query
stringlengths 7
9.55k
| document
stringlengths 10
363k
| metadata
dict | negatives
sequencelengths 0
101
| negative_scores
sequencelengths 0
101
| document_score
stringlengths 3
10
| document_rank
stringclasses 102
values |
---|---|---|---|---|---|---|
Using the options build when the commandline was parsed, instantiate a new Capistrano configuration, initialize it, and execute the requested actions. Returns the Configuration instance used, if successful. | def execute!
config = instantiate_configuration(options)
config.debug = options[:debug]
config.dry_run = options[:dry_run]
config.preserve_roles = options[:preserve_roles]
config.logger.level = options[:verbose]
set_pre_vars(config)
load_recipes(config)
config.trigger(:load)
execute_requested_actions(config)
config.trigger(:exit)
config
rescue Exception => error
handle_error(error)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def instantiate_configuration(options={}) #:nodoc:\n Capistrano::Configuration.new(options)\n end",
"def instantiate_configuration(options={})\n config = Capistrano::Configuration.new(options)\n config.logger = logger\n config\n end",
"def execute!\n config = instantiate_configuration\n config.logger.level = options[:verbose]\n config.load 'deploy'\n\n status = catch(:abort_called_by_capistrano){\n set_webistrano_logger(config)\n \n set_up_config(config)\n \n exchange_real_revision(config) unless (config.fetch(:scm).to_s == 'git') # git cannot do a local query by default\n save_revision(config)\n save_pid\n \n config.trigger(:load)\n execute_requested_actions(config)\n config.trigger(:exit)\n }\n \n if status == :capistrano_abort\n false\n else\n config\n end\n rescue Exception => error\n handle_error(error) \n return false\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 execute\n Tools.public_send(command, options.configuration_path)\n end",
"def parse_options! #:nodoc:\n @options = { :recipes => [], :actions => [],\n :vars => {}, :pre_vars => {},\n :sysconf => default_sysconf, :dotfile => default_dotfile }\n\n if args.empty?\n warn \"Please specify at least one action to execute.\"\n warn option_parser\n exit\n end\n\n option_parser.parse!(args)\n\n coerce_variable_types!\n\n # if no verbosity has been specified, be verbose\n options[:verbose] = 3 if !options.has_key?(:verbose)\n\n look_for_default_recipe_file! if options[:default_config] || options[:recipes].empty?\n extract_environment_variables!\n\n options[:actions].concat(args)\n\n password = options.has_key?(:password)\n options[:password] = Proc.new { self.class.password_prompt }\n options[:password] = options[:password].call if password\n end",
"def new_capistrano_config(opts=@opts)\n c = Capistrano::Configuration.new(opts)\n # NOTE: Capistrano::Logger constant values are opposite of Logger ....goofy\n c.logger.level = opts[:log_level] || Capistrano::Logger::DEBUG\n @@load_paths.each {|d| c.load_paths << d }\n Array(opts[:load_paths]).flatten.each {|d| c.load_paths << d } if opts[:load_paths]\n return c\n end",
"def configure_command\n load_configuration_file\n return false unless determine_products_to_parse\n return false unless determine_product_version_to_parse\n\n determine_number_of_attempts\n setup_destination_directory\n Workers.pool.resize(10)\n true\n end",
"def run_actions\n # List vhosts\n if ( @options[:actions].include?(:web_server) || @options[:actions].include?(:list_vhosts))\n @nginx = Cheese::Nginx::Config.new(NGINX_CONF)\n end\n \n if @options[:actions].include? :list_vhosts\n Cheese::Verbose.log_task(\"listing vhosts in nginx.conf\") do\n begin\n @nginx.domains.each_with_index {|domain, i| puts \"#{i}. #{domain.vhost.domain} - #{domain.proxy.ports.size} threads\" }\n rescue Exception => e\n puts \"Error listing vhosts:\"\n puts e.message\n puts \"exiting\"\n exit\n end\n end\n end\n\n # Nginx\n if @options[:actions].include? :web_server\n begin\n Cheese::Verbose.log_task(\"back up nginx.conf\") do\n FileUtils.cp(NGINX_CONF, NGINX_CONF + \".old\") if File.exists?(NGINX_CONF)\n end\n rescue Errno::EPERM\n puts \"This script must be run with root privileges\"\n exit\n rescue Errno::EACCES\n puts \"This script must be run with root privileges\"\n exit\n end\n \n case @options[:remove]\n when false\n Cheese::Verbose.log_task(\"create nginx vhost (#{@options[:name]})\") do\n @added_domain = @nginx.add @options\n end\n when true\n Cheese::Verbose.log_task(\"remove nginx vhost (#{@options[:name]})\") do \n @removed_domain = @nginx.remove @options\n end\n end\n \n @nginx.save\n @nginx.restart\n end\n \n # Subversion\n if @options[:actions].include? :scm\n if @options[:remove]\n Cheese::Verbose.log_task(\"remove subversion repository (#{@options[:name]})\") do\n svn = Cheese::Subversion::Repository.remove @options[:name]\n end\n else\n Cheese::Verbose.log_task(\"add subversion repository (#{@options[:name]})\") do\n svn = Cheese::Subversion::Repository.create @options[:name]\n end\n Cheese::Verbose.log_task(\"set the default permissions on the repository\") do\n user, pass = @preferences[:scm_user].chomp, @preferences[:scm_pass].chomp\n Cheese::Subversion::Repository.set_permissions( :name => @options[:name],\n :access => {:anon => :none, :auth => :write},\n :users => {:user => user, :pass => pass})\n end\n end\n end\n\n # Mongrel cluster file\n if @options[:actions].include? :app_server\n if @options[:remove]\n Cheese::Verbose.log_task(\"remove the mongrel_cluster file\") do\n Cheese::Mongrel.remove(@removed_domain)\n end\n else\n Cheese::Verbose.log_task(\"create the mongrel_cluster file\") do\n Cheese::Mongrel.create(@options[:name], @added_domain.proxy.ports)\n end\n end\n end\n \n # Database\n if @options[:actions].include? :database\n if @options[:remove]\n Cheese::Verbose.log_task(\"drop a database\") do\n Cheese::Verbose.log_task(\" requiring lib/#{@options[:database_type]}\")\n require \"database/#{@options[:database_type]}\"\n Cheese::Verbose.log_task(\" creating class #{@options[:database_type].to_s.capitalize}\")\n db_klass = Cheese.const_get(@options[:database_type].to_s.capitalize.intern)\n Cheese::Verbose.log_task(\" executing remove command on #{@options[:name]}\")\n db_klass.remove(@options[:name])\n end\n else\n Cheese::Verbose.log_task(\"create a database\") do\n Cheese::Verbose.log_task(\" requiring lib/#{@options[:database_type]}\")\n require \"database/#{@options[:database_type]}\"\n Cheese::Verbose.log_task(\" creating class #{@options[:database_type].to_s.capitalize}\")\n db_klass = Cheese.const_get(@options[:database_type].to_s.capitalize.intern)\n Cheese::Verbose.log_task(\" executing create command\")\n db_klass.create(@options[:name])\n end\n end\n end\n end",
"def init_config(options={})\n options = options.to_symbol_keys\n\n if !options[:method]\n abort \"Please provide a deployment method. e.g. #{METHODS.keys}\"\n end\n\n @options = DEFAULT_OPTIONS.deep_merge(options)\n write_config\n check_gitignore\n end",
"def build options\n $conf.machine_name = options.shift\n return say(Help.new.syntax) unless $conf.machine_name\n init\n @core.package 'Machinesfile'\n\n @core.task options if options.any?\n\n ssh_options = {:paranoid => false}\n if $conf.machine.cloud\n username = $conf.machine.cloud.username\n ssh_options[:keys] = [$conf.machine.cloud.private_key_path]\n else\n username = $conf.machine.user\n ssh_options[:password] = $conf.password\n end\n\n if $conf.log_only\n $conf.commands.each do |command|\n command.run\n end\n else\n Kernel.trap(\"INT\") { prepare_to_exit }\n begin\n Command.ssh = Net::SSH.start $conf.machine.address, username, ssh_options\n Command.scp = Net::SCP.new(Command.ssh)\n $conf.commands.each do |command|\n command.run\n Command.file.flush\n exit if $exit_requested\n end\n rescue Errno::ETIMEDOUT => e\n say e.message\n say 'Check the IP address in machines.yml'\n ensure\n Command.ssh.close if Command.ssh\n end\n end\n end",
"def configure\n run_with_failure_handler(\"cd #{@extracted_path} ; ./configure #{options[:config_options] || ''}\", 'configure')\n end",
"def remote_deploy(options={})\n @cartridge_model.do_control('update-configuration',\n @cartridge_model.primary_cartridge,\n pre_action_hooks_enabled: false,\n post_action_hooks_enabled: false,\n out: options[:out],\n err: options[:err])\n\n deploy(options)\n\n if options[:init]\n primary_cart_env_dir = PathUtils.join(@container_dir, @cartridge_model.primary_cartridge.directory, 'env')\n primary_cart_env = ::OpenShift::Runtime::Utils::Environ.load(primary_cart_env_dir)\n ident = primary_cart_env.keys.grep(/^OPENSHIFT_.*_IDENT/)\n _, _, version, _ = Runtime::Manifest.parse_ident(primary_cart_env[ident.first])\n\n @cartridge_model.post_install(@cartridge_model.primary_cartridge,\n version,\n out: options[:out],\n err: options[:err])\n\n end\n end",
"def parse\n options = {}\n options.merge(parse_config_file(CONFIG_LOCATION))\n\n argv = parse_argv\n if argv[:config_file].kind_of?(String)\n options.merge(parse_config_file(argv[:config_file]))\n end\n\n options.merge(argv)\n end",
"def instantiate_configuration #:nodoc:\n config = Webistrano::Configuration.new\n config.logger = logger\n config\n end",
"def cap_config\n @cap_config ||= Sauce.instance.new_capistrano_config()\n end",
"def configure(argv = ARGV)\n # => Parse CLI Configuration\n cli = Options.new\n cli.parse_options(argv)\n\n # => Parse JSON Config File (If Specified and Exists)\n json_config = Util.parse_json(cli.config[:config_file] || Config.config_file)\n\n # => Merge Configuration (CLI Wins)\n config = [json_config, cli.config].compact.reduce(:merge)\n\n # => Apply Configuration\n config.each { |k, v| Config.send(\"#{k}=\", v) }\n end",
"def configure\n\n # config file default options\n configuration = {\n :options => {\n :verbose => false,\n :color => 'AUTO'\n }\n }\n\n # set default config if not given on command line\n config = @options[:config]\n unless config\n config = [\n File.join(@working_dir, \"oct.conf\"),\n File.join(@working_dir, \".oct.conf\"),\n File.join(@working_dir, \"config\", \"oct.conf\"),\n File.expand_path(File.join(\"~\", \".oct.conf\"))\n ].detect { |filename| File.exists?(filename) }\n end\n\n if config && File.exists?(config)\n # rewrite options full path for config for later use\n @options[:config] = config\n\n # load options from the config file, overwriting hard-coded defaults\n config_contents = YAML::load(File.open(config))\n configuration.merge!(config_contents.symbolize_keys!) if config_contents && config_contents.is_a?(Hash)\n else\n # user specified a config file?, no error if user did not specify config file\n raise \"config file not found\" if @options[:config]\n end\n\n # the command line options override options read from the config file\n @options = configuration[:options].symbolize_keys!.merge!(@options)\n\n end",
"def action_command\n Command.new(serverside_command_path, @serverside_version, *task) do |cmd|\n given_applicable_options = given_options & applicable_options\n given_applicable_options.each do |option|\n cmd.argument(option.type, option.to_switch, @arguments[option.name])\n end\n end\n end",
"def control(options)\n fail(\"No action specified on the command line.\") unless (options[:action] || options[:requires_network_config])\n name = options[:name]\n parameters = options[:parameters] || []\n only_if = options[:only_if]\n verbose = options[:verbose]\n\n # support either single or a comma-delimited list of actions to execute\n # sequentially (e.g. \"--action clear_state,wait_for_instance_ready,write_user_metadata\")\n # (because we need to split bootstrap actions up in Windows case).\n actions = options[:action].to_s.split(',').inject([]) do |result, action|\n unless (action = action.strip).empty?\n action = action.to_sym\n case action\n when :bootstrap\n # bootstrap is shorthand for all standard actions performed on boot\n result += [:clear_state, :wait_for_instance_ready, :write_cloud_metadata, :write_user_metadata, :wait_for_eip]\n only_if = true\n else\n result << action\n end\n end\n result\n end\n\n cloud = CloudFactory.instance.create(name, :logger => default_logger(verbose))\n\n actions.each do |action|\n if cloud.respond_to?(action)\n # Expect most methods to return ActionResult, but a cloud can expose any\n # custom method so we can't assume return type\n result = cloud.send(action, *parameters)\n $stderr.puts result.error if result.respond_to?(:error) && result.error\n $stdout.puts result.output if verbose && result.respond_to?(:output) && result.output\n\n if result.respond_to?(:exitstatus) && (result.exitstatus != 0)\n raise StandardError, \"Action #{action} failed with status #{result.exitstatus}\"\n end\n elsif only_if\n next\n else\n raise ArgumentError, \"ERROR: Unknown cloud action: #{action}\"\n end\n end\n if options[:requires_network_config]\n exit(cloud.requires_network_config? ? 0 : 1)\n end\n end",
"def parse_options\n @options = {\n :environment => 'production',\n :config_path => ENV['CLOUD_CROWD_CONFIG'] || '.',\n :daemonize => false\n }\n @option_parser = OptionParser.new do |opts|\n opts.on('-c', '--config PATH', 'path to configuration directory') do |conf_path|\n @options[:config_path] = conf_path\n end\n opts.on('-p', '--port PORT', 'port number for server (central or node)') do |port_num|\n @options[:port] = port_num\n end\n opts.on('-e', '--environment ENV', 'server environment (defaults to production)') do |env|\n @options[:environment] = env\n end\n opts.on('-d', '--daemonize', 'run as a background daemon') do |daemonize|\n @options[:daemonize] = daemonize\n end\n opts.on('--days NUM_DAYS', 'grace period before cleanup (7 by default)') do |days|\n @options[:days] = days.to_i if days.match(/\\A\\d+\\Z/)\n end\n opts.on_tail('-v', '--version', 'show version') do\n require \"#{CC_ROOT}/lib/cloud-crowd\"\n puts \"CloudCrowd version #{VERSION}\"\n exit\n end\n end\n @option_parser.banner = BANNER\n @option_parser.parse!(ARGV)\n end",
"def run\n case action\n when 'new'\n require_relative('templater')\n Templater.new(File.expand_path(directory, Dir.pwd), settings).run!\n when 'console'\n require_relative('console')\n Wukong::Deploy::Console.new.run!\n end\n end",
"def start\n puts options\n config = Configuration.new(options)\n puts config.build\n exit(0)\n end",
"def configure_backdat\n @commands = parse_options\n\n begin\n ::File.open(config[:config_file]) { |f| apply_config(f.path) }\n rescue Errno::ENOENT => error\n msg = \"Did not find the config file: #{config[:config_file]}\"\n msg << \", Using command line options.\"\n Backdat::Log.warn \"*****************************************\"\n Backdat::Log.warn msg\n Backdat::Log.warn \"*****************************************\"\n end\n end",
"def parse_arguments\n @command_line_options = {}\n @config.insert 0, '<command_line>', @command_line_options\n\n @options = OptionParser.new do |opts|\n opts.on('-a', '--application STRING', 'set application name') do |application|\n @command_line_options[:application] = application\n end\n\n opts.on('-d', '--destination DIR', 'set destination directory', \"default: #{@config[:destination_directory]}\") do |directory|\n @command_line_options[:destination_directory] = directory\n end\n\n opts.on('-n', '--dryrun', 'do not switch') do\n @command_line_options[:dryrun] = true\n end\n\n opts.on('-V', '--version STRING', 'set application version to deploy') do |version|\n @command_line_options[:version] = version\n end\n end\n @options.parse!\n end",
"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 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 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 configure_and_run(params = [])\n config_file = Configuration::DEFAULT_CONFIG_FILE_NAME\n tmp_config = Configuration.new\n action_wizard = false\n\n parser = OptionParser.new do |opts|\n opts.banner = if ENV['OCRA_EXECUTABLE']\n \"Usage: #{ENV['OCRA_EXECUTABLE'].gsub(\"#{Dir.pwd}/\".gsub('/', '\\\\'), '')} [options]\"\n else\n \"Usage: #{Gem.ruby} #{$PROGRAM_NAME} [options]\"\n end\n\n opts.on('-c', '--config CONFIG_FILE_NAME', 'Specify custom configuration file,'\\\n \" instead of #{Configuration::DEFAULT_CONFIG_FILE_NAME}.\") do |file_name|\n config_file = file_name\n end\n\n opts.on('-r', '--register FILE', 'Register a custom plugin, e.g. your own Datasource implementation') do |plugin|\n require plugin\n end\n\n opts.on('-d', '--debug LEVEL', 'Specify detail level: FATAL, ERROR, WARN, INFO, DEBUG.') do |level|\n tmp_config.set_param('grafana-reporter:debug-level', level)\n end\n\n opts.on('-o', '--output FILE', 'Output filename if only a single file is rendered') do |file|\n tmp_config.set_param('to_file', file)\n end\n\n opts.on('-s', '--set VARIABLE,VALUE', Array, 'Set a variable value, which will be passed to the '\\\n 'rendering') do |list|\n raise ParameterValueError, list.length unless list.length == 2\n\n tmp_config.set_param(\"default-document-attributes:#{list[0]}\", list[1])\n end\n\n opts.on('--ssl-cert FILE', 'Manually specify a SSL cert file for HTTPS connection to grafana. Only '\\\n 'needed if not working properly otherwise.') do |file|\n if File.file?(file)\n tmp_config.set_param('grafana-reporter:ssl-cert', file)\n else\n config.logger.warn(\"SSL certificate file #{file} does not exist. Setting will be ignored.\")\n end\n end\n\n opts.on('--test GRAFANA_INSTANCE', 'test current configuration against given GRAFANA_INSTANCE') do |instance|\n tmp_config.set_param('grafana-reporter:run-mode', 'test')\n tmp_config.set_param('grafana-reporter:test-instance', instance)\n end\n\n opts.on('-t', '--template TEMPLATE', 'Render a single ASCIIDOC template to PDF and exit') do |template|\n tmp_config.set_param('grafana-reporter:run-mode', 'single-render')\n tmp_config.set_param('default-document-attributes:var-template', template)\n end\n\n opts.on('-w', '--wizard', 'Configuration wizard to prepare environment for the reporter.') do\n action_wizard = true\n end\n\n opts.on('-v', '--version', 'Version information') do\n puts GRAFANA_REPORTER_VERSION.join('.')\n return -1\n end\n\n opts.on('-h', '--help', 'Show this message') do\n puts opts\n return -1\n end\n end\n\n begin\n parser.parse!(params)\n return ConsoleConfigurationWizard.new.start_wizard(config_file, tmp_config) if action_wizard\n rescue ApplicationError => e\n puts e.message\n return -1\n end\n\n # abort if config file does not exist\n unless File.file?(config_file)\n puts \"Config file '#{config_file}' does not exist. Consider calling the configuration wizard\"\\\n ' with option \\'-w\\' or use \\'-h\\' to see help message. Aborting.'\n return -1\n end\n\n # merge command line configuration with read config file\n @config.load_config_from_file(config_file)\n @config.merge!(tmp_config)\n\n run\n end",
"def setup_options\n parser = OptionParser.new do |o|\n o.banner = 'Usage: bundle exec qpush-server [options]'\n\n o.on('-c', '--config PATH', 'Load PATH for config file') do |arg|\n load(arg)\n Server.log.info(\"* Server config: #{arg}\")\n end\n\n o.on('-h', '--help', 'Prints this help') { puts o && exit }\n end\n parser.parse!(@argv)\n end",
"def parse_context\n return if @config['repository'] && @config['command'] && @config['role']\n\n @options['command'] = ARGV[0] unless @options['command']\n\n parse_role(@options['role']) unless @options['role'].nil?\n\n @options['repository'] = reverse_parse_role_to_repository(@options['role']) unless @options['role'].nil?\n\n parse_repository(@options['repository'])\n\n parse_node_name(@options['node_name']) if @options['node_name']\n\n parse_address(@options['address']) if @options['address']\n\n parse_and_set_deploy_args if @options['target_revision'] || @options['deploy_organization'] || @options['unset_github_deploy_args']\n end",
"def initialize options = {}\n require 'aws/ec2'\n\n options.each_key do | key |\n raise ArgumentError, \"unrecognized option \\'#{key}\\'\" unless RECOGNIZED_OPTIONS.include? key\n end\n \n @ec2 = options[ :instance ]\n @start_options = options[ :start_options ] || {}\n \n if @ec2 \n puts \"\\'credentials\\' ignored as an instance was given too\" if options.key? :credentials\n else\n ::AWS.config( options[ :credentials ] )\n \n @ec2 = ::AWS::EC2.new\n @ec2 = @ec2.regions[ options[ :region ] ] if options.key? :region\n end\n end",
"def config(target, options={}, &block)\n #options[:profile] = (options[:profile] || 'default').to_s\n #options[:command] = command.to_s unless options.key?(:command)\n #options[:feature] = command.to_s unless options.key?(:feature)\n #command = options[:command].to_s\n\n # IDEA: other import options such as local file?\n\n configs_from(options).each do |c|\n @_config[target.to_s] << c.copy(options)\n end\n\n return unless block\n\n @_config[target.to_s] << Config.new(target, options, &block)\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 run!\n\t\t\topts=OptionParser.new\n\n\t\t\topts.banner = \"Usage: #{$0} [options] action\\n action is one of init, build, install, uninstall, info, status, diff\"\n\n\t\t\topts.separator \"\"\n\t\t\topts.separator \"install options:\"\n\n\t\t\topts.on(\"-o\", \"--[no-]overwrite\", \"Overwrite existing files (a backup will be created)\") { |v| @options[:overwrite] = v }\n\n\t\t\topts.separator \"\"\n\t\t\topts.separator \"build options:\"\n\n\t\t\topts.on(\"-r\", \"--[no-]rebuild\", \"Build even if the built file is current\") { |v| @options[:rebuild] = v }\n\n\t\t\topts.separator \"\"\n\t\t\topts.separator \"Common options:\"\n\n\t\t\topts.on(\"-h\", \"--help\" , \"Show this message\") { puts opts ; exit }\n\t\t\topts.on( \"--version\", \"Show version\" ) { puts VERSION; exit }\n\n\t\t\tbegin\n\t\t\t\topts.parse!\n\t\t\trescue OptionParser::InvalidOption => ex\n\t\t\t\tputs ex.message\n\t\t\t\treturn\n\t\t\tend\n\n\t\t\taction=ARGV[0]||\"\"\n\n\t\t\tcase action.downcase\n\t\t\t\twhen \"init\" then Coffle.init! @repository, @options\n\t\t\t\twhen \"build\" then instance_action=:build\n\t\t\t\twhen \"install\" then instance_action=:install\n\t\t\t\twhen \"uninstall\"then instance_action=:uninstall\n\t\t\t\twhen \"info\" then instance_action=:info\n\t\t\t\twhen \"status\" then instance_action=:status\n\t\t\t\twhen \"diff\" then instance_action=:diff\n\t\t\t\telse puts opts # Output the options help message\n\n\t\t\tend\n\n\t\t\tif instance_action\n\t\t\t\tcoffle=Coffle.new(@repository, @target, @options)\n\n\t\t\t\tcase instance_action\n\t\t\t\twhen :build then coffle.build! @options\n\t\t\t\twhen :install then coffle.install! @options\n\t\t\t\twhen :uninstall then coffle.uninstall! @options\n\t\t\t\twhen :info then coffle.info! @options\n\t\t\t\twhen :status then coffle.status! @options\n\t\t\t\twhen :diff then coffle.diff! @options\n\t\t\t\tend\n\n\t\t\t\tcoffle.write_status\n\t\t\t\tcoffle.write_target_status\n\t\t\tend\n\t\tend",
"def initialize(options = {})\n @build_command = options.delete(:build_command)\n @spec_command = options.delete(:spec_command) \n @verbose = options.has_key?(:verbose) ? options.delete(:verbose) : false\n @update = options.has_key?(:update) ? options.delete(:update) : false\n @spec = options.has_key?(:spec) ? options.delete(:spec) : true\n @app_root = options.delete(:app_root)\n super\n end",
"def config(action, *args); end",
"def cops_init(opts)\n cwd = opts.fetch(:cwd, nil)\n cops_path = opts.fetch(:cops_path, nil)\n cops_playbooks = opts.fetch(:cops_playbooks, nil)\n cfg = opts.fetch(:cfg, nil)\n if cfg.nil?\n cfg = Hash.new\n end\n if cwd.nil?\n cwd = Dir.pwd\n end\n if cops_path.nil?\n tf = File.absolute_path(__FILE__)\n cops_path = File.dirname(tf)\n end\n if cops_playbooks.nil?\n cops_playbooks = File.join(\n cops_path, 'roles/corpusops.roles/playbooks')\n end\n cfg['CWD'] = cwd\n cfg['SCWD'] = cfg['CWD'].gsub(/\\//, '_').slice(1..-1)\n # Number of machines to spawn\n cfg.setdefault('COPS_BRANCH', \"master\")\n # see bellow for cfg['COPS_INSTALLER']\n # see bellow for cfg['COPS_SYNCER']\n #\n cfg.setdefault('COPS_ROOT', cops_path)\n cfg.setdefault('COPS_PLAYBOOKS', cops_playbooks)\n cfg['COPS_VAGRANT_DIR'] = File.join(cfg['COPS_ROOT'], 'hacking/vagrant')\n cfg['COPS_REL_ROOT'] = Pathname.new(cfg['COPS_ROOT']).relative_path_from(\n Pathname.new(cfg['CWD'])).to_s\n cfg['COPS_REL_PLAYBOOKS'] = Pathname.new(cfg['COPS_PLAYBOOKS']).relative_path_from(\n Pathname.new(cfg['CWD'])).to_s\n cfg['COPS_REL_VAGRANT_DIR'] = Pathname.new(cfg['COPS_VAGRANT_DIR']).relative_path_from(\n Pathname.new(cfg['CWD'])).to_s\n #\n cfg.setdefault('UNAME', `uname`.strip)\n #\n cfg.setdefault('DEBUG', !ENV.fetch(\"COPS_DEBUG\", \"\").empty?)\n cfg.setdefault('SKIP_CONFIGURE_NET', nil)\n cfg.setdefault('SKIP_SYNC', nil)\n cfg.setdefault('SKIP_PLAY_PLAYBOOKS', nil)\n cfg.setdefault('SKIP_ROOTSSHKEYS_SYNC', nil)\n cfg.setdefault('SKIP_INSTALL_SSHFS', nil)\n cfg.setdefault('SKIP_CLEANUP', nil)\n cfg.setdefault('SKIP_APT_CLEANUP', nil)\n # IP managment\n # The box used a default NAT private IP and a HOST only if\n # defined automatically by vagrant and virtualbox\n cfg.setdefault('DNS_SERVERS', '8.8.8.8')\n # Subnet\n cfg.setdefault(\"PRIVATE_NETWORK_PREF\", \"192.168\")\n # Number of the first machine to provision\n cfg.setdefault('CLUSTER_NUM', 4)\n # Number of machines to spawn\n cfg.setdefault('MACHINES', 1)\n cfg.setdefault('MACHINE_NUM_START', 1)\n # Per Machine resources quotas\n cfg.setdefault('DOMAIN', 'vbox.local')\n cfg.setdefault('MEMORY', 3096)\n cfg.setdefault('CPUS', 1)\n cfg.setdefault('MAX_CPU_USAGE_PERCENT', 97)\n cfg.setdefault('AUTO_UPDATE_VBOXGUEST_ADD', true)\n # OS\n cfg.setdefault('OS', 'Ubuntu')\n cfg.setdefault('APT_MIRROR', 'http://mirror.ovh.net/ftp.ubuntu.com/ubuntu/')\n cfg.setdefault('APT_PROXY', '')\n # MAKINA STATES CONFIGURATION\n cfg.setdefault('SERIAL', [\"disconnected\"])\n cfg.setdefault('HOST_MOUNTPOINT', \"/host\")\n # extra provision, value in dictionnary can be either a file or a hash containing ansible variables\n cfg['PLAYBOOKS'] = {\n \"default\" => [\n {\"#{cfg['COPS_REL_PLAYBOOKS']}/provision/vagrant/net.yml\" => {\n :raw_arguments => [\"--flush-cache\"]}},\n {\"#{cfg['COPS_REL_PLAYBOOKS']}/provision/vagrant/pkgmgr.yml\" => {\n :raw_arguments => [\"--flush-cache\"]}},\n {\"#{cfg['COPS_REL_PLAYBOOKS']}/provision/vagrant/locales.yml\" => {\n :raw_arguments => [\"--flush-cache\"]}},\n {\"#{cfg['COPS_REL_PLAYBOOKS']}/provision/vagrant/timezone.yml\" => {\n :raw_arguments => [\"--flush-cache\"]}},\n {\"#{cfg['COPS_REL_PLAYBOOKS']}/provision/vagrant/sync_sshkeys.yml\" => {\n :raw_arguments => [\"--flush-cache\"]}},\n {\"#{cfg['COPS_REL_PLAYBOOKS']}/provision/vagrant/sshfs.yml\" => {}},\n ],\n \"post_default\" => [\n {\"#{cfg['COPS_REL_PLAYBOOKS']}/provision/vagrant/cleanup.yml\" => {}},\n ]\n }\n\n # load settings from a local file in case\n localcfg = Hash.new\n yaml_config = \"#{cfg['CWD']}/vagrant_config.yml\"\n if File.exist?(yaml_config)\n localcfg = YAML.load_file(yaml_config)\n if ! localcfg then localcfg = Hash.new end\n end\n cfg = cfg.merge(localcfg)\n # per machine overrides\n machines_cfg = cfg.setdefault('MACHINES_CFG', {})\n\n cfg.setdefault(\n 'MACHINES_RANGE',\n (cfg['MACHINE_NUM_START'].to_i..\n cfg['MACHINE_NUM_START'].to_i+cfg['MACHINES'].to_i-1).to_a)\n\n # OS/BOX SELECTION\n case cfg['OS']\n when /centos/i\n cfg.setdefault('OS_RELEASE', '7')\n cfg.setdefault(\"BOX\", \"centosorg#{cfg['OS_RELEASE']}64\")\n cfg.setdefault('BOX_URI',\n \"http://cloud.centos.org/centos/#{cfg['OS_RELEASE']}/\"\\\n \"vagrant/x86_64/images/CentOS-#{cfg['OS_RELEASE']}.box\")\n when /debian/i\n cfg.setdefault('OS_RELEASE', 'sid')\n else\n cfg.setdefault('OS_RELEASE', 'xenial')\n case cfg['OS_RELEASE']\n when /trusty|vivid/i\n cfg.setdefault(\"BOX\", \"ubuntu/#{cfg['OS_RELEASE']}64\")\n cfg.setdefault(\"BOX_URI\", nil)\n else\n cfg.setdefault(\"BOX\", \"ubuntuorg#{cfg['OS_RELEASE']}64\")\n cfg.setdefault(\"BOX_URI\",\n \"https://cloud-images.ubuntu.com/\"\\\n \"#{cfg['OS_RELEASE']}/current/\"\\\n \"#{cfg['OS_RELEASE']}-server-cloudimg-amd64-vagrant.box\")\n end\n end\n\n # Computed variables\n cfg.setdefault('COPS_REL_ROOT', cfg['COPS_ROOT'])\n cfg.setdefault('COPS_REL_VAGRANT_DIR', cfg['COPS_VAGRANT_DIR'])\n cfg.setdefault('HOSTNAME_PRE', \"corpusops#{cfg['CLUSTER_NUM']}\")\n cfg.setdefault('VB_NAME_PRE', \"#{cfg['HOSTNAME_PRE']}\")\n cfg.setdefault('VB_NAME_POST', \"#{cfg['OS']} #{cfg['OS_RELEASE']}64\")\n cfg.setdefault(\n \"COPS_INSTALLER\",\n \"#{cfg['COPS_REL_ROOT']}/bin/install.sh -b #{cfg['COPS_BRANCH']} -C -S\")\n cfg.setdefault(\n \"COPS_SYNCER\",\n \"#{cfg['COPS_REL_ROOT']}/bin/install.sh -b #{cfg['COPS_BRANCH']} -C -s\")\n\n # SHARED FOLDERS\n cfg.setdefault('mountpoints', {cfg['CWD'] => cfg['HOST_MOUNTPOINT']})\n cfg.setdefault('PRIVATE_IP_START', cfg['MACHINE_NUM_START'])\n if File.exists? \".ansible/scripts/call_ansible.sh\"\n playbook_command = \".ansible/scripts/call_ansible.sh\"\n else\n playbook_command = \"#{cfg['COPS_ROOT']}/hacking/deploy/call_ansible.sh\"\n end\n\n cfg.setdefault(\"PLAYBOOK_COMMAND\", playbook_command)\n # save back config to yaml (mainly for persiting corpusops)\n File.open(\"#{yaml_config}\", 'w') {|f| f.write localcfg.to_yaml }\n # Generate each machine configuration mappings\n private_ip = 0\n cfg['MACHINES_RANGE'].each do |machine_num|\n private_ip += 1\n cfg.each do |key, val|\n if FORWARDED_MACHINE_KEYS.include? key\n machine_config(cfg, machine_num, key)\n elsif key.start_with? 'SKIP_'\n machine_config(cfg, machine_num, key)\n end\n end\n machine_cfg = machines_cfg.setdefault(machine_num, {})\n machine_config(cfg, machine_num, 'CLUSTER_NUM', cfg['CLUSTER_NUM'])\n machine_config(cfg, machine_num, 'MACHINE_NUM', machine_num)\n machine_config(cfg, machine_num, 'PLAYBOOKS',\n cfg['PLAYBOOKS'].fetch(\n machine_num, cfg['PLAYBOOKS']['default']))\n machine_config(cfg, machine_num, 'POST_PLAYBOOKS',\n cfg['PLAYBOOKS'].fetch(\n \"#{machine_num}_post\", cfg['PLAYBOOKS']['post_default']))\n machine_config(cfg, machine_num, 'HOSTNAME', \"#{cfg['HOSTNAME_PRE']}-#{machine_num}\")\n machine_config(cfg, machine_num, 'FQDN', \"#{machine_cfg['HOSTNAME']}.#{machine_cfg['DOMAIN']}\")\n machine_config(cfg, machine_num, 'VB_NAME',\n \"#{cfg['VB_NAME_PRE']}\" \\\n \" #{machine_num}\" \\\n \" #{cfg['VB_NAME_POST']}(#{cfg['SCWD']})\")\n ssh_username = cfg.setdefault('SSH_USERNAME', \"vagrant\")\n # not on the new base boxes ... omg\n #if ['xenial'].include? machine_cfg['OS_RELEASE']\n # ssh_username = \"ubuntu\"\n #end\n machine_config(cfg, machine_num, 'SSH_USERNAME', ssh_username)\n machine_config(cfg, machine_num,\n 'PRIVATE_NETWORK_NUM',\n \"#{machine_cfg['CLUSTER_NUM'].to_i}\")\n machine_config(cfg, machine_num, 'PRIVATE_NETWORK',\n \"#{machine_cfg['PRIVATE_NETWORK_PREF']}.\" \\\n \"#{machine_cfg['PRIVATE_NETWORK_NUM']}\")\n machine_config(cfg, machine_num, 'PRIVATE_IP',\n \"#{machine_cfg['PRIVATE_NETWORK']}.\" \\\n \"#{cfg['PRIVATE_IP_START']+private_ip}\")\n skip = []\n force = []\n [machine_cfg, ENV].each do |mapping|\n mapping.each do |k, v|\n if k.start_with? 'FORCE_'\n force.push(k)\n skip.push(\"SKIP_\"+k[6..-1])\n end\n if k.start_with? 'SKIP_'\n force.push(\"FORCE_\"+k[5..-1])\n skip.push(k)\n end\n end\n end\n [skip, force].each do |col|\n col.each do |k|\n machine_cfg.setdefault(k, ENV.fetch(k, cfg.fetch(k, false)))\n end\n end\n end\n return cfg\nend",
"def go(argv)\n logger.debug(\"Using args passed in: #{argv.inspect}\")\n\n cmd = nil\n\n @optparse = OptionParser.new do |opts|\n cmd = super(argv, opts, @config)\n\n opts.on('-v', '--version', 'Print the version') do\n puts \"#{name} #{version}\"\n abort\n end\n end\n\n @optparse.parse!(argv)\n\n logger.debug(\"Parsed config: #{@config.inspect}\")\n\n cmd.execute(argv, @config)\n end",
"def initialize\n @options = {}\n # Populate the @options hash, if and only if\n # hadooken started directly by its own command.\n # The reason is, ARGV can be populated by puma\n # or rspec configuration options and this options\n # can be unrecognized by Hadooken and will lead\n # an exception in OptionParser.\n parser.parse! if Kernel.const_defined?(:HADOOKEN)\n @options[:config_file] ||= DEFAULT_CONFIG_FILE if File.exist?(DEFAULT_CONFIG_FILE)\n parse_config_file if @options[:config_file]\n end",
"def initialize(config, options)\n # step: setup the variable\n @options = options\n @rules = OptionsDSL::Rules::new\n @config = config\n # step: lets validate the config\n @config = validate_config @config\n # step: lets load the command line dsl\n load_options\n # step: we need to generate the parser\n @generate = OptionsDSL::Generate::new @rules, @options\n # step: return the options\n end",
"def run_cmd(command_class, args) \n command = command_class.new(args)\n command.config[:config_file] = config[:config_file]\n command.configure_chef\n command.run\n \n command\n end",
"def deploy?; run_options[:deploy]; end",
"def execute\n @executed = true\n if @autoconf\n Rscons.application.check_configure\n Rscons.application.check_process_environments\n end\n @dependencies.each do |dependency|\n Task[dependency].check_execute\n end\n if @name == \"configure\"\n Rscons.application.silent_configure = false\n Rscons.application.configure\n else\n @actions.each do |action|\n action[self, param_values]\n end\n end\n end",
"def initialize(argv=[], openstack_server_create=OpenstackServerCreate.new)\n super(argv) # Thanks, mixlib-cli\n\n # This loads the config\n configure_chef\n\n @profiles = YAMLProfiles.new(config[:yaml_config])\n @openstack_server_create = openstack_server_create\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 perform_deployment\n \tself.started_at = Time.now \t\n \tline = Cocaine::CommandLine.new(\"cd /home/mohkhan.Desktop/SFDC_DeplomentScripts && perl fetch_and_deploy.pl -r #{self.release} -d <#{self.target_config_name}> --mode=#{self.mode}\")\n \tline.run\n \tself.ended_at = Time.now\n \tself.status = \"deployed\"\n \tself.save\n end",
"def run!\n @application.load_configuration_file_or_read_the_options!(@options)\n case\n when options.include?(:show_heuristics?)\n list_heuristics!\n when options.include?(:generate_file)\n Generator.new(options)\n else\n @application.run_global_commands!\n start_continuous_testing!\n end\n end",
"def initialize(options={})\n # Thor::Base.initialize(args = [], local_options = {}, config = {}) <= original signature\n options[:force] = options[:yes]\n super([], options)\n self.destination_root = Dir.pwd # Thor::Actions require destination_root to be set\n end",
"def perform\n validate_system_config\n\n deployment_name = \"#{system_config.system_name}-core\"\n\n manifest = base_manifest(\n deployment_name,\n bosh_config.target_uuid,\n system_config.bosh_provider,\n system_config.system_name,\n system_config.release_name,\n system_config.release_version,\n system_config.stemcell_name,\n system_config.stemcell_version,\n cloud_properties_for_server_flavor(system_config.core_server_flavor),\n system_config.core_ip,\n system_config.root_dns,\n system_config.admin_emails,\n system_config.common_password,\n system_config.common_persistent_disk,\n system_config.security_group\n )\n\n dea_config.build_into_manifest(manifest)\n system_config.services.each do |service_config|\n service_config.build_into_manifest(manifest)\n end\n\n chdir system_config.system_dir do\n mkdir_p(\"deployments\")\n File.open(\"deployments/#{system_config.system_name}-core.yml\", \"w\") do |file|\n file << manifest.to_yaml\n end\n end\n end",
"def init\n if @args.first.nil?\n @ui.error('Please specify the configuration')\n return ARGUMENT_ERROR_RESULT\n end\n\n @mdbci_config = Configuration.new(@args.first, @env.labels)\n @keyfile = @env.keyFile.to_s\n unless File.exist?(@keyfile)\n @ui.error('Please specify the key file to put to nodes')\n return ARGUMENT_ERROR_RESULT\n end\n result = NetworkSettings.from_file(@mdbci_config.network_settings_file)\n if result.error?\n @ui.error(result.error)\n return ARGUMENT_ERROR_RESULT\n end\n\n @network_settings = result.value\n SUCCESS_RESULT\n end",
"def configuration_from_options(options); end",
"def configure\n\n # config file default options\n configuration = {\n :options => {\n :verbose => false,\n :coloring => 'AUTO'\n },\n :mount => {\n :source => {\n :name => nil\n },\n :mountpoint => {\n :name => nil\n },\n :passphrasefile => {\n :name => 'passphrase'\n },\n :keyfile => {\n :name => 'encfs6.xml'\n },\n :cmd => nil,\n :executable => nil\n },\n :unmount => {\n :mountpoint => {\n :name => nil\n },\n :cmd => nil,\n :executable => nil\n },\n :copy => {\n :source => {\n :name => nil\n },\n :destination => {\n :name => nil\n },\n :cmd => nil,\n :executable => nil\n }\n }\n\n # set default config if not given on command line\n config = @options[:config]\n unless config\n config = [\n File.join(@working_dir, \"revenc.conf\"),\n File.join(@working_dir, \".revenc.conf\"),\n File.join(@working_dir, \"config\", \"revenc.conf\"),\n File.expand_path(File.join(\"~\", \".revenc.conf\"))\n ].detect { |filename| File.exists?(filename) }\n end\n\n if config && File.exists?(config)\n # rewrite options full path for config for later use\n @options[:config] = config\n\n # load options from the config file, overwriting hard-coded defaults\n config_contents = YAML::load(File.open(config))\n configuration.merge!(config_contents.symbolize_keys!) if config_contents && config_contents.is_a?(Hash)\n else\n # user specified a config file?, no error if user did not specify config file\n raise \"config file not found\" if @options[:config]\n end\n\n # the command line options override options read from the config file\n @options = configuration[:options].merge!(@options)\n @options.symbolize_keys!\n\n # mount, unmount and copy configuration hashes\n @options[:mount] = configuration[:mount].recursively_symbolize_keys! if configuration[:mount]\n @options[:unmount] = configuration[:unmount].recursively_symbolize_keys! if configuration[:unmount]\n @options[:copy] = configuration[:copy].recursively_symbolize_keys! if configuration[:copy]\n end",
"def configure(options=nil, &block)\n config_class = @provisioner.config_class\n return if !config_class\n\n @logger.debug(\"Configuring provisioner with: #{config_class}\")\n @config = config_class.new\n @config.set_options(options) if options\n block.call(@config) if block\n end",
"def conf\n unless @conf\n if @db_url || @db # skip loading config if db set explicitly\n @conf = {}\n else\n parse_command_line unless @args\n\n raise \"No configuration file defined (-c <config>).\" if @args[\"config\"].nil?\n raise \"Couldn't read #{@args[\"config\"]} file.\" unless @args['config'] && @conf = YAML::load(File.new(@args[\"config\"]).read)\n # setting default options that should be written along with all the records to process_items\n if @conf['default_options']\n @conf['default_options'].each do |k,v|\n default_options.send(\"#{k}=\", v)\n end\n end\n\n if @args['params']\n @args['params'].each do |k, v|\n default_options.send(\"#{k}=\", v)\n end\n end\n end\n end\n @conf\n end",
"def opts\n @opts ||= OptionParser.new do |opts|\n opts.program_name = File.basename($PROGRAM_NAME)\n opts.banner = \"Usage: #{opts.program_name}\"\n\n opts.separator ''\n opts.separator 'Actions:'\n\n names = @actions.map(&:name)\n padding = names.map(&:size).max\n @actions.each do |action|\n opts.separator \" #{action.name.ljust(padding)} #{action.description}\\n\"\n end\n\n opts.separator ''\n opts.separator 'Tasks:'\n\n @processor_class.tasks.each do |task_name|\n opts.separator \" #{task_name}\"\n end\n\n opts.separator ''\n opts.separator 'Specific options:'\n opts.on('-a', '--action ACTION', names, 'Select an action to run (you may give this switch multiple times)', \" (#{names.join(', ')})\") do |v|\n options.actions << v\n end\n opts.on('-t', '--task TASK', @processor_class.tasks, 'Select a scraping task to run (you may give this switch multiple times)', \" (#{@processor_class.tasks.join(', ')})\") do |v|\n options.tasks << v\n end\n opts.on('-o', '--output_dir PATH', 'The directory or Redis address (e.g. redis://localhost:6379/0) in which to dump JSON documents') do |v|\n options.output_dir = v\n end\n opts.on('--pipelined', 'Dump JSON documents all at once') do |v|\n options.pipelined = v\n end\n opts.on('-c', '--cache_dir PATH', 'The directory or Memcached address (e.g. memcached://localhost:11211) in which to cache HTTP requests') do |v|\n options.cache_dir = v\n end\n opts.on('--no-cache', 'Disable HTTP request caching') do |v|\n options.cache_dir = nil\n end\n opts.on('-e', '--expires_in SECONDS', \"The cache's expiration time in seconds\") do |v|\n options.expires_in = v\n end\n opts.on('--value_max_bytes BYTES', \"The maximum Memcached item size\") do |v|\n options.value_max_bytes = v\n end\n opts.on('--memcached_username USERNAME', \"The Memcached username\") do |v|\n options.memcached_username = v\n end\n opts.on('--memcached_password USERNAME', \"The Memcached password\") do |v|\n options.memcached_password = v\n end\n opts.on('-d', '--database_url', 'The database URL (e.g. mongodb://USER:PASSWORD@localhost:27017/pupa or postgres://USER:PASSWORD@localhost:5432/pupa') do |v|\n options.database_url = v\n end\n opts.on('--[no-]validate', 'Validate JSON documents') do |v|\n options.validate = v\n end\n opts.on('-v', '--verbose', 'Show all messages') do\n options.level = 'DEBUG'\n end\n opts.on('-q', '--quiet', 'Show only warning and error messages') do\n options.level = 'WARN'\n end\n opts.on('-s', '--silent', 'Show no messages') do\n options.level = 'UNKNOWN'\n end\n opts.on('-n', '--dry-run', 'Show the plan without running any actions') do\n options.dry_run = true\n end\n\n opts.separator ''\n opts.separator 'Common options:'\n opts.on_tail('-h', '--help', 'Show this message') do\n puts opts\n exit\n end\n opts.on_tail('-v', '--version', 'Show version') do\n puts Pupa::VERSION\n exit\n end\n end\n end",
"def exec\r\n if valid?\r\n _result = configure\r\n _result &&= compile\r\n _result &&= install\r\n end\r\n end",
"def post_option_parser(configuration)\n # we could test or manipulate input values here\n if ARGV.length >= 1\n configuration[:command] = ARGV.shift \n end\n\n raise \"Action must be say_goodbye or get_towel\" unless [\"say_goodbye\", \"get_towel\"].include?(configuration[:command])\n end",
"def initialize(argv)\n @options = {\n :command => 'execute',\n :rpcname => nil,\n :verbose => false\n }\n @argv = argv.clone\n if @argv.first =~ /^[a-z0-9][a-z0-9_-]*$/i\n self.options[:command] = @argv.shift\n end\n if @argv.first =~ /^[a-z0-9_-]+\\.[a-z0-9_\\.-]+$/i\n self.options[:rpcname] = @argv.shift\n end\n end",
"def initialize\n @argv_option = {}\n @config = {}\n end",
"def configure(options={})\n Configuration.configure(options)\n end",
"def process_config(config_file, options=OpenStruct.new)\n # Defaults\n config = {\n 'target_directory' => 'auto',\n 'copy_rpm_data' => false\n }\n\n if File.exist?(config_file)\n begin\n system_config = YAML.load_file(config_file)\n if system_config\n config.merge!(system_config)\n end\n rescue\n fail(\"Error: Config file '#{config_file}' could not be processed\")\n end\n end\n\n if options.copy_rpm_data.nil?\n options.copy_rpm_data = (config['copy_rpm_data'].to_s == 'true')\n end\n\n if options.target_dir.nil? && config['target_directory']\n if config['target_directory'] == 'auto'\n options.target_dir = simp_target_dir\n else\n unless config['target_directory'][0].chr == '/'\n fail(\"Error: 'target_directory' in '#{config_file}' must be an absolute path\")\n end\n\n options.target_dir = config['target_directory'].strip\n end\n end\n\n return options\nend",
"def initialize(options = {})\n application_configuration.merge!(options)\n configuration_options.each do |key|\n send(\"#{key}=\", application_configuration[key])\n end\n end",
"def initialize\n @options = ArgumentParser.parse\n Environment.environment = @options[:environment] || \"production\"\n + @options.delete(:environment)\n end",
"def parse!(argv=ARGV, options={})\n parser = ConfigParser.new\n parser.add(configurations)\n \n args = parser.parse!(argv, options)\n [args, parser.config]\n end",
"def call(*args)\n before *args\n klass = _extract_class!(args)\n Ing.execute(klass, *args) do |cmd|\n configure_command cmd\n end\n after\n end",
"def execute(options = {})\n # load all the options for this plugin\n options.each { |name,value| send(\"#{name}=\".to_sym, value) }\n\n # validate we have the properties we need\n validate_properties\n\n # run the workflow plugin\n run\n end",
"def option_parser #:nodoc:\n @option_parser ||= OptionParser.new do |opts|\n opts.banner = \"Usage: #{File.basename($0)} [options] action ...\"\n\n opts.on(\"-d\", \"--debug\",\n \"Prompts before each remote command execution.\"\n ) { |value| options[:debug] = true }\n\n opts.on(\"-e\", \"--explain TASK\",\n \"Displays help (if available) for the task.\"\n ) { |value| options[:explain] = value }\n\n opts.on(\"-F\", \"--default-config\",\n \"Always use default config, even with -f.\"\n ) { options[:default_config] = true }\n\n opts.on(\"-f\", \"--file FILE\",\n \"A recipe file to load. May be given more than once.\"\n ) { |value| options[:recipes] << value }\n\n opts.on(\"-H\", \"--long-help\", \"Explain these options and environment variables.\") do\n long_help\n exit\n end\n\n opts.on(\"-h\", \"--help\", \"Display this help message.\") do\n puts opts\n exit\n end\n\n opts.on(\"-n\", \"--dry-run\",\n \"Prints out commands without running them.\"\n ) { |value| options[:dry_run] = true }\n\n opts.on(\"-p\", \"--password\",\n \"Immediately prompt for the password.\"\n ) { options[:password] = nil }\n\n opts.on(\"-q\", \"--quiet\",\n \"Make the output as quiet as possible.\"\n ) { options[:verbose] = 0 }\n\n opts.on(\"-S\", \"--set-before NAME=VALUE\",\n \"Set a variable before the recipes are loaded.\"\n ) do |pair|\n name, value = pair.split(/=/, 2)\n options[:pre_vars][name.to_sym] = value\n end\n\n opts.on(\"-s\", \"--set NAME=VALUE\",\n \"Set a variable after the recipes are loaded.\"\n ) do |pair|\n name, value = pair.split(/=/, 2)\n options[:vars][name.to_sym] = value\n end\n\n opts.on(\"-T\", \"--tasks [PATTERN]\",\n \"List all tasks (matching optional PATTERN) in the loaded recipe files.\"\n ) do |value|\n options[:tasks] = if value\n value\n else\n true\n end\n options[:verbose] ||= 0\n end\n\n opts.on(\"-t\", \"--tool\",\n \"Abbreviates the output of -T for tool integration.\"\n ) { options[:tool] = true }\n\n opts.on(\"-V\", \"--version\",\n \"Display the Capistrano version, and exit.\"\n ) do\n require 'capistrano/version'\n puts \"Capistrano v#{Capistrano::Version::STRING}\"\n exit\n end\n\n opts.on(\"-v\", \"--verbose\",\n \"Be more verbose. May be given more than once.\"\n ) do\n options[:verbose] ||= 0\n options[:verbose] += 1\n end\n\n opts.on(\"-X\", \"--skip-system-config\",\n \"Don't load the system config file (capistrano.conf)\"\n ) { options.delete(:sysconf) }\n\n opts.on(\"-x\", \"--skip-user-config\",\n \"Don't load the user config file (.caprc)\"\n ) { options.delete(:dotfile) }\n end\n end",
"def run(argv = ARGV)\n # => Parse CLI Configuration\n cli = Options.new\n cli.parse_options(argv)\n\n # => Parse JSON Config File (If Specified and Exists)\n json_config = Util.parse_json_config(cli.config[:config_file] || Config.config_file)\n\n # => Grab the Default Values\n default = Config.options\n\n # => Merge Configuration (CLI Wins)\n config = [default, json_config, cli.config].compact.reduce(:merge)\n\n # => Apply Configuration\n Config.setup do |cfg|\n cfg.config_file = config[:config_file]\n cfg.cache_timeout = config[:cache_timeout].to_i\n cfg.bind = config[:bind]\n cfg.port = config[:port]\n cfg.environment = config[:environment].to_sym.downcase\n cfg.do_api_key = config[:do_api_key]\n end\n\n # => Launch the API\n API.run!\n end",
"def configure(options=nil, &block)\n # We don't want ancestors to be searched. This is the default in 1.8,\n # but not in 1.9, hence this hackery.\n const_args = [\"Config\"]\n const_args << false if RUBY_VERSION >= \"1.9\"\n\n # We assume that every provisioner has a `Config` class beneath\n # it for configuring.\n return if !@provisioner || !@provisioner.const_defined?(*const_args)\n\n # Instantiate the config class and configure it\n @config = @provisioner.const_get(*const_args).new\n @config.top = top\n @config.set_options(options) if options\n block.call(@config) if block\n end",
"def initialize\n parse_options\n command = ARGV.shift\n subcommand = ARGV.shift\n case command\n when 'console' then run_console\n when 'server' then run_server(subcommand)\n when 'node' then run_node(subcommand)\n when 'load_schema' then run_load_schema\n when 'install' then run_install(subcommand)\n when 'cleanup' then run_cleanup\n else usage\n end\n end",
"def launch_configuration(asg, sg_tcp_80_priv, sg_tcp_22_priv, instance_type, ami)\n asg.create_launch_configuration(launch_configuration_name: 'lc-nginx_auto',\n associate_public_ip_address: false,\n # key_name: 'UbuntuKeyPair', # TODO: Change/Remove\n image_id: ami, # Ubuntu base AMI from ubuntu.com\n instance_type: instance_type,\n security_groups: [sg_tcp_80_priv], # sg_tcp_22_priv\n instance_monitoring: { enabled: true }, # true=CloudWatch monitoring (60sec)\n user_data: Base64.encode64(\"#!/bin/bash -ex\\n\"\\\n \"export DEBIAN_FRONTEND=noninteractive\\n\"\\\n \"apt-get -q=2 update && apt-get -q=2 upgrade\\n\"\\\n \"apt-get -q=2 install nginx\\n\"\\\n \"URL=http://169.254.169.254/latest/meta-data\\n\"\\\n \"cat >> /var/www/html/index.html <<EOF\\n\"\\\n \"<meta http-equiv=refresh content=2 /><br>\\n\"\\\n \"FROM: Launch Configuration / ASG<br>\\n\"\\\n \"INSTANCE ID: $(curl $URL/instance-id)<br>\\n\"\\\n \"PUBLIC IP: [NONE], using NAT instances<br>\\n\"\\\n \"INTERNAL IP: $(curl $URL/local-ipv4)<br>\\n\"\\\n 'EOF'))\n sleep 5\nend",
"def run(arguments)\n parse(arguments)\n configure\n execute\n end",
"def execute\n cli_options = OptionManager.new.execute\n argv = parse_options(cli_options[:parser])\n \n return unless argv\n \n if [nil, ''].include? cli_options[:values][:cmd]\n env.ui.info cli_options[:parser]\n else\n with_target_vms(argv) do |machine|\n manage_machine(machine, cli_options) \n end\n end\n 0\n end",
"def execute\n options = {}\n options[:force] = @env.vagrantfile.config.orchestrate.force_push\n\n opts = OptionParser.new do |o|\n o.banner = \"Usage: vagrant orchestrate push\"\n o.separator \"\"\n\n o.on(\"--reboot\", \"Reboot a managed server after the provisioning step\") do\n options[:reboot] = true\n end\n\n o.on(\"--strategy strategy\", \"The orchestration strategy to use. Default is serial\") do |v|\n options[:strategy] = v\n end\n\n o.on(\"-f\", \"--force\", \"Suppress prompting in between groups\") do\n options[:force] = true\n end\n end\n\n argv = parse_options(opts)\n return unless argv\n\n guard_clean unless ENV[\"VAGRANT_ORCHESTRATE_NO_GUARD_CLEAN\"]\n\n machines = filter_unmanaged(argv)\n return 0 if machines.empty?\n\n retrieve_creds(machines) if @env.vagrantfile.config.orchestrate.credentials\n\n options[:parallel] = true\n strategy = options[:strategy] || @env.vagrantfile.config.orchestrate.strategy\n @env.ui.info(\"Pushing to managed servers using #{strategy} strategy.\")\n\n # Handle a couple of them more tricky edges.\n strategy = :serial if machines.size == 1\n strategy = :half_half if strategy.to_sym == :canary_half_half && machines.size == 2\n\n case strategy.to_sym\n when :serial\n options[:parallel] = false\n result = deploy(options, machines)\n when :parallel\n result = deploy(options, machines)\n when :canary\n # A single canary server and then the rest\n result = deploy(options, machines.take(1), machines.drop(1))\n when :half_half\n # Split into two (almost) equal groups\n groups = split(machines)\n result = deploy(options, groups.first, groups.last)\n when :canary_half_half\n # A single canary and then two equal groups\n canary = machines.take(1)\n groups = split(machines.drop(1))\n result = deploy(options, canary, groups.first, groups.last)\n else\n @env.ui.error(\"Invalid deployment strategy specified\")\n result = false\n end\n\n return 1 unless result\n 0\n end",
"def initialize(options={ :force => false, :deployfile => 'deploy.yml', :remove_elements => []})\n\n deployfile = options[:deployfile]\n \n if (!File.exist?(deployfile))\n message = \"\\'#{File.expand_path(deployfile)}\\' not found.\"\n raise Error::IOError, message, caller\n end\n\n extension = File.extname(deployfile)\n \n case extension\n when '.json'\n @json = YamlJson.read_json_w_macros(deployfile)\n when '.yaml','.yml'\n @json = YamlJson.yaml2json(deployfile)\n else\n message = \"File extension #{extension} is not supported for deployment file #{deployfile}\"\n raise Error::UnsupportedFileExtension, message, caller\n end \n\n # JSON fix for marathon\n # marathon require ENV variables to be quoted\n @json['env'].each do |key, value|\n if (value.is_a? Numeric)\n @json['env'][key] = value.to_json\n end\n end\n \n missing_attributes = MarathonDefaults.missing_attributes(@json) \n \n if(!missing_attributes.empty?)\n message = \"#{deployfile} is missing required marathon API attributes: #{missing_attributes.join(',')}\"\n raise Error::MissingMarathonAttributesError, message, caller\n end\n \n missing_envs = MarathonDefaults.missing_envs(@json)\n if(!missing_envs.empty?)\n message = \"#{deployfile} is missing required environment variables: #{missing_envs.join(',')}\"\n raise Error::MissingMarathonAttributesError, message, caller\n end\n \n @deployfile = deployfile \n @json = Utils.deep_symbolize(@json) \n \n add_identifier if (options[:force])\n remove_elements(options[:remove_elements])\n \n inject_envs = ENV.select { |k,v| /^#{MarathonDeploy::MarathonDefaults::ENVIRONMENT_VARIABLE_PREFIX}/.match(k) }\n cleaned_envs = Hash[inject_envs.map { |k,v| [k.gsub(/^#{MarathonDeploy::MarathonDefaults::ENVIRONMENT_VARIABLE_PREFIX}/,''), v ] }] \n self.add_envs cleaned_envs.to_h unless cleaned_envs.empty?\n end",
"def initialize(options = { })\n @options = DEFAULT_OPTIONS.merge(options)\n \n load_config\n end",
"def execute\n if @env.show_help\n show_help\n return SUCCESS_RESULT\n end\n return ARGUMENT_ERROR_RESULT unless init == SUCCESS_RESULT\n\n if @mdbci_config.node_names.size != 1\n @ui.error('Invalid node specified')\n return ARGUMENT_ERROR_RESULT\n end\n recipe_name = ProductAttributes.recipe_name(@product)\n return Result.error('Failed to recognize the product') if recipe_name.nil?\n result = ChefConfigurationGenerator.install_product(@mdbci_config.node_names.first,\n @mdbci_config, @ui, @network_settings,\n @machine_configurator, @product, true,\n @env.repos, @product_version, recipe_name)\n\n if result.success?\n SUCCESS_RESULT\n else\n @ui.error(result.error)\n ERROR_RESULT\n end\n end",
"def run_init\n run(\n result:\n ::Kitchen::Terraform::Client::Command\n .init(\n options:\n ::Kitchen::Terraform::Client::Options\n .new\n .disable_input\n .enable_lock\n .lock_timeout(duration: config_lock_timeout)\n .maybe_no_color(toggle: !config_color)\n .upgrade\n .from_module(source: config_directory)\n .enable_backend\n .force_copy\n .backend_configs(keys_and_values: config_backend_configurations)\n .enable_get\n .maybe_plugin_dir(path: config_plugin_directory)\n .verify_plugins(toggle: config_verify_plugins),\n working_directory: instance_directory\n )\n )\n end",
"def initialize(options)\n opts = string_keys(options)\n config = JSON.load(opts.delete(\"config\") || \"{}\")\n append_config_source opts # high priority\n append_config_source config # lower priority\n end",
"def initialize\n configure_via_yaml\n configure_via_env\n end",
"def config_build config_file, config_vars={}, parse=false\n @logger.debug \"Using config file #{config_file}.\"\n validate_file_input(config_file, \"config\")\n if config_vars.length > 0 or parse or contains_liquid(config_file)\n @logger.debug \"Config_vars: #{config_vars.length}\"\n # If config variables are passed on the CLI, we want to parse the config file\n # and use the parsed version for the rest fo this routine\n config_out = \"#{@build_dir}/pre/#{File.basename(config_file)}\"\n vars = DataObj.new()\n vars.add_data!(\"vars\", config_vars)\n liquify(vars, config_file, config_out)\n config_file = config_out\n @logger.debug \"Config parsed! Using #{config_out} for build.\"\n validate_file_input(config_file, \"config\")\n end\n begin\n config = YAML.load_file(config_file)\n rescue Exception => ex\n unless File.exists?(config_file)\n @logger.error \"Config file #{config_file} not found.\"\n else\n @logger.error \"Problem loading config file #{config_file}. #{ex} Exiting.\"\n end\n raise \"ConfigFileError\"\n end\n cfg = BuildConfig.new(config) # convert the config file to a new object called 'cfg'\n if @safemode\n commands = \"\"\n cfg.steps.each do |step|\n if step['action'] == \"execute\"\n commands = commands + \"> \" + step['command'] + \"\\n\"\n end\n end\n unless commands.to_s.strip.empty?\n puts \"\\nWARNING: This routine will execute the following shell commands:\\n\\n#{commands}\"\n ui = HighLine.new\n answer = ui.ask(\"\\nDo you approve? (YES/no): \")\n raise \"CommandExecutionsNotAuthorized\" unless answer.strip == \"YES\"\n end\n end\n iterate_build(cfg)\nend",
"def parse\n # Parse all arguments first\n option_parser.parse!(arguments)\n\n # Get the first argument, this is our command\n cmd = arguments.pop\n raise OptionParser::MissingArgument, 'command' unless cmd\n\n # Set the command if it's present\n options.command = cmd.to_sym\n end",
"def run!(configuration:, deployment_policy:)\n containers = find_containers_to_deploy(configuration, deployment_policy)\n\n cloner = Indocker::Repositories::Cloner.new(configuration, @logger)\n build_server_pool = Indocker::ServerPools::BuildServerPool.new(configuration: configuration, logger: @logger)\n deployer = Indocker::ContainerDeployer.new(configuration: configuration, logger: @logger)\n\n @global_logger.info(\"Establishing ssh sessions to all servers...\")\n build_server_pool.create_sessions!\n\n build_servers = configuration\n .build_servers\n .uniq { |s| s.host }\n\n deploy_servers = containers\n .map(&:servers)\n .flatten\n .uniq { |s| s.host }\n\n servers = (deploy_servers + build_servers).uniq { |s| s.host }\n\n @progress.setup(\n binaries_servers: servers,\n build_servers: build_servers,\n deploy_servers: deploy_servers,\n env_files: configuration.env_files.keys,\n repositories: configuration.repositories.keys,\n force_restart: deployment_policy.force_restart,\n skip_build: deployment_policy.skip_build,\n skip_deploy: deployment_policy.skip_deploy,\n containers: containers,\n artifact_servers: configuration.artifact_servers,\n )\n\n remote_operations = sync_indocker(servers)\n wait_remote_operations(remote_operations)\n\n remote_operations = sync_env_files(deploy_servers, configuration.env_files)\n wait_remote_operations(remote_operations)\n\n remote_operations = pull_repositories(cloner, build_servers, configuration.repositories)\n wait_remote_operations(remote_operations)\n\n remote_operations = sync_artifacts(cloner, configuration.artifact_servers)\n wait_remote_operations(remote_operations)\n\n update_crontab_redeploy_rules(configuration, build_servers.first)\n\n containers.uniq.each do |container|\n recursively_deploy_container(\n configuration,\n deployer,\n build_server_pool,\n container,\n containers,\n deployment_policy.skip_build,\n deployment_policy.skip_deploy,\n deployment_policy.force_restart,\n deployment_policy.skip_force_restart\n )\n end\n\n Thread\n .list\n .each { |t| t.join if t != Thread.current }\n ensure\n build_server_pool.close_sessions if build_server_pool\n deployer.close_sessions if deployer\n end",
"def parse_command_line &block\n data = {}\n\n OptionParser.new do |opts|\n opts.banner = \"Usage: #{File.basename($0)} [options]\"\n\n opts.on(\"-c CONFIG\", \"--conf CONFIG\", \"YAML config file\") do |config|\n data[\"config\"] = config\n end\n\n opts.on(\"-p PARAMS\", \"--params PARAMS\", \"Additional default options - key: value as JSON string, override values from config file\") do |params|\n data[\"params\"] = JSON.parse(params)\n end\n\n # process custom args, if given\n block.call(opts) if block_given?\n\n opts.on_tail('-h', '--help', 'display this help and exit') do\n puts opts\n exit\n# return nil\n end\n\n# begin\n opts.parse(ARGV)\n# rescue OptionParser::InvalidOption\n# # do nothing\n# end\n\n end\n\n @args = data\n end",
"def with_configured_network(opts)\n ret = nil\n\n # Pipes for communicating with opts[:init_script]\n in_r, in_w = IO.pipe\n out_r, out_w = IO.pipe\n\n # Start the container with lxc-init\n init_pid = ct_runscript_run(\n id: opts[:id],\n script: opts[:init_script],\n stdin: in_r,\n stdout: out_w,\n stderr: out_w,\n close_fds: [in_w, out_r],\n wait: false,\n )\n\n in_r.close\n out_w.close\n\n # Wait for the container to be started\n if out_r.readline.strip == 'ready'\n # Configure network\n pid = lxc_ct(opts[:id]).attach do\n setup_exec_env\n opts[:net_config].setup\n end\n\n Process.wait2(pid)\n\n # Execute user command\n ret = yield\n end\n\n # Closing in_w will bring down opts[:init_script] and stop the container\n in_w.close\n out_r.close\n\n _, status = Process.wait2(init_pid)\n ret || ok(exitstatus: status.exitstatus)\n end",
"def run\n if @initializer.nil?\n @initializer = new\n \n yield @initializer.configuration if block_given?\n @initializer.process\n \n start_app\n else\n yield @initializer.configuration if block_given?\n end\n end",
"def config(command)\n ensure_mode(:configuration)\n run(command)\n end",
"def load(optparse, &block)\n return if block.nil? && !File.exists?(Config::CONFIG_FILE)\n config = @config\n config.optparse = optparse\n environment = Class.new do\n define_method(:set) { |opt,val| config.set(opt,val) }\n define_method(:use) { |plugin,*args,&b| config.use(plugin,*args,&b) }\n define_method(:before) { |*args,&block| config.before(*args,&block) }\n define_method(:after) { |*args,&block| config.after(*args,&block) }\n define_method(:tick) { |&block| config.tick(&block) }\n define_method(:option) { |sh,lo,desc,&b| config.option(sh,lo,desc,&b) }\n end.new\n\n if block # for test environment\n environment.instance_eval(&block)\n else\n environment.instance_eval(File.read(Config::CONFIG_FILE), Config::CONFIG_FILE)\n end\n end",
"def create(options={})\n unless options[:ostemplate]\n # We need at least a valid ostemplate\n raise ArgumentError, \"Create requires argument :ostemplate.\"\n end\n\n cmd = \"#{@vzctl} create #{@ctid}\"\n\n options.each do |opt,val|\n cmd << \" --#{opt}\"\n cmd << \" #{val}\"\n end\n\n execute(cmd)\n\n Log.debug(\"Reading new container configuration file: #{@configfile}\")\n @config = Config.new(load_config_file)\n @config.add_observer(self)\n end",
"def initialize(options={\n :force => false,\n :deployfile => 'deploy.yml',\n :remove_elements => [],\n :environment => nil,\n })\n\n deployfile = options[:deployfile]\n @json = readFile(deployfile)\n\n if (!options[:environment].nil?)\n overrides = env_overrides(\n File.dirname(deployfile),\n options[:environment].name)\n\n @json = @json.deep_merge!(overrides)\n end\n\n missing_attributes = MarathonDefaults.missing_attributes(@json) \n \n if(!missing_attributes.empty?)\n message = \"#{deployfile} is missing required marathon API attributes: #{missing_attributes.join(',')}\"\n raise Error::MissingMarathonAttributesError, message, caller\n end\n \n missing_envs = MarathonDefaults.missing_envs(@json)\n if(!missing_envs.empty?)\n message = \"#{deployfile} is missing required environment variables: #{missing_envs.join(',')}\"\n raise Error::MissingMarathonAttributesError, message, caller\n end\n \n @deployfile = deployfile \n @json = Utils.deep_symbolize(@json) \n \n add_identifier if (options[:force])\n remove_elements(options[:remove_elements])\n \n inject_envs = ENV.select { |k,v| /^#{MarathonDeploy::MarathonDefaults::ENVIRONMENT_VARIABLE_PREFIX}/.match(k) }\n cleaned_envs = Hash[inject_envs.map { |k,v| [k.gsub(/^#{MarathonDeploy::MarathonDefaults::ENVIRONMENT_VARIABLE_PREFIX}/,''), v ] }] \n self.add_envs cleaned_envs.to_hash unless cleaned_envs.empty?\n end",
"def initialize(options = {})\n @config = env_options.merge(options)\n end",
"def initialize(opts = {})\n super\n self.__options = opts\n self.__tasks = []\n self.__servers = []\n self.__sequences = []\n\n instance_eval(File.read(self.__options[:recipe_file])) if self.__options[:recipe_file]\n end",
"def initialize(opts={})\n @verbose = @root_file = @reload_disabled = nil\n\n opts = Hash[:path, opts] if opts.is_a?(Array) || opts.is_a?(String)\n\n @config_file = opts[:file]\n\n # :path/:file have higher priority then ENV variables\n if opts.include?(:path) || opts.include?(:file) then\n @config_path = opts[:path]\n else\n # default or infer :path through ENV or Rails obejct.\n # no ENV variable for :file\n @config_path = ENV['ACTIVE_CONFIG_PATH'] ||\n (defined?(Rails) ? (Rails.root + 'etc') : nil) ||\n (defined?(RAILS_ROOT) ? File.join(RAILS_ROOT, 'etc') : nil)\n end\n\n # alexg: Damn, this is ugly\n if ActiveConfig::Suffixes === opts[:suffixes]\n @suffixes_obj = opts[:suffixes]\n end\n\n @suffixes_obj ||= Suffixes.new(self, opts[:suffixes])\n @suffixes_obj.ac_instance = self\n @config_refresh = (opts.has_key?(:config_refresh) ? opts[:config_refresh].to_i : 300)\n @on_load = { }\n\n self._flush_cache\n\n dups_h = Hash.new{ |h,e| h[e] = [] }\n\n self._config_path.map{|e|\n if File.exist?(e) and File.directory?(e)\n Dir[e + '/*'].map{|f|\n dups_h[File.basename(f)] << f if File.file?(f)\n }\n else\n STDERR.puts \"WARNING: Active Config Path NOT FOUND #{e}\" unless opts[:quiet]\n end\n }\n\n dups = dups_h.to_a.select{|k,v| v.size >= 2}\n\n raise ActiveConfig::DuplicateConfig.new(dups.map{|e|\"Duplicate file #{e.first} found in \\n#{e.last.map{|el|\"\\t\"+el}.join(\"\\n\")}\"}.join(\"\\n\")) if dups.size>0\n\n # root_file only possible with :path.\n #\n # IMPORTANT: This check needs to be after we have suffixes.\n # _valid_file? barfs if suffixes are offset\n if @config_path then\n @root_file = opts[:root_file] ||\n (_valid_file?('global') ? 'global' : nil)\n end\n\n _check_config!\n end",
"def initialize(options = {})\n @dry_run = false\n @log_path = nil\n @destination_uri = nil\n @manifest_path = nil\n @skip_deletes = false\n unpack_options options\n end",
"def parse\n parse_command\n load_config\n finalize_setup\n end",
"def update_config_options\n options = Util::OptsParser.options(ARGV)\n Util::Configuration.tag_time_to_live_in_seconds = options[:ttl]\n Util::Configuration.case_sensitive_matching = options[:case]\n Util::Configuration.hashtag_storage_class = options[:storage]\n Util::Configuration.log_capture_device = options[:log_device]\n Util::Configuration.automatic_restart = options[:automatic_restart]\n current_config = Util::Configuration.to_a\n current_config << \"Port: #{options[:port]}\"\n logger.info(current_config.join(', '))\n options\n end",
"def run\n greet_user\n process_args\n confirm_settings\n # this will loop between confirm_settings <-> change_settings until user is done editing\n\n settings_write\n\n path_to_private_key = write_ssh_key_to_temp_file\n path_to_inventory_file = write_ansible_inventory_file\n\n # instead of string formatting, make ∂ do it from objects\n\n playbook = self[:ansible_playbook]\n\n # extra_vars = [:sysadmin_username, :server_type, :deploy_git_revision, :default_rails_env, :machine_type]\n extra_vars = @value_definitions.keys\n\n begin_section(\"ATTEMPTING TO DEPLOY VIA ANSIBLE\")\n print ''\n\n cmd = build_ansible_command inventory: path_to_inventory_file,\n playbook: playbook,\n extra_vars: extra_vars,\n ssh_key: path_to_private_key\n\n\n print cmd\n\n # while 1\n # sleep 1\n # end\n\n Kernel.system cmd\n\n if block_given?\n yield\n else\n # supplying a run block isn't required anymore; it can be useful with just default behavior\n end\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 init!\n # check if configuration file is already created\n puts \"=> [MoIP] Sandbox mode enabled\" if sandbox?\n unless File.exist?(CONFIG_FILE)\n puts \"=> [Moip] The configuration could not be found at #{CONFIG_FILE.inspect}\"\n return\n end\n end"
] | [
"0.7152716",
"0.6579198",
"0.6338743",
"0.6274714",
"0.6095499",
"0.59507096",
"0.59278",
"0.57823443",
"0.5697909",
"0.5646606",
"0.5614647",
"0.5561333",
"0.55549026",
"0.55056256",
"0.5439381",
"0.5431543",
"0.5408432",
"0.53939605",
"0.53827214",
"0.53669345",
"0.5340831",
"0.53206384",
"0.53026634",
"0.52903175",
"0.5266335",
"0.526057",
"0.5239066",
"0.5233571",
"0.52216214",
"0.51808035",
"0.5177798",
"0.5172084",
"0.5154057",
"0.51519793",
"0.51287276",
"0.5124431",
"0.51191074",
"0.511862",
"0.51037097",
"0.5098333",
"0.50936306",
"0.5083216",
"0.5081713",
"0.50772595",
"0.50697947",
"0.50646037",
"0.50477517",
"0.5029728",
"0.5022722",
"0.5021895",
"0.5019502",
"0.5010057",
"0.5001968",
"0.49976572",
"0.49865076",
"0.49851382",
"0.49820796",
"0.49613434",
"0.49591735",
"0.494483",
"0.49433672",
"0.49299276",
"0.49228394",
"0.4919365",
"0.49178293",
"0.49164724",
"0.49041784",
"0.48900056",
"0.48857078",
"0.48820895",
"0.48572156",
"0.48542306",
"0.485367",
"0.4852582",
"0.48524824",
"0.48498648",
"0.48471135",
"0.48465067",
"0.48461273",
"0.48270828",
"0.48191065",
"0.48168415",
"0.48161578",
"0.48151496",
"0.48123413",
"0.48106474",
"0.4807204",
"0.4806228",
"0.4799594",
"0.47909424",
"0.47881404",
"0.47797394",
"0.47777647",
"0.47728908",
"0.4757022",
"0.47522956",
"0.47517577",
"0.47483495",
"0.47469646",
"0.4738211"
] | 0.66710156 | 1 |
Primarily useful for testing, but subclasses of CLI could conceivably override this method to return a Configuration subclass or replacement. | def instantiate_configuration(options={}) #:nodoc:
Capistrano::Configuration.new(options)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def as_config\n Configureasy::Config.new self.parse\n end",
"def configuration\n @configuration ||= configuration_type.new\n end",
"def configuration_type\n Configuration\n end",
"def configuration\n return self\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 ||= self.class.config.inheritable_copy\n end",
"def config(for_plugin: nil, for_command: nil)\n if for_plugin && for_command\n fail ArgumentError, \"Cannot get config for plug-in and command together\"\n elsif for_plugin\n @config.dig(:plugins, for_plugin.to_sym) || OpenStruct.new\n elsif for_command\n @config.dig(:commands, for_command.to_sym) || OpenStruct.new\n else\n @config\n end\n end",
"def config\n self.class.configuration_builder.configuration\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 @configuration ||= Configuration.new\n end",
"def config\n @configuration ||= Configuration.new\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 ||= Config.create ConfigLoader.new(root, CONFIG_FILE).to_hash, options.merge_config\n end",
"def configure\n # Create a new configuration and yield it to a block\n self.configuration ||= Configuration.new\n\n yield(configuration)\n\n return configuration\n end",
"def configuration\n self\n end",
"def actual_config\n Config.instance\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\n @config ||= Configuration.new\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(&block)\n @config ||= Configuration.new\n instance_exec(@config, &block) if block_given?\n @config\n end",
"def config\n @bot.config.plugins.options[self.class] || {}\n end",
"def config\n @bot.config.plugins.options[self.class] || {}\n end",
"def config\n @bot.config.plugins.options[self.class] || {}\n end",
"def config\n (null_config? ? NoConfig.instance : actual_config)\n end",
"def genPiledDefaultConf(klass = self.class())\n if(klass == WithConfParam) then\n return klass::DefaultConf.dup() ;\n else\n newConf = genPiledDefaultConf(klass.superclass()) ;\n if(klass.const_defined?(:DefaultConf)) \n newConf.update(klass::DefaultConf) ;\n end\n \n return newConf ;\n end\n end",
"def install_configure_in(base)\n base.instance_eval <<-EOF\n # Configuration class for host module\n #\n #{base.name}::Configuration = Class.new(Configurations::Configuration)\n\n # The central configure method\n # @params [Proc] block the block to configure host module with\n # @raise [ArgumentError] error when not given a block\n # @example Configure a configuration\n # MyGem.configure do |c|\n # c.foo = :bar\n # end\n #\n def self.configure(&block)\n fail ArgumentError, \"configure needs a block\" unless block_given?\n include_configuration_type!(#{base.name}::Configuration)\n\n set_configuration!(&block)\n end\n\n # A reader for Configuration\n #\n def configuration\n return Thread.current[configuration_name] if Thread.current.key?(configuration_name)\n\n @configuration_defaults && configure {}\n end\n\n\n private\n\n # Sets the configuration instance variable\n #\n def self.set_configuration!(&block)\n Thread.current[configuration_name] = #{base.name}::Configuration.__new__(\n configuration_options,\n &block\n )\n end\n\n def self.configuration_name\n :\"#{underscore_camelized(base.name)}\"\n end\n\n EOF\n end",
"def configuration\n self.class.configuration\n end",
"def configuration\n self.class.configuration\n end",
"def config(opts=nil)\n return @@config if opts.nil?\n @@config = Config.new opts\n end",
"def configuration\n\t\t\t\tconfiguration = Configuration.new\n\t\t\t\t\n\t\t\t\tself.resolved_paths.each do |path|\n\t\t\t\t\tpath = File.expand_path(path)\n\t\t\t\t\t\n\t\t\t\t\tconfiguration.load_file(path)\n\t\t\t\tend\n\t\t\t\t\n\t\t\t\treturn configuration\n\t\t\tend",
"def config_generator\n @config_generator ||= definition.config_generator_class.new(ui, config_generator_options)\n end",
"def config\n log.deprecated(log_key) do\n 'config (DSL). Please use Config.(thing) instead (capital C).'\n end\n\n Config\n end",
"def use_configuration_type type\n define_method(:configuration_type){ type }\n end",
"def configuration\n @configuration ||= Configuration.new\n end",
"def configuration\n @configuration ||= Configuration.new\n end",
"def configuration\n @configuration ||= Configuration.new\n end",
"def configuration\n @configuration ||= Configuration.new\n end",
"def get_instance(payload)\n ConfigurationInstance.new(@version, payload)\n end",
"def default_configuration=(_arg0); end",
"def configuration\n @configuration ||= case configuration_path.split(\"/\").last\n when \"database.yml\" then database_yml_config\n when \"mongoid.yml\" then mongoid_yml_config\n end\n end",
"def configuration_from_options(options); end",
"def configuration\n self.class.configuration\n end",
"def configuration\n self.class.configuration\n end",
"def install_configure_in(base)\n base.instance_eval <<-EOF\n # Configuration class for host module\n #\n #{base.name}::Configuration = Class.new(Configurations::Configuration)\n\n # The central configure method\n # @params [Proc] block the block to configure host module with\n # @raise [ArgumentError] error when not given a block\n # @example Configure a configuration\n # MyGem.configure do |c|\n # c.foo = :bar\n # end\n #\n def self.configure(&block)\n semaphore.synchronize do\n fail ArgumentError, \"configure needs a block\" unless block_given?\n include_configuration_type!(#{base.name}::Configuration)\n\n set_configuration!(&block)\n end\n end\n\n # A reader for Configuration\n #\n def configuration\n semaphore.synchronize do\n return @configuration if @configuration\n\n if @configuration_defaults\n include_configuration_type!(#{base.name}::Configuration)\n set_configuration! { }\n end\n end\n end\n\n\n private\n\n # Sets the configuration instance variable\n #\n def self.set_configuration!(&block)\n @configuration = #{base.name}::Configuration.__new__(\n configuration_options,\n &block\n )\n end\n\n @semaphore = Mutex.new\n def self.semaphore\n @semaphore\n end\n\n EOF\n end",
"def configuration\n @configuration ||= Configuration.new\n end",
"def configuration\n @configuration ||= Configuration.new\n end",
"def configuration\n @configuration ||= Configuration.new\n end",
"def configuration\n @configuration ||= Configuration.new\n end",
"def configuration\n @configuration ||= Configuration.new\n end",
"def configuration\n @configuration ||= Configuration.new\n end",
"def configuration\n @configuration ||= Configuration.new\n end",
"def configuration\n @configuration ||= Configuration.new\n end",
"def configuration\n @configuration ||= Configuration.new\n end",
"def configuration\n @configuration ||= Configuration.new\n end",
"def configure\n return self\n end",
"def config\n Setting[klass_name]\n end",
"def configuration\n @configuration ||= Configuration.new(self)\n end",
"def configuration\n @configuration ||= Configuration.new()\n end",
"def default_config\n self.class.default_config\n end",
"def c\n configuration\n end",
"def configuration(override = Hash.new)\n config = Configuration[Configuration::DEFAULTS]\n override = Configuration[override].stringify_keys\n unless override.delete('skip_config_files')\n config = config.read_config_files(config.config_files(override))\n end\n\n # Merge DEFAULTS < _config.yml < override\n config = Utility.deep_merge_hashes(config, override).stringify_keys\n\n config\n end",
"def configuration\n self[:configuration] || {}\n end",
"def config\n @config ||= OpenStruct.new(YAML.load_file(self.config_path))\n end",
"def configure(options=nil, &block)\n # We don't want ancestors to be searched. This is the default in 1.8,\n # but not in 1.9, hence this hackery.\n const_args = [\"Config\"]\n const_args << false if RUBY_VERSION >= \"1.9\"\n\n # We assume that every provisioner has a `Config` class beneath\n # it for configuring.\n return if !@provisioner || !@provisioner.const_defined?(*const_args)\n\n # Instantiate the config class and configure it\n @config = @provisioner.const_get(*const_args).new\n @config.top = top\n @config.set_options(options) if options\n block.call(@config) if block\n end",
"def configuration\n @configuration ||= RecursiveOpenStruct.new\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 option_type_config_for(name, result_if_empty: :default)\n return unless option_configs\n\n res = option_configs.find { |s| s.name == name.to_s.underscore.to_sym }\n\n if !res && self.class.allow_empty_options\n res = if result_if_empty == :first_config\n option_configs.first\n else\n self.class.options_provider.new(result_if_empty, {}, self)\n end\n\n end\n res\n end",
"def config\n fail(SlashDeploy::NoConfig) unless config?\n SlashDeploy::Config.from_yaml(raw_config)\n end",
"def c\n configuration\n end",
"def configuration(override = {})\n config = Configuration[Configuration::DEFAULTS]\n override = Configuration[override].stringify_keys\n unless override.delete('skip_config_files')\n config = config.read_config_files(config.config_files(override))\n end\n\n # Merge DEFAULTS < _config.yml < override\n config = Utils.deep_merge_hashes(config, override).stringify_keys\n set_timezone(config['timezone']) if config['timezone']\n\n config\n end",
"def configuration\n @configuration ||= Configuration.new\n end",
"def configuration\n @configuration ||= begin\n config = {}\n\n if protoc_options[:configuration]\n require \"yaml\"\n\n config = YAML.load_file protoc_options[:configuration]\n config.merge! config\n end\n\n config\n end\n end",
"def initialize\n @config = DEFAULT_CONFIG.deep_dup\n end",
"def config\n @config || QuestBack.default_configuration || fail(QuestBack::Error, 'No configuration given or found on QuestBack.default_configuration.')\n end",
"def configuration(name, &block)\n config = Configuration.new\n config.instance_eval(&block)\n @configurations[name] = config\n end",
"def initialize(opts={})\n @verbose = @root_file = @reload_disabled = nil\n\n opts = Hash[:path, opts] if opts.is_a?(Array) || opts.is_a?(String)\n\n @config_file = opts[:file]\n\n # :path/:file have higher priority then ENV variables\n if opts.include?(:path) || opts.include?(:file) then\n @config_path = opts[:path]\n else\n # default or infer :path through ENV or Rails obejct.\n # no ENV variable for :file\n @config_path = ENV['ACTIVE_CONFIG_PATH'] ||\n (defined?(Rails) ? (Rails.root + 'etc') : nil) ||\n (defined?(RAILS_ROOT) ? File.join(RAILS_ROOT, 'etc') : nil)\n end\n\n # alexg: Damn, this is ugly\n if ActiveConfig::Suffixes === opts[:suffixes]\n @suffixes_obj = opts[:suffixes]\n end\n\n @suffixes_obj ||= Suffixes.new(self, opts[:suffixes])\n @suffixes_obj.ac_instance = self\n @config_refresh = (opts.has_key?(:config_refresh) ? opts[:config_refresh].to_i : 300)\n @on_load = { }\n\n self._flush_cache\n\n dups_h = Hash.new{ |h,e| h[e] = [] }\n\n self._config_path.map{|e|\n if File.exist?(e) and File.directory?(e)\n Dir[e + '/*'].map{|f|\n dups_h[File.basename(f)] << f if File.file?(f)\n }\n else\n STDERR.puts \"WARNING: Active Config Path NOT FOUND #{e}\" unless opts[:quiet]\n end\n }\n\n dups = dups_h.to_a.select{|k,v| v.size >= 2}\n\n raise ActiveConfig::DuplicateConfig.new(dups.map{|e|\"Duplicate file #{e.first} found in \\n#{e.last.map{|el|\"\\t\"+el}.join(\"\\n\")}\"}.join(\"\\n\")) if dups.size>0\n\n # root_file only possible with :path.\n #\n # IMPORTANT: This check needs to be after we have suffixes.\n # _valid_file? barfs if suffixes are offset\n if @config_path then\n @root_file = opts[:root_file] ||\n (_valid_file?('global') ? 'global' : nil)\n end\n\n _check_config!\n end",
"def config\n if Config.config.nil? or Config.config.empty?\n begin\n Config.config = Configuration.load_config(Config.config_file,\n Config.config_options)\n rescue Errno::ENOENT\n Config.config = {}\n end\n end\n\n return Config.config\n end",
"def configuration_with_overrides(options, preloaded = nil)\n return preloaded.merge!(options) if preloaded.is_a?(Bridgetown::Configuration)\n\n Bridgetown.configuration(options)\n end",
"def configure\n\n # config file default options\n configuration = {\n :options => {\n :verbose => false,\n :color => 'AUTO'\n }\n }\n\n # set default config if not given on command line\n config = @options[:config]\n unless config\n config = [\n File.join(@working_dir, \"oct.conf\"),\n File.join(@working_dir, \".oct.conf\"),\n File.join(@working_dir, \"config\", \"oct.conf\"),\n File.expand_path(File.join(\"~\", \".oct.conf\"))\n ].detect { |filename| File.exists?(filename) }\n end\n\n if config && File.exists?(config)\n # rewrite options full path for config for later use\n @options[:config] = config\n\n # load options from the config file, overwriting hard-coded defaults\n config_contents = YAML::load(File.open(config))\n configuration.merge!(config_contents.symbolize_keys!) if config_contents && config_contents.is_a?(Hash)\n else\n # user specified a config file?, no error if user did not specify config file\n raise \"config file not found\" if @options[:config]\n end\n\n # the command line options override options read from the config file\n @options = configuration[:options].symbolize_keys!.merge!(@options)\n\n end",
"def grifter_configuration\n @config.clone\n end",
"def conf\n begin\n @conf ||= JSON.parse(File.read(config_file))\n rescue\n @conf ||= {}\n end\n end",
"def conf\n begin\n @conf ||= JSON.parse(File.read(config_file))\n rescue\n @conf ||= {}\n end\n end",
"def instance_by_config(config)\n klass = config[:klass] || config[:class_name].constantize\n klass.new(config)\n end",
"def retriable_configuration\n Take2::Configuration::CONFIG_ATTRS.each_with_object({}) do |key, hash|\n hash[key] = send(key)\n end\n end",
"def config\n @config ||= Config.new\n end",
"def config\n @config ||= Config.new\n end",
"def configuration\n $_temescal_configuration ||= Configuration.new\n end",
"def config\n @options[:config]\n end",
"def configurations\n return @configurations if @configurations\n \n configurations = CONFIGURATIONS_CLASS.new\n configurations.extend(IndifferentAccess) if @use_indifferent_access\n \n ancestors.reverse.each do |ancestor|\n next unless ancestor.kind_of?(ClassMethods)\n ancestor.config_registry.each_pair do |key, value|\n if value.nil?\n configurations.delete(key)\n else\n configurations[key] = value\n end\n end\n end\n \n configurations\n end",
"def add_config_inheritance!\n class_eval do\n def self.inherited(subclass)\n subclass.class_eval do\n class << self\n attr_accessor :sorcery_config\n end\n end\n # Pass parent config to subclass\n subclass.sorcery_config = sorcery_config\n super\n end\n end\n end",
"def command_config(str_opts)\n command :config do |c|\n c.syntax = 'budik config [options]'\n c.summary = @str_config.summary\n c.description = @str_config.description\n c.option '-r', '--reset', str_opts.reset\n c.action { |_args, opts| Command.new(:config, opts) }\n end\n end",
"def config\n self\n end",
"def config\n @_config ||= Config.new\n yield @_config if block_given?\n @_config\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 configuration\n self[:configuration]\n end",
"def configuration\n @configuration ||= Configuration.new\n if block_given?\n yield @configuration\n else\n @configuration\n end\n end"
] | [
"0.66527593",
"0.6319266",
"0.631017",
"0.60788953",
"0.5983536",
"0.5911647",
"0.589147",
"0.5871636",
"0.5861939",
"0.5856198",
"0.5856198",
"0.58518517",
"0.5822058",
"0.5769548",
"0.57683957",
"0.5763366",
"0.5762089",
"0.57605493",
"0.57522273",
"0.57522273",
"0.57522273",
"0.57522273",
"0.57522273",
"0.57522273",
"0.5749638",
"0.5743947",
"0.5743947",
"0.5743947",
"0.57205594",
"0.56779504",
"0.56556934",
"0.56244516",
"0.56244516",
"0.5623635",
"0.5613019",
"0.5604878",
"0.56035715",
"0.5602675",
"0.5601406",
"0.5601406",
"0.5601406",
"0.5601406",
"0.5600948",
"0.55980915",
"0.55948365",
"0.55945337",
"0.55787575",
"0.55787575",
"0.55774826",
"0.5569468",
"0.5569468",
"0.5569468",
"0.5569468",
"0.5569468",
"0.5569468",
"0.5569468",
"0.5569468",
"0.5569468",
"0.5569468",
"0.55554277",
"0.5551572",
"0.55396205",
"0.55384177",
"0.55366343",
"0.55298996",
"0.55282253",
"0.55271274",
"0.5525629",
"0.5498576",
"0.5489503",
"0.5475714",
"0.5452641",
"0.5451642",
"0.5444912",
"0.54356545",
"0.54255646",
"0.542527",
"0.5421951",
"0.5421449",
"0.5419019",
"0.5416518",
"0.54158396",
"0.54147154",
"0.54129416",
"0.54102457",
"0.54082304",
"0.54082304",
"0.5401731",
"0.5396187",
"0.5394125",
"0.5394125",
"0.53935856",
"0.53913224",
"0.53894526",
"0.53855914",
"0.5378186",
"0.53768677",
"0.5364754",
"0.5363605",
"0.535787",
"0.533785"
] | 0.0 | -1 |
The current_user can be found in the JWT payload; eagerly load the user's roles so they can be discriminated against | def current_user
@current_user ||= User.includes(:roles).find_by(id: payload['user_id'])
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def current_user\n @current_user ||= CurrentUser.includes(:roles).find_by(email: id_token[:email])\n end",
"def current_user\n if decode_token\n #returns an array\n #user_id is the key on our payload\n user_id = decode_token[0]['user_id']\n #using user_id to find our user\n @user = User.find_by(id: user_id)\n else\n render json: { message: 'Did not find user.' }, status: :unauthorized \n end\n end",
"def get_current_user\n return if !bearer_token\n decoded_jwt = decode_token(bearer_token)\n User.find(decoded_jwt[0][\"user\"][\"id\"])\n end",
"def current_user\n unless request.format.json?\n @current_user ||= User.find_by_auth_token(cookies[:auth_token]) if cookies[:auth_token]\n end\n @current_user\n end",
"def login_from_jwt_header\n @current_user = if jwt_decoded_payload['sub']\n user_class.sorcery_adapter.find_by_id(jwt_decoded_payload['sub'])\n end\n end",
"def current_jwt_user\n #\n @jwt_user ||= (defined? session and session[:jwt_user]) ? JwtUser.where(id: session[:jwt_user]).first : nil\n end",
"def current_user\n if payload\n @current_user ||= User.find(payload[:user_id])\n else\n @current_user = nil\n end\n end",
"def current_role\n if user_signed_in?\n @current_role ||= current_user.roles.pluck(:name)\n end\n end",
"def current_user\n if decoded_token\n user_id = decoded_token[0]['user_id']\n @user = User.find_by(id: user_id)\n # Returns nil if not found\n end\n end",
"def current_user\n if decoded_token\n # Using the decoded token, grab the user_id stored within it and find a user\n user_id = decoded_token[0]['user_id']\n @user = User.find_by(id: user_id)\n end\n end",
"def current_user\n puts decoded_token\n \n if decoded_token\n # user_id = User.find_by(id: user_id)\n User.find_by(id: decoded_token[0][\"user_id\"])\n\n end\n end",
"def get_current_muser\n return if !bearer_token\n decoded_jwt = decode_token(bearer_token)\n Muser.find(decoded_jwt[0][\"user\"][\"id\"])\n end",
"def current_user\n token_locations = [cookies[:auth_token], ENV['DANGEROUS_AUTH_HACK'], params[:auth_token]]\n token = token_locations.find{|x| !x.blank? }\n if token\n Identity.includes(:person).find_by(token: token).try(:person)\n else\n nil\n end\n end",
"def select\n @users ||= User.role_wise_users(params[:user][:role])\n authorize! :read, @user\n end",
"def current_user\n @current_user ||= User.find_by(token: request.headers[:authorization])\n end",
"def authenticate_user\n return if request.headers['Authorization'].blank?\n\n jwt_payload = JwtHelper.decode(token: request.headers['Authorization'].split(' ').second)\n\n raise JWT::VerificationError if JwtBlacklist.any? { |obj| obj.jti == jwt_payload['jti'] }\n\n @current_user_id = jwt_payload['id']\n end",
"def current_user_role\n current_user.try(:role).try(:to_sym) || :normal\n end",
"def authenticate_user!\n payload = decode_token\n return unless payload.is_a? Hash\n\n @current_user = User.find payload[:user_id]\n end",
"def signed_in_with_roles(user)\n signed_in_with_organization_admin_role(user) if user.has_cached_role? :organization_admin, :any\n signed_in_with_organizer_role(user) if user.has_cached_role? :organizer, :any\n signed_in_with_cfp_role(user) if user.has_cached_role? :cfp, :any\n signed_in_with_info_desk_role(user) if user.has_cached_role? :info_desk, :any\n signed_in_with_volunteers_coordinator_role(user) if user.has_cached_role? :volunteers_coordinator, :any\n signed_in_with_track_organizer_role(user) if user.has_cached_role? :track_organizer, :any\n common_abilities_for_roles(user)\n end",
"def current_user\n payload = TokiToki.decode(bearer_token)\n @current_user ||= User.find_by :github_name => payload[0]['sub']\n end",
"def current_user\n puts \"Finding user: \" + session[:user_id].to_s\n if session[:user_role] == 'Customer'\n @current_user ||= Customer.find_by(CustomerID: session[:user_id])\n else\n @current_user ||= Employee.find_by(EmployeeID: session[:user_id])\n end\n end",
"def find_review_user\n if params[:user_id] && @current_user_roles.include?('admin')\n @current_api_user = Spree.user_class.find(params[:user_id])\n end\n end",
"def current_jwt_auth\n #\n @jwt_auth ||= (defined? session and session[:jwt_auth]) ? JwtToken.where(id: session[:jwt_auth]).first : nil\n end",
"def current_user\n @current_user ||= User.find_by_auth_token(cookies[:auth_token]) if cookies[:auth_token]\n end",
"def authenticate\n \n authenticate_or_request_with_http_token do |token|\n begin\n decoded = decode(token)\n @current_user = User.find_by(id: decoded[0][\"user_id\"]) \n \n rescue JWT::DecodeError\n render json: {authorized: false }, status: 401 \n end\n end \n end",
"def set_current_user\n if decoded_auth_token\n @current_user ||= User.find(decoded_auth_token[:user_id])\n end\n end",
"def set_current_user\n if decoded_auth_token\n @current_user ||= User.find(decoded_auth_token[:user_id])\n end\n end",
"def current_user\n return @current_user if @current_user\n\n purpose = request.url.include?('refresh_token') ? :refresh_token : :access_token\n\n @current_user = AuthorizationTokenValidator.new(\n authorization_token: env['HTTP_AUTHORIZATION'],\n purpose: purpose\n ).call\n end",
"def curAuth\n current_user.role_ids[0]\n end",
"def set_current_user\n if decoded_auth_token\n @current_user ||= User.find_by_id(decoded_auth_token['user_id'])\n end\n end",
"def current_user\n @current_user ||= User.find_by(id: token_user_id)\n end",
"def claims\n get_all_roles\n end",
"def claims\n get_all_roles\n end",
"def user_role\n current_user.role if current_user\n end",
"def current_user\n if access_token.present?\n @current_user ||= Token.find_by_token(access_token)&.user\n end\n end",
"def current_jwt_token\n @jwt_auth ||= session[:jwt_auth] ? JwtToken.where(id: session[:jwt_auth]).first : nil\n end",
"def actual_user\n if @current_user.nil? || session[:cas_user] != @current_user.cas_directory_id\n update_current_user(User.eager_load(*eager_loads).find_by(cas_directory_id: session[:cas_user]))\n end\n @current_user\n end",
"def filter_roles\n if params[:user] && params[:user][:roles]\n params[:user][:roles] = params[:user][:roles].map(&:to_i) & current_user.assignable_roles\n end\n end",
"def current_user\n @current_user ||= User.find_by_auth_token(cookies[:auth_token]) if cookies[:auth_token]\n end",
"def role_object\n (APP_CONFIG[\"user_roles\"]+SYSTEM_DATA[\"user_roles\"]).select{|role| role[\"name\"] == self.role}.first\n end",
"def current_role\n session.has_key?(:role) ? session[:role] : nil\n end",
"def hubssolib_get_user_roles\n user = self.hubssolib_current_user\n user ? user.user_roles.to_authenticated_roles : nil\n end",
"def rails_role_user\n current_user\n end",
"def show(id = @id, user = @@default_user)\n @attributes = send_request(\"roles/#{id}\", :get) do |req|\n req.params = {\n auth_token: user.auth_token\n }\n end\n end",
"def current_user\n @current_user ||= User.includes(:collection).includes(:categories).find_by(\n remember_token: cookies[:remember_token])\n end",
"def current_user\n User.find(:first, :conditions => {:token => session[:user_token]})\n end",
"def current_user\n authenticate_token\n end",
"def current_user\n if auth_token && !@current_user\n if @current_user = User.find_by_auth_token(auth_token)\n @current_user = nil if @current_user.auth_token_expired?\n end\n end\n @current_user\n end",
"def current_user_id\n if request.headers && request.headers['Authorization']\n token = request.headers['Authorization'].split(' ')[1] #[Bearer <token>]\n begin\n decoded_token = JWT.decode(token, 'this should be in .env', true, algorithm: 'HS256')\n if decoded_token\n user_id = decoded_token[0]['user_id'] #[{ \"user_id\"=>\"2\" }, { \"alg\"=>\"HS256\" }]\n end\n rescue JWT::DecodeError\n nil\n end\n end\n end",
"def current_user_has_any_role?(node)\n current_user.present? && current_user.has_any_role?(node)\n end",
"def current_user\n @_current_user ||= authenticate_token\n end",
"def current_user\n @_current_user ||= authenticate_token\n end",
"def get_user\n @user = current_user\n @is_logged_in = user_signed_in? #true fals\n @is_user = @is_logged_in && @user.role =='user'\n @is_admin = @is_logged_in && @user.role =='admin'\n end",
"def current_user\n data[:users][@current_user['id']] ||= @current_user\n data[:identities][@current_user_identity['id']] ||= @current_user_identity\n\n @current_user\n end",
"def my_roles(user)\n user.roles & self.design_review_results.collect { |drr| drr.role }\n end",
"def current_role\n \treturn @current_role if defined? @current_role\n \t@current_role = current_user && current_user.role_symbol\n end",
"def current_user\n # authorization initialization if not run yet\n # (in the case of paper_trial it might not have run)\n authorization_init\n @logged_in_user\n end",
"def current_user\n session[:user_id] ||= cookies[:auth_token]\n @current_user ||= User.includes(:role, :main_room).find_by(id: session[:user_id])\n\n if Rails.configuration.loadbalanced_configuration\n unless @current_user.nil?\n if !@current_user.has_role?(:super_admin) &&\n @current_user.provider != @user_domain\n @current_user = nil\n session.clear\n end\n end\n end\n # Check and create monthly sessions\n @current_user.has_monthly_sessions? unless @current_user.nil?\n\n @current_user\n end",
"def current_user\n @current_user ||= authorize_request\n end",
"def current_user\n @current_user ||= authorize_request\n end",
"def current_user\n @current_user ||= authorize_request\n end",
"def current_user\n\t\tif session[:user_id]\n\t\t\t@current_user = User.find(session[:user_id])\n\t\telse\n\t\t\tapi_key = ApiKey.where(access_token: token_and_options(request)).first\n\t\t\t@current_user = User.find(api_key.user_id) if api_key\n\t\tend\n\tend",
"def authenticate_user\n @token = Token.find_by(auth_token: request.headers['HTTP_AUTH_TOKEN'])\n return render json: { message: 'token invalid' }, status: 422 unless @token\n\n @current_user = @token.user\n end",
"def current_user\n User::TYPES.each do |mapping|\n user = self.send(\"current_#{mapping.to_s.downcase}\")\n return user unless user.nil?\n end\n end",
"def current_user\n auth_token = request.headers['HTTP_AUTH_TOKEN']\n puts auth_token\n @current_user ||= User.find_by(auth_token: auth_token)\n #puts @current_user.name + \" is logged in\"\n end",
"def find_current_user\n Current.user = UserSession.find&.user\n\n return if logged_in?\n\n authenticate_with_http_token do |token, options|\n user = User.find_by(api_token: token)\n return unless user.present?\n\n # Compare the tokens in a time-constant manner, to mitigate timing attacks.\n Current.user = user if ActiveSupport::SecurityUtils.secure_compare(user.api_token, token)\n end\n end",
"def current_user\n @current_user = User.find_by_authentication_token! params[:authentication_token]\n end",
"def current_user\n @current_user ||=\n if @env.key?(\"HTTP_AUTHORIZATION\")\n decoded_credentials =\n Base64.decode64(@env[\"HTTP_AUTHORIZATION\"][/^Basic (.*)$/, 1])\n email, password = decoded_credentials.split(\":\")\n\n login = Login.new(email: email, password: password)\n login.user\n else\n Guest.new\n end\n end",
"def get_user_roles\n @roles = @user.roles.pluck(:name)\n render json: @roles\n end",
"def load_user\n case\n when session[:user_id]\n @current_user = User.find(session[:user_id]) \n when @api_key_allowed && token_provided?(params[:api_key])\n @current_user = User.where(api_key: params[:api_key]).first\n @have_valid_api_key = true\n when token_provided?(cookies[:auth_token])\n @current_user = User.where(auth_token: cookies[:auth_token]).first\n # Sign back automatically.\n sign_in_as(@current_user) unless current_user.nil?\n end\n end",
"def authenticate_user_from_jwt\n _, token = request.headers['Authorization'].split\n decoded_token = AuthToken.decode(token)\n User.find(decoded_token[:user_id])\n rescue NoMethodError\n raise Exceptions::UnauthorizedError\n end",
"def authorize_request\n # request.headers[\"Authorization\"] = JsonWebToken.encode(user_id: 1)\n @current_user = (AuthorizeApiRequest.new(request.headers).call)[:user]\n end",
"def get_user\n if params[:email].nil?\n render json: current_user,\n except: [\n :created_at,\n :updated_at,\n :admin_permissions\n ],\n include: {\n case_cortege: {},\n cortege: {},\n orchestra: {},\n orchestra_signup: {\n include: [\n :orchestra\n ]\n },\n funkis_application: {\n include: [\n funkis_shift_applications: {\n include: [\n funkis_shift: {\n include: [\n :funkis_category\n ],\n except: [\n :maximum_workers\n ]\n }\n ]\n }\n ]\n }\n }\n else\n user = User.find_by email:(params[:email])\n unless user.nil?\n if current_user.has_admin_permission? AdminPermission::ALL\n render json: user,\n include: {\n case_cortege: {},\n cortege: {},\n orchestra: {},\n orchestra_signup: {\n include: [\n :orchestra\n ]\n },\n funkis_application: {\n include: [\n funkis_shift_applications: {\n include: [\n funkis_shift: {\n include: [\n :funkis_category\n ],\n except: [\n :maximum_workers\n ]\n }\n ]\n }\n ],\n }\n }\n elsif current_user.has_admin_permission? AdminPermission::ORCHESTRA_ADMIN\n render json: user, except: [\n :created_at,\n :updated_at,\n :admin_permissions\n ],\n include: {\n orchestra: {},\n orchestra_signup: {\n include: [\n :orchestra\n ]\n }\n }\n\n elsif current_user.has_admin_permission? \\\n AdminPermission::LIST_CORTEGE_APPLICATIONS || AdminPermission::APPROVE_CORTEGE_APPLICATIONS\n render json: user, except: [\n :created_at,\n :updated_at,\n :admin_permissions\n ],\n include: {\n case_cortege: {},\n cortege: {},\n }\n elsif current_user.has_admin_permission? AdminPermission::LIST_FUNKIS_APPLICATIONS\n render json: user, except: [\n :created_at,\n :updated_at,\n :admin_permissions\n ],\n include: {\n case_cortege: {},\n cortege: {},\n orchestra: {},\n orchestra_signup: {\n include: [\n :orchestra\n ]\n },\n funkis_application: {\n include: [\n funkis_shift_applications: {\n include: [\n funkis_shift: {\n include: [\n :funkis_category\n ],\n except: [\n :maximum_workers\n ]\n }\n ]\n }\n ],\n }\n }\n else\n render json: user, except: [\n :created_at,\n :updated_at,\n :permissions\n ]\n end\n else\n render :status => '404', :json => {:message => 'Användare kunde inte hittas'}\n end\n end\n end",
"def current_jwt_context\n @jwt_context ||= session[:jwt_context]\n end",
"def filter_access!\n treat_as get_current_role\n end",
"def current_user\n if session[\"warden.user.user.key\"]\n @current_user ||= User.find(session[\"warden.user.user.key\"][0][0])\n elsif session[\"warden.user.student.key\"]\n @current_user ||= User.find(session[\"warden.user.student.key\"][0][0])\n elsif session[\"warden.user.expert.key\"]\n @current_user ||= User.find(session[\"warden.user.expert.key\"][0][0])\n end\n end",
"def authorize_request\n @current_user = (AUTHORIZER.new(request.headers).call)[:user]\n end",
"def user\n # find a User matching the decoded token if the decode operation was successfull\n user = User.find(decoded_auth_token[:user_id]) if decoded_auth_token\n\n if user\n # return the user if active\n return user if user.active\n\n # Else raise a JWTException Inactive Account\n raise(API::JWTExceptionHandler::InactiveAccount, APIMessages.account_not_active)\n end\n rescue ActiveRecord::RecordNotFound => e\n # Raise an Invalid Token if there is no matching User from db\n raise(API::JWTExceptionHandler::InvalidToken, (\"#{APIMessages.invalid_token} #{e.message}\"))\n end",
"def current_user\n self.data[:users][@current_user[\"id\"]] ||= @current_user\n self.data[:identities][@current_user_identity[\"id\"]] ||= @current_user_identity\n\n @current_user\n end",
"def current_user\n self.data[:users][@current_user[\"id\"]] ||= @current_user\n self.data[:identities][@current_user_identity[\"id\"]] ||= @current_user_identity\n\n @current_user\n end",
"def current_user\n @current_user ||= Resident.where(id: session[:user_id], community_id: session[:commune_id])\n end",
"def logged_in_user\n if decoded_token\n user_id = decoded_token[0]['user_id']\n @user = User.find_by(id: user_id)\n end\n end",
"def logged_in_user\n if decoded_token\n user_id = decoded_token[0]['user_id']\n @user = User.find_by(id: user_id)\n end\n end",
"def set_current_user\n if decoded_auth_token\n begin\n @current_user ||= User.where(active: true).find(decoded_auth_token[:user_id])\n rescue\n raise NotAuthenticatedError\n end\n end\n end",
"def verify_jwt_token\n begin\n if request.format.json?\n token = request.headers['Authorization'].split(' ').last\n decoded_token = JWT.decode token, nil, false\n @current_user = User.find(decoded_token[0][\"user_id\"])\n head :unauthorized if request.headers['Authorization'].nil? || !AuthToken.valid?(token)\n else\n authenticate_user!\n end\n rescue => exception\n head :unauthorized \n end\n end",
"def authorize\n puts \"********** current user app controller *****************\"\n puts @current_user\n puts current_user\n puts '*********************************************************'\n # NOTE: to self: current_user method is called, it then decodes the JSON WEB Token,\n # grabs the user_id, and uses that id to make a query to find the user that matches that id and returns it. Then on that returned user we do a .id to get the id and compare it to the parameter :id\n\n render json: {status: 401, message: \"unauthorized\"} unless current_user.id == params[:id].to_i\n end",
"def current_user\n\t\t@current_user ||= authenticate_token\n\tend",
"def load_roles\n @roles = service_user.identity.roles.keep_if do |role|\n ALLOWED_ROLES.include?(role.name) || user_has_beta_role?(role.name)\n end.sort_by(&:name)\n end",
"def authenticate_request!\n\t\t# unless is if in reverse. If user_id_in_token == false then render error\n\t unless user_id_in_token?\n\t render json: { errors: ['Not Authenticated'] }, status: :unauthorized\n\t return\n\t end\n\t @current_user = User.find(auth_token[:user_id])\n\trescue JWT::VerificationError, JWT::DecodeError\n\t render json: { errors: ['Not Authenticated'] }, status: :unauthorized\n\tend",
"def authenticated_user_with_token\n ApiKey.find_user_with_token(decoded_token)\n end",
"def check_for_user\n if current_user\n @user = current_user\n else\n @user = {}\n end\n render json: @user\n end",
"def authorize_request\n @current_user = (AuthorizeApiRequest.new(request.headers).call)[:user]\n end",
"def authorize_request\n @current_user = (AuthorizeApiRequest.new(request.headers).call)[:user]\n end",
"def authorize_request\n @current_user = (AuthorizeApiRequest.new(request.headers).call)[:user]\n end",
"def authorize_request\n @current_user = (AuthorizeApiRequest.new(request.headers).call)[:user]\n end",
"def authorize_request\n @current_user = (AuthorizeApiRequest.new(request.headers).call)[:user]\n end",
"def authorize_request\n @current_user = (AuthorizeApiRequest.new(request.headers).call)[:user]\n end",
"def authorize_request\n @current_user = (AuthorizeApiRequest.new(request.headers).call)[:user]\n end",
"def authorize_request\n @current_user = (AuthorizeApiRequest.new(request.headers).call)[:user]\n end",
"def authorize_request\n @current_user = (AuthorizeApiRequest.new(request.headers).call)[:user]\n end"
] | [
"0.6946939",
"0.6665169",
"0.65388304",
"0.64807844",
"0.64038014",
"0.63818717",
"0.636937",
"0.6247758",
"0.62351215",
"0.62340903",
"0.62236655",
"0.6103606",
"0.6083097",
"0.6069289",
"0.606571",
"0.6015878",
"0.5993976",
"0.5985258",
"0.5981403",
"0.5970841",
"0.5966524",
"0.5964431",
"0.5957597",
"0.5945216",
"0.59387577",
"0.59237486",
"0.59237486",
"0.5881503",
"0.58786607",
"0.58781844",
"0.5874098",
"0.586465",
"0.586465",
"0.5852541",
"0.5847699",
"0.5841052",
"0.58260876",
"0.5817923",
"0.58168054",
"0.5812465",
"0.57988477",
"0.5787938",
"0.5783506",
"0.57815444",
"0.5767632",
"0.5767457",
"0.57658464",
"0.5749107",
"0.57441795",
"0.57422394",
"0.57269394",
"0.57269394",
"0.5711269",
"0.5710989",
"0.57075614",
"0.5701253",
"0.5700869",
"0.56876796",
"0.56833273",
"0.56833273",
"0.5680528",
"0.5677461",
"0.5669722",
"0.56683946",
"0.5668152",
"0.56536937",
"0.5650851",
"0.5648756",
"0.56465364",
"0.56395227",
"0.5627624",
"0.5624548",
"0.56215364",
"0.56149334",
"0.5607285",
"0.56040937",
"0.5602118",
"0.5600185",
"0.55937153",
"0.55937153",
"0.5592991",
"0.5592101",
"0.5592101",
"0.55730593",
"0.5569988",
"0.5569213",
"0.5567045",
"0.55624694",
"0.55621177",
"0.55564225",
"0.5545461",
"0.55441016",
"0.55441016",
"0.55441016",
"0.55441016",
"0.55441016",
"0.55441016",
"0.55441016",
"0.55441016",
"0.55441016"
] | 0.7442987 | 0 |
Preview this email at | def password_reset
doctor = Doctor.first
doctor.reset_token = Doctor.new_token
DoctorMailer.password_reset(doctor)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def preview\n @email = Email.find(params[:id])\n render :text => @email.body\n end",
"def preview\n @email = DirectEmail.find(params[:id])\n render :text => @email.body\n end",
"def preview\n @email = EventEmail.find(params[:id])\n render :text => @email.body\n end",
"def preview_email\r\n invitation = Invitation.new(:user => current_user, :code => Code.new)\r\n mail = Mailers::Debate.create_invitation(current_user, @resource, invitation)\r\n @mail_body = mail.body.sub('No message provided', 'YOUR PERSONALIZED NOTE GOES HERE')\r\n\r\n render :inline => %Q{<%= simple_format(@mail_body, {:style => 'margin: 8px 0px'}) %>}\r\n end",
"def demo\n preview(DemoMailer.demo)\n end",
"def demo\n preview(DemoMailer.demo)\n end",
"def call(email, params = {})\n preview = new(params)\n message = preview.public_send(email)\n inform_preview_interceptors(message)\n message\n end",
"def call(email)\n preview = self.new\n preview.public_send(email)\n end",
"def preview_newsletter\n @newsletter = @structure.newsletters.friendly.find params[:id]\n\n # Send email to no recipients to generate mail object\n mail = NewsletterMailer.send_newsletter(@newsletter, nil)\n @body = MailerPreviewer.preview(mail)\n\n render layout: false\n end",
"def preview\n task = MailTasks::Task.new( params[:task] )\n recipient = StoreUser.find( params[:id], :include => \"customer\", :readonly => true )\n mail = task.generate_mails( [recipient], false, mail_layout_options ).first\n render :text => mail.content_with_layout( mail_layout_options ), :layout => false\n # rescue => exception\n # headers[\"Content-Type\"] = \"text/plain\"\n # render :text => exception.to_yaml, :layout => false\n end",
"def preview_to(recipient)\n @newsletter = build_newsletter\n mail = build_mail\n mail.to = recipient.email\n replace_and_send_mail_safely(mail, recipient)\n end",
"def show_body\n I18n.with_locale @email_locale do\n @mail_body = mail_body(@preview, @part_type)\n render :show_body, layout: 'rails_email_preview/email'\n end\n end",
"def process_explanation_mail\n petition = Petition.where(status: 'live').first\n PetitionMailer.process_explanation_mail(Petition.live.first)\n end",
"def content_for_preview( layout_options )\r\n content = self.body.dup\r\n content.gsub!( /<%=\\s?(@[^%]+)\\s?%>/, '<code>\\1</code>' )\r\n mail = Mail.new( :token => \"\" )\r\n mail.content = Render::Base.new( content ).mail_content\r\n template = IO.read(\"#{RAILS_ROOT}/app/views/mail_tasks/mailer/this_mail.text.html.rhtml\")\r\n \r\n render = Render::Base.new( template, layout_options.merge( :mail => mail ) )\r\n render.mail_content\r\n end",
"def preview\n frm.button(:value=>\"Preview\").click\n PreviewAnnouncements.new(@browser)\n end",
"def compose_email\n @title = t 'conclusion_draft_review.send_by_email'\n end",
"def preview\n end",
"def preview\n end",
"def show\n @decrypted = @autocrypt.decrypt(@email)\n @reply_params = {\n to: @email.from,\n subject: 'Re: ' + @email.subject,\n body: (@decrypted || @email.body).gsub(/^/, '> ')\n }\n end",
"def preview\n attachments.first.file.url(:preview)\n rescue StandardError => exc\n logger.error(\"Message for the log file while retrieving preview #{exc.message}\")\n 'empty_file.png'\n end",
"def preview\n redirect_to preview_url\n end",
"def preview\n @text = params[:deliverable][:description]\n render :partial => 'common/preview'\n end",
"def preview_announcement(subject)\n frm.link(:text=>subject).click\n PreviewAnnouncements.new(@browser)\n end",
"def show\n if @sent_email.photo.nil?\n @display_name = ''\n @title = ''\n @flickr_url = ''\n else\n @display_name = @sent_email.photo.member.display_name\n @title = @sent_email.photo.title\n @flickr_url = @sent_email.photo.get_flickr_url\n end\n end",
"def preview\n frm.button(:value=>\"Preview\").click\n AssignmentsPreview.new(@browser)\n end",
"def preview\n frm.button(:value=>\"Preview\").click\n AssignmentsPreview.new(@browser)\n end",
"def send_preview(recipients, personalize=\"fallback\")\n options = { :body => {\n :PreviewRecipients => recipients.kind_of?(String) ? [ recipients ] : recipients,\n :Personalize => personalize }.to_json }\n response = post \"sendpreview\", options\n end",
"def create\n @mail = Mail.new(params[:mail])\n @mail.user = current_user\n \n if params[:preview_button] || !@mail.save\n render :action => \"new\"\n else\n flash[:notice] = 'Mail was successfully created.'\n redirect_to(@mail)\n end\n end",
"def last_message_preview=(value)\n @last_message_preview = value\n end",
"def edit\n yield @editor\n @mail = @editor.mail\n @message = @mail.to_s\n end",
"def preview_text\n return @preview_text\n end",
"def preview_text\n return @preview_text\n end",
"def preview\n return @preview\n end",
"def inspect\n \"#<Envelope::Message to=#{formatted_to} from=#{formatted_from} cc=#{formatted_cc} bcc=#{formatted_bcc} reply_to=#{formatted_reply_to} subject=\\\"#{subject}\\\" text_part=\\\"#{preview = (text_part || html_part); (preview && preview.gsub(/\\s+/, ' ') || 'No preview available')[0..50]}...\\\">\"\n end",
"def petition_announcement_mail\n petition = Petition.where(status: 'live').first\n PetitionMailer.petition_announcement_mail(Petition.live.first)\n end",
"def preview\n frm.link(:text=>\"Preview\").click\n PreviewOverview.new(@browser)\n end",
"def preview() @page.find(input_elements[:preview]) end",
"def preview(channel_id, msg_id, data)\n channel_config, message_config, text =\n prepare_message(channel_id, msg_id, data)\n chats = channel_config.chat_ids\n connector = channel_config.connector\n\n if message_allowed?(message_config, data)\n connector.preview(chats, text, message_config)\n else\n puts \"No message sent beacuse it's not allowed\"\n end\n end",
"def improve_and_reopen_mail\n petition = Petition.where(status: 'live').first\n PetitionMailer.improve_and_reopen_mail(Petition.live.first)\n end",
"def hand_over_to_office_mail\n petition = Petition.where(status: 'live').first\n PetitionMailer.hand_over_to_office_mail(Petition.live.first)\n end",
"def content_preview\n self.send(content_preview_method)\n end",
"def write_about_hand_over_mail\n petition = Petition.where(status: 'live').first\n PetitionMailer.write_about_hand_over_mail(Petition.live.first)\n end",
"def preview\n order = current_user.orders.find_by_cookbook_id(params[:id])\n @cookbook = (order) ? order.cookbook : current_cookbook\n preview_path = \"#{PDF_PREVIEW_FOLDER}/preview_cookbook-#{@cookbook.id}_#{Time.now.to_i}.pdf\"\n session[:preview_filename] = preview_path\n preview = CookbookPreviewWorker.new(\n cookbook: @cookbook, \n filename: preview_path\n )\n preview.cookbook\n render \"previews/preview\"\n end",
"def preview=(value)\n @preview = value\n end",
"def preview_path_for_attachment(attachment)\n preview_attachment_path(id: attachment.attachment_data.id, file: attachment.filename.split('.').first, extension: attachment.file_extension)\n end",
"def preview(attachment, options)\n Rails.application.routes.url_helpers.rails_representation_path(attachment.preview(options), only_path: true)\n end",
"def preview_doc\n @tpl = Template.find(params[\"template_id\"]) \n output = @tpl.render_by_model_id(params[:id], 'print', 'www.freightoperations.com:8080')\n render(:text => output, :layout => false) \n end",
"def preview\n frm.button(:value=>\"Preview\").click\n @@file_number=0\n AssignmentStudentPreview.new(@browser)\n end",
"def preview\n frm.button(:value=>\"Preview\").click\n @@file_number=0\n AssignmentStudentPreview.new(@browser)\n end",
"def last_message_preview\n return @last_message_preview\n end",
"def preview\n @preview ||= Preview.new(self) #if has_preview?\n end",
"def tweet_reviewed_by_influencer(tweet)\n @tweet = tweet\n\n set_attachments\n\n mail(to: tweet.campaign.advertiser.user.email, subject: \"Notificaciones @ Social Target - Uno de tus tweets fue revisado/modificado por una empresa\")\n end",
"def body_preview=(value)\n @body_preview = value\n end",
"def preview\n content[0..19]\n end",
"def view(review, recipient)\n @review = review\n\n mail(to: recipient.email, subject: \"#{@review.review_type == \"cto\" ? @review.booking.user.first_name : @review.booking.offer.user.first_name} vous a laissé un commentaire\")\n end",
"def new_review_email (review)\n\t@book = review.book\n\t@review = review\n\tmail :to => @book.readers.collect{|r| r.email},\n\t :subject=>\"New review for #{@book.title}\"\n end",
"def preview(element_key)\n parameter = { basic_auth: @auth }\n self.class.get(\"/elements/#{element_key}/preview\", parameter)\n end",
"def open\n mail = MailTasks::Mail.find_by_token( params[:id] )\n raise ActiveRecord::RecordNotFound unless mail # raise 404 if mail is not found\n \n options = {\n :post_back_url => url_for( :controller => \"/email\", :action => \"red_logo\" ),\n :base => [request.protocol, request.host].join\n }\n render :text => mail.content_with_layout( options ), :layout => false\n end",
"def emailOnMetareview(revieweeId)\r\n puts \"in Metareview\"\r\n participant = Participant.find_by_id(revieweeId).user_id\r\n asstId = Participant.find_by_id(revieweeId).parent_id\r\n user=User.find_by_id(participant)\r\n assignment=Assignment.find_by_id(asstId).name\r\n partialName=\"email_on_review_of_review\"\r\n if(user.email_on_review_of_review)\r\n email(user.email,\"Metareview\",ApplicationHelper::get_user_first_name(user),assignment,partialName)\r\n end\r\n end",
"def body_preview\n return @body_preview\n end",
"def preview(*)\n nil\n end",
"def preview(*)\n nil\n end",
"def preview\n preview_path = \"#{PDF_PREVIEW_FOLDER}/preview_extra_page-#{@extra_page.id}_#{Time.now.to_i}.pdf\"\n session[:preview_filename] = preview_path\n preview = CookbookPreviewWorker.new(\n cookbook: current_cookbook, \n filename: preview_path\n )\n preview.extra_page @extra_page.id\n render \"previews/preview\"\n end",
"def reference_number_mail\n petition = Petition.where(status: 'live').first\n PetitionMailer.reference_number_mail(Petition.live.first)\n end",
"def ask_office_for_answer_mail\n petition = Petition.where(status: 'live').first\n PetitionMailer.ask_office_for_answer_mail(Petition.live.first)\n end",
"def show\n set_retail\n end",
"def preview_name\n name.sub(/Preview$/, '').underscore\n end",
"def preview\n mixpanel_tab_event(\"View Item\", \"Get Preview URL\")\n begin\n embed_url = user_client.embed_url(params[:id])\n redirect_to embed_url\n rescue\n redirect_to no_support_url\n end\n\n end",
"def blog_preview\n object._challenge\n end",
"def show\n session[:applicant_token] = params[:id] unless current_user\n @email = ERB.new(Settings.email_template).result(get_binding)\n p EMAIL: @email\n end",
"def ping_reviewer(review)\n\n to_list = [review[:user].email]\n cc_list = []\n subject = 'Your unresolved Design Review(s)'\n\n @user = review[:user]\n @result = review[:results]\n \n if review[:urgent]\n attachments.inline['warning.png'] = File.read('app/assets/images/warning.png')\n headers['Importance'] = 'high'\n headers['X-Priority'] = '1'\n headers['X-MSMail-Priority'] = 'High'\n end\n\n mail( :to => to_list,\n :subject => subject,\n :cc => cc_list,\n ) \n end",
"def preview_text(maxlength = 30)\n return \"\" if description.blank?\n my_contents = description[\"contents\"]\n return \"\" if my_contents.blank?\n content_flagged_as_preview = my_contents.select { |a| a[\"take_me_for_preview\"] }.first\n if content_flagged_as_preview.blank?\n content_to_take_as_preview = my_contents.first\n else\n content_to_take_as_preview = content_flagged_as_preview\n end\n preview_content = self.contents.select { |content| content.name == content_to_take_as_preview[\"name\"] }.first\n return \"\" if preview_content.blank? || preview_content.essence.blank?\n text = preview_content.essence.preview_text(maxlength)\n text.size > maxlength ? \"#{text[0..maxlength]}...\" : text\n end",
"def link_to_preview(text, type_id, *args)\n link_to_function text, \"CCPEVE.showPreview(#{type_id.inspect})\", *args\n end",
"def preview_text=(value)\n @preview_text = value\n end",
"def preview_text=(value)\n @preview_text = value\n end",
"def resume_confirm(email, username, filename)\n subject 'You have uploaded your resume to YouIntern'\n recipients email\n from 'support@youintern.com'\n sent_on Time.now\n \n body :username => username, :filename => filename\n end",
"def preview_text(max_length = 30)\n attachment&.name.to_s[0..max_length - 1]\n end",
"def display_resume\n\t profile_resume = Profile.find_by_id(params[:id]).resume\n send_data(profile_resume.attachment_binary.data,\n\t\t\t\t :filename => profile_resume.name,\n\t\t\t\t :type => profile_resume.content_type,\n\t\t\t\t :disposition => \"attachment\"\n\t\t\t\t )\n end",
"def generate_complete_timeline_preview_url(given_timeline_id)\n tl_entry_to_use = Timeline.find(given_timeline_id)\n target_page_path = timeline_path(tl_entry_to_use)\n \n protocol_host_port = \"#{request.protocol}#{request.host_with_port}\"\n main_url = \"#{protocol_host_port}#{target_page_path}?preview=true\"\n \n url_to_return = URI::encode(main_url)\n return url_to_return\n end",
"def preview(article)\n unless article.published_at.nil?\n article_path(article)\n else\n preview_path(article.preview_hash)\n end\n end",
"def post_edit_email\n NotificationMailer.post_edit_email('default@email.com')\n end",
"def reviewed(inquiry)\n @inquiry = inquiry\n mail to: inquiry.email, subject: 'Verteo Biopharma Inquiry Reviewed'\n end",
"def update\n @mail = Mail.find(params[:id]) \n if !@mail.update_attributes(params[:mail]) || params[:preview_button]\n \n render :action => \"edit\"\n else\n flash[:notice] = 'Mail was successfully updated.'\n redirect_to(@mail)\n end\n end",
"def to_s\n \"Last Modified: #{@modifiedAt}\\nStatus: #{@status}\\nAssigned to: #{@owner}\\nSubject: #{@subject}\\n#{@preview}\"\n end",
"def show\n #TRACKER.track(current_user['email'], \"READ_EMAIL\", {\"email_id\" => @email.id, \"email_reference\" => @email.reference_id})\n TRACKER.track(current_user['email'], \"READ_EMAIL\", @email.id, @email.reference_id)\n end",
"def preview!(purchase)\n post(purchase, \"#{collection_path}/preview\")\n end",
"def preview!(purchase)\n post(purchase, \"#{collection_path}/preview\")\n end",
"def preview\n begin\n page = Comatose::Page.new(params[:page])\n page.author = current_user\n if params.has_key? :version\n content = page.to_html( {'params'=>params.stringify_keys, 'version'=>params[:version]} )\n else\n content = page.to_html( {'params'=>params.stringify_keys} )\n end\n rescue SyntaxError\n content = \"<p>There was an error generating the preview.</p><p><pre>#{$!.to_s.gsub(/\\</, '<')}</pre></p>\"\n rescue\n content = \"<p>There was an error generating the preview.</p><p><pre>#{$!.to_s.gsub(/\\</, '<')}</pre></p>\"\n end\n render :text=>content, :layout => false\n end",
"def show\n # notification_email\n end",
"def preview\n self.content.split(' ')[0...5].join(' ') + '...'\n end",
"def apply(interviewee,interviewer)\n @interviewee = interviewee\n @interviewer = interviewer\n mail(to: @interviewee.email + \",\" + @interviewer.email, subject: '面接日程承認のお知らせ')\n end",
"def to_s\n '#<Twilio::REST::Preview>'\n end",
"def to_s\n '#<Twilio::REST::Preview>'\n end",
"def email_approved_proposal\n ProposalMailer.email_approved_proposal\n end",
"def preview_submit\n @story = Story.find(params[:submission])\n @story_slam_preview = true # to hide/show certain things in the header\n end",
"def set_preview\n @preview = Preview.find(params[:id])\n end",
"def preview_msg(msg_params_with_name)\n uri = 'cgi-bin/operate_appmsg?sub=preview&t=ajax-appmsg-preview'\\\n \"&type=10&token=#{@token}&lang=zh_CN\"\n headers = {\n referer: 'https://mp.weixin.qq.com/cgi-bin/appmsg?t=media/appmsg_edit'\\\n \"&action=edit&type=10&isMul=0&isNew=1&lang=zh_CN&token=#{@token}\",\n host: 'mp.weixin.qq.com',\n x_requested_with: 'XMLHttpRequest'\n }\n resource = RestClient::Resource.new(@home_url, headers: headers, cookies: @cookies)\n\n res = resource[uri].post msg_params_with_name\n # \"ret\":\"0\", \"msg\":\"preview send success!\", \"appMsgId\":\"201796045\", \"fakeid\":\"\"\n JSON.parse res.to_s\n end",
"def review_posted(email,permalink) \n @service_permalink = permalink \n subject = \"A review was posted for your service\"\n setup_email(email, subject)\n end",
"def preview_cover\n preview_path = \"#{PDF_PREVIEW_FOLDER}/preview_cover-#{current_cookbook.id}_#{Time.now.to_i}.pdf\"\n session[:preview_filename] = preview_path\n preview = CookbookPreviewWorker.new(\n cookbook: current_cookbook, \n filename: preview_path\n )\n preview.cover\n render \"previews/preview\"\n end",
"def emailOnReview(revieweeId)\r\n puts \"we are in email on review\"\r\n @team_member = TeamsUser.find_all_by_team_id(revieweeId)\r\n asstId = Team.find_by_id(revieweeId).parent_id\r\n assignment=Assignment.find_by_id(asstId).name\r\n partialName=\"email_on_review\"\r\n @team_member.each do |team_Member|\r\n # get parameters for sending mail\r\n user=User.find_by_id(team_Member.user_id)\r\n puts \"teammate name = #(user.name)\"\r\n if(user.email_on_review)\r\n email(user.email,\"Review\",ApplicationHelper::get_user_first_name(user),assignment,partialName)\r\n end\r\n end\r\n end",
"def preview_edit\n\n layout_style = nil\n if (params[:layout])\n layout_style = params[:layout]\n end\n\n\n begin\n @bulletin = Bulletin.find(params[:id])\n @bulletin_layout = @bulletin.layout_for_editing(layout_style, self)\n headers[\"Content-Type\"] = @bulletin_layout.filetype + \"; charset=\" + @bulletin_layout.charset\n render :text => @bulletin_layout.rendered, :layout => 'bulletin'\n return\n rescue SyntaxError\n @error = _('A fatal error has occurred while compiling the temlpate!') + \n '<br /><br />ERROR: '+$!\n end\n render :action => 'error', :layout => 'bulletin'\n end"
] | [
"0.71475905",
"0.71186084",
"0.70552814",
"0.6985626",
"0.6848472",
"0.6848472",
"0.6832406",
"0.6663229",
"0.64324814",
"0.631654",
"0.6304366",
"0.6181875",
"0.6167911",
"0.61338973",
"0.61305445",
"0.6115152",
"0.61100966",
"0.61100966",
"0.60882556",
"0.60132533",
"0.5982547",
"0.5970752",
"0.5921947",
"0.5854165",
"0.58256847",
"0.58256847",
"0.5801412",
"0.5798907",
"0.57861274",
"0.5756108",
"0.57435614",
"0.57311475",
"0.5694853",
"0.5693586",
"0.56733876",
"0.56689703",
"0.5667859",
"0.56230783",
"0.5584482",
"0.5580056",
"0.556691",
"0.5565034",
"0.553256",
"0.55282027",
"0.5521174",
"0.55182135",
"0.54865557",
"0.54802716",
"0.54802716",
"0.5475045",
"0.54698133",
"0.5462231",
"0.54592174",
"0.5457588",
"0.54561025",
"0.5434102",
"0.54326165",
"0.5418592",
"0.5416024",
"0.5406969",
"0.5398783",
"0.5398783",
"0.5390498",
"0.53865004",
"0.53677875",
"0.5354904",
"0.53483963",
"0.53450906",
"0.53428084",
"0.5339015",
"0.5331245",
"0.5324016",
"0.5320464",
"0.52986485",
"0.52971554",
"0.52956325",
"0.52885884",
"0.52866477",
"0.52858466",
"0.52848935",
"0.5274558",
"0.52651525",
"0.5261375",
"0.5255958",
"0.52543974",
"0.52372897",
"0.52372897",
"0.5235101",
"0.522828",
"0.5226132",
"0.5213765",
"0.52118236",
"0.52118236",
"0.52064675",
"0.5192629",
"0.5186882",
"0.5167913",
"0.51622766",
"0.5158241",
"0.515572",
"0.5152641"
] | 0.0 | -1 |
Preview this email at | def notification
doctor = Doctor.first
DoctorMailer.notification(doctor)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def preview\n @email = Email.find(params[:id])\n render :text => @email.body\n end",
"def preview\n @email = DirectEmail.find(params[:id])\n render :text => @email.body\n end",
"def preview\n @email = EventEmail.find(params[:id])\n render :text => @email.body\n end",
"def preview_email\r\n invitation = Invitation.new(:user => current_user, :code => Code.new)\r\n mail = Mailers::Debate.create_invitation(current_user, @resource, invitation)\r\n @mail_body = mail.body.sub('No message provided', 'YOUR PERSONALIZED NOTE GOES HERE')\r\n\r\n render :inline => %Q{<%= simple_format(@mail_body, {:style => 'margin: 8px 0px'}) %>}\r\n end",
"def demo\n preview(DemoMailer.demo)\n end",
"def demo\n preview(DemoMailer.demo)\n end",
"def call(email, params = {})\n preview = new(params)\n message = preview.public_send(email)\n inform_preview_interceptors(message)\n message\n end",
"def call(email)\n preview = self.new\n preview.public_send(email)\n end",
"def preview_newsletter\n @newsletter = @structure.newsletters.friendly.find params[:id]\n\n # Send email to no recipients to generate mail object\n mail = NewsletterMailer.send_newsletter(@newsletter, nil)\n @body = MailerPreviewer.preview(mail)\n\n render layout: false\n end",
"def preview\n task = MailTasks::Task.new( params[:task] )\n recipient = StoreUser.find( params[:id], :include => \"customer\", :readonly => true )\n mail = task.generate_mails( [recipient], false, mail_layout_options ).first\n render :text => mail.content_with_layout( mail_layout_options ), :layout => false\n # rescue => exception\n # headers[\"Content-Type\"] = \"text/plain\"\n # render :text => exception.to_yaml, :layout => false\n end",
"def preview_to(recipient)\n @newsletter = build_newsletter\n mail = build_mail\n mail.to = recipient.email\n replace_and_send_mail_safely(mail, recipient)\n end",
"def show_body\n I18n.with_locale @email_locale do\n @mail_body = mail_body(@preview, @part_type)\n render :show_body, layout: 'rails_email_preview/email'\n end\n end",
"def process_explanation_mail\n petition = Petition.where(status: 'live').first\n PetitionMailer.process_explanation_mail(Petition.live.first)\n end",
"def preview\n frm.button(:value=>\"Preview\").click\n PreviewAnnouncements.new(@browser)\n end",
"def content_for_preview( layout_options )\r\n content = self.body.dup\r\n content.gsub!( /<%=\\s?(@[^%]+)\\s?%>/, '<code>\\1</code>' )\r\n mail = Mail.new( :token => \"\" )\r\n mail.content = Render::Base.new( content ).mail_content\r\n template = IO.read(\"#{RAILS_ROOT}/app/views/mail_tasks/mailer/this_mail.text.html.rhtml\")\r\n \r\n render = Render::Base.new( template, layout_options.merge( :mail => mail ) )\r\n render.mail_content\r\n end",
"def preview\n end",
"def preview\n end",
"def compose_email\n @title = t 'conclusion_draft_review.send_by_email'\n end",
"def show\n @decrypted = @autocrypt.decrypt(@email)\n @reply_params = {\n to: @email.from,\n subject: 'Re: ' + @email.subject,\n body: (@decrypted || @email.body).gsub(/^/, '> ')\n }\n end",
"def preview\n attachments.first.file.url(:preview)\n rescue StandardError => exc\n logger.error(\"Message for the log file while retrieving preview #{exc.message}\")\n 'empty_file.png'\n end",
"def preview\n redirect_to preview_url\n end",
"def preview\n @text = params[:deliverable][:description]\n render :partial => 'common/preview'\n end",
"def preview_announcement(subject)\n frm.link(:text=>subject).click\n PreviewAnnouncements.new(@browser)\n end",
"def show\n if @sent_email.photo.nil?\n @display_name = ''\n @title = ''\n @flickr_url = ''\n else\n @display_name = @sent_email.photo.member.display_name\n @title = @sent_email.photo.title\n @flickr_url = @sent_email.photo.get_flickr_url\n end\n end",
"def preview\n frm.button(:value=>\"Preview\").click\n AssignmentsPreview.new(@browser)\n end",
"def preview\n frm.button(:value=>\"Preview\").click\n AssignmentsPreview.new(@browser)\n end",
"def send_preview(recipients, personalize=\"fallback\")\n options = { :body => {\n :PreviewRecipients => recipients.kind_of?(String) ? [ recipients ] : recipients,\n :Personalize => personalize }.to_json }\n response = post \"sendpreview\", options\n end",
"def create\n @mail = Mail.new(params[:mail])\n @mail.user = current_user\n \n if params[:preview_button] || !@mail.save\n render :action => \"new\"\n else\n flash[:notice] = 'Mail was successfully created.'\n redirect_to(@mail)\n end\n end",
"def last_message_preview=(value)\n @last_message_preview = value\n end",
"def edit\n yield @editor\n @mail = @editor.mail\n @message = @mail.to_s\n end",
"def preview_text\n return @preview_text\n end",
"def preview_text\n return @preview_text\n end",
"def preview\n return @preview\n end",
"def inspect\n \"#<Envelope::Message to=#{formatted_to} from=#{formatted_from} cc=#{formatted_cc} bcc=#{formatted_bcc} reply_to=#{formatted_reply_to} subject=\\\"#{subject}\\\" text_part=\\\"#{preview = (text_part || html_part); (preview && preview.gsub(/\\s+/, ' ') || 'No preview available')[0..50]}...\\\">\"\n end",
"def preview\n frm.link(:text=>\"Preview\").click\n PreviewOverview.new(@browser)\n end",
"def preview() @page.find(input_elements[:preview]) end",
"def petition_announcement_mail\n petition = Petition.where(status: 'live').first\n PetitionMailer.petition_announcement_mail(Petition.live.first)\n end",
"def preview(channel_id, msg_id, data)\n channel_config, message_config, text =\n prepare_message(channel_id, msg_id, data)\n chats = channel_config.chat_ids\n connector = channel_config.connector\n\n if message_allowed?(message_config, data)\n connector.preview(chats, text, message_config)\n else\n puts \"No message sent beacuse it's not allowed\"\n end\n end",
"def improve_and_reopen_mail\n petition = Petition.where(status: 'live').first\n PetitionMailer.improve_and_reopen_mail(Petition.live.first)\n end",
"def hand_over_to_office_mail\n petition = Petition.where(status: 'live').first\n PetitionMailer.hand_over_to_office_mail(Petition.live.first)\n end",
"def content_preview\n self.send(content_preview_method)\n end",
"def write_about_hand_over_mail\n petition = Petition.where(status: 'live').first\n PetitionMailer.write_about_hand_over_mail(Petition.live.first)\n end",
"def preview\n order = current_user.orders.find_by_cookbook_id(params[:id])\n @cookbook = (order) ? order.cookbook : current_cookbook\n preview_path = \"#{PDF_PREVIEW_FOLDER}/preview_cookbook-#{@cookbook.id}_#{Time.now.to_i}.pdf\"\n session[:preview_filename] = preview_path\n preview = CookbookPreviewWorker.new(\n cookbook: @cookbook, \n filename: preview_path\n )\n preview.cookbook\n render \"previews/preview\"\n end",
"def preview=(value)\n @preview = value\n end",
"def preview_path_for_attachment(attachment)\n preview_attachment_path(id: attachment.attachment_data.id, file: attachment.filename.split('.').first, extension: attachment.file_extension)\n end",
"def preview(attachment, options)\n Rails.application.routes.url_helpers.rails_representation_path(attachment.preview(options), only_path: true)\n end",
"def preview_doc\n @tpl = Template.find(params[\"template_id\"]) \n output = @tpl.render_by_model_id(params[:id], 'print', 'www.freightoperations.com:8080')\n render(:text => output, :layout => false) \n end",
"def preview\n frm.button(:value=>\"Preview\").click\n @@file_number=0\n AssignmentStudentPreview.new(@browser)\n end",
"def preview\n frm.button(:value=>\"Preview\").click\n @@file_number=0\n AssignmentStudentPreview.new(@browser)\n end",
"def last_message_preview\n return @last_message_preview\n end",
"def preview\n @preview ||= Preview.new(self) #if has_preview?\n end",
"def body_preview=(value)\n @body_preview = value\n end",
"def preview\n content[0..19]\n end",
"def tweet_reviewed_by_influencer(tweet)\n @tweet = tweet\n\n set_attachments\n\n mail(to: tweet.campaign.advertiser.user.email, subject: \"Notificaciones @ Social Target - Uno de tus tweets fue revisado/modificado por una empresa\")\n end",
"def view(review, recipient)\n @review = review\n\n mail(to: recipient.email, subject: \"#{@review.review_type == \"cto\" ? @review.booking.user.first_name : @review.booking.offer.user.first_name} vous a laissé un commentaire\")\n end",
"def preview(element_key)\n parameter = { basic_auth: @auth }\n self.class.get(\"/elements/#{element_key}/preview\", parameter)\n end",
"def new_review_email (review)\n\t@book = review.book\n\t@review = review\n\tmail :to => @book.readers.collect{|r| r.email},\n\t :subject=>\"New review for #{@book.title}\"\n end",
"def open\n mail = MailTasks::Mail.find_by_token( params[:id] )\n raise ActiveRecord::RecordNotFound unless mail # raise 404 if mail is not found\n \n options = {\n :post_back_url => url_for( :controller => \"/email\", :action => \"red_logo\" ),\n :base => [request.protocol, request.host].join\n }\n render :text => mail.content_with_layout( options ), :layout => false\n end",
"def emailOnMetareview(revieweeId)\r\n puts \"in Metareview\"\r\n participant = Participant.find_by_id(revieweeId).user_id\r\n asstId = Participant.find_by_id(revieweeId).parent_id\r\n user=User.find_by_id(participant)\r\n assignment=Assignment.find_by_id(asstId).name\r\n partialName=\"email_on_review_of_review\"\r\n if(user.email_on_review_of_review)\r\n email(user.email,\"Metareview\",ApplicationHelper::get_user_first_name(user),assignment,partialName)\r\n end\r\n end",
"def body_preview\n return @body_preview\n end",
"def preview(*)\n nil\n end",
"def preview(*)\n nil\n end",
"def preview\n preview_path = \"#{PDF_PREVIEW_FOLDER}/preview_extra_page-#{@extra_page.id}_#{Time.now.to_i}.pdf\"\n session[:preview_filename] = preview_path\n preview = CookbookPreviewWorker.new(\n cookbook: current_cookbook, \n filename: preview_path\n )\n preview.extra_page @extra_page.id\n render \"previews/preview\"\n end",
"def reference_number_mail\n petition = Petition.where(status: 'live').first\n PetitionMailer.reference_number_mail(Petition.live.first)\n end",
"def ask_office_for_answer_mail\n petition = Petition.where(status: 'live').first\n PetitionMailer.ask_office_for_answer_mail(Petition.live.first)\n end",
"def show\n set_retail\n end",
"def preview_name\n name.sub(/Preview$/, '').underscore\n end",
"def preview\n mixpanel_tab_event(\"View Item\", \"Get Preview URL\")\n begin\n embed_url = user_client.embed_url(params[:id])\n redirect_to embed_url\n rescue\n redirect_to no_support_url\n end\n\n end",
"def blog_preview\n object._challenge\n end",
"def show\n session[:applicant_token] = params[:id] unless current_user\n @email = ERB.new(Settings.email_template).result(get_binding)\n p EMAIL: @email\n end",
"def ping_reviewer(review)\n\n to_list = [review[:user].email]\n cc_list = []\n subject = 'Your unresolved Design Review(s)'\n\n @user = review[:user]\n @result = review[:results]\n \n if review[:urgent]\n attachments.inline['warning.png'] = File.read('app/assets/images/warning.png')\n headers['Importance'] = 'high'\n headers['X-Priority'] = '1'\n headers['X-MSMail-Priority'] = 'High'\n end\n\n mail( :to => to_list,\n :subject => subject,\n :cc => cc_list,\n ) \n end",
"def preview_text(maxlength = 30)\n return \"\" if description.blank?\n my_contents = description[\"contents\"]\n return \"\" if my_contents.blank?\n content_flagged_as_preview = my_contents.select { |a| a[\"take_me_for_preview\"] }.first\n if content_flagged_as_preview.blank?\n content_to_take_as_preview = my_contents.first\n else\n content_to_take_as_preview = content_flagged_as_preview\n end\n preview_content = self.contents.select { |content| content.name == content_to_take_as_preview[\"name\"] }.first\n return \"\" if preview_content.blank? || preview_content.essence.blank?\n text = preview_content.essence.preview_text(maxlength)\n text.size > maxlength ? \"#{text[0..maxlength]}...\" : text\n end",
"def link_to_preview(text, type_id, *args)\n link_to_function text, \"CCPEVE.showPreview(#{type_id.inspect})\", *args\n end",
"def preview_text=(value)\n @preview_text = value\n end",
"def preview_text=(value)\n @preview_text = value\n end",
"def resume_confirm(email, username, filename)\n subject 'You have uploaded your resume to YouIntern'\n recipients email\n from 'support@youintern.com'\n sent_on Time.now\n \n body :username => username, :filename => filename\n end",
"def preview_text(max_length = 30)\n attachment&.name.to_s[0..max_length - 1]\n end",
"def generate_complete_timeline_preview_url(given_timeline_id)\n tl_entry_to_use = Timeline.find(given_timeline_id)\n target_page_path = timeline_path(tl_entry_to_use)\n \n protocol_host_port = \"#{request.protocol}#{request.host_with_port}\"\n main_url = \"#{protocol_host_port}#{target_page_path}?preview=true\"\n \n url_to_return = URI::encode(main_url)\n return url_to_return\n end",
"def display_resume\n\t profile_resume = Profile.find_by_id(params[:id]).resume\n send_data(profile_resume.attachment_binary.data,\n\t\t\t\t :filename => profile_resume.name,\n\t\t\t\t :type => profile_resume.content_type,\n\t\t\t\t :disposition => \"attachment\"\n\t\t\t\t )\n end",
"def preview(article)\n unless article.published_at.nil?\n article_path(article)\n else\n preview_path(article.preview_hash)\n end\n end",
"def post_edit_email\n NotificationMailer.post_edit_email('default@email.com')\n end",
"def reviewed(inquiry)\n @inquiry = inquiry\n mail to: inquiry.email, subject: 'Verteo Biopharma Inquiry Reviewed'\n end",
"def update\n @mail = Mail.find(params[:id]) \n if !@mail.update_attributes(params[:mail]) || params[:preview_button]\n \n render :action => \"edit\"\n else\n flash[:notice] = 'Mail was successfully updated.'\n redirect_to(@mail)\n end\n end",
"def to_s\n \"Last Modified: #{@modifiedAt}\\nStatus: #{@status}\\nAssigned to: #{@owner}\\nSubject: #{@subject}\\n#{@preview}\"\n end",
"def show\n #TRACKER.track(current_user['email'], \"READ_EMAIL\", {\"email_id\" => @email.id, \"email_reference\" => @email.reference_id})\n TRACKER.track(current_user['email'], \"READ_EMAIL\", @email.id, @email.reference_id)\n end",
"def preview!(purchase)\n post(purchase, \"#{collection_path}/preview\")\n end",
"def preview!(purchase)\n post(purchase, \"#{collection_path}/preview\")\n end",
"def preview\n begin\n page = Comatose::Page.new(params[:page])\n page.author = current_user\n if params.has_key? :version\n content = page.to_html( {'params'=>params.stringify_keys, 'version'=>params[:version]} )\n else\n content = page.to_html( {'params'=>params.stringify_keys} )\n end\n rescue SyntaxError\n content = \"<p>There was an error generating the preview.</p><p><pre>#{$!.to_s.gsub(/\\</, '<')}</pre></p>\"\n rescue\n content = \"<p>There was an error generating the preview.</p><p><pre>#{$!.to_s.gsub(/\\</, '<')}</pre></p>\"\n end\n render :text=>content, :layout => false\n end",
"def preview\n self.content.split(' ')[0...5].join(' ') + '...'\n end",
"def show\n # notification_email\n end",
"def to_s\n '#<Twilio::REST::Preview>'\n end",
"def to_s\n '#<Twilio::REST::Preview>'\n end",
"def apply(interviewee,interviewer)\n @interviewee = interviewee\n @interviewer = interviewer\n mail(to: @interviewee.email + \",\" + @interviewer.email, subject: '面接日程承認のお知らせ')\n end",
"def email_approved_proposal\n ProposalMailer.email_approved_proposal\n end",
"def preview_submit\n @story = Story.find(params[:submission])\n @story_slam_preview = true # to hide/show certain things in the header\n end",
"def set_preview\n @preview = Preview.find(params[:id])\n end",
"def preview_msg(msg_params_with_name)\n uri = 'cgi-bin/operate_appmsg?sub=preview&t=ajax-appmsg-preview'\\\n \"&type=10&token=#{@token}&lang=zh_CN\"\n headers = {\n referer: 'https://mp.weixin.qq.com/cgi-bin/appmsg?t=media/appmsg_edit'\\\n \"&action=edit&type=10&isMul=0&isNew=1&lang=zh_CN&token=#{@token}\",\n host: 'mp.weixin.qq.com',\n x_requested_with: 'XMLHttpRequest'\n }\n resource = RestClient::Resource.new(@home_url, headers: headers, cookies: @cookies)\n\n res = resource[uri].post msg_params_with_name\n # \"ret\":\"0\", \"msg\":\"preview send success!\", \"appMsgId\":\"201796045\", \"fakeid\":\"\"\n JSON.parse res.to_s\n end",
"def preview_cover\n preview_path = \"#{PDF_PREVIEW_FOLDER}/preview_cover-#{current_cookbook.id}_#{Time.now.to_i}.pdf\"\n session[:preview_filename] = preview_path\n preview = CookbookPreviewWorker.new(\n cookbook: current_cookbook, \n filename: preview_path\n )\n preview.cover\n render \"previews/preview\"\n end",
"def review_posted(email,permalink) \n @service_permalink = permalink \n subject = \"A review was posted for your service\"\n setup_email(email, subject)\n end",
"def preview_edit\n\n layout_style = nil\n if (params[:layout])\n layout_style = params[:layout]\n end\n\n\n begin\n @bulletin = Bulletin.find(params[:id])\n @bulletin_layout = @bulletin.layout_for_editing(layout_style, self)\n headers[\"Content-Type\"] = @bulletin_layout.filetype + \"; charset=\" + @bulletin_layout.charset\n render :text => @bulletin_layout.rendered, :layout => 'bulletin'\n return\n rescue SyntaxError\n @error = _('A fatal error has occurred while compiling the temlpate!') + \n '<br /><br />ERROR: '+$!\n end\n render :action => 'error', :layout => 'bulletin'\n end",
"def emailOnReview(revieweeId)\r\n puts \"we are in email on review\"\r\n @team_member = TeamsUser.find_all_by_team_id(revieweeId)\r\n asstId = Team.find_by_id(revieweeId).parent_id\r\n assignment=Assignment.find_by_id(asstId).name\r\n partialName=\"email_on_review\"\r\n @team_member.each do |team_Member|\r\n # get parameters for sending mail\r\n user=User.find_by_id(team_Member.user_id)\r\n puts \"teammate name = #(user.name)\"\r\n if(user.email_on_review)\r\n email(user.email,\"Review\",ApplicationHelper::get_user_first_name(user),assignment,partialName)\r\n end\r\n end\r\n end"
] | [
"0.7148097",
"0.7118316",
"0.70554626",
"0.6983837",
"0.6848186",
"0.6848186",
"0.6831797",
"0.66628146",
"0.6432127",
"0.6314473",
"0.6301628",
"0.61805815",
"0.6167137",
"0.6134986",
"0.61325854",
"0.6116219",
"0.6116219",
"0.6111137",
"0.6084831",
"0.6016193",
"0.5987876",
"0.5973401",
"0.5923656",
"0.58525056",
"0.5830576",
"0.5830576",
"0.5802649",
"0.57975614",
"0.57884544",
"0.57534206",
"0.57475513",
"0.5735005",
"0.56996673",
"0.569123",
"0.56751263",
"0.5672906",
"0.56717473",
"0.5623967",
"0.5584179",
"0.557865",
"0.5571335",
"0.55633086",
"0.55368453",
"0.55342185",
"0.55232453",
"0.55208904",
"0.548973",
"0.5485324",
"0.5485324",
"0.54761684",
"0.5475641",
"0.546386",
"0.5462067",
"0.54612374",
"0.5454331",
"0.5436504",
"0.5431917",
"0.5414687",
"0.54133755",
"0.5410702",
"0.5405009",
"0.5405009",
"0.5393956",
"0.538491",
"0.5366117",
"0.5354621",
"0.5354137",
"0.53494906",
"0.5345953",
"0.53343326",
"0.533015",
"0.53284234",
"0.5325212",
"0.53026086",
"0.5301146",
"0.52934086",
"0.5290488",
"0.52892685",
"0.52883166",
"0.5287757",
"0.5271332",
"0.52622163",
"0.52618545",
"0.52567494",
"0.52520114",
"0.5241059",
"0.5241059",
"0.523862",
"0.5230366",
"0.52248764",
"0.5214624",
"0.5214624",
"0.5210681",
"0.52043736",
"0.5197302",
"0.5192274",
"0.5168362",
"0.51614016",
"0.5160714",
"0.51560205",
"0.5153214"
] | 0.0 | -1 |
Called by Devise Method checks to see if the user is enabled (it will therefore not allow a user who is disabled to log in) | def active_for_authentication?
super and self.enabled?
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def can_log_in?\n !disabled\n end",
"def active_for_authentication?\n super && !disabled\n end",
"def check_enabled\n return if current_user.enabled\n\n render(json: format_error(request.path, \"Estas inhabilitado\"), status: 401)\n end",
"def active_for_authentication? \n super && (self.is_disabled == 0)\n end",
"def active_for_authentication?\n super && !self.is_disabled\n end",
"def active_for_authentication?\n super && !disabled?\n end",
"def enabled?\n user.present?\n end",
"def active_for_authentication?\n super && !disabled?\n end",
"def active_for_authentication?\n super and !self.disabled?\n end",
"def user_enabled\n redirected = false\n if ((producer_signed_in? && current_producer.enabled == false) || (customer_signed_in? && current_customer.enabled==false)) && redirected == false\n redirected = true\n render 'producers/not_allowed'\n end\n false\n end",
"def active_for_authentication?\n super && self.enabled? && self.is_allowed_in?\n end",
"def active_for_authentication?\n super && !banned\n end",
"def disabled?\n user.nil?\n end",
"def active_for_authentication?\n super && !disabled_at\n end",
"def active_for_authentication?\n super && !banned?\n end",
"def require_login\n if !current_user\n flash[:alert] = \"You must login first\"\n redirect_to root_path\n elsif current_user.disabled && current_user.disabled_until && current_user.disabled_until > Time.now\n flash[:alert] = \"Your account has been temporarily disabled, try again after \" + current_user.disabled_until.in_time_zone(current_user.timezone).to_s(:FHM)\n logger.info(\"request by temp disabled user\")\n redirect_to root_path\n elsif current_user.disabled && current_user.disabled_until.nil?\n flash[:alert] = \"You account has been locked\"\n logger.info(\"request by permanently disabled user\")\n redirect_to root_path\n else\n return false # User is logged in ok.\n end\n return true # User is not logged in or account has been disabled.\n end",
"def active_for_authentication?\n super && un_blocked?\n end",
"def active_for_authentication?\n !deactivated? && super\n end",
"def active_for_authentication?\n super and self.locked != 1\n end",
"def active_for_authentication?\n super && !suspended_account\n end",
"def active_for_authentication?\n super && activation_status == true\nend",
"def allow_access\n !@current_user.nil?\n end",
"def active_for_authentication?\n super && !self.blocked\n end",
"def active_for_authentication?\n super && !self.blocked\n end",
"def can_login?\n\t\t\t!disabled? && !locked?\n end",
"def active_for_authentication?\n super && !access_locked?\n end",
"def enable_user(username)\n begin\n p = get_permissions(username)\n if !p\n raise \"Username not found\"\n end\n p[:enabled] = true\n p.save!\n if !p.persisted?\n raise \"Failed to save user data for #{username}\"\n end\n return true\n rescue\n return false\n end\n end",
"def require_active_user\n unless current_user && current_user.status == UserStatus::ACTIVE\n flash[:alert]= I18n.t 'auth.msg.lock_account'\n redirect_to new_user_sessions_url\n return false\n end\n end",
"def check_admin\n if current_user && current_user.admin\n logger.info \"[auth] Allowed for #{current_user.email}\"\n true\n else\n logger.info (\"[auth] Access Denied\")\n redirect_to new_user_session\n end\n end",
"def active_for_authentication?\n super && !deactivated_at\n end",
"def active_for_authentication?\n super && !deactivated_at\n end",
"def active_for_authentication?\n super && !deactivated_at\n end",
"def disabled?\n\t\t\tuserAccountControl.to_i & UAC_ACCOUNT_DISABLED != 0\n\t\tend",
"def active_for_authentication?\n super && !self.deactivated # i.e. super && self.is_active\n end",
"def active_for_authentication?\n super && account_active?\n end",
"def active_for_authentication? \n super && approved? \n end",
"def active_for_authentication?\n super && !deleted_at && self.enabled?\n end",
"def active_for_authentication?\n super && !self.deactivated_staff?\n end",
"def active_for_authentication?\n super && active\n end",
"def active_for_authentication?\n super && approved?\n end",
"def active_for_authentication?\n super && approved?\n end",
"def active_for_authentication?\n super && approved?\n end",
"def active_for_authentication?\n super && approved?\n end",
"def active_for_authentication?\n super && approved?\n end",
"def active_for_authentication?\n super && approved?\n end",
"def active_for_authentication?\n super && approved?\n end",
"def active_for_authentication?\r\n super && active_status?\r\n end",
"def active_for_authentication?\n super && approved?\n end",
"def disable\n\t\tif user = check_admin\n\t\t\ttarget_user = User.find_by(id: params[:id])\n\t\t\ttarget_user.toggle!(:enabled)\n\t\t\tredirect_back fallback_location: '/home'\n\t\tend\n\tend",
"def active_for_authentication? \n super && is_approved? \n end",
"def active_for_authentication?\n super && active?\n end",
"def active_for_authentication?\n super && active?\n end",
"def active_for_authentication?\n super && active?\n end",
"def disable_user(username)\n begin\n p = get_permissions(username)\n if !p\n raise \"Username not found\"\n end\n p[:enabled] = false\n p.save!\n if !p.persisted?\n raise \"Failed to save user data for #{username}\"\n end\n return true\n rescue\n return false\n end\n end",
"def check_session_validity\n if @current_user && @current_user.disabled_at\n sign_out @current_user\n redirect_to root_path, alert: 'Your account has been disabled by an administrator. Please contact us if you think this is incorrect.'\n end\n end",
"def active_for_authentication?\n super && isActive\n end",
"def active_for_authentication? \n super && (approved? || self.admin) \n end",
"def active_for_authentication?\n active? && super\n end",
"def active_for_authentication? \n \tsuper && approved?\n \t\n\tend",
"def active_for_authentication?\n super && is_active?\n end",
"def active_for_authentication?\n super && self.approved?\n end",
"def active_for_authentication?\n super && self.is_active?\n end",
"def active_for_authentication?\n super && bloqueado == 0\n end",
"def active_for_authentication?\n super && assigned?\n end",
"def enable\n if disabled?\n Cratus::LDAP.replace_attribute(\n dn,\n Cratus.config.user_account_control_attribute,\n ['512']\n )\n refresh\n else\n true\n end\n end",
"def check_is_login_required\n authorized_denied unless logged_in?\n end",
"def disabled?\n @disabled ||= (user_configuration_from_key('disabled') || false)\n end",
"def disabled?\n @disabled ||= (user_configuration_from_key('disabled') || false)\n end",
"def restricted?\n return ( self.user_type == User::USER_TYPE_NORMAL )\n end",
"def enable_or_disable\n @user = User.find(params[:id])\n begin\n if(@user.user_type == 'e')\n @user.user_type = 'd'\n if(@user.update_attributes(params[:user]))\n flash[:notice] = \"User #{@user.name} disabled\"\n end\n else if(@user.user_type == 'd')\n @user.user_type = 'e'\n if(@user.update_attributes(params[:user]))\n flash[:notice] = \"User #{@user.name} enabled\"\n end\n end\n end\n rescue Exception => e\n flash[:notice] = \"Exception in enable_or_disable: \" + e.message\n end\n respond_to do |format|\n format.html { redirect_to(users_url) }\n format.xml { head :ok }\n end\n end",
"def active_for_authentication?\n\t\tsuper && (self.is_active)\n\tend",
"def enable\n user = User.find_by_username params[:username]\n raise ActiveRecord::RecordNotFound unless user\n\n command = EnableUserCommand.new(user, current_user, request.remote_ip)\n begin\n command.execute\n rescue => e\n flash['error'] = \"#{e}\"\n else\n flash['success'] = \"User #{user.username} enabled.\"\n ensure\n redirect_back fallback_location: user_url(user)\n end\n end",
"def get_user\r\n @current_user = current_user\r\n\tif current_user\r\n\t\tif current_user.disabled\r\n\t\t\tflash[:alert] = \"Your account has been disabled\"\r\n\t\t\tsign_out current_user\r\n\t\t\tredirect_to new_session_path(), :alert => \"Your account has been disabled\"\r\n\t\tend\r\n\t\t#only_beci\r\n\t\t\r\n\tend\r\n end",
"def users_only\n deny_access(\"Necesitas crear una cuenta para entrar a esta sección\") unless signed_in?\n end",
"def active_for_authentication?\n super && !expired?\n end",
"def check_user_status\n user = current_user\n if user && user.status != 2\n redirect_to signupcode_settings_path\n end\n end",
"def disable\n authorize! @user\n @user.enabled = false\n @user.save\n @user.owned_extensions.update_all(enabled: false)\n redirect_to root_path, notice: t(\"user.disabled\", name: @user.username)\n end",
"def users_only\n unless logged_in?\n redirect_to(:sign_in)\n return false\n end\n\n return true\n end",
"def admin_required\n self.current_user != :false && \n self.current_user.is_admin? ? true : access_denied\n end",
"def authenticate_user\n render_403 'Invalid user.' if @user.blank? || !@user.active?\n end",
"def require_login\n !!current_user || access_denied\n end",
"def enable_admin\n if current_user.admin?\n user = User.find(params[:id])\n user.update_attribute(\"admin\", true)\n redirect_to \"/users\"\n else\n redirect_to \"/home\"\n flash[:warning] = \"Only admins can perform that action.\"\n end\n end",
"def login_required\n logged_in? ? true : access_denied\n end",
"def client_login_disabler\n unless Spree::Auth::Disabler::Config[:client_login_enabled]\n # TODO: add variants of workaround (404 and so on)\n if (user = User.find_by_email(params[:user_session]['login'])) && (!user.has_role? :admin)\n flash[:error] = t('spree_auth_disabler.client_login_disabled')\n redirect_to root_url \n end\n end\n end",
"def user_is_admin?\n ALLOWED_USERS.include? current_user.email\n end",
"def change_is_enabled\n member = Member.find params[:id]\n user = User.find(member.user_id)\n Member.change_student_status(member)\n if member.is_enabled == true\n redirect_to users_url, :flash => { :success => \"#{user.first_name} #{user.last_name} has been enabled.\" }\n else\n redirect_to users_url, :flash => { :success => \"#{user.first_name} #{user.last_name} has been disabled.\" }\n end\n end",
"def valid_user\n if logged_in?\n user = current_user\n unless (user.activated?)\n redirect_to root_url\n end\n end\n end",
"def active_for_authentication?\n super && !deleted? && approved?\n end",
"def active_for_authentication?\n super && !deleted? && approved?\n end",
"def login_required\n logged_in? ? true : access_denied\n end",
"def user_authorized?(user)\n user == current_user || is_admin?\n end",
"def active_for_authentication?\n super && self.active? # i.e. super && self.active\n end",
"def allow_login?\n return (not is_throttled?)\n end",
"def active_for_authentication?\n super\n end",
"def skip_authentication?\n devise_controller? ||\n (%w[update_cart empty_cart terms_of_service]\n .include?(params[:action]) && !guests_disabled?)\n end",
"def login_required\n not_authorized unless current_user\n end",
"def enable\n account = Account.for(\"github\").with_username(params[:id]).first!\n @user = User.unscoped.where(id: account.user_id).first\n authorize! @user\n @user.enabled = true\n @user.save\n redirect_back fallback_location: root_path, notice: t(\"user.enabled\", name: @user.username)\n end",
"def allowedusers_only\n \n\t\tallowed_users=[VendorPortal::Application.config.operationadmin.to_s,VendorPortal::Application.config.operationuser.to_s,VendorPortal::Application.config.vendor.to_s]\n\t\n if !current_user.userrole.in?(allowed_users)\n redirect_to root_path, :alert => \"Access denied.\"\n end\n end",
"def allowedusers_only\n \n\t\tallowed_users=[VendorPortal::Application.config.operationadmin.to_s,VendorPortal::Application.config.operationuser.to_s,VendorPortal::Application.config.vendor.to_s]\n\t\n if !current_user.userrole.in?(allowed_users)\n redirect_to root_path, :alert => \"Access denied.\"\n end\n end",
"def allowedusers_only\n \n\t\tallowed_users=[VendorPortal::Application.config.operationadmin.to_s,VendorPortal::Application.config.operationuser.to_s,VendorPortal::Application.config.vendor.to_s]\n\t\n if !current_user.userrole.in?(allowed_users)\n redirect_to root_path, :alert => \"Access denied.\"\n end\n end"
] | [
"0.7692359",
"0.7690379",
"0.7635548",
"0.7605066",
"0.7587088",
"0.7581947",
"0.75737923",
"0.75180733",
"0.74985397",
"0.74653685",
"0.74278986",
"0.74155974",
"0.741463",
"0.73746705",
"0.73154527",
"0.7205409",
"0.7035429",
"0.6936015",
"0.6934793",
"0.6925597",
"0.6916802",
"0.69026953",
"0.6898822",
"0.6898822",
"0.6879975",
"0.6834009",
"0.68306226",
"0.68285197",
"0.68198025",
"0.681069",
"0.681069",
"0.681069",
"0.6807305",
"0.68007344",
"0.67791736",
"0.6771588",
"0.67531353",
"0.67516285",
"0.6751495",
"0.6751188",
"0.6751188",
"0.6751188",
"0.6751188",
"0.6751188",
"0.6751188",
"0.6751188",
"0.6734746",
"0.67095226",
"0.6703786",
"0.670363",
"0.66827214",
"0.66827214",
"0.66827214",
"0.66793317",
"0.6679052",
"0.66779566",
"0.6661995",
"0.664632",
"0.6644974",
"0.66372323",
"0.6597006",
"0.6588412",
"0.65880084",
"0.6566513",
"0.6546155",
"0.6538056",
"0.65343857",
"0.65328735",
"0.6520081",
"0.65187687",
"0.6498932",
"0.64866257",
"0.64829284",
"0.64682937",
"0.64682114",
"0.6466909",
"0.6457874",
"0.64341885",
"0.64319175",
"0.6430798",
"0.6427695",
"0.64184964",
"0.64090925",
"0.64011693",
"0.6390796",
"0.6372773",
"0.63631225",
"0.63516694",
"0.63516694",
"0.6348754",
"0.63482463",
"0.6343863",
"0.63084745",
"0.63066363",
"0.63050693",
"0.63022584",
"0.6296301",
"0.62856644",
"0.62856644",
"0.62856644"
] | 0.7231575 | 15 |
called after the user has been destroyed delete all user maps | def delete_maps
own_maps.each do | map |
logger.debug "deleting map #{map.inspect}"
map.destroy
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def clear_users\n @users = {}\n end",
"def clear_users\n @users = {}\n end",
"def finalize!\n @users = nil if @users == UNSET_VALUE\n end",
"def destroy\n @usermap.destroy\n respond_to do |format|\n format.html { redirect_to usermaps_url, notice: 'Usermap was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def unload!\n @versions = nil\n @version_json = {}\n @last_update = {}\n @maps = {}\n @mappings = nil\n end",
"def destroy\n @user_info.destroy\n end",
"def userinfo_unset\n userinfo_set nil\n end",
"def teardown\n\n\n @city.destroy()\n User.destroy_all()\n\n end",
"def purge!\n @map = {}\n end",
"def delete\n\t\tcurrent_user\n\t\tcurrent_user.regexpressions.destroy_all\n\t\tcurrent_user.tasks.destroy_all\n\t\tcurrent_user.clouds.destroy_all\n\t\tcurrent_user.platforms.destroy_all\n\t\tcurrent_user.demos.destroy_all\n\t\tcurrent_user.favorites.destroy_all\n\tend",
"def destroy\n @mapuser.destroy\n respond_to do |format|\n format.html { redirect_to mapusers_url, notice: 'Mapuser was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def clear_users_cache\n GridState.all_users = nil\n end",
"def destroy\n @user_mapping.destroy\n respond_to do |format|\n format.html { redirect_to user_mappings_url, notice: 'User mapping was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @mind_map.destroy\n end",
"def after_destroy(user)\n expire_cache_for(user)\n end",
"def teardown\n @user = nil\n end",
"def teardown\n User.delete_all\n end",
"def destroy\n remove_user_associations\n @user.destroy\n session[:user_id] = nil\n redirect_to login_path\n end",
"def cleanup_locations\n Location.all.each do |location|\n location.destroy if has_different_location_uid?(location)\n end\n end",
"def remove_users\r\n @userAdmin.destroy\r\n @user2.destroy\r\n @user3.destroy\r\n end",
"def forget_everything\n empty_session!\n PersistentUser.new(@user).delete\n end",
"def cleanup\n self.profile.destroy if self.profile\n end",
"def before_destroy_user\n indestructible_demo_user\n\n self.opml_import_job_state.opml_import_failures.delete_all\n self.opml_import_job_state.delete\n self.opml_export_job_state.delete\n self.refresh_feed_job_states.delete_all\n self.subscribe_job_states.delete_all\n\n self.folders.delete_all\n self.entry_states.delete_all\n\n # feed subscriptions are deleted WITH callbacks, to take care of the possible deletion of feeds with no more\n # subscribed users\n self.feed_subscriptions.destroy_all\n end",
"def after_destroy(user)\n # Default\n object_roles = []\n # Find all ObjectRole records that point to this user's ID.\n begin\n object_roles = ObjectRole.find_all_by_user_id(user.id)\n rescue\n end\n # Walk through 'em\n # Not executed if anything happens (array.size = 0)\n for object_role in object_roles\n object_role.destroy\n end\n end",
"def teardown\n remove_user :login_id => @user.login_id\n end",
"def cdb_destroy\n couchdb.delete(\"webui_user\", @name, @couchdb_rev)\n end",
"def before_destroy\n super\n self.remove_all_owners\n self.remove_all_members\n self.remove_all_account_configs\n self.delete_all_custom_services\n end",
"def clear_user_and_mark_purged\n random_suffix = (('0'..'9').to_a + ('a'..'z').to_a).sample(8).join\n\n self.studio_person_id = nil\n self.name = nil\n self.username = \"#{SYSTEM_DELETED_USERNAME}_#{random_suffix}\"\n self.current_sign_in_ip = nil\n self.last_sign_in_ip = nil\n self.email = ''\n self.hashed_email = ''\n self.parent_email = nil\n self.encrypted_password = nil\n self.uid = nil\n self.reset_password_token = nil\n self.full_address = nil\n self.properties = {}\n\n self.purged_at = Time.zone.now\n\n save!\n end",
"def before_destroy\n self.user.entry_states.where(entry_id: self.feed.entries).delete_all\n self.feed.refresh_feed_job_states.where(user_id: self.user.id).destroy_all\n self.feed.subscribe_job_states.where(user_id: self.user.id).destroy_all\n\n folder = self.feed.user_folder self.user\n folder.feeds.delete self.feed if folder.present?\n\n # If triggered by the destruction of user or feed, do not update timestamps, there's no need\n unless destroyed_by_association\n touch_subscriptions\n touch_user_data\n end\n end",
"def destroy\n @user_file_mapping.destroy\n respond_to do |format|\n format.html { redirect_to user_file_mappings_url, notice: 'User file mapping was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def remove_everything_about_testuser\n list_of_activerecords = [\n Follow.find_by(leader_id: TESTUSER_ID),\n Follow.find_by(user_id: TESTUSER_ID),\n Mention.find_by(username: TESTUSER_NAME),\n Tweet.find_by(user_id: TESTUSER_ID),\n User.find_by(username: TESTUSER_NAME)\n ]\n list_of_activerecords.each { |ar| destroy_and_save(ar) }\nend",
"def teardown\n @user_admin = nil\n @user_admin_details = nil\n\n @user_normal = nil\n @user_normal_details = nil\n\n session[:user_id] = nil\n end",
"def destroy\n @user_trick.destroy\n end",
"def destroy_everything\n destroy_user_key_columns\n destroy_user_key_organizations\n destroy_whitelists\n destroy_approvals\n destroy_user_keys\n destroy_users\n destroy_comments\n destroy_filters\n destroy_columns\n destroy_organizations\n end",
"def remove_all_keys\n\t\tdelete(\"/user/keys\")\n\tend",
"def remove_all_keys\n\t\tdelete(\"/user/keys\")\n\tend",
"def clear_cache\n CacheManagement::User.new([@user.id]).clear\n CacheManagement::UserSecure.new([@user.id]).clear\n end",
"def inactive_cleanup\n # Finds referenced micropost from user's map and deletes itself\n user = User.find_by(:id => self.user_id)\n user.current_tasks_map = user.current_tasks_map.delete_if {|h| h[\"micropost id\"] == self.id}\n user.save\n\n # Finds and removes all associated Delayed Jobs still lurking in the system\n garbage_jobs = Delayed::Job.where(:owner_type => \"Micropost\", \n :owner_id => self.id\n )\n garbage_jobs.each do |job|\n job.delete\n end\n end",
"def delete_user(username)\n\t\t\t\t@session['datastore'][username] = nil\n\t\t\tend",
"def clear\n factory_map.clear\n end",
"def destroy\n @map.destroy\n\n head :no_content\n end",
"def clear\n self.map.clear\n end",
"def destroy\n @user_company_mapping.destroy\n respond_to do |format|\n format.html { redirect_to user_company_mappings_url, notice: 'User company mapping was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def clear_all()\n User.destroy_all\n Hashtag.destroy_all\n Mention.destroy_all\n Tweet.destroy_all\n Follow.destroy_all\n # Hashtag_tweets.destroy_all\nend",
"def teardown\n PersistentUser.new(TEST_USER).delete\n Time.use_system_time\n clear_change_log\n end",
"def destroy\n review_response_maps.each(&:destroy)\n super\n end",
"def destroy_users\n user = User.find(params[:id])\n \n # Delete user\n user.destroy\n\n # Sign out of any machines user is on\n Devise.sign_out_all_scopes ? sign_out : sign_out(:user)\n set_flash_message! :notice, :destroyed\n \n @users = User.all\n render \"manage\"\n end",
"def unload\n @members.clear\n @loaded = false\n end",
"def destroy\n\t\t@user.delete\n\tend",
"def reset!\n logs.remove\n features.remove\n users.remove\n end",
"def destroy_all_test_users\n test_users.each(&:destroy)\n self.test_users = []\n end",
"def delete\n self.users.each do |id|\n user = User.find_by_id(id)\n next if user.nil?\n user.databases.delete(self._id)\n user.working_db_id = nil if user.working_db == self\n user.save\n end\n super\n end",
"def teardown\n delete_goo_models(LinkedData::Models::Project.all)\n delete_goo_models(LinkedData::Models::Ontology.all)\n delete_goo_models(LinkedData::Models::User.all)\n @projectParams = nil\n @user = nil\n @ont = nil\n @p = nil\n end",
"def remove_expired_keys\n self.user_key.each do |user_key|\n if user_key.expired?\n self.remove_user_key(user_key)\n user_key.delete\n end\n end\n end",
"def unload\n @all = nil\n end",
"def teardown\n super\n delete_goo_models(LinkedData::Models::Review.all)\n delete_goo_models(LinkedData::Models::Ontology.all)\n delete_goo_models(LinkedData::Models::User.all)\n @review_params = nil\n @user = nil\n @ont = nil\n end",
"def remove_all_authentications\n current_user.authentications = []\n current_user.save\n render :text => \"Your Auths Are Destroy\"\n end",
"def destroy\n @user_schedule.destroy\n\n @user = User.find(session[:user_id])\n @user_locations = UserLocation.find_all_by_user_id(session[:user_id])\n\n respond_to do |format|\n format.js {}\n end\n end",
"def destroy\n find_user\n # check if logged in & if user exists\n @user.destroy\n # also destorys all attending events that contains the user_id\n end",
"def finalize\n Pez.destroy_all\n Comida.destroy_all\n Tiburon.destroy_all\n end",
"def destroy\n @user = User.find_by(uuid:params[:uuid])\n @user.characters.all.each do |x| x.destroy end\n @user.answers.all.each do |x| x.destroy end\n @user.destroy\n redirect_to users_path\n end",
"def destroy\n @session[:user_id] = nil\n @current_user = nil\n end",
"def destroy\n @fw_baidu_map = current_user.baidu_maps.find(params[:id])\n @fw_baidu_map.destroy\n\n respond_to do |format|\n format.html { redirect_to fw_baidu_maps_url }\n format.json { head :no_content }\n end\n end",
"def empty_users\n user_list = Array.new(self.users)\n user_list.each { |id| remove_user User.find_by_id(id) }\n end",
"def wipe_all\n return unless current_user.user_role.can_delete_users\n\n user_role = UserRole.find_by(name: 'User')\n\n users = user_role.users\n users.each(&:destroy)\n flash[:notice] = 'Sytem Wiped of all normal users'\n redirect_to root_path\n end",
"def remove_unregistered_users\n User.where(person: nil).where('created_at < ?', USER_GRACE_PERIOD.ago).destroy_all\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n redirect_to look_up_colonies_path\n\n end",
"def destroy\n @user_location.destroy\n\n respond_to do |format|\n format.html { redirect_to user_locations_url }\n format.json { head :no_content }\n end\n end",
"def destroy_user_data(user_id)\n # ap(destroy_user_data: {user_id: user_id})\n @user_data.remove(\"_id\" => BSON::ObjectId(user_id))\n end",
"def destroy_tokens\n if saved_change_to_address? || destroyed?\n tokens = ['recovery']\n Token.where(:user_id => user_id, :action => tokens).delete_all\n end\n end",
"def destroy\r\n\t\t\tif @user != nil\r\n\t\t\t\t@user.quit\r\n\t\t\tend\r\n\t\t\tsuper\r\n\t\tend",
"def cleanup\n cleanup_accounts\n end",
"def cleanup\n @transition_map.each do |type, events_to_transition_arrays|\n events_to_transition_arrays.each do |event, transitions|\n transitions.clear\n end\n end\n\n @transition_map = nil\n @state_machine = nil\n @entry_actions = nil\n @exit_actions = nil\n end",
"def invalidate_users_cache\n users.reload.map(&:touch)\n end",
"def clear_map_view\n set :map_view, nil\n end",
"def clean\n\t\t\n\t\t@db.del 'twitter'\n\t\t@db.del 'rpg'\n\t\n\tend",
"def logout\n $redis.del \"userhash:#{session['userhash']}\"\n session['userhash']=nil\n session['user']=nil\n end",
"def Elimina_Utente()\n Category.delete_all(user_id: self.id)\n Dish.delete_all(user_id: self.id)\n Ingredient.delete_all(user_id: self.id)\n Medium.destroy_all(user_id: self.id)\n Menu.delete_all(user_id: self.id)\n Profile.destroy_all(user_id: self.id)\n self.destroy()\n end",
"def destroy\n REDIS.srem REDIS_SET, @user.id\n self.class.broadcast\n end",
"def destroy\n get_map\n @map.destroy\n\n respond_to do |format|\n format.html { redirect_to maps_url }\n format.json { head :no_content }\n end\n end",
"def unload\n @structures = []\n @controllers = []\n @helpers = @helpers.is_a?(Array) ? @helpers.select { |h| h.options[:unloadable] == false } : []\n @authenticators = {}\n @shared_actions = {}\n @default_access = nil\n end",
"def destroy\n return super unless mti_class?\n shard_wrangler.destroy\n if ActiveRecord::IdentityMap.enabled? and persisted?\n ActiveRecord::IdentityMap.remove(self)\n end\n @destroyed = true\n freeze\n end",
"def remove_user(user)\n self.users.delete(user.user_id)\n user.databases.delete(self._id)\n self.save\n user.save\n end",
"def remove\r\n session_user.details.select { |d| d.key =~ /^cc_/ }.each { |d| d.destroy }\r\n render :text => \"Craftsman Club details wiped clean.\"\r\n end",
"def destroy\n current_user.tasks.all.each do |c|\n c.update({tag_ids: []})\n c.destroy\n end\n current_user.tags.all.each do |g|\n g.destroy\n end\n current_user.categories.all.each do |t|\n t.destroy\n end\n super\n end",
"def cleanup_old_person\n\t\tself.person_was.destroy if self.person_was && self.person_was.show_positions.count == 0 && self.person_was.netid.blank?\n\tend",
"def logout\n\t\t\tPicombo::Session.instance.unset('loggedin')\n\t\t\tPicombo::Session.instance.unset('user')\n\t\tend",
"def clear\n if namespace\n keys.each do |key|\n delete(key)\n end\n delete(KEYS_ADDRESS)\n else\n database.clear\n end\n end",
"def destroy\r\n super\r\n @areas.dup.each do |area|\r\n area.destroy\r\n end\r\n @areas = nil\r\n Game.instance.remove_continent(self)\r\n return\r\n end",
"def destroy\n @my_map = current_my_map\n if @way_point.my_map_id == @my_map.id\n @way_point.destroy\n session[:my_map_id] = nil\n respond_to do |format|\n format.html { redirect_to @my_map }\n format.json { head :no_content }\n end\n else\n redirect_to @my_map\n end\n end",
"def clean_up\n self.user_thread = nil\n self.uid = nil\n self.internal_date = nil\n self.raw_eml = nil\n self.envelope = nil\n self.message_id = nil\n self.sha1 = nil\n self.mail_log = nil\n end",
"def destroy\n @user_allergen.destroy\n end",
"def destroy_simple_game\n Zone.destroy_all\n ZoneHolder.destroy_all\n User.destroy_all\n Team.destroy_all\n Task.destroy_all\n Hint.destroy_all\n Code.destroy_all\n CodeString.destroy_all\n TeamCode.destroy_all\n TeamHint.destroy_all\n Log.destroy_all\n Game.destroy_all\nend",
"def clear_all_in_database\n Tweet.destroy_all\n User.destroy_all\n Follow.destroy_all\n end",
"def clear_all_in_database\n Tweet.destroy_all\n User.destroy_all\n Follow.destroy_all\n end",
"def clear\n set :map_view, nil\n set :data_set, nil\n end",
"def after_destroyed\n end",
"def did_destroy\n @destroyed = true\n self.class.identity_map.delete self.id\n self.class.all.delete self\n\n trigger_events(:destroy)\n end",
"def destroy\n\t\t#logout method is defined in helper file\n\t\tsession[:user_id] = nil\n\t\tredirect_to root_path\n\tend"
] | [
"0.71513337",
"0.7066254",
"0.70412266",
"0.68661004",
"0.6790899",
"0.67540103",
"0.6628399",
"0.65500426",
"0.65495676",
"0.6542638",
"0.65141034",
"0.651373",
"0.6508905",
"0.6505024",
"0.64683336",
"0.6451432",
"0.64459807",
"0.63865954",
"0.6368416",
"0.63560957",
"0.6343761",
"0.6290655",
"0.6284781",
"0.6263136",
"0.62540597",
"0.6248906",
"0.62215304",
"0.6210939",
"0.6141243",
"0.61186904",
"0.611116",
"0.6093734",
"0.60859936",
"0.6066317",
"0.60636437",
"0.60636437",
"0.6054006",
"0.6053601",
"0.6030698",
"0.6022603",
"0.6008195",
"0.60060376",
"0.6001711",
"0.59963",
"0.5994542",
"0.5991203",
"0.59726363",
"0.59688824",
"0.59674174",
"0.5963116",
"0.59566814",
"0.59533185",
"0.5949888",
"0.59460926",
"0.59384906",
"0.59235597",
"0.59103936",
"0.59051764",
"0.5903016",
"0.5893533",
"0.5890596",
"0.5890474",
"0.58903015",
"0.58880174",
"0.5887042",
"0.5874176",
"0.5863983",
"0.58634573",
"0.5853166",
"0.58419836",
"0.5836881",
"0.5834714",
"0.5834522",
"0.58219963",
"0.581433",
"0.5807705",
"0.5801884",
"0.5799289",
"0.5786676",
"0.5783577",
"0.5759778",
"0.5758479",
"0.5758237",
"0.57555056",
"0.57552236",
"0.57507336",
"0.57431734",
"0.5742256",
"0.57416016",
"0.57364243",
"0.57333255",
"0.5731614",
"0.5724824",
"0.5723018",
"0.5723018",
"0.5722009",
"0.5719158",
"0.5718115",
"0.5717209"
] | 0.7356118 | 1 |
Set meta tags for the page. See MetaTags::ViewHelperset_meta_tags for details. | def set_meta_tags(meta_tags)
self.meta_tags.update(meta_tags)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_page_meta_tags\n req = self.request\n set_meta_tags_for_url_path(req.base_url, req.fullpath)\n end",
"def set_meta\n meta.tap do |m|\n m.tag = [{\n system: META_SYSTEM,\n code: META_CODE,\n display: META_DISPLAY\n }]\n end\n end",
"def setExtractMetaTags(value)\n @fields['extract_meta_tags'] = value\n self\n end",
"def meta_tag(*tags, &block)\n content_for(:meta_tags) { tags }\n content_for(:meta_tags) { concat(capture( &block), block.binding) if block_given? }\n end",
"def []=(name, value)\n @meta_tags[name] = value\n end",
"def set_meta_tags_title\n set_meta_tags site: 'benradler.com'\n end",
"def set_meta\n puts 'meta'\n end",
"def prepare_meta_tags(options={})\n site_name = I18n.t('meta_tag.site_name')\n title = I18n.t('meta_tag.title')\n description = I18n.t('meta_tag.description')\n image = options[:image] || ActionController::Base.helpers.image_url('/homepage/teaser_bg.jpg')\n current_url = request.url\n\n # Let's prepare a nice set of defaults\n defaults = {\n site: site_name,\n title: title,\n image: image,\n description: description,\n keywords: %w[bookmarks web mobile free application],\n twitter: {\n site_name: site_name,\n site: '@wundermarks',\n card: 'summary',\n description: :description,\n image: image\n },\n og: {\n url: current_url,\n site_name: site_name,\n title: :title,\n image: image,\n description: :description,\n type: 'website'\n }\n }\n\n options.reverse_merge!(defaults)\n\n set_meta_tags options\n end",
"def update_meta_tag(key, value)\n set_meta_tags({key => value})\n end",
"def dynamic_meta_tags\n @meta_tag_object = (@r_object || @page)\n return unless @meta_tag_object\n return unless @meta_tag_object.respond_to?(:meta_tags)\n meta_tags_list = []\n\n @meta_tag_object.meta_tags.each do |meta_tag|\n meta_tags_list << content_tag(:meta, \"\", name: meta_tag.meta_key, content: meta_tag.meta_value)\n end\n\n raw(meta_tags_list.join(\" \"))\n end",
"def set_meta_tags_for_url_path(base_url, request_fullpath)\n\n page_title = t(LOCALE_TITLE_KEY, default: SiteMetaInfoDefaults.title)\n page_desc = t(LOCALE_DESCRIPTION_KEY, default: SiteMetaInfoDefaults.description)\n\n set_meta_tags site: SiteMetaInfoDefaults.site_name,\n title: page_title,\n description: page_desc,\n keywords: create_keywords\n\n set_page_meta_images\n\n set_og_meta_tags(site_name: SiteMetaInfoDefaults.site_name,\n title: helpers.full_page_title(page_title: page_title),\n description: page_desc,\n type: t(LOCALE_TYPE_KEY, default: SiteMetaInfoDefaults.og_type),\n base_url: base_url,\n fullpath: request_fullpath)\n\n set_facebook_meta_tags\n\n set_twitter_meta_tags(card: t(LOCALE_TWITTER_CARD_KEY, default: SiteMetaInfoDefaults.twitter_card_type))\n\n end",
"def meta_tags\n @meta_tags ||= MetaTagsCollection.new\n end",
"def set_site_meta_tags\n config = ZanoboRails::Crawlable.configuration\n\n site_ids = {\n separator: config.page_title_sitename_separator,\n reverse: config.page_title_sitename_pos == 'right'\n }\n\n if config.gplus_id.present?\n site_ids[:publisher] = \"https://plus.google.com/#{config.gplus_id}\"\n end\n if config.twitter_id.present?\n site_ids[:twitter] = \"@#{config.twitter_id}\"\n end\n if config.fb_app_id.present?\n site_ids[:fb] = { app_id: \"@#{config.fb_app_id}\" }\n end\n if config.site_name.present?\n site_ids[:open_graph] = { site_name: config.site_name }\n site_ids[:site] = config.site_name\n end\n\n set_meta_tags(site_ids)\n end",
"def render_custom(tags)\n meta_tags.meta_tags.each do |name, data|\n Array(data).each do |val|\n tags << Tag.new(:meta, :name => name, :content => val)\n end\n meta_tags.extract(name)\n end\n end",
"def set_tags(page)\n tags = page.data['tags']\n\n if tags\n tags = (tags.kind_of?(Array) ? tags : tags.split)\n else\n tags = []\n end\n\n tags << page.data['category']\n page.data['tags'] = tags.sort\n end",
"def set_seo_meta(title,keywords = '',desc = '')\n if title\n @page_title = \"#{title}\"\n if params[:page]\n @page_title += \" » (First#{params[:page]}Page)\"\n end\n @page_title += \" » #{@setting.site_name}\"\n else\n @page_title = @setting.site_name\n end\n @meta_keywords = keywords\n @meta_description = desc\n end",
"def meta(meta_data)\n @_meta = meta_data\n end",
"def initialize(meta_tags)\n @meta_tags = meta_tags\n @normalized_meta_tags = {}\n end",
"def initialize(meta_tags)\n @meta_tags = meta_tags\n @normalized_meta_tags = {}\n end",
"def render_custom(tags)\n meta_tags.meta_tags.each do |name, data|\n Array(data).each do |val|\n tags << Tag.new(:meta, configured_name_key(name) => name, :content => val)\n end\n meta_tags.extract(name)\n end\n end",
"def build_meta_tags(with: Metatags::BaseMetatags, instance: nil)\n self.meta_tags = with.new(instance, view_context)\n end",
"def set_meta_tags_for_company(company)\n co_meta_info = CompanyMetaInfoAdapter.new(company)\n\n set_meta_tags title: co_meta_info.title,\n description: co_meta_info.description,\n keywords: co_meta_info.keywords,\n og: { title: helpers.full_page_title( page_title: co_meta_info.title),\n description: co_meta_info.og[:description] }\n\n end",
"def prepare_meta_tags(options = {})\n defaults = {\n author: nil,\n authors: [],\n description: nil,\n description_og: nil,\n description_twitter: nil,\n images: [],\n #is_duplicate?: false,\n # # used to determine if we should rel=canonical, true if viewing a paginated\n # just comparing request url to canonical for now\n # form of a full-page-enabled resource\n keywords: [],\n nofollow?: false,\n noindex?: false,\n page: nil, # Have to throw this into the title\n pages: nil, # along with this\n title: nil, # Just the descriptive part of the title\n #title_format: nil, # Title with placeholders for sitename, pages, and separators\n # disabling this for now, because getting it to with with meta-tags\n # current title passing scheme would require reading placement and\n # then monkey-patching parameters\n #title_separator: '|', #set this at higher level # '-', 'on', ':', etc\n #title_site_name_position: 'right', #set this at higher level\n #title_site_name: SITE_IDS[:NAME], # provided earlier on, meta-tags ties to other site identifier tags\n title_og: nil,\n title_twitter: nil,\n type: 'page', # og and twitter need types, we generate from our map if missing\n type_og: nil,\n type_twitter: nil,\n video: nil,\n url: nil, # canonical, required by og \"#{request.url}\"\n url_current: request.url,\n url_next: nil, # if paged and no full-page alternative\n url_prev: nil, # if paged and no full-page alternative\n }\n options.reverse_merge! defaults\n\n # @todo Raise some errors if mandatory things are missing as required by\n # og and twitter, i.e.\n # We want this to fill out as much as possible, but it needs a base of info\n # description\n # title (except certain cards...)\n # url - this is the big one, always needed\n # image_url - for og\n if options[:url].blank?\n raise MetaTagError, 'No url defined for content, required by OG and needed if protocol different from canonical'\n end\n\n # initialize return array\n return_values = {\n author: [],\n og: { image: []},\n twitter: { creator: []}\n }\n\n # Authors\n options[:authors] << options[:author] if options[:author]\n options[:authors].each do |author|\n if author.has_key?(:gplus_id) and (id = author[:gplus_id])\n return_values[:author] << \"https://plus.google.com/#{id}\"\n end\n if author.has_key?(:twitter_id)\n return_values[:twitter][:creator] << id\n end\n end\n\n # Descriptions\n return_values[:description] = options[:description]\n return_values[:og][:description] = options[:description_og]\n return_values[:twitter][:description] = options[:description_twitter]\n\n # Images\n # @todo existence checks and warnings for sizes, AR, filesize, etc\n # @todo Need to take in all images and distribute to each stream according to size appropriateness,\n # unless specifically tagged to a stream\n\n # Images - OG\n # @todo pass https url through secure_url, width and height once after\n # https://github.com/kpumuk/meta-tags/issues/63 is resolved\n options[:images].each do |image|\n if image.has_key? :url\n return_values[:og][:image] << image[:url]\n\n #if image.has_key? :width and image.has_key? :height\n # return_values[:og][:image][:width] = image[:width].to_i\n # return_values[:og][:image][:height] = image[:height].to_i\n #end\n end\n end\n\n # Images - Twitter\n # Falls back to open graph, let's rely on that for now\n # @todo Support custom images for twitter\n\n # Keywords\n return_values[:keywords] = options[:keywords]\n\n # Noindex, nofollow\n # @todo Build in checking for if these are turned off for this object type somewhere\n return_values[:noindex] = options[:noindex?]\n return_values[:nofollow] = options[:nofollow?]\n\n # Titles\n return_values[:og][:title] = options[:title_og] if options[:title_og]\n return_values[:twitter][:title] = options[:title_twitter] if options[:title_twitter]\n\n #if options.has_key)[:title_format]\n # #if options[:title_page_format]\n #\n # end\n # return_values[:title] = options[:title_format].gsub(['special','characters'],['value','otherval'])\n #else\n if options[:pages] and options[:page] and options[:pages] > 1 and options[:page] > 1\n return_values[:title] = [\n options[:title],\n t('pagination.page_x_of_y', page: options[:page], pages: options[:pages])\n ]\n else\n return_values[:title] = options[:title]\n end\n #end\n\n # Types\n og_content_type = options[:type_og]\n if og_content_type and ZanoboRails::Crawlable.content_types_for(:og).include? og_content_type\n return_values[:og][:type] = og_content_type\n elsif type_provided = (general_type = options[:type] and ZanoboRails::Crawlable.general_content_types.include? general_type)\n return_values[:og][:type] = ZanoboRails::Crawlable::Advisor.og_content_type_for(general_type)\n else\n # Type is REQUIRED, we really should test for required values.\n return_values[:og][:type] = ZanoboRails::Crawlable::Advisor.recommend(:content_type, :og).to_s\n end\n\n twitter_content_type = options[:type_twitter]\n if twitter_content_type and ZanoboRails::Crawlable.content_types_for(:twitter).include? twitter_content_type\n return_values[:twitter][:type] = twitter_content_type\n elsif type_provided\n return_values[:twitter][:type] = ZanoboRails::Crawlable.twitter_content_type_for(general_type)\n else\n # Type is REQUIRED\n return_values[:twitter][:type] = ZanoboRails::Crawlable::Advisor.recommend(:content_type, :twitter).to_s\n end\n\n # URLS\n # og:url\n # twitter:url\n # rel=canonical\n return_values[:og][:url] = options[:url]\n return_values[:twitter][:url] = options[:url]\n return_values[:canonical] = options[:url] unless request.url == options[:url]\n return_values[:next] = options[:url_next]\n return_values[:prev] = options[:url_prev]\n\n # Video\n #og:video => {\n # :director => 'http://www.imdb.com/name/nm0000881/',\n # :writer => ['http://www.imdb.com/name/nm0918711/', 'http://www.imdb.com/name/nm0177018/']\n #}\n\n # Tell og and twitter to use primary description and title if nothing is customized to them\n return_values[:og][:description] = :description if return_values[:og][:description].nil?\n return_values[:twitter][:description] = :description if return_values[:twitter][:description].nil?\n return_values[:og][:title] = :title if return_values[:og][:title].nil?\n return_values[:twitter][:title] = :title if return_values[:twitter][:title].nil?\n\n return_values\n end",
"def seo_for_page\n PAGE_SEO_META.each do |meta|\n send(\"set_#{meta}_key\", \"#{seo_condition[:prefix]}#{meta}\")\n end\n\n set_title_variables(seo_variables)\n end",
"def meta_tag(name, content)\n\t\ttag(:meta, name: name, content: content)\n\tend",
"def set_record_metatags! tags, record\n tags['title'] = record.name\n tags['description'] = record.excerpt if record.respond_to?(:excerpt)\n tags['og:url'] = wm_url_for(record)\n tags['og:type'] = 'article'\n tags['og:image'] = record.thumbnail.url if record.try(:thumbnail).present?\n tags['og:article:published_time'] = record.created_at.to_s(:db)\n tags['og:article:modified_time'] = record.updated_at.to_s(:db)\n tags['og:article:section'] = record.category&.name if record.is_a?(Article)\n tags['twitter:card'] = 'summary'\n\n set_locale_metatags!(tags, record) if record.try(:translatable?)\n set_static_page_metatags!(tags, record) if record.is_a?(StaticPage)\n set_video_metatags!(tags, record) if record.try(:vimeo_metadata).present?\n end",
"def render_meta_tags\n item = find_item\n\n if item.present?\n @meta_tags = item.meta_tags.published\n render meta_tags: @meta_tags\n end\n end",
"def meta_tags_with_multi_site=(tags)\n self.save if self.new_record?\n # just skip the whole method if the tags string hasn't changed\n return if tags == tag_list\n\n # Find site\n site_id = self.homepage_site.id\n\n # do we need to delete any tags?\n tags_to_delete = tag_list.split(MetaTag::DELIMITER) - tags.split(MetaTag::DELIMITER)\n tags_to_delete.select{|t| meta_tags.delete(MetaTag.find_by_name_and_site_id(t, site_id))}\n\n tags.split(MetaTag::DELIMITER).each do |tag|\n begin\n MetaTag.find_or_create_by_name_and_site_id(tag.strip.squeeze(\" \"), site_id).taggables << self\n rescue ActiveRecord::StatementInvalid => e\n # With SQLite3 - a duplicate tagging will result in the following message:\n # SQLite3::SQLException: SQL logic error or missing database: INSERT INTO taggings (\"meta_tag_id\", \"taggable_type\", \"taggable_id\") VALUES(11, 'Page', 74)\n # raise unless e.to_s =~ /duplicate/i\n end\n end\n end",
"def assign_resource_meta_tags\n assign_meta_tags(resource_meta_tags)\n end",
"def meta_tags(hash)\n meta_information.merge!(hash)\n end",
"def meta_tag(name, content = '')\n tag(:meta, :name => name, :content => content)\n end",
"def meta name, contents\n Tagz.tag :meta, :name => name, :contents => contents \n end",
"def get_meta_tags\n if @content_package\n\n if @content_package.meta_image_uid\n image = \"#{Settings.site_url}#{@content_package.meta_image.thumb('1200x630#').url}\"\n elsif @content_package.respond_to?(:hero_image) && @content_package.hero_image.present?\n image = \"#{Settings.site_url}#{@content_package.hero_image.thumb('1200x630#').url}\"\n end\n\n meta_title = @content_package.meta_title.presence || Settings.default_meta_title\n meta_description = @content_package.meta_description.presence || Settings.default_meta_description\n meta_keywords = @content_package.meta_keywords.presence || Settings.default_meta_keywords\n if @content_package.hide_from_robots?\n meta_hide_from_robots = \"<meta name='robots' content='noindex, nofollow' />\\n\"\n end\n\n else\n meta_title = content_for(:title) || Settings.default_meta_title\n meta_description = content_for(:description) || Settings.default_meta_description\n meta_keywords = content_for(:keywords) || Settings.default_meta_keywords\n meta_hide_from_robots = nil\n end\n\n meta_description = strip_tags CGI.unescapeHTML(meta_description.strip)\n\n meta_image = image || content_for(:meta_image) || \"#{Settings.site_url}#{asset_path(Settings.default_fb_meta_image)}\"\n\n meta_values = [meta_title, meta_description, meta_image, meta_keywords, meta_hide_from_robots]\n\n pig_meta_tags(meta_values)\n end",
"def meta_tag(content, options={})\n options = { \"content\" => content }.update(options)\n tag(:meta, options)\n end",
"def tags=(tags)\n\t\t\tupdate_metadata(:tags => tags)\n\t\t\t@metadata.attributes.update do |u|\n\t\t\t\tu.set(:tags => tags)\n\t\t\t\tu.add(:idenity => 1)\n\t\t\tend\n\t\t\treturn nil\n\t\tend",
"def add_meta(meta)\n self.meta.merge!(meta)\n self\n end",
"def set_meta_builder pairs\n pairs.each_pair do |token,klass|\n attr_meta_builder(token) unless meta_builders.has_key?(token)\n self.meta_builders[token] = klass\n end\n end",
"def show\n set_meta_tags og: {\n url: \"#{request.base_url + request.original_fullpath}\",\n type: \"website\",\n title: \"#{@news.title} Software Libre y Codigo Abierto Panama\",\n description: @news.news_content.content,\n site_name: \"floss-pa\",\n image: \"https://floss-pa.net/images/logo.png}\"\n }\n set_meta_tags twitter: {\n card: \"summary\",\n description: @news.news_content.content,\n title: @news.title,\n creator: \"@flosspa\",\n image: {\n _: \"https://floss-pa.net/images/logo.png}\",\n width: 100,\n height: 100,\n },\n domain: \"Floss-pa\"\n }\n\n\n set_meta_tags author: user_custom_path(@news.user,@news.user.name.gsub(/\\s/,'-'))\n end",
"def render_tag(tags, name, value, itemprop: nil)\n name_key ||= configured_name_key(name)\n tags << Tag.new(:meta, name_key => name.to_s, :content => value, :itemprop => itemprop) if value.present?\n end",
"def set_locale_meta_tags\n set_meta_tags(og: {locale: t('locale.short-code', default: 'en_US')} )\n # @todo When we support multiple locales, pull them in below\n #alternate: { \"fr\" => \"http://yoursite.fr/alternate/url\",\n # \"de\" => \"http://yoursite.de/alternate/url\" }\n end",
"def metatags(**options)\n itemprop = options.dig(:config, :itemprop)\n safe_join(\n options.fetch(:value, []).map { |v| content_tag(:meta, nil, itemprop: itemprop, content: v) }\n )\n end",
"def setTags(tags)\r\n\t\t\t\t\t@tags = tags\r\n\t\t\t\tend",
"def set_market_category_meta_tags\n return unless @market_category && params[:category_id]\n @page_title ||= @market_category.name\n end",
"def set_tags(given_tags = {})\n @tags.merge!(given_tags)\n end",
"def set_tags(tags)\n @tags.update(tags)\n end",
"def render_with_normalization(tags, name)\n value = TextNormalizer.public_send(\"normalize_#{name}\", meta_tags.extract(name))\n normalized_meta_tags[name] = value\n tags << Tag.new(:meta, name: name, content: value) if value.present?\n end",
"def set_page_meta_info(custom_extended_data = {})\n service_response = GetPageMetaInfo.new(\n controller: params[:controller],\n action: params[:action],\n request_url: request.url,\n custom_extended_data: custom_extended_data\n ).perform\n\n unless service_response.success?\n raise 'Incomplete Page Meta.'\n end\n\n page_extended_data = service_response.data\n\n @page_meta_data = page_extended_data[:meta]\n @page_assets_data = page_extended_data[:assets]\n end",
"def set_page_meta_info(custom_extended_data = {})\n service_response = GetPageMetaInfo.new(\n controller: params[:controller],\n action: params[:action],\n request_url: request.url,\n custom_extended_data: custom_extended_data\n ).perform\n\n unless service_response.success?\n raise 'Incomplete Page Meta.'\n end\n\n page_extended_data = service_response.data\n\n @page_meta_data = page_extended_data[:meta]\n @page_assets_data = page_extended_data[:assets]\n end",
"def set_page_meta_info(custom_extended_data = {})\n service_response = GetPageMetaInfo.new(\n controller: params[:controller],\n action: params[:action],\n request_url: request.url,\n custom_extended_data: custom_extended_data\n ).perform\n\n unless service_response.success?\n raise 'Incomplete Page Meta.'\n end\n\n page_extended_data = service_response.data\n\n @page_meta_data = page_extended_data[:meta]\n @page_assets_data = page_extended_data[:assets]\n end",
"def render_meta_tag(options={})\n default_options = {\n :name => \"\",\n :default_language => \"de\",\n :content => \"\"\n }\n options = default_options.merge(options)\n lang = (current_page.language.blank? ? options[:default_language] : current_page.language)\n %(<meta name=\"#{options[:name]}\" content=\"#{options[:content]}\" lang=\"#{lang}\" xml:lang=\"#{lang}\" />)\n end",
"def set_Tags(value)\n set_input(\"Tags\", value)\n end",
"def set_Tags(value)\n set_input(\"Tags\", value)\n end",
"def set_Tags(value)\n set_input(\"Tags\", value)\n end",
"def set_Tags(value)\n set_input(\"Tags\", value)\n end",
"def set_Tags(value)\n set_input(\"Tags\", value)\n end",
"def set_Tags(value)\n set_input(\"Tags\", value)\n end",
"def set_video_metatags! tags, record\n metadata = record.vimeo_metadata\n metadata = metadata[:horizontal] if metadata.key?(:horizontal)\n return unless metadata.present?\n\n tags.merge!({\n 'og:type' => 'video.other',\n 'og:image' => metadata[:thumbnail],\n 'og:video' => metadata[:download_url],\n 'og:video:duration' => metadata[:duration],\n 'og:video:release_date' => record.created_at.to_s(:db),\n 'twitter:card' => 'player',\n 'twitter:player:url' => metadata[:embed_url],\n 'twitter:player:width' => metadata[:width],\n 'twitter:player:height' => metadata[:height],\n })\n end",
"def set_meta_description\n html = html_overview || html_content || ''\n\n self.meta_description =\n html.\n gsub(/<\\/?[^>]*>/, ' '). # replace HTML tags with spaces\n gsub(/&\\w{1,9};|\"/, ''). # remove HTML special chars and double quotes\n gsub(/\\n+/, \" \"). # remove new lines\n gsub(/\\s+/, ' '). # remove duplicated spaces\n strip[0..200] # strip spaces and get first 200 chars\n end",
"def tags=(tags)\n assert_unloaded\n @tags = names_to_tags(tags)\n end",
"def resource_meta_tags\n meta_tags = [\n current_site.metatags,\n @page.metatags\n ].flatten.inject({}) do |tags, metatag|\n tags.merge(metatag.name => metatag.content)\n end\n\n { image_src: current_site.logo.url }.merge(meta_tags)\n .merge(title: @page.title)\n end",
"def meta_keywords(*args)\n if args.any?\n @meta_keywords = Array(args.first).join(\", \")\n else\n keywords = @meta_keywords\n keywords ||= @page.tag_list if @page&.tags&.any?\n strip_tags(keywords)\n end\n end",
"def set_tags(tags)\n self.tags = tags.map.each do |tag|\n Tag.find_or_create_by_name tag\n end\n end",
"def tags=(tags)\n if tags.first.is_a? Hash\n tags = tags.collect { |tag| Tag.new(tag) }\n end\n\n tags.each { |tag|\n if not tag.is_a? Tag\n raise \"Wrong class for attempted tag #{tag.inspect}\"\n end\n }\n\n @tags = tags\n end",
"def tags=(tag_string)\n # tag_array = tag_string.split(/,\\s*/)\n # story.add_tags(tag_array)\n story.set_tag_string(tag_string)\n end",
"def set_meta(key, value)\n metas.where(key: key).update_or_create({value: fix_meta_value(value)})\n cama_set_cache(\"meta_#{key}\", value)\n end",
"def set_tag(key, value = nil)\n # Keys must be unique between tags and metrics\n metrics.delete(key)\n\n # DEV: This is necessary because the agent looks at `meta[key]`, not `metrics[key]`.\n value = value.to_s if ENSURE_AGENT_TAGS[key]\n\n # NOTE: Adding numeric tags as metrics is stop-gap support\n # for numeric typed tags. Eventually they will become\n # tags again.\n # Any numeric that is not an integer greater than max size is logged as a metric.\n # Everything else gets logged as a tag.\n if value.is_a?(Numeric) && !(value.is_a?(Integer) && !NUMERIC_TAG_SIZE_RANGE.cover?(value))\n set_metric(key, value)\n else\n # Encode strings in UTF-8 to facilitate downstream serialization\n meta[Core::Utils.utf8_encode(key)] = Core::Utils.utf8_encode(value)\n end\n rescue StandardError => e\n Datadog.logger.debug(\"Unable to set the tag #{key}, ignoring it. Caused by: #{e}\")\n end",
"def yield_meta_tag(tag, default_text = '')\n content_for?(:\"meta_#{tag}\") ? content_for(:\"meta_#{tag}\") : default_text\n end",
"def render_keywords(tags)\n keywords = TextNormalizer.normalize_keywords(meta_tags.extract(:keywords))\n normalized_meta_tags[:keywords] = keywords\n tags << Tag.new(:meta, :name => :keywords, :content => keywords) if keywords.present?\n end",
"def set_seo_meta(title, options = {})\r\n #todo\r\n keywords = options[:keywords] || \"问答\"\r\n description = options[:description] || \"Kejian.TV 课件交流系统是中国最大的教育资源在线集散平台,同时,课件交流系统也是中国最专业的在线学习社区。\"\r\n\r\n if title.length > 0\r\n @seo[:title] = \"#{title}\"\r\n end\r\n @seo[:keywords] = keywords\r\n @seo[:description] = description\r\n end",
"def meta_tag(attr_name, options = {})\n key = normalize_meta_tag_name(attr_name)\n\n key = localized_key(key)\n\n cached_meta_tags[key] ||= find_meta(key, options[:fallback])\n cached_meta_tags[key] ||= meta_tags.build(name: key) if options[:build]\n\n cached_meta_tags[key]\n end",
"def meta\n tag(:meta, :charset => \"utf-8\") +\n tag(:meta, :name => \"viewport\",\n :content => \"width=device-width, initial-scale=1.0\")+\n tag(:meta, :name => \"HandheldFriendly\", :content => \"True\")+\n tag(:meta, 'http-equiv' => \"cleartype\", :content => \"on\")+\n favicon_link_tag('https://library.nyu.edu/favicon.ico')+\n csrf_meta_tags\n end",
"def tags=(tags)\n @tags = tags.map { |name| Tag.new(:name => name) }\n end",
"def tags=(tags)\n @tags = tags.map { |name| Tag.new(:name => name) }\n end",
"def set_static_page_metatags! tags, record\n if record.role == 'home'\n tags['title'] = translate('we_meditate')\n image = MediaFile.find_by(id: record.content_blocks.first['data']['image']['id']) if record.content_blocks.present?\n elsif record.parsed_content.present? && record.parsed_content['mediaFiles'].present?\n image = MediaFile.find_by(id: record.parsed_content['mediaFiles'].first)\n end\n\n tags['og:image'] = image_url image.file_url if image.present?\n tags['og:type'] = 'website' if %w[home contact privacy articles meditations subtle_system].include?(record.role)\n end",
"def build_default_meta_tags\n klass = metatags_class || default_metatags_class\n build_meta_tags(with: klass, instance: metatags_instance)\n end",
"def injectable_meta \n set_meta_tags title: \"#{controller_name.humanize.titleize + ' - ' + action_name.capitalize}\",\n description: 'NoBull Software Co.\\'s NoBull Website Ordering Thingy™!👋' ,\n keywords: 'webapp, web site development, business information',\n index: false,\n nofollow: true,\n icon: [\n { href: \"#{ActionController::Base.helpers.asset_path('favicon.ico')}\"},\n { href: \"#{ActionController::Base.helpers.asset_path('favicon-96x96.png')}\", sizes: '32x32 96x96', type: 'image/png' },\n { href: \"#{ActionController::Base.helpers.asset_path('apple-icon.png')}\", rel: 'apple-touch-icon-precomposed', sizes: '32x32', type: 'image/png' },\n ]\n end",
"def set_metadata(*args)\n self.metadata.set(*args)\n end",
"def set_meta_image\n regexp = /<img[^>]+src=[\"']([^\"']*)/\n if img_tag = (html_content || '').match(regexp)\n self.meta_image = img_tag[1]\n else\n self.meta_image = nil\n end\n end",
"def with_defaults(defaults = {})\n old_meta_tags = @meta_tags\n @meta_tags = normalize_open_graph(defaults).deep_merge!(@meta_tags)\n yield\n ensure\n @meta_tags = old_meta_tags\n end",
"def tags=(list)\n tag(self.class.name)\n tag(*list)\n end",
"def [](name)\n @meta_tags[name]\n end",
"def initialize\n @meta_tags = ActiveSupport::HashWithIndifferentAccess.new\n end",
"def tags=(value)\n @tags = value\n end",
"def tags=(value)\n @tags = value\n end",
"def tags=(value)\n @tags = value\n end",
"def set_page_metadata\n params[:id].tap do |page|\n if %w(home privacy styles terms).include? page\n page_title t(\"pages.#{page}.page_title\") unless page == 'home'\n page_author t(\"pages.#{page}.page_author\", default: '')\n page_description t(\"pages.#{page}.page_description\", default: '')\n extra_body_classes \"#{page}-page\"\n end\n end\n end",
"def tags\n @meta.merge(@metrics)\n end",
"def define_tag_setter_methods\n @tags.keys.each do |tag_name|\n next if respond_to? :\"#{tag_name}=\"\n if tag_name =~ /karma:(.*)/\n class_eval %{\n def karma\n def #{$1}=(new_value)\n update_tag_value('#{tag_name}', new_value)\n end\n end\n }\n else\n class_eval %{\n def #{tag_name}=(new_value)\n update_tag_value('#{tag_name}', new_value)\n end\n }\n end \n end\n end",
"def setTag(tag)\n @fields['tag'] = tag\n self\n end",
"def setTag(tag)\n @fields['tag'] = tag\n self\n end",
"def setTag(tag)\n @fields['tag'] = tag\n self\n end",
"def setTag(tag)\n @fields['tag'] = tag\n self\n end",
"def setTag(tag)\n @fields['tag'] = tag\n self\n end",
"def setTag(tag)\n @fields['tag'] = tag\n self\n end",
"def setTag(tag)\n @fields['tag'] = tag\n self\n end",
"def set_tags(path, ctype, arr)\n # FIXME : force lowercase?\n add_metadata(path, ctype, arr.map { |t| t.to_s }, :tags)\n notify(EVENT_TAG, path, ctype)\n end",
"def set_tags\n @tags = Tag.all\n @time = Tag.all.to_a.slice(0..4)\n @place = Tag.all.to_a.slice(5..8)\n @feeling = Tag.all.to_a.slice(9..13)\n @tag = Tag.find_by(id: params[:id])\n end",
"def parse_meta_tags ( field_key )\n value = self[field_key]\n tags = parse_tags value\n return tags\n end",
"def tags=(value)\n if value == @defaults['tags']\n @values.delete 'tags' if @values.key? 'tags'\n else\n @values['tags'] = value\n end\n end",
"def tag_set(p_tag_sym, p_val) tag.send(\"#{p_tag_sym.to_s}=\", p_val) end"
] | [
"0.7819052",
"0.7375335",
"0.71944946",
"0.673408",
"0.6650074",
"0.6561222",
"0.6538302",
"0.65313774",
"0.64864284",
"0.6444286",
"0.64038604",
"0.6388647",
"0.63083726",
"0.61532444",
"0.6114086",
"0.61054283",
"0.61012495",
"0.6074484",
"0.6074484",
"0.6043993",
"0.60314643",
"0.60277057",
"0.601962",
"0.60105705",
"0.5981122",
"0.5964943",
"0.5915872",
"0.59034",
"0.58893657",
"0.5852722",
"0.58063465",
"0.5801726",
"0.5726322",
"0.57104367",
"0.56494963",
"0.5641817",
"0.5624492",
"0.56231415",
"0.56169325",
"0.558671",
"0.55832857",
"0.5570998",
"0.5564627",
"0.55362386",
"0.5524252",
"0.54829264",
"0.54809785",
"0.54809785",
"0.54809785",
"0.5453561",
"0.5442354",
"0.5442354",
"0.5442354",
"0.5442354",
"0.5442354",
"0.5442354",
"0.5383733",
"0.53799725",
"0.53687865",
"0.5356498",
"0.53541875",
"0.53435516",
"0.53288615",
"0.5321482",
"0.53208923",
"0.5318777",
"0.53075045",
"0.5301027",
"0.52865034",
"0.52843887",
"0.5270666",
"0.5257289",
"0.5257289",
"0.5254199",
"0.52511615",
"0.52444196",
"0.5234774",
"0.5188142",
"0.51873106",
"0.51867914",
"0.5185985",
"0.5175208",
"0.51728404",
"0.51728404",
"0.51728404",
"0.51469207",
"0.5146419",
"0.51389766",
"0.5133792",
"0.5133792",
"0.5133792",
"0.5133792",
"0.5133792",
"0.5133792",
"0.5133792",
"0.5133193",
"0.51214534",
"0.5105628",
"0.51040614",
"0.5093282"
] | 0.816145 | 0 |
Get meta tags for the page. | def meta_tags
@meta_tags ||= MetaTagsCollection.new
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def dynamic_meta_tags\n @meta_tag_object = (@r_object || @page)\n return unless @meta_tag_object\n return unless @meta_tag_object.respond_to?(:meta_tags)\n meta_tags_list = []\n\n @meta_tag_object.meta_tags.each do |meta_tag|\n meta_tags_list << content_tag(:meta, \"\", name: meta_tag.meta_key, content: meta_tag.meta_value)\n end\n\n raw(meta_tags_list.join(\" \"))\n end",
"def get_meta_tags\n if @content_package\n\n if @content_package.meta_image_uid\n image = \"#{Settings.site_url}#{@content_package.meta_image.thumb('1200x630#').url}\"\n elsif @content_package.respond_to?(:hero_image) && @content_package.hero_image.present?\n image = \"#{Settings.site_url}#{@content_package.hero_image.thumb('1200x630#').url}\"\n end\n\n meta_title = @content_package.meta_title.presence || Settings.default_meta_title\n meta_description = @content_package.meta_description.presence || Settings.default_meta_description\n meta_keywords = @content_package.meta_keywords.presence || Settings.default_meta_keywords\n if @content_package.hide_from_robots?\n meta_hide_from_robots = \"<meta name='robots' content='noindex, nofollow' />\\n\"\n end\n\n else\n meta_title = content_for(:title) || Settings.default_meta_title\n meta_description = content_for(:description) || Settings.default_meta_description\n meta_keywords = content_for(:keywords) || Settings.default_meta_keywords\n meta_hide_from_robots = nil\n end\n\n meta_description = strip_tags CGI.unescapeHTML(meta_description.strip)\n\n meta_image = image || content_for(:meta_image) || \"#{Settings.site_url}#{asset_path(Settings.default_fb_meta_image)}\"\n\n meta_values = [meta_title, meta_description, meta_image, meta_keywords, meta_hide_from_robots]\n\n pig_meta_tags(meta_values)\n end",
"def set_page_meta_tags\n req = self.request\n set_meta_tags_for_url_path(req.base_url, req.fullpath)\n end",
"def resource_meta_tags\n meta_tags = [\n current_site.metatags,\n @page.metatags\n ].flatten.inject({}) do |tags, metatag|\n tags.merge(metatag.name => metatag.content)\n end\n\n { image_src: current_site.logo.url }.merge(meta_tags)\n .merge(title: @page.title)\n end",
"def parse_meta_tags ( field_key )\n value = self[field_key]\n tags = parse_tags value\n return tags\n end",
"def get_metatag(page, tag)\n page.parser.css(\"meta[name='#{tag}']\").first['content']\n end",
"def page_meta\n @page_meta ||= {}\n end",
"def render_meta_tags\n item = find_item\n\n if item.present?\n @meta_tags = item.meta_tags.published\n render meta_tags: @meta_tags\n end\n end",
"def metatags(**options)\n itemprop = options.dig(:config, :itemprop)\n safe_join(\n options.fetch(:value, []).map { |v| content_tag(:meta, nil, itemprop: itemprop, content: v) }\n )\n end",
"def seo_tags\n seo_title + seo_meta_author + seo_meta_description\n end",
"def meta name, contents\n Tagz.tag :meta, :name => name, :contents => contents \n end",
"def get_tag(meta)\n sanitize_tag parse_tag_metadata_vars(meta)\n end",
"def get_page_meta\n @page_meta = PageMeta.find_by(request_path: request.path)\n end",
"def meta\n meta = {}\n set_meta(meta)\n return meta\n end",
"def meta_tags(hash)\n meta_information.merge!(hash)\n end",
"def render_custom(tags)\n meta_tags.meta_tags.each do |name, data|\n Array(data).each do |val|\n tags << Tag.new(:meta, :name => name, :content => val)\n end\n meta_tags.extract(name)\n end\n end",
"def tags\n get.tagGuids\n end",
"def [](name)\n @meta_tags[name]\n end",
"def set_meta\n meta.tap do |m|\n m.tag = [{\n system: META_SYSTEM,\n code: META_CODE,\n display: META_DISPLAY\n }]\n end\n end",
"def allTags\n tags = []\n MU::MommaCat.listStandardTags.each_pair { |name, value|\n tags << {key: name, value: value}\n }\n\n if @config['optional_tags']\n MU::MommaCat.listOptionalTags.each_pair { |name, value|\n tags << {key: name, value: value}\n }\n end\n\n if @config['tags']\n @config['tags'].each { |tag|\n tags << {key: tag['key'], value: tag['value']}\n }\n end\n\n return tags\n end",
"def render_custom(tags)\n meta_tags.meta_tags.each do |name, data|\n Array(data).each do |val|\n tags << Tag.new(:meta, configured_name_key(name) => name, :content => val)\n end\n meta_tags.extract(name)\n end\n end",
"def set_tags(page)\n tags = page.data['tags']\n\n if tags\n tags = (tags.kind_of?(Array) ? tags : tags.split)\n else\n tags = []\n end\n\n tags << page.data['category']\n page.data['tags'] = tags.sort\n end",
"def metas\n @metas ||= Metas.new(self)\n end",
"def scrape_meta_data\n unless @data.meta\n @data.meta!.name!\n @data.meta!.property!\n parsed_document.xpath(\"//meta\").each do |element|\n get_meta_name_or_property(element)\n end\n end\n end",
"def site_meta\n end",
"def site_meta\n end",
"def meta_tag(*tags, &block)\n content_for(:meta_tags) { tags }\n content_for(:meta_tags) { concat(capture( &block), block.binding) if block_given? }\n end",
"def index\n @blogs = Blog.order(\"created_at DESC\")\n @all_tags = Tag.get_tags_count\n @tags_for_meta = []\n Tag.all.select(\"description\").each { |element| @tags_for_meta << element.description}\n end",
"def tags() ; info[:tags] ; end",
"def tags() ; info[:tags] ; end",
"def tags\n @meta.merge(@metrics)\n end",
"def prepare_meta_tags(options={})\n site_name = I18n.t('meta_tag.site_name')\n title = I18n.t('meta_tag.title')\n description = I18n.t('meta_tag.description')\n image = options[:image] || ActionController::Base.helpers.image_url('/homepage/teaser_bg.jpg')\n current_url = request.url\n\n # Let's prepare a nice set of defaults\n defaults = {\n site: site_name,\n title: title,\n image: image,\n description: description,\n keywords: %w[bookmarks web mobile free application],\n twitter: {\n site_name: site_name,\n site: '@wundermarks',\n card: 'summary',\n description: :description,\n image: image\n },\n og: {\n url: current_url,\n site_name: site_name,\n title: :title,\n image: image,\n description: :description,\n type: 'website'\n }\n }\n\n options.reverse_merge!(defaults)\n\n set_meta_tags options\n end",
"def meta\n %Q(\n <meta charset=\"UTF-8\">\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n <meta property=\"og:title\" content=\"Game Boy opcode table\" />\n <meta name=\"author\" content=\"Luís Mendes\" />\n <meta property=\"og:locale\" content=\"en_US\" />\n <meta name=\"description\" content=\"Game Boy CPU (Sharp LR35902) instruction set\" />\n <meta property=\"og:description\" content=\"Game Boy CPU (Sharp LR35902) instruction set\" />\n <link rel=\"canonical\" href=\"https://gb.insertcoin.dev/\" />\n <meta property=\"og:url\" content=\"https://gb.insertcoin.dev/\" />\n <meta property=\"og:site_name\" content=\"Game Boy opcode table\" />\n <script type=\"application/ld+json\">\n {\"url\":\"https://gb.insertcoin.dev/\",\"@type\":\"WebSite\",\"headline\":\"ink\",\"author\":{\"@type\":\"Person\",\"name\":\"Luís Mendes\"},\"description\":\"Game Boy CPU (Sharp LR35902) instruction set\",\"name\":\"Game Boy opcode table\",\"@context\":\"https://schema.org\"}\n </script>\n)\nend",
"def set_site_meta_tags\n config = ZanoboRails::Crawlable.configuration\n\n site_ids = {\n separator: config.page_title_sitename_separator,\n reverse: config.page_title_sitename_pos == 'right'\n }\n\n if config.gplus_id.present?\n site_ids[:publisher] = \"https://plus.google.com/#{config.gplus_id}\"\n end\n if config.twitter_id.present?\n site_ids[:twitter] = \"@#{config.twitter_id}\"\n end\n if config.fb_app_id.present?\n site_ids[:fb] = { app_id: \"@#{config.fb_app_id}\" }\n end\n if config.site_name.present?\n site_ids[:open_graph] = { site_name: config.site_name }\n site_ids[:site] = config.site_name\n end\n\n set_meta_tags(site_ids)\n end",
"def meta_tag(name, content)\n\t\ttag(:meta, name: name, content: content)\n\tend",
"def tags\n tags = nil\n\n # Jekyll v3 has it in data, while v2 have it at the root\n if @file.data.key?('tags')\n tags = @file.data['tags']\n elsif @file.respond_to? :tags\n tags = @file.tags\n end\n\n return tags if tags.nil?\n\n # Anyway, we force cast it to string as some plugins will extend the tags to\n # full featured objects\n tags.map(&:to_s)\n end",
"def meta\n @d[:meta]\n end",
"def all_descriptions\n result = []\n @pages.each do |page|\n result << [page.page_url, page.meta_desc_content] if page.page_a_tags\n end\n result\n end",
"def tags\n return @tags ||= begin\n @site.tags.keys.map do |tag|\n TagDrop.new({\n :site => @site, :tag => tag\n })\n end\n end\n end",
"def tags()\n\t\t\treturn @metadata.attributes[:tags].to_a\n\t\tend",
"def get_tags\n\ttags = Set.new\n\t@site.articles.each do |post|\n\t\tif(post[:tags].nil?) \n\t\t\tpost[:tags] = Array.new\n\t\t\tpost[:tags] << \"(none)\"\n\t\t\ttags << \"(none)\"\n\t\telse\n\t\t\tpost[:tags].each do |tag|\n\t\t\t\ttags << tag\n\t\t\tend\n\t\tend\n\tend\n\ttags.to_a\nend",
"def metadata\n @page.metadata\n end",
"def get_meta(url)\n\n unless url.is_a? URI\n error \"{url} (instance of #{url.class}) is not an URI instance!\"\n return nil\n end\n\n begin\n body = Net::HTTP.get(url.host,url.request_uri)\n return nil unless body\n rescue => e\n error \"Failed to request url: #{url} : #{e}\"\n return nil\n end\n\n robots_arr = nil\n\n begin\n doc = Nokogiri::HTML(body)\n tags = doc.xpath(META_ROBOTS_TAG_SELECTOR)\n\n return nil if tags.nil? || tags.length == 0\n\n tag = tags.pop\n robots = tag[\"content\"]\n\n return nil unless robots\n\n robots_arr = robots.gsub(/\\s/,'').split(',')\n rescue => e\n error \"Failed to get meta for #{url} : #{e}\"\n return nil\n end\n\n # return lowercase values\n return robots_arr.map {|val| val.downcase}\n end",
"def create_meta_array(document)\n document\n .css('meta').reject { |node| node_type(node).nil? }\n .map do |node|\n {\n type: node_type(node),\n name: node['name'],\n property: node['property'],\n content: node['content'],\n itemprop: node['itemprop']\n }\n end\n end",
"def prepare_meta_tags(options = {})\n defaults = {\n author: nil,\n authors: [],\n description: nil,\n description_og: nil,\n description_twitter: nil,\n images: [],\n #is_duplicate?: false,\n # # used to determine if we should rel=canonical, true if viewing a paginated\n # just comparing request url to canonical for now\n # form of a full-page-enabled resource\n keywords: [],\n nofollow?: false,\n noindex?: false,\n page: nil, # Have to throw this into the title\n pages: nil, # along with this\n title: nil, # Just the descriptive part of the title\n #title_format: nil, # Title with placeholders for sitename, pages, and separators\n # disabling this for now, because getting it to with with meta-tags\n # current title passing scheme would require reading placement and\n # then monkey-patching parameters\n #title_separator: '|', #set this at higher level # '-', 'on', ':', etc\n #title_site_name_position: 'right', #set this at higher level\n #title_site_name: SITE_IDS[:NAME], # provided earlier on, meta-tags ties to other site identifier tags\n title_og: nil,\n title_twitter: nil,\n type: 'page', # og and twitter need types, we generate from our map if missing\n type_og: nil,\n type_twitter: nil,\n video: nil,\n url: nil, # canonical, required by og \"#{request.url}\"\n url_current: request.url,\n url_next: nil, # if paged and no full-page alternative\n url_prev: nil, # if paged and no full-page alternative\n }\n options.reverse_merge! defaults\n\n # @todo Raise some errors if mandatory things are missing as required by\n # og and twitter, i.e.\n # We want this to fill out as much as possible, but it needs a base of info\n # description\n # title (except certain cards...)\n # url - this is the big one, always needed\n # image_url - for og\n if options[:url].blank?\n raise MetaTagError, 'No url defined for content, required by OG and needed if protocol different from canonical'\n end\n\n # initialize return array\n return_values = {\n author: [],\n og: { image: []},\n twitter: { creator: []}\n }\n\n # Authors\n options[:authors] << options[:author] if options[:author]\n options[:authors].each do |author|\n if author.has_key?(:gplus_id) and (id = author[:gplus_id])\n return_values[:author] << \"https://plus.google.com/#{id}\"\n end\n if author.has_key?(:twitter_id)\n return_values[:twitter][:creator] << id\n end\n end\n\n # Descriptions\n return_values[:description] = options[:description]\n return_values[:og][:description] = options[:description_og]\n return_values[:twitter][:description] = options[:description_twitter]\n\n # Images\n # @todo existence checks and warnings for sizes, AR, filesize, etc\n # @todo Need to take in all images and distribute to each stream according to size appropriateness,\n # unless specifically tagged to a stream\n\n # Images - OG\n # @todo pass https url through secure_url, width and height once after\n # https://github.com/kpumuk/meta-tags/issues/63 is resolved\n options[:images].each do |image|\n if image.has_key? :url\n return_values[:og][:image] << image[:url]\n\n #if image.has_key? :width and image.has_key? :height\n # return_values[:og][:image][:width] = image[:width].to_i\n # return_values[:og][:image][:height] = image[:height].to_i\n #end\n end\n end\n\n # Images - Twitter\n # Falls back to open graph, let's rely on that for now\n # @todo Support custom images for twitter\n\n # Keywords\n return_values[:keywords] = options[:keywords]\n\n # Noindex, nofollow\n # @todo Build in checking for if these are turned off for this object type somewhere\n return_values[:noindex] = options[:noindex?]\n return_values[:nofollow] = options[:nofollow?]\n\n # Titles\n return_values[:og][:title] = options[:title_og] if options[:title_og]\n return_values[:twitter][:title] = options[:title_twitter] if options[:title_twitter]\n\n #if options.has_key)[:title_format]\n # #if options[:title_page_format]\n #\n # end\n # return_values[:title] = options[:title_format].gsub(['special','characters'],['value','otherval'])\n #else\n if options[:pages] and options[:page] and options[:pages] > 1 and options[:page] > 1\n return_values[:title] = [\n options[:title],\n t('pagination.page_x_of_y', page: options[:page], pages: options[:pages])\n ]\n else\n return_values[:title] = options[:title]\n end\n #end\n\n # Types\n og_content_type = options[:type_og]\n if og_content_type and ZanoboRails::Crawlable.content_types_for(:og).include? og_content_type\n return_values[:og][:type] = og_content_type\n elsif type_provided = (general_type = options[:type] and ZanoboRails::Crawlable.general_content_types.include? general_type)\n return_values[:og][:type] = ZanoboRails::Crawlable::Advisor.og_content_type_for(general_type)\n else\n # Type is REQUIRED, we really should test for required values.\n return_values[:og][:type] = ZanoboRails::Crawlable::Advisor.recommend(:content_type, :og).to_s\n end\n\n twitter_content_type = options[:type_twitter]\n if twitter_content_type and ZanoboRails::Crawlable.content_types_for(:twitter).include? twitter_content_type\n return_values[:twitter][:type] = twitter_content_type\n elsif type_provided\n return_values[:twitter][:type] = ZanoboRails::Crawlable.twitter_content_type_for(general_type)\n else\n # Type is REQUIRED\n return_values[:twitter][:type] = ZanoboRails::Crawlable::Advisor.recommend(:content_type, :twitter).to_s\n end\n\n # URLS\n # og:url\n # twitter:url\n # rel=canonical\n return_values[:og][:url] = options[:url]\n return_values[:twitter][:url] = options[:url]\n return_values[:canonical] = options[:url] unless request.url == options[:url]\n return_values[:next] = options[:url_next]\n return_values[:prev] = options[:url_prev]\n\n # Video\n #og:video => {\n # :director => 'http://www.imdb.com/name/nm0000881/',\n # :writer => ['http://www.imdb.com/name/nm0918711/', 'http://www.imdb.com/name/nm0177018/']\n #}\n\n # Tell og and twitter to use primary description and title if nothing is customized to them\n return_values[:og][:description] = :description if return_values[:og][:description].nil?\n return_values[:twitter][:description] = :description if return_values[:twitter][:description].nil?\n return_values[:og][:title] = :title if return_values[:og][:title].nil?\n return_values[:twitter][:title] = :title if return_values[:twitter][:title].nil?\n\n return_values\n end",
"def opengraph_tags\n all_opengraph_tags = {\n \"og:description\" => page_description,\n \"og:image\" => page_image,\n \"og:site_name\" => site_name,\n \"og:title\" => page_title,\n \"og:type\" => \"object\",\n \"og:url\" => canonical_url,\n }\n\n Hash[all_opengraph_tags.select { |_k, v| v }]\n end",
"def set_meta_tags_title\n set_meta_tags site: 'benradler.com'\n end",
"def tags\n data[:tags]\n end",
"def tags\n data[:tags]\n end",
"def tags\n data[:tags]\n end",
"def tags\n data[:tags]\n end",
"def tags\n data[:tags]\n end",
"def tags\n response[\"tags\"]\n end",
"def extract_meta\n end",
"def tags\n @obj['tags']\n end",
"def meta\n options[:meta]\n end",
"def meta_tag(name, content = '')\n tag(:meta, :name => name, :content => content)\n end",
"def meta\n tag(:meta, :charset => \"utf-8\") +\n tag(:meta, :name => \"viewport\",\n :content => \"width=device-width, initial-scale=1.0\")+\n tag(:meta, :name => \"HandheldFriendly\", :content => \"True\")+\n tag(:meta, 'http-equiv' => \"cleartype\", :content => \"on\")+\n favicon_link_tag('https://library.nyu.edu/favicon.ico')+\n csrf_meta_tags\n end",
"def keywords(page_keywords) \n content_for(:keywords){\"<meta name=\\\"keywords\\\" content=\\\"#{page_keywords}\\\" />\\n\"} \n end",
"def keywords(page_keywords)\n content_for(:keywords) do\n \"<meta name=\\\"keywords\\\" content=\\\"#{page_keywords}\\\" />\\n\"\n end\n end",
"def keywords(page_keywords)\n content_for(:keywords) do\n \"<meta name=\\\"keywords\\\" content=\\\"#{page_keywords}\\\" />\\n\"\n end\n end",
"def tags\n get('tags')\n end",
"def index\n @tags = Tag.grouped_by_name(@page)\n end",
"def og(key)\n html.at_css(\"meta[property='og:#{key}']\")&.[]('content')\n end",
"def all\n response= handle_errors{ self.class.get('/get')}\n response[\"tags\"][\"tag\"].collect do |tag| \n t= Rubycious::Tag.new(tag)\n end\n end",
"def tags\n @data['tags']\n end",
"def _get_tags(tag)\n tags = if tag.attr['tags'] && !tag.attr['tags'].blank?\n Tag.from_list(tag.attr['tags'], false) # false parameter -> not to create missing tags\n elsif tag.locals.page.respond_to?(:requested_tags)\n tag.locals.page.requested_tags\n elsif tag.locals.page\n tag.locals.page.attached_tags.visible\n else\n []\n end\n tag.locals.tags = tags.uniq.compact\n end",
"def getTags\r\n\t\t\t\t\treturn @tags\r\n\t\t\t\tend",
"def top_tags()\n get(:standard, {:method => \"tag.getTopTags\"})\n end",
"def tags\n self.lib.tags.map { |r| tag(r) }\n end",
"def setExtractMetaTags(value)\n @fields['extract_meta_tags'] = value\n self\n end",
"def attributes_for_tag(tag)\n metafeta_store[tag] || []\n end",
"def set_meta\n puts 'meta'\n end",
"def tags_and_categories_list\n list =[]\n self.div(:id=>\"contentmetadata_tags_container\").links.each do |link|\n list << link.text\n end\n return list\n end",
"def set_static_page_metatags! tags, record\n if record.role == 'home'\n tags['title'] = translate('we_meditate')\n image = MediaFile.find_by(id: record.content_blocks.first['data']['image']['id']) if record.content_blocks.present?\n elsif record.parsed_content.present? && record.parsed_content['mediaFiles'].present?\n image = MediaFile.find_by(id: record.parsed_content['mediaFiles'].first)\n end\n\n tags['og:image'] = image_url image.file_url if image.present?\n tags['og:type'] = 'website' if %w[home contact privacy articles meditations subtle_system].include?(record.role)\n end",
"def boiler_plate_meta_tags\n # read document as encoded in UTF-8\n ('<meta charset=\"utf-8\">' + \"\\n\" +\n # tell IE to use the latest version to render, this is default in IE11+\n '<meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\">' + \"\\n\" +\n # set window to normal scale and width\n '<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">').html_safe\n end",
"def tags\n return @tags\n end",
"def tags\n return @tags\n end",
"def tags\n return @tags\n end",
"def tags\n @values.fetch('tags') { \n @values['tags'] = {}\n }\n end",
"def content_for_meta_tag(attribute_selector, html)\n html.xpath(\"//head/meta[@#{attribute_selector}]/@content\").first.try(:content)\n end",
"def tags\n @tags ||= []\n end",
"def get_keywords(site)\n response = Net::HTTP.get_response(site, \"/\")\n Hpricot(response.body).\n search(\"meta[@name='keywords']\")[0]. #Select meta keywords element\n attributes[\"content\"]. #Select its content\n split(\",\"). #Keywords are coma separated\n collect{ |k| k.strip.downcase } #Remove start and end white spaces\nend",
"def seo_for_page\n PAGE_SEO_META.each do |meta|\n send(\"set_#{meta}_key\", \"#{seo_condition[:prefix]}#{meta}\")\n end\n\n set_title_variables(seo_variables)\n end",
"def tags\n\t\tresponse = self.server.run_with_json_template( :tags )\n\t\treturn response.flatten.map {|tag| Hglib::Repo::Tag.new(self, **tag) }\n\tend",
"def meta_keywords(*args)\n if args.any?\n @meta_keywords = Array(args.first).join(\", \")\n else\n keywords = @meta_keywords\n keywords ||= @page.tag_list if @page&.tags&.any?\n strip_tags(keywords)\n end\n end",
"def set_page_meta_info(custom_extended_data = {})\n service_response = GetPageMetaInfo.new(\n controller: params[:controller],\n action: params[:action],\n request_url: request.url,\n custom_extended_data: custom_extended_data\n ).perform\n\n unless service_response.success?\n raise 'Incomplete Page Meta.'\n end\n\n page_extended_data = service_response.data\n\n @page_meta_data = page_extended_data[:meta]\n @page_assets_data = page_extended_data[:assets]\n end",
"def set_page_meta_info(custom_extended_data = {})\n service_response = GetPageMetaInfo.new(\n controller: params[:controller],\n action: params[:action],\n request_url: request.url,\n custom_extended_data: custom_extended_data\n ).perform\n\n unless service_response.success?\n raise 'Incomplete Page Meta.'\n end\n\n page_extended_data = service_response.data\n\n @page_meta_data = page_extended_data[:meta]\n @page_assets_data = page_extended_data[:assets]\n end",
"def set_page_meta_info(custom_extended_data = {})\n service_response = GetPageMetaInfo.new(\n controller: params[:controller],\n action: params[:action],\n request_url: request.url,\n custom_extended_data: custom_extended_data\n ).perform\n\n unless service_response.success?\n raise 'Incomplete Page Meta.'\n end\n\n page_extended_data = service_response.data\n\n @page_meta_data = page_extended_data[:meta]\n @page_assets_data = page_extended_data[:assets]\n end",
"def set_meta_tags(meta_tags)\n self.meta_tags.update(meta_tags)\n end",
"def meta\n @meta ||= decoded_body[:meta]\n end",
"def retrieve_tags\n # noop\n end",
"def tags\n css_selectors = [\n '.watch-info-tag-list a', # YouTube\n '.entry .tags a', # Livejournal\n 'a[rel~=tag]', # Wordpress and many others\n 'a.tag', # Tumblr\n '.tags a',\n '.labels a',\n '.categories a',\n '.topics a'\n ]\n\n tags = []\n\n # grab the first one we get results from\n css_selectors.each do |css_selector|\n tags += @doc.css(css_selector)\n break if tags.any?\n end\n\n # convert from Nokogiri Element objects to strings\n tags.map!(&:inner_text)\n\n # remove \"#\" from hashtag-like tags\n tags.map! { |t| t.gsub(/^#/, '') }\n\n tags\n end",
"def create_tag_pages\n tag_set(items).each do |tag|\n page_identifier = @config[:tags][:page] % tag\n next unless item_by_identifier(page_identifier).nil?\n item = Nanoc3::Item.new(\n # content\n @config[:tags][:content],\n # do not include in sitemap.xml\n { :title => @config[:tags][:title] % tag,\n :tag => tag,\n :page_size => 10,\n :kind => 'tag'\n }.merge(@config[:tags][:attributes]),\n # identifier\n page_identifier,\n # options\n :binary => false\n )\n item.page_items = items_with_tag(tag, items).sort { |x, y| x[:created_at] <=> y[:created_at] }\n items << item\n end\n end",
"def all_titles\n result = []\n @pages.each do |page|\n result << [page.page_url, page.all_titles] if page.page_a_tags\n end\n result\n end",
"def meta(name, content)\n raw %(<meta name=\"#{name}\" content=\"#{content}\" />)\n end",
"def existing_tags\n Notion.where(locale: @lecture.locale || I18n.default_locale)\n .pluck('title') & @content_descriptions\n end",
"def tags\n entries = Entry.all\n # Create a list of all the tags, as a String\n tags_list = String.new\n entries.each do |entry|\n tags_list << entry.tags + \" \"\n end\n # Convert the String to a global array, removing the duplicate elements\n $tags_array = tags_list.split.uniq\n end",
"def get_tags\n\t\t\ttaglist = read_command_output( 'hg', 'tags' )\n\t\t\treturn taglist.split( /\\n/ ).collect {|tag| tag[/^\\S+/] }\n\t\tend",
"def meta_keywords\n read_attribute(:meta_keywords).blank? ? self.title : read_attribute(:meta_keywords)\n end"
] | [
"0.74313164",
"0.72951317",
"0.6951111",
"0.6911265",
"0.6908562",
"0.6812103",
"0.67202574",
"0.65609103",
"0.6524895",
"0.6376451",
"0.63621753",
"0.63406277",
"0.6329424",
"0.6313019",
"0.6253143",
"0.6204404",
"0.6189943",
"0.61593646",
"0.61174047",
"0.60442543",
"0.6002941",
"0.59546775",
"0.59538823",
"0.595249",
"0.5939408",
"0.5939408",
"0.59366924",
"0.5931282",
"0.5921483",
"0.5921483",
"0.5916743",
"0.5915544",
"0.5913803",
"0.5911313",
"0.59111077",
"0.5908006",
"0.5888606",
"0.58838284",
"0.5878931",
"0.5875295",
"0.5860875",
"0.58608186",
"0.5859737",
"0.5827123",
"0.58213514",
"0.58155566",
"0.58124244",
"0.5801027",
"0.5801027",
"0.5801027",
"0.5801027",
"0.5801027",
"0.5793001",
"0.57872546",
"0.5787006",
"0.57839906",
"0.5782731",
"0.5778423",
"0.57716334",
"0.5771139",
"0.5771139",
"0.5705906",
"0.5701231",
"0.569804",
"0.56913424",
"0.5682693",
"0.5681217",
"0.56798524",
"0.56385046",
"0.56327665",
"0.56131744",
"0.5599051",
"0.55935395",
"0.5586438",
"0.5566635",
"0.5566413",
"0.5562629",
"0.5562629",
"0.5562629",
"0.5548636",
"0.5541378",
"0.5536705",
"0.5528932",
"0.55283666",
"0.5526408",
"0.55148077",
"0.55106604",
"0.55106604",
"0.55106604",
"0.55074537",
"0.55038446",
"0.550293",
"0.5485851",
"0.54829913",
"0.5480319",
"0.5463029",
"0.54585916",
"0.54554635",
"0.5452424",
"0.54482764"
] | 0.7259558 | 2 |
whether a sunny or cloudy day lies ahead. However, the output is the same every time the method is invoked. Why? Fix the code so that it behaves as expected. | def predict_weather
sunshine = ['true', 'false'].sample
if sunshine == 'true'
puts "Today's weather will be sunny!"
else
puts "Today's weather will be cloudy!"
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def time_of_day?(sky)\n puts \"It's #{sky ? 'daytime' : 'nighttime'}!\" # my original below:\nend",
"def time_of_day(daylight)\n puts daylight ? \"It's daytime!\" : \"It's nighttime!\"\nend",
"def time_of_day(daylight)\n if daylight\n puts \"It's daytime!\"\n else\n puts \"It's nighttime!\"\n end\nend",
"def fixed?\n !moving? && day.present?\n end",
"def rainy_today?\n self.rainy_today == true\n end",
"def all_day ; true ; end",
"def late?\n returning_at.past? \n end",
"def weather_condition\n @stormy = chance_of_storm < storm_severity\n end",
"def time_of_day(boolean)\n if boolean\n puts 'It\\'s daytime!'\n else\n puts 'It\\'s nighttime!'\n end\nend",
"def what_to_take(outside)\n outside.each do |today|\n if today == 'sunny'\n p \"The weather is #{today}, wear sunscreen\"\n elsif today == 'rainy'\n p \"The weather is #{today}, bring an umbrella\"\n elsif today == 'snowy'\n p \"The weather is #{today}, wear a coat\"\n elsif today == 'icy'\n p \"The weather is #{today}, bring yak traks\"\n else\n p \"The weather is perfect today, you're good to go!\"\n end\n end\nend",
"def check_for_rain\n city_forecast = self.set_city_and_measure\n is_forecast_wet = city_forecast.wet?(\"13:00\",25)\n end",
"def go_outside(temperature, is_daytime)\n puts \"Should we go outside?\"\n if temperature >= 60 && temperature < 90 && is_daytime == true\n puts \"It is a nice #{temperature} degrees and still daytime.\"\n puts \"Let's go outside!\"\n elsif temperature >= 60 && temperature < 90 && is_daytime == false\n puts \"It's a nice #{temperature} degrees out, but it's nighttime.\"\n puts \"Let's stay inside.\"\n elsif temperature >= 90 && is_daytime == true\n puts \"It's a hot #{temperature} degrees out today.\"\n puts \"It's too hot to go outside today.\"\n elsif temperature >= 90 && is_daytime == false\n puts \"It's still #{temperature} even at night!\"\n puts \"Let's stay inside.\"\n elsif temperature < 60 && is_daytime == true\n puts \"It's still daylight, but it's only #{temperature} degrees.\"\n puts \"Let's stay inside.\"\n else\n puts \"It's too cold and dark outside.\"\n puts \"Let's stay inside.\"\n end\nend",
"def time_of_day(boolean)\n boolean ? \"It's daytime!\" : \"It's nighttime!\"\nend",
"def date_of_application?(d)\n d[:date_applied] >= 15.days.ago.to_date\n #RIDICULOUSE BRAIN WARPING ONE! AHH!!!\n #what I'm really asking is April 24th less than April 15th on a plotted line from left to right? Nope! \n\nend",
"def is_in_the_past? \n departureOnThe > returnOnThe \n end",
"def rain_is_coming?\n today_and_tomorrow = @forecast[\"daily\"][\"data\"][0..1]\n\n rain_is_coming = today_and_tomorrow.any? do |d| \n d[\"precipType\"] == \"rain\" && \n (d[\"precipProbability\"] * d[\"precipIntensity\"]) > RAIN_THRESHOLD\n end\n rain_is_coming\n end",
"def has_aired\n self.airdate < Time.now\n end",
"def is_stormy?\n\t\tweather?\n\tend",
"def hold_day?\n if date-7 < Time.zone.today && date >= Time.zone.today\n \"week_in\"\n elsif date < Time.zone.today\n \"finished\"\n end\n end",
"def returnin_early(early)\n return \"left early\" if early\n \"left late\"\nend",
"def tired\t\r\n\tif $hours_asleep >= 8 then\r\n\t $hours_asleep = 0\r\n \t\treturn false\r\n \telse\r\n \t\t$hours_asleep += 1\r\n \t\treturn true\r\n \tend \t\t\r\nend",
"def tenders(day)\n\tif day == 'THURSDAY' \n\t\ttrue\n\telse\n\t\tfalse\n\tend\nend",
"def predict_weather\n\tsunshine = ['true', 'false'].sample\n\n\tif sunshine == 'true'\n\t\tputs \"Today's weather will be sunny!\"\n\telse\n\t\tputs \"Today's weather will be cloudy!\"\n\tend\nend",
"def time_of_day(daytime)\n if daytime\n puts \"It's daytime!\"\n else\n puts \"It's nighttime!\"\n end\nend",
"def currently_snowing?\n\tomaha_coordinates = \"41.2524,-95.9980\"\n\n\tapi_url = \"https://api.darksky.net/forecast/#{ENV[\"DARK_SKY_API_KEY\"]}/#{omaha_coordinates}\"\n\n\tresponse = HTTParty.get(api_url)\n\n\tresponse_hash = response.to_h\n\n\tcurrent_weather = response_hash[\"currently\"]\n\n\tif current_weather[\"icon\"].downcase == \"snow\"\n\t\treturn true\n\telse\n\t\treturn false\n\tend\nend",
"def best_day\n\n end",
"def play_today?\n if self.use_matrix == false #der tag ist egal\n return true\n end\n\n if !self.day_matrix #tag ist nicht egal, ist gibt aber keinen aktiven tag...\n return false\n end\n\n cweekday = Time.now.to_date.cwday\n\n if self.check_matrix(cweekday)\n return true\n end\n return false\n end",
"def upcoming?\n begins.to_time > Time.now\n end",
"def getForecast(location, today)\n forecasts = location.forecasts\n\n # for each forecast, set the weekday, predicted high temp and predicted low temp\n forecasts.each do |forecast|\n weekday = forecast['date']\n day = weekday.strftime('%A')\n weather = forecast['text'].downcase\n predHigh = forecast['high'].to_i\n predLow = forecast['low'].to_i\n\n dayNum = weekday.strftime('%w')\n\n # set the correct day of the week in the forecast using a conditional statement\n if dayNum == today\n weekday = \"Today\"\n elsif dayNum == today + 1 || dayNum == today -6\n weekday \"Tomorrow\"\n else\n weekday = day\n end\n\n puts \"#{weekday}'s forecast is #{weather} with a high of #{predHigh} ˚C and a low of #{predLow} ˚C.\"\n end\nend",
"def upcoming?\n starts_at > Time.now\n end",
"def run?\n !Time.now.saturday? && !Time.now.sunday?\nend",
"def time_of_day(input)\n if input # you dont have to test here as you did above\n puts \"It's daytime!\"\n else\n puts \"It's nighttime\"\n end\nend",
"def return_static_day(myday,day_map,human_label)\n\n static_day=myday\n my_1day=(60*60*24) #1 day in seconds\n\n #static holiday\n if ( myday.wday != day_map['sun'] and myday.wday != day_map['sat']) #not on a weekend\n static_day=(\"#{(myday).to_i}:#{human_label}\")\n elsif myday.wday == day_map['sun'] #push Monday after\n static_day=(\"#{(myday+my_1day).to_i}:#{human_label} Monday After\")\n elsif myday.wday == day_map['sat'] #Friday before\n static_day=(\"#{(myday-my_1day).to_i}:#{human_label} Friday Before\")\n else\n #we shouldn't see anything here\n end\n return static_day\nend",
"def rest_day?\n rest_day\n end",
"def works_at_hanson_st?\n @city == HANSON\n end",
"def monitored_now?\n tf = circuit.monitoring_setting.todays_monitoring_times\n return false unless tf \n \n from,to = tf.split('-').map { |e| (\"%02d%02d\" % _sh(e)).to_i }\n now = (\"%02d%02d\" % [Time.now.hour, Time.now.min]).to_i\n \n $stderr.puts \"#{from} #{to} - #{now}\"\n \n (from..to).include?(now)\n end",
"def futur?\n before > 0\n end",
"def predict_weather\n sunshine = [true, false].sample\n if sunshine\n puts \"Today's weather will be sunny!\"\n else\n puts \"Today's weather will be cloudy!\"\n end\nend",
"def one_sp_day(obs)\n [obs, false]\nend",
"def tired\t\n\tif $hours_asleep >= 8 then\n\t $hours_asleep = 0\n \t\treturn false\n \telse\n \t\t$hours_asleep += 1\n \t\treturn true\n \tend \t\t\nend",
"def clocked_in\n if clock_in_times.select {|c| c.time.localtime.to_date == Date.today}.count >= 1\n true\n end\n end",
"def trending_up(date)\n self.sickness_quotient(date).round(2) > self.sickness_quotient(date-1).round(2)\n end",
"def predict_weather\n sunshine = ['true', 'false'].sample\n if sunshine == 'true'\n puts \"Today's weather will be sunny!\"\n else\n puts \"Today's weather will be cloudy!\"\n end\nend",
"def predict_weather\n sunshine = [true, false].sample\n\n if sunshine\n puts \"Today's weather will be sunny!\"\n else\n puts \"Today's weather will be cloudy!\"\n end\nend",
"def predict_weather\n sunshine = [true, false].sample\n\n if sunshine\n puts \"Today's weather will be sunny!\"\n else\n puts \"Today's weather will be cloudy!\"\n end\nend",
"def predict_weather\n sunshine = [true, false].sample\n\n if sunshine\n puts \"Today's weather will be sunny!\"\n else\n puts \"Today's weather will be cloudy!\"\n end\nend",
"def upcoming?\n (start_date > Date.today)\n end",
"def perfectDayChecker day\n\t\t\t# If all five prayers were performed\n\t\t\tif day[:fajr] == 2 && day[:zuhr] == 2 && day[:asr] == 2 && day[:maghrib] == 2 && day[:isha] == 2\n\t\t\t \ttrue \t# Return true\n\t\t\telse\n\t\t\t\tfalse\t# Return false\n\t\t\tend\n\t\tend",
"def happy?\n return @happiness > 7\n end",
"def lessthan?\n if self.contractendon < 14.day.since.to_date && self.contractendon > Time.now.to_date\n return true\n end\n end",
"def happy?\n @happiness > 7 \n end",
"def first_sun?(days, year)\n\t(days % 7 == 0 && year > 1900) ? 1 : 0\n\tend",
"def predict_weather\n sunshine = ['true', 'false'].sample\n\n if sunshine\n puts \"Today's weather will be sunny!\"\n else \n puts \"Today\\'s weather will be cloudy!\"\n end\nend",
"def happy?\n @happiness > 7\n end",
"def predict_weather\n sunshine = ['true', false].sample\n\n if sunshine\n puts \"Today's weather will be sunny!\"\n else\n puts \"Today's weather will be cloudy!\"\n end\nend",
"def predict_weather\n # sunshine = ['true', 'false'].sample\n sunshine = [true, false].sample\n\n if sunshine\n puts \"Today's weather will be sunny!\"\n else\n puts \"Today's weather will be cloudy!\"\n end\nend",
"def hold_day?\n if self.date-7 < Date.today && self.date > Date.today\n return \"week_in\"\n elsif self.date < Date.today\n return \"finished\"\n end\n end",
"def predict_weather\n sunshine = ['true', 'false'].sample\n\n if sunshine\n puts \"Today's weather will be sunny!\"\n else\n puts \"Today's weather will be cloudy!\"\n end\nend",
"def predict_weather\n sunshine = ['true', 'false'].sample\n\n if sunshine\n puts \"Today's weather will be sunny!\"\n else\n puts \"Today's weather will be cloudy!\"\n end\nend",
"def classStart()\n ((self.date.strftime(\"%y\") == DateTime.now.strftime(\"%y\")) && \n (self.date.strftime(\"%m\") == DateTime.now.strftime(\"%m\")) && \n (self.date.strftime(\"%d\") == DateTime.now.strftime(\"%d\")) &&\n (self.date.strftime(\"%k\").to_i + 1 >= DateTime.now.strftime(\"%k\")).to_i)\n end",
"def tenders_ci(day)\n\tif day.upcase == 'THURSDAY' #convert our string to uppercase and then test\n\t\t\"It's Chicken Tenders Day!\" \n\telse \n\t\t\"Nope.\"\n\tend\nend",
"def trade_shifts_current_day?\n @trade_shifts_current_day\n end",
"def past?\n\n false # by default\n end",
"def day_pred(day, times = 1)\n check_pre((\n (day?(day))\n ))\n\n if (day_num_elem?(day) or day.day_num?)\n return day_num_pred(day, times)\n elsif (day_sym_elem?(day) or day.day_sym?)\n return day_sym_pred(day, times)\n end\nend",
"def w_day; end",
"def day_pred(day)\n check_pre((\n (day?(day))\n ))\n\n if day_num?(day)\n return day_num_pred(day)\n elsif day_sym?(day)\n return day_sym_pred(day)\n end\nend",
"def meal_plane(time_of_week, time_of_day)\n if time_of_week == \"weekday\"\n if time_of_day == \"breakfast\"\n \"Cereal\"\n elsif time_of_day == \"lunch\"\n \"Sandwinch\"\n elsif time_of_day == \"dinner\"\n \"Chicken nuggets\"\n end\n elsif time_of_week == \"weekend\"\n if time_of_day == \"breakfast\"\n \"French toast\"\n elsif time_of_day == \"lunch\"\n \"Pizza\"\n elsif time_of_day == \"dinner\"\n \"Steak\"\n end\n end\nend",
"def cwday\n end",
"def virtually_over?\n end_date < Date.today\n end",
"def find_day_of(num)\n curr_day = Time.new(2016, 1, 1)\n day_find = curr_day + (3600 * 24 * num - 1)\n #the_day = curr_day.yday()\n\n\n p \"#{day_find} is Monday\" if day_find.monday?\n p \"#{day_find} is Tuesday\" if day_find.tuesday?\n p \"#{day_find} is Wednesday\" if day_find.wednesday?\n p \"#{day_find} is Thursday\" if day_find.thursday?\n p \"#{day_find} is Friday\" if day_find.friday?\n p \"#{day_find} is Saturday\" if day_find.saturday?\n p \"#{day_find} is Sunday\" if day_find.sunday?\n\n p day_find.ctime\nend",
"def availdays(av)\n avail_day_1=false\n avail_day_1=true if (av&1)==1\n end",
"def past; end",
"def p1Alive #weather player is alive or not\r\n p1Life = true\r\n end",
"def feelings_day(feelings, day)\n # require 'googleauth'\n # # Get the environment configured authorization\n # scopes = ['https://www.googleapis.com/auth/cloud-platform',\n # 'https://www.googleapis.com/auth/compute']\n # authorization = Google::Auth.get_application_default(scopes)\n #\n # # Add the the access token obtained using the authorization to a hash, e.g\n # # headers.\n # some_headers = {}\n # authorization.apply(some_headers)\n #\n # require \"google/cloud/language\"\n # language = Google::Cloud::Language.new\n # content = feelings\n # document = language.document content\n # annotation = document.annotate\n\n # if annotation.sentiment.score < -(0.4)\n # audio_features.valence < convert_google_sentiment_to_spotify_valence(-0.4)\n # elsif (annotation.sentiment.score < 0 && annotation.sentiment.score > -(0.4))\n # p \"sad\"\n # elsif (annotation.sentiment.score < 0.5 && annotation.sentiment.score > 0)\n # p \"Sort of happu\"\n # elsif (annotation.sentiment.score > 0.5 && annotation.sentiment.score <= 1)\n # p \"HAppy \"\n # else\n # p \"ooppss\"\n # end\n\n # return (audio_features.valence < convert_google_sentiment_to_spotify_valence(annotation.sentiment.score) + 0.5) && (audio_features.valence > convert_google_sentiment_to_spotify_valence(annotation.sentiment.score) - 0.5)\n\n end",
"def result(day)\n case result_string(day.year)[day.yday - 1]\n when '2'\n true\n when '1'\n false\n end\n end",
"def early_mornings\n blocks.count do |b|\n eight = eight_am b.day\n b.start <= eight && b.finish > eight\n end\n end",
"def time_of_day(x)\n x ? (puts \"Daytime!\") : (puts \"Nighttime!\")\n # OR- if x\n # puts \"Daytime!\"\n end",
"def weatherman (condition, temperature)\n if condition == \"rainy\" && temperature == \"cold\"\n puts \"Better stay inside!\"\n elsif condition == \"rainy\" && temperature == \"hot\"\n puts \"Sounds like a gross combination.\"\n elsif condition == \"sunny\" && temperature == \"hot\"\n puts \"Maybe best to go swimming.\"\n elsif condition == \"windy\" && temperature == \"cold\"\n puts \"Bundle up!\"\n elsif condition == \"windy\" && temperature == \"hot\"\n puts \"Tornado warning!\"\n end\nend",
"def beg_for_food(food_served)\n if food_served\n puts \"Whimper\"\n end\n end",
"def parrot_trouble(talking, hour)\n if talking && (hour < 7 || hour > 20)\n puts \"NG\"\n else\n puts \"OK\"\n end\nend",
"def continuious_overstay?\n no_days_continuous_in_schengen > 90\n end",
"def country_comparison\n country_per_cap_daily_average = self.house.address.city.region.country.avg_daily_electricity_consumed_per_capita\n if country_per_cap_daily_average\n num_days = self.end_date - self.start_date\n bill_daily_average = self.total_kwhs.fdiv(num_days)\n avg_daily_use_per_resident = bill_daily_average.fdiv(self.no_residents)\n country_per_cap_daily_average > avg_daily_use_per_resident ? res = true : res = false\n res ? self.electricity_saved = ((country_per_cap_daily_average - avg_daily_use_per_resident) * num_days) : self.electricity_saved = 0\n else\n res = false\n self.electricity_saved = 0\n end\n res\n end",
"def happy?\nif @happiness >7\n\ttrue\nelse\n\tfalse\nend\nend",
"def wday() end",
"def future?\n Date.today <= finish\n end",
"def determine_snow_jacket_points\n weather_data['list'][0..3].any? { |wd| wd['snow'].try(:keys).try(:any?) } ? 10 : 0\n end",
"def allDay\n false\n end",
"def hungry?(time_of_day_in_hours)\n if time_of_day_in_hours < 12\n puts \"Me not hungry.\"\n\tfalse\n else\n puts \"Me hungry.\"\n true\n end\nend",
"def weather(location)\n \n #instantiate client object\n client = Weatherman::Client.new(unit: 'f')\n \n temp = client.lookup_by_location(location).condition['temp']\n condition = client.lookup_by_location(location).condition['text']\n\n puts \"The weather right now is #{condition} with a temperature of #{temp} \\xC2\\xB0F.\"\n \n \n #instantiate forecasts\n weather = client.lookup_by_location(location)\n forecasts = weather.forecasts \n \n ##################################\n #loop through forecast hashes to print out forecast values\n ##################################\n \n puts \"Here's your 5-day forecast:\"\n \n #Get today's day of the week as a number\n current_day = Time.now.strftime('%w').to_i\n \n forecasts.each do |forecast|\n \n #Get forecast's day of the week as a number\n forecast_day = forecast['date'].strftime('%w').to_i\n\n #compare current day with each forecast day to determine if forecast is today, tomorrow, or another day\n if current_day == forecast_day\n weekday = 'Today'\n elsif current_day + 1 == forecast_day\n weekday = 'Tomorrow'\n elsif current_day == 6 && forecast_day == 0\n weekday = 'Tomorrow'\n else\n weekday = forecast['day']\n end\n\n #print out forecast in terminal\n puts weekday + \"\\'s forecast is \" + forecast.fetch('text') + \" with a low of \" + forecast.fetch('low').to_s + \"\\xC2\\xB0F and a high of \" + forecast.fetch('high').to_s + \"\\xC2\\xB0F.\"\n\n\n end\n ##################################\n #end loop\n ##################################\n \nend",
"def passage_of_time\n if @stuff_in_belly > 0\n # move food from belly to intestine\n @stuff_in_belly = @stuff_in_belly - 1\n @stuff_in_intestine = @stuff_in_intestine + 1\n else\n if @asleep\n @asleep = false\n puts 'He wakes up suddenly!'\n end\n puts @name + ' is starving! In desperation, he ate YOU!'\n exit\n end\n \n if @stuff_in_intestine >= 10\n @stuff_in_intestine = 0\n puts 'Whoops! ' + @name + ' had an accident...'\n end\n \n if hungry?\n if @asleep\n @asleep = false\n puts 'He wakes up suddenly!'\n end\n puts @name + '\\'s stomach grumbles...'\n end\n \n if poopy?\n if @asleep\n @asleep = false\n puts 'He wakes up suddenly!'\n end\n puts @name + ' does the potty dance...'\n end\n end",
"def fifteen?\n @points == 1\n end",
"def should_run?\n date.sunday?\n end",
"def allDay\n FALSE\n end",
"def is_soon?\n is_event_soon = false\n if is_future? == true\n is_event_soon = true if (start_date - Time.now <= 30*60)\n end\n return is_event_soon\n end",
"def day() end",
"def send?\n # TODO: rename to better name\n !Holiday.today?\n end",
"def time_passed\n @food_in_belly -= 10\n @food_in_intestine += 10\n @hydration_level -= 10\n @liquid_in_bladder +=10\n\n if @hydration_level < 30\n puts \"#{@name} is thirsty!\"\n end\n\n if @liquid_in_bladder > 50\n if @awake != true\n @awake = true\n puts \"#{@name} suddenly awakes because she needs to pee!\"\n else\n puts \"#{@name} needs to go out to pee.\"\n end #end of conditonal if she wakes up to pee\n end\n\n if @food_in_belly < 30\n puts \"#{@name} is hungry!\"\n end #end of conditional to determine hunger\n\n if @food_in_belly <= 0\n if @awake != true\n @awake = true\n puts \"#{@name} suddenly awakes because she is hungry!\"\n else\n puts \"#{@name} was so hungry she ate you!\"\n exit #makes the program end\n end #end of conditional if she's so hungry she wakes up\n end #end of conditional if hunger drops to zero\n\n #what happens if drago is dehydrated to 0\n if @hydration_level <= 0\n if @awake != true\n @awake = true\n puts \"#{@name} suddenly awakes because she is thristy!\"\n else\n puts \"#{@name} was so thirsty she incinerates you!\"\n exit #makes the program end\n end\n end\n\n if @food_in_intestine > 80\n if @awake != true\n @awake = true\n puts \"#{@name} suddenly awakes because she needs to go out to poop!\"\n else\n puts \"#{@name} needs to go out to poop.\"\n end #end of conditonal if she wakes up to pee\n end#end of if statement for when she needs to go out\n\n if @awake != true\n puts \"#{@name}: zzzzzzzzzzz.....\"\n end #end of snooze comditional\n end",
"def happy?\n if @happiness > 7\n true\n else\n false\n end\n end",
"def interesting_date\n marked_as_fast_growing_at\n end",
"def round_now?\n #something like the above, but also goes into finding the tournament and then cheking if any rounds are active.\n return false;\n end"
] | [
"0.6760223",
"0.6559218",
"0.65440464",
"0.629016",
"0.6239676",
"0.6165904",
"0.6094402",
"0.60584205",
"0.6054313",
"0.60187423",
"0.6017667",
"0.6016583",
"0.59984154",
"0.59821707",
"0.5891176",
"0.5877735",
"0.5874637",
"0.5853128",
"0.5812249",
"0.57867426",
"0.5776873",
"0.57708275",
"0.5766552",
"0.5757639",
"0.57534313",
"0.57471853",
"0.5736705",
"0.5706629",
"0.5699461",
"0.569371",
"0.5686527",
"0.5680436",
"0.5664331",
"0.56626654",
"0.56595176",
"0.56562895",
"0.56549734",
"0.56530666",
"0.5652935",
"0.56501573",
"0.5603216",
"0.5593952",
"0.55840695",
"0.5577482",
"0.5577482",
"0.5577482",
"0.55715656",
"0.5568605",
"0.5566284",
"0.5565443",
"0.5555712",
"0.5549346",
"0.554933",
"0.5540058",
"0.55370533",
"0.5535391",
"0.5532027",
"0.55294645",
"0.55294645",
"0.55218613",
"0.5513486",
"0.5509118",
"0.55081296",
"0.5501946",
"0.5491092",
"0.5483733",
"0.547915",
"0.54784536",
"0.5471076",
"0.5458241",
"0.5457346",
"0.54465425",
"0.5442765",
"0.5435351",
"0.5431501",
"0.5430603",
"0.5426264",
"0.5421981",
"0.54162127",
"0.5414036",
"0.5410372",
"0.5409933",
"0.5408853",
"0.54071313",
"0.5403812",
"0.540205",
"0.5395398",
"0.5395109",
"0.5387691",
"0.53875136",
"0.5386851",
"0.53832",
"0.53801256",
"0.5379939",
"0.53711486",
"0.5367394",
"0.5362055",
"0.53573656",
"0.5353683",
"0.5352781"
] | 0.55151725 | 60 |
Had to separate initial_cards from show_cards, because I couldn't think of an easy way to only show the first dealer card. | def show_cards(players_hand, dealers_hand)
puts "Dealers cards:"
dealers_hand.each do |card|
puts ".---. "
puts "|#{card[0]} | "
puts "| #{card[1]} | "
puts "| #{card[0]}| "
puts ".---. "
puts
end
puts "Players cards:"
players_hand.each do |card|
puts ".---. "
puts "|#{card[0]} | "
puts "| #{card[1]} | "
puts "| #{card[0]}| "
puts ".---. "
puts
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def deal_cards\n Print.heading('Dealing initial cards')\n deal_card_to_players\n dealer_card_to_dealer(false) #false to hide first dealer card\n deal_card_to_players\n dealer_card_to_dealer(true)\n end",
"def show_dealer_cards(dlr_first_hand, game_status)\n c1_pic = dlr_first_hand[:show_card_1][:picture]\n c1_name = dlr_first_hand[:show_card_1][:name]\n c2_pic = dlr_first_hand[:show_card_2][:picture]\n c2_name = dlr_first_hand[:show_card_2][:name]\n hits = dlr_first_hand[:hit_cards].map { |n| n[:name] }\n dealer_hand_total = game_status[:dealer_hand]\n\n if game_status[:show_all_hands] == false\n c2_pic = '? '\n dealer_hand_total = \"unknown\"\n end\n\n prompt \"***** Dealers Cards *****\"\n prompt \"Here are the dealers first 2 cards\"\n prompt \"First card => #{c1_name}\"\n prompt \"Second card => Dealer to know, you to find out..\"\n prompt \"+-----+ +-----+\"\n prompt \"| | | |\"\n prompt \"| #{c1_pic} | | #{c2_pic} |\"\n prompt \"| | | |\"\n prompt \"+-----+ +-----+\"\n prompt \" \"\n prompt \"Dealers 'hit cards' #{hits}\"\n prompt \"The dealers total card count is #{dealer_hand_total}\"\nend",
"def give_initial_cards\n # deal each player their initial cards\n @players.each do |player|\n player.receive(@deck.draw_card)\n player.receive(@deck.draw_card)\n end\n\n # give the dealer his two cards\n @dealer.receive(@deck.draw_card)\n @dealer.receive(@deck.draw_card)\n end",
"def show_dealer_cards(dlr_first_hand, game_status)\n c1_pic = dlr_first_hand[:show_card_one][:picture]\n c1_name = dlr_first_hand[:show_card_one][:name]\n c2_pic = dlr_first_hand[:show_card_two][:picture]\n c2_name = dlr_first_hand[:show_card_two][:name]\n hits = dlr_first_hand[:hit_cards].map { |n| n[:name] }\n dealer_hand_total = game_status[:dealer_hand]\n\n if game_status[:show_all_hands] == false\n c2_pic = '? '\n dealer_hand_total = \"unknown\"\n end\n\n prompt \"***** Dealers Cards *****\"\n prompt \"Here are the dealers first two cards\"\n prompt \"First card => #{c1_name}\"\n prompt \"Second card => Dealer to know, you to find out..\"\n prompt \"+-----+ +-----+\"\n prompt \"| | | |\"\n prompt \"| #{c1_pic} | | #{c2_pic} |\"\n prompt \"| | | |\"\n prompt \"+-----+ +-----+\"\n prompt \" \"\n prompt \"Dealers 'hit cards' #{hits}\"\n prompt \"The dealers total card count is #{dealer_hand_total}\"\nend",
"def show_card\n\t\t@cards.shuffle.first\n\tend",
"def dealInitialCards\n\t\t@players.each.with_index do |player, playerIndex|\n\t\t\t(0..1).each do |i|\n\t\t\t\tcard = @deck.getNextCard\n\t\t\t\tplayer.dealCard(card, 0, false)\n\t\t\t\tif playerIndex != DEALER_INDEX\n\t\t\t\t\t@out.puts \"Player #{playerIndex} drew a #{card}\"\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\tend",
"def card_display(cards, num_cards, hidden = false)\n dealer_first_card = cards[0] if hidden == true\n cards[0] = [' ', ' '] if hidden == true\n num_cards.times { print \" ______ \" }\n puts \"\"\n num_cards.times { |num| print \" |#{cards[num][0].encode('utf-8')} |\" }\n puts \"\"\n num_cards.times { print \" | |\" }\n puts \"\"\n num_cards.times { |num| print \" | #{cards[num][1]} |\" }\n puts \"\"\n num_cards.times { print \" | |\" }\n puts \"\"\n num_cards.times { |num| print \" |_____#{cards[num][0].encode('utf-8')}|\" }\n puts \"\"\n cards[0] = dealer_first_card if hidden == true\nend",
"def show_hands_initial\n puts \"\\nYour hand (#{player_hand_total}):\" #\\n creates a new line. makes the command line text easier to read\n players_hand.each do |card|\n puts \"\\t#{card.face} of #{card.suit}\" #\\t indents the given text. not necessary, just easier to read/play\n end\n puts \"\\nDealer is showing #{dealers_hand[0].face} of #{dealers_hand[0].suit}\"\n end",
"def display_deck\n @deck_array.each do |x|\n x.display_card\n end\n end",
"def display\n\t\t@deck_of_cards.each.with_index do |card, i|\n\t\t\tputs \"#{i}=> #{card.display}\"\n\t\tend\n\tend",
"def show\n set_card\n end",
"def show\n @card_one = Card.find( params[:id] )\n setup_for_display \n end",
"def card_display(i)\n if(i < @hidden_cards.size)\n Card::HIDDEN_CARD_STRING\n else\n Card.card_to_s(@cards[i - @hidden_cards.size])\n end\n end",
"def display_dealer_card(dealer=\"\")\n card = []\n if dealer == \"dealer\"\n card = @dealer_hand # Fetch all of dealers cards\n else\n card = [\"blank card\"]\n card << @dealer_hand.fetch(1) # Fetch dealers 2cd card\n end\n return card\n end",
"def show_hands_initial\n player.show_hand\n dealer.show_hand\n end",
"def show_cards\r\n @user_cards = User.find(params[:id]).cards\r\n end",
"def display_card(player_hand,dealer_hand,index,dealer_turn)\n\t#puts \"debug: display_card\"\n\n\tif index >= dealer_hand.length\n\t\t# we know that we have gone past the length of the hand, so print blanks\n\t\tplayer_card = ' '\n\telse\n\t\tplayer_card = player_hand[index]\n\tend\n\n\t# To print the dealer hand, we know that if dealer_turn is false, don't dislay the second card\n\tif !dealer_turn\n\t\tif index == 1\n\t\t\tdealer_card = '--'\n\t\telsif index == 0\n\t\t\tdealer_card = dealer_hand[0]\n\t\telse\n\t\t\tdealer_card = ' '\n\t\tend\n\telse \n\t\t# We know it is the dealer turn\n\t\tif index >= dealer_hand.length\n\t\t\t# we know that we have gone past the length of the hand, so print blanks\n\t\t\tdealer_card = ' '\n\t\telse\n\t\t\tdealer_card = dealer_card[index]\n\t\tend\n\tend\n\n\tputs (\" \" * (13 - player_card.length)) + player_card + (\" \" * (17 - dealer_card.length)) + dealer_card\nend",
"def player_deal_card\n player.add_card(deck.deal_card)\n player.add_card(deck.deal_card)\n player.show_hand\n end",
"def show_facecard\r\n\t\tputs \"The #{name} is showing:\" \r\n\t\thand.cards[1].display_card\r\n\tend",
"def choose_card \n\n @cards.shift\n end",
"def show_cards_of player\r\n if player == nil\r\n return\r\n end\r\n player[:cards].each do |card|\r\n card[:visible] = 1\r\n end\r\nend",
"def leading_card\n \tCard.find_by(owner_id: id )\n end",
"def show_visible_card\n puts \"*******************************************************************\"\n puts \" Dealer's visible card is: \" + num_to_rank(@hand[1])\n puts \"*******************************************************************\"\n end",
"def show\n @make_card = MakeCard.find(params[:id])\n @rechargeable_cards_ids = @make_card.rechargeable_cards.ids\n @rechargeable_cards = RechargeableCard.find(@rechargeable_cards_ids)\n @rechargeable_cards = RechargeableCard.paginate(page: params[:page])\n\n end",
"def remaining_cards\r\n @deck_of_cards.each do |card|\r\n card.output_card\r\n end\r\n end",
"def desk_cards\n desk = []\n self.public_deal.each do |i|\n desk.push(i)\n end\n self.hand_deal.each do |i|\n desk.push(i)\n end\n desk\n end",
"def show_hand\n if @hand.point == \"Blackjack\" # the dealer should reveal both cards when it has blackjack\n @hand.turn_all_cards_up\n puts \" #{@hand.to_s} Blackjack\\n\" \n else\n puts \" #{@hand.to_s}\\n\"\n end\n end",
"def display_hand(hand)\n card_names = {\n \"c2\" => \"the 2 of clubs\", \"c3\" => \"the 3 of clubs\", \"c4\" => \"the 4 of clubs\", \"c5\" => \"the 5 of clubs\", \"c6\" => \"the 6 of clubs\", \"c7\" => \"the 7 of clubs\", \"c8\" => \"the 8 of clubs\", \"c9\" => \"the 9 of clubs\", \"c10\" => \"the 10 of clubs\", \"cj\" => \"the jack of clubs\", \"cq\" => \"the queen of clubs\", \"ck\" => \"the king of clubs\", \"ca\" => \"the ace of clubs\",\n \"d2\" => \"the 2 of diamonds\", \"d3\" => \"the 3 of diamonds\", \"d4\" => \"the 4 of diamonds\", \"d5\" => \"the 5 of diamonds\", \"d6\" => \"the 6 of diamonds\", \"d7\" => \"the 7 of diamonds\", \"d8\" => \"the 8 of diamonds\", \"d9\" => \"the 9 of diamonds\", \"d10\" => \"the 10 of diamonds\", \"dj\" => \"the jack of diamonds\", \"dq\" => \"the queen of diamonds\", \"dk\" => \"the king of diamonds\", \"da\" => \"the ace of diamonds\",\n \"h2\" => \"the 2 of hearts\", \"h3\" => \"the 3 of hearts\", \"h4\" => \"the 4 of hearts\", \"h5\" => \"the 5 of hearts\", \"h6\" => \"the 6 of hearts\", \"h7\" => \"the 7 of hearts\", \"h8\" => \"the 8 of hearts\", \"h9\" => \"the 9 of hearts\", \"h10\" => \"the 10 of hearts\", \"hj\" => \"the jack of hearts\", \"hq\" => \"the queen of hearts\", \"hk\" => \"the king of hearts\", \"ha\" => \"the ace of hearts\",\n \"s2\" => \"the 2 of spades\", \"s3\" => \"the 3 of spades\", \"s4\" => \"the 4 of spades\", \"s5\" => \"the 5 of spades\", \"s6\" => \"the 6 of spades\", \"s7\" => \"the 7 of spades\", \"s8\" => \"the 8 of spades\", \"s9\" => \"the 9 of spades\", \"s10\" => \"the 10 of spades\", \"sj\" => \"the jack of spades\", \"sq\" => \"the queen of spades\", \"sk\" => \"the king of spades\", \"sa\" => \"the ace of spades, aww yeah!\"\n}\n puts \"Your hand contains the following cards:\"\n hand.each do |key, _|\n puts card_names[key]\n end\nend",
"def show_card(player, i, j)\n display(\"#{player.name} has: #{player.hands[i].cards[j]}\\n\\n\")\n end",
"def display_board_screen(hidden_dealer)\n display_hand_dealer = []\n display_hand_player = []\n\n if hidden_dealer\n dealer_card = [generate_ASCII_card(@hand_dealer[0]),generate_ASCII_card(@hidden_card)]\n display_hand_dealer = concatenate_cards(dealer_card)\n\n else\n dealer_card = []\n @hand_dealer.each do |card|\n dealer_card.push(generate_ASCII_card(card))\n end\n display_hand_dealer = concatenate_cards(dealer_card)\n end\n \n\n @hand_player.each do |card|\n player_card = []\n @hand_player.each do |card|\n player_card.push(generate_ASCII_card(card))\n end\n display_hand_player = concatenate_cards(player_card)\n end\n\n system \"clear\" or system \"cls\"\n puts \"Dealer:\"\n puts display_hand_dealer\n puts\n puts \"Player:\"\n puts display_hand_player\n puts\n puts \"Do you want to (h)it or (s)tay?\"\nend",
"def show_cards2(dck, dlr, plyr, plyr_points, dlr_points)\n system \"clear\"\n puts \"=========================\"\n prompt \"Dealer has...#{dlr_points}\"\n dlr.each do |card|\n prompt \" \" + dck[card][:name] + ' ' + dck[card][:value].to_s\n end\n puts\n prompt \"Player has...#{plyr_points}\"\n plyr.each do |card|\n prompt \" \" + dck[card][:name] + ' ' + dck[card][:value].to_s\n end\nend",
"def showDeck\n puts \"\\nDeck looks like this:\"\n # Dynamically determine leading spaces so output lines up nicely...\n ls = self.cardsAvailable.to_s.size\n i = 0\n @deckA.each do |c|\n i += 1\n puts \"Card #{i.to_s.rjust(ls,\" \")} in deck is: #{c.to_s.rjust(ls, \" \")}->#{@deckOfCards[c].visible}\"\n end\n end",
"def get_cards(deck)\n\n end",
"def show\n cards = @deck.cards\n cards = cards.where(is_disabled: false)\n @cards = cards.shuffle\n end",
"def display_hands(cards_of_player, cards_of_dealer, player_name, hidden)\n system 'clear'\n print \"#{player_name}:\\t\"\n cards_of_player.each {|card| print card.join + ' '}\n puts \"\\t\\tPoints: #{calculate_points(cards_of_player)}\"\n puts\n print \"Dealer:\\t\"\n cards_of_dealer.each_with_index do |v, index|\n if !hidden || index == 0\n print v.join + ' '\n else\n print \"??\" + ' '\n end\n end\n\n print \"\\t\\tPoints: #{calculate_points(cards_of_dealer)}\" if !hidden\n puts\n puts\nend",
"def show\n @cards = Card.where(:duelist_id == @duelist.id)\n end",
"def display_cards (cards, name)\n puts \"#{name} has been dealt:\"\n cards.each do |card|\n puts \"#{card.value} of #{card.suit}\"\n end \n end",
"def print_deal_cards\n puts \"-----------\"\n puts \"Cards Dealt\"\n puts \"-----------\"\n end",
"def display_compare_cards(player_cards, dealer_cards)\n # compare cards!\n puts \"==============\"\n prompt \"Dealer has #{dealer_cards}, for a total of: #{total(dealer_cards)}\"\n prompt \"Player has #{player_cards}, for a total of: #{total(player_cards)}\"\n puts \"==============\"\nend",
"def deal_cards\n player.add_card(deck.deal_one)\n dealer.add_card(deck.deal_one)\n player.add_card(deck.deal_one)\n dealer.add_card(deck.deal_one)\n end",
"def show\n @owner = Owner.find(params[:id])\n @cards = []\n @owner.cards.each do |card|\n @cards << [\"#{card.name} (#{card.brand.category})\", card.count]\n end \n end",
"def cards\n @cards\n end",
"def display_cards(card_array)\n card_images = [[],[],[],[],[]]\n card_array.each do |card|\n card_images.each_index { |index| card_images[index] << make_card_image(card)[index] }\n end\n \n card_images.each do |image_section_of_card|\n puts image_section_of_card.join(\" \")\n end\n end",
"def display_hands(player_hand, dealer_hand, hide_dealer=false)\n system('clear') || system('cls')\n puts \">>>>>> Twenty-One <<<<<<\"\n prompt(\"Dealer's Hand:\")\n print_cards(dealer_hand, hide_dealer)\n puts\n prompt(\"Player's Hand:\")\n print_cards(player_hand)\nend",
"def deal_cards\n MAX_CARDS.times do |d|\n @player_manager.players.each do |player| \n player.rack.add_card(@decks_manager.draw_pile.draw_card)\n end\n end\n\n # prep the discard pile with one card from the top of the draw pile\n @decks_manager.discard_top_card\n end",
"def initial_hand(hand,name)\n puts\n hand.cards.each do |card|\n puts \"#{name} was dealt #{card.rank}#{card.suit}\"\n end\n puts \"#{name}'s score: #{hand.determine_score}\\n\"\n end",
"def deal\n\n @first_card = @cards.shift\n\n return @first_card\n\n end",
"def face_cards\n @face_cards ||= DEFAULT_FACE_CARDS\n end",
"def draw_initial_cards\n @card1 = Card.draw\n @card2 = Card.draw(@card1.id)\n\n # check for joker\n raise Rules::Bust::Joker if @card1.joker? || @card2.joker?\n\n # check for consecutive\n raise Rules::Bust::Consecutive if (@card1.value - @card2.value).abs == 1\n\n # player wins if the cards are the same\n raise Rules::Win::SameCards if @card1.value == @card2.value\n end",
"def deal(num_cards)\n card_lst = @cards.slice!(0,num_cards)\n return (num_cards == 1 ? ((card_lst == nil) ? nil : card_lst[0]) : card_lst)\n end",
"def cards\n\t\t@cards.each do |card|\n\t\t\tputs card.card\n\t\tend\n\tend",
"def print_dealers_partial_hand(dealer)\n dealer_hand = dealer.get_hand\n cards = dealer_hand.get_hand_cards\n print \"Dealer: Hand: \"\n print \"#{cards[0].symbol}#{cards[0].suit} \"\n print \"XX\"\n puts \"\"\n end",
"def display_both_hands(users_name, dealers_hand, users_hand, initial_deal_bool, cards_n_values)\n display_players_hand(\"Dealer\", dealers_hand, initial_deal_bool, cards_n_values)\n puts\n display_players_hand(users_name, users_hand, false, cards_n_values)\n puts\n\n return nil\nend",
"def cards(options = { :filter => :open })\n return @cards if @cards\n @cards = Client.get(\"/boards/#{id}/cards\").json_into(Card)\n end",
"def show_cards(gamer, name)\n puts say(\"#{name} cards on hand list below:\")\n gamer.each do |card|\n puts \"[#{card[:suit]} #{card[:value]}]\"\n end\nend",
"def show_hand(player_ID)\n card_ID = 0\n print_with_pause(\"Here are your cards...\".colorize(:red))\n print_with_pause(\"Choose wisely.\".colorize(:red))\n waits(2)\n puts `clear`\n while card_ID < @players[player_ID].cards.length\n line_number = card_ID + 1\n puts (line_number.to_s + \". \" + @players[player_ID].cards[card_ID].value).colorize(:black).on_white\n card_ID = card_ID + 1\n end\n end",
"def play_like_a_master\r\n card = nil\r\n @log.debug \"Cards on hand \" + @cards_on_hand.inject(\"\"){|res, card| res + \"#{card.to_s} \"}\r\n \r\n case @card_played.size\r\n when 0\r\n card = play_as_master_first\r\n when 1\r\n card = play_as_master_second\r\n end\r\n return card\r\n end",
"def first_deal\n @printer = []\n if session[:player].chips == 0\n @printer << \"#{session[:player].gender}. #{session[:player].name} is all in!\"\n session[:player].make_reckless\n end \n deal_dealer\n de_total\n 2.times {deal_player}\n pl_total\n if session[:player].hand_total == 21\n @action = :end\n run_dealer\n else\n @action = :choice\n end\n chat\n end",
"def return_cards\n @hand = []\n end",
"def stackshow\n puts \"#{@@stack.length} cards remaining\"\n for card in @@stack do\n card.show\n end\n end",
"def display_card_deck(deck_key)\r\n if @deck_infos[deck_key]\r\n @curr_deck_key = deck_key\r\n deck_info = @deck_infos[deck_key]\r\n @menu_deck_name.setCurrentNo(deck_info[:pane_ix])\r\n init_deck(deck_key)\r\n @canvas_disp.update\r\n end\r\n end",
"def show(card)\n # H ==1, D==2, C==3, S==4\n card[0] = 'H' if card[0] == 1\n card[0] = 'D'if card[0] == 2\n card[0] = 'C' if card[0] == 3\n card[0] = 'S' if card[0] == 4\n card[1] = 'J' if card[1] == 11\n card[1] = 'Q' if card[1] == 12\n card[1] = 'K' if card[1] == 13\n card[1] = 'A' if card[1] == 14\n card\n end",
"def show_deck(deck) \n display(deck.to_s)\n end",
"def deal_card_to_player(player, card, show)\n if show\n puts \"Dealing to #{player.name}: #{card}\"\n elsif\n puts \"Dealing hidden card to #{player.name}\"\n end\n player.hands[0].add_card(card, false)\n end",
"def show_hands_final\n player.show_hand\n dealer.show_hand_for_turn\n end",
"def printCards(hide_card=true)\n card_strings_array = printCardsArray\n if hide_card # If hide the last card, remove the last\n card_strings_array.pop # string and replace it with \"X:X\"\n card_strings_array.push(\"X:X\")\n end\n to_print = \"\"\n card_strings_array.each do |card_string| # concatenate everything\n to_print += card_string\n end\n to_print + \"\\n\"\n end",
"def deal_cards\n\t\t\tend",
"def deal_cards\r\n\t\t@player.draw_card(@deck.deal_card)\r\n\t\t@dealer.draw_card(@deck.deal_card)\r\n\t\t@player.draw_card(@deck.deal_card)\r\n\t\t@dealer.draw_card(@deck.deal_card)\r\n\tend",
"def show_players\n puts @cards.length\n @players.each do |player|\n puts \"Nombre: #{player.name}\"\n player.cards.each do |card|\n puts card.id\n end\n end\n end",
"def play\n deal( INITIAL_CARDS )\n while hand.deck.size >= CARD_SET\n compare_cards\n deal( CARDS )\n end\n end",
"def show\n @quizSelect = Quiz.find(1)\n @questions = @quizSelect.questions\n @cards = Card.all.limit(@quizSelect.questions.count*3).shuffle\n\n \tend",
"def showHands\n @players.times do |p|\n i=p + 1\n print \"\\nPlayer #{i}:\"\n # DJBHERE DJB HERE str = \"file_\" + i.to_s.rjust(n, \"0\")\n @playersCards[i].each do |c|\n print \" #{c.visible}\"\n end\n end\n end",
"def play_like_a_dummy\r\n # very brutal algorithm , always play the first card\r\n #card = @cards_on_hand.pop\r\n #p @cards_on_hand.size\r\n card = @cards_on_hand[0]\r\n if card\r\n # check if the played card take something\r\n #@table_cards\r\n \r\n #@log.debug \"Alg: cards on table #{@table_cards}\"\r\n list = @core_game.which_cards_pick(card, @table_cards)\r\n #p \"which cards pick: card #{card}, table #{@table_cards.join(\",\")}, list #{list.size}\"\r\n result = [card, list[0]].flatten\r\n return result\r\n end\r\n raise \"Error cards on hand #{@cards_on_hand.join(',')}\" \r\n end",
"def dealer_turn\n @dealer.show_hidden_card\n render_cards(@dealer.cards_in_hand, \"The Dealer shows his hidden card...\")\n hit_loop(@dealer) unless @player.bust?\n end",
"def display_hands(player_hand, dealer_hand, dealer_turn)\n\tputs \"Debug: display_hands\" \n\n\t# show the hands\n\tputs \" Player Dealer\"\n\tputs \" ====== ======\"\n\n\t# Determine the max rows to display\n\tmax_rows = [player_hand.length, dealer_hand.length].max\n\n\tfor index in 0..max_rows-1\n\t\tdisplay_card(player_hand, dealer_hand, index, dealer_turn)\n\tend\n\n\t# Print the totals\n\tdisplay_card_total(player_hand, dealer_hand, dealer_turn)\nend",
"def first_hand\n @player_hand = deck.cards.pop(2)\n @dealer_hand = deck.cards.pop(2)\n puts \"House will now deal you two cards..Press any key.\"\n #Dumb speech, might take out.\n %x(say 'to lose')\n gets\n #Shows the first two cards you receive\n puts \"Dealer showing #{dealer_hand[0].face} of #{dealer_hand[0].suit}.\"\n puts \"You have a #{player_hand[0].face} of #{player_hand[0].suit} and a #{player_hand[1].face} of #{player_hand[1].suit}. \"\n two_aces\n if dealer_score == 21\n puts \"Well you lost, I got #{dealer_score} already. That was quick huh.\"\n dealer_win\n play_again\n elsif player1_score == 21\n puts \"You win. with a total of #{player1_score}. I didn't even get to deal :(\"\n player_win\n play_again\n else\n play\n end\n end",
"def show_top_card\n self.discard(draw)\n end",
"def show\n @team = Team.find(params[:id])\n @cards = @team.cards :all, :limit => 10\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @team }\n end\n end",
"def fetch_cards\n log 'fetch_cards'\n data = get(PRODUCTS_ENDPOINT, fields: { carteras: false,listaSolicitada: 'TODOS',indicadorSaldoPreTarj: false })\n data['datosSalidaTarjetas']['tarjetas'].map{ |data| build_card(data) }\n end",
"def draw_first_hand(hand, cards)\n hand = []\n hand << draw_card(cards)\n hand << draw_card(cards)\nend",
"def current_card\n @deck.cards[0]\n end",
"def play_like_a_dummy\r\n # very brutal algorithm , always play the first card\r\n card = @cards_on_hand.pop\r\n return card\r\n end",
"def draw\n raise \"not enough cards\" if @cards.empty?\n @cards.shift\n end",
"def list_hand_cards(card_array) \n user_choice = \"\"\n while user_choice != \"⬅️ BACK ⬅️\" && user_choice != \"🗑 DELETE READING 🗑\" do\n user_choice = prompt.select(\"🔮 #{self.user.name}, Select a card to see more details.\") do |menu|\n card_emoji_string = \"🂠\"\n crystal_ball_emoji_string = \"🔮\"\n card_array.map do |handCard|\n string=\" 🂠 TAROT #{crystal_ball_emoji_string} 🂠 \"\n menu.choice \" 🂠 TAROT #{crystal_ball_emoji_string} 🂠 \", -> {reading_card(handCard.card, card_array,string); \" 🂠 TAROT #{crystal_ball_emoji_string} 🂠 \"}\n card_emoji_string += \"🂠\"\n crystal_ball_emoji_string += \" 🔮\"\n end\n menu.choice \"🗑 DELETE READING 🗑\", -> {self.delete_reading(card_array); \"🗑 DELETE READING 🗑\"}\n menu.choice \"⬅️ BACK ⬅️\", -> {self.main_menu;\"⬅️ BACK ⬅️\"}\n end \n end \n end",
"def display (card)\n image_name = \"/images/cards/\" + card[0] + \"_\" + card[1] + \".jpg\"\n image_name\n end",
"def get_card\n end",
"def show\n @card_sort_result = CardSortResult.new\n end",
"def card_output(cards)\n cards.each do |card|\n if card.downcase.include?('h')\n print \" #{card.chars[0]} of Hearts \".light_red.on_light_white\n # print \"#{card}\".light_red.on_light_white\n elsif card.downcase.include?('c')\n print \" #{card.chars[0]} of Clubs \".black.on_light_white\n # print \"#{card}\".black.on_light_white\n elsif card.downcase.include?('d')\n print \" #{card.chars[0]} of Diamonds \".red.on_light_white\n # print \"#{card}\".red.on_light_white\n elsif card.downcase.include?('s')\n print \" #{card.chars[0]} of Spades \".light_black.on_light_white\n # print \"#{card}\".light_black.on_light_white\n end\n print ' and the ' unless card == cards.last\n end\nend",
"def show\n\t\t@cardsort = Cardsort.find(params[:cardsort_id])\n\t\t@cards = @cardsort.cards\n\t\t@groups = @cardsort.groups\n\t\t#other_cardsorts = @cardsort.project.cardsorts\n\tend",
"def deal_initial_hands\n INITIAL_CARDS.times do\n @players_in_round.each do |player|\n @deck.deal_to player\n end\n end\n end",
"def choose_cards(turn, player)\n if turn.turn_card_on_deck?\n rand_num = rand(2)\n list_of_cards = case\n when rand_num == 0: Array.new.push(turn.turn_get_a_card_from_deck)\n when rand_num == 1: turn.turn_get_cards_from_stack(1)\n end\n else\n list_of_cards = turn.turn_get_cards_from_stack(1)\n end\n list_of_cards.concat(turn.turn_get_cards_from_stack(1))\n end",
"def filter_cards(cards)\n cards = Array(cards) unless cards.respond_to?(:count) \n return cards.select { |card| Card.get(card.id).nil? } #TODO: move this to method\n end",
"def initialize(cards)\n @cards = cards\n end",
"def initialize(cards)\n @cards = cards\n end",
"def initialize(cards)\n @cards = cards\n end",
"def current_repetition\n @cards = current_user.cards_due\n @card = @cards.sample\n end",
"def deal_cards(player_hand, dealer_hand)\n\t# Everyone gets 2 cards\n\t2.times do\n\t\tdeal_card(player_hand)\n\t\tdeal_card(dealer_hand)\n\tend\nend",
"def draw\n @cards.shift\n end",
"def print_cards\n str_arr = @cards.map { |card| card.to_s }\n cards_str = str_arr.join(\", \")\n \"#{@name}'s cards: #{cards_str}\"\n end",
"def get_next_card\n if params[:type]\n num_of_cards = session[:all_cards].size - 1\n random_num = rand(0..num_of_cards)\n\n #Ensures a previously dealt card is not dealt again\n while( session[:all_cards][random_num].to_i==0 )\n random_num = rand(0..num_of_cards)\n end\n\n selected = session[:all_cards][random_num]\n session[:all_cards][random_num] = 0\n session[:player_cards] << selected if params[:type].to_s==\"player\"\n session[:dealer_cards] << selected if params[:type].to_s==\"dealer\"\n @status = :ok\n else\n selected = nil\n @status = :failed \n end\n respond_to do |format|\n format.json { render :json => {:status => @status, :selected => selected} }\n end\n end"
] | [
"0.7474914",
"0.7075754",
"0.70465183",
"0.7036786",
"0.70065236",
"0.6995966",
"0.6731462",
"0.672787",
"0.6638253",
"0.66009873",
"0.65614086",
"0.65503997",
"0.6543507",
"0.65348715",
"0.651512",
"0.651397",
"0.6494259",
"0.6444714",
"0.64093196",
"0.63866574",
"0.6358034",
"0.63333726",
"0.6325515",
"0.6284867",
"0.6283841",
"0.62821347",
"0.6263711",
"0.6262188",
"0.62437993",
"0.62255794",
"0.62133664",
"0.61951655",
"0.6170818",
"0.61688",
"0.6159232",
"0.615517",
"0.61401564",
"0.6118541",
"0.6117727",
"0.61055195",
"0.6100848",
"0.60766137",
"0.6061522",
"0.60368854",
"0.6029463",
"0.60231614",
"0.602313",
"0.6013494",
"0.6011025",
"0.60090727",
"0.59909666",
"0.5973598",
"0.5958827",
"0.59472597",
"0.594111",
"0.59403765",
"0.59299177",
"0.591982",
"0.59157807",
"0.5911154",
"0.5904144",
"0.5899704",
"0.58877736",
"0.5883708",
"0.5858379",
"0.58570707",
"0.58507925",
"0.58481425",
"0.5846274",
"0.5843608",
"0.5835965",
"0.5830103",
"0.5828363",
"0.582709",
"0.5806584",
"0.5797879",
"0.5795842",
"0.5789805",
"0.57873964",
"0.578568",
"0.5785509",
"0.57806224",
"0.5765104",
"0.57485545",
"0.57451075",
"0.5732395",
"0.5725048",
"0.57232213",
"0.5709024",
"0.5705404",
"0.57014775",
"0.57007486",
"0.5700411",
"0.5700411",
"0.5700411",
"0.5693446",
"0.5691254",
"0.5690832",
"0.56848156",
"0.5664575"
] | 0.6695631 | 8 |
define method that will take block code as argument | def display_favorite_things
puts "This method is gearing up to start!"
# yield to block code in method call, passing three colors
yield("blue","purple","pink")
# yield to block code in method call, passing three sports
yield("soccer","football","jazzercise")
puts "This method is all done with work and is winding down."
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def block; end",
"def block; end",
"def block; end",
"def block; end",
"def block; end",
"def block; end",
"def block; end",
"def block; end",
"def block; end",
"def block; end",
"def block; end",
"def block; end",
"def block; end",
"def block; end",
"def block; end",
"def block; end",
"def block; end",
"def block; end",
"def block; end",
"def block; end",
"def block=(_arg0); end",
"def block=(_arg0); end",
"def block?; end",
"def block_example(&block)\n does block\n end",
"def call_block(&block)\n block.call\nend",
"def with_block(&block)\n end",
"def method &block\r\n\t1\r\nend",
"def method &block\r\n\t1\r\nend",
"def method &block \r\n\t1\r\nend",
"def method_that_takes_a_block(&blk)\n p blk.call(\"hello\")\n p blk.call(\"World!\")\nend",
"def run(&block)\n end",
"def run(&block); end",
"def callBlock\n yield\n yield\nend",
"def my_method(&my_block)\n\n puts \"hello method\"\n\n my_block.call\n\n return my_block\n\nend",
"def my_method(&block)\n block.call # .call to invoke the block\nend",
"def method &block, a\r\n\t1\r\nend",
"def my_method(&my_block)\n puts \"hello method\"\n my_block.call\n return my_block\nend",
"def a_method(&block)\n block\nend",
"def function\n block.function\n end",
"def test(&block)\n block.call\nend",
"def test(&block)\n block.call\nend",
"def method a, &block\r\n\t1\r\nend",
"def parse_codeblock; end",
"def blocks; end",
"def blocks; end",
"def blocks; end",
"def call_block \n yield('hello', 99) \nend",
"def call_block \n yield('hello', 99) \nend",
"def BlocksAndMethods(&argumento)\n\targumento.call\nend",
"def run_block_proc\n yield\nend",
"def execute(&block)\n block\nend",
"def execute(&block)\n block\nend",
"def run_block\n yield\nend",
"def block_node; end",
"def block_node; end",
"def execute(&block)\r\n block\r\nend",
"def method_with_block\n yield\nend",
"def create_block_object(&block)\n block\nend",
"def hello(&block)\n puts block\n block.call\nend",
"def hello_world(&block)\n puts block.call\nend",
"def method_missing(meth, *args, &block)\n if args.length == 0\n code = Block.new(meth.to_s , self )\n if block_given?\n add_block code\n code.instance_eval(&block)\n end\n return code\n else\n super\n end\n end",
"def execute(&block)\n block\nend",
"def execute(&block)\n block\nend",
"def execute(&block)\n block\nend",
"def execute(&block)\n block\nend",
"def execute(&block)\n block\nend",
"def execute(&block)\n block\nend",
"def execute(&block)\n block\nend",
"def execute(&block)\n block\nend",
"def execute(&block)\n block\nend",
"def execute(&block)\n block\nend",
"def execute(&block)\n block\nend",
"def execute(&block)\n block\nend",
"def execute(&block)\n block\nend",
"def execute(&block)\n block\nend",
"def execute(&block)\n block\nend",
"def execute(&block)\n block\nend",
"def execute(&block)\n block\nend",
"def execute(&block)\n block\nend",
"def met(&block)\n puts \"This is method\"\n block.call\nend",
"def callBlock\n yield ,\n end",
"def return(&block); end",
"def blocks() end",
"def execute(&block)\n # block\n block.call\nend",
"def use_block(obj, &method)\n\tmethod.call\nend",
"def method_1 nombre, &bloque\n yield if block_given? # bloque.call if block_given? #llamamos a nuestro bloque\nend",
"def call_block\n yield('hello', 99)\nend",
"def call_block\n yield('hello', 99)\nend",
"def call_block\n yield('hello', 99)\nend",
"def i_take_a_block\n yield\nend",
"def run\n block.call\n end",
"def method_with_block_parameter &provided_block_proc\n puts provided_block_proc.class\n provided_block_proc.call(\"called from method\")\n yield \"called from method with yield\"\nend",
"def execute(&block)\n\tblock\nend",
"def execute(&block)\n\tblock\nend",
"def run_block # this is a method that accepts a block and yields action to block once method is called (just like map or each)\n yield if block_given? # prevents error if no block is run with method invocation; only use this if you have a specific reason for it, otherwise, it's best to fail and fail early\nend",
"def call_block\r\n puts \"Start of method\"\r\n yield\r\n yield\r\n puts \"End of method\"\r\nend",
"def ruby(&block)\n @ruby_block = block\n end",
"def perform(&block); end",
"def block_method1\n yield\nend",
"def block_method2(&block)\n block.call\nend",
"def execute(block)\n block.call\nend"
] | [
"0.8142532",
"0.8142532",
"0.8142532",
"0.8142532",
"0.8142532",
"0.8142532",
"0.8142532",
"0.8142532",
"0.8142532",
"0.8142532",
"0.8142532",
"0.8142532",
"0.8142532",
"0.8142532",
"0.8142532",
"0.8142532",
"0.8142532",
"0.8142532",
"0.8142532",
"0.8142532",
"0.764488",
"0.764488",
"0.75308347",
"0.74461895",
"0.74447984",
"0.7427902",
"0.74253833",
"0.74253833",
"0.7416752",
"0.74148315",
"0.73882145",
"0.7387959",
"0.7387728",
"0.73725176",
"0.73523986",
"0.73396194",
"0.732884",
"0.73233527",
"0.7277899",
"0.7251262",
"0.7251262",
"0.7226176",
"0.7216251",
"0.71922636",
"0.71922636",
"0.71922636",
"0.7188831",
"0.7188831",
"0.71746415",
"0.7169939",
"0.7167398",
"0.7167398",
"0.7160485",
"0.71545815",
"0.71545815",
"0.71211284",
"0.70972157",
"0.7086274",
"0.70862085",
"0.70861393",
"0.7078908",
"0.70762086",
"0.70762086",
"0.70762086",
"0.70762086",
"0.70762086",
"0.70762086",
"0.70762086",
"0.70762086",
"0.70762086",
"0.70762086",
"0.70762086",
"0.70762086",
"0.70762086",
"0.70762086",
"0.70762086",
"0.70762086",
"0.70762086",
"0.70762086",
"0.70740366",
"0.70662796",
"0.7064681",
"0.70579964",
"0.70490104",
"0.7037138",
"0.703516",
"0.7024885",
"0.7024885",
"0.7024885",
"0.7014975",
"0.7011486",
"0.7005353",
"0.69897807",
"0.69897807",
"0.69897383",
"0.69804996",
"0.6956072",
"0.6940726",
"0.69293755",
"0.6925235",
"0.6921065"
] | 0.0 | -1 |
GET /products GET /products.json | def index
@products = []
@@this_week.each_with_index do |id,index|
puts "#{id}"
@products[index] = Product.find(id)
end
if member_signed_in?
@order = Order.create(:member => @current_member,
:cheap_beer => @count_cheap,
:class_beer => @count_class)
else
@order = Order.create(:cheap_beer => @count_cheap,
:class_beer => @count_class)
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_products()\n\tputs \"Getting products\"\n\tresponse = request_get(\"/api/product\")\n\tputs response.body\nend",
"def products\n request :public, :get, :products\n end",
"def index\n @products = Product.all\n render json: @products\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 index\n \tproducts = Product.all\n \trender json: products\n \tend",
"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 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 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 product(name)\n get(\"/apiproducts/#{name}\")\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 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 @product = Product.find(params[:id])\n json_response(params)\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 show\n render json: @product\n end",
"def show\n product = Product.find_by_id(params[:id])\n\n render json: product\n end",
"def show\n render json: @product, status: 200\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 render json: @product\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 show\n @product = Product.find(params[:id])\n\n render json: @product\n end",
"def show\n @product = Product.find(params[:id])\n render json: @product, status: :ok\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 show\n result = Product.find(params[:id])\n render json: {\n status: :ok,\n product: result\n } \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 render :json => Producto.all\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 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 show\n render :json => Producto.find(params[:id])\n end",
"def index\n products = Product.all\n render json: {message: \"ok\", data: products}\n puts \"hello\"\n\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 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 respond_to do |format|\n format.html\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 json_response(@api_v1_product)\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 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 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 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 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 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 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 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 @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\t\t@products = Product.page(params[:page])\n respond_with(@products)\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 all\n @products = Product.get_list_active_products.page(params[:page]).per(10)\n if @products.present?\n @products\n else\n @object = 'product'\n render \"api/v1/errors/404\", status: 401\n end\n end",
"def get_products_by_ids\n products_ids = params[:products_ids]\n products = Array.new\n JSON.parse(products_ids).each do |product_id|\n product = Product.find_by_id(product_id)\n if product\n products.push(product)\n end\n end\n render json: {products: serialized_products(products)}, status: :ok\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 = get_products\n \n respond_to do |format|\n format.html # index.html.haml\n format.js # index.js.rjs\n format.xml { render :xml => @products }\n end\n end",
"def index\n @user_interactive_products = UserInteractiveProduct.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @user_interactive_products }\n end\n end",
"def show\n @products = Product.find(params[:id])\n end",
"def index\n @size_to_products = SizeToProduct.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @size_to_products }\n end\n end",
"def show\n render json: @product_management\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 index\n @products = current_company.products.order('created_at desc').page(params[:page]).per(20)\n render json: @products, meta: {total_pages: @products.total_pages, total_count: @products.total_count}\n end",
"def products\n run(:get,\"/school_products\", [200])\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 get_product\n json_response({ message: 'NOT IMPLEMENTED' })\n end",
"def show\n render json: @food_product\n end",
"def index\n @products = Spree::Product.not_deleted.includes(:variants).page(params[:page]).per(Spree::Config[:orders_per_page])\n respond_with @products\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 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 index\n @carts_products = @cart.carts_products.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @carts_products }\n end\n end",
"def get_products\n products = response['products']\n products_ops = []\n products.each_value do |value|\n product = {}\n product[:sku] = value['sku']\n product[:product_family] = value['productFamily']\n product[:pricing_list_id] = pricing_list.id\n attributes = value['attributes']\n product[:service_code] = attributes['servicecode']\n product[:location] = attributes['location']\n product[:location_type] = attributes['locationType']\n product[:usage_type] = attributes['usagetype']\n product[:operation] = attributes['operation']\n product[:request_description] = attributes['requestDescription']\n product[:request_type] = attributes['requestType']\n product[:service_name] = attributes['servicename']\n product[:pricing_list_id] = pricing_list.id\n product[:created_at] = Time.zone.now.utc\n product[:updated_at] = Time.zone.now.utc\n products_ops << product\n end\n products_ops\n end",
"def products\n Product.all\n end",
"def show\n \n @product = Product.find(params[:id])\n @vendors = @product.vendor(:all)\n #@vendors = Vendor.find(params[:id])\n #@vendors = Vendor.all\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.order(\"created_at desc\").paginate(page: params[:page], per_page: 21)\n\n respond_with @products\n end"
] | [
"0.7949616",
"0.79296285",
"0.7904974",
"0.7747317",
"0.7661734",
"0.7621926",
"0.76217246",
"0.76217246",
"0.76217246",
"0.7606416",
"0.75870323",
"0.75831693",
"0.75783014",
"0.7574301",
"0.7565189",
"0.7565189",
"0.7565189",
"0.7565189",
"0.75304884",
"0.75230986",
"0.75099146",
"0.74997324",
"0.74873686",
"0.74827695",
"0.7477311",
"0.7424242",
"0.7393207",
"0.7385748",
"0.7381122",
"0.73784256",
"0.73618054",
"0.733516",
"0.73280925",
"0.7321561",
"0.73009324",
"0.7271847",
"0.72662467",
"0.7236853",
"0.7231384",
"0.7219935",
"0.7201375",
"0.72005683",
"0.72005683",
"0.72005683",
"0.72005683",
"0.72005683",
"0.72005683",
"0.72005683",
"0.72005683",
"0.72005683",
"0.72005683",
"0.72005683",
"0.72005683",
"0.72005683",
"0.72005683",
"0.72005683",
"0.72005683",
"0.72005683",
"0.72005683",
"0.72005683",
"0.72005683",
"0.7200475",
"0.71834666",
"0.71771955",
"0.7170925",
"0.71676415",
"0.7161379",
"0.7138833",
"0.7132521",
"0.7132521",
"0.7132521",
"0.71279013",
"0.7067609",
"0.70582485",
"0.7054289",
"0.70536995",
"0.7048212",
"0.7037161",
"0.7028569",
"0.70231986",
"0.70168394",
"0.7006047",
"0.69924545",
"0.69874877",
"0.6977199",
"0.6953006",
"0.6952525",
"0.69503003",
"0.6946788",
"0.69457746",
"0.6945103",
"0.6941791",
"0.69249344",
"0.6924892",
"0.692273",
"0.6914159",
"0.6913606",
"0.6896366",
"0.6875076",
"0.68680954",
"0.6863318"
] | 0.0 | -1 |
Update properties of this object | def update!(**args)
@items = args[:items] if args.key?(:items)
@request_id = args[:request_id] if args.key?(:request_id)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update_properties(hash)\n hash.each do |key, value|\n setter_method = \"#{key}=\"\n if self.respond_to?(setter_method)\n self.send(setter_method, value)\n end\n end\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def refresh\n self.class.base_properties.each_with_index do |prop, prop_id|\n @properties[prop] = get_property(prop_id)\n end\n refresh_features\n refresh_status\n refresh_config\n self\n end",
"def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\n end",
"def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\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 update_properties!(branch_id=nil)\n properties = fetch_properties(false, branch_id)\n length = properties.length\n counter = 0\n properties.each do |property|\n counter += 1\n if Vebra.debugging?\n puts \"[Vebra]: #{counter}/#{length}: live updating property with Vebra ref: #{property.attributes[:vebra_ref]}\"\n end\n live_update!(property)\n Vebra.set_last_updated_at(Time.now) if counter == length\n end\n end",
"def update_self obj\n obj.each do |k,v|\n instance_variable_set(\"@#{k}\", v) if v\n end\n end",
"def update_attributes(properties_hash)\n self.class.get_class_properties.each do |property|\n key = property[:name].to_sym\n if properties_hash.has_key? key\n self.setValue(properties_hash[key], forKey:key)\n end\n end\n end",
"def update\n # TODO: implement update\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @states = args[:states] if args.key?(:states)\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end",
"def update!(**args)\n @property = args[:property] if args.key?(:property)\n @total_value_count = args[:total_value_count] if args.key?(:total_value_count)\n @value = args[:value] if args.key?(:value)\n @value_status = args[:value_status] if args.key?(:value_status)\n end",
"def update\n \n end",
"def refresh\n set_attributes\n end",
"def update(attrs)\n @attrs.update(attrs)\n self\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @source = args[:source] if args.key?(:source)\n end",
"def update_resource object, attributes\n object.update attributes\n end",
"def update(attrs)\n @attrs ||= {}\n @attrs.update(attrs)\n self\n end",
"def update\n \n end",
"def update!(**args)\n @property = args[:property] if args.key?(:property)\n @schema = args[:schema] if args.key?(:schema)\n end",
"def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def _update!\n self.class.properties.each do |property, predicate|\n if dirty?(property)\n self.class.repository_or_fail.delete([subject, predicate[:predicate], nil])\n if self.class.is_list?(property)\n repo = RDF::Repository.new\n attribute_get(property).each do |value|\n repo << RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(value, self.class.properties[property][:type]))\n end\n self.class.repository_or_fail.insert(*repo)\n else\n self.class.repository_or_fail.insert(RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(attribute_get(property), self.class.properties[property][:type])))\n end\n end\n @dirty[property] = nil\n @attributes[:original][property] = attribute_get(property)\n end\n self.class.repository_or_fail.insert(RDF::Statement.new(@subject, RDF.type, type)) unless type.nil?\n end",
"def update(attributes = {})\n super(attributes)\n retrieve!\n self\n end",
"def update\n @objects.map(&:update);\n end",
"def update\n raise NotImplementedError\n end",
"def update\n raise NotImplementedError\n end",
"def live_update!(property)\n property_class = Vebra.models[:property][:class].to_s.camelize.constantize\n\n # ensure we have the full property attributes\n property.get_property if !property.attributes[:status] && property.attributes[:action] != 'deleted'\n\n # find & update or build a new property\n property_model = property_class.find_or_initialize_by_vebra_ref(property.attributes[:vebra_ref])\n\n # make sure property object is not empty\n return false if !property.attributes || !property.attributes[:property_type]\n\n # if the property has been deleted, mark it appropriately and move on\n if property.attributes[:action] == 'deleted'\n return property_model.destroy\n end\n\n # extract accessible attributes for the property\n property_accessibles = property_class.accessible_attributes.map(&:to_sym)\n property_attributes = property.attributes.inject({}) do |result, (key, value)|\n result[key] = value if property_accessibles.include?(key)\n result\n end\n\n # update the property model's attributes\n property_model.no_callbacks = true if property_model.respond_to?(:no_callbacks)\n property_model.update_attributes(property_attributes)\n\n # find & update or build a new address\n if Vebra.models[:address]\n address_class = Vebra.models[:address][:class].to_s.camelize.constantize\n address_model = property_model.send(Vebra.models[:property][:address_method])\n address_model = property_model.send(\"build_#{Vebra.models[:property][:address_method]}\") unless address_model\n\n # extract accessible attributes for the address\n address_accessibles = address_class.accessible_attributes.map(&:to_sym)\n address_attributes = property.attributes[:address].inject({}) do |result, (key, value)|\n result[key] = value if address_accessibles.include?(key)\n result\n end\n\n # update the address model's attributes\n address_model.update_attributes(address_attributes)\n end\n\n # find & update or build new rooms\n if Vebra.models[:room]\n room_class = Vebra.models[:room][:class].to_s.camelize.constantize\n\n # accessible attributes for the rooms\n room_accessibles = room_class.accessible_attributes.map(&:to_sym)\n\n # delete any rooms which are no longer present\n property_rooms = property.attributes[:rooms] || []\n property_model_rooms = property_model.send(Vebra.models[:property][:rooms_method])\n refs_to_delete = property_model_rooms.map(&:vebra_ref) - property_rooms.map { |r| r[:vebra_ref] }\n property_model_rooms.each do |room|\n room.destroy if refs_to_delete.include?(room.vebra_ref)\n end\n\n # find & update or build new rooms\n property_rooms.each do |room|\n room_model = room_class.find_by_property_id_and_vebra_ref(property_model.id, room[:vebra_ref])\n room_model = property_model_rooms.build unless room_model\n\n # extract accessible attributes for the room\n room_attributes = room.inject({}) do |result, (key, value)|\n result[key] = value if room_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n room_model.update_attributes(room_attributes)\n end\n end\n\n # find & update or build new file attachments\n if Vebra.models[:file]\n file_class = Vebra.models[:file][:class].to_s.camelize.constantize\n\n # accessible attributes for the files\n file_accessibles = file_class.accessible_attributes.map(&:to_sym)\n\n # first normalize the collection (currently nested collections)\n property_files = property.attributes[:files].inject([]) do |result, (kind, collection)|\n collection.each do |file|\n file[:type] = kind.to_s.singularize.camelize if file_accessibles.include?(:type)\n file[\"remote_#{Vebra.models[:file][:attachment_method]}_url\".to_sym] = file.delete(:url)\n # if file[:type] is set, it means the attachment file class can be subclassed. In this\n # case we need to ensure that the subclass exists. If not, we ignore this file\n begin\n file[:type].constantize if file_accessibles.include?(:type)\n result << file\n rescue NameError => e\n # ignore - this means the subclass does not exist\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n\n result\n end\n\n # delete any files which are no longer present\n property_model_files = property_model.send(Vebra.models[:property][:files_method])\n refs_to_delete = property_model_files.map(&:vebra_ref) - property_files.map { |f| f[:vebra_ref] }\n property_model_files.each do |file|\n file.destroy if refs_to_delete.include?(file.vebra_ref)\n end\n\n # find & update or build new files\n property_files.each do |file|\n begin\n file_model = property_model_files.find_by_vebra_ref(file[:vebra_ref])\n file_model = property_model_files.build unless file_model\n\n # extract accessible attributes for the file\n file_attributes = file.inject({}) do |result, (key, value)|\n result[key] = value if file_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n file_model.update_attributes(file_attributes)\n rescue CarrierWave::ProcessingError, OpenURI::HTTPError => e\n # just ignore the file\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n end\n\n property_model.no_callbacks = false if property_model.respond_to?(:no_callbacks)\n property_model.save\n return property_model\n end",
"def update!(**args)\n @id = args[:id] if args.key?(:id)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def update\n end",
"def update!(**args)\n @mid = args[:mid] if args.key?(:mid)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def modified_properties=(value)\n @modified_properties = value\n end",
"def apply_properties!(properties)\n # Non-commutitivity etc. eventually.\n end",
"def set_properties(hash)\n hash.each do |key, value|\n add_or_remove_ostruct_member(key, value)\n end\n rest_reset_properties\n end",
"def update\n\t\t\n\t\tend",
"def set_props(props)\n @props.merge!(props)\n end",
"def update() end",
"def update!(**args)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def assign_properties\n self.properties ||= {}\n listing_properties.each do |prop|\n self.properties[prop.key] ||= prop.value\n end\n end",
"def change_properties(new_current_floor, new_next_floor, new_movement)\n @current_floor = new_current_floor\n @next_floor = new_next_floor\n @movement = new_movement\n end",
"def update!(**args)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end",
"def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end",
"def update(attributes)\n (@attributes ||= {}).merge! attributes\n\n (self.class.attr_initializables & attributes.keys).each do |name|\n instance_variable_set :\"@#{name}\", attributes[name]\n end\n\n self\n end",
"def update_attributes(attrs)\n super({})\n end",
"def update\n @dirty = true\n end",
"def update\n\n # Run through the mixin updates\n colourable_update\n movable_update\n\n end",
"def set(props)\n props.each do |prop, val|\n self.send(:\"#{ prop }=\", val)\n end\n end",
"def update\n super\n end",
"def update!(**args)\n @property_id = args[:property_id] if args.key?(:property_id)\n @value_status = args[:value_status] if args.key?(:value_status)\n end",
"def update!(**args)\n @object_size_bytes = args[:object_size_bytes] if args.key?(:object_size_bytes)\n @object_version = args[:object_version] if args.key?(:object_version)\n end",
"def movable_update\n\n # Work through the different aspects we update\n movable_location_update\n movable_size_update\n movable_angle_update\n\n end",
"def properties=(value)\n @properties = value\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(context={})\n self.pre_cast_attributes\n m2o = @relations.reject{|k, v| !self.class.many2one_relations.has_key?(k)}\n vals = @attributes.reject {|key, value| key == 'id'}.merge(m2o.merge(m2o){|k, v| v.is_a?(Array) ? v[0] : v})\n self.class.rpc_execute('write', self.id, vals, context)\n reload_from_record!(self.class.find(self.id, :context => context))\n end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update ; end",
"def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end",
"def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end",
"def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end",
"def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end",
"def update_with(attributes)\n assign_attributes(attributes)\n end",
"def update\n # don't need to update; hash is shared\n end",
"def update(attributes)\n HashProxy.with(attributes) do |proxy|\n self.class.attribute_names.each do |name|\n send(\"#{name}=\", proxy[name]) if proxy.key?(name)\n end\n end\n save\n end",
"def update!(**args)\n @object_id_prop = args[:object_id_prop] if args.key?(:object_id_prop)\n @relation = args[:relation] if args.key?(:relation)\n @subject_id = args[:subject_id] if args.key?(:subject_id)\n end",
"def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end",
"def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end",
"def update\n raise NotImplementedError\n end",
"def update_attributes attributes\n @attributes.merge! attributes\n end",
"def update!(**args)\n @async_options = args[:async_options] if args.key?(:async_options)\n @input_mappings = args[:input_mappings] if args.key?(:input_mappings)\n @name_property = args[:name_property] if args.key?(:name_property)\n @validation_options = args[:validation_options] if args.key?(:validation_options)\n end",
"def update\r\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @type = args[:type] if args.key?(:type)\n end",
"def update\n raise NotImplemented\n end",
"def update_obj\n mean, sd = rating.to_glicko_rating\n @obj.rating = mean\n @obj.rating_deviation = sd\n @obj.volatility = volatility\n end",
"def update_values\n end",
"def update_values\n end",
"def update\n raise NotImplementedError\n end",
"def update!(**args)\n @answers_header_signals = args[:answers_header_signals] if args.key?(:answers_header_signals)\n @property_value = args[:property_value] if args.key?(:property_value)\n @response_meaning_application = args[:response_meaning_application] if args.key?(:response_meaning_application)\n end",
"def update!(**args)\n @create_time = args[:create_time] if args.key?(:create_time)\n @method_prop = args[:method_prop] if args.key?(:method_prop)\n @name = args[:name] if args.key?(:name)\n @state = args[:state] if args.key?(:state)\n end",
"def update attributes, collection #:nodoc:\n 0\n end",
"def update_property_groups(roll)\n @property_groups.each { |_, v| v.update_rent(roll) }\n end",
"def update!(**args)\n @source_property = args[:source_property] if args.key?(:source_property)\n 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 update_properties(path, properties)\n prop_patch = PropPatch.new(properties)\n emit('propPatch', [path, prop_patch])\n prop_patch.commit\n\n prop_patch.result\n end",
"def update\n set_deltatime\n set_last_update_at\n end"
] | [
"0.7012263",
"0.69181895",
"0.69181895",
"0.69181895",
"0.69181895",
"0.69181895",
"0.67403597",
"0.6709326",
"0.6709326",
"0.6696149",
"0.6696149",
"0.6696149",
"0.6696149",
"0.6618882",
"0.6571848",
"0.65386343",
"0.65178275",
"0.6394807",
"0.6389745",
"0.6389745",
"0.63328",
"0.6319025",
"0.6283673",
"0.6269463",
"0.62639254",
"0.62410724",
"0.62170374",
"0.62152076",
"0.6210263",
"0.6204041",
"0.6204041",
"0.62021106",
"0.62017816",
"0.62017",
"0.61730784",
"0.61730784",
"0.6159277",
"0.6156169",
"0.61445665",
"0.6125433",
"0.61241156",
"0.6121413",
"0.6110477",
"0.6105694",
"0.61016303",
"0.60845226",
"0.6084427",
"0.6065455",
"0.6059506",
"0.6054869",
"0.6051708",
"0.6051708",
"0.60413384",
"0.6030853",
"0.6022535",
"0.6015561",
"0.59932375",
"0.59898263",
"0.5976479",
"0.5973787",
"0.59678394",
"0.5963291",
"0.5962048",
"0.5961157",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.59500545",
"0.59443134",
"0.59443134",
"0.59424853",
"0.59424853",
"0.593523",
"0.5926413",
"0.5924831",
"0.592427",
"0.59233046",
"0.59233046",
"0.5921224",
"0.59144294",
"0.59142506",
"0.58887535",
"0.58854496",
"0.5883008",
"0.58792305",
"0.5876954",
"0.5876954",
"0.58744955",
"0.5857968",
"0.5845542",
"0.5841629",
"0.58363605",
"0.5829255",
"0.582919",
"0.5822138",
"0.58208305"
] | 0.0 | -1 |
Update properties of this object | def update!(**args)
@capacity = args[:capacity] if args.key?(:capacity)
@create_time = args[:create_time] if args.key?(:create_time)
@description = args[:description] if args.key?(:description)
@items = args[:items] if args.key?(:items)
@labels = args[:labels] if args.key?(:labels)
@name = args[:name] if args.key?(:name)
@self_link = args[:self_link] if args.key?(:self_link)
@type = args[:type] if args.key?(:type)
@update_time = args[:update_time] if args.key?(:update_time)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update_properties(hash)\n hash.each do |key, value|\n setter_method = \"#{key}=\"\n if self.respond_to?(setter_method)\n self.send(setter_method, value)\n end\n end\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def refresh\n self.class.base_properties.each_with_index do |prop, prop_id|\n @properties[prop] = get_property(prop_id)\n end\n refresh_features\n refresh_status\n refresh_config\n self\n end",
"def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\n end",
"def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\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 update_properties!(branch_id=nil)\n properties = fetch_properties(false, branch_id)\n length = properties.length\n counter = 0\n properties.each do |property|\n counter += 1\n if Vebra.debugging?\n puts \"[Vebra]: #{counter}/#{length}: live updating property with Vebra ref: #{property.attributes[:vebra_ref]}\"\n end\n live_update!(property)\n Vebra.set_last_updated_at(Time.now) if counter == length\n end\n end",
"def update_self obj\n obj.each do |k,v|\n instance_variable_set(\"@#{k}\", v) if v\n end\n end",
"def update_attributes(properties_hash)\n self.class.get_class_properties.each do |property|\n key = property[:name].to_sym\n if properties_hash.has_key? key\n self.setValue(properties_hash[key], forKey:key)\n end\n end\n end",
"def update\n # TODO: implement update\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @states = args[:states] if args.key?(:states)\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end",
"def update!(**args)\n @property = args[:property] if args.key?(:property)\n @total_value_count = args[:total_value_count] if args.key?(:total_value_count)\n @value = args[:value] if args.key?(:value)\n @value_status = args[:value_status] if args.key?(:value_status)\n end",
"def update\n \n end",
"def refresh\n set_attributes\n end",
"def update(attrs)\n @attrs.update(attrs)\n self\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @source = args[:source] if args.key?(:source)\n end",
"def update_resource object, attributes\n object.update attributes\n end",
"def update(attrs)\n @attrs ||= {}\n @attrs.update(attrs)\n self\n end",
"def update\n \n end",
"def update!(**args)\n @property = args[:property] if args.key?(:property)\n @schema = args[:schema] if args.key?(:schema)\n end",
"def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def _update!\n self.class.properties.each do |property, predicate|\n if dirty?(property)\n self.class.repository_or_fail.delete([subject, predicate[:predicate], nil])\n if self.class.is_list?(property)\n repo = RDF::Repository.new\n attribute_get(property).each do |value|\n repo << RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(value, self.class.properties[property][:type]))\n end\n self.class.repository_or_fail.insert(*repo)\n else\n self.class.repository_or_fail.insert(RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(attribute_get(property), self.class.properties[property][:type])))\n end\n end\n @dirty[property] = nil\n @attributes[:original][property] = attribute_get(property)\n end\n self.class.repository_or_fail.insert(RDF::Statement.new(@subject, RDF.type, type)) unless type.nil?\n end",
"def update(attributes = {})\n super(attributes)\n retrieve!\n self\n end",
"def update\n @objects.map(&:update);\n end",
"def update\n raise NotImplementedError\n end",
"def update\n raise NotImplementedError\n end",
"def live_update!(property)\n property_class = Vebra.models[:property][:class].to_s.camelize.constantize\n\n # ensure we have the full property attributes\n property.get_property if !property.attributes[:status] && property.attributes[:action] != 'deleted'\n\n # find & update or build a new property\n property_model = property_class.find_or_initialize_by_vebra_ref(property.attributes[:vebra_ref])\n\n # make sure property object is not empty\n return false if !property.attributes || !property.attributes[:property_type]\n\n # if the property has been deleted, mark it appropriately and move on\n if property.attributes[:action] == 'deleted'\n return property_model.destroy\n end\n\n # extract accessible attributes for the property\n property_accessibles = property_class.accessible_attributes.map(&:to_sym)\n property_attributes = property.attributes.inject({}) do |result, (key, value)|\n result[key] = value if property_accessibles.include?(key)\n result\n end\n\n # update the property model's attributes\n property_model.no_callbacks = true if property_model.respond_to?(:no_callbacks)\n property_model.update_attributes(property_attributes)\n\n # find & update or build a new address\n if Vebra.models[:address]\n address_class = Vebra.models[:address][:class].to_s.camelize.constantize\n address_model = property_model.send(Vebra.models[:property][:address_method])\n address_model = property_model.send(\"build_#{Vebra.models[:property][:address_method]}\") unless address_model\n\n # extract accessible attributes for the address\n address_accessibles = address_class.accessible_attributes.map(&:to_sym)\n address_attributes = property.attributes[:address].inject({}) do |result, (key, value)|\n result[key] = value if address_accessibles.include?(key)\n result\n end\n\n # update the address model's attributes\n address_model.update_attributes(address_attributes)\n end\n\n # find & update or build new rooms\n if Vebra.models[:room]\n room_class = Vebra.models[:room][:class].to_s.camelize.constantize\n\n # accessible attributes for the rooms\n room_accessibles = room_class.accessible_attributes.map(&:to_sym)\n\n # delete any rooms which are no longer present\n property_rooms = property.attributes[:rooms] || []\n property_model_rooms = property_model.send(Vebra.models[:property][:rooms_method])\n refs_to_delete = property_model_rooms.map(&:vebra_ref) - property_rooms.map { |r| r[:vebra_ref] }\n property_model_rooms.each do |room|\n room.destroy if refs_to_delete.include?(room.vebra_ref)\n end\n\n # find & update or build new rooms\n property_rooms.each do |room|\n room_model = room_class.find_by_property_id_and_vebra_ref(property_model.id, room[:vebra_ref])\n room_model = property_model_rooms.build unless room_model\n\n # extract accessible attributes for the room\n room_attributes = room.inject({}) do |result, (key, value)|\n result[key] = value if room_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n room_model.update_attributes(room_attributes)\n end\n end\n\n # find & update or build new file attachments\n if Vebra.models[:file]\n file_class = Vebra.models[:file][:class].to_s.camelize.constantize\n\n # accessible attributes for the files\n file_accessibles = file_class.accessible_attributes.map(&:to_sym)\n\n # first normalize the collection (currently nested collections)\n property_files = property.attributes[:files].inject([]) do |result, (kind, collection)|\n collection.each do |file|\n file[:type] = kind.to_s.singularize.camelize if file_accessibles.include?(:type)\n file[\"remote_#{Vebra.models[:file][:attachment_method]}_url\".to_sym] = file.delete(:url)\n # if file[:type] is set, it means the attachment file class can be subclassed. In this\n # case we need to ensure that the subclass exists. If not, we ignore this file\n begin\n file[:type].constantize if file_accessibles.include?(:type)\n result << file\n rescue NameError => e\n # ignore - this means the subclass does not exist\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n\n result\n end\n\n # delete any files which are no longer present\n property_model_files = property_model.send(Vebra.models[:property][:files_method])\n refs_to_delete = property_model_files.map(&:vebra_ref) - property_files.map { |f| f[:vebra_ref] }\n property_model_files.each do |file|\n file.destroy if refs_to_delete.include?(file.vebra_ref)\n end\n\n # find & update or build new files\n property_files.each do |file|\n begin\n file_model = property_model_files.find_by_vebra_ref(file[:vebra_ref])\n file_model = property_model_files.build unless file_model\n\n # extract accessible attributes for the file\n file_attributes = file.inject({}) do |result, (key, value)|\n result[key] = value if file_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n file_model.update_attributes(file_attributes)\n rescue CarrierWave::ProcessingError, OpenURI::HTTPError => e\n # just ignore the file\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n end\n\n property_model.no_callbacks = false if property_model.respond_to?(:no_callbacks)\n property_model.save\n return property_model\n end",
"def update!(**args)\n @id = args[:id] if args.key?(:id)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def update\n end",
"def update!(**args)\n @mid = args[:mid] if args.key?(:mid)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def modified_properties=(value)\n @modified_properties = value\n end",
"def apply_properties!(properties)\n # Non-commutitivity etc. eventually.\n end",
"def set_properties(hash)\n hash.each do |key, value|\n add_or_remove_ostruct_member(key, value)\n end\n rest_reset_properties\n end",
"def update\n\t\t\n\t\tend",
"def set_props(props)\n @props.merge!(props)\n end",
"def update() end",
"def update!(**args)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def assign_properties\n self.properties ||= {}\n listing_properties.each do |prop|\n self.properties[prop.key] ||= prop.value\n end\n end",
"def change_properties(new_current_floor, new_next_floor, new_movement)\n @current_floor = new_current_floor\n @next_floor = new_next_floor\n @movement = new_movement\n end",
"def update!(**args)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end",
"def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end",
"def update(attributes)\n (@attributes ||= {}).merge! attributes\n\n (self.class.attr_initializables & attributes.keys).each do |name|\n instance_variable_set :\"@#{name}\", attributes[name]\n end\n\n self\n end",
"def update_attributes(attrs)\n super({})\n end",
"def update\n @dirty = true\n end",
"def update\n\n # Run through the mixin updates\n colourable_update\n movable_update\n\n end",
"def set(props)\n props.each do |prop, val|\n self.send(:\"#{ prop }=\", val)\n end\n end",
"def update\n super\n end",
"def update!(**args)\n @property_id = args[:property_id] if args.key?(:property_id)\n @value_status = args[:value_status] if args.key?(:value_status)\n end",
"def update!(**args)\n @object_size_bytes = args[:object_size_bytes] if args.key?(:object_size_bytes)\n @object_version = args[:object_version] if args.key?(:object_version)\n end",
"def movable_update\n\n # Work through the different aspects we update\n movable_location_update\n movable_size_update\n movable_angle_update\n\n end",
"def properties=(value)\n @properties = value\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(context={})\n self.pre_cast_attributes\n m2o = @relations.reject{|k, v| !self.class.many2one_relations.has_key?(k)}\n vals = @attributes.reject {|key, value| key == 'id'}.merge(m2o.merge(m2o){|k, v| v.is_a?(Array) ? v[0] : v})\n self.class.rpc_execute('write', self.id, vals, context)\n reload_from_record!(self.class.find(self.id, :context => context))\n end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update ; end",
"def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end",
"def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end",
"def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end",
"def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end",
"def update_with(attributes)\n assign_attributes(attributes)\n end",
"def update\n # don't need to update; hash is shared\n end",
"def update(attributes)\n HashProxy.with(attributes) do |proxy|\n self.class.attribute_names.each do |name|\n send(\"#{name}=\", proxy[name]) if proxy.key?(name)\n end\n end\n save\n end",
"def update!(**args)\n @object_id_prop = args[:object_id_prop] if args.key?(:object_id_prop)\n @relation = args[:relation] if args.key?(:relation)\n @subject_id = args[:subject_id] if args.key?(:subject_id)\n end",
"def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end",
"def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end",
"def update\n raise NotImplementedError\n end",
"def update_attributes attributes\n @attributes.merge! attributes\n end",
"def update!(**args)\n @async_options = args[:async_options] if args.key?(:async_options)\n @input_mappings = args[:input_mappings] if args.key?(:input_mappings)\n @name_property = args[:name_property] if args.key?(:name_property)\n @validation_options = args[:validation_options] if args.key?(:validation_options)\n end",
"def update\r\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @type = args[:type] if args.key?(:type)\n end",
"def update\n raise NotImplemented\n end",
"def update_obj\n mean, sd = rating.to_glicko_rating\n @obj.rating = mean\n @obj.rating_deviation = sd\n @obj.volatility = volatility\n end",
"def update_values\n end",
"def update_values\n end",
"def update\n raise NotImplementedError\n end",
"def update!(**args)\n @answers_header_signals = args[:answers_header_signals] if args.key?(:answers_header_signals)\n @property_value = args[:property_value] if args.key?(:property_value)\n @response_meaning_application = args[:response_meaning_application] if args.key?(:response_meaning_application)\n end",
"def update!(**args)\n @create_time = args[:create_time] if args.key?(:create_time)\n @method_prop = args[:method_prop] if args.key?(:method_prop)\n @name = args[:name] if args.key?(:name)\n @state = args[:state] if args.key?(:state)\n end",
"def update attributes, collection #:nodoc:\n 0\n end",
"def update_property_groups(roll)\n @property_groups.each { |_, v| v.update_rent(roll) }\n end",
"def update!(**args)\n @source_property = args[:source_property] if args.key?(:source_property)\n 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 update_properties(path, properties)\n prop_patch = PropPatch.new(properties)\n emit('propPatch', [path, prop_patch])\n prop_patch.commit\n\n prop_patch.result\n end",
"def update\n set_deltatime\n set_last_update_at\n end"
] | [
"0.7012263",
"0.69181895",
"0.69181895",
"0.69181895",
"0.69181895",
"0.69181895",
"0.67403597",
"0.6709326",
"0.6709326",
"0.6696149",
"0.6696149",
"0.6696149",
"0.6696149",
"0.6618882",
"0.6571848",
"0.65386343",
"0.65178275",
"0.6394807",
"0.6389745",
"0.6389745",
"0.63328",
"0.6319025",
"0.6283673",
"0.6269463",
"0.62639254",
"0.62410724",
"0.62170374",
"0.62152076",
"0.6210263",
"0.6204041",
"0.6204041",
"0.62021106",
"0.62017816",
"0.62017",
"0.61730784",
"0.61730784",
"0.6159277",
"0.6156169",
"0.61445665",
"0.6125433",
"0.61241156",
"0.6121413",
"0.6110477",
"0.6105694",
"0.61016303",
"0.60845226",
"0.6084427",
"0.6065455",
"0.6059506",
"0.6054869",
"0.6051708",
"0.6051708",
"0.60413384",
"0.6030853",
"0.6022535",
"0.6015561",
"0.59932375",
"0.59898263",
"0.5976479",
"0.5973787",
"0.59678394",
"0.5963291",
"0.5962048",
"0.5961157",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.59500545",
"0.59443134",
"0.59443134",
"0.59424853",
"0.59424853",
"0.593523",
"0.5926413",
"0.5924831",
"0.592427",
"0.59233046",
"0.59233046",
"0.5921224",
"0.59144294",
"0.59142506",
"0.58887535",
"0.58854496",
"0.5883008",
"0.58792305",
"0.5876954",
"0.5876954",
"0.58744955",
"0.5857968",
"0.5845542",
"0.5841629",
"0.58363605",
"0.5829255",
"0.582919",
"0.5822138",
"0.58208305"
] | 0.0 | -1 |
Update properties of this object | def update!(**args)
@action = args[:action] if args.key?(:action)
@create_time = args[:create_time] if args.key?(:create_time)
@description = args[:description] if args.key?(:description)
@labels = args[:labels] if args.key?(:labels)
@name = args[:name] if args.key?(:name)
@rules = args[:rules] if args.key?(:rules)
@update_time = args[:update_time] if args.key?(:update_time)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update_properties(hash)\n hash.each do |key, value|\n setter_method = \"#{key}=\"\n if self.respond_to?(setter_method)\n self.send(setter_method, value)\n end\n end\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def refresh\n self.class.base_properties.each_with_index do |prop, prop_id|\n @properties[prop] = get_property(prop_id)\n end\n refresh_features\n refresh_status\n refresh_config\n self\n end",
"def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\n end",
"def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\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 update_properties!(branch_id=nil)\n properties = fetch_properties(false, branch_id)\n length = properties.length\n counter = 0\n properties.each do |property|\n counter += 1\n if Vebra.debugging?\n puts \"[Vebra]: #{counter}/#{length}: live updating property with Vebra ref: #{property.attributes[:vebra_ref]}\"\n end\n live_update!(property)\n Vebra.set_last_updated_at(Time.now) if counter == length\n end\n end",
"def update_self obj\n obj.each do |k,v|\n instance_variable_set(\"@#{k}\", v) if v\n end\n end",
"def update_attributes(properties_hash)\n self.class.get_class_properties.each do |property|\n key = property[:name].to_sym\n if properties_hash.has_key? key\n self.setValue(properties_hash[key], forKey:key)\n end\n end\n end",
"def update\n # TODO: implement update\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @states = args[:states] if args.key?(:states)\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end",
"def update!(**args)\n @property = args[:property] if args.key?(:property)\n @total_value_count = args[:total_value_count] if args.key?(:total_value_count)\n @value = args[:value] if args.key?(:value)\n @value_status = args[:value_status] if args.key?(:value_status)\n end",
"def update\n \n end",
"def refresh\n set_attributes\n end",
"def update(attrs)\n @attrs.update(attrs)\n self\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @source = args[:source] if args.key?(:source)\n end",
"def update_resource object, attributes\n object.update attributes\n end",
"def update(attrs)\n @attrs ||= {}\n @attrs.update(attrs)\n self\n end",
"def update\n \n end",
"def update!(**args)\n @property = args[:property] if args.key?(:property)\n @schema = args[:schema] if args.key?(:schema)\n end",
"def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def _update!\n self.class.properties.each do |property, predicate|\n if dirty?(property)\n self.class.repository_or_fail.delete([subject, predicate[:predicate], nil])\n if self.class.is_list?(property)\n repo = RDF::Repository.new\n attribute_get(property).each do |value|\n repo << RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(value, self.class.properties[property][:type]))\n end\n self.class.repository_or_fail.insert(*repo)\n else\n self.class.repository_or_fail.insert(RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(attribute_get(property), self.class.properties[property][:type])))\n end\n end\n @dirty[property] = nil\n @attributes[:original][property] = attribute_get(property)\n end\n self.class.repository_or_fail.insert(RDF::Statement.new(@subject, RDF.type, type)) unless type.nil?\n end",
"def update(attributes = {})\n super(attributes)\n retrieve!\n self\n end",
"def update\n @objects.map(&:update);\n end",
"def update\n raise NotImplementedError\n end",
"def update\n raise NotImplementedError\n end",
"def live_update!(property)\n property_class = Vebra.models[:property][:class].to_s.camelize.constantize\n\n # ensure we have the full property attributes\n property.get_property if !property.attributes[:status] && property.attributes[:action] != 'deleted'\n\n # find & update or build a new property\n property_model = property_class.find_or_initialize_by_vebra_ref(property.attributes[:vebra_ref])\n\n # make sure property object is not empty\n return false if !property.attributes || !property.attributes[:property_type]\n\n # if the property has been deleted, mark it appropriately and move on\n if property.attributes[:action] == 'deleted'\n return property_model.destroy\n end\n\n # extract accessible attributes for the property\n property_accessibles = property_class.accessible_attributes.map(&:to_sym)\n property_attributes = property.attributes.inject({}) do |result, (key, value)|\n result[key] = value if property_accessibles.include?(key)\n result\n end\n\n # update the property model's attributes\n property_model.no_callbacks = true if property_model.respond_to?(:no_callbacks)\n property_model.update_attributes(property_attributes)\n\n # find & update or build a new address\n if Vebra.models[:address]\n address_class = Vebra.models[:address][:class].to_s.camelize.constantize\n address_model = property_model.send(Vebra.models[:property][:address_method])\n address_model = property_model.send(\"build_#{Vebra.models[:property][:address_method]}\") unless address_model\n\n # extract accessible attributes for the address\n address_accessibles = address_class.accessible_attributes.map(&:to_sym)\n address_attributes = property.attributes[:address].inject({}) do |result, (key, value)|\n result[key] = value if address_accessibles.include?(key)\n result\n end\n\n # update the address model's attributes\n address_model.update_attributes(address_attributes)\n end\n\n # find & update or build new rooms\n if Vebra.models[:room]\n room_class = Vebra.models[:room][:class].to_s.camelize.constantize\n\n # accessible attributes for the rooms\n room_accessibles = room_class.accessible_attributes.map(&:to_sym)\n\n # delete any rooms which are no longer present\n property_rooms = property.attributes[:rooms] || []\n property_model_rooms = property_model.send(Vebra.models[:property][:rooms_method])\n refs_to_delete = property_model_rooms.map(&:vebra_ref) - property_rooms.map { |r| r[:vebra_ref] }\n property_model_rooms.each do |room|\n room.destroy if refs_to_delete.include?(room.vebra_ref)\n end\n\n # find & update or build new rooms\n property_rooms.each do |room|\n room_model = room_class.find_by_property_id_and_vebra_ref(property_model.id, room[:vebra_ref])\n room_model = property_model_rooms.build unless room_model\n\n # extract accessible attributes for the room\n room_attributes = room.inject({}) do |result, (key, value)|\n result[key] = value if room_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n room_model.update_attributes(room_attributes)\n end\n end\n\n # find & update or build new file attachments\n if Vebra.models[:file]\n file_class = Vebra.models[:file][:class].to_s.camelize.constantize\n\n # accessible attributes for the files\n file_accessibles = file_class.accessible_attributes.map(&:to_sym)\n\n # first normalize the collection (currently nested collections)\n property_files = property.attributes[:files].inject([]) do |result, (kind, collection)|\n collection.each do |file|\n file[:type] = kind.to_s.singularize.camelize if file_accessibles.include?(:type)\n file[\"remote_#{Vebra.models[:file][:attachment_method]}_url\".to_sym] = file.delete(:url)\n # if file[:type] is set, it means the attachment file class can be subclassed. In this\n # case we need to ensure that the subclass exists. If not, we ignore this file\n begin\n file[:type].constantize if file_accessibles.include?(:type)\n result << file\n rescue NameError => e\n # ignore - this means the subclass does not exist\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n\n result\n end\n\n # delete any files which are no longer present\n property_model_files = property_model.send(Vebra.models[:property][:files_method])\n refs_to_delete = property_model_files.map(&:vebra_ref) - property_files.map { |f| f[:vebra_ref] }\n property_model_files.each do |file|\n file.destroy if refs_to_delete.include?(file.vebra_ref)\n end\n\n # find & update or build new files\n property_files.each do |file|\n begin\n file_model = property_model_files.find_by_vebra_ref(file[:vebra_ref])\n file_model = property_model_files.build unless file_model\n\n # extract accessible attributes for the file\n file_attributes = file.inject({}) do |result, (key, value)|\n result[key] = value if file_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n file_model.update_attributes(file_attributes)\n rescue CarrierWave::ProcessingError, OpenURI::HTTPError => e\n # just ignore the file\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n end\n\n property_model.no_callbacks = false if property_model.respond_to?(:no_callbacks)\n property_model.save\n return property_model\n end",
"def update!(**args)\n @id = args[:id] if args.key?(:id)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def update\n end",
"def update!(**args)\n @mid = args[:mid] if args.key?(:mid)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def modified_properties=(value)\n @modified_properties = value\n end",
"def apply_properties!(properties)\n # Non-commutitivity etc. eventually.\n end",
"def set_properties(hash)\n hash.each do |key, value|\n add_or_remove_ostruct_member(key, value)\n end\n rest_reset_properties\n end",
"def update\n\t\t\n\t\tend",
"def set_props(props)\n @props.merge!(props)\n end",
"def update() end",
"def update!(**args)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def assign_properties\n self.properties ||= {}\n listing_properties.each do |prop|\n self.properties[prop.key] ||= prop.value\n end\n end",
"def change_properties(new_current_floor, new_next_floor, new_movement)\n @current_floor = new_current_floor\n @next_floor = new_next_floor\n @movement = new_movement\n end",
"def update!(**args)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end",
"def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end",
"def update(attributes)\n (@attributes ||= {}).merge! attributes\n\n (self.class.attr_initializables & attributes.keys).each do |name|\n instance_variable_set :\"@#{name}\", attributes[name]\n end\n\n self\n end",
"def update_attributes(attrs)\n super({})\n end",
"def update\n @dirty = true\n end",
"def update\n\n # Run through the mixin updates\n colourable_update\n movable_update\n\n end",
"def set(props)\n props.each do |prop, val|\n self.send(:\"#{ prop }=\", val)\n end\n end",
"def update\n super\n end",
"def update!(**args)\n @property_id = args[:property_id] if args.key?(:property_id)\n @value_status = args[:value_status] if args.key?(:value_status)\n end",
"def update!(**args)\n @object_size_bytes = args[:object_size_bytes] if args.key?(:object_size_bytes)\n @object_version = args[:object_version] if args.key?(:object_version)\n end",
"def movable_update\n\n # Work through the different aspects we update\n movable_location_update\n movable_size_update\n movable_angle_update\n\n end",
"def properties=(value)\n @properties = value\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(context={})\n self.pre_cast_attributes\n m2o = @relations.reject{|k, v| !self.class.many2one_relations.has_key?(k)}\n vals = @attributes.reject {|key, value| key == 'id'}.merge(m2o.merge(m2o){|k, v| v.is_a?(Array) ? v[0] : v})\n self.class.rpc_execute('write', self.id, vals, context)\n reload_from_record!(self.class.find(self.id, :context => context))\n end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update ; end",
"def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end",
"def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end",
"def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end",
"def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end",
"def update_with(attributes)\n assign_attributes(attributes)\n end",
"def update\n # don't need to update; hash is shared\n end",
"def update(attributes)\n HashProxy.with(attributes) do |proxy|\n self.class.attribute_names.each do |name|\n send(\"#{name}=\", proxy[name]) if proxy.key?(name)\n end\n end\n save\n end",
"def update!(**args)\n @object_id_prop = args[:object_id_prop] if args.key?(:object_id_prop)\n @relation = args[:relation] if args.key?(:relation)\n @subject_id = args[:subject_id] if args.key?(:subject_id)\n end",
"def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end",
"def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end",
"def update\n raise NotImplementedError\n end",
"def update_attributes attributes\n @attributes.merge! attributes\n end",
"def update!(**args)\n @async_options = args[:async_options] if args.key?(:async_options)\n @input_mappings = args[:input_mappings] if args.key?(:input_mappings)\n @name_property = args[:name_property] if args.key?(:name_property)\n @validation_options = args[:validation_options] if args.key?(:validation_options)\n end",
"def update\r\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @type = args[:type] if args.key?(:type)\n end",
"def update\n raise NotImplemented\n end",
"def update_obj\n mean, sd = rating.to_glicko_rating\n @obj.rating = mean\n @obj.rating_deviation = sd\n @obj.volatility = volatility\n end",
"def update_values\n end",
"def update_values\n end",
"def update\n raise NotImplementedError\n end",
"def update!(**args)\n @answers_header_signals = args[:answers_header_signals] if args.key?(:answers_header_signals)\n @property_value = args[:property_value] if args.key?(:property_value)\n @response_meaning_application = args[:response_meaning_application] if args.key?(:response_meaning_application)\n end",
"def update!(**args)\n @create_time = args[:create_time] if args.key?(:create_time)\n @method_prop = args[:method_prop] if args.key?(:method_prop)\n @name = args[:name] if args.key?(:name)\n @state = args[:state] if args.key?(:state)\n end",
"def update attributes, collection #:nodoc:\n 0\n end",
"def update_property_groups(roll)\n @property_groups.each { |_, v| v.update_rent(roll) }\n end",
"def update!(**args)\n @source_property = args[:source_property] if args.key?(:source_property)\n 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 update_properties(path, properties)\n prop_patch = PropPatch.new(properties)\n emit('propPatch', [path, prop_patch])\n prop_patch.commit\n\n prop_patch.result\n end",
"def update\n set_deltatime\n set_last_update_at\n end"
] | [
"0.7012263",
"0.69181895",
"0.69181895",
"0.69181895",
"0.69181895",
"0.69181895",
"0.67403597",
"0.6709326",
"0.6709326",
"0.6696149",
"0.6696149",
"0.6696149",
"0.6696149",
"0.6618882",
"0.6571848",
"0.65386343",
"0.65178275",
"0.6394807",
"0.6389745",
"0.6389745",
"0.63328",
"0.6319025",
"0.6283673",
"0.6269463",
"0.62639254",
"0.62410724",
"0.62170374",
"0.62152076",
"0.6210263",
"0.6204041",
"0.6204041",
"0.62021106",
"0.62017816",
"0.62017",
"0.61730784",
"0.61730784",
"0.6159277",
"0.6156169",
"0.61445665",
"0.6125433",
"0.61241156",
"0.6121413",
"0.6110477",
"0.6105694",
"0.61016303",
"0.60845226",
"0.6084427",
"0.6065455",
"0.6059506",
"0.6054869",
"0.6051708",
"0.6051708",
"0.60413384",
"0.6030853",
"0.6022535",
"0.6015561",
"0.59932375",
"0.59898263",
"0.5976479",
"0.5973787",
"0.59678394",
"0.5963291",
"0.5962048",
"0.5961157",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.59500545",
"0.59443134",
"0.59443134",
"0.59424853",
"0.59424853",
"0.593523",
"0.5926413",
"0.5924831",
"0.592427",
"0.59233046",
"0.59233046",
"0.5921224",
"0.59144294",
"0.59142506",
"0.58887535",
"0.58854496",
"0.5883008",
"0.58792305",
"0.5876954",
"0.5876954",
"0.58744955",
"0.5857968",
"0.5845542",
"0.5841629",
"0.58363605",
"0.5829255",
"0.582919",
"0.5822138",
"0.58208305"
] | 0.0 | -1 |
Update properties of this object | def update!(**args)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update_properties(hash)\n hash.each do |key, value|\n setter_method = \"#{key}=\"\n if self.respond_to?(setter_method)\n self.send(setter_method, value)\n end\n end\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def refresh\n self.class.base_properties.each_with_index do |prop, prop_id|\n @properties[prop] = get_property(prop_id)\n end\n refresh_features\n refresh_status\n refresh_config\n self\n end",
"def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\n end",
"def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\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 update_properties!(branch_id=nil)\n properties = fetch_properties(false, branch_id)\n length = properties.length\n counter = 0\n properties.each do |property|\n counter += 1\n if Vebra.debugging?\n puts \"[Vebra]: #{counter}/#{length}: live updating property with Vebra ref: #{property.attributes[:vebra_ref]}\"\n end\n live_update!(property)\n Vebra.set_last_updated_at(Time.now) if counter == length\n end\n end",
"def update_self obj\n obj.each do |k,v|\n instance_variable_set(\"@#{k}\", v) if v\n end\n end",
"def update_attributes(properties_hash)\n self.class.get_class_properties.each do |property|\n key = property[:name].to_sym\n if properties_hash.has_key? key\n self.setValue(properties_hash[key], forKey:key)\n end\n end\n end",
"def update\n # TODO: implement update\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @states = args[:states] if args.key?(:states)\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end",
"def update!(**args)\n @property = args[:property] if args.key?(:property)\n @total_value_count = args[:total_value_count] if args.key?(:total_value_count)\n @value = args[:value] if args.key?(:value)\n @value_status = args[:value_status] if args.key?(:value_status)\n end",
"def update\n \n end",
"def refresh\n set_attributes\n end",
"def update(attrs)\n @attrs.update(attrs)\n self\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @source = args[:source] if args.key?(:source)\n end",
"def update_resource object, attributes\n object.update attributes\n end",
"def update(attrs)\n @attrs ||= {}\n @attrs.update(attrs)\n self\n end",
"def update\n \n end",
"def update!(**args)\n @property = args[:property] if args.key?(:property)\n @schema = args[:schema] if args.key?(:schema)\n end",
"def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def update(attributes = {})\n super(attributes)\n retrieve!\n self\n end",
"def _update!\n self.class.properties.each do |property, predicate|\n if dirty?(property)\n self.class.repository_or_fail.delete([subject, predicate[:predicate], nil])\n if self.class.is_list?(property)\n repo = RDF::Repository.new\n attribute_get(property).each do |value|\n repo << RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(value, self.class.properties[property][:type]))\n end\n self.class.repository_or_fail.insert(*repo)\n else\n self.class.repository_or_fail.insert(RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(attribute_get(property), self.class.properties[property][:type])))\n end\n end\n @dirty[property] = nil\n @attributes[:original][property] = attribute_get(property)\n end\n self.class.repository_or_fail.insert(RDF::Statement.new(@subject, RDF.type, type)) unless type.nil?\n end",
"def update\n @objects.map(&:update);\n end",
"def update\n raise NotImplementedError\n end",
"def update\n raise NotImplementedError\n end",
"def live_update!(property)\n property_class = Vebra.models[:property][:class].to_s.camelize.constantize\n\n # ensure we have the full property attributes\n property.get_property if !property.attributes[:status] && property.attributes[:action] != 'deleted'\n\n # find & update or build a new property\n property_model = property_class.find_or_initialize_by_vebra_ref(property.attributes[:vebra_ref])\n\n # make sure property object is not empty\n return false if !property.attributes || !property.attributes[:property_type]\n\n # if the property has been deleted, mark it appropriately and move on\n if property.attributes[:action] == 'deleted'\n return property_model.destroy\n end\n\n # extract accessible attributes for the property\n property_accessibles = property_class.accessible_attributes.map(&:to_sym)\n property_attributes = property.attributes.inject({}) do |result, (key, value)|\n result[key] = value if property_accessibles.include?(key)\n result\n end\n\n # update the property model's attributes\n property_model.no_callbacks = true if property_model.respond_to?(:no_callbacks)\n property_model.update_attributes(property_attributes)\n\n # find & update or build a new address\n if Vebra.models[:address]\n address_class = Vebra.models[:address][:class].to_s.camelize.constantize\n address_model = property_model.send(Vebra.models[:property][:address_method])\n address_model = property_model.send(\"build_#{Vebra.models[:property][:address_method]}\") unless address_model\n\n # extract accessible attributes for the address\n address_accessibles = address_class.accessible_attributes.map(&:to_sym)\n address_attributes = property.attributes[:address].inject({}) do |result, (key, value)|\n result[key] = value if address_accessibles.include?(key)\n result\n end\n\n # update the address model's attributes\n address_model.update_attributes(address_attributes)\n end\n\n # find & update or build new rooms\n if Vebra.models[:room]\n room_class = Vebra.models[:room][:class].to_s.camelize.constantize\n\n # accessible attributes for the rooms\n room_accessibles = room_class.accessible_attributes.map(&:to_sym)\n\n # delete any rooms which are no longer present\n property_rooms = property.attributes[:rooms] || []\n property_model_rooms = property_model.send(Vebra.models[:property][:rooms_method])\n refs_to_delete = property_model_rooms.map(&:vebra_ref) - property_rooms.map { |r| r[:vebra_ref] }\n property_model_rooms.each do |room|\n room.destroy if refs_to_delete.include?(room.vebra_ref)\n end\n\n # find & update or build new rooms\n property_rooms.each do |room|\n room_model = room_class.find_by_property_id_and_vebra_ref(property_model.id, room[:vebra_ref])\n room_model = property_model_rooms.build unless room_model\n\n # extract accessible attributes for the room\n room_attributes = room.inject({}) do |result, (key, value)|\n result[key] = value if room_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n room_model.update_attributes(room_attributes)\n end\n end\n\n # find & update or build new file attachments\n if Vebra.models[:file]\n file_class = Vebra.models[:file][:class].to_s.camelize.constantize\n\n # accessible attributes for the files\n file_accessibles = file_class.accessible_attributes.map(&:to_sym)\n\n # first normalize the collection (currently nested collections)\n property_files = property.attributes[:files].inject([]) do |result, (kind, collection)|\n collection.each do |file|\n file[:type] = kind.to_s.singularize.camelize if file_accessibles.include?(:type)\n file[\"remote_#{Vebra.models[:file][:attachment_method]}_url\".to_sym] = file.delete(:url)\n # if file[:type] is set, it means the attachment file class can be subclassed. In this\n # case we need to ensure that the subclass exists. If not, we ignore this file\n begin\n file[:type].constantize if file_accessibles.include?(:type)\n result << file\n rescue NameError => e\n # ignore - this means the subclass does not exist\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n\n result\n end\n\n # delete any files which are no longer present\n property_model_files = property_model.send(Vebra.models[:property][:files_method])\n refs_to_delete = property_model_files.map(&:vebra_ref) - property_files.map { |f| f[:vebra_ref] }\n property_model_files.each do |file|\n file.destroy if refs_to_delete.include?(file.vebra_ref)\n end\n\n # find & update or build new files\n property_files.each do |file|\n begin\n file_model = property_model_files.find_by_vebra_ref(file[:vebra_ref])\n file_model = property_model_files.build unless file_model\n\n # extract accessible attributes for the file\n file_attributes = file.inject({}) do |result, (key, value)|\n result[key] = value if file_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n file_model.update_attributes(file_attributes)\n rescue CarrierWave::ProcessingError, OpenURI::HTTPError => e\n # just ignore the file\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n end\n\n property_model.no_callbacks = false if property_model.respond_to?(:no_callbacks)\n property_model.save\n return property_model\n end",
"def update!(**args)\n @id = args[:id] if args.key?(:id)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def update\n end",
"def update!(**args)\n @mid = args[:mid] if args.key?(:mid)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def modified_properties=(value)\n @modified_properties = value\n end",
"def apply_properties!(properties)\n # Non-commutitivity etc. eventually.\n end",
"def set_properties(hash)\n hash.each do |key, value|\n add_or_remove_ostruct_member(key, value)\n end\n rest_reset_properties\n end",
"def update\n\t\t\n\t\tend",
"def set_props(props)\n @props.merge!(props)\n end",
"def update() end",
"def update!(**args)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def assign_properties\n self.properties ||= {}\n listing_properties.each do |prop|\n self.properties[prop.key] ||= prop.value\n end\n end",
"def change_properties(new_current_floor, new_next_floor, new_movement)\n @current_floor = new_current_floor\n @next_floor = new_next_floor\n @movement = new_movement\n end",
"def update!(**args)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end",
"def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end",
"def update(attributes)\n (@attributes ||= {}).merge! attributes\n\n (self.class.attr_initializables & attributes.keys).each do |name|\n instance_variable_set :\"@#{name}\", attributes[name]\n end\n\n self\n end",
"def update_attributes(attrs)\n super({})\n end",
"def update\n @dirty = true\n end",
"def update\n\n # Run through the mixin updates\n colourable_update\n movable_update\n\n end",
"def set(props)\n props.each do |prop, val|\n self.send(:\"#{ prop }=\", val)\n end\n end",
"def update\n super\n end",
"def update!(**args)\n @property_id = args[:property_id] if args.key?(:property_id)\n @value_status = args[:value_status] if args.key?(:value_status)\n end",
"def update!(**args)\n @object_size_bytes = args[:object_size_bytes] if args.key?(:object_size_bytes)\n @object_version = args[:object_version] if args.key?(:object_version)\n end",
"def movable_update\n\n # Work through the different aspects we update\n movable_location_update\n movable_size_update\n movable_angle_update\n\n end",
"def properties=(value)\n @properties = value\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(context={})\n self.pre_cast_attributes\n m2o = @relations.reject{|k, v| !self.class.many2one_relations.has_key?(k)}\n vals = @attributes.reject {|key, value| key == 'id'}.merge(m2o.merge(m2o){|k, v| v.is_a?(Array) ? v[0] : v})\n self.class.rpc_execute('write', self.id, vals, context)\n reload_from_record!(self.class.find(self.id, :context => context))\n end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update ; end",
"def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end",
"def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end",
"def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end",
"def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end",
"def update_with(attributes)\n assign_attributes(attributes)\n end",
"def update\n # don't need to update; hash is shared\n end",
"def update(attributes)\n HashProxy.with(attributes) do |proxy|\n self.class.attribute_names.each do |name|\n send(\"#{name}=\", proxy[name]) if proxy.key?(name)\n end\n end\n save\n end",
"def update!(**args)\n @object_id_prop = args[:object_id_prop] if args.key?(:object_id_prop)\n @relation = args[:relation] if args.key?(:relation)\n @subject_id = args[:subject_id] if args.key?(:subject_id)\n end",
"def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end",
"def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end",
"def update\n raise NotImplementedError\n end",
"def update_attributes attributes\n @attributes.merge! attributes\n end",
"def update!(**args)\n @async_options = args[:async_options] if args.key?(:async_options)\n @input_mappings = args[:input_mappings] if args.key?(:input_mappings)\n @name_property = args[:name_property] if args.key?(:name_property)\n @validation_options = args[:validation_options] if args.key?(:validation_options)\n end",
"def update\r\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @type = args[:type] if args.key?(:type)\n end",
"def update\n raise NotImplemented\n end",
"def update_obj\n mean, sd = rating.to_glicko_rating\n @obj.rating = mean\n @obj.rating_deviation = sd\n @obj.volatility = volatility\n end",
"def update_values\n end",
"def update_values\n end",
"def update\n raise NotImplementedError\n end",
"def update!(**args)\n @answers_header_signals = args[:answers_header_signals] if args.key?(:answers_header_signals)\n @property_value = args[:property_value] if args.key?(:property_value)\n @response_meaning_application = args[:response_meaning_application] if args.key?(:response_meaning_application)\n end",
"def update!(**args)\n @create_time = args[:create_time] if args.key?(:create_time)\n @method_prop = args[:method_prop] if args.key?(:method_prop)\n @name = args[:name] if args.key?(:name)\n @state = args[:state] if args.key?(:state)\n end",
"def update attributes, collection #:nodoc:\n 0\n end",
"def update_property_groups(roll)\n @property_groups.each { |_, v| v.update_rent(roll) }\n 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 update!(**args)\n @source_property = args[:source_property] if args.key?(:source_property)\n end",
"def update_properties(path, properties)\n prop_patch = PropPatch.new(properties)\n emit('propPatch', [path, prop_patch])\n prop_patch.commit\n\n prop_patch.result\n end",
"def update\n set_deltatime\n set_last_update_at\n end"
] | [
"0.7012568",
"0.6918917",
"0.6918917",
"0.6918917",
"0.6918917",
"0.6918917",
"0.67404634",
"0.6709981",
"0.6709981",
"0.66964126",
"0.66964126",
"0.66964126",
"0.66964126",
"0.6619218",
"0.6570895",
"0.6539287",
"0.6517026",
"0.63946927",
"0.63901657",
"0.63901657",
"0.63328683",
"0.6318612",
"0.62846893",
"0.62692374",
"0.6264273",
"0.6241163",
"0.6216599",
"0.6214641",
"0.6210363",
"0.6203827",
"0.6203827",
"0.620312",
"0.6201905",
"0.62001497",
"0.61728275",
"0.61728275",
"0.6159924",
"0.61569315",
"0.61442953",
"0.61260897",
"0.6125199",
"0.61227936",
"0.61111224",
"0.610543",
"0.6102925",
"0.60839343",
"0.6083609",
"0.6066973",
"0.60602766",
"0.6055065",
"0.6051568",
"0.6051568",
"0.6042057",
"0.60319084",
"0.60221004",
"0.60149413",
"0.5994295",
"0.5989816",
"0.597674",
"0.5973157",
"0.5967343",
"0.5965598",
"0.59629464",
"0.59618354",
"0.5950329",
"0.5950329",
"0.5950329",
"0.5950329",
"0.5950329",
"0.5950329",
"0.5950329",
"0.5950329",
"0.59495455",
"0.59442014",
"0.59442014",
"0.5944142",
"0.5944142",
"0.59361076",
"0.5925741",
"0.5925574",
"0.59250593",
"0.5924476",
"0.5924476",
"0.5921039",
"0.59155524",
"0.59145254",
"0.5888445",
"0.58860934",
"0.5882302",
"0.5879913",
"0.5877467",
"0.5877467",
"0.58743787",
"0.585829",
"0.584583",
"0.58408254",
"0.5835501",
"0.5829063",
"0.5828611",
"0.58228916",
"0.5819882"
] | 0.0 | -1 |
Update properties of this object | def update!(**args)
@plugin_instance = args[:plugin_instance] if args.key?(:plugin_instance)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update_properties(hash)\n hash.each do |key, value|\n setter_method = \"#{key}=\"\n if self.respond_to?(setter_method)\n self.send(setter_method, value)\n end\n end\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def refresh\n self.class.base_properties.each_with_index do |prop, prop_id|\n @properties[prop] = get_property(prop_id)\n end\n refresh_features\n refresh_status\n refresh_config\n self\n end",
"def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\n end",
"def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\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 update_properties!(branch_id=nil)\n properties = fetch_properties(false, branch_id)\n length = properties.length\n counter = 0\n properties.each do |property|\n counter += 1\n if Vebra.debugging?\n puts \"[Vebra]: #{counter}/#{length}: live updating property with Vebra ref: #{property.attributes[:vebra_ref]}\"\n end\n live_update!(property)\n Vebra.set_last_updated_at(Time.now) if counter == length\n end\n end",
"def update_self obj\n obj.each do |k,v|\n instance_variable_set(\"@#{k}\", v) if v\n end\n end",
"def update_attributes(properties_hash)\n self.class.get_class_properties.each do |property|\n key = property[:name].to_sym\n if properties_hash.has_key? key\n self.setValue(properties_hash[key], forKey:key)\n end\n end\n end",
"def update\n # TODO: implement update\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @states = args[:states] if args.key?(:states)\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end",
"def update!(**args)\n @property = args[:property] if args.key?(:property)\n @total_value_count = args[:total_value_count] if args.key?(:total_value_count)\n @value = args[:value] if args.key?(:value)\n @value_status = args[:value_status] if args.key?(:value_status)\n end",
"def update\n \n end",
"def refresh\n set_attributes\n end",
"def update(attrs)\n @attrs.update(attrs)\n self\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @source = args[:source] if args.key?(:source)\n end",
"def update_resource object, attributes\n object.update attributes\n end",
"def update(attrs)\n @attrs ||= {}\n @attrs.update(attrs)\n self\n end",
"def update\n \n end",
"def update!(**args)\n @property = args[:property] if args.key?(:property)\n @schema = args[:schema] if args.key?(:schema)\n end",
"def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def _update!\n self.class.properties.each do |property, predicate|\n if dirty?(property)\n self.class.repository_or_fail.delete([subject, predicate[:predicate], nil])\n if self.class.is_list?(property)\n repo = RDF::Repository.new\n attribute_get(property).each do |value|\n repo << RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(value, self.class.properties[property][:type]))\n end\n self.class.repository_or_fail.insert(*repo)\n else\n self.class.repository_or_fail.insert(RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(attribute_get(property), self.class.properties[property][:type])))\n end\n end\n @dirty[property] = nil\n @attributes[:original][property] = attribute_get(property)\n end\n self.class.repository_or_fail.insert(RDF::Statement.new(@subject, RDF.type, type)) unless type.nil?\n end",
"def update(attributes = {})\n super(attributes)\n retrieve!\n self\n end",
"def update\n @objects.map(&:update);\n end",
"def update\n raise NotImplementedError\n end",
"def update\n raise NotImplementedError\n end",
"def live_update!(property)\n property_class = Vebra.models[:property][:class].to_s.camelize.constantize\n\n # ensure we have the full property attributes\n property.get_property if !property.attributes[:status] && property.attributes[:action] != 'deleted'\n\n # find & update or build a new property\n property_model = property_class.find_or_initialize_by_vebra_ref(property.attributes[:vebra_ref])\n\n # make sure property object is not empty\n return false if !property.attributes || !property.attributes[:property_type]\n\n # if the property has been deleted, mark it appropriately and move on\n if property.attributes[:action] == 'deleted'\n return property_model.destroy\n end\n\n # extract accessible attributes for the property\n property_accessibles = property_class.accessible_attributes.map(&:to_sym)\n property_attributes = property.attributes.inject({}) do |result, (key, value)|\n result[key] = value if property_accessibles.include?(key)\n result\n end\n\n # update the property model's attributes\n property_model.no_callbacks = true if property_model.respond_to?(:no_callbacks)\n property_model.update_attributes(property_attributes)\n\n # find & update or build a new address\n if Vebra.models[:address]\n address_class = Vebra.models[:address][:class].to_s.camelize.constantize\n address_model = property_model.send(Vebra.models[:property][:address_method])\n address_model = property_model.send(\"build_#{Vebra.models[:property][:address_method]}\") unless address_model\n\n # extract accessible attributes for the address\n address_accessibles = address_class.accessible_attributes.map(&:to_sym)\n address_attributes = property.attributes[:address].inject({}) do |result, (key, value)|\n result[key] = value if address_accessibles.include?(key)\n result\n end\n\n # update the address model's attributes\n address_model.update_attributes(address_attributes)\n end\n\n # find & update or build new rooms\n if Vebra.models[:room]\n room_class = Vebra.models[:room][:class].to_s.camelize.constantize\n\n # accessible attributes for the rooms\n room_accessibles = room_class.accessible_attributes.map(&:to_sym)\n\n # delete any rooms which are no longer present\n property_rooms = property.attributes[:rooms] || []\n property_model_rooms = property_model.send(Vebra.models[:property][:rooms_method])\n refs_to_delete = property_model_rooms.map(&:vebra_ref) - property_rooms.map { |r| r[:vebra_ref] }\n property_model_rooms.each do |room|\n room.destroy if refs_to_delete.include?(room.vebra_ref)\n end\n\n # find & update or build new rooms\n property_rooms.each do |room|\n room_model = room_class.find_by_property_id_and_vebra_ref(property_model.id, room[:vebra_ref])\n room_model = property_model_rooms.build unless room_model\n\n # extract accessible attributes for the room\n room_attributes = room.inject({}) do |result, (key, value)|\n result[key] = value if room_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n room_model.update_attributes(room_attributes)\n end\n end\n\n # find & update or build new file attachments\n if Vebra.models[:file]\n file_class = Vebra.models[:file][:class].to_s.camelize.constantize\n\n # accessible attributes for the files\n file_accessibles = file_class.accessible_attributes.map(&:to_sym)\n\n # first normalize the collection (currently nested collections)\n property_files = property.attributes[:files].inject([]) do |result, (kind, collection)|\n collection.each do |file|\n file[:type] = kind.to_s.singularize.camelize if file_accessibles.include?(:type)\n file[\"remote_#{Vebra.models[:file][:attachment_method]}_url\".to_sym] = file.delete(:url)\n # if file[:type] is set, it means the attachment file class can be subclassed. In this\n # case we need to ensure that the subclass exists. If not, we ignore this file\n begin\n file[:type].constantize if file_accessibles.include?(:type)\n result << file\n rescue NameError => e\n # ignore - this means the subclass does not exist\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n\n result\n end\n\n # delete any files which are no longer present\n property_model_files = property_model.send(Vebra.models[:property][:files_method])\n refs_to_delete = property_model_files.map(&:vebra_ref) - property_files.map { |f| f[:vebra_ref] }\n property_model_files.each do |file|\n file.destroy if refs_to_delete.include?(file.vebra_ref)\n end\n\n # find & update or build new files\n property_files.each do |file|\n begin\n file_model = property_model_files.find_by_vebra_ref(file[:vebra_ref])\n file_model = property_model_files.build unless file_model\n\n # extract accessible attributes for the file\n file_attributes = file.inject({}) do |result, (key, value)|\n result[key] = value if file_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n file_model.update_attributes(file_attributes)\n rescue CarrierWave::ProcessingError, OpenURI::HTTPError => e\n # just ignore the file\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n end\n\n property_model.no_callbacks = false if property_model.respond_to?(:no_callbacks)\n property_model.save\n return property_model\n end",
"def update!(**args)\n @id = args[:id] if args.key?(:id)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def update\n end",
"def update!(**args)\n @mid = args[:mid] if args.key?(:mid)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def modified_properties=(value)\n @modified_properties = value\n end",
"def apply_properties!(properties)\n # Non-commutitivity etc. eventually.\n end",
"def set_properties(hash)\n hash.each do |key, value|\n add_or_remove_ostruct_member(key, value)\n end\n rest_reset_properties\n end",
"def update\n\t\t\n\t\tend",
"def set_props(props)\n @props.merge!(props)\n end",
"def update() end",
"def update!(**args)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def assign_properties\n self.properties ||= {}\n listing_properties.each do |prop|\n self.properties[prop.key] ||= prop.value\n end\n end",
"def change_properties(new_current_floor, new_next_floor, new_movement)\n @current_floor = new_current_floor\n @next_floor = new_next_floor\n @movement = new_movement\n end",
"def update!(**args)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end",
"def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end",
"def update(attributes)\n (@attributes ||= {}).merge! attributes\n\n (self.class.attr_initializables & attributes.keys).each do |name|\n instance_variable_set :\"@#{name}\", attributes[name]\n end\n\n self\n end",
"def update_attributes(attrs)\n super({})\n end",
"def update\n @dirty = true\n end",
"def update\n\n # Run through the mixin updates\n colourable_update\n movable_update\n\n end",
"def set(props)\n props.each do |prop, val|\n self.send(:\"#{ prop }=\", val)\n end\n end",
"def update\n super\n end",
"def update!(**args)\n @property_id = args[:property_id] if args.key?(:property_id)\n @value_status = args[:value_status] if args.key?(:value_status)\n end",
"def update!(**args)\n @object_size_bytes = args[:object_size_bytes] if args.key?(:object_size_bytes)\n @object_version = args[:object_version] if args.key?(:object_version)\n end",
"def movable_update\n\n # Work through the different aspects we update\n movable_location_update\n movable_size_update\n movable_angle_update\n\n end",
"def properties=(value)\n @properties = value\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(context={})\n self.pre_cast_attributes\n m2o = @relations.reject{|k, v| !self.class.many2one_relations.has_key?(k)}\n vals = @attributes.reject {|key, value| key == 'id'}.merge(m2o.merge(m2o){|k, v| v.is_a?(Array) ? v[0] : v})\n self.class.rpc_execute('write', self.id, vals, context)\n reload_from_record!(self.class.find(self.id, :context => context))\n end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update ; end",
"def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end",
"def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end",
"def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end",
"def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end",
"def update_with(attributes)\n assign_attributes(attributes)\n end",
"def update\n # don't need to update; hash is shared\n end",
"def update(attributes)\n HashProxy.with(attributes) do |proxy|\n self.class.attribute_names.each do |name|\n send(\"#{name}=\", proxy[name]) if proxy.key?(name)\n end\n end\n save\n end",
"def update!(**args)\n @object_id_prop = args[:object_id_prop] if args.key?(:object_id_prop)\n @relation = args[:relation] if args.key?(:relation)\n @subject_id = args[:subject_id] if args.key?(:subject_id)\n end",
"def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end",
"def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end",
"def update\n raise NotImplementedError\n end",
"def update_attributes attributes\n @attributes.merge! attributes\n end",
"def update!(**args)\n @async_options = args[:async_options] if args.key?(:async_options)\n @input_mappings = args[:input_mappings] if args.key?(:input_mappings)\n @name_property = args[:name_property] if args.key?(:name_property)\n @validation_options = args[:validation_options] if args.key?(:validation_options)\n end",
"def update\r\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @type = args[:type] if args.key?(:type)\n end",
"def update\n raise NotImplemented\n end",
"def update_obj\n mean, sd = rating.to_glicko_rating\n @obj.rating = mean\n @obj.rating_deviation = sd\n @obj.volatility = volatility\n end",
"def update_values\n end",
"def update_values\n end",
"def update\n raise NotImplementedError\n end",
"def update!(**args)\n @answers_header_signals = args[:answers_header_signals] if args.key?(:answers_header_signals)\n @property_value = args[:property_value] if args.key?(:property_value)\n @response_meaning_application = args[:response_meaning_application] if args.key?(:response_meaning_application)\n end",
"def update!(**args)\n @create_time = args[:create_time] if args.key?(:create_time)\n @method_prop = args[:method_prop] if args.key?(:method_prop)\n @name = args[:name] if args.key?(:name)\n @state = args[:state] if args.key?(:state)\n end",
"def update attributes, collection #:nodoc:\n 0\n end",
"def update_property_groups(roll)\n @property_groups.each { |_, v| v.update_rent(roll) }\n end",
"def update!(**args)\n @source_property = args[:source_property] if args.key?(:source_property)\n 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 update_properties(path, properties)\n prop_patch = PropPatch.new(properties)\n emit('propPatch', [path, prop_patch])\n prop_patch.commit\n\n prop_patch.result\n end",
"def update\n set_deltatime\n set_last_update_at\n end"
] | [
"0.7012263",
"0.69181895",
"0.69181895",
"0.69181895",
"0.69181895",
"0.69181895",
"0.67403597",
"0.6709326",
"0.6709326",
"0.6696149",
"0.6696149",
"0.6696149",
"0.6696149",
"0.6618882",
"0.6571848",
"0.65386343",
"0.65178275",
"0.6394807",
"0.6389745",
"0.6389745",
"0.63328",
"0.6319025",
"0.6283673",
"0.6269463",
"0.62639254",
"0.62410724",
"0.62170374",
"0.62152076",
"0.6210263",
"0.6204041",
"0.6204041",
"0.62021106",
"0.62017816",
"0.62017",
"0.61730784",
"0.61730784",
"0.6159277",
"0.6156169",
"0.61445665",
"0.6125433",
"0.61241156",
"0.6121413",
"0.6110477",
"0.6105694",
"0.61016303",
"0.60845226",
"0.6084427",
"0.6065455",
"0.6059506",
"0.6054869",
"0.6051708",
"0.6051708",
"0.60413384",
"0.6030853",
"0.6022535",
"0.6015561",
"0.59932375",
"0.59898263",
"0.5976479",
"0.5973787",
"0.59678394",
"0.5963291",
"0.5962048",
"0.5961157",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.59500545",
"0.59443134",
"0.59443134",
"0.59424853",
"0.59424853",
"0.593523",
"0.5926413",
"0.5924831",
"0.592427",
"0.59233046",
"0.59233046",
"0.5921224",
"0.59144294",
"0.59142506",
"0.58887535",
"0.58854496",
"0.5883008",
"0.58792305",
"0.5876954",
"0.5876954",
"0.58744955",
"0.5857968",
"0.5845542",
"0.5841629",
"0.58363605",
"0.5829255",
"0.582919",
"0.5822138",
"0.58208305"
] | 0.0 | -1 |
Update properties of this object | def update!(**args)
@client_certificate = args[:client_certificate] if args.key?(:client_certificate)
@create_time = args[:create_time] if args.key?(:create_time)
@description = args[:description] if args.key?(:description)
@labels = args[:labels] if args.key?(:labels)
@name = args[:name] if args.key?(:name)
@server_validation_ca = args[:server_validation_ca] if args.key?(:server_validation_ca)
@sni = args[:sni] if args.key?(:sni)
@update_time = args[:update_time] if args.key?(:update_time)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update_properties(hash)\n hash.each do |key, value|\n setter_method = \"#{key}=\"\n if self.respond_to?(setter_method)\n self.send(setter_method, value)\n end\n end\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def refresh\n self.class.base_properties.each_with_index do |prop, prop_id|\n @properties[prop] = get_property(prop_id)\n end\n refresh_features\n refresh_status\n refresh_config\n self\n end",
"def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\n end",
"def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\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 update_properties!(branch_id=nil)\n properties = fetch_properties(false, branch_id)\n length = properties.length\n counter = 0\n properties.each do |property|\n counter += 1\n if Vebra.debugging?\n puts \"[Vebra]: #{counter}/#{length}: live updating property with Vebra ref: #{property.attributes[:vebra_ref]}\"\n end\n live_update!(property)\n Vebra.set_last_updated_at(Time.now) if counter == length\n end\n end",
"def update_self obj\n obj.each do |k,v|\n instance_variable_set(\"@#{k}\", v) if v\n end\n end",
"def update_attributes(properties_hash)\n self.class.get_class_properties.each do |property|\n key = property[:name].to_sym\n if properties_hash.has_key? key\n self.setValue(properties_hash[key], forKey:key)\n end\n end\n end",
"def update\n # TODO: implement update\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @states = args[:states] if args.key?(:states)\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end",
"def update!(**args)\n @property = args[:property] if args.key?(:property)\n @total_value_count = args[:total_value_count] if args.key?(:total_value_count)\n @value = args[:value] if args.key?(:value)\n @value_status = args[:value_status] if args.key?(:value_status)\n end",
"def update\n \n end",
"def refresh\n set_attributes\n end",
"def update(attrs)\n @attrs.update(attrs)\n self\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @source = args[:source] if args.key?(:source)\n end",
"def update_resource object, attributes\n object.update attributes\n end",
"def update(attrs)\n @attrs ||= {}\n @attrs.update(attrs)\n self\n end",
"def update\n \n end",
"def update!(**args)\n @property = args[:property] if args.key?(:property)\n @schema = args[:schema] if args.key?(:schema)\n end",
"def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def _update!\n self.class.properties.each do |property, predicate|\n if dirty?(property)\n self.class.repository_or_fail.delete([subject, predicate[:predicate], nil])\n if self.class.is_list?(property)\n repo = RDF::Repository.new\n attribute_get(property).each do |value|\n repo << RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(value, self.class.properties[property][:type]))\n end\n self.class.repository_or_fail.insert(*repo)\n else\n self.class.repository_or_fail.insert(RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(attribute_get(property), self.class.properties[property][:type])))\n end\n end\n @dirty[property] = nil\n @attributes[:original][property] = attribute_get(property)\n end\n self.class.repository_or_fail.insert(RDF::Statement.new(@subject, RDF.type, type)) unless type.nil?\n end",
"def update(attributes = {})\n super(attributes)\n retrieve!\n self\n end",
"def update\n @objects.map(&:update);\n end",
"def update\n raise NotImplementedError\n end",
"def update\n raise NotImplementedError\n end",
"def live_update!(property)\n property_class = Vebra.models[:property][:class].to_s.camelize.constantize\n\n # ensure we have the full property attributes\n property.get_property if !property.attributes[:status] && property.attributes[:action] != 'deleted'\n\n # find & update or build a new property\n property_model = property_class.find_or_initialize_by_vebra_ref(property.attributes[:vebra_ref])\n\n # make sure property object is not empty\n return false if !property.attributes || !property.attributes[:property_type]\n\n # if the property has been deleted, mark it appropriately and move on\n if property.attributes[:action] == 'deleted'\n return property_model.destroy\n end\n\n # extract accessible attributes for the property\n property_accessibles = property_class.accessible_attributes.map(&:to_sym)\n property_attributes = property.attributes.inject({}) do |result, (key, value)|\n result[key] = value if property_accessibles.include?(key)\n result\n end\n\n # update the property model's attributes\n property_model.no_callbacks = true if property_model.respond_to?(:no_callbacks)\n property_model.update_attributes(property_attributes)\n\n # find & update or build a new address\n if Vebra.models[:address]\n address_class = Vebra.models[:address][:class].to_s.camelize.constantize\n address_model = property_model.send(Vebra.models[:property][:address_method])\n address_model = property_model.send(\"build_#{Vebra.models[:property][:address_method]}\") unless address_model\n\n # extract accessible attributes for the address\n address_accessibles = address_class.accessible_attributes.map(&:to_sym)\n address_attributes = property.attributes[:address].inject({}) do |result, (key, value)|\n result[key] = value if address_accessibles.include?(key)\n result\n end\n\n # update the address model's attributes\n address_model.update_attributes(address_attributes)\n end\n\n # find & update or build new rooms\n if Vebra.models[:room]\n room_class = Vebra.models[:room][:class].to_s.camelize.constantize\n\n # accessible attributes for the rooms\n room_accessibles = room_class.accessible_attributes.map(&:to_sym)\n\n # delete any rooms which are no longer present\n property_rooms = property.attributes[:rooms] || []\n property_model_rooms = property_model.send(Vebra.models[:property][:rooms_method])\n refs_to_delete = property_model_rooms.map(&:vebra_ref) - property_rooms.map { |r| r[:vebra_ref] }\n property_model_rooms.each do |room|\n room.destroy if refs_to_delete.include?(room.vebra_ref)\n end\n\n # find & update or build new rooms\n property_rooms.each do |room|\n room_model = room_class.find_by_property_id_and_vebra_ref(property_model.id, room[:vebra_ref])\n room_model = property_model_rooms.build unless room_model\n\n # extract accessible attributes for the room\n room_attributes = room.inject({}) do |result, (key, value)|\n result[key] = value if room_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n room_model.update_attributes(room_attributes)\n end\n end\n\n # find & update or build new file attachments\n if Vebra.models[:file]\n file_class = Vebra.models[:file][:class].to_s.camelize.constantize\n\n # accessible attributes for the files\n file_accessibles = file_class.accessible_attributes.map(&:to_sym)\n\n # first normalize the collection (currently nested collections)\n property_files = property.attributes[:files].inject([]) do |result, (kind, collection)|\n collection.each do |file|\n file[:type] = kind.to_s.singularize.camelize if file_accessibles.include?(:type)\n file[\"remote_#{Vebra.models[:file][:attachment_method]}_url\".to_sym] = file.delete(:url)\n # if file[:type] is set, it means the attachment file class can be subclassed. In this\n # case we need to ensure that the subclass exists. If not, we ignore this file\n begin\n file[:type].constantize if file_accessibles.include?(:type)\n result << file\n rescue NameError => e\n # ignore - this means the subclass does not exist\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n\n result\n end\n\n # delete any files which are no longer present\n property_model_files = property_model.send(Vebra.models[:property][:files_method])\n refs_to_delete = property_model_files.map(&:vebra_ref) - property_files.map { |f| f[:vebra_ref] }\n property_model_files.each do |file|\n file.destroy if refs_to_delete.include?(file.vebra_ref)\n end\n\n # find & update or build new files\n property_files.each do |file|\n begin\n file_model = property_model_files.find_by_vebra_ref(file[:vebra_ref])\n file_model = property_model_files.build unless file_model\n\n # extract accessible attributes for the file\n file_attributes = file.inject({}) do |result, (key, value)|\n result[key] = value if file_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n file_model.update_attributes(file_attributes)\n rescue CarrierWave::ProcessingError, OpenURI::HTTPError => e\n # just ignore the file\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n end\n\n property_model.no_callbacks = false if property_model.respond_to?(:no_callbacks)\n property_model.save\n return property_model\n end",
"def update!(**args)\n @id = args[:id] if args.key?(:id)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def update\n end",
"def update!(**args)\n @mid = args[:mid] if args.key?(:mid)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def modified_properties=(value)\n @modified_properties = value\n end",
"def apply_properties!(properties)\n # Non-commutitivity etc. eventually.\n end",
"def set_properties(hash)\n hash.each do |key, value|\n add_or_remove_ostruct_member(key, value)\n end\n rest_reset_properties\n end",
"def update\n\t\t\n\t\tend",
"def set_props(props)\n @props.merge!(props)\n end",
"def update() end",
"def update!(**args)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def assign_properties\n self.properties ||= {}\n listing_properties.each do |prop|\n self.properties[prop.key] ||= prop.value\n end\n end",
"def change_properties(new_current_floor, new_next_floor, new_movement)\n @current_floor = new_current_floor\n @next_floor = new_next_floor\n @movement = new_movement\n end",
"def update!(**args)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end",
"def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end",
"def update(attributes)\n (@attributes ||= {}).merge! attributes\n\n (self.class.attr_initializables & attributes.keys).each do |name|\n instance_variable_set :\"@#{name}\", attributes[name]\n end\n\n self\n end",
"def update_attributes(attrs)\n super({})\n end",
"def update\n @dirty = true\n end",
"def update\n\n # Run through the mixin updates\n colourable_update\n movable_update\n\n end",
"def set(props)\n props.each do |prop, val|\n self.send(:\"#{ prop }=\", val)\n end\n end",
"def update\n super\n end",
"def update!(**args)\n @property_id = args[:property_id] if args.key?(:property_id)\n @value_status = args[:value_status] if args.key?(:value_status)\n end",
"def update!(**args)\n @object_size_bytes = args[:object_size_bytes] if args.key?(:object_size_bytes)\n @object_version = args[:object_version] if args.key?(:object_version)\n end",
"def movable_update\n\n # Work through the different aspects we update\n movable_location_update\n movable_size_update\n movable_angle_update\n\n end",
"def properties=(value)\n @properties = value\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(context={})\n self.pre_cast_attributes\n m2o = @relations.reject{|k, v| !self.class.many2one_relations.has_key?(k)}\n vals = @attributes.reject {|key, value| key == 'id'}.merge(m2o.merge(m2o){|k, v| v.is_a?(Array) ? v[0] : v})\n self.class.rpc_execute('write', self.id, vals, context)\n reload_from_record!(self.class.find(self.id, :context => context))\n end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update ; end",
"def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end",
"def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end",
"def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end",
"def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end",
"def update_with(attributes)\n assign_attributes(attributes)\n end",
"def update\n # don't need to update; hash is shared\n end",
"def update(attributes)\n HashProxy.with(attributes) do |proxy|\n self.class.attribute_names.each do |name|\n send(\"#{name}=\", proxy[name]) if proxy.key?(name)\n end\n end\n save\n end",
"def update!(**args)\n @object_id_prop = args[:object_id_prop] if args.key?(:object_id_prop)\n @relation = args[:relation] if args.key?(:relation)\n @subject_id = args[:subject_id] if args.key?(:subject_id)\n end",
"def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end",
"def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end",
"def update\n raise NotImplementedError\n end",
"def update_attributes attributes\n @attributes.merge! attributes\n end",
"def update!(**args)\n @async_options = args[:async_options] if args.key?(:async_options)\n @input_mappings = args[:input_mappings] if args.key?(:input_mappings)\n @name_property = args[:name_property] if args.key?(:name_property)\n @validation_options = args[:validation_options] if args.key?(:validation_options)\n end",
"def update\r\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @type = args[:type] if args.key?(:type)\n end",
"def update\n raise NotImplemented\n end",
"def update_obj\n mean, sd = rating.to_glicko_rating\n @obj.rating = mean\n @obj.rating_deviation = sd\n @obj.volatility = volatility\n end",
"def update_values\n end",
"def update_values\n end",
"def update\n raise NotImplementedError\n end",
"def update!(**args)\n @answers_header_signals = args[:answers_header_signals] if args.key?(:answers_header_signals)\n @property_value = args[:property_value] if args.key?(:property_value)\n @response_meaning_application = args[:response_meaning_application] if args.key?(:response_meaning_application)\n end",
"def update!(**args)\n @create_time = args[:create_time] if args.key?(:create_time)\n @method_prop = args[:method_prop] if args.key?(:method_prop)\n @name = args[:name] if args.key?(:name)\n @state = args[:state] if args.key?(:state)\n end",
"def update attributes, collection #:nodoc:\n 0\n end",
"def update_property_groups(roll)\n @property_groups.each { |_, v| v.update_rent(roll) }\n end",
"def update!(**args)\n @source_property = args[:source_property] if args.key?(:source_property)\n 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 update_properties(path, properties)\n prop_patch = PropPatch.new(properties)\n emit('propPatch', [path, prop_patch])\n prop_patch.commit\n\n prop_patch.result\n end",
"def update\n set_deltatime\n set_last_update_at\n end"
] | [
"0.7012263",
"0.69181895",
"0.69181895",
"0.69181895",
"0.69181895",
"0.69181895",
"0.67403597",
"0.6709326",
"0.6709326",
"0.6696149",
"0.6696149",
"0.6696149",
"0.6696149",
"0.6618882",
"0.6571848",
"0.65386343",
"0.65178275",
"0.6394807",
"0.6389745",
"0.6389745",
"0.63328",
"0.6319025",
"0.6283673",
"0.6269463",
"0.62639254",
"0.62410724",
"0.62170374",
"0.62152076",
"0.6210263",
"0.6204041",
"0.6204041",
"0.62021106",
"0.62017816",
"0.62017",
"0.61730784",
"0.61730784",
"0.6159277",
"0.6156169",
"0.61445665",
"0.6125433",
"0.61241156",
"0.6121413",
"0.6110477",
"0.6105694",
"0.61016303",
"0.60845226",
"0.6084427",
"0.6065455",
"0.6059506",
"0.6054869",
"0.6051708",
"0.6051708",
"0.60413384",
"0.6030853",
"0.6022535",
"0.6015561",
"0.59932375",
"0.59898263",
"0.5976479",
"0.5973787",
"0.59678394",
"0.5963291",
"0.5962048",
"0.5961157",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.59500545",
"0.59443134",
"0.59443134",
"0.59424853",
"0.59424853",
"0.593523",
"0.5926413",
"0.5924831",
"0.592427",
"0.59233046",
"0.59233046",
"0.5921224",
"0.59144294",
"0.59142506",
"0.58887535",
"0.58854496",
"0.5883008",
"0.58792305",
"0.5876954",
"0.5876954",
"0.58744955",
"0.5857968",
"0.5845542",
"0.5841629",
"0.58363605",
"0.5829255",
"0.582919",
"0.5822138",
"0.58208305"
] | 0.0 | -1 |
Update properties of this object | def update!(**args)
@request_id = args[:request_id] if args.key?(:request_id)
@source_address_group = args[:source_address_group] if args.key?(:source_address_group)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update_properties(hash)\n hash.each do |key, value|\n setter_method = \"#{key}=\"\n if self.respond_to?(setter_method)\n self.send(setter_method, value)\n end\n end\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def refresh\n self.class.base_properties.each_with_index do |prop, prop_id|\n @properties[prop] = get_property(prop_id)\n end\n refresh_features\n refresh_status\n refresh_config\n self\n end",
"def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\n end",
"def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\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 update_properties!(branch_id=nil)\n properties = fetch_properties(false, branch_id)\n length = properties.length\n counter = 0\n properties.each do |property|\n counter += 1\n if Vebra.debugging?\n puts \"[Vebra]: #{counter}/#{length}: live updating property with Vebra ref: #{property.attributes[:vebra_ref]}\"\n end\n live_update!(property)\n Vebra.set_last_updated_at(Time.now) if counter == length\n end\n end",
"def update_self obj\n obj.each do |k,v|\n instance_variable_set(\"@#{k}\", v) if v\n end\n end",
"def update_attributes(properties_hash)\n self.class.get_class_properties.each do |property|\n key = property[:name].to_sym\n if properties_hash.has_key? key\n self.setValue(properties_hash[key], forKey:key)\n end\n end\n end",
"def update\n # TODO: implement update\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @states = args[:states] if args.key?(:states)\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end",
"def update!(**args)\n @property = args[:property] if args.key?(:property)\n @total_value_count = args[:total_value_count] if args.key?(:total_value_count)\n @value = args[:value] if args.key?(:value)\n @value_status = args[:value_status] if args.key?(:value_status)\n end",
"def update\n \n end",
"def refresh\n set_attributes\n end",
"def update(attrs)\n @attrs.update(attrs)\n self\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @source = args[:source] if args.key?(:source)\n end",
"def update_resource object, attributes\n object.update attributes\n end",
"def update(attrs)\n @attrs ||= {}\n @attrs.update(attrs)\n self\n end",
"def update\n \n end",
"def update!(**args)\n @property = args[:property] if args.key?(:property)\n @schema = args[:schema] if args.key?(:schema)\n end",
"def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def _update!\n self.class.properties.each do |property, predicate|\n if dirty?(property)\n self.class.repository_or_fail.delete([subject, predicate[:predicate], nil])\n if self.class.is_list?(property)\n repo = RDF::Repository.new\n attribute_get(property).each do |value|\n repo << RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(value, self.class.properties[property][:type]))\n end\n self.class.repository_or_fail.insert(*repo)\n else\n self.class.repository_or_fail.insert(RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(attribute_get(property), self.class.properties[property][:type])))\n end\n end\n @dirty[property] = nil\n @attributes[:original][property] = attribute_get(property)\n end\n self.class.repository_or_fail.insert(RDF::Statement.new(@subject, RDF.type, type)) unless type.nil?\n end",
"def update(attributes = {})\n super(attributes)\n retrieve!\n self\n end",
"def update\n @objects.map(&:update);\n end",
"def update\n raise NotImplementedError\n end",
"def update\n raise NotImplementedError\n end",
"def live_update!(property)\n property_class = Vebra.models[:property][:class].to_s.camelize.constantize\n\n # ensure we have the full property attributes\n property.get_property if !property.attributes[:status] && property.attributes[:action] != 'deleted'\n\n # find & update or build a new property\n property_model = property_class.find_or_initialize_by_vebra_ref(property.attributes[:vebra_ref])\n\n # make sure property object is not empty\n return false if !property.attributes || !property.attributes[:property_type]\n\n # if the property has been deleted, mark it appropriately and move on\n if property.attributes[:action] == 'deleted'\n return property_model.destroy\n end\n\n # extract accessible attributes for the property\n property_accessibles = property_class.accessible_attributes.map(&:to_sym)\n property_attributes = property.attributes.inject({}) do |result, (key, value)|\n result[key] = value if property_accessibles.include?(key)\n result\n end\n\n # update the property model's attributes\n property_model.no_callbacks = true if property_model.respond_to?(:no_callbacks)\n property_model.update_attributes(property_attributes)\n\n # find & update or build a new address\n if Vebra.models[:address]\n address_class = Vebra.models[:address][:class].to_s.camelize.constantize\n address_model = property_model.send(Vebra.models[:property][:address_method])\n address_model = property_model.send(\"build_#{Vebra.models[:property][:address_method]}\") unless address_model\n\n # extract accessible attributes for the address\n address_accessibles = address_class.accessible_attributes.map(&:to_sym)\n address_attributes = property.attributes[:address].inject({}) do |result, (key, value)|\n result[key] = value if address_accessibles.include?(key)\n result\n end\n\n # update the address model's attributes\n address_model.update_attributes(address_attributes)\n end\n\n # find & update or build new rooms\n if Vebra.models[:room]\n room_class = Vebra.models[:room][:class].to_s.camelize.constantize\n\n # accessible attributes for the rooms\n room_accessibles = room_class.accessible_attributes.map(&:to_sym)\n\n # delete any rooms which are no longer present\n property_rooms = property.attributes[:rooms] || []\n property_model_rooms = property_model.send(Vebra.models[:property][:rooms_method])\n refs_to_delete = property_model_rooms.map(&:vebra_ref) - property_rooms.map { |r| r[:vebra_ref] }\n property_model_rooms.each do |room|\n room.destroy if refs_to_delete.include?(room.vebra_ref)\n end\n\n # find & update or build new rooms\n property_rooms.each do |room|\n room_model = room_class.find_by_property_id_and_vebra_ref(property_model.id, room[:vebra_ref])\n room_model = property_model_rooms.build unless room_model\n\n # extract accessible attributes for the room\n room_attributes = room.inject({}) do |result, (key, value)|\n result[key] = value if room_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n room_model.update_attributes(room_attributes)\n end\n end\n\n # find & update or build new file attachments\n if Vebra.models[:file]\n file_class = Vebra.models[:file][:class].to_s.camelize.constantize\n\n # accessible attributes for the files\n file_accessibles = file_class.accessible_attributes.map(&:to_sym)\n\n # first normalize the collection (currently nested collections)\n property_files = property.attributes[:files].inject([]) do |result, (kind, collection)|\n collection.each do |file|\n file[:type] = kind.to_s.singularize.camelize if file_accessibles.include?(:type)\n file[\"remote_#{Vebra.models[:file][:attachment_method]}_url\".to_sym] = file.delete(:url)\n # if file[:type] is set, it means the attachment file class can be subclassed. In this\n # case we need to ensure that the subclass exists. If not, we ignore this file\n begin\n file[:type].constantize if file_accessibles.include?(:type)\n result << file\n rescue NameError => e\n # ignore - this means the subclass does not exist\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n\n result\n end\n\n # delete any files which are no longer present\n property_model_files = property_model.send(Vebra.models[:property][:files_method])\n refs_to_delete = property_model_files.map(&:vebra_ref) - property_files.map { |f| f[:vebra_ref] }\n property_model_files.each do |file|\n file.destroy if refs_to_delete.include?(file.vebra_ref)\n end\n\n # find & update or build new files\n property_files.each do |file|\n begin\n file_model = property_model_files.find_by_vebra_ref(file[:vebra_ref])\n file_model = property_model_files.build unless file_model\n\n # extract accessible attributes for the file\n file_attributes = file.inject({}) do |result, (key, value)|\n result[key] = value if file_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n file_model.update_attributes(file_attributes)\n rescue CarrierWave::ProcessingError, OpenURI::HTTPError => e\n # just ignore the file\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n end\n\n property_model.no_callbacks = false if property_model.respond_to?(:no_callbacks)\n property_model.save\n return property_model\n end",
"def update!(**args)\n @id = args[:id] if args.key?(:id)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def update\n end",
"def update!(**args)\n @mid = args[:mid] if args.key?(:mid)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def modified_properties=(value)\n @modified_properties = value\n end",
"def apply_properties!(properties)\n # Non-commutitivity etc. eventually.\n end",
"def set_properties(hash)\n hash.each do |key, value|\n add_or_remove_ostruct_member(key, value)\n end\n rest_reset_properties\n end",
"def update\n\t\t\n\t\tend",
"def set_props(props)\n @props.merge!(props)\n end",
"def update() end",
"def update!(**args)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def assign_properties\n self.properties ||= {}\n listing_properties.each do |prop|\n self.properties[prop.key] ||= prop.value\n end\n end",
"def change_properties(new_current_floor, new_next_floor, new_movement)\n @current_floor = new_current_floor\n @next_floor = new_next_floor\n @movement = new_movement\n end",
"def update!(**args)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end",
"def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end",
"def update(attributes)\n (@attributes ||= {}).merge! attributes\n\n (self.class.attr_initializables & attributes.keys).each do |name|\n instance_variable_set :\"@#{name}\", attributes[name]\n end\n\n self\n end",
"def update_attributes(attrs)\n super({})\n end",
"def update\n @dirty = true\n end",
"def update\n\n # Run through the mixin updates\n colourable_update\n movable_update\n\n end",
"def set(props)\n props.each do |prop, val|\n self.send(:\"#{ prop }=\", val)\n end\n end",
"def update\n super\n end",
"def update!(**args)\n @property_id = args[:property_id] if args.key?(:property_id)\n @value_status = args[:value_status] if args.key?(:value_status)\n end",
"def update!(**args)\n @object_size_bytes = args[:object_size_bytes] if args.key?(:object_size_bytes)\n @object_version = args[:object_version] if args.key?(:object_version)\n end",
"def movable_update\n\n # Work through the different aspects we update\n movable_location_update\n movable_size_update\n movable_angle_update\n\n end",
"def properties=(value)\n @properties = value\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(context={})\n self.pre_cast_attributes\n m2o = @relations.reject{|k, v| !self.class.many2one_relations.has_key?(k)}\n vals = @attributes.reject {|key, value| key == 'id'}.merge(m2o.merge(m2o){|k, v| v.is_a?(Array) ? v[0] : v})\n self.class.rpc_execute('write', self.id, vals, context)\n reload_from_record!(self.class.find(self.id, :context => context))\n end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update ; end",
"def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end",
"def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end",
"def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end",
"def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end",
"def update_with(attributes)\n assign_attributes(attributes)\n end",
"def update\n # don't need to update; hash is shared\n end",
"def update(attributes)\n HashProxy.with(attributes) do |proxy|\n self.class.attribute_names.each do |name|\n send(\"#{name}=\", proxy[name]) if proxy.key?(name)\n end\n end\n save\n end",
"def update!(**args)\n @object_id_prop = args[:object_id_prop] if args.key?(:object_id_prop)\n @relation = args[:relation] if args.key?(:relation)\n @subject_id = args[:subject_id] if args.key?(:subject_id)\n end",
"def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end",
"def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end",
"def update\n raise NotImplementedError\n end",
"def update_attributes attributes\n @attributes.merge! attributes\n end",
"def update!(**args)\n @async_options = args[:async_options] if args.key?(:async_options)\n @input_mappings = args[:input_mappings] if args.key?(:input_mappings)\n @name_property = args[:name_property] if args.key?(:name_property)\n @validation_options = args[:validation_options] if args.key?(:validation_options)\n end",
"def update\r\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @type = args[:type] if args.key?(:type)\n end",
"def update\n raise NotImplemented\n end",
"def update_obj\n mean, sd = rating.to_glicko_rating\n @obj.rating = mean\n @obj.rating_deviation = sd\n @obj.volatility = volatility\n end",
"def update_values\n end",
"def update_values\n end",
"def update\n raise NotImplementedError\n end",
"def update!(**args)\n @answers_header_signals = args[:answers_header_signals] if args.key?(:answers_header_signals)\n @property_value = args[:property_value] if args.key?(:property_value)\n @response_meaning_application = args[:response_meaning_application] if args.key?(:response_meaning_application)\n end",
"def update!(**args)\n @create_time = args[:create_time] if args.key?(:create_time)\n @method_prop = args[:method_prop] if args.key?(:method_prop)\n @name = args[:name] if args.key?(:name)\n @state = args[:state] if args.key?(:state)\n end",
"def update attributes, collection #:nodoc:\n 0\n end",
"def update_property_groups(roll)\n @property_groups.each { |_, v| v.update_rent(roll) }\n end",
"def update!(**args)\n @source_property = args[:source_property] if args.key?(:source_property)\n 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 update_properties(path, properties)\n prop_patch = PropPatch.new(properties)\n emit('propPatch', [path, prop_patch])\n prop_patch.commit\n\n prop_patch.result\n end",
"def update\n set_deltatime\n set_last_update_at\n end"
] | [
"0.7012263",
"0.69181895",
"0.69181895",
"0.69181895",
"0.69181895",
"0.69181895",
"0.67403597",
"0.6709326",
"0.6709326",
"0.6696149",
"0.6696149",
"0.6696149",
"0.6696149",
"0.6618882",
"0.6571848",
"0.65386343",
"0.65178275",
"0.6394807",
"0.6389745",
"0.6389745",
"0.63328",
"0.6319025",
"0.6283673",
"0.6269463",
"0.62639254",
"0.62410724",
"0.62170374",
"0.62152076",
"0.6210263",
"0.6204041",
"0.6204041",
"0.62021106",
"0.62017816",
"0.62017",
"0.61730784",
"0.61730784",
"0.6159277",
"0.6156169",
"0.61445665",
"0.6125433",
"0.61241156",
"0.6121413",
"0.6110477",
"0.6105694",
"0.61016303",
"0.60845226",
"0.6084427",
"0.6065455",
"0.6059506",
"0.6054869",
"0.6051708",
"0.6051708",
"0.60413384",
"0.6030853",
"0.6022535",
"0.6015561",
"0.59932375",
"0.59898263",
"0.5976479",
"0.5973787",
"0.59678394",
"0.5963291",
"0.5962048",
"0.5961157",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.59500545",
"0.59443134",
"0.59443134",
"0.59424853",
"0.59424853",
"0.593523",
"0.5926413",
"0.5924831",
"0.592427",
"0.59233046",
"0.59233046",
"0.5921224",
"0.59144294",
"0.59142506",
"0.58887535",
"0.58854496",
"0.5883008",
"0.58792305",
"0.5876954",
"0.5876954",
"0.58744955",
"0.5857968",
"0.5845542",
"0.5841629",
"0.58363605",
"0.5829255",
"0.582919",
"0.5822138",
"0.58208305"
] | 0.0 | -1 |
Update properties of this object | def update!(**args)
@hosts = args[:hosts] if args.key?(:hosts)
@http_header_match = args[:http_header_match] if args.key?(:http_header_match)
@methods_prop = args[:methods_prop] if args.key?(:methods_prop)
@ports = args[:ports] if args.key?(:ports)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update_properties(hash)\n hash.each do |key, value|\n setter_method = \"#{key}=\"\n if self.respond_to?(setter_method)\n self.send(setter_method, value)\n end\n end\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def refresh\n self.class.base_properties.each_with_index do |prop, prop_id|\n @properties[prop] = get_property(prop_id)\n end\n refresh_features\n refresh_status\n refresh_config\n self\n end",
"def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\n end",
"def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\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 update_properties!(branch_id=nil)\n properties = fetch_properties(false, branch_id)\n length = properties.length\n counter = 0\n properties.each do |property|\n counter += 1\n if Vebra.debugging?\n puts \"[Vebra]: #{counter}/#{length}: live updating property with Vebra ref: #{property.attributes[:vebra_ref]}\"\n end\n live_update!(property)\n Vebra.set_last_updated_at(Time.now) if counter == length\n end\n end",
"def update_self obj\n obj.each do |k,v|\n instance_variable_set(\"@#{k}\", v) if v\n end\n end",
"def update_attributes(properties_hash)\n self.class.get_class_properties.each do |property|\n key = property[:name].to_sym\n if properties_hash.has_key? key\n self.setValue(properties_hash[key], forKey:key)\n end\n end\n end",
"def update\n # TODO: implement update\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @states = args[:states] if args.key?(:states)\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end",
"def update!(**args)\n @property = args[:property] if args.key?(:property)\n @total_value_count = args[:total_value_count] if args.key?(:total_value_count)\n @value = args[:value] if args.key?(:value)\n @value_status = args[:value_status] if args.key?(:value_status)\n end",
"def update\n \n end",
"def refresh\n set_attributes\n end",
"def update(attrs)\n @attrs.update(attrs)\n self\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @source = args[:source] if args.key?(:source)\n end",
"def update_resource object, attributes\n object.update attributes\n end",
"def update(attrs)\n @attrs ||= {}\n @attrs.update(attrs)\n self\n end",
"def update\n \n end",
"def update!(**args)\n @property = args[:property] if args.key?(:property)\n @schema = args[:schema] if args.key?(:schema)\n end",
"def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def update(attributes = {})\n super(attributes)\n retrieve!\n self\n end",
"def _update!\n self.class.properties.each do |property, predicate|\n if dirty?(property)\n self.class.repository_or_fail.delete([subject, predicate[:predicate], nil])\n if self.class.is_list?(property)\n repo = RDF::Repository.new\n attribute_get(property).each do |value|\n repo << RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(value, self.class.properties[property][:type]))\n end\n self.class.repository_or_fail.insert(*repo)\n else\n self.class.repository_or_fail.insert(RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(attribute_get(property), self.class.properties[property][:type])))\n end\n end\n @dirty[property] = nil\n @attributes[:original][property] = attribute_get(property)\n end\n self.class.repository_or_fail.insert(RDF::Statement.new(@subject, RDF.type, type)) unless type.nil?\n end",
"def update\n @objects.map(&:update);\n end",
"def update\n raise NotImplementedError\n end",
"def update\n raise NotImplementedError\n end",
"def live_update!(property)\n property_class = Vebra.models[:property][:class].to_s.camelize.constantize\n\n # ensure we have the full property attributes\n property.get_property if !property.attributes[:status] && property.attributes[:action] != 'deleted'\n\n # find & update or build a new property\n property_model = property_class.find_or_initialize_by_vebra_ref(property.attributes[:vebra_ref])\n\n # make sure property object is not empty\n return false if !property.attributes || !property.attributes[:property_type]\n\n # if the property has been deleted, mark it appropriately and move on\n if property.attributes[:action] == 'deleted'\n return property_model.destroy\n end\n\n # extract accessible attributes for the property\n property_accessibles = property_class.accessible_attributes.map(&:to_sym)\n property_attributes = property.attributes.inject({}) do |result, (key, value)|\n result[key] = value if property_accessibles.include?(key)\n result\n end\n\n # update the property model's attributes\n property_model.no_callbacks = true if property_model.respond_to?(:no_callbacks)\n property_model.update_attributes(property_attributes)\n\n # find & update or build a new address\n if Vebra.models[:address]\n address_class = Vebra.models[:address][:class].to_s.camelize.constantize\n address_model = property_model.send(Vebra.models[:property][:address_method])\n address_model = property_model.send(\"build_#{Vebra.models[:property][:address_method]}\") unless address_model\n\n # extract accessible attributes for the address\n address_accessibles = address_class.accessible_attributes.map(&:to_sym)\n address_attributes = property.attributes[:address].inject({}) do |result, (key, value)|\n result[key] = value if address_accessibles.include?(key)\n result\n end\n\n # update the address model's attributes\n address_model.update_attributes(address_attributes)\n end\n\n # find & update or build new rooms\n if Vebra.models[:room]\n room_class = Vebra.models[:room][:class].to_s.camelize.constantize\n\n # accessible attributes for the rooms\n room_accessibles = room_class.accessible_attributes.map(&:to_sym)\n\n # delete any rooms which are no longer present\n property_rooms = property.attributes[:rooms] || []\n property_model_rooms = property_model.send(Vebra.models[:property][:rooms_method])\n refs_to_delete = property_model_rooms.map(&:vebra_ref) - property_rooms.map { |r| r[:vebra_ref] }\n property_model_rooms.each do |room|\n room.destroy if refs_to_delete.include?(room.vebra_ref)\n end\n\n # find & update or build new rooms\n property_rooms.each do |room|\n room_model = room_class.find_by_property_id_and_vebra_ref(property_model.id, room[:vebra_ref])\n room_model = property_model_rooms.build unless room_model\n\n # extract accessible attributes for the room\n room_attributes = room.inject({}) do |result, (key, value)|\n result[key] = value if room_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n room_model.update_attributes(room_attributes)\n end\n end\n\n # find & update or build new file attachments\n if Vebra.models[:file]\n file_class = Vebra.models[:file][:class].to_s.camelize.constantize\n\n # accessible attributes for the files\n file_accessibles = file_class.accessible_attributes.map(&:to_sym)\n\n # first normalize the collection (currently nested collections)\n property_files = property.attributes[:files].inject([]) do |result, (kind, collection)|\n collection.each do |file|\n file[:type] = kind.to_s.singularize.camelize if file_accessibles.include?(:type)\n file[\"remote_#{Vebra.models[:file][:attachment_method]}_url\".to_sym] = file.delete(:url)\n # if file[:type] is set, it means the attachment file class can be subclassed. In this\n # case we need to ensure that the subclass exists. If not, we ignore this file\n begin\n file[:type].constantize if file_accessibles.include?(:type)\n result << file\n rescue NameError => e\n # ignore - this means the subclass does not exist\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n\n result\n end\n\n # delete any files which are no longer present\n property_model_files = property_model.send(Vebra.models[:property][:files_method])\n refs_to_delete = property_model_files.map(&:vebra_ref) - property_files.map { |f| f[:vebra_ref] }\n property_model_files.each do |file|\n file.destroy if refs_to_delete.include?(file.vebra_ref)\n end\n\n # find & update or build new files\n property_files.each do |file|\n begin\n file_model = property_model_files.find_by_vebra_ref(file[:vebra_ref])\n file_model = property_model_files.build unless file_model\n\n # extract accessible attributes for the file\n file_attributes = file.inject({}) do |result, (key, value)|\n result[key] = value if file_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n file_model.update_attributes(file_attributes)\n rescue CarrierWave::ProcessingError, OpenURI::HTTPError => e\n # just ignore the file\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n end\n\n property_model.no_callbacks = false if property_model.respond_to?(:no_callbacks)\n property_model.save\n return property_model\n end",
"def update!(**args)\n @id = args[:id] if args.key?(:id)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def update\n end",
"def update!(**args)\n @mid = args[:mid] if args.key?(:mid)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def modified_properties=(value)\n @modified_properties = value\n end",
"def apply_properties!(properties)\n # Non-commutitivity etc. eventually.\n end",
"def set_properties(hash)\n hash.each do |key, value|\n add_or_remove_ostruct_member(key, value)\n end\n rest_reset_properties\n end",
"def update\n\t\t\n\t\tend",
"def set_props(props)\n @props.merge!(props)\n end",
"def update() end",
"def update!(**args)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def assign_properties\n self.properties ||= {}\n listing_properties.each do |prop|\n self.properties[prop.key] ||= prop.value\n end\n end",
"def change_properties(new_current_floor, new_next_floor, new_movement)\n @current_floor = new_current_floor\n @next_floor = new_next_floor\n @movement = new_movement\n end",
"def update!(**args)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end",
"def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end",
"def update(attributes)\n (@attributes ||= {}).merge! attributes\n\n (self.class.attr_initializables & attributes.keys).each do |name|\n instance_variable_set :\"@#{name}\", attributes[name]\n end\n\n self\n end",
"def update_attributes(attrs)\n super({})\n end",
"def update\n @dirty = true\n end",
"def update\n\n # Run through the mixin updates\n colourable_update\n movable_update\n\n end",
"def set(props)\n props.each do |prop, val|\n self.send(:\"#{ prop }=\", val)\n end\n end",
"def update\n super\n end",
"def update!(**args)\n @property_id = args[:property_id] if args.key?(:property_id)\n @value_status = args[:value_status] if args.key?(:value_status)\n end",
"def update!(**args)\n @object_size_bytes = args[:object_size_bytes] if args.key?(:object_size_bytes)\n @object_version = args[:object_version] if args.key?(:object_version)\n end",
"def movable_update\n\n # Work through the different aspects we update\n movable_location_update\n movable_size_update\n movable_angle_update\n\n end",
"def properties=(value)\n @properties = value\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(context={})\n self.pre_cast_attributes\n m2o = @relations.reject{|k, v| !self.class.many2one_relations.has_key?(k)}\n vals = @attributes.reject {|key, value| key == 'id'}.merge(m2o.merge(m2o){|k, v| v.is_a?(Array) ? v[0] : v})\n self.class.rpc_execute('write', self.id, vals, context)\n reload_from_record!(self.class.find(self.id, :context => context))\n end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update ; end",
"def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end",
"def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end",
"def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end",
"def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end",
"def update_with(attributes)\n assign_attributes(attributes)\n end",
"def update\n # don't need to update; hash is shared\n end",
"def update(attributes)\n HashProxy.with(attributes) do |proxy|\n self.class.attribute_names.each do |name|\n send(\"#{name}=\", proxy[name]) if proxy.key?(name)\n end\n end\n save\n end",
"def update!(**args)\n @object_id_prop = args[:object_id_prop] if args.key?(:object_id_prop)\n @relation = args[:relation] if args.key?(:relation)\n @subject_id = args[:subject_id] if args.key?(:subject_id)\n end",
"def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end",
"def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end",
"def update\n raise NotImplementedError\n end",
"def update_attributes attributes\n @attributes.merge! attributes\n end",
"def update!(**args)\n @async_options = args[:async_options] if args.key?(:async_options)\n @input_mappings = args[:input_mappings] if args.key?(:input_mappings)\n @name_property = args[:name_property] if args.key?(:name_property)\n @validation_options = args[:validation_options] if args.key?(:validation_options)\n end",
"def update\r\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @type = args[:type] if args.key?(:type)\n end",
"def update\n raise NotImplemented\n end",
"def update_obj\n mean, sd = rating.to_glicko_rating\n @obj.rating = mean\n @obj.rating_deviation = sd\n @obj.volatility = volatility\n end",
"def update_values\n end",
"def update_values\n end",
"def update\n raise NotImplementedError\n end",
"def update!(**args)\n @answers_header_signals = args[:answers_header_signals] if args.key?(:answers_header_signals)\n @property_value = args[:property_value] if args.key?(:property_value)\n @response_meaning_application = args[:response_meaning_application] if args.key?(:response_meaning_application)\n end",
"def update!(**args)\n @create_time = args[:create_time] if args.key?(:create_time)\n @method_prop = args[:method_prop] if args.key?(:method_prop)\n @name = args[:name] if args.key?(:name)\n @state = args[:state] if args.key?(:state)\n end",
"def update attributes, collection #:nodoc:\n 0\n end",
"def update_property_groups(roll)\n @property_groups.each { |_, v| v.update_rent(roll) }\n 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 update!(**args)\n @source_property = args[:source_property] if args.key?(:source_property)\n end",
"def update_properties(path, properties)\n prop_patch = PropPatch.new(properties)\n emit('propPatch', [path, prop_patch])\n prop_patch.commit\n\n prop_patch.result\n end",
"def update\n set_deltatime\n set_last_update_at\n end"
] | [
"0.7012568",
"0.6918917",
"0.6918917",
"0.6918917",
"0.6918917",
"0.6918917",
"0.67404634",
"0.6709981",
"0.6709981",
"0.66964126",
"0.66964126",
"0.66964126",
"0.66964126",
"0.6619218",
"0.6570895",
"0.6539287",
"0.6517026",
"0.63946927",
"0.63901657",
"0.63901657",
"0.63328683",
"0.6318612",
"0.62846893",
"0.62692374",
"0.6264273",
"0.6241163",
"0.6216599",
"0.6214641",
"0.6210363",
"0.6203827",
"0.6203827",
"0.620312",
"0.6201905",
"0.62001497",
"0.61728275",
"0.61728275",
"0.6159924",
"0.61569315",
"0.61442953",
"0.61260897",
"0.6125199",
"0.61227936",
"0.61111224",
"0.610543",
"0.6102925",
"0.60839343",
"0.6083609",
"0.6066973",
"0.60602766",
"0.6055065",
"0.6051568",
"0.6051568",
"0.6042057",
"0.60319084",
"0.60221004",
"0.60149413",
"0.5994295",
"0.5989816",
"0.597674",
"0.5973157",
"0.5967343",
"0.5965598",
"0.59629464",
"0.59618354",
"0.5950329",
"0.5950329",
"0.5950329",
"0.5950329",
"0.5950329",
"0.5950329",
"0.5950329",
"0.5950329",
"0.59495455",
"0.59442014",
"0.59442014",
"0.5944142",
"0.5944142",
"0.59361076",
"0.5925741",
"0.5925574",
"0.59250593",
"0.5924476",
"0.5924476",
"0.5921039",
"0.59155524",
"0.59145254",
"0.5888445",
"0.58860934",
"0.5882302",
"0.5879913",
"0.5877467",
"0.5877467",
"0.58743787",
"0.585829",
"0.584583",
"0.58408254",
"0.5835501",
"0.5829063",
"0.5828611",
"0.58228916",
"0.5819882"
] | 0.0 | -1 |
Update properties of this object | def update!(**args)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update_properties(hash)\n hash.each do |key, value|\n setter_method = \"#{key}=\"\n if self.respond_to?(setter_method)\n self.send(setter_method, value)\n end\n end\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def refresh\n self.class.base_properties.each_with_index do |prop, prop_id|\n @properties[prop] = get_property(prop_id)\n end\n refresh_features\n refresh_status\n refresh_config\n self\n end",
"def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\n end",
"def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\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 update_properties!(branch_id=nil)\n properties = fetch_properties(false, branch_id)\n length = properties.length\n counter = 0\n properties.each do |property|\n counter += 1\n if Vebra.debugging?\n puts \"[Vebra]: #{counter}/#{length}: live updating property with Vebra ref: #{property.attributes[:vebra_ref]}\"\n end\n live_update!(property)\n Vebra.set_last_updated_at(Time.now) if counter == length\n end\n end",
"def update_self obj\n obj.each do |k,v|\n instance_variable_set(\"@#{k}\", v) if v\n end\n end",
"def update_attributes(properties_hash)\n self.class.get_class_properties.each do |property|\n key = property[:name].to_sym\n if properties_hash.has_key? key\n self.setValue(properties_hash[key], forKey:key)\n end\n end\n end",
"def update\n # TODO: implement update\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @states = args[:states] if args.key?(:states)\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end",
"def update!(**args)\n @property = args[:property] if args.key?(:property)\n @total_value_count = args[:total_value_count] if args.key?(:total_value_count)\n @value = args[:value] if args.key?(:value)\n @value_status = args[:value_status] if args.key?(:value_status)\n end",
"def update\n \n end",
"def refresh\n set_attributes\n end",
"def update(attrs)\n @attrs.update(attrs)\n self\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @source = args[:source] if args.key?(:source)\n end",
"def update_resource object, attributes\n object.update attributes\n end",
"def update(attrs)\n @attrs ||= {}\n @attrs.update(attrs)\n self\n end",
"def update\n \n end",
"def update!(**args)\n @property = args[:property] if args.key?(:property)\n @schema = args[:schema] if args.key?(:schema)\n end",
"def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def _update!\n self.class.properties.each do |property, predicate|\n if dirty?(property)\n self.class.repository_or_fail.delete([subject, predicate[:predicate], nil])\n if self.class.is_list?(property)\n repo = RDF::Repository.new\n attribute_get(property).each do |value|\n repo << RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(value, self.class.properties[property][:type]))\n end\n self.class.repository_or_fail.insert(*repo)\n else\n self.class.repository_or_fail.insert(RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(attribute_get(property), self.class.properties[property][:type])))\n end\n end\n @dirty[property] = nil\n @attributes[:original][property] = attribute_get(property)\n end\n self.class.repository_or_fail.insert(RDF::Statement.new(@subject, RDF.type, type)) unless type.nil?\n end",
"def update(attributes = {})\n super(attributes)\n retrieve!\n self\n end",
"def update\n @objects.map(&:update);\n end",
"def update\n raise NotImplementedError\n end",
"def update\n raise NotImplementedError\n end",
"def live_update!(property)\n property_class = Vebra.models[:property][:class].to_s.camelize.constantize\n\n # ensure we have the full property attributes\n property.get_property if !property.attributes[:status] && property.attributes[:action] != 'deleted'\n\n # find & update or build a new property\n property_model = property_class.find_or_initialize_by_vebra_ref(property.attributes[:vebra_ref])\n\n # make sure property object is not empty\n return false if !property.attributes || !property.attributes[:property_type]\n\n # if the property has been deleted, mark it appropriately and move on\n if property.attributes[:action] == 'deleted'\n return property_model.destroy\n end\n\n # extract accessible attributes for the property\n property_accessibles = property_class.accessible_attributes.map(&:to_sym)\n property_attributes = property.attributes.inject({}) do |result, (key, value)|\n result[key] = value if property_accessibles.include?(key)\n result\n end\n\n # update the property model's attributes\n property_model.no_callbacks = true if property_model.respond_to?(:no_callbacks)\n property_model.update_attributes(property_attributes)\n\n # find & update or build a new address\n if Vebra.models[:address]\n address_class = Vebra.models[:address][:class].to_s.camelize.constantize\n address_model = property_model.send(Vebra.models[:property][:address_method])\n address_model = property_model.send(\"build_#{Vebra.models[:property][:address_method]}\") unless address_model\n\n # extract accessible attributes for the address\n address_accessibles = address_class.accessible_attributes.map(&:to_sym)\n address_attributes = property.attributes[:address].inject({}) do |result, (key, value)|\n result[key] = value if address_accessibles.include?(key)\n result\n end\n\n # update the address model's attributes\n address_model.update_attributes(address_attributes)\n end\n\n # find & update or build new rooms\n if Vebra.models[:room]\n room_class = Vebra.models[:room][:class].to_s.camelize.constantize\n\n # accessible attributes for the rooms\n room_accessibles = room_class.accessible_attributes.map(&:to_sym)\n\n # delete any rooms which are no longer present\n property_rooms = property.attributes[:rooms] || []\n property_model_rooms = property_model.send(Vebra.models[:property][:rooms_method])\n refs_to_delete = property_model_rooms.map(&:vebra_ref) - property_rooms.map { |r| r[:vebra_ref] }\n property_model_rooms.each do |room|\n room.destroy if refs_to_delete.include?(room.vebra_ref)\n end\n\n # find & update or build new rooms\n property_rooms.each do |room|\n room_model = room_class.find_by_property_id_and_vebra_ref(property_model.id, room[:vebra_ref])\n room_model = property_model_rooms.build unless room_model\n\n # extract accessible attributes for the room\n room_attributes = room.inject({}) do |result, (key, value)|\n result[key] = value if room_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n room_model.update_attributes(room_attributes)\n end\n end\n\n # find & update or build new file attachments\n if Vebra.models[:file]\n file_class = Vebra.models[:file][:class].to_s.camelize.constantize\n\n # accessible attributes for the files\n file_accessibles = file_class.accessible_attributes.map(&:to_sym)\n\n # first normalize the collection (currently nested collections)\n property_files = property.attributes[:files].inject([]) do |result, (kind, collection)|\n collection.each do |file|\n file[:type] = kind.to_s.singularize.camelize if file_accessibles.include?(:type)\n file[\"remote_#{Vebra.models[:file][:attachment_method]}_url\".to_sym] = file.delete(:url)\n # if file[:type] is set, it means the attachment file class can be subclassed. In this\n # case we need to ensure that the subclass exists. If not, we ignore this file\n begin\n file[:type].constantize if file_accessibles.include?(:type)\n result << file\n rescue NameError => e\n # ignore - this means the subclass does not exist\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n\n result\n end\n\n # delete any files which are no longer present\n property_model_files = property_model.send(Vebra.models[:property][:files_method])\n refs_to_delete = property_model_files.map(&:vebra_ref) - property_files.map { |f| f[:vebra_ref] }\n property_model_files.each do |file|\n file.destroy if refs_to_delete.include?(file.vebra_ref)\n end\n\n # find & update or build new files\n property_files.each do |file|\n begin\n file_model = property_model_files.find_by_vebra_ref(file[:vebra_ref])\n file_model = property_model_files.build unless file_model\n\n # extract accessible attributes for the file\n file_attributes = file.inject({}) do |result, (key, value)|\n result[key] = value if file_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n file_model.update_attributes(file_attributes)\n rescue CarrierWave::ProcessingError, OpenURI::HTTPError => e\n # just ignore the file\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n end\n\n property_model.no_callbacks = false if property_model.respond_to?(:no_callbacks)\n property_model.save\n return property_model\n end",
"def update!(**args)\n @id = args[:id] if args.key?(:id)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def update\n end",
"def update!(**args)\n @mid = args[:mid] if args.key?(:mid)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def modified_properties=(value)\n @modified_properties = value\n end",
"def apply_properties!(properties)\n # Non-commutitivity etc. eventually.\n end",
"def set_properties(hash)\n hash.each do |key, value|\n add_or_remove_ostruct_member(key, value)\n end\n rest_reset_properties\n end",
"def update\n\t\t\n\t\tend",
"def set_props(props)\n @props.merge!(props)\n end",
"def update() end",
"def update!(**args)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def assign_properties\n self.properties ||= {}\n listing_properties.each do |prop|\n self.properties[prop.key] ||= prop.value\n end\n end",
"def change_properties(new_current_floor, new_next_floor, new_movement)\n @current_floor = new_current_floor\n @next_floor = new_next_floor\n @movement = new_movement\n end",
"def update!(**args)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end",
"def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end",
"def update(attributes)\n (@attributes ||= {}).merge! attributes\n\n (self.class.attr_initializables & attributes.keys).each do |name|\n instance_variable_set :\"@#{name}\", attributes[name]\n end\n\n self\n end",
"def update_attributes(attrs)\n super({})\n end",
"def update\n @dirty = true\n end",
"def update\n\n # Run through the mixin updates\n colourable_update\n movable_update\n\n end",
"def set(props)\n props.each do |prop, val|\n self.send(:\"#{ prop }=\", val)\n end\n end",
"def update\n super\n end",
"def update!(**args)\n @property_id = args[:property_id] if args.key?(:property_id)\n @value_status = args[:value_status] if args.key?(:value_status)\n end",
"def update!(**args)\n @object_size_bytes = args[:object_size_bytes] if args.key?(:object_size_bytes)\n @object_version = args[:object_version] if args.key?(:object_version)\n end",
"def movable_update\n\n # Work through the different aspects we update\n movable_location_update\n movable_size_update\n movable_angle_update\n\n end",
"def properties=(value)\n @properties = value\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(context={})\n self.pre_cast_attributes\n m2o = @relations.reject{|k, v| !self.class.many2one_relations.has_key?(k)}\n vals = @attributes.reject {|key, value| key == 'id'}.merge(m2o.merge(m2o){|k, v| v.is_a?(Array) ? v[0] : v})\n self.class.rpc_execute('write', self.id, vals, context)\n reload_from_record!(self.class.find(self.id, :context => context))\n end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update ; end",
"def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end",
"def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end",
"def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end",
"def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end",
"def update_with(attributes)\n assign_attributes(attributes)\n end",
"def update\n # don't need to update; hash is shared\n end",
"def update(attributes)\n HashProxy.with(attributes) do |proxy|\n self.class.attribute_names.each do |name|\n send(\"#{name}=\", proxy[name]) if proxy.key?(name)\n end\n end\n save\n end",
"def update!(**args)\n @object_id_prop = args[:object_id_prop] if args.key?(:object_id_prop)\n @relation = args[:relation] if args.key?(:relation)\n @subject_id = args[:subject_id] if args.key?(:subject_id)\n end",
"def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end",
"def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end",
"def update\n raise NotImplementedError\n end",
"def update_attributes attributes\n @attributes.merge! attributes\n end",
"def update!(**args)\n @async_options = args[:async_options] if args.key?(:async_options)\n @input_mappings = args[:input_mappings] if args.key?(:input_mappings)\n @name_property = args[:name_property] if args.key?(:name_property)\n @validation_options = args[:validation_options] if args.key?(:validation_options)\n end",
"def update\r\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @type = args[:type] if args.key?(:type)\n end",
"def update\n raise NotImplemented\n end",
"def update_obj\n mean, sd = rating.to_glicko_rating\n @obj.rating = mean\n @obj.rating_deviation = sd\n @obj.volatility = volatility\n end",
"def update_values\n end",
"def update_values\n end",
"def update\n raise NotImplementedError\n end",
"def update!(**args)\n @answers_header_signals = args[:answers_header_signals] if args.key?(:answers_header_signals)\n @property_value = args[:property_value] if args.key?(:property_value)\n @response_meaning_application = args[:response_meaning_application] if args.key?(:response_meaning_application)\n end",
"def update!(**args)\n @create_time = args[:create_time] if args.key?(:create_time)\n @method_prop = args[:method_prop] if args.key?(:method_prop)\n @name = args[:name] if args.key?(:name)\n @state = args[:state] if args.key?(:state)\n end",
"def update attributes, collection #:nodoc:\n 0\n end",
"def update_property_groups(roll)\n @property_groups.each { |_, v| v.update_rent(roll) }\n end",
"def update!(**args)\n @source_property = args[:source_property] if args.key?(:source_property)\n 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 update_properties(path, properties)\n prop_patch = PropPatch.new(properties)\n emit('propPatch', [path, prop_patch])\n prop_patch.commit\n\n prop_patch.result\n end",
"def update\n set_deltatime\n set_last_update_at\n end"
] | [
"0.7012263",
"0.69181895",
"0.69181895",
"0.69181895",
"0.69181895",
"0.69181895",
"0.67403597",
"0.6709326",
"0.6709326",
"0.6696149",
"0.6696149",
"0.6696149",
"0.6696149",
"0.6618882",
"0.6571848",
"0.65386343",
"0.65178275",
"0.6394807",
"0.6389745",
"0.6389745",
"0.63328",
"0.6319025",
"0.6283673",
"0.6269463",
"0.62639254",
"0.62410724",
"0.62170374",
"0.62152076",
"0.6210263",
"0.6204041",
"0.6204041",
"0.62021106",
"0.62017816",
"0.62017",
"0.61730784",
"0.61730784",
"0.6159277",
"0.6156169",
"0.61445665",
"0.6125433",
"0.61241156",
"0.6121413",
"0.6110477",
"0.6105694",
"0.61016303",
"0.60845226",
"0.6084427",
"0.6065455",
"0.6059506",
"0.6054869",
"0.6051708",
"0.6051708",
"0.60413384",
"0.6030853",
"0.6022535",
"0.6015561",
"0.59932375",
"0.59898263",
"0.5976479",
"0.5973787",
"0.59678394",
"0.5963291",
"0.5962048",
"0.5961157",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.59500545",
"0.59443134",
"0.59443134",
"0.59424853",
"0.59424853",
"0.593523",
"0.5926413",
"0.5924831",
"0.592427",
"0.59233046",
"0.59233046",
"0.5921224",
"0.59144294",
"0.59142506",
"0.58887535",
"0.58854496",
"0.5883008",
"0.58792305",
"0.5876954",
"0.5876954",
"0.58744955",
"0.5857968",
"0.5845542",
"0.5841629",
"0.58363605",
"0.5829255",
"0.582919",
"0.5822138",
"0.58208305"
] | 0.0 | -1 |
Update properties of this object | def update!(**args)
@description = args[:description] if args.key?(:description)
@expression = args[:expression] if args.key?(:expression)
@location = args[:location] if args.key?(:location)
@title = args[:title] if args.key?(:title)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update_properties(hash)\n hash.each do |key, value|\n setter_method = \"#{key}=\"\n if self.respond_to?(setter_method)\n self.send(setter_method, value)\n end\n end\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def refresh\n self.class.base_properties.each_with_index do |prop, prop_id|\n @properties[prop] = get_property(prop_id)\n end\n refresh_features\n refresh_status\n refresh_config\n self\n end",
"def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\n end",
"def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\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 update_properties!(branch_id=nil)\n properties = fetch_properties(false, branch_id)\n length = properties.length\n counter = 0\n properties.each do |property|\n counter += 1\n if Vebra.debugging?\n puts \"[Vebra]: #{counter}/#{length}: live updating property with Vebra ref: #{property.attributes[:vebra_ref]}\"\n end\n live_update!(property)\n Vebra.set_last_updated_at(Time.now) if counter == length\n end\n end",
"def update_self obj\n obj.each do |k,v|\n instance_variable_set(\"@#{k}\", v) if v\n end\n end",
"def update_attributes(properties_hash)\n self.class.get_class_properties.each do |property|\n key = property[:name].to_sym\n if properties_hash.has_key? key\n self.setValue(properties_hash[key], forKey:key)\n end\n end\n end",
"def update\n # TODO: implement update\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @states = args[:states] if args.key?(:states)\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end",
"def update!(**args)\n @property = args[:property] if args.key?(:property)\n @total_value_count = args[:total_value_count] if args.key?(:total_value_count)\n @value = args[:value] if args.key?(:value)\n @value_status = args[:value_status] if args.key?(:value_status)\n end",
"def update\n \n end",
"def refresh\n set_attributes\n end",
"def update(attrs)\n @attrs.update(attrs)\n self\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @source = args[:source] if args.key?(:source)\n end",
"def update_resource object, attributes\n object.update attributes\n end",
"def update(attrs)\n @attrs ||= {}\n @attrs.update(attrs)\n self\n end",
"def update\n \n end",
"def update!(**args)\n @property = args[:property] if args.key?(:property)\n @schema = args[:schema] if args.key?(:schema)\n end",
"def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def _update!\n self.class.properties.each do |property, predicate|\n if dirty?(property)\n self.class.repository_or_fail.delete([subject, predicate[:predicate], nil])\n if self.class.is_list?(property)\n repo = RDF::Repository.new\n attribute_get(property).each do |value|\n repo << RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(value, self.class.properties[property][:type]))\n end\n self.class.repository_or_fail.insert(*repo)\n else\n self.class.repository_or_fail.insert(RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(attribute_get(property), self.class.properties[property][:type])))\n end\n end\n @dirty[property] = nil\n @attributes[:original][property] = attribute_get(property)\n end\n self.class.repository_or_fail.insert(RDF::Statement.new(@subject, RDF.type, type)) unless type.nil?\n end",
"def update(attributes = {})\n super(attributes)\n retrieve!\n self\n end",
"def update\n @objects.map(&:update);\n end",
"def update\n raise NotImplementedError\n end",
"def update\n raise NotImplementedError\n end",
"def live_update!(property)\n property_class = Vebra.models[:property][:class].to_s.camelize.constantize\n\n # ensure we have the full property attributes\n property.get_property if !property.attributes[:status] && property.attributes[:action] != 'deleted'\n\n # find & update or build a new property\n property_model = property_class.find_or_initialize_by_vebra_ref(property.attributes[:vebra_ref])\n\n # make sure property object is not empty\n return false if !property.attributes || !property.attributes[:property_type]\n\n # if the property has been deleted, mark it appropriately and move on\n if property.attributes[:action] == 'deleted'\n return property_model.destroy\n end\n\n # extract accessible attributes for the property\n property_accessibles = property_class.accessible_attributes.map(&:to_sym)\n property_attributes = property.attributes.inject({}) do |result, (key, value)|\n result[key] = value if property_accessibles.include?(key)\n result\n end\n\n # update the property model's attributes\n property_model.no_callbacks = true if property_model.respond_to?(:no_callbacks)\n property_model.update_attributes(property_attributes)\n\n # find & update or build a new address\n if Vebra.models[:address]\n address_class = Vebra.models[:address][:class].to_s.camelize.constantize\n address_model = property_model.send(Vebra.models[:property][:address_method])\n address_model = property_model.send(\"build_#{Vebra.models[:property][:address_method]}\") unless address_model\n\n # extract accessible attributes for the address\n address_accessibles = address_class.accessible_attributes.map(&:to_sym)\n address_attributes = property.attributes[:address].inject({}) do |result, (key, value)|\n result[key] = value if address_accessibles.include?(key)\n result\n end\n\n # update the address model's attributes\n address_model.update_attributes(address_attributes)\n end\n\n # find & update or build new rooms\n if Vebra.models[:room]\n room_class = Vebra.models[:room][:class].to_s.camelize.constantize\n\n # accessible attributes for the rooms\n room_accessibles = room_class.accessible_attributes.map(&:to_sym)\n\n # delete any rooms which are no longer present\n property_rooms = property.attributes[:rooms] || []\n property_model_rooms = property_model.send(Vebra.models[:property][:rooms_method])\n refs_to_delete = property_model_rooms.map(&:vebra_ref) - property_rooms.map { |r| r[:vebra_ref] }\n property_model_rooms.each do |room|\n room.destroy if refs_to_delete.include?(room.vebra_ref)\n end\n\n # find & update or build new rooms\n property_rooms.each do |room|\n room_model = room_class.find_by_property_id_and_vebra_ref(property_model.id, room[:vebra_ref])\n room_model = property_model_rooms.build unless room_model\n\n # extract accessible attributes for the room\n room_attributes = room.inject({}) do |result, (key, value)|\n result[key] = value if room_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n room_model.update_attributes(room_attributes)\n end\n end\n\n # find & update or build new file attachments\n if Vebra.models[:file]\n file_class = Vebra.models[:file][:class].to_s.camelize.constantize\n\n # accessible attributes for the files\n file_accessibles = file_class.accessible_attributes.map(&:to_sym)\n\n # first normalize the collection (currently nested collections)\n property_files = property.attributes[:files].inject([]) do |result, (kind, collection)|\n collection.each do |file|\n file[:type] = kind.to_s.singularize.camelize if file_accessibles.include?(:type)\n file[\"remote_#{Vebra.models[:file][:attachment_method]}_url\".to_sym] = file.delete(:url)\n # if file[:type] is set, it means the attachment file class can be subclassed. In this\n # case we need to ensure that the subclass exists. If not, we ignore this file\n begin\n file[:type].constantize if file_accessibles.include?(:type)\n result << file\n rescue NameError => e\n # ignore - this means the subclass does not exist\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n\n result\n end\n\n # delete any files which are no longer present\n property_model_files = property_model.send(Vebra.models[:property][:files_method])\n refs_to_delete = property_model_files.map(&:vebra_ref) - property_files.map { |f| f[:vebra_ref] }\n property_model_files.each do |file|\n file.destroy if refs_to_delete.include?(file.vebra_ref)\n end\n\n # find & update or build new files\n property_files.each do |file|\n begin\n file_model = property_model_files.find_by_vebra_ref(file[:vebra_ref])\n file_model = property_model_files.build unless file_model\n\n # extract accessible attributes for the file\n file_attributes = file.inject({}) do |result, (key, value)|\n result[key] = value if file_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n file_model.update_attributes(file_attributes)\n rescue CarrierWave::ProcessingError, OpenURI::HTTPError => e\n # just ignore the file\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n end\n\n property_model.no_callbacks = false if property_model.respond_to?(:no_callbacks)\n property_model.save\n return property_model\n end",
"def update!(**args)\n @id = args[:id] if args.key?(:id)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def update\n end",
"def update!(**args)\n @mid = args[:mid] if args.key?(:mid)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def modified_properties=(value)\n @modified_properties = value\n end",
"def apply_properties!(properties)\n # Non-commutitivity etc. eventually.\n end",
"def set_properties(hash)\n hash.each do |key, value|\n add_or_remove_ostruct_member(key, value)\n end\n rest_reset_properties\n end",
"def update\n\t\t\n\t\tend",
"def set_props(props)\n @props.merge!(props)\n end",
"def update() end",
"def update!(**args)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def assign_properties\n self.properties ||= {}\n listing_properties.each do |prop|\n self.properties[prop.key] ||= prop.value\n end\n end",
"def change_properties(new_current_floor, new_next_floor, new_movement)\n @current_floor = new_current_floor\n @next_floor = new_next_floor\n @movement = new_movement\n end",
"def update!(**args)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end",
"def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end",
"def update(attributes)\n (@attributes ||= {}).merge! attributes\n\n (self.class.attr_initializables & attributes.keys).each do |name|\n instance_variable_set :\"@#{name}\", attributes[name]\n end\n\n self\n end",
"def update_attributes(attrs)\n super({})\n end",
"def update\n @dirty = true\n end",
"def update\n\n # Run through the mixin updates\n colourable_update\n movable_update\n\n end",
"def set(props)\n props.each do |prop, val|\n self.send(:\"#{ prop }=\", val)\n end\n end",
"def update\n super\n end",
"def update!(**args)\n @property_id = args[:property_id] if args.key?(:property_id)\n @value_status = args[:value_status] if args.key?(:value_status)\n end",
"def update!(**args)\n @object_size_bytes = args[:object_size_bytes] if args.key?(:object_size_bytes)\n @object_version = args[:object_version] if args.key?(:object_version)\n end",
"def movable_update\n\n # Work through the different aspects we update\n movable_location_update\n movable_size_update\n movable_angle_update\n\n end",
"def properties=(value)\n @properties = value\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(context={})\n self.pre_cast_attributes\n m2o = @relations.reject{|k, v| !self.class.many2one_relations.has_key?(k)}\n vals = @attributes.reject {|key, value| key == 'id'}.merge(m2o.merge(m2o){|k, v| v.is_a?(Array) ? v[0] : v})\n self.class.rpc_execute('write', self.id, vals, context)\n reload_from_record!(self.class.find(self.id, :context => context))\n end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update ; end",
"def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end",
"def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end",
"def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end",
"def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end",
"def update_with(attributes)\n assign_attributes(attributes)\n end",
"def update\n # don't need to update; hash is shared\n end",
"def update(attributes)\n HashProxy.with(attributes) do |proxy|\n self.class.attribute_names.each do |name|\n send(\"#{name}=\", proxy[name]) if proxy.key?(name)\n end\n end\n save\n end",
"def update!(**args)\n @object_id_prop = args[:object_id_prop] if args.key?(:object_id_prop)\n @relation = args[:relation] if args.key?(:relation)\n @subject_id = args[:subject_id] if args.key?(:subject_id)\n end",
"def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end",
"def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end",
"def update\n raise NotImplementedError\n end",
"def update_attributes attributes\n @attributes.merge! attributes\n end",
"def update!(**args)\n @async_options = args[:async_options] if args.key?(:async_options)\n @input_mappings = args[:input_mappings] if args.key?(:input_mappings)\n @name_property = args[:name_property] if args.key?(:name_property)\n @validation_options = args[:validation_options] if args.key?(:validation_options)\n end",
"def update\r\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @type = args[:type] if args.key?(:type)\n end",
"def update\n raise NotImplemented\n end",
"def update_obj\n mean, sd = rating.to_glicko_rating\n @obj.rating = mean\n @obj.rating_deviation = sd\n @obj.volatility = volatility\n end",
"def update_values\n end",
"def update_values\n end",
"def update\n raise NotImplementedError\n end",
"def update!(**args)\n @answers_header_signals = args[:answers_header_signals] if args.key?(:answers_header_signals)\n @property_value = args[:property_value] if args.key?(:property_value)\n @response_meaning_application = args[:response_meaning_application] if args.key?(:response_meaning_application)\n end",
"def update!(**args)\n @create_time = args[:create_time] if args.key?(:create_time)\n @method_prop = args[:method_prop] if args.key?(:method_prop)\n @name = args[:name] if args.key?(:name)\n @state = args[:state] if args.key?(:state)\n end",
"def update attributes, collection #:nodoc:\n 0\n end",
"def update_property_groups(roll)\n @property_groups.each { |_, v| v.update_rent(roll) }\n end",
"def update!(**args)\n @source_property = args[:source_property] if args.key?(:source_property)\n 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 update_properties(path, properties)\n prop_patch = PropPatch.new(properties)\n emit('propPatch', [path, prop_patch])\n prop_patch.commit\n\n prop_patch.result\n end",
"def update\n set_deltatime\n set_last_update_at\n end"
] | [
"0.7012263",
"0.69181895",
"0.69181895",
"0.69181895",
"0.69181895",
"0.69181895",
"0.67403597",
"0.6709326",
"0.6709326",
"0.6696149",
"0.6696149",
"0.6696149",
"0.6696149",
"0.6618882",
"0.6571848",
"0.65386343",
"0.65178275",
"0.6394807",
"0.6389745",
"0.6389745",
"0.63328",
"0.6319025",
"0.6283673",
"0.6269463",
"0.62639254",
"0.62410724",
"0.62170374",
"0.62152076",
"0.6210263",
"0.6204041",
"0.6204041",
"0.62021106",
"0.62017816",
"0.62017",
"0.61730784",
"0.61730784",
"0.6159277",
"0.6156169",
"0.61445665",
"0.6125433",
"0.61241156",
"0.6121413",
"0.6110477",
"0.6105694",
"0.61016303",
"0.60845226",
"0.6084427",
"0.6065455",
"0.6059506",
"0.6054869",
"0.6051708",
"0.6051708",
"0.60413384",
"0.6030853",
"0.6022535",
"0.6015561",
"0.59932375",
"0.59898263",
"0.5976479",
"0.5973787",
"0.59678394",
"0.5963291",
"0.5962048",
"0.5961157",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.59500545",
"0.59443134",
"0.59443134",
"0.59424853",
"0.59424853",
"0.593523",
"0.5926413",
"0.5924831",
"0.592427",
"0.59233046",
"0.59233046",
"0.5921224",
"0.59144294",
"0.59142506",
"0.58887535",
"0.58854496",
"0.5883008",
"0.58792305",
"0.5876954",
"0.5876954",
"0.58744955",
"0.5857968",
"0.5845542",
"0.5841629",
"0.58363605",
"0.5829255",
"0.582919",
"0.5822138",
"0.58208305"
] | 0.0 | -1 |
Update properties of this object | def update!(**args)
@associated_networks = args[:associated_networks] if args.key?(:associated_networks)
@create_time = args[:create_time] if args.key?(:create_time)
@labels = args[:labels] if args.key?(:labels)
@name = args[:name] if args.key?(:name)
@reconciling = args[:reconciling] if args.key?(:reconciling)
@state = args[:state] if args.key?(:state)
@update_time = args[:update_time] if args.key?(:update_time)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update_properties(hash)\n hash.each do |key, value|\n setter_method = \"#{key}=\"\n if self.respond_to?(setter_method)\n self.send(setter_method, value)\n end\n end\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def refresh\n self.class.base_properties.each_with_index do |prop, prop_id|\n @properties[prop] = get_property(prop_id)\n end\n refresh_features\n refresh_status\n refresh_config\n self\n end",
"def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\n end",
"def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\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 update_properties!(branch_id=nil)\n properties = fetch_properties(false, branch_id)\n length = properties.length\n counter = 0\n properties.each do |property|\n counter += 1\n if Vebra.debugging?\n puts \"[Vebra]: #{counter}/#{length}: live updating property with Vebra ref: #{property.attributes[:vebra_ref]}\"\n end\n live_update!(property)\n Vebra.set_last_updated_at(Time.now) if counter == length\n end\n end",
"def update_self obj\n obj.each do |k,v|\n instance_variable_set(\"@#{k}\", v) if v\n end\n end",
"def update_attributes(properties_hash)\n self.class.get_class_properties.each do |property|\n key = property[:name].to_sym\n if properties_hash.has_key? key\n self.setValue(properties_hash[key], forKey:key)\n end\n end\n end",
"def update\n # TODO: implement update\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @states = args[:states] if args.key?(:states)\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end",
"def update!(**args)\n @property = args[:property] if args.key?(:property)\n @total_value_count = args[:total_value_count] if args.key?(:total_value_count)\n @value = args[:value] if args.key?(:value)\n @value_status = args[:value_status] if args.key?(:value_status)\n end",
"def update\n \n end",
"def refresh\n set_attributes\n end",
"def update(attrs)\n @attrs.update(attrs)\n self\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @source = args[:source] if args.key?(:source)\n end",
"def update_resource object, attributes\n object.update attributes\n end",
"def update(attrs)\n @attrs ||= {}\n @attrs.update(attrs)\n self\n end",
"def update\n \n end",
"def update!(**args)\n @property = args[:property] if args.key?(:property)\n @schema = args[:schema] if args.key?(:schema)\n end",
"def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def _update!\n self.class.properties.each do |property, predicate|\n if dirty?(property)\n self.class.repository_or_fail.delete([subject, predicate[:predicate], nil])\n if self.class.is_list?(property)\n repo = RDF::Repository.new\n attribute_get(property).each do |value|\n repo << RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(value, self.class.properties[property][:type]))\n end\n self.class.repository_or_fail.insert(*repo)\n else\n self.class.repository_or_fail.insert(RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(attribute_get(property), self.class.properties[property][:type])))\n end\n end\n @dirty[property] = nil\n @attributes[:original][property] = attribute_get(property)\n end\n self.class.repository_or_fail.insert(RDF::Statement.new(@subject, RDF.type, type)) unless type.nil?\n end",
"def update(attributes = {})\n super(attributes)\n retrieve!\n self\n end",
"def update\n @objects.map(&:update);\n end",
"def update\n raise NotImplementedError\n end",
"def update\n raise NotImplementedError\n end",
"def live_update!(property)\n property_class = Vebra.models[:property][:class].to_s.camelize.constantize\n\n # ensure we have the full property attributes\n property.get_property if !property.attributes[:status] && property.attributes[:action] != 'deleted'\n\n # find & update or build a new property\n property_model = property_class.find_or_initialize_by_vebra_ref(property.attributes[:vebra_ref])\n\n # make sure property object is not empty\n return false if !property.attributes || !property.attributes[:property_type]\n\n # if the property has been deleted, mark it appropriately and move on\n if property.attributes[:action] == 'deleted'\n return property_model.destroy\n end\n\n # extract accessible attributes for the property\n property_accessibles = property_class.accessible_attributes.map(&:to_sym)\n property_attributes = property.attributes.inject({}) do |result, (key, value)|\n result[key] = value if property_accessibles.include?(key)\n result\n end\n\n # update the property model's attributes\n property_model.no_callbacks = true if property_model.respond_to?(:no_callbacks)\n property_model.update_attributes(property_attributes)\n\n # find & update or build a new address\n if Vebra.models[:address]\n address_class = Vebra.models[:address][:class].to_s.camelize.constantize\n address_model = property_model.send(Vebra.models[:property][:address_method])\n address_model = property_model.send(\"build_#{Vebra.models[:property][:address_method]}\") unless address_model\n\n # extract accessible attributes for the address\n address_accessibles = address_class.accessible_attributes.map(&:to_sym)\n address_attributes = property.attributes[:address].inject({}) do |result, (key, value)|\n result[key] = value if address_accessibles.include?(key)\n result\n end\n\n # update the address model's attributes\n address_model.update_attributes(address_attributes)\n end\n\n # find & update or build new rooms\n if Vebra.models[:room]\n room_class = Vebra.models[:room][:class].to_s.camelize.constantize\n\n # accessible attributes for the rooms\n room_accessibles = room_class.accessible_attributes.map(&:to_sym)\n\n # delete any rooms which are no longer present\n property_rooms = property.attributes[:rooms] || []\n property_model_rooms = property_model.send(Vebra.models[:property][:rooms_method])\n refs_to_delete = property_model_rooms.map(&:vebra_ref) - property_rooms.map { |r| r[:vebra_ref] }\n property_model_rooms.each do |room|\n room.destroy if refs_to_delete.include?(room.vebra_ref)\n end\n\n # find & update or build new rooms\n property_rooms.each do |room|\n room_model = room_class.find_by_property_id_and_vebra_ref(property_model.id, room[:vebra_ref])\n room_model = property_model_rooms.build unless room_model\n\n # extract accessible attributes for the room\n room_attributes = room.inject({}) do |result, (key, value)|\n result[key] = value if room_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n room_model.update_attributes(room_attributes)\n end\n end\n\n # find & update or build new file attachments\n if Vebra.models[:file]\n file_class = Vebra.models[:file][:class].to_s.camelize.constantize\n\n # accessible attributes for the files\n file_accessibles = file_class.accessible_attributes.map(&:to_sym)\n\n # first normalize the collection (currently nested collections)\n property_files = property.attributes[:files].inject([]) do |result, (kind, collection)|\n collection.each do |file|\n file[:type] = kind.to_s.singularize.camelize if file_accessibles.include?(:type)\n file[\"remote_#{Vebra.models[:file][:attachment_method]}_url\".to_sym] = file.delete(:url)\n # if file[:type] is set, it means the attachment file class can be subclassed. In this\n # case we need to ensure that the subclass exists. If not, we ignore this file\n begin\n file[:type].constantize if file_accessibles.include?(:type)\n result << file\n rescue NameError => e\n # ignore - this means the subclass does not exist\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n\n result\n end\n\n # delete any files which are no longer present\n property_model_files = property_model.send(Vebra.models[:property][:files_method])\n refs_to_delete = property_model_files.map(&:vebra_ref) - property_files.map { |f| f[:vebra_ref] }\n property_model_files.each do |file|\n file.destroy if refs_to_delete.include?(file.vebra_ref)\n end\n\n # find & update or build new files\n property_files.each do |file|\n begin\n file_model = property_model_files.find_by_vebra_ref(file[:vebra_ref])\n file_model = property_model_files.build unless file_model\n\n # extract accessible attributes for the file\n file_attributes = file.inject({}) do |result, (key, value)|\n result[key] = value if file_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n file_model.update_attributes(file_attributes)\n rescue CarrierWave::ProcessingError, OpenURI::HTTPError => e\n # just ignore the file\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n end\n\n property_model.no_callbacks = false if property_model.respond_to?(:no_callbacks)\n property_model.save\n return property_model\n end",
"def update!(**args)\n @id = args[:id] if args.key?(:id)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def update\n end",
"def update!(**args)\n @mid = args[:mid] if args.key?(:mid)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def modified_properties=(value)\n @modified_properties = value\n end",
"def apply_properties!(properties)\n # Non-commutitivity etc. eventually.\n end",
"def set_properties(hash)\n hash.each do |key, value|\n add_or_remove_ostruct_member(key, value)\n end\n rest_reset_properties\n end",
"def update\n\t\t\n\t\tend",
"def set_props(props)\n @props.merge!(props)\n end",
"def update() end",
"def update!(**args)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def assign_properties\n self.properties ||= {}\n listing_properties.each do |prop|\n self.properties[prop.key] ||= prop.value\n end\n end",
"def change_properties(new_current_floor, new_next_floor, new_movement)\n @current_floor = new_current_floor\n @next_floor = new_next_floor\n @movement = new_movement\n end",
"def update!(**args)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end",
"def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end",
"def update(attributes)\n (@attributes ||= {}).merge! attributes\n\n (self.class.attr_initializables & attributes.keys).each do |name|\n instance_variable_set :\"@#{name}\", attributes[name]\n end\n\n self\n end",
"def update_attributes(attrs)\n super({})\n end",
"def update\n @dirty = true\n end",
"def update\n\n # Run through the mixin updates\n colourable_update\n movable_update\n\n end",
"def set(props)\n props.each do |prop, val|\n self.send(:\"#{ prop }=\", val)\n end\n end",
"def update\n super\n end",
"def update!(**args)\n @property_id = args[:property_id] if args.key?(:property_id)\n @value_status = args[:value_status] if args.key?(:value_status)\n end",
"def update!(**args)\n @object_size_bytes = args[:object_size_bytes] if args.key?(:object_size_bytes)\n @object_version = args[:object_version] if args.key?(:object_version)\n end",
"def movable_update\n\n # Work through the different aspects we update\n movable_location_update\n movable_size_update\n movable_angle_update\n\n end",
"def properties=(value)\n @properties = value\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(context={})\n self.pre_cast_attributes\n m2o = @relations.reject{|k, v| !self.class.many2one_relations.has_key?(k)}\n vals = @attributes.reject {|key, value| key == 'id'}.merge(m2o.merge(m2o){|k, v| v.is_a?(Array) ? v[0] : v})\n self.class.rpc_execute('write', self.id, vals, context)\n reload_from_record!(self.class.find(self.id, :context => context))\n end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update ; end",
"def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end",
"def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end",
"def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end",
"def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end",
"def update_with(attributes)\n assign_attributes(attributes)\n end",
"def update\n # don't need to update; hash is shared\n end",
"def update(attributes)\n HashProxy.with(attributes) do |proxy|\n self.class.attribute_names.each do |name|\n send(\"#{name}=\", proxy[name]) if proxy.key?(name)\n end\n end\n save\n end",
"def update!(**args)\n @object_id_prop = args[:object_id_prop] if args.key?(:object_id_prop)\n @relation = args[:relation] if args.key?(:relation)\n @subject_id = args[:subject_id] if args.key?(:subject_id)\n end",
"def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end",
"def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end",
"def update\n raise NotImplementedError\n end",
"def update_attributes attributes\n @attributes.merge! attributes\n end",
"def update!(**args)\n @async_options = args[:async_options] if args.key?(:async_options)\n @input_mappings = args[:input_mappings] if args.key?(:input_mappings)\n @name_property = args[:name_property] if args.key?(:name_property)\n @validation_options = args[:validation_options] if args.key?(:validation_options)\n end",
"def update\r\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @type = args[:type] if args.key?(:type)\n end",
"def update\n raise NotImplemented\n end",
"def update_obj\n mean, sd = rating.to_glicko_rating\n @obj.rating = mean\n @obj.rating_deviation = sd\n @obj.volatility = volatility\n end",
"def update_values\n end",
"def update_values\n end",
"def update\n raise NotImplementedError\n end",
"def update!(**args)\n @answers_header_signals = args[:answers_header_signals] if args.key?(:answers_header_signals)\n @property_value = args[:property_value] if args.key?(:property_value)\n @response_meaning_application = args[:response_meaning_application] if args.key?(:response_meaning_application)\n end",
"def update!(**args)\n @create_time = args[:create_time] if args.key?(:create_time)\n @method_prop = args[:method_prop] if args.key?(:method_prop)\n @name = args[:name] if args.key?(:name)\n @state = args[:state] if args.key?(:state)\n end",
"def update attributes, collection #:nodoc:\n 0\n end",
"def update_property_groups(roll)\n @property_groups.each { |_, v| v.update_rent(roll) }\n end",
"def update!(**args)\n @source_property = args[:source_property] if args.key?(:source_property)\n 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 update_properties(path, properties)\n prop_patch = PropPatch.new(properties)\n emit('propPatch', [path, prop_patch])\n prop_patch.commit\n\n prop_patch.result\n end",
"def update\n set_deltatime\n set_last_update_at\n end"
] | [
"0.7012263",
"0.69181895",
"0.69181895",
"0.69181895",
"0.69181895",
"0.69181895",
"0.67403597",
"0.6709326",
"0.6709326",
"0.6696149",
"0.6696149",
"0.6696149",
"0.6696149",
"0.6618882",
"0.6571848",
"0.65386343",
"0.65178275",
"0.6394807",
"0.6389745",
"0.6389745",
"0.63328",
"0.6319025",
"0.6283673",
"0.6269463",
"0.62639254",
"0.62410724",
"0.62170374",
"0.62152076",
"0.6210263",
"0.6204041",
"0.6204041",
"0.62021106",
"0.62017816",
"0.62017",
"0.61730784",
"0.61730784",
"0.6159277",
"0.6156169",
"0.61445665",
"0.6125433",
"0.61241156",
"0.6121413",
"0.6110477",
"0.6105694",
"0.61016303",
"0.60845226",
"0.6084427",
"0.6065455",
"0.6059506",
"0.6054869",
"0.6051708",
"0.6051708",
"0.60413384",
"0.6030853",
"0.6022535",
"0.6015561",
"0.59932375",
"0.59898263",
"0.5976479",
"0.5973787",
"0.59678394",
"0.5963291",
"0.5962048",
"0.5961157",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.59500545",
"0.59443134",
"0.59443134",
"0.59424853",
"0.59424853",
"0.593523",
"0.5926413",
"0.5924831",
"0.592427",
"0.59233046",
"0.59233046",
"0.5921224",
"0.59144294",
"0.59142506",
"0.58887535",
"0.58854496",
"0.5883008",
"0.58792305",
"0.5876954",
"0.5876954",
"0.58744955",
"0.5857968",
"0.5845542",
"0.5841629",
"0.58363605",
"0.5829255",
"0.582919",
"0.5822138",
"0.58208305"
] | 0.0 | -1 |
Update properties of this object | def update!(**args)
@create_time = args[:create_time] if args.key?(:create_time)
@firewall_endpoint = args[:firewall_endpoint] if args.key?(:firewall_endpoint)
@labels = args[:labels] if args.key?(:labels)
@name = args[:name] if args.key?(:name)
@network = args[:network] if args.key?(:network)
@reconciling = args[:reconciling] if args.key?(:reconciling)
@state = args[:state] if args.key?(:state)
@tls_inspection_policy = args[:tls_inspection_policy] if args.key?(:tls_inspection_policy)
@update_time = args[:update_time] if args.key?(:update_time)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update_properties(hash)\n hash.each do |key, value|\n setter_method = \"#{key}=\"\n if self.respond_to?(setter_method)\n self.send(setter_method, value)\n end\n end\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def refresh\n self.class.base_properties.each_with_index do |prop, prop_id|\n @properties[prop] = get_property(prop_id)\n end\n refresh_features\n refresh_status\n refresh_config\n self\n end",
"def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\n end",
"def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\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 update_properties!(branch_id=nil)\n properties = fetch_properties(false, branch_id)\n length = properties.length\n counter = 0\n properties.each do |property|\n counter += 1\n if Vebra.debugging?\n puts \"[Vebra]: #{counter}/#{length}: live updating property with Vebra ref: #{property.attributes[:vebra_ref]}\"\n end\n live_update!(property)\n Vebra.set_last_updated_at(Time.now) if counter == length\n end\n end",
"def update_self obj\n obj.each do |k,v|\n instance_variable_set(\"@#{k}\", v) if v\n end\n end",
"def update_attributes(properties_hash)\n self.class.get_class_properties.each do |property|\n key = property[:name].to_sym\n if properties_hash.has_key? key\n self.setValue(properties_hash[key], forKey:key)\n end\n end\n end",
"def update\n # TODO: implement update\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @states = args[:states] if args.key?(:states)\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end",
"def update!(**args)\n @property = args[:property] if args.key?(:property)\n @total_value_count = args[:total_value_count] if args.key?(:total_value_count)\n @value = args[:value] if args.key?(:value)\n @value_status = args[:value_status] if args.key?(:value_status)\n end",
"def update\n \n end",
"def refresh\n set_attributes\n end",
"def update(attrs)\n @attrs.update(attrs)\n self\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @source = args[:source] if args.key?(:source)\n end",
"def update_resource object, attributes\n object.update attributes\n end",
"def update(attrs)\n @attrs ||= {}\n @attrs.update(attrs)\n self\n end",
"def update\n \n end",
"def update!(**args)\n @property = args[:property] if args.key?(:property)\n @schema = args[:schema] if args.key?(:schema)\n end",
"def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def update(attributes = {})\n super(attributes)\n retrieve!\n self\n end",
"def _update!\n self.class.properties.each do |property, predicate|\n if dirty?(property)\n self.class.repository_or_fail.delete([subject, predicate[:predicate], nil])\n if self.class.is_list?(property)\n repo = RDF::Repository.new\n attribute_get(property).each do |value|\n repo << RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(value, self.class.properties[property][:type]))\n end\n self.class.repository_or_fail.insert(*repo)\n else\n self.class.repository_or_fail.insert(RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(attribute_get(property), self.class.properties[property][:type])))\n end\n end\n @dirty[property] = nil\n @attributes[:original][property] = attribute_get(property)\n end\n self.class.repository_or_fail.insert(RDF::Statement.new(@subject, RDF.type, type)) unless type.nil?\n end",
"def update\n @objects.map(&:update);\n end",
"def update\n raise NotImplementedError\n end",
"def update\n raise NotImplementedError\n end",
"def live_update!(property)\n property_class = Vebra.models[:property][:class].to_s.camelize.constantize\n\n # ensure we have the full property attributes\n property.get_property if !property.attributes[:status] && property.attributes[:action] != 'deleted'\n\n # find & update or build a new property\n property_model = property_class.find_or_initialize_by_vebra_ref(property.attributes[:vebra_ref])\n\n # make sure property object is not empty\n return false if !property.attributes || !property.attributes[:property_type]\n\n # if the property has been deleted, mark it appropriately and move on\n if property.attributes[:action] == 'deleted'\n return property_model.destroy\n end\n\n # extract accessible attributes for the property\n property_accessibles = property_class.accessible_attributes.map(&:to_sym)\n property_attributes = property.attributes.inject({}) do |result, (key, value)|\n result[key] = value if property_accessibles.include?(key)\n result\n end\n\n # update the property model's attributes\n property_model.no_callbacks = true if property_model.respond_to?(:no_callbacks)\n property_model.update_attributes(property_attributes)\n\n # find & update or build a new address\n if Vebra.models[:address]\n address_class = Vebra.models[:address][:class].to_s.camelize.constantize\n address_model = property_model.send(Vebra.models[:property][:address_method])\n address_model = property_model.send(\"build_#{Vebra.models[:property][:address_method]}\") unless address_model\n\n # extract accessible attributes for the address\n address_accessibles = address_class.accessible_attributes.map(&:to_sym)\n address_attributes = property.attributes[:address].inject({}) do |result, (key, value)|\n result[key] = value if address_accessibles.include?(key)\n result\n end\n\n # update the address model's attributes\n address_model.update_attributes(address_attributes)\n end\n\n # find & update or build new rooms\n if Vebra.models[:room]\n room_class = Vebra.models[:room][:class].to_s.camelize.constantize\n\n # accessible attributes for the rooms\n room_accessibles = room_class.accessible_attributes.map(&:to_sym)\n\n # delete any rooms which are no longer present\n property_rooms = property.attributes[:rooms] || []\n property_model_rooms = property_model.send(Vebra.models[:property][:rooms_method])\n refs_to_delete = property_model_rooms.map(&:vebra_ref) - property_rooms.map { |r| r[:vebra_ref] }\n property_model_rooms.each do |room|\n room.destroy if refs_to_delete.include?(room.vebra_ref)\n end\n\n # find & update or build new rooms\n property_rooms.each do |room|\n room_model = room_class.find_by_property_id_and_vebra_ref(property_model.id, room[:vebra_ref])\n room_model = property_model_rooms.build unless room_model\n\n # extract accessible attributes for the room\n room_attributes = room.inject({}) do |result, (key, value)|\n result[key] = value if room_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n room_model.update_attributes(room_attributes)\n end\n end\n\n # find & update or build new file attachments\n if Vebra.models[:file]\n file_class = Vebra.models[:file][:class].to_s.camelize.constantize\n\n # accessible attributes for the files\n file_accessibles = file_class.accessible_attributes.map(&:to_sym)\n\n # first normalize the collection (currently nested collections)\n property_files = property.attributes[:files].inject([]) do |result, (kind, collection)|\n collection.each do |file|\n file[:type] = kind.to_s.singularize.camelize if file_accessibles.include?(:type)\n file[\"remote_#{Vebra.models[:file][:attachment_method]}_url\".to_sym] = file.delete(:url)\n # if file[:type] is set, it means the attachment file class can be subclassed. In this\n # case we need to ensure that the subclass exists. If not, we ignore this file\n begin\n file[:type].constantize if file_accessibles.include?(:type)\n result << file\n rescue NameError => e\n # ignore - this means the subclass does not exist\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n\n result\n end\n\n # delete any files which are no longer present\n property_model_files = property_model.send(Vebra.models[:property][:files_method])\n refs_to_delete = property_model_files.map(&:vebra_ref) - property_files.map { |f| f[:vebra_ref] }\n property_model_files.each do |file|\n file.destroy if refs_to_delete.include?(file.vebra_ref)\n end\n\n # find & update or build new files\n property_files.each do |file|\n begin\n file_model = property_model_files.find_by_vebra_ref(file[:vebra_ref])\n file_model = property_model_files.build unless file_model\n\n # extract accessible attributes for the file\n file_attributes = file.inject({}) do |result, (key, value)|\n result[key] = value if file_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n file_model.update_attributes(file_attributes)\n rescue CarrierWave::ProcessingError, OpenURI::HTTPError => e\n # just ignore the file\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n end\n\n property_model.no_callbacks = false if property_model.respond_to?(:no_callbacks)\n property_model.save\n return property_model\n end",
"def update!(**args)\n @id = args[:id] if args.key?(:id)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def update\n end",
"def update!(**args)\n @mid = args[:mid] if args.key?(:mid)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def modified_properties=(value)\n @modified_properties = value\n end",
"def apply_properties!(properties)\n # Non-commutitivity etc. eventually.\n end",
"def set_properties(hash)\n hash.each do |key, value|\n add_or_remove_ostruct_member(key, value)\n end\n rest_reset_properties\n end",
"def update\n\t\t\n\t\tend",
"def set_props(props)\n @props.merge!(props)\n end",
"def update() end",
"def update!(**args)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def assign_properties\n self.properties ||= {}\n listing_properties.each do |prop|\n self.properties[prop.key] ||= prop.value\n end\n end",
"def change_properties(new_current_floor, new_next_floor, new_movement)\n @current_floor = new_current_floor\n @next_floor = new_next_floor\n @movement = new_movement\n end",
"def update!(**args)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end",
"def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end",
"def update(attributes)\n (@attributes ||= {}).merge! attributes\n\n (self.class.attr_initializables & attributes.keys).each do |name|\n instance_variable_set :\"@#{name}\", attributes[name]\n end\n\n self\n end",
"def update_attributes(attrs)\n super({})\n end",
"def update\n @dirty = true\n end",
"def update\n\n # Run through the mixin updates\n colourable_update\n movable_update\n\n end",
"def set(props)\n props.each do |prop, val|\n self.send(:\"#{ prop }=\", val)\n end\n end",
"def update\n super\n end",
"def update!(**args)\n @property_id = args[:property_id] if args.key?(:property_id)\n @value_status = args[:value_status] if args.key?(:value_status)\n end",
"def update!(**args)\n @object_size_bytes = args[:object_size_bytes] if args.key?(:object_size_bytes)\n @object_version = args[:object_version] if args.key?(:object_version)\n end",
"def movable_update\n\n # Work through the different aspects we update\n movable_location_update\n movable_size_update\n movable_angle_update\n\n end",
"def properties=(value)\n @properties = value\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(context={})\n self.pre_cast_attributes\n m2o = @relations.reject{|k, v| !self.class.many2one_relations.has_key?(k)}\n vals = @attributes.reject {|key, value| key == 'id'}.merge(m2o.merge(m2o){|k, v| v.is_a?(Array) ? v[0] : v})\n self.class.rpc_execute('write', self.id, vals, context)\n reload_from_record!(self.class.find(self.id, :context => context))\n end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update ; end",
"def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end",
"def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end",
"def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end",
"def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end",
"def update_with(attributes)\n assign_attributes(attributes)\n end",
"def update\n # don't need to update; hash is shared\n end",
"def update(attributes)\n HashProxy.with(attributes) do |proxy|\n self.class.attribute_names.each do |name|\n send(\"#{name}=\", proxy[name]) if proxy.key?(name)\n end\n end\n save\n end",
"def update!(**args)\n @object_id_prop = args[:object_id_prop] if args.key?(:object_id_prop)\n @relation = args[:relation] if args.key?(:relation)\n @subject_id = args[:subject_id] if args.key?(:subject_id)\n end",
"def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end",
"def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end",
"def update\n raise NotImplementedError\n end",
"def update_attributes attributes\n @attributes.merge! attributes\n end",
"def update!(**args)\n @async_options = args[:async_options] if args.key?(:async_options)\n @input_mappings = args[:input_mappings] if args.key?(:input_mappings)\n @name_property = args[:name_property] if args.key?(:name_property)\n @validation_options = args[:validation_options] if args.key?(:validation_options)\n end",
"def update\r\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @type = args[:type] if args.key?(:type)\n end",
"def update\n raise NotImplemented\n end",
"def update_obj\n mean, sd = rating.to_glicko_rating\n @obj.rating = mean\n @obj.rating_deviation = sd\n @obj.volatility = volatility\n end",
"def update_values\n end",
"def update_values\n end",
"def update\n raise NotImplementedError\n end",
"def update!(**args)\n @answers_header_signals = args[:answers_header_signals] if args.key?(:answers_header_signals)\n @property_value = args[:property_value] if args.key?(:property_value)\n @response_meaning_application = args[:response_meaning_application] if args.key?(:response_meaning_application)\n end",
"def update!(**args)\n @create_time = args[:create_time] if args.key?(:create_time)\n @method_prop = args[:method_prop] if args.key?(:method_prop)\n @name = args[:name] if args.key?(:name)\n @state = args[:state] if args.key?(:state)\n end",
"def update attributes, collection #:nodoc:\n 0\n end",
"def update_property_groups(roll)\n @property_groups.each { |_, v| v.update_rent(roll) }\n 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 update!(**args)\n @source_property = args[:source_property] if args.key?(:source_property)\n end",
"def update_properties(path, properties)\n prop_patch = PropPatch.new(properties)\n emit('propPatch', [path, prop_patch])\n prop_patch.commit\n\n prop_patch.result\n end",
"def update\n set_deltatime\n set_last_update_at\n end"
] | [
"0.7012568",
"0.6918917",
"0.6918917",
"0.6918917",
"0.6918917",
"0.6918917",
"0.67404634",
"0.6709981",
"0.6709981",
"0.66964126",
"0.66964126",
"0.66964126",
"0.66964126",
"0.6619218",
"0.6570895",
"0.6539287",
"0.6517026",
"0.63946927",
"0.63901657",
"0.63901657",
"0.63328683",
"0.6318612",
"0.62846893",
"0.62692374",
"0.6264273",
"0.6241163",
"0.6216599",
"0.6214641",
"0.6210363",
"0.6203827",
"0.6203827",
"0.620312",
"0.6201905",
"0.62001497",
"0.61728275",
"0.61728275",
"0.6159924",
"0.61569315",
"0.61442953",
"0.61260897",
"0.6125199",
"0.61227936",
"0.61111224",
"0.610543",
"0.6102925",
"0.60839343",
"0.6083609",
"0.6066973",
"0.60602766",
"0.6055065",
"0.6051568",
"0.6051568",
"0.6042057",
"0.60319084",
"0.60221004",
"0.60149413",
"0.5994295",
"0.5989816",
"0.597674",
"0.5973157",
"0.5967343",
"0.5965598",
"0.59629464",
"0.59618354",
"0.5950329",
"0.5950329",
"0.5950329",
"0.5950329",
"0.5950329",
"0.5950329",
"0.5950329",
"0.5950329",
"0.59495455",
"0.59442014",
"0.59442014",
"0.5944142",
"0.5944142",
"0.59361076",
"0.5925741",
"0.5925574",
"0.59250593",
"0.5924476",
"0.5924476",
"0.5921039",
"0.59155524",
"0.59145254",
"0.5888445",
"0.58860934",
"0.5882302",
"0.5879913",
"0.5877467",
"0.5877467",
"0.58743787",
"0.585829",
"0.584583",
"0.58408254",
"0.5835501",
"0.5829063",
"0.5828611",
"0.58228916",
"0.5819882"
] | 0.0 | -1 |
Update properties of this object | def update!(**args)
@create_time = args[:create_time] if args.key?(:create_time)
@description = args[:description] if args.key?(:description)
@name = args[:name] if args.key?(:name)
@tls_inspection_policy = args[:tls_inspection_policy] if args.key?(:tls_inspection_policy)
@update_time = args[:update_time] if args.key?(:update_time)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update_properties(hash)\n hash.each do |key, value|\n setter_method = \"#{key}=\"\n if self.respond_to?(setter_method)\n self.send(setter_method, value)\n end\n end\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def refresh\n self.class.base_properties.each_with_index do |prop, prop_id|\n @properties[prop] = get_property(prop_id)\n end\n refresh_features\n refresh_status\n refresh_config\n self\n end",
"def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\n end",
"def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\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 update_properties!(branch_id=nil)\n properties = fetch_properties(false, branch_id)\n length = properties.length\n counter = 0\n properties.each do |property|\n counter += 1\n if Vebra.debugging?\n puts \"[Vebra]: #{counter}/#{length}: live updating property with Vebra ref: #{property.attributes[:vebra_ref]}\"\n end\n live_update!(property)\n Vebra.set_last_updated_at(Time.now) if counter == length\n end\n end",
"def update_self obj\n obj.each do |k,v|\n instance_variable_set(\"@#{k}\", v) if v\n end\n end",
"def update_attributes(properties_hash)\n self.class.get_class_properties.each do |property|\n key = property[:name].to_sym\n if properties_hash.has_key? key\n self.setValue(properties_hash[key], forKey:key)\n end\n end\n end",
"def update\n # TODO: implement update\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @states = args[:states] if args.key?(:states)\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end",
"def update!(**args)\n @property = args[:property] if args.key?(:property)\n @total_value_count = args[:total_value_count] if args.key?(:total_value_count)\n @value = args[:value] if args.key?(:value)\n @value_status = args[:value_status] if args.key?(:value_status)\n end",
"def update\n \n end",
"def refresh\n set_attributes\n end",
"def update(attrs)\n @attrs.update(attrs)\n self\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @source = args[:source] if args.key?(:source)\n end",
"def update_resource object, attributes\n object.update attributes\n end",
"def update(attrs)\n @attrs ||= {}\n @attrs.update(attrs)\n self\n end",
"def update\n \n end",
"def update!(**args)\n @property = args[:property] if args.key?(:property)\n @schema = args[:schema] if args.key?(:schema)\n end",
"def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def _update!\n self.class.properties.each do |property, predicate|\n if dirty?(property)\n self.class.repository_or_fail.delete([subject, predicate[:predicate], nil])\n if self.class.is_list?(property)\n repo = RDF::Repository.new\n attribute_get(property).each do |value|\n repo << RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(value, self.class.properties[property][:type]))\n end\n self.class.repository_or_fail.insert(*repo)\n else\n self.class.repository_or_fail.insert(RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(attribute_get(property), self.class.properties[property][:type])))\n end\n end\n @dirty[property] = nil\n @attributes[:original][property] = attribute_get(property)\n end\n self.class.repository_or_fail.insert(RDF::Statement.new(@subject, RDF.type, type)) unless type.nil?\n end",
"def update(attributes = {})\n super(attributes)\n retrieve!\n self\n end",
"def update\n @objects.map(&:update);\n end",
"def update\n raise NotImplementedError\n end",
"def update\n raise NotImplementedError\n end",
"def live_update!(property)\n property_class = Vebra.models[:property][:class].to_s.camelize.constantize\n\n # ensure we have the full property attributes\n property.get_property if !property.attributes[:status] && property.attributes[:action] != 'deleted'\n\n # find & update or build a new property\n property_model = property_class.find_or_initialize_by_vebra_ref(property.attributes[:vebra_ref])\n\n # make sure property object is not empty\n return false if !property.attributes || !property.attributes[:property_type]\n\n # if the property has been deleted, mark it appropriately and move on\n if property.attributes[:action] == 'deleted'\n return property_model.destroy\n end\n\n # extract accessible attributes for the property\n property_accessibles = property_class.accessible_attributes.map(&:to_sym)\n property_attributes = property.attributes.inject({}) do |result, (key, value)|\n result[key] = value if property_accessibles.include?(key)\n result\n end\n\n # update the property model's attributes\n property_model.no_callbacks = true if property_model.respond_to?(:no_callbacks)\n property_model.update_attributes(property_attributes)\n\n # find & update or build a new address\n if Vebra.models[:address]\n address_class = Vebra.models[:address][:class].to_s.camelize.constantize\n address_model = property_model.send(Vebra.models[:property][:address_method])\n address_model = property_model.send(\"build_#{Vebra.models[:property][:address_method]}\") unless address_model\n\n # extract accessible attributes for the address\n address_accessibles = address_class.accessible_attributes.map(&:to_sym)\n address_attributes = property.attributes[:address].inject({}) do |result, (key, value)|\n result[key] = value if address_accessibles.include?(key)\n result\n end\n\n # update the address model's attributes\n address_model.update_attributes(address_attributes)\n end\n\n # find & update or build new rooms\n if Vebra.models[:room]\n room_class = Vebra.models[:room][:class].to_s.camelize.constantize\n\n # accessible attributes for the rooms\n room_accessibles = room_class.accessible_attributes.map(&:to_sym)\n\n # delete any rooms which are no longer present\n property_rooms = property.attributes[:rooms] || []\n property_model_rooms = property_model.send(Vebra.models[:property][:rooms_method])\n refs_to_delete = property_model_rooms.map(&:vebra_ref) - property_rooms.map { |r| r[:vebra_ref] }\n property_model_rooms.each do |room|\n room.destroy if refs_to_delete.include?(room.vebra_ref)\n end\n\n # find & update or build new rooms\n property_rooms.each do |room|\n room_model = room_class.find_by_property_id_and_vebra_ref(property_model.id, room[:vebra_ref])\n room_model = property_model_rooms.build unless room_model\n\n # extract accessible attributes for the room\n room_attributes = room.inject({}) do |result, (key, value)|\n result[key] = value if room_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n room_model.update_attributes(room_attributes)\n end\n end\n\n # find & update or build new file attachments\n if Vebra.models[:file]\n file_class = Vebra.models[:file][:class].to_s.camelize.constantize\n\n # accessible attributes for the files\n file_accessibles = file_class.accessible_attributes.map(&:to_sym)\n\n # first normalize the collection (currently nested collections)\n property_files = property.attributes[:files].inject([]) do |result, (kind, collection)|\n collection.each do |file|\n file[:type] = kind.to_s.singularize.camelize if file_accessibles.include?(:type)\n file[\"remote_#{Vebra.models[:file][:attachment_method]}_url\".to_sym] = file.delete(:url)\n # if file[:type] is set, it means the attachment file class can be subclassed. In this\n # case we need to ensure that the subclass exists. If not, we ignore this file\n begin\n file[:type].constantize if file_accessibles.include?(:type)\n result << file\n rescue NameError => e\n # ignore - this means the subclass does not exist\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n\n result\n end\n\n # delete any files which are no longer present\n property_model_files = property_model.send(Vebra.models[:property][:files_method])\n refs_to_delete = property_model_files.map(&:vebra_ref) - property_files.map { |f| f[:vebra_ref] }\n property_model_files.each do |file|\n file.destroy if refs_to_delete.include?(file.vebra_ref)\n end\n\n # find & update or build new files\n property_files.each do |file|\n begin\n file_model = property_model_files.find_by_vebra_ref(file[:vebra_ref])\n file_model = property_model_files.build unless file_model\n\n # extract accessible attributes for the file\n file_attributes = file.inject({}) do |result, (key, value)|\n result[key] = value if file_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n file_model.update_attributes(file_attributes)\n rescue CarrierWave::ProcessingError, OpenURI::HTTPError => e\n # just ignore the file\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n end\n\n property_model.no_callbacks = false if property_model.respond_to?(:no_callbacks)\n property_model.save\n return property_model\n end",
"def update!(**args)\n @id = args[:id] if args.key?(:id)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def update\n end",
"def update!(**args)\n @mid = args[:mid] if args.key?(:mid)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def modified_properties=(value)\n @modified_properties = value\n end",
"def apply_properties!(properties)\n # Non-commutitivity etc. eventually.\n end",
"def set_properties(hash)\n hash.each do |key, value|\n add_or_remove_ostruct_member(key, value)\n end\n rest_reset_properties\n end",
"def update\n\t\t\n\t\tend",
"def set_props(props)\n @props.merge!(props)\n end",
"def update() end",
"def update!(**args)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def assign_properties\n self.properties ||= {}\n listing_properties.each do |prop|\n self.properties[prop.key] ||= prop.value\n end\n end",
"def change_properties(new_current_floor, new_next_floor, new_movement)\n @current_floor = new_current_floor\n @next_floor = new_next_floor\n @movement = new_movement\n end",
"def update!(**args)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end",
"def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end",
"def update(attributes)\n (@attributes ||= {}).merge! attributes\n\n (self.class.attr_initializables & attributes.keys).each do |name|\n instance_variable_set :\"@#{name}\", attributes[name]\n end\n\n self\n end",
"def update_attributes(attrs)\n super({})\n end",
"def update\n @dirty = true\n end",
"def update\n\n # Run through the mixin updates\n colourable_update\n movable_update\n\n end",
"def set(props)\n props.each do |prop, val|\n self.send(:\"#{ prop }=\", val)\n end\n end",
"def update\n super\n end",
"def update!(**args)\n @property_id = args[:property_id] if args.key?(:property_id)\n @value_status = args[:value_status] if args.key?(:value_status)\n end",
"def update!(**args)\n @object_size_bytes = args[:object_size_bytes] if args.key?(:object_size_bytes)\n @object_version = args[:object_version] if args.key?(:object_version)\n end",
"def movable_update\n\n # Work through the different aspects we update\n movable_location_update\n movable_size_update\n movable_angle_update\n\n end",
"def properties=(value)\n @properties = value\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(context={})\n self.pre_cast_attributes\n m2o = @relations.reject{|k, v| !self.class.many2one_relations.has_key?(k)}\n vals = @attributes.reject {|key, value| key == 'id'}.merge(m2o.merge(m2o){|k, v| v.is_a?(Array) ? v[0] : v})\n self.class.rpc_execute('write', self.id, vals, context)\n reload_from_record!(self.class.find(self.id, :context => context))\n end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update ; end",
"def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end",
"def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end",
"def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end",
"def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end",
"def update_with(attributes)\n assign_attributes(attributes)\n end",
"def update\n # don't need to update; hash is shared\n end",
"def update(attributes)\n HashProxy.with(attributes) do |proxy|\n self.class.attribute_names.each do |name|\n send(\"#{name}=\", proxy[name]) if proxy.key?(name)\n end\n end\n save\n end",
"def update!(**args)\n @object_id_prop = args[:object_id_prop] if args.key?(:object_id_prop)\n @relation = args[:relation] if args.key?(:relation)\n @subject_id = args[:subject_id] if args.key?(:subject_id)\n end",
"def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end",
"def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end",
"def update\n raise NotImplementedError\n end",
"def update_attributes attributes\n @attributes.merge! attributes\n end",
"def update!(**args)\n @async_options = args[:async_options] if args.key?(:async_options)\n @input_mappings = args[:input_mappings] if args.key?(:input_mappings)\n @name_property = args[:name_property] if args.key?(:name_property)\n @validation_options = args[:validation_options] if args.key?(:validation_options)\n end",
"def update\r\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @type = args[:type] if args.key?(:type)\n end",
"def update\n raise NotImplemented\n end",
"def update_obj\n mean, sd = rating.to_glicko_rating\n @obj.rating = mean\n @obj.rating_deviation = sd\n @obj.volatility = volatility\n end",
"def update_values\n end",
"def update_values\n end",
"def update\n raise NotImplementedError\n end",
"def update!(**args)\n @answers_header_signals = args[:answers_header_signals] if args.key?(:answers_header_signals)\n @property_value = args[:property_value] if args.key?(:property_value)\n @response_meaning_application = args[:response_meaning_application] if args.key?(:response_meaning_application)\n end",
"def update!(**args)\n @create_time = args[:create_time] if args.key?(:create_time)\n @method_prop = args[:method_prop] if args.key?(:method_prop)\n @name = args[:name] if args.key?(:name)\n @state = args[:state] if args.key?(:state)\n end",
"def update attributes, collection #:nodoc:\n 0\n end",
"def update_property_groups(roll)\n @property_groups.each { |_, v| v.update_rent(roll) }\n end",
"def update!(**args)\n @source_property = args[:source_property] if args.key?(:source_property)\n 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 update_properties(path, properties)\n prop_patch = PropPatch.new(properties)\n emit('propPatch', [path, prop_patch])\n prop_patch.commit\n\n prop_patch.result\n end",
"def update\n set_deltatime\n set_last_update_at\n end"
] | [
"0.7012263",
"0.69181895",
"0.69181895",
"0.69181895",
"0.69181895",
"0.69181895",
"0.67403597",
"0.6709326",
"0.6709326",
"0.6696149",
"0.6696149",
"0.6696149",
"0.6696149",
"0.6618882",
"0.6571848",
"0.65386343",
"0.65178275",
"0.6394807",
"0.6389745",
"0.6389745",
"0.63328",
"0.6319025",
"0.6283673",
"0.6269463",
"0.62639254",
"0.62410724",
"0.62170374",
"0.62152076",
"0.6210263",
"0.6204041",
"0.6204041",
"0.62021106",
"0.62017816",
"0.62017",
"0.61730784",
"0.61730784",
"0.6159277",
"0.6156169",
"0.61445665",
"0.6125433",
"0.61241156",
"0.6121413",
"0.6110477",
"0.6105694",
"0.61016303",
"0.60845226",
"0.6084427",
"0.6065455",
"0.6059506",
"0.6054869",
"0.6051708",
"0.6051708",
"0.60413384",
"0.6030853",
"0.6022535",
"0.6015561",
"0.59932375",
"0.59898263",
"0.5976479",
"0.5973787",
"0.59678394",
"0.5963291",
"0.5962048",
"0.5961157",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.59500545",
"0.59443134",
"0.59443134",
"0.59424853",
"0.59424853",
"0.593523",
"0.5926413",
"0.5924831",
"0.592427",
"0.59233046",
"0.59233046",
"0.5921224",
"0.59144294",
"0.59142506",
"0.58887535",
"0.58854496",
"0.5883008",
"0.58792305",
"0.5876954",
"0.5876954",
"0.58744955",
"0.5857968",
"0.5845542",
"0.5841629",
"0.58363605",
"0.5829255",
"0.582919",
"0.5822138",
"0.58208305"
] | 0.0 | -1 |
Update properties of this object | def update!(**args)
@application_matcher = args[:application_matcher] if args.key?(:application_matcher)
@basic_profile = args[:basic_profile] if args.key?(:basic_profile)
@create_time = args[:create_time] if args.key?(:create_time)
@description = args[:description] if args.key?(:description)
@enabled = args[:enabled] if args.key?(:enabled)
@name = args[:name] if args.key?(:name)
@priority = args[:priority] if args.key?(:priority)
@session_matcher = args[:session_matcher] if args.key?(:session_matcher)
@tls_inspection_enabled = args[:tls_inspection_enabled] if args.key?(:tls_inspection_enabled)
@update_time = args[:update_time] if args.key?(:update_time)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update_properties(hash)\n hash.each do |key, value|\n setter_method = \"#{key}=\"\n if self.respond_to?(setter_method)\n self.send(setter_method, value)\n end\n end\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def refresh\n self.class.base_properties.each_with_index do |prop, prop_id|\n @properties[prop] = get_property(prop_id)\n end\n refresh_features\n refresh_status\n refresh_config\n self\n end",
"def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\n end",
"def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\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 update_properties!(branch_id=nil)\n properties = fetch_properties(false, branch_id)\n length = properties.length\n counter = 0\n properties.each do |property|\n counter += 1\n if Vebra.debugging?\n puts \"[Vebra]: #{counter}/#{length}: live updating property with Vebra ref: #{property.attributes[:vebra_ref]}\"\n end\n live_update!(property)\n Vebra.set_last_updated_at(Time.now) if counter == length\n end\n end",
"def update_self obj\n obj.each do |k,v|\n instance_variable_set(\"@#{k}\", v) if v\n end\n end",
"def update_attributes(properties_hash)\n self.class.get_class_properties.each do |property|\n key = property[:name].to_sym\n if properties_hash.has_key? key\n self.setValue(properties_hash[key], forKey:key)\n end\n end\n end",
"def update\n # TODO: implement update\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @states = args[:states] if args.key?(:states)\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end",
"def update!(**args)\n @property = args[:property] if args.key?(:property)\n @total_value_count = args[:total_value_count] if args.key?(:total_value_count)\n @value = args[:value] if args.key?(:value)\n @value_status = args[:value_status] if args.key?(:value_status)\n end",
"def update\n \n end",
"def refresh\n set_attributes\n end",
"def update(attrs)\n @attrs.update(attrs)\n self\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @source = args[:source] if args.key?(:source)\n end",
"def update_resource object, attributes\n object.update attributes\n end",
"def update(attrs)\n @attrs ||= {}\n @attrs.update(attrs)\n self\n end",
"def update\n \n end",
"def update!(**args)\n @property = args[:property] if args.key?(:property)\n @schema = args[:schema] if args.key?(:schema)\n end",
"def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def _update!\n self.class.properties.each do |property, predicate|\n if dirty?(property)\n self.class.repository_or_fail.delete([subject, predicate[:predicate], nil])\n if self.class.is_list?(property)\n repo = RDF::Repository.new\n attribute_get(property).each do |value|\n repo << RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(value, self.class.properties[property][:type]))\n end\n self.class.repository_or_fail.insert(*repo)\n else\n self.class.repository_or_fail.insert(RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(attribute_get(property), self.class.properties[property][:type])))\n end\n end\n @dirty[property] = nil\n @attributes[:original][property] = attribute_get(property)\n end\n self.class.repository_or_fail.insert(RDF::Statement.new(@subject, RDF.type, type)) unless type.nil?\n end",
"def update(attributes = {})\n super(attributes)\n retrieve!\n self\n end",
"def update\n @objects.map(&:update);\n end",
"def update\n raise NotImplementedError\n end",
"def update\n raise NotImplementedError\n end",
"def live_update!(property)\n property_class = Vebra.models[:property][:class].to_s.camelize.constantize\n\n # ensure we have the full property attributes\n property.get_property if !property.attributes[:status] && property.attributes[:action] != 'deleted'\n\n # find & update or build a new property\n property_model = property_class.find_or_initialize_by_vebra_ref(property.attributes[:vebra_ref])\n\n # make sure property object is not empty\n return false if !property.attributes || !property.attributes[:property_type]\n\n # if the property has been deleted, mark it appropriately and move on\n if property.attributes[:action] == 'deleted'\n return property_model.destroy\n end\n\n # extract accessible attributes for the property\n property_accessibles = property_class.accessible_attributes.map(&:to_sym)\n property_attributes = property.attributes.inject({}) do |result, (key, value)|\n result[key] = value if property_accessibles.include?(key)\n result\n end\n\n # update the property model's attributes\n property_model.no_callbacks = true if property_model.respond_to?(:no_callbacks)\n property_model.update_attributes(property_attributes)\n\n # find & update or build a new address\n if Vebra.models[:address]\n address_class = Vebra.models[:address][:class].to_s.camelize.constantize\n address_model = property_model.send(Vebra.models[:property][:address_method])\n address_model = property_model.send(\"build_#{Vebra.models[:property][:address_method]}\") unless address_model\n\n # extract accessible attributes for the address\n address_accessibles = address_class.accessible_attributes.map(&:to_sym)\n address_attributes = property.attributes[:address].inject({}) do |result, (key, value)|\n result[key] = value if address_accessibles.include?(key)\n result\n end\n\n # update the address model's attributes\n address_model.update_attributes(address_attributes)\n end\n\n # find & update or build new rooms\n if Vebra.models[:room]\n room_class = Vebra.models[:room][:class].to_s.camelize.constantize\n\n # accessible attributes for the rooms\n room_accessibles = room_class.accessible_attributes.map(&:to_sym)\n\n # delete any rooms which are no longer present\n property_rooms = property.attributes[:rooms] || []\n property_model_rooms = property_model.send(Vebra.models[:property][:rooms_method])\n refs_to_delete = property_model_rooms.map(&:vebra_ref) - property_rooms.map { |r| r[:vebra_ref] }\n property_model_rooms.each do |room|\n room.destroy if refs_to_delete.include?(room.vebra_ref)\n end\n\n # find & update or build new rooms\n property_rooms.each do |room|\n room_model = room_class.find_by_property_id_and_vebra_ref(property_model.id, room[:vebra_ref])\n room_model = property_model_rooms.build unless room_model\n\n # extract accessible attributes for the room\n room_attributes = room.inject({}) do |result, (key, value)|\n result[key] = value if room_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n room_model.update_attributes(room_attributes)\n end\n end\n\n # find & update or build new file attachments\n if Vebra.models[:file]\n file_class = Vebra.models[:file][:class].to_s.camelize.constantize\n\n # accessible attributes for the files\n file_accessibles = file_class.accessible_attributes.map(&:to_sym)\n\n # first normalize the collection (currently nested collections)\n property_files = property.attributes[:files].inject([]) do |result, (kind, collection)|\n collection.each do |file|\n file[:type] = kind.to_s.singularize.camelize if file_accessibles.include?(:type)\n file[\"remote_#{Vebra.models[:file][:attachment_method]}_url\".to_sym] = file.delete(:url)\n # if file[:type] is set, it means the attachment file class can be subclassed. In this\n # case we need to ensure that the subclass exists. If not, we ignore this file\n begin\n file[:type].constantize if file_accessibles.include?(:type)\n result << file\n rescue NameError => e\n # ignore - this means the subclass does not exist\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n\n result\n end\n\n # delete any files which are no longer present\n property_model_files = property_model.send(Vebra.models[:property][:files_method])\n refs_to_delete = property_model_files.map(&:vebra_ref) - property_files.map { |f| f[:vebra_ref] }\n property_model_files.each do |file|\n file.destroy if refs_to_delete.include?(file.vebra_ref)\n end\n\n # find & update or build new files\n property_files.each do |file|\n begin\n file_model = property_model_files.find_by_vebra_ref(file[:vebra_ref])\n file_model = property_model_files.build unless file_model\n\n # extract accessible attributes for the file\n file_attributes = file.inject({}) do |result, (key, value)|\n result[key] = value if file_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n file_model.update_attributes(file_attributes)\n rescue CarrierWave::ProcessingError, OpenURI::HTTPError => e\n # just ignore the file\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n end\n\n property_model.no_callbacks = false if property_model.respond_to?(:no_callbacks)\n property_model.save\n return property_model\n end",
"def update!(**args)\n @id = args[:id] if args.key?(:id)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def update\n end",
"def update!(**args)\n @mid = args[:mid] if args.key?(:mid)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def modified_properties=(value)\n @modified_properties = value\n end",
"def apply_properties!(properties)\n # Non-commutitivity etc. eventually.\n end",
"def set_properties(hash)\n hash.each do |key, value|\n add_or_remove_ostruct_member(key, value)\n end\n rest_reset_properties\n end",
"def update\n\t\t\n\t\tend",
"def set_props(props)\n @props.merge!(props)\n end",
"def update() end",
"def update!(**args)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def assign_properties\n self.properties ||= {}\n listing_properties.each do |prop|\n self.properties[prop.key] ||= prop.value\n end\n end",
"def change_properties(new_current_floor, new_next_floor, new_movement)\n @current_floor = new_current_floor\n @next_floor = new_next_floor\n @movement = new_movement\n end",
"def update!(**args)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end",
"def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end",
"def update(attributes)\n (@attributes ||= {}).merge! attributes\n\n (self.class.attr_initializables & attributes.keys).each do |name|\n instance_variable_set :\"@#{name}\", attributes[name]\n end\n\n self\n end",
"def update_attributes(attrs)\n super({})\n end",
"def update\n @dirty = true\n end",
"def update\n\n # Run through the mixin updates\n colourable_update\n movable_update\n\n end",
"def set(props)\n props.each do |prop, val|\n self.send(:\"#{ prop }=\", val)\n end\n end",
"def update\n super\n end",
"def update!(**args)\n @property_id = args[:property_id] if args.key?(:property_id)\n @value_status = args[:value_status] if args.key?(:value_status)\n end",
"def update!(**args)\n @object_size_bytes = args[:object_size_bytes] if args.key?(:object_size_bytes)\n @object_version = args[:object_version] if args.key?(:object_version)\n end",
"def movable_update\n\n # Work through the different aspects we update\n movable_location_update\n movable_size_update\n movable_angle_update\n\n end",
"def properties=(value)\n @properties = value\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(context={})\n self.pre_cast_attributes\n m2o = @relations.reject{|k, v| !self.class.many2one_relations.has_key?(k)}\n vals = @attributes.reject {|key, value| key == 'id'}.merge(m2o.merge(m2o){|k, v| v.is_a?(Array) ? v[0] : v})\n self.class.rpc_execute('write', self.id, vals, context)\n reload_from_record!(self.class.find(self.id, :context => context))\n end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update ; end",
"def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end",
"def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end",
"def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end",
"def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end",
"def update_with(attributes)\n assign_attributes(attributes)\n end",
"def update\n # don't need to update; hash is shared\n end",
"def update(attributes)\n HashProxy.with(attributes) do |proxy|\n self.class.attribute_names.each do |name|\n send(\"#{name}=\", proxy[name]) if proxy.key?(name)\n end\n end\n save\n end",
"def update!(**args)\n @object_id_prop = args[:object_id_prop] if args.key?(:object_id_prop)\n @relation = args[:relation] if args.key?(:relation)\n @subject_id = args[:subject_id] if args.key?(:subject_id)\n end",
"def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end",
"def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end",
"def update\n raise NotImplementedError\n end",
"def update_attributes attributes\n @attributes.merge! attributes\n end",
"def update!(**args)\n @async_options = args[:async_options] if args.key?(:async_options)\n @input_mappings = args[:input_mappings] if args.key?(:input_mappings)\n @name_property = args[:name_property] if args.key?(:name_property)\n @validation_options = args[:validation_options] if args.key?(:validation_options)\n end",
"def update\r\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @type = args[:type] if args.key?(:type)\n end",
"def update\n raise NotImplemented\n end",
"def update_obj\n mean, sd = rating.to_glicko_rating\n @obj.rating = mean\n @obj.rating_deviation = sd\n @obj.volatility = volatility\n end",
"def update_values\n end",
"def update_values\n end",
"def update\n raise NotImplementedError\n end",
"def update!(**args)\n @answers_header_signals = args[:answers_header_signals] if args.key?(:answers_header_signals)\n @property_value = args[:property_value] if args.key?(:property_value)\n @response_meaning_application = args[:response_meaning_application] if args.key?(:response_meaning_application)\n end",
"def update!(**args)\n @create_time = args[:create_time] if args.key?(:create_time)\n @method_prop = args[:method_prop] if args.key?(:method_prop)\n @name = args[:name] if args.key?(:name)\n @state = args[:state] if args.key?(:state)\n end",
"def update attributes, collection #:nodoc:\n 0\n end",
"def update_property_groups(roll)\n @property_groups.each { |_, v| v.update_rent(roll) }\n end",
"def update!(**args)\n @source_property = args[:source_property] if args.key?(:source_property)\n 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 update_properties(path, properties)\n prop_patch = PropPatch.new(properties)\n emit('propPatch', [path, prop_patch])\n prop_patch.commit\n\n prop_patch.result\n end",
"def update\n set_deltatime\n set_last_update_at\n end"
] | [
"0.7012263",
"0.69181895",
"0.69181895",
"0.69181895",
"0.69181895",
"0.69181895",
"0.67403597",
"0.6709326",
"0.6709326",
"0.6696149",
"0.6696149",
"0.6696149",
"0.6696149",
"0.6618882",
"0.6571848",
"0.65386343",
"0.65178275",
"0.6394807",
"0.6389745",
"0.6389745",
"0.63328",
"0.6319025",
"0.6283673",
"0.6269463",
"0.62639254",
"0.62410724",
"0.62170374",
"0.62152076",
"0.6210263",
"0.6204041",
"0.6204041",
"0.62021106",
"0.62017816",
"0.62017",
"0.61730784",
"0.61730784",
"0.6159277",
"0.6156169",
"0.61445665",
"0.6125433",
"0.61241156",
"0.6121413",
"0.6110477",
"0.6105694",
"0.61016303",
"0.60845226",
"0.6084427",
"0.6065455",
"0.6059506",
"0.6054869",
"0.6051708",
"0.6051708",
"0.60413384",
"0.6030853",
"0.6022535",
"0.6015561",
"0.59932375",
"0.59898263",
"0.5976479",
"0.5973787",
"0.59678394",
"0.5963291",
"0.5962048",
"0.5961157",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.59500545",
"0.59443134",
"0.59443134",
"0.59424853",
"0.59424853",
"0.593523",
"0.5926413",
"0.5924831",
"0.592427",
"0.59233046",
"0.59233046",
"0.5921224",
"0.59144294",
"0.59142506",
"0.58887535",
"0.58854496",
"0.5883008",
"0.58792305",
"0.5876954",
"0.5876954",
"0.58744955",
"0.5857968",
"0.5845542",
"0.5841629",
"0.58363605",
"0.5829255",
"0.582919",
"0.5822138",
"0.58208305"
] | 0.0 | -1 |
Update properties of this object | def update!(**args)
@certificate_provider_instance = args[:certificate_provider_instance] if args.key?(:certificate_provider_instance)
@grpc_endpoint = args[:grpc_endpoint] if args.key?(:grpc_endpoint)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update_properties(hash)\n hash.each do |key, value|\n setter_method = \"#{key}=\"\n if self.respond_to?(setter_method)\n self.send(setter_method, value)\n end\n end\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def refresh\n self.class.base_properties.each_with_index do |prop, prop_id|\n @properties[prop] = get_property(prop_id)\n end\n refresh_features\n refresh_status\n refresh_config\n self\n end",
"def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\n end",
"def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\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 update_properties!(branch_id=nil)\n properties = fetch_properties(false, branch_id)\n length = properties.length\n counter = 0\n properties.each do |property|\n counter += 1\n if Vebra.debugging?\n puts \"[Vebra]: #{counter}/#{length}: live updating property with Vebra ref: #{property.attributes[:vebra_ref]}\"\n end\n live_update!(property)\n Vebra.set_last_updated_at(Time.now) if counter == length\n end\n end",
"def update_self obj\n obj.each do |k,v|\n instance_variable_set(\"@#{k}\", v) if v\n end\n end",
"def update_attributes(properties_hash)\n self.class.get_class_properties.each do |property|\n key = property[:name].to_sym\n if properties_hash.has_key? key\n self.setValue(properties_hash[key], forKey:key)\n end\n end\n end",
"def update\n # TODO: implement update\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @states = args[:states] if args.key?(:states)\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end",
"def update!(**args)\n @property = args[:property] if args.key?(:property)\n @total_value_count = args[:total_value_count] if args.key?(:total_value_count)\n @value = args[:value] if args.key?(:value)\n @value_status = args[:value_status] if args.key?(:value_status)\n end",
"def update\n \n end",
"def refresh\n set_attributes\n end",
"def update(attrs)\n @attrs.update(attrs)\n self\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @source = args[:source] if args.key?(:source)\n end",
"def update_resource object, attributes\n object.update attributes\n end",
"def update(attrs)\n @attrs ||= {}\n @attrs.update(attrs)\n self\n end",
"def update\n \n end",
"def update!(**args)\n @property = args[:property] if args.key?(:property)\n @schema = args[:schema] if args.key?(:schema)\n end",
"def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def _update!\n self.class.properties.each do |property, predicate|\n if dirty?(property)\n self.class.repository_or_fail.delete([subject, predicate[:predicate], nil])\n if self.class.is_list?(property)\n repo = RDF::Repository.new\n attribute_get(property).each do |value|\n repo << RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(value, self.class.properties[property][:type]))\n end\n self.class.repository_or_fail.insert(*repo)\n else\n self.class.repository_or_fail.insert(RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(attribute_get(property), self.class.properties[property][:type])))\n end\n end\n @dirty[property] = nil\n @attributes[:original][property] = attribute_get(property)\n end\n self.class.repository_or_fail.insert(RDF::Statement.new(@subject, RDF.type, type)) unless type.nil?\n end",
"def update(attributes = {})\n super(attributes)\n retrieve!\n self\n end",
"def update\n @objects.map(&:update);\n end",
"def update\n raise NotImplementedError\n end",
"def update\n raise NotImplementedError\n end",
"def live_update!(property)\n property_class = Vebra.models[:property][:class].to_s.camelize.constantize\n\n # ensure we have the full property attributes\n property.get_property if !property.attributes[:status] && property.attributes[:action] != 'deleted'\n\n # find & update or build a new property\n property_model = property_class.find_or_initialize_by_vebra_ref(property.attributes[:vebra_ref])\n\n # make sure property object is not empty\n return false if !property.attributes || !property.attributes[:property_type]\n\n # if the property has been deleted, mark it appropriately and move on\n if property.attributes[:action] == 'deleted'\n return property_model.destroy\n end\n\n # extract accessible attributes for the property\n property_accessibles = property_class.accessible_attributes.map(&:to_sym)\n property_attributes = property.attributes.inject({}) do |result, (key, value)|\n result[key] = value if property_accessibles.include?(key)\n result\n end\n\n # update the property model's attributes\n property_model.no_callbacks = true if property_model.respond_to?(:no_callbacks)\n property_model.update_attributes(property_attributes)\n\n # find & update or build a new address\n if Vebra.models[:address]\n address_class = Vebra.models[:address][:class].to_s.camelize.constantize\n address_model = property_model.send(Vebra.models[:property][:address_method])\n address_model = property_model.send(\"build_#{Vebra.models[:property][:address_method]}\") unless address_model\n\n # extract accessible attributes for the address\n address_accessibles = address_class.accessible_attributes.map(&:to_sym)\n address_attributes = property.attributes[:address].inject({}) do |result, (key, value)|\n result[key] = value if address_accessibles.include?(key)\n result\n end\n\n # update the address model's attributes\n address_model.update_attributes(address_attributes)\n end\n\n # find & update or build new rooms\n if Vebra.models[:room]\n room_class = Vebra.models[:room][:class].to_s.camelize.constantize\n\n # accessible attributes for the rooms\n room_accessibles = room_class.accessible_attributes.map(&:to_sym)\n\n # delete any rooms which are no longer present\n property_rooms = property.attributes[:rooms] || []\n property_model_rooms = property_model.send(Vebra.models[:property][:rooms_method])\n refs_to_delete = property_model_rooms.map(&:vebra_ref) - property_rooms.map { |r| r[:vebra_ref] }\n property_model_rooms.each do |room|\n room.destroy if refs_to_delete.include?(room.vebra_ref)\n end\n\n # find & update or build new rooms\n property_rooms.each do |room|\n room_model = room_class.find_by_property_id_and_vebra_ref(property_model.id, room[:vebra_ref])\n room_model = property_model_rooms.build unless room_model\n\n # extract accessible attributes for the room\n room_attributes = room.inject({}) do |result, (key, value)|\n result[key] = value if room_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n room_model.update_attributes(room_attributes)\n end\n end\n\n # find & update or build new file attachments\n if Vebra.models[:file]\n file_class = Vebra.models[:file][:class].to_s.camelize.constantize\n\n # accessible attributes for the files\n file_accessibles = file_class.accessible_attributes.map(&:to_sym)\n\n # first normalize the collection (currently nested collections)\n property_files = property.attributes[:files].inject([]) do |result, (kind, collection)|\n collection.each do |file|\n file[:type] = kind.to_s.singularize.camelize if file_accessibles.include?(:type)\n file[\"remote_#{Vebra.models[:file][:attachment_method]}_url\".to_sym] = file.delete(:url)\n # if file[:type] is set, it means the attachment file class can be subclassed. In this\n # case we need to ensure that the subclass exists. If not, we ignore this file\n begin\n file[:type].constantize if file_accessibles.include?(:type)\n result << file\n rescue NameError => e\n # ignore - this means the subclass does not exist\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n\n result\n end\n\n # delete any files which are no longer present\n property_model_files = property_model.send(Vebra.models[:property][:files_method])\n refs_to_delete = property_model_files.map(&:vebra_ref) - property_files.map { |f| f[:vebra_ref] }\n property_model_files.each do |file|\n file.destroy if refs_to_delete.include?(file.vebra_ref)\n end\n\n # find & update or build new files\n property_files.each do |file|\n begin\n file_model = property_model_files.find_by_vebra_ref(file[:vebra_ref])\n file_model = property_model_files.build unless file_model\n\n # extract accessible attributes for the file\n file_attributes = file.inject({}) do |result, (key, value)|\n result[key] = value if file_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n file_model.update_attributes(file_attributes)\n rescue CarrierWave::ProcessingError, OpenURI::HTTPError => e\n # just ignore the file\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n end\n\n property_model.no_callbacks = false if property_model.respond_to?(:no_callbacks)\n property_model.save\n return property_model\n end",
"def update!(**args)\n @id = args[:id] if args.key?(:id)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def update\n end",
"def update!(**args)\n @mid = args[:mid] if args.key?(:mid)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def modified_properties=(value)\n @modified_properties = value\n end",
"def apply_properties!(properties)\n # Non-commutitivity etc. eventually.\n end",
"def set_properties(hash)\n hash.each do |key, value|\n add_or_remove_ostruct_member(key, value)\n end\n rest_reset_properties\n end",
"def update\n\t\t\n\t\tend",
"def set_props(props)\n @props.merge!(props)\n end",
"def update() end",
"def update!(**args)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def assign_properties\n self.properties ||= {}\n listing_properties.each do |prop|\n self.properties[prop.key] ||= prop.value\n end\n end",
"def change_properties(new_current_floor, new_next_floor, new_movement)\n @current_floor = new_current_floor\n @next_floor = new_next_floor\n @movement = new_movement\n end",
"def update!(**args)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end",
"def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end",
"def update(attributes)\n (@attributes ||= {}).merge! attributes\n\n (self.class.attr_initializables & attributes.keys).each do |name|\n instance_variable_set :\"@#{name}\", attributes[name]\n end\n\n self\n end",
"def update_attributes(attrs)\n super({})\n end",
"def update\n @dirty = true\n end",
"def update\n\n # Run through the mixin updates\n colourable_update\n movable_update\n\n end",
"def set(props)\n props.each do |prop, val|\n self.send(:\"#{ prop }=\", val)\n end\n end",
"def update\n super\n end",
"def update!(**args)\n @property_id = args[:property_id] if args.key?(:property_id)\n @value_status = args[:value_status] if args.key?(:value_status)\n end",
"def update!(**args)\n @object_size_bytes = args[:object_size_bytes] if args.key?(:object_size_bytes)\n @object_version = args[:object_version] if args.key?(:object_version)\n end",
"def movable_update\n\n # Work through the different aspects we update\n movable_location_update\n movable_size_update\n movable_angle_update\n\n end",
"def properties=(value)\n @properties = value\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(context={})\n self.pre_cast_attributes\n m2o = @relations.reject{|k, v| !self.class.many2one_relations.has_key?(k)}\n vals = @attributes.reject {|key, value| key == 'id'}.merge(m2o.merge(m2o){|k, v| v.is_a?(Array) ? v[0] : v})\n self.class.rpc_execute('write', self.id, vals, context)\n reload_from_record!(self.class.find(self.id, :context => context))\n end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update ; end",
"def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end",
"def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end",
"def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end",
"def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end",
"def update_with(attributes)\n assign_attributes(attributes)\n end",
"def update\n # don't need to update; hash is shared\n end",
"def update(attributes)\n HashProxy.with(attributes) do |proxy|\n self.class.attribute_names.each do |name|\n send(\"#{name}=\", proxy[name]) if proxy.key?(name)\n end\n end\n save\n end",
"def update!(**args)\n @object_id_prop = args[:object_id_prop] if args.key?(:object_id_prop)\n @relation = args[:relation] if args.key?(:relation)\n @subject_id = args[:subject_id] if args.key?(:subject_id)\n end",
"def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end",
"def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end",
"def update\n raise NotImplementedError\n end",
"def update_attributes attributes\n @attributes.merge! attributes\n end",
"def update!(**args)\n @async_options = args[:async_options] if args.key?(:async_options)\n @input_mappings = args[:input_mappings] if args.key?(:input_mappings)\n @name_property = args[:name_property] if args.key?(:name_property)\n @validation_options = args[:validation_options] if args.key?(:validation_options)\n end",
"def update\r\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @type = args[:type] if args.key?(:type)\n end",
"def update\n raise NotImplemented\n end",
"def update_obj\n mean, sd = rating.to_glicko_rating\n @obj.rating = mean\n @obj.rating_deviation = sd\n @obj.volatility = volatility\n end",
"def update_values\n end",
"def update_values\n end",
"def update\n raise NotImplementedError\n end",
"def update!(**args)\n @answers_header_signals = args[:answers_header_signals] if args.key?(:answers_header_signals)\n @property_value = args[:property_value] if args.key?(:property_value)\n @response_meaning_application = args[:response_meaning_application] if args.key?(:response_meaning_application)\n end",
"def update!(**args)\n @create_time = args[:create_time] if args.key?(:create_time)\n @method_prop = args[:method_prop] if args.key?(:method_prop)\n @name = args[:name] if args.key?(:name)\n @state = args[:state] if args.key?(:state)\n end",
"def update attributes, collection #:nodoc:\n 0\n end",
"def update_property_groups(roll)\n @property_groups.each { |_, v| v.update_rent(roll) }\n end",
"def update!(**args)\n @source_property = args[:source_property] if args.key?(:source_property)\n 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 update_properties(path, properties)\n prop_patch = PropPatch.new(properties)\n emit('propPatch', [path, prop_patch])\n prop_patch.commit\n\n prop_patch.result\n end",
"def update\n set_deltatime\n set_last_update_at\n end"
] | [
"0.7012263",
"0.69181895",
"0.69181895",
"0.69181895",
"0.69181895",
"0.69181895",
"0.67403597",
"0.6709326",
"0.6709326",
"0.6696149",
"0.6696149",
"0.6696149",
"0.6696149",
"0.6618882",
"0.6571848",
"0.65386343",
"0.65178275",
"0.6394807",
"0.6389745",
"0.6389745",
"0.63328",
"0.6319025",
"0.6283673",
"0.6269463",
"0.62639254",
"0.62410724",
"0.62170374",
"0.62152076",
"0.6210263",
"0.6204041",
"0.6204041",
"0.62021106",
"0.62017816",
"0.62017",
"0.61730784",
"0.61730784",
"0.6159277",
"0.6156169",
"0.61445665",
"0.6125433",
"0.61241156",
"0.6121413",
"0.6110477",
"0.6105694",
"0.61016303",
"0.60845226",
"0.6084427",
"0.6065455",
"0.6059506",
"0.6054869",
"0.6051708",
"0.6051708",
"0.60413384",
"0.6030853",
"0.6022535",
"0.6015561",
"0.59932375",
"0.59898263",
"0.5976479",
"0.5973787",
"0.59678394",
"0.5963291",
"0.5962048",
"0.5961157",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.59500545",
"0.59443134",
"0.59443134",
"0.59424853",
"0.59424853",
"0.593523",
"0.5926413",
"0.5924831",
"0.592427",
"0.59233046",
"0.59233046",
"0.5921224",
"0.59144294",
"0.59142506",
"0.58887535",
"0.58854496",
"0.5883008",
"0.58792305",
"0.5876954",
"0.5876954",
"0.58744955",
"0.5857968",
"0.5845542",
"0.5841629",
"0.58363605",
"0.5829255",
"0.582919",
"0.5822138",
"0.58208305"
] | 0.0 | -1 |
Update properties of this object | def update!(**args)
@target_uri = args[:target_uri] if args.key?(:target_uri)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update_properties(hash)\n hash.each do |key, value|\n setter_method = \"#{key}=\"\n if self.respond_to?(setter_method)\n self.send(setter_method, value)\n end\n end\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def refresh\n self.class.base_properties.each_with_index do |prop, prop_id|\n @properties[prop] = get_property(prop_id)\n end\n refresh_features\n refresh_status\n refresh_config\n self\n end",
"def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\n end",
"def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\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 update_properties!(branch_id=nil)\n properties = fetch_properties(false, branch_id)\n length = properties.length\n counter = 0\n properties.each do |property|\n counter += 1\n if Vebra.debugging?\n puts \"[Vebra]: #{counter}/#{length}: live updating property with Vebra ref: #{property.attributes[:vebra_ref]}\"\n end\n live_update!(property)\n Vebra.set_last_updated_at(Time.now) if counter == length\n end\n end",
"def update_self obj\n obj.each do |k,v|\n instance_variable_set(\"@#{k}\", v) if v\n end\n end",
"def update_attributes(properties_hash)\n self.class.get_class_properties.each do |property|\n key = property[:name].to_sym\n if properties_hash.has_key? key\n self.setValue(properties_hash[key], forKey:key)\n end\n end\n end",
"def update\n # TODO: implement update\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @states = args[:states] if args.key?(:states)\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end",
"def update!(**args)\n @property = args[:property] if args.key?(:property)\n @total_value_count = args[:total_value_count] if args.key?(:total_value_count)\n @value = args[:value] if args.key?(:value)\n @value_status = args[:value_status] if args.key?(:value_status)\n end",
"def update\n \n end",
"def refresh\n set_attributes\n end",
"def update(attrs)\n @attrs.update(attrs)\n self\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @source = args[:source] if args.key?(:source)\n end",
"def update_resource object, attributes\n object.update attributes\n end",
"def update(attrs)\n @attrs ||= {}\n @attrs.update(attrs)\n self\n end",
"def update\n \n end",
"def update!(**args)\n @property = args[:property] if args.key?(:property)\n @schema = args[:schema] if args.key?(:schema)\n end",
"def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def update(attributes = {})\n super(attributes)\n retrieve!\n self\n end",
"def _update!\n self.class.properties.each do |property, predicate|\n if dirty?(property)\n self.class.repository_or_fail.delete([subject, predicate[:predicate], nil])\n if self.class.is_list?(property)\n repo = RDF::Repository.new\n attribute_get(property).each do |value|\n repo << RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(value, self.class.properties[property][:type]))\n end\n self.class.repository_or_fail.insert(*repo)\n else\n self.class.repository_or_fail.insert(RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(attribute_get(property), self.class.properties[property][:type])))\n end\n end\n @dirty[property] = nil\n @attributes[:original][property] = attribute_get(property)\n end\n self.class.repository_or_fail.insert(RDF::Statement.new(@subject, RDF.type, type)) unless type.nil?\n end",
"def update\n @objects.map(&:update);\n end",
"def update\n raise NotImplementedError\n end",
"def update\n raise NotImplementedError\n end",
"def live_update!(property)\n property_class = Vebra.models[:property][:class].to_s.camelize.constantize\n\n # ensure we have the full property attributes\n property.get_property if !property.attributes[:status] && property.attributes[:action] != 'deleted'\n\n # find & update or build a new property\n property_model = property_class.find_or_initialize_by_vebra_ref(property.attributes[:vebra_ref])\n\n # make sure property object is not empty\n return false if !property.attributes || !property.attributes[:property_type]\n\n # if the property has been deleted, mark it appropriately and move on\n if property.attributes[:action] == 'deleted'\n return property_model.destroy\n end\n\n # extract accessible attributes for the property\n property_accessibles = property_class.accessible_attributes.map(&:to_sym)\n property_attributes = property.attributes.inject({}) do |result, (key, value)|\n result[key] = value if property_accessibles.include?(key)\n result\n end\n\n # update the property model's attributes\n property_model.no_callbacks = true if property_model.respond_to?(:no_callbacks)\n property_model.update_attributes(property_attributes)\n\n # find & update or build a new address\n if Vebra.models[:address]\n address_class = Vebra.models[:address][:class].to_s.camelize.constantize\n address_model = property_model.send(Vebra.models[:property][:address_method])\n address_model = property_model.send(\"build_#{Vebra.models[:property][:address_method]}\") unless address_model\n\n # extract accessible attributes for the address\n address_accessibles = address_class.accessible_attributes.map(&:to_sym)\n address_attributes = property.attributes[:address].inject({}) do |result, (key, value)|\n result[key] = value if address_accessibles.include?(key)\n result\n end\n\n # update the address model's attributes\n address_model.update_attributes(address_attributes)\n end\n\n # find & update or build new rooms\n if Vebra.models[:room]\n room_class = Vebra.models[:room][:class].to_s.camelize.constantize\n\n # accessible attributes for the rooms\n room_accessibles = room_class.accessible_attributes.map(&:to_sym)\n\n # delete any rooms which are no longer present\n property_rooms = property.attributes[:rooms] || []\n property_model_rooms = property_model.send(Vebra.models[:property][:rooms_method])\n refs_to_delete = property_model_rooms.map(&:vebra_ref) - property_rooms.map { |r| r[:vebra_ref] }\n property_model_rooms.each do |room|\n room.destroy if refs_to_delete.include?(room.vebra_ref)\n end\n\n # find & update or build new rooms\n property_rooms.each do |room|\n room_model = room_class.find_by_property_id_and_vebra_ref(property_model.id, room[:vebra_ref])\n room_model = property_model_rooms.build unless room_model\n\n # extract accessible attributes for the room\n room_attributes = room.inject({}) do |result, (key, value)|\n result[key] = value if room_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n room_model.update_attributes(room_attributes)\n end\n end\n\n # find & update or build new file attachments\n if Vebra.models[:file]\n file_class = Vebra.models[:file][:class].to_s.camelize.constantize\n\n # accessible attributes for the files\n file_accessibles = file_class.accessible_attributes.map(&:to_sym)\n\n # first normalize the collection (currently nested collections)\n property_files = property.attributes[:files].inject([]) do |result, (kind, collection)|\n collection.each do |file|\n file[:type] = kind.to_s.singularize.camelize if file_accessibles.include?(:type)\n file[\"remote_#{Vebra.models[:file][:attachment_method]}_url\".to_sym] = file.delete(:url)\n # if file[:type] is set, it means the attachment file class can be subclassed. In this\n # case we need to ensure that the subclass exists. If not, we ignore this file\n begin\n file[:type].constantize if file_accessibles.include?(:type)\n result << file\n rescue NameError => e\n # ignore - this means the subclass does not exist\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n\n result\n end\n\n # delete any files which are no longer present\n property_model_files = property_model.send(Vebra.models[:property][:files_method])\n refs_to_delete = property_model_files.map(&:vebra_ref) - property_files.map { |f| f[:vebra_ref] }\n property_model_files.each do |file|\n file.destroy if refs_to_delete.include?(file.vebra_ref)\n end\n\n # find & update or build new files\n property_files.each do |file|\n begin\n file_model = property_model_files.find_by_vebra_ref(file[:vebra_ref])\n file_model = property_model_files.build unless file_model\n\n # extract accessible attributes for the file\n file_attributes = file.inject({}) do |result, (key, value)|\n result[key] = value if file_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n file_model.update_attributes(file_attributes)\n rescue CarrierWave::ProcessingError, OpenURI::HTTPError => e\n # just ignore the file\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n end\n\n property_model.no_callbacks = false if property_model.respond_to?(:no_callbacks)\n property_model.save\n return property_model\n end",
"def update!(**args)\n @id = args[:id] if args.key?(:id)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def update\n end",
"def update!(**args)\n @mid = args[:mid] if args.key?(:mid)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def modified_properties=(value)\n @modified_properties = value\n end",
"def apply_properties!(properties)\n # Non-commutitivity etc. eventually.\n end",
"def set_properties(hash)\n hash.each do |key, value|\n add_or_remove_ostruct_member(key, value)\n end\n rest_reset_properties\n end",
"def update\n\t\t\n\t\tend",
"def set_props(props)\n @props.merge!(props)\n end",
"def update() end",
"def update!(**args)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def assign_properties\n self.properties ||= {}\n listing_properties.each do |prop|\n self.properties[prop.key] ||= prop.value\n end\n end",
"def change_properties(new_current_floor, new_next_floor, new_movement)\n @current_floor = new_current_floor\n @next_floor = new_next_floor\n @movement = new_movement\n end",
"def update!(**args)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end",
"def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end",
"def update(attributes)\n (@attributes ||= {}).merge! attributes\n\n (self.class.attr_initializables & attributes.keys).each do |name|\n instance_variable_set :\"@#{name}\", attributes[name]\n end\n\n self\n end",
"def update_attributes(attrs)\n super({})\n end",
"def update\n @dirty = true\n end",
"def update\n\n # Run through the mixin updates\n colourable_update\n movable_update\n\n end",
"def set(props)\n props.each do |prop, val|\n self.send(:\"#{ prop }=\", val)\n end\n end",
"def update\n super\n end",
"def update!(**args)\n @property_id = args[:property_id] if args.key?(:property_id)\n @value_status = args[:value_status] if args.key?(:value_status)\n end",
"def update!(**args)\n @object_size_bytes = args[:object_size_bytes] if args.key?(:object_size_bytes)\n @object_version = args[:object_version] if args.key?(:object_version)\n end",
"def movable_update\n\n # Work through the different aspects we update\n movable_location_update\n movable_size_update\n movable_angle_update\n\n end",
"def properties=(value)\n @properties = value\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(context={})\n self.pre_cast_attributes\n m2o = @relations.reject{|k, v| !self.class.many2one_relations.has_key?(k)}\n vals = @attributes.reject {|key, value| key == 'id'}.merge(m2o.merge(m2o){|k, v| v.is_a?(Array) ? v[0] : v})\n self.class.rpc_execute('write', self.id, vals, context)\n reload_from_record!(self.class.find(self.id, :context => context))\n end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update ; end",
"def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end",
"def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end",
"def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end",
"def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end",
"def update_with(attributes)\n assign_attributes(attributes)\n end",
"def update\n # don't need to update; hash is shared\n end",
"def update(attributes)\n HashProxy.with(attributes) do |proxy|\n self.class.attribute_names.each do |name|\n send(\"#{name}=\", proxy[name]) if proxy.key?(name)\n end\n end\n save\n end",
"def update!(**args)\n @object_id_prop = args[:object_id_prop] if args.key?(:object_id_prop)\n @relation = args[:relation] if args.key?(:relation)\n @subject_id = args[:subject_id] if args.key?(:subject_id)\n end",
"def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end",
"def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end",
"def update\n raise NotImplementedError\n end",
"def update_attributes attributes\n @attributes.merge! attributes\n end",
"def update!(**args)\n @async_options = args[:async_options] if args.key?(:async_options)\n @input_mappings = args[:input_mappings] if args.key?(:input_mappings)\n @name_property = args[:name_property] if args.key?(:name_property)\n @validation_options = args[:validation_options] if args.key?(:validation_options)\n end",
"def update\r\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @type = args[:type] if args.key?(:type)\n end",
"def update\n raise NotImplemented\n end",
"def update_obj\n mean, sd = rating.to_glicko_rating\n @obj.rating = mean\n @obj.rating_deviation = sd\n @obj.volatility = volatility\n end",
"def update_values\n end",
"def update_values\n end",
"def update\n raise NotImplementedError\n end",
"def update!(**args)\n @answers_header_signals = args[:answers_header_signals] if args.key?(:answers_header_signals)\n @property_value = args[:property_value] if args.key?(:property_value)\n @response_meaning_application = args[:response_meaning_application] if args.key?(:response_meaning_application)\n end",
"def update!(**args)\n @create_time = args[:create_time] if args.key?(:create_time)\n @method_prop = args[:method_prop] if args.key?(:method_prop)\n @name = args[:name] if args.key?(:name)\n @state = args[:state] if args.key?(:state)\n end",
"def update attributes, collection #:nodoc:\n 0\n end",
"def update_property_groups(roll)\n @property_groups.each { |_, v| v.update_rent(roll) }\n 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 update!(**args)\n @source_property = args[:source_property] if args.key?(:source_property)\n end",
"def update_properties(path, properties)\n prop_patch = PropPatch.new(properties)\n emit('propPatch', [path, prop_patch])\n prop_patch.commit\n\n prop_patch.result\n end",
"def update\n set_deltatime\n set_last_update_at\n end"
] | [
"0.7012568",
"0.6918917",
"0.6918917",
"0.6918917",
"0.6918917",
"0.6918917",
"0.67404634",
"0.6709981",
"0.6709981",
"0.66964126",
"0.66964126",
"0.66964126",
"0.66964126",
"0.6619218",
"0.6570895",
"0.6539287",
"0.6517026",
"0.63946927",
"0.63901657",
"0.63901657",
"0.63328683",
"0.6318612",
"0.62846893",
"0.62692374",
"0.6264273",
"0.6241163",
"0.6216599",
"0.6214641",
"0.6210363",
"0.6203827",
"0.6203827",
"0.620312",
"0.6201905",
"0.62001497",
"0.61728275",
"0.61728275",
"0.6159924",
"0.61569315",
"0.61442953",
"0.61260897",
"0.6125199",
"0.61227936",
"0.61111224",
"0.610543",
"0.6102925",
"0.60839343",
"0.6083609",
"0.6066973",
"0.60602766",
"0.6055065",
"0.6051568",
"0.6051568",
"0.6042057",
"0.60319084",
"0.60221004",
"0.60149413",
"0.5994295",
"0.5989816",
"0.597674",
"0.5973157",
"0.5967343",
"0.5965598",
"0.59629464",
"0.59618354",
"0.5950329",
"0.5950329",
"0.5950329",
"0.5950329",
"0.5950329",
"0.5950329",
"0.5950329",
"0.5950329",
"0.59495455",
"0.59442014",
"0.59442014",
"0.5944142",
"0.5944142",
"0.59361076",
"0.5925741",
"0.5925574",
"0.59250593",
"0.5924476",
"0.5924476",
"0.5921039",
"0.59155524",
"0.59145254",
"0.5888445",
"0.58860934",
"0.5882302",
"0.5879913",
"0.5877467",
"0.5877467",
"0.58743787",
"0.585829",
"0.584583",
"0.58408254",
"0.5835501",
"0.5829063",
"0.5828611",
"0.58228916",
"0.5819882"
] | 0.0 | -1 |
Update properties of this object | def update!(**args)
@audit_log_configs = args[:audit_log_configs] if args.key?(:audit_log_configs)
@service = args[:service] if args.key?(:service)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update_properties(hash)\n hash.each do |key, value|\n setter_method = \"#{key}=\"\n if self.respond_to?(setter_method)\n self.send(setter_method, value)\n end\n end\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def refresh\n self.class.base_properties.each_with_index do |prop, prop_id|\n @properties[prop] = get_property(prop_id)\n end\n refresh_features\n refresh_status\n refresh_config\n self\n end",
"def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\n end",
"def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\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 update_properties!(branch_id=nil)\n properties = fetch_properties(false, branch_id)\n length = properties.length\n counter = 0\n properties.each do |property|\n counter += 1\n if Vebra.debugging?\n puts \"[Vebra]: #{counter}/#{length}: live updating property with Vebra ref: #{property.attributes[:vebra_ref]}\"\n end\n live_update!(property)\n Vebra.set_last_updated_at(Time.now) if counter == length\n end\n end",
"def update_self obj\n obj.each do |k,v|\n instance_variable_set(\"@#{k}\", v) if v\n end\n end",
"def update_attributes(properties_hash)\n self.class.get_class_properties.each do |property|\n key = property[:name].to_sym\n if properties_hash.has_key? key\n self.setValue(properties_hash[key], forKey:key)\n end\n end\n end",
"def update\n # TODO: implement update\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @states = args[:states] if args.key?(:states)\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end",
"def update!(**args)\n @property = args[:property] if args.key?(:property)\n @total_value_count = args[:total_value_count] if args.key?(:total_value_count)\n @value = args[:value] if args.key?(:value)\n @value_status = args[:value_status] if args.key?(:value_status)\n end",
"def update\n \n end",
"def refresh\n set_attributes\n end",
"def update(attrs)\n @attrs.update(attrs)\n self\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @source = args[:source] if args.key?(:source)\n end",
"def update_resource object, attributes\n object.update attributes\n end",
"def update(attrs)\n @attrs ||= {}\n @attrs.update(attrs)\n self\n end",
"def update\n \n end",
"def update!(**args)\n @property = args[:property] if args.key?(:property)\n @schema = args[:schema] if args.key?(:schema)\n end",
"def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def _update!\n self.class.properties.each do |property, predicate|\n if dirty?(property)\n self.class.repository_or_fail.delete([subject, predicate[:predicate], nil])\n if self.class.is_list?(property)\n repo = RDF::Repository.new\n attribute_get(property).each do |value|\n repo << RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(value, self.class.properties[property][:type]))\n end\n self.class.repository_or_fail.insert(*repo)\n else\n self.class.repository_or_fail.insert(RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(attribute_get(property), self.class.properties[property][:type])))\n end\n end\n @dirty[property] = nil\n @attributes[:original][property] = attribute_get(property)\n end\n self.class.repository_or_fail.insert(RDF::Statement.new(@subject, RDF.type, type)) unless type.nil?\n end",
"def update(attributes = {})\n super(attributes)\n retrieve!\n self\n end",
"def update\n @objects.map(&:update);\n end",
"def update\n raise NotImplementedError\n end",
"def update\n raise NotImplementedError\n end",
"def live_update!(property)\n property_class = Vebra.models[:property][:class].to_s.camelize.constantize\n\n # ensure we have the full property attributes\n property.get_property if !property.attributes[:status] && property.attributes[:action] != 'deleted'\n\n # find & update or build a new property\n property_model = property_class.find_or_initialize_by_vebra_ref(property.attributes[:vebra_ref])\n\n # make sure property object is not empty\n return false if !property.attributes || !property.attributes[:property_type]\n\n # if the property has been deleted, mark it appropriately and move on\n if property.attributes[:action] == 'deleted'\n return property_model.destroy\n end\n\n # extract accessible attributes for the property\n property_accessibles = property_class.accessible_attributes.map(&:to_sym)\n property_attributes = property.attributes.inject({}) do |result, (key, value)|\n result[key] = value if property_accessibles.include?(key)\n result\n end\n\n # update the property model's attributes\n property_model.no_callbacks = true if property_model.respond_to?(:no_callbacks)\n property_model.update_attributes(property_attributes)\n\n # find & update or build a new address\n if Vebra.models[:address]\n address_class = Vebra.models[:address][:class].to_s.camelize.constantize\n address_model = property_model.send(Vebra.models[:property][:address_method])\n address_model = property_model.send(\"build_#{Vebra.models[:property][:address_method]}\") unless address_model\n\n # extract accessible attributes for the address\n address_accessibles = address_class.accessible_attributes.map(&:to_sym)\n address_attributes = property.attributes[:address].inject({}) do |result, (key, value)|\n result[key] = value if address_accessibles.include?(key)\n result\n end\n\n # update the address model's attributes\n address_model.update_attributes(address_attributes)\n end\n\n # find & update or build new rooms\n if Vebra.models[:room]\n room_class = Vebra.models[:room][:class].to_s.camelize.constantize\n\n # accessible attributes for the rooms\n room_accessibles = room_class.accessible_attributes.map(&:to_sym)\n\n # delete any rooms which are no longer present\n property_rooms = property.attributes[:rooms] || []\n property_model_rooms = property_model.send(Vebra.models[:property][:rooms_method])\n refs_to_delete = property_model_rooms.map(&:vebra_ref) - property_rooms.map { |r| r[:vebra_ref] }\n property_model_rooms.each do |room|\n room.destroy if refs_to_delete.include?(room.vebra_ref)\n end\n\n # find & update or build new rooms\n property_rooms.each do |room|\n room_model = room_class.find_by_property_id_and_vebra_ref(property_model.id, room[:vebra_ref])\n room_model = property_model_rooms.build unless room_model\n\n # extract accessible attributes for the room\n room_attributes = room.inject({}) do |result, (key, value)|\n result[key] = value if room_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n room_model.update_attributes(room_attributes)\n end\n end\n\n # find & update or build new file attachments\n if Vebra.models[:file]\n file_class = Vebra.models[:file][:class].to_s.camelize.constantize\n\n # accessible attributes for the files\n file_accessibles = file_class.accessible_attributes.map(&:to_sym)\n\n # first normalize the collection (currently nested collections)\n property_files = property.attributes[:files].inject([]) do |result, (kind, collection)|\n collection.each do |file|\n file[:type] = kind.to_s.singularize.camelize if file_accessibles.include?(:type)\n file[\"remote_#{Vebra.models[:file][:attachment_method]}_url\".to_sym] = file.delete(:url)\n # if file[:type] is set, it means the attachment file class can be subclassed. In this\n # case we need to ensure that the subclass exists. If not, we ignore this file\n begin\n file[:type].constantize if file_accessibles.include?(:type)\n result << file\n rescue NameError => e\n # ignore - this means the subclass does not exist\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n\n result\n end\n\n # delete any files which are no longer present\n property_model_files = property_model.send(Vebra.models[:property][:files_method])\n refs_to_delete = property_model_files.map(&:vebra_ref) - property_files.map { |f| f[:vebra_ref] }\n property_model_files.each do |file|\n file.destroy if refs_to_delete.include?(file.vebra_ref)\n end\n\n # find & update or build new files\n property_files.each do |file|\n begin\n file_model = property_model_files.find_by_vebra_ref(file[:vebra_ref])\n file_model = property_model_files.build unless file_model\n\n # extract accessible attributes for the file\n file_attributes = file.inject({}) do |result, (key, value)|\n result[key] = value if file_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n file_model.update_attributes(file_attributes)\n rescue CarrierWave::ProcessingError, OpenURI::HTTPError => e\n # just ignore the file\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n end\n\n property_model.no_callbacks = false if property_model.respond_to?(:no_callbacks)\n property_model.save\n return property_model\n end",
"def update!(**args)\n @id = args[:id] if args.key?(:id)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def update\n end",
"def update!(**args)\n @mid = args[:mid] if args.key?(:mid)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def modified_properties=(value)\n @modified_properties = value\n end",
"def apply_properties!(properties)\n # Non-commutitivity etc. eventually.\n end",
"def set_properties(hash)\n hash.each do |key, value|\n add_or_remove_ostruct_member(key, value)\n end\n rest_reset_properties\n end",
"def update\n\t\t\n\t\tend",
"def set_props(props)\n @props.merge!(props)\n end",
"def update() end",
"def update!(**args)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def assign_properties\n self.properties ||= {}\n listing_properties.each do |prop|\n self.properties[prop.key] ||= prop.value\n end\n end",
"def change_properties(new_current_floor, new_next_floor, new_movement)\n @current_floor = new_current_floor\n @next_floor = new_next_floor\n @movement = new_movement\n end",
"def update!(**args)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end",
"def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end",
"def update(attributes)\n (@attributes ||= {}).merge! attributes\n\n (self.class.attr_initializables & attributes.keys).each do |name|\n instance_variable_set :\"@#{name}\", attributes[name]\n end\n\n self\n end",
"def update_attributes(attrs)\n super({})\n end",
"def update\n @dirty = true\n end",
"def update\n\n # Run through the mixin updates\n colourable_update\n movable_update\n\n end",
"def set(props)\n props.each do |prop, val|\n self.send(:\"#{ prop }=\", val)\n end\n end",
"def update\n super\n end",
"def update!(**args)\n @property_id = args[:property_id] if args.key?(:property_id)\n @value_status = args[:value_status] if args.key?(:value_status)\n end",
"def update!(**args)\n @object_size_bytes = args[:object_size_bytes] if args.key?(:object_size_bytes)\n @object_version = args[:object_version] if args.key?(:object_version)\n end",
"def movable_update\n\n # Work through the different aspects we update\n movable_location_update\n movable_size_update\n movable_angle_update\n\n end",
"def properties=(value)\n @properties = value\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(context={})\n self.pre_cast_attributes\n m2o = @relations.reject{|k, v| !self.class.many2one_relations.has_key?(k)}\n vals = @attributes.reject {|key, value| key == 'id'}.merge(m2o.merge(m2o){|k, v| v.is_a?(Array) ? v[0] : v})\n self.class.rpc_execute('write', self.id, vals, context)\n reload_from_record!(self.class.find(self.id, :context => context))\n end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update ; end",
"def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end",
"def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end",
"def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end",
"def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end",
"def update_with(attributes)\n assign_attributes(attributes)\n end",
"def update\n # don't need to update; hash is shared\n end",
"def update(attributes)\n HashProxy.with(attributes) do |proxy|\n self.class.attribute_names.each do |name|\n send(\"#{name}=\", proxy[name]) if proxy.key?(name)\n end\n end\n save\n end",
"def update!(**args)\n @object_id_prop = args[:object_id_prop] if args.key?(:object_id_prop)\n @relation = args[:relation] if args.key?(:relation)\n @subject_id = args[:subject_id] if args.key?(:subject_id)\n end",
"def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end",
"def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end",
"def update\n raise NotImplementedError\n end",
"def update_attributes attributes\n @attributes.merge! attributes\n end",
"def update!(**args)\n @async_options = args[:async_options] if args.key?(:async_options)\n @input_mappings = args[:input_mappings] if args.key?(:input_mappings)\n @name_property = args[:name_property] if args.key?(:name_property)\n @validation_options = args[:validation_options] if args.key?(:validation_options)\n end",
"def update\r\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @type = args[:type] if args.key?(:type)\n end",
"def update\n raise NotImplemented\n end",
"def update_obj\n mean, sd = rating.to_glicko_rating\n @obj.rating = mean\n @obj.rating_deviation = sd\n @obj.volatility = volatility\n end",
"def update_values\n end",
"def update_values\n end",
"def update\n raise NotImplementedError\n end",
"def update!(**args)\n @answers_header_signals = args[:answers_header_signals] if args.key?(:answers_header_signals)\n @property_value = args[:property_value] if args.key?(:property_value)\n @response_meaning_application = args[:response_meaning_application] if args.key?(:response_meaning_application)\n end",
"def update!(**args)\n @create_time = args[:create_time] if args.key?(:create_time)\n @method_prop = args[:method_prop] if args.key?(:method_prop)\n @name = args[:name] if args.key?(:name)\n @state = args[:state] if args.key?(:state)\n end",
"def update attributes, collection #:nodoc:\n 0\n end",
"def update_property_groups(roll)\n @property_groups.each { |_, v| v.update_rent(roll) }\n end",
"def update!(**args)\n @source_property = args[:source_property] if args.key?(:source_property)\n 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 update_properties(path, properties)\n prop_patch = PropPatch.new(properties)\n emit('propPatch', [path, prop_patch])\n prop_patch.commit\n\n prop_patch.result\n end",
"def update\n set_deltatime\n set_last_update_at\n end"
] | [
"0.7012263",
"0.69181895",
"0.69181895",
"0.69181895",
"0.69181895",
"0.69181895",
"0.67403597",
"0.6709326",
"0.6709326",
"0.6696149",
"0.6696149",
"0.6696149",
"0.6696149",
"0.6618882",
"0.6571848",
"0.65386343",
"0.65178275",
"0.6394807",
"0.6389745",
"0.6389745",
"0.63328",
"0.6319025",
"0.6283673",
"0.6269463",
"0.62639254",
"0.62410724",
"0.62170374",
"0.62152076",
"0.6210263",
"0.6204041",
"0.6204041",
"0.62021106",
"0.62017816",
"0.62017",
"0.61730784",
"0.61730784",
"0.6159277",
"0.6156169",
"0.61445665",
"0.6125433",
"0.61241156",
"0.6121413",
"0.6110477",
"0.6105694",
"0.61016303",
"0.60845226",
"0.6084427",
"0.6065455",
"0.6059506",
"0.6054869",
"0.6051708",
"0.6051708",
"0.60413384",
"0.6030853",
"0.6022535",
"0.6015561",
"0.59932375",
"0.59898263",
"0.5976479",
"0.5973787",
"0.59678394",
"0.5963291",
"0.5962048",
"0.5961157",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.59500545",
"0.59443134",
"0.59443134",
"0.59424853",
"0.59424853",
"0.593523",
"0.5926413",
"0.5924831",
"0.592427",
"0.59233046",
"0.59233046",
"0.5921224",
"0.59144294",
"0.59142506",
"0.58887535",
"0.58854496",
"0.5883008",
"0.58792305",
"0.5876954",
"0.5876954",
"0.58744955",
"0.5857968",
"0.5845542",
"0.5841629",
"0.58363605",
"0.5829255",
"0.582919",
"0.5822138",
"0.58208305"
] | 0.0 | -1 |
Update properties of this object | def update!(**args)
@exempted_members = args[:exempted_members] if args.key?(:exempted_members)
@log_type = args[:log_type] if args.key?(:log_type)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update_properties(hash)\n hash.each do |key, value|\n setter_method = \"#{key}=\"\n if self.respond_to?(setter_method)\n self.send(setter_method, value)\n end\n end\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def refresh\n self.class.base_properties.each_with_index do |prop, prop_id|\n @properties[prop] = get_property(prop_id)\n end\n refresh_features\n refresh_status\n refresh_config\n self\n end",
"def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\n end",
"def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\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 update_properties!(branch_id=nil)\n properties = fetch_properties(false, branch_id)\n length = properties.length\n counter = 0\n properties.each do |property|\n counter += 1\n if Vebra.debugging?\n puts \"[Vebra]: #{counter}/#{length}: live updating property with Vebra ref: #{property.attributes[:vebra_ref]}\"\n end\n live_update!(property)\n Vebra.set_last_updated_at(Time.now) if counter == length\n end\n end",
"def update_self obj\n obj.each do |k,v|\n instance_variable_set(\"@#{k}\", v) if v\n end\n end",
"def update_attributes(properties_hash)\n self.class.get_class_properties.each do |property|\n key = property[:name].to_sym\n if properties_hash.has_key? key\n self.setValue(properties_hash[key], forKey:key)\n end\n end\n end",
"def update\n # TODO: implement update\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @states = args[:states] if args.key?(:states)\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end",
"def update!(**args)\n @property = args[:property] if args.key?(:property)\n @total_value_count = args[:total_value_count] if args.key?(:total_value_count)\n @value = args[:value] if args.key?(:value)\n @value_status = args[:value_status] if args.key?(:value_status)\n end",
"def update\n \n end",
"def refresh\n set_attributes\n end",
"def update(attrs)\n @attrs.update(attrs)\n self\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @source = args[:source] if args.key?(:source)\n end",
"def update_resource object, attributes\n object.update attributes\n end",
"def update(attrs)\n @attrs ||= {}\n @attrs.update(attrs)\n self\n end",
"def update\n \n end",
"def update!(**args)\n @property = args[:property] if args.key?(:property)\n @schema = args[:schema] if args.key?(:schema)\n end",
"def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def _update!\n self.class.properties.each do |property, predicate|\n if dirty?(property)\n self.class.repository_or_fail.delete([subject, predicate[:predicate], nil])\n if self.class.is_list?(property)\n repo = RDF::Repository.new\n attribute_get(property).each do |value|\n repo << RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(value, self.class.properties[property][:type]))\n end\n self.class.repository_or_fail.insert(*repo)\n else\n self.class.repository_or_fail.insert(RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(attribute_get(property), self.class.properties[property][:type])))\n end\n end\n @dirty[property] = nil\n @attributes[:original][property] = attribute_get(property)\n end\n self.class.repository_or_fail.insert(RDF::Statement.new(@subject, RDF.type, type)) unless type.nil?\n end",
"def update(attributes = {})\n super(attributes)\n retrieve!\n self\n end",
"def update\n @objects.map(&:update);\n end",
"def update\n raise NotImplementedError\n end",
"def update\n raise NotImplementedError\n end",
"def live_update!(property)\n property_class = Vebra.models[:property][:class].to_s.camelize.constantize\n\n # ensure we have the full property attributes\n property.get_property if !property.attributes[:status] && property.attributes[:action] != 'deleted'\n\n # find & update or build a new property\n property_model = property_class.find_or_initialize_by_vebra_ref(property.attributes[:vebra_ref])\n\n # make sure property object is not empty\n return false if !property.attributes || !property.attributes[:property_type]\n\n # if the property has been deleted, mark it appropriately and move on\n if property.attributes[:action] == 'deleted'\n return property_model.destroy\n end\n\n # extract accessible attributes for the property\n property_accessibles = property_class.accessible_attributes.map(&:to_sym)\n property_attributes = property.attributes.inject({}) do |result, (key, value)|\n result[key] = value if property_accessibles.include?(key)\n result\n end\n\n # update the property model's attributes\n property_model.no_callbacks = true if property_model.respond_to?(:no_callbacks)\n property_model.update_attributes(property_attributes)\n\n # find & update or build a new address\n if Vebra.models[:address]\n address_class = Vebra.models[:address][:class].to_s.camelize.constantize\n address_model = property_model.send(Vebra.models[:property][:address_method])\n address_model = property_model.send(\"build_#{Vebra.models[:property][:address_method]}\") unless address_model\n\n # extract accessible attributes for the address\n address_accessibles = address_class.accessible_attributes.map(&:to_sym)\n address_attributes = property.attributes[:address].inject({}) do |result, (key, value)|\n result[key] = value if address_accessibles.include?(key)\n result\n end\n\n # update the address model's attributes\n address_model.update_attributes(address_attributes)\n end\n\n # find & update or build new rooms\n if Vebra.models[:room]\n room_class = Vebra.models[:room][:class].to_s.camelize.constantize\n\n # accessible attributes for the rooms\n room_accessibles = room_class.accessible_attributes.map(&:to_sym)\n\n # delete any rooms which are no longer present\n property_rooms = property.attributes[:rooms] || []\n property_model_rooms = property_model.send(Vebra.models[:property][:rooms_method])\n refs_to_delete = property_model_rooms.map(&:vebra_ref) - property_rooms.map { |r| r[:vebra_ref] }\n property_model_rooms.each do |room|\n room.destroy if refs_to_delete.include?(room.vebra_ref)\n end\n\n # find & update or build new rooms\n property_rooms.each do |room|\n room_model = room_class.find_by_property_id_and_vebra_ref(property_model.id, room[:vebra_ref])\n room_model = property_model_rooms.build unless room_model\n\n # extract accessible attributes for the room\n room_attributes = room.inject({}) do |result, (key, value)|\n result[key] = value if room_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n room_model.update_attributes(room_attributes)\n end\n end\n\n # find & update or build new file attachments\n if Vebra.models[:file]\n file_class = Vebra.models[:file][:class].to_s.camelize.constantize\n\n # accessible attributes for the files\n file_accessibles = file_class.accessible_attributes.map(&:to_sym)\n\n # first normalize the collection (currently nested collections)\n property_files = property.attributes[:files].inject([]) do |result, (kind, collection)|\n collection.each do |file|\n file[:type] = kind.to_s.singularize.camelize if file_accessibles.include?(:type)\n file[\"remote_#{Vebra.models[:file][:attachment_method]}_url\".to_sym] = file.delete(:url)\n # if file[:type] is set, it means the attachment file class can be subclassed. In this\n # case we need to ensure that the subclass exists. If not, we ignore this file\n begin\n file[:type].constantize if file_accessibles.include?(:type)\n result << file\n rescue NameError => e\n # ignore - this means the subclass does not exist\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n\n result\n end\n\n # delete any files which are no longer present\n property_model_files = property_model.send(Vebra.models[:property][:files_method])\n refs_to_delete = property_model_files.map(&:vebra_ref) - property_files.map { |f| f[:vebra_ref] }\n property_model_files.each do |file|\n file.destroy if refs_to_delete.include?(file.vebra_ref)\n end\n\n # find & update or build new files\n property_files.each do |file|\n begin\n file_model = property_model_files.find_by_vebra_ref(file[:vebra_ref])\n file_model = property_model_files.build unless file_model\n\n # extract accessible attributes for the file\n file_attributes = file.inject({}) do |result, (key, value)|\n result[key] = value if file_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n file_model.update_attributes(file_attributes)\n rescue CarrierWave::ProcessingError, OpenURI::HTTPError => e\n # just ignore the file\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n end\n\n property_model.no_callbacks = false if property_model.respond_to?(:no_callbacks)\n property_model.save\n return property_model\n end",
"def update!(**args)\n @id = args[:id] if args.key?(:id)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def update\n end",
"def update!(**args)\n @mid = args[:mid] if args.key?(:mid)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def modified_properties=(value)\n @modified_properties = value\n end",
"def apply_properties!(properties)\n # Non-commutitivity etc. eventually.\n end",
"def set_properties(hash)\n hash.each do |key, value|\n add_or_remove_ostruct_member(key, value)\n end\n rest_reset_properties\n end",
"def update\n\t\t\n\t\tend",
"def set_props(props)\n @props.merge!(props)\n end",
"def update() end",
"def update!(**args)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def assign_properties\n self.properties ||= {}\n listing_properties.each do |prop|\n self.properties[prop.key] ||= prop.value\n end\n end",
"def change_properties(new_current_floor, new_next_floor, new_movement)\n @current_floor = new_current_floor\n @next_floor = new_next_floor\n @movement = new_movement\n end",
"def update!(**args)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end",
"def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end",
"def update(attributes)\n (@attributes ||= {}).merge! attributes\n\n (self.class.attr_initializables & attributes.keys).each do |name|\n instance_variable_set :\"@#{name}\", attributes[name]\n end\n\n self\n end",
"def update_attributes(attrs)\n super({})\n end",
"def update\n @dirty = true\n end",
"def update\n\n # Run through the mixin updates\n colourable_update\n movable_update\n\n end",
"def set(props)\n props.each do |prop, val|\n self.send(:\"#{ prop }=\", val)\n end\n end",
"def update\n super\n end",
"def update!(**args)\n @property_id = args[:property_id] if args.key?(:property_id)\n @value_status = args[:value_status] if args.key?(:value_status)\n end",
"def update!(**args)\n @object_size_bytes = args[:object_size_bytes] if args.key?(:object_size_bytes)\n @object_version = args[:object_version] if args.key?(:object_version)\n end",
"def movable_update\n\n # Work through the different aspects we update\n movable_location_update\n movable_size_update\n movable_angle_update\n\n end",
"def properties=(value)\n @properties = value\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(context={})\n self.pre_cast_attributes\n m2o = @relations.reject{|k, v| !self.class.many2one_relations.has_key?(k)}\n vals = @attributes.reject {|key, value| key == 'id'}.merge(m2o.merge(m2o){|k, v| v.is_a?(Array) ? v[0] : v})\n self.class.rpc_execute('write', self.id, vals, context)\n reload_from_record!(self.class.find(self.id, :context => context))\n end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update ; end",
"def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end",
"def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end",
"def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end",
"def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end",
"def update_with(attributes)\n assign_attributes(attributes)\n end",
"def update\n # don't need to update; hash is shared\n end",
"def update(attributes)\n HashProxy.with(attributes) do |proxy|\n self.class.attribute_names.each do |name|\n send(\"#{name}=\", proxy[name]) if proxy.key?(name)\n end\n end\n save\n end",
"def update!(**args)\n @object_id_prop = args[:object_id_prop] if args.key?(:object_id_prop)\n @relation = args[:relation] if args.key?(:relation)\n @subject_id = args[:subject_id] if args.key?(:subject_id)\n end",
"def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end",
"def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end",
"def update\n raise NotImplementedError\n end",
"def update_attributes attributes\n @attributes.merge! attributes\n end",
"def update!(**args)\n @async_options = args[:async_options] if args.key?(:async_options)\n @input_mappings = args[:input_mappings] if args.key?(:input_mappings)\n @name_property = args[:name_property] if args.key?(:name_property)\n @validation_options = args[:validation_options] if args.key?(:validation_options)\n end",
"def update\r\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @type = args[:type] if args.key?(:type)\n end",
"def update\n raise NotImplemented\n end",
"def update_obj\n mean, sd = rating.to_glicko_rating\n @obj.rating = mean\n @obj.rating_deviation = sd\n @obj.volatility = volatility\n end",
"def update_values\n end",
"def update_values\n end",
"def update\n raise NotImplementedError\n end",
"def update!(**args)\n @answers_header_signals = args[:answers_header_signals] if args.key?(:answers_header_signals)\n @property_value = args[:property_value] if args.key?(:property_value)\n @response_meaning_application = args[:response_meaning_application] if args.key?(:response_meaning_application)\n end",
"def update!(**args)\n @create_time = args[:create_time] if args.key?(:create_time)\n @method_prop = args[:method_prop] if args.key?(:method_prop)\n @name = args[:name] if args.key?(:name)\n @state = args[:state] if args.key?(:state)\n end",
"def update attributes, collection #:nodoc:\n 0\n end",
"def update_property_groups(roll)\n @property_groups.each { |_, v| v.update_rent(roll) }\n end",
"def update!(**args)\n @source_property = args[:source_property] if args.key?(:source_property)\n 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 update_properties(path, properties)\n prop_patch = PropPatch.new(properties)\n emit('propPatch', [path, prop_patch])\n prop_patch.commit\n\n prop_patch.result\n end",
"def update\n set_deltatime\n set_last_update_at\n end"
] | [
"0.7012263",
"0.69181895",
"0.69181895",
"0.69181895",
"0.69181895",
"0.69181895",
"0.67403597",
"0.6709326",
"0.6709326",
"0.6696149",
"0.6696149",
"0.6696149",
"0.6696149",
"0.6618882",
"0.6571848",
"0.65386343",
"0.65178275",
"0.6394807",
"0.6389745",
"0.6389745",
"0.63328",
"0.6319025",
"0.6283673",
"0.6269463",
"0.62639254",
"0.62410724",
"0.62170374",
"0.62152076",
"0.6210263",
"0.6204041",
"0.6204041",
"0.62021106",
"0.62017816",
"0.62017",
"0.61730784",
"0.61730784",
"0.6159277",
"0.6156169",
"0.61445665",
"0.6125433",
"0.61241156",
"0.6121413",
"0.6110477",
"0.6105694",
"0.61016303",
"0.60845226",
"0.6084427",
"0.6065455",
"0.6059506",
"0.6054869",
"0.6051708",
"0.6051708",
"0.60413384",
"0.6030853",
"0.6022535",
"0.6015561",
"0.59932375",
"0.59898263",
"0.5976479",
"0.5973787",
"0.59678394",
"0.5963291",
"0.5962048",
"0.5961157",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.59500545",
"0.59443134",
"0.59443134",
"0.59424853",
"0.59424853",
"0.593523",
"0.5926413",
"0.5924831",
"0.592427",
"0.59233046",
"0.59233046",
"0.5921224",
"0.59144294",
"0.59142506",
"0.58887535",
"0.58854496",
"0.5883008",
"0.58792305",
"0.5876954",
"0.5876954",
"0.58744955",
"0.5857968",
"0.5845542",
"0.5841629",
"0.58363605",
"0.5829255",
"0.582919",
"0.5822138",
"0.58208305"
] | 0.0 | -1 |
Update properties of this object | def update!(**args)
@condition = args[:condition] if args.key?(:condition)
@members = args[:members] if args.key?(:members)
@role = args[:role] if args.key?(:role)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update_properties(hash)\n hash.each do |key, value|\n setter_method = \"#{key}=\"\n if self.respond_to?(setter_method)\n self.send(setter_method, value)\n end\n end\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def refresh\n self.class.base_properties.each_with_index do |prop, prop_id|\n @properties[prop] = get_property(prop_id)\n end\n refresh_features\n refresh_status\n refresh_config\n self\n end",
"def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\n end",
"def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\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 update_properties!(branch_id=nil)\n properties = fetch_properties(false, branch_id)\n length = properties.length\n counter = 0\n properties.each do |property|\n counter += 1\n if Vebra.debugging?\n puts \"[Vebra]: #{counter}/#{length}: live updating property with Vebra ref: #{property.attributes[:vebra_ref]}\"\n end\n live_update!(property)\n Vebra.set_last_updated_at(Time.now) if counter == length\n end\n end",
"def update_self obj\n obj.each do |k,v|\n instance_variable_set(\"@#{k}\", v) if v\n end\n end",
"def update_attributes(properties_hash)\n self.class.get_class_properties.each do |property|\n key = property[:name].to_sym\n if properties_hash.has_key? key\n self.setValue(properties_hash[key], forKey:key)\n end\n end\n end",
"def update\n # TODO: implement update\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @states = args[:states] if args.key?(:states)\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end",
"def update!(**args)\n @property = args[:property] if args.key?(:property)\n @total_value_count = args[:total_value_count] if args.key?(:total_value_count)\n @value = args[:value] if args.key?(:value)\n @value_status = args[:value_status] if args.key?(:value_status)\n end",
"def update\n \n end",
"def refresh\n set_attributes\n end",
"def update(attrs)\n @attrs.update(attrs)\n self\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @source = args[:source] if args.key?(:source)\n end",
"def update_resource object, attributes\n object.update attributes\n end",
"def update(attrs)\n @attrs ||= {}\n @attrs.update(attrs)\n self\n end",
"def update\n \n end",
"def update!(**args)\n @property = args[:property] if args.key?(:property)\n @schema = args[:schema] if args.key?(:schema)\n end",
"def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def _update!\n self.class.properties.each do |property, predicate|\n if dirty?(property)\n self.class.repository_or_fail.delete([subject, predicate[:predicate], nil])\n if self.class.is_list?(property)\n repo = RDF::Repository.new\n attribute_get(property).each do |value|\n repo << RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(value, self.class.properties[property][:type]))\n end\n self.class.repository_or_fail.insert(*repo)\n else\n self.class.repository_or_fail.insert(RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(attribute_get(property), self.class.properties[property][:type])))\n end\n end\n @dirty[property] = nil\n @attributes[:original][property] = attribute_get(property)\n end\n self.class.repository_or_fail.insert(RDF::Statement.new(@subject, RDF.type, type)) unless type.nil?\n end",
"def update(attributes = {})\n super(attributes)\n retrieve!\n self\n end",
"def update\n @objects.map(&:update);\n end",
"def update\n raise NotImplementedError\n end",
"def update\n raise NotImplementedError\n end",
"def live_update!(property)\n property_class = Vebra.models[:property][:class].to_s.camelize.constantize\n\n # ensure we have the full property attributes\n property.get_property if !property.attributes[:status] && property.attributes[:action] != 'deleted'\n\n # find & update or build a new property\n property_model = property_class.find_or_initialize_by_vebra_ref(property.attributes[:vebra_ref])\n\n # make sure property object is not empty\n return false if !property.attributes || !property.attributes[:property_type]\n\n # if the property has been deleted, mark it appropriately and move on\n if property.attributes[:action] == 'deleted'\n return property_model.destroy\n end\n\n # extract accessible attributes for the property\n property_accessibles = property_class.accessible_attributes.map(&:to_sym)\n property_attributes = property.attributes.inject({}) do |result, (key, value)|\n result[key] = value if property_accessibles.include?(key)\n result\n end\n\n # update the property model's attributes\n property_model.no_callbacks = true if property_model.respond_to?(:no_callbacks)\n property_model.update_attributes(property_attributes)\n\n # find & update or build a new address\n if Vebra.models[:address]\n address_class = Vebra.models[:address][:class].to_s.camelize.constantize\n address_model = property_model.send(Vebra.models[:property][:address_method])\n address_model = property_model.send(\"build_#{Vebra.models[:property][:address_method]}\") unless address_model\n\n # extract accessible attributes for the address\n address_accessibles = address_class.accessible_attributes.map(&:to_sym)\n address_attributes = property.attributes[:address].inject({}) do |result, (key, value)|\n result[key] = value if address_accessibles.include?(key)\n result\n end\n\n # update the address model's attributes\n address_model.update_attributes(address_attributes)\n end\n\n # find & update or build new rooms\n if Vebra.models[:room]\n room_class = Vebra.models[:room][:class].to_s.camelize.constantize\n\n # accessible attributes for the rooms\n room_accessibles = room_class.accessible_attributes.map(&:to_sym)\n\n # delete any rooms which are no longer present\n property_rooms = property.attributes[:rooms] || []\n property_model_rooms = property_model.send(Vebra.models[:property][:rooms_method])\n refs_to_delete = property_model_rooms.map(&:vebra_ref) - property_rooms.map { |r| r[:vebra_ref] }\n property_model_rooms.each do |room|\n room.destroy if refs_to_delete.include?(room.vebra_ref)\n end\n\n # find & update or build new rooms\n property_rooms.each do |room|\n room_model = room_class.find_by_property_id_and_vebra_ref(property_model.id, room[:vebra_ref])\n room_model = property_model_rooms.build unless room_model\n\n # extract accessible attributes for the room\n room_attributes = room.inject({}) do |result, (key, value)|\n result[key] = value if room_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n room_model.update_attributes(room_attributes)\n end\n end\n\n # find & update or build new file attachments\n if Vebra.models[:file]\n file_class = Vebra.models[:file][:class].to_s.camelize.constantize\n\n # accessible attributes for the files\n file_accessibles = file_class.accessible_attributes.map(&:to_sym)\n\n # first normalize the collection (currently nested collections)\n property_files = property.attributes[:files].inject([]) do |result, (kind, collection)|\n collection.each do |file|\n file[:type] = kind.to_s.singularize.camelize if file_accessibles.include?(:type)\n file[\"remote_#{Vebra.models[:file][:attachment_method]}_url\".to_sym] = file.delete(:url)\n # if file[:type] is set, it means the attachment file class can be subclassed. In this\n # case we need to ensure that the subclass exists. If not, we ignore this file\n begin\n file[:type].constantize if file_accessibles.include?(:type)\n result << file\n rescue NameError => e\n # ignore - this means the subclass does not exist\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n\n result\n end\n\n # delete any files which are no longer present\n property_model_files = property_model.send(Vebra.models[:property][:files_method])\n refs_to_delete = property_model_files.map(&:vebra_ref) - property_files.map { |f| f[:vebra_ref] }\n property_model_files.each do |file|\n file.destroy if refs_to_delete.include?(file.vebra_ref)\n end\n\n # find & update or build new files\n property_files.each do |file|\n begin\n file_model = property_model_files.find_by_vebra_ref(file[:vebra_ref])\n file_model = property_model_files.build unless file_model\n\n # extract accessible attributes for the file\n file_attributes = file.inject({}) do |result, (key, value)|\n result[key] = value if file_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n file_model.update_attributes(file_attributes)\n rescue CarrierWave::ProcessingError, OpenURI::HTTPError => e\n # just ignore the file\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n end\n\n property_model.no_callbacks = false if property_model.respond_to?(:no_callbacks)\n property_model.save\n return property_model\n end",
"def update!(**args)\n @id = args[:id] if args.key?(:id)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def update\n end",
"def update!(**args)\n @mid = args[:mid] if args.key?(:mid)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def modified_properties=(value)\n @modified_properties = value\n end",
"def apply_properties!(properties)\n # Non-commutitivity etc. eventually.\n end",
"def set_properties(hash)\n hash.each do |key, value|\n add_or_remove_ostruct_member(key, value)\n end\n rest_reset_properties\n end",
"def update\n\t\t\n\t\tend",
"def set_props(props)\n @props.merge!(props)\n end",
"def update() end",
"def update!(**args)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def assign_properties\n self.properties ||= {}\n listing_properties.each do |prop|\n self.properties[prop.key] ||= prop.value\n end\n end",
"def change_properties(new_current_floor, new_next_floor, new_movement)\n @current_floor = new_current_floor\n @next_floor = new_next_floor\n @movement = new_movement\n end",
"def update!(**args)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end",
"def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end",
"def update(attributes)\n (@attributes ||= {}).merge! attributes\n\n (self.class.attr_initializables & attributes.keys).each do |name|\n instance_variable_set :\"@#{name}\", attributes[name]\n end\n\n self\n end",
"def update_attributes(attrs)\n super({})\n end",
"def update\n @dirty = true\n end",
"def update\n\n # Run through the mixin updates\n colourable_update\n movable_update\n\n end",
"def set(props)\n props.each do |prop, val|\n self.send(:\"#{ prop }=\", val)\n end\n end",
"def update\n super\n end",
"def update!(**args)\n @property_id = args[:property_id] if args.key?(:property_id)\n @value_status = args[:value_status] if args.key?(:value_status)\n end",
"def update!(**args)\n @object_size_bytes = args[:object_size_bytes] if args.key?(:object_size_bytes)\n @object_version = args[:object_version] if args.key?(:object_version)\n end",
"def movable_update\n\n # Work through the different aspects we update\n movable_location_update\n movable_size_update\n movable_angle_update\n\n end",
"def properties=(value)\n @properties = value\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(context={})\n self.pre_cast_attributes\n m2o = @relations.reject{|k, v| !self.class.many2one_relations.has_key?(k)}\n vals = @attributes.reject {|key, value| key == 'id'}.merge(m2o.merge(m2o){|k, v| v.is_a?(Array) ? v[0] : v})\n self.class.rpc_execute('write', self.id, vals, context)\n reload_from_record!(self.class.find(self.id, :context => context))\n end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update ; end",
"def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end",
"def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end",
"def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end",
"def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end",
"def update_with(attributes)\n assign_attributes(attributes)\n end",
"def update\n # don't need to update; hash is shared\n end",
"def update(attributes)\n HashProxy.with(attributes) do |proxy|\n self.class.attribute_names.each do |name|\n send(\"#{name}=\", proxy[name]) if proxy.key?(name)\n end\n end\n save\n end",
"def update!(**args)\n @object_id_prop = args[:object_id_prop] if args.key?(:object_id_prop)\n @relation = args[:relation] if args.key?(:relation)\n @subject_id = args[:subject_id] if args.key?(:subject_id)\n end",
"def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end",
"def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end",
"def update\n raise NotImplementedError\n end",
"def update_attributes attributes\n @attributes.merge! attributes\n end",
"def update!(**args)\n @async_options = args[:async_options] if args.key?(:async_options)\n @input_mappings = args[:input_mappings] if args.key?(:input_mappings)\n @name_property = args[:name_property] if args.key?(:name_property)\n @validation_options = args[:validation_options] if args.key?(:validation_options)\n end",
"def update\r\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @type = args[:type] if args.key?(:type)\n end",
"def update\n raise NotImplemented\n end",
"def update_obj\n mean, sd = rating.to_glicko_rating\n @obj.rating = mean\n @obj.rating_deviation = sd\n @obj.volatility = volatility\n end",
"def update_values\n end",
"def update_values\n end",
"def update\n raise NotImplementedError\n end",
"def update!(**args)\n @answers_header_signals = args[:answers_header_signals] if args.key?(:answers_header_signals)\n @property_value = args[:property_value] if args.key?(:property_value)\n @response_meaning_application = args[:response_meaning_application] if args.key?(:response_meaning_application)\n end",
"def update!(**args)\n @create_time = args[:create_time] if args.key?(:create_time)\n @method_prop = args[:method_prop] if args.key?(:method_prop)\n @name = args[:name] if args.key?(:name)\n @state = args[:state] if args.key?(:state)\n end",
"def update attributes, collection #:nodoc:\n 0\n end",
"def update_property_groups(roll)\n @property_groups.each { |_, v| v.update_rent(roll) }\n end",
"def update!(**args)\n @source_property = args[:source_property] if args.key?(:source_property)\n 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 update_properties(path, properties)\n prop_patch = PropPatch.new(properties)\n emit('propPatch', [path, prop_patch])\n prop_patch.commit\n\n prop_patch.result\n end",
"def update\n set_deltatime\n set_last_update_at\n end"
] | [
"0.7012263",
"0.69181895",
"0.69181895",
"0.69181895",
"0.69181895",
"0.69181895",
"0.67403597",
"0.6709326",
"0.6709326",
"0.6696149",
"0.6696149",
"0.6696149",
"0.6696149",
"0.6618882",
"0.6571848",
"0.65386343",
"0.65178275",
"0.6394807",
"0.6389745",
"0.6389745",
"0.63328",
"0.6319025",
"0.6283673",
"0.6269463",
"0.62639254",
"0.62410724",
"0.62170374",
"0.62152076",
"0.6210263",
"0.6204041",
"0.6204041",
"0.62021106",
"0.62017816",
"0.62017",
"0.61730784",
"0.61730784",
"0.6159277",
"0.6156169",
"0.61445665",
"0.6125433",
"0.61241156",
"0.6121413",
"0.6110477",
"0.6105694",
"0.61016303",
"0.60845226",
"0.6084427",
"0.6065455",
"0.6059506",
"0.6054869",
"0.6051708",
"0.6051708",
"0.60413384",
"0.6030853",
"0.6022535",
"0.6015561",
"0.59932375",
"0.59898263",
"0.5976479",
"0.5973787",
"0.59678394",
"0.5963291",
"0.5962048",
"0.5961157",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.59500545",
"0.59443134",
"0.59443134",
"0.59424853",
"0.59424853",
"0.593523",
"0.5926413",
"0.5924831",
"0.592427",
"0.59233046",
"0.59233046",
"0.5921224",
"0.59144294",
"0.59142506",
"0.58887535",
"0.58854496",
"0.5883008",
"0.58792305",
"0.5876954",
"0.5876954",
"0.58744955",
"0.5857968",
"0.5845542",
"0.5841629",
"0.58363605",
"0.5829255",
"0.582919",
"0.5822138",
"0.58208305"
] | 0.0 | -1 |
Update properties of this object | def update!(**args)
@audit_configs = args[:audit_configs] if args.key?(:audit_configs)
@bindings = args[:bindings] if args.key?(:bindings)
@etag = args[:etag] if args.key?(:etag)
@version = args[:version] if args.key?(:version)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update_properties(hash)\n hash.each do |key, value|\n setter_method = \"#{key}=\"\n if self.respond_to?(setter_method)\n self.send(setter_method, value)\n end\n end\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def refresh\n self.class.base_properties.each_with_index do |prop, prop_id|\n @properties[prop] = get_property(prop_id)\n end\n refresh_features\n refresh_status\n refresh_config\n self\n end",
"def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\n end",
"def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\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 update_properties!(branch_id=nil)\n properties = fetch_properties(false, branch_id)\n length = properties.length\n counter = 0\n properties.each do |property|\n counter += 1\n if Vebra.debugging?\n puts \"[Vebra]: #{counter}/#{length}: live updating property with Vebra ref: #{property.attributes[:vebra_ref]}\"\n end\n live_update!(property)\n Vebra.set_last_updated_at(Time.now) if counter == length\n end\n end",
"def update_self obj\n obj.each do |k,v|\n instance_variable_set(\"@#{k}\", v) if v\n end\n end",
"def update_attributes(properties_hash)\n self.class.get_class_properties.each do |property|\n key = property[:name].to_sym\n if properties_hash.has_key? key\n self.setValue(properties_hash[key], forKey:key)\n end\n end\n end",
"def update\n # TODO: implement update\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @states = args[:states] if args.key?(:states)\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end",
"def update!(**args)\n @property = args[:property] if args.key?(:property)\n @total_value_count = args[:total_value_count] if args.key?(:total_value_count)\n @value = args[:value] if args.key?(:value)\n @value_status = args[:value_status] if args.key?(:value_status)\n end",
"def update\n \n end",
"def refresh\n set_attributes\n end",
"def update(attrs)\n @attrs.update(attrs)\n self\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @source = args[:source] if args.key?(:source)\n end",
"def update_resource object, attributes\n object.update attributes\n end",
"def update(attrs)\n @attrs ||= {}\n @attrs.update(attrs)\n self\n end",
"def update\n \n end",
"def update!(**args)\n @property = args[:property] if args.key?(:property)\n @schema = args[:schema] if args.key?(:schema)\n end",
"def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def update(attributes = {})\n super(attributes)\n retrieve!\n self\n end",
"def _update!\n self.class.properties.each do |property, predicate|\n if dirty?(property)\n self.class.repository_or_fail.delete([subject, predicate[:predicate], nil])\n if self.class.is_list?(property)\n repo = RDF::Repository.new\n attribute_get(property).each do |value|\n repo << RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(value, self.class.properties[property][:type]))\n end\n self.class.repository_or_fail.insert(*repo)\n else\n self.class.repository_or_fail.insert(RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(attribute_get(property), self.class.properties[property][:type])))\n end\n end\n @dirty[property] = nil\n @attributes[:original][property] = attribute_get(property)\n end\n self.class.repository_or_fail.insert(RDF::Statement.new(@subject, RDF.type, type)) unless type.nil?\n end",
"def update\n @objects.map(&:update);\n end",
"def update\n raise NotImplementedError\n end",
"def update\n raise NotImplementedError\n end",
"def live_update!(property)\n property_class = Vebra.models[:property][:class].to_s.camelize.constantize\n\n # ensure we have the full property attributes\n property.get_property if !property.attributes[:status] && property.attributes[:action] != 'deleted'\n\n # find & update or build a new property\n property_model = property_class.find_or_initialize_by_vebra_ref(property.attributes[:vebra_ref])\n\n # make sure property object is not empty\n return false if !property.attributes || !property.attributes[:property_type]\n\n # if the property has been deleted, mark it appropriately and move on\n if property.attributes[:action] == 'deleted'\n return property_model.destroy\n end\n\n # extract accessible attributes for the property\n property_accessibles = property_class.accessible_attributes.map(&:to_sym)\n property_attributes = property.attributes.inject({}) do |result, (key, value)|\n result[key] = value if property_accessibles.include?(key)\n result\n end\n\n # update the property model's attributes\n property_model.no_callbacks = true if property_model.respond_to?(:no_callbacks)\n property_model.update_attributes(property_attributes)\n\n # find & update or build a new address\n if Vebra.models[:address]\n address_class = Vebra.models[:address][:class].to_s.camelize.constantize\n address_model = property_model.send(Vebra.models[:property][:address_method])\n address_model = property_model.send(\"build_#{Vebra.models[:property][:address_method]}\") unless address_model\n\n # extract accessible attributes for the address\n address_accessibles = address_class.accessible_attributes.map(&:to_sym)\n address_attributes = property.attributes[:address].inject({}) do |result, (key, value)|\n result[key] = value if address_accessibles.include?(key)\n result\n end\n\n # update the address model's attributes\n address_model.update_attributes(address_attributes)\n end\n\n # find & update or build new rooms\n if Vebra.models[:room]\n room_class = Vebra.models[:room][:class].to_s.camelize.constantize\n\n # accessible attributes for the rooms\n room_accessibles = room_class.accessible_attributes.map(&:to_sym)\n\n # delete any rooms which are no longer present\n property_rooms = property.attributes[:rooms] || []\n property_model_rooms = property_model.send(Vebra.models[:property][:rooms_method])\n refs_to_delete = property_model_rooms.map(&:vebra_ref) - property_rooms.map { |r| r[:vebra_ref] }\n property_model_rooms.each do |room|\n room.destroy if refs_to_delete.include?(room.vebra_ref)\n end\n\n # find & update or build new rooms\n property_rooms.each do |room|\n room_model = room_class.find_by_property_id_and_vebra_ref(property_model.id, room[:vebra_ref])\n room_model = property_model_rooms.build unless room_model\n\n # extract accessible attributes for the room\n room_attributes = room.inject({}) do |result, (key, value)|\n result[key] = value if room_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n room_model.update_attributes(room_attributes)\n end\n end\n\n # find & update or build new file attachments\n if Vebra.models[:file]\n file_class = Vebra.models[:file][:class].to_s.camelize.constantize\n\n # accessible attributes for the files\n file_accessibles = file_class.accessible_attributes.map(&:to_sym)\n\n # first normalize the collection (currently nested collections)\n property_files = property.attributes[:files].inject([]) do |result, (kind, collection)|\n collection.each do |file|\n file[:type] = kind.to_s.singularize.camelize if file_accessibles.include?(:type)\n file[\"remote_#{Vebra.models[:file][:attachment_method]}_url\".to_sym] = file.delete(:url)\n # if file[:type] is set, it means the attachment file class can be subclassed. In this\n # case we need to ensure that the subclass exists. If not, we ignore this file\n begin\n file[:type].constantize if file_accessibles.include?(:type)\n result << file\n rescue NameError => e\n # ignore - this means the subclass does not exist\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n\n result\n end\n\n # delete any files which are no longer present\n property_model_files = property_model.send(Vebra.models[:property][:files_method])\n refs_to_delete = property_model_files.map(&:vebra_ref) - property_files.map { |f| f[:vebra_ref] }\n property_model_files.each do |file|\n file.destroy if refs_to_delete.include?(file.vebra_ref)\n end\n\n # find & update or build new files\n property_files.each do |file|\n begin\n file_model = property_model_files.find_by_vebra_ref(file[:vebra_ref])\n file_model = property_model_files.build unless file_model\n\n # extract accessible attributes for the file\n file_attributes = file.inject({}) do |result, (key, value)|\n result[key] = value if file_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n file_model.update_attributes(file_attributes)\n rescue CarrierWave::ProcessingError, OpenURI::HTTPError => e\n # just ignore the file\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n end\n\n property_model.no_callbacks = false if property_model.respond_to?(:no_callbacks)\n property_model.save\n return property_model\n end",
"def update!(**args)\n @id = args[:id] if args.key?(:id)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def update\n end",
"def update!(**args)\n @mid = args[:mid] if args.key?(:mid)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def modified_properties=(value)\n @modified_properties = value\n end",
"def apply_properties!(properties)\n # Non-commutitivity etc. eventually.\n end",
"def set_properties(hash)\n hash.each do |key, value|\n add_or_remove_ostruct_member(key, value)\n end\n rest_reset_properties\n end",
"def update\n\t\t\n\t\tend",
"def set_props(props)\n @props.merge!(props)\n end",
"def update() end",
"def update!(**args)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def assign_properties\n self.properties ||= {}\n listing_properties.each do |prop|\n self.properties[prop.key] ||= prop.value\n end\n end",
"def change_properties(new_current_floor, new_next_floor, new_movement)\n @current_floor = new_current_floor\n @next_floor = new_next_floor\n @movement = new_movement\n end",
"def update!(**args)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end",
"def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end",
"def update(attributes)\n (@attributes ||= {}).merge! attributes\n\n (self.class.attr_initializables & attributes.keys).each do |name|\n instance_variable_set :\"@#{name}\", attributes[name]\n end\n\n self\n end",
"def update_attributes(attrs)\n super({})\n end",
"def update\n @dirty = true\n end",
"def update\n\n # Run through the mixin updates\n colourable_update\n movable_update\n\n end",
"def set(props)\n props.each do |prop, val|\n self.send(:\"#{ prop }=\", val)\n end\n end",
"def update\n super\n end",
"def update!(**args)\n @property_id = args[:property_id] if args.key?(:property_id)\n @value_status = args[:value_status] if args.key?(:value_status)\n end",
"def update!(**args)\n @object_size_bytes = args[:object_size_bytes] if args.key?(:object_size_bytes)\n @object_version = args[:object_version] if args.key?(:object_version)\n end",
"def movable_update\n\n # Work through the different aspects we update\n movable_location_update\n movable_size_update\n movable_angle_update\n\n end",
"def properties=(value)\n @properties = value\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(context={})\n self.pre_cast_attributes\n m2o = @relations.reject{|k, v| !self.class.many2one_relations.has_key?(k)}\n vals = @attributes.reject {|key, value| key == 'id'}.merge(m2o.merge(m2o){|k, v| v.is_a?(Array) ? v[0] : v})\n self.class.rpc_execute('write', self.id, vals, context)\n reload_from_record!(self.class.find(self.id, :context => context))\n end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update ; end",
"def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end",
"def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end",
"def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end",
"def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end",
"def update_with(attributes)\n assign_attributes(attributes)\n end",
"def update\n # don't need to update; hash is shared\n end",
"def update(attributes)\n HashProxy.with(attributes) do |proxy|\n self.class.attribute_names.each do |name|\n send(\"#{name}=\", proxy[name]) if proxy.key?(name)\n end\n end\n save\n end",
"def update!(**args)\n @object_id_prop = args[:object_id_prop] if args.key?(:object_id_prop)\n @relation = args[:relation] if args.key?(:relation)\n @subject_id = args[:subject_id] if args.key?(:subject_id)\n end",
"def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end",
"def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end",
"def update\n raise NotImplementedError\n end",
"def update_attributes attributes\n @attributes.merge! attributes\n end",
"def update!(**args)\n @async_options = args[:async_options] if args.key?(:async_options)\n @input_mappings = args[:input_mappings] if args.key?(:input_mappings)\n @name_property = args[:name_property] if args.key?(:name_property)\n @validation_options = args[:validation_options] if args.key?(:validation_options)\n end",
"def update\r\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @type = args[:type] if args.key?(:type)\n end",
"def update\n raise NotImplemented\n end",
"def update_obj\n mean, sd = rating.to_glicko_rating\n @obj.rating = mean\n @obj.rating_deviation = sd\n @obj.volatility = volatility\n end",
"def update_values\n end",
"def update_values\n end",
"def update\n raise NotImplementedError\n end",
"def update!(**args)\n @answers_header_signals = args[:answers_header_signals] if args.key?(:answers_header_signals)\n @property_value = args[:property_value] if args.key?(:property_value)\n @response_meaning_application = args[:response_meaning_application] if args.key?(:response_meaning_application)\n end",
"def update!(**args)\n @create_time = args[:create_time] if args.key?(:create_time)\n @method_prop = args[:method_prop] if args.key?(:method_prop)\n @name = args[:name] if args.key?(:name)\n @state = args[:state] if args.key?(:state)\n end",
"def update attributes, collection #:nodoc:\n 0\n end",
"def update_property_groups(roll)\n @property_groups.each { |_, v| v.update_rent(roll) }\n 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 update!(**args)\n @source_property = args[:source_property] if args.key?(:source_property)\n end",
"def update_properties(path, properties)\n prop_patch = PropPatch.new(properties)\n emit('propPatch', [path, prop_patch])\n prop_patch.commit\n\n prop_patch.result\n end",
"def update\n set_deltatime\n set_last_update_at\n end"
] | [
"0.7012568",
"0.6918917",
"0.6918917",
"0.6918917",
"0.6918917",
"0.6918917",
"0.67404634",
"0.6709981",
"0.6709981",
"0.66964126",
"0.66964126",
"0.66964126",
"0.66964126",
"0.6619218",
"0.6570895",
"0.6539287",
"0.6517026",
"0.63946927",
"0.63901657",
"0.63901657",
"0.63328683",
"0.6318612",
"0.62846893",
"0.62692374",
"0.6264273",
"0.6241163",
"0.6216599",
"0.6214641",
"0.6210363",
"0.6203827",
"0.6203827",
"0.620312",
"0.6201905",
"0.62001497",
"0.61728275",
"0.61728275",
"0.6159924",
"0.61569315",
"0.61442953",
"0.61260897",
"0.6125199",
"0.61227936",
"0.61111224",
"0.610543",
"0.6102925",
"0.60839343",
"0.6083609",
"0.6066973",
"0.60602766",
"0.6055065",
"0.6051568",
"0.6051568",
"0.6042057",
"0.60319084",
"0.60221004",
"0.60149413",
"0.5994295",
"0.5989816",
"0.597674",
"0.5973157",
"0.5967343",
"0.5965598",
"0.59629464",
"0.59618354",
"0.5950329",
"0.5950329",
"0.5950329",
"0.5950329",
"0.5950329",
"0.5950329",
"0.5950329",
"0.5950329",
"0.59495455",
"0.59442014",
"0.59442014",
"0.5944142",
"0.5944142",
"0.59361076",
"0.5925741",
"0.5925574",
"0.59250593",
"0.5924476",
"0.5924476",
"0.5921039",
"0.59155524",
"0.59145254",
"0.5888445",
"0.58860934",
"0.5882302",
"0.5879913",
"0.5877467",
"0.5877467",
"0.58743787",
"0.585829",
"0.584583",
"0.58408254",
"0.5835501",
"0.5829063",
"0.5828611",
"0.58228916",
"0.5819882"
] | 0.0 | -1 |
Update properties of this object | def update!(**args)
@policy = args[:policy] if args.key?(:policy)
@update_mask = args[:update_mask] if args.key?(:update_mask)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update_properties(hash)\n hash.each do |key, value|\n setter_method = \"#{key}=\"\n if self.respond_to?(setter_method)\n self.send(setter_method, value)\n end\n end\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def refresh\n self.class.base_properties.each_with_index do |prop, prop_id|\n @properties[prop] = get_property(prop_id)\n end\n refresh_features\n refresh_status\n refresh_config\n self\n end",
"def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\n end",
"def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\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 update_properties!(branch_id=nil)\n properties = fetch_properties(false, branch_id)\n length = properties.length\n counter = 0\n properties.each do |property|\n counter += 1\n if Vebra.debugging?\n puts \"[Vebra]: #{counter}/#{length}: live updating property with Vebra ref: #{property.attributes[:vebra_ref]}\"\n end\n live_update!(property)\n Vebra.set_last_updated_at(Time.now) if counter == length\n end\n end",
"def update_self obj\n obj.each do |k,v|\n instance_variable_set(\"@#{k}\", v) if v\n end\n end",
"def update_attributes(properties_hash)\n self.class.get_class_properties.each do |property|\n key = property[:name].to_sym\n if properties_hash.has_key? key\n self.setValue(properties_hash[key], forKey:key)\n end\n end\n end",
"def update\n # TODO: implement update\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @states = args[:states] if args.key?(:states)\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end",
"def update!(**args)\n @property = args[:property] if args.key?(:property)\n @total_value_count = args[:total_value_count] if args.key?(:total_value_count)\n @value = args[:value] if args.key?(:value)\n @value_status = args[:value_status] if args.key?(:value_status)\n end",
"def update\n \n end",
"def refresh\n set_attributes\n end",
"def update(attrs)\n @attrs.update(attrs)\n self\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @source = args[:source] if args.key?(:source)\n end",
"def update_resource object, attributes\n object.update attributes\n end",
"def update(attrs)\n @attrs ||= {}\n @attrs.update(attrs)\n self\n end",
"def update\n \n end",
"def update!(**args)\n @property = args[:property] if args.key?(:property)\n @schema = args[:schema] if args.key?(:schema)\n end",
"def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def _update!\n self.class.properties.each do |property, predicate|\n if dirty?(property)\n self.class.repository_or_fail.delete([subject, predicate[:predicate], nil])\n if self.class.is_list?(property)\n repo = RDF::Repository.new\n attribute_get(property).each do |value|\n repo << RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(value, self.class.properties[property][:type]))\n end\n self.class.repository_or_fail.insert(*repo)\n else\n self.class.repository_or_fail.insert(RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(attribute_get(property), self.class.properties[property][:type])))\n end\n end\n @dirty[property] = nil\n @attributes[:original][property] = attribute_get(property)\n end\n self.class.repository_or_fail.insert(RDF::Statement.new(@subject, RDF.type, type)) unless type.nil?\n end",
"def update(attributes = {})\n super(attributes)\n retrieve!\n self\n end",
"def update\n @objects.map(&:update);\n end",
"def update\n raise NotImplementedError\n end",
"def update\n raise NotImplementedError\n end",
"def live_update!(property)\n property_class = Vebra.models[:property][:class].to_s.camelize.constantize\n\n # ensure we have the full property attributes\n property.get_property if !property.attributes[:status] && property.attributes[:action] != 'deleted'\n\n # find & update or build a new property\n property_model = property_class.find_or_initialize_by_vebra_ref(property.attributes[:vebra_ref])\n\n # make sure property object is not empty\n return false if !property.attributes || !property.attributes[:property_type]\n\n # if the property has been deleted, mark it appropriately and move on\n if property.attributes[:action] == 'deleted'\n return property_model.destroy\n end\n\n # extract accessible attributes for the property\n property_accessibles = property_class.accessible_attributes.map(&:to_sym)\n property_attributes = property.attributes.inject({}) do |result, (key, value)|\n result[key] = value if property_accessibles.include?(key)\n result\n end\n\n # update the property model's attributes\n property_model.no_callbacks = true if property_model.respond_to?(:no_callbacks)\n property_model.update_attributes(property_attributes)\n\n # find & update or build a new address\n if Vebra.models[:address]\n address_class = Vebra.models[:address][:class].to_s.camelize.constantize\n address_model = property_model.send(Vebra.models[:property][:address_method])\n address_model = property_model.send(\"build_#{Vebra.models[:property][:address_method]}\") unless address_model\n\n # extract accessible attributes for the address\n address_accessibles = address_class.accessible_attributes.map(&:to_sym)\n address_attributes = property.attributes[:address].inject({}) do |result, (key, value)|\n result[key] = value if address_accessibles.include?(key)\n result\n end\n\n # update the address model's attributes\n address_model.update_attributes(address_attributes)\n end\n\n # find & update or build new rooms\n if Vebra.models[:room]\n room_class = Vebra.models[:room][:class].to_s.camelize.constantize\n\n # accessible attributes for the rooms\n room_accessibles = room_class.accessible_attributes.map(&:to_sym)\n\n # delete any rooms which are no longer present\n property_rooms = property.attributes[:rooms] || []\n property_model_rooms = property_model.send(Vebra.models[:property][:rooms_method])\n refs_to_delete = property_model_rooms.map(&:vebra_ref) - property_rooms.map { |r| r[:vebra_ref] }\n property_model_rooms.each do |room|\n room.destroy if refs_to_delete.include?(room.vebra_ref)\n end\n\n # find & update or build new rooms\n property_rooms.each do |room|\n room_model = room_class.find_by_property_id_and_vebra_ref(property_model.id, room[:vebra_ref])\n room_model = property_model_rooms.build unless room_model\n\n # extract accessible attributes for the room\n room_attributes = room.inject({}) do |result, (key, value)|\n result[key] = value if room_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n room_model.update_attributes(room_attributes)\n end\n end\n\n # find & update or build new file attachments\n if Vebra.models[:file]\n file_class = Vebra.models[:file][:class].to_s.camelize.constantize\n\n # accessible attributes for the files\n file_accessibles = file_class.accessible_attributes.map(&:to_sym)\n\n # first normalize the collection (currently nested collections)\n property_files = property.attributes[:files].inject([]) do |result, (kind, collection)|\n collection.each do |file|\n file[:type] = kind.to_s.singularize.camelize if file_accessibles.include?(:type)\n file[\"remote_#{Vebra.models[:file][:attachment_method]}_url\".to_sym] = file.delete(:url)\n # if file[:type] is set, it means the attachment file class can be subclassed. In this\n # case we need to ensure that the subclass exists. If not, we ignore this file\n begin\n file[:type].constantize if file_accessibles.include?(:type)\n result << file\n rescue NameError => e\n # ignore - this means the subclass does not exist\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n\n result\n end\n\n # delete any files which are no longer present\n property_model_files = property_model.send(Vebra.models[:property][:files_method])\n refs_to_delete = property_model_files.map(&:vebra_ref) - property_files.map { |f| f[:vebra_ref] }\n property_model_files.each do |file|\n file.destroy if refs_to_delete.include?(file.vebra_ref)\n end\n\n # find & update or build new files\n property_files.each do |file|\n begin\n file_model = property_model_files.find_by_vebra_ref(file[:vebra_ref])\n file_model = property_model_files.build unless file_model\n\n # extract accessible attributes for the file\n file_attributes = file.inject({}) do |result, (key, value)|\n result[key] = value if file_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n file_model.update_attributes(file_attributes)\n rescue CarrierWave::ProcessingError, OpenURI::HTTPError => e\n # just ignore the file\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n end\n\n property_model.no_callbacks = false if property_model.respond_to?(:no_callbacks)\n property_model.save\n return property_model\n end",
"def update!(**args)\n @id = args[:id] if args.key?(:id)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def update\n end",
"def update!(**args)\n @mid = args[:mid] if args.key?(:mid)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def modified_properties=(value)\n @modified_properties = value\n end",
"def apply_properties!(properties)\n # Non-commutitivity etc. eventually.\n end",
"def set_properties(hash)\n hash.each do |key, value|\n add_or_remove_ostruct_member(key, value)\n end\n rest_reset_properties\n end",
"def update\n\t\t\n\t\tend",
"def set_props(props)\n @props.merge!(props)\n end",
"def update() end",
"def update!(**args)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def assign_properties\n self.properties ||= {}\n listing_properties.each do |prop|\n self.properties[prop.key] ||= prop.value\n end\n end",
"def change_properties(new_current_floor, new_next_floor, new_movement)\n @current_floor = new_current_floor\n @next_floor = new_next_floor\n @movement = new_movement\n end",
"def update!(**args)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end",
"def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end",
"def update(attributes)\n (@attributes ||= {}).merge! attributes\n\n (self.class.attr_initializables & attributes.keys).each do |name|\n instance_variable_set :\"@#{name}\", attributes[name]\n end\n\n self\n end",
"def update_attributes(attrs)\n super({})\n end",
"def update\n @dirty = true\n end",
"def update\n\n # Run through the mixin updates\n colourable_update\n movable_update\n\n end",
"def set(props)\n props.each do |prop, val|\n self.send(:\"#{ prop }=\", val)\n end\n end",
"def update\n super\n end",
"def update!(**args)\n @property_id = args[:property_id] if args.key?(:property_id)\n @value_status = args[:value_status] if args.key?(:value_status)\n end",
"def update!(**args)\n @object_size_bytes = args[:object_size_bytes] if args.key?(:object_size_bytes)\n @object_version = args[:object_version] if args.key?(:object_version)\n end",
"def movable_update\n\n # Work through the different aspects we update\n movable_location_update\n movable_size_update\n movable_angle_update\n\n end",
"def properties=(value)\n @properties = value\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(context={})\n self.pre_cast_attributes\n m2o = @relations.reject{|k, v| !self.class.many2one_relations.has_key?(k)}\n vals = @attributes.reject {|key, value| key == 'id'}.merge(m2o.merge(m2o){|k, v| v.is_a?(Array) ? v[0] : v})\n self.class.rpc_execute('write', self.id, vals, context)\n reload_from_record!(self.class.find(self.id, :context => context))\n end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update ; end",
"def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end",
"def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end",
"def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end",
"def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end",
"def update_with(attributes)\n assign_attributes(attributes)\n end",
"def update\n # don't need to update; hash is shared\n end",
"def update(attributes)\n HashProxy.with(attributes) do |proxy|\n self.class.attribute_names.each do |name|\n send(\"#{name}=\", proxy[name]) if proxy.key?(name)\n end\n end\n save\n end",
"def update!(**args)\n @object_id_prop = args[:object_id_prop] if args.key?(:object_id_prop)\n @relation = args[:relation] if args.key?(:relation)\n @subject_id = args[:subject_id] if args.key?(:subject_id)\n end",
"def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end",
"def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end",
"def update\n raise NotImplementedError\n end",
"def update_attributes attributes\n @attributes.merge! attributes\n end",
"def update!(**args)\n @async_options = args[:async_options] if args.key?(:async_options)\n @input_mappings = args[:input_mappings] if args.key?(:input_mappings)\n @name_property = args[:name_property] if args.key?(:name_property)\n @validation_options = args[:validation_options] if args.key?(:validation_options)\n end",
"def update\r\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @type = args[:type] if args.key?(:type)\n end",
"def update\n raise NotImplemented\n end",
"def update_obj\n mean, sd = rating.to_glicko_rating\n @obj.rating = mean\n @obj.rating_deviation = sd\n @obj.volatility = volatility\n end",
"def update_values\n end",
"def update_values\n end",
"def update\n raise NotImplementedError\n end",
"def update!(**args)\n @answers_header_signals = args[:answers_header_signals] if args.key?(:answers_header_signals)\n @property_value = args[:property_value] if args.key?(:property_value)\n @response_meaning_application = args[:response_meaning_application] if args.key?(:response_meaning_application)\n end",
"def update!(**args)\n @create_time = args[:create_time] if args.key?(:create_time)\n @method_prop = args[:method_prop] if args.key?(:method_prop)\n @name = args[:name] if args.key?(:name)\n @state = args[:state] if args.key?(:state)\n end",
"def update attributes, collection #:nodoc:\n 0\n end",
"def update_property_groups(roll)\n @property_groups.each { |_, v| v.update_rent(roll) }\n end",
"def update!(**args)\n @source_property = args[:source_property] if args.key?(:source_property)\n 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 update_properties(path, properties)\n prop_patch = PropPatch.new(properties)\n emit('propPatch', [path, prop_patch])\n prop_patch.commit\n\n prop_patch.result\n end",
"def update\n set_deltatime\n set_last_update_at\n end"
] | [
"0.7012263",
"0.69181895",
"0.69181895",
"0.69181895",
"0.69181895",
"0.69181895",
"0.67403597",
"0.6709326",
"0.6709326",
"0.6696149",
"0.6696149",
"0.6696149",
"0.6696149",
"0.6618882",
"0.6571848",
"0.65386343",
"0.65178275",
"0.6394807",
"0.6389745",
"0.6389745",
"0.63328",
"0.6319025",
"0.6283673",
"0.6269463",
"0.62639254",
"0.62410724",
"0.62170374",
"0.62152076",
"0.6210263",
"0.6204041",
"0.6204041",
"0.62021106",
"0.62017816",
"0.62017",
"0.61730784",
"0.61730784",
"0.6159277",
"0.6156169",
"0.61445665",
"0.6125433",
"0.61241156",
"0.6121413",
"0.6110477",
"0.6105694",
"0.61016303",
"0.60845226",
"0.6084427",
"0.6065455",
"0.6059506",
"0.6054869",
"0.6051708",
"0.6051708",
"0.60413384",
"0.6030853",
"0.6022535",
"0.6015561",
"0.59932375",
"0.59898263",
"0.5976479",
"0.5973787",
"0.59678394",
"0.5963291",
"0.5962048",
"0.5961157",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.59500545",
"0.59443134",
"0.59443134",
"0.59424853",
"0.59424853",
"0.593523",
"0.5926413",
"0.5924831",
"0.592427",
"0.59233046",
"0.59233046",
"0.5921224",
"0.59144294",
"0.59142506",
"0.58887535",
"0.58854496",
"0.5883008",
"0.58792305",
"0.5876954",
"0.5876954",
"0.58744955",
"0.5857968",
"0.5845542",
"0.5841629",
"0.58363605",
"0.5829255",
"0.582919",
"0.5822138",
"0.58208305"
] | 0.0 | -1 |
Update properties of this object | def update!(**args)
@permissions = args[:permissions] if args.key?(:permissions)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update_properties(hash)\n hash.each do |key, value|\n setter_method = \"#{key}=\"\n if self.respond_to?(setter_method)\n self.send(setter_method, value)\n end\n end\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def refresh\n self.class.base_properties.each_with_index do |prop, prop_id|\n @properties[prop] = get_property(prop_id)\n end\n refresh_features\n refresh_status\n refresh_config\n self\n end",
"def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\n end",
"def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\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 update_properties!(branch_id=nil)\n properties = fetch_properties(false, branch_id)\n length = properties.length\n counter = 0\n properties.each do |property|\n counter += 1\n if Vebra.debugging?\n puts \"[Vebra]: #{counter}/#{length}: live updating property with Vebra ref: #{property.attributes[:vebra_ref]}\"\n end\n live_update!(property)\n Vebra.set_last_updated_at(Time.now) if counter == length\n end\n end",
"def update_self obj\n obj.each do |k,v|\n instance_variable_set(\"@#{k}\", v) if v\n end\n end",
"def update_attributes(properties_hash)\n self.class.get_class_properties.each do |property|\n key = property[:name].to_sym\n if properties_hash.has_key? key\n self.setValue(properties_hash[key], forKey:key)\n end\n end\n end",
"def update\n # TODO: implement update\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @states = args[:states] if args.key?(:states)\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end",
"def update!(**args)\n @property = args[:property] if args.key?(:property)\n @total_value_count = args[:total_value_count] if args.key?(:total_value_count)\n @value = args[:value] if args.key?(:value)\n @value_status = args[:value_status] if args.key?(:value_status)\n end",
"def update\n \n end",
"def refresh\n set_attributes\n end",
"def update(attrs)\n @attrs.update(attrs)\n self\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @source = args[:source] if args.key?(:source)\n end",
"def update_resource object, attributes\n object.update attributes\n end",
"def update(attrs)\n @attrs ||= {}\n @attrs.update(attrs)\n self\n end",
"def update\n \n end",
"def update!(**args)\n @property = args[:property] if args.key?(:property)\n @schema = args[:schema] if args.key?(:schema)\n end",
"def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def _update!\n self.class.properties.each do |property, predicate|\n if dirty?(property)\n self.class.repository_or_fail.delete([subject, predicate[:predicate], nil])\n if self.class.is_list?(property)\n repo = RDF::Repository.new\n attribute_get(property).each do |value|\n repo << RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(value, self.class.properties[property][:type]))\n end\n self.class.repository_or_fail.insert(*repo)\n else\n self.class.repository_or_fail.insert(RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(attribute_get(property), self.class.properties[property][:type])))\n end\n end\n @dirty[property] = nil\n @attributes[:original][property] = attribute_get(property)\n end\n self.class.repository_or_fail.insert(RDF::Statement.new(@subject, RDF.type, type)) unless type.nil?\n end",
"def update(attributes = {})\n super(attributes)\n retrieve!\n self\n end",
"def update\n @objects.map(&:update);\n end",
"def update\n raise NotImplementedError\n end",
"def update\n raise NotImplementedError\n end",
"def live_update!(property)\n property_class = Vebra.models[:property][:class].to_s.camelize.constantize\n\n # ensure we have the full property attributes\n property.get_property if !property.attributes[:status] && property.attributes[:action] != 'deleted'\n\n # find & update or build a new property\n property_model = property_class.find_or_initialize_by_vebra_ref(property.attributes[:vebra_ref])\n\n # make sure property object is not empty\n return false if !property.attributes || !property.attributes[:property_type]\n\n # if the property has been deleted, mark it appropriately and move on\n if property.attributes[:action] == 'deleted'\n return property_model.destroy\n end\n\n # extract accessible attributes for the property\n property_accessibles = property_class.accessible_attributes.map(&:to_sym)\n property_attributes = property.attributes.inject({}) do |result, (key, value)|\n result[key] = value if property_accessibles.include?(key)\n result\n end\n\n # update the property model's attributes\n property_model.no_callbacks = true if property_model.respond_to?(:no_callbacks)\n property_model.update_attributes(property_attributes)\n\n # find & update or build a new address\n if Vebra.models[:address]\n address_class = Vebra.models[:address][:class].to_s.camelize.constantize\n address_model = property_model.send(Vebra.models[:property][:address_method])\n address_model = property_model.send(\"build_#{Vebra.models[:property][:address_method]}\") unless address_model\n\n # extract accessible attributes for the address\n address_accessibles = address_class.accessible_attributes.map(&:to_sym)\n address_attributes = property.attributes[:address].inject({}) do |result, (key, value)|\n result[key] = value if address_accessibles.include?(key)\n result\n end\n\n # update the address model's attributes\n address_model.update_attributes(address_attributes)\n end\n\n # find & update or build new rooms\n if Vebra.models[:room]\n room_class = Vebra.models[:room][:class].to_s.camelize.constantize\n\n # accessible attributes for the rooms\n room_accessibles = room_class.accessible_attributes.map(&:to_sym)\n\n # delete any rooms which are no longer present\n property_rooms = property.attributes[:rooms] || []\n property_model_rooms = property_model.send(Vebra.models[:property][:rooms_method])\n refs_to_delete = property_model_rooms.map(&:vebra_ref) - property_rooms.map { |r| r[:vebra_ref] }\n property_model_rooms.each do |room|\n room.destroy if refs_to_delete.include?(room.vebra_ref)\n end\n\n # find & update or build new rooms\n property_rooms.each do |room|\n room_model = room_class.find_by_property_id_and_vebra_ref(property_model.id, room[:vebra_ref])\n room_model = property_model_rooms.build unless room_model\n\n # extract accessible attributes for the room\n room_attributes = room.inject({}) do |result, (key, value)|\n result[key] = value if room_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n room_model.update_attributes(room_attributes)\n end\n end\n\n # find & update or build new file attachments\n if Vebra.models[:file]\n file_class = Vebra.models[:file][:class].to_s.camelize.constantize\n\n # accessible attributes for the files\n file_accessibles = file_class.accessible_attributes.map(&:to_sym)\n\n # first normalize the collection (currently nested collections)\n property_files = property.attributes[:files].inject([]) do |result, (kind, collection)|\n collection.each do |file|\n file[:type] = kind.to_s.singularize.camelize if file_accessibles.include?(:type)\n file[\"remote_#{Vebra.models[:file][:attachment_method]}_url\".to_sym] = file.delete(:url)\n # if file[:type] is set, it means the attachment file class can be subclassed. In this\n # case we need to ensure that the subclass exists. If not, we ignore this file\n begin\n file[:type].constantize if file_accessibles.include?(:type)\n result << file\n rescue NameError => e\n # ignore - this means the subclass does not exist\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n\n result\n end\n\n # delete any files which are no longer present\n property_model_files = property_model.send(Vebra.models[:property][:files_method])\n refs_to_delete = property_model_files.map(&:vebra_ref) - property_files.map { |f| f[:vebra_ref] }\n property_model_files.each do |file|\n file.destroy if refs_to_delete.include?(file.vebra_ref)\n end\n\n # find & update or build new files\n property_files.each do |file|\n begin\n file_model = property_model_files.find_by_vebra_ref(file[:vebra_ref])\n file_model = property_model_files.build unless file_model\n\n # extract accessible attributes for the file\n file_attributes = file.inject({}) do |result, (key, value)|\n result[key] = value if file_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n file_model.update_attributes(file_attributes)\n rescue CarrierWave::ProcessingError, OpenURI::HTTPError => e\n # just ignore the file\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n end\n\n property_model.no_callbacks = false if property_model.respond_to?(:no_callbacks)\n property_model.save\n return property_model\n end",
"def update!(**args)\n @id = args[:id] if args.key?(:id)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def update\n end",
"def update!(**args)\n @mid = args[:mid] if args.key?(:mid)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def modified_properties=(value)\n @modified_properties = value\n end",
"def apply_properties!(properties)\n # Non-commutitivity etc. eventually.\n end",
"def set_properties(hash)\n hash.each do |key, value|\n add_or_remove_ostruct_member(key, value)\n end\n rest_reset_properties\n end",
"def update\n\t\t\n\t\tend",
"def set_props(props)\n @props.merge!(props)\n end",
"def update() end",
"def update!(**args)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def assign_properties\n self.properties ||= {}\n listing_properties.each do |prop|\n self.properties[prop.key] ||= prop.value\n end\n end",
"def change_properties(new_current_floor, new_next_floor, new_movement)\n @current_floor = new_current_floor\n @next_floor = new_next_floor\n @movement = new_movement\n end",
"def update!(**args)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end",
"def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end",
"def update(attributes)\n (@attributes ||= {}).merge! attributes\n\n (self.class.attr_initializables & attributes.keys).each do |name|\n instance_variable_set :\"@#{name}\", attributes[name]\n end\n\n self\n end",
"def update_attributes(attrs)\n super({})\n end",
"def update\n @dirty = true\n end",
"def update\n\n # Run through the mixin updates\n colourable_update\n movable_update\n\n end",
"def set(props)\n props.each do |prop, val|\n self.send(:\"#{ prop }=\", val)\n end\n end",
"def update\n super\n end",
"def update!(**args)\n @property_id = args[:property_id] if args.key?(:property_id)\n @value_status = args[:value_status] if args.key?(:value_status)\n end",
"def update!(**args)\n @object_size_bytes = args[:object_size_bytes] if args.key?(:object_size_bytes)\n @object_version = args[:object_version] if args.key?(:object_version)\n end",
"def movable_update\n\n # Work through the different aspects we update\n movable_location_update\n movable_size_update\n movable_angle_update\n\n end",
"def properties=(value)\n @properties = value\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(context={})\n self.pre_cast_attributes\n m2o = @relations.reject{|k, v| !self.class.many2one_relations.has_key?(k)}\n vals = @attributes.reject {|key, value| key == 'id'}.merge(m2o.merge(m2o){|k, v| v.is_a?(Array) ? v[0] : v})\n self.class.rpc_execute('write', self.id, vals, context)\n reload_from_record!(self.class.find(self.id, :context => context))\n end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update ; end",
"def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end",
"def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end",
"def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end",
"def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end",
"def update_with(attributes)\n assign_attributes(attributes)\n end",
"def update\n # don't need to update; hash is shared\n end",
"def update(attributes)\n HashProxy.with(attributes) do |proxy|\n self.class.attribute_names.each do |name|\n send(\"#{name}=\", proxy[name]) if proxy.key?(name)\n end\n end\n save\n end",
"def update!(**args)\n @object_id_prop = args[:object_id_prop] if args.key?(:object_id_prop)\n @relation = args[:relation] if args.key?(:relation)\n @subject_id = args[:subject_id] if args.key?(:subject_id)\n end",
"def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end",
"def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end",
"def update\n raise NotImplementedError\n end",
"def update_attributes attributes\n @attributes.merge! attributes\n end",
"def update!(**args)\n @async_options = args[:async_options] if args.key?(:async_options)\n @input_mappings = args[:input_mappings] if args.key?(:input_mappings)\n @name_property = args[:name_property] if args.key?(:name_property)\n @validation_options = args[:validation_options] if args.key?(:validation_options)\n end",
"def update\r\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @type = args[:type] if args.key?(:type)\n end",
"def update\n raise NotImplemented\n end",
"def update_obj\n mean, sd = rating.to_glicko_rating\n @obj.rating = mean\n @obj.rating_deviation = sd\n @obj.volatility = volatility\n end",
"def update_values\n end",
"def update_values\n end",
"def update\n raise NotImplementedError\n end",
"def update!(**args)\n @answers_header_signals = args[:answers_header_signals] if args.key?(:answers_header_signals)\n @property_value = args[:property_value] if args.key?(:property_value)\n @response_meaning_application = args[:response_meaning_application] if args.key?(:response_meaning_application)\n end",
"def update!(**args)\n @create_time = args[:create_time] if args.key?(:create_time)\n @method_prop = args[:method_prop] if args.key?(:method_prop)\n @name = args[:name] if args.key?(:name)\n @state = args[:state] if args.key?(:state)\n end",
"def update attributes, collection #:nodoc:\n 0\n end",
"def update_property_groups(roll)\n @property_groups.each { |_, v| v.update_rent(roll) }\n end",
"def update!(**args)\n @source_property = args[:source_property] if args.key?(:source_property)\n 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 update_properties(path, properties)\n prop_patch = PropPatch.new(properties)\n emit('propPatch', [path, prop_patch])\n prop_patch.commit\n\n prop_patch.result\n end",
"def update\n set_deltatime\n set_last_update_at\n end"
] | [
"0.7012263",
"0.69181895",
"0.69181895",
"0.69181895",
"0.69181895",
"0.69181895",
"0.67403597",
"0.6709326",
"0.6709326",
"0.6696149",
"0.6696149",
"0.6696149",
"0.6696149",
"0.6618882",
"0.6571848",
"0.65386343",
"0.65178275",
"0.6394807",
"0.6389745",
"0.6389745",
"0.63328",
"0.6319025",
"0.6283673",
"0.6269463",
"0.62639254",
"0.62410724",
"0.62170374",
"0.62152076",
"0.6210263",
"0.6204041",
"0.6204041",
"0.62021106",
"0.62017816",
"0.62017",
"0.61730784",
"0.61730784",
"0.6159277",
"0.6156169",
"0.61445665",
"0.6125433",
"0.61241156",
"0.6121413",
"0.6110477",
"0.6105694",
"0.61016303",
"0.60845226",
"0.6084427",
"0.6065455",
"0.6059506",
"0.6054869",
"0.6051708",
"0.6051708",
"0.60413384",
"0.6030853",
"0.6022535",
"0.6015561",
"0.59932375",
"0.59898263",
"0.5976479",
"0.5973787",
"0.59678394",
"0.5963291",
"0.5962048",
"0.5961157",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.59500545",
"0.59443134",
"0.59443134",
"0.59424853",
"0.59424853",
"0.593523",
"0.5926413",
"0.5924831",
"0.592427",
"0.59233046",
"0.59233046",
"0.5921224",
"0.59144294",
"0.59142506",
"0.58887535",
"0.58854496",
"0.5883008",
"0.58792305",
"0.5876954",
"0.5876954",
"0.58744955",
"0.5857968",
"0.5845542",
"0.5841629",
"0.58363605",
"0.5829255",
"0.582919",
"0.5822138",
"0.58208305"
] | 0.0 | -1 |
Update properties of this object | def update!(**args)
@permissions = args[:permissions] if args.key?(:permissions)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update_properties(hash)\n hash.each do |key, value|\n setter_method = \"#{key}=\"\n if self.respond_to?(setter_method)\n self.send(setter_method, value)\n end\n end\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def refresh\n self.class.base_properties.each_with_index do |prop, prop_id|\n @properties[prop] = get_property(prop_id)\n end\n refresh_features\n refresh_status\n refresh_config\n self\n end",
"def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\n end",
"def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\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 update_properties!(branch_id=nil)\n properties = fetch_properties(false, branch_id)\n length = properties.length\n counter = 0\n properties.each do |property|\n counter += 1\n if Vebra.debugging?\n puts \"[Vebra]: #{counter}/#{length}: live updating property with Vebra ref: #{property.attributes[:vebra_ref]}\"\n end\n live_update!(property)\n Vebra.set_last_updated_at(Time.now) if counter == length\n end\n end",
"def update_self obj\n obj.each do |k,v|\n instance_variable_set(\"@#{k}\", v) if v\n end\n end",
"def update_attributes(properties_hash)\n self.class.get_class_properties.each do |property|\n key = property[:name].to_sym\n if properties_hash.has_key? key\n self.setValue(properties_hash[key], forKey:key)\n end\n end\n end",
"def update\n # TODO: implement update\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @states = args[:states] if args.key?(:states)\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end",
"def update!(**args)\n @property = args[:property] if args.key?(:property)\n @total_value_count = args[:total_value_count] if args.key?(:total_value_count)\n @value = args[:value] if args.key?(:value)\n @value_status = args[:value_status] if args.key?(:value_status)\n end",
"def update\n \n end",
"def refresh\n set_attributes\n end",
"def update(attrs)\n @attrs.update(attrs)\n self\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @source = args[:source] if args.key?(:source)\n end",
"def update_resource object, attributes\n object.update attributes\n end",
"def update(attrs)\n @attrs ||= {}\n @attrs.update(attrs)\n self\n end",
"def update\n \n end",
"def update!(**args)\n @property = args[:property] if args.key?(:property)\n @schema = args[:schema] if args.key?(:schema)\n end",
"def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def _update!\n self.class.properties.each do |property, predicate|\n if dirty?(property)\n self.class.repository_or_fail.delete([subject, predicate[:predicate], nil])\n if self.class.is_list?(property)\n repo = RDF::Repository.new\n attribute_get(property).each do |value|\n repo << RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(value, self.class.properties[property][:type]))\n end\n self.class.repository_or_fail.insert(*repo)\n else\n self.class.repository_or_fail.insert(RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(attribute_get(property), self.class.properties[property][:type])))\n end\n end\n @dirty[property] = nil\n @attributes[:original][property] = attribute_get(property)\n end\n self.class.repository_or_fail.insert(RDF::Statement.new(@subject, RDF.type, type)) unless type.nil?\n end",
"def update(attributes = {})\n super(attributes)\n retrieve!\n self\n end",
"def update\n @objects.map(&:update);\n end",
"def update\n raise NotImplementedError\n end",
"def update\n raise NotImplementedError\n end",
"def live_update!(property)\n property_class = Vebra.models[:property][:class].to_s.camelize.constantize\n\n # ensure we have the full property attributes\n property.get_property if !property.attributes[:status] && property.attributes[:action] != 'deleted'\n\n # find & update or build a new property\n property_model = property_class.find_or_initialize_by_vebra_ref(property.attributes[:vebra_ref])\n\n # make sure property object is not empty\n return false if !property.attributes || !property.attributes[:property_type]\n\n # if the property has been deleted, mark it appropriately and move on\n if property.attributes[:action] == 'deleted'\n return property_model.destroy\n end\n\n # extract accessible attributes for the property\n property_accessibles = property_class.accessible_attributes.map(&:to_sym)\n property_attributes = property.attributes.inject({}) do |result, (key, value)|\n result[key] = value if property_accessibles.include?(key)\n result\n end\n\n # update the property model's attributes\n property_model.no_callbacks = true if property_model.respond_to?(:no_callbacks)\n property_model.update_attributes(property_attributes)\n\n # find & update or build a new address\n if Vebra.models[:address]\n address_class = Vebra.models[:address][:class].to_s.camelize.constantize\n address_model = property_model.send(Vebra.models[:property][:address_method])\n address_model = property_model.send(\"build_#{Vebra.models[:property][:address_method]}\") unless address_model\n\n # extract accessible attributes for the address\n address_accessibles = address_class.accessible_attributes.map(&:to_sym)\n address_attributes = property.attributes[:address].inject({}) do |result, (key, value)|\n result[key] = value if address_accessibles.include?(key)\n result\n end\n\n # update the address model's attributes\n address_model.update_attributes(address_attributes)\n end\n\n # find & update or build new rooms\n if Vebra.models[:room]\n room_class = Vebra.models[:room][:class].to_s.camelize.constantize\n\n # accessible attributes for the rooms\n room_accessibles = room_class.accessible_attributes.map(&:to_sym)\n\n # delete any rooms which are no longer present\n property_rooms = property.attributes[:rooms] || []\n property_model_rooms = property_model.send(Vebra.models[:property][:rooms_method])\n refs_to_delete = property_model_rooms.map(&:vebra_ref) - property_rooms.map { |r| r[:vebra_ref] }\n property_model_rooms.each do |room|\n room.destroy if refs_to_delete.include?(room.vebra_ref)\n end\n\n # find & update or build new rooms\n property_rooms.each do |room|\n room_model = room_class.find_by_property_id_and_vebra_ref(property_model.id, room[:vebra_ref])\n room_model = property_model_rooms.build unless room_model\n\n # extract accessible attributes for the room\n room_attributes = room.inject({}) do |result, (key, value)|\n result[key] = value if room_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n room_model.update_attributes(room_attributes)\n end\n end\n\n # find & update or build new file attachments\n if Vebra.models[:file]\n file_class = Vebra.models[:file][:class].to_s.camelize.constantize\n\n # accessible attributes for the files\n file_accessibles = file_class.accessible_attributes.map(&:to_sym)\n\n # first normalize the collection (currently nested collections)\n property_files = property.attributes[:files].inject([]) do |result, (kind, collection)|\n collection.each do |file|\n file[:type] = kind.to_s.singularize.camelize if file_accessibles.include?(:type)\n file[\"remote_#{Vebra.models[:file][:attachment_method]}_url\".to_sym] = file.delete(:url)\n # if file[:type] is set, it means the attachment file class can be subclassed. In this\n # case we need to ensure that the subclass exists. If not, we ignore this file\n begin\n file[:type].constantize if file_accessibles.include?(:type)\n result << file\n rescue NameError => e\n # ignore - this means the subclass does not exist\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n\n result\n end\n\n # delete any files which are no longer present\n property_model_files = property_model.send(Vebra.models[:property][:files_method])\n refs_to_delete = property_model_files.map(&:vebra_ref) - property_files.map { |f| f[:vebra_ref] }\n property_model_files.each do |file|\n file.destroy if refs_to_delete.include?(file.vebra_ref)\n end\n\n # find & update or build new files\n property_files.each do |file|\n begin\n file_model = property_model_files.find_by_vebra_ref(file[:vebra_ref])\n file_model = property_model_files.build unless file_model\n\n # extract accessible attributes for the file\n file_attributes = file.inject({}) do |result, (key, value)|\n result[key] = value if file_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n file_model.update_attributes(file_attributes)\n rescue CarrierWave::ProcessingError, OpenURI::HTTPError => e\n # just ignore the file\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n end\n\n property_model.no_callbacks = false if property_model.respond_to?(:no_callbacks)\n property_model.save\n return property_model\n end",
"def update!(**args)\n @id = args[:id] if args.key?(:id)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def update\n end",
"def update!(**args)\n @mid = args[:mid] if args.key?(:mid)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def modified_properties=(value)\n @modified_properties = value\n end",
"def apply_properties!(properties)\n # Non-commutitivity etc. eventually.\n end",
"def set_properties(hash)\n hash.each do |key, value|\n add_or_remove_ostruct_member(key, value)\n end\n rest_reset_properties\n end",
"def update\n\t\t\n\t\tend",
"def set_props(props)\n @props.merge!(props)\n end",
"def update() end",
"def update!(**args)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def assign_properties\n self.properties ||= {}\n listing_properties.each do |prop|\n self.properties[prop.key] ||= prop.value\n end\n end",
"def change_properties(new_current_floor, new_next_floor, new_movement)\n @current_floor = new_current_floor\n @next_floor = new_next_floor\n @movement = new_movement\n end",
"def update!(**args)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end",
"def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end",
"def update(attributes)\n (@attributes ||= {}).merge! attributes\n\n (self.class.attr_initializables & attributes.keys).each do |name|\n instance_variable_set :\"@#{name}\", attributes[name]\n end\n\n self\n end",
"def update_attributes(attrs)\n super({})\n end",
"def update\n @dirty = true\n end",
"def update\n\n # Run through the mixin updates\n colourable_update\n movable_update\n\n end",
"def set(props)\n props.each do |prop, val|\n self.send(:\"#{ prop }=\", val)\n end\n end",
"def update\n super\n end",
"def update!(**args)\n @property_id = args[:property_id] if args.key?(:property_id)\n @value_status = args[:value_status] if args.key?(:value_status)\n end",
"def update!(**args)\n @object_size_bytes = args[:object_size_bytes] if args.key?(:object_size_bytes)\n @object_version = args[:object_version] if args.key?(:object_version)\n end",
"def movable_update\n\n # Work through the different aspects we update\n movable_location_update\n movable_size_update\n movable_angle_update\n\n end",
"def properties=(value)\n @properties = value\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(context={})\n self.pre_cast_attributes\n m2o = @relations.reject{|k, v| !self.class.many2one_relations.has_key?(k)}\n vals = @attributes.reject {|key, value| key == 'id'}.merge(m2o.merge(m2o){|k, v| v.is_a?(Array) ? v[0] : v})\n self.class.rpc_execute('write', self.id, vals, context)\n reload_from_record!(self.class.find(self.id, :context => context))\n end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update ; end",
"def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end",
"def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end",
"def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end",
"def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end",
"def update_with(attributes)\n assign_attributes(attributes)\n end",
"def update\n # don't need to update; hash is shared\n end",
"def update(attributes)\n HashProxy.with(attributes) do |proxy|\n self.class.attribute_names.each do |name|\n send(\"#{name}=\", proxy[name]) if proxy.key?(name)\n end\n end\n save\n end",
"def update!(**args)\n @object_id_prop = args[:object_id_prop] if args.key?(:object_id_prop)\n @relation = args[:relation] if args.key?(:relation)\n @subject_id = args[:subject_id] if args.key?(:subject_id)\n end",
"def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end",
"def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end",
"def update\n raise NotImplementedError\n end",
"def update_attributes attributes\n @attributes.merge! attributes\n end",
"def update!(**args)\n @async_options = args[:async_options] if args.key?(:async_options)\n @input_mappings = args[:input_mappings] if args.key?(:input_mappings)\n @name_property = args[:name_property] if args.key?(:name_property)\n @validation_options = args[:validation_options] if args.key?(:validation_options)\n end",
"def update\r\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @type = args[:type] if args.key?(:type)\n end",
"def update\n raise NotImplemented\n end",
"def update_obj\n mean, sd = rating.to_glicko_rating\n @obj.rating = mean\n @obj.rating_deviation = sd\n @obj.volatility = volatility\n end",
"def update_values\n end",
"def update_values\n end",
"def update\n raise NotImplementedError\n end",
"def update!(**args)\n @answers_header_signals = args[:answers_header_signals] if args.key?(:answers_header_signals)\n @property_value = args[:property_value] if args.key?(:property_value)\n @response_meaning_application = args[:response_meaning_application] if args.key?(:response_meaning_application)\n end",
"def update!(**args)\n @create_time = args[:create_time] if args.key?(:create_time)\n @method_prop = args[:method_prop] if args.key?(:method_prop)\n @name = args[:name] if args.key?(:name)\n @state = args[:state] if args.key?(:state)\n end",
"def update attributes, collection #:nodoc:\n 0\n end",
"def update_property_groups(roll)\n @property_groups.each { |_, v| v.update_rent(roll) }\n end",
"def update!(**args)\n @source_property = args[:source_property] if args.key?(:source_property)\n 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 update_properties(path, properties)\n prop_patch = PropPatch.new(properties)\n emit('propPatch', [path, prop_patch])\n prop_patch.commit\n\n prop_patch.result\n end",
"def update\n set_deltatime\n set_last_update_at\n end"
] | [
"0.7012263",
"0.69181895",
"0.69181895",
"0.69181895",
"0.69181895",
"0.69181895",
"0.67403597",
"0.6709326",
"0.6709326",
"0.6696149",
"0.6696149",
"0.6696149",
"0.6696149",
"0.6618882",
"0.6571848",
"0.65386343",
"0.65178275",
"0.6394807",
"0.6389745",
"0.6389745",
"0.63328",
"0.6319025",
"0.6283673",
"0.6269463",
"0.62639254",
"0.62410724",
"0.62170374",
"0.62152076",
"0.6210263",
"0.6204041",
"0.6204041",
"0.62021106",
"0.62017816",
"0.62017",
"0.61730784",
"0.61730784",
"0.6159277",
"0.6156169",
"0.61445665",
"0.6125433",
"0.61241156",
"0.6121413",
"0.6110477",
"0.6105694",
"0.61016303",
"0.60845226",
"0.6084427",
"0.6065455",
"0.6059506",
"0.6054869",
"0.6051708",
"0.6051708",
"0.60413384",
"0.6030853",
"0.6022535",
"0.6015561",
"0.59932375",
"0.59898263",
"0.5976479",
"0.5973787",
"0.59678394",
"0.5963291",
"0.5962048",
"0.5961157",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.59500545",
"0.59443134",
"0.59443134",
"0.59424853",
"0.59424853",
"0.593523",
"0.5926413",
"0.5924831",
"0.592427",
"0.59233046",
"0.59233046",
"0.5921224",
"0.59144294",
"0.59142506",
"0.58887535",
"0.58854496",
"0.5883008",
"0.58792305",
"0.5876954",
"0.5876954",
"0.58744955",
"0.5857968",
"0.5845542",
"0.5841629",
"0.58363605",
"0.5829255",
"0.582919",
"0.5822138",
"0.58208305"
] | 0.0 | -1 |
Update properties of this object | def update!(**args)
@header_name = args[:header_name] if args.key?(:header_name)
@regex_match = args[:regex_match] if args.key?(:regex_match)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update_properties(hash)\n hash.each do |key, value|\n setter_method = \"#{key}=\"\n if self.respond_to?(setter_method)\n self.send(setter_method, value)\n end\n end\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def refresh\n self.class.base_properties.each_with_index do |prop, prop_id|\n @properties[prop] = get_property(prop_id)\n end\n refresh_features\n refresh_status\n refresh_config\n self\n end",
"def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\n end",
"def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\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 update_properties!(branch_id=nil)\n properties = fetch_properties(false, branch_id)\n length = properties.length\n counter = 0\n properties.each do |property|\n counter += 1\n if Vebra.debugging?\n puts \"[Vebra]: #{counter}/#{length}: live updating property with Vebra ref: #{property.attributes[:vebra_ref]}\"\n end\n live_update!(property)\n Vebra.set_last_updated_at(Time.now) if counter == length\n end\n end",
"def update_self obj\n obj.each do |k,v|\n instance_variable_set(\"@#{k}\", v) if v\n end\n end",
"def update_attributes(properties_hash)\n self.class.get_class_properties.each do |property|\n key = property[:name].to_sym\n if properties_hash.has_key? key\n self.setValue(properties_hash[key], forKey:key)\n end\n end\n end",
"def update\n # TODO: implement update\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @states = args[:states] if args.key?(:states)\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end",
"def update!(**args)\n @property = args[:property] if args.key?(:property)\n @total_value_count = args[:total_value_count] if args.key?(:total_value_count)\n @value = args[:value] if args.key?(:value)\n @value_status = args[:value_status] if args.key?(:value_status)\n end",
"def update\n \n end",
"def refresh\n set_attributes\n end",
"def update(attrs)\n @attrs.update(attrs)\n self\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @source = args[:source] if args.key?(:source)\n end",
"def update_resource object, attributes\n object.update attributes\n end",
"def update(attrs)\n @attrs ||= {}\n @attrs.update(attrs)\n self\n end",
"def update\n \n end",
"def update!(**args)\n @property = args[:property] if args.key?(:property)\n @schema = args[:schema] if args.key?(:schema)\n end",
"def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def update(attributes = {})\n super(attributes)\n retrieve!\n self\n end",
"def _update!\n self.class.properties.each do |property, predicate|\n if dirty?(property)\n self.class.repository_or_fail.delete([subject, predicate[:predicate], nil])\n if self.class.is_list?(property)\n repo = RDF::Repository.new\n attribute_get(property).each do |value|\n repo << RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(value, self.class.properties[property][:type]))\n end\n self.class.repository_or_fail.insert(*repo)\n else\n self.class.repository_or_fail.insert(RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(attribute_get(property), self.class.properties[property][:type])))\n end\n end\n @dirty[property] = nil\n @attributes[:original][property] = attribute_get(property)\n end\n self.class.repository_or_fail.insert(RDF::Statement.new(@subject, RDF.type, type)) unless type.nil?\n end",
"def update\n @objects.map(&:update);\n end",
"def update\n raise NotImplementedError\n end",
"def update\n raise NotImplementedError\n end",
"def live_update!(property)\n property_class = Vebra.models[:property][:class].to_s.camelize.constantize\n\n # ensure we have the full property attributes\n property.get_property if !property.attributes[:status] && property.attributes[:action] != 'deleted'\n\n # find & update or build a new property\n property_model = property_class.find_or_initialize_by_vebra_ref(property.attributes[:vebra_ref])\n\n # make sure property object is not empty\n return false if !property.attributes || !property.attributes[:property_type]\n\n # if the property has been deleted, mark it appropriately and move on\n if property.attributes[:action] == 'deleted'\n return property_model.destroy\n end\n\n # extract accessible attributes for the property\n property_accessibles = property_class.accessible_attributes.map(&:to_sym)\n property_attributes = property.attributes.inject({}) do |result, (key, value)|\n result[key] = value if property_accessibles.include?(key)\n result\n end\n\n # update the property model's attributes\n property_model.no_callbacks = true if property_model.respond_to?(:no_callbacks)\n property_model.update_attributes(property_attributes)\n\n # find & update or build a new address\n if Vebra.models[:address]\n address_class = Vebra.models[:address][:class].to_s.camelize.constantize\n address_model = property_model.send(Vebra.models[:property][:address_method])\n address_model = property_model.send(\"build_#{Vebra.models[:property][:address_method]}\") unless address_model\n\n # extract accessible attributes for the address\n address_accessibles = address_class.accessible_attributes.map(&:to_sym)\n address_attributes = property.attributes[:address].inject({}) do |result, (key, value)|\n result[key] = value if address_accessibles.include?(key)\n result\n end\n\n # update the address model's attributes\n address_model.update_attributes(address_attributes)\n end\n\n # find & update or build new rooms\n if Vebra.models[:room]\n room_class = Vebra.models[:room][:class].to_s.camelize.constantize\n\n # accessible attributes for the rooms\n room_accessibles = room_class.accessible_attributes.map(&:to_sym)\n\n # delete any rooms which are no longer present\n property_rooms = property.attributes[:rooms] || []\n property_model_rooms = property_model.send(Vebra.models[:property][:rooms_method])\n refs_to_delete = property_model_rooms.map(&:vebra_ref) - property_rooms.map { |r| r[:vebra_ref] }\n property_model_rooms.each do |room|\n room.destroy if refs_to_delete.include?(room.vebra_ref)\n end\n\n # find & update or build new rooms\n property_rooms.each do |room|\n room_model = room_class.find_by_property_id_and_vebra_ref(property_model.id, room[:vebra_ref])\n room_model = property_model_rooms.build unless room_model\n\n # extract accessible attributes for the room\n room_attributes = room.inject({}) do |result, (key, value)|\n result[key] = value if room_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n room_model.update_attributes(room_attributes)\n end\n end\n\n # find & update or build new file attachments\n if Vebra.models[:file]\n file_class = Vebra.models[:file][:class].to_s.camelize.constantize\n\n # accessible attributes for the files\n file_accessibles = file_class.accessible_attributes.map(&:to_sym)\n\n # first normalize the collection (currently nested collections)\n property_files = property.attributes[:files].inject([]) do |result, (kind, collection)|\n collection.each do |file|\n file[:type] = kind.to_s.singularize.camelize if file_accessibles.include?(:type)\n file[\"remote_#{Vebra.models[:file][:attachment_method]}_url\".to_sym] = file.delete(:url)\n # if file[:type] is set, it means the attachment file class can be subclassed. In this\n # case we need to ensure that the subclass exists. If not, we ignore this file\n begin\n file[:type].constantize if file_accessibles.include?(:type)\n result << file\n rescue NameError => e\n # ignore - this means the subclass does not exist\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n\n result\n end\n\n # delete any files which are no longer present\n property_model_files = property_model.send(Vebra.models[:property][:files_method])\n refs_to_delete = property_model_files.map(&:vebra_ref) - property_files.map { |f| f[:vebra_ref] }\n property_model_files.each do |file|\n file.destroy if refs_to_delete.include?(file.vebra_ref)\n end\n\n # find & update or build new files\n property_files.each do |file|\n begin\n file_model = property_model_files.find_by_vebra_ref(file[:vebra_ref])\n file_model = property_model_files.build unless file_model\n\n # extract accessible attributes for the file\n file_attributes = file.inject({}) do |result, (key, value)|\n result[key] = value if file_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n file_model.update_attributes(file_attributes)\n rescue CarrierWave::ProcessingError, OpenURI::HTTPError => e\n # just ignore the file\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n end\n\n property_model.no_callbacks = false if property_model.respond_to?(:no_callbacks)\n property_model.save\n return property_model\n end",
"def update!(**args)\n @id = args[:id] if args.key?(:id)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def update\n end",
"def update!(**args)\n @mid = args[:mid] if args.key?(:mid)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def modified_properties=(value)\n @modified_properties = value\n end",
"def apply_properties!(properties)\n # Non-commutitivity etc. eventually.\n end",
"def set_properties(hash)\n hash.each do |key, value|\n add_or_remove_ostruct_member(key, value)\n end\n rest_reset_properties\n end",
"def update\n\t\t\n\t\tend",
"def set_props(props)\n @props.merge!(props)\n end",
"def update() end",
"def update!(**args)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def assign_properties\n self.properties ||= {}\n listing_properties.each do |prop|\n self.properties[prop.key] ||= prop.value\n end\n end",
"def change_properties(new_current_floor, new_next_floor, new_movement)\n @current_floor = new_current_floor\n @next_floor = new_next_floor\n @movement = new_movement\n end",
"def update!(**args)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end",
"def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end",
"def update(attributes)\n (@attributes ||= {}).merge! attributes\n\n (self.class.attr_initializables & attributes.keys).each do |name|\n instance_variable_set :\"@#{name}\", attributes[name]\n end\n\n self\n end",
"def update_attributes(attrs)\n super({})\n end",
"def update\n @dirty = true\n end",
"def update\n\n # Run through the mixin updates\n colourable_update\n movable_update\n\n end",
"def set(props)\n props.each do |prop, val|\n self.send(:\"#{ prop }=\", val)\n end\n end",
"def update\n super\n end",
"def update!(**args)\n @property_id = args[:property_id] if args.key?(:property_id)\n @value_status = args[:value_status] if args.key?(:value_status)\n end",
"def update!(**args)\n @object_size_bytes = args[:object_size_bytes] if args.key?(:object_size_bytes)\n @object_version = args[:object_version] if args.key?(:object_version)\n end",
"def movable_update\n\n # Work through the different aspects we update\n movable_location_update\n movable_size_update\n movable_angle_update\n\n end",
"def properties=(value)\n @properties = value\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(context={})\n self.pre_cast_attributes\n m2o = @relations.reject{|k, v| !self.class.many2one_relations.has_key?(k)}\n vals = @attributes.reject {|key, value| key == 'id'}.merge(m2o.merge(m2o){|k, v| v.is_a?(Array) ? v[0] : v})\n self.class.rpc_execute('write', self.id, vals, context)\n reload_from_record!(self.class.find(self.id, :context => context))\n end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update ; end",
"def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end",
"def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end",
"def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end",
"def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end",
"def update_with(attributes)\n assign_attributes(attributes)\n end",
"def update\n # don't need to update; hash is shared\n end",
"def update(attributes)\n HashProxy.with(attributes) do |proxy|\n self.class.attribute_names.each do |name|\n send(\"#{name}=\", proxy[name]) if proxy.key?(name)\n end\n end\n save\n end",
"def update!(**args)\n @object_id_prop = args[:object_id_prop] if args.key?(:object_id_prop)\n @relation = args[:relation] if args.key?(:relation)\n @subject_id = args[:subject_id] if args.key?(:subject_id)\n end",
"def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end",
"def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end",
"def update\n raise NotImplementedError\n end",
"def update_attributes attributes\n @attributes.merge! attributes\n end",
"def update!(**args)\n @async_options = args[:async_options] if args.key?(:async_options)\n @input_mappings = args[:input_mappings] if args.key?(:input_mappings)\n @name_property = args[:name_property] if args.key?(:name_property)\n @validation_options = args[:validation_options] if args.key?(:validation_options)\n end",
"def update\r\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @type = args[:type] if args.key?(:type)\n end",
"def update\n raise NotImplemented\n end",
"def update_obj\n mean, sd = rating.to_glicko_rating\n @obj.rating = mean\n @obj.rating_deviation = sd\n @obj.volatility = volatility\n end",
"def update_values\n end",
"def update_values\n end",
"def update\n raise NotImplementedError\n end",
"def update!(**args)\n @answers_header_signals = args[:answers_header_signals] if args.key?(:answers_header_signals)\n @property_value = args[:property_value] if args.key?(:property_value)\n @response_meaning_application = args[:response_meaning_application] if args.key?(:response_meaning_application)\n end",
"def update!(**args)\n @create_time = args[:create_time] if args.key?(:create_time)\n @method_prop = args[:method_prop] if args.key?(:method_prop)\n @name = args[:name] if args.key?(:name)\n @state = args[:state] if args.key?(:state)\n end",
"def update attributes, collection #:nodoc:\n 0\n end",
"def update_property_groups(roll)\n @property_groups.each { |_, v| v.update_rent(roll) }\n 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 update!(**args)\n @source_property = args[:source_property] if args.key?(:source_property)\n end",
"def update_properties(path, properties)\n prop_patch = PropPatch.new(properties)\n emit('propPatch', [path, prop_patch])\n prop_patch.commit\n\n prop_patch.result\n end",
"def update\n set_deltatime\n set_last_update_at\n end"
] | [
"0.7012568",
"0.6918917",
"0.6918917",
"0.6918917",
"0.6918917",
"0.6918917",
"0.67404634",
"0.6709981",
"0.6709981",
"0.66964126",
"0.66964126",
"0.66964126",
"0.66964126",
"0.6619218",
"0.6570895",
"0.6539287",
"0.6517026",
"0.63946927",
"0.63901657",
"0.63901657",
"0.63328683",
"0.6318612",
"0.62846893",
"0.62692374",
"0.6264273",
"0.6241163",
"0.6216599",
"0.6214641",
"0.6210363",
"0.6203827",
"0.6203827",
"0.620312",
"0.6201905",
"0.62001497",
"0.61728275",
"0.61728275",
"0.6159924",
"0.61569315",
"0.61442953",
"0.61260897",
"0.6125199",
"0.61227936",
"0.61111224",
"0.610543",
"0.6102925",
"0.60839343",
"0.6083609",
"0.6066973",
"0.60602766",
"0.6055065",
"0.6051568",
"0.6051568",
"0.6042057",
"0.60319084",
"0.60221004",
"0.60149413",
"0.5994295",
"0.5989816",
"0.597674",
"0.5973157",
"0.5967343",
"0.5965598",
"0.59629464",
"0.59618354",
"0.5950329",
"0.5950329",
"0.5950329",
"0.5950329",
"0.5950329",
"0.5950329",
"0.5950329",
"0.5950329",
"0.59495455",
"0.59442014",
"0.59442014",
"0.5944142",
"0.5944142",
"0.59361076",
"0.5925741",
"0.5925574",
"0.59250593",
"0.5924476",
"0.5924476",
"0.5921039",
"0.59155524",
"0.59145254",
"0.5888445",
"0.58860934",
"0.5882302",
"0.5879913",
"0.5877467",
"0.5877467",
"0.58743787",
"0.585829",
"0.584583",
"0.58408254",
"0.5835501",
"0.5829063",
"0.5828611",
"0.58228916",
"0.5819882"
] | 0.0 | -1 |
Update properties of this object | def update!(**args)
@address_group_references = args[:address_group_references] if args.key?(:address_group_references)
@next_page_token = args[:next_page_token] if args.key?(:next_page_token)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update_properties(hash)\n hash.each do |key, value|\n setter_method = \"#{key}=\"\n if self.respond_to?(setter_method)\n self.send(setter_method, value)\n end\n end\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def refresh\n self.class.base_properties.each_with_index do |prop, prop_id|\n @properties[prop] = get_property(prop_id)\n end\n refresh_features\n refresh_status\n refresh_config\n self\n end",
"def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\n end",
"def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\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 update_properties!(branch_id=nil)\n properties = fetch_properties(false, branch_id)\n length = properties.length\n counter = 0\n properties.each do |property|\n counter += 1\n if Vebra.debugging?\n puts \"[Vebra]: #{counter}/#{length}: live updating property with Vebra ref: #{property.attributes[:vebra_ref]}\"\n end\n live_update!(property)\n Vebra.set_last_updated_at(Time.now) if counter == length\n end\n end",
"def update_self obj\n obj.each do |k,v|\n instance_variable_set(\"@#{k}\", v) if v\n end\n end",
"def update_attributes(properties_hash)\n self.class.get_class_properties.each do |property|\n key = property[:name].to_sym\n if properties_hash.has_key? key\n self.setValue(properties_hash[key], forKey:key)\n end\n end\n end",
"def update\n # TODO: implement update\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @states = args[:states] if args.key?(:states)\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end",
"def update!(**args)\n @property = args[:property] if args.key?(:property)\n @total_value_count = args[:total_value_count] if args.key?(:total_value_count)\n @value = args[:value] if args.key?(:value)\n @value_status = args[:value_status] if args.key?(:value_status)\n end",
"def update\n \n end",
"def refresh\n set_attributes\n end",
"def update(attrs)\n @attrs.update(attrs)\n self\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @source = args[:source] if args.key?(:source)\n end",
"def update_resource object, attributes\n object.update attributes\n end",
"def update(attrs)\n @attrs ||= {}\n @attrs.update(attrs)\n self\n end",
"def update\n \n end",
"def update!(**args)\n @property = args[:property] if args.key?(:property)\n @schema = args[:schema] if args.key?(:schema)\n end",
"def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def _update!\n self.class.properties.each do |property, predicate|\n if dirty?(property)\n self.class.repository_or_fail.delete([subject, predicate[:predicate], nil])\n if self.class.is_list?(property)\n repo = RDF::Repository.new\n attribute_get(property).each do |value|\n repo << RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(value, self.class.properties[property][:type]))\n end\n self.class.repository_or_fail.insert(*repo)\n else\n self.class.repository_or_fail.insert(RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(attribute_get(property), self.class.properties[property][:type])))\n end\n end\n @dirty[property] = nil\n @attributes[:original][property] = attribute_get(property)\n end\n self.class.repository_or_fail.insert(RDF::Statement.new(@subject, RDF.type, type)) unless type.nil?\n end",
"def update(attributes = {})\n super(attributes)\n retrieve!\n self\n end",
"def update\n @objects.map(&:update);\n end",
"def update\n raise NotImplementedError\n end",
"def update\n raise NotImplementedError\n end",
"def live_update!(property)\n property_class = Vebra.models[:property][:class].to_s.camelize.constantize\n\n # ensure we have the full property attributes\n property.get_property if !property.attributes[:status] && property.attributes[:action] != 'deleted'\n\n # find & update or build a new property\n property_model = property_class.find_or_initialize_by_vebra_ref(property.attributes[:vebra_ref])\n\n # make sure property object is not empty\n return false if !property.attributes || !property.attributes[:property_type]\n\n # if the property has been deleted, mark it appropriately and move on\n if property.attributes[:action] == 'deleted'\n return property_model.destroy\n end\n\n # extract accessible attributes for the property\n property_accessibles = property_class.accessible_attributes.map(&:to_sym)\n property_attributes = property.attributes.inject({}) do |result, (key, value)|\n result[key] = value if property_accessibles.include?(key)\n result\n end\n\n # update the property model's attributes\n property_model.no_callbacks = true if property_model.respond_to?(:no_callbacks)\n property_model.update_attributes(property_attributes)\n\n # find & update or build a new address\n if Vebra.models[:address]\n address_class = Vebra.models[:address][:class].to_s.camelize.constantize\n address_model = property_model.send(Vebra.models[:property][:address_method])\n address_model = property_model.send(\"build_#{Vebra.models[:property][:address_method]}\") unless address_model\n\n # extract accessible attributes for the address\n address_accessibles = address_class.accessible_attributes.map(&:to_sym)\n address_attributes = property.attributes[:address].inject({}) do |result, (key, value)|\n result[key] = value if address_accessibles.include?(key)\n result\n end\n\n # update the address model's attributes\n address_model.update_attributes(address_attributes)\n end\n\n # find & update or build new rooms\n if Vebra.models[:room]\n room_class = Vebra.models[:room][:class].to_s.camelize.constantize\n\n # accessible attributes for the rooms\n room_accessibles = room_class.accessible_attributes.map(&:to_sym)\n\n # delete any rooms which are no longer present\n property_rooms = property.attributes[:rooms] || []\n property_model_rooms = property_model.send(Vebra.models[:property][:rooms_method])\n refs_to_delete = property_model_rooms.map(&:vebra_ref) - property_rooms.map { |r| r[:vebra_ref] }\n property_model_rooms.each do |room|\n room.destroy if refs_to_delete.include?(room.vebra_ref)\n end\n\n # find & update or build new rooms\n property_rooms.each do |room|\n room_model = room_class.find_by_property_id_and_vebra_ref(property_model.id, room[:vebra_ref])\n room_model = property_model_rooms.build unless room_model\n\n # extract accessible attributes for the room\n room_attributes = room.inject({}) do |result, (key, value)|\n result[key] = value if room_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n room_model.update_attributes(room_attributes)\n end\n end\n\n # find & update or build new file attachments\n if Vebra.models[:file]\n file_class = Vebra.models[:file][:class].to_s.camelize.constantize\n\n # accessible attributes for the files\n file_accessibles = file_class.accessible_attributes.map(&:to_sym)\n\n # first normalize the collection (currently nested collections)\n property_files = property.attributes[:files].inject([]) do |result, (kind, collection)|\n collection.each do |file|\n file[:type] = kind.to_s.singularize.camelize if file_accessibles.include?(:type)\n file[\"remote_#{Vebra.models[:file][:attachment_method]}_url\".to_sym] = file.delete(:url)\n # if file[:type] is set, it means the attachment file class can be subclassed. In this\n # case we need to ensure that the subclass exists. If not, we ignore this file\n begin\n file[:type].constantize if file_accessibles.include?(:type)\n result << file\n rescue NameError => e\n # ignore - this means the subclass does not exist\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n\n result\n end\n\n # delete any files which are no longer present\n property_model_files = property_model.send(Vebra.models[:property][:files_method])\n refs_to_delete = property_model_files.map(&:vebra_ref) - property_files.map { |f| f[:vebra_ref] }\n property_model_files.each do |file|\n file.destroy if refs_to_delete.include?(file.vebra_ref)\n end\n\n # find & update or build new files\n property_files.each do |file|\n begin\n file_model = property_model_files.find_by_vebra_ref(file[:vebra_ref])\n file_model = property_model_files.build unless file_model\n\n # extract accessible attributes for the file\n file_attributes = file.inject({}) do |result, (key, value)|\n result[key] = value if file_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n file_model.update_attributes(file_attributes)\n rescue CarrierWave::ProcessingError, OpenURI::HTTPError => e\n # just ignore the file\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n end\n\n property_model.no_callbacks = false if property_model.respond_to?(:no_callbacks)\n property_model.save\n return property_model\n end",
"def update!(**args)\n @id = args[:id] if args.key?(:id)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def update\n end",
"def update!(**args)\n @mid = args[:mid] if args.key?(:mid)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def modified_properties=(value)\n @modified_properties = value\n end",
"def apply_properties!(properties)\n # Non-commutitivity etc. eventually.\n end",
"def set_properties(hash)\n hash.each do |key, value|\n add_or_remove_ostruct_member(key, value)\n end\n rest_reset_properties\n end",
"def update\n\t\t\n\t\tend",
"def set_props(props)\n @props.merge!(props)\n end",
"def update() end",
"def update!(**args)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def assign_properties\n self.properties ||= {}\n listing_properties.each do |prop|\n self.properties[prop.key] ||= prop.value\n end\n end",
"def change_properties(new_current_floor, new_next_floor, new_movement)\n @current_floor = new_current_floor\n @next_floor = new_next_floor\n @movement = new_movement\n end",
"def update!(**args)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end",
"def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end",
"def update(attributes)\n (@attributes ||= {}).merge! attributes\n\n (self.class.attr_initializables & attributes.keys).each do |name|\n instance_variable_set :\"@#{name}\", attributes[name]\n end\n\n self\n end",
"def update_attributes(attrs)\n super({})\n end",
"def update\n @dirty = true\n end",
"def update\n\n # Run through the mixin updates\n colourable_update\n movable_update\n\n end",
"def set(props)\n props.each do |prop, val|\n self.send(:\"#{ prop }=\", val)\n end\n end",
"def update\n super\n end",
"def update!(**args)\n @property_id = args[:property_id] if args.key?(:property_id)\n @value_status = args[:value_status] if args.key?(:value_status)\n end",
"def update!(**args)\n @object_size_bytes = args[:object_size_bytes] if args.key?(:object_size_bytes)\n @object_version = args[:object_version] if args.key?(:object_version)\n end",
"def movable_update\n\n # Work through the different aspects we update\n movable_location_update\n movable_size_update\n movable_angle_update\n\n end",
"def properties=(value)\n @properties = value\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(context={})\n self.pre_cast_attributes\n m2o = @relations.reject{|k, v| !self.class.many2one_relations.has_key?(k)}\n vals = @attributes.reject {|key, value| key == 'id'}.merge(m2o.merge(m2o){|k, v| v.is_a?(Array) ? v[0] : v})\n self.class.rpc_execute('write', self.id, vals, context)\n reload_from_record!(self.class.find(self.id, :context => context))\n end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update ; end",
"def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end",
"def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end",
"def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end",
"def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end",
"def update_with(attributes)\n assign_attributes(attributes)\n end",
"def update\n # don't need to update; hash is shared\n end",
"def update(attributes)\n HashProxy.with(attributes) do |proxy|\n self.class.attribute_names.each do |name|\n send(\"#{name}=\", proxy[name]) if proxy.key?(name)\n end\n end\n save\n end",
"def update!(**args)\n @object_id_prop = args[:object_id_prop] if args.key?(:object_id_prop)\n @relation = args[:relation] if args.key?(:relation)\n @subject_id = args[:subject_id] if args.key?(:subject_id)\n end",
"def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end",
"def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end",
"def update\n raise NotImplementedError\n end",
"def update_attributes attributes\n @attributes.merge! attributes\n end",
"def update!(**args)\n @async_options = args[:async_options] if args.key?(:async_options)\n @input_mappings = args[:input_mappings] if args.key?(:input_mappings)\n @name_property = args[:name_property] if args.key?(:name_property)\n @validation_options = args[:validation_options] if args.key?(:validation_options)\n end",
"def update\r\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @type = args[:type] if args.key?(:type)\n end",
"def update\n raise NotImplemented\n end",
"def update_obj\n mean, sd = rating.to_glicko_rating\n @obj.rating = mean\n @obj.rating_deviation = sd\n @obj.volatility = volatility\n end",
"def update_values\n end",
"def update_values\n end",
"def update\n raise NotImplementedError\n end",
"def update!(**args)\n @answers_header_signals = args[:answers_header_signals] if args.key?(:answers_header_signals)\n @property_value = args[:property_value] if args.key?(:property_value)\n @response_meaning_application = args[:response_meaning_application] if args.key?(:response_meaning_application)\n end",
"def update!(**args)\n @create_time = args[:create_time] if args.key?(:create_time)\n @method_prop = args[:method_prop] if args.key?(:method_prop)\n @name = args[:name] if args.key?(:name)\n @state = args[:state] if args.key?(:state)\n end",
"def update attributes, collection #:nodoc:\n 0\n end",
"def update_property_groups(roll)\n @property_groups.each { |_, v| v.update_rent(roll) }\n end",
"def update!(**args)\n @source_property = args[:source_property] if args.key?(:source_property)\n 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 update_properties(path, properties)\n prop_patch = PropPatch.new(properties)\n emit('propPatch', [path, prop_patch])\n prop_patch.commit\n\n prop_patch.result\n end",
"def update\n set_deltatime\n set_last_update_at\n end"
] | [
"0.7012263",
"0.69181895",
"0.69181895",
"0.69181895",
"0.69181895",
"0.69181895",
"0.67403597",
"0.6709326",
"0.6709326",
"0.6696149",
"0.6696149",
"0.6696149",
"0.6696149",
"0.6618882",
"0.6571848",
"0.65386343",
"0.65178275",
"0.6394807",
"0.6389745",
"0.6389745",
"0.63328",
"0.6319025",
"0.6283673",
"0.6269463",
"0.62639254",
"0.62410724",
"0.62170374",
"0.62152076",
"0.6210263",
"0.6204041",
"0.6204041",
"0.62021106",
"0.62017816",
"0.62017",
"0.61730784",
"0.61730784",
"0.6159277",
"0.6156169",
"0.61445665",
"0.6125433",
"0.61241156",
"0.6121413",
"0.6110477",
"0.6105694",
"0.61016303",
"0.60845226",
"0.6084427",
"0.6065455",
"0.6059506",
"0.6054869",
"0.6051708",
"0.6051708",
"0.60413384",
"0.6030853",
"0.6022535",
"0.6015561",
"0.59932375",
"0.59898263",
"0.5976479",
"0.5973787",
"0.59678394",
"0.5963291",
"0.5962048",
"0.5961157",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.59500545",
"0.59443134",
"0.59443134",
"0.59424853",
"0.59424853",
"0.593523",
"0.5926413",
"0.5924831",
"0.592427",
"0.59233046",
"0.59233046",
"0.5921224",
"0.59144294",
"0.59142506",
"0.58887535",
"0.58854496",
"0.5883008",
"0.58792305",
"0.5876954",
"0.5876954",
"0.58744955",
"0.5857968",
"0.5845542",
"0.5841629",
"0.58363605",
"0.5829255",
"0.582919",
"0.5822138",
"0.58208305"
] | 0.0 | -1 |
Update properties of this object | def update!(**args)
@firewall_policy = args[:firewall_policy] if args.key?(:firewall_policy)
@rule_priority = args[:rule_priority] if args.key?(:rule_priority)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update_properties(hash)\n hash.each do |key, value|\n setter_method = \"#{key}=\"\n if self.respond_to?(setter_method)\n self.send(setter_method, value)\n end\n end\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def refresh\n self.class.base_properties.each_with_index do |prop, prop_id|\n @properties[prop] = get_property(prop_id)\n end\n refresh_features\n refresh_status\n refresh_config\n self\n end",
"def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\n end",
"def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\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 update_properties!(branch_id=nil)\n properties = fetch_properties(false, branch_id)\n length = properties.length\n counter = 0\n properties.each do |property|\n counter += 1\n if Vebra.debugging?\n puts \"[Vebra]: #{counter}/#{length}: live updating property with Vebra ref: #{property.attributes[:vebra_ref]}\"\n end\n live_update!(property)\n Vebra.set_last_updated_at(Time.now) if counter == length\n end\n end",
"def update_self obj\n obj.each do |k,v|\n instance_variable_set(\"@#{k}\", v) if v\n end\n end",
"def update_attributes(properties_hash)\n self.class.get_class_properties.each do |property|\n key = property[:name].to_sym\n if properties_hash.has_key? key\n self.setValue(properties_hash[key], forKey:key)\n end\n end\n end",
"def update\n # TODO: implement update\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @states = args[:states] if args.key?(:states)\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end",
"def update!(**args)\n @property = args[:property] if args.key?(:property)\n @total_value_count = args[:total_value_count] if args.key?(:total_value_count)\n @value = args[:value] if args.key?(:value)\n @value_status = args[:value_status] if args.key?(:value_status)\n end",
"def update\n \n end",
"def refresh\n set_attributes\n end",
"def update(attrs)\n @attrs.update(attrs)\n self\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @source = args[:source] if args.key?(:source)\n end",
"def update_resource object, attributes\n object.update attributes\n end",
"def update(attrs)\n @attrs ||= {}\n @attrs.update(attrs)\n self\n end",
"def update\n \n end",
"def update!(**args)\n @property = args[:property] if args.key?(:property)\n @schema = args[:schema] if args.key?(:schema)\n end",
"def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def _update!\n self.class.properties.each do |property, predicate|\n if dirty?(property)\n self.class.repository_or_fail.delete([subject, predicate[:predicate], nil])\n if self.class.is_list?(property)\n repo = RDF::Repository.new\n attribute_get(property).each do |value|\n repo << RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(value, self.class.properties[property][:type]))\n end\n self.class.repository_or_fail.insert(*repo)\n else\n self.class.repository_or_fail.insert(RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(attribute_get(property), self.class.properties[property][:type])))\n end\n end\n @dirty[property] = nil\n @attributes[:original][property] = attribute_get(property)\n end\n self.class.repository_or_fail.insert(RDF::Statement.new(@subject, RDF.type, type)) unless type.nil?\n end",
"def update(attributes = {})\n super(attributes)\n retrieve!\n self\n end",
"def update\n @objects.map(&:update);\n end",
"def update\n raise NotImplementedError\n end",
"def update\n raise NotImplementedError\n end",
"def live_update!(property)\n property_class = Vebra.models[:property][:class].to_s.camelize.constantize\n\n # ensure we have the full property attributes\n property.get_property if !property.attributes[:status] && property.attributes[:action] != 'deleted'\n\n # find & update or build a new property\n property_model = property_class.find_or_initialize_by_vebra_ref(property.attributes[:vebra_ref])\n\n # make sure property object is not empty\n return false if !property.attributes || !property.attributes[:property_type]\n\n # if the property has been deleted, mark it appropriately and move on\n if property.attributes[:action] == 'deleted'\n return property_model.destroy\n end\n\n # extract accessible attributes for the property\n property_accessibles = property_class.accessible_attributes.map(&:to_sym)\n property_attributes = property.attributes.inject({}) do |result, (key, value)|\n result[key] = value if property_accessibles.include?(key)\n result\n end\n\n # update the property model's attributes\n property_model.no_callbacks = true if property_model.respond_to?(:no_callbacks)\n property_model.update_attributes(property_attributes)\n\n # find & update or build a new address\n if Vebra.models[:address]\n address_class = Vebra.models[:address][:class].to_s.camelize.constantize\n address_model = property_model.send(Vebra.models[:property][:address_method])\n address_model = property_model.send(\"build_#{Vebra.models[:property][:address_method]}\") unless address_model\n\n # extract accessible attributes for the address\n address_accessibles = address_class.accessible_attributes.map(&:to_sym)\n address_attributes = property.attributes[:address].inject({}) do |result, (key, value)|\n result[key] = value if address_accessibles.include?(key)\n result\n end\n\n # update the address model's attributes\n address_model.update_attributes(address_attributes)\n end\n\n # find & update or build new rooms\n if Vebra.models[:room]\n room_class = Vebra.models[:room][:class].to_s.camelize.constantize\n\n # accessible attributes for the rooms\n room_accessibles = room_class.accessible_attributes.map(&:to_sym)\n\n # delete any rooms which are no longer present\n property_rooms = property.attributes[:rooms] || []\n property_model_rooms = property_model.send(Vebra.models[:property][:rooms_method])\n refs_to_delete = property_model_rooms.map(&:vebra_ref) - property_rooms.map { |r| r[:vebra_ref] }\n property_model_rooms.each do |room|\n room.destroy if refs_to_delete.include?(room.vebra_ref)\n end\n\n # find & update or build new rooms\n property_rooms.each do |room|\n room_model = room_class.find_by_property_id_and_vebra_ref(property_model.id, room[:vebra_ref])\n room_model = property_model_rooms.build unless room_model\n\n # extract accessible attributes for the room\n room_attributes = room.inject({}) do |result, (key, value)|\n result[key] = value if room_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n room_model.update_attributes(room_attributes)\n end\n end\n\n # find & update or build new file attachments\n if Vebra.models[:file]\n file_class = Vebra.models[:file][:class].to_s.camelize.constantize\n\n # accessible attributes for the files\n file_accessibles = file_class.accessible_attributes.map(&:to_sym)\n\n # first normalize the collection (currently nested collections)\n property_files = property.attributes[:files].inject([]) do |result, (kind, collection)|\n collection.each do |file|\n file[:type] = kind.to_s.singularize.camelize if file_accessibles.include?(:type)\n file[\"remote_#{Vebra.models[:file][:attachment_method]}_url\".to_sym] = file.delete(:url)\n # if file[:type] is set, it means the attachment file class can be subclassed. In this\n # case we need to ensure that the subclass exists. If not, we ignore this file\n begin\n file[:type].constantize if file_accessibles.include?(:type)\n result << file\n rescue NameError => e\n # ignore - this means the subclass does not exist\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n\n result\n end\n\n # delete any files which are no longer present\n property_model_files = property_model.send(Vebra.models[:property][:files_method])\n refs_to_delete = property_model_files.map(&:vebra_ref) - property_files.map { |f| f[:vebra_ref] }\n property_model_files.each do |file|\n file.destroy if refs_to_delete.include?(file.vebra_ref)\n end\n\n # find & update or build new files\n property_files.each do |file|\n begin\n file_model = property_model_files.find_by_vebra_ref(file[:vebra_ref])\n file_model = property_model_files.build unless file_model\n\n # extract accessible attributes for the file\n file_attributes = file.inject({}) do |result, (key, value)|\n result[key] = value if file_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n file_model.update_attributes(file_attributes)\n rescue CarrierWave::ProcessingError, OpenURI::HTTPError => e\n # just ignore the file\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n end\n\n property_model.no_callbacks = false if property_model.respond_to?(:no_callbacks)\n property_model.save\n return property_model\n end",
"def update!(**args)\n @id = args[:id] if args.key?(:id)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def update\n end",
"def update!(**args)\n @mid = args[:mid] if args.key?(:mid)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def modified_properties=(value)\n @modified_properties = value\n end",
"def apply_properties!(properties)\n # Non-commutitivity etc. eventually.\n end",
"def set_properties(hash)\n hash.each do |key, value|\n add_or_remove_ostruct_member(key, value)\n end\n rest_reset_properties\n end",
"def update\n\t\t\n\t\tend",
"def set_props(props)\n @props.merge!(props)\n end",
"def update() end",
"def update!(**args)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def assign_properties\n self.properties ||= {}\n listing_properties.each do |prop|\n self.properties[prop.key] ||= prop.value\n end\n end",
"def change_properties(new_current_floor, new_next_floor, new_movement)\n @current_floor = new_current_floor\n @next_floor = new_next_floor\n @movement = new_movement\n end",
"def update!(**args)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end",
"def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end",
"def update(attributes)\n (@attributes ||= {}).merge! attributes\n\n (self.class.attr_initializables & attributes.keys).each do |name|\n instance_variable_set :\"@#{name}\", attributes[name]\n end\n\n self\n end",
"def update_attributes(attrs)\n super({})\n end",
"def update\n @dirty = true\n end",
"def update\n\n # Run through the mixin updates\n colourable_update\n movable_update\n\n end",
"def set(props)\n props.each do |prop, val|\n self.send(:\"#{ prop }=\", val)\n end\n end",
"def update\n super\n end",
"def update!(**args)\n @property_id = args[:property_id] if args.key?(:property_id)\n @value_status = args[:value_status] if args.key?(:value_status)\n end",
"def update!(**args)\n @object_size_bytes = args[:object_size_bytes] if args.key?(:object_size_bytes)\n @object_version = args[:object_version] if args.key?(:object_version)\n end",
"def movable_update\n\n # Work through the different aspects we update\n movable_location_update\n movable_size_update\n movable_angle_update\n\n end",
"def properties=(value)\n @properties = value\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(context={})\n self.pre_cast_attributes\n m2o = @relations.reject{|k, v| !self.class.many2one_relations.has_key?(k)}\n vals = @attributes.reject {|key, value| key == 'id'}.merge(m2o.merge(m2o){|k, v| v.is_a?(Array) ? v[0] : v})\n self.class.rpc_execute('write', self.id, vals, context)\n reload_from_record!(self.class.find(self.id, :context => context))\n end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update ; end",
"def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end",
"def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end",
"def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end",
"def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end",
"def update_with(attributes)\n assign_attributes(attributes)\n end",
"def update\n # don't need to update; hash is shared\n end",
"def update(attributes)\n HashProxy.with(attributes) do |proxy|\n self.class.attribute_names.each do |name|\n send(\"#{name}=\", proxy[name]) if proxy.key?(name)\n end\n end\n save\n end",
"def update!(**args)\n @object_id_prop = args[:object_id_prop] if args.key?(:object_id_prop)\n @relation = args[:relation] if args.key?(:relation)\n @subject_id = args[:subject_id] if args.key?(:subject_id)\n end",
"def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end",
"def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end",
"def update\n raise NotImplementedError\n end",
"def update_attributes attributes\n @attributes.merge! attributes\n end",
"def update!(**args)\n @async_options = args[:async_options] if args.key?(:async_options)\n @input_mappings = args[:input_mappings] if args.key?(:input_mappings)\n @name_property = args[:name_property] if args.key?(:name_property)\n @validation_options = args[:validation_options] if args.key?(:validation_options)\n end",
"def update\r\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @type = args[:type] if args.key?(:type)\n end",
"def update\n raise NotImplemented\n end",
"def update_obj\n mean, sd = rating.to_glicko_rating\n @obj.rating = mean\n @obj.rating_deviation = sd\n @obj.volatility = volatility\n end",
"def update_values\n end",
"def update_values\n end",
"def update\n raise NotImplementedError\n end",
"def update!(**args)\n @answers_header_signals = args[:answers_header_signals] if args.key?(:answers_header_signals)\n @property_value = args[:property_value] if args.key?(:property_value)\n @response_meaning_application = args[:response_meaning_application] if args.key?(:response_meaning_application)\n end",
"def update!(**args)\n @create_time = args[:create_time] if args.key?(:create_time)\n @method_prop = args[:method_prop] if args.key?(:method_prop)\n @name = args[:name] if args.key?(:name)\n @state = args[:state] if args.key?(:state)\n end",
"def update attributes, collection #:nodoc:\n 0\n end",
"def update_property_groups(roll)\n @property_groups.each { |_, v| v.update_rent(roll) }\n end",
"def update!(**args)\n @source_property = args[:source_property] if args.key?(:source_property)\n 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 update_properties(path, properties)\n prop_patch = PropPatch.new(properties)\n emit('propPatch', [path, prop_patch])\n prop_patch.commit\n\n prop_patch.result\n end",
"def update\n set_deltatime\n set_last_update_at\n end"
] | [
"0.7012263",
"0.69181895",
"0.69181895",
"0.69181895",
"0.69181895",
"0.69181895",
"0.67403597",
"0.6709326",
"0.6709326",
"0.6696149",
"0.6696149",
"0.6696149",
"0.6696149",
"0.6618882",
"0.6571848",
"0.65386343",
"0.65178275",
"0.6394807",
"0.6389745",
"0.6389745",
"0.63328",
"0.6319025",
"0.6283673",
"0.6269463",
"0.62639254",
"0.62410724",
"0.62170374",
"0.62152076",
"0.6210263",
"0.6204041",
"0.6204041",
"0.62021106",
"0.62017816",
"0.62017",
"0.61730784",
"0.61730784",
"0.6159277",
"0.6156169",
"0.61445665",
"0.6125433",
"0.61241156",
"0.6121413",
"0.6110477",
"0.6105694",
"0.61016303",
"0.60845226",
"0.6084427",
"0.6065455",
"0.6059506",
"0.6054869",
"0.6051708",
"0.6051708",
"0.60413384",
"0.6030853",
"0.6022535",
"0.6015561",
"0.59932375",
"0.59898263",
"0.5976479",
"0.5973787",
"0.59678394",
"0.5963291",
"0.5962048",
"0.5961157",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.59500545",
"0.59443134",
"0.59443134",
"0.59424853",
"0.59424853",
"0.593523",
"0.5926413",
"0.5924831",
"0.592427",
"0.59233046",
"0.59233046",
"0.5921224",
"0.59144294",
"0.59142506",
"0.58887535",
"0.58854496",
"0.5883008",
"0.58792305",
"0.5876954",
"0.5876954",
"0.58744955",
"0.5857968",
"0.5845542",
"0.5841629",
"0.58363605",
"0.5829255",
"0.582919",
"0.5822138",
"0.58208305"
] | 0.0 | -1 |
Update properties of this object | def update!(**args)
@address_groups = args[:address_groups] if args.key?(:address_groups)
@next_page_token = args[:next_page_token] if args.key?(:next_page_token)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update_properties(hash)\n hash.each do |key, value|\n setter_method = \"#{key}=\"\n if self.respond_to?(setter_method)\n self.send(setter_method, value)\n end\n end\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def refresh\n self.class.base_properties.each_with_index do |prop, prop_id|\n @properties[prop] = get_property(prop_id)\n end\n refresh_features\n refresh_status\n refresh_config\n self\n end",
"def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\n end",
"def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\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 update_properties!(branch_id=nil)\n properties = fetch_properties(false, branch_id)\n length = properties.length\n counter = 0\n properties.each do |property|\n counter += 1\n if Vebra.debugging?\n puts \"[Vebra]: #{counter}/#{length}: live updating property with Vebra ref: #{property.attributes[:vebra_ref]}\"\n end\n live_update!(property)\n Vebra.set_last_updated_at(Time.now) if counter == length\n end\n end",
"def update_self obj\n obj.each do |k,v|\n instance_variable_set(\"@#{k}\", v) if v\n end\n end",
"def update_attributes(properties_hash)\n self.class.get_class_properties.each do |property|\n key = property[:name].to_sym\n if properties_hash.has_key? key\n self.setValue(properties_hash[key], forKey:key)\n end\n end\n end",
"def update\n # TODO: implement update\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @states = args[:states] if args.key?(:states)\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end",
"def update!(**args)\n @property = args[:property] if args.key?(:property)\n @total_value_count = args[:total_value_count] if args.key?(:total_value_count)\n @value = args[:value] if args.key?(:value)\n @value_status = args[:value_status] if args.key?(:value_status)\n end",
"def update\n \n end",
"def refresh\n set_attributes\n end",
"def update(attrs)\n @attrs.update(attrs)\n self\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @source = args[:source] if args.key?(:source)\n end",
"def update_resource object, attributes\n object.update attributes\n end",
"def update(attrs)\n @attrs ||= {}\n @attrs.update(attrs)\n self\n end",
"def update\n \n end",
"def update!(**args)\n @property = args[:property] if args.key?(:property)\n @schema = args[:schema] if args.key?(:schema)\n end",
"def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def _update!\n self.class.properties.each do |property, predicate|\n if dirty?(property)\n self.class.repository_or_fail.delete([subject, predicate[:predicate], nil])\n if self.class.is_list?(property)\n repo = RDF::Repository.new\n attribute_get(property).each do |value|\n repo << RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(value, self.class.properties[property][:type]))\n end\n self.class.repository_or_fail.insert(*repo)\n else\n self.class.repository_or_fail.insert(RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(attribute_get(property), self.class.properties[property][:type])))\n end\n end\n @dirty[property] = nil\n @attributes[:original][property] = attribute_get(property)\n end\n self.class.repository_or_fail.insert(RDF::Statement.new(@subject, RDF.type, type)) unless type.nil?\n end",
"def update(attributes = {})\n super(attributes)\n retrieve!\n self\n end",
"def update\n @objects.map(&:update);\n end",
"def update\n raise NotImplementedError\n end",
"def update\n raise NotImplementedError\n end",
"def live_update!(property)\n property_class = Vebra.models[:property][:class].to_s.camelize.constantize\n\n # ensure we have the full property attributes\n property.get_property if !property.attributes[:status] && property.attributes[:action] != 'deleted'\n\n # find & update or build a new property\n property_model = property_class.find_or_initialize_by_vebra_ref(property.attributes[:vebra_ref])\n\n # make sure property object is not empty\n return false if !property.attributes || !property.attributes[:property_type]\n\n # if the property has been deleted, mark it appropriately and move on\n if property.attributes[:action] == 'deleted'\n return property_model.destroy\n end\n\n # extract accessible attributes for the property\n property_accessibles = property_class.accessible_attributes.map(&:to_sym)\n property_attributes = property.attributes.inject({}) do |result, (key, value)|\n result[key] = value if property_accessibles.include?(key)\n result\n end\n\n # update the property model's attributes\n property_model.no_callbacks = true if property_model.respond_to?(:no_callbacks)\n property_model.update_attributes(property_attributes)\n\n # find & update or build a new address\n if Vebra.models[:address]\n address_class = Vebra.models[:address][:class].to_s.camelize.constantize\n address_model = property_model.send(Vebra.models[:property][:address_method])\n address_model = property_model.send(\"build_#{Vebra.models[:property][:address_method]}\") unless address_model\n\n # extract accessible attributes for the address\n address_accessibles = address_class.accessible_attributes.map(&:to_sym)\n address_attributes = property.attributes[:address].inject({}) do |result, (key, value)|\n result[key] = value if address_accessibles.include?(key)\n result\n end\n\n # update the address model's attributes\n address_model.update_attributes(address_attributes)\n end\n\n # find & update or build new rooms\n if Vebra.models[:room]\n room_class = Vebra.models[:room][:class].to_s.camelize.constantize\n\n # accessible attributes for the rooms\n room_accessibles = room_class.accessible_attributes.map(&:to_sym)\n\n # delete any rooms which are no longer present\n property_rooms = property.attributes[:rooms] || []\n property_model_rooms = property_model.send(Vebra.models[:property][:rooms_method])\n refs_to_delete = property_model_rooms.map(&:vebra_ref) - property_rooms.map { |r| r[:vebra_ref] }\n property_model_rooms.each do |room|\n room.destroy if refs_to_delete.include?(room.vebra_ref)\n end\n\n # find & update or build new rooms\n property_rooms.each do |room|\n room_model = room_class.find_by_property_id_and_vebra_ref(property_model.id, room[:vebra_ref])\n room_model = property_model_rooms.build unless room_model\n\n # extract accessible attributes for the room\n room_attributes = room.inject({}) do |result, (key, value)|\n result[key] = value if room_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n room_model.update_attributes(room_attributes)\n end\n end\n\n # find & update or build new file attachments\n if Vebra.models[:file]\n file_class = Vebra.models[:file][:class].to_s.camelize.constantize\n\n # accessible attributes for the files\n file_accessibles = file_class.accessible_attributes.map(&:to_sym)\n\n # first normalize the collection (currently nested collections)\n property_files = property.attributes[:files].inject([]) do |result, (kind, collection)|\n collection.each do |file|\n file[:type] = kind.to_s.singularize.camelize if file_accessibles.include?(:type)\n file[\"remote_#{Vebra.models[:file][:attachment_method]}_url\".to_sym] = file.delete(:url)\n # if file[:type] is set, it means the attachment file class can be subclassed. In this\n # case we need to ensure that the subclass exists. If not, we ignore this file\n begin\n file[:type].constantize if file_accessibles.include?(:type)\n result << file\n rescue NameError => e\n # ignore - this means the subclass does not exist\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n\n result\n end\n\n # delete any files which are no longer present\n property_model_files = property_model.send(Vebra.models[:property][:files_method])\n refs_to_delete = property_model_files.map(&:vebra_ref) - property_files.map { |f| f[:vebra_ref] }\n property_model_files.each do |file|\n file.destroy if refs_to_delete.include?(file.vebra_ref)\n end\n\n # find & update or build new files\n property_files.each do |file|\n begin\n file_model = property_model_files.find_by_vebra_ref(file[:vebra_ref])\n file_model = property_model_files.build unless file_model\n\n # extract accessible attributes for the file\n file_attributes = file.inject({}) do |result, (key, value)|\n result[key] = value if file_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n file_model.update_attributes(file_attributes)\n rescue CarrierWave::ProcessingError, OpenURI::HTTPError => e\n # just ignore the file\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n end\n\n property_model.no_callbacks = false if property_model.respond_to?(:no_callbacks)\n property_model.save\n return property_model\n end",
"def update!(**args)\n @id = args[:id] if args.key?(:id)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def update\n end",
"def update!(**args)\n @mid = args[:mid] if args.key?(:mid)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def modified_properties=(value)\n @modified_properties = value\n end",
"def apply_properties!(properties)\n # Non-commutitivity etc. eventually.\n end",
"def set_properties(hash)\n hash.each do |key, value|\n add_or_remove_ostruct_member(key, value)\n end\n rest_reset_properties\n end",
"def update\n\t\t\n\t\tend",
"def set_props(props)\n @props.merge!(props)\n end",
"def update() end",
"def update!(**args)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def assign_properties\n self.properties ||= {}\n listing_properties.each do |prop|\n self.properties[prop.key] ||= prop.value\n end\n end",
"def change_properties(new_current_floor, new_next_floor, new_movement)\n @current_floor = new_current_floor\n @next_floor = new_next_floor\n @movement = new_movement\n end",
"def update!(**args)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end",
"def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end",
"def update(attributes)\n (@attributes ||= {}).merge! attributes\n\n (self.class.attr_initializables & attributes.keys).each do |name|\n instance_variable_set :\"@#{name}\", attributes[name]\n end\n\n self\n end",
"def update_attributes(attrs)\n super({})\n end",
"def update\n @dirty = true\n end",
"def update\n\n # Run through the mixin updates\n colourable_update\n movable_update\n\n end",
"def set(props)\n props.each do |prop, val|\n self.send(:\"#{ prop }=\", val)\n end\n end",
"def update\n super\n end",
"def update!(**args)\n @property_id = args[:property_id] if args.key?(:property_id)\n @value_status = args[:value_status] if args.key?(:value_status)\n end",
"def update!(**args)\n @object_size_bytes = args[:object_size_bytes] if args.key?(:object_size_bytes)\n @object_version = args[:object_version] if args.key?(:object_version)\n end",
"def movable_update\n\n # Work through the different aspects we update\n movable_location_update\n movable_size_update\n movable_angle_update\n\n end",
"def properties=(value)\n @properties = value\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(context={})\n self.pre_cast_attributes\n m2o = @relations.reject{|k, v| !self.class.many2one_relations.has_key?(k)}\n vals = @attributes.reject {|key, value| key == 'id'}.merge(m2o.merge(m2o){|k, v| v.is_a?(Array) ? v[0] : v})\n self.class.rpc_execute('write', self.id, vals, context)\n reload_from_record!(self.class.find(self.id, :context => context))\n end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update ; end",
"def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end",
"def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end",
"def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end",
"def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end",
"def update_with(attributes)\n assign_attributes(attributes)\n end",
"def update\n # don't need to update; hash is shared\n end",
"def update(attributes)\n HashProxy.with(attributes) do |proxy|\n self.class.attribute_names.each do |name|\n send(\"#{name}=\", proxy[name]) if proxy.key?(name)\n end\n end\n save\n end",
"def update!(**args)\n @object_id_prop = args[:object_id_prop] if args.key?(:object_id_prop)\n @relation = args[:relation] if args.key?(:relation)\n @subject_id = args[:subject_id] if args.key?(:subject_id)\n end",
"def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end",
"def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end",
"def update\n raise NotImplementedError\n end",
"def update_attributes attributes\n @attributes.merge! attributes\n end",
"def update!(**args)\n @async_options = args[:async_options] if args.key?(:async_options)\n @input_mappings = args[:input_mappings] if args.key?(:input_mappings)\n @name_property = args[:name_property] if args.key?(:name_property)\n @validation_options = args[:validation_options] if args.key?(:validation_options)\n end",
"def update\r\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @type = args[:type] if args.key?(:type)\n end",
"def update\n raise NotImplemented\n end",
"def update_obj\n mean, sd = rating.to_glicko_rating\n @obj.rating = mean\n @obj.rating_deviation = sd\n @obj.volatility = volatility\n end",
"def update_values\n end",
"def update_values\n end",
"def update\n raise NotImplementedError\n end",
"def update!(**args)\n @answers_header_signals = args[:answers_header_signals] if args.key?(:answers_header_signals)\n @property_value = args[:property_value] if args.key?(:property_value)\n @response_meaning_application = args[:response_meaning_application] if args.key?(:response_meaning_application)\n end",
"def update!(**args)\n @create_time = args[:create_time] if args.key?(:create_time)\n @method_prop = args[:method_prop] if args.key?(:method_prop)\n @name = args[:name] if args.key?(:name)\n @state = args[:state] if args.key?(:state)\n end",
"def update attributes, collection #:nodoc:\n 0\n end",
"def update_property_groups(roll)\n @property_groups.each { |_, v| v.update_rent(roll) }\n end",
"def update!(**args)\n @source_property = args[:source_property] if args.key?(:source_property)\n 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 update_properties(path, properties)\n prop_patch = PropPatch.new(properties)\n emit('propPatch', [path, prop_patch])\n prop_patch.commit\n\n prop_patch.result\n end",
"def update\n set_deltatime\n set_last_update_at\n end"
] | [
"0.7012263",
"0.69181895",
"0.69181895",
"0.69181895",
"0.69181895",
"0.69181895",
"0.67403597",
"0.6709326",
"0.6709326",
"0.6696149",
"0.6696149",
"0.6696149",
"0.6696149",
"0.6618882",
"0.6571848",
"0.65386343",
"0.65178275",
"0.6394807",
"0.6389745",
"0.6389745",
"0.63328",
"0.6319025",
"0.6283673",
"0.6269463",
"0.62639254",
"0.62410724",
"0.62170374",
"0.62152076",
"0.6210263",
"0.6204041",
"0.6204041",
"0.62021106",
"0.62017816",
"0.62017",
"0.61730784",
"0.61730784",
"0.6159277",
"0.6156169",
"0.61445665",
"0.6125433",
"0.61241156",
"0.6121413",
"0.6110477",
"0.6105694",
"0.61016303",
"0.60845226",
"0.6084427",
"0.6065455",
"0.6059506",
"0.6054869",
"0.6051708",
"0.6051708",
"0.60413384",
"0.6030853",
"0.6022535",
"0.6015561",
"0.59932375",
"0.59898263",
"0.5976479",
"0.5973787",
"0.59678394",
"0.5963291",
"0.5962048",
"0.5961157",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.59500545",
"0.59443134",
"0.59443134",
"0.59424853",
"0.59424853",
"0.593523",
"0.5926413",
"0.5924831",
"0.592427",
"0.59233046",
"0.59233046",
"0.5921224",
"0.59144294",
"0.59142506",
"0.58887535",
"0.58854496",
"0.5883008",
"0.58792305",
"0.5876954",
"0.5876954",
"0.58744955",
"0.5857968",
"0.5845542",
"0.5841629",
"0.58363605",
"0.5829255",
"0.582919",
"0.5822138",
"0.58208305"
] | 0.0 | -1 |
Update properties of this object | def update!(**args)
@authorization_policies = args[:authorization_policies] if args.key?(:authorization_policies)
@next_page_token = args[:next_page_token] if args.key?(:next_page_token)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update_properties(hash)\n hash.each do |key, value|\n setter_method = \"#{key}=\"\n if self.respond_to?(setter_method)\n self.send(setter_method, value)\n end\n end\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def refresh\n self.class.base_properties.each_with_index do |prop, prop_id|\n @properties[prop] = get_property(prop_id)\n end\n refresh_features\n refresh_status\n refresh_config\n self\n end",
"def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\n end",
"def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\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 update_properties!(branch_id=nil)\n properties = fetch_properties(false, branch_id)\n length = properties.length\n counter = 0\n properties.each do |property|\n counter += 1\n if Vebra.debugging?\n puts \"[Vebra]: #{counter}/#{length}: live updating property with Vebra ref: #{property.attributes[:vebra_ref]}\"\n end\n live_update!(property)\n Vebra.set_last_updated_at(Time.now) if counter == length\n end\n end",
"def update_self obj\n obj.each do |k,v|\n instance_variable_set(\"@#{k}\", v) if v\n end\n end",
"def update_attributes(properties_hash)\n self.class.get_class_properties.each do |property|\n key = property[:name].to_sym\n if properties_hash.has_key? key\n self.setValue(properties_hash[key], forKey:key)\n end\n end\n end",
"def update\n # TODO: implement update\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @states = args[:states] if args.key?(:states)\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end",
"def update!(**args)\n @property = args[:property] if args.key?(:property)\n @total_value_count = args[:total_value_count] if args.key?(:total_value_count)\n @value = args[:value] if args.key?(:value)\n @value_status = args[:value_status] if args.key?(:value_status)\n end",
"def update\n \n end",
"def refresh\n set_attributes\n end",
"def update(attrs)\n @attrs.update(attrs)\n self\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @source = args[:source] if args.key?(:source)\n end",
"def update_resource object, attributes\n object.update attributes\n end",
"def update(attrs)\n @attrs ||= {}\n @attrs.update(attrs)\n self\n end",
"def update\n \n end",
"def update!(**args)\n @property = args[:property] if args.key?(:property)\n @schema = args[:schema] if args.key?(:schema)\n end",
"def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def update(attributes = {})\n super(attributes)\n retrieve!\n self\n end",
"def _update!\n self.class.properties.each do |property, predicate|\n if dirty?(property)\n self.class.repository_or_fail.delete([subject, predicate[:predicate], nil])\n if self.class.is_list?(property)\n repo = RDF::Repository.new\n attribute_get(property).each do |value|\n repo << RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(value, self.class.properties[property][:type]))\n end\n self.class.repository_or_fail.insert(*repo)\n else\n self.class.repository_or_fail.insert(RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(attribute_get(property), self.class.properties[property][:type])))\n end\n end\n @dirty[property] = nil\n @attributes[:original][property] = attribute_get(property)\n end\n self.class.repository_or_fail.insert(RDF::Statement.new(@subject, RDF.type, type)) unless type.nil?\n end",
"def update\n @objects.map(&:update);\n end",
"def update\n raise NotImplementedError\n end",
"def update\n raise NotImplementedError\n end",
"def live_update!(property)\n property_class = Vebra.models[:property][:class].to_s.camelize.constantize\n\n # ensure we have the full property attributes\n property.get_property if !property.attributes[:status] && property.attributes[:action] != 'deleted'\n\n # find & update or build a new property\n property_model = property_class.find_or_initialize_by_vebra_ref(property.attributes[:vebra_ref])\n\n # make sure property object is not empty\n return false if !property.attributes || !property.attributes[:property_type]\n\n # if the property has been deleted, mark it appropriately and move on\n if property.attributes[:action] == 'deleted'\n return property_model.destroy\n end\n\n # extract accessible attributes for the property\n property_accessibles = property_class.accessible_attributes.map(&:to_sym)\n property_attributes = property.attributes.inject({}) do |result, (key, value)|\n result[key] = value if property_accessibles.include?(key)\n result\n end\n\n # update the property model's attributes\n property_model.no_callbacks = true if property_model.respond_to?(:no_callbacks)\n property_model.update_attributes(property_attributes)\n\n # find & update or build a new address\n if Vebra.models[:address]\n address_class = Vebra.models[:address][:class].to_s.camelize.constantize\n address_model = property_model.send(Vebra.models[:property][:address_method])\n address_model = property_model.send(\"build_#{Vebra.models[:property][:address_method]}\") unless address_model\n\n # extract accessible attributes for the address\n address_accessibles = address_class.accessible_attributes.map(&:to_sym)\n address_attributes = property.attributes[:address].inject({}) do |result, (key, value)|\n result[key] = value if address_accessibles.include?(key)\n result\n end\n\n # update the address model's attributes\n address_model.update_attributes(address_attributes)\n end\n\n # find & update or build new rooms\n if Vebra.models[:room]\n room_class = Vebra.models[:room][:class].to_s.camelize.constantize\n\n # accessible attributes for the rooms\n room_accessibles = room_class.accessible_attributes.map(&:to_sym)\n\n # delete any rooms which are no longer present\n property_rooms = property.attributes[:rooms] || []\n property_model_rooms = property_model.send(Vebra.models[:property][:rooms_method])\n refs_to_delete = property_model_rooms.map(&:vebra_ref) - property_rooms.map { |r| r[:vebra_ref] }\n property_model_rooms.each do |room|\n room.destroy if refs_to_delete.include?(room.vebra_ref)\n end\n\n # find & update or build new rooms\n property_rooms.each do |room|\n room_model = room_class.find_by_property_id_and_vebra_ref(property_model.id, room[:vebra_ref])\n room_model = property_model_rooms.build unless room_model\n\n # extract accessible attributes for the room\n room_attributes = room.inject({}) do |result, (key, value)|\n result[key] = value if room_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n room_model.update_attributes(room_attributes)\n end\n end\n\n # find & update or build new file attachments\n if Vebra.models[:file]\n file_class = Vebra.models[:file][:class].to_s.camelize.constantize\n\n # accessible attributes for the files\n file_accessibles = file_class.accessible_attributes.map(&:to_sym)\n\n # first normalize the collection (currently nested collections)\n property_files = property.attributes[:files].inject([]) do |result, (kind, collection)|\n collection.each do |file|\n file[:type] = kind.to_s.singularize.camelize if file_accessibles.include?(:type)\n file[\"remote_#{Vebra.models[:file][:attachment_method]}_url\".to_sym] = file.delete(:url)\n # if file[:type] is set, it means the attachment file class can be subclassed. In this\n # case we need to ensure that the subclass exists. If not, we ignore this file\n begin\n file[:type].constantize if file_accessibles.include?(:type)\n result << file\n rescue NameError => e\n # ignore - this means the subclass does not exist\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n\n result\n end\n\n # delete any files which are no longer present\n property_model_files = property_model.send(Vebra.models[:property][:files_method])\n refs_to_delete = property_model_files.map(&:vebra_ref) - property_files.map { |f| f[:vebra_ref] }\n property_model_files.each do |file|\n file.destroy if refs_to_delete.include?(file.vebra_ref)\n end\n\n # find & update or build new files\n property_files.each do |file|\n begin\n file_model = property_model_files.find_by_vebra_ref(file[:vebra_ref])\n file_model = property_model_files.build unless file_model\n\n # extract accessible attributes for the file\n file_attributes = file.inject({}) do |result, (key, value)|\n result[key] = value if file_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n file_model.update_attributes(file_attributes)\n rescue CarrierWave::ProcessingError, OpenURI::HTTPError => e\n # just ignore the file\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n end\n\n property_model.no_callbacks = false if property_model.respond_to?(:no_callbacks)\n property_model.save\n return property_model\n end",
"def update!(**args)\n @id = args[:id] if args.key?(:id)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def update\n end",
"def update!(**args)\n @mid = args[:mid] if args.key?(:mid)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def modified_properties=(value)\n @modified_properties = value\n end",
"def apply_properties!(properties)\n # Non-commutitivity etc. eventually.\n end",
"def set_properties(hash)\n hash.each do |key, value|\n add_or_remove_ostruct_member(key, value)\n end\n rest_reset_properties\n end",
"def update\n\t\t\n\t\tend",
"def set_props(props)\n @props.merge!(props)\n end",
"def update() end",
"def update!(**args)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def assign_properties\n self.properties ||= {}\n listing_properties.each do |prop|\n self.properties[prop.key] ||= prop.value\n end\n end",
"def change_properties(new_current_floor, new_next_floor, new_movement)\n @current_floor = new_current_floor\n @next_floor = new_next_floor\n @movement = new_movement\n end",
"def update!(**args)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end",
"def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end",
"def update(attributes)\n (@attributes ||= {}).merge! attributes\n\n (self.class.attr_initializables & attributes.keys).each do |name|\n instance_variable_set :\"@#{name}\", attributes[name]\n end\n\n self\n end",
"def update_attributes(attrs)\n super({})\n end",
"def update\n @dirty = true\n end",
"def update\n\n # Run through the mixin updates\n colourable_update\n movable_update\n\n end",
"def set(props)\n props.each do |prop, val|\n self.send(:\"#{ prop }=\", val)\n end\n end",
"def update\n super\n end",
"def update!(**args)\n @property_id = args[:property_id] if args.key?(:property_id)\n @value_status = args[:value_status] if args.key?(:value_status)\n end",
"def update!(**args)\n @object_size_bytes = args[:object_size_bytes] if args.key?(:object_size_bytes)\n @object_version = args[:object_version] if args.key?(:object_version)\n end",
"def movable_update\n\n # Work through the different aspects we update\n movable_location_update\n movable_size_update\n movable_angle_update\n\n end",
"def properties=(value)\n @properties = value\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(context={})\n self.pre_cast_attributes\n m2o = @relations.reject{|k, v| !self.class.many2one_relations.has_key?(k)}\n vals = @attributes.reject {|key, value| key == 'id'}.merge(m2o.merge(m2o){|k, v| v.is_a?(Array) ? v[0] : v})\n self.class.rpc_execute('write', self.id, vals, context)\n reload_from_record!(self.class.find(self.id, :context => context))\n end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update ; end",
"def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end",
"def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end",
"def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end",
"def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end",
"def update_with(attributes)\n assign_attributes(attributes)\n end",
"def update\n # don't need to update; hash is shared\n end",
"def update(attributes)\n HashProxy.with(attributes) do |proxy|\n self.class.attribute_names.each do |name|\n send(\"#{name}=\", proxy[name]) if proxy.key?(name)\n end\n end\n save\n end",
"def update!(**args)\n @object_id_prop = args[:object_id_prop] if args.key?(:object_id_prop)\n @relation = args[:relation] if args.key?(:relation)\n @subject_id = args[:subject_id] if args.key?(:subject_id)\n end",
"def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end",
"def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end",
"def update\n raise NotImplementedError\n end",
"def update_attributes attributes\n @attributes.merge! attributes\n end",
"def update!(**args)\n @async_options = args[:async_options] if args.key?(:async_options)\n @input_mappings = args[:input_mappings] if args.key?(:input_mappings)\n @name_property = args[:name_property] if args.key?(:name_property)\n @validation_options = args[:validation_options] if args.key?(:validation_options)\n end",
"def update\r\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @type = args[:type] if args.key?(:type)\n end",
"def update\n raise NotImplemented\n end",
"def update_obj\n mean, sd = rating.to_glicko_rating\n @obj.rating = mean\n @obj.rating_deviation = sd\n @obj.volatility = volatility\n end",
"def update_values\n end",
"def update_values\n end",
"def update\n raise NotImplementedError\n end",
"def update!(**args)\n @answers_header_signals = args[:answers_header_signals] if args.key?(:answers_header_signals)\n @property_value = args[:property_value] if args.key?(:property_value)\n @response_meaning_application = args[:response_meaning_application] if args.key?(:response_meaning_application)\n end",
"def update!(**args)\n @create_time = args[:create_time] if args.key?(:create_time)\n @method_prop = args[:method_prop] if args.key?(:method_prop)\n @name = args[:name] if args.key?(:name)\n @state = args[:state] if args.key?(:state)\n end",
"def update attributes, collection #:nodoc:\n 0\n end",
"def update_property_groups(roll)\n @property_groups.each { |_, v| v.update_rent(roll) }\n 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 update!(**args)\n @source_property = args[:source_property] if args.key?(:source_property)\n end",
"def update_properties(path, properties)\n prop_patch = PropPatch.new(properties)\n emit('propPatch', [path, prop_patch])\n prop_patch.commit\n\n prop_patch.result\n end",
"def update\n set_deltatime\n set_last_update_at\n end"
] | [
"0.7012568",
"0.6918917",
"0.6918917",
"0.6918917",
"0.6918917",
"0.6918917",
"0.67404634",
"0.6709981",
"0.6709981",
"0.66964126",
"0.66964126",
"0.66964126",
"0.66964126",
"0.6619218",
"0.6570895",
"0.6539287",
"0.6517026",
"0.63946927",
"0.63901657",
"0.63901657",
"0.63328683",
"0.6318612",
"0.62846893",
"0.62692374",
"0.6264273",
"0.6241163",
"0.6216599",
"0.6214641",
"0.6210363",
"0.6203827",
"0.6203827",
"0.620312",
"0.6201905",
"0.62001497",
"0.61728275",
"0.61728275",
"0.6159924",
"0.61569315",
"0.61442953",
"0.61260897",
"0.6125199",
"0.61227936",
"0.61111224",
"0.610543",
"0.6102925",
"0.60839343",
"0.6083609",
"0.6066973",
"0.60602766",
"0.6055065",
"0.6051568",
"0.6051568",
"0.6042057",
"0.60319084",
"0.60221004",
"0.60149413",
"0.5994295",
"0.5989816",
"0.597674",
"0.5973157",
"0.5967343",
"0.5965598",
"0.59629464",
"0.59618354",
"0.5950329",
"0.5950329",
"0.5950329",
"0.5950329",
"0.5950329",
"0.5950329",
"0.5950329",
"0.5950329",
"0.59495455",
"0.59442014",
"0.59442014",
"0.5944142",
"0.5944142",
"0.59361076",
"0.5925741",
"0.5925574",
"0.59250593",
"0.5924476",
"0.5924476",
"0.5921039",
"0.59155524",
"0.59145254",
"0.5888445",
"0.58860934",
"0.5882302",
"0.5879913",
"0.5877467",
"0.5877467",
"0.58743787",
"0.585829",
"0.584583",
"0.58408254",
"0.5835501",
"0.5829063",
"0.5828611",
"0.58228916",
"0.5819882"
] | 0.0 | -1 |
Update properties of this object | def update!(**args)
@client_tls_policies = args[:client_tls_policies] if args.key?(:client_tls_policies)
@next_page_token = args[:next_page_token] if args.key?(:next_page_token)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update_properties(hash)\n hash.each do |key, value|\n setter_method = \"#{key}=\"\n if self.respond_to?(setter_method)\n self.send(setter_method, value)\n end\n end\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def refresh\n self.class.base_properties.each_with_index do |prop, prop_id|\n @properties[prop] = get_property(prop_id)\n end\n refresh_features\n refresh_status\n refresh_config\n self\n end",
"def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\n end",
"def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\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 update_properties!(branch_id=nil)\n properties = fetch_properties(false, branch_id)\n length = properties.length\n counter = 0\n properties.each do |property|\n counter += 1\n if Vebra.debugging?\n puts \"[Vebra]: #{counter}/#{length}: live updating property with Vebra ref: #{property.attributes[:vebra_ref]}\"\n end\n live_update!(property)\n Vebra.set_last_updated_at(Time.now) if counter == length\n end\n end",
"def update_self obj\n obj.each do |k,v|\n instance_variable_set(\"@#{k}\", v) if v\n end\n end",
"def update_attributes(properties_hash)\n self.class.get_class_properties.each do |property|\n key = property[:name].to_sym\n if properties_hash.has_key? key\n self.setValue(properties_hash[key], forKey:key)\n end\n end\n end",
"def update\n # TODO: implement update\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @states = args[:states] if args.key?(:states)\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end",
"def update!(**args)\n @property = args[:property] if args.key?(:property)\n @total_value_count = args[:total_value_count] if args.key?(:total_value_count)\n @value = args[:value] if args.key?(:value)\n @value_status = args[:value_status] if args.key?(:value_status)\n end",
"def update\n \n end",
"def refresh\n set_attributes\n end",
"def update(attrs)\n @attrs.update(attrs)\n self\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @source = args[:source] if args.key?(:source)\n end",
"def update_resource object, attributes\n object.update attributes\n end",
"def update(attrs)\n @attrs ||= {}\n @attrs.update(attrs)\n self\n end",
"def update\n \n end",
"def update!(**args)\n @property = args[:property] if args.key?(:property)\n @schema = args[:schema] if args.key?(:schema)\n end",
"def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def _update!\n self.class.properties.each do |property, predicate|\n if dirty?(property)\n self.class.repository_or_fail.delete([subject, predicate[:predicate], nil])\n if self.class.is_list?(property)\n repo = RDF::Repository.new\n attribute_get(property).each do |value|\n repo << RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(value, self.class.properties[property][:type]))\n end\n self.class.repository_or_fail.insert(*repo)\n else\n self.class.repository_or_fail.insert(RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(attribute_get(property), self.class.properties[property][:type])))\n end\n end\n @dirty[property] = nil\n @attributes[:original][property] = attribute_get(property)\n end\n self.class.repository_or_fail.insert(RDF::Statement.new(@subject, RDF.type, type)) unless type.nil?\n end",
"def update(attributes = {})\n super(attributes)\n retrieve!\n self\n end",
"def update\n @objects.map(&:update);\n end",
"def update\n raise NotImplementedError\n end",
"def update\n raise NotImplementedError\n end",
"def live_update!(property)\n property_class = Vebra.models[:property][:class].to_s.camelize.constantize\n\n # ensure we have the full property attributes\n property.get_property if !property.attributes[:status] && property.attributes[:action] != 'deleted'\n\n # find & update or build a new property\n property_model = property_class.find_or_initialize_by_vebra_ref(property.attributes[:vebra_ref])\n\n # make sure property object is not empty\n return false if !property.attributes || !property.attributes[:property_type]\n\n # if the property has been deleted, mark it appropriately and move on\n if property.attributes[:action] == 'deleted'\n return property_model.destroy\n end\n\n # extract accessible attributes for the property\n property_accessibles = property_class.accessible_attributes.map(&:to_sym)\n property_attributes = property.attributes.inject({}) do |result, (key, value)|\n result[key] = value if property_accessibles.include?(key)\n result\n end\n\n # update the property model's attributes\n property_model.no_callbacks = true if property_model.respond_to?(:no_callbacks)\n property_model.update_attributes(property_attributes)\n\n # find & update or build a new address\n if Vebra.models[:address]\n address_class = Vebra.models[:address][:class].to_s.camelize.constantize\n address_model = property_model.send(Vebra.models[:property][:address_method])\n address_model = property_model.send(\"build_#{Vebra.models[:property][:address_method]}\") unless address_model\n\n # extract accessible attributes for the address\n address_accessibles = address_class.accessible_attributes.map(&:to_sym)\n address_attributes = property.attributes[:address].inject({}) do |result, (key, value)|\n result[key] = value if address_accessibles.include?(key)\n result\n end\n\n # update the address model's attributes\n address_model.update_attributes(address_attributes)\n end\n\n # find & update or build new rooms\n if Vebra.models[:room]\n room_class = Vebra.models[:room][:class].to_s.camelize.constantize\n\n # accessible attributes for the rooms\n room_accessibles = room_class.accessible_attributes.map(&:to_sym)\n\n # delete any rooms which are no longer present\n property_rooms = property.attributes[:rooms] || []\n property_model_rooms = property_model.send(Vebra.models[:property][:rooms_method])\n refs_to_delete = property_model_rooms.map(&:vebra_ref) - property_rooms.map { |r| r[:vebra_ref] }\n property_model_rooms.each do |room|\n room.destroy if refs_to_delete.include?(room.vebra_ref)\n end\n\n # find & update or build new rooms\n property_rooms.each do |room|\n room_model = room_class.find_by_property_id_and_vebra_ref(property_model.id, room[:vebra_ref])\n room_model = property_model_rooms.build unless room_model\n\n # extract accessible attributes for the room\n room_attributes = room.inject({}) do |result, (key, value)|\n result[key] = value if room_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n room_model.update_attributes(room_attributes)\n end\n end\n\n # find & update or build new file attachments\n if Vebra.models[:file]\n file_class = Vebra.models[:file][:class].to_s.camelize.constantize\n\n # accessible attributes for the files\n file_accessibles = file_class.accessible_attributes.map(&:to_sym)\n\n # first normalize the collection (currently nested collections)\n property_files = property.attributes[:files].inject([]) do |result, (kind, collection)|\n collection.each do |file|\n file[:type] = kind.to_s.singularize.camelize if file_accessibles.include?(:type)\n file[\"remote_#{Vebra.models[:file][:attachment_method]}_url\".to_sym] = file.delete(:url)\n # if file[:type] is set, it means the attachment file class can be subclassed. In this\n # case we need to ensure that the subclass exists. If not, we ignore this file\n begin\n file[:type].constantize if file_accessibles.include?(:type)\n result << file\n rescue NameError => e\n # ignore - this means the subclass does not exist\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n\n result\n end\n\n # delete any files which are no longer present\n property_model_files = property_model.send(Vebra.models[:property][:files_method])\n refs_to_delete = property_model_files.map(&:vebra_ref) - property_files.map { |f| f[:vebra_ref] }\n property_model_files.each do |file|\n file.destroy if refs_to_delete.include?(file.vebra_ref)\n end\n\n # find & update or build new files\n property_files.each do |file|\n begin\n file_model = property_model_files.find_by_vebra_ref(file[:vebra_ref])\n file_model = property_model_files.build unless file_model\n\n # extract accessible attributes for the file\n file_attributes = file.inject({}) do |result, (key, value)|\n result[key] = value if file_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n file_model.update_attributes(file_attributes)\n rescue CarrierWave::ProcessingError, OpenURI::HTTPError => e\n # just ignore the file\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n end\n\n property_model.no_callbacks = false if property_model.respond_to?(:no_callbacks)\n property_model.save\n return property_model\n end",
"def update!(**args)\n @id = args[:id] if args.key?(:id)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def update\n end",
"def update!(**args)\n @mid = args[:mid] if args.key?(:mid)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def modified_properties=(value)\n @modified_properties = value\n end",
"def apply_properties!(properties)\n # Non-commutitivity etc. eventually.\n end",
"def set_properties(hash)\n hash.each do |key, value|\n add_or_remove_ostruct_member(key, value)\n end\n rest_reset_properties\n end",
"def update\n\t\t\n\t\tend",
"def set_props(props)\n @props.merge!(props)\n end",
"def update() end",
"def update!(**args)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def assign_properties\n self.properties ||= {}\n listing_properties.each do |prop|\n self.properties[prop.key] ||= prop.value\n end\n end",
"def change_properties(new_current_floor, new_next_floor, new_movement)\n @current_floor = new_current_floor\n @next_floor = new_next_floor\n @movement = new_movement\n end",
"def update!(**args)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end",
"def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end",
"def update(attributes)\n (@attributes ||= {}).merge! attributes\n\n (self.class.attr_initializables & attributes.keys).each do |name|\n instance_variable_set :\"@#{name}\", attributes[name]\n end\n\n self\n end",
"def update_attributes(attrs)\n super({})\n end",
"def update\n @dirty = true\n end",
"def update\n\n # Run through the mixin updates\n colourable_update\n movable_update\n\n end",
"def set(props)\n props.each do |prop, val|\n self.send(:\"#{ prop }=\", val)\n end\n end",
"def update\n super\n end",
"def update!(**args)\n @property_id = args[:property_id] if args.key?(:property_id)\n @value_status = args[:value_status] if args.key?(:value_status)\n end",
"def update!(**args)\n @object_size_bytes = args[:object_size_bytes] if args.key?(:object_size_bytes)\n @object_version = args[:object_version] if args.key?(:object_version)\n end",
"def movable_update\n\n # Work through the different aspects we update\n movable_location_update\n movable_size_update\n movable_angle_update\n\n end",
"def properties=(value)\n @properties = value\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(context={})\n self.pre_cast_attributes\n m2o = @relations.reject{|k, v| !self.class.many2one_relations.has_key?(k)}\n vals = @attributes.reject {|key, value| key == 'id'}.merge(m2o.merge(m2o){|k, v| v.is_a?(Array) ? v[0] : v})\n self.class.rpc_execute('write', self.id, vals, context)\n reload_from_record!(self.class.find(self.id, :context => context))\n end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update ; end",
"def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end",
"def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end",
"def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end",
"def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end",
"def update_with(attributes)\n assign_attributes(attributes)\n end",
"def update\n # don't need to update; hash is shared\n end",
"def update(attributes)\n HashProxy.with(attributes) do |proxy|\n self.class.attribute_names.each do |name|\n send(\"#{name}=\", proxy[name]) if proxy.key?(name)\n end\n end\n save\n end",
"def update!(**args)\n @object_id_prop = args[:object_id_prop] if args.key?(:object_id_prop)\n @relation = args[:relation] if args.key?(:relation)\n @subject_id = args[:subject_id] if args.key?(:subject_id)\n end",
"def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end",
"def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end",
"def update\n raise NotImplementedError\n end",
"def update_attributes attributes\n @attributes.merge! attributes\n end",
"def update!(**args)\n @async_options = args[:async_options] if args.key?(:async_options)\n @input_mappings = args[:input_mappings] if args.key?(:input_mappings)\n @name_property = args[:name_property] if args.key?(:name_property)\n @validation_options = args[:validation_options] if args.key?(:validation_options)\n end",
"def update\r\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @type = args[:type] if args.key?(:type)\n end",
"def update\n raise NotImplemented\n end",
"def update_obj\n mean, sd = rating.to_glicko_rating\n @obj.rating = mean\n @obj.rating_deviation = sd\n @obj.volatility = volatility\n end",
"def update_values\n end",
"def update_values\n end",
"def update\n raise NotImplementedError\n end",
"def update!(**args)\n @answers_header_signals = args[:answers_header_signals] if args.key?(:answers_header_signals)\n @property_value = args[:property_value] if args.key?(:property_value)\n @response_meaning_application = args[:response_meaning_application] if args.key?(:response_meaning_application)\n end",
"def update!(**args)\n @create_time = args[:create_time] if args.key?(:create_time)\n @method_prop = args[:method_prop] if args.key?(:method_prop)\n @name = args[:name] if args.key?(:name)\n @state = args[:state] if args.key?(:state)\n end",
"def update attributes, collection #:nodoc:\n 0\n end",
"def update_property_groups(roll)\n @property_groups.each { |_, v| v.update_rent(roll) }\n end",
"def update!(**args)\n @source_property = args[:source_property] if args.key?(:source_property)\n 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 update_properties(path, properties)\n prop_patch = PropPatch.new(properties)\n emit('propPatch', [path, prop_patch])\n prop_patch.commit\n\n prop_patch.result\n end",
"def update\n set_deltatime\n set_last_update_at\n end"
] | [
"0.7012263",
"0.69181895",
"0.69181895",
"0.69181895",
"0.69181895",
"0.69181895",
"0.67403597",
"0.6709326",
"0.6709326",
"0.6696149",
"0.6696149",
"0.6696149",
"0.6696149",
"0.6618882",
"0.6571848",
"0.65386343",
"0.65178275",
"0.6394807",
"0.6389745",
"0.6389745",
"0.63328",
"0.6319025",
"0.6283673",
"0.6269463",
"0.62639254",
"0.62410724",
"0.62170374",
"0.62152076",
"0.6210263",
"0.6204041",
"0.6204041",
"0.62021106",
"0.62017816",
"0.62017",
"0.61730784",
"0.61730784",
"0.6159277",
"0.6156169",
"0.61445665",
"0.6125433",
"0.61241156",
"0.6121413",
"0.6110477",
"0.6105694",
"0.61016303",
"0.60845226",
"0.6084427",
"0.6065455",
"0.6059506",
"0.6054869",
"0.6051708",
"0.6051708",
"0.60413384",
"0.6030853",
"0.6022535",
"0.6015561",
"0.59932375",
"0.59898263",
"0.5976479",
"0.5973787",
"0.59678394",
"0.5963291",
"0.5962048",
"0.5961157",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.59500545",
"0.59443134",
"0.59443134",
"0.59424853",
"0.59424853",
"0.593523",
"0.5926413",
"0.5924831",
"0.592427",
"0.59233046",
"0.59233046",
"0.5921224",
"0.59144294",
"0.59142506",
"0.58887535",
"0.58854496",
"0.5883008",
"0.58792305",
"0.5876954",
"0.5876954",
"0.58744955",
"0.5857968",
"0.5845542",
"0.5841629",
"0.58363605",
"0.5829255",
"0.582919",
"0.5822138",
"0.58208305"
] | 0.0 | -1 |
Update properties of this object | def update!(**args)
@firewall_endpoint_associations = args[:firewall_endpoint_associations] if args.key?(:firewall_endpoint_associations)
@next_page_token = args[:next_page_token] if args.key?(:next_page_token)
@unreachable = args[:unreachable] if args.key?(:unreachable)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update_properties(hash)\n hash.each do |key, value|\n setter_method = \"#{key}=\"\n if self.respond_to?(setter_method)\n self.send(setter_method, value)\n end\n end\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def refresh\n self.class.base_properties.each_with_index do |prop, prop_id|\n @properties[prop] = get_property(prop_id)\n end\n refresh_features\n refresh_status\n refresh_config\n self\n end",
"def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\n end",
"def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\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 update_properties!(branch_id=nil)\n properties = fetch_properties(false, branch_id)\n length = properties.length\n counter = 0\n properties.each do |property|\n counter += 1\n if Vebra.debugging?\n puts \"[Vebra]: #{counter}/#{length}: live updating property with Vebra ref: #{property.attributes[:vebra_ref]}\"\n end\n live_update!(property)\n Vebra.set_last_updated_at(Time.now) if counter == length\n end\n end",
"def update_self obj\n obj.each do |k,v|\n instance_variable_set(\"@#{k}\", v) if v\n end\n end",
"def update_attributes(properties_hash)\n self.class.get_class_properties.each do |property|\n key = property[:name].to_sym\n if properties_hash.has_key? key\n self.setValue(properties_hash[key], forKey:key)\n end\n end\n end",
"def update\n # TODO: implement update\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @states = args[:states] if args.key?(:states)\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end",
"def update!(**args)\n @property = args[:property] if args.key?(:property)\n @total_value_count = args[:total_value_count] if args.key?(:total_value_count)\n @value = args[:value] if args.key?(:value)\n @value_status = args[:value_status] if args.key?(:value_status)\n end",
"def update\n \n end",
"def refresh\n set_attributes\n end",
"def update(attrs)\n @attrs.update(attrs)\n self\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @source = args[:source] if args.key?(:source)\n end",
"def update_resource object, attributes\n object.update attributes\n end",
"def update(attrs)\n @attrs ||= {}\n @attrs.update(attrs)\n self\n end",
"def update\n \n end",
"def update!(**args)\n @property = args[:property] if args.key?(:property)\n @schema = args[:schema] if args.key?(:schema)\n end",
"def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def _update!\n self.class.properties.each do |property, predicate|\n if dirty?(property)\n self.class.repository_or_fail.delete([subject, predicate[:predicate], nil])\n if self.class.is_list?(property)\n repo = RDF::Repository.new\n attribute_get(property).each do |value|\n repo << RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(value, self.class.properties[property][:type]))\n end\n self.class.repository_or_fail.insert(*repo)\n else\n self.class.repository_or_fail.insert(RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(attribute_get(property), self.class.properties[property][:type])))\n end\n end\n @dirty[property] = nil\n @attributes[:original][property] = attribute_get(property)\n end\n self.class.repository_or_fail.insert(RDF::Statement.new(@subject, RDF.type, type)) unless type.nil?\n end",
"def update(attributes = {})\n super(attributes)\n retrieve!\n self\n end",
"def update\n @objects.map(&:update);\n end",
"def update\n raise NotImplementedError\n end",
"def update\n raise NotImplementedError\n end",
"def live_update!(property)\n property_class = Vebra.models[:property][:class].to_s.camelize.constantize\n\n # ensure we have the full property attributes\n property.get_property if !property.attributes[:status] && property.attributes[:action] != 'deleted'\n\n # find & update or build a new property\n property_model = property_class.find_or_initialize_by_vebra_ref(property.attributes[:vebra_ref])\n\n # make sure property object is not empty\n return false if !property.attributes || !property.attributes[:property_type]\n\n # if the property has been deleted, mark it appropriately and move on\n if property.attributes[:action] == 'deleted'\n return property_model.destroy\n end\n\n # extract accessible attributes for the property\n property_accessibles = property_class.accessible_attributes.map(&:to_sym)\n property_attributes = property.attributes.inject({}) do |result, (key, value)|\n result[key] = value if property_accessibles.include?(key)\n result\n end\n\n # update the property model's attributes\n property_model.no_callbacks = true if property_model.respond_to?(:no_callbacks)\n property_model.update_attributes(property_attributes)\n\n # find & update or build a new address\n if Vebra.models[:address]\n address_class = Vebra.models[:address][:class].to_s.camelize.constantize\n address_model = property_model.send(Vebra.models[:property][:address_method])\n address_model = property_model.send(\"build_#{Vebra.models[:property][:address_method]}\") unless address_model\n\n # extract accessible attributes for the address\n address_accessibles = address_class.accessible_attributes.map(&:to_sym)\n address_attributes = property.attributes[:address].inject({}) do |result, (key, value)|\n result[key] = value if address_accessibles.include?(key)\n result\n end\n\n # update the address model's attributes\n address_model.update_attributes(address_attributes)\n end\n\n # find & update or build new rooms\n if Vebra.models[:room]\n room_class = Vebra.models[:room][:class].to_s.camelize.constantize\n\n # accessible attributes for the rooms\n room_accessibles = room_class.accessible_attributes.map(&:to_sym)\n\n # delete any rooms which are no longer present\n property_rooms = property.attributes[:rooms] || []\n property_model_rooms = property_model.send(Vebra.models[:property][:rooms_method])\n refs_to_delete = property_model_rooms.map(&:vebra_ref) - property_rooms.map { |r| r[:vebra_ref] }\n property_model_rooms.each do |room|\n room.destroy if refs_to_delete.include?(room.vebra_ref)\n end\n\n # find & update or build new rooms\n property_rooms.each do |room|\n room_model = room_class.find_by_property_id_and_vebra_ref(property_model.id, room[:vebra_ref])\n room_model = property_model_rooms.build unless room_model\n\n # extract accessible attributes for the room\n room_attributes = room.inject({}) do |result, (key, value)|\n result[key] = value if room_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n room_model.update_attributes(room_attributes)\n end\n end\n\n # find & update or build new file attachments\n if Vebra.models[:file]\n file_class = Vebra.models[:file][:class].to_s.camelize.constantize\n\n # accessible attributes for the files\n file_accessibles = file_class.accessible_attributes.map(&:to_sym)\n\n # first normalize the collection (currently nested collections)\n property_files = property.attributes[:files].inject([]) do |result, (kind, collection)|\n collection.each do |file|\n file[:type] = kind.to_s.singularize.camelize if file_accessibles.include?(:type)\n file[\"remote_#{Vebra.models[:file][:attachment_method]}_url\".to_sym] = file.delete(:url)\n # if file[:type] is set, it means the attachment file class can be subclassed. In this\n # case we need to ensure that the subclass exists. If not, we ignore this file\n begin\n file[:type].constantize if file_accessibles.include?(:type)\n result << file\n rescue NameError => e\n # ignore - this means the subclass does not exist\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n\n result\n end\n\n # delete any files which are no longer present\n property_model_files = property_model.send(Vebra.models[:property][:files_method])\n refs_to_delete = property_model_files.map(&:vebra_ref) - property_files.map { |f| f[:vebra_ref] }\n property_model_files.each do |file|\n file.destroy if refs_to_delete.include?(file.vebra_ref)\n end\n\n # find & update or build new files\n property_files.each do |file|\n begin\n file_model = property_model_files.find_by_vebra_ref(file[:vebra_ref])\n file_model = property_model_files.build unless file_model\n\n # extract accessible attributes for the file\n file_attributes = file.inject({}) do |result, (key, value)|\n result[key] = value if file_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n file_model.update_attributes(file_attributes)\n rescue CarrierWave::ProcessingError, OpenURI::HTTPError => e\n # just ignore the file\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n end\n\n property_model.no_callbacks = false if property_model.respond_to?(:no_callbacks)\n property_model.save\n return property_model\n end",
"def update!(**args)\n @id = args[:id] if args.key?(:id)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def update\n end",
"def update!(**args)\n @mid = args[:mid] if args.key?(:mid)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def modified_properties=(value)\n @modified_properties = value\n end",
"def apply_properties!(properties)\n # Non-commutitivity etc. eventually.\n end",
"def set_properties(hash)\n hash.each do |key, value|\n add_or_remove_ostruct_member(key, value)\n end\n rest_reset_properties\n end",
"def update\n\t\t\n\t\tend",
"def set_props(props)\n @props.merge!(props)\n end",
"def update() end",
"def update!(**args)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def assign_properties\n self.properties ||= {}\n listing_properties.each do |prop|\n self.properties[prop.key] ||= prop.value\n end\n end",
"def change_properties(new_current_floor, new_next_floor, new_movement)\n @current_floor = new_current_floor\n @next_floor = new_next_floor\n @movement = new_movement\n end",
"def update!(**args)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end",
"def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end",
"def update(attributes)\n (@attributes ||= {}).merge! attributes\n\n (self.class.attr_initializables & attributes.keys).each do |name|\n instance_variable_set :\"@#{name}\", attributes[name]\n end\n\n self\n end",
"def update_attributes(attrs)\n super({})\n end",
"def update\n @dirty = true\n end",
"def update\n\n # Run through the mixin updates\n colourable_update\n movable_update\n\n end",
"def set(props)\n props.each do |prop, val|\n self.send(:\"#{ prop }=\", val)\n end\n end",
"def update\n super\n end",
"def update!(**args)\n @property_id = args[:property_id] if args.key?(:property_id)\n @value_status = args[:value_status] if args.key?(:value_status)\n end",
"def update!(**args)\n @object_size_bytes = args[:object_size_bytes] if args.key?(:object_size_bytes)\n @object_version = args[:object_version] if args.key?(:object_version)\n end",
"def movable_update\n\n # Work through the different aspects we update\n movable_location_update\n movable_size_update\n movable_angle_update\n\n end",
"def properties=(value)\n @properties = value\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(context={})\n self.pre_cast_attributes\n m2o = @relations.reject{|k, v| !self.class.many2one_relations.has_key?(k)}\n vals = @attributes.reject {|key, value| key == 'id'}.merge(m2o.merge(m2o){|k, v| v.is_a?(Array) ? v[0] : v})\n self.class.rpc_execute('write', self.id, vals, context)\n reload_from_record!(self.class.find(self.id, :context => context))\n end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update ; end",
"def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end",
"def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end",
"def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end",
"def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end",
"def update_with(attributes)\n assign_attributes(attributes)\n end",
"def update\n # don't need to update; hash is shared\n end",
"def update(attributes)\n HashProxy.with(attributes) do |proxy|\n self.class.attribute_names.each do |name|\n send(\"#{name}=\", proxy[name]) if proxy.key?(name)\n end\n end\n save\n end",
"def update!(**args)\n @object_id_prop = args[:object_id_prop] if args.key?(:object_id_prop)\n @relation = args[:relation] if args.key?(:relation)\n @subject_id = args[:subject_id] if args.key?(:subject_id)\n end",
"def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end",
"def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end",
"def update\n raise NotImplementedError\n end",
"def update_attributes attributes\n @attributes.merge! attributes\n end",
"def update!(**args)\n @async_options = args[:async_options] if args.key?(:async_options)\n @input_mappings = args[:input_mappings] if args.key?(:input_mappings)\n @name_property = args[:name_property] if args.key?(:name_property)\n @validation_options = args[:validation_options] if args.key?(:validation_options)\n end",
"def update\r\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @type = args[:type] if args.key?(:type)\n end",
"def update\n raise NotImplemented\n end",
"def update_obj\n mean, sd = rating.to_glicko_rating\n @obj.rating = mean\n @obj.rating_deviation = sd\n @obj.volatility = volatility\n end",
"def update_values\n end",
"def update_values\n end",
"def update\n raise NotImplementedError\n end",
"def update!(**args)\n @answers_header_signals = args[:answers_header_signals] if args.key?(:answers_header_signals)\n @property_value = args[:property_value] if args.key?(:property_value)\n @response_meaning_application = args[:response_meaning_application] if args.key?(:response_meaning_application)\n end",
"def update!(**args)\n @create_time = args[:create_time] if args.key?(:create_time)\n @method_prop = args[:method_prop] if args.key?(:method_prop)\n @name = args[:name] if args.key?(:name)\n @state = args[:state] if args.key?(:state)\n end",
"def update attributes, collection #:nodoc:\n 0\n end",
"def update_property_groups(roll)\n @property_groups.each { |_, v| v.update_rent(roll) }\n end",
"def update!(**args)\n @source_property = args[:source_property] if args.key?(:source_property)\n 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 update_properties(path, properties)\n prop_patch = PropPatch.new(properties)\n emit('propPatch', [path, prop_patch])\n prop_patch.commit\n\n prop_patch.result\n end",
"def update\n set_deltatime\n set_last_update_at\n end"
] | [
"0.7012263",
"0.69181895",
"0.69181895",
"0.69181895",
"0.69181895",
"0.69181895",
"0.67403597",
"0.6709326",
"0.6709326",
"0.6696149",
"0.6696149",
"0.6696149",
"0.6696149",
"0.6618882",
"0.6571848",
"0.65386343",
"0.65178275",
"0.6394807",
"0.6389745",
"0.6389745",
"0.63328",
"0.6319025",
"0.6283673",
"0.6269463",
"0.62639254",
"0.62410724",
"0.62170374",
"0.62152076",
"0.6210263",
"0.6204041",
"0.6204041",
"0.62021106",
"0.62017816",
"0.62017",
"0.61730784",
"0.61730784",
"0.6159277",
"0.6156169",
"0.61445665",
"0.6125433",
"0.61241156",
"0.6121413",
"0.6110477",
"0.6105694",
"0.61016303",
"0.60845226",
"0.6084427",
"0.6065455",
"0.6059506",
"0.6054869",
"0.6051708",
"0.6051708",
"0.60413384",
"0.6030853",
"0.6022535",
"0.6015561",
"0.59932375",
"0.59898263",
"0.5976479",
"0.5973787",
"0.59678394",
"0.5963291",
"0.5962048",
"0.5961157",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.59500545",
"0.59443134",
"0.59443134",
"0.59424853",
"0.59424853",
"0.593523",
"0.5926413",
"0.5924831",
"0.592427",
"0.59233046",
"0.59233046",
"0.5921224",
"0.59144294",
"0.59142506",
"0.58887535",
"0.58854496",
"0.5883008",
"0.58792305",
"0.5876954",
"0.5876954",
"0.58744955",
"0.5857968",
"0.5845542",
"0.5841629",
"0.58363605",
"0.5829255",
"0.582919",
"0.5822138",
"0.58208305"
] | 0.0 | -1 |
Update properties of this object | def update!(**args)
@firewall_endpoints = args[:firewall_endpoints] if args.key?(:firewall_endpoints)
@next_page_token = args[:next_page_token] if args.key?(:next_page_token)
@unreachable = args[:unreachable] if args.key?(:unreachable)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update_properties(hash)\n hash.each do |key, value|\n setter_method = \"#{key}=\"\n if self.respond_to?(setter_method)\n self.send(setter_method, value)\n end\n end\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def refresh\n self.class.base_properties.each_with_index do |prop, prop_id|\n @properties[prop] = get_property(prop_id)\n end\n refresh_features\n refresh_status\n refresh_config\n self\n end",
"def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\n end",
"def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\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 update_properties!(branch_id=nil)\n properties = fetch_properties(false, branch_id)\n length = properties.length\n counter = 0\n properties.each do |property|\n counter += 1\n if Vebra.debugging?\n puts \"[Vebra]: #{counter}/#{length}: live updating property with Vebra ref: #{property.attributes[:vebra_ref]}\"\n end\n live_update!(property)\n Vebra.set_last_updated_at(Time.now) if counter == length\n end\n end",
"def update_self obj\n obj.each do |k,v|\n instance_variable_set(\"@#{k}\", v) if v\n end\n end",
"def update_attributes(properties_hash)\n self.class.get_class_properties.each do |property|\n key = property[:name].to_sym\n if properties_hash.has_key? key\n self.setValue(properties_hash[key], forKey:key)\n end\n end\n end",
"def update\n # TODO: implement update\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @states = args[:states] if args.key?(:states)\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end",
"def update!(**args)\n @property = args[:property] if args.key?(:property)\n @total_value_count = args[:total_value_count] if args.key?(:total_value_count)\n @value = args[:value] if args.key?(:value)\n @value_status = args[:value_status] if args.key?(:value_status)\n end",
"def update\n \n end",
"def refresh\n set_attributes\n end",
"def update(attrs)\n @attrs.update(attrs)\n self\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @source = args[:source] if args.key?(:source)\n end",
"def update_resource object, attributes\n object.update attributes\n end",
"def update(attrs)\n @attrs ||= {}\n @attrs.update(attrs)\n self\n end",
"def update\n \n end",
"def update!(**args)\n @property = args[:property] if args.key?(:property)\n @schema = args[:schema] if args.key?(:schema)\n end",
"def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def _update!\n self.class.properties.each do |property, predicate|\n if dirty?(property)\n self.class.repository_or_fail.delete([subject, predicate[:predicate], nil])\n if self.class.is_list?(property)\n repo = RDF::Repository.new\n attribute_get(property).each do |value|\n repo << RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(value, self.class.properties[property][:type]))\n end\n self.class.repository_or_fail.insert(*repo)\n else\n self.class.repository_or_fail.insert(RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(attribute_get(property), self.class.properties[property][:type])))\n end\n end\n @dirty[property] = nil\n @attributes[:original][property] = attribute_get(property)\n end\n self.class.repository_or_fail.insert(RDF::Statement.new(@subject, RDF.type, type)) unless type.nil?\n end",
"def update(attributes = {})\n super(attributes)\n retrieve!\n self\n end",
"def update\n @objects.map(&:update);\n end",
"def update\n raise NotImplementedError\n end",
"def update\n raise NotImplementedError\n end",
"def live_update!(property)\n property_class = Vebra.models[:property][:class].to_s.camelize.constantize\n\n # ensure we have the full property attributes\n property.get_property if !property.attributes[:status] && property.attributes[:action] != 'deleted'\n\n # find & update or build a new property\n property_model = property_class.find_or_initialize_by_vebra_ref(property.attributes[:vebra_ref])\n\n # make sure property object is not empty\n return false if !property.attributes || !property.attributes[:property_type]\n\n # if the property has been deleted, mark it appropriately and move on\n if property.attributes[:action] == 'deleted'\n return property_model.destroy\n end\n\n # extract accessible attributes for the property\n property_accessibles = property_class.accessible_attributes.map(&:to_sym)\n property_attributes = property.attributes.inject({}) do |result, (key, value)|\n result[key] = value if property_accessibles.include?(key)\n result\n end\n\n # update the property model's attributes\n property_model.no_callbacks = true if property_model.respond_to?(:no_callbacks)\n property_model.update_attributes(property_attributes)\n\n # find & update or build a new address\n if Vebra.models[:address]\n address_class = Vebra.models[:address][:class].to_s.camelize.constantize\n address_model = property_model.send(Vebra.models[:property][:address_method])\n address_model = property_model.send(\"build_#{Vebra.models[:property][:address_method]}\") unless address_model\n\n # extract accessible attributes for the address\n address_accessibles = address_class.accessible_attributes.map(&:to_sym)\n address_attributes = property.attributes[:address].inject({}) do |result, (key, value)|\n result[key] = value if address_accessibles.include?(key)\n result\n end\n\n # update the address model's attributes\n address_model.update_attributes(address_attributes)\n end\n\n # find & update or build new rooms\n if Vebra.models[:room]\n room_class = Vebra.models[:room][:class].to_s.camelize.constantize\n\n # accessible attributes for the rooms\n room_accessibles = room_class.accessible_attributes.map(&:to_sym)\n\n # delete any rooms which are no longer present\n property_rooms = property.attributes[:rooms] || []\n property_model_rooms = property_model.send(Vebra.models[:property][:rooms_method])\n refs_to_delete = property_model_rooms.map(&:vebra_ref) - property_rooms.map { |r| r[:vebra_ref] }\n property_model_rooms.each do |room|\n room.destroy if refs_to_delete.include?(room.vebra_ref)\n end\n\n # find & update or build new rooms\n property_rooms.each do |room|\n room_model = room_class.find_by_property_id_and_vebra_ref(property_model.id, room[:vebra_ref])\n room_model = property_model_rooms.build unless room_model\n\n # extract accessible attributes for the room\n room_attributes = room.inject({}) do |result, (key, value)|\n result[key] = value if room_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n room_model.update_attributes(room_attributes)\n end\n end\n\n # find & update or build new file attachments\n if Vebra.models[:file]\n file_class = Vebra.models[:file][:class].to_s.camelize.constantize\n\n # accessible attributes for the files\n file_accessibles = file_class.accessible_attributes.map(&:to_sym)\n\n # first normalize the collection (currently nested collections)\n property_files = property.attributes[:files].inject([]) do |result, (kind, collection)|\n collection.each do |file|\n file[:type] = kind.to_s.singularize.camelize if file_accessibles.include?(:type)\n file[\"remote_#{Vebra.models[:file][:attachment_method]}_url\".to_sym] = file.delete(:url)\n # if file[:type] is set, it means the attachment file class can be subclassed. In this\n # case we need to ensure that the subclass exists. If not, we ignore this file\n begin\n file[:type].constantize if file_accessibles.include?(:type)\n result << file\n rescue NameError => e\n # ignore - this means the subclass does not exist\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n\n result\n end\n\n # delete any files which are no longer present\n property_model_files = property_model.send(Vebra.models[:property][:files_method])\n refs_to_delete = property_model_files.map(&:vebra_ref) - property_files.map { |f| f[:vebra_ref] }\n property_model_files.each do |file|\n file.destroy if refs_to_delete.include?(file.vebra_ref)\n end\n\n # find & update or build new files\n property_files.each do |file|\n begin\n file_model = property_model_files.find_by_vebra_ref(file[:vebra_ref])\n file_model = property_model_files.build unless file_model\n\n # extract accessible attributes for the file\n file_attributes = file.inject({}) do |result, (key, value)|\n result[key] = value if file_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n file_model.update_attributes(file_attributes)\n rescue CarrierWave::ProcessingError, OpenURI::HTTPError => e\n # just ignore the file\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n end\n\n property_model.no_callbacks = false if property_model.respond_to?(:no_callbacks)\n property_model.save\n return property_model\n end",
"def update!(**args)\n @id = args[:id] if args.key?(:id)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def update\n end",
"def update!(**args)\n @mid = args[:mid] if args.key?(:mid)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def modified_properties=(value)\n @modified_properties = value\n end",
"def apply_properties!(properties)\n # Non-commutitivity etc. eventually.\n end",
"def set_properties(hash)\n hash.each do |key, value|\n add_or_remove_ostruct_member(key, value)\n end\n rest_reset_properties\n end",
"def update\n\t\t\n\t\tend",
"def set_props(props)\n @props.merge!(props)\n end",
"def update() end",
"def update!(**args)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def assign_properties\n self.properties ||= {}\n listing_properties.each do |prop|\n self.properties[prop.key] ||= prop.value\n end\n end",
"def change_properties(new_current_floor, new_next_floor, new_movement)\n @current_floor = new_current_floor\n @next_floor = new_next_floor\n @movement = new_movement\n end",
"def update!(**args)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end",
"def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end",
"def update(attributes)\n (@attributes ||= {}).merge! attributes\n\n (self.class.attr_initializables & attributes.keys).each do |name|\n instance_variable_set :\"@#{name}\", attributes[name]\n end\n\n self\n end",
"def update_attributes(attrs)\n super({})\n end",
"def update\n @dirty = true\n end",
"def update\n\n # Run through the mixin updates\n colourable_update\n movable_update\n\n end",
"def set(props)\n props.each do |prop, val|\n self.send(:\"#{ prop }=\", val)\n end\n end",
"def update\n super\n end",
"def update!(**args)\n @property_id = args[:property_id] if args.key?(:property_id)\n @value_status = args[:value_status] if args.key?(:value_status)\n end",
"def update!(**args)\n @object_size_bytes = args[:object_size_bytes] if args.key?(:object_size_bytes)\n @object_version = args[:object_version] if args.key?(:object_version)\n end",
"def movable_update\n\n # Work through the different aspects we update\n movable_location_update\n movable_size_update\n movable_angle_update\n\n end",
"def properties=(value)\n @properties = value\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(context={})\n self.pre_cast_attributes\n m2o = @relations.reject{|k, v| !self.class.many2one_relations.has_key?(k)}\n vals = @attributes.reject {|key, value| key == 'id'}.merge(m2o.merge(m2o){|k, v| v.is_a?(Array) ? v[0] : v})\n self.class.rpc_execute('write', self.id, vals, context)\n reload_from_record!(self.class.find(self.id, :context => context))\n end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update ; end",
"def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end",
"def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end",
"def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end",
"def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end",
"def update_with(attributes)\n assign_attributes(attributes)\n end",
"def update\n # don't need to update; hash is shared\n end",
"def update(attributes)\n HashProxy.with(attributes) do |proxy|\n self.class.attribute_names.each do |name|\n send(\"#{name}=\", proxy[name]) if proxy.key?(name)\n end\n end\n save\n end",
"def update!(**args)\n @object_id_prop = args[:object_id_prop] if args.key?(:object_id_prop)\n @relation = args[:relation] if args.key?(:relation)\n @subject_id = args[:subject_id] if args.key?(:subject_id)\n end",
"def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end",
"def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end",
"def update\n raise NotImplementedError\n end",
"def update_attributes attributes\n @attributes.merge! attributes\n end",
"def update!(**args)\n @async_options = args[:async_options] if args.key?(:async_options)\n @input_mappings = args[:input_mappings] if args.key?(:input_mappings)\n @name_property = args[:name_property] if args.key?(:name_property)\n @validation_options = args[:validation_options] if args.key?(:validation_options)\n end",
"def update\r\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @type = args[:type] if args.key?(:type)\n end",
"def update\n raise NotImplemented\n end",
"def update_obj\n mean, sd = rating.to_glicko_rating\n @obj.rating = mean\n @obj.rating_deviation = sd\n @obj.volatility = volatility\n end",
"def update_values\n end",
"def update_values\n end",
"def update\n raise NotImplementedError\n end",
"def update!(**args)\n @answers_header_signals = args[:answers_header_signals] if args.key?(:answers_header_signals)\n @property_value = args[:property_value] if args.key?(:property_value)\n @response_meaning_application = args[:response_meaning_application] if args.key?(:response_meaning_application)\n end",
"def update!(**args)\n @create_time = args[:create_time] if args.key?(:create_time)\n @method_prop = args[:method_prop] if args.key?(:method_prop)\n @name = args[:name] if args.key?(:name)\n @state = args[:state] if args.key?(:state)\n end",
"def update attributes, collection #:nodoc:\n 0\n end",
"def update_property_groups(roll)\n @property_groups.each { |_, v| v.update_rent(roll) }\n end",
"def update!(**args)\n @source_property = args[:source_property] if args.key?(:source_property)\n 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 update_properties(path, properties)\n prop_patch = PropPatch.new(properties)\n emit('propPatch', [path, prop_patch])\n prop_patch.commit\n\n prop_patch.result\n end",
"def update\n set_deltatime\n set_last_update_at\n end"
] | [
"0.7012263",
"0.69181895",
"0.69181895",
"0.69181895",
"0.69181895",
"0.69181895",
"0.67403597",
"0.6709326",
"0.6709326",
"0.6696149",
"0.6696149",
"0.6696149",
"0.6696149",
"0.6618882",
"0.6571848",
"0.65386343",
"0.65178275",
"0.6394807",
"0.6389745",
"0.6389745",
"0.63328",
"0.6319025",
"0.6283673",
"0.6269463",
"0.62639254",
"0.62410724",
"0.62170374",
"0.62152076",
"0.6210263",
"0.6204041",
"0.6204041",
"0.62021106",
"0.62017816",
"0.62017",
"0.61730784",
"0.61730784",
"0.6159277",
"0.6156169",
"0.61445665",
"0.6125433",
"0.61241156",
"0.6121413",
"0.6110477",
"0.6105694",
"0.61016303",
"0.60845226",
"0.6084427",
"0.6065455",
"0.6059506",
"0.6054869",
"0.6051708",
"0.6051708",
"0.60413384",
"0.6030853",
"0.6022535",
"0.6015561",
"0.59932375",
"0.59898263",
"0.5976479",
"0.5973787",
"0.59678394",
"0.5963291",
"0.5962048",
"0.5961157",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.59500545",
"0.59443134",
"0.59443134",
"0.59424853",
"0.59424853",
"0.593523",
"0.5926413",
"0.5924831",
"0.592427",
"0.59233046",
"0.59233046",
"0.5921224",
"0.59144294",
"0.59142506",
"0.58887535",
"0.58854496",
"0.5883008",
"0.58792305",
"0.5876954",
"0.5876954",
"0.58744955",
"0.5857968",
"0.5845542",
"0.5841629",
"0.58363605",
"0.5829255",
"0.582919",
"0.5822138",
"0.58208305"
] | 0.0 | -1 |
Update properties of this object | def update!(**args)
@gateway_security_policies = args[:gateway_security_policies] if args.key?(:gateway_security_policies)
@next_page_token = args[:next_page_token] if args.key?(:next_page_token)
@unreachable = args[:unreachable] if args.key?(:unreachable)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update_properties(hash)\n hash.each do |key, value|\n setter_method = \"#{key}=\"\n if self.respond_to?(setter_method)\n self.send(setter_method, value)\n end\n end\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def refresh\n self.class.base_properties.each_with_index do |prop, prop_id|\n @properties[prop] = get_property(prop_id)\n end\n refresh_features\n refresh_status\n refresh_config\n self\n end",
"def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\n end",
"def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\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 update_properties!(branch_id=nil)\n properties = fetch_properties(false, branch_id)\n length = properties.length\n counter = 0\n properties.each do |property|\n counter += 1\n if Vebra.debugging?\n puts \"[Vebra]: #{counter}/#{length}: live updating property with Vebra ref: #{property.attributes[:vebra_ref]}\"\n end\n live_update!(property)\n Vebra.set_last_updated_at(Time.now) if counter == length\n end\n end",
"def update_self obj\n obj.each do |k,v|\n instance_variable_set(\"@#{k}\", v) if v\n end\n end",
"def update_attributes(properties_hash)\n self.class.get_class_properties.each do |property|\n key = property[:name].to_sym\n if properties_hash.has_key? key\n self.setValue(properties_hash[key], forKey:key)\n end\n end\n end",
"def update\n # TODO: implement update\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @states = args[:states] if args.key?(:states)\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end",
"def update!(**args)\n @property = args[:property] if args.key?(:property)\n @total_value_count = args[:total_value_count] if args.key?(:total_value_count)\n @value = args[:value] if args.key?(:value)\n @value_status = args[:value_status] if args.key?(:value_status)\n end",
"def update\n \n end",
"def refresh\n set_attributes\n end",
"def update(attrs)\n @attrs.update(attrs)\n self\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @source = args[:source] if args.key?(:source)\n end",
"def update_resource object, attributes\n object.update attributes\n end",
"def update(attrs)\n @attrs ||= {}\n @attrs.update(attrs)\n self\n end",
"def update\n \n end",
"def update!(**args)\n @property = args[:property] if args.key?(:property)\n @schema = args[:schema] if args.key?(:schema)\n end",
"def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def update(attributes = {})\n super(attributes)\n retrieve!\n self\n end",
"def _update!\n self.class.properties.each do |property, predicate|\n if dirty?(property)\n self.class.repository_or_fail.delete([subject, predicate[:predicate], nil])\n if self.class.is_list?(property)\n repo = RDF::Repository.new\n attribute_get(property).each do |value|\n repo << RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(value, self.class.properties[property][:type]))\n end\n self.class.repository_or_fail.insert(*repo)\n else\n self.class.repository_or_fail.insert(RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(attribute_get(property), self.class.properties[property][:type])))\n end\n end\n @dirty[property] = nil\n @attributes[:original][property] = attribute_get(property)\n end\n self.class.repository_or_fail.insert(RDF::Statement.new(@subject, RDF.type, type)) unless type.nil?\n end",
"def update\n @objects.map(&:update);\n end",
"def update\n raise NotImplementedError\n end",
"def update\n raise NotImplementedError\n end",
"def live_update!(property)\n property_class = Vebra.models[:property][:class].to_s.camelize.constantize\n\n # ensure we have the full property attributes\n property.get_property if !property.attributes[:status] && property.attributes[:action] != 'deleted'\n\n # find & update or build a new property\n property_model = property_class.find_or_initialize_by_vebra_ref(property.attributes[:vebra_ref])\n\n # make sure property object is not empty\n return false if !property.attributes || !property.attributes[:property_type]\n\n # if the property has been deleted, mark it appropriately and move on\n if property.attributes[:action] == 'deleted'\n return property_model.destroy\n end\n\n # extract accessible attributes for the property\n property_accessibles = property_class.accessible_attributes.map(&:to_sym)\n property_attributes = property.attributes.inject({}) do |result, (key, value)|\n result[key] = value if property_accessibles.include?(key)\n result\n end\n\n # update the property model's attributes\n property_model.no_callbacks = true if property_model.respond_to?(:no_callbacks)\n property_model.update_attributes(property_attributes)\n\n # find & update or build a new address\n if Vebra.models[:address]\n address_class = Vebra.models[:address][:class].to_s.camelize.constantize\n address_model = property_model.send(Vebra.models[:property][:address_method])\n address_model = property_model.send(\"build_#{Vebra.models[:property][:address_method]}\") unless address_model\n\n # extract accessible attributes for the address\n address_accessibles = address_class.accessible_attributes.map(&:to_sym)\n address_attributes = property.attributes[:address].inject({}) do |result, (key, value)|\n result[key] = value if address_accessibles.include?(key)\n result\n end\n\n # update the address model's attributes\n address_model.update_attributes(address_attributes)\n end\n\n # find & update or build new rooms\n if Vebra.models[:room]\n room_class = Vebra.models[:room][:class].to_s.camelize.constantize\n\n # accessible attributes for the rooms\n room_accessibles = room_class.accessible_attributes.map(&:to_sym)\n\n # delete any rooms which are no longer present\n property_rooms = property.attributes[:rooms] || []\n property_model_rooms = property_model.send(Vebra.models[:property][:rooms_method])\n refs_to_delete = property_model_rooms.map(&:vebra_ref) - property_rooms.map { |r| r[:vebra_ref] }\n property_model_rooms.each do |room|\n room.destroy if refs_to_delete.include?(room.vebra_ref)\n end\n\n # find & update or build new rooms\n property_rooms.each do |room|\n room_model = room_class.find_by_property_id_and_vebra_ref(property_model.id, room[:vebra_ref])\n room_model = property_model_rooms.build unless room_model\n\n # extract accessible attributes for the room\n room_attributes = room.inject({}) do |result, (key, value)|\n result[key] = value if room_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n room_model.update_attributes(room_attributes)\n end\n end\n\n # find & update or build new file attachments\n if Vebra.models[:file]\n file_class = Vebra.models[:file][:class].to_s.camelize.constantize\n\n # accessible attributes for the files\n file_accessibles = file_class.accessible_attributes.map(&:to_sym)\n\n # first normalize the collection (currently nested collections)\n property_files = property.attributes[:files].inject([]) do |result, (kind, collection)|\n collection.each do |file|\n file[:type] = kind.to_s.singularize.camelize if file_accessibles.include?(:type)\n file[\"remote_#{Vebra.models[:file][:attachment_method]}_url\".to_sym] = file.delete(:url)\n # if file[:type] is set, it means the attachment file class can be subclassed. In this\n # case we need to ensure that the subclass exists. If not, we ignore this file\n begin\n file[:type].constantize if file_accessibles.include?(:type)\n result << file\n rescue NameError => e\n # ignore - this means the subclass does not exist\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n\n result\n end\n\n # delete any files which are no longer present\n property_model_files = property_model.send(Vebra.models[:property][:files_method])\n refs_to_delete = property_model_files.map(&:vebra_ref) - property_files.map { |f| f[:vebra_ref] }\n property_model_files.each do |file|\n file.destroy if refs_to_delete.include?(file.vebra_ref)\n end\n\n # find & update or build new files\n property_files.each do |file|\n begin\n file_model = property_model_files.find_by_vebra_ref(file[:vebra_ref])\n file_model = property_model_files.build unless file_model\n\n # extract accessible attributes for the file\n file_attributes = file.inject({}) do |result, (key, value)|\n result[key] = value if file_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n file_model.update_attributes(file_attributes)\n rescue CarrierWave::ProcessingError, OpenURI::HTTPError => e\n # just ignore the file\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n end\n\n property_model.no_callbacks = false if property_model.respond_to?(:no_callbacks)\n property_model.save\n return property_model\n end",
"def update!(**args)\n @id = args[:id] if args.key?(:id)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def update\n end",
"def update!(**args)\n @mid = args[:mid] if args.key?(:mid)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def modified_properties=(value)\n @modified_properties = value\n end",
"def apply_properties!(properties)\n # Non-commutitivity etc. eventually.\n end",
"def set_properties(hash)\n hash.each do |key, value|\n add_or_remove_ostruct_member(key, value)\n end\n rest_reset_properties\n end",
"def update\n\t\t\n\t\tend",
"def set_props(props)\n @props.merge!(props)\n end",
"def update() end",
"def update!(**args)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def assign_properties\n self.properties ||= {}\n listing_properties.each do |prop|\n self.properties[prop.key] ||= prop.value\n end\n end",
"def change_properties(new_current_floor, new_next_floor, new_movement)\n @current_floor = new_current_floor\n @next_floor = new_next_floor\n @movement = new_movement\n end",
"def update!(**args)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end",
"def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end",
"def update(attributes)\n (@attributes ||= {}).merge! attributes\n\n (self.class.attr_initializables & attributes.keys).each do |name|\n instance_variable_set :\"@#{name}\", attributes[name]\n end\n\n self\n end",
"def update_attributes(attrs)\n super({})\n end",
"def update\n @dirty = true\n end",
"def update\n\n # Run through the mixin updates\n colourable_update\n movable_update\n\n end",
"def set(props)\n props.each do |prop, val|\n self.send(:\"#{ prop }=\", val)\n end\n end",
"def update\n super\n end",
"def update!(**args)\n @property_id = args[:property_id] if args.key?(:property_id)\n @value_status = args[:value_status] if args.key?(:value_status)\n end",
"def update!(**args)\n @object_size_bytes = args[:object_size_bytes] if args.key?(:object_size_bytes)\n @object_version = args[:object_version] if args.key?(:object_version)\n end",
"def movable_update\n\n # Work through the different aspects we update\n movable_location_update\n movable_size_update\n movable_angle_update\n\n end",
"def properties=(value)\n @properties = value\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(context={})\n self.pre_cast_attributes\n m2o = @relations.reject{|k, v| !self.class.many2one_relations.has_key?(k)}\n vals = @attributes.reject {|key, value| key == 'id'}.merge(m2o.merge(m2o){|k, v| v.is_a?(Array) ? v[0] : v})\n self.class.rpc_execute('write', self.id, vals, context)\n reload_from_record!(self.class.find(self.id, :context => context))\n end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update ; end",
"def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end",
"def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end",
"def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end",
"def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end",
"def update_with(attributes)\n assign_attributes(attributes)\n end",
"def update\n # don't need to update; hash is shared\n end",
"def update(attributes)\n HashProxy.with(attributes) do |proxy|\n self.class.attribute_names.each do |name|\n send(\"#{name}=\", proxy[name]) if proxy.key?(name)\n end\n end\n save\n end",
"def update!(**args)\n @object_id_prop = args[:object_id_prop] if args.key?(:object_id_prop)\n @relation = args[:relation] if args.key?(:relation)\n @subject_id = args[:subject_id] if args.key?(:subject_id)\n end",
"def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end",
"def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end",
"def update\n raise NotImplementedError\n end",
"def update_attributes attributes\n @attributes.merge! attributes\n end",
"def update!(**args)\n @async_options = args[:async_options] if args.key?(:async_options)\n @input_mappings = args[:input_mappings] if args.key?(:input_mappings)\n @name_property = args[:name_property] if args.key?(:name_property)\n @validation_options = args[:validation_options] if args.key?(:validation_options)\n end",
"def update\r\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @type = args[:type] if args.key?(:type)\n end",
"def update\n raise NotImplemented\n end",
"def update_obj\n mean, sd = rating.to_glicko_rating\n @obj.rating = mean\n @obj.rating_deviation = sd\n @obj.volatility = volatility\n end",
"def update_values\n end",
"def update_values\n end",
"def update\n raise NotImplementedError\n end",
"def update!(**args)\n @answers_header_signals = args[:answers_header_signals] if args.key?(:answers_header_signals)\n @property_value = args[:property_value] if args.key?(:property_value)\n @response_meaning_application = args[:response_meaning_application] if args.key?(:response_meaning_application)\n end",
"def update!(**args)\n @create_time = args[:create_time] if args.key?(:create_time)\n @method_prop = args[:method_prop] if args.key?(:method_prop)\n @name = args[:name] if args.key?(:name)\n @state = args[:state] if args.key?(:state)\n end",
"def update attributes, collection #:nodoc:\n 0\n end",
"def update_property_groups(roll)\n @property_groups.each { |_, v| v.update_rent(roll) }\n 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 update!(**args)\n @source_property = args[:source_property] if args.key?(:source_property)\n end",
"def update_properties(path, properties)\n prop_patch = PropPatch.new(properties)\n emit('propPatch', [path, prop_patch])\n prop_patch.commit\n\n prop_patch.result\n end",
"def update\n set_deltatime\n set_last_update_at\n end"
] | [
"0.7012568",
"0.6918917",
"0.6918917",
"0.6918917",
"0.6918917",
"0.6918917",
"0.67404634",
"0.6709981",
"0.6709981",
"0.66964126",
"0.66964126",
"0.66964126",
"0.66964126",
"0.6619218",
"0.6570895",
"0.6539287",
"0.6517026",
"0.63946927",
"0.63901657",
"0.63901657",
"0.63328683",
"0.6318612",
"0.62846893",
"0.62692374",
"0.6264273",
"0.6241163",
"0.6216599",
"0.6214641",
"0.6210363",
"0.6203827",
"0.6203827",
"0.620312",
"0.6201905",
"0.62001497",
"0.61728275",
"0.61728275",
"0.6159924",
"0.61569315",
"0.61442953",
"0.61260897",
"0.6125199",
"0.61227936",
"0.61111224",
"0.610543",
"0.6102925",
"0.60839343",
"0.6083609",
"0.6066973",
"0.60602766",
"0.6055065",
"0.6051568",
"0.6051568",
"0.6042057",
"0.60319084",
"0.60221004",
"0.60149413",
"0.5994295",
"0.5989816",
"0.597674",
"0.5973157",
"0.5967343",
"0.5965598",
"0.59629464",
"0.59618354",
"0.5950329",
"0.5950329",
"0.5950329",
"0.5950329",
"0.5950329",
"0.5950329",
"0.5950329",
"0.5950329",
"0.59495455",
"0.59442014",
"0.59442014",
"0.5944142",
"0.5944142",
"0.59361076",
"0.5925741",
"0.5925574",
"0.59250593",
"0.5924476",
"0.5924476",
"0.5921039",
"0.59155524",
"0.59145254",
"0.5888445",
"0.58860934",
"0.5882302",
"0.5879913",
"0.5877467",
"0.5877467",
"0.58743787",
"0.585829",
"0.584583",
"0.58408254",
"0.5835501",
"0.5829063",
"0.5828611",
"0.58228916",
"0.5819882"
] | 0.0 | -1 |
Update properties of this object | def update!(**args)
@gateway_security_policy_rules = args[:gateway_security_policy_rules] if args.key?(:gateway_security_policy_rules)
@next_page_token = args[:next_page_token] if args.key?(:next_page_token)
@unreachable = args[:unreachable] if args.key?(:unreachable)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update_properties(hash)\n hash.each do |key, value|\n setter_method = \"#{key}=\"\n if self.respond_to?(setter_method)\n self.send(setter_method, value)\n end\n end\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def refresh\n self.class.base_properties.each_with_index do |prop, prop_id|\n @properties[prop] = get_property(prop_id)\n end\n refresh_features\n refresh_status\n refresh_config\n self\n end",
"def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\n end",
"def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\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 update_properties!(branch_id=nil)\n properties = fetch_properties(false, branch_id)\n length = properties.length\n counter = 0\n properties.each do |property|\n counter += 1\n if Vebra.debugging?\n puts \"[Vebra]: #{counter}/#{length}: live updating property with Vebra ref: #{property.attributes[:vebra_ref]}\"\n end\n live_update!(property)\n Vebra.set_last_updated_at(Time.now) if counter == length\n end\n end",
"def update_self obj\n obj.each do |k,v|\n instance_variable_set(\"@#{k}\", v) if v\n end\n end",
"def update_attributes(properties_hash)\n self.class.get_class_properties.each do |property|\n key = property[:name].to_sym\n if properties_hash.has_key? key\n self.setValue(properties_hash[key], forKey:key)\n end\n end\n end",
"def update\n # TODO: implement update\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @states = args[:states] if args.key?(:states)\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end",
"def update!(**args)\n @property = args[:property] if args.key?(:property)\n @total_value_count = args[:total_value_count] if args.key?(:total_value_count)\n @value = args[:value] if args.key?(:value)\n @value_status = args[:value_status] if args.key?(:value_status)\n end",
"def update\n \n end",
"def refresh\n set_attributes\n end",
"def update(attrs)\n @attrs.update(attrs)\n self\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @source = args[:source] if args.key?(:source)\n end",
"def update_resource object, attributes\n object.update attributes\n end",
"def update(attrs)\n @attrs ||= {}\n @attrs.update(attrs)\n self\n end",
"def update\n \n end",
"def update!(**args)\n @property = args[:property] if args.key?(:property)\n @schema = args[:schema] if args.key?(:schema)\n end",
"def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def _update!\n self.class.properties.each do |property, predicate|\n if dirty?(property)\n self.class.repository_or_fail.delete([subject, predicate[:predicate], nil])\n if self.class.is_list?(property)\n repo = RDF::Repository.new\n attribute_get(property).each do |value|\n repo << RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(value, self.class.properties[property][:type]))\n end\n self.class.repository_or_fail.insert(*repo)\n else\n self.class.repository_or_fail.insert(RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(attribute_get(property), self.class.properties[property][:type])))\n end\n end\n @dirty[property] = nil\n @attributes[:original][property] = attribute_get(property)\n end\n self.class.repository_or_fail.insert(RDF::Statement.new(@subject, RDF.type, type)) unless type.nil?\n end",
"def update(attributes = {})\n super(attributes)\n retrieve!\n self\n end",
"def update\n @objects.map(&:update);\n end",
"def update\n raise NotImplementedError\n end",
"def update\n raise NotImplementedError\n end",
"def live_update!(property)\n property_class = Vebra.models[:property][:class].to_s.camelize.constantize\n\n # ensure we have the full property attributes\n property.get_property if !property.attributes[:status] && property.attributes[:action] != 'deleted'\n\n # find & update or build a new property\n property_model = property_class.find_or_initialize_by_vebra_ref(property.attributes[:vebra_ref])\n\n # make sure property object is not empty\n return false if !property.attributes || !property.attributes[:property_type]\n\n # if the property has been deleted, mark it appropriately and move on\n if property.attributes[:action] == 'deleted'\n return property_model.destroy\n end\n\n # extract accessible attributes for the property\n property_accessibles = property_class.accessible_attributes.map(&:to_sym)\n property_attributes = property.attributes.inject({}) do |result, (key, value)|\n result[key] = value if property_accessibles.include?(key)\n result\n end\n\n # update the property model's attributes\n property_model.no_callbacks = true if property_model.respond_to?(:no_callbacks)\n property_model.update_attributes(property_attributes)\n\n # find & update or build a new address\n if Vebra.models[:address]\n address_class = Vebra.models[:address][:class].to_s.camelize.constantize\n address_model = property_model.send(Vebra.models[:property][:address_method])\n address_model = property_model.send(\"build_#{Vebra.models[:property][:address_method]}\") unless address_model\n\n # extract accessible attributes for the address\n address_accessibles = address_class.accessible_attributes.map(&:to_sym)\n address_attributes = property.attributes[:address].inject({}) do |result, (key, value)|\n result[key] = value if address_accessibles.include?(key)\n result\n end\n\n # update the address model's attributes\n address_model.update_attributes(address_attributes)\n end\n\n # find & update or build new rooms\n if Vebra.models[:room]\n room_class = Vebra.models[:room][:class].to_s.camelize.constantize\n\n # accessible attributes for the rooms\n room_accessibles = room_class.accessible_attributes.map(&:to_sym)\n\n # delete any rooms which are no longer present\n property_rooms = property.attributes[:rooms] || []\n property_model_rooms = property_model.send(Vebra.models[:property][:rooms_method])\n refs_to_delete = property_model_rooms.map(&:vebra_ref) - property_rooms.map { |r| r[:vebra_ref] }\n property_model_rooms.each do |room|\n room.destroy if refs_to_delete.include?(room.vebra_ref)\n end\n\n # find & update or build new rooms\n property_rooms.each do |room|\n room_model = room_class.find_by_property_id_and_vebra_ref(property_model.id, room[:vebra_ref])\n room_model = property_model_rooms.build unless room_model\n\n # extract accessible attributes for the room\n room_attributes = room.inject({}) do |result, (key, value)|\n result[key] = value if room_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n room_model.update_attributes(room_attributes)\n end\n end\n\n # find & update or build new file attachments\n if Vebra.models[:file]\n file_class = Vebra.models[:file][:class].to_s.camelize.constantize\n\n # accessible attributes for the files\n file_accessibles = file_class.accessible_attributes.map(&:to_sym)\n\n # first normalize the collection (currently nested collections)\n property_files = property.attributes[:files].inject([]) do |result, (kind, collection)|\n collection.each do |file|\n file[:type] = kind.to_s.singularize.camelize if file_accessibles.include?(:type)\n file[\"remote_#{Vebra.models[:file][:attachment_method]}_url\".to_sym] = file.delete(:url)\n # if file[:type] is set, it means the attachment file class can be subclassed. In this\n # case we need to ensure that the subclass exists. If not, we ignore this file\n begin\n file[:type].constantize if file_accessibles.include?(:type)\n result << file\n rescue NameError => e\n # ignore - this means the subclass does not exist\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n\n result\n end\n\n # delete any files which are no longer present\n property_model_files = property_model.send(Vebra.models[:property][:files_method])\n refs_to_delete = property_model_files.map(&:vebra_ref) - property_files.map { |f| f[:vebra_ref] }\n property_model_files.each do |file|\n file.destroy if refs_to_delete.include?(file.vebra_ref)\n end\n\n # find & update or build new files\n property_files.each do |file|\n begin\n file_model = property_model_files.find_by_vebra_ref(file[:vebra_ref])\n file_model = property_model_files.build unless file_model\n\n # extract accessible attributes for the file\n file_attributes = file.inject({}) do |result, (key, value)|\n result[key] = value if file_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n file_model.update_attributes(file_attributes)\n rescue CarrierWave::ProcessingError, OpenURI::HTTPError => e\n # just ignore the file\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n end\n\n property_model.no_callbacks = false if property_model.respond_to?(:no_callbacks)\n property_model.save\n return property_model\n end",
"def update!(**args)\n @id = args[:id] if args.key?(:id)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def update\n end",
"def update!(**args)\n @mid = args[:mid] if args.key?(:mid)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def modified_properties=(value)\n @modified_properties = value\n end",
"def apply_properties!(properties)\n # Non-commutitivity etc. eventually.\n end",
"def set_properties(hash)\n hash.each do |key, value|\n add_or_remove_ostruct_member(key, value)\n end\n rest_reset_properties\n end",
"def update\n\t\t\n\t\tend",
"def set_props(props)\n @props.merge!(props)\n end",
"def update() end",
"def update!(**args)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def assign_properties\n self.properties ||= {}\n listing_properties.each do |prop|\n self.properties[prop.key] ||= prop.value\n end\n end",
"def change_properties(new_current_floor, new_next_floor, new_movement)\n @current_floor = new_current_floor\n @next_floor = new_next_floor\n @movement = new_movement\n end",
"def update!(**args)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end",
"def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end",
"def update(attributes)\n (@attributes ||= {}).merge! attributes\n\n (self.class.attr_initializables & attributes.keys).each do |name|\n instance_variable_set :\"@#{name}\", attributes[name]\n end\n\n self\n end",
"def update_attributes(attrs)\n super({})\n end",
"def update\n @dirty = true\n end",
"def update\n\n # Run through the mixin updates\n colourable_update\n movable_update\n\n end",
"def set(props)\n props.each do |prop, val|\n self.send(:\"#{ prop }=\", val)\n end\n end",
"def update\n super\n end",
"def update!(**args)\n @property_id = args[:property_id] if args.key?(:property_id)\n @value_status = args[:value_status] if args.key?(:value_status)\n end",
"def update!(**args)\n @object_size_bytes = args[:object_size_bytes] if args.key?(:object_size_bytes)\n @object_version = args[:object_version] if args.key?(:object_version)\n end",
"def movable_update\n\n # Work through the different aspects we update\n movable_location_update\n movable_size_update\n movable_angle_update\n\n end",
"def properties=(value)\n @properties = value\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(context={})\n self.pre_cast_attributes\n m2o = @relations.reject{|k, v| !self.class.many2one_relations.has_key?(k)}\n vals = @attributes.reject {|key, value| key == 'id'}.merge(m2o.merge(m2o){|k, v| v.is_a?(Array) ? v[0] : v})\n self.class.rpc_execute('write', self.id, vals, context)\n reload_from_record!(self.class.find(self.id, :context => context))\n end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update ; end",
"def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end",
"def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end",
"def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end",
"def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end",
"def update_with(attributes)\n assign_attributes(attributes)\n end",
"def update\n # don't need to update; hash is shared\n end",
"def update(attributes)\n HashProxy.with(attributes) do |proxy|\n self.class.attribute_names.each do |name|\n send(\"#{name}=\", proxy[name]) if proxy.key?(name)\n end\n end\n save\n end",
"def update!(**args)\n @object_id_prop = args[:object_id_prop] if args.key?(:object_id_prop)\n @relation = args[:relation] if args.key?(:relation)\n @subject_id = args[:subject_id] if args.key?(:subject_id)\n end",
"def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end",
"def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end",
"def update\n raise NotImplementedError\n end",
"def update_attributes attributes\n @attributes.merge! attributes\n end",
"def update!(**args)\n @async_options = args[:async_options] if args.key?(:async_options)\n @input_mappings = args[:input_mappings] if args.key?(:input_mappings)\n @name_property = args[:name_property] if args.key?(:name_property)\n @validation_options = args[:validation_options] if args.key?(:validation_options)\n end",
"def update\r\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @type = args[:type] if args.key?(:type)\n end",
"def update\n raise NotImplemented\n end",
"def update_obj\n mean, sd = rating.to_glicko_rating\n @obj.rating = mean\n @obj.rating_deviation = sd\n @obj.volatility = volatility\n end",
"def update_values\n end",
"def update_values\n end",
"def update\n raise NotImplementedError\n end",
"def update!(**args)\n @answers_header_signals = args[:answers_header_signals] if args.key?(:answers_header_signals)\n @property_value = args[:property_value] if args.key?(:property_value)\n @response_meaning_application = args[:response_meaning_application] if args.key?(:response_meaning_application)\n end",
"def update!(**args)\n @create_time = args[:create_time] if args.key?(:create_time)\n @method_prop = args[:method_prop] if args.key?(:method_prop)\n @name = args[:name] if args.key?(:name)\n @state = args[:state] if args.key?(:state)\n end",
"def update attributes, collection #:nodoc:\n 0\n end",
"def update_property_groups(roll)\n @property_groups.each { |_, v| v.update_rent(roll) }\n end",
"def update!(**args)\n @source_property = args[:source_property] if args.key?(:source_property)\n 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 update_properties(path, properties)\n prop_patch = PropPatch.new(properties)\n emit('propPatch', [path, prop_patch])\n prop_patch.commit\n\n prop_patch.result\n end",
"def update\n set_deltatime\n set_last_update_at\n end"
] | [
"0.7012263",
"0.69181895",
"0.69181895",
"0.69181895",
"0.69181895",
"0.69181895",
"0.67403597",
"0.6709326",
"0.6709326",
"0.6696149",
"0.6696149",
"0.6696149",
"0.6696149",
"0.6618882",
"0.6571848",
"0.65386343",
"0.65178275",
"0.6394807",
"0.6389745",
"0.6389745",
"0.63328",
"0.6319025",
"0.6283673",
"0.6269463",
"0.62639254",
"0.62410724",
"0.62170374",
"0.62152076",
"0.6210263",
"0.6204041",
"0.6204041",
"0.62021106",
"0.62017816",
"0.62017",
"0.61730784",
"0.61730784",
"0.6159277",
"0.6156169",
"0.61445665",
"0.6125433",
"0.61241156",
"0.6121413",
"0.6110477",
"0.6105694",
"0.61016303",
"0.60845226",
"0.6084427",
"0.6065455",
"0.6059506",
"0.6054869",
"0.6051708",
"0.6051708",
"0.60413384",
"0.6030853",
"0.6022535",
"0.6015561",
"0.59932375",
"0.59898263",
"0.5976479",
"0.5973787",
"0.59678394",
"0.5963291",
"0.5962048",
"0.5961157",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.59500545",
"0.59443134",
"0.59443134",
"0.59424853",
"0.59424853",
"0.593523",
"0.5926413",
"0.5924831",
"0.592427",
"0.59233046",
"0.59233046",
"0.5921224",
"0.59144294",
"0.59142506",
"0.58887535",
"0.58854496",
"0.5883008",
"0.58792305",
"0.5876954",
"0.5876954",
"0.58744955",
"0.5857968",
"0.5845542",
"0.5841629",
"0.58363605",
"0.5829255",
"0.582919",
"0.5822138",
"0.58208305"
] | 0.0 | -1 |
Update properties of this object | def update!(**args)
@locations = args[:locations] if args.key?(:locations)
@next_page_token = args[:next_page_token] if args.key?(:next_page_token)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update_properties(hash)\n hash.each do |key, value|\n setter_method = \"#{key}=\"\n if self.respond_to?(setter_method)\n self.send(setter_method, value)\n end\n end\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def refresh\n self.class.base_properties.each_with_index do |prop, prop_id|\n @properties[prop] = get_property(prop_id)\n end\n refresh_features\n refresh_status\n refresh_config\n self\n end",
"def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\n end",
"def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\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 update_properties!(branch_id=nil)\n properties = fetch_properties(false, branch_id)\n length = properties.length\n counter = 0\n properties.each do |property|\n counter += 1\n if Vebra.debugging?\n puts \"[Vebra]: #{counter}/#{length}: live updating property with Vebra ref: #{property.attributes[:vebra_ref]}\"\n end\n live_update!(property)\n Vebra.set_last_updated_at(Time.now) if counter == length\n end\n end",
"def update_self obj\n obj.each do |k,v|\n instance_variable_set(\"@#{k}\", v) if v\n end\n end",
"def update_attributes(properties_hash)\n self.class.get_class_properties.each do |property|\n key = property[:name].to_sym\n if properties_hash.has_key? key\n self.setValue(properties_hash[key], forKey:key)\n end\n end\n end",
"def update\n # TODO: implement update\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @states = args[:states] if args.key?(:states)\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end",
"def update!(**args)\n @property = args[:property] if args.key?(:property)\n @total_value_count = args[:total_value_count] if args.key?(:total_value_count)\n @value = args[:value] if args.key?(:value)\n @value_status = args[:value_status] if args.key?(:value_status)\n end",
"def update\n \n end",
"def refresh\n set_attributes\n end",
"def update(attrs)\n @attrs.update(attrs)\n self\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @source = args[:source] if args.key?(:source)\n end",
"def update_resource object, attributes\n object.update attributes\n end",
"def update(attrs)\n @attrs ||= {}\n @attrs.update(attrs)\n self\n end",
"def update\n \n end",
"def update!(**args)\n @property = args[:property] if args.key?(:property)\n @schema = args[:schema] if args.key?(:schema)\n end",
"def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def _update!\n self.class.properties.each do |property, predicate|\n if dirty?(property)\n self.class.repository_or_fail.delete([subject, predicate[:predicate], nil])\n if self.class.is_list?(property)\n repo = RDF::Repository.new\n attribute_get(property).each do |value|\n repo << RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(value, self.class.properties[property][:type]))\n end\n self.class.repository_or_fail.insert(*repo)\n else\n self.class.repository_or_fail.insert(RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(attribute_get(property), self.class.properties[property][:type])))\n end\n end\n @dirty[property] = nil\n @attributes[:original][property] = attribute_get(property)\n end\n self.class.repository_or_fail.insert(RDF::Statement.new(@subject, RDF.type, type)) unless type.nil?\n end",
"def update(attributes = {})\n super(attributes)\n retrieve!\n self\n end",
"def update\n @objects.map(&:update);\n end",
"def update\n raise NotImplementedError\n end",
"def update\n raise NotImplementedError\n end",
"def live_update!(property)\n property_class = Vebra.models[:property][:class].to_s.camelize.constantize\n\n # ensure we have the full property attributes\n property.get_property if !property.attributes[:status] && property.attributes[:action] != 'deleted'\n\n # find & update or build a new property\n property_model = property_class.find_or_initialize_by_vebra_ref(property.attributes[:vebra_ref])\n\n # make sure property object is not empty\n return false if !property.attributes || !property.attributes[:property_type]\n\n # if the property has been deleted, mark it appropriately and move on\n if property.attributes[:action] == 'deleted'\n return property_model.destroy\n end\n\n # extract accessible attributes for the property\n property_accessibles = property_class.accessible_attributes.map(&:to_sym)\n property_attributes = property.attributes.inject({}) do |result, (key, value)|\n result[key] = value if property_accessibles.include?(key)\n result\n end\n\n # update the property model's attributes\n property_model.no_callbacks = true if property_model.respond_to?(:no_callbacks)\n property_model.update_attributes(property_attributes)\n\n # find & update or build a new address\n if Vebra.models[:address]\n address_class = Vebra.models[:address][:class].to_s.camelize.constantize\n address_model = property_model.send(Vebra.models[:property][:address_method])\n address_model = property_model.send(\"build_#{Vebra.models[:property][:address_method]}\") unless address_model\n\n # extract accessible attributes for the address\n address_accessibles = address_class.accessible_attributes.map(&:to_sym)\n address_attributes = property.attributes[:address].inject({}) do |result, (key, value)|\n result[key] = value if address_accessibles.include?(key)\n result\n end\n\n # update the address model's attributes\n address_model.update_attributes(address_attributes)\n end\n\n # find & update or build new rooms\n if Vebra.models[:room]\n room_class = Vebra.models[:room][:class].to_s.camelize.constantize\n\n # accessible attributes for the rooms\n room_accessibles = room_class.accessible_attributes.map(&:to_sym)\n\n # delete any rooms which are no longer present\n property_rooms = property.attributes[:rooms] || []\n property_model_rooms = property_model.send(Vebra.models[:property][:rooms_method])\n refs_to_delete = property_model_rooms.map(&:vebra_ref) - property_rooms.map { |r| r[:vebra_ref] }\n property_model_rooms.each do |room|\n room.destroy if refs_to_delete.include?(room.vebra_ref)\n end\n\n # find & update or build new rooms\n property_rooms.each do |room|\n room_model = room_class.find_by_property_id_and_vebra_ref(property_model.id, room[:vebra_ref])\n room_model = property_model_rooms.build unless room_model\n\n # extract accessible attributes for the room\n room_attributes = room.inject({}) do |result, (key, value)|\n result[key] = value if room_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n room_model.update_attributes(room_attributes)\n end\n end\n\n # find & update or build new file attachments\n if Vebra.models[:file]\n file_class = Vebra.models[:file][:class].to_s.camelize.constantize\n\n # accessible attributes for the files\n file_accessibles = file_class.accessible_attributes.map(&:to_sym)\n\n # first normalize the collection (currently nested collections)\n property_files = property.attributes[:files].inject([]) do |result, (kind, collection)|\n collection.each do |file|\n file[:type] = kind.to_s.singularize.camelize if file_accessibles.include?(:type)\n file[\"remote_#{Vebra.models[:file][:attachment_method]}_url\".to_sym] = file.delete(:url)\n # if file[:type] is set, it means the attachment file class can be subclassed. In this\n # case we need to ensure that the subclass exists. If not, we ignore this file\n begin\n file[:type].constantize if file_accessibles.include?(:type)\n result << file\n rescue NameError => e\n # ignore - this means the subclass does not exist\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n\n result\n end\n\n # delete any files which are no longer present\n property_model_files = property_model.send(Vebra.models[:property][:files_method])\n refs_to_delete = property_model_files.map(&:vebra_ref) - property_files.map { |f| f[:vebra_ref] }\n property_model_files.each do |file|\n file.destroy if refs_to_delete.include?(file.vebra_ref)\n end\n\n # find & update or build new files\n property_files.each do |file|\n begin\n file_model = property_model_files.find_by_vebra_ref(file[:vebra_ref])\n file_model = property_model_files.build unless file_model\n\n # extract accessible attributes for the file\n file_attributes = file.inject({}) do |result, (key, value)|\n result[key] = value if file_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n file_model.update_attributes(file_attributes)\n rescue CarrierWave::ProcessingError, OpenURI::HTTPError => e\n # just ignore the file\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n end\n\n property_model.no_callbacks = false if property_model.respond_to?(:no_callbacks)\n property_model.save\n return property_model\n end",
"def update!(**args)\n @id = args[:id] if args.key?(:id)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def update\n end",
"def update!(**args)\n @mid = args[:mid] if args.key?(:mid)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def modified_properties=(value)\n @modified_properties = value\n end",
"def apply_properties!(properties)\n # Non-commutitivity etc. eventually.\n end",
"def set_properties(hash)\n hash.each do |key, value|\n add_or_remove_ostruct_member(key, value)\n end\n rest_reset_properties\n end",
"def update\n\t\t\n\t\tend",
"def set_props(props)\n @props.merge!(props)\n end",
"def update() end",
"def update!(**args)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def assign_properties\n self.properties ||= {}\n listing_properties.each do |prop|\n self.properties[prop.key] ||= prop.value\n end\n end",
"def change_properties(new_current_floor, new_next_floor, new_movement)\n @current_floor = new_current_floor\n @next_floor = new_next_floor\n @movement = new_movement\n end",
"def update!(**args)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end",
"def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end",
"def update(attributes)\n (@attributes ||= {}).merge! attributes\n\n (self.class.attr_initializables & attributes.keys).each do |name|\n instance_variable_set :\"@#{name}\", attributes[name]\n end\n\n self\n end",
"def update_attributes(attrs)\n super({})\n end",
"def update\n @dirty = true\n end",
"def update\n\n # Run through the mixin updates\n colourable_update\n movable_update\n\n end",
"def set(props)\n props.each do |prop, val|\n self.send(:\"#{ prop }=\", val)\n end\n end",
"def update\n super\n end",
"def update!(**args)\n @property_id = args[:property_id] if args.key?(:property_id)\n @value_status = args[:value_status] if args.key?(:value_status)\n end",
"def update!(**args)\n @object_size_bytes = args[:object_size_bytes] if args.key?(:object_size_bytes)\n @object_version = args[:object_version] if args.key?(:object_version)\n end",
"def movable_update\n\n # Work through the different aspects we update\n movable_location_update\n movable_size_update\n movable_angle_update\n\n end",
"def properties=(value)\n @properties = value\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(context={})\n self.pre_cast_attributes\n m2o = @relations.reject{|k, v| !self.class.many2one_relations.has_key?(k)}\n vals = @attributes.reject {|key, value| key == 'id'}.merge(m2o.merge(m2o){|k, v| v.is_a?(Array) ? v[0] : v})\n self.class.rpc_execute('write', self.id, vals, context)\n reload_from_record!(self.class.find(self.id, :context => context))\n end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update ; end",
"def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end",
"def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end",
"def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end",
"def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end",
"def update_with(attributes)\n assign_attributes(attributes)\n end",
"def update\n # don't need to update; hash is shared\n end",
"def update(attributes)\n HashProxy.with(attributes) do |proxy|\n self.class.attribute_names.each do |name|\n send(\"#{name}=\", proxy[name]) if proxy.key?(name)\n end\n end\n save\n end",
"def update!(**args)\n @object_id_prop = args[:object_id_prop] if args.key?(:object_id_prop)\n @relation = args[:relation] if args.key?(:relation)\n @subject_id = args[:subject_id] if args.key?(:subject_id)\n end",
"def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end",
"def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end",
"def update\n raise NotImplementedError\n end",
"def update_attributes attributes\n @attributes.merge! attributes\n end",
"def update!(**args)\n @async_options = args[:async_options] if args.key?(:async_options)\n @input_mappings = args[:input_mappings] if args.key?(:input_mappings)\n @name_property = args[:name_property] if args.key?(:name_property)\n @validation_options = args[:validation_options] if args.key?(:validation_options)\n end",
"def update\r\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @type = args[:type] if args.key?(:type)\n end",
"def update\n raise NotImplemented\n end",
"def update_obj\n mean, sd = rating.to_glicko_rating\n @obj.rating = mean\n @obj.rating_deviation = sd\n @obj.volatility = volatility\n end",
"def update_values\n end",
"def update_values\n end",
"def update\n raise NotImplementedError\n end",
"def update!(**args)\n @answers_header_signals = args[:answers_header_signals] if args.key?(:answers_header_signals)\n @property_value = args[:property_value] if args.key?(:property_value)\n @response_meaning_application = args[:response_meaning_application] if args.key?(:response_meaning_application)\n end",
"def update!(**args)\n @create_time = args[:create_time] if args.key?(:create_time)\n @method_prop = args[:method_prop] if args.key?(:method_prop)\n @name = args[:name] if args.key?(:name)\n @state = args[:state] if args.key?(:state)\n end",
"def update attributes, collection #:nodoc:\n 0\n end",
"def update_property_groups(roll)\n @property_groups.each { |_, v| v.update_rent(roll) }\n end",
"def update!(**args)\n @source_property = args[:source_property] if args.key?(:source_property)\n 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 update_properties(path, properties)\n prop_patch = PropPatch.new(properties)\n emit('propPatch', [path, prop_patch])\n prop_patch.commit\n\n prop_patch.result\n end",
"def update\n set_deltatime\n set_last_update_at\n end"
] | [
"0.7012263",
"0.69181895",
"0.69181895",
"0.69181895",
"0.69181895",
"0.69181895",
"0.67403597",
"0.6709326",
"0.6709326",
"0.6696149",
"0.6696149",
"0.6696149",
"0.6696149",
"0.6618882",
"0.6571848",
"0.65386343",
"0.65178275",
"0.6394807",
"0.6389745",
"0.6389745",
"0.63328",
"0.6319025",
"0.6283673",
"0.6269463",
"0.62639254",
"0.62410724",
"0.62170374",
"0.62152076",
"0.6210263",
"0.6204041",
"0.6204041",
"0.62021106",
"0.62017816",
"0.62017",
"0.61730784",
"0.61730784",
"0.6159277",
"0.6156169",
"0.61445665",
"0.6125433",
"0.61241156",
"0.6121413",
"0.6110477",
"0.6105694",
"0.61016303",
"0.60845226",
"0.6084427",
"0.6065455",
"0.6059506",
"0.6054869",
"0.6051708",
"0.6051708",
"0.60413384",
"0.6030853",
"0.6022535",
"0.6015561",
"0.59932375",
"0.59898263",
"0.5976479",
"0.5973787",
"0.59678394",
"0.5963291",
"0.5962048",
"0.5961157",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.59500545",
"0.59443134",
"0.59443134",
"0.59424853",
"0.59424853",
"0.593523",
"0.5926413",
"0.5924831",
"0.592427",
"0.59233046",
"0.59233046",
"0.5921224",
"0.59144294",
"0.59142506",
"0.58887535",
"0.58854496",
"0.5883008",
"0.58792305",
"0.5876954",
"0.5876954",
"0.58744955",
"0.5857968",
"0.5845542",
"0.5841629",
"0.58363605",
"0.5829255",
"0.582919",
"0.5822138",
"0.58208305"
] | 0.0 | -1 |
Update properties of this object | def update!(**args)
@next_page_token = args[:next_page_token] if args.key?(:next_page_token)
@operations = args[:operations] if args.key?(:operations)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update_properties(hash)\n hash.each do |key, value|\n setter_method = \"#{key}=\"\n if self.respond_to?(setter_method)\n self.send(setter_method, value)\n end\n end\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def refresh\n self.class.base_properties.each_with_index do |prop, prop_id|\n @properties[prop] = get_property(prop_id)\n end\n refresh_features\n refresh_status\n refresh_config\n self\n end",
"def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\n end",
"def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\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 update_properties!(branch_id=nil)\n properties = fetch_properties(false, branch_id)\n length = properties.length\n counter = 0\n properties.each do |property|\n counter += 1\n if Vebra.debugging?\n puts \"[Vebra]: #{counter}/#{length}: live updating property with Vebra ref: #{property.attributes[:vebra_ref]}\"\n end\n live_update!(property)\n Vebra.set_last_updated_at(Time.now) if counter == length\n end\n end",
"def update_self obj\n obj.each do |k,v|\n instance_variable_set(\"@#{k}\", v) if v\n end\n end",
"def update_attributes(properties_hash)\n self.class.get_class_properties.each do |property|\n key = property[:name].to_sym\n if properties_hash.has_key? key\n self.setValue(properties_hash[key], forKey:key)\n end\n end\n end",
"def update\n # TODO: implement update\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @states = args[:states] if args.key?(:states)\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end",
"def update!(**args)\n @property = args[:property] if args.key?(:property)\n @total_value_count = args[:total_value_count] if args.key?(:total_value_count)\n @value = args[:value] if args.key?(:value)\n @value_status = args[:value_status] if args.key?(:value_status)\n end",
"def update\n \n end",
"def refresh\n set_attributes\n end",
"def update(attrs)\n @attrs.update(attrs)\n self\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @source = args[:source] if args.key?(:source)\n end",
"def update_resource object, attributes\n object.update attributes\n end",
"def update(attrs)\n @attrs ||= {}\n @attrs.update(attrs)\n self\n end",
"def update\n \n end",
"def update!(**args)\n @property = args[:property] if args.key?(:property)\n @schema = args[:schema] if args.key?(:schema)\n end",
"def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def _update!\n self.class.properties.each do |property, predicate|\n if dirty?(property)\n self.class.repository_or_fail.delete([subject, predicate[:predicate], nil])\n if self.class.is_list?(property)\n repo = RDF::Repository.new\n attribute_get(property).each do |value|\n repo << RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(value, self.class.properties[property][:type]))\n end\n self.class.repository_or_fail.insert(*repo)\n else\n self.class.repository_or_fail.insert(RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(attribute_get(property), self.class.properties[property][:type])))\n end\n end\n @dirty[property] = nil\n @attributes[:original][property] = attribute_get(property)\n end\n self.class.repository_or_fail.insert(RDF::Statement.new(@subject, RDF.type, type)) unless type.nil?\n end",
"def update(attributes = {})\n super(attributes)\n retrieve!\n self\n end",
"def update\n @objects.map(&:update);\n end",
"def update\n raise NotImplementedError\n end",
"def update\n raise NotImplementedError\n end",
"def live_update!(property)\n property_class = Vebra.models[:property][:class].to_s.camelize.constantize\n\n # ensure we have the full property attributes\n property.get_property if !property.attributes[:status] && property.attributes[:action] != 'deleted'\n\n # find & update or build a new property\n property_model = property_class.find_or_initialize_by_vebra_ref(property.attributes[:vebra_ref])\n\n # make sure property object is not empty\n return false if !property.attributes || !property.attributes[:property_type]\n\n # if the property has been deleted, mark it appropriately and move on\n if property.attributes[:action] == 'deleted'\n return property_model.destroy\n end\n\n # extract accessible attributes for the property\n property_accessibles = property_class.accessible_attributes.map(&:to_sym)\n property_attributes = property.attributes.inject({}) do |result, (key, value)|\n result[key] = value if property_accessibles.include?(key)\n result\n end\n\n # update the property model's attributes\n property_model.no_callbacks = true if property_model.respond_to?(:no_callbacks)\n property_model.update_attributes(property_attributes)\n\n # find & update or build a new address\n if Vebra.models[:address]\n address_class = Vebra.models[:address][:class].to_s.camelize.constantize\n address_model = property_model.send(Vebra.models[:property][:address_method])\n address_model = property_model.send(\"build_#{Vebra.models[:property][:address_method]}\") unless address_model\n\n # extract accessible attributes for the address\n address_accessibles = address_class.accessible_attributes.map(&:to_sym)\n address_attributes = property.attributes[:address].inject({}) do |result, (key, value)|\n result[key] = value if address_accessibles.include?(key)\n result\n end\n\n # update the address model's attributes\n address_model.update_attributes(address_attributes)\n end\n\n # find & update or build new rooms\n if Vebra.models[:room]\n room_class = Vebra.models[:room][:class].to_s.camelize.constantize\n\n # accessible attributes for the rooms\n room_accessibles = room_class.accessible_attributes.map(&:to_sym)\n\n # delete any rooms which are no longer present\n property_rooms = property.attributes[:rooms] || []\n property_model_rooms = property_model.send(Vebra.models[:property][:rooms_method])\n refs_to_delete = property_model_rooms.map(&:vebra_ref) - property_rooms.map { |r| r[:vebra_ref] }\n property_model_rooms.each do |room|\n room.destroy if refs_to_delete.include?(room.vebra_ref)\n end\n\n # find & update or build new rooms\n property_rooms.each do |room|\n room_model = room_class.find_by_property_id_and_vebra_ref(property_model.id, room[:vebra_ref])\n room_model = property_model_rooms.build unless room_model\n\n # extract accessible attributes for the room\n room_attributes = room.inject({}) do |result, (key, value)|\n result[key] = value if room_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n room_model.update_attributes(room_attributes)\n end\n end\n\n # find & update or build new file attachments\n if Vebra.models[:file]\n file_class = Vebra.models[:file][:class].to_s.camelize.constantize\n\n # accessible attributes for the files\n file_accessibles = file_class.accessible_attributes.map(&:to_sym)\n\n # first normalize the collection (currently nested collections)\n property_files = property.attributes[:files].inject([]) do |result, (kind, collection)|\n collection.each do |file|\n file[:type] = kind.to_s.singularize.camelize if file_accessibles.include?(:type)\n file[\"remote_#{Vebra.models[:file][:attachment_method]}_url\".to_sym] = file.delete(:url)\n # if file[:type] is set, it means the attachment file class can be subclassed. In this\n # case we need to ensure that the subclass exists. If not, we ignore this file\n begin\n file[:type].constantize if file_accessibles.include?(:type)\n result << file\n rescue NameError => e\n # ignore - this means the subclass does not exist\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n\n result\n end\n\n # delete any files which are no longer present\n property_model_files = property_model.send(Vebra.models[:property][:files_method])\n refs_to_delete = property_model_files.map(&:vebra_ref) - property_files.map { |f| f[:vebra_ref] }\n property_model_files.each do |file|\n file.destroy if refs_to_delete.include?(file.vebra_ref)\n end\n\n # find & update or build new files\n property_files.each do |file|\n begin\n file_model = property_model_files.find_by_vebra_ref(file[:vebra_ref])\n file_model = property_model_files.build unless file_model\n\n # extract accessible attributes for the file\n file_attributes = file.inject({}) do |result, (key, value)|\n result[key] = value if file_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n file_model.update_attributes(file_attributes)\n rescue CarrierWave::ProcessingError, OpenURI::HTTPError => e\n # just ignore the file\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n end\n\n property_model.no_callbacks = false if property_model.respond_to?(:no_callbacks)\n property_model.save\n return property_model\n end",
"def update!(**args)\n @id = args[:id] if args.key?(:id)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def update\n end",
"def update!(**args)\n @mid = args[:mid] if args.key?(:mid)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def modified_properties=(value)\n @modified_properties = value\n end",
"def apply_properties!(properties)\n # Non-commutitivity etc. eventually.\n end",
"def set_properties(hash)\n hash.each do |key, value|\n add_or_remove_ostruct_member(key, value)\n end\n rest_reset_properties\n end",
"def update\n\t\t\n\t\tend",
"def set_props(props)\n @props.merge!(props)\n end",
"def update() end",
"def update!(**args)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def assign_properties\n self.properties ||= {}\n listing_properties.each do |prop|\n self.properties[prop.key] ||= prop.value\n end\n end",
"def change_properties(new_current_floor, new_next_floor, new_movement)\n @current_floor = new_current_floor\n @next_floor = new_next_floor\n @movement = new_movement\n end",
"def update!(**args)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end",
"def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end",
"def update(attributes)\n (@attributes ||= {}).merge! attributes\n\n (self.class.attr_initializables & attributes.keys).each do |name|\n instance_variable_set :\"@#{name}\", attributes[name]\n end\n\n self\n end",
"def update_attributes(attrs)\n super({})\n end",
"def update\n @dirty = true\n end",
"def update\n\n # Run through the mixin updates\n colourable_update\n movable_update\n\n end",
"def set(props)\n props.each do |prop, val|\n self.send(:\"#{ prop }=\", val)\n end\n end",
"def update\n super\n end",
"def update!(**args)\n @property_id = args[:property_id] if args.key?(:property_id)\n @value_status = args[:value_status] if args.key?(:value_status)\n end",
"def update!(**args)\n @object_size_bytes = args[:object_size_bytes] if args.key?(:object_size_bytes)\n @object_version = args[:object_version] if args.key?(:object_version)\n end",
"def movable_update\n\n # Work through the different aspects we update\n movable_location_update\n movable_size_update\n movable_angle_update\n\n end",
"def properties=(value)\n @properties = value\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(context={})\n self.pre_cast_attributes\n m2o = @relations.reject{|k, v| !self.class.many2one_relations.has_key?(k)}\n vals = @attributes.reject {|key, value| key == 'id'}.merge(m2o.merge(m2o){|k, v| v.is_a?(Array) ? v[0] : v})\n self.class.rpc_execute('write', self.id, vals, context)\n reload_from_record!(self.class.find(self.id, :context => context))\n end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update ; end",
"def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end",
"def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end",
"def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end",
"def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end",
"def update_with(attributes)\n assign_attributes(attributes)\n end",
"def update\n # don't need to update; hash is shared\n end",
"def update(attributes)\n HashProxy.with(attributes) do |proxy|\n self.class.attribute_names.each do |name|\n send(\"#{name}=\", proxy[name]) if proxy.key?(name)\n end\n end\n save\n end",
"def update!(**args)\n @object_id_prop = args[:object_id_prop] if args.key?(:object_id_prop)\n @relation = args[:relation] if args.key?(:relation)\n @subject_id = args[:subject_id] if args.key?(:subject_id)\n end",
"def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end",
"def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end",
"def update\n raise NotImplementedError\n end",
"def update_attributes attributes\n @attributes.merge! attributes\n end",
"def update!(**args)\n @async_options = args[:async_options] if args.key?(:async_options)\n @input_mappings = args[:input_mappings] if args.key?(:input_mappings)\n @name_property = args[:name_property] if args.key?(:name_property)\n @validation_options = args[:validation_options] if args.key?(:validation_options)\n end",
"def update\r\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @type = args[:type] if args.key?(:type)\n end",
"def update\n raise NotImplemented\n end",
"def update_obj\n mean, sd = rating.to_glicko_rating\n @obj.rating = mean\n @obj.rating_deviation = sd\n @obj.volatility = volatility\n end",
"def update_values\n end",
"def update_values\n end",
"def update\n raise NotImplementedError\n end",
"def update!(**args)\n @answers_header_signals = args[:answers_header_signals] if args.key?(:answers_header_signals)\n @property_value = args[:property_value] if args.key?(:property_value)\n @response_meaning_application = args[:response_meaning_application] if args.key?(:response_meaning_application)\n end",
"def update!(**args)\n @create_time = args[:create_time] if args.key?(:create_time)\n @method_prop = args[:method_prop] if args.key?(:method_prop)\n @name = args[:name] if args.key?(:name)\n @state = args[:state] if args.key?(:state)\n end",
"def update attributes, collection #:nodoc:\n 0\n end",
"def update_property_groups(roll)\n @property_groups.each { |_, v| v.update_rent(roll) }\n end",
"def update!(**args)\n @source_property = args[:source_property] if args.key?(:source_property)\n 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 update_properties(path, properties)\n prop_patch = PropPatch.new(properties)\n emit('propPatch', [path, prop_patch])\n prop_patch.commit\n\n prop_patch.result\n end",
"def update\n set_deltatime\n set_last_update_at\n end"
] | [
"0.7012263",
"0.69181895",
"0.69181895",
"0.69181895",
"0.69181895",
"0.69181895",
"0.67403597",
"0.6709326",
"0.6709326",
"0.6696149",
"0.6696149",
"0.6696149",
"0.6696149",
"0.6618882",
"0.6571848",
"0.65386343",
"0.65178275",
"0.6394807",
"0.6389745",
"0.6389745",
"0.63328",
"0.6319025",
"0.6283673",
"0.6269463",
"0.62639254",
"0.62410724",
"0.62170374",
"0.62152076",
"0.6210263",
"0.6204041",
"0.6204041",
"0.62021106",
"0.62017816",
"0.62017",
"0.61730784",
"0.61730784",
"0.6159277",
"0.6156169",
"0.61445665",
"0.6125433",
"0.61241156",
"0.6121413",
"0.6110477",
"0.6105694",
"0.61016303",
"0.60845226",
"0.6084427",
"0.6065455",
"0.6059506",
"0.6054869",
"0.6051708",
"0.6051708",
"0.60413384",
"0.6030853",
"0.6022535",
"0.6015561",
"0.59932375",
"0.59898263",
"0.5976479",
"0.5973787",
"0.59678394",
"0.5963291",
"0.5962048",
"0.5961157",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.59500545",
"0.59443134",
"0.59443134",
"0.59424853",
"0.59424853",
"0.593523",
"0.5926413",
"0.5924831",
"0.592427",
"0.59233046",
"0.59233046",
"0.5921224",
"0.59144294",
"0.59142506",
"0.58887535",
"0.58854496",
"0.5883008",
"0.58792305",
"0.5876954",
"0.5876954",
"0.58744955",
"0.5857968",
"0.5845542",
"0.5841629",
"0.58363605",
"0.5829255",
"0.582919",
"0.5822138",
"0.58208305"
] | 0.0 | -1 |
Update properties of this object | def update!(**args)
@next_page_token = args[:next_page_token] if args.key?(:next_page_token)
@security_profile_groups = args[:security_profile_groups] if args.key?(:security_profile_groups)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update_properties(hash)\n hash.each do |key, value|\n setter_method = \"#{key}=\"\n if self.respond_to?(setter_method)\n self.send(setter_method, value)\n end\n end\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def refresh\n self.class.base_properties.each_with_index do |prop, prop_id|\n @properties[prop] = get_property(prop_id)\n end\n refresh_features\n refresh_status\n refresh_config\n self\n end",
"def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\n end",
"def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\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 update_properties!(branch_id=nil)\n properties = fetch_properties(false, branch_id)\n length = properties.length\n counter = 0\n properties.each do |property|\n counter += 1\n if Vebra.debugging?\n puts \"[Vebra]: #{counter}/#{length}: live updating property with Vebra ref: #{property.attributes[:vebra_ref]}\"\n end\n live_update!(property)\n Vebra.set_last_updated_at(Time.now) if counter == length\n end\n end",
"def update_self obj\n obj.each do |k,v|\n instance_variable_set(\"@#{k}\", v) if v\n end\n end",
"def update_attributes(properties_hash)\n self.class.get_class_properties.each do |property|\n key = property[:name].to_sym\n if properties_hash.has_key? key\n self.setValue(properties_hash[key], forKey:key)\n end\n end\n end",
"def update\n # TODO: implement update\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @states = args[:states] if args.key?(:states)\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end",
"def update!(**args)\n @property = args[:property] if args.key?(:property)\n @total_value_count = args[:total_value_count] if args.key?(:total_value_count)\n @value = args[:value] if args.key?(:value)\n @value_status = args[:value_status] if args.key?(:value_status)\n end",
"def update\n \n end",
"def refresh\n set_attributes\n end",
"def update(attrs)\n @attrs.update(attrs)\n self\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @source = args[:source] if args.key?(:source)\n end",
"def update_resource object, attributes\n object.update attributes\n end",
"def update(attrs)\n @attrs ||= {}\n @attrs.update(attrs)\n self\n end",
"def update\n \n end",
"def update!(**args)\n @property = args[:property] if args.key?(:property)\n @schema = args[:schema] if args.key?(:schema)\n end",
"def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def update(attributes = {})\n super(attributes)\n retrieve!\n self\n end",
"def _update!\n self.class.properties.each do |property, predicate|\n if dirty?(property)\n self.class.repository_or_fail.delete([subject, predicate[:predicate], nil])\n if self.class.is_list?(property)\n repo = RDF::Repository.new\n attribute_get(property).each do |value|\n repo << RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(value, self.class.properties[property][:type]))\n end\n self.class.repository_or_fail.insert(*repo)\n else\n self.class.repository_or_fail.insert(RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(attribute_get(property), self.class.properties[property][:type])))\n end\n end\n @dirty[property] = nil\n @attributes[:original][property] = attribute_get(property)\n end\n self.class.repository_or_fail.insert(RDF::Statement.new(@subject, RDF.type, type)) unless type.nil?\n end",
"def update\n @objects.map(&:update);\n end",
"def update\n raise NotImplementedError\n end",
"def update\n raise NotImplementedError\n end",
"def live_update!(property)\n property_class = Vebra.models[:property][:class].to_s.camelize.constantize\n\n # ensure we have the full property attributes\n property.get_property if !property.attributes[:status] && property.attributes[:action] != 'deleted'\n\n # find & update or build a new property\n property_model = property_class.find_or_initialize_by_vebra_ref(property.attributes[:vebra_ref])\n\n # make sure property object is not empty\n return false if !property.attributes || !property.attributes[:property_type]\n\n # if the property has been deleted, mark it appropriately and move on\n if property.attributes[:action] == 'deleted'\n return property_model.destroy\n end\n\n # extract accessible attributes for the property\n property_accessibles = property_class.accessible_attributes.map(&:to_sym)\n property_attributes = property.attributes.inject({}) do |result, (key, value)|\n result[key] = value if property_accessibles.include?(key)\n result\n end\n\n # update the property model's attributes\n property_model.no_callbacks = true if property_model.respond_to?(:no_callbacks)\n property_model.update_attributes(property_attributes)\n\n # find & update or build a new address\n if Vebra.models[:address]\n address_class = Vebra.models[:address][:class].to_s.camelize.constantize\n address_model = property_model.send(Vebra.models[:property][:address_method])\n address_model = property_model.send(\"build_#{Vebra.models[:property][:address_method]}\") unless address_model\n\n # extract accessible attributes for the address\n address_accessibles = address_class.accessible_attributes.map(&:to_sym)\n address_attributes = property.attributes[:address].inject({}) do |result, (key, value)|\n result[key] = value if address_accessibles.include?(key)\n result\n end\n\n # update the address model's attributes\n address_model.update_attributes(address_attributes)\n end\n\n # find & update or build new rooms\n if Vebra.models[:room]\n room_class = Vebra.models[:room][:class].to_s.camelize.constantize\n\n # accessible attributes for the rooms\n room_accessibles = room_class.accessible_attributes.map(&:to_sym)\n\n # delete any rooms which are no longer present\n property_rooms = property.attributes[:rooms] || []\n property_model_rooms = property_model.send(Vebra.models[:property][:rooms_method])\n refs_to_delete = property_model_rooms.map(&:vebra_ref) - property_rooms.map { |r| r[:vebra_ref] }\n property_model_rooms.each do |room|\n room.destroy if refs_to_delete.include?(room.vebra_ref)\n end\n\n # find & update or build new rooms\n property_rooms.each do |room|\n room_model = room_class.find_by_property_id_and_vebra_ref(property_model.id, room[:vebra_ref])\n room_model = property_model_rooms.build unless room_model\n\n # extract accessible attributes for the room\n room_attributes = room.inject({}) do |result, (key, value)|\n result[key] = value if room_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n room_model.update_attributes(room_attributes)\n end\n end\n\n # find & update or build new file attachments\n if Vebra.models[:file]\n file_class = Vebra.models[:file][:class].to_s.camelize.constantize\n\n # accessible attributes for the files\n file_accessibles = file_class.accessible_attributes.map(&:to_sym)\n\n # first normalize the collection (currently nested collections)\n property_files = property.attributes[:files].inject([]) do |result, (kind, collection)|\n collection.each do |file|\n file[:type] = kind.to_s.singularize.camelize if file_accessibles.include?(:type)\n file[\"remote_#{Vebra.models[:file][:attachment_method]}_url\".to_sym] = file.delete(:url)\n # if file[:type] is set, it means the attachment file class can be subclassed. In this\n # case we need to ensure that the subclass exists. If not, we ignore this file\n begin\n file[:type].constantize if file_accessibles.include?(:type)\n result << file\n rescue NameError => e\n # ignore - this means the subclass does not exist\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n\n result\n end\n\n # delete any files which are no longer present\n property_model_files = property_model.send(Vebra.models[:property][:files_method])\n refs_to_delete = property_model_files.map(&:vebra_ref) - property_files.map { |f| f[:vebra_ref] }\n property_model_files.each do |file|\n file.destroy if refs_to_delete.include?(file.vebra_ref)\n end\n\n # find & update or build new files\n property_files.each do |file|\n begin\n file_model = property_model_files.find_by_vebra_ref(file[:vebra_ref])\n file_model = property_model_files.build unless file_model\n\n # extract accessible attributes for the file\n file_attributes = file.inject({}) do |result, (key, value)|\n result[key] = value if file_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n file_model.update_attributes(file_attributes)\n rescue CarrierWave::ProcessingError, OpenURI::HTTPError => e\n # just ignore the file\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n end\n\n property_model.no_callbacks = false if property_model.respond_to?(:no_callbacks)\n property_model.save\n return property_model\n end",
"def update!(**args)\n @id = args[:id] if args.key?(:id)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def update\n end",
"def update!(**args)\n @mid = args[:mid] if args.key?(:mid)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def modified_properties=(value)\n @modified_properties = value\n end",
"def apply_properties!(properties)\n # Non-commutitivity etc. eventually.\n end",
"def set_properties(hash)\n hash.each do |key, value|\n add_or_remove_ostruct_member(key, value)\n end\n rest_reset_properties\n end",
"def update\n\t\t\n\t\tend",
"def set_props(props)\n @props.merge!(props)\n end",
"def update() end",
"def update!(**args)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def assign_properties\n self.properties ||= {}\n listing_properties.each do |prop|\n self.properties[prop.key] ||= prop.value\n end\n end",
"def change_properties(new_current_floor, new_next_floor, new_movement)\n @current_floor = new_current_floor\n @next_floor = new_next_floor\n @movement = new_movement\n end",
"def update!(**args)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end",
"def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end",
"def update(attributes)\n (@attributes ||= {}).merge! attributes\n\n (self.class.attr_initializables & attributes.keys).each do |name|\n instance_variable_set :\"@#{name}\", attributes[name]\n end\n\n self\n end",
"def update_attributes(attrs)\n super({})\n end",
"def update\n @dirty = true\n end",
"def update\n\n # Run through the mixin updates\n colourable_update\n movable_update\n\n end",
"def set(props)\n props.each do |prop, val|\n self.send(:\"#{ prop }=\", val)\n end\n end",
"def update\n super\n end",
"def update!(**args)\n @property_id = args[:property_id] if args.key?(:property_id)\n @value_status = args[:value_status] if args.key?(:value_status)\n end",
"def update!(**args)\n @object_size_bytes = args[:object_size_bytes] if args.key?(:object_size_bytes)\n @object_version = args[:object_version] if args.key?(:object_version)\n end",
"def movable_update\n\n # Work through the different aspects we update\n movable_location_update\n movable_size_update\n movable_angle_update\n\n end",
"def properties=(value)\n @properties = value\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(context={})\n self.pre_cast_attributes\n m2o = @relations.reject{|k, v| !self.class.many2one_relations.has_key?(k)}\n vals = @attributes.reject {|key, value| key == 'id'}.merge(m2o.merge(m2o){|k, v| v.is_a?(Array) ? v[0] : v})\n self.class.rpc_execute('write', self.id, vals, context)\n reload_from_record!(self.class.find(self.id, :context => context))\n end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update ; end",
"def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end",
"def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end",
"def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end",
"def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end",
"def update_with(attributes)\n assign_attributes(attributes)\n end",
"def update\n # don't need to update; hash is shared\n end",
"def update(attributes)\n HashProxy.with(attributes) do |proxy|\n self.class.attribute_names.each do |name|\n send(\"#{name}=\", proxy[name]) if proxy.key?(name)\n end\n end\n save\n end",
"def update!(**args)\n @object_id_prop = args[:object_id_prop] if args.key?(:object_id_prop)\n @relation = args[:relation] if args.key?(:relation)\n @subject_id = args[:subject_id] if args.key?(:subject_id)\n end",
"def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end",
"def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end",
"def update\n raise NotImplementedError\n end",
"def update_attributes attributes\n @attributes.merge! attributes\n end",
"def update!(**args)\n @async_options = args[:async_options] if args.key?(:async_options)\n @input_mappings = args[:input_mappings] if args.key?(:input_mappings)\n @name_property = args[:name_property] if args.key?(:name_property)\n @validation_options = args[:validation_options] if args.key?(:validation_options)\n end",
"def update\r\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @type = args[:type] if args.key?(:type)\n end",
"def update\n raise NotImplemented\n end",
"def update_obj\n mean, sd = rating.to_glicko_rating\n @obj.rating = mean\n @obj.rating_deviation = sd\n @obj.volatility = volatility\n end",
"def update_values\n end",
"def update_values\n end",
"def update\n raise NotImplementedError\n end",
"def update!(**args)\n @answers_header_signals = args[:answers_header_signals] if args.key?(:answers_header_signals)\n @property_value = args[:property_value] if args.key?(:property_value)\n @response_meaning_application = args[:response_meaning_application] if args.key?(:response_meaning_application)\n end",
"def update!(**args)\n @create_time = args[:create_time] if args.key?(:create_time)\n @method_prop = args[:method_prop] if args.key?(:method_prop)\n @name = args[:name] if args.key?(:name)\n @state = args[:state] if args.key?(:state)\n end",
"def update attributes, collection #:nodoc:\n 0\n end",
"def update_property_groups(roll)\n @property_groups.each { |_, v| v.update_rent(roll) }\n 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 update!(**args)\n @source_property = args[:source_property] if args.key?(:source_property)\n end",
"def update_properties(path, properties)\n prop_patch = PropPatch.new(properties)\n emit('propPatch', [path, prop_patch])\n prop_patch.commit\n\n prop_patch.result\n end",
"def update\n set_deltatime\n set_last_update_at\n end"
] | [
"0.7012568",
"0.6918917",
"0.6918917",
"0.6918917",
"0.6918917",
"0.6918917",
"0.67404634",
"0.6709981",
"0.6709981",
"0.66964126",
"0.66964126",
"0.66964126",
"0.66964126",
"0.6619218",
"0.6570895",
"0.6539287",
"0.6517026",
"0.63946927",
"0.63901657",
"0.63901657",
"0.63328683",
"0.6318612",
"0.62846893",
"0.62692374",
"0.6264273",
"0.6241163",
"0.6216599",
"0.6214641",
"0.6210363",
"0.6203827",
"0.6203827",
"0.620312",
"0.6201905",
"0.62001497",
"0.61728275",
"0.61728275",
"0.6159924",
"0.61569315",
"0.61442953",
"0.61260897",
"0.6125199",
"0.61227936",
"0.61111224",
"0.610543",
"0.6102925",
"0.60839343",
"0.6083609",
"0.6066973",
"0.60602766",
"0.6055065",
"0.6051568",
"0.6051568",
"0.6042057",
"0.60319084",
"0.60221004",
"0.60149413",
"0.5994295",
"0.5989816",
"0.597674",
"0.5973157",
"0.5967343",
"0.5965598",
"0.59629464",
"0.59618354",
"0.5950329",
"0.5950329",
"0.5950329",
"0.5950329",
"0.5950329",
"0.5950329",
"0.5950329",
"0.5950329",
"0.59495455",
"0.59442014",
"0.59442014",
"0.5944142",
"0.5944142",
"0.59361076",
"0.5925741",
"0.5925574",
"0.59250593",
"0.5924476",
"0.5924476",
"0.5921039",
"0.59155524",
"0.59145254",
"0.5888445",
"0.58860934",
"0.5882302",
"0.5879913",
"0.5877467",
"0.5877467",
"0.58743787",
"0.585829",
"0.584583",
"0.58408254",
"0.5835501",
"0.5829063",
"0.5828611",
"0.58228916",
"0.5819882"
] | 0.0 | -1 |
Update properties of this object | def update!(**args)
@next_page_token = args[:next_page_token] if args.key?(:next_page_token)
@security_profiles = args[:security_profiles] if args.key?(:security_profiles)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update_properties(hash)\n hash.each do |key, value|\n setter_method = \"#{key}=\"\n if self.respond_to?(setter_method)\n self.send(setter_method, value)\n end\n end\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def refresh\n self.class.base_properties.each_with_index do |prop, prop_id|\n @properties[prop] = get_property(prop_id)\n end\n refresh_features\n refresh_status\n refresh_config\n self\n end",
"def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\n end",
"def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\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 update_properties!(branch_id=nil)\n properties = fetch_properties(false, branch_id)\n length = properties.length\n counter = 0\n properties.each do |property|\n counter += 1\n if Vebra.debugging?\n puts \"[Vebra]: #{counter}/#{length}: live updating property with Vebra ref: #{property.attributes[:vebra_ref]}\"\n end\n live_update!(property)\n Vebra.set_last_updated_at(Time.now) if counter == length\n end\n end",
"def update_self obj\n obj.each do |k,v|\n instance_variable_set(\"@#{k}\", v) if v\n end\n end",
"def update_attributes(properties_hash)\n self.class.get_class_properties.each do |property|\n key = property[:name].to_sym\n if properties_hash.has_key? key\n self.setValue(properties_hash[key], forKey:key)\n end\n end\n end",
"def update\n # TODO: implement update\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @states = args[:states] if args.key?(:states)\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end",
"def update!(**args)\n @property = args[:property] if args.key?(:property)\n @total_value_count = args[:total_value_count] if args.key?(:total_value_count)\n @value = args[:value] if args.key?(:value)\n @value_status = args[:value_status] if args.key?(:value_status)\n end",
"def update\n \n end",
"def refresh\n set_attributes\n end",
"def update(attrs)\n @attrs.update(attrs)\n self\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @source = args[:source] if args.key?(:source)\n end",
"def update_resource object, attributes\n object.update attributes\n end",
"def update(attrs)\n @attrs ||= {}\n @attrs.update(attrs)\n self\n end",
"def update\n \n end",
"def update!(**args)\n @property = args[:property] if args.key?(:property)\n @schema = args[:schema] if args.key?(:schema)\n end",
"def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def _update!\n self.class.properties.each do |property, predicate|\n if dirty?(property)\n self.class.repository_or_fail.delete([subject, predicate[:predicate], nil])\n if self.class.is_list?(property)\n repo = RDF::Repository.new\n attribute_get(property).each do |value|\n repo << RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(value, self.class.properties[property][:type]))\n end\n self.class.repository_or_fail.insert(*repo)\n else\n self.class.repository_or_fail.insert(RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(attribute_get(property), self.class.properties[property][:type])))\n end\n end\n @dirty[property] = nil\n @attributes[:original][property] = attribute_get(property)\n end\n self.class.repository_or_fail.insert(RDF::Statement.new(@subject, RDF.type, type)) unless type.nil?\n end",
"def update(attributes = {})\n super(attributes)\n retrieve!\n self\n end",
"def update\n @objects.map(&:update);\n end",
"def update\n raise NotImplementedError\n end",
"def update\n raise NotImplementedError\n end",
"def live_update!(property)\n property_class = Vebra.models[:property][:class].to_s.camelize.constantize\n\n # ensure we have the full property attributes\n property.get_property if !property.attributes[:status] && property.attributes[:action] != 'deleted'\n\n # find & update or build a new property\n property_model = property_class.find_or_initialize_by_vebra_ref(property.attributes[:vebra_ref])\n\n # make sure property object is not empty\n return false if !property.attributes || !property.attributes[:property_type]\n\n # if the property has been deleted, mark it appropriately and move on\n if property.attributes[:action] == 'deleted'\n return property_model.destroy\n end\n\n # extract accessible attributes for the property\n property_accessibles = property_class.accessible_attributes.map(&:to_sym)\n property_attributes = property.attributes.inject({}) do |result, (key, value)|\n result[key] = value if property_accessibles.include?(key)\n result\n end\n\n # update the property model's attributes\n property_model.no_callbacks = true if property_model.respond_to?(:no_callbacks)\n property_model.update_attributes(property_attributes)\n\n # find & update or build a new address\n if Vebra.models[:address]\n address_class = Vebra.models[:address][:class].to_s.camelize.constantize\n address_model = property_model.send(Vebra.models[:property][:address_method])\n address_model = property_model.send(\"build_#{Vebra.models[:property][:address_method]}\") unless address_model\n\n # extract accessible attributes for the address\n address_accessibles = address_class.accessible_attributes.map(&:to_sym)\n address_attributes = property.attributes[:address].inject({}) do |result, (key, value)|\n result[key] = value if address_accessibles.include?(key)\n result\n end\n\n # update the address model's attributes\n address_model.update_attributes(address_attributes)\n end\n\n # find & update or build new rooms\n if Vebra.models[:room]\n room_class = Vebra.models[:room][:class].to_s.camelize.constantize\n\n # accessible attributes for the rooms\n room_accessibles = room_class.accessible_attributes.map(&:to_sym)\n\n # delete any rooms which are no longer present\n property_rooms = property.attributes[:rooms] || []\n property_model_rooms = property_model.send(Vebra.models[:property][:rooms_method])\n refs_to_delete = property_model_rooms.map(&:vebra_ref) - property_rooms.map { |r| r[:vebra_ref] }\n property_model_rooms.each do |room|\n room.destroy if refs_to_delete.include?(room.vebra_ref)\n end\n\n # find & update or build new rooms\n property_rooms.each do |room|\n room_model = room_class.find_by_property_id_and_vebra_ref(property_model.id, room[:vebra_ref])\n room_model = property_model_rooms.build unless room_model\n\n # extract accessible attributes for the room\n room_attributes = room.inject({}) do |result, (key, value)|\n result[key] = value if room_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n room_model.update_attributes(room_attributes)\n end\n end\n\n # find & update or build new file attachments\n if Vebra.models[:file]\n file_class = Vebra.models[:file][:class].to_s.camelize.constantize\n\n # accessible attributes for the files\n file_accessibles = file_class.accessible_attributes.map(&:to_sym)\n\n # first normalize the collection (currently nested collections)\n property_files = property.attributes[:files].inject([]) do |result, (kind, collection)|\n collection.each do |file|\n file[:type] = kind.to_s.singularize.camelize if file_accessibles.include?(:type)\n file[\"remote_#{Vebra.models[:file][:attachment_method]}_url\".to_sym] = file.delete(:url)\n # if file[:type] is set, it means the attachment file class can be subclassed. In this\n # case we need to ensure that the subclass exists. If not, we ignore this file\n begin\n file[:type].constantize if file_accessibles.include?(:type)\n result << file\n rescue NameError => e\n # ignore - this means the subclass does not exist\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n\n result\n end\n\n # delete any files which are no longer present\n property_model_files = property_model.send(Vebra.models[:property][:files_method])\n refs_to_delete = property_model_files.map(&:vebra_ref) - property_files.map { |f| f[:vebra_ref] }\n property_model_files.each do |file|\n file.destroy if refs_to_delete.include?(file.vebra_ref)\n end\n\n # find & update or build new files\n property_files.each do |file|\n begin\n file_model = property_model_files.find_by_vebra_ref(file[:vebra_ref])\n file_model = property_model_files.build unless file_model\n\n # extract accessible attributes for the file\n file_attributes = file.inject({}) do |result, (key, value)|\n result[key] = value if file_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n file_model.update_attributes(file_attributes)\n rescue CarrierWave::ProcessingError, OpenURI::HTTPError => e\n # just ignore the file\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n end\n\n property_model.no_callbacks = false if property_model.respond_to?(:no_callbacks)\n property_model.save\n return property_model\n end",
"def update!(**args)\n @id = args[:id] if args.key?(:id)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def update\n end",
"def update!(**args)\n @mid = args[:mid] if args.key?(:mid)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def modified_properties=(value)\n @modified_properties = value\n end",
"def apply_properties!(properties)\n # Non-commutitivity etc. eventually.\n end",
"def set_properties(hash)\n hash.each do |key, value|\n add_or_remove_ostruct_member(key, value)\n end\n rest_reset_properties\n end",
"def update\n\t\t\n\t\tend",
"def set_props(props)\n @props.merge!(props)\n end",
"def update() end",
"def update!(**args)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def assign_properties\n self.properties ||= {}\n listing_properties.each do |prop|\n self.properties[prop.key] ||= prop.value\n end\n end",
"def change_properties(new_current_floor, new_next_floor, new_movement)\n @current_floor = new_current_floor\n @next_floor = new_next_floor\n @movement = new_movement\n end",
"def update!(**args)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end",
"def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end",
"def update(attributes)\n (@attributes ||= {}).merge! attributes\n\n (self.class.attr_initializables & attributes.keys).each do |name|\n instance_variable_set :\"@#{name}\", attributes[name]\n end\n\n self\n end",
"def update_attributes(attrs)\n super({})\n end",
"def update\n @dirty = true\n end",
"def update\n\n # Run through the mixin updates\n colourable_update\n movable_update\n\n end",
"def set(props)\n props.each do |prop, val|\n self.send(:\"#{ prop }=\", val)\n end\n end",
"def update\n super\n end",
"def update!(**args)\n @property_id = args[:property_id] if args.key?(:property_id)\n @value_status = args[:value_status] if args.key?(:value_status)\n end",
"def update!(**args)\n @object_size_bytes = args[:object_size_bytes] if args.key?(:object_size_bytes)\n @object_version = args[:object_version] if args.key?(:object_version)\n end",
"def movable_update\n\n # Work through the different aspects we update\n movable_location_update\n movable_size_update\n movable_angle_update\n\n end",
"def properties=(value)\n @properties = value\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(context={})\n self.pre_cast_attributes\n m2o = @relations.reject{|k, v| !self.class.many2one_relations.has_key?(k)}\n vals = @attributes.reject {|key, value| key == 'id'}.merge(m2o.merge(m2o){|k, v| v.is_a?(Array) ? v[0] : v})\n self.class.rpc_execute('write', self.id, vals, context)\n reload_from_record!(self.class.find(self.id, :context => context))\n end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update ; end",
"def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end",
"def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end",
"def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end",
"def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end",
"def update_with(attributes)\n assign_attributes(attributes)\n end",
"def update\n # don't need to update; hash is shared\n end",
"def update(attributes)\n HashProxy.with(attributes) do |proxy|\n self.class.attribute_names.each do |name|\n send(\"#{name}=\", proxy[name]) if proxy.key?(name)\n end\n end\n save\n end",
"def update!(**args)\n @object_id_prop = args[:object_id_prop] if args.key?(:object_id_prop)\n @relation = args[:relation] if args.key?(:relation)\n @subject_id = args[:subject_id] if args.key?(:subject_id)\n end",
"def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end",
"def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end",
"def update\n raise NotImplementedError\n end",
"def update_attributes attributes\n @attributes.merge! attributes\n end",
"def update!(**args)\n @async_options = args[:async_options] if args.key?(:async_options)\n @input_mappings = args[:input_mappings] if args.key?(:input_mappings)\n @name_property = args[:name_property] if args.key?(:name_property)\n @validation_options = args[:validation_options] if args.key?(:validation_options)\n end",
"def update\r\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @type = args[:type] if args.key?(:type)\n end",
"def update\n raise NotImplemented\n end",
"def update_obj\n mean, sd = rating.to_glicko_rating\n @obj.rating = mean\n @obj.rating_deviation = sd\n @obj.volatility = volatility\n end",
"def update_values\n end",
"def update_values\n end",
"def update\n raise NotImplementedError\n end",
"def update!(**args)\n @answers_header_signals = args[:answers_header_signals] if args.key?(:answers_header_signals)\n @property_value = args[:property_value] if args.key?(:property_value)\n @response_meaning_application = args[:response_meaning_application] if args.key?(:response_meaning_application)\n end",
"def update!(**args)\n @create_time = args[:create_time] if args.key?(:create_time)\n @method_prop = args[:method_prop] if args.key?(:method_prop)\n @name = args[:name] if args.key?(:name)\n @state = args[:state] if args.key?(:state)\n end",
"def update attributes, collection #:nodoc:\n 0\n end",
"def update_property_groups(roll)\n @property_groups.each { |_, v| v.update_rent(roll) }\n end",
"def update!(**args)\n @source_property = args[:source_property] if args.key?(:source_property)\n 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 update_properties(path, properties)\n prop_patch = PropPatch.new(properties)\n emit('propPatch', [path, prop_patch])\n prop_patch.commit\n\n prop_patch.result\n end",
"def update\n set_deltatime\n set_last_update_at\n end"
] | [
"0.7012263",
"0.69181895",
"0.69181895",
"0.69181895",
"0.69181895",
"0.69181895",
"0.67403597",
"0.6709326",
"0.6709326",
"0.6696149",
"0.6696149",
"0.6696149",
"0.6696149",
"0.6618882",
"0.6571848",
"0.65386343",
"0.65178275",
"0.6394807",
"0.6389745",
"0.6389745",
"0.63328",
"0.6319025",
"0.6283673",
"0.6269463",
"0.62639254",
"0.62410724",
"0.62170374",
"0.62152076",
"0.6210263",
"0.6204041",
"0.6204041",
"0.62021106",
"0.62017816",
"0.62017",
"0.61730784",
"0.61730784",
"0.6159277",
"0.6156169",
"0.61445665",
"0.6125433",
"0.61241156",
"0.6121413",
"0.6110477",
"0.6105694",
"0.61016303",
"0.60845226",
"0.6084427",
"0.6065455",
"0.6059506",
"0.6054869",
"0.6051708",
"0.6051708",
"0.60413384",
"0.6030853",
"0.6022535",
"0.6015561",
"0.59932375",
"0.59898263",
"0.5976479",
"0.5973787",
"0.59678394",
"0.5963291",
"0.5962048",
"0.5961157",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.59500545",
"0.59443134",
"0.59443134",
"0.59424853",
"0.59424853",
"0.593523",
"0.5926413",
"0.5924831",
"0.592427",
"0.59233046",
"0.59233046",
"0.5921224",
"0.59144294",
"0.59142506",
"0.58887535",
"0.58854496",
"0.5883008",
"0.58792305",
"0.5876954",
"0.5876954",
"0.58744955",
"0.5857968",
"0.5845542",
"0.5841629",
"0.58363605",
"0.5829255",
"0.582919",
"0.5822138",
"0.58208305"
] | 0.0 | -1 |
Update properties of this object | def update!(**args)
@next_page_token = args[:next_page_token] if args.key?(:next_page_token)
@server_tls_policies = args[:server_tls_policies] if args.key?(:server_tls_policies)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update_properties(hash)\n hash.each do |key, value|\n setter_method = \"#{key}=\"\n if self.respond_to?(setter_method)\n self.send(setter_method, value)\n end\n end\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def refresh\n self.class.base_properties.each_with_index do |prop, prop_id|\n @properties[prop] = get_property(prop_id)\n end\n refresh_features\n refresh_status\n refresh_config\n self\n end",
"def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\n end",
"def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\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 update_properties!(branch_id=nil)\n properties = fetch_properties(false, branch_id)\n length = properties.length\n counter = 0\n properties.each do |property|\n counter += 1\n if Vebra.debugging?\n puts \"[Vebra]: #{counter}/#{length}: live updating property with Vebra ref: #{property.attributes[:vebra_ref]}\"\n end\n live_update!(property)\n Vebra.set_last_updated_at(Time.now) if counter == length\n end\n end",
"def update_self obj\n obj.each do |k,v|\n instance_variable_set(\"@#{k}\", v) if v\n end\n end",
"def update_attributes(properties_hash)\n self.class.get_class_properties.each do |property|\n key = property[:name].to_sym\n if properties_hash.has_key? key\n self.setValue(properties_hash[key], forKey:key)\n end\n end\n end",
"def update\n # TODO: implement update\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @states = args[:states] if args.key?(:states)\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end",
"def update!(**args)\n @property = args[:property] if args.key?(:property)\n @total_value_count = args[:total_value_count] if args.key?(:total_value_count)\n @value = args[:value] if args.key?(:value)\n @value_status = args[:value_status] if args.key?(:value_status)\n end",
"def update\n \n end",
"def refresh\n set_attributes\n end",
"def update(attrs)\n @attrs.update(attrs)\n self\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @source = args[:source] if args.key?(:source)\n end",
"def update_resource object, attributes\n object.update attributes\n end",
"def update(attrs)\n @attrs ||= {}\n @attrs.update(attrs)\n self\n end",
"def update\n \n end",
"def update!(**args)\n @property = args[:property] if args.key?(:property)\n @schema = args[:schema] if args.key?(:schema)\n end",
"def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def _update!\n self.class.properties.each do |property, predicate|\n if dirty?(property)\n self.class.repository_or_fail.delete([subject, predicate[:predicate], nil])\n if self.class.is_list?(property)\n repo = RDF::Repository.new\n attribute_get(property).each do |value|\n repo << RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(value, self.class.properties[property][:type]))\n end\n self.class.repository_or_fail.insert(*repo)\n else\n self.class.repository_or_fail.insert(RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(attribute_get(property), self.class.properties[property][:type])))\n end\n end\n @dirty[property] = nil\n @attributes[:original][property] = attribute_get(property)\n end\n self.class.repository_or_fail.insert(RDF::Statement.new(@subject, RDF.type, type)) unless type.nil?\n end",
"def update(attributes = {})\n super(attributes)\n retrieve!\n self\n end",
"def update\n @objects.map(&:update);\n end",
"def update\n raise NotImplementedError\n end",
"def update\n raise NotImplementedError\n end",
"def live_update!(property)\n property_class = Vebra.models[:property][:class].to_s.camelize.constantize\n\n # ensure we have the full property attributes\n property.get_property if !property.attributes[:status] && property.attributes[:action] != 'deleted'\n\n # find & update or build a new property\n property_model = property_class.find_or_initialize_by_vebra_ref(property.attributes[:vebra_ref])\n\n # make sure property object is not empty\n return false if !property.attributes || !property.attributes[:property_type]\n\n # if the property has been deleted, mark it appropriately and move on\n if property.attributes[:action] == 'deleted'\n return property_model.destroy\n end\n\n # extract accessible attributes for the property\n property_accessibles = property_class.accessible_attributes.map(&:to_sym)\n property_attributes = property.attributes.inject({}) do |result, (key, value)|\n result[key] = value if property_accessibles.include?(key)\n result\n end\n\n # update the property model's attributes\n property_model.no_callbacks = true if property_model.respond_to?(:no_callbacks)\n property_model.update_attributes(property_attributes)\n\n # find & update or build a new address\n if Vebra.models[:address]\n address_class = Vebra.models[:address][:class].to_s.camelize.constantize\n address_model = property_model.send(Vebra.models[:property][:address_method])\n address_model = property_model.send(\"build_#{Vebra.models[:property][:address_method]}\") unless address_model\n\n # extract accessible attributes for the address\n address_accessibles = address_class.accessible_attributes.map(&:to_sym)\n address_attributes = property.attributes[:address].inject({}) do |result, (key, value)|\n result[key] = value if address_accessibles.include?(key)\n result\n end\n\n # update the address model's attributes\n address_model.update_attributes(address_attributes)\n end\n\n # find & update or build new rooms\n if Vebra.models[:room]\n room_class = Vebra.models[:room][:class].to_s.camelize.constantize\n\n # accessible attributes for the rooms\n room_accessibles = room_class.accessible_attributes.map(&:to_sym)\n\n # delete any rooms which are no longer present\n property_rooms = property.attributes[:rooms] || []\n property_model_rooms = property_model.send(Vebra.models[:property][:rooms_method])\n refs_to_delete = property_model_rooms.map(&:vebra_ref) - property_rooms.map { |r| r[:vebra_ref] }\n property_model_rooms.each do |room|\n room.destroy if refs_to_delete.include?(room.vebra_ref)\n end\n\n # find & update or build new rooms\n property_rooms.each do |room|\n room_model = room_class.find_by_property_id_and_vebra_ref(property_model.id, room[:vebra_ref])\n room_model = property_model_rooms.build unless room_model\n\n # extract accessible attributes for the room\n room_attributes = room.inject({}) do |result, (key, value)|\n result[key] = value if room_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n room_model.update_attributes(room_attributes)\n end\n end\n\n # find & update or build new file attachments\n if Vebra.models[:file]\n file_class = Vebra.models[:file][:class].to_s.camelize.constantize\n\n # accessible attributes for the files\n file_accessibles = file_class.accessible_attributes.map(&:to_sym)\n\n # first normalize the collection (currently nested collections)\n property_files = property.attributes[:files].inject([]) do |result, (kind, collection)|\n collection.each do |file|\n file[:type] = kind.to_s.singularize.camelize if file_accessibles.include?(:type)\n file[\"remote_#{Vebra.models[:file][:attachment_method]}_url\".to_sym] = file.delete(:url)\n # if file[:type] is set, it means the attachment file class can be subclassed. In this\n # case we need to ensure that the subclass exists. If not, we ignore this file\n begin\n file[:type].constantize if file_accessibles.include?(:type)\n result << file\n rescue NameError => e\n # ignore - this means the subclass does not exist\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n\n result\n end\n\n # delete any files which are no longer present\n property_model_files = property_model.send(Vebra.models[:property][:files_method])\n refs_to_delete = property_model_files.map(&:vebra_ref) - property_files.map { |f| f[:vebra_ref] }\n property_model_files.each do |file|\n file.destroy if refs_to_delete.include?(file.vebra_ref)\n end\n\n # find & update or build new files\n property_files.each do |file|\n begin\n file_model = property_model_files.find_by_vebra_ref(file[:vebra_ref])\n file_model = property_model_files.build unless file_model\n\n # extract accessible attributes for the file\n file_attributes = file.inject({}) do |result, (key, value)|\n result[key] = value if file_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n file_model.update_attributes(file_attributes)\n rescue CarrierWave::ProcessingError, OpenURI::HTTPError => e\n # just ignore the file\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n end\n\n property_model.no_callbacks = false if property_model.respond_to?(:no_callbacks)\n property_model.save\n return property_model\n end",
"def update!(**args)\n @id = args[:id] if args.key?(:id)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def update\n end",
"def update!(**args)\n @mid = args[:mid] if args.key?(:mid)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def modified_properties=(value)\n @modified_properties = value\n end",
"def apply_properties!(properties)\n # Non-commutitivity etc. eventually.\n end",
"def set_properties(hash)\n hash.each do |key, value|\n add_or_remove_ostruct_member(key, value)\n end\n rest_reset_properties\n end",
"def update\n\t\t\n\t\tend",
"def set_props(props)\n @props.merge!(props)\n end",
"def update() end",
"def update!(**args)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def assign_properties\n self.properties ||= {}\n listing_properties.each do |prop|\n self.properties[prop.key] ||= prop.value\n end\n end",
"def change_properties(new_current_floor, new_next_floor, new_movement)\n @current_floor = new_current_floor\n @next_floor = new_next_floor\n @movement = new_movement\n end",
"def update!(**args)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end",
"def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end",
"def update(attributes)\n (@attributes ||= {}).merge! attributes\n\n (self.class.attr_initializables & attributes.keys).each do |name|\n instance_variable_set :\"@#{name}\", attributes[name]\n end\n\n self\n end",
"def update_attributes(attrs)\n super({})\n end",
"def update\n @dirty = true\n end",
"def update\n\n # Run through the mixin updates\n colourable_update\n movable_update\n\n end",
"def set(props)\n props.each do |prop, val|\n self.send(:\"#{ prop }=\", val)\n end\n end",
"def update\n super\n end",
"def update!(**args)\n @property_id = args[:property_id] if args.key?(:property_id)\n @value_status = args[:value_status] if args.key?(:value_status)\n end",
"def update!(**args)\n @object_size_bytes = args[:object_size_bytes] if args.key?(:object_size_bytes)\n @object_version = args[:object_version] if args.key?(:object_version)\n end",
"def movable_update\n\n # Work through the different aspects we update\n movable_location_update\n movable_size_update\n movable_angle_update\n\n end",
"def properties=(value)\n @properties = value\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(context={})\n self.pre_cast_attributes\n m2o = @relations.reject{|k, v| !self.class.many2one_relations.has_key?(k)}\n vals = @attributes.reject {|key, value| key == 'id'}.merge(m2o.merge(m2o){|k, v| v.is_a?(Array) ? v[0] : v})\n self.class.rpc_execute('write', self.id, vals, context)\n reload_from_record!(self.class.find(self.id, :context => context))\n end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update ; end",
"def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end",
"def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end",
"def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end",
"def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end",
"def update_with(attributes)\n assign_attributes(attributes)\n end",
"def update\n # don't need to update; hash is shared\n end",
"def update(attributes)\n HashProxy.with(attributes) do |proxy|\n self.class.attribute_names.each do |name|\n send(\"#{name}=\", proxy[name]) if proxy.key?(name)\n end\n end\n save\n end",
"def update!(**args)\n @object_id_prop = args[:object_id_prop] if args.key?(:object_id_prop)\n @relation = args[:relation] if args.key?(:relation)\n @subject_id = args[:subject_id] if args.key?(:subject_id)\n end",
"def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end",
"def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end",
"def update\n raise NotImplementedError\n end",
"def update_attributes attributes\n @attributes.merge! attributes\n end",
"def update!(**args)\n @async_options = args[:async_options] if args.key?(:async_options)\n @input_mappings = args[:input_mappings] if args.key?(:input_mappings)\n @name_property = args[:name_property] if args.key?(:name_property)\n @validation_options = args[:validation_options] if args.key?(:validation_options)\n end",
"def update\r\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @type = args[:type] if args.key?(:type)\n end",
"def update\n raise NotImplemented\n end",
"def update_obj\n mean, sd = rating.to_glicko_rating\n @obj.rating = mean\n @obj.rating_deviation = sd\n @obj.volatility = volatility\n end",
"def update_values\n end",
"def update_values\n end",
"def update\n raise NotImplementedError\n end",
"def update!(**args)\n @answers_header_signals = args[:answers_header_signals] if args.key?(:answers_header_signals)\n @property_value = args[:property_value] if args.key?(:property_value)\n @response_meaning_application = args[:response_meaning_application] if args.key?(:response_meaning_application)\n end",
"def update!(**args)\n @create_time = args[:create_time] if args.key?(:create_time)\n @method_prop = args[:method_prop] if args.key?(:method_prop)\n @name = args[:name] if args.key?(:name)\n @state = args[:state] if args.key?(:state)\n end",
"def update attributes, collection #:nodoc:\n 0\n end",
"def update_property_groups(roll)\n @property_groups.each { |_, v| v.update_rent(roll) }\n end",
"def update!(**args)\n @source_property = args[:source_property] if args.key?(:source_property)\n 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 update_properties(path, properties)\n prop_patch = PropPatch.new(properties)\n emit('propPatch', [path, prop_patch])\n prop_patch.commit\n\n prop_patch.result\n end",
"def update\n set_deltatime\n set_last_update_at\n end"
] | [
"0.7012263",
"0.69181895",
"0.69181895",
"0.69181895",
"0.69181895",
"0.69181895",
"0.67403597",
"0.6709326",
"0.6709326",
"0.6696149",
"0.6696149",
"0.6696149",
"0.6696149",
"0.6618882",
"0.6571848",
"0.65386343",
"0.65178275",
"0.6394807",
"0.6389745",
"0.6389745",
"0.63328",
"0.6319025",
"0.6283673",
"0.6269463",
"0.62639254",
"0.62410724",
"0.62170374",
"0.62152076",
"0.6210263",
"0.6204041",
"0.6204041",
"0.62021106",
"0.62017816",
"0.62017",
"0.61730784",
"0.61730784",
"0.6159277",
"0.6156169",
"0.61445665",
"0.6125433",
"0.61241156",
"0.6121413",
"0.6110477",
"0.6105694",
"0.61016303",
"0.60845226",
"0.6084427",
"0.6065455",
"0.6059506",
"0.6054869",
"0.6051708",
"0.6051708",
"0.60413384",
"0.6030853",
"0.6022535",
"0.6015561",
"0.59932375",
"0.59898263",
"0.5976479",
"0.5973787",
"0.59678394",
"0.5963291",
"0.5962048",
"0.5961157",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.59500545",
"0.59443134",
"0.59443134",
"0.59424853",
"0.59424853",
"0.593523",
"0.5926413",
"0.5924831",
"0.592427",
"0.59233046",
"0.59233046",
"0.5921224",
"0.59144294",
"0.59142506",
"0.58887535",
"0.58854496",
"0.5883008",
"0.58792305",
"0.5876954",
"0.5876954",
"0.58744955",
"0.5857968",
"0.5845542",
"0.5841629",
"0.58363605",
"0.5829255",
"0.582919",
"0.5822138",
"0.58208305"
] | 0.0 | -1 |
Update properties of this object | def update!(**args)
@next_page_token = args[:next_page_token] if args.key?(:next_page_token)
@tls_inspection_policies = args[:tls_inspection_policies] if args.key?(:tls_inspection_policies)
@unreachable = args[:unreachable] if args.key?(:unreachable)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update_properties(hash)\n hash.each do |key, value|\n setter_method = \"#{key}=\"\n if self.respond_to?(setter_method)\n self.send(setter_method, value)\n end\n end\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def refresh\n self.class.base_properties.each_with_index do |prop, prop_id|\n @properties[prop] = get_property(prop_id)\n end\n refresh_features\n refresh_status\n refresh_config\n self\n end",
"def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\n end",
"def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\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 update_properties!(branch_id=nil)\n properties = fetch_properties(false, branch_id)\n length = properties.length\n counter = 0\n properties.each do |property|\n counter += 1\n if Vebra.debugging?\n puts \"[Vebra]: #{counter}/#{length}: live updating property with Vebra ref: #{property.attributes[:vebra_ref]}\"\n end\n live_update!(property)\n Vebra.set_last_updated_at(Time.now) if counter == length\n end\n end",
"def update_self obj\n obj.each do |k,v|\n instance_variable_set(\"@#{k}\", v) if v\n end\n end",
"def update_attributes(properties_hash)\n self.class.get_class_properties.each do |property|\n key = property[:name].to_sym\n if properties_hash.has_key? key\n self.setValue(properties_hash[key], forKey:key)\n end\n end\n end",
"def update\n # TODO: implement update\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @states = args[:states] if args.key?(:states)\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end",
"def update!(**args)\n @property = args[:property] if args.key?(:property)\n @total_value_count = args[:total_value_count] if args.key?(:total_value_count)\n @value = args[:value] if args.key?(:value)\n @value_status = args[:value_status] if args.key?(:value_status)\n end",
"def update\n \n end",
"def refresh\n set_attributes\n end",
"def update(attrs)\n @attrs.update(attrs)\n self\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @source = args[:source] if args.key?(:source)\n end",
"def update_resource object, attributes\n object.update attributes\n end",
"def update(attrs)\n @attrs ||= {}\n @attrs.update(attrs)\n self\n end",
"def update\n \n end",
"def update!(**args)\n @property = args[:property] if args.key?(:property)\n @schema = args[:schema] if args.key?(:schema)\n end",
"def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def _update!\n self.class.properties.each do |property, predicate|\n if dirty?(property)\n self.class.repository_or_fail.delete([subject, predicate[:predicate], nil])\n if self.class.is_list?(property)\n repo = RDF::Repository.new\n attribute_get(property).each do |value|\n repo << RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(value, self.class.properties[property][:type]))\n end\n self.class.repository_or_fail.insert(*repo)\n else\n self.class.repository_or_fail.insert(RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(attribute_get(property), self.class.properties[property][:type])))\n end\n end\n @dirty[property] = nil\n @attributes[:original][property] = attribute_get(property)\n end\n self.class.repository_or_fail.insert(RDF::Statement.new(@subject, RDF.type, type)) unless type.nil?\n end",
"def update(attributes = {})\n super(attributes)\n retrieve!\n self\n end",
"def update\n @objects.map(&:update);\n end",
"def update\n raise NotImplementedError\n end",
"def update\n raise NotImplementedError\n end",
"def live_update!(property)\n property_class = Vebra.models[:property][:class].to_s.camelize.constantize\n\n # ensure we have the full property attributes\n property.get_property if !property.attributes[:status] && property.attributes[:action] != 'deleted'\n\n # find & update or build a new property\n property_model = property_class.find_or_initialize_by_vebra_ref(property.attributes[:vebra_ref])\n\n # make sure property object is not empty\n return false if !property.attributes || !property.attributes[:property_type]\n\n # if the property has been deleted, mark it appropriately and move on\n if property.attributes[:action] == 'deleted'\n return property_model.destroy\n end\n\n # extract accessible attributes for the property\n property_accessibles = property_class.accessible_attributes.map(&:to_sym)\n property_attributes = property.attributes.inject({}) do |result, (key, value)|\n result[key] = value if property_accessibles.include?(key)\n result\n end\n\n # update the property model's attributes\n property_model.no_callbacks = true if property_model.respond_to?(:no_callbacks)\n property_model.update_attributes(property_attributes)\n\n # find & update or build a new address\n if Vebra.models[:address]\n address_class = Vebra.models[:address][:class].to_s.camelize.constantize\n address_model = property_model.send(Vebra.models[:property][:address_method])\n address_model = property_model.send(\"build_#{Vebra.models[:property][:address_method]}\") unless address_model\n\n # extract accessible attributes for the address\n address_accessibles = address_class.accessible_attributes.map(&:to_sym)\n address_attributes = property.attributes[:address].inject({}) do |result, (key, value)|\n result[key] = value if address_accessibles.include?(key)\n result\n end\n\n # update the address model's attributes\n address_model.update_attributes(address_attributes)\n end\n\n # find & update or build new rooms\n if Vebra.models[:room]\n room_class = Vebra.models[:room][:class].to_s.camelize.constantize\n\n # accessible attributes for the rooms\n room_accessibles = room_class.accessible_attributes.map(&:to_sym)\n\n # delete any rooms which are no longer present\n property_rooms = property.attributes[:rooms] || []\n property_model_rooms = property_model.send(Vebra.models[:property][:rooms_method])\n refs_to_delete = property_model_rooms.map(&:vebra_ref) - property_rooms.map { |r| r[:vebra_ref] }\n property_model_rooms.each do |room|\n room.destroy if refs_to_delete.include?(room.vebra_ref)\n end\n\n # find & update or build new rooms\n property_rooms.each do |room|\n room_model = room_class.find_by_property_id_and_vebra_ref(property_model.id, room[:vebra_ref])\n room_model = property_model_rooms.build unless room_model\n\n # extract accessible attributes for the room\n room_attributes = room.inject({}) do |result, (key, value)|\n result[key] = value if room_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n room_model.update_attributes(room_attributes)\n end\n end\n\n # find & update or build new file attachments\n if Vebra.models[:file]\n file_class = Vebra.models[:file][:class].to_s.camelize.constantize\n\n # accessible attributes for the files\n file_accessibles = file_class.accessible_attributes.map(&:to_sym)\n\n # first normalize the collection (currently nested collections)\n property_files = property.attributes[:files].inject([]) do |result, (kind, collection)|\n collection.each do |file|\n file[:type] = kind.to_s.singularize.camelize if file_accessibles.include?(:type)\n file[\"remote_#{Vebra.models[:file][:attachment_method]}_url\".to_sym] = file.delete(:url)\n # if file[:type] is set, it means the attachment file class can be subclassed. In this\n # case we need to ensure that the subclass exists. If not, we ignore this file\n begin\n file[:type].constantize if file_accessibles.include?(:type)\n result << file\n rescue NameError => e\n # ignore - this means the subclass does not exist\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n\n result\n end\n\n # delete any files which are no longer present\n property_model_files = property_model.send(Vebra.models[:property][:files_method])\n refs_to_delete = property_model_files.map(&:vebra_ref) - property_files.map { |f| f[:vebra_ref] }\n property_model_files.each do |file|\n file.destroy if refs_to_delete.include?(file.vebra_ref)\n end\n\n # find & update or build new files\n property_files.each do |file|\n begin\n file_model = property_model_files.find_by_vebra_ref(file[:vebra_ref])\n file_model = property_model_files.build unless file_model\n\n # extract accessible attributes for the file\n file_attributes = file.inject({}) do |result, (key, value)|\n result[key] = value if file_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n file_model.update_attributes(file_attributes)\n rescue CarrierWave::ProcessingError, OpenURI::HTTPError => e\n # just ignore the file\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n end\n\n property_model.no_callbacks = false if property_model.respond_to?(:no_callbacks)\n property_model.save\n return property_model\n end",
"def update!(**args)\n @id = args[:id] if args.key?(:id)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def update\n end",
"def update!(**args)\n @mid = args[:mid] if args.key?(:mid)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def modified_properties=(value)\n @modified_properties = value\n end",
"def apply_properties!(properties)\n # Non-commutitivity etc. eventually.\n end",
"def set_properties(hash)\n hash.each do |key, value|\n add_or_remove_ostruct_member(key, value)\n end\n rest_reset_properties\n end",
"def update\n\t\t\n\t\tend",
"def set_props(props)\n @props.merge!(props)\n end",
"def update() end",
"def update!(**args)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def assign_properties\n self.properties ||= {}\n listing_properties.each do |prop|\n self.properties[prop.key] ||= prop.value\n end\n end",
"def change_properties(new_current_floor, new_next_floor, new_movement)\n @current_floor = new_current_floor\n @next_floor = new_next_floor\n @movement = new_movement\n end",
"def update!(**args)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end",
"def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end",
"def update(attributes)\n (@attributes ||= {}).merge! attributes\n\n (self.class.attr_initializables & attributes.keys).each do |name|\n instance_variable_set :\"@#{name}\", attributes[name]\n end\n\n self\n end",
"def update_attributes(attrs)\n super({})\n end",
"def update\n @dirty = true\n end",
"def update\n\n # Run through the mixin updates\n colourable_update\n movable_update\n\n end",
"def set(props)\n props.each do |prop, val|\n self.send(:\"#{ prop }=\", val)\n end\n end",
"def update\n super\n end",
"def update!(**args)\n @property_id = args[:property_id] if args.key?(:property_id)\n @value_status = args[:value_status] if args.key?(:value_status)\n end",
"def update!(**args)\n @object_size_bytes = args[:object_size_bytes] if args.key?(:object_size_bytes)\n @object_version = args[:object_version] if args.key?(:object_version)\n end",
"def movable_update\n\n # Work through the different aspects we update\n movable_location_update\n movable_size_update\n movable_angle_update\n\n end",
"def properties=(value)\n @properties = value\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(context={})\n self.pre_cast_attributes\n m2o = @relations.reject{|k, v| !self.class.many2one_relations.has_key?(k)}\n vals = @attributes.reject {|key, value| key == 'id'}.merge(m2o.merge(m2o){|k, v| v.is_a?(Array) ? v[0] : v})\n self.class.rpc_execute('write', self.id, vals, context)\n reload_from_record!(self.class.find(self.id, :context => context))\n end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update ; end",
"def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end",
"def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end",
"def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end",
"def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end",
"def update_with(attributes)\n assign_attributes(attributes)\n end",
"def update\n # don't need to update; hash is shared\n end",
"def update(attributes)\n HashProxy.with(attributes) do |proxy|\n self.class.attribute_names.each do |name|\n send(\"#{name}=\", proxy[name]) if proxy.key?(name)\n end\n end\n save\n end",
"def update!(**args)\n @object_id_prop = args[:object_id_prop] if args.key?(:object_id_prop)\n @relation = args[:relation] if args.key?(:relation)\n @subject_id = args[:subject_id] if args.key?(:subject_id)\n end",
"def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end",
"def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end",
"def update\n raise NotImplementedError\n end",
"def update_attributes attributes\n @attributes.merge! attributes\n end",
"def update!(**args)\n @async_options = args[:async_options] if args.key?(:async_options)\n @input_mappings = args[:input_mappings] if args.key?(:input_mappings)\n @name_property = args[:name_property] if args.key?(:name_property)\n @validation_options = args[:validation_options] if args.key?(:validation_options)\n end",
"def update\r\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @type = args[:type] if args.key?(:type)\n end",
"def update\n raise NotImplemented\n end",
"def update_obj\n mean, sd = rating.to_glicko_rating\n @obj.rating = mean\n @obj.rating_deviation = sd\n @obj.volatility = volatility\n end",
"def update_values\n end",
"def update_values\n end",
"def update\n raise NotImplementedError\n end",
"def update!(**args)\n @answers_header_signals = args[:answers_header_signals] if args.key?(:answers_header_signals)\n @property_value = args[:property_value] if args.key?(:property_value)\n @response_meaning_application = args[:response_meaning_application] if args.key?(:response_meaning_application)\n end",
"def update!(**args)\n @create_time = args[:create_time] if args.key?(:create_time)\n @method_prop = args[:method_prop] if args.key?(:method_prop)\n @name = args[:name] if args.key?(:name)\n @state = args[:state] if args.key?(:state)\n end",
"def update attributes, collection #:nodoc:\n 0\n end",
"def update_property_groups(roll)\n @property_groups.each { |_, v| v.update_rent(roll) }\n end",
"def update!(**args)\n @source_property = args[:source_property] if args.key?(:source_property)\n 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 update_properties(path, properties)\n prop_patch = PropPatch.new(properties)\n emit('propPatch', [path, prop_patch])\n prop_patch.commit\n\n prop_patch.result\n end",
"def update\n set_deltatime\n set_last_update_at\n end"
] | [
"0.7012263",
"0.69181895",
"0.69181895",
"0.69181895",
"0.69181895",
"0.69181895",
"0.67403597",
"0.6709326",
"0.6709326",
"0.6696149",
"0.6696149",
"0.6696149",
"0.6696149",
"0.6618882",
"0.6571848",
"0.65386343",
"0.65178275",
"0.6394807",
"0.6389745",
"0.6389745",
"0.63328",
"0.6319025",
"0.6283673",
"0.6269463",
"0.62639254",
"0.62410724",
"0.62170374",
"0.62152076",
"0.6210263",
"0.6204041",
"0.6204041",
"0.62021106",
"0.62017816",
"0.62017",
"0.61730784",
"0.61730784",
"0.6159277",
"0.6156169",
"0.61445665",
"0.6125433",
"0.61241156",
"0.6121413",
"0.6110477",
"0.6105694",
"0.61016303",
"0.60845226",
"0.6084427",
"0.6065455",
"0.6059506",
"0.6054869",
"0.6051708",
"0.6051708",
"0.60413384",
"0.6030853",
"0.6022535",
"0.6015561",
"0.59932375",
"0.59898263",
"0.5976479",
"0.5973787",
"0.59678394",
"0.5963291",
"0.5962048",
"0.5961157",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.59500545",
"0.59443134",
"0.59443134",
"0.59424853",
"0.59424853",
"0.593523",
"0.5926413",
"0.5924831",
"0.592427",
"0.59233046",
"0.59233046",
"0.5921224",
"0.59144294",
"0.59142506",
"0.58887535",
"0.58854496",
"0.5883008",
"0.58792305",
"0.5876954",
"0.5876954",
"0.58744955",
"0.5857968",
"0.5845542",
"0.5841629",
"0.58363605",
"0.5829255",
"0.582919",
"0.5822138",
"0.58208305"
] | 0.0 | -1 |
Update properties of this object | def update!(**args)
@next_page_token = args[:next_page_token] if args.key?(:next_page_token)
@unreachable = args[:unreachable] if args.key?(:unreachable)
@url_lists = args[:url_lists] if args.key?(:url_lists)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update_properties(hash)\n hash.each do |key, value|\n setter_method = \"#{key}=\"\n if self.respond_to?(setter_method)\n self.send(setter_method, value)\n end\n end\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def refresh\n self.class.base_properties.each_with_index do |prop, prop_id|\n @properties[prop] = get_property(prop_id)\n end\n refresh_features\n refresh_status\n refresh_config\n self\n end",
"def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\n end",
"def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\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 update_properties!(branch_id=nil)\n properties = fetch_properties(false, branch_id)\n length = properties.length\n counter = 0\n properties.each do |property|\n counter += 1\n if Vebra.debugging?\n puts \"[Vebra]: #{counter}/#{length}: live updating property with Vebra ref: #{property.attributes[:vebra_ref]}\"\n end\n live_update!(property)\n Vebra.set_last_updated_at(Time.now) if counter == length\n end\n end",
"def update_self obj\n obj.each do |k,v|\n instance_variable_set(\"@#{k}\", v) if v\n end\n end",
"def update_attributes(properties_hash)\n self.class.get_class_properties.each do |property|\n key = property[:name].to_sym\n if properties_hash.has_key? key\n self.setValue(properties_hash[key], forKey:key)\n end\n end\n end",
"def update\n # TODO: implement update\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @states = args[:states] if args.key?(:states)\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end",
"def update!(**args)\n @property = args[:property] if args.key?(:property)\n @total_value_count = args[:total_value_count] if args.key?(:total_value_count)\n @value = args[:value] if args.key?(:value)\n @value_status = args[:value_status] if args.key?(:value_status)\n end",
"def update\n \n end",
"def refresh\n set_attributes\n end",
"def update(attrs)\n @attrs.update(attrs)\n self\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @source = args[:source] if args.key?(:source)\n end",
"def update_resource object, attributes\n object.update attributes\n end",
"def update(attrs)\n @attrs ||= {}\n @attrs.update(attrs)\n self\n end",
"def update\n \n end",
"def update!(**args)\n @property = args[:property] if args.key?(:property)\n @schema = args[:schema] if args.key?(:schema)\n end",
"def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def update(attributes = {})\n super(attributes)\n retrieve!\n self\n end",
"def _update!\n self.class.properties.each do |property, predicate|\n if dirty?(property)\n self.class.repository_or_fail.delete([subject, predicate[:predicate], nil])\n if self.class.is_list?(property)\n repo = RDF::Repository.new\n attribute_get(property).each do |value|\n repo << RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(value, self.class.properties[property][:type]))\n end\n self.class.repository_or_fail.insert(*repo)\n else\n self.class.repository_or_fail.insert(RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(attribute_get(property), self.class.properties[property][:type])))\n end\n end\n @dirty[property] = nil\n @attributes[:original][property] = attribute_get(property)\n end\n self.class.repository_or_fail.insert(RDF::Statement.new(@subject, RDF.type, type)) unless type.nil?\n end",
"def update\n @objects.map(&:update);\n end",
"def update\n raise NotImplementedError\n end",
"def update\n raise NotImplementedError\n end",
"def live_update!(property)\n property_class = Vebra.models[:property][:class].to_s.camelize.constantize\n\n # ensure we have the full property attributes\n property.get_property if !property.attributes[:status] && property.attributes[:action] != 'deleted'\n\n # find & update or build a new property\n property_model = property_class.find_or_initialize_by_vebra_ref(property.attributes[:vebra_ref])\n\n # make sure property object is not empty\n return false if !property.attributes || !property.attributes[:property_type]\n\n # if the property has been deleted, mark it appropriately and move on\n if property.attributes[:action] == 'deleted'\n return property_model.destroy\n end\n\n # extract accessible attributes for the property\n property_accessibles = property_class.accessible_attributes.map(&:to_sym)\n property_attributes = property.attributes.inject({}) do |result, (key, value)|\n result[key] = value if property_accessibles.include?(key)\n result\n end\n\n # update the property model's attributes\n property_model.no_callbacks = true if property_model.respond_to?(:no_callbacks)\n property_model.update_attributes(property_attributes)\n\n # find & update or build a new address\n if Vebra.models[:address]\n address_class = Vebra.models[:address][:class].to_s.camelize.constantize\n address_model = property_model.send(Vebra.models[:property][:address_method])\n address_model = property_model.send(\"build_#{Vebra.models[:property][:address_method]}\") unless address_model\n\n # extract accessible attributes for the address\n address_accessibles = address_class.accessible_attributes.map(&:to_sym)\n address_attributes = property.attributes[:address].inject({}) do |result, (key, value)|\n result[key] = value if address_accessibles.include?(key)\n result\n end\n\n # update the address model's attributes\n address_model.update_attributes(address_attributes)\n end\n\n # find & update or build new rooms\n if Vebra.models[:room]\n room_class = Vebra.models[:room][:class].to_s.camelize.constantize\n\n # accessible attributes for the rooms\n room_accessibles = room_class.accessible_attributes.map(&:to_sym)\n\n # delete any rooms which are no longer present\n property_rooms = property.attributes[:rooms] || []\n property_model_rooms = property_model.send(Vebra.models[:property][:rooms_method])\n refs_to_delete = property_model_rooms.map(&:vebra_ref) - property_rooms.map { |r| r[:vebra_ref] }\n property_model_rooms.each do |room|\n room.destroy if refs_to_delete.include?(room.vebra_ref)\n end\n\n # find & update or build new rooms\n property_rooms.each do |room|\n room_model = room_class.find_by_property_id_and_vebra_ref(property_model.id, room[:vebra_ref])\n room_model = property_model_rooms.build unless room_model\n\n # extract accessible attributes for the room\n room_attributes = room.inject({}) do |result, (key, value)|\n result[key] = value if room_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n room_model.update_attributes(room_attributes)\n end\n end\n\n # find & update or build new file attachments\n if Vebra.models[:file]\n file_class = Vebra.models[:file][:class].to_s.camelize.constantize\n\n # accessible attributes for the files\n file_accessibles = file_class.accessible_attributes.map(&:to_sym)\n\n # first normalize the collection (currently nested collections)\n property_files = property.attributes[:files].inject([]) do |result, (kind, collection)|\n collection.each do |file|\n file[:type] = kind.to_s.singularize.camelize if file_accessibles.include?(:type)\n file[\"remote_#{Vebra.models[:file][:attachment_method]}_url\".to_sym] = file.delete(:url)\n # if file[:type] is set, it means the attachment file class can be subclassed. In this\n # case we need to ensure that the subclass exists. If not, we ignore this file\n begin\n file[:type].constantize if file_accessibles.include?(:type)\n result << file\n rescue NameError => e\n # ignore - this means the subclass does not exist\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n\n result\n end\n\n # delete any files which are no longer present\n property_model_files = property_model.send(Vebra.models[:property][:files_method])\n refs_to_delete = property_model_files.map(&:vebra_ref) - property_files.map { |f| f[:vebra_ref] }\n property_model_files.each do |file|\n file.destroy if refs_to_delete.include?(file.vebra_ref)\n end\n\n # find & update or build new files\n property_files.each do |file|\n begin\n file_model = property_model_files.find_by_vebra_ref(file[:vebra_ref])\n file_model = property_model_files.build unless file_model\n\n # extract accessible attributes for the file\n file_attributes = file.inject({}) do |result, (key, value)|\n result[key] = value if file_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n file_model.update_attributes(file_attributes)\n rescue CarrierWave::ProcessingError, OpenURI::HTTPError => e\n # just ignore the file\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n end\n\n property_model.no_callbacks = false if property_model.respond_to?(:no_callbacks)\n property_model.save\n return property_model\n end",
"def update!(**args)\n @id = args[:id] if args.key?(:id)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def update\n end",
"def update!(**args)\n @mid = args[:mid] if args.key?(:mid)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def modified_properties=(value)\n @modified_properties = value\n end",
"def apply_properties!(properties)\n # Non-commutitivity etc. eventually.\n end",
"def set_properties(hash)\n hash.each do |key, value|\n add_or_remove_ostruct_member(key, value)\n end\n rest_reset_properties\n end",
"def update\n\t\t\n\t\tend",
"def set_props(props)\n @props.merge!(props)\n end",
"def update() end",
"def update!(**args)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def assign_properties\n self.properties ||= {}\n listing_properties.each do |prop|\n self.properties[prop.key] ||= prop.value\n end\n end",
"def change_properties(new_current_floor, new_next_floor, new_movement)\n @current_floor = new_current_floor\n @next_floor = new_next_floor\n @movement = new_movement\n end",
"def update!(**args)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end",
"def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end",
"def update(attributes)\n (@attributes ||= {}).merge! attributes\n\n (self.class.attr_initializables & attributes.keys).each do |name|\n instance_variable_set :\"@#{name}\", attributes[name]\n end\n\n self\n end",
"def update_attributes(attrs)\n super({})\n end",
"def update\n @dirty = true\n end",
"def update\n\n # Run through the mixin updates\n colourable_update\n movable_update\n\n end",
"def set(props)\n props.each do |prop, val|\n self.send(:\"#{ prop }=\", val)\n end\n end",
"def update\n super\n end",
"def update!(**args)\n @property_id = args[:property_id] if args.key?(:property_id)\n @value_status = args[:value_status] if args.key?(:value_status)\n end",
"def update!(**args)\n @object_size_bytes = args[:object_size_bytes] if args.key?(:object_size_bytes)\n @object_version = args[:object_version] if args.key?(:object_version)\n end",
"def movable_update\n\n # Work through the different aspects we update\n movable_location_update\n movable_size_update\n movable_angle_update\n\n end",
"def properties=(value)\n @properties = value\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(context={})\n self.pre_cast_attributes\n m2o = @relations.reject{|k, v| !self.class.many2one_relations.has_key?(k)}\n vals = @attributes.reject {|key, value| key == 'id'}.merge(m2o.merge(m2o){|k, v| v.is_a?(Array) ? v[0] : v})\n self.class.rpc_execute('write', self.id, vals, context)\n reload_from_record!(self.class.find(self.id, :context => context))\n end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update ; end",
"def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end",
"def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end",
"def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end",
"def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end",
"def update_with(attributes)\n assign_attributes(attributes)\n end",
"def update\n # don't need to update; hash is shared\n end",
"def update(attributes)\n HashProxy.with(attributes) do |proxy|\n self.class.attribute_names.each do |name|\n send(\"#{name}=\", proxy[name]) if proxy.key?(name)\n end\n end\n save\n end",
"def update!(**args)\n @object_id_prop = args[:object_id_prop] if args.key?(:object_id_prop)\n @relation = args[:relation] if args.key?(:relation)\n @subject_id = args[:subject_id] if args.key?(:subject_id)\n end",
"def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end",
"def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end",
"def update\n raise NotImplementedError\n end",
"def update_attributes attributes\n @attributes.merge! attributes\n end",
"def update!(**args)\n @async_options = args[:async_options] if args.key?(:async_options)\n @input_mappings = args[:input_mappings] if args.key?(:input_mappings)\n @name_property = args[:name_property] if args.key?(:name_property)\n @validation_options = args[:validation_options] if args.key?(:validation_options)\n end",
"def update\r\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @type = args[:type] if args.key?(:type)\n end",
"def update\n raise NotImplemented\n end",
"def update_obj\n mean, sd = rating.to_glicko_rating\n @obj.rating = mean\n @obj.rating_deviation = sd\n @obj.volatility = volatility\n end",
"def update_values\n end",
"def update_values\n end",
"def update\n raise NotImplementedError\n end",
"def update!(**args)\n @answers_header_signals = args[:answers_header_signals] if args.key?(:answers_header_signals)\n @property_value = args[:property_value] if args.key?(:property_value)\n @response_meaning_application = args[:response_meaning_application] if args.key?(:response_meaning_application)\n end",
"def update!(**args)\n @create_time = args[:create_time] if args.key?(:create_time)\n @method_prop = args[:method_prop] if args.key?(:method_prop)\n @name = args[:name] if args.key?(:name)\n @state = args[:state] if args.key?(:state)\n end",
"def update attributes, collection #:nodoc:\n 0\n end",
"def update_property_groups(roll)\n @property_groups.each { |_, v| v.update_rent(roll) }\n 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 update!(**args)\n @source_property = args[:source_property] if args.key?(:source_property)\n end",
"def update_properties(path, properties)\n prop_patch = PropPatch.new(properties)\n emit('propPatch', [path, prop_patch])\n prop_patch.commit\n\n prop_patch.result\n end",
"def update\n set_deltatime\n set_last_update_at\n end"
] | [
"0.7012568",
"0.6918917",
"0.6918917",
"0.6918917",
"0.6918917",
"0.6918917",
"0.67404634",
"0.6709981",
"0.6709981",
"0.66964126",
"0.66964126",
"0.66964126",
"0.66964126",
"0.6619218",
"0.6570895",
"0.6539287",
"0.6517026",
"0.63946927",
"0.63901657",
"0.63901657",
"0.63328683",
"0.6318612",
"0.62846893",
"0.62692374",
"0.6264273",
"0.6241163",
"0.6216599",
"0.6214641",
"0.6210363",
"0.6203827",
"0.6203827",
"0.620312",
"0.6201905",
"0.62001497",
"0.61728275",
"0.61728275",
"0.6159924",
"0.61569315",
"0.61442953",
"0.61260897",
"0.6125199",
"0.61227936",
"0.61111224",
"0.610543",
"0.6102925",
"0.60839343",
"0.6083609",
"0.6066973",
"0.60602766",
"0.6055065",
"0.6051568",
"0.6051568",
"0.6042057",
"0.60319084",
"0.60221004",
"0.60149413",
"0.5994295",
"0.5989816",
"0.597674",
"0.5973157",
"0.5967343",
"0.5965598",
"0.59629464",
"0.59618354",
"0.5950329",
"0.5950329",
"0.5950329",
"0.5950329",
"0.5950329",
"0.5950329",
"0.5950329",
"0.5950329",
"0.59495455",
"0.59442014",
"0.59442014",
"0.5944142",
"0.5944142",
"0.59361076",
"0.5925741",
"0.5925574",
"0.59250593",
"0.5924476",
"0.5924476",
"0.5921039",
"0.59155524",
"0.59145254",
"0.5888445",
"0.58860934",
"0.5882302",
"0.5879913",
"0.5877467",
"0.5877467",
"0.58743787",
"0.585829",
"0.584583",
"0.58408254",
"0.5835501",
"0.5829063",
"0.5828611",
"0.58228916",
"0.5819882"
] | 0.0 | -1 |
Update properties of this object | def update!(**args)
@display_name = args[:display_name] if args.key?(:display_name)
@labels = args[:labels] if args.key?(:labels)
@location_id = args[:location_id] if args.key?(:location_id)
@metadata = args[:metadata] if args.key?(:metadata)
@name = args[:name] if args.key?(:name)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update_properties(hash)\n hash.each do |key, value|\n setter_method = \"#{key}=\"\n if self.respond_to?(setter_method)\n self.send(setter_method, value)\n end\n end\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def refresh\n self.class.base_properties.each_with_index do |prop, prop_id|\n @properties[prop] = get_property(prop_id)\n end\n refresh_features\n refresh_status\n refresh_config\n self\n end",
"def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\n end",
"def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\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 update_properties!(branch_id=nil)\n properties = fetch_properties(false, branch_id)\n length = properties.length\n counter = 0\n properties.each do |property|\n counter += 1\n if Vebra.debugging?\n puts \"[Vebra]: #{counter}/#{length}: live updating property with Vebra ref: #{property.attributes[:vebra_ref]}\"\n end\n live_update!(property)\n Vebra.set_last_updated_at(Time.now) if counter == length\n end\n end",
"def update_self obj\n obj.each do |k,v|\n instance_variable_set(\"@#{k}\", v) if v\n end\n end",
"def update_attributes(properties_hash)\n self.class.get_class_properties.each do |property|\n key = property[:name].to_sym\n if properties_hash.has_key? key\n self.setValue(properties_hash[key], forKey:key)\n end\n end\n end",
"def update\n # TODO: implement update\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @states = args[:states] if args.key?(:states)\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end",
"def update!(**args)\n @property = args[:property] if args.key?(:property)\n @total_value_count = args[:total_value_count] if args.key?(:total_value_count)\n @value = args[:value] if args.key?(:value)\n @value_status = args[:value_status] if args.key?(:value_status)\n end",
"def update\n \n end",
"def refresh\n set_attributes\n end",
"def update(attrs)\n @attrs.update(attrs)\n self\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @source = args[:source] if args.key?(:source)\n end",
"def update_resource object, attributes\n object.update attributes\n end",
"def update(attrs)\n @attrs ||= {}\n @attrs.update(attrs)\n self\n end",
"def update\n \n end",
"def update!(**args)\n @property = args[:property] if args.key?(:property)\n @schema = args[:schema] if args.key?(:schema)\n end",
"def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def _update!\n self.class.properties.each do |property, predicate|\n if dirty?(property)\n self.class.repository_or_fail.delete([subject, predicate[:predicate], nil])\n if self.class.is_list?(property)\n repo = RDF::Repository.new\n attribute_get(property).each do |value|\n repo << RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(value, self.class.properties[property][:type]))\n end\n self.class.repository_or_fail.insert(*repo)\n else\n self.class.repository_or_fail.insert(RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(attribute_get(property), self.class.properties[property][:type])))\n end\n end\n @dirty[property] = nil\n @attributes[:original][property] = attribute_get(property)\n end\n self.class.repository_or_fail.insert(RDF::Statement.new(@subject, RDF.type, type)) unless type.nil?\n end",
"def update(attributes = {})\n super(attributes)\n retrieve!\n self\n end",
"def update\n @objects.map(&:update);\n end",
"def update\n raise NotImplementedError\n end",
"def update\n raise NotImplementedError\n end",
"def live_update!(property)\n property_class = Vebra.models[:property][:class].to_s.camelize.constantize\n\n # ensure we have the full property attributes\n property.get_property if !property.attributes[:status] && property.attributes[:action] != 'deleted'\n\n # find & update or build a new property\n property_model = property_class.find_or_initialize_by_vebra_ref(property.attributes[:vebra_ref])\n\n # make sure property object is not empty\n return false if !property.attributes || !property.attributes[:property_type]\n\n # if the property has been deleted, mark it appropriately and move on\n if property.attributes[:action] == 'deleted'\n return property_model.destroy\n end\n\n # extract accessible attributes for the property\n property_accessibles = property_class.accessible_attributes.map(&:to_sym)\n property_attributes = property.attributes.inject({}) do |result, (key, value)|\n result[key] = value if property_accessibles.include?(key)\n result\n end\n\n # update the property model's attributes\n property_model.no_callbacks = true if property_model.respond_to?(:no_callbacks)\n property_model.update_attributes(property_attributes)\n\n # find & update or build a new address\n if Vebra.models[:address]\n address_class = Vebra.models[:address][:class].to_s.camelize.constantize\n address_model = property_model.send(Vebra.models[:property][:address_method])\n address_model = property_model.send(\"build_#{Vebra.models[:property][:address_method]}\") unless address_model\n\n # extract accessible attributes for the address\n address_accessibles = address_class.accessible_attributes.map(&:to_sym)\n address_attributes = property.attributes[:address].inject({}) do |result, (key, value)|\n result[key] = value if address_accessibles.include?(key)\n result\n end\n\n # update the address model's attributes\n address_model.update_attributes(address_attributes)\n end\n\n # find & update or build new rooms\n if Vebra.models[:room]\n room_class = Vebra.models[:room][:class].to_s.camelize.constantize\n\n # accessible attributes for the rooms\n room_accessibles = room_class.accessible_attributes.map(&:to_sym)\n\n # delete any rooms which are no longer present\n property_rooms = property.attributes[:rooms] || []\n property_model_rooms = property_model.send(Vebra.models[:property][:rooms_method])\n refs_to_delete = property_model_rooms.map(&:vebra_ref) - property_rooms.map { |r| r[:vebra_ref] }\n property_model_rooms.each do |room|\n room.destroy if refs_to_delete.include?(room.vebra_ref)\n end\n\n # find & update or build new rooms\n property_rooms.each do |room|\n room_model = room_class.find_by_property_id_and_vebra_ref(property_model.id, room[:vebra_ref])\n room_model = property_model_rooms.build unless room_model\n\n # extract accessible attributes for the room\n room_attributes = room.inject({}) do |result, (key, value)|\n result[key] = value if room_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n room_model.update_attributes(room_attributes)\n end\n end\n\n # find & update or build new file attachments\n if Vebra.models[:file]\n file_class = Vebra.models[:file][:class].to_s.camelize.constantize\n\n # accessible attributes for the files\n file_accessibles = file_class.accessible_attributes.map(&:to_sym)\n\n # first normalize the collection (currently nested collections)\n property_files = property.attributes[:files].inject([]) do |result, (kind, collection)|\n collection.each do |file|\n file[:type] = kind.to_s.singularize.camelize if file_accessibles.include?(:type)\n file[\"remote_#{Vebra.models[:file][:attachment_method]}_url\".to_sym] = file.delete(:url)\n # if file[:type] is set, it means the attachment file class can be subclassed. In this\n # case we need to ensure that the subclass exists. If not, we ignore this file\n begin\n file[:type].constantize if file_accessibles.include?(:type)\n result << file\n rescue NameError => e\n # ignore - this means the subclass does not exist\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n\n result\n end\n\n # delete any files which are no longer present\n property_model_files = property_model.send(Vebra.models[:property][:files_method])\n refs_to_delete = property_model_files.map(&:vebra_ref) - property_files.map { |f| f[:vebra_ref] }\n property_model_files.each do |file|\n file.destroy if refs_to_delete.include?(file.vebra_ref)\n end\n\n # find & update or build new files\n property_files.each do |file|\n begin\n file_model = property_model_files.find_by_vebra_ref(file[:vebra_ref])\n file_model = property_model_files.build unless file_model\n\n # extract accessible attributes for the file\n file_attributes = file.inject({}) do |result, (key, value)|\n result[key] = value if file_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n file_model.update_attributes(file_attributes)\n rescue CarrierWave::ProcessingError, OpenURI::HTTPError => e\n # just ignore the file\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n end\n\n property_model.no_callbacks = false if property_model.respond_to?(:no_callbacks)\n property_model.save\n return property_model\n end",
"def update!(**args)\n @id = args[:id] if args.key?(:id)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def update\n end",
"def update!(**args)\n @mid = args[:mid] if args.key?(:mid)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def modified_properties=(value)\n @modified_properties = value\n end",
"def apply_properties!(properties)\n # Non-commutitivity etc. eventually.\n end",
"def set_properties(hash)\n hash.each do |key, value|\n add_or_remove_ostruct_member(key, value)\n end\n rest_reset_properties\n end",
"def update\n\t\t\n\t\tend",
"def set_props(props)\n @props.merge!(props)\n end",
"def update() end",
"def update!(**args)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def assign_properties\n self.properties ||= {}\n listing_properties.each do |prop|\n self.properties[prop.key] ||= prop.value\n end\n end",
"def change_properties(new_current_floor, new_next_floor, new_movement)\n @current_floor = new_current_floor\n @next_floor = new_next_floor\n @movement = new_movement\n end",
"def update!(**args)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end",
"def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end",
"def update(attributes)\n (@attributes ||= {}).merge! attributes\n\n (self.class.attr_initializables & attributes.keys).each do |name|\n instance_variable_set :\"@#{name}\", attributes[name]\n end\n\n self\n end",
"def update_attributes(attrs)\n super({})\n end",
"def update\n @dirty = true\n end",
"def update\n\n # Run through the mixin updates\n colourable_update\n movable_update\n\n end",
"def set(props)\n props.each do |prop, val|\n self.send(:\"#{ prop }=\", val)\n end\n end",
"def update\n super\n end",
"def update!(**args)\n @property_id = args[:property_id] if args.key?(:property_id)\n @value_status = args[:value_status] if args.key?(:value_status)\n end",
"def update!(**args)\n @object_size_bytes = args[:object_size_bytes] if args.key?(:object_size_bytes)\n @object_version = args[:object_version] if args.key?(:object_version)\n end",
"def movable_update\n\n # Work through the different aspects we update\n movable_location_update\n movable_size_update\n movable_angle_update\n\n end",
"def properties=(value)\n @properties = value\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(context={})\n self.pre_cast_attributes\n m2o = @relations.reject{|k, v| !self.class.many2one_relations.has_key?(k)}\n vals = @attributes.reject {|key, value| key == 'id'}.merge(m2o.merge(m2o){|k, v| v.is_a?(Array) ? v[0] : v})\n self.class.rpc_execute('write', self.id, vals, context)\n reload_from_record!(self.class.find(self.id, :context => context))\n end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update ; end",
"def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end",
"def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end",
"def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end",
"def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end",
"def update_with(attributes)\n assign_attributes(attributes)\n end",
"def update\n # don't need to update; hash is shared\n end",
"def update(attributes)\n HashProxy.with(attributes) do |proxy|\n self.class.attribute_names.each do |name|\n send(\"#{name}=\", proxy[name]) if proxy.key?(name)\n end\n end\n save\n end",
"def update!(**args)\n @object_id_prop = args[:object_id_prop] if args.key?(:object_id_prop)\n @relation = args[:relation] if args.key?(:relation)\n @subject_id = args[:subject_id] if args.key?(:subject_id)\n end",
"def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end",
"def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end",
"def update\n raise NotImplementedError\n end",
"def update_attributes attributes\n @attributes.merge! attributes\n end",
"def update!(**args)\n @async_options = args[:async_options] if args.key?(:async_options)\n @input_mappings = args[:input_mappings] if args.key?(:input_mappings)\n @name_property = args[:name_property] if args.key?(:name_property)\n @validation_options = args[:validation_options] if args.key?(:validation_options)\n end",
"def update\r\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @type = args[:type] if args.key?(:type)\n end",
"def update\n raise NotImplemented\n end",
"def update_obj\n mean, sd = rating.to_glicko_rating\n @obj.rating = mean\n @obj.rating_deviation = sd\n @obj.volatility = volatility\n end",
"def update_values\n end",
"def update_values\n end",
"def update\n raise NotImplementedError\n end",
"def update!(**args)\n @answers_header_signals = args[:answers_header_signals] if args.key?(:answers_header_signals)\n @property_value = args[:property_value] if args.key?(:property_value)\n @response_meaning_application = args[:response_meaning_application] if args.key?(:response_meaning_application)\n end",
"def update!(**args)\n @create_time = args[:create_time] if args.key?(:create_time)\n @method_prop = args[:method_prop] if args.key?(:method_prop)\n @name = args[:name] if args.key?(:name)\n @state = args[:state] if args.key?(:state)\n end",
"def update attributes, collection #:nodoc:\n 0\n end",
"def update_property_groups(roll)\n @property_groups.each { |_, v| v.update_rent(roll) }\n end",
"def update!(**args)\n @source_property = args[:source_property] if args.key?(:source_property)\n 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 update_properties(path, properties)\n prop_patch = PropPatch.new(properties)\n emit('propPatch', [path, prop_patch])\n prop_patch.commit\n\n prop_patch.result\n end",
"def update\n set_deltatime\n set_last_update_at\n end"
] | [
"0.7012263",
"0.69181895",
"0.69181895",
"0.69181895",
"0.69181895",
"0.69181895",
"0.67403597",
"0.6709326",
"0.6709326",
"0.6696149",
"0.6696149",
"0.6696149",
"0.6696149",
"0.6618882",
"0.6571848",
"0.65386343",
"0.65178275",
"0.6394807",
"0.6389745",
"0.6389745",
"0.63328",
"0.6319025",
"0.6283673",
"0.6269463",
"0.62639254",
"0.62410724",
"0.62170374",
"0.62152076",
"0.6210263",
"0.6204041",
"0.6204041",
"0.62021106",
"0.62017816",
"0.62017",
"0.61730784",
"0.61730784",
"0.6159277",
"0.6156169",
"0.61445665",
"0.6125433",
"0.61241156",
"0.6121413",
"0.6110477",
"0.6105694",
"0.61016303",
"0.60845226",
"0.6084427",
"0.6065455",
"0.6059506",
"0.6054869",
"0.6051708",
"0.6051708",
"0.60413384",
"0.6030853",
"0.6022535",
"0.6015561",
"0.59932375",
"0.59898263",
"0.5976479",
"0.5973787",
"0.59678394",
"0.5963291",
"0.5962048",
"0.5961157",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.59500545",
"0.59443134",
"0.59443134",
"0.59424853",
"0.59424853",
"0.593523",
"0.5926413",
"0.5924831",
"0.592427",
"0.59233046",
"0.59233046",
"0.5921224",
"0.59144294",
"0.59142506",
"0.58887535",
"0.58854496",
"0.5883008",
"0.58792305",
"0.5876954",
"0.5876954",
"0.58744955",
"0.5857968",
"0.5845542",
"0.5841629",
"0.58363605",
"0.5829255",
"0.582919",
"0.5822138",
"0.58208305"
] | 0.0 | -1 |
Update properties of this object | def update!(**args)
@client_validation_ca = args[:client_validation_ca] if args.key?(:client_validation_ca)
@client_validation_mode = args[:client_validation_mode] if args.key?(:client_validation_mode)
@client_validation_trust_config = args[:client_validation_trust_config] if args.key?(:client_validation_trust_config)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update_properties(hash)\n hash.each do |key, value|\n setter_method = \"#{key}=\"\n if self.respond_to?(setter_method)\n self.send(setter_method, value)\n end\n end\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def refresh\n self.class.base_properties.each_with_index do |prop, prop_id|\n @properties[prop] = get_property(prop_id)\n end\n refresh_features\n refresh_status\n refresh_config\n self\n end",
"def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\n end",
"def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\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 update_properties!(branch_id=nil)\n properties = fetch_properties(false, branch_id)\n length = properties.length\n counter = 0\n properties.each do |property|\n counter += 1\n if Vebra.debugging?\n puts \"[Vebra]: #{counter}/#{length}: live updating property with Vebra ref: #{property.attributes[:vebra_ref]}\"\n end\n live_update!(property)\n Vebra.set_last_updated_at(Time.now) if counter == length\n end\n end",
"def update_self obj\n obj.each do |k,v|\n instance_variable_set(\"@#{k}\", v) if v\n end\n end",
"def update_attributes(properties_hash)\n self.class.get_class_properties.each do |property|\n key = property[:name].to_sym\n if properties_hash.has_key? key\n self.setValue(properties_hash[key], forKey:key)\n end\n end\n end",
"def update\n # TODO: implement update\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @states = args[:states] if args.key?(:states)\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end",
"def update!(**args)\n @property = args[:property] if args.key?(:property)\n @total_value_count = args[:total_value_count] if args.key?(:total_value_count)\n @value = args[:value] if args.key?(:value)\n @value_status = args[:value_status] if args.key?(:value_status)\n end",
"def update\n \n end",
"def refresh\n set_attributes\n end",
"def update(attrs)\n @attrs.update(attrs)\n self\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @source = args[:source] if args.key?(:source)\n end",
"def update_resource object, attributes\n object.update attributes\n end",
"def update(attrs)\n @attrs ||= {}\n @attrs.update(attrs)\n self\n end",
"def update\n \n end",
"def update!(**args)\n @property = args[:property] if args.key?(:property)\n @schema = args[:schema] if args.key?(:schema)\n end",
"def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def _update!\n self.class.properties.each do |property, predicate|\n if dirty?(property)\n self.class.repository_or_fail.delete([subject, predicate[:predicate], nil])\n if self.class.is_list?(property)\n repo = RDF::Repository.new\n attribute_get(property).each do |value|\n repo << RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(value, self.class.properties[property][:type]))\n end\n self.class.repository_or_fail.insert(*repo)\n else\n self.class.repository_or_fail.insert(RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(attribute_get(property), self.class.properties[property][:type])))\n end\n end\n @dirty[property] = nil\n @attributes[:original][property] = attribute_get(property)\n end\n self.class.repository_or_fail.insert(RDF::Statement.new(@subject, RDF.type, type)) unless type.nil?\n end",
"def update(attributes = {})\n super(attributes)\n retrieve!\n self\n end",
"def update\n @objects.map(&:update);\n end",
"def update\n raise NotImplementedError\n end",
"def update\n raise NotImplementedError\n end",
"def live_update!(property)\n property_class = Vebra.models[:property][:class].to_s.camelize.constantize\n\n # ensure we have the full property attributes\n property.get_property if !property.attributes[:status] && property.attributes[:action] != 'deleted'\n\n # find & update or build a new property\n property_model = property_class.find_or_initialize_by_vebra_ref(property.attributes[:vebra_ref])\n\n # make sure property object is not empty\n return false if !property.attributes || !property.attributes[:property_type]\n\n # if the property has been deleted, mark it appropriately and move on\n if property.attributes[:action] == 'deleted'\n return property_model.destroy\n end\n\n # extract accessible attributes for the property\n property_accessibles = property_class.accessible_attributes.map(&:to_sym)\n property_attributes = property.attributes.inject({}) do |result, (key, value)|\n result[key] = value if property_accessibles.include?(key)\n result\n end\n\n # update the property model's attributes\n property_model.no_callbacks = true if property_model.respond_to?(:no_callbacks)\n property_model.update_attributes(property_attributes)\n\n # find & update or build a new address\n if Vebra.models[:address]\n address_class = Vebra.models[:address][:class].to_s.camelize.constantize\n address_model = property_model.send(Vebra.models[:property][:address_method])\n address_model = property_model.send(\"build_#{Vebra.models[:property][:address_method]}\") unless address_model\n\n # extract accessible attributes for the address\n address_accessibles = address_class.accessible_attributes.map(&:to_sym)\n address_attributes = property.attributes[:address].inject({}) do |result, (key, value)|\n result[key] = value if address_accessibles.include?(key)\n result\n end\n\n # update the address model's attributes\n address_model.update_attributes(address_attributes)\n end\n\n # find & update or build new rooms\n if Vebra.models[:room]\n room_class = Vebra.models[:room][:class].to_s.camelize.constantize\n\n # accessible attributes for the rooms\n room_accessibles = room_class.accessible_attributes.map(&:to_sym)\n\n # delete any rooms which are no longer present\n property_rooms = property.attributes[:rooms] || []\n property_model_rooms = property_model.send(Vebra.models[:property][:rooms_method])\n refs_to_delete = property_model_rooms.map(&:vebra_ref) - property_rooms.map { |r| r[:vebra_ref] }\n property_model_rooms.each do |room|\n room.destroy if refs_to_delete.include?(room.vebra_ref)\n end\n\n # find & update or build new rooms\n property_rooms.each do |room|\n room_model = room_class.find_by_property_id_and_vebra_ref(property_model.id, room[:vebra_ref])\n room_model = property_model_rooms.build unless room_model\n\n # extract accessible attributes for the room\n room_attributes = room.inject({}) do |result, (key, value)|\n result[key] = value if room_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n room_model.update_attributes(room_attributes)\n end\n end\n\n # find & update or build new file attachments\n if Vebra.models[:file]\n file_class = Vebra.models[:file][:class].to_s.camelize.constantize\n\n # accessible attributes for the files\n file_accessibles = file_class.accessible_attributes.map(&:to_sym)\n\n # first normalize the collection (currently nested collections)\n property_files = property.attributes[:files].inject([]) do |result, (kind, collection)|\n collection.each do |file|\n file[:type] = kind.to_s.singularize.camelize if file_accessibles.include?(:type)\n file[\"remote_#{Vebra.models[:file][:attachment_method]}_url\".to_sym] = file.delete(:url)\n # if file[:type] is set, it means the attachment file class can be subclassed. In this\n # case we need to ensure that the subclass exists. If not, we ignore this file\n begin\n file[:type].constantize if file_accessibles.include?(:type)\n result << file\n rescue NameError => e\n # ignore - this means the subclass does not exist\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n\n result\n end\n\n # delete any files which are no longer present\n property_model_files = property_model.send(Vebra.models[:property][:files_method])\n refs_to_delete = property_model_files.map(&:vebra_ref) - property_files.map { |f| f[:vebra_ref] }\n property_model_files.each do |file|\n file.destroy if refs_to_delete.include?(file.vebra_ref)\n end\n\n # find & update or build new files\n property_files.each do |file|\n begin\n file_model = property_model_files.find_by_vebra_ref(file[:vebra_ref])\n file_model = property_model_files.build unless file_model\n\n # extract accessible attributes for the file\n file_attributes = file.inject({}) do |result, (key, value)|\n result[key] = value if file_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n file_model.update_attributes(file_attributes)\n rescue CarrierWave::ProcessingError, OpenURI::HTTPError => e\n # just ignore the file\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n end\n\n property_model.no_callbacks = false if property_model.respond_to?(:no_callbacks)\n property_model.save\n return property_model\n end",
"def update!(**args)\n @id = args[:id] if args.key?(:id)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def update\n end",
"def update!(**args)\n @mid = args[:mid] if args.key?(:mid)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def modified_properties=(value)\n @modified_properties = value\n end",
"def apply_properties!(properties)\n # Non-commutitivity etc. eventually.\n end",
"def set_properties(hash)\n hash.each do |key, value|\n add_or_remove_ostruct_member(key, value)\n end\n rest_reset_properties\n end",
"def update\n\t\t\n\t\tend",
"def set_props(props)\n @props.merge!(props)\n end",
"def update() end",
"def update!(**args)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def assign_properties\n self.properties ||= {}\n listing_properties.each do |prop|\n self.properties[prop.key] ||= prop.value\n end\n end",
"def change_properties(new_current_floor, new_next_floor, new_movement)\n @current_floor = new_current_floor\n @next_floor = new_next_floor\n @movement = new_movement\n end",
"def update!(**args)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end",
"def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end",
"def update(attributes)\n (@attributes ||= {}).merge! attributes\n\n (self.class.attr_initializables & attributes.keys).each do |name|\n instance_variable_set :\"@#{name}\", attributes[name]\n end\n\n self\n end",
"def update_attributes(attrs)\n super({})\n end",
"def update\n @dirty = true\n end",
"def update\n\n # Run through the mixin updates\n colourable_update\n movable_update\n\n end",
"def set(props)\n props.each do |prop, val|\n self.send(:\"#{ prop }=\", val)\n end\n end",
"def update\n super\n end",
"def update!(**args)\n @property_id = args[:property_id] if args.key?(:property_id)\n @value_status = args[:value_status] if args.key?(:value_status)\n end",
"def update!(**args)\n @object_size_bytes = args[:object_size_bytes] if args.key?(:object_size_bytes)\n @object_version = args[:object_version] if args.key?(:object_version)\n end",
"def movable_update\n\n # Work through the different aspects we update\n movable_location_update\n movable_size_update\n movable_angle_update\n\n end",
"def properties=(value)\n @properties = value\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(context={})\n self.pre_cast_attributes\n m2o = @relations.reject{|k, v| !self.class.many2one_relations.has_key?(k)}\n vals = @attributes.reject {|key, value| key == 'id'}.merge(m2o.merge(m2o){|k, v| v.is_a?(Array) ? v[0] : v})\n self.class.rpc_execute('write', self.id, vals, context)\n reload_from_record!(self.class.find(self.id, :context => context))\n end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update ; end",
"def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end",
"def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end",
"def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end",
"def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end",
"def update_with(attributes)\n assign_attributes(attributes)\n end",
"def update\n # don't need to update; hash is shared\n end",
"def update(attributes)\n HashProxy.with(attributes) do |proxy|\n self.class.attribute_names.each do |name|\n send(\"#{name}=\", proxy[name]) if proxy.key?(name)\n end\n end\n save\n end",
"def update!(**args)\n @object_id_prop = args[:object_id_prop] if args.key?(:object_id_prop)\n @relation = args[:relation] if args.key?(:relation)\n @subject_id = args[:subject_id] if args.key?(:subject_id)\n end",
"def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end",
"def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end",
"def update\n raise NotImplementedError\n end",
"def update_attributes attributes\n @attributes.merge! attributes\n end",
"def update!(**args)\n @async_options = args[:async_options] if args.key?(:async_options)\n @input_mappings = args[:input_mappings] if args.key?(:input_mappings)\n @name_property = args[:name_property] if args.key?(:name_property)\n @validation_options = args[:validation_options] if args.key?(:validation_options)\n end",
"def update\r\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @type = args[:type] if args.key?(:type)\n end",
"def update\n raise NotImplemented\n end",
"def update_obj\n mean, sd = rating.to_glicko_rating\n @obj.rating = mean\n @obj.rating_deviation = sd\n @obj.volatility = volatility\n end",
"def update_values\n end",
"def update_values\n end",
"def update\n raise NotImplementedError\n end",
"def update!(**args)\n @answers_header_signals = args[:answers_header_signals] if args.key?(:answers_header_signals)\n @property_value = args[:property_value] if args.key?(:property_value)\n @response_meaning_application = args[:response_meaning_application] if args.key?(:response_meaning_application)\n end",
"def update!(**args)\n @create_time = args[:create_time] if args.key?(:create_time)\n @method_prop = args[:method_prop] if args.key?(:method_prop)\n @name = args[:name] if args.key?(:name)\n @state = args[:state] if args.key?(:state)\n end",
"def update attributes, collection #:nodoc:\n 0\n end",
"def update_property_groups(roll)\n @property_groups.each { |_, v| v.update_rent(roll) }\n end",
"def update!(**args)\n @source_property = args[:source_property] if args.key?(:source_property)\n 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 update_properties(path, properties)\n prop_patch = PropPatch.new(properties)\n emit('propPatch', [path, prop_patch])\n prop_patch.commit\n\n prop_patch.result\n end",
"def update\n set_deltatime\n set_last_update_at\n end"
] | [
"0.7012263",
"0.69181895",
"0.69181895",
"0.69181895",
"0.69181895",
"0.69181895",
"0.67403597",
"0.6709326",
"0.6709326",
"0.6696149",
"0.6696149",
"0.6696149",
"0.6696149",
"0.6618882",
"0.6571848",
"0.65386343",
"0.65178275",
"0.6394807",
"0.6389745",
"0.6389745",
"0.63328",
"0.6319025",
"0.6283673",
"0.6269463",
"0.62639254",
"0.62410724",
"0.62170374",
"0.62152076",
"0.6210263",
"0.6204041",
"0.6204041",
"0.62021106",
"0.62017816",
"0.62017",
"0.61730784",
"0.61730784",
"0.6159277",
"0.6156169",
"0.61445665",
"0.6125433",
"0.61241156",
"0.6121413",
"0.6110477",
"0.6105694",
"0.61016303",
"0.60845226",
"0.6084427",
"0.6065455",
"0.6059506",
"0.6054869",
"0.6051708",
"0.6051708",
"0.60413384",
"0.6030853",
"0.6022535",
"0.6015561",
"0.59932375",
"0.59898263",
"0.5976479",
"0.5973787",
"0.59678394",
"0.5963291",
"0.5962048",
"0.5961157",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.59500545",
"0.59443134",
"0.59443134",
"0.59424853",
"0.59424853",
"0.593523",
"0.5926413",
"0.5924831",
"0.592427",
"0.59233046",
"0.59233046",
"0.5921224",
"0.59144294",
"0.59142506",
"0.58887535",
"0.58854496",
"0.5883008",
"0.58792305",
"0.5876954",
"0.5876954",
"0.58744955",
"0.5857968",
"0.5845542",
"0.5841629",
"0.58363605",
"0.5829255",
"0.582919",
"0.5822138",
"0.58208305"
] | 0.0 | -1 |
Update properties of this object | def update!(**args)
@done = args[:done] if args.key?(:done)
@error = args[:error] if args.key?(:error)
@metadata = args[:metadata] if args.key?(:metadata)
@name = args[:name] if args.key?(:name)
@response = args[:response] if args.key?(:response)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update_properties(hash)\n hash.each do |key, value|\n setter_method = \"#{key}=\"\n if self.respond_to?(setter_method)\n self.send(setter_method, value)\n end\n end\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def refresh\n self.class.base_properties.each_with_index do |prop, prop_id|\n @properties[prop] = get_property(prop_id)\n end\n refresh_features\n refresh_status\n refresh_config\n self\n end",
"def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\n end",
"def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\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 update_properties!(branch_id=nil)\n properties = fetch_properties(false, branch_id)\n length = properties.length\n counter = 0\n properties.each do |property|\n counter += 1\n if Vebra.debugging?\n puts \"[Vebra]: #{counter}/#{length}: live updating property with Vebra ref: #{property.attributes[:vebra_ref]}\"\n end\n live_update!(property)\n Vebra.set_last_updated_at(Time.now) if counter == length\n end\n end",
"def update_self obj\n obj.each do |k,v|\n instance_variable_set(\"@#{k}\", v) if v\n end\n end",
"def update_attributes(properties_hash)\n self.class.get_class_properties.each do |property|\n key = property[:name].to_sym\n if properties_hash.has_key? key\n self.setValue(properties_hash[key], forKey:key)\n end\n end\n end",
"def update\n # TODO: implement update\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @states = args[:states] if args.key?(:states)\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end",
"def update!(**args)\n @property = args[:property] if args.key?(:property)\n @total_value_count = args[:total_value_count] if args.key?(:total_value_count)\n @value = args[:value] if args.key?(:value)\n @value_status = args[:value_status] if args.key?(:value_status)\n end",
"def update\n \n end",
"def refresh\n set_attributes\n end",
"def update(attrs)\n @attrs.update(attrs)\n self\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @source = args[:source] if args.key?(:source)\n end",
"def update_resource object, attributes\n object.update attributes\n end",
"def update(attrs)\n @attrs ||= {}\n @attrs.update(attrs)\n self\n end",
"def update\n \n end",
"def update!(**args)\n @property = args[:property] if args.key?(:property)\n @schema = args[:schema] if args.key?(:schema)\n end",
"def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def _update!\n self.class.properties.each do |property, predicate|\n if dirty?(property)\n self.class.repository_or_fail.delete([subject, predicate[:predicate], nil])\n if self.class.is_list?(property)\n repo = RDF::Repository.new\n attribute_get(property).each do |value|\n repo << RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(value, self.class.properties[property][:type]))\n end\n self.class.repository_or_fail.insert(*repo)\n else\n self.class.repository_or_fail.insert(RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(attribute_get(property), self.class.properties[property][:type])))\n end\n end\n @dirty[property] = nil\n @attributes[:original][property] = attribute_get(property)\n end\n self.class.repository_or_fail.insert(RDF::Statement.new(@subject, RDF.type, type)) unless type.nil?\n end",
"def update(attributes = {})\n super(attributes)\n retrieve!\n self\n end",
"def update\n @objects.map(&:update);\n end",
"def update\n raise NotImplementedError\n end",
"def update\n raise NotImplementedError\n end",
"def live_update!(property)\n property_class = Vebra.models[:property][:class].to_s.camelize.constantize\n\n # ensure we have the full property attributes\n property.get_property if !property.attributes[:status] && property.attributes[:action] != 'deleted'\n\n # find & update or build a new property\n property_model = property_class.find_or_initialize_by_vebra_ref(property.attributes[:vebra_ref])\n\n # make sure property object is not empty\n return false if !property.attributes || !property.attributes[:property_type]\n\n # if the property has been deleted, mark it appropriately and move on\n if property.attributes[:action] == 'deleted'\n return property_model.destroy\n end\n\n # extract accessible attributes for the property\n property_accessibles = property_class.accessible_attributes.map(&:to_sym)\n property_attributes = property.attributes.inject({}) do |result, (key, value)|\n result[key] = value if property_accessibles.include?(key)\n result\n end\n\n # update the property model's attributes\n property_model.no_callbacks = true if property_model.respond_to?(:no_callbacks)\n property_model.update_attributes(property_attributes)\n\n # find & update or build a new address\n if Vebra.models[:address]\n address_class = Vebra.models[:address][:class].to_s.camelize.constantize\n address_model = property_model.send(Vebra.models[:property][:address_method])\n address_model = property_model.send(\"build_#{Vebra.models[:property][:address_method]}\") unless address_model\n\n # extract accessible attributes for the address\n address_accessibles = address_class.accessible_attributes.map(&:to_sym)\n address_attributes = property.attributes[:address].inject({}) do |result, (key, value)|\n result[key] = value if address_accessibles.include?(key)\n result\n end\n\n # update the address model's attributes\n address_model.update_attributes(address_attributes)\n end\n\n # find & update or build new rooms\n if Vebra.models[:room]\n room_class = Vebra.models[:room][:class].to_s.camelize.constantize\n\n # accessible attributes for the rooms\n room_accessibles = room_class.accessible_attributes.map(&:to_sym)\n\n # delete any rooms which are no longer present\n property_rooms = property.attributes[:rooms] || []\n property_model_rooms = property_model.send(Vebra.models[:property][:rooms_method])\n refs_to_delete = property_model_rooms.map(&:vebra_ref) - property_rooms.map { |r| r[:vebra_ref] }\n property_model_rooms.each do |room|\n room.destroy if refs_to_delete.include?(room.vebra_ref)\n end\n\n # find & update or build new rooms\n property_rooms.each do |room|\n room_model = room_class.find_by_property_id_and_vebra_ref(property_model.id, room[:vebra_ref])\n room_model = property_model_rooms.build unless room_model\n\n # extract accessible attributes for the room\n room_attributes = room.inject({}) do |result, (key, value)|\n result[key] = value if room_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n room_model.update_attributes(room_attributes)\n end\n end\n\n # find & update or build new file attachments\n if Vebra.models[:file]\n file_class = Vebra.models[:file][:class].to_s.camelize.constantize\n\n # accessible attributes for the files\n file_accessibles = file_class.accessible_attributes.map(&:to_sym)\n\n # first normalize the collection (currently nested collections)\n property_files = property.attributes[:files].inject([]) do |result, (kind, collection)|\n collection.each do |file|\n file[:type] = kind.to_s.singularize.camelize if file_accessibles.include?(:type)\n file[\"remote_#{Vebra.models[:file][:attachment_method]}_url\".to_sym] = file.delete(:url)\n # if file[:type] is set, it means the attachment file class can be subclassed. In this\n # case we need to ensure that the subclass exists. If not, we ignore this file\n begin\n file[:type].constantize if file_accessibles.include?(:type)\n result << file\n rescue NameError => e\n # ignore - this means the subclass does not exist\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n\n result\n end\n\n # delete any files which are no longer present\n property_model_files = property_model.send(Vebra.models[:property][:files_method])\n refs_to_delete = property_model_files.map(&:vebra_ref) - property_files.map { |f| f[:vebra_ref] }\n property_model_files.each do |file|\n file.destroy if refs_to_delete.include?(file.vebra_ref)\n end\n\n # find & update or build new files\n property_files.each do |file|\n begin\n file_model = property_model_files.find_by_vebra_ref(file[:vebra_ref])\n file_model = property_model_files.build unless file_model\n\n # extract accessible attributes for the file\n file_attributes = file.inject({}) do |result, (key, value)|\n result[key] = value if file_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n file_model.update_attributes(file_attributes)\n rescue CarrierWave::ProcessingError, OpenURI::HTTPError => e\n # just ignore the file\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n end\n\n property_model.no_callbacks = false if property_model.respond_to?(:no_callbacks)\n property_model.save\n return property_model\n end",
"def update!(**args)\n @id = args[:id] if args.key?(:id)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def update\n end",
"def update!(**args)\n @mid = args[:mid] if args.key?(:mid)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def modified_properties=(value)\n @modified_properties = value\n end",
"def apply_properties!(properties)\n # Non-commutitivity etc. eventually.\n end",
"def set_properties(hash)\n hash.each do |key, value|\n add_or_remove_ostruct_member(key, value)\n end\n rest_reset_properties\n end",
"def update\n\t\t\n\t\tend",
"def set_props(props)\n @props.merge!(props)\n end",
"def update() end",
"def update!(**args)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def assign_properties\n self.properties ||= {}\n listing_properties.each do |prop|\n self.properties[prop.key] ||= prop.value\n end\n end",
"def change_properties(new_current_floor, new_next_floor, new_movement)\n @current_floor = new_current_floor\n @next_floor = new_next_floor\n @movement = new_movement\n end",
"def update!(**args)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end",
"def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end",
"def update(attributes)\n (@attributes ||= {}).merge! attributes\n\n (self.class.attr_initializables & attributes.keys).each do |name|\n instance_variable_set :\"@#{name}\", attributes[name]\n end\n\n self\n end",
"def update_attributes(attrs)\n super({})\n end",
"def update\n @dirty = true\n end",
"def update\n\n # Run through the mixin updates\n colourable_update\n movable_update\n\n end",
"def set(props)\n props.each do |prop, val|\n self.send(:\"#{ prop }=\", val)\n end\n end",
"def update\n super\n end",
"def update!(**args)\n @property_id = args[:property_id] if args.key?(:property_id)\n @value_status = args[:value_status] if args.key?(:value_status)\n end",
"def update!(**args)\n @object_size_bytes = args[:object_size_bytes] if args.key?(:object_size_bytes)\n @object_version = args[:object_version] if args.key?(:object_version)\n end",
"def movable_update\n\n # Work through the different aspects we update\n movable_location_update\n movable_size_update\n movable_angle_update\n\n end",
"def properties=(value)\n @properties = value\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(context={})\n self.pre_cast_attributes\n m2o = @relations.reject{|k, v| !self.class.many2one_relations.has_key?(k)}\n vals = @attributes.reject {|key, value| key == 'id'}.merge(m2o.merge(m2o){|k, v| v.is_a?(Array) ? v[0] : v})\n self.class.rpc_execute('write', self.id, vals, context)\n reload_from_record!(self.class.find(self.id, :context => context))\n end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update ; end",
"def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end",
"def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end",
"def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end",
"def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end",
"def update_with(attributes)\n assign_attributes(attributes)\n end",
"def update\n # don't need to update; hash is shared\n end",
"def update(attributes)\n HashProxy.with(attributes) do |proxy|\n self.class.attribute_names.each do |name|\n send(\"#{name}=\", proxy[name]) if proxy.key?(name)\n end\n end\n save\n end",
"def update!(**args)\n @object_id_prop = args[:object_id_prop] if args.key?(:object_id_prop)\n @relation = args[:relation] if args.key?(:relation)\n @subject_id = args[:subject_id] if args.key?(:subject_id)\n end",
"def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end",
"def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end",
"def update\n raise NotImplementedError\n end",
"def update_attributes attributes\n @attributes.merge! attributes\n end",
"def update!(**args)\n @async_options = args[:async_options] if args.key?(:async_options)\n @input_mappings = args[:input_mappings] if args.key?(:input_mappings)\n @name_property = args[:name_property] if args.key?(:name_property)\n @validation_options = args[:validation_options] if args.key?(:validation_options)\n end",
"def update\r\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @type = args[:type] if args.key?(:type)\n end",
"def update\n raise NotImplemented\n end",
"def update_obj\n mean, sd = rating.to_glicko_rating\n @obj.rating = mean\n @obj.rating_deviation = sd\n @obj.volatility = volatility\n end",
"def update_values\n end",
"def update_values\n end",
"def update\n raise NotImplementedError\n end",
"def update!(**args)\n @answers_header_signals = args[:answers_header_signals] if args.key?(:answers_header_signals)\n @property_value = args[:property_value] if args.key?(:property_value)\n @response_meaning_application = args[:response_meaning_application] if args.key?(:response_meaning_application)\n end",
"def update!(**args)\n @create_time = args[:create_time] if args.key?(:create_time)\n @method_prop = args[:method_prop] if args.key?(:method_prop)\n @name = args[:name] if args.key?(:name)\n @state = args[:state] if args.key?(:state)\n end",
"def update attributes, collection #:nodoc:\n 0\n end",
"def update_property_groups(roll)\n @property_groups.each { |_, v| v.update_rent(roll) }\n end",
"def update!(**args)\n @source_property = args[:source_property] if args.key?(:source_property)\n 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 update_properties(path, properties)\n prop_patch = PropPatch.new(properties)\n emit('propPatch', [path, prop_patch])\n prop_patch.commit\n\n prop_patch.result\n end",
"def update\n set_deltatime\n set_last_update_at\n end"
] | [
"0.7012263",
"0.69181895",
"0.69181895",
"0.69181895",
"0.69181895",
"0.69181895",
"0.67403597",
"0.6709326",
"0.6709326",
"0.6696149",
"0.6696149",
"0.6696149",
"0.6696149",
"0.6618882",
"0.6571848",
"0.65386343",
"0.65178275",
"0.6394807",
"0.6389745",
"0.6389745",
"0.63328",
"0.6319025",
"0.6283673",
"0.6269463",
"0.62639254",
"0.62410724",
"0.62170374",
"0.62152076",
"0.6210263",
"0.6204041",
"0.6204041",
"0.62021106",
"0.62017816",
"0.62017",
"0.61730784",
"0.61730784",
"0.6159277",
"0.6156169",
"0.61445665",
"0.6125433",
"0.61241156",
"0.6121413",
"0.6110477",
"0.6105694",
"0.61016303",
"0.60845226",
"0.6084427",
"0.6065455",
"0.6059506",
"0.6054869",
"0.6051708",
"0.6051708",
"0.60413384",
"0.6030853",
"0.6022535",
"0.6015561",
"0.59932375",
"0.59898263",
"0.5976479",
"0.5973787",
"0.59678394",
"0.5963291",
"0.5962048",
"0.5961157",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.59500545",
"0.59443134",
"0.59443134",
"0.59424853",
"0.59424853",
"0.593523",
"0.5926413",
"0.5924831",
"0.592427",
"0.59233046",
"0.59233046",
"0.5921224",
"0.59144294",
"0.59142506",
"0.58887535",
"0.58854496",
"0.5883008",
"0.58792305",
"0.5876954",
"0.5876954",
"0.58744955",
"0.5857968",
"0.5845542",
"0.5841629",
"0.58363605",
"0.5829255",
"0.582919",
"0.5822138",
"0.58208305"
] | 0.0 | -1 |
Update properties of this object | def update!(**args)
@api_version = args[:api_version] if args.key?(:api_version)
@create_time = args[:create_time] if args.key?(:create_time)
@end_time = args[:end_time] if args.key?(:end_time)
@requested_cancellation = args[:requested_cancellation] if args.key?(:requested_cancellation)
@status_message = args[:status_message] if args.key?(:status_message)
@target = args[:target] if args.key?(:target)
@verb = args[:verb] if args.key?(:verb)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update_properties(hash)\n hash.each do |key, value|\n setter_method = \"#{key}=\"\n if self.respond_to?(setter_method)\n self.send(setter_method, value)\n end\n end\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def refresh\n self.class.base_properties.each_with_index do |prop, prop_id|\n @properties[prop] = get_property(prop_id)\n end\n refresh_features\n refresh_status\n refresh_config\n self\n end",
"def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\n end",
"def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\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 update_properties!(branch_id=nil)\n properties = fetch_properties(false, branch_id)\n length = properties.length\n counter = 0\n properties.each do |property|\n counter += 1\n if Vebra.debugging?\n puts \"[Vebra]: #{counter}/#{length}: live updating property with Vebra ref: #{property.attributes[:vebra_ref]}\"\n end\n live_update!(property)\n Vebra.set_last_updated_at(Time.now) if counter == length\n end\n end",
"def update_self obj\n obj.each do |k,v|\n instance_variable_set(\"@#{k}\", v) if v\n end\n end",
"def update_attributes(properties_hash)\n self.class.get_class_properties.each do |property|\n key = property[:name].to_sym\n if properties_hash.has_key? key\n self.setValue(properties_hash[key], forKey:key)\n end\n end\n end",
"def update\n # TODO: implement update\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @states = args[:states] if args.key?(:states)\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end",
"def update!(**args)\n @property = args[:property] if args.key?(:property)\n @total_value_count = args[:total_value_count] if args.key?(:total_value_count)\n @value = args[:value] if args.key?(:value)\n @value_status = args[:value_status] if args.key?(:value_status)\n end",
"def update\n \n end",
"def refresh\n set_attributes\n end",
"def update(attrs)\n @attrs.update(attrs)\n self\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @source = args[:source] if args.key?(:source)\n end",
"def update_resource object, attributes\n object.update attributes\n end",
"def update(attrs)\n @attrs ||= {}\n @attrs.update(attrs)\n self\n end",
"def update\n \n end",
"def update!(**args)\n @property = args[:property] if args.key?(:property)\n @schema = args[:schema] if args.key?(:schema)\n end",
"def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def update(attributes = {})\n super(attributes)\n retrieve!\n self\n end",
"def _update!\n self.class.properties.each do |property, predicate|\n if dirty?(property)\n self.class.repository_or_fail.delete([subject, predicate[:predicate], nil])\n if self.class.is_list?(property)\n repo = RDF::Repository.new\n attribute_get(property).each do |value|\n repo << RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(value, self.class.properties[property][:type]))\n end\n self.class.repository_or_fail.insert(*repo)\n else\n self.class.repository_or_fail.insert(RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(attribute_get(property), self.class.properties[property][:type])))\n end\n end\n @dirty[property] = nil\n @attributes[:original][property] = attribute_get(property)\n end\n self.class.repository_or_fail.insert(RDF::Statement.new(@subject, RDF.type, type)) unless type.nil?\n end",
"def update\n @objects.map(&:update);\n end",
"def update\n raise NotImplementedError\n end",
"def update\n raise NotImplementedError\n end",
"def live_update!(property)\n property_class = Vebra.models[:property][:class].to_s.camelize.constantize\n\n # ensure we have the full property attributes\n property.get_property if !property.attributes[:status] && property.attributes[:action] != 'deleted'\n\n # find & update or build a new property\n property_model = property_class.find_or_initialize_by_vebra_ref(property.attributes[:vebra_ref])\n\n # make sure property object is not empty\n return false if !property.attributes || !property.attributes[:property_type]\n\n # if the property has been deleted, mark it appropriately and move on\n if property.attributes[:action] == 'deleted'\n return property_model.destroy\n end\n\n # extract accessible attributes for the property\n property_accessibles = property_class.accessible_attributes.map(&:to_sym)\n property_attributes = property.attributes.inject({}) do |result, (key, value)|\n result[key] = value if property_accessibles.include?(key)\n result\n end\n\n # update the property model's attributes\n property_model.no_callbacks = true if property_model.respond_to?(:no_callbacks)\n property_model.update_attributes(property_attributes)\n\n # find & update or build a new address\n if Vebra.models[:address]\n address_class = Vebra.models[:address][:class].to_s.camelize.constantize\n address_model = property_model.send(Vebra.models[:property][:address_method])\n address_model = property_model.send(\"build_#{Vebra.models[:property][:address_method]}\") unless address_model\n\n # extract accessible attributes for the address\n address_accessibles = address_class.accessible_attributes.map(&:to_sym)\n address_attributes = property.attributes[:address].inject({}) do |result, (key, value)|\n result[key] = value if address_accessibles.include?(key)\n result\n end\n\n # update the address model's attributes\n address_model.update_attributes(address_attributes)\n end\n\n # find & update or build new rooms\n if Vebra.models[:room]\n room_class = Vebra.models[:room][:class].to_s.camelize.constantize\n\n # accessible attributes for the rooms\n room_accessibles = room_class.accessible_attributes.map(&:to_sym)\n\n # delete any rooms which are no longer present\n property_rooms = property.attributes[:rooms] || []\n property_model_rooms = property_model.send(Vebra.models[:property][:rooms_method])\n refs_to_delete = property_model_rooms.map(&:vebra_ref) - property_rooms.map { |r| r[:vebra_ref] }\n property_model_rooms.each do |room|\n room.destroy if refs_to_delete.include?(room.vebra_ref)\n end\n\n # find & update or build new rooms\n property_rooms.each do |room|\n room_model = room_class.find_by_property_id_and_vebra_ref(property_model.id, room[:vebra_ref])\n room_model = property_model_rooms.build unless room_model\n\n # extract accessible attributes for the room\n room_attributes = room.inject({}) do |result, (key, value)|\n result[key] = value if room_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n room_model.update_attributes(room_attributes)\n end\n end\n\n # find & update or build new file attachments\n if Vebra.models[:file]\n file_class = Vebra.models[:file][:class].to_s.camelize.constantize\n\n # accessible attributes for the files\n file_accessibles = file_class.accessible_attributes.map(&:to_sym)\n\n # first normalize the collection (currently nested collections)\n property_files = property.attributes[:files].inject([]) do |result, (kind, collection)|\n collection.each do |file|\n file[:type] = kind.to_s.singularize.camelize if file_accessibles.include?(:type)\n file[\"remote_#{Vebra.models[:file][:attachment_method]}_url\".to_sym] = file.delete(:url)\n # if file[:type] is set, it means the attachment file class can be subclassed. In this\n # case we need to ensure that the subclass exists. If not, we ignore this file\n begin\n file[:type].constantize if file_accessibles.include?(:type)\n result << file\n rescue NameError => e\n # ignore - this means the subclass does not exist\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n\n result\n end\n\n # delete any files which are no longer present\n property_model_files = property_model.send(Vebra.models[:property][:files_method])\n refs_to_delete = property_model_files.map(&:vebra_ref) - property_files.map { |f| f[:vebra_ref] }\n property_model_files.each do |file|\n file.destroy if refs_to_delete.include?(file.vebra_ref)\n end\n\n # find & update or build new files\n property_files.each do |file|\n begin\n file_model = property_model_files.find_by_vebra_ref(file[:vebra_ref])\n file_model = property_model_files.build unless file_model\n\n # extract accessible attributes for the file\n file_attributes = file.inject({}) do |result, (key, value)|\n result[key] = value if file_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n file_model.update_attributes(file_attributes)\n rescue CarrierWave::ProcessingError, OpenURI::HTTPError => e\n # just ignore the file\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n end\n\n property_model.no_callbacks = false if property_model.respond_to?(:no_callbacks)\n property_model.save\n return property_model\n end",
"def update!(**args)\n @id = args[:id] if args.key?(:id)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def update\n end",
"def update!(**args)\n @mid = args[:mid] if args.key?(:mid)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def modified_properties=(value)\n @modified_properties = value\n end",
"def apply_properties!(properties)\n # Non-commutitivity etc. eventually.\n end",
"def set_properties(hash)\n hash.each do |key, value|\n add_or_remove_ostruct_member(key, value)\n end\n rest_reset_properties\n end",
"def update\n\t\t\n\t\tend",
"def set_props(props)\n @props.merge!(props)\n end",
"def update() end",
"def update!(**args)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def assign_properties\n self.properties ||= {}\n listing_properties.each do |prop|\n self.properties[prop.key] ||= prop.value\n end\n end",
"def change_properties(new_current_floor, new_next_floor, new_movement)\n @current_floor = new_current_floor\n @next_floor = new_next_floor\n @movement = new_movement\n end",
"def update!(**args)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end",
"def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end",
"def update(attributes)\n (@attributes ||= {}).merge! attributes\n\n (self.class.attr_initializables & attributes.keys).each do |name|\n instance_variable_set :\"@#{name}\", attributes[name]\n end\n\n self\n end",
"def update_attributes(attrs)\n super({})\n end",
"def update\n @dirty = true\n end",
"def update\n\n # Run through the mixin updates\n colourable_update\n movable_update\n\n end",
"def set(props)\n props.each do |prop, val|\n self.send(:\"#{ prop }=\", val)\n end\n end",
"def update\n super\n end",
"def update!(**args)\n @property_id = args[:property_id] if args.key?(:property_id)\n @value_status = args[:value_status] if args.key?(:value_status)\n end",
"def update!(**args)\n @object_size_bytes = args[:object_size_bytes] if args.key?(:object_size_bytes)\n @object_version = args[:object_version] if args.key?(:object_version)\n end",
"def movable_update\n\n # Work through the different aspects we update\n movable_location_update\n movable_size_update\n movable_angle_update\n\n end",
"def properties=(value)\n @properties = value\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(context={})\n self.pre_cast_attributes\n m2o = @relations.reject{|k, v| !self.class.many2one_relations.has_key?(k)}\n vals = @attributes.reject {|key, value| key == 'id'}.merge(m2o.merge(m2o){|k, v| v.is_a?(Array) ? v[0] : v})\n self.class.rpc_execute('write', self.id, vals, context)\n reload_from_record!(self.class.find(self.id, :context => context))\n end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update ; end",
"def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end",
"def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end",
"def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end",
"def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end",
"def update_with(attributes)\n assign_attributes(attributes)\n end",
"def update\n # don't need to update; hash is shared\n end",
"def update(attributes)\n HashProxy.with(attributes) do |proxy|\n self.class.attribute_names.each do |name|\n send(\"#{name}=\", proxy[name]) if proxy.key?(name)\n end\n end\n save\n end",
"def update!(**args)\n @object_id_prop = args[:object_id_prop] if args.key?(:object_id_prop)\n @relation = args[:relation] if args.key?(:relation)\n @subject_id = args[:subject_id] if args.key?(:subject_id)\n end",
"def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end",
"def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end",
"def update\n raise NotImplementedError\n end",
"def update_attributes attributes\n @attributes.merge! attributes\n end",
"def update!(**args)\n @async_options = args[:async_options] if args.key?(:async_options)\n @input_mappings = args[:input_mappings] if args.key?(:input_mappings)\n @name_property = args[:name_property] if args.key?(:name_property)\n @validation_options = args[:validation_options] if args.key?(:validation_options)\n end",
"def update\r\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @type = args[:type] if args.key?(:type)\n end",
"def update\n raise NotImplemented\n end",
"def update_obj\n mean, sd = rating.to_glicko_rating\n @obj.rating = mean\n @obj.rating_deviation = sd\n @obj.volatility = volatility\n end",
"def update_values\n end",
"def update_values\n end",
"def update\n raise NotImplementedError\n end",
"def update!(**args)\n @answers_header_signals = args[:answers_header_signals] if args.key?(:answers_header_signals)\n @property_value = args[:property_value] if args.key?(:property_value)\n @response_meaning_application = args[:response_meaning_application] if args.key?(:response_meaning_application)\n end",
"def update!(**args)\n @create_time = args[:create_time] if args.key?(:create_time)\n @method_prop = args[:method_prop] if args.key?(:method_prop)\n @name = args[:name] if args.key?(:name)\n @state = args[:state] if args.key?(:state)\n end",
"def update attributes, collection #:nodoc:\n 0\n end",
"def update_property_groups(roll)\n @property_groups.each { |_, v| v.update_rent(roll) }\n 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 update!(**args)\n @source_property = args[:source_property] if args.key?(:source_property)\n end",
"def update_properties(path, properties)\n prop_patch = PropPatch.new(properties)\n emit('propPatch', [path, prop_patch])\n prop_patch.commit\n\n prop_patch.result\n end",
"def update\n set_deltatime\n set_last_update_at\n end"
] | [
"0.7012568",
"0.6918917",
"0.6918917",
"0.6918917",
"0.6918917",
"0.6918917",
"0.67404634",
"0.6709981",
"0.6709981",
"0.66964126",
"0.66964126",
"0.66964126",
"0.66964126",
"0.6619218",
"0.6570895",
"0.6539287",
"0.6517026",
"0.63946927",
"0.63901657",
"0.63901657",
"0.63328683",
"0.6318612",
"0.62846893",
"0.62692374",
"0.6264273",
"0.6241163",
"0.6216599",
"0.6214641",
"0.6210363",
"0.6203827",
"0.6203827",
"0.620312",
"0.6201905",
"0.62001497",
"0.61728275",
"0.61728275",
"0.6159924",
"0.61569315",
"0.61442953",
"0.61260897",
"0.6125199",
"0.61227936",
"0.61111224",
"0.610543",
"0.6102925",
"0.60839343",
"0.6083609",
"0.6066973",
"0.60602766",
"0.6055065",
"0.6051568",
"0.6051568",
"0.6042057",
"0.60319084",
"0.60221004",
"0.60149413",
"0.5994295",
"0.5989816",
"0.597674",
"0.5973157",
"0.5967343",
"0.5965598",
"0.59629464",
"0.59618354",
"0.5950329",
"0.5950329",
"0.5950329",
"0.5950329",
"0.5950329",
"0.5950329",
"0.5950329",
"0.5950329",
"0.59495455",
"0.59442014",
"0.59442014",
"0.5944142",
"0.5944142",
"0.59361076",
"0.5925741",
"0.5925574",
"0.59250593",
"0.5924476",
"0.5924476",
"0.5921039",
"0.59155524",
"0.59145254",
"0.5888445",
"0.58860934",
"0.5882302",
"0.5879913",
"0.5877467",
"0.5877467",
"0.58743787",
"0.585829",
"0.584583",
"0.58408254",
"0.5835501",
"0.5829063",
"0.5828611",
"0.58228916",
"0.5819882"
] | 0.0 | -1 |
Update properties of this object | def update!(**args)
@items = args[:items] if args.key?(:items)
@request_id = args[:request_id] if args.key?(:request_id)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update_properties(hash)\n hash.each do |key, value|\n setter_method = \"#{key}=\"\n if self.respond_to?(setter_method)\n self.send(setter_method, value)\n end\n end\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def refresh\n self.class.base_properties.each_with_index do |prop, prop_id|\n @properties[prop] = get_property(prop_id)\n end\n refresh_features\n refresh_status\n refresh_config\n self\n end",
"def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\n end",
"def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\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 update_properties!(branch_id=nil)\n properties = fetch_properties(false, branch_id)\n length = properties.length\n counter = 0\n properties.each do |property|\n counter += 1\n if Vebra.debugging?\n puts \"[Vebra]: #{counter}/#{length}: live updating property with Vebra ref: #{property.attributes[:vebra_ref]}\"\n end\n live_update!(property)\n Vebra.set_last_updated_at(Time.now) if counter == length\n end\n end",
"def update_self obj\n obj.each do |k,v|\n instance_variable_set(\"@#{k}\", v) if v\n end\n end",
"def update_attributes(properties_hash)\n self.class.get_class_properties.each do |property|\n key = property[:name].to_sym\n if properties_hash.has_key? key\n self.setValue(properties_hash[key], forKey:key)\n end\n end\n end",
"def update\n # TODO: implement update\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @states = args[:states] if args.key?(:states)\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end",
"def update!(**args)\n @property = args[:property] if args.key?(:property)\n @total_value_count = args[:total_value_count] if args.key?(:total_value_count)\n @value = args[:value] if args.key?(:value)\n @value_status = args[:value_status] if args.key?(:value_status)\n end",
"def update\n \n end",
"def refresh\n set_attributes\n end",
"def update(attrs)\n @attrs.update(attrs)\n self\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @source = args[:source] if args.key?(:source)\n end",
"def update_resource object, attributes\n object.update attributes\n end",
"def update(attrs)\n @attrs ||= {}\n @attrs.update(attrs)\n self\n end",
"def update\n \n end",
"def update!(**args)\n @property = args[:property] if args.key?(:property)\n @schema = args[:schema] if args.key?(:schema)\n end",
"def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def _update!\n self.class.properties.each do |property, predicate|\n if dirty?(property)\n self.class.repository_or_fail.delete([subject, predicate[:predicate], nil])\n if self.class.is_list?(property)\n repo = RDF::Repository.new\n attribute_get(property).each do |value|\n repo << RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(value, self.class.properties[property][:type]))\n end\n self.class.repository_or_fail.insert(*repo)\n else\n self.class.repository_or_fail.insert(RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(attribute_get(property), self.class.properties[property][:type])))\n end\n end\n @dirty[property] = nil\n @attributes[:original][property] = attribute_get(property)\n end\n self.class.repository_or_fail.insert(RDF::Statement.new(@subject, RDF.type, type)) unless type.nil?\n end",
"def update(attributes = {})\n super(attributes)\n retrieve!\n self\n end",
"def update\n @objects.map(&:update);\n end",
"def update\n raise NotImplementedError\n end",
"def update\n raise NotImplementedError\n end",
"def live_update!(property)\n property_class = Vebra.models[:property][:class].to_s.camelize.constantize\n\n # ensure we have the full property attributes\n property.get_property if !property.attributes[:status] && property.attributes[:action] != 'deleted'\n\n # find & update or build a new property\n property_model = property_class.find_or_initialize_by_vebra_ref(property.attributes[:vebra_ref])\n\n # make sure property object is not empty\n return false if !property.attributes || !property.attributes[:property_type]\n\n # if the property has been deleted, mark it appropriately and move on\n if property.attributes[:action] == 'deleted'\n return property_model.destroy\n end\n\n # extract accessible attributes for the property\n property_accessibles = property_class.accessible_attributes.map(&:to_sym)\n property_attributes = property.attributes.inject({}) do |result, (key, value)|\n result[key] = value if property_accessibles.include?(key)\n result\n end\n\n # update the property model's attributes\n property_model.no_callbacks = true if property_model.respond_to?(:no_callbacks)\n property_model.update_attributes(property_attributes)\n\n # find & update or build a new address\n if Vebra.models[:address]\n address_class = Vebra.models[:address][:class].to_s.camelize.constantize\n address_model = property_model.send(Vebra.models[:property][:address_method])\n address_model = property_model.send(\"build_#{Vebra.models[:property][:address_method]}\") unless address_model\n\n # extract accessible attributes for the address\n address_accessibles = address_class.accessible_attributes.map(&:to_sym)\n address_attributes = property.attributes[:address].inject({}) do |result, (key, value)|\n result[key] = value if address_accessibles.include?(key)\n result\n end\n\n # update the address model's attributes\n address_model.update_attributes(address_attributes)\n end\n\n # find & update or build new rooms\n if Vebra.models[:room]\n room_class = Vebra.models[:room][:class].to_s.camelize.constantize\n\n # accessible attributes for the rooms\n room_accessibles = room_class.accessible_attributes.map(&:to_sym)\n\n # delete any rooms which are no longer present\n property_rooms = property.attributes[:rooms] || []\n property_model_rooms = property_model.send(Vebra.models[:property][:rooms_method])\n refs_to_delete = property_model_rooms.map(&:vebra_ref) - property_rooms.map { |r| r[:vebra_ref] }\n property_model_rooms.each do |room|\n room.destroy if refs_to_delete.include?(room.vebra_ref)\n end\n\n # find & update or build new rooms\n property_rooms.each do |room|\n room_model = room_class.find_by_property_id_and_vebra_ref(property_model.id, room[:vebra_ref])\n room_model = property_model_rooms.build unless room_model\n\n # extract accessible attributes for the room\n room_attributes = room.inject({}) do |result, (key, value)|\n result[key] = value if room_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n room_model.update_attributes(room_attributes)\n end\n end\n\n # find & update or build new file attachments\n if Vebra.models[:file]\n file_class = Vebra.models[:file][:class].to_s.camelize.constantize\n\n # accessible attributes for the files\n file_accessibles = file_class.accessible_attributes.map(&:to_sym)\n\n # first normalize the collection (currently nested collections)\n property_files = property.attributes[:files].inject([]) do |result, (kind, collection)|\n collection.each do |file|\n file[:type] = kind.to_s.singularize.camelize if file_accessibles.include?(:type)\n file[\"remote_#{Vebra.models[:file][:attachment_method]}_url\".to_sym] = file.delete(:url)\n # if file[:type] is set, it means the attachment file class can be subclassed. In this\n # case we need to ensure that the subclass exists. If not, we ignore this file\n begin\n file[:type].constantize if file_accessibles.include?(:type)\n result << file\n rescue NameError => e\n # ignore - this means the subclass does not exist\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n\n result\n end\n\n # delete any files which are no longer present\n property_model_files = property_model.send(Vebra.models[:property][:files_method])\n refs_to_delete = property_model_files.map(&:vebra_ref) - property_files.map { |f| f[:vebra_ref] }\n property_model_files.each do |file|\n file.destroy if refs_to_delete.include?(file.vebra_ref)\n end\n\n # find & update or build new files\n property_files.each do |file|\n begin\n file_model = property_model_files.find_by_vebra_ref(file[:vebra_ref])\n file_model = property_model_files.build unless file_model\n\n # extract accessible attributes for the file\n file_attributes = file.inject({}) do |result, (key, value)|\n result[key] = value if file_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n file_model.update_attributes(file_attributes)\n rescue CarrierWave::ProcessingError, OpenURI::HTTPError => e\n # just ignore the file\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n end\n\n property_model.no_callbacks = false if property_model.respond_to?(:no_callbacks)\n property_model.save\n return property_model\n end",
"def update!(**args)\n @id = args[:id] if args.key?(:id)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def update\n end",
"def update!(**args)\n @mid = args[:mid] if args.key?(:mid)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def modified_properties=(value)\n @modified_properties = value\n end",
"def apply_properties!(properties)\n # Non-commutitivity etc. eventually.\n end",
"def set_properties(hash)\n hash.each do |key, value|\n add_or_remove_ostruct_member(key, value)\n end\n rest_reset_properties\n end",
"def update\n\t\t\n\t\tend",
"def set_props(props)\n @props.merge!(props)\n end",
"def update() end",
"def update!(**args)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def assign_properties\n self.properties ||= {}\n listing_properties.each do |prop|\n self.properties[prop.key] ||= prop.value\n end\n end",
"def change_properties(new_current_floor, new_next_floor, new_movement)\n @current_floor = new_current_floor\n @next_floor = new_next_floor\n @movement = new_movement\n end",
"def update!(**args)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end",
"def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end",
"def update(attributes)\n (@attributes ||= {}).merge! attributes\n\n (self.class.attr_initializables & attributes.keys).each do |name|\n instance_variable_set :\"@#{name}\", attributes[name]\n end\n\n self\n end",
"def update_attributes(attrs)\n super({})\n end",
"def update\n @dirty = true\n end",
"def update\n\n # Run through the mixin updates\n colourable_update\n movable_update\n\n end",
"def set(props)\n props.each do |prop, val|\n self.send(:\"#{ prop }=\", val)\n end\n end",
"def update\n super\n end",
"def update!(**args)\n @property_id = args[:property_id] if args.key?(:property_id)\n @value_status = args[:value_status] if args.key?(:value_status)\n end",
"def update!(**args)\n @object_size_bytes = args[:object_size_bytes] if args.key?(:object_size_bytes)\n @object_version = args[:object_version] if args.key?(:object_version)\n end",
"def movable_update\n\n # Work through the different aspects we update\n movable_location_update\n movable_size_update\n movable_angle_update\n\n end",
"def properties=(value)\n @properties = value\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(context={})\n self.pre_cast_attributes\n m2o = @relations.reject{|k, v| !self.class.many2one_relations.has_key?(k)}\n vals = @attributes.reject {|key, value| key == 'id'}.merge(m2o.merge(m2o){|k, v| v.is_a?(Array) ? v[0] : v})\n self.class.rpc_execute('write', self.id, vals, context)\n reload_from_record!(self.class.find(self.id, :context => context))\n end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update ; end",
"def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end",
"def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end",
"def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end",
"def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end",
"def update_with(attributes)\n assign_attributes(attributes)\n end",
"def update\n # don't need to update; hash is shared\n end",
"def update(attributes)\n HashProxy.with(attributes) do |proxy|\n self.class.attribute_names.each do |name|\n send(\"#{name}=\", proxy[name]) if proxy.key?(name)\n end\n end\n save\n end",
"def update!(**args)\n @object_id_prop = args[:object_id_prop] if args.key?(:object_id_prop)\n @relation = args[:relation] if args.key?(:relation)\n @subject_id = args[:subject_id] if args.key?(:subject_id)\n end",
"def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end",
"def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end",
"def update\n raise NotImplementedError\n end",
"def update_attributes attributes\n @attributes.merge! attributes\n end",
"def update!(**args)\n @async_options = args[:async_options] if args.key?(:async_options)\n @input_mappings = args[:input_mappings] if args.key?(:input_mappings)\n @name_property = args[:name_property] if args.key?(:name_property)\n @validation_options = args[:validation_options] if args.key?(:validation_options)\n end",
"def update\r\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @type = args[:type] if args.key?(:type)\n end",
"def update\n raise NotImplemented\n end",
"def update_obj\n mean, sd = rating.to_glicko_rating\n @obj.rating = mean\n @obj.rating_deviation = sd\n @obj.volatility = volatility\n end",
"def update_values\n end",
"def update_values\n end",
"def update\n raise NotImplementedError\n end",
"def update!(**args)\n @answers_header_signals = args[:answers_header_signals] if args.key?(:answers_header_signals)\n @property_value = args[:property_value] if args.key?(:property_value)\n @response_meaning_application = args[:response_meaning_application] if args.key?(:response_meaning_application)\n end",
"def update!(**args)\n @create_time = args[:create_time] if args.key?(:create_time)\n @method_prop = args[:method_prop] if args.key?(:method_prop)\n @name = args[:name] if args.key?(:name)\n @state = args[:state] if args.key?(:state)\n end",
"def update attributes, collection #:nodoc:\n 0\n end",
"def update_property_groups(roll)\n @property_groups.each { |_, v| v.update_rent(roll) }\n end",
"def update!(**args)\n @source_property = args[:source_property] if args.key?(:source_property)\n 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 update_properties(path, properties)\n prop_patch = PropPatch.new(properties)\n emit('propPatch', [path, prop_patch])\n prop_patch.commit\n\n prop_patch.result\n end",
"def update\n set_deltatime\n set_last_update_at\n end"
] | [
"0.7012263",
"0.69181895",
"0.69181895",
"0.69181895",
"0.69181895",
"0.69181895",
"0.67403597",
"0.6709326",
"0.6709326",
"0.6696149",
"0.6696149",
"0.6696149",
"0.6696149",
"0.6618882",
"0.6571848",
"0.65386343",
"0.65178275",
"0.6394807",
"0.6389745",
"0.6389745",
"0.63328",
"0.6319025",
"0.6283673",
"0.6269463",
"0.62639254",
"0.62410724",
"0.62170374",
"0.62152076",
"0.6210263",
"0.6204041",
"0.6204041",
"0.62021106",
"0.62017816",
"0.62017",
"0.61730784",
"0.61730784",
"0.6159277",
"0.6156169",
"0.61445665",
"0.6125433",
"0.61241156",
"0.6121413",
"0.6110477",
"0.6105694",
"0.61016303",
"0.60845226",
"0.6084427",
"0.6065455",
"0.6059506",
"0.6054869",
"0.6051708",
"0.6051708",
"0.60413384",
"0.6030853",
"0.6022535",
"0.6015561",
"0.59932375",
"0.59898263",
"0.5976479",
"0.5973787",
"0.59678394",
"0.5963291",
"0.5962048",
"0.5961157",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.59500545",
"0.59443134",
"0.59443134",
"0.59424853",
"0.59424853",
"0.593523",
"0.5926413",
"0.5924831",
"0.592427",
"0.59233046",
"0.59233046",
"0.5921224",
"0.59144294",
"0.59142506",
"0.58887535",
"0.58854496",
"0.5883008",
"0.58792305",
"0.5876954",
"0.5876954",
"0.58744955",
"0.5857968",
"0.5845542",
"0.5841629",
"0.58363605",
"0.5829255",
"0.582919",
"0.5822138",
"0.58208305"
] | 0.0 | -1 |
Update properties of this object | def update!(**args)
@destinations = args[:destinations] if args.key?(:destinations)
@sources = args[:sources] if args.key?(:sources)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update_properties(hash)\n hash.each do |key, value|\n setter_method = \"#{key}=\"\n if self.respond_to?(setter_method)\n self.send(setter_method, value)\n end\n end\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def refresh\n self.class.base_properties.each_with_index do |prop, prop_id|\n @properties[prop] = get_property(prop_id)\n end\n refresh_features\n refresh_status\n refresh_config\n self\n end",
"def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\n end",
"def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\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 update_properties!(branch_id=nil)\n properties = fetch_properties(false, branch_id)\n length = properties.length\n counter = 0\n properties.each do |property|\n counter += 1\n if Vebra.debugging?\n puts \"[Vebra]: #{counter}/#{length}: live updating property with Vebra ref: #{property.attributes[:vebra_ref]}\"\n end\n live_update!(property)\n Vebra.set_last_updated_at(Time.now) if counter == length\n end\n end",
"def update_self obj\n obj.each do |k,v|\n instance_variable_set(\"@#{k}\", v) if v\n end\n end",
"def update_attributes(properties_hash)\n self.class.get_class_properties.each do |property|\n key = property[:name].to_sym\n if properties_hash.has_key? key\n self.setValue(properties_hash[key], forKey:key)\n end\n end\n end",
"def update\n # TODO: implement update\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @states = args[:states] if args.key?(:states)\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end",
"def update!(**args)\n @property = args[:property] if args.key?(:property)\n @total_value_count = args[:total_value_count] if args.key?(:total_value_count)\n @value = args[:value] if args.key?(:value)\n @value_status = args[:value_status] if args.key?(:value_status)\n end",
"def update\n \n end",
"def refresh\n set_attributes\n end",
"def update(attrs)\n @attrs.update(attrs)\n self\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @source = args[:source] if args.key?(:source)\n end",
"def update_resource object, attributes\n object.update attributes\n end",
"def update(attrs)\n @attrs ||= {}\n @attrs.update(attrs)\n self\n end",
"def update\n \n end",
"def update!(**args)\n @property = args[:property] if args.key?(:property)\n @schema = args[:schema] if args.key?(:schema)\n end",
"def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def _update!\n self.class.properties.each do |property, predicate|\n if dirty?(property)\n self.class.repository_or_fail.delete([subject, predicate[:predicate], nil])\n if self.class.is_list?(property)\n repo = RDF::Repository.new\n attribute_get(property).each do |value|\n repo << RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(value, self.class.properties[property][:type]))\n end\n self.class.repository_or_fail.insert(*repo)\n else\n self.class.repository_or_fail.insert(RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(attribute_get(property), self.class.properties[property][:type])))\n end\n end\n @dirty[property] = nil\n @attributes[:original][property] = attribute_get(property)\n end\n self.class.repository_or_fail.insert(RDF::Statement.new(@subject, RDF.type, type)) unless type.nil?\n end",
"def update(attributes = {})\n super(attributes)\n retrieve!\n self\n end",
"def update\n @objects.map(&:update);\n end",
"def update\n raise NotImplementedError\n end",
"def update\n raise NotImplementedError\n end",
"def live_update!(property)\n property_class = Vebra.models[:property][:class].to_s.camelize.constantize\n\n # ensure we have the full property attributes\n property.get_property if !property.attributes[:status] && property.attributes[:action] != 'deleted'\n\n # find & update or build a new property\n property_model = property_class.find_or_initialize_by_vebra_ref(property.attributes[:vebra_ref])\n\n # make sure property object is not empty\n return false if !property.attributes || !property.attributes[:property_type]\n\n # if the property has been deleted, mark it appropriately and move on\n if property.attributes[:action] == 'deleted'\n return property_model.destroy\n end\n\n # extract accessible attributes for the property\n property_accessibles = property_class.accessible_attributes.map(&:to_sym)\n property_attributes = property.attributes.inject({}) do |result, (key, value)|\n result[key] = value if property_accessibles.include?(key)\n result\n end\n\n # update the property model's attributes\n property_model.no_callbacks = true if property_model.respond_to?(:no_callbacks)\n property_model.update_attributes(property_attributes)\n\n # find & update or build a new address\n if Vebra.models[:address]\n address_class = Vebra.models[:address][:class].to_s.camelize.constantize\n address_model = property_model.send(Vebra.models[:property][:address_method])\n address_model = property_model.send(\"build_#{Vebra.models[:property][:address_method]}\") unless address_model\n\n # extract accessible attributes for the address\n address_accessibles = address_class.accessible_attributes.map(&:to_sym)\n address_attributes = property.attributes[:address].inject({}) do |result, (key, value)|\n result[key] = value if address_accessibles.include?(key)\n result\n end\n\n # update the address model's attributes\n address_model.update_attributes(address_attributes)\n end\n\n # find & update or build new rooms\n if Vebra.models[:room]\n room_class = Vebra.models[:room][:class].to_s.camelize.constantize\n\n # accessible attributes for the rooms\n room_accessibles = room_class.accessible_attributes.map(&:to_sym)\n\n # delete any rooms which are no longer present\n property_rooms = property.attributes[:rooms] || []\n property_model_rooms = property_model.send(Vebra.models[:property][:rooms_method])\n refs_to_delete = property_model_rooms.map(&:vebra_ref) - property_rooms.map { |r| r[:vebra_ref] }\n property_model_rooms.each do |room|\n room.destroy if refs_to_delete.include?(room.vebra_ref)\n end\n\n # find & update or build new rooms\n property_rooms.each do |room|\n room_model = room_class.find_by_property_id_and_vebra_ref(property_model.id, room[:vebra_ref])\n room_model = property_model_rooms.build unless room_model\n\n # extract accessible attributes for the room\n room_attributes = room.inject({}) do |result, (key, value)|\n result[key] = value if room_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n room_model.update_attributes(room_attributes)\n end\n end\n\n # find & update or build new file attachments\n if Vebra.models[:file]\n file_class = Vebra.models[:file][:class].to_s.camelize.constantize\n\n # accessible attributes for the files\n file_accessibles = file_class.accessible_attributes.map(&:to_sym)\n\n # first normalize the collection (currently nested collections)\n property_files = property.attributes[:files].inject([]) do |result, (kind, collection)|\n collection.each do |file|\n file[:type] = kind.to_s.singularize.camelize if file_accessibles.include?(:type)\n file[\"remote_#{Vebra.models[:file][:attachment_method]}_url\".to_sym] = file.delete(:url)\n # if file[:type] is set, it means the attachment file class can be subclassed. In this\n # case we need to ensure that the subclass exists. If not, we ignore this file\n begin\n file[:type].constantize if file_accessibles.include?(:type)\n result << file\n rescue NameError => e\n # ignore - this means the subclass does not exist\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n\n result\n end\n\n # delete any files which are no longer present\n property_model_files = property_model.send(Vebra.models[:property][:files_method])\n refs_to_delete = property_model_files.map(&:vebra_ref) - property_files.map { |f| f[:vebra_ref] }\n property_model_files.each do |file|\n file.destroy if refs_to_delete.include?(file.vebra_ref)\n end\n\n # find & update or build new files\n property_files.each do |file|\n begin\n file_model = property_model_files.find_by_vebra_ref(file[:vebra_ref])\n file_model = property_model_files.build unless file_model\n\n # extract accessible attributes for the file\n file_attributes = file.inject({}) do |result, (key, value)|\n result[key] = value if file_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n file_model.update_attributes(file_attributes)\n rescue CarrierWave::ProcessingError, OpenURI::HTTPError => e\n # just ignore the file\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n end\n\n property_model.no_callbacks = false if property_model.respond_to?(:no_callbacks)\n property_model.save\n return property_model\n end",
"def update!(**args)\n @id = args[:id] if args.key?(:id)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def update\n end",
"def update!(**args)\n @mid = args[:mid] if args.key?(:mid)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def modified_properties=(value)\n @modified_properties = value\n end",
"def apply_properties!(properties)\n # Non-commutitivity etc. eventually.\n end",
"def set_properties(hash)\n hash.each do |key, value|\n add_or_remove_ostruct_member(key, value)\n end\n rest_reset_properties\n end",
"def update\n\t\t\n\t\tend",
"def set_props(props)\n @props.merge!(props)\n end",
"def update() end",
"def update!(**args)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def assign_properties\n self.properties ||= {}\n listing_properties.each do |prop|\n self.properties[prop.key] ||= prop.value\n end\n end",
"def change_properties(new_current_floor, new_next_floor, new_movement)\n @current_floor = new_current_floor\n @next_floor = new_next_floor\n @movement = new_movement\n end",
"def update!(**args)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end",
"def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end",
"def update(attributes)\n (@attributes ||= {}).merge! attributes\n\n (self.class.attr_initializables & attributes.keys).each do |name|\n instance_variable_set :\"@#{name}\", attributes[name]\n end\n\n self\n end",
"def update_attributes(attrs)\n super({})\n end",
"def update\n @dirty = true\n end",
"def update\n\n # Run through the mixin updates\n colourable_update\n movable_update\n\n end",
"def set(props)\n props.each do |prop, val|\n self.send(:\"#{ prop }=\", val)\n end\n end",
"def update\n super\n end",
"def update!(**args)\n @property_id = args[:property_id] if args.key?(:property_id)\n @value_status = args[:value_status] if args.key?(:value_status)\n end",
"def update!(**args)\n @object_size_bytes = args[:object_size_bytes] if args.key?(:object_size_bytes)\n @object_version = args[:object_version] if args.key?(:object_version)\n end",
"def movable_update\n\n # Work through the different aspects we update\n movable_location_update\n movable_size_update\n movable_angle_update\n\n end",
"def properties=(value)\n @properties = value\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(context={})\n self.pre_cast_attributes\n m2o = @relations.reject{|k, v| !self.class.many2one_relations.has_key?(k)}\n vals = @attributes.reject {|key, value| key == 'id'}.merge(m2o.merge(m2o){|k, v| v.is_a?(Array) ? v[0] : v})\n self.class.rpc_execute('write', self.id, vals, context)\n reload_from_record!(self.class.find(self.id, :context => context))\n end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update ; end",
"def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end",
"def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end",
"def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end",
"def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end",
"def update_with(attributes)\n assign_attributes(attributes)\n end",
"def update\n # don't need to update; hash is shared\n end",
"def update(attributes)\n HashProxy.with(attributes) do |proxy|\n self.class.attribute_names.each do |name|\n send(\"#{name}=\", proxy[name]) if proxy.key?(name)\n end\n end\n save\n end",
"def update!(**args)\n @object_id_prop = args[:object_id_prop] if args.key?(:object_id_prop)\n @relation = args[:relation] if args.key?(:relation)\n @subject_id = args[:subject_id] if args.key?(:subject_id)\n end",
"def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end",
"def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end",
"def update\n raise NotImplementedError\n end",
"def update_attributes attributes\n @attributes.merge! attributes\n end",
"def update!(**args)\n @async_options = args[:async_options] if args.key?(:async_options)\n @input_mappings = args[:input_mappings] if args.key?(:input_mappings)\n @name_property = args[:name_property] if args.key?(:name_property)\n @validation_options = args[:validation_options] if args.key?(:validation_options)\n end",
"def update\r\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @type = args[:type] if args.key?(:type)\n end",
"def update\n raise NotImplemented\n end",
"def update_obj\n mean, sd = rating.to_glicko_rating\n @obj.rating = mean\n @obj.rating_deviation = sd\n @obj.volatility = volatility\n end",
"def update_values\n end",
"def update_values\n end",
"def update\n raise NotImplementedError\n end",
"def update!(**args)\n @answers_header_signals = args[:answers_header_signals] if args.key?(:answers_header_signals)\n @property_value = args[:property_value] if args.key?(:property_value)\n @response_meaning_application = args[:response_meaning_application] if args.key?(:response_meaning_application)\n end",
"def update!(**args)\n @create_time = args[:create_time] if args.key?(:create_time)\n @method_prop = args[:method_prop] if args.key?(:method_prop)\n @name = args[:name] if args.key?(:name)\n @state = args[:state] if args.key?(:state)\n end",
"def update attributes, collection #:nodoc:\n 0\n end",
"def update_property_groups(roll)\n @property_groups.each { |_, v| v.update_rent(roll) }\n end",
"def update!(**args)\n @source_property = args[:source_property] if args.key?(:source_property)\n 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 update_properties(path, properties)\n prop_patch = PropPatch.new(properties)\n emit('propPatch', [path, prop_patch])\n prop_patch.commit\n\n prop_patch.result\n end",
"def update\n set_deltatime\n set_last_update_at\n end"
] | [
"0.7012263",
"0.69181895",
"0.69181895",
"0.69181895",
"0.69181895",
"0.69181895",
"0.67403597",
"0.6709326",
"0.6709326",
"0.6696149",
"0.6696149",
"0.6696149",
"0.6696149",
"0.6618882",
"0.6571848",
"0.65386343",
"0.65178275",
"0.6394807",
"0.6389745",
"0.6389745",
"0.63328",
"0.6319025",
"0.6283673",
"0.6269463",
"0.62639254",
"0.62410724",
"0.62170374",
"0.62152076",
"0.6210263",
"0.6204041",
"0.6204041",
"0.62021106",
"0.62017816",
"0.62017",
"0.61730784",
"0.61730784",
"0.6159277",
"0.6156169",
"0.61445665",
"0.6125433",
"0.61241156",
"0.6121413",
"0.6110477",
"0.6105694",
"0.61016303",
"0.60845226",
"0.6084427",
"0.6065455",
"0.6059506",
"0.6054869",
"0.6051708",
"0.6051708",
"0.60413384",
"0.6030853",
"0.6022535",
"0.6015561",
"0.59932375",
"0.59898263",
"0.5976479",
"0.5973787",
"0.59678394",
"0.5963291",
"0.5962048",
"0.5961157",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.59500545",
"0.59443134",
"0.59443134",
"0.59424853",
"0.59424853",
"0.593523",
"0.5926413",
"0.5924831",
"0.592427",
"0.59233046",
"0.59233046",
"0.5921224",
"0.59144294",
"0.59142506",
"0.58887535",
"0.58854496",
"0.5883008",
"0.58792305",
"0.5876954",
"0.5876954",
"0.58744955",
"0.5857968",
"0.5845542",
"0.5841629",
"0.58363605",
"0.5829255",
"0.582919",
"0.5822138",
"0.58208305"
] | 0.0 | -1 |
Update properties of this object | def update!(**args)
@create_time = args[:create_time] if args.key?(:create_time)
@description = args[:description] if args.key?(:description)
@etag = args[:etag] if args.key?(:etag)
@labels = args[:labels] if args.key?(:labels)
@name = args[:name] if args.key?(:name)
@threat_prevention_profile = args[:threat_prevention_profile] if args.key?(:threat_prevention_profile)
@type = args[:type] if args.key?(:type)
@update_time = args[:update_time] if args.key?(:update_time)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update_properties(hash)\n hash.each do |key, value|\n setter_method = \"#{key}=\"\n if self.respond_to?(setter_method)\n self.send(setter_method, value)\n end\n end\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def refresh\n self.class.base_properties.each_with_index do |prop, prop_id|\n @properties[prop] = get_property(prop_id)\n end\n refresh_features\n refresh_status\n refresh_config\n self\n end",
"def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\n end",
"def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\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 update_properties!(branch_id=nil)\n properties = fetch_properties(false, branch_id)\n length = properties.length\n counter = 0\n properties.each do |property|\n counter += 1\n if Vebra.debugging?\n puts \"[Vebra]: #{counter}/#{length}: live updating property with Vebra ref: #{property.attributes[:vebra_ref]}\"\n end\n live_update!(property)\n Vebra.set_last_updated_at(Time.now) if counter == length\n end\n end",
"def update_self obj\n obj.each do |k,v|\n instance_variable_set(\"@#{k}\", v) if v\n end\n end",
"def update_attributes(properties_hash)\n self.class.get_class_properties.each do |property|\n key = property[:name].to_sym\n if properties_hash.has_key? key\n self.setValue(properties_hash[key], forKey:key)\n end\n end\n end",
"def update\n # TODO: implement update\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @states = args[:states] if args.key?(:states)\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end",
"def update!(**args)\n @property = args[:property] if args.key?(:property)\n @total_value_count = args[:total_value_count] if args.key?(:total_value_count)\n @value = args[:value] if args.key?(:value)\n @value_status = args[:value_status] if args.key?(:value_status)\n end",
"def update\n \n end",
"def refresh\n set_attributes\n end",
"def update(attrs)\n @attrs.update(attrs)\n self\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @source = args[:source] if args.key?(:source)\n end",
"def update_resource object, attributes\n object.update attributes\n end",
"def update(attrs)\n @attrs ||= {}\n @attrs.update(attrs)\n self\n end",
"def update\n \n end",
"def update!(**args)\n @property = args[:property] if args.key?(:property)\n @schema = args[:schema] if args.key?(:schema)\n end",
"def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def _update!\n self.class.properties.each do |property, predicate|\n if dirty?(property)\n self.class.repository_or_fail.delete([subject, predicate[:predicate], nil])\n if self.class.is_list?(property)\n repo = RDF::Repository.new\n attribute_get(property).each do |value|\n repo << RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(value, self.class.properties[property][:type]))\n end\n self.class.repository_or_fail.insert(*repo)\n else\n self.class.repository_or_fail.insert(RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(attribute_get(property), self.class.properties[property][:type])))\n end\n end\n @dirty[property] = nil\n @attributes[:original][property] = attribute_get(property)\n end\n self.class.repository_or_fail.insert(RDF::Statement.new(@subject, RDF.type, type)) unless type.nil?\n end",
"def update(attributes = {})\n super(attributes)\n retrieve!\n self\n end",
"def update\n @objects.map(&:update);\n end",
"def update\n raise NotImplementedError\n end",
"def update\n raise NotImplementedError\n end",
"def live_update!(property)\n property_class = Vebra.models[:property][:class].to_s.camelize.constantize\n\n # ensure we have the full property attributes\n property.get_property if !property.attributes[:status] && property.attributes[:action] != 'deleted'\n\n # find & update or build a new property\n property_model = property_class.find_or_initialize_by_vebra_ref(property.attributes[:vebra_ref])\n\n # make sure property object is not empty\n return false if !property.attributes || !property.attributes[:property_type]\n\n # if the property has been deleted, mark it appropriately and move on\n if property.attributes[:action] == 'deleted'\n return property_model.destroy\n end\n\n # extract accessible attributes for the property\n property_accessibles = property_class.accessible_attributes.map(&:to_sym)\n property_attributes = property.attributes.inject({}) do |result, (key, value)|\n result[key] = value if property_accessibles.include?(key)\n result\n end\n\n # update the property model's attributes\n property_model.no_callbacks = true if property_model.respond_to?(:no_callbacks)\n property_model.update_attributes(property_attributes)\n\n # find & update or build a new address\n if Vebra.models[:address]\n address_class = Vebra.models[:address][:class].to_s.camelize.constantize\n address_model = property_model.send(Vebra.models[:property][:address_method])\n address_model = property_model.send(\"build_#{Vebra.models[:property][:address_method]}\") unless address_model\n\n # extract accessible attributes for the address\n address_accessibles = address_class.accessible_attributes.map(&:to_sym)\n address_attributes = property.attributes[:address].inject({}) do |result, (key, value)|\n result[key] = value if address_accessibles.include?(key)\n result\n end\n\n # update the address model's attributes\n address_model.update_attributes(address_attributes)\n end\n\n # find & update or build new rooms\n if Vebra.models[:room]\n room_class = Vebra.models[:room][:class].to_s.camelize.constantize\n\n # accessible attributes for the rooms\n room_accessibles = room_class.accessible_attributes.map(&:to_sym)\n\n # delete any rooms which are no longer present\n property_rooms = property.attributes[:rooms] || []\n property_model_rooms = property_model.send(Vebra.models[:property][:rooms_method])\n refs_to_delete = property_model_rooms.map(&:vebra_ref) - property_rooms.map { |r| r[:vebra_ref] }\n property_model_rooms.each do |room|\n room.destroy if refs_to_delete.include?(room.vebra_ref)\n end\n\n # find & update or build new rooms\n property_rooms.each do |room|\n room_model = room_class.find_by_property_id_and_vebra_ref(property_model.id, room[:vebra_ref])\n room_model = property_model_rooms.build unless room_model\n\n # extract accessible attributes for the room\n room_attributes = room.inject({}) do |result, (key, value)|\n result[key] = value if room_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n room_model.update_attributes(room_attributes)\n end\n end\n\n # find & update or build new file attachments\n if Vebra.models[:file]\n file_class = Vebra.models[:file][:class].to_s.camelize.constantize\n\n # accessible attributes for the files\n file_accessibles = file_class.accessible_attributes.map(&:to_sym)\n\n # first normalize the collection (currently nested collections)\n property_files = property.attributes[:files].inject([]) do |result, (kind, collection)|\n collection.each do |file|\n file[:type] = kind.to_s.singularize.camelize if file_accessibles.include?(:type)\n file[\"remote_#{Vebra.models[:file][:attachment_method]}_url\".to_sym] = file.delete(:url)\n # if file[:type] is set, it means the attachment file class can be subclassed. In this\n # case we need to ensure that the subclass exists. If not, we ignore this file\n begin\n file[:type].constantize if file_accessibles.include?(:type)\n result << file\n rescue NameError => e\n # ignore - this means the subclass does not exist\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n\n result\n end\n\n # delete any files which are no longer present\n property_model_files = property_model.send(Vebra.models[:property][:files_method])\n refs_to_delete = property_model_files.map(&:vebra_ref) - property_files.map { |f| f[:vebra_ref] }\n property_model_files.each do |file|\n file.destroy if refs_to_delete.include?(file.vebra_ref)\n end\n\n # find & update or build new files\n property_files.each do |file|\n begin\n file_model = property_model_files.find_by_vebra_ref(file[:vebra_ref])\n file_model = property_model_files.build unless file_model\n\n # extract accessible attributes for the file\n file_attributes = file.inject({}) do |result, (key, value)|\n result[key] = value if file_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n file_model.update_attributes(file_attributes)\n rescue CarrierWave::ProcessingError, OpenURI::HTTPError => e\n # just ignore the file\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n end\n\n property_model.no_callbacks = false if property_model.respond_to?(:no_callbacks)\n property_model.save\n return property_model\n end",
"def update!(**args)\n @id = args[:id] if args.key?(:id)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def update\n end",
"def update!(**args)\n @mid = args[:mid] if args.key?(:mid)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def modified_properties=(value)\n @modified_properties = value\n end",
"def apply_properties!(properties)\n # Non-commutitivity etc. eventually.\n end",
"def set_properties(hash)\n hash.each do |key, value|\n add_or_remove_ostruct_member(key, value)\n end\n rest_reset_properties\n end",
"def update\n\t\t\n\t\tend",
"def set_props(props)\n @props.merge!(props)\n end",
"def update() end",
"def update!(**args)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def assign_properties\n self.properties ||= {}\n listing_properties.each do |prop|\n self.properties[prop.key] ||= prop.value\n end\n end",
"def change_properties(new_current_floor, new_next_floor, new_movement)\n @current_floor = new_current_floor\n @next_floor = new_next_floor\n @movement = new_movement\n end",
"def update!(**args)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end",
"def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end",
"def update(attributes)\n (@attributes ||= {}).merge! attributes\n\n (self.class.attr_initializables & attributes.keys).each do |name|\n instance_variable_set :\"@#{name}\", attributes[name]\n end\n\n self\n end",
"def update_attributes(attrs)\n super({})\n end",
"def update\n @dirty = true\n end",
"def update\n\n # Run through the mixin updates\n colourable_update\n movable_update\n\n end",
"def set(props)\n props.each do |prop, val|\n self.send(:\"#{ prop }=\", val)\n end\n end",
"def update\n super\n end",
"def update!(**args)\n @property_id = args[:property_id] if args.key?(:property_id)\n @value_status = args[:value_status] if args.key?(:value_status)\n end",
"def update!(**args)\n @object_size_bytes = args[:object_size_bytes] if args.key?(:object_size_bytes)\n @object_version = args[:object_version] if args.key?(:object_version)\n end",
"def movable_update\n\n # Work through the different aspects we update\n movable_location_update\n movable_size_update\n movable_angle_update\n\n end",
"def properties=(value)\n @properties = value\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(context={})\n self.pre_cast_attributes\n m2o = @relations.reject{|k, v| !self.class.many2one_relations.has_key?(k)}\n vals = @attributes.reject {|key, value| key == 'id'}.merge(m2o.merge(m2o){|k, v| v.is_a?(Array) ? v[0] : v})\n self.class.rpc_execute('write', self.id, vals, context)\n reload_from_record!(self.class.find(self.id, :context => context))\n end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update ; end",
"def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end",
"def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end",
"def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end",
"def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end",
"def update_with(attributes)\n assign_attributes(attributes)\n end",
"def update\n # don't need to update; hash is shared\n end",
"def update(attributes)\n HashProxy.with(attributes) do |proxy|\n self.class.attribute_names.each do |name|\n send(\"#{name}=\", proxy[name]) if proxy.key?(name)\n end\n end\n save\n end",
"def update!(**args)\n @object_id_prop = args[:object_id_prop] if args.key?(:object_id_prop)\n @relation = args[:relation] if args.key?(:relation)\n @subject_id = args[:subject_id] if args.key?(:subject_id)\n end",
"def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end",
"def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end",
"def update\n raise NotImplementedError\n end",
"def update_attributes attributes\n @attributes.merge! attributes\n end",
"def update!(**args)\n @async_options = args[:async_options] if args.key?(:async_options)\n @input_mappings = args[:input_mappings] if args.key?(:input_mappings)\n @name_property = args[:name_property] if args.key?(:name_property)\n @validation_options = args[:validation_options] if args.key?(:validation_options)\n end",
"def update\r\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @type = args[:type] if args.key?(:type)\n end",
"def update\n raise NotImplemented\n end",
"def update_obj\n mean, sd = rating.to_glicko_rating\n @obj.rating = mean\n @obj.rating_deviation = sd\n @obj.volatility = volatility\n end",
"def update_values\n end",
"def update_values\n end",
"def update\n raise NotImplementedError\n end",
"def update!(**args)\n @answers_header_signals = args[:answers_header_signals] if args.key?(:answers_header_signals)\n @property_value = args[:property_value] if args.key?(:property_value)\n @response_meaning_application = args[:response_meaning_application] if args.key?(:response_meaning_application)\n end",
"def update!(**args)\n @create_time = args[:create_time] if args.key?(:create_time)\n @method_prop = args[:method_prop] if args.key?(:method_prop)\n @name = args[:name] if args.key?(:name)\n @state = args[:state] if args.key?(:state)\n end",
"def update attributes, collection #:nodoc:\n 0\n end",
"def update_property_groups(roll)\n @property_groups.each { |_, v| v.update_rent(roll) }\n end",
"def update!(**args)\n @source_property = args[:source_property] if args.key?(:source_property)\n 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 update_properties(path, properties)\n prop_patch = PropPatch.new(properties)\n emit('propPatch', [path, prop_patch])\n prop_patch.commit\n\n prop_patch.result\n end",
"def update\n set_deltatime\n set_last_update_at\n end"
] | [
"0.7012263",
"0.69181895",
"0.69181895",
"0.69181895",
"0.69181895",
"0.69181895",
"0.67403597",
"0.6709326",
"0.6709326",
"0.6696149",
"0.6696149",
"0.6696149",
"0.6696149",
"0.6618882",
"0.6571848",
"0.65386343",
"0.65178275",
"0.6394807",
"0.6389745",
"0.6389745",
"0.63328",
"0.6319025",
"0.6283673",
"0.6269463",
"0.62639254",
"0.62410724",
"0.62170374",
"0.62152076",
"0.6210263",
"0.6204041",
"0.6204041",
"0.62021106",
"0.62017816",
"0.62017",
"0.61730784",
"0.61730784",
"0.6159277",
"0.6156169",
"0.61445665",
"0.6125433",
"0.61241156",
"0.6121413",
"0.6110477",
"0.6105694",
"0.61016303",
"0.60845226",
"0.6084427",
"0.6065455",
"0.6059506",
"0.6054869",
"0.6051708",
"0.6051708",
"0.60413384",
"0.6030853",
"0.6022535",
"0.6015561",
"0.59932375",
"0.59898263",
"0.5976479",
"0.5973787",
"0.59678394",
"0.5963291",
"0.5962048",
"0.5961157",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.59500545",
"0.59443134",
"0.59443134",
"0.59424853",
"0.59424853",
"0.593523",
"0.5926413",
"0.5924831",
"0.592427",
"0.59233046",
"0.59233046",
"0.5921224",
"0.59144294",
"0.59142506",
"0.58887535",
"0.58854496",
"0.5883008",
"0.58792305",
"0.5876954",
"0.5876954",
"0.58744955",
"0.5857968",
"0.5845542",
"0.5841629",
"0.58363605",
"0.5829255",
"0.582919",
"0.5822138",
"0.58208305"
] | 0.0 | -1 |
Update properties of this object | def update!(**args)
@create_time = args[:create_time] if args.key?(:create_time)
@description = args[:description] if args.key?(:description)
@etag = args[:etag] if args.key?(:etag)
@labels = args[:labels] if args.key?(:labels)
@name = args[:name] if args.key?(:name)
@threat_prevention_profile = args[:threat_prevention_profile] if args.key?(:threat_prevention_profile)
@update_time = args[:update_time] if args.key?(:update_time)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update_properties(hash)\n hash.each do |key, value|\n setter_method = \"#{key}=\"\n if self.respond_to?(setter_method)\n self.send(setter_method, value)\n end\n end\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def refresh\n self.class.base_properties.each_with_index do |prop, prop_id|\n @properties[prop] = get_property(prop_id)\n end\n refresh_features\n refresh_status\n refresh_config\n self\n end",
"def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\n end",
"def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\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 update_properties!(branch_id=nil)\n properties = fetch_properties(false, branch_id)\n length = properties.length\n counter = 0\n properties.each do |property|\n counter += 1\n if Vebra.debugging?\n puts \"[Vebra]: #{counter}/#{length}: live updating property with Vebra ref: #{property.attributes[:vebra_ref]}\"\n end\n live_update!(property)\n Vebra.set_last_updated_at(Time.now) if counter == length\n end\n end",
"def update_self obj\n obj.each do |k,v|\n instance_variable_set(\"@#{k}\", v) if v\n end\n end",
"def update_attributes(properties_hash)\n self.class.get_class_properties.each do |property|\n key = property[:name].to_sym\n if properties_hash.has_key? key\n self.setValue(properties_hash[key], forKey:key)\n end\n end\n end",
"def update\n # TODO: implement update\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @states = args[:states] if args.key?(:states)\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end",
"def update!(**args)\n @property = args[:property] if args.key?(:property)\n @total_value_count = args[:total_value_count] if args.key?(:total_value_count)\n @value = args[:value] if args.key?(:value)\n @value_status = args[:value_status] if args.key?(:value_status)\n end",
"def update\n \n end",
"def refresh\n set_attributes\n end",
"def update(attrs)\n @attrs.update(attrs)\n self\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @source = args[:source] if args.key?(:source)\n end",
"def update_resource object, attributes\n object.update attributes\n end",
"def update(attrs)\n @attrs ||= {}\n @attrs.update(attrs)\n self\n end",
"def update\n \n end",
"def update!(**args)\n @property = args[:property] if args.key?(:property)\n @schema = args[:schema] if args.key?(:schema)\n end",
"def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def update(attributes = {})\n super(attributes)\n retrieve!\n self\n end",
"def _update!\n self.class.properties.each do |property, predicate|\n if dirty?(property)\n self.class.repository_or_fail.delete([subject, predicate[:predicate], nil])\n if self.class.is_list?(property)\n repo = RDF::Repository.new\n attribute_get(property).each do |value|\n repo << RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(value, self.class.properties[property][:type]))\n end\n self.class.repository_or_fail.insert(*repo)\n else\n self.class.repository_or_fail.insert(RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(attribute_get(property), self.class.properties[property][:type])))\n end\n end\n @dirty[property] = nil\n @attributes[:original][property] = attribute_get(property)\n end\n self.class.repository_or_fail.insert(RDF::Statement.new(@subject, RDF.type, type)) unless type.nil?\n end",
"def update\n @objects.map(&:update);\n end",
"def update\n raise NotImplementedError\n end",
"def update\n raise NotImplementedError\n end",
"def live_update!(property)\n property_class = Vebra.models[:property][:class].to_s.camelize.constantize\n\n # ensure we have the full property attributes\n property.get_property if !property.attributes[:status] && property.attributes[:action] != 'deleted'\n\n # find & update or build a new property\n property_model = property_class.find_or_initialize_by_vebra_ref(property.attributes[:vebra_ref])\n\n # make sure property object is not empty\n return false if !property.attributes || !property.attributes[:property_type]\n\n # if the property has been deleted, mark it appropriately and move on\n if property.attributes[:action] == 'deleted'\n return property_model.destroy\n end\n\n # extract accessible attributes for the property\n property_accessibles = property_class.accessible_attributes.map(&:to_sym)\n property_attributes = property.attributes.inject({}) do |result, (key, value)|\n result[key] = value if property_accessibles.include?(key)\n result\n end\n\n # update the property model's attributes\n property_model.no_callbacks = true if property_model.respond_to?(:no_callbacks)\n property_model.update_attributes(property_attributes)\n\n # find & update or build a new address\n if Vebra.models[:address]\n address_class = Vebra.models[:address][:class].to_s.camelize.constantize\n address_model = property_model.send(Vebra.models[:property][:address_method])\n address_model = property_model.send(\"build_#{Vebra.models[:property][:address_method]}\") unless address_model\n\n # extract accessible attributes for the address\n address_accessibles = address_class.accessible_attributes.map(&:to_sym)\n address_attributes = property.attributes[:address].inject({}) do |result, (key, value)|\n result[key] = value if address_accessibles.include?(key)\n result\n end\n\n # update the address model's attributes\n address_model.update_attributes(address_attributes)\n end\n\n # find & update or build new rooms\n if Vebra.models[:room]\n room_class = Vebra.models[:room][:class].to_s.camelize.constantize\n\n # accessible attributes for the rooms\n room_accessibles = room_class.accessible_attributes.map(&:to_sym)\n\n # delete any rooms which are no longer present\n property_rooms = property.attributes[:rooms] || []\n property_model_rooms = property_model.send(Vebra.models[:property][:rooms_method])\n refs_to_delete = property_model_rooms.map(&:vebra_ref) - property_rooms.map { |r| r[:vebra_ref] }\n property_model_rooms.each do |room|\n room.destroy if refs_to_delete.include?(room.vebra_ref)\n end\n\n # find & update or build new rooms\n property_rooms.each do |room|\n room_model = room_class.find_by_property_id_and_vebra_ref(property_model.id, room[:vebra_ref])\n room_model = property_model_rooms.build unless room_model\n\n # extract accessible attributes for the room\n room_attributes = room.inject({}) do |result, (key, value)|\n result[key] = value if room_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n room_model.update_attributes(room_attributes)\n end\n end\n\n # find & update or build new file attachments\n if Vebra.models[:file]\n file_class = Vebra.models[:file][:class].to_s.camelize.constantize\n\n # accessible attributes for the files\n file_accessibles = file_class.accessible_attributes.map(&:to_sym)\n\n # first normalize the collection (currently nested collections)\n property_files = property.attributes[:files].inject([]) do |result, (kind, collection)|\n collection.each do |file|\n file[:type] = kind.to_s.singularize.camelize if file_accessibles.include?(:type)\n file[\"remote_#{Vebra.models[:file][:attachment_method]}_url\".to_sym] = file.delete(:url)\n # if file[:type] is set, it means the attachment file class can be subclassed. In this\n # case we need to ensure that the subclass exists. If not, we ignore this file\n begin\n file[:type].constantize if file_accessibles.include?(:type)\n result << file\n rescue NameError => e\n # ignore - this means the subclass does not exist\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n\n result\n end\n\n # delete any files which are no longer present\n property_model_files = property_model.send(Vebra.models[:property][:files_method])\n refs_to_delete = property_model_files.map(&:vebra_ref) - property_files.map { |f| f[:vebra_ref] }\n property_model_files.each do |file|\n file.destroy if refs_to_delete.include?(file.vebra_ref)\n end\n\n # find & update or build new files\n property_files.each do |file|\n begin\n file_model = property_model_files.find_by_vebra_ref(file[:vebra_ref])\n file_model = property_model_files.build unless file_model\n\n # extract accessible attributes for the file\n file_attributes = file.inject({}) do |result, (key, value)|\n result[key] = value if file_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n file_model.update_attributes(file_attributes)\n rescue CarrierWave::ProcessingError, OpenURI::HTTPError => e\n # just ignore the file\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n end\n\n property_model.no_callbacks = false if property_model.respond_to?(:no_callbacks)\n property_model.save\n return property_model\n end",
"def update!(**args)\n @id = args[:id] if args.key?(:id)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def update\n end",
"def update!(**args)\n @mid = args[:mid] if args.key?(:mid)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def modified_properties=(value)\n @modified_properties = value\n end",
"def apply_properties!(properties)\n # Non-commutitivity etc. eventually.\n end",
"def set_properties(hash)\n hash.each do |key, value|\n add_or_remove_ostruct_member(key, value)\n end\n rest_reset_properties\n end",
"def update\n\t\t\n\t\tend",
"def set_props(props)\n @props.merge!(props)\n end",
"def update() end",
"def update!(**args)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def assign_properties\n self.properties ||= {}\n listing_properties.each do |prop|\n self.properties[prop.key] ||= prop.value\n end\n end",
"def change_properties(new_current_floor, new_next_floor, new_movement)\n @current_floor = new_current_floor\n @next_floor = new_next_floor\n @movement = new_movement\n end",
"def update!(**args)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end",
"def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end",
"def update(attributes)\n (@attributes ||= {}).merge! attributes\n\n (self.class.attr_initializables & attributes.keys).each do |name|\n instance_variable_set :\"@#{name}\", attributes[name]\n end\n\n self\n end",
"def update_attributes(attrs)\n super({})\n end",
"def update\n @dirty = true\n end",
"def update\n\n # Run through the mixin updates\n colourable_update\n movable_update\n\n end",
"def set(props)\n props.each do |prop, val|\n self.send(:\"#{ prop }=\", val)\n end\n end",
"def update\n super\n end",
"def update!(**args)\n @property_id = args[:property_id] if args.key?(:property_id)\n @value_status = args[:value_status] if args.key?(:value_status)\n end",
"def update!(**args)\n @object_size_bytes = args[:object_size_bytes] if args.key?(:object_size_bytes)\n @object_version = args[:object_version] if args.key?(:object_version)\n end",
"def movable_update\n\n # Work through the different aspects we update\n movable_location_update\n movable_size_update\n movable_angle_update\n\n end",
"def properties=(value)\n @properties = value\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(context={})\n self.pre_cast_attributes\n m2o = @relations.reject{|k, v| !self.class.many2one_relations.has_key?(k)}\n vals = @attributes.reject {|key, value| key == 'id'}.merge(m2o.merge(m2o){|k, v| v.is_a?(Array) ? v[0] : v})\n self.class.rpc_execute('write', self.id, vals, context)\n reload_from_record!(self.class.find(self.id, :context => context))\n end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update ; end",
"def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end",
"def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end",
"def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end",
"def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end",
"def update_with(attributes)\n assign_attributes(attributes)\n end",
"def update\n # don't need to update; hash is shared\n end",
"def update(attributes)\n HashProxy.with(attributes) do |proxy|\n self.class.attribute_names.each do |name|\n send(\"#{name}=\", proxy[name]) if proxy.key?(name)\n end\n end\n save\n end",
"def update!(**args)\n @object_id_prop = args[:object_id_prop] if args.key?(:object_id_prop)\n @relation = args[:relation] if args.key?(:relation)\n @subject_id = args[:subject_id] if args.key?(:subject_id)\n end",
"def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end",
"def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end",
"def update\n raise NotImplementedError\n end",
"def update_attributes attributes\n @attributes.merge! attributes\n end",
"def update!(**args)\n @async_options = args[:async_options] if args.key?(:async_options)\n @input_mappings = args[:input_mappings] if args.key?(:input_mappings)\n @name_property = args[:name_property] if args.key?(:name_property)\n @validation_options = args[:validation_options] if args.key?(:validation_options)\n end",
"def update\r\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @type = args[:type] if args.key?(:type)\n end",
"def update\n raise NotImplemented\n end",
"def update_obj\n mean, sd = rating.to_glicko_rating\n @obj.rating = mean\n @obj.rating_deviation = sd\n @obj.volatility = volatility\n end",
"def update_values\n end",
"def update_values\n end",
"def update\n raise NotImplementedError\n end",
"def update!(**args)\n @answers_header_signals = args[:answers_header_signals] if args.key?(:answers_header_signals)\n @property_value = args[:property_value] if args.key?(:property_value)\n @response_meaning_application = args[:response_meaning_application] if args.key?(:response_meaning_application)\n end",
"def update!(**args)\n @create_time = args[:create_time] if args.key?(:create_time)\n @method_prop = args[:method_prop] if args.key?(:method_prop)\n @name = args[:name] if args.key?(:name)\n @state = args[:state] if args.key?(:state)\n end",
"def update attributes, collection #:nodoc:\n 0\n end",
"def update_property_groups(roll)\n @property_groups.each { |_, v| v.update_rent(roll) }\n 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 update!(**args)\n @source_property = args[:source_property] if args.key?(:source_property)\n end",
"def update_properties(path, properties)\n prop_patch = PropPatch.new(properties)\n emit('propPatch', [path, prop_patch])\n prop_patch.commit\n\n prop_patch.result\n end",
"def update\n set_deltatime\n set_last_update_at\n end"
] | [
"0.7012568",
"0.6918917",
"0.6918917",
"0.6918917",
"0.6918917",
"0.6918917",
"0.67404634",
"0.6709981",
"0.6709981",
"0.66964126",
"0.66964126",
"0.66964126",
"0.66964126",
"0.6619218",
"0.6570895",
"0.6539287",
"0.6517026",
"0.63946927",
"0.63901657",
"0.63901657",
"0.63328683",
"0.6318612",
"0.62846893",
"0.62692374",
"0.6264273",
"0.6241163",
"0.6216599",
"0.6214641",
"0.6210363",
"0.6203827",
"0.6203827",
"0.620312",
"0.6201905",
"0.62001497",
"0.61728275",
"0.61728275",
"0.6159924",
"0.61569315",
"0.61442953",
"0.61260897",
"0.6125199",
"0.61227936",
"0.61111224",
"0.610543",
"0.6102925",
"0.60839343",
"0.6083609",
"0.6066973",
"0.60602766",
"0.6055065",
"0.6051568",
"0.6051568",
"0.6042057",
"0.60319084",
"0.60221004",
"0.60149413",
"0.5994295",
"0.5989816",
"0.597674",
"0.5973157",
"0.5967343",
"0.5965598",
"0.59629464",
"0.59618354",
"0.5950329",
"0.5950329",
"0.5950329",
"0.5950329",
"0.5950329",
"0.5950329",
"0.5950329",
"0.5950329",
"0.59495455",
"0.59442014",
"0.59442014",
"0.5944142",
"0.5944142",
"0.59361076",
"0.5925741",
"0.5925574",
"0.59250593",
"0.5924476",
"0.5924476",
"0.5921039",
"0.59155524",
"0.59145254",
"0.5888445",
"0.58860934",
"0.5882302",
"0.5879913",
"0.5877467",
"0.5877467",
"0.58743787",
"0.585829",
"0.584583",
"0.58408254",
"0.5835501",
"0.5829063",
"0.5828611",
"0.58228916",
"0.5819882"
] | 0.0 | -1 |
Update properties of this object | def update!(**args)
@allow_open = args[:allow_open] if args.key?(:allow_open)
@create_time = args[:create_time] if args.key?(:create_time)
@description = args[:description] if args.key?(:description)
@labels = args[:labels] if args.key?(:labels)
@mtls_policy = args[:mtls_policy] if args.key?(:mtls_policy)
@name = args[:name] if args.key?(:name)
@server_certificate = args[:server_certificate] if args.key?(:server_certificate)
@update_time = args[:update_time] if args.key?(:update_time)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update_properties(hash)\n hash.each do |key, value|\n setter_method = \"#{key}=\"\n if self.respond_to?(setter_method)\n self.send(setter_method, value)\n end\n end\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def refresh\n self.class.base_properties.each_with_index do |prop, prop_id|\n @properties[prop] = get_property(prop_id)\n end\n refresh_features\n refresh_status\n refresh_config\n self\n end",
"def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\n end",
"def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\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 update_properties!(branch_id=nil)\n properties = fetch_properties(false, branch_id)\n length = properties.length\n counter = 0\n properties.each do |property|\n counter += 1\n if Vebra.debugging?\n puts \"[Vebra]: #{counter}/#{length}: live updating property with Vebra ref: #{property.attributes[:vebra_ref]}\"\n end\n live_update!(property)\n Vebra.set_last_updated_at(Time.now) if counter == length\n end\n end",
"def update_self obj\n obj.each do |k,v|\n instance_variable_set(\"@#{k}\", v) if v\n end\n end",
"def update_attributes(properties_hash)\n self.class.get_class_properties.each do |property|\n key = property[:name].to_sym\n if properties_hash.has_key? key\n self.setValue(properties_hash[key], forKey:key)\n end\n end\n end",
"def update\n # TODO: implement update\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @states = args[:states] if args.key?(:states)\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end",
"def update!(**args)\n @property = args[:property] if args.key?(:property)\n @total_value_count = args[:total_value_count] if args.key?(:total_value_count)\n @value = args[:value] if args.key?(:value)\n @value_status = args[:value_status] if args.key?(:value_status)\n end",
"def update\n \n end",
"def refresh\n set_attributes\n end",
"def update(attrs)\n @attrs.update(attrs)\n self\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @source = args[:source] if args.key?(:source)\n end",
"def update_resource object, attributes\n object.update attributes\n end",
"def update(attrs)\n @attrs ||= {}\n @attrs.update(attrs)\n self\n end",
"def update\n \n end",
"def update!(**args)\n @property = args[:property] if args.key?(:property)\n @schema = args[:schema] if args.key?(:schema)\n end",
"def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def _update!\n self.class.properties.each do |property, predicate|\n if dirty?(property)\n self.class.repository_or_fail.delete([subject, predicate[:predicate], nil])\n if self.class.is_list?(property)\n repo = RDF::Repository.new\n attribute_get(property).each do |value|\n repo << RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(value, self.class.properties[property][:type]))\n end\n self.class.repository_or_fail.insert(*repo)\n else\n self.class.repository_or_fail.insert(RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(attribute_get(property), self.class.properties[property][:type])))\n end\n end\n @dirty[property] = nil\n @attributes[:original][property] = attribute_get(property)\n end\n self.class.repository_or_fail.insert(RDF::Statement.new(@subject, RDF.type, type)) unless type.nil?\n end",
"def update(attributes = {})\n super(attributes)\n retrieve!\n self\n end",
"def update\n @objects.map(&:update);\n end",
"def update\n raise NotImplementedError\n end",
"def update\n raise NotImplementedError\n end",
"def live_update!(property)\n property_class = Vebra.models[:property][:class].to_s.camelize.constantize\n\n # ensure we have the full property attributes\n property.get_property if !property.attributes[:status] && property.attributes[:action] != 'deleted'\n\n # find & update or build a new property\n property_model = property_class.find_or_initialize_by_vebra_ref(property.attributes[:vebra_ref])\n\n # make sure property object is not empty\n return false if !property.attributes || !property.attributes[:property_type]\n\n # if the property has been deleted, mark it appropriately and move on\n if property.attributes[:action] == 'deleted'\n return property_model.destroy\n end\n\n # extract accessible attributes for the property\n property_accessibles = property_class.accessible_attributes.map(&:to_sym)\n property_attributes = property.attributes.inject({}) do |result, (key, value)|\n result[key] = value if property_accessibles.include?(key)\n result\n end\n\n # update the property model's attributes\n property_model.no_callbacks = true if property_model.respond_to?(:no_callbacks)\n property_model.update_attributes(property_attributes)\n\n # find & update or build a new address\n if Vebra.models[:address]\n address_class = Vebra.models[:address][:class].to_s.camelize.constantize\n address_model = property_model.send(Vebra.models[:property][:address_method])\n address_model = property_model.send(\"build_#{Vebra.models[:property][:address_method]}\") unless address_model\n\n # extract accessible attributes for the address\n address_accessibles = address_class.accessible_attributes.map(&:to_sym)\n address_attributes = property.attributes[:address].inject({}) do |result, (key, value)|\n result[key] = value if address_accessibles.include?(key)\n result\n end\n\n # update the address model's attributes\n address_model.update_attributes(address_attributes)\n end\n\n # find & update or build new rooms\n if Vebra.models[:room]\n room_class = Vebra.models[:room][:class].to_s.camelize.constantize\n\n # accessible attributes for the rooms\n room_accessibles = room_class.accessible_attributes.map(&:to_sym)\n\n # delete any rooms which are no longer present\n property_rooms = property.attributes[:rooms] || []\n property_model_rooms = property_model.send(Vebra.models[:property][:rooms_method])\n refs_to_delete = property_model_rooms.map(&:vebra_ref) - property_rooms.map { |r| r[:vebra_ref] }\n property_model_rooms.each do |room|\n room.destroy if refs_to_delete.include?(room.vebra_ref)\n end\n\n # find & update or build new rooms\n property_rooms.each do |room|\n room_model = room_class.find_by_property_id_and_vebra_ref(property_model.id, room[:vebra_ref])\n room_model = property_model_rooms.build unless room_model\n\n # extract accessible attributes for the room\n room_attributes = room.inject({}) do |result, (key, value)|\n result[key] = value if room_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n room_model.update_attributes(room_attributes)\n end\n end\n\n # find & update or build new file attachments\n if Vebra.models[:file]\n file_class = Vebra.models[:file][:class].to_s.camelize.constantize\n\n # accessible attributes for the files\n file_accessibles = file_class.accessible_attributes.map(&:to_sym)\n\n # first normalize the collection (currently nested collections)\n property_files = property.attributes[:files].inject([]) do |result, (kind, collection)|\n collection.each do |file|\n file[:type] = kind.to_s.singularize.camelize if file_accessibles.include?(:type)\n file[\"remote_#{Vebra.models[:file][:attachment_method]}_url\".to_sym] = file.delete(:url)\n # if file[:type] is set, it means the attachment file class can be subclassed. In this\n # case we need to ensure that the subclass exists. If not, we ignore this file\n begin\n file[:type].constantize if file_accessibles.include?(:type)\n result << file\n rescue NameError => e\n # ignore - this means the subclass does not exist\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n\n result\n end\n\n # delete any files which are no longer present\n property_model_files = property_model.send(Vebra.models[:property][:files_method])\n refs_to_delete = property_model_files.map(&:vebra_ref) - property_files.map { |f| f[:vebra_ref] }\n property_model_files.each do |file|\n file.destroy if refs_to_delete.include?(file.vebra_ref)\n end\n\n # find & update or build new files\n property_files.each do |file|\n begin\n file_model = property_model_files.find_by_vebra_ref(file[:vebra_ref])\n file_model = property_model_files.build unless file_model\n\n # extract accessible attributes for the file\n file_attributes = file.inject({}) do |result, (key, value)|\n result[key] = value if file_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n file_model.update_attributes(file_attributes)\n rescue CarrierWave::ProcessingError, OpenURI::HTTPError => e\n # just ignore the file\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n end\n\n property_model.no_callbacks = false if property_model.respond_to?(:no_callbacks)\n property_model.save\n return property_model\n end",
"def update!(**args)\n @id = args[:id] if args.key?(:id)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def update\n end",
"def update!(**args)\n @mid = args[:mid] if args.key?(:mid)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def modified_properties=(value)\n @modified_properties = value\n end",
"def apply_properties!(properties)\n # Non-commutitivity etc. eventually.\n end",
"def set_properties(hash)\n hash.each do |key, value|\n add_or_remove_ostruct_member(key, value)\n end\n rest_reset_properties\n end",
"def update\n\t\t\n\t\tend",
"def set_props(props)\n @props.merge!(props)\n end",
"def update() end",
"def update!(**args)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def assign_properties\n self.properties ||= {}\n listing_properties.each do |prop|\n self.properties[prop.key] ||= prop.value\n end\n end",
"def change_properties(new_current_floor, new_next_floor, new_movement)\n @current_floor = new_current_floor\n @next_floor = new_next_floor\n @movement = new_movement\n end",
"def update!(**args)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end",
"def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end",
"def update(attributes)\n (@attributes ||= {}).merge! attributes\n\n (self.class.attr_initializables & attributes.keys).each do |name|\n instance_variable_set :\"@#{name}\", attributes[name]\n end\n\n self\n end",
"def update_attributes(attrs)\n super({})\n end",
"def update\n @dirty = true\n end",
"def update\n\n # Run through the mixin updates\n colourable_update\n movable_update\n\n end",
"def set(props)\n props.each do |prop, val|\n self.send(:\"#{ prop }=\", val)\n end\n end",
"def update\n super\n end",
"def update!(**args)\n @property_id = args[:property_id] if args.key?(:property_id)\n @value_status = args[:value_status] if args.key?(:value_status)\n end",
"def update!(**args)\n @object_size_bytes = args[:object_size_bytes] if args.key?(:object_size_bytes)\n @object_version = args[:object_version] if args.key?(:object_version)\n end",
"def movable_update\n\n # Work through the different aspects we update\n movable_location_update\n movable_size_update\n movable_angle_update\n\n end",
"def properties=(value)\n @properties = value\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(context={})\n self.pre_cast_attributes\n m2o = @relations.reject{|k, v| !self.class.many2one_relations.has_key?(k)}\n vals = @attributes.reject {|key, value| key == 'id'}.merge(m2o.merge(m2o){|k, v| v.is_a?(Array) ? v[0] : v})\n self.class.rpc_execute('write', self.id, vals, context)\n reload_from_record!(self.class.find(self.id, :context => context))\n end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update ; end",
"def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end",
"def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end",
"def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end",
"def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end",
"def update_with(attributes)\n assign_attributes(attributes)\n end",
"def update\n # don't need to update; hash is shared\n end",
"def update(attributes)\n HashProxy.with(attributes) do |proxy|\n self.class.attribute_names.each do |name|\n send(\"#{name}=\", proxy[name]) if proxy.key?(name)\n end\n end\n save\n end",
"def update!(**args)\n @object_id_prop = args[:object_id_prop] if args.key?(:object_id_prop)\n @relation = args[:relation] if args.key?(:relation)\n @subject_id = args[:subject_id] if args.key?(:subject_id)\n end",
"def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end",
"def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end",
"def update\n raise NotImplementedError\n end",
"def update_attributes attributes\n @attributes.merge! attributes\n end",
"def update!(**args)\n @async_options = args[:async_options] if args.key?(:async_options)\n @input_mappings = args[:input_mappings] if args.key?(:input_mappings)\n @name_property = args[:name_property] if args.key?(:name_property)\n @validation_options = args[:validation_options] if args.key?(:validation_options)\n end",
"def update\r\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @type = args[:type] if args.key?(:type)\n end",
"def update\n raise NotImplemented\n end",
"def update_obj\n mean, sd = rating.to_glicko_rating\n @obj.rating = mean\n @obj.rating_deviation = sd\n @obj.volatility = volatility\n end",
"def update_values\n end",
"def update_values\n end",
"def update\n raise NotImplementedError\n end",
"def update!(**args)\n @answers_header_signals = args[:answers_header_signals] if args.key?(:answers_header_signals)\n @property_value = args[:property_value] if args.key?(:property_value)\n @response_meaning_application = args[:response_meaning_application] if args.key?(:response_meaning_application)\n end",
"def update!(**args)\n @create_time = args[:create_time] if args.key?(:create_time)\n @method_prop = args[:method_prop] if args.key?(:method_prop)\n @name = args[:name] if args.key?(:name)\n @state = args[:state] if args.key?(:state)\n end",
"def update attributes, collection #:nodoc:\n 0\n end",
"def update_property_groups(roll)\n @property_groups.each { |_, v| v.update_rent(roll) }\n end",
"def update!(**args)\n @source_property = args[:source_property] if args.key?(:source_property)\n 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 update_properties(path, properties)\n prop_patch = PropPatch.new(properties)\n emit('propPatch', [path, prop_patch])\n prop_patch.commit\n\n prop_patch.result\n end",
"def update\n set_deltatime\n set_last_update_at\n end"
] | [
"0.7012263",
"0.69181895",
"0.69181895",
"0.69181895",
"0.69181895",
"0.69181895",
"0.67403597",
"0.6709326",
"0.6709326",
"0.6696149",
"0.6696149",
"0.6696149",
"0.6696149",
"0.6618882",
"0.6571848",
"0.65386343",
"0.65178275",
"0.6394807",
"0.6389745",
"0.6389745",
"0.63328",
"0.6319025",
"0.6283673",
"0.6269463",
"0.62639254",
"0.62410724",
"0.62170374",
"0.62152076",
"0.6210263",
"0.6204041",
"0.6204041",
"0.62021106",
"0.62017816",
"0.62017",
"0.61730784",
"0.61730784",
"0.6159277",
"0.6156169",
"0.61445665",
"0.6125433",
"0.61241156",
"0.6121413",
"0.6110477",
"0.6105694",
"0.61016303",
"0.60845226",
"0.6084427",
"0.6065455",
"0.6059506",
"0.6054869",
"0.6051708",
"0.6051708",
"0.60413384",
"0.6030853",
"0.6022535",
"0.6015561",
"0.59932375",
"0.59898263",
"0.5976479",
"0.5973787",
"0.59678394",
"0.5963291",
"0.5962048",
"0.5961157",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.59500545",
"0.59443134",
"0.59443134",
"0.59424853",
"0.59424853",
"0.593523",
"0.5926413",
"0.5924831",
"0.592427",
"0.59233046",
"0.59233046",
"0.5921224",
"0.59144294",
"0.59142506",
"0.58887535",
"0.58854496",
"0.5883008",
"0.58792305",
"0.5876954",
"0.5876954",
"0.58744955",
"0.5857968",
"0.5845542",
"0.5841629",
"0.58363605",
"0.5829255",
"0.582919",
"0.5822138",
"0.58208305"
] | 0.0 | -1 |
Update properties of this object | def update!(**args)
@action = args[:action] if args.key?(:action)
@severity = args[:severity] if args.key?(:severity)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update_properties(hash)\n hash.each do |key, value|\n setter_method = \"#{key}=\"\n if self.respond_to?(setter_method)\n self.send(setter_method, value)\n end\n end\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def refresh\n self.class.base_properties.each_with_index do |prop, prop_id|\n @properties[prop] = get_property(prop_id)\n end\n refresh_features\n refresh_status\n refresh_config\n self\n end",
"def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\n end",
"def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\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 update_properties!(branch_id=nil)\n properties = fetch_properties(false, branch_id)\n length = properties.length\n counter = 0\n properties.each do |property|\n counter += 1\n if Vebra.debugging?\n puts \"[Vebra]: #{counter}/#{length}: live updating property with Vebra ref: #{property.attributes[:vebra_ref]}\"\n end\n live_update!(property)\n Vebra.set_last_updated_at(Time.now) if counter == length\n end\n end",
"def update_self obj\n obj.each do |k,v|\n instance_variable_set(\"@#{k}\", v) if v\n end\n end",
"def update_attributes(properties_hash)\n self.class.get_class_properties.each do |property|\n key = property[:name].to_sym\n if properties_hash.has_key? key\n self.setValue(properties_hash[key], forKey:key)\n end\n end\n end",
"def update\n # TODO: implement update\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @states = args[:states] if args.key?(:states)\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end",
"def update!(**args)\n @property = args[:property] if args.key?(:property)\n @total_value_count = args[:total_value_count] if args.key?(:total_value_count)\n @value = args[:value] if args.key?(:value)\n @value_status = args[:value_status] if args.key?(:value_status)\n end",
"def update\n \n end",
"def refresh\n set_attributes\n end",
"def update(attrs)\n @attrs.update(attrs)\n self\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @source = args[:source] if args.key?(:source)\n end",
"def update_resource object, attributes\n object.update attributes\n end",
"def update(attrs)\n @attrs ||= {}\n @attrs.update(attrs)\n self\n end",
"def update\n \n end",
"def update!(**args)\n @property = args[:property] if args.key?(:property)\n @schema = args[:schema] if args.key?(:schema)\n end",
"def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def _update!\n self.class.properties.each do |property, predicate|\n if dirty?(property)\n self.class.repository_or_fail.delete([subject, predicate[:predicate], nil])\n if self.class.is_list?(property)\n repo = RDF::Repository.new\n attribute_get(property).each do |value|\n repo << RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(value, self.class.properties[property][:type]))\n end\n self.class.repository_or_fail.insert(*repo)\n else\n self.class.repository_or_fail.insert(RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(attribute_get(property), self.class.properties[property][:type])))\n end\n end\n @dirty[property] = nil\n @attributes[:original][property] = attribute_get(property)\n end\n self.class.repository_or_fail.insert(RDF::Statement.new(@subject, RDF.type, type)) unless type.nil?\n end",
"def update(attributes = {})\n super(attributes)\n retrieve!\n self\n end",
"def update\n @objects.map(&:update);\n end",
"def update\n raise NotImplementedError\n end",
"def update\n raise NotImplementedError\n end",
"def live_update!(property)\n property_class = Vebra.models[:property][:class].to_s.camelize.constantize\n\n # ensure we have the full property attributes\n property.get_property if !property.attributes[:status] && property.attributes[:action] != 'deleted'\n\n # find & update or build a new property\n property_model = property_class.find_or_initialize_by_vebra_ref(property.attributes[:vebra_ref])\n\n # make sure property object is not empty\n return false if !property.attributes || !property.attributes[:property_type]\n\n # if the property has been deleted, mark it appropriately and move on\n if property.attributes[:action] == 'deleted'\n return property_model.destroy\n end\n\n # extract accessible attributes for the property\n property_accessibles = property_class.accessible_attributes.map(&:to_sym)\n property_attributes = property.attributes.inject({}) do |result, (key, value)|\n result[key] = value if property_accessibles.include?(key)\n result\n end\n\n # update the property model's attributes\n property_model.no_callbacks = true if property_model.respond_to?(:no_callbacks)\n property_model.update_attributes(property_attributes)\n\n # find & update or build a new address\n if Vebra.models[:address]\n address_class = Vebra.models[:address][:class].to_s.camelize.constantize\n address_model = property_model.send(Vebra.models[:property][:address_method])\n address_model = property_model.send(\"build_#{Vebra.models[:property][:address_method]}\") unless address_model\n\n # extract accessible attributes for the address\n address_accessibles = address_class.accessible_attributes.map(&:to_sym)\n address_attributes = property.attributes[:address].inject({}) do |result, (key, value)|\n result[key] = value if address_accessibles.include?(key)\n result\n end\n\n # update the address model's attributes\n address_model.update_attributes(address_attributes)\n end\n\n # find & update or build new rooms\n if Vebra.models[:room]\n room_class = Vebra.models[:room][:class].to_s.camelize.constantize\n\n # accessible attributes for the rooms\n room_accessibles = room_class.accessible_attributes.map(&:to_sym)\n\n # delete any rooms which are no longer present\n property_rooms = property.attributes[:rooms] || []\n property_model_rooms = property_model.send(Vebra.models[:property][:rooms_method])\n refs_to_delete = property_model_rooms.map(&:vebra_ref) - property_rooms.map { |r| r[:vebra_ref] }\n property_model_rooms.each do |room|\n room.destroy if refs_to_delete.include?(room.vebra_ref)\n end\n\n # find & update or build new rooms\n property_rooms.each do |room|\n room_model = room_class.find_by_property_id_and_vebra_ref(property_model.id, room[:vebra_ref])\n room_model = property_model_rooms.build unless room_model\n\n # extract accessible attributes for the room\n room_attributes = room.inject({}) do |result, (key, value)|\n result[key] = value if room_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n room_model.update_attributes(room_attributes)\n end\n end\n\n # find & update or build new file attachments\n if Vebra.models[:file]\n file_class = Vebra.models[:file][:class].to_s.camelize.constantize\n\n # accessible attributes for the files\n file_accessibles = file_class.accessible_attributes.map(&:to_sym)\n\n # first normalize the collection (currently nested collections)\n property_files = property.attributes[:files].inject([]) do |result, (kind, collection)|\n collection.each do |file|\n file[:type] = kind.to_s.singularize.camelize if file_accessibles.include?(:type)\n file[\"remote_#{Vebra.models[:file][:attachment_method]}_url\".to_sym] = file.delete(:url)\n # if file[:type] is set, it means the attachment file class can be subclassed. In this\n # case we need to ensure that the subclass exists. If not, we ignore this file\n begin\n file[:type].constantize if file_accessibles.include?(:type)\n result << file\n rescue NameError => e\n # ignore - this means the subclass does not exist\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n\n result\n end\n\n # delete any files which are no longer present\n property_model_files = property_model.send(Vebra.models[:property][:files_method])\n refs_to_delete = property_model_files.map(&:vebra_ref) - property_files.map { |f| f[:vebra_ref] }\n property_model_files.each do |file|\n file.destroy if refs_to_delete.include?(file.vebra_ref)\n end\n\n # find & update or build new files\n property_files.each do |file|\n begin\n file_model = property_model_files.find_by_vebra_ref(file[:vebra_ref])\n file_model = property_model_files.build unless file_model\n\n # extract accessible attributes for the file\n file_attributes = file.inject({}) do |result, (key, value)|\n result[key] = value if file_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n file_model.update_attributes(file_attributes)\n rescue CarrierWave::ProcessingError, OpenURI::HTTPError => e\n # just ignore the file\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n end\n\n property_model.no_callbacks = false if property_model.respond_to?(:no_callbacks)\n property_model.save\n return property_model\n end",
"def update!(**args)\n @id = args[:id] if args.key?(:id)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def update\n end",
"def update!(**args)\n @mid = args[:mid] if args.key?(:mid)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def modified_properties=(value)\n @modified_properties = value\n end",
"def apply_properties!(properties)\n # Non-commutitivity etc. eventually.\n end",
"def set_properties(hash)\n hash.each do |key, value|\n add_or_remove_ostruct_member(key, value)\n end\n rest_reset_properties\n end",
"def update\n\t\t\n\t\tend",
"def set_props(props)\n @props.merge!(props)\n end",
"def update() end",
"def update!(**args)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def assign_properties\n self.properties ||= {}\n listing_properties.each do |prop|\n self.properties[prop.key] ||= prop.value\n end\n end",
"def change_properties(new_current_floor, new_next_floor, new_movement)\n @current_floor = new_current_floor\n @next_floor = new_next_floor\n @movement = new_movement\n end",
"def update!(**args)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end",
"def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end",
"def update(attributes)\n (@attributes ||= {}).merge! attributes\n\n (self.class.attr_initializables & attributes.keys).each do |name|\n instance_variable_set :\"@#{name}\", attributes[name]\n end\n\n self\n end",
"def update_attributes(attrs)\n super({})\n end",
"def update\n @dirty = true\n end",
"def update\n\n # Run through the mixin updates\n colourable_update\n movable_update\n\n end",
"def set(props)\n props.each do |prop, val|\n self.send(:\"#{ prop }=\", val)\n end\n end",
"def update\n super\n end",
"def update!(**args)\n @property_id = args[:property_id] if args.key?(:property_id)\n @value_status = args[:value_status] if args.key?(:value_status)\n end",
"def update!(**args)\n @object_size_bytes = args[:object_size_bytes] if args.key?(:object_size_bytes)\n @object_version = args[:object_version] if args.key?(:object_version)\n end",
"def movable_update\n\n # Work through the different aspects we update\n movable_location_update\n movable_size_update\n movable_angle_update\n\n end",
"def properties=(value)\n @properties = value\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(context={})\n self.pre_cast_attributes\n m2o = @relations.reject{|k, v| !self.class.many2one_relations.has_key?(k)}\n vals = @attributes.reject {|key, value| key == 'id'}.merge(m2o.merge(m2o){|k, v| v.is_a?(Array) ? v[0] : v})\n self.class.rpc_execute('write', self.id, vals, context)\n reload_from_record!(self.class.find(self.id, :context => context))\n end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update ; end",
"def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end",
"def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end",
"def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end",
"def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end",
"def update_with(attributes)\n assign_attributes(attributes)\n end",
"def update\n # don't need to update; hash is shared\n end",
"def update(attributes)\n HashProxy.with(attributes) do |proxy|\n self.class.attribute_names.each do |name|\n send(\"#{name}=\", proxy[name]) if proxy.key?(name)\n end\n end\n save\n end",
"def update!(**args)\n @object_id_prop = args[:object_id_prop] if args.key?(:object_id_prop)\n @relation = args[:relation] if args.key?(:relation)\n @subject_id = args[:subject_id] if args.key?(:subject_id)\n end",
"def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end",
"def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end",
"def update\n raise NotImplementedError\n end",
"def update_attributes attributes\n @attributes.merge! attributes\n end",
"def update!(**args)\n @async_options = args[:async_options] if args.key?(:async_options)\n @input_mappings = args[:input_mappings] if args.key?(:input_mappings)\n @name_property = args[:name_property] if args.key?(:name_property)\n @validation_options = args[:validation_options] if args.key?(:validation_options)\n end",
"def update\r\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @type = args[:type] if args.key?(:type)\n end",
"def update\n raise NotImplemented\n end",
"def update_obj\n mean, sd = rating.to_glicko_rating\n @obj.rating = mean\n @obj.rating_deviation = sd\n @obj.volatility = volatility\n end",
"def update_values\n end",
"def update_values\n end",
"def update\n raise NotImplementedError\n end",
"def update!(**args)\n @answers_header_signals = args[:answers_header_signals] if args.key?(:answers_header_signals)\n @property_value = args[:property_value] if args.key?(:property_value)\n @response_meaning_application = args[:response_meaning_application] if args.key?(:response_meaning_application)\n end",
"def update!(**args)\n @create_time = args[:create_time] if args.key?(:create_time)\n @method_prop = args[:method_prop] if args.key?(:method_prop)\n @name = args[:name] if args.key?(:name)\n @state = args[:state] if args.key?(:state)\n end",
"def update attributes, collection #:nodoc:\n 0\n end",
"def update_property_groups(roll)\n @property_groups.each { |_, v| v.update_rent(roll) }\n end",
"def update!(**args)\n @source_property = args[:source_property] if args.key?(:source_property)\n 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 update_properties(path, properties)\n prop_patch = PropPatch.new(properties)\n emit('propPatch', [path, prop_patch])\n prop_patch.commit\n\n prop_patch.result\n end",
"def update\n set_deltatime\n set_last_update_at\n end"
] | [
"0.7012263",
"0.69181895",
"0.69181895",
"0.69181895",
"0.69181895",
"0.69181895",
"0.67403597",
"0.6709326",
"0.6709326",
"0.6696149",
"0.6696149",
"0.6696149",
"0.6696149",
"0.6618882",
"0.6571848",
"0.65386343",
"0.65178275",
"0.6394807",
"0.6389745",
"0.6389745",
"0.63328",
"0.6319025",
"0.6283673",
"0.6269463",
"0.62639254",
"0.62410724",
"0.62170374",
"0.62152076",
"0.6210263",
"0.6204041",
"0.6204041",
"0.62021106",
"0.62017816",
"0.62017",
"0.61730784",
"0.61730784",
"0.6159277",
"0.6156169",
"0.61445665",
"0.6125433",
"0.61241156",
"0.6121413",
"0.6110477",
"0.6105694",
"0.61016303",
"0.60845226",
"0.6084427",
"0.6065455",
"0.6059506",
"0.6054869",
"0.6051708",
"0.6051708",
"0.60413384",
"0.6030853",
"0.6022535",
"0.6015561",
"0.59932375",
"0.59898263",
"0.5976479",
"0.5973787",
"0.59678394",
"0.5963291",
"0.5962048",
"0.5961157",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.59500545",
"0.59443134",
"0.59443134",
"0.59424853",
"0.59424853",
"0.593523",
"0.5926413",
"0.5924831",
"0.592427",
"0.59233046",
"0.59233046",
"0.5921224",
"0.59144294",
"0.59142506",
"0.58887535",
"0.58854496",
"0.5883008",
"0.58792305",
"0.5876954",
"0.5876954",
"0.58744955",
"0.5857968",
"0.5845542",
"0.5841629",
"0.58363605",
"0.5829255",
"0.582919",
"0.5822138",
"0.58208305"
] | 0.0 | -1 |
Update properties of this object | def update!(**args)
@ip_blocks = args[:ip_blocks] if args.key?(:ip_blocks)
@principals = args[:principals] if args.key?(:principals)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update_properties(hash)\n hash.each do |key, value|\n setter_method = \"#{key}=\"\n if self.respond_to?(setter_method)\n self.send(setter_method, value)\n end\n end\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def refresh\n self.class.base_properties.each_with_index do |prop, prop_id|\n @properties[prop] = get_property(prop_id)\n end\n refresh_features\n refresh_status\n refresh_config\n self\n end",
"def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\n end",
"def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\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 update_properties!(branch_id=nil)\n properties = fetch_properties(false, branch_id)\n length = properties.length\n counter = 0\n properties.each do |property|\n counter += 1\n if Vebra.debugging?\n puts \"[Vebra]: #{counter}/#{length}: live updating property with Vebra ref: #{property.attributes[:vebra_ref]}\"\n end\n live_update!(property)\n Vebra.set_last_updated_at(Time.now) if counter == length\n end\n end",
"def update_self obj\n obj.each do |k,v|\n instance_variable_set(\"@#{k}\", v) if v\n end\n end",
"def update_attributes(properties_hash)\n self.class.get_class_properties.each do |property|\n key = property[:name].to_sym\n if properties_hash.has_key? key\n self.setValue(properties_hash[key], forKey:key)\n end\n end\n end",
"def update\n # TODO: implement update\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @states = args[:states] if args.key?(:states)\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end",
"def update!(**args)\n @property = args[:property] if args.key?(:property)\n @total_value_count = args[:total_value_count] if args.key?(:total_value_count)\n @value = args[:value] if args.key?(:value)\n @value_status = args[:value_status] if args.key?(:value_status)\n end",
"def update\n \n end",
"def refresh\n set_attributes\n end",
"def update(attrs)\n @attrs.update(attrs)\n self\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @source = args[:source] if args.key?(:source)\n end",
"def update_resource object, attributes\n object.update attributes\n end",
"def update(attrs)\n @attrs ||= {}\n @attrs.update(attrs)\n self\n end",
"def update\n \n end",
"def update!(**args)\n @property = args[:property] if args.key?(:property)\n @schema = args[:schema] if args.key?(:schema)\n end",
"def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def _update!\n self.class.properties.each do |property, predicate|\n if dirty?(property)\n self.class.repository_or_fail.delete([subject, predicate[:predicate], nil])\n if self.class.is_list?(property)\n repo = RDF::Repository.new\n attribute_get(property).each do |value|\n repo << RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(value, self.class.properties[property][:type]))\n end\n self.class.repository_or_fail.insert(*repo)\n else\n self.class.repository_or_fail.insert(RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(attribute_get(property), self.class.properties[property][:type])))\n end\n end\n @dirty[property] = nil\n @attributes[:original][property] = attribute_get(property)\n end\n self.class.repository_or_fail.insert(RDF::Statement.new(@subject, RDF.type, type)) unless type.nil?\n end",
"def update(attributes = {})\n super(attributes)\n retrieve!\n self\n end",
"def update\n @objects.map(&:update);\n end",
"def update\n raise NotImplementedError\n end",
"def update\n raise NotImplementedError\n end",
"def live_update!(property)\n property_class = Vebra.models[:property][:class].to_s.camelize.constantize\n\n # ensure we have the full property attributes\n property.get_property if !property.attributes[:status] && property.attributes[:action] != 'deleted'\n\n # find & update or build a new property\n property_model = property_class.find_or_initialize_by_vebra_ref(property.attributes[:vebra_ref])\n\n # make sure property object is not empty\n return false if !property.attributes || !property.attributes[:property_type]\n\n # if the property has been deleted, mark it appropriately and move on\n if property.attributes[:action] == 'deleted'\n return property_model.destroy\n end\n\n # extract accessible attributes for the property\n property_accessibles = property_class.accessible_attributes.map(&:to_sym)\n property_attributes = property.attributes.inject({}) do |result, (key, value)|\n result[key] = value if property_accessibles.include?(key)\n result\n end\n\n # update the property model's attributes\n property_model.no_callbacks = true if property_model.respond_to?(:no_callbacks)\n property_model.update_attributes(property_attributes)\n\n # find & update or build a new address\n if Vebra.models[:address]\n address_class = Vebra.models[:address][:class].to_s.camelize.constantize\n address_model = property_model.send(Vebra.models[:property][:address_method])\n address_model = property_model.send(\"build_#{Vebra.models[:property][:address_method]}\") unless address_model\n\n # extract accessible attributes for the address\n address_accessibles = address_class.accessible_attributes.map(&:to_sym)\n address_attributes = property.attributes[:address].inject({}) do |result, (key, value)|\n result[key] = value if address_accessibles.include?(key)\n result\n end\n\n # update the address model's attributes\n address_model.update_attributes(address_attributes)\n end\n\n # find & update or build new rooms\n if Vebra.models[:room]\n room_class = Vebra.models[:room][:class].to_s.camelize.constantize\n\n # accessible attributes for the rooms\n room_accessibles = room_class.accessible_attributes.map(&:to_sym)\n\n # delete any rooms which are no longer present\n property_rooms = property.attributes[:rooms] || []\n property_model_rooms = property_model.send(Vebra.models[:property][:rooms_method])\n refs_to_delete = property_model_rooms.map(&:vebra_ref) - property_rooms.map { |r| r[:vebra_ref] }\n property_model_rooms.each do |room|\n room.destroy if refs_to_delete.include?(room.vebra_ref)\n end\n\n # find & update or build new rooms\n property_rooms.each do |room|\n room_model = room_class.find_by_property_id_and_vebra_ref(property_model.id, room[:vebra_ref])\n room_model = property_model_rooms.build unless room_model\n\n # extract accessible attributes for the room\n room_attributes = room.inject({}) do |result, (key, value)|\n result[key] = value if room_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n room_model.update_attributes(room_attributes)\n end\n end\n\n # find & update or build new file attachments\n if Vebra.models[:file]\n file_class = Vebra.models[:file][:class].to_s.camelize.constantize\n\n # accessible attributes for the files\n file_accessibles = file_class.accessible_attributes.map(&:to_sym)\n\n # first normalize the collection (currently nested collections)\n property_files = property.attributes[:files].inject([]) do |result, (kind, collection)|\n collection.each do |file|\n file[:type] = kind.to_s.singularize.camelize if file_accessibles.include?(:type)\n file[\"remote_#{Vebra.models[:file][:attachment_method]}_url\".to_sym] = file.delete(:url)\n # if file[:type] is set, it means the attachment file class can be subclassed. In this\n # case we need to ensure that the subclass exists. If not, we ignore this file\n begin\n file[:type].constantize if file_accessibles.include?(:type)\n result << file\n rescue NameError => e\n # ignore - this means the subclass does not exist\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n\n result\n end\n\n # delete any files which are no longer present\n property_model_files = property_model.send(Vebra.models[:property][:files_method])\n refs_to_delete = property_model_files.map(&:vebra_ref) - property_files.map { |f| f[:vebra_ref] }\n property_model_files.each do |file|\n file.destroy if refs_to_delete.include?(file.vebra_ref)\n end\n\n # find & update or build new files\n property_files.each do |file|\n begin\n file_model = property_model_files.find_by_vebra_ref(file[:vebra_ref])\n file_model = property_model_files.build unless file_model\n\n # extract accessible attributes for the file\n file_attributes = file.inject({}) do |result, (key, value)|\n result[key] = value if file_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n file_model.update_attributes(file_attributes)\n rescue CarrierWave::ProcessingError, OpenURI::HTTPError => e\n # just ignore the file\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n end\n\n property_model.no_callbacks = false if property_model.respond_to?(:no_callbacks)\n property_model.save\n return property_model\n end",
"def update!(**args)\n @id = args[:id] if args.key?(:id)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def update\n end",
"def update!(**args)\n @mid = args[:mid] if args.key?(:mid)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def modified_properties=(value)\n @modified_properties = value\n end",
"def apply_properties!(properties)\n # Non-commutitivity etc. eventually.\n end",
"def set_properties(hash)\n hash.each do |key, value|\n add_or_remove_ostruct_member(key, value)\n end\n rest_reset_properties\n end",
"def update\n\t\t\n\t\tend",
"def set_props(props)\n @props.merge!(props)\n end",
"def update() end",
"def update!(**args)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def assign_properties\n self.properties ||= {}\n listing_properties.each do |prop|\n self.properties[prop.key] ||= prop.value\n end\n end",
"def change_properties(new_current_floor, new_next_floor, new_movement)\n @current_floor = new_current_floor\n @next_floor = new_next_floor\n @movement = new_movement\n end",
"def update!(**args)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end",
"def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end",
"def update(attributes)\n (@attributes ||= {}).merge! attributes\n\n (self.class.attr_initializables & attributes.keys).each do |name|\n instance_variable_set :\"@#{name}\", attributes[name]\n end\n\n self\n end",
"def update_attributes(attrs)\n super({})\n end",
"def update\n @dirty = true\n end",
"def update\n\n # Run through the mixin updates\n colourable_update\n movable_update\n\n end",
"def set(props)\n props.each do |prop, val|\n self.send(:\"#{ prop }=\", val)\n end\n end",
"def update\n super\n end",
"def update!(**args)\n @property_id = args[:property_id] if args.key?(:property_id)\n @value_status = args[:value_status] if args.key?(:value_status)\n end",
"def update!(**args)\n @object_size_bytes = args[:object_size_bytes] if args.key?(:object_size_bytes)\n @object_version = args[:object_version] if args.key?(:object_version)\n end",
"def movable_update\n\n # Work through the different aspects we update\n movable_location_update\n movable_size_update\n movable_angle_update\n\n end",
"def properties=(value)\n @properties = value\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(context={})\n self.pre_cast_attributes\n m2o = @relations.reject{|k, v| !self.class.many2one_relations.has_key?(k)}\n vals = @attributes.reject {|key, value| key == 'id'}.merge(m2o.merge(m2o){|k, v| v.is_a?(Array) ? v[0] : v})\n self.class.rpc_execute('write', self.id, vals, context)\n reload_from_record!(self.class.find(self.id, :context => context))\n end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update ; end",
"def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end",
"def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end",
"def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end",
"def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end",
"def update_with(attributes)\n assign_attributes(attributes)\n end",
"def update\n # don't need to update; hash is shared\n end",
"def update(attributes)\n HashProxy.with(attributes) do |proxy|\n self.class.attribute_names.each do |name|\n send(\"#{name}=\", proxy[name]) if proxy.key?(name)\n end\n end\n save\n end",
"def update!(**args)\n @object_id_prop = args[:object_id_prop] if args.key?(:object_id_prop)\n @relation = args[:relation] if args.key?(:relation)\n @subject_id = args[:subject_id] if args.key?(:subject_id)\n end",
"def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end",
"def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end",
"def update\n raise NotImplementedError\n end",
"def update_attributes attributes\n @attributes.merge! attributes\n end",
"def update!(**args)\n @async_options = args[:async_options] if args.key?(:async_options)\n @input_mappings = args[:input_mappings] if args.key?(:input_mappings)\n @name_property = args[:name_property] if args.key?(:name_property)\n @validation_options = args[:validation_options] if args.key?(:validation_options)\n end",
"def update\r\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @type = args[:type] if args.key?(:type)\n end",
"def update\n raise NotImplemented\n end",
"def update_obj\n mean, sd = rating.to_glicko_rating\n @obj.rating = mean\n @obj.rating_deviation = sd\n @obj.volatility = volatility\n end",
"def update_values\n end",
"def update_values\n end",
"def update\n raise NotImplementedError\n end",
"def update!(**args)\n @answers_header_signals = args[:answers_header_signals] if args.key?(:answers_header_signals)\n @property_value = args[:property_value] if args.key?(:property_value)\n @response_meaning_application = args[:response_meaning_application] if args.key?(:response_meaning_application)\n end",
"def update!(**args)\n @create_time = args[:create_time] if args.key?(:create_time)\n @method_prop = args[:method_prop] if args.key?(:method_prop)\n @name = args[:name] if args.key?(:name)\n @state = args[:state] if args.key?(:state)\n end",
"def update attributes, collection #:nodoc:\n 0\n end",
"def update_property_groups(roll)\n @property_groups.each { |_, v| v.update_rent(roll) }\n end",
"def update!(**args)\n @source_property = args[:source_property] if args.key?(:source_property)\n 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 update_properties(path, properties)\n prop_patch = PropPatch.new(properties)\n emit('propPatch', [path, prop_patch])\n prop_patch.commit\n\n prop_patch.result\n end",
"def update\n set_deltatime\n set_last_update_at\n end"
] | [
"0.7012263",
"0.69181895",
"0.69181895",
"0.69181895",
"0.69181895",
"0.69181895",
"0.67403597",
"0.6709326",
"0.6709326",
"0.6696149",
"0.6696149",
"0.6696149",
"0.6696149",
"0.6618882",
"0.6571848",
"0.65386343",
"0.65178275",
"0.6394807",
"0.6389745",
"0.6389745",
"0.63328",
"0.6319025",
"0.6283673",
"0.6269463",
"0.62639254",
"0.62410724",
"0.62170374",
"0.62152076",
"0.6210263",
"0.6204041",
"0.6204041",
"0.62021106",
"0.62017816",
"0.62017",
"0.61730784",
"0.61730784",
"0.6159277",
"0.6156169",
"0.61445665",
"0.6125433",
"0.61241156",
"0.6121413",
"0.6110477",
"0.6105694",
"0.61016303",
"0.60845226",
"0.6084427",
"0.6065455",
"0.6059506",
"0.6054869",
"0.6051708",
"0.6051708",
"0.60413384",
"0.6030853",
"0.6022535",
"0.6015561",
"0.59932375",
"0.59898263",
"0.5976479",
"0.5973787",
"0.59678394",
"0.5963291",
"0.5962048",
"0.5961157",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.59500545",
"0.59443134",
"0.59443134",
"0.59424853",
"0.59424853",
"0.593523",
"0.5926413",
"0.5924831",
"0.592427",
"0.59233046",
"0.59233046",
"0.5921224",
"0.59144294",
"0.59142506",
"0.58887535",
"0.58854496",
"0.5883008",
"0.58792305",
"0.5876954",
"0.5876954",
"0.58744955",
"0.5857968",
"0.5845542",
"0.5841629",
"0.58363605",
"0.5829255",
"0.582919",
"0.5822138",
"0.58208305"
] | 0.0 | -1 |
Update properties of this object | def update!(**args)
@code = args[:code] if args.key?(:code)
@details = args[:details] if args.key?(:details)
@message = args[:message] if args.key?(:message)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update_properties(hash)\n hash.each do |key, value|\n setter_method = \"#{key}=\"\n if self.respond_to?(setter_method)\n self.send(setter_method, value)\n end\n end\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def refresh\n self.class.base_properties.each_with_index do |prop, prop_id|\n @properties[prop] = get_property(prop_id)\n end\n refresh_features\n refresh_status\n refresh_config\n self\n end",
"def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\n end",
"def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\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 update_properties!(branch_id=nil)\n properties = fetch_properties(false, branch_id)\n length = properties.length\n counter = 0\n properties.each do |property|\n counter += 1\n if Vebra.debugging?\n puts \"[Vebra]: #{counter}/#{length}: live updating property with Vebra ref: #{property.attributes[:vebra_ref]}\"\n end\n live_update!(property)\n Vebra.set_last_updated_at(Time.now) if counter == length\n end\n end",
"def update_self obj\n obj.each do |k,v|\n instance_variable_set(\"@#{k}\", v) if v\n end\n end",
"def update_attributes(properties_hash)\n self.class.get_class_properties.each do |property|\n key = property[:name].to_sym\n if properties_hash.has_key? key\n self.setValue(properties_hash[key], forKey:key)\n end\n end\n end",
"def update\n # TODO: implement update\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @states = args[:states] if args.key?(:states)\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end",
"def update!(**args)\n @property = args[:property] if args.key?(:property)\n @total_value_count = args[:total_value_count] if args.key?(:total_value_count)\n @value = args[:value] if args.key?(:value)\n @value_status = args[:value_status] if args.key?(:value_status)\n end",
"def update\n \n end",
"def refresh\n set_attributes\n end",
"def update(attrs)\n @attrs.update(attrs)\n self\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @source = args[:source] if args.key?(:source)\n end",
"def update_resource object, attributes\n object.update attributes\n end",
"def update(attrs)\n @attrs ||= {}\n @attrs.update(attrs)\n self\n end",
"def update\n \n end",
"def update!(**args)\n @property = args[:property] if args.key?(:property)\n @schema = args[:schema] if args.key?(:schema)\n end",
"def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def update(attributes = {})\n super(attributes)\n retrieve!\n self\n end",
"def _update!\n self.class.properties.each do |property, predicate|\n if dirty?(property)\n self.class.repository_or_fail.delete([subject, predicate[:predicate], nil])\n if self.class.is_list?(property)\n repo = RDF::Repository.new\n attribute_get(property).each do |value|\n repo << RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(value, self.class.properties[property][:type]))\n end\n self.class.repository_or_fail.insert(*repo)\n else\n self.class.repository_or_fail.insert(RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(attribute_get(property), self.class.properties[property][:type])))\n end\n end\n @dirty[property] = nil\n @attributes[:original][property] = attribute_get(property)\n end\n self.class.repository_or_fail.insert(RDF::Statement.new(@subject, RDF.type, type)) unless type.nil?\n end",
"def update\n @objects.map(&:update);\n end",
"def update\n raise NotImplementedError\n end",
"def update\n raise NotImplementedError\n end",
"def live_update!(property)\n property_class = Vebra.models[:property][:class].to_s.camelize.constantize\n\n # ensure we have the full property attributes\n property.get_property if !property.attributes[:status] && property.attributes[:action] != 'deleted'\n\n # find & update or build a new property\n property_model = property_class.find_or_initialize_by_vebra_ref(property.attributes[:vebra_ref])\n\n # make sure property object is not empty\n return false if !property.attributes || !property.attributes[:property_type]\n\n # if the property has been deleted, mark it appropriately and move on\n if property.attributes[:action] == 'deleted'\n return property_model.destroy\n end\n\n # extract accessible attributes for the property\n property_accessibles = property_class.accessible_attributes.map(&:to_sym)\n property_attributes = property.attributes.inject({}) do |result, (key, value)|\n result[key] = value if property_accessibles.include?(key)\n result\n end\n\n # update the property model's attributes\n property_model.no_callbacks = true if property_model.respond_to?(:no_callbacks)\n property_model.update_attributes(property_attributes)\n\n # find & update or build a new address\n if Vebra.models[:address]\n address_class = Vebra.models[:address][:class].to_s.camelize.constantize\n address_model = property_model.send(Vebra.models[:property][:address_method])\n address_model = property_model.send(\"build_#{Vebra.models[:property][:address_method]}\") unless address_model\n\n # extract accessible attributes for the address\n address_accessibles = address_class.accessible_attributes.map(&:to_sym)\n address_attributes = property.attributes[:address].inject({}) do |result, (key, value)|\n result[key] = value if address_accessibles.include?(key)\n result\n end\n\n # update the address model's attributes\n address_model.update_attributes(address_attributes)\n end\n\n # find & update or build new rooms\n if Vebra.models[:room]\n room_class = Vebra.models[:room][:class].to_s.camelize.constantize\n\n # accessible attributes for the rooms\n room_accessibles = room_class.accessible_attributes.map(&:to_sym)\n\n # delete any rooms which are no longer present\n property_rooms = property.attributes[:rooms] || []\n property_model_rooms = property_model.send(Vebra.models[:property][:rooms_method])\n refs_to_delete = property_model_rooms.map(&:vebra_ref) - property_rooms.map { |r| r[:vebra_ref] }\n property_model_rooms.each do |room|\n room.destroy if refs_to_delete.include?(room.vebra_ref)\n end\n\n # find & update or build new rooms\n property_rooms.each do |room|\n room_model = room_class.find_by_property_id_and_vebra_ref(property_model.id, room[:vebra_ref])\n room_model = property_model_rooms.build unless room_model\n\n # extract accessible attributes for the room\n room_attributes = room.inject({}) do |result, (key, value)|\n result[key] = value if room_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n room_model.update_attributes(room_attributes)\n end\n end\n\n # find & update or build new file attachments\n if Vebra.models[:file]\n file_class = Vebra.models[:file][:class].to_s.camelize.constantize\n\n # accessible attributes for the files\n file_accessibles = file_class.accessible_attributes.map(&:to_sym)\n\n # first normalize the collection (currently nested collections)\n property_files = property.attributes[:files].inject([]) do |result, (kind, collection)|\n collection.each do |file|\n file[:type] = kind.to_s.singularize.camelize if file_accessibles.include?(:type)\n file[\"remote_#{Vebra.models[:file][:attachment_method]}_url\".to_sym] = file.delete(:url)\n # if file[:type] is set, it means the attachment file class can be subclassed. In this\n # case we need to ensure that the subclass exists. If not, we ignore this file\n begin\n file[:type].constantize if file_accessibles.include?(:type)\n result << file\n rescue NameError => e\n # ignore - this means the subclass does not exist\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n\n result\n end\n\n # delete any files which are no longer present\n property_model_files = property_model.send(Vebra.models[:property][:files_method])\n refs_to_delete = property_model_files.map(&:vebra_ref) - property_files.map { |f| f[:vebra_ref] }\n property_model_files.each do |file|\n file.destroy if refs_to_delete.include?(file.vebra_ref)\n end\n\n # find & update or build new files\n property_files.each do |file|\n begin\n file_model = property_model_files.find_by_vebra_ref(file[:vebra_ref])\n file_model = property_model_files.build unless file_model\n\n # extract accessible attributes for the file\n file_attributes = file.inject({}) do |result, (key, value)|\n result[key] = value if file_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n file_model.update_attributes(file_attributes)\n rescue CarrierWave::ProcessingError, OpenURI::HTTPError => e\n # just ignore the file\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n end\n\n property_model.no_callbacks = false if property_model.respond_to?(:no_callbacks)\n property_model.save\n return property_model\n end",
"def update!(**args)\n @id = args[:id] if args.key?(:id)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def update\n end",
"def update!(**args)\n @mid = args[:mid] if args.key?(:mid)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def modified_properties=(value)\n @modified_properties = value\n end",
"def apply_properties!(properties)\n # Non-commutitivity etc. eventually.\n end",
"def set_properties(hash)\n hash.each do |key, value|\n add_or_remove_ostruct_member(key, value)\n end\n rest_reset_properties\n end",
"def update\n\t\t\n\t\tend",
"def set_props(props)\n @props.merge!(props)\n end",
"def update() end",
"def update!(**args)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def assign_properties\n self.properties ||= {}\n listing_properties.each do |prop|\n self.properties[prop.key] ||= prop.value\n end\n end",
"def change_properties(new_current_floor, new_next_floor, new_movement)\n @current_floor = new_current_floor\n @next_floor = new_next_floor\n @movement = new_movement\n end",
"def update!(**args)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end",
"def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end",
"def update(attributes)\n (@attributes ||= {}).merge! attributes\n\n (self.class.attr_initializables & attributes.keys).each do |name|\n instance_variable_set :\"@#{name}\", attributes[name]\n end\n\n self\n end",
"def update_attributes(attrs)\n super({})\n end",
"def update\n @dirty = true\n end",
"def update\n\n # Run through the mixin updates\n colourable_update\n movable_update\n\n end",
"def set(props)\n props.each do |prop, val|\n self.send(:\"#{ prop }=\", val)\n end\n end",
"def update\n super\n end",
"def update!(**args)\n @property_id = args[:property_id] if args.key?(:property_id)\n @value_status = args[:value_status] if args.key?(:value_status)\n end",
"def update!(**args)\n @object_size_bytes = args[:object_size_bytes] if args.key?(:object_size_bytes)\n @object_version = args[:object_version] if args.key?(:object_version)\n end",
"def movable_update\n\n # Work through the different aspects we update\n movable_location_update\n movable_size_update\n movable_angle_update\n\n end",
"def properties=(value)\n @properties = value\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(context={})\n self.pre_cast_attributes\n m2o = @relations.reject{|k, v| !self.class.many2one_relations.has_key?(k)}\n vals = @attributes.reject {|key, value| key == 'id'}.merge(m2o.merge(m2o){|k, v| v.is_a?(Array) ? v[0] : v})\n self.class.rpc_execute('write', self.id, vals, context)\n reload_from_record!(self.class.find(self.id, :context => context))\n end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update ; end",
"def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end",
"def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end",
"def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end",
"def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end",
"def update_with(attributes)\n assign_attributes(attributes)\n end",
"def update\n # don't need to update; hash is shared\n end",
"def update(attributes)\n HashProxy.with(attributes) do |proxy|\n self.class.attribute_names.each do |name|\n send(\"#{name}=\", proxy[name]) if proxy.key?(name)\n end\n end\n save\n end",
"def update!(**args)\n @object_id_prop = args[:object_id_prop] if args.key?(:object_id_prop)\n @relation = args[:relation] if args.key?(:relation)\n @subject_id = args[:subject_id] if args.key?(:subject_id)\n end",
"def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end",
"def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end",
"def update\n raise NotImplementedError\n end",
"def update_attributes attributes\n @attributes.merge! attributes\n end",
"def update!(**args)\n @async_options = args[:async_options] if args.key?(:async_options)\n @input_mappings = args[:input_mappings] if args.key?(:input_mappings)\n @name_property = args[:name_property] if args.key?(:name_property)\n @validation_options = args[:validation_options] if args.key?(:validation_options)\n end",
"def update\r\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @type = args[:type] if args.key?(:type)\n end",
"def update\n raise NotImplemented\n end",
"def update_obj\n mean, sd = rating.to_glicko_rating\n @obj.rating = mean\n @obj.rating_deviation = sd\n @obj.volatility = volatility\n end",
"def update_values\n end",
"def update_values\n end",
"def update\n raise NotImplementedError\n end",
"def update!(**args)\n @answers_header_signals = args[:answers_header_signals] if args.key?(:answers_header_signals)\n @property_value = args[:property_value] if args.key?(:property_value)\n @response_meaning_application = args[:response_meaning_application] if args.key?(:response_meaning_application)\n end",
"def update!(**args)\n @create_time = args[:create_time] if args.key?(:create_time)\n @method_prop = args[:method_prop] if args.key?(:method_prop)\n @name = args[:name] if args.key?(:name)\n @state = args[:state] if args.key?(:state)\n end",
"def update attributes, collection #:nodoc:\n 0\n end",
"def update_property_groups(roll)\n @property_groups.each { |_, v| v.update_rent(roll) }\n 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 update!(**args)\n @source_property = args[:source_property] if args.key?(:source_property)\n end",
"def update_properties(path, properties)\n prop_patch = PropPatch.new(properties)\n emit('propPatch', [path, prop_patch])\n prop_patch.commit\n\n prop_patch.result\n end",
"def update\n set_deltatime\n set_last_update_at\n end"
] | [
"0.7012568",
"0.6918917",
"0.6918917",
"0.6918917",
"0.6918917",
"0.6918917",
"0.67404634",
"0.6709981",
"0.6709981",
"0.66964126",
"0.66964126",
"0.66964126",
"0.66964126",
"0.6619218",
"0.6570895",
"0.6539287",
"0.6517026",
"0.63946927",
"0.63901657",
"0.63901657",
"0.63328683",
"0.6318612",
"0.62846893",
"0.62692374",
"0.6264273",
"0.6241163",
"0.6216599",
"0.6214641",
"0.6210363",
"0.6203827",
"0.6203827",
"0.620312",
"0.6201905",
"0.62001497",
"0.61728275",
"0.61728275",
"0.6159924",
"0.61569315",
"0.61442953",
"0.61260897",
"0.6125199",
"0.61227936",
"0.61111224",
"0.610543",
"0.6102925",
"0.60839343",
"0.6083609",
"0.6066973",
"0.60602766",
"0.6055065",
"0.6051568",
"0.6051568",
"0.6042057",
"0.60319084",
"0.60221004",
"0.60149413",
"0.5994295",
"0.5989816",
"0.597674",
"0.5973157",
"0.5967343",
"0.5965598",
"0.59629464",
"0.59618354",
"0.5950329",
"0.5950329",
"0.5950329",
"0.5950329",
"0.5950329",
"0.5950329",
"0.5950329",
"0.5950329",
"0.59495455",
"0.59442014",
"0.59442014",
"0.5944142",
"0.5944142",
"0.59361076",
"0.5925741",
"0.5925574",
"0.59250593",
"0.5924476",
"0.5924476",
"0.5921039",
"0.59155524",
"0.59145254",
"0.5888445",
"0.58860934",
"0.5882302",
"0.5879913",
"0.5877467",
"0.5877467",
"0.58743787",
"0.585829",
"0.584583",
"0.58408254",
"0.5835501",
"0.5829063",
"0.5828611",
"0.58228916",
"0.5819882"
] | 0.0 | -1 |
Update properties of this object | def update!(**args)
@action = args[:action] if args.key?(:action)
@threat_id = args[:threat_id] if args.key?(:threat_id)
@type = args[:type] if args.key?(:type)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update_properties(hash)\n hash.each do |key, value|\n setter_method = \"#{key}=\"\n if self.respond_to?(setter_method)\n self.send(setter_method, value)\n end\n end\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def refresh\n self.class.base_properties.each_with_index do |prop, prop_id|\n @properties[prop] = get_property(prop_id)\n end\n refresh_features\n refresh_status\n refresh_config\n self\n end",
"def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\n end",
"def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\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 update_properties!(branch_id=nil)\n properties = fetch_properties(false, branch_id)\n length = properties.length\n counter = 0\n properties.each do |property|\n counter += 1\n if Vebra.debugging?\n puts \"[Vebra]: #{counter}/#{length}: live updating property with Vebra ref: #{property.attributes[:vebra_ref]}\"\n end\n live_update!(property)\n Vebra.set_last_updated_at(Time.now) if counter == length\n end\n end",
"def update_self obj\n obj.each do |k,v|\n instance_variable_set(\"@#{k}\", v) if v\n end\n end",
"def update_attributes(properties_hash)\n self.class.get_class_properties.each do |property|\n key = property[:name].to_sym\n if properties_hash.has_key? key\n self.setValue(properties_hash[key], forKey:key)\n end\n end\n end",
"def update\n # TODO: implement update\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @states = args[:states] if args.key?(:states)\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end",
"def update!(**args)\n @property = args[:property] if args.key?(:property)\n @total_value_count = args[:total_value_count] if args.key?(:total_value_count)\n @value = args[:value] if args.key?(:value)\n @value_status = args[:value_status] if args.key?(:value_status)\n end",
"def update\n \n end",
"def refresh\n set_attributes\n end",
"def update(attrs)\n @attrs.update(attrs)\n self\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @source = args[:source] if args.key?(:source)\n end",
"def update_resource object, attributes\n object.update attributes\n end",
"def update(attrs)\n @attrs ||= {}\n @attrs.update(attrs)\n self\n end",
"def update\n \n end",
"def update!(**args)\n @property = args[:property] if args.key?(:property)\n @schema = args[:schema] if args.key?(:schema)\n end",
"def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def _update!\n self.class.properties.each do |property, predicate|\n if dirty?(property)\n self.class.repository_or_fail.delete([subject, predicate[:predicate], nil])\n if self.class.is_list?(property)\n repo = RDF::Repository.new\n attribute_get(property).each do |value|\n repo << RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(value, self.class.properties[property][:type]))\n end\n self.class.repository_or_fail.insert(*repo)\n else\n self.class.repository_or_fail.insert(RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(attribute_get(property), self.class.properties[property][:type])))\n end\n end\n @dirty[property] = nil\n @attributes[:original][property] = attribute_get(property)\n end\n self.class.repository_or_fail.insert(RDF::Statement.new(@subject, RDF.type, type)) unless type.nil?\n end",
"def update(attributes = {})\n super(attributes)\n retrieve!\n self\n end",
"def update\n @objects.map(&:update);\n end",
"def update\n raise NotImplementedError\n end",
"def update\n raise NotImplementedError\n end",
"def live_update!(property)\n property_class = Vebra.models[:property][:class].to_s.camelize.constantize\n\n # ensure we have the full property attributes\n property.get_property if !property.attributes[:status] && property.attributes[:action] != 'deleted'\n\n # find & update or build a new property\n property_model = property_class.find_or_initialize_by_vebra_ref(property.attributes[:vebra_ref])\n\n # make sure property object is not empty\n return false if !property.attributes || !property.attributes[:property_type]\n\n # if the property has been deleted, mark it appropriately and move on\n if property.attributes[:action] == 'deleted'\n return property_model.destroy\n end\n\n # extract accessible attributes for the property\n property_accessibles = property_class.accessible_attributes.map(&:to_sym)\n property_attributes = property.attributes.inject({}) do |result, (key, value)|\n result[key] = value if property_accessibles.include?(key)\n result\n end\n\n # update the property model's attributes\n property_model.no_callbacks = true if property_model.respond_to?(:no_callbacks)\n property_model.update_attributes(property_attributes)\n\n # find & update or build a new address\n if Vebra.models[:address]\n address_class = Vebra.models[:address][:class].to_s.camelize.constantize\n address_model = property_model.send(Vebra.models[:property][:address_method])\n address_model = property_model.send(\"build_#{Vebra.models[:property][:address_method]}\") unless address_model\n\n # extract accessible attributes for the address\n address_accessibles = address_class.accessible_attributes.map(&:to_sym)\n address_attributes = property.attributes[:address].inject({}) do |result, (key, value)|\n result[key] = value if address_accessibles.include?(key)\n result\n end\n\n # update the address model's attributes\n address_model.update_attributes(address_attributes)\n end\n\n # find & update or build new rooms\n if Vebra.models[:room]\n room_class = Vebra.models[:room][:class].to_s.camelize.constantize\n\n # accessible attributes for the rooms\n room_accessibles = room_class.accessible_attributes.map(&:to_sym)\n\n # delete any rooms which are no longer present\n property_rooms = property.attributes[:rooms] || []\n property_model_rooms = property_model.send(Vebra.models[:property][:rooms_method])\n refs_to_delete = property_model_rooms.map(&:vebra_ref) - property_rooms.map { |r| r[:vebra_ref] }\n property_model_rooms.each do |room|\n room.destroy if refs_to_delete.include?(room.vebra_ref)\n end\n\n # find & update or build new rooms\n property_rooms.each do |room|\n room_model = room_class.find_by_property_id_and_vebra_ref(property_model.id, room[:vebra_ref])\n room_model = property_model_rooms.build unless room_model\n\n # extract accessible attributes for the room\n room_attributes = room.inject({}) do |result, (key, value)|\n result[key] = value if room_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n room_model.update_attributes(room_attributes)\n end\n end\n\n # find & update or build new file attachments\n if Vebra.models[:file]\n file_class = Vebra.models[:file][:class].to_s.camelize.constantize\n\n # accessible attributes for the files\n file_accessibles = file_class.accessible_attributes.map(&:to_sym)\n\n # first normalize the collection (currently nested collections)\n property_files = property.attributes[:files].inject([]) do |result, (kind, collection)|\n collection.each do |file|\n file[:type] = kind.to_s.singularize.camelize if file_accessibles.include?(:type)\n file[\"remote_#{Vebra.models[:file][:attachment_method]}_url\".to_sym] = file.delete(:url)\n # if file[:type] is set, it means the attachment file class can be subclassed. In this\n # case we need to ensure that the subclass exists. If not, we ignore this file\n begin\n file[:type].constantize if file_accessibles.include?(:type)\n result << file\n rescue NameError => e\n # ignore - this means the subclass does not exist\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n\n result\n end\n\n # delete any files which are no longer present\n property_model_files = property_model.send(Vebra.models[:property][:files_method])\n refs_to_delete = property_model_files.map(&:vebra_ref) - property_files.map { |f| f[:vebra_ref] }\n property_model_files.each do |file|\n file.destroy if refs_to_delete.include?(file.vebra_ref)\n end\n\n # find & update or build new files\n property_files.each do |file|\n begin\n file_model = property_model_files.find_by_vebra_ref(file[:vebra_ref])\n file_model = property_model_files.build unless file_model\n\n # extract accessible attributes for the file\n file_attributes = file.inject({}) do |result, (key, value)|\n result[key] = value if file_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n file_model.update_attributes(file_attributes)\n rescue CarrierWave::ProcessingError, OpenURI::HTTPError => e\n # just ignore the file\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n end\n\n property_model.no_callbacks = false if property_model.respond_to?(:no_callbacks)\n property_model.save\n return property_model\n end",
"def update!(**args)\n @id = args[:id] if args.key?(:id)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def update\n end",
"def update!(**args)\n @mid = args[:mid] if args.key?(:mid)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def modified_properties=(value)\n @modified_properties = value\n end",
"def apply_properties!(properties)\n # Non-commutitivity etc. eventually.\n end",
"def set_properties(hash)\n hash.each do |key, value|\n add_or_remove_ostruct_member(key, value)\n end\n rest_reset_properties\n end",
"def update\n\t\t\n\t\tend",
"def set_props(props)\n @props.merge!(props)\n end",
"def update() end",
"def update!(**args)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def assign_properties\n self.properties ||= {}\n listing_properties.each do |prop|\n self.properties[prop.key] ||= prop.value\n end\n end",
"def change_properties(new_current_floor, new_next_floor, new_movement)\n @current_floor = new_current_floor\n @next_floor = new_next_floor\n @movement = new_movement\n end",
"def update!(**args)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end",
"def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end",
"def update(attributes)\n (@attributes ||= {}).merge! attributes\n\n (self.class.attr_initializables & attributes.keys).each do |name|\n instance_variable_set :\"@#{name}\", attributes[name]\n end\n\n self\n end",
"def update_attributes(attrs)\n super({})\n end",
"def update\n @dirty = true\n end",
"def update\n\n # Run through the mixin updates\n colourable_update\n movable_update\n\n end",
"def set(props)\n props.each do |prop, val|\n self.send(:\"#{ prop }=\", val)\n end\n end",
"def update\n super\n end",
"def update!(**args)\n @property_id = args[:property_id] if args.key?(:property_id)\n @value_status = args[:value_status] if args.key?(:value_status)\n end",
"def update!(**args)\n @object_size_bytes = args[:object_size_bytes] if args.key?(:object_size_bytes)\n @object_version = args[:object_version] if args.key?(:object_version)\n end",
"def movable_update\n\n # Work through the different aspects we update\n movable_location_update\n movable_size_update\n movable_angle_update\n\n end",
"def properties=(value)\n @properties = value\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(context={})\n self.pre_cast_attributes\n m2o = @relations.reject{|k, v| !self.class.many2one_relations.has_key?(k)}\n vals = @attributes.reject {|key, value| key == 'id'}.merge(m2o.merge(m2o){|k, v| v.is_a?(Array) ? v[0] : v})\n self.class.rpc_execute('write', self.id, vals, context)\n reload_from_record!(self.class.find(self.id, :context => context))\n end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update ; end",
"def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end",
"def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end",
"def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end",
"def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end",
"def update_with(attributes)\n assign_attributes(attributes)\n end",
"def update\n # don't need to update; hash is shared\n end",
"def update(attributes)\n HashProxy.with(attributes) do |proxy|\n self.class.attribute_names.each do |name|\n send(\"#{name}=\", proxy[name]) if proxy.key?(name)\n end\n end\n save\n end",
"def update!(**args)\n @object_id_prop = args[:object_id_prop] if args.key?(:object_id_prop)\n @relation = args[:relation] if args.key?(:relation)\n @subject_id = args[:subject_id] if args.key?(:subject_id)\n end",
"def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end",
"def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end",
"def update\n raise NotImplementedError\n end",
"def update_attributes attributes\n @attributes.merge! attributes\n end",
"def update!(**args)\n @async_options = args[:async_options] if args.key?(:async_options)\n @input_mappings = args[:input_mappings] if args.key?(:input_mappings)\n @name_property = args[:name_property] if args.key?(:name_property)\n @validation_options = args[:validation_options] if args.key?(:validation_options)\n end",
"def update\r\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @type = args[:type] if args.key?(:type)\n end",
"def update\n raise NotImplemented\n end",
"def update_obj\n mean, sd = rating.to_glicko_rating\n @obj.rating = mean\n @obj.rating_deviation = sd\n @obj.volatility = volatility\n end",
"def update_values\n end",
"def update_values\n end",
"def update\n raise NotImplementedError\n end",
"def update!(**args)\n @answers_header_signals = args[:answers_header_signals] if args.key?(:answers_header_signals)\n @property_value = args[:property_value] if args.key?(:property_value)\n @response_meaning_application = args[:response_meaning_application] if args.key?(:response_meaning_application)\n end",
"def update!(**args)\n @create_time = args[:create_time] if args.key?(:create_time)\n @method_prop = args[:method_prop] if args.key?(:method_prop)\n @name = args[:name] if args.key?(:name)\n @state = args[:state] if args.key?(:state)\n end",
"def update attributes, collection #:nodoc:\n 0\n end",
"def update_property_groups(roll)\n @property_groups.each { |_, v| v.update_rent(roll) }\n end",
"def update!(**args)\n @source_property = args[:source_property] if args.key?(:source_property)\n 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 update_properties(path, properties)\n prop_patch = PropPatch.new(properties)\n emit('propPatch', [path, prop_patch])\n prop_patch.commit\n\n prop_patch.result\n end",
"def update\n set_deltatime\n set_last_update_at\n end"
] | [
"0.7012263",
"0.69181895",
"0.69181895",
"0.69181895",
"0.69181895",
"0.69181895",
"0.67403597",
"0.6709326",
"0.6709326",
"0.6696149",
"0.6696149",
"0.6696149",
"0.6696149",
"0.6618882",
"0.6571848",
"0.65386343",
"0.65178275",
"0.6394807",
"0.6389745",
"0.6389745",
"0.63328",
"0.6319025",
"0.6283673",
"0.6269463",
"0.62639254",
"0.62410724",
"0.62170374",
"0.62152076",
"0.6210263",
"0.6204041",
"0.6204041",
"0.62021106",
"0.62017816",
"0.62017",
"0.61730784",
"0.61730784",
"0.6159277",
"0.6156169",
"0.61445665",
"0.6125433",
"0.61241156",
"0.6121413",
"0.6110477",
"0.6105694",
"0.61016303",
"0.60845226",
"0.6084427",
"0.6065455",
"0.6059506",
"0.6054869",
"0.6051708",
"0.6051708",
"0.60413384",
"0.6030853",
"0.6022535",
"0.6015561",
"0.59932375",
"0.59898263",
"0.5976479",
"0.5973787",
"0.59678394",
"0.5963291",
"0.5962048",
"0.5961157",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.59500545",
"0.59443134",
"0.59443134",
"0.59424853",
"0.59424853",
"0.593523",
"0.5926413",
"0.5924831",
"0.592427",
"0.59233046",
"0.59233046",
"0.5921224",
"0.59144294",
"0.59142506",
"0.58887535",
"0.58854496",
"0.5883008",
"0.58792305",
"0.5876954",
"0.5876954",
"0.58744955",
"0.5857968",
"0.5845542",
"0.5841629",
"0.58363605",
"0.5829255",
"0.582919",
"0.5822138",
"0.58208305"
] | 0.0 | -1 |
Update properties of this object | def update!(**args)
@severity_overrides = args[:severity_overrides] if args.key?(:severity_overrides)
@threat_overrides = args[:threat_overrides] if args.key?(:threat_overrides)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update_properties(hash)\n hash.each do |key, value|\n setter_method = \"#{key}=\"\n if self.respond_to?(setter_method)\n self.send(setter_method, value)\n end\n end\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def refresh\n self.class.base_properties.each_with_index do |prop, prop_id|\n @properties[prop] = get_property(prop_id)\n end\n refresh_features\n refresh_status\n refresh_config\n self\n end",
"def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\n end",
"def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\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 update_properties!(branch_id=nil)\n properties = fetch_properties(false, branch_id)\n length = properties.length\n counter = 0\n properties.each do |property|\n counter += 1\n if Vebra.debugging?\n puts \"[Vebra]: #{counter}/#{length}: live updating property with Vebra ref: #{property.attributes[:vebra_ref]}\"\n end\n live_update!(property)\n Vebra.set_last_updated_at(Time.now) if counter == length\n end\n end",
"def update_self obj\n obj.each do |k,v|\n instance_variable_set(\"@#{k}\", v) if v\n end\n end",
"def update_attributes(properties_hash)\n self.class.get_class_properties.each do |property|\n key = property[:name].to_sym\n if properties_hash.has_key? key\n self.setValue(properties_hash[key], forKey:key)\n end\n end\n end",
"def update\n # TODO: implement update\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @states = args[:states] if args.key?(:states)\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end",
"def update!(**args)\n @property = args[:property] if args.key?(:property)\n @total_value_count = args[:total_value_count] if args.key?(:total_value_count)\n @value = args[:value] if args.key?(:value)\n @value_status = args[:value_status] if args.key?(:value_status)\n end",
"def update\n \n end",
"def refresh\n set_attributes\n end",
"def update(attrs)\n @attrs.update(attrs)\n self\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @source = args[:source] if args.key?(:source)\n end",
"def update_resource object, attributes\n object.update attributes\n end",
"def update(attrs)\n @attrs ||= {}\n @attrs.update(attrs)\n self\n end",
"def update\n \n end",
"def update!(**args)\n @property = args[:property] if args.key?(:property)\n @schema = args[:schema] if args.key?(:schema)\n end",
"def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def _update!\n self.class.properties.each do |property, predicate|\n if dirty?(property)\n self.class.repository_or_fail.delete([subject, predicate[:predicate], nil])\n if self.class.is_list?(property)\n repo = RDF::Repository.new\n attribute_get(property).each do |value|\n repo << RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(value, self.class.properties[property][:type]))\n end\n self.class.repository_or_fail.insert(*repo)\n else\n self.class.repository_or_fail.insert(RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(attribute_get(property), self.class.properties[property][:type])))\n end\n end\n @dirty[property] = nil\n @attributes[:original][property] = attribute_get(property)\n end\n self.class.repository_or_fail.insert(RDF::Statement.new(@subject, RDF.type, type)) unless type.nil?\n end",
"def update(attributes = {})\n super(attributes)\n retrieve!\n self\n end",
"def update\n @objects.map(&:update);\n end",
"def update\n raise NotImplementedError\n end",
"def update\n raise NotImplementedError\n end",
"def live_update!(property)\n property_class = Vebra.models[:property][:class].to_s.camelize.constantize\n\n # ensure we have the full property attributes\n property.get_property if !property.attributes[:status] && property.attributes[:action] != 'deleted'\n\n # find & update or build a new property\n property_model = property_class.find_or_initialize_by_vebra_ref(property.attributes[:vebra_ref])\n\n # make sure property object is not empty\n return false if !property.attributes || !property.attributes[:property_type]\n\n # if the property has been deleted, mark it appropriately and move on\n if property.attributes[:action] == 'deleted'\n return property_model.destroy\n end\n\n # extract accessible attributes for the property\n property_accessibles = property_class.accessible_attributes.map(&:to_sym)\n property_attributes = property.attributes.inject({}) do |result, (key, value)|\n result[key] = value if property_accessibles.include?(key)\n result\n end\n\n # update the property model's attributes\n property_model.no_callbacks = true if property_model.respond_to?(:no_callbacks)\n property_model.update_attributes(property_attributes)\n\n # find & update or build a new address\n if Vebra.models[:address]\n address_class = Vebra.models[:address][:class].to_s.camelize.constantize\n address_model = property_model.send(Vebra.models[:property][:address_method])\n address_model = property_model.send(\"build_#{Vebra.models[:property][:address_method]}\") unless address_model\n\n # extract accessible attributes for the address\n address_accessibles = address_class.accessible_attributes.map(&:to_sym)\n address_attributes = property.attributes[:address].inject({}) do |result, (key, value)|\n result[key] = value if address_accessibles.include?(key)\n result\n end\n\n # update the address model's attributes\n address_model.update_attributes(address_attributes)\n end\n\n # find & update or build new rooms\n if Vebra.models[:room]\n room_class = Vebra.models[:room][:class].to_s.camelize.constantize\n\n # accessible attributes for the rooms\n room_accessibles = room_class.accessible_attributes.map(&:to_sym)\n\n # delete any rooms which are no longer present\n property_rooms = property.attributes[:rooms] || []\n property_model_rooms = property_model.send(Vebra.models[:property][:rooms_method])\n refs_to_delete = property_model_rooms.map(&:vebra_ref) - property_rooms.map { |r| r[:vebra_ref] }\n property_model_rooms.each do |room|\n room.destroy if refs_to_delete.include?(room.vebra_ref)\n end\n\n # find & update or build new rooms\n property_rooms.each do |room|\n room_model = room_class.find_by_property_id_and_vebra_ref(property_model.id, room[:vebra_ref])\n room_model = property_model_rooms.build unless room_model\n\n # extract accessible attributes for the room\n room_attributes = room.inject({}) do |result, (key, value)|\n result[key] = value if room_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n room_model.update_attributes(room_attributes)\n end\n end\n\n # find & update or build new file attachments\n if Vebra.models[:file]\n file_class = Vebra.models[:file][:class].to_s.camelize.constantize\n\n # accessible attributes for the files\n file_accessibles = file_class.accessible_attributes.map(&:to_sym)\n\n # first normalize the collection (currently nested collections)\n property_files = property.attributes[:files].inject([]) do |result, (kind, collection)|\n collection.each do |file|\n file[:type] = kind.to_s.singularize.camelize if file_accessibles.include?(:type)\n file[\"remote_#{Vebra.models[:file][:attachment_method]}_url\".to_sym] = file.delete(:url)\n # if file[:type] is set, it means the attachment file class can be subclassed. In this\n # case we need to ensure that the subclass exists. If not, we ignore this file\n begin\n file[:type].constantize if file_accessibles.include?(:type)\n result << file\n rescue NameError => e\n # ignore - this means the subclass does not exist\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n\n result\n end\n\n # delete any files which are no longer present\n property_model_files = property_model.send(Vebra.models[:property][:files_method])\n refs_to_delete = property_model_files.map(&:vebra_ref) - property_files.map { |f| f[:vebra_ref] }\n property_model_files.each do |file|\n file.destroy if refs_to_delete.include?(file.vebra_ref)\n end\n\n # find & update or build new files\n property_files.each do |file|\n begin\n file_model = property_model_files.find_by_vebra_ref(file[:vebra_ref])\n file_model = property_model_files.build unless file_model\n\n # extract accessible attributes for the file\n file_attributes = file.inject({}) do |result, (key, value)|\n result[key] = value if file_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n file_model.update_attributes(file_attributes)\n rescue CarrierWave::ProcessingError, OpenURI::HTTPError => e\n # just ignore the file\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n end\n\n property_model.no_callbacks = false if property_model.respond_to?(:no_callbacks)\n property_model.save\n return property_model\n end",
"def update!(**args)\n @id = args[:id] if args.key?(:id)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def update\n end",
"def update!(**args)\n @mid = args[:mid] if args.key?(:mid)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def modified_properties=(value)\n @modified_properties = value\n end",
"def apply_properties!(properties)\n # Non-commutitivity etc. eventually.\n end",
"def set_properties(hash)\n hash.each do |key, value|\n add_or_remove_ostruct_member(key, value)\n end\n rest_reset_properties\n end",
"def update\n\t\t\n\t\tend",
"def set_props(props)\n @props.merge!(props)\n end",
"def update() end",
"def update!(**args)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def assign_properties\n self.properties ||= {}\n listing_properties.each do |prop|\n self.properties[prop.key] ||= prop.value\n end\n end",
"def change_properties(new_current_floor, new_next_floor, new_movement)\n @current_floor = new_current_floor\n @next_floor = new_next_floor\n @movement = new_movement\n end",
"def update!(**args)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end",
"def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end",
"def update(attributes)\n (@attributes ||= {}).merge! attributes\n\n (self.class.attr_initializables & attributes.keys).each do |name|\n instance_variable_set :\"@#{name}\", attributes[name]\n end\n\n self\n end",
"def update_attributes(attrs)\n super({})\n end",
"def update\n @dirty = true\n end",
"def update\n\n # Run through the mixin updates\n colourable_update\n movable_update\n\n end",
"def set(props)\n props.each do |prop, val|\n self.send(:\"#{ prop }=\", val)\n end\n end",
"def update\n super\n end",
"def update!(**args)\n @property_id = args[:property_id] if args.key?(:property_id)\n @value_status = args[:value_status] if args.key?(:value_status)\n end",
"def update!(**args)\n @object_size_bytes = args[:object_size_bytes] if args.key?(:object_size_bytes)\n @object_version = args[:object_version] if args.key?(:object_version)\n end",
"def movable_update\n\n # Work through the different aspects we update\n movable_location_update\n movable_size_update\n movable_angle_update\n\n end",
"def properties=(value)\n @properties = value\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(context={})\n self.pre_cast_attributes\n m2o = @relations.reject{|k, v| !self.class.many2one_relations.has_key?(k)}\n vals = @attributes.reject {|key, value| key == 'id'}.merge(m2o.merge(m2o){|k, v| v.is_a?(Array) ? v[0] : v})\n self.class.rpc_execute('write', self.id, vals, context)\n reload_from_record!(self.class.find(self.id, :context => context))\n end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update ; end",
"def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end",
"def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end",
"def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end",
"def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end",
"def update_with(attributes)\n assign_attributes(attributes)\n end",
"def update\n # don't need to update; hash is shared\n end",
"def update(attributes)\n HashProxy.with(attributes) do |proxy|\n self.class.attribute_names.each do |name|\n send(\"#{name}=\", proxy[name]) if proxy.key?(name)\n end\n end\n save\n end",
"def update!(**args)\n @object_id_prop = args[:object_id_prop] if args.key?(:object_id_prop)\n @relation = args[:relation] if args.key?(:relation)\n @subject_id = args[:subject_id] if args.key?(:subject_id)\n end",
"def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end",
"def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end",
"def update\n raise NotImplementedError\n end",
"def update_attributes attributes\n @attributes.merge! attributes\n end",
"def update!(**args)\n @async_options = args[:async_options] if args.key?(:async_options)\n @input_mappings = args[:input_mappings] if args.key?(:input_mappings)\n @name_property = args[:name_property] if args.key?(:name_property)\n @validation_options = args[:validation_options] if args.key?(:validation_options)\n end",
"def update\r\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @type = args[:type] if args.key?(:type)\n end",
"def update\n raise NotImplemented\n end",
"def update_obj\n mean, sd = rating.to_glicko_rating\n @obj.rating = mean\n @obj.rating_deviation = sd\n @obj.volatility = volatility\n end",
"def update_values\n end",
"def update_values\n end",
"def update\n raise NotImplementedError\n end",
"def update!(**args)\n @answers_header_signals = args[:answers_header_signals] if args.key?(:answers_header_signals)\n @property_value = args[:property_value] if args.key?(:property_value)\n @response_meaning_application = args[:response_meaning_application] if args.key?(:response_meaning_application)\n end",
"def update!(**args)\n @create_time = args[:create_time] if args.key?(:create_time)\n @method_prop = args[:method_prop] if args.key?(:method_prop)\n @name = args[:name] if args.key?(:name)\n @state = args[:state] if args.key?(:state)\n end",
"def update attributes, collection #:nodoc:\n 0\n end",
"def update_property_groups(roll)\n @property_groups.each { |_, v| v.update_rent(roll) }\n end",
"def update!(**args)\n @source_property = args[:source_property] if args.key?(:source_property)\n 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 update_properties(path, properties)\n prop_patch = PropPatch.new(properties)\n emit('propPatch', [path, prop_patch])\n prop_patch.commit\n\n prop_patch.result\n end",
"def update\n set_deltatime\n set_last_update_at\n end"
] | [
"0.7012263",
"0.69181895",
"0.69181895",
"0.69181895",
"0.69181895",
"0.69181895",
"0.67403597",
"0.6709326",
"0.6709326",
"0.6696149",
"0.6696149",
"0.6696149",
"0.6696149",
"0.6618882",
"0.6571848",
"0.65386343",
"0.65178275",
"0.6394807",
"0.6389745",
"0.6389745",
"0.63328",
"0.6319025",
"0.6283673",
"0.6269463",
"0.62639254",
"0.62410724",
"0.62170374",
"0.62152076",
"0.6210263",
"0.6204041",
"0.6204041",
"0.62021106",
"0.62017816",
"0.62017",
"0.61730784",
"0.61730784",
"0.6159277",
"0.6156169",
"0.61445665",
"0.6125433",
"0.61241156",
"0.6121413",
"0.6110477",
"0.6105694",
"0.61016303",
"0.60845226",
"0.6084427",
"0.6065455",
"0.6059506",
"0.6054869",
"0.6051708",
"0.6051708",
"0.60413384",
"0.6030853",
"0.6022535",
"0.6015561",
"0.59932375",
"0.59898263",
"0.5976479",
"0.5973787",
"0.59678394",
"0.5963291",
"0.5962048",
"0.5961157",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.59500545",
"0.59443134",
"0.59443134",
"0.59424853",
"0.59424853",
"0.593523",
"0.5926413",
"0.5924831",
"0.592427",
"0.59233046",
"0.59233046",
"0.5921224",
"0.59144294",
"0.59142506",
"0.58887535",
"0.58854496",
"0.5883008",
"0.58792305",
"0.5876954",
"0.5876954",
"0.58744955",
"0.5857968",
"0.5845542",
"0.5841629",
"0.58363605",
"0.5829255",
"0.582919",
"0.5822138",
"0.58208305"
] | 0.0 | -1 |
Update properties of this object | def update!(**args)
@ca_pool = args[:ca_pool] if args.key?(:ca_pool)
@create_time = args[:create_time] if args.key?(:create_time)
@custom_tls_features = args[:custom_tls_features] if args.key?(:custom_tls_features)
@description = args[:description] if args.key?(:description)
@exclude_public_ca_set = args[:exclude_public_ca_set] if args.key?(:exclude_public_ca_set)
@min_tls_version = args[:min_tls_version] if args.key?(:min_tls_version)
@name = args[:name] if args.key?(:name)
@tls_feature_profile = args[:tls_feature_profile] if args.key?(:tls_feature_profile)
@trust_config = args[:trust_config] if args.key?(:trust_config)
@update_time = args[:update_time] if args.key?(:update_time)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update_properties(hash)\n hash.each do |key, value|\n setter_method = \"#{key}=\"\n if self.respond_to?(setter_method)\n self.send(setter_method, value)\n end\n end\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def refresh\n self.class.base_properties.each_with_index do |prop, prop_id|\n @properties[prop] = get_property(prop_id)\n end\n refresh_features\n refresh_status\n refresh_config\n self\n end",
"def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\n end",
"def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\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 update_properties!(branch_id=nil)\n properties = fetch_properties(false, branch_id)\n length = properties.length\n counter = 0\n properties.each do |property|\n counter += 1\n if Vebra.debugging?\n puts \"[Vebra]: #{counter}/#{length}: live updating property with Vebra ref: #{property.attributes[:vebra_ref]}\"\n end\n live_update!(property)\n Vebra.set_last_updated_at(Time.now) if counter == length\n end\n end",
"def update_self obj\n obj.each do |k,v|\n instance_variable_set(\"@#{k}\", v) if v\n end\n end",
"def update_attributes(properties_hash)\n self.class.get_class_properties.each do |property|\n key = property[:name].to_sym\n if properties_hash.has_key? key\n self.setValue(properties_hash[key], forKey:key)\n end\n end\n end",
"def update\n # TODO: implement update\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @states = args[:states] if args.key?(:states)\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end",
"def update!(**args)\n @property = args[:property] if args.key?(:property)\n @total_value_count = args[:total_value_count] if args.key?(:total_value_count)\n @value = args[:value] if args.key?(:value)\n @value_status = args[:value_status] if args.key?(:value_status)\n end",
"def update\n \n end",
"def refresh\n set_attributes\n end",
"def update(attrs)\n @attrs.update(attrs)\n self\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @source = args[:source] if args.key?(:source)\n end",
"def update_resource object, attributes\n object.update attributes\n end",
"def update(attrs)\n @attrs ||= {}\n @attrs.update(attrs)\n self\n end",
"def update\n \n end",
"def update!(**args)\n @property = args[:property] if args.key?(:property)\n @schema = args[:schema] if args.key?(:schema)\n end",
"def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def _update!\n self.class.properties.each do |property, predicate|\n if dirty?(property)\n self.class.repository_or_fail.delete([subject, predicate[:predicate], nil])\n if self.class.is_list?(property)\n repo = RDF::Repository.new\n attribute_get(property).each do |value|\n repo << RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(value, self.class.properties[property][:type]))\n end\n self.class.repository_or_fail.insert(*repo)\n else\n self.class.repository_or_fail.insert(RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(attribute_get(property), self.class.properties[property][:type])))\n end\n end\n @dirty[property] = nil\n @attributes[:original][property] = attribute_get(property)\n end\n self.class.repository_or_fail.insert(RDF::Statement.new(@subject, RDF.type, type)) unless type.nil?\n end",
"def update(attributes = {})\n super(attributes)\n retrieve!\n self\n end",
"def update\n @objects.map(&:update);\n end",
"def update\n raise NotImplementedError\n end",
"def update\n raise NotImplementedError\n end",
"def live_update!(property)\n property_class = Vebra.models[:property][:class].to_s.camelize.constantize\n\n # ensure we have the full property attributes\n property.get_property if !property.attributes[:status] && property.attributes[:action] != 'deleted'\n\n # find & update or build a new property\n property_model = property_class.find_or_initialize_by_vebra_ref(property.attributes[:vebra_ref])\n\n # make sure property object is not empty\n return false if !property.attributes || !property.attributes[:property_type]\n\n # if the property has been deleted, mark it appropriately and move on\n if property.attributes[:action] == 'deleted'\n return property_model.destroy\n end\n\n # extract accessible attributes for the property\n property_accessibles = property_class.accessible_attributes.map(&:to_sym)\n property_attributes = property.attributes.inject({}) do |result, (key, value)|\n result[key] = value if property_accessibles.include?(key)\n result\n end\n\n # update the property model's attributes\n property_model.no_callbacks = true if property_model.respond_to?(:no_callbacks)\n property_model.update_attributes(property_attributes)\n\n # find & update or build a new address\n if Vebra.models[:address]\n address_class = Vebra.models[:address][:class].to_s.camelize.constantize\n address_model = property_model.send(Vebra.models[:property][:address_method])\n address_model = property_model.send(\"build_#{Vebra.models[:property][:address_method]}\") unless address_model\n\n # extract accessible attributes for the address\n address_accessibles = address_class.accessible_attributes.map(&:to_sym)\n address_attributes = property.attributes[:address].inject({}) do |result, (key, value)|\n result[key] = value if address_accessibles.include?(key)\n result\n end\n\n # update the address model's attributes\n address_model.update_attributes(address_attributes)\n end\n\n # find & update or build new rooms\n if Vebra.models[:room]\n room_class = Vebra.models[:room][:class].to_s.camelize.constantize\n\n # accessible attributes for the rooms\n room_accessibles = room_class.accessible_attributes.map(&:to_sym)\n\n # delete any rooms which are no longer present\n property_rooms = property.attributes[:rooms] || []\n property_model_rooms = property_model.send(Vebra.models[:property][:rooms_method])\n refs_to_delete = property_model_rooms.map(&:vebra_ref) - property_rooms.map { |r| r[:vebra_ref] }\n property_model_rooms.each do |room|\n room.destroy if refs_to_delete.include?(room.vebra_ref)\n end\n\n # find & update or build new rooms\n property_rooms.each do |room|\n room_model = room_class.find_by_property_id_and_vebra_ref(property_model.id, room[:vebra_ref])\n room_model = property_model_rooms.build unless room_model\n\n # extract accessible attributes for the room\n room_attributes = room.inject({}) do |result, (key, value)|\n result[key] = value if room_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n room_model.update_attributes(room_attributes)\n end\n end\n\n # find & update or build new file attachments\n if Vebra.models[:file]\n file_class = Vebra.models[:file][:class].to_s.camelize.constantize\n\n # accessible attributes for the files\n file_accessibles = file_class.accessible_attributes.map(&:to_sym)\n\n # first normalize the collection (currently nested collections)\n property_files = property.attributes[:files].inject([]) do |result, (kind, collection)|\n collection.each do |file|\n file[:type] = kind.to_s.singularize.camelize if file_accessibles.include?(:type)\n file[\"remote_#{Vebra.models[:file][:attachment_method]}_url\".to_sym] = file.delete(:url)\n # if file[:type] is set, it means the attachment file class can be subclassed. In this\n # case we need to ensure that the subclass exists. If not, we ignore this file\n begin\n file[:type].constantize if file_accessibles.include?(:type)\n result << file\n rescue NameError => e\n # ignore - this means the subclass does not exist\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n\n result\n end\n\n # delete any files which are no longer present\n property_model_files = property_model.send(Vebra.models[:property][:files_method])\n refs_to_delete = property_model_files.map(&:vebra_ref) - property_files.map { |f| f[:vebra_ref] }\n property_model_files.each do |file|\n file.destroy if refs_to_delete.include?(file.vebra_ref)\n end\n\n # find & update or build new files\n property_files.each do |file|\n begin\n file_model = property_model_files.find_by_vebra_ref(file[:vebra_ref])\n file_model = property_model_files.build unless file_model\n\n # extract accessible attributes for the file\n file_attributes = file.inject({}) do |result, (key, value)|\n result[key] = value if file_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n file_model.update_attributes(file_attributes)\n rescue CarrierWave::ProcessingError, OpenURI::HTTPError => e\n # just ignore the file\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n end\n\n property_model.no_callbacks = false if property_model.respond_to?(:no_callbacks)\n property_model.save\n return property_model\n end",
"def update!(**args)\n @id = args[:id] if args.key?(:id)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def update\n end",
"def update!(**args)\n @mid = args[:mid] if args.key?(:mid)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def modified_properties=(value)\n @modified_properties = value\n end",
"def apply_properties!(properties)\n # Non-commutitivity etc. eventually.\n end",
"def set_properties(hash)\n hash.each do |key, value|\n add_or_remove_ostruct_member(key, value)\n end\n rest_reset_properties\n end",
"def update\n\t\t\n\t\tend",
"def set_props(props)\n @props.merge!(props)\n end",
"def update() end",
"def update!(**args)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def assign_properties\n self.properties ||= {}\n listing_properties.each do |prop|\n self.properties[prop.key] ||= prop.value\n end\n end",
"def change_properties(new_current_floor, new_next_floor, new_movement)\n @current_floor = new_current_floor\n @next_floor = new_next_floor\n @movement = new_movement\n end",
"def update!(**args)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end",
"def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end",
"def update(attributes)\n (@attributes ||= {}).merge! attributes\n\n (self.class.attr_initializables & attributes.keys).each do |name|\n instance_variable_set :\"@#{name}\", attributes[name]\n end\n\n self\n end",
"def update_attributes(attrs)\n super({})\n end",
"def update\n @dirty = true\n end",
"def update\n\n # Run through the mixin updates\n colourable_update\n movable_update\n\n end",
"def set(props)\n props.each do |prop, val|\n self.send(:\"#{ prop }=\", val)\n end\n end",
"def update\n super\n end",
"def update!(**args)\n @property_id = args[:property_id] if args.key?(:property_id)\n @value_status = args[:value_status] if args.key?(:value_status)\n end",
"def update!(**args)\n @object_size_bytes = args[:object_size_bytes] if args.key?(:object_size_bytes)\n @object_version = args[:object_version] if args.key?(:object_version)\n end",
"def movable_update\n\n # Work through the different aspects we update\n movable_location_update\n movable_size_update\n movable_angle_update\n\n end",
"def properties=(value)\n @properties = value\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(context={})\n self.pre_cast_attributes\n m2o = @relations.reject{|k, v| !self.class.many2one_relations.has_key?(k)}\n vals = @attributes.reject {|key, value| key == 'id'}.merge(m2o.merge(m2o){|k, v| v.is_a?(Array) ? v[0] : v})\n self.class.rpc_execute('write', self.id, vals, context)\n reload_from_record!(self.class.find(self.id, :context => context))\n end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update ; end",
"def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end",
"def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end",
"def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end",
"def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end",
"def update_with(attributes)\n assign_attributes(attributes)\n end",
"def update\n # don't need to update; hash is shared\n end",
"def update(attributes)\n HashProxy.with(attributes) do |proxy|\n self.class.attribute_names.each do |name|\n send(\"#{name}=\", proxy[name]) if proxy.key?(name)\n end\n end\n save\n end",
"def update!(**args)\n @object_id_prop = args[:object_id_prop] if args.key?(:object_id_prop)\n @relation = args[:relation] if args.key?(:relation)\n @subject_id = args[:subject_id] if args.key?(:subject_id)\n end",
"def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end",
"def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end",
"def update\n raise NotImplementedError\n end",
"def update_attributes attributes\n @attributes.merge! attributes\n end",
"def update!(**args)\n @async_options = args[:async_options] if args.key?(:async_options)\n @input_mappings = args[:input_mappings] if args.key?(:input_mappings)\n @name_property = args[:name_property] if args.key?(:name_property)\n @validation_options = args[:validation_options] if args.key?(:validation_options)\n end",
"def update\r\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @type = args[:type] if args.key?(:type)\n end",
"def update\n raise NotImplemented\n end",
"def update_obj\n mean, sd = rating.to_glicko_rating\n @obj.rating = mean\n @obj.rating_deviation = sd\n @obj.volatility = volatility\n end",
"def update_values\n end",
"def update_values\n end",
"def update\n raise NotImplementedError\n end",
"def update!(**args)\n @answers_header_signals = args[:answers_header_signals] if args.key?(:answers_header_signals)\n @property_value = args[:property_value] if args.key?(:property_value)\n @response_meaning_application = args[:response_meaning_application] if args.key?(:response_meaning_application)\n end",
"def update!(**args)\n @create_time = args[:create_time] if args.key?(:create_time)\n @method_prop = args[:method_prop] if args.key?(:method_prop)\n @name = args[:name] if args.key?(:name)\n @state = args[:state] if args.key?(:state)\n end",
"def update attributes, collection #:nodoc:\n 0\n end",
"def update_property_groups(roll)\n @property_groups.each { |_, v| v.update_rent(roll) }\n end",
"def update!(**args)\n @source_property = args[:source_property] if args.key?(:source_property)\n 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 update_properties(path, properties)\n prop_patch = PropPatch.new(properties)\n emit('propPatch', [path, prop_patch])\n prop_patch.commit\n\n prop_patch.result\n end",
"def update\n set_deltatime\n set_last_update_at\n end"
] | [
"0.7012263",
"0.69181895",
"0.69181895",
"0.69181895",
"0.69181895",
"0.69181895",
"0.67403597",
"0.6709326",
"0.6709326",
"0.6696149",
"0.6696149",
"0.6696149",
"0.6696149",
"0.6618882",
"0.6571848",
"0.65386343",
"0.65178275",
"0.6394807",
"0.6389745",
"0.6389745",
"0.63328",
"0.6319025",
"0.6283673",
"0.6269463",
"0.62639254",
"0.62410724",
"0.62170374",
"0.62152076",
"0.6210263",
"0.6204041",
"0.6204041",
"0.62021106",
"0.62017816",
"0.62017",
"0.61730784",
"0.61730784",
"0.6159277",
"0.6156169",
"0.61445665",
"0.6125433",
"0.61241156",
"0.6121413",
"0.6110477",
"0.6105694",
"0.61016303",
"0.60845226",
"0.6084427",
"0.6065455",
"0.6059506",
"0.6054869",
"0.6051708",
"0.6051708",
"0.60413384",
"0.6030853",
"0.6022535",
"0.6015561",
"0.59932375",
"0.59898263",
"0.5976479",
"0.5973787",
"0.59678394",
"0.5963291",
"0.5962048",
"0.5961157",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.59500545",
"0.59443134",
"0.59443134",
"0.59424853",
"0.59424853",
"0.593523",
"0.5926413",
"0.5924831",
"0.592427",
"0.59233046",
"0.59233046",
"0.5921224",
"0.59144294",
"0.59142506",
"0.58887535",
"0.58854496",
"0.5883008",
"0.58792305",
"0.5876954",
"0.5876954",
"0.58744955",
"0.5857968",
"0.5845542",
"0.5841629",
"0.58363605",
"0.5829255",
"0.582919",
"0.5822138",
"0.58208305"
] | 0.0 | -1 |
Update properties of this object | def update!(**args)
@create_time = args[:create_time] if args.key?(:create_time)
@description = args[:description] if args.key?(:description)
@name = args[:name] if args.key?(:name)
@update_time = args[:update_time] if args.key?(:update_time)
@values = args[:values] if args.key?(:values)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update_properties(hash)\n hash.each do |key, value|\n setter_method = \"#{key}=\"\n if self.respond_to?(setter_method)\n self.send(setter_method, value)\n end\n end\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def refresh\n self.class.base_properties.each_with_index do |prop, prop_id|\n @properties[prop] = get_property(prop_id)\n end\n refresh_features\n refresh_status\n refresh_config\n self\n end",
"def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\n end",
"def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\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 update_properties!(branch_id=nil)\n properties = fetch_properties(false, branch_id)\n length = properties.length\n counter = 0\n properties.each do |property|\n counter += 1\n if Vebra.debugging?\n puts \"[Vebra]: #{counter}/#{length}: live updating property with Vebra ref: #{property.attributes[:vebra_ref]}\"\n end\n live_update!(property)\n Vebra.set_last_updated_at(Time.now) if counter == length\n end\n end",
"def update_self obj\n obj.each do |k,v|\n instance_variable_set(\"@#{k}\", v) if v\n end\n end",
"def update_attributes(properties_hash)\n self.class.get_class_properties.each do |property|\n key = property[:name].to_sym\n if properties_hash.has_key? key\n self.setValue(properties_hash[key], forKey:key)\n end\n end\n end",
"def update\n # TODO: implement update\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @states = args[:states] if args.key?(:states)\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end",
"def update!(**args)\n @property = args[:property] if args.key?(:property)\n @total_value_count = args[:total_value_count] if args.key?(:total_value_count)\n @value = args[:value] if args.key?(:value)\n @value_status = args[:value_status] if args.key?(:value_status)\n end",
"def update\n \n end",
"def refresh\n set_attributes\n end",
"def update(attrs)\n @attrs.update(attrs)\n self\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @source = args[:source] if args.key?(:source)\n end",
"def update_resource object, attributes\n object.update attributes\n end",
"def update(attrs)\n @attrs ||= {}\n @attrs.update(attrs)\n self\n end",
"def update\n \n end",
"def update!(**args)\n @property = args[:property] if args.key?(:property)\n @schema = args[:schema] if args.key?(:schema)\n end",
"def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def update(attributes = {})\n super(attributes)\n retrieve!\n self\n end",
"def _update!\n self.class.properties.each do |property, predicate|\n if dirty?(property)\n self.class.repository_or_fail.delete([subject, predicate[:predicate], nil])\n if self.class.is_list?(property)\n repo = RDF::Repository.new\n attribute_get(property).each do |value|\n repo << RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(value, self.class.properties[property][:type]))\n end\n self.class.repository_or_fail.insert(*repo)\n else\n self.class.repository_or_fail.insert(RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(attribute_get(property), self.class.properties[property][:type])))\n end\n end\n @dirty[property] = nil\n @attributes[:original][property] = attribute_get(property)\n end\n self.class.repository_or_fail.insert(RDF::Statement.new(@subject, RDF.type, type)) unless type.nil?\n end",
"def update\n @objects.map(&:update);\n end",
"def update\n raise NotImplementedError\n end",
"def update\n raise NotImplementedError\n end",
"def live_update!(property)\n property_class = Vebra.models[:property][:class].to_s.camelize.constantize\n\n # ensure we have the full property attributes\n property.get_property if !property.attributes[:status] && property.attributes[:action] != 'deleted'\n\n # find & update or build a new property\n property_model = property_class.find_or_initialize_by_vebra_ref(property.attributes[:vebra_ref])\n\n # make sure property object is not empty\n return false if !property.attributes || !property.attributes[:property_type]\n\n # if the property has been deleted, mark it appropriately and move on\n if property.attributes[:action] == 'deleted'\n return property_model.destroy\n end\n\n # extract accessible attributes for the property\n property_accessibles = property_class.accessible_attributes.map(&:to_sym)\n property_attributes = property.attributes.inject({}) do |result, (key, value)|\n result[key] = value if property_accessibles.include?(key)\n result\n end\n\n # update the property model's attributes\n property_model.no_callbacks = true if property_model.respond_to?(:no_callbacks)\n property_model.update_attributes(property_attributes)\n\n # find & update or build a new address\n if Vebra.models[:address]\n address_class = Vebra.models[:address][:class].to_s.camelize.constantize\n address_model = property_model.send(Vebra.models[:property][:address_method])\n address_model = property_model.send(\"build_#{Vebra.models[:property][:address_method]}\") unless address_model\n\n # extract accessible attributes for the address\n address_accessibles = address_class.accessible_attributes.map(&:to_sym)\n address_attributes = property.attributes[:address].inject({}) do |result, (key, value)|\n result[key] = value if address_accessibles.include?(key)\n result\n end\n\n # update the address model's attributes\n address_model.update_attributes(address_attributes)\n end\n\n # find & update or build new rooms\n if Vebra.models[:room]\n room_class = Vebra.models[:room][:class].to_s.camelize.constantize\n\n # accessible attributes for the rooms\n room_accessibles = room_class.accessible_attributes.map(&:to_sym)\n\n # delete any rooms which are no longer present\n property_rooms = property.attributes[:rooms] || []\n property_model_rooms = property_model.send(Vebra.models[:property][:rooms_method])\n refs_to_delete = property_model_rooms.map(&:vebra_ref) - property_rooms.map { |r| r[:vebra_ref] }\n property_model_rooms.each do |room|\n room.destroy if refs_to_delete.include?(room.vebra_ref)\n end\n\n # find & update or build new rooms\n property_rooms.each do |room|\n room_model = room_class.find_by_property_id_and_vebra_ref(property_model.id, room[:vebra_ref])\n room_model = property_model_rooms.build unless room_model\n\n # extract accessible attributes for the room\n room_attributes = room.inject({}) do |result, (key, value)|\n result[key] = value if room_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n room_model.update_attributes(room_attributes)\n end\n end\n\n # find & update or build new file attachments\n if Vebra.models[:file]\n file_class = Vebra.models[:file][:class].to_s.camelize.constantize\n\n # accessible attributes for the files\n file_accessibles = file_class.accessible_attributes.map(&:to_sym)\n\n # first normalize the collection (currently nested collections)\n property_files = property.attributes[:files].inject([]) do |result, (kind, collection)|\n collection.each do |file|\n file[:type] = kind.to_s.singularize.camelize if file_accessibles.include?(:type)\n file[\"remote_#{Vebra.models[:file][:attachment_method]}_url\".to_sym] = file.delete(:url)\n # if file[:type] is set, it means the attachment file class can be subclassed. In this\n # case we need to ensure that the subclass exists. If not, we ignore this file\n begin\n file[:type].constantize if file_accessibles.include?(:type)\n result << file\n rescue NameError => e\n # ignore - this means the subclass does not exist\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n\n result\n end\n\n # delete any files which are no longer present\n property_model_files = property_model.send(Vebra.models[:property][:files_method])\n refs_to_delete = property_model_files.map(&:vebra_ref) - property_files.map { |f| f[:vebra_ref] }\n property_model_files.each do |file|\n file.destroy if refs_to_delete.include?(file.vebra_ref)\n end\n\n # find & update or build new files\n property_files.each do |file|\n begin\n file_model = property_model_files.find_by_vebra_ref(file[:vebra_ref])\n file_model = property_model_files.build unless file_model\n\n # extract accessible attributes for the file\n file_attributes = file.inject({}) do |result, (key, value)|\n result[key] = value if file_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n file_model.update_attributes(file_attributes)\n rescue CarrierWave::ProcessingError, OpenURI::HTTPError => e\n # just ignore the file\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n end\n\n property_model.no_callbacks = false if property_model.respond_to?(:no_callbacks)\n property_model.save\n return property_model\n end",
"def update!(**args)\n @id = args[:id] if args.key?(:id)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def update\n end",
"def update!(**args)\n @mid = args[:mid] if args.key?(:mid)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def modified_properties=(value)\n @modified_properties = value\n end",
"def apply_properties!(properties)\n # Non-commutitivity etc. eventually.\n end",
"def set_properties(hash)\n hash.each do |key, value|\n add_or_remove_ostruct_member(key, value)\n end\n rest_reset_properties\n end",
"def update\n\t\t\n\t\tend",
"def set_props(props)\n @props.merge!(props)\n end",
"def update() end",
"def update!(**args)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def assign_properties\n self.properties ||= {}\n listing_properties.each do |prop|\n self.properties[prop.key] ||= prop.value\n end\n end",
"def change_properties(new_current_floor, new_next_floor, new_movement)\n @current_floor = new_current_floor\n @next_floor = new_next_floor\n @movement = new_movement\n end",
"def update!(**args)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end",
"def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end",
"def update(attributes)\n (@attributes ||= {}).merge! attributes\n\n (self.class.attr_initializables & attributes.keys).each do |name|\n instance_variable_set :\"@#{name}\", attributes[name]\n end\n\n self\n end",
"def update_attributes(attrs)\n super({})\n end",
"def update\n @dirty = true\n end",
"def update\n\n # Run through the mixin updates\n colourable_update\n movable_update\n\n end",
"def set(props)\n props.each do |prop, val|\n self.send(:\"#{ prop }=\", val)\n end\n end",
"def update\n super\n end",
"def update!(**args)\n @property_id = args[:property_id] if args.key?(:property_id)\n @value_status = args[:value_status] if args.key?(:value_status)\n end",
"def update!(**args)\n @object_size_bytes = args[:object_size_bytes] if args.key?(:object_size_bytes)\n @object_version = args[:object_version] if args.key?(:object_version)\n end",
"def movable_update\n\n # Work through the different aspects we update\n movable_location_update\n movable_size_update\n movable_angle_update\n\n end",
"def properties=(value)\n @properties = value\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(context={})\n self.pre_cast_attributes\n m2o = @relations.reject{|k, v| !self.class.many2one_relations.has_key?(k)}\n vals = @attributes.reject {|key, value| key == 'id'}.merge(m2o.merge(m2o){|k, v| v.is_a?(Array) ? v[0] : v})\n self.class.rpc_execute('write', self.id, vals, context)\n reload_from_record!(self.class.find(self.id, :context => context))\n end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update ; end",
"def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end",
"def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end",
"def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end",
"def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end",
"def update_with(attributes)\n assign_attributes(attributes)\n end",
"def update\n # don't need to update; hash is shared\n end",
"def update(attributes)\n HashProxy.with(attributes) do |proxy|\n self.class.attribute_names.each do |name|\n send(\"#{name}=\", proxy[name]) if proxy.key?(name)\n end\n end\n save\n end",
"def update!(**args)\n @object_id_prop = args[:object_id_prop] if args.key?(:object_id_prop)\n @relation = args[:relation] if args.key?(:relation)\n @subject_id = args[:subject_id] if args.key?(:subject_id)\n end",
"def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end",
"def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end",
"def update\n raise NotImplementedError\n end",
"def update_attributes attributes\n @attributes.merge! attributes\n end",
"def update!(**args)\n @async_options = args[:async_options] if args.key?(:async_options)\n @input_mappings = args[:input_mappings] if args.key?(:input_mappings)\n @name_property = args[:name_property] if args.key?(:name_property)\n @validation_options = args[:validation_options] if args.key?(:validation_options)\n end",
"def update\r\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @type = args[:type] if args.key?(:type)\n end",
"def update\n raise NotImplemented\n end",
"def update_obj\n mean, sd = rating.to_glicko_rating\n @obj.rating = mean\n @obj.rating_deviation = sd\n @obj.volatility = volatility\n end",
"def update_values\n end",
"def update_values\n end",
"def update\n raise NotImplementedError\n end",
"def update!(**args)\n @answers_header_signals = args[:answers_header_signals] if args.key?(:answers_header_signals)\n @property_value = args[:property_value] if args.key?(:property_value)\n @response_meaning_application = args[:response_meaning_application] if args.key?(:response_meaning_application)\n end",
"def update!(**args)\n @create_time = args[:create_time] if args.key?(:create_time)\n @method_prop = args[:method_prop] if args.key?(:method_prop)\n @name = args[:name] if args.key?(:name)\n @state = args[:state] if args.key?(:state)\n end",
"def update attributes, collection #:nodoc:\n 0\n end",
"def update_property_groups(roll)\n @property_groups.each { |_, v| v.update_rent(roll) }\n 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 update!(**args)\n @source_property = args[:source_property] if args.key?(:source_property)\n end",
"def update_properties(path, properties)\n prop_patch = PropPatch.new(properties)\n emit('propPatch', [path, prop_patch])\n prop_patch.commit\n\n prop_patch.result\n end",
"def update\n set_deltatime\n set_last_update_at\n end"
] | [
"0.7012568",
"0.6918917",
"0.6918917",
"0.6918917",
"0.6918917",
"0.6918917",
"0.67404634",
"0.6709981",
"0.6709981",
"0.66964126",
"0.66964126",
"0.66964126",
"0.66964126",
"0.6619218",
"0.6570895",
"0.6539287",
"0.6517026",
"0.63946927",
"0.63901657",
"0.63901657",
"0.63328683",
"0.6318612",
"0.62846893",
"0.62692374",
"0.6264273",
"0.6241163",
"0.6216599",
"0.6214641",
"0.6210363",
"0.6203827",
"0.6203827",
"0.620312",
"0.6201905",
"0.62001497",
"0.61728275",
"0.61728275",
"0.6159924",
"0.61569315",
"0.61442953",
"0.61260897",
"0.6125199",
"0.61227936",
"0.61111224",
"0.610543",
"0.6102925",
"0.60839343",
"0.6083609",
"0.6066973",
"0.60602766",
"0.6055065",
"0.6051568",
"0.6051568",
"0.6042057",
"0.60319084",
"0.60221004",
"0.60149413",
"0.5994295",
"0.5989816",
"0.597674",
"0.5973157",
"0.5967343",
"0.5965598",
"0.59629464",
"0.59618354",
"0.5950329",
"0.5950329",
"0.5950329",
"0.5950329",
"0.5950329",
"0.5950329",
"0.5950329",
"0.5950329",
"0.59495455",
"0.59442014",
"0.59442014",
"0.5944142",
"0.5944142",
"0.59361076",
"0.5925741",
"0.5925574",
"0.59250593",
"0.5924476",
"0.5924476",
"0.5921039",
"0.59155524",
"0.59145254",
"0.5888445",
"0.58860934",
"0.5882302",
"0.5879913",
"0.5877467",
"0.5877467",
"0.58743787",
"0.585829",
"0.584583",
"0.58408254",
"0.5835501",
"0.5829063",
"0.5828611",
"0.58228916",
"0.5819882"
] | 0.0 | -1 |
Update properties of this object | def update!(**args)
@certificate_provider_instance = args[:certificate_provider_instance] if args.key?(:certificate_provider_instance)
@grpc_endpoint = args[:grpc_endpoint] if args.key?(:grpc_endpoint)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update_properties(hash)\n hash.each do |key, value|\n setter_method = \"#{key}=\"\n if self.respond_to?(setter_method)\n self.send(setter_method, value)\n end\n end\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def refresh\n self.class.base_properties.each_with_index do |prop, prop_id|\n @properties[prop] = get_property(prop_id)\n end\n refresh_features\n refresh_status\n refresh_config\n self\n end",
"def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\n end",
"def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\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 update_properties!(branch_id=nil)\n properties = fetch_properties(false, branch_id)\n length = properties.length\n counter = 0\n properties.each do |property|\n counter += 1\n if Vebra.debugging?\n puts \"[Vebra]: #{counter}/#{length}: live updating property with Vebra ref: #{property.attributes[:vebra_ref]}\"\n end\n live_update!(property)\n Vebra.set_last_updated_at(Time.now) if counter == length\n end\n end",
"def update_self obj\n obj.each do |k,v|\n instance_variable_set(\"@#{k}\", v) if v\n end\n end",
"def update_attributes(properties_hash)\n self.class.get_class_properties.each do |property|\n key = property[:name].to_sym\n if properties_hash.has_key? key\n self.setValue(properties_hash[key], forKey:key)\n end\n end\n end",
"def update\n # TODO: implement update\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @states = args[:states] if args.key?(:states)\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end",
"def update!(**args)\n @property = args[:property] if args.key?(:property)\n @total_value_count = args[:total_value_count] if args.key?(:total_value_count)\n @value = args[:value] if args.key?(:value)\n @value_status = args[:value_status] if args.key?(:value_status)\n end",
"def update\n \n end",
"def refresh\n set_attributes\n end",
"def update(attrs)\n @attrs.update(attrs)\n self\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @source = args[:source] if args.key?(:source)\n end",
"def update_resource object, attributes\n object.update attributes\n end",
"def update(attrs)\n @attrs ||= {}\n @attrs.update(attrs)\n self\n end",
"def update\n \n end",
"def update!(**args)\n @property = args[:property] if args.key?(:property)\n @schema = args[:schema] if args.key?(:schema)\n end",
"def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def _update!\n self.class.properties.each do |property, predicate|\n if dirty?(property)\n self.class.repository_or_fail.delete([subject, predicate[:predicate], nil])\n if self.class.is_list?(property)\n repo = RDF::Repository.new\n attribute_get(property).each do |value|\n repo << RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(value, self.class.properties[property][:type]))\n end\n self.class.repository_or_fail.insert(*repo)\n else\n self.class.repository_or_fail.insert(RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(attribute_get(property), self.class.properties[property][:type])))\n end\n end\n @dirty[property] = nil\n @attributes[:original][property] = attribute_get(property)\n end\n self.class.repository_or_fail.insert(RDF::Statement.new(@subject, RDF.type, type)) unless type.nil?\n end",
"def update(attributes = {})\n super(attributes)\n retrieve!\n self\n end",
"def update\n @objects.map(&:update);\n end",
"def update\n raise NotImplementedError\n end",
"def update\n raise NotImplementedError\n end",
"def live_update!(property)\n property_class = Vebra.models[:property][:class].to_s.camelize.constantize\n\n # ensure we have the full property attributes\n property.get_property if !property.attributes[:status] && property.attributes[:action] != 'deleted'\n\n # find & update or build a new property\n property_model = property_class.find_or_initialize_by_vebra_ref(property.attributes[:vebra_ref])\n\n # make sure property object is not empty\n return false if !property.attributes || !property.attributes[:property_type]\n\n # if the property has been deleted, mark it appropriately and move on\n if property.attributes[:action] == 'deleted'\n return property_model.destroy\n end\n\n # extract accessible attributes for the property\n property_accessibles = property_class.accessible_attributes.map(&:to_sym)\n property_attributes = property.attributes.inject({}) do |result, (key, value)|\n result[key] = value if property_accessibles.include?(key)\n result\n end\n\n # update the property model's attributes\n property_model.no_callbacks = true if property_model.respond_to?(:no_callbacks)\n property_model.update_attributes(property_attributes)\n\n # find & update or build a new address\n if Vebra.models[:address]\n address_class = Vebra.models[:address][:class].to_s.camelize.constantize\n address_model = property_model.send(Vebra.models[:property][:address_method])\n address_model = property_model.send(\"build_#{Vebra.models[:property][:address_method]}\") unless address_model\n\n # extract accessible attributes for the address\n address_accessibles = address_class.accessible_attributes.map(&:to_sym)\n address_attributes = property.attributes[:address].inject({}) do |result, (key, value)|\n result[key] = value if address_accessibles.include?(key)\n result\n end\n\n # update the address model's attributes\n address_model.update_attributes(address_attributes)\n end\n\n # find & update or build new rooms\n if Vebra.models[:room]\n room_class = Vebra.models[:room][:class].to_s.camelize.constantize\n\n # accessible attributes for the rooms\n room_accessibles = room_class.accessible_attributes.map(&:to_sym)\n\n # delete any rooms which are no longer present\n property_rooms = property.attributes[:rooms] || []\n property_model_rooms = property_model.send(Vebra.models[:property][:rooms_method])\n refs_to_delete = property_model_rooms.map(&:vebra_ref) - property_rooms.map { |r| r[:vebra_ref] }\n property_model_rooms.each do |room|\n room.destroy if refs_to_delete.include?(room.vebra_ref)\n end\n\n # find & update or build new rooms\n property_rooms.each do |room|\n room_model = room_class.find_by_property_id_and_vebra_ref(property_model.id, room[:vebra_ref])\n room_model = property_model_rooms.build unless room_model\n\n # extract accessible attributes for the room\n room_attributes = room.inject({}) do |result, (key, value)|\n result[key] = value if room_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n room_model.update_attributes(room_attributes)\n end\n end\n\n # find & update or build new file attachments\n if Vebra.models[:file]\n file_class = Vebra.models[:file][:class].to_s.camelize.constantize\n\n # accessible attributes for the files\n file_accessibles = file_class.accessible_attributes.map(&:to_sym)\n\n # first normalize the collection (currently nested collections)\n property_files = property.attributes[:files].inject([]) do |result, (kind, collection)|\n collection.each do |file|\n file[:type] = kind.to_s.singularize.camelize if file_accessibles.include?(:type)\n file[\"remote_#{Vebra.models[:file][:attachment_method]}_url\".to_sym] = file.delete(:url)\n # if file[:type] is set, it means the attachment file class can be subclassed. In this\n # case we need to ensure that the subclass exists. If not, we ignore this file\n begin\n file[:type].constantize if file_accessibles.include?(:type)\n result << file\n rescue NameError => e\n # ignore - this means the subclass does not exist\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n\n result\n end\n\n # delete any files which are no longer present\n property_model_files = property_model.send(Vebra.models[:property][:files_method])\n refs_to_delete = property_model_files.map(&:vebra_ref) - property_files.map { |f| f[:vebra_ref] }\n property_model_files.each do |file|\n file.destroy if refs_to_delete.include?(file.vebra_ref)\n end\n\n # find & update or build new files\n property_files.each do |file|\n begin\n file_model = property_model_files.find_by_vebra_ref(file[:vebra_ref])\n file_model = property_model_files.build unless file_model\n\n # extract accessible attributes for the file\n file_attributes = file.inject({}) do |result, (key, value)|\n result[key] = value if file_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n file_model.update_attributes(file_attributes)\n rescue CarrierWave::ProcessingError, OpenURI::HTTPError => e\n # just ignore the file\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n end\n\n property_model.no_callbacks = false if property_model.respond_to?(:no_callbacks)\n property_model.save\n return property_model\n end",
"def update!(**args)\n @id = args[:id] if args.key?(:id)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def update\n end",
"def update!(**args)\n @mid = args[:mid] if args.key?(:mid)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def modified_properties=(value)\n @modified_properties = value\n end",
"def apply_properties!(properties)\n # Non-commutitivity etc. eventually.\n end",
"def set_properties(hash)\n hash.each do |key, value|\n add_or_remove_ostruct_member(key, value)\n end\n rest_reset_properties\n end",
"def update\n\t\t\n\t\tend",
"def set_props(props)\n @props.merge!(props)\n end",
"def update() end",
"def update!(**args)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def assign_properties\n self.properties ||= {}\n listing_properties.each do |prop|\n self.properties[prop.key] ||= prop.value\n end\n end",
"def change_properties(new_current_floor, new_next_floor, new_movement)\n @current_floor = new_current_floor\n @next_floor = new_next_floor\n @movement = new_movement\n end",
"def update!(**args)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end",
"def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end",
"def update(attributes)\n (@attributes ||= {}).merge! attributes\n\n (self.class.attr_initializables & attributes.keys).each do |name|\n instance_variable_set :\"@#{name}\", attributes[name]\n end\n\n self\n end",
"def update_attributes(attrs)\n super({})\n end",
"def update\n @dirty = true\n end",
"def update\n\n # Run through the mixin updates\n colourable_update\n movable_update\n\n end",
"def set(props)\n props.each do |prop, val|\n self.send(:\"#{ prop }=\", val)\n end\n end",
"def update\n super\n end",
"def update!(**args)\n @property_id = args[:property_id] if args.key?(:property_id)\n @value_status = args[:value_status] if args.key?(:value_status)\n end",
"def update!(**args)\n @object_size_bytes = args[:object_size_bytes] if args.key?(:object_size_bytes)\n @object_version = args[:object_version] if args.key?(:object_version)\n end",
"def movable_update\n\n # Work through the different aspects we update\n movable_location_update\n movable_size_update\n movable_angle_update\n\n end",
"def properties=(value)\n @properties = value\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(context={})\n self.pre_cast_attributes\n m2o = @relations.reject{|k, v| !self.class.many2one_relations.has_key?(k)}\n vals = @attributes.reject {|key, value| key == 'id'}.merge(m2o.merge(m2o){|k, v| v.is_a?(Array) ? v[0] : v})\n self.class.rpc_execute('write', self.id, vals, context)\n reload_from_record!(self.class.find(self.id, :context => context))\n end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update ; end",
"def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end",
"def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end",
"def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end",
"def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end",
"def update_with(attributes)\n assign_attributes(attributes)\n end",
"def update\n # don't need to update; hash is shared\n end",
"def update(attributes)\n HashProxy.with(attributes) do |proxy|\n self.class.attribute_names.each do |name|\n send(\"#{name}=\", proxy[name]) if proxy.key?(name)\n end\n end\n save\n end",
"def update!(**args)\n @object_id_prop = args[:object_id_prop] if args.key?(:object_id_prop)\n @relation = args[:relation] if args.key?(:relation)\n @subject_id = args[:subject_id] if args.key?(:subject_id)\n end",
"def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end",
"def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end",
"def update\n raise NotImplementedError\n end",
"def update_attributes attributes\n @attributes.merge! attributes\n end",
"def update!(**args)\n @async_options = args[:async_options] if args.key?(:async_options)\n @input_mappings = args[:input_mappings] if args.key?(:input_mappings)\n @name_property = args[:name_property] if args.key?(:name_property)\n @validation_options = args[:validation_options] if args.key?(:validation_options)\n end",
"def update\r\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @type = args[:type] if args.key?(:type)\n end",
"def update\n raise NotImplemented\n end",
"def update_obj\n mean, sd = rating.to_glicko_rating\n @obj.rating = mean\n @obj.rating_deviation = sd\n @obj.volatility = volatility\n end",
"def update_values\n end",
"def update_values\n end",
"def update\n raise NotImplementedError\n end",
"def update!(**args)\n @answers_header_signals = args[:answers_header_signals] if args.key?(:answers_header_signals)\n @property_value = args[:property_value] if args.key?(:property_value)\n @response_meaning_application = args[:response_meaning_application] if args.key?(:response_meaning_application)\n end",
"def update!(**args)\n @create_time = args[:create_time] if args.key?(:create_time)\n @method_prop = args[:method_prop] if args.key?(:method_prop)\n @name = args[:name] if args.key?(:name)\n @state = args[:state] if args.key?(:state)\n end",
"def update attributes, collection #:nodoc:\n 0\n end",
"def update_property_groups(roll)\n @property_groups.each { |_, v| v.update_rent(roll) }\n end",
"def update!(**args)\n @source_property = args[:source_property] if args.key?(:source_property)\n 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 update_properties(path, properties)\n prop_patch = PropPatch.new(properties)\n emit('propPatch', [path, prop_patch])\n prop_patch.commit\n\n prop_patch.result\n end",
"def update\n set_deltatime\n set_last_update_at\n end"
] | [
"0.7012263",
"0.69181895",
"0.69181895",
"0.69181895",
"0.69181895",
"0.69181895",
"0.67403597",
"0.6709326",
"0.6709326",
"0.6696149",
"0.6696149",
"0.6696149",
"0.6696149",
"0.6618882",
"0.6571848",
"0.65386343",
"0.65178275",
"0.6394807",
"0.6389745",
"0.6389745",
"0.63328",
"0.6319025",
"0.6283673",
"0.6269463",
"0.62639254",
"0.62410724",
"0.62170374",
"0.62152076",
"0.6210263",
"0.6204041",
"0.6204041",
"0.62021106",
"0.62017816",
"0.62017",
"0.61730784",
"0.61730784",
"0.6159277",
"0.6156169",
"0.61445665",
"0.6125433",
"0.61241156",
"0.6121413",
"0.6110477",
"0.6105694",
"0.61016303",
"0.60845226",
"0.6084427",
"0.6065455",
"0.6059506",
"0.6054869",
"0.6051708",
"0.6051708",
"0.60413384",
"0.6030853",
"0.6022535",
"0.6015561",
"0.59932375",
"0.59898263",
"0.5976479",
"0.5973787",
"0.59678394",
"0.5963291",
"0.5962048",
"0.5961157",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.59500545",
"0.59443134",
"0.59443134",
"0.59424853",
"0.59424853",
"0.593523",
"0.5926413",
"0.5924831",
"0.592427",
"0.59233046",
"0.59233046",
"0.5921224",
"0.59144294",
"0.59142506",
"0.58887535",
"0.58854496",
"0.5883008",
"0.58792305",
"0.5876954",
"0.5876954",
"0.58744955",
"0.5857968",
"0.5845542",
"0.5841629",
"0.58363605",
"0.5829255",
"0.582919",
"0.5822138",
"0.58208305"
] | 0.0 | -1 |
routines to add: is mysql even installed? is mysql process started? is mysql listening at all on remote node? check the cluster status on a remote node start the mysql service with the given address restart the mysql service cos the cluster is complete | def create
# this routine creates the cluster - if this runs, exists? has exited false
# first we check all the nodes to ensure mysql is listening, and if the
# wsrep_cluster_status is primary. If one is, we'll join it.
# array cluster_servers is the list of hosts to check
first_node = true
gcomm_address = "gcomm://"
@resource[:cluster_servers].each { | node |
if @resource[:hostname] != node # not this host, so do the check
puts "checking host #{node} for Primary"
#TODO - refactor this to simplify, it's ugly like this
begin
cluster_check_result = mysql([defaults_file, "-h", node, '-NBe', "show status like 'wsrep_cluster_status'"].compact)
puts "Result of check on #{node} was #{cluster_check_result}"
rescue => e
debug(e.message)
cluster_check_result = "someerror"
end
if cluster_check_result.match(/Primary/)
first_node = false
gcomm_address = "gcomm://#{node}"
puts "Node #{node} matched Primary, first_node is #{first_node}, address is now #{gcomm_address}"
# TODO what happens when mysql isn't listening on node?
# that node is a primary, we can connect to it
# we should end the loop here, but it probably doesn't hurt if we don't
#break
else
puts "host #{node} is not a primary"
end
end
}
# after that loop, we'll have a boolean first_node that tells if this is the first node.
if first_node == true
puts "This is the first node of the cluster, so we will create the cluster now, address: #{gcomm_address}"
# this is the first node, and it's not yet a cluster
else
puts "first node is #{first_node}, address: #{gcomm_address}"
end
# stop the service
mysqladmin([defaults_file, "shutdown"].compact)
service([@resource[:servicename], "stop"].compact)
# start it special with the address as set above
# TODO if this is the first node, do another check after some random sleep time, just in case...
mysql_startup = fork do
exec "/usr/bin/mysqld_safe --wsrep_cluster_address=#{gcomm_address}"
end
Process.detach(mysql_startup)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def check_for_mysql_presence(host,user,system_user)\n Net::SSH.start(host,system_user, {auth_methods: %w( publickey )}) do |ssh|\n output = ssh.exec!(\"ps -U #{user} -u #{user} u\")\n if output =~ /mysql/\n $results += 1\n # Grab the port number. This requires ruby 1.9.2+\n /port=(?<port>\\d+)/ =~ output\n puts \"MySQL Match on #{host}:#{port} for #{user}\".blue\n end\n end\n end",
"def mysqlHealth(envid)\n now = Time.now\n env = $envManager.getEnv(envid)\n vmList = env.getVMList()\n vmList.each { |vm|\n cmd = \"ssh carina@#{vm.ipaddress} mysqladmin ping\"\n lineread = false\n IO.popen(cmd) { |f|\n if f.eof\n if !lineread\n $Logger.debug \"MySqlHealthPlugin: mysqld is not alive - no output from mysqladmin ping\"\n vm.status = \"SICK\"\n return 0\n end\n break\n end\n v = f.readline\n puts \"MySqlHealthPlugin: Processing line: #{v}\"\n lineread=true\n if !v.include? 'is alive'\n $Logger.debug \"MySqlHealthPlugin: mysqld is not alive\"\n vm.status = \"SICK\"\n return 0\n end\n }\n }\n $Logger.debug \"MySqlHealthPlugin: mysqld is alive\"\n return 1\n end",
"def run_lamp_chef_checks\n # check that the standard unified app is responding on port 80\n run_unified_application_checks(@servers, 80)\n \n=begin \n # check that running the mysql backup script succeeds\n @servers.first.spot_check_command(\"/etc/cron.daily/mysql-dump-backup.sh\")\n \n # exercise operational RightScript(s)\n run_script(\"backup\", @servers.first)\n run_script(\"restart_apache\", @servers.first)\n \n # check that mysql tmpdir is custom setup on all servers\n query = \"show variables like 'tmpdir'\"\n query_command = \"echo -e \\\"#{query}\\\"| mysql\"\n @servers.each do |server|\n server.spot_check(query_command) { |result| raise \"Failure: tmpdir was unset#{result}\" unless result.include?(\"/mnt/mysqltmp\") }\n end\n \n # check that logrotate has mysqlslow in it\n @servers.each do |server|\n res = server.spot_check_command(\"logrotate --force -v /etc/logrotate.d/mysql-server\")\n raise \"LOGROTATE FAILURE, exited with non-zero status\" if res[:status] != 0\n raise \"DID NOT FIND mysqlslow.log in the log rotation!\" if res[:output] !~ /mysqlslow/\n end\n=end\n \n end",
"def run_host(ip)\n\t\tbegin\n\t\t\ts = connect(false)\n\t\t\tdata = s.get\n\t\t\tdisconnect(s)\n\t\trescue ::Rex::ConnectionError, ::EOFError\n\t\t\treturn\n\t\trescue ::Exception\n\t\t\tprint_error(\"Error: #{$!}\")\n\t\t\treturn\n\t\tend\n\n\t\toffset = 0\n\n\t\tl0, l1, l2 = data[offset, 3].unpack('CCC')\n\t\tlength = l0 | (l1 << 8) | (l2 << 16)\n\n\t\t# Read a bad amount of data\n\t\treturn if length != (data.length - 4)\n\n\t\toffset += 4\n\n\t\tproto = data[offset, 1].unpack('C')[0]\n\n\t\t# Application-level error condition\n\t\tif proto == 255\n\t\t\toffset += 2\n\t\t\terr_msg = Rex::Text.to_hex_ascii(data[offset..-1].to_s)\n\t\t\tprint_status(\"#{rhost}:#{rport} is running MySQL, but responds with an error: #{err_msg}\")\n\t\t\treport_service(\n\t\t\t\t:host => rhost,\n\t\t\t\t:port => rport,\n\t\t\t\t:name => \"mysql\",\n\t\t\t\t:info => \"Error: #{err_msg}\"\n\t\t\t)\n\t\telse\n\t\t\toffset += 1\n\t\t\tversion = data[offset..-1].unpack('Z*')[0]\n\t\t\tprint_status(\"#{rhost}:#{rport} is running MySQL #{version} (protocol #{proto})\")\n\t\t\treport_service(\n\t\t\t\t:host => rhost,\n\t\t\t\t:port => rport,\n\t\t\t\t:name => \"mysql\",\n\t\t\t\t:info => version\n\t\t\t)\n\t\tend\n\tend",
"def activate_service(modified=false)\n service = \"mysql\"\n modified |= interpreter.service_manager.enable(service)\n modified |= interpreter.service_manager.start(service)\n return modified\n end",
"def run_mysqlslap_check\n @servers.each do |server|\n result = server.spot_check_command(\"mysqlslap --concurrency=5000 --iterations=10 --number-int-cols=2 --number-char-cols=3 --auto-generate-sql --csv=/tmp/mysqlslap_q1000_innodb.csv --engine=innodb --auto-generate-sql-add-autoincrement --auto-generate-sql-load-type=mixed --number-of-queries=1000 --user=root\")\n raise \"FATAL: mysqlslap check failed\" unless result[:output].empty?\n end\n end",
"def startup\n Mysql2::Client.new(host: '127.0.0.1', username: 'root', port: '3307', database: 'management_gateway_development')\nend",
"def mysql_global_vip_connection_info(category='root')\n host_info = {\n host: node[:bcpc][:management][:vip],\n port: 3306\n }\n mysql_local_connection_info.merge(host_info)\nend",
"def mysql_remote_connection_info(category='root', remote)\n host_info = {\n host: remote,\n port: 3306\n }\n mysql_local_connection_info.merge(host_info)\nend",
"def mysql_keepalive\n ping_mysql\n end",
"def check_cluster\n hostname = \"botha1.cs.ualberta.ca\"\n username = \"prion\"\n keys = ['/apps/phaster/.ssh/botha', '~/.ssh/id_rsa'] # private keys to test (not all the files need to exist)\n\n # Can we connect?\n begin\n ssh = Net::SSH.start(hostname, username, :keys => keys, :auth_methods => ['publickey']) # Only try public key authentication.\n rescue\n #puts \"Unable to connect to #{hostname} using #{username}\"\n return('Unable to connect to the computing cluster! Please contact PHASTER support so the issue can be addressed.')\n end\n\n # Can qsub command be found?\n res = ssh.exec!('which qsub')\n if res =~ /no qsub in/\n return('A problem was detected on the computing cluster! Please contact PHASTER support so the issue can be addressed.')\n end\n\n # Are there any cluster child nodes that are alive?\n res = ssh.exec!('alive')\n c = 0\n res.split(\"\\n\").each { |line|\n c += 1\n }\n #puts \"#{c} child nodes available\"\n if c == 0\n return('A problem was detected on the computing cluster! Please contact PHASTER support so the issue can be addressed.')\n end\n\n ssh.close\n return('')\n end",
"def start()\n %x( zkServer.sh --config \"#{@configDir}\" start )\n if $?.exitstatus != 0\n raise RuntimeError, \"CloudRDBMS node #{@address} failed to start zk server\"\n end\n end",
"def install_lamp(mysql_root_pass)\n\n # Update repository\n system ( \"apt-get update\" )\n system ( \"apt-get -y upgrade\" )\n \n # Install MySQL\n system ( \"echo mysql-server mysql-server/root_password password #{mysql_root_pass} | sudo debconf-set-selections\" )\n system ( \"echo mysql-server mysql-server/root_password_again password #{mysql_root_pass} | sudo debconf-set-selections\" )\n system ( \"apt-get -y install mysql-server mysql-client\" )\n\n # Install Apache\n system ( \"apt-get -y install apache2\" )\n\n # Install PHP\n system ( \"apt-get -y install php5 libapache2-mod-php5 php5-mysql\" )\n\n # Restart Apache\n system ( \"/etc/init.d/apache2 restart\" )\n\n # Install MySQL development headers and 'mysql2' ruby gem (needed for ruby->mysql interaction)\n system ( \"apt-get install libmysqlclient-dev\")\n system ( \"gem install mysql2\" )\n\n # Install phpMyAdmin (skipped for now)\n # system ( \"sudo apt-get -y install phpmyadmin\" )\n\n puts \"LAMP Installed\"\nend",
"def karaf_started?\n n = `netstat -ao | grep 8101 | wc -l`\n n.to_i > 0\n end",
"def can_we_connect?(host, user, pass, db=nil, port=3306)\n begin\n dbc = Mysql.connect(host, user, pass, db, port)\n return dbc\n rescue Mysql::Error => e\n puts \"Connection Problem\".light_red + \"!\".white\n puts \"\\t=> \".white + \"#{e}\".light_red\n return nil\n end\nend",
"def repl_status_host(args={})\n req(:required => [:slave],\n :args_object => args)\n args.delete(:sql) if args.has_key?(:sql)\n dbh = Mysqladmin::Exec.new(:connection_name => args[:slave])\n dbh.query(:sql => \"SHOW SLAVE STATUS\")\n res = dbh.fetch_hash\n sbm = res[\"Seconds_Behind_Master\"].to_i\n io = res[\"Slave_IO_Running\"].upcase\n sql = res[\"Slave_SQL_Running\"].upcase\n if((io != \"YES\") || (sql != \"YES\"))\n return false\n elsif(sbm > @sbm_limit)\n return false\n else\n return true\n end\n end",
"def run_checks\n # check that mysql tmpdir is custom setup on all servers\n query = \"show variables like 'tmpdir'\"\n query_command = \"echo -e \\\"#{query}\\\"| mysql\"\n @servers.each do |server|\n server.spot_check(query_command) { |result| raise \"Failure: tmpdir was unset#{result}\" unless result.include?(\"/mnt/mysqltmp\") }\n end\n end",
"def config_master_from_scratch(server)\n behavior(:create_stripe, server)\n object_behavior(server, :spot_check_command, \"service mysqld start\")\n#TODO the service name depends on the OS\n# server.spot_check_command(\"service mysql start\")\n behavior(:run_query, \"create database mynewtest\", server)\n behavior(:set_master_dns, server)\n # This sleep is to wait for DNS to settle - must sleep\n sleep 120\n behavior(:run_script, \"backup\", server)\n end",
"def multiple_clusters_available?\n false\n end",
"def cluster(cmd, registry:nil)\n puts(\":: Deploying Kubernetes Cluster...\".colorize(:light_yellow))\n proxy_export = \"[ -f /etc/profile.d/setproxy.sh ] && source /etc/profile.d/setproxy.sh\"\n elapse = Time.now\n ips = getnodes.map{|x| x.ip}\n all = cmd.include?('all')\n init = cmd.include?('init')\n config = cmd.include?('config')\n dashboard = cmd.include?('dashboard')\n helm = cmd.include?('helm')\n weave = cmd.include?('weave')\n flannel = cmd.include?('flannel')\n flannel = true if !weave\n\n # Validate host environment\n #---------------------------------------------------------------------------\n puts(\":: Validating the K8s host environment\".colorize(:cyan))\n Log.die(\"Ensure 'kubectl' is installed and on the $PATH\") unless FileUtils.exec?('kubectl')\n host_k8sver = `kubectl version --client`[/GitVersion.*v([\\d]+\\.[\\d]+\\.[\\d]+)/, 1]\n !puts(\"Kubectl needs to be version #{@k8sver} or higher\".colorize(:red)) and\n exit unless Gem::Version.new(host_k8sver) >= Gem::Version.new(@k8sver)\n puts(\"Host K8s Version: #{host_k8sver}\".colorize(:green))\n\n Log.die(\"Ensure 'helm' is installed and on the path\") unless FileUtils.exec?('helm')\n host_helmver = `helm version --client`[/\\d+\\.\\d+\\.\\d+/]\n !puts(\"Helm needs to be version #{@helmver} or higher\".colorize(:red)) and\n exit unless Gem::Version.new(host_helmver) >= Gem::Version.new(@helmver)\n puts(\"Host Helm Version: #{host_helmver}\".colorize(:green))\n\n # Validate node environment\n #---------------------------------------------------------------------------\n puts(\":: Validating the K8s node environment\".colorize(:cyan))\n node_k8sver = nil\n puts(\"Nodes: #{ips * ', '}\".colorize(:cyan))\n Net::SSH.start(ips.first, @user, password:@pass, verify_host_key: :never){|ssh|\n node_k8sver = ssh.exec!(\"kubectl version --client\")[/GitVersion.*v([\\d]+\\.[\\d]+\\.[\\d]+)/, 1]\n !puts(\"Node K8s needs to be version #{@k8sver} or higher\".colorize(:red)) and\n exit unless Gem::Version.new(node_k8sver) >= Gem::Version.new(@k8sver)\n puts(\"Node K8s Version: #{node_k8sver}\".colorize(:green))\n\n node_helmver = ssh.exec!(\"helm version --client\")[/SemVer.*v([\\d]+\\.[\\d]+\\.[\\d]+)/, 1]\n !puts(\"Node Helm needs to be version #{@helmver} or higher\".colorize(:red)) and\n exit unless Gem::Version.new(node_helmver) >= Gem::Version.new(@helmver)\n puts(\"Node Helm Version: #{node_helmver}\".colorize(:green))\n }\n\n # (Idempotent) Configure nodes for clustering\n # ==========================================================================\n threads = []\n ips.each{|ip| threads << Thread.new{\n Net::SSH.start(ip, @user, password:@pass, verify_host_key: :never) do |ssh|\n puts(\":: Configure nodes for clustering\".colorize(:cyan))\n\n # Configure journald for persistent storage\n journald_conf = '/etc/systemd/journald.conf'\n if not ssh.exec!(\"cat #{journald_conf}\").include?('persistent')\n ssh.exec!(\"sudo sed -i -e 's/.*\\\\(Storage=\\\\).*/\\\\1persistent/' #{journald_conf}\")\n ssh.exec!(\"sudo systemctl restart systemd-journald\")\n puts(\"#{ip}: Configured node journald...done\".colorize(:cyan))\n else\n puts(\"#{ip}: Configure node journald...skipped\".colorize(:cyan))\n end\n\n # Configure kubelet node ip\n kubelet = '/etc/default/kubelet'\n if not ssh.exec!(\"cat #{kubelet}\").include?(ip)\n args = [\"--node-ip=#{ip}\"] * ' '\n ssh.exec!(\"sudo sed -i -e 's/\\\\(KUBELET_EXTRA_ARGS=\\\\)\\\\(.*$\\\\)/\\\\1#{args} \\\\2/' #{kubelet}\")\n ssh.exec!(\"sudo systemctl restart kubelet\")\n puts(\"#{ip}: Configured Kubelet private network ip...done\".colorize(:cyan))\n else\n puts(\"#{ip}: Configure Kubelet private network ip...skipped\".colorize(:cyan))\n end\n\n # Configure kernel for Elasticsearch\n sysctl_conf = '/etc/sysctl.d/10-cyberlinux.conf'\n if not ssh.exec!(\"cat #{sysctl_conf}\").include?('max_map_count')\n ssh.exec!(\"echo 'vm.max_map_count = 262144' | sudo tee -a #{sysctl_conf}'\")\n ssh.exec!(\"sudo sysctl -w vm.max_map_count=262144\")\n else\n puts(\"#{ip}: Configure kernel params...skipped\".colorize(:cyan))\n end\n\n # Optionally - configure private registry\n# if registry\n# docker_opts = [ \"--registry-mirror=http://#{registry}\", \"--insecure-registry #{registry}\" ]\n# override_conf = '/etc/systemd/system/docker.service.d/override.conf'\n# if not ssh.exec!(\"[ -e #{override_conf} ] && echo 'exists'\").include?('exists')\n#\n# # Configure kubernetes for private registry\n# docker_conf = \"{\\\\\\\"auths\\\\\\\":{\\\\\\\"#{registry}\\\\\\\":{\\\\\\\"auth\\\\\\\":\\\\\\\"YW5vbnltb3VzOmFub255bW91cw==\\\\\\\"}}}\"\n# ssh.exec!(\"sudo bash -c 'mkdir -p /root/.docker'\")\n# ssh.exec!(\"sudo bash -c 'echo \\\"#{docker_conf}\\\" > /root/.docker/config.json'\")\n#\n# # Configure docker for private registry\n# ssh.exec!(\"sudo bash -c 'echo \\\"[Service]\\\" > #{override_conf}'\")\n# ssh.exec!(\"sudo bash -c 'echo \\\"ExecStart=\\\" >> #{override_conf}'\")\n# ssh.exec!(\"sudo bash -c 'echo \\\"ExecStart=/usr/bin/dockerd #{docker_opts * ' '} -H fd://\\\" >> #{override_conf}'\")\n# ssh.exec!(\"sudo systemctl daemon-reload\")\n# ssh.exec!(\"sudo systemctl restart docker\")\n# puts(\"#{ip}: Configured Docker overrides...done\".colorize(:cyan))\n# else\n# puts(\"#{ip}: Configure Docker overrides...skipped\".colorize(:cyan))\n# end\n# end\n end\n }}\n threads.each{|x| x.join}\n\n # (Idempotent) Initialize cluster via kubeadm\n # ==========================================================================\n # https://kubernetes.io/docs/getting-started-guides/kubeadm\n # https://kubernetes.io/docs/reference/setup-tools/kubeadm/kubeadm-init/\n # https://kubernetes.io/docs/reference/setup-tools/kubeadm/kubeadm-init/#config-file\n # --------------------------------------------------------------------------\n join = nil\n if all or init\n Net::SSH.start(ips.first, @user, password:@pass, verify_host_key: :never){|ssh|\n if not ssh.exec!(\"docker ps\").include?(\"apiserver\")\n puts(\":: Initialize master node '#{ips.first}'\".colorize(:cyan))\n ssh.exec!(\"mkdir -p ~/manifest\")\n\n # Cluster cidr is required for flannel and some other pod networks.\n # https://github.com/coreos/flannel/blob/master/Documentation/kubernetes.md\n # It is the same cidr range that gets assigned to --cluster-cidr if you check with\n # 'kubectl cluster-info dump | grep cidr' and thus the same value that should be used for\n # the kube-proxy --cluster-cidr argument as well.\n cluster_cidr = \"10.32.0.0/12\" if weave\n cluster_cidr = \"10.244.0.0/16\" if flannel\n\n # Execute kubeadm with config template\n if config\n FileUtils.cp('template/kubeadm.tpl', 'manifest/kubeadm.yaml')\n FileUtils.resolve('manifest/kubeadm.yaml', {\n advertise_address: ips.first,\n kubernetes_version: @k8sver,\n kube_proxy_mode: \"iptables\",\n cgroup_driver: \"cgroupfs\", # kubeadm default: cgroupfs\n cluster_domain: \"cluster.local\", # kubeadm default: cluster.local\n cluster_dns: \"10.96.0.10\", # kubeadm default: 10.96.0.10\n service_cidr: \"10.96.0.0/12\", # kubeadm default: 10.96.0.0/12\n cluster_cidr: cluster_cidr # cidr for pod networking\n })\n Net::SCP.upload!(ips.first, @user, 'manifest/kubeadm.yaml', 'manifest/kubeadm.yaml',\n ssh:{verify_host_key: :never, password: @pass})\n cmd = \"sudo kubeadm init --config manifest/kubeadm.yaml\"\n else\n cmd = \"sudo kubeadm init --kubernetes-version=v#{@k8sver} \"\n cmd += \"--apiserver-advertise-address=#{ips.first} \"\n cmd += \"--pod-network-cidr=#{cluster_cidr}\"\n end\n\n # Capture join for worker nodes\n # e.g. kubeadm join 192.168.56.10:6443 --token u6wor2.6kinrlvcbtxcoqo4 --discovery-token-ca-cert-hash\n # sha256:1112aafe50e27d54bccfd45d956f658a18b05e8b0ccf90c264ec17b026d01a8f\n ssh.exec!(cmd){|c,s,o|\n puts(o)\n join = o.split(\"\\n\").find{|x| x.include?(\"kubeadm join\")}.strip if o.include?(\"kubeadm join\")\n }\n\n # Setup kubectl on master node for both vagrant and root users\n ssh.exec!(\"mkdir -p ~/.kube\")\n ssh.exec!(\"sudo mkdir -p /root/.kube\")\n ssh.exec!(\"sudo cp /etc/kubernetes/admin.conf /root/.kube/config\")\n ssh.exec!(\"sudo cp /etc/kubernetes/admin.conf ~/.kube/config\")\n ssh.exec!(\"sudo chown $(id -u):$(id -g) ~/.kube/config\")\n ssh.exec!(\"kubectl config use-context kubernetes-admin@kubernetes\")\n ssh.exec!(\"sudo kubectl config use-context kubernetes-admin@kubernetes\")\n ssh.exec!(\"kubectl cluster-info\"){|c,s,o|puts(o)}\n\n # Disable RBAC\n # Bottom of https://kubernetes.io/docs/admin/authorization/rbac\n puts(\"Disabling RBAC...\".colorize(:cyan))\n ssh.exec!(\"kubectl create clusterrolebinding permissive-binding --clusterrole=cluster-admin --user=admin --user=kubelet --group=system:serviceaccounts\"){|c,s,o|puts(o)}\n\n # Taint master node to allow pods to be scheduled on it\n # Check current taints in Taints section: kubectl describe node\n puts(\"Tainting the master node to allow pods to be scheduled on it\".colorize(:cyan))\n ssh.exec!(\"kubectl taint nodes --all node-role.kubernetes.io/master-\"){|c,s,o|puts(o)}\n\n # Configure kube-proxy\n # --------------------------------------------------------------------\n # https://kubernetes.io/docs/reference/command-line-tools-reference/kube-proxy/\n # --------------------------------------------------------------------\n # Note: as kube-proxy runs as a pod created by the kubeadm process it is impossible to\n # configure it as all documentation suggests with --<param> values nor with config files\n # for kube-proxy e.g. /var/lib/kub-proxy/config.conf. The only way to configure it is to\n # launch kubeadm with the --config param and pass in a static kubeadm config with the\n # .kubeProxy.config.mode and .kubeProxy.config.clusterCIDR variables changed as deired.\n # Alternatively one can modify the kube-proxy manifest post deploy and restart the pod.\n # --------------------------------------------------------------------\n # See configs kube-proxy is currently using:\n # kubectl -n kube-system get ds kube-proxy -o json | jq '.spec.template.spec.containers[0].command'\n # --------------------------------------------------------------------\n if !config\n puts(\"Configure kube-proxy...\".colorize(:cyan))\n get_kube_proxy = \"kubectl -n kube-system get ds kube-proxy -o json\"\n\n # Which proxy mode to use 'userspace' (older), 'iptables' (faster), 'ipvs' (experimental)\n mod_kube_proxy = \" | jq '.spec.template.spec.containers[0].command |= .+ [\\\"--proxy-mode=iptables\\\"]'\"\n\n # CIDR range of pods in cluster. Essential to set so kube-proxy knows what and where to proxy\n mod_kube_proxy += \" | jq '.spec.template.spec.containers[0].command |= .+ [\\\"--cluster-cidr=#{cluster_cidr}\\\"]'\"\n\n # Update kube-proxy deployment configuration and restart the service\n set_kube_proxy = \"#{get_kube_proxy} #{mod_kube_proxy} | kubectl apply -f -\"\n puts(\"exec: #{set_kube_proxy}\")\n ssh.exec!(set_kube_proxy){|c,s,o|puts(o)}\n ssh.exec!(\"kubectl -n kube-system delete po -l 'k8s-app=kube-proxy'\"){|c,s,o|puts(o)}\n end\n\n # Deploy Pod networking\n # CoreDNS will be in a pending state until pod networking is deployed\n # CoreDNS must be running before joining any worker nodes to the cluster\n # https://kubernetes.io/docs/setup/independent/create-cluster-kubeadm/#pod-network\n # kubectl -n kube-system get ds kube-flannel-ds -o json | '.spec.template.spec.containers[0].command'\"\n puts(\"Installing pod networking\".colorize(:cyan))\n if weave\n podnet = \"https://cloud.weave.works/k8s/net?k8s-version=#{@k8sver}\"\n elsif flannel\n FileUtils.cp('template/flannel.tpl', 'manifest/flannel.yaml')\n FileUtils.resolve('manifest/flannel.yaml', {\n iface: \"enp0s8\", # the interface to use for inter-host communication\n backend_type: \"vxlan\", # default: vxlan - backend type\n cluster_cidr: cluster_cidr # default: 10.244.0.0/16 - cidr for pod networking\n })\n Net::SCP.upload!(ips.first, @user, 'manifest/flannel.yaml', 'manifest/flannel.yaml',\n ssh:{verify_host_key: :never, password: @pass})\n podnet = \"~/manifest/flannel.yaml\"\n end\n ssh.exec!(\"#{proxy_export}; kubectl apply -f #{podnet}\"){|c,s,o|puts(o)}\n podready!('coredns', ssh:ssh)\n end\n }\n end\n\n # (Idempotent) Configure slaves to join cluster\n #---------------------------------------------------------------------------\n if all or init\n nodes_to_join = []\n Net::SSH.start(ips.first, @user, password:@pass, verify_host_key: :never){|ssh|\n puts(\":: Determine nodes to join cluster...\".colorize(:cyan))\n output = getpods(ssh:ssh)\n nodes_to_join = ips[1..-1].select{|x| !output.include?(x)}\n puts(nodes_to_join)\n }\n nodes_to_join.each{|ip|\n Net::SSH.start(ip, @user, password:@pass, verify_host_key: :never){|ssh|\n puts(\"#{ip.colorize(:cyan)}: Joining cluster\")\n puts(\"#{ip.colorize(:cyan)}: sudo #{join}\")\n ssh.exec!(\"sudo #{join}\"){|c,s,o|puts(o)}\n }\n }\n end\n\n # (Idempotent) Install dashboard and helm\n #---------------------------------------------------------------------------\n Net::SSH.start(ips.first, @user, password:@pass, verify_host_key: :never){|ssh|\n if (all || init) && (dashboard || helm)\n podready!('etcd', ssh:ssh)\n podready!('apiserver', ssh:ssh)\n podready!('controller', ssh:ssh)\n podready!('scheduler', ssh:ssh)\n end\n\n # Initialize/update helm\n if all or helm\n if not getpods(pod:'tiller', ssh:ssh)\n puts(\"#{ips.first}: Initializing helm\".colorize(:cyan))\n ssh.exec!(\"#{proxy_export}; helm init\"){|c,s,o|puts(o)}\n ssh.exec!(\"#{proxy_export}; helm repo update\"){|c,s,o|puts(o)}\n else\n puts(\"#{ips.first}: Initializing/updating helm...skipped\".colorize(:cyan))\n end\n end\n\n # Install dashboard\n # debug dns: kubectl run -ti --image=busybox -- sh\n # nslookup kubernetes.default\n if all or dashboard\n if not getpods(pod:'dashboard', ssh:ssh)\n puts(\"#{ips.first}: Installing dashboard\".colorize(:cyan))\n url = \"https://raw.githubusercontent.com/kubernetes/dashboard/master/src/deploy/recommended/kubernetes-dashboard.yaml\"\n puts(ssh.exec!(\"kubectl create -f #{url}\"))\n puts(\"Access Dashboard:\".colorize(:cyan))\n puts(\"run: kubectl proxy\".colorize(:cyan))\n puts(\"#{'Navigate to:'.colorize(:cyan)} http://localhost:8001/api/v1/namespaces/kube-system/services/https:kubernetes-dashboard:/proxy/\")\n else\n puts(\"#{ips.first}: Installing dashboard...skipped\".colorize(:cyan))\n end\n end\n podready!('tiller', ssh:ssh) if all or helm\n podready!('dashboard', ssh:ssh) if all or dashboard\n }\n\n puts(\"Cluster creation took: #{Time.now - elapse} sec\".colorize(:light_yellow))\n\n # Configure local kubectl\n kube_conf_dir = File.expand_path(\"~/.kube\")\n FileUtils.mkdir_p(kube_conf_dir) if Dir.exists?(kube_conf_dir)\n kube_conf = File.join(kube_conf_dir, \"config.kubinator\")\n FileUtils.rm_rf(kube_conf)\n Net::SCP.download!(ips.first, @user, '.kube/config', kube_conf, ssh:{verify_host_key: :never, password: @pass})\n Sys.exec(\"ln -sf ~/.kube/config.kubinator ~/.kube/config\")\n puts(\"#{'-' * 80}\".colorize(:cyan))\n Sys.exec(\"kubectl get po --all-namespaces -o wide\")\n end",
"def install\n begin\n nagios = `service nagios status 2>&1` != \"nagios: unrecognized service\\n\"\n puts \"Nagios service already installed, moving to add Nagios hosts only\" if nagios\n if @addonly || nagios\n\tnserver = ServerNagios.new(@ip,@hostnames, @mask)\n\tnserver.addNagiosHosts\n else\n\tnserver = ServerNagios.new(@ip, @hostnames, @mask)\n\tnserver.installNagios\n\tnserver.addNagiosHosts\n end\n \n sip = `ifconfig $1 | grep \"inet addr\" | awk -F: '{print $2}' | awk '{print $1}' | grep -v '127.0.0.1'`.chop\n if !File.open('/etc/mail/sendmail.cf').read().index('cit470.nku.edu')\n smserver = ServerSendmail.new(sip, @ip, @hostnames, @mask)\n smserver.installSendmail\n else\n smserver = ServerSendmail.new(sip, @ip, @hostnames, @mask)\n smserver.updateHosts\n\tsmserver.updateAccessdb\n end\n if !File.exists?('/etc/monitrc')\n monitserver = ServerMonit.new\n monitserver.installMonit\n end\n\n rescue Exception => msg\n puts msg\n STDOUT.reopen(ORIG_STD_OUT)\n STDERR.reopen(ORIG_STD_ERR)\n puts \"\\e[31mSomething went wrong please check the logs.\\e[0m\"\n end\n syslog = ServerSyslog.new\n syslog.configSyslog\n logwatch = InstallLogwatchServer.new\n logwatch.install\n end",
"def auto_discover_nodes!\n @servers = execute(:all_nodes)\n end",
"def prereqs\n response = getRequest(\"/hosts/#{new_resource.host}\")\n haveHost = response.code.to_i.between?(200,299)\n unless haveHost\n Chef::Log::info \"Can't execute on this resource until host #{new_resource.host} is available\"\n return false\n end\n\n haveService = getRequest(\"/clusters/#{new_resource.cluster}/services/#{new_resource.service}\").code.to_i.between?(200,299)\n unless haveService\n Chef::Log::info \"Can't execute on this resource until service #{new_resource.service} is available\"\n return false\n end \n \n return true\nend",
"def agent_exist?(agent, index, host, user, password, port)\n # Set commands per agent type\n case agent\n when 'flush'\n instance_type = 'publish'\n ip_regex = /Replication test to http:\\/\\/([a-zA-Z0-9\\.\\-]+)\\/dispatcher\\/invalidate.cache/\n when :publish\n instance_type = 'author'\n ip_regex = /Replication test to http:\\/\\/([a-zA-Z0-9\\.\\-]+):4503\\/bin\\/receive\\?sling:authRequestLogin=1/\n end\n # Compose command\n # TODO: rewrite using command_finder\n command = \"curl -u #{user}:#{password} -X GET http://localhost:#{port}/etc/replication/agents.#{instance_type}/#{agent.to_s}#{index}.test.html\"\n Chef::Log.warn \"Running command '#{command}'\"\n # Run command\n runner = Mixlib::ShellOut.new(command)\n runner.run_command\n\n # If no errors and stdout recieved\n if runner.error? || runner.stdout.empty? || runner.stdout.nil?\n Chef::Log.error(\" Command '#{command}'; runner.error?: '#{runner.error?}'; runner.stdout: '#{runner.stdout}'\")\n false\n else\n # Extract ip check agent status from stdout\n ip_match = runner.stdout.match(ip_regex)\n ip = ip_match ? ip_match[1] : nil\n # status = runner.stdout[/Replication test <strong>succeeded<\\/strong>/]\n\n Chef::Log.warn \"Agent detected ip: '#{ip}'\"\n # If status success and ip detected\n compare_ips(ip, host[:ipaddress]) if ip\n end\nend",
"def create_mysqld_fact_mysqldhelp(factname, varname)\n Facter.add(factname) do\n confine :kernel => :linux\n setcode do\n if @the_config_settings == nil\n @the_config_settings = %x{/usr/sbin/mysqld --help --verbose --pid-file=/tmp/facter-mysqld-dummy.pid --log-bin=/dev/null 2>/dev/null}\n end\n re = Regexp.new(\"^#{varname}\\\\s+([^ ]+)$\")\n if @the_config_settings.match re\n value = $1\n value = :undef if $1 == 'undefined'\n value = true if $1 == 'TRUE'\n value = false if $1 == 'FALSE'\n value = :undef if $1 == '(No default value)'\n value\n else\n nil\n end\n end\n end\nend",
"def slaveof(host, port); end",
"def net_services\n svc = []\n# svc = cluster_configurations.map{ |cc| cc.net_service(self.node_type.node_type) }\n clusters.each do |cc| \n cc.services.each {|s|\n svc << [s.ha_ip_address , s.ha_port ,\n s.ha_proto, s.localport,\n \"#{net_type}#{cc.vlan}\" # local interface\n ]\n }\n svc << [nil, nil,'icmp', nil, \n \"#{net_type}#{cc.vlan}\" # local interface\n ]\n end\n #puts \"DEBUG:#{hostname}: #{svc.inspect}\" if is_load_balancer? \n if is_server? then \n svc2 = []\n svc.each { |s| \n svc2 << [\"\",\"\",s[2],s[3], mangle(s[4])]\n svc2 << [\"\",\"\",s[2],s[3], s[4]]\n }\n #puts \"DEBUG:#{hostname}: #{svc2.inspect}\" if is_load_balancer? \n svc.concat(svc2)\n end\n # will be wrong for virutal with SANs\n san = san_nics.map { |nic| [nil, nil, 'tcp', 22, nic.port_name] }\n svc.concat(san)\n if node_type.is_loadbalancer?\n ha_svc = ClusterConfiguration.find_all_ha_net_services\n svc.concat(ha_svc)\n # For Testing only - Delete after Feb 28, 2009 or come up with\n # something better\n test_vlans = Cluster.find(:all, :conditions => [\"vlan <= 102 and vlan > 8\"]).map{|c| c.vlan }\n testing_svc = test_vlans.map{|vlan|\n [nil,nil,'tcp',22, \"vlan#{vlan}\"]\n }.uniq\n svc.concat(testing_svc)\n testing_svc = test_vlans.map{|vlan|\n [nil,nil,'icmp',nil, \"vlan#{vlan}\"]\n }.uniq\n svc.concat(testing_svc)\n end\n # Icmp for application vlans\n if node_type.is_virtual?\n icmp = nics.map { |nic| \n [nil,nil,'icmp',nil, nic.port_name] if nic.port_name =~ /eth\\d+/ \n }.compact\n svc.concat(icmp)\n nginx = nics.map { |nic| \n [nil,nil,'tcp', 80, nic.port_name] if nic.lan? and nic.port_name =~ /eth\\d+/ \n }.compact\n svc.concat(nginx)\n end\n if hostname == 'uk01' then\n svc << [nil,nil,'tcp',11301,'eth4000']\n end\n rules = svc.map{|a| a.join(':') }\n if mgmt_ip_address then\n rules.concat( mgmt_ip_address.network.net_service(net_type) )\n end\n rules.map{|a| %Q(\\t\"#{a}\") }.sort.uniq.join(\"\\n\")\n end",
"def getMysqlServer()\n if @@serverList.nil?\n output = RunCommandOnMailbox.new('zmlocalconfig mysql_bind_address').run[1]\n @@serverList = output.to_s.split('=').last.strip\n end\n \n @@serverList\n end",
"def ensure_running\n agent_status = `service logicmonitor-agent status`\n if agent_status.include?(\"not running\")\n puts \"LogicMonitor collector isn't running\"\n puts `service logicmonitor-agent start`\n else\n puts \"LogicMonitor collector is running\"\n end\n\n watchdog_status = `service logicmonitor-watchdog status`\n if watchdog_status.include?(\"not running\")\n puts \"LogicMonitor watchdog isn't running\"\n puts `service logicmonitor-watchdog start`\n end\nend",
"def set_mysql_service(database = nil, username = nil, password = nil)\n @database = database\n @user_name = username\n @password = password\n @service = Service::MYSQL\n end",
"def chef_clients_running?(host_or_ip)\n ssh_cmd = ssh_cmd_base(host_or_ip)\n ssh_cmd << \"'if test -f /var/chef/cache/chef-client-running.pid; then flock -n /var/chef/cache/chef-client-running.pid true; fi'\"\n ssh_cmd = ssh_cmd.map(&:chomp).join(\" \")\n res = `#{ssh_cmd}`\n case $?.exitstatus\n when 0\n return false\n else\n return true\n end\n end",
"def install(log_location)\r\n log_location = log_location || bootstrap_directory # example default logs go to C:\\chef\\\r\n exit_code = 0\r\n message = \"success\"\r\n error_message = \"Error installing chef-client service\"\r\n begin\r\n if windows?\r\n puts \"#{Time.now} Getting chef-client service status\"\r\n status = shell_out(\"sc.exe query chef-client\")\r\n if status.exitstatus == 1060 && status.stdout.include?(\"The specified service does not exist as an installed service.\")\r\n puts \"#{Time.now} Installing chef-client service...\"\r\n params = \" -a install -c #{bootstrap_directory}\\\\client.rb -L #{log_location}\\\\chef-client.log \"\r\n result = shell_out(\"chef-service-manager #{params}\")\r\n result.error!\r\n puts \"#{Time.now} Installed chef-client service.\"\r\n else\r\n status.error!\r\n puts \"#{Time.now} chef-client service is already installed.\"\r\n end\r\n end\r\n # Unix - only start chef-client in daemonize mode using self.enable\r\n rescue Mixlib::ShellOut::ShellCommandFailed => e\r\n Chef::Log.error \"#{error_message} (#{e})\"\r\n message = \"#{error_message} - #{e} - Check log file for details\"\r\n exit_code = 1\r\n rescue => e\r\n Chef::Log.error \"#{error_message} (#{e})\"\r\n message = \"#{error_message}- #{e} - Check log file for details\"\r\n exit_code = 1\r\n end\r\n [exit_code, message]\r\n end",
"def setup_helper\n\n # Define ZOO_LOG_DIR\n node.default['apache_zookeeper'][\"env_vars\"][\"ZOO_LOG_DIR\"] = node['apache_zookeeper']['log_dir']\n\n # Make sure server ids are set or set them\n if !node['apache_zookeeper'][\"zoo.cfg\"].select{ |key, value| key.to_s.match(/\\Aserver.\\d+\\z/)}.empty?\n log \"Using given zoo.cfg config for server ids\"\n\n node['apache_zookeeper'][\"zoo.cfg\"].select{ |key, value| key.to_s.match(/\\Aserver.\\d+\\z/)}.each do |key, value|\n if does_server_match_node? value\n @zookeeper_myid = key[\"server.\".size, key.size]\n break\n end\n end\n\n raise \"Unable to find server [#{node[\"fqdn\"]} in zoo.cfg attributes #{node['apache_zookeeper'][\"zoo.cfg\"].select{ |key, value| key.to_s.match(/\\Aserver.\\d+\\z/)}}\" if @zookeeper_myid.nil?\n\n elsif node['apache_zookeeper'][\"servers\"].empty?\n log \"Configuring standalone zookeeper cluster\"\n else\n log \"Configuring mult-server zookeeper cluster\"\n\n id = 1\n node['apache_zookeeper'][\"servers\"].each do |server|\n if server.include? \":\"\n # If they include port information in their list of servers just use the raw value\n node.default['apache_zookeeper'][\"zoo.cfg\"][\"server.#{id}\"] = server\n else\n node.default['apache_zookeeper'][\"zoo.cfg\"][\"server.#{id}\"] = \"#{server}:#{node['apache_zookeeper'][\"follower_port\"]}:#{node['apache_zookeeper'][\"election_port\"]}\"\n end\n\n if does_server_match_node? server\n @zookeeper_myid = id.to_s\n end\n\n id = id + 1\n end\n\n raise \"Unable to find server [#{node[\"fqdn\"]} in servers attribute #{node['apache_zookeeper'][\"servers\"]}\" if @zookeeper_myid.nil?\n end\n\n end",
"def is_cassandra_node settings\n has_role settings, \"cassandra_node\"\n security_group 'cassandra_node' do\n authorize :group_name => 'cassandra_node'\n authorize :network => '70.91.172.41/29', :from_port => \"9160\", :to_port => \"9160\"\n authorize :network => '72.32.68.18/32', :from_port => \"9160\", :to_port => \"9160\"\n authorize :network => '72.32.70.9/32', :from_port => \"9160\", :to_port => \"9160\"\n end\nend",
"def validate!\n super\n if admin_mysql_ifaces\n # Check for .sock or IP:PORT\n unless admin_mysql_ifaces =~ /\\.sock|\\:\\d+/\n raise \"Provide admin_variables['mysql_ifaces'] in a form of \"\\\n \"'127.0.0.1:6032' or '/var/lib/mysql/mysql.sock'\"\n end\n else\n raise \"Provide admin_variables['mysql_ifaces'] attribute\"\n end\n if admin_credentials\n if admin_credentials.split(':').size != 2\n raise \"Provide admin_variables['admin_credentials'] in a \"\\\n \"form of 'admin:admin'\"\n end\n else\n raise \"Provide admin_variables['admin_credentials'] attribute\"\n end\n\n output = Mixlib::ShellOut.new('which mysql').run_command\n unless output.status.success?\n raise 'Install MySQL client not found for loading '\\\n 'config to RUNTIME'\n end\n end",
"def configureStartup\n `chkconfig --add nagios`\n `chkconfig --level 35 nagios on`\n `chkconfig --add httpd`\n `chkconfig --level 35 httpd on`\n `iptables -I INPUT 1 -s #{@ips[0]}/#{@mask} -p tcp -m tcp --dport 80 -j ACCEPT`\n `iptables -I INPUT 1 -s #{@ips[0]}/#{@mask} -p udp -m udp --dport 80 -j ACCEPT`\n `service iptables save`\n `service iptables restart`\n end",
"def healthy_cluster_config\n {\n 'http://127.0.0.1:4001' => 'http://127.0.0.1:4001',\n 'http://127.0.0.1:4002' => 'http://127.0.0.1:4001',\n 'http://127.0.0.1:4003' => 'http://127.0.0.1:4001'\n }\n end",
"def is_running?\n omnibus_helper = OmnibusHelper.new(node)\n omnibus_helper.service_up?(service_name) || (delegated? && omnibus_helper.service_up?(delegate_service_name) && is_ready?)\n end",
"def ensure_prerequisites\n return false unless command_found('netsh')\n return false unless command_found('net')\n return false unless command_found('reg')\n\n unless wired_autoconfig_service_running?\n info('starting \\'Wired AutoConfig\\' service')\n if admin_mode?\n `net start dot3svc`\n else\n require 'win32ole'\n shell = WIN32OLE.new('Shell.Application')\n shell.ShellExecute('net', 'start dot3svc', nil, 'runas', 1)\n end\n service_has_started = Landrush::Util::Retry.retry(tries: 5, sleep: 1) do\n wired_autoconfig_service_running?\n end\n unless service_has_started\n info('Unable to start \\'Wired AutoConfig\\' service. Unable to configure DNS on host. Try manual configuration.')\n return false\n end\n info('\\'Wired AutoConfig\\' service has started.')\n end\n true\n end",
"def start_sshd_service\n # FIXME: We should probably check exit status rather than AIX-specific error codes.\n output=ssh_command(\"#{config[:sudo]} #{config[:clogin]} #{config[:wpar_name]} #{config[:startsrc]} -s sshd\", :stderr)\n if output.include?('0513-059') # 0513-059 The sshd Subsystem has been started. Subsystem PID is 2688212.\n return true\n end\n false\n end",
"def single_mongos?\n ClusterConfig.instance.single_server? && ClusterConfig.instance.mongos?\nend",
"def single_mongos?\n ClusterConfig.instance.single_server? && ClusterConfig.instance.mongos?\nend",
"def systemd?\n false\n end",
"def on_localhost?; true end",
"def check_chef(hostname)\n knife = Chef::Knife.new\n knife.config[:config_file] = File.join(ENV['HOME'], '.chef', 'knife.rb')\n knife.configure_chef\n search_query = Chef::Search::Query.new\n result = search_query.search(:node, \"name:#{hostname}\")\n \n if result.last > 0\n puts msg = \"Chef already has node #{hostname} registered. Skipping\"\n @logger.warn(msg)\n return false\n end\n return true\nend",
"def debian_enabled?\n system(\"/usr/sbin/invoke-rc.d\", \"--quiet\", \"--query\", @resource[:name], \"start\")\n if [104, 106].include?($CHILD_STATUS.exitstatus)\n return :true\n elsif [101, 105].include?($CHILD_STATUS.exitstatus)\n # 101 is action not allowed, which means we have to do the check manually.\n # 105 is unknown, which generally means the initscript does not support query\n # The debian policy states that the initscript should support methods of query\n # For those that do not, perform the checks manually\n # http://www.debian.org/doc/debian-policy/ch-opersys.html\n if get_start_link_count >= 4\n return :true\n else\n return :false\n end\n else\n return :false\n end\n end",
"def test_has_services\n hostname = `hostname`.chomp\n assert_equal(true, cmk.has_services(hostname))\n end",
"def jbossas?\n @cli_executor.jbossas?\n end",
"def create_sshd_service\n # FIXME: We should probably check exit status rather than AIX-specific error codes.\n output=ssh_command(\"#{config[:sudo]} #{config[:clogin]} #{config[:wpar_name]} #{config[:mkssys]} -s sshd -p /usr/sbin/sshd -a '-D' -u 0 -S -n 15 -f 9 -R -G local\", :stderr)\n if output.include?('0513-071') # 0513-071 The sshd Subsystem has been added.\n return true\n end\n false\n end",
"def batchLayerStart(cluster)\n node_managers, node_workers, nn1, nn2, rm = getClusterHosts cluster\n\n # 1. Start Zookeeper Esemble\n puts \"starting up Zookeeper Esemble....\"\n node_managers.each do |h|\n mcServiceAction h, 'zookeeper-server', 'start'\n end\n\n # 2. Stop QJM\n puts \"starting up QJM ....\"\n node_managers.each do |h|\n mcServiceAction h, 'hadoop-hdfs-journalnode', 'start'\n end\n\n # 3. Start namenodes and resourcemanager\n puts \"starting up NameNodes and ResourceManager ....\"\n mcServiceAction nn1, 'hadoop-hdfs-namenode', 'start'\n mcServiceAction nn2, 'hadoop-hdfs-namenode', 'start'\n mcServiceAction rm, 'hadoop-yarn-resourcemanager', 'start'\n\n # 4. Start Automatic Failover\n puts \"starting up Zkfc ....\"\n mcServiceAction nn1, 'hadoop-hdfs-zkfc', 'start'\n mcServiceAction nn2, 'hadoop-hdfs-zkfc', 'start'\n\n #\n # 5. History Server.\n #\n puts \"Hisotry server starting up ...\"\n mcServiceAction rm, 'hadoop-mapreduce-historyserver', 'start'\n\n # 6. start the workers.\n puts \"starting up DataNode workers....\"\n node_workers.each do |h|\n mcServiceAction h, 'hadoop-hdfs-datanode', 'start'\n mcServiceAction h, 'hadoop-yarn-nodemanager', 'start'\n end\n end",
"def test_centralized_drb_discovery\n\tDRb.stop_service\n\n\tcentral_tuplespace = TupleSpace.new\n\tDRb.start_service 'druby://localhost:1245', central_tuplespace\n\n\tremote_pid = remote_process do\n\t DRb.stop_service\n\t DRb.start_service\n\t central_tuplespace = DRbObject.new_with_uri('druby://localhost:1245')\n\n\t Distributed.state = ConnectionSpace.new :ring_discovery => false, \n\t\t:discovery_tuplespace => central_tuplespace, :plan => plan\n\tend\n\t@local = ConnectionSpace.new :ring_discovery => false, \n\t :discovery_tuplespace => central_tuplespace, :plan => plan\n Distributed.state = local\n\tassert_has_neighbour { |n| n.name == \"#{Socket.gethostname}-#{remote_pid}\" }\n end",
"def manage_cluster\n @nodes = Node.find(:all)\n end",
"def status\n return true unless managed?\n return false if pid.nil?\n\n begin\n Process.getpgid(pid)\n\n TCPSocket.new('127.0.0.1', port).close\n true\n rescue Errno::ESRCH, Errno::ECONNREFUSED\n false\n end\n end",
"def mysql_lookup_scripts\n scripts = [\n [ 'setup_block_device', 'db_mysql::setup_block_device' ],\n [ 'do_backup', 'db_mysql::do_backup' ],\n [ 'do_restore', 'db_mysql::do_restore' ],\n [ 'do_backup_s3', 'db_mysql::do_backup_s3' ],\n [ 'do_backup_ebs', 'db_mysql::do_backup_ebs' ],\n [ 'do_backup_cloud_files', 'db_mysql::do_backup_cloud_files' ],\n [ 'do_restore_s3', 'db_mysql::do_restore_s3' ],\n [ 'do_restore_ebs', 'db_mysql::do_restore_ebs' ],\n [ 'do_restore_cloud_files', 'db_mysql::do_restore_cloud_files' ],\n [ 'do_restore_cloud_files', 'db_mysql::do_restore_cloud_files' ],\n [ 'do_force_reset', 'db_mysql::do_force_reset' ]\n ]\n raise \"FATAL: Need 1 MySQL servers in the deployment\" unless @servers.size == 1\n \n st = ServerTemplate.find(resource_id(s_one.server_template_href))\n load_script_table(st,scripts)\n end",
"def haveBootstrapped?\n self.class.loadChefLib\n MU.log \"Chef config\", MU::DEBUG, details: ::Chef::Config.inspect\n nodelist = ::Chef::Node.list()\n nodelist.has_key?(@server.mu_name)\n end",
"def cluster_status\n # Default formatting changed to \"table\" in 3.8, need to explicity specify\n # \"erlang\" to parse output properly.\n installed_version = Gem::Version.new(installed_rabbitmq_version)\n version_requiring_formatter = Gem::Version.new('3.8.0')\n cmd = +'rabbitmqctl -q cluster_status'\n cmd << ' --formatter erlang' if installed_version >= version_requiring_formatter\n # execute > rabbitmqctl cluster_status\"\n # This removes an optional \"... Done\" linee that older version used to output\n Chef::Log.debug(\"[rabbitmq_cluster] Executing #{cmd}\")\n cmd = get_shellout(cmd)\n cmd.run_command\n cmd.error!\n result = cmd.stdout.squeeze(' ').gsub(/\\n */, '').gsub('...done.', '')\n Chef::Log.debug(\"[rabbitmq_cluster] #{cmd} : #{result}\")\n result\n end",
"def is_installed?(domain)\n return execute_drush_cmd('sql-query \"SELECT value FROM variable WHERE name=\\'install_task\\'\"', domain).include?('done');\nend",
"def batchLayerBootStrapping(cluster)\n node_managers, node_workers, nn1, nn2, rm = getClusterHosts cluster\n\n puts \"Batch Layer (Hadoop) Bootstrap ...\"\n\n #\n # 1. Zookeeper bootstrap\n #\n puts \"Zookeeper Esemble starting up ...\"\n node_managers.each do |h|\n mcServiceAction h, 'zookeeper-server', 'start'\n end\n\n #\n # 2. Zookeeper znode formating for Automatic Failover.\n #\n # FIXME: Warning FORMAT\n puts \"Zookeeper Znode formating for Automatic Failover ...\"\n cmd = @cmdenv + 'sudo -E -u hdfs hdfs zkfc -formatZK -force'\n dpExecuteAction nn1, cmd\n\n #\n # 3. QJM - Quorum Journal Manager startup.\n #\n puts \"starting QJM ....\"\n node_managers.each do |h|\n mcServiceAction h, 'hadoop-hdfs-journalnode', 'start'\n end\n\n #\n # 4. HDFS format initialization\n #\n # FIXME: Warning FORMAT\n puts \"Formating HDFS ....\"\n cmd = @cmdenv + 'sudo -E -u hdfs hdfs namenode -format -force'\n dpExecuteAction nn1, cmd\n\n # \n # 5. Namenodes startup\n #\n puts \"NameNodes start up ....\"\n mcServiceAction nn1, 'hadoop-hdfs-namenode', 'start'\n # FIXME: Warning FORMAT:\n cmd = @cmdenv + 'sudo -E -u hdfs hdfs namenode -bootstrapStandby'\n dpExecuteAction nn2, cmd\n mcServiceAction nn2, 'hadoop-hdfs-namenode', 'start'\n\n # \n # 6. Check HA\n #\n puts \"HA checking ...\"\n cmd = @cmdenv + 'sudo -E -u hdfs hdfs haadmin -getServiceState nn1'\n dpExecuteAction nn1, cmd\n cmd = @cmdenv + 'sudo -E -u hdfs hdfs haadmin -getServiceState nn2'\n dpExecuteAction nn1, cmd\n\n #\n # 7. Automatic Failover startup\n #\n puts \"Automatic Failover startup\"\n mcServiceAction nn1, 'hadoop-hdfs-zkfc', 'start'\n mcServiceAction nn2, 'hadoop-hdfs-zkfc', 'start'\n\n #\n # 8. Workers node startup \n #\n puts \"starting DataNode workers....\"\n node_workers.each do |h|\n mcServiceAction h, 'hadoop-hdfs-datanode', 'start'\n end\n\n #\n # 9. Minimal HDFS folders layout creation.\n #\n puts \"HDFS folder initialization ...\"\n # tmp folder\n cmd = @cmdenv + 'sudo -E -u hdfs hadoop fs -mkdir /tmp'\n dpExecuteAction nn1, cmd\n cmd = @cmdenv + 'sudo -E -u hdfs hadoop fs -chmod -R 1777 /tmp'\n dpExecuteAction nn1, cmd\n # MapReduce history server: MapReduce V2 History Server runs as user \"mapred:hadoop\"\n cmd = @cmdenv + 'sudo -E -u hdfs hadoop fs -mkdir -p /user/history'\n dpExecuteAction nn1, cmd\n cmd = @cmdenv + 'sudo -E -u hdfs hadoop fs -mkdir /user/history/done'\n dpExecuteAction nn1, cmd\n cmd = @cmdenv + 'sudo -E -u hdfs hadoop fs -mkdir /user/history/done_intermediate'\n dpExecuteAction nn1, cmd\n cmd = @cmdenv + 'sudo -E -u hdfs hadoop fs -chown -R mapred:hadoop /user/history'\n dpExecuteAction nn1, cmd\n cmd = @cmdenv + 'sudo -E -u hdfs hadoop fs -chmod -R 1777 /user/history'\n dpExecuteAction nn1, cmd\n\n #\n # 10. History Server.\n #\n puts \"Hisotry server starting up ...\"\n mcServiceAction rm, 'hadoop-mapreduce-historyserver', 'start'\n cmd = @cmdenv + 'sudo -E -u hdfs hadoop fs -mkdir -p /var/log/hadoop-yarn'\n dpExecuteAction nn1, cmd\n cmd = @cmdenv + 'sudo -E -u hdfs hadoop fs -chown yarn:mapred /var/log/hadoop-yarn'\n dpExecuteAction nn1, cmd\n\n #\n # 11. Example user creation.\n #\n puts \"example user creation\"\n cmd = @cmdenv + 'sudo -E -u hdfs hadoop fs -mkdir -p /user/jroman'\n dpExecuteAction nn1, cmd\n cmd = @cmdenv + 'sudo -E -u hdfs hadoop fs -chown jroman /user/jroman'\n dpExecuteAction nn1, cmd\n\n #\n # 11. YARN system start up\n #\n puts \"YARN Framework starting up\"\n mcServiceAction rm, 'hadoop-yarn-resourcemanager', 'start'\n node_workers.each do |h|\n mcServiceAction h, 'hadoop-yarn-nodemanager', 'start'\n end\n\n end",
"def sys_exec_check(dbc)\n begin\n q = dbc.query(\"SELECT COUNT(*) FROM mysql.func WHERE name='sys_exec';\")\n q.each do |x|\n if x[0].to_i == 0\n return false\n else\n return true\n end\n end\n rescue Mysql::Error => e\n puts \"Problem Checking for SYS_EXEC() function\".light_red + \"!\".white\n puts \"\\t=> \".white + \"#{e}\".light_red\n return false\n end\nend",
"def mysql_stack\n recipe :apache_server\n recipe :passenger_gem, :passenger_configure_gem_path, :passenger_apache_module, :passenger_site\n recipe :mysql_server, :mysql_gem, :mysql_fixup_debian_start\n #recipe :mysql_database, :mysql_user # TODO: parses database.yml\n recipe :rails_rake_environment, :rails_gems, :rails_directories, :rails_bootstrap\n recipe :ntp, :time_zone, :postfix, :cron_packages, :motd, :security_updates\n end",
"def start\n if self.running?\n __log \"[!] Elasticsearch cluster already running\".ansi(:red)\n return false\n end\n\n __remove_cluster_data if @clear_cluster\n\n __log \"Starting \".ansi(:faint) + arguments[:number_of_nodes].to_s.ansi(:bold, :faint) +\n \" Elasticsearch #{arguments[:number_of_nodes] < 2 ? 'node' : 'nodes'}..\".ansi(:faint), :print\n\n pids = []\n\n __log \"\\nUsing Elasticsearch version [#{version}]\" if ENV['DEBUG']\n\n arguments[:number_of_nodes].times do |n|\n n += 1\n\n command = __command(version, arguments, n)\n command += '> /dev/null' unless ENV['DEBUG']\n\n __log command.gsub(/ {1,}/, ' ').ansi(:bold) if ENV['DEBUG']\n\n pid = Process.spawn(command)\n Process.detach pid\n pids << pid\n sleep 1\n end\n\n __check_for_running_processes(pids)\n wait_for_green\n __log __cluster_info\n\n return true\n end",
"def srv_running\n return unless RUBY_PLATFORM =~ /linux/\n cmdobj = Mixlib::ShellOut.new(\"ps -ef | grep #{@new_resource.name} | grep java\")\n cmdobj.run_command.stdout.split(\"\\n\").reject { |e| e.include? \"sh -c\" }.size >= 1 # true or false\nend",
"def remote_exists?\n system \"which cmus-remote &> /dev/null\"\nend",
"def up\n uri = URI(\"http://#{@host}:#{@port_s}/_cluster/health\")\n req = Net::HTTP::Get.new(uri)\n\n begin\n result = JSON.parse run(uri, req)\n result[\"status\"] == \"yellow\" or\n result[\"status\"] == \"green\"\n rescue\n false\n end\n end",
"def secondary_status\n session.cluster.with_secondary do |secondary|\n secondary.command(:admin, replSetGetStatus: 1)\n end\n rescue => e\n raise ConnectionFailed, e\n end",
"def start\n extract\n if managed?\n exec('start', p: port)\n\n # Wait for solr to start\n unless status\n sleep 1\n end\n end\n end",
"def status\n return true unless managed?\n\n out = exec('status', output: true).read\n out =~ /running on port #{port}/\n end",
"def get_mysql_hostname \n @mysql_hostname = @sequel[\"SELECT @@hostname;\"].first[:@@hostname]\n end",
"def get_mysql_hostname \n @mysql_hostname = @sequel[\"SELECT @@hostname;\"].first[:@@hostname]\n end",
"def eaddrinuse?() EADDRINUSE == @error_code; end",
"def register(start_command, home = self.install_folder)\n dependency = 0\n dependency = 1 if self.dependable\n username = 'EdenManager'\n unless options.nil?\n unless options['username'].nil?\n username = options['username']\n end\n end\n $db.services.insert(:service_name => self.name, :service_type => self.type, :username => username, :folder_name => home, :status => 'Installing', :start_command => start_command, :pid_file => self.pid_file, :running => 0, :dependency => dependency, :version => self.version)\n end",
"def create_mysqld_fact_augeas(factname, varname, default, section='mysqld')\n Facter.add(factname) do\n confine :kernel => :linux\n setcode do\n value = nil\n ## The config file.\n cfg = Facter.value(:mysqld_configfile)\n # Is there a config file?\n if cfg\n begin\n require 'augeas'\n # We do not preload all the lenses. This is too slow and\n # we will be only using one anyhow.\n aug = Augeas::open('/', '/usr/share/augeas/lenses', Augeas::NO_MODL_AUTOLOAD)\n # Use the mysql lens and include the config file.\n aug.transform(:lens => 'Mysql.lns', :incl => cfg)\n # Load the file\n aug.load()\n # Get the variable we are after\n Facter.debug(\"xpath: /files/#{cfg}/*[ . = '#{section}']/#{varname}\")\n value = aug.get(\"/files/#{cfg}/*[ . = '#{section}']/#{varname}\")\n # Close augeas down.\n aug.close()\n ## If the var is not found, use the default.\n if value == nil\n value = default\n end\n rescue Exception\n Facter.debug(\"ruby-augeas is required (and is not installed) for fact #{factname}\")\n end\n end\n value\n end\n end\nend",
"def update_ip_on_mgmt_cluster\n if mgmt_ip_address_changed?\n mgmt_cluster = Cluster.find_mgmt_cluster_by_location(datacenter.name)\n return true if mgmt_cluster.blank?\n cluster_node = cluster_nodes.detect{|cn| cn.cluster == mgmt_cluster}\n return true if cluster_node.blank?\n cluster_node.change_ip(mgmt_ip_address)\n end\n return true\n end",
"def start\n puts \"Starting clusters...\"\n for app in @apps\n if @env == :deployment\n #need to check if application has a pid file so we don't start\n pid_file = \"#{APP_PATH}/log/doozer.#{app[:port]}.pid\"\n raise \"pid file already exists for #{pid_file}\" if File.exist?(pid_file)\n cmd = \"rackup #{@config} -p #{app[:port]} -E #{@env.to_s} -s #{@server} -o #{app[:ip]} #{@daemonize} -P #{pid_file}\" \n puts \"=> #{cmd}\"\n system(cmd)\n else\n cmd = \"rackup #{@config} -p #{app[:port]} -E #{@env.to_s} -s #{@server} -o #{app[:ip]}\" \n puts \"=> #{cmd}\"\n system(cmd)\n break\n end\n end\n puts \"Did they start?\"\n system(\"ps -aux | grep rackup\")\nend",
"def after_probe_master\n unless @running\n my_pool, my_role = Jetpants.topology.class.tracker.determine_pool_and_role(@ip, @port)\n @master = (my_role == 'MASTER' ? false : my_pool.master)\n end\n end",
"def check_docker_vm_exists(options)\n exists = false\n message = \"Information:\\tChecking docker instances for #{options['name']}\"\n command = \"docker-machine ls\"\n output = execute_command(options,message,command)\n output = output.split(/\\n/)\n output.each do |line|\n line = line.chomp\n items = line.split(/\\s+/)\n host = items[0]\n if host.match(/^#{options['name']}$/)\n exists = true\n return exists\n end\n end\n return exists\nend",
"def nodes_live?(host, port, ip_list, timeout_sec)\n params = {\n :action => \"CLUSTERSTATUS\"\n }\n sleep_time_sec = 10\n attempts = timeout_sec/sleep_time_sec\n all_nodes_live = false\n while attempts >= 0 do\n begin\n live_nodes = []\n Chef::Log.info(\"Getting live nodes. Remaining attempts : #{attempts}\")\n attempts = attempts - 1\n cluster_status_resp = solr_collection_api(host, port, params)\n cluster_live_nodes = cluster_status_resp[\"cluster\"][\"live_nodes\"]\n cluster_live_nodes.each do |live_node|\n ipaddress = live_node.split(\":\")[0]\n live_nodes.push ipaddress\n end\n Chef::Log.info(\"live_nodes = #{live_nodes}\")\n result = (ip_list-live_nodes)\n if result.empty?\n all_nodes_live = true\n break\n else\n Chef::Log.info(\"Nodes not live : #{result}\")\n end\n rescue => e\n Chef::Log.info(\"Error while getting live nodes : #{e.message}\")\n Chef::Log.info(\"Retry getting live nodes after #{sleep_time_sec} seconds\")\n sleep sleep_time_sec\n end\n end\n return all_nodes_live\n end",
"def mysql_version_check(target=\"5.0.67\") # Oldest the library claims.\n\t\tbegin\n\t\t\ts = connect(false)\n\t\t\tdata = s.get\n\t\t\tdisconnect(s)\n\t\trescue ::Rex::ConnectionError, ::EOFError\n\t\t\treturn false\n\t\trescue ::Exception => e\n\t\t\tvprint_error(\"#{rhost}:#{rport} error checking version #{e.class} #{e}\")\n\t\t\treturn false\n\t\tend\n\t\toffset = 0\n\t\tl0, l1, l2 = data[offset, 3].unpack('CCC')\n\t\tlength = l0 | (l1 << 8) | (l2 << 16)\n\t\t# Read a bad amount of data\n\t\treturn if length != (data.length - 4)\n\t\toffset += 4\n\t\tproto = data[offset, 1].unpack('C')[0]\n\t\t# Error condition\n\t\treturn if proto == 255\n\t\toffset += 1\n\t\tversion = data[offset..-1].unpack('Z*')[0]\n\t\treport_service(:host => rhost, :port => rport, :name => \"mysql\", :info => version)\n\t\tshort_version = version.split('-')[0]\n\t\tvprint_status \"#{rhost}:#{rport} - Found remote MySQL version #{short_version}\"\n\t\tint_version(short_version) >= int_version(target)\n\tend",
"def measure_cluster_status cluster_name, private_ip\n begin\n connection = Net::HTTP.new(private_ip, 8080) # FIXME port\n request = Net::HTTP::Get.new('/status/cluster', 'Accept' => 'text/xml')\n response = connection.request(request)\n return false unless response.code.to_i == 200\n \n data = Crack::XML.parse(response.body)\n cluster_status = data['ClusterStatus']\n dead_nodes = cluster_status['DeadNodes'] ? cluster_status['DeadNodes']['Node'] : []\n live_nodes = cluster_status['LiveNodes']['Node']\n rescue NoMethodError, SocketError, REXML::ParseException, Errno::ECONNREFUSED => e\n # puts \"#{e.class} -- #{e.message}\"\n # puts e.backtrace\n return false\n end\n\n write({\n :hostname => \"#{cluster_name}-hbase\",\n :hostgroup => self.class::CLUSTER_HOSTGROUPS,\n :application => self.class::CLUSTER_APPLICATIONS,\n :templates => self.class::CLUSTER_TEMPLATES\n }) do |d|\n d << ['requests', cluster_status['requests']]\n d << ['regions', cluster_status['regions']]\n d << ['load', cluster_status['averageLoad']]\n d << ['nodes.dead', dead_nodes.size]\n d << ['nodes.alive', live_nodes.size]\n end\n measure_cluster_tables(cluster_name, data)\n measure_cluster_nodes(cluster_name, live_nodes)\n true\n end",
"def check_xinetd_service(service)\n ret = false\n srv = Facter::Core::Execution.exec(\"chkconfig --list 2>/dev/null | grep #{service}\")\n if srv.empty?\n ret = false\n else\n srvs = srv.split(\"\\n\")\n srvs.each do |line|\n data = line.split(%r{:})\n if data[1].casecmp('off') != 0\n ret = true\n end\n end\n end\n\n ret\nend",
"def start_peers\n\t\tDRb.stop_service\n\t\tremote_process do\n\t\t DRb.start_service DISCOVERY_SERVER, Rinda::TupleSpace.new\n\t\tend\n\n\t\tif engine.running?\n\t\t begin\n\t\t\tengine.quit\n\t\t\tengine.join\n\t\t rescue ControlQuitError\n\t\t end\n\t\tend\n\n\t\tremote_process do\n\t\t central_tuplespace = DRbObject.new_with_uri(DISCOVERY_SERVER)\n\n\t\t cs = ConnectionSpace.new :ring_discovery => false, \n\t\t\t:discovery_tuplespace => central_tuplespace, :name => \"remote\",\n :plan => plan\n\n getter = Class.new do\n attr_accessor :cs\n def get; DRbObject.new(cs) end\n end.new\n getter.cs = cs\n\n Distributed.state = cs\n\n DRb.start_service REMOTE_SERVER, getter\n\n\t\t cs.extend RemotePeerSupport\n\t\t cs.testcase = self\n\n\t\t def cs.start_control_thread\n\t\t\tengine.run\n\t\t end\n\n\t\t yield(cs) if block_given?\n\t\tend\n\n\t\tDRb.start_service LOCAL_SERVER\n\t\t@central_tuplespace = DRbObject.new_with_uri(DISCOVERY_SERVER)\n\t\t@remote = DRbObject.new_with_uri(REMOTE_SERVER).get\n\t\t@local = ConnectionSpace.new :ring_discovery => false, \n\t\t :discovery_tuplespace => central_tuplespace, :name => 'local', \n\t\t :plan => plan\n Distributed.state = local\n\n remote.start_control_thread\n engine.run\n\t end",
"def checkSolrNodeStatus(solrPortNo)\n activeReplicas = 0\n recoveringReplicas = 0\n downReplicas = 0\n\n if(checkSolrProcessIsRunning(solrPortNo))\n coreListUrl = \"/solr/admin/cores?action=STATUS&wt=json\"\n\n coreApiResponse = solr_rest_api_get_auth(\"127.0.0.1\", solrPortNo, coreListUrl)\n\n if(coreApiResponse.code == '200')\n if !coreApiResponse.body.empty?\n coreApiJsonResponse = JSON.parse(coreApiResponse.body)\n coreNames = coreApiJsonResponse[\"status\"].keys\n failedCores = coreApiJsonResponse[\"initFailures\"].keys\n activeReplicas, recoveringReplicas, downReplicas, failedReplicas = computeReplicaStats(solrPortNo, coreNames, failedCores)\n end\n else\n raise \"Node is in down state.\"\n end\n else\n raise \"Node is in down state.\"\n end\n return activeReplicas, recoveringReplicas, downReplicas, failedReplicas\nend",
"def replica_set?; true; end",
"def check\n refresh\n primary_status = self.primary_status\n secondary_status = self.secondary_status\n mark_message \"Connected to #{session.cluster.nodes.count} nodes in mongodb replica set '#{primary_status['set']}'\"\n rescue ConnectionFailed => e\n mark_failure\n mark_message \"Error: '#{e}'\"\n end",
"def check_for_localhome(user,system_user)\n host = 'ovid02.u.washington.edu'\n Net::SSH.start(host,system_user, {auth_methods: %w( publickey )}) do |ssh|\n output = ssh.exec!(\"cpw -poh #{user}\")\n if output =~ /Unknown/\n return \"No MySQL Localhome Set for #{user}\".red\n else\n return \"Localhome for #{user}: #{output}\"\n end\n end\n end",
"def setup?\n Crocoduck::Store.server_cluster && \n Crocoduck::Store.server_db && \n Crocoduck::Store.server_collection\n end",
"def cluster_status\n report_metric 'Cluster Status/Partitioned', 'nodes', rmq_manager.nodes.count { |n| Array(n['partitions']).any? }\n report_metric 'Cluster Status/Stopped', 'nodes', rmq_manager.nodes.count { |n| !n['running'] }\n end",
"def configure_database\n\tbegin\n\t @client = Mysql2::Client.new(:host => \"localhost\", :username => \"root\", :password => \"qburst\", :database => \"ruby\")\n\trescue Exception=>e\n\t puts e.message\n\tend\n end",
"def run_host(ip)\n begin\n\n epm = dcerpc_endpoint_list()\n if(not epm)\n print_status(\"Could not contact the endpoint mapper on #{ip}\")\n return\n end\n\n eports = {}\n\n epm.each do |ep|\n next if !(ep[:port] and ep[:prot] and ep[:prot] == \"tcp\")\n eports[ep[:port]] ||= {}\n eports[ep[:port]][ep[:uuid]+'_'+ep[:vers]] = true\n end\n\n eports.each_pair do |eport, servs|\n\n rport = eport\n print_status(\"Looking for services on #{ip}:#{rport}...\")\n\n ids = dcerpc_mgmt_inq_if_ids(rport)\n next if not ids\n\n ids.each do |id|\n if (not servs.has_key?(id[0]+'_'+id[1]))\n print_status(\"\\tHIDDEN: UUID #{id[0]} v#{id[1]}\")\n\n conn = nil\n bind = nil\n call = nil\n data = nil\n error = nil\n begin\n connect(true, { 'RPORT' => eport })\n conn = true\n\n handle = dcerpc_handle(id[0], id[1], 'ncacn_ip_tcp', [eport])\n dcerpc_bind(handle)\n bind = true\n\n res = dcerpc.call(0, NDR.long(0) * 128)\n call = true\n\n if (dcerpc.last_response != nil and dcerpc.last_response.stub_data != nil)\n data = dcerpc.last_response.stub_data\n end\n\n rescue ::Interrupt\n raise $!\n rescue ::Exception => e\n error = e.to_s\n end\n\n if (error and error =~ /DCERPC FAULT/ and error !~ /nca_s_fault_access_denied/)\n call = true\n end\n\n status = \"\\t\\t\"\n status << \"CONN \" if conn\n status << \"BIND \" if bind\n status << \"CALL \" if call\n status << \"DATA=#{data.unpack(\"H*\")[0]} \" if data\n status << \"ERROR=#{error} \" if error\n\n print_status(status)\n print_status(\"\")\n\n ## Add Report\n report_note(\n :host => ip,\n :proto => 'tcp',\n :port => datastore['RPORT'],\n :type => \"DCERPC HIDDEN: UUID #{id[0]} v#{id[1]}\",\n :data => status\n )\n\n end\n end\n end\n\n rescue ::Interrupt\n raise $!\n rescue ::Exception => e\n print_status(\"Error: #{e}\")\n end\n end",
"def has_cluster?( name )\n \n return ::Module::Cluster.instance_controller( self ).has_cluster?( name )\n \n end",
"def status\n return true unless config.managed?\n return false if pid.nil?\n\n begin\n Process.getpgid(pid)\n rescue Errno::ESRCH\n return false\n end\n\n begin\n TCPSocket.new(host, port).close\n\n Net::HTTP.start(host, port) do |http|\n http.request(Net::HTTP::Get.new('/'))\n end\n\n true\n rescue Errno::ECONNREFUSED, Errno::EINVAL\n false\n end\n end",
"def process_status(mongrel_config = \"/data/honk/shared/config/mongrel_cluster.yml\")\n mongrel_ports = MongrelPortManager.new.mongrel_ports(mongrel_config)\n return [] if mongrel_ports.empty? || mongrel_ports.nil?\n response_summary = Hash.new\n mongrel_ports.each do |port|\n response = self.http_response(\"http://localhost:#{port}/\")\n response_summary[port] = self.valid_http_response?(response)\n end\n response_summary\n end",
"def cassandra_running(seconds=120)\n begin\n Timeout::timeout(seconds) do\n running = false\n while !running do\n cmd = \"service cassandra status 2>&1\"\n Chef::Log.info(cmd)\n result = `#{cmd}`\n if $? == 0\n running = true\n break\n end\n sleep 5\n end\n return running\n end\n rescue Timeout::Error \n return false\n end\n end",
"def start_api_services()\n # ejabberd uses uaserver for authentication\n # so start it after we find out the uaserver's ip\n threads = []\n if my_node.is_login?\n threads << Thread.new {\n start_ejabberd()\n }\n end\n\n @done_initializing = true\n\n # start zookeeper\n threads << Thread.new {\n if my_node.is_zookeeper?\n configure_zookeeper(@nodes, @my_index)\n start_zookeeper\n end\n\n ZKInterface.init(my_node, @nodes)\n }\n\n if my_node.is_memcache?\n threads << Thread.new {\n start_memcache()\n }\n end\n\n if my_node.is_db_master?\n threads << Thread.new {\n start_db_master()\n # create initial tables\n if my_node.is_db_master?\n prime_database\n end\n\n # Always colocate the Datastore Server and UserAppServer (soap_server).\n if has_soap_server?(my_node)\n @state = \"Starting up SOAP Server and Datastore Server\"\n start_datastore_server()\n start_soap_server()\n HelperFunctions.sleep_until_port_is_open(HelperFunctions.local_ip, UserAppClient::SERVER_PORT)\n end\n\n # If we're starting AppScale with data from a previous deployment, we\n # may have to clear out all the registered app instances from the\n # UserAppServer (since nobody is currently hosting any apps).\n if not @creds['clear_datastore']\n erase_app_instance_info\n end\n }\n end\n\n if my_node.is_db_slave?\n threads << Thread.new {\n start_db_slave()\n\n # Currently we always run the Datastore Server and SOAP\n # server on the same nodes.\n if has_soap_server?(my_node)\n @state = \"Starting up SOAP Server and Datastore Server\"\n start_datastore_server()\n start_soap_server()\n HelperFunctions.sleep_until_port_is_open(HelperFunctions.local_ip,\n UserAppClient::SERVER_PORT)\n end\n }\n end\n\n # All nodes have application managers\n threads << Thread.new {\n start_app_manager_server()\n }\n\n if my_node.is_appengine?\n threads << Thread.new {\n start_blobstore_server()\n }\n end\n\n if my_node.is_taskqueue_master?\n threads << Thread.new {\n start_taskqueue_master()\n }\n elsif my_node.is_taskqueue_slave?\n threads << Thread.new {\n start_taskqueue_slave()\n }\n end\n\n # App Engine apps rely on the above services to be started, so\n # join all our threads here\n Djinn.log_info(\"Waiting for all services to finish starting up\")\n threads.each { |t| t.join() }\n Djinn.log_info(\"API services have started on this node\")\n\n end",
"def server_exist?(server_name)\n compute = find_match(@compute.servers, server_name)\n Puppet.debug \"found server #{compute.name}\" if compute != nil\n Puppet.debug \"server not found : #{server_name}\" if compute == nil\n return (compute != nil)\n end",
"def service_start(restart: false)\n return false unless @service_thread.nil? || restart\n @service_thread.kill unless @service_thread.nil?\n\n cleanup\n\n @service_thread = Thread.new do\n begin\n exit = false\n until exit do\n command = @service_commands.pop # blocks, does not wait spin\n @failed_peers = @failed_peers.select { |host, time| time + PEER_RETRY_TIME > Time.now } # sliding window\n\n\n\n case command[0]\n when 'tracker updated'\n @tracker_provided_peers.merge!(command[1].map { |host_info| [\"#{host_info['ip']}:#{host_info['port']}\", host_info['peer id']]}.to_h)\n @service_commands.push(['more connections'])\n when 'connect'\n ip, port, peer_id = command[1]\n unless (@connections_out.key?(\"#{ip}:#{port}\"))\n worker = ::KTorrent::Torrent::PeerWorker.new(manager: self, ip: ip, port: port, peer_id: peer_id)\n @connections_out[worker.ip_port] = worker\n ::KTorrent.log(\"Worker #{worker.ip_port} created\")\n worker.start_thread\n end\n when 'disconnect'\n ip_port, worker, error = command[1]\n\n if error\n case error\n when Errno::ETIMEDOUT\n # A connection attempt failed because the connected party did not properly respond after a period of time,\n # or established connection failed because connected host has failed to respond\n ::KTorrent.log(\"Worker #{worker.ip_port} failed with Errno::ETIMEDOUT\")\n when Errno::ECONNREFUSED\n # No connection could be made because the target machine actively refused it\n ::KTorrent.log(\"Worker #{worker.ip_port} failed with Errno::ECONNREFUSED\")\n when Errno::ECONNRESET\n # An existing connection was forcibly closed by the remote host\n ::KTorrent.log(\"Worker #{worker.ip_port} failed with Errno::ECONNRESET\")\n when SocketError\n # getaddrinfo: This is usually a temporary error during hostname resolution and means that the local server did not receive a response from an authoritative server.\n # getaddrinfo: No such host is known\n ::KTorrent.log(\"Worker #{worker.ip_port} failed with SocketError\")\n when ::KTorrent::Torrent::TrackerManager::BadTrackerResponse\n ::KTorrent.log(\"Worker #{worker.ip_port} failed with error from tracker: #{e.message}\")\n when ::KTorrent::Torrent::PeerWorker::HandShakeFailed\n ::KTorrent.log(\"Worker #{worker.ip_port} failed with bad peer handshake\")\n else\n ::KTorrent.log(\"Worker #{worker.ip_port} failed with #{error.inspect + \"\\n\" + error.backtrace[0..2].join(\"\\n\")}\")\n end\n end\n worker.clean_up\n\n @connections_out.delete(ip_port)\n @failed_peers[ip_port] = Time.now\n @pieces_being_retrieved.delete(worker)\n @workers_pending_pieces.reject! {|piece_id, wk| wk == worker }\n\n @service_commands.push(['more connections'])\n when 'more connections'\n # try to add more connections, if not at quota yet and possible\n @tracker_provided_peers.select { |ip_port, peer_id|\n !@failed_peers.key?(ip_port)\n }.to_a\n .sample([MAX_CONNECTIONS - @connections_out.size, 0].max)\n .to_h\n .each { |ip_port, peer_id|\n ip, port = ip_port.split(':')\n service_commands.push(['connect', [ip, port, peer_id]])\n }\n when 'retrieve pieces'\n worker = command[1]\n pieces = worker.state.have\n worker_can_request = torrent.data.have_all.zip(pieces).map.with_index do |(self_have, worker_have), piece_id|\n !self_have && worker_have && !@workers_pending_pieces.key?(piece_id)\n end\n\n piece_ids = worker_can_request.each_index.select { |piece_id| worker_can_request[piece_id] }\n @pieces_being_retrieved[worker] ||= []\n want = piece_ids.take([::KTorrent::Torrent::PeerWorker::MAX_REQUESTED_PIECES - @pieces_being_retrieved[worker].size, 0].max)\n want.each do |piece_id|\n @pieces_being_retrieved[worker].push(piece_id)\n @workers_pending_pieces[piece_id] = worker\n end\n worker.queue.push(['attempt pieces', want])\n when 'received piece'\n worker, piece_id, data = command[1]\n ::KTorrent.log(\"received piece #{piece_id} from #{worker.ip_port}\")\n\n torrent.data[piece_id] = data\n\n service_commands.push(['retrieve pieces', worker])\n when 'abandoned piece'\n worker, piece_id = command[1]\n\n # remove piece id from pieces_being_retrieved\n @workers_pending_pieces.delete(piece_id)\n @pieces_being_retrieved[worker].delete(piece_id)\n\n when 'saved piece'\n piece_id = command[1]\n\n # remove piece id from pieces_being_retrieved\n worker = @workers_pending_pieces[piece_id]\n @workers_pending_pieces.delete(piece_id)\n @pieces_being_retrieved[worker].delete(piece_id)\n\n ::KTorrent.log(\"saved piece #{piece_id} from #{worker.ip_port}\")\n\n connections_out.each { |ip_port, worker| worker.queue.push(['send have', piece_id]) }\n when 'exit'\n exit = true\n end\n end\n rescue StandardError => e\n ::KTorrent.log(\"Peer Manager crashed with #{e.inspect + \"\\n\" + e.backtrace[0..2].join(\"\\n\")}\")\n ensure\n ::KTorrent.log(\"Peer Manager has stopped\")\n end\n end\n end",
"def connection_status_server; end",
"def daemon_running?; end",
"def sshd_service_exists?\n # FIXME: We should probably check exit status rather than AIX-specific error codes.\n output=ssh_command(\"#{config[:sudo]} #{config[:clogin]} #{config[:wpar_name]} #{config[:lssrc]} -s sshd\", :stderr)\n if output.include?('0513-085') # 0513-085 The sshd Subsystem is not on file.\n return false\n end\n true\n end",
"def install_redis(ips)\n print \"==== Begin install redis on follow server(s). \" + ips.join(', ') + \" ====\\n\"\n ips.each { |ip|\n have_redis_32 = `ssh redis@#{ip} \"stat redis-3.2.11\"`\n if have_redis_32 == \"\"\n # install redis\n print \"Install redis-3.2.11 ...\\n\"\n system \"scp ~/redis-3.2.11.tar.gz redis@#{ip}:.\"\n if $?.to_i != 0\n abort \"Copy redis-3.2.11.tar.gz to remote host failed!\"\n end\n\n system \"ssh redis@#{ip} 'tar -zxf redis-3.2.11.tar.gz && cd redis-3.2.11 && make'\"\n if $?.to_i != 0\n abort \"Build redis-3.2.11 failed!\"\n end\n\n print \"Redis install complete!\\n\"\n else\n print \"Redis-3.2.11 already installed!\\n\"\n end\n }\n\n print \"\\n==== All install completed! ====\\n\\n\"\nend"
] | [
"0.6725727",
"0.6241318",
"0.6231221",
"0.5955846",
"0.5892616",
"0.5754152",
"0.5713558",
"0.5579522",
"0.5471411",
"0.5470958",
"0.5350067",
"0.53359824",
"0.5333004",
"0.5332093",
"0.5330134",
"0.5313745",
"0.53044957",
"0.52969456",
"0.5276121",
"0.52760583",
"0.5268439",
"0.52518696",
"0.5241338",
"0.5238279",
"0.52328956",
"0.5229249",
"0.5228525",
"0.52266604",
"0.5221425",
"0.5189973",
"0.518675",
"0.5169845",
"0.5158696",
"0.5154926",
"0.5146751",
"0.5139818",
"0.51360273",
"0.5126522",
"0.51245636",
"0.5111739",
"0.5096144",
"0.5096144",
"0.50935787",
"0.5082473",
"0.50581354",
"0.50548196",
"0.504853",
"0.50465053",
"0.50408775",
"0.5039378",
"0.5038931",
"0.5038652",
"0.5035855",
"0.50324047",
"0.5030121",
"0.50257534",
"0.5013351",
"0.5013002",
"0.50096756",
"0.5009652",
"0.500578",
"0.5003053",
"0.50022435",
"0.50018704",
"0.4998887",
"0.499592",
"0.4995302",
"0.4991486",
"0.4991486",
"0.4986141",
"0.49719372",
"0.49714693",
"0.49714372",
"0.49708235",
"0.49683645",
"0.49607658",
"0.49598753",
"0.49597523",
"0.49585497",
"0.49570617",
"0.4954908",
"0.49450216",
"0.49417847",
"0.4937899",
"0.49367663",
"0.4929152",
"0.49227154",
"0.4917543",
"0.49113733",
"0.49086553",
"0.48930737",
"0.48916808",
"0.48912758",
"0.48837295",
"0.48826042",
"0.48823428",
"0.48787832",
"0.48701492",
"0.48662326",
"0.4865189"
] | 0.6929079 | 0 |
GET /report_orders_by_users GET /report_orders_by_users.json | def index
@report_orders_by_users = ReportOrdersByUser.all
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_report_orders_by_user\n @report_orders_by_user = ReportOrdersByUser.find(params[:id])\n end",
"def show_orders\n @user = User.find_by_sql [\"select * from users where email = ? and users.status = 'admin'\", params[:email]]\n if @user.count != 0\n @orders = UsersOrder.find_by_sql [\"select users_orders.id, users.email, books.title, books.genre from users_orders\n LEFT JOIN users ON users_orders.user_id = users.id\n LEFT JOIN books ON users_orders.book_id = books.id where users_orders.status = ? ORDER BY users_orders.created_at ASC\", params[:status]]\n end\n render json: @orders\n end",
"def index\n @orders = Order.order(\"id DESC\").page(params[:page])\n\n if params[:user_id]\n @orders = @orders.where(:user_id => params[:user_id])\n end\n\n if Rails.configuration.orders_status.select{|k, v| v[:real]}.keys.include? params[:status]\n @orders = @orders.where(:status => params[:status])\n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @orders }\n end\n end",
"def show_user_reports\n reports = User.find(params[:id]).reports\n render :json => reports\n end",
"def index\n @user = User.find(params[:user_id])\n @orders = User.find(params[:user_id]).orders\n end",
"def index\n\n # render :json => users.to_json(include: :reports)\n\n reports = current_user.reports\n # render :json => reports\n\n render :json => reports.to_json(include: :inputs)\n end",
"def index\n\t\t@orders = Order.includes(:user).paginate(page: params[:page], per_page: 10).order(order_date: :desc)\n\tend",
"def index\n page = params[:page] || 1\n page_size = params[:page_size] || 8\n\n @orders = Order.all.includes(:user).where(user: @current_user)\n @orders = @orders.order(created_at: :desc).offset(page_size * (page - 1)).limit(page_size)\n @orders_count = @orders.count\n @dto = OrderListDto.new(@orders, @orders_count, self.request.path, page, page_size)\n render json: @dto, status: :created\n end",
"def orders\r\n\t\t@current_area = 'orders_report'\r\n\t\t@current_menu = 'reports'\r\n\r\n\t\tif request.post? || (request.get? && params[:page])\r\n\t\t\t@report_title = 'Orders'\r\n\t\t\tfilename = 'reports/orders'\r\n\t\t\t@criteria = [\"status='completed'\"]\r\n\r\n\t\t\t@page = (params[:page] || 1).to_i\r\n\t\t\t@items_per_page = 20\r\n\t\t\t@offset = (@page - 1) * @items_per_page\r\n\r\n\t\t\tif params[:start_date]\r\n\t\t\t\t@start_date = ffs_parse_date(params[:start_date])\r\n\r\n\t\t\t\t@criteria << \"(created_at >= '\" + @start_date.strftime('%Y-%m-%d') + \"')\"\r\n\t\t\t\tfilename += '-' + @start_date.strftime('%Y-%m-%d')\r\n\t\t\t\t@report_title += ': ' + @start_date.strftime('%d/%m/%Y')\r\n\t\t\tend\r\n\r\n\t\t\tif params[:end_date]\r\n\t\t\t\t# We want to show records that fall before the day after the end date\r\n\t\t\t\t@end_date = ffs_parse_date(params[:end_date])\r\n\t\t\t\tquery_end_date = @end_date + 1\r\n\r\n\t\t\t\t@criteria << \"(created_at <= '\" + query_end_date.strftime('%Y-%m-%d') + \"')\"\r\n\t\t\t\tfilename += '-to-' + @end_date.strftime('%Y-%m-%d')\r\n\t\t\t\t@report_title += ' to ' + @end_date.strftime('%d/%m/%Y')\r\n\t\t\telse\r\n\t\t\t\t@report_title += ' to present'\r\n\t\t\tend\r\n\r\n\t\t\t@order_count = Order.count(@criteria.join(' AND '))\r\n\t\t\t@pages = Paginator.new(self, @order_count, @items_per_page, @page)\r\n\t\t\t@orders = Order.find(\r\n\t\t\t\t:all,\r\n\t\t\t\t:conditions => @criteria.join(' AND '),\r\n\t\t\t\t:order => 'created_at DESC',\r\n\t\t\t\t:offset => params[:download] ? 0 : @offset,\r\n\t\t\t\t:limit => params[:download] ? nil : @items_per_page\r\n\t\t\t)\r\n\r\n\t\t\t# make Excel file if download is selected - otherwise render in page\r\n\t\t\tif params[:download]\r\n\t\t\t\t@rows = @orders.collect { |x| [ x.id, [x.created_at, :date], x.user.to_s, x.delivery_address ? x.delivery_address.country : x.billing_address.country, x.items.count, [x.total, :price] ] }\r\n\r\n\t\t\t\t@report_title += ' ' + Date.today.strftime('%d/%m/%Y')\r\n\t\t\t\tfilename += '.xls'\r\n\r\n\t\t\t\treport = Report.new filename\r\n\t\t\t\treport.write 0, 0, @report_title, :title\r\n\t\t\t\treport.write 1, 0, [ 'ID', 'Date', 'User', 'Country', 'Items', 'Total' ], :heading\r\n\t\t\t\treport.write_rows @rows\r\n\t\t\t\treport.close\r\n\r\n\t\t\t\t@headers['Expires'] = '0'\r\n\t\t\t\t@headers['Cache-Control'] = 'must-revalidate,post-check=0,pre-check=0'\r\n\t\t\t\t@headers['Pragma'] = 'public'\r\n\r\n\t\t\t\tsend_file filename, :type => 'application/vnd.ms-excel', :stream => false\r\n\t\t\t\tFile.delete filename\r\n\t\t\tend\r\n\t\telse\r\n\t\t\t@start_date = @end_date = Date.today\r\n\t\tend\r\n\tend",
"def index\n\n order_by = params[:order]\n\n if order_by\n order_by = \"users.name\" if order_by == \"salesperson\"\n @leads = Lead.includes(:user).order(order_by)\n else\n @leads = Lead.includes(:user).order(received_at: :desc)\n end\n @users = User.all\n\n respond_to do |format|\n format.html\n format.csv { send_data @leads.to_csv, filename: \"leadmailer-leads-#{Date.today}.csv\" }\n end\n\n @leads = Lead.all\n @leads = Lead.paginate(page: params[:page], per_page: 10)\n end",
"def index\n @user_reports = UserReport.find_all_by_spam(false, :include => :user, :order => 'user_reports.created_at DESC')\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @user_reports }\n end\n end",
"def index\n @q = Order.order(id: :desc).search(params[:q])\n @orders = @q.result.includes(:user).page(params[:page]).per(20)\n end",
"def index # see model > order.rb\n # if current_user\n @orders = current_user.orders\n render \"index.json.jb\"\n # else\n # render json: [], status: :unauthorized\n # end\n end",
"def index\n @user_orders = UserOrder.all\n end",
"def index\n @user = current_user.id\n @users = User.order(sort_column + \" \" + sort_direction)\n respond_to do |format|\n format.html\n format.csv { render text: @users.to_csv }\n format.pdf do\n pdf = ReportPdf.new(@users)\n send_data pdf.render, filename: 'Report-'+ Time.now.strftime(\"%d/%m/%Y\") +'.pdf', type: 'application/pdf'\n end\n end\n end",
"def index\n @orders = orders_for_user.order(created_at: :desc)\n end",
"def index\n @orders = Order.user_orders current_user\n end",
"def index\n @orders = Order.for_today.includes(:user)\n @users_missing_orders = Lunch.for_today.users_missing_orders\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @orders }\n end\n end",
"def index\n @planned_orders = PlannedOrder.where(:user => current_user.email).all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @planned_orders }\n end\n end",
"def getorders(args={})\n {\n :method=> \"GetOrders\"\n }.to_json\n end",
"def reports\n @orders_r = @branch.orders.where(:date=> Date.today).order(\"created_at desc\")\n @order_close = @branch.orders.find_by_mode_and_date(\"4\",Date.today)\n\n respond_to do |format|\n format.html\n format.json {render json: @order}\n end\n end",
"def my_reports\n @reports ||= Report.user(current_user).all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @reports }\n end\n end",
"def index\n @reports = current_company.reports.reverse_order.page(params[:page]).per(10) if params[:sort] == nil && params[:uesr_id] == nil\n @reports = current_company.reports.order(params[:sort]).page(params[:page]).per(10) if params[:sort] != nil\n @reports = current_company.reports.where(user_id: params[:user_id]).reverse_order.page(params[:page]).per(10) if params[:user_id] != nil\n end",
"def get_user_report\n service_response = AdminManagement::Report::User.new(params).perform\n render_api_response(service_response)\n end",
"def user_report\n user = User.find_by_username(params[:username])\n raise Discourse::InvalidParameters.new(:username) if !user\n\n ignored_ids = DiscourseFingerprint.get_ignores(user)\n\n fingerprints =\n Fingerprint\n .where(user: user)\n .where.not(value: FlaggedFingerprint.select(:value).where(hidden: true))\n .order(updated_at: :desc)\n\n user_ids =\n Fingerprint\n .matches\n .where(value: fingerprints.pluck(:value))\n .to_h { |match| [match.value, match.user_ids - [user.id]] }\n\n users = User.where(id: user_ids.values.flatten.uniq).or(User.where(id: ignored_ids))\n\n render json: {\n user: BasicUserSerializer.new(user, root: false),\n ignored_ids: ignored_ids,\n fingerprints:\n serialize_data(fingerprints, FingerprintSerializer, scope: { user_ids: user_ids }),\n users: users.map { |u| [u.id, BasicUserSerializer.new(u, root: false)] }.to_h,\n }\n end",
"def list\n @reports_fetch = Report.all\n @reports = []\n\n @reports_fetch.each do |report|\n @reports << report if current_user == report.submitter\n end\n\n render status: 200, json: @reports.as_json(methods: [:url_title_string, :report_time_ms], include: { report_status_type: {}, report_type: {}, specified_submit_to_role: {} })\n end",
"def index_by_user\n # find the user by username\n user = User.find_by(username: params[:user_id])\n # find the fills by user.id\n @fills = Fill.where(user_id: user.id)\n render json: @fills, include: ['user', 'prompt', 'comments.user', 'comments.user.id', 'comments.user.username']\n end",
"def orders\n params = { command: 'account_orders' }\n get('/json.php', params)\n end",
"def index\n @user_orders = Order.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @user_orders }\n end\n end",
"def index\n @orders = current_user.type == 'Referral' ? current_user.orders : Order\n @orders = @orders.success_order.page(params[:page]).per(100).order('orders.created_at DESC')\n end",
"def show\n @order = Order.find(params[:id])\n @users = []\n\n @order.groupas.each do |ga|\n ga.groupa_users.each do |u|\n @users << u.user if u.user\n end\n end\n @order.groupbs.each do |gb|\n gb.groupb_users.each do |u|\n @users << u.user if u.user\n end\n end\n @order.groupcs.each do |gc|\n gc.groupc_users.each do |u|\n @users << u.user if u.user\n end\n end\n @users << @order.user\n @users.uniq!\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @order }\n end\n end",
"def index\n @orders = Order.where(user_id: current_user.id)\n end",
"def index\n @orders = current_user.orders.order(\"created_at DESC\")\n end",
"def index\n @reports = Report.user_reports(current_user).order('created_at DESC').paginate(page: params[:page], per_page: 10)\n @report = Report.new(report_params)\n end",
"def index\n @usr = current_user\n @orders = Order.order(:name).page(params[:page]).per(2)\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @orders }\n end\n end",
"def index\n records = policy_scope(Record)\n if !params[:from] && !params[:from]\n records = Record.where(:user_id => @current_user.id)\n else\n records = Record.where(\"user_id = ? and created_at >= ? and created_at <= ?\", @current_user.id, params[:from], params[:to])\n end\n records = records.select(\"date(created_at) as created_date, sum(distance) as distance,sum(time) as time,(sum(distance) / sum(time)) as average_speed\").group(\"created_date\")\n render json:{ reports: records}\n\n end",
"def find_reports(user)\n @reports = Report.all(:conditions => { :user_id => user })\n end",
"def single_customer_reports\n @id = params[:id] # stores customer id\n @user = User.find(@id)\n start_date = params[:start_date]\n if (start_date.nil?)\n @date_arr = @user.orders.all\n else\n end_date = params[:end_date]\n @date_arr = []\n @user.orders.each do |order|\n if (order.date.strftime(\"%Y-%m-%d\").to_date >= start_date.to_date && order.date.strftime(\"%Y-%m-%d\").to_date <= end_date.to_date)\n @date_arr.push(order)\n end\n end\n end\n end",
"def index\n @orders = Order.paginate page: params[:page], order: 'created_at desc', \n per_page: 10\n \n respond_to do |format|\n format.html\n format.json { render json: @orders } \n end\n end",
"def index\n @orders = current_user.orders.all.order(created_at: :desc)\n end",
"def customer_reports\n @users = User.where(\"role = ?\", \"user\")\n end",
"def show\n @orders = Order.where(user_id: @user.id)\n end",
"def index\n @q = Order.ransack(params[:q])\n @orders = @q.result.includes(:collector, :user).paginate(page: params[:page], per_page: params[:per_page] || 10)\n\n respond_to do |format|\n format.html\n format.xlsx {\n response.headers[\n 'Content-Disposition'\n ] = \"attachment; filename=pedidos.xlsx\"\n }\n end\n end",
"def employee_repair_orders_index\n\n @employee = current_employee_user.id\n\n @employee_repair_orders = current_business_user.employee_users_repair_orders.where(\n employee_user_id: @employee )\n if @employee_repair_orders\n render json: { employee_repair_orders: @employee_repair_orders.as_json(include: [\n :repair_order,\n :client,\n :vehicle]) },\n status: :ok\n else\n render json: { employee_repair_orders: @employee_repair_orders.errors.full_messages },\n status: :unprocessable_entity\n end\n end",
"def show\n @report = @report_orders_by_user.gen_report.each(:as => :hash)\n\n respond_to do |format|\n format.html\n format.pdf do\n pdf = ReportOrdersByUsers.new(@report, view_context)\n send_data pdf.render, filename: \"report_orders_by_users.pdf\",\n type: \"application/pdf\",\n disposition: \"inline\"\n end\n end\n\n end",
"def index\n @orders = current_user.orders\n @involvedOrders = OrderUser.where('user_id = (?)',current_user.try(:id))\n end",
"def index\n @user = User.find(params[:user_id])\n @reports = Report.where(user_id: @user.id, date: (start_of_year(@year)..end_of_year(@year))).order('date ASC')\n end",
"def index\n @users = User.where(params[:sort] + \" <> ''\").order(params[:sort] + \" \" + params[:direction]).page params[:page]\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @users, :except => [:email] }\n end\n end",
"def index\n @reports = Report.where(user_id: current_user.id, patient_id:@patient.id)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @reports }\n end\n end",
"def index\n if current_user.admin\n @orders = Order.find(:all)\n else\n @orders = current_user.orders.find(:all)\n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @orders }\n end\n end",
"def index\n @orders = Order.order(\"id\").all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @orders }\n end\n end",
"def index\n @orders = current_user.orders\n .where(status: [Order.statuses[:initiated], Order.statuses[:deleted]])\n .includes(:items, :supplier)\n .order(id: :desc)\n .page(params[:page])\n .per(params[:per])\n end",
"def index\n from_time = Time.now\n render json: Invoice.where(invoice_status_id: 12).order(id: :desc).limit(10).map { |x|\n {\n username: x.user.username,\n plan: \"#{x.plan.name} - $#{x.plan.price} USD\",\n created_at: x.created_at\n }\n }\n end",
"def index\n @orders_grid = initialize_grid(@orders,\n :conditions => {:order_type => \"b2c\"}, :include => [:business, :keyclientorder, :user_logs],:order => 'created_at', :order_direction => 'desc')\n @orders_grid.with_resultset do |orders|\n @@orders_query_export = orders.order(created_at: :desc)\n end\n end",
"def index\n @orders = current_user.orders\n end",
"def index\n @orders = current_user.orders\n end",
"def get_log_out_users_orders\n orders_details = []\n orders = Order.where(user_id: nil)\n\n orders.each do |order|\n bufor = []\n order_price = 0\n orders_products = OrdersProduct.where(order_id: order.id)\n\n # I need do it because I need to know product price, desc etc not only quantity and id\n orders_products.each do |order_product| \n product = Product.find(order_product.product_id)\n\n order_price += (product.price * order_product.quantity)\n \n bufor.push({\n product_description: product.description,\n product_price: product.price,\n quantity: order_product.quantity\n })\n end\n\n data_creation = order.dataCreation\n data = \"#{data_creation.year}:#{data_creation.month}:#{data_creation.day} #{data_creation.hour}:#{data_creation.minute}:#{data_creation.second}\"\n\n orders_details.push({\n dataPerson: order.dataPerson,\n deliveryAddress: order.deliveryAddress,\n dataCreated: data,\n details: bufor,\n orderPrice: order_price,\n orderID: order.id\n })\n end\n\n render json: orders_details\n end",
"def index\n\n if current_user.status==User.STATUS_SHOPPER\n @orders=current_user.orders.order(\"created_at DESC\").all\n else\n @orders=Order.order(\"created_at DESC\").all\n end\n\n end",
"def index\n @orders = Order.search(attach_owner_user_id)\n end",
"def index\n @backend_user_content_reports = Backend::UserContentReport.paginate(:order => 'created_at DESC', :page => params[:page], :per_page => 50)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @backend_user_content_reports }\n end\n end",
"def index\n if current_user\n #User.find(current_user.id).orders.to_a +\n @pagy, @orders = pagy_array(Order.find_by_sql(\"SELECT order_type,restaurant,joined_num ,invited_num,status, orders.user_id, orders.id from orders, user_join_orders WHERE orders.id = user_join_orders.order_id AND user_join_orders.user_id = #{current_user.id}\"),items: 2)\n else\n redirect_to new_user_session_path, notice: 'You are not logged in.'\n end\n end",
"def index\n if current_user[:user_type] == :normal\n @orders = Order.where('email = ?', current_user[:login]).order(:created_at).reverse_order\n else\n @orders = Order.order(:created_at).reverse_order\n end\n @criteria = OrderCriteria.new\n end",
"def index\n\t\t@orders = Order.all\n\t\trespond_with @orders\n\tend",
"def sales\n @orders = Order.where(seller: current_user).order(\"created_at DESC\").paginate(:page => params[:page], :per_page => 48)\n respond_to do |format|\n format.html\n format.csv { send_data @orders.to_csv(@orders) } \n end\n end",
"def index\n # Admin users see all orders; non-Admins only see their own orders\n if current_user.admin\n @orders = Order.order(\"updated_at DESC\")\n else\n @orders = current_user.orders.order(\"updated_at DESC\")\n end\n end",
"def index\n @order_users = OrderUser.all\n end",
"def index\n\n # TODO тут избавиться от scoped и в includes наверно включить ping\n users_scope = User.scoped\n\n if params[:role].present? && params[:role] != 'all'\n users_scope = users_scope.where(:role => params[:role])\n end\n\n @users = users_scope.references(:stats).order('stats.updated_at DESC').includes(:stats, :email_addresses, :phones, :names, :account).page(params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @users }\n end\n end",
"def index\n @orders = Order.where(buyer: current_user)\n end",
"def index\n @orders = Order.all\n respond_to do |format|\n format.html { render layout: \"account\" }\n format.json { render :json => @orders }\n end\n end",
"def index\n @orders = Order.all\n render json: @orders\n end",
"def listOrders()\n if(!authenticateAdmin(params[:admin_id], params[:admin_auth_key]))\n render json: {status: false, reason: \"Authentication Failed\", data: \"\"}\n return\n end\n ret = []\n Order.find_each do |order|\n ret << {id: order.id, product_id: order.product_id, product_name: Product.find(order.product_id).name, user_id: order.user_id, quantity: order.quantity, price_per_unit: order.price_per_unit, int_status: order.order_status}\n end\n render json: {data: ret.to_json, reason: '', status: true}\n end",
"def index# not :post order. this is a :get index of previous orders.\n @orders = current_refinery_user.orders.order('created_at DESC')\n end",
"def list_orders\n Order.list(@current_user)\n end",
"def report\n search = params[:event_name].strip unless params[:event_name].nil?\n column = params[:column].nil? ? 'event_name' : params[:column]\n direction = params[:direction].nil? ? 'asc' : params[:direction]\n items = Event.my_order(column, direction).where(:creator_user_id => user_id).joins(participants: [:attendee_types]).merge(Participant.where :user_id => user_id).merge(AttendeeType.where :id => AttendeeType.director_id)\n .title_like(search).select(\"events.id AS event_id, events.title AS event_name, 0 AS net_income, \"+\n \"0 AS payment_recived,\"+\n \"0 AS account_balance\")\n .group(\"events.id\")\n json_response_serializer_collection items, AdminReportSerializer\n end",
"def index\n @orders = Order.search(current_user, params[:customer_id]).paginate(:per_page => current_user.profile.orders_per_page, :page => params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.js # index.js.erb\n format.xml { render :xml => @orders }\n end\n end",
"def index\n @users = User.order(:idnum)\n respond_to do |format|\n format.html { render json: {:message => \"Here are the details of all #{@users.size} users.\", :users => @users }}\n end\n end",
"def index\n @orders = Order.all\n respond_to do |format|\n format.html\n format.json { render :json => @orders }\n end\n end",
"def index\n # @orders = Order.all\n # @orders = Order.where(user_id: current_user.id)\n \n @friendships=Friendship.where(user_id: current_user.id)\n @orders = Order.joins(:users).where(users: {id: current_user.id}).paginate(page: params[:page], per_page: 2)\n @myOrders = Order.where(user_id: current_user.id).paginate(page: params[:page], per_page: 2)\n end",
"def index\n @purchase_orders = current_user.purchase_orders\n @purchase_orders = @purchase_orders.map{ |purchase_order| purchase_order.attributes }\n render json: @purchase_orders\n end",
"def recent_orders()\n\t\twith_auth nil do |options|\n\t\t\tself.class.get(\"/api/v1/orders\", options)\n \tend\n\tend",
"def orders\n authenticated_post(\"auth/r/orders\").body\n end",
"def index\n @orders = Order.all\n render json: @orders, status: 200\n end",
"def view_log\n transactions = Transaction.sort_user_transactions(params[:user_id]) # sort by created_date\n render json: transactions, each_serializer: TransactionShowSerializer\n end",
"def index\n @users = User.all.select(\"id\", \"name\", \"progress\", \"created_at\", \"updated_at\")\n render :json => @users\n end",
"def show_report\n report = User.find(params[:id]).reports.find(params[:r_id])\n render :json => report\n end",
"def export\n send_data current_user.records.select(:json).order('updated_at desc').collect(&:json).to_json, filename: 'records.json'\n end",
"def index\n\n @orders = Order.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @orders }\n end\n end",
"def index\n @orders = Order.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @orders }\n end\n end",
"def index\n @orders = Order.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @orders }\n end\n end",
"def index\n @orders = Order.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @orders }\n end\n end",
"def index\n @orders = Order.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @orders }\n end\n end",
"def index\n @orders = Order.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @orders }\n end\n end",
"def index\n @users = User.paginate(page: params[:page], per_page: params[:size])\n .order(created_at: :desc).all\n render json: @users\n end",
"def index\n if current_user.client_user?\n redirect_to :root\n return\n end\n \n @users = User.order(\"users.created_at DESC\")\n\n respond_to do |format|\n format.html\n format.json {head :ok }\n end\n end",
"def index\n\t\t#@admin_orders = Admin::Order.where(:status => [1,2,3])\n\n\t\t#logger.info params.to_yaml\n\n\t\trespond_to do |format|\n\t\t\tformat.html # index.html.erb\n\t\t\tformat.json { render json: OrdersDatatable.new(view_context) }\n\t\tend\n\tend",
"def index\n @ranks = Rank.includes(:users).order('power asc').all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @users }\n end\n end",
"def index\n #@orders = Order.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @orders }\n end\n end",
"def index\r\n @users = User.order(\"created_at DESC\")\r\n\r\n respond_to do |format|\r\n format.html # index.html.erb\r\n format.json { render json: @users }\r\n end\r\n end",
"def index\n @users = User.myfamily(current_user).includes_ext.order(:generation)\n @users += User.notfamily(current_user).includes_ext.order(\"root11, generation\")\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @users }\n end\n end",
"def index\n if current_user.admin? == false\n @blocks = Block.where(:user_id => current_user.id)\n @user_reports = Array.new\n for block in @blocks\n @user_reports << block.block_number\n end\n @reports = Report.where(:block_number => @user_reports).paginate(:page => params[:page], :per_page => 10)\n @reports = @reports.order(sort_column + \" \" + sort_direction)\n else\n @reports = Report.all.paginate(:page => params[:page], :per_page => 10)\n @reports = @reports.order(sort_column + \" \" + sort_direction)\n @reportsAll = Report.all\n end\n\n respond_to do |format|\n format.html\n format.csv { send_data @reportsAll.to_csv }\n format.xls { send_data @reportsAll.to_csv(col_sep: \"\\t\") }\n end\n end"
] | [
"0.68145066",
"0.6755658",
"0.6679018",
"0.66612995",
"0.66135854",
"0.65507966",
"0.652272",
"0.6500816",
"0.6461309",
"0.64477193",
"0.6438078",
"0.6390728",
"0.63844866",
"0.63711613",
"0.634273",
"0.63385",
"0.6317462",
"0.63109976",
"0.63023907",
"0.6298229",
"0.62834126",
"0.6279414",
"0.6272281",
"0.62647986",
"0.62510663",
"0.62244636",
"0.62175536",
"0.6190219",
"0.6183935",
"0.61797625",
"0.6165486",
"0.61637694",
"0.61596715",
"0.61093426",
"0.6094668",
"0.6093165",
"0.6082719",
"0.60790783",
"0.60773915",
"0.6070874",
"0.60659504",
"0.6062629",
"0.6056707",
"0.6046748",
"0.6035829",
"0.6020821",
"0.59904885",
"0.59844935",
"0.598376",
"0.5980587",
"0.59588736",
"0.59524965",
"0.5951874",
"0.59510803",
"0.59401196",
"0.59401196",
"0.5934858",
"0.59337795",
"0.59269494",
"0.5913776",
"0.59020203",
"0.5896062",
"0.5893368",
"0.58825374",
"0.5882205",
"0.58772945",
"0.5875488",
"0.58615726",
"0.5860329",
"0.5853167",
"0.5853163",
"0.58516675",
"0.58445096",
"0.58444035",
"0.5836762",
"0.583272",
"0.58298135",
"0.5828752",
"0.5828735",
"0.58221304",
"0.5813645",
"0.5812918",
"0.58084726",
"0.58040905",
"0.5801261",
"0.5792457",
"0.57920486",
"0.5789819",
"0.5789816",
"0.5789816",
"0.5789816",
"0.5789816",
"0.57843435",
"0.5781104",
"0.57745206",
"0.57739645",
"0.5761591",
"0.57585657",
"0.5755194",
"0.575042"
] | 0.7475197 | 0 |
GET /report_orders_by_users/1 GET /report_orders_by_users/1.json | def show
@report = @report_orders_by_user.gen_report.each(:as => :hash)
respond_to do |format|
format.html
format.pdf do
pdf = ReportOrdersByUsers.new(@report, view_context)
send_data pdf.render, filename: "report_orders_by_users.pdf",
type: "application/pdf",
disposition: "inline"
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n @report_orders_by_users = ReportOrdersByUser.all\n end",
"def set_report_orders_by_user\n @report_orders_by_user = ReportOrdersByUser.find(params[:id])\n end",
"def show_user_reports\n reports = User.find(params[:id]).reports\n render :json => reports\n end",
"def index\n @user = User.find(params[:user_id])\n @orders = User.find(params[:user_id]).orders\n end",
"def show_orders\n @user = User.find_by_sql [\"select * from users where email = ? and users.status = 'admin'\", params[:email]]\n if @user.count != 0\n @orders = UsersOrder.find_by_sql [\"select users_orders.id, users.email, books.title, books.genre from users_orders\n LEFT JOIN users ON users_orders.user_id = users.id\n LEFT JOIN books ON users_orders.book_id = books.id where users_orders.status = ? ORDER BY users_orders.created_at ASC\", params[:status]]\n end\n render json: @orders\n end",
"def index\n @orders = Order.order(\"id DESC\").page(params[:page])\n\n if params[:user_id]\n @orders = @orders.where(:user_id => params[:user_id])\n end\n\n if Rails.configuration.orders_status.select{|k, v| v[:real]}.keys.include? params[:status]\n @orders = @orders.where(:status => params[:status])\n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @orders }\n end\n end",
"def index\n\n # render :json => users.to_json(include: :reports)\n\n reports = current_user.reports\n # render :json => reports\n\n render :json => reports.to_json(include: :inputs)\n end",
"def get_user_report\n service_response = AdminManagement::Report::User.new(params).perform\n render_api_response(service_response)\n end",
"def index\n page = params[:page] || 1\n page_size = params[:page_size] || 8\n\n @orders = Order.all.includes(:user).where(user: @current_user)\n @orders = @orders.order(created_at: :desc).offset(page_size * (page - 1)).limit(page_size)\n @orders_count = @orders.count\n @dto = OrderListDto.new(@orders, @orders_count, self.request.path, page, page_size)\n render json: @dto, status: :created\n end",
"def index\n\t\t@orders = Order.includes(:user).paginate(page: params[:page], per_page: 10).order(order_date: :desc)\n\tend",
"def index\n @user_orders = UserOrder.all\n end",
"def orders\r\n\t\t@current_area = 'orders_report'\r\n\t\t@current_menu = 'reports'\r\n\r\n\t\tif request.post? || (request.get? && params[:page])\r\n\t\t\t@report_title = 'Orders'\r\n\t\t\tfilename = 'reports/orders'\r\n\t\t\t@criteria = [\"status='completed'\"]\r\n\r\n\t\t\t@page = (params[:page] || 1).to_i\r\n\t\t\t@items_per_page = 20\r\n\t\t\t@offset = (@page - 1) * @items_per_page\r\n\r\n\t\t\tif params[:start_date]\r\n\t\t\t\t@start_date = ffs_parse_date(params[:start_date])\r\n\r\n\t\t\t\t@criteria << \"(created_at >= '\" + @start_date.strftime('%Y-%m-%d') + \"')\"\r\n\t\t\t\tfilename += '-' + @start_date.strftime('%Y-%m-%d')\r\n\t\t\t\t@report_title += ': ' + @start_date.strftime('%d/%m/%Y')\r\n\t\t\tend\r\n\r\n\t\t\tif params[:end_date]\r\n\t\t\t\t# We want to show records that fall before the day after the end date\r\n\t\t\t\t@end_date = ffs_parse_date(params[:end_date])\r\n\t\t\t\tquery_end_date = @end_date + 1\r\n\r\n\t\t\t\t@criteria << \"(created_at <= '\" + query_end_date.strftime('%Y-%m-%d') + \"')\"\r\n\t\t\t\tfilename += '-to-' + @end_date.strftime('%Y-%m-%d')\r\n\t\t\t\t@report_title += ' to ' + @end_date.strftime('%d/%m/%Y')\r\n\t\t\telse\r\n\t\t\t\t@report_title += ' to present'\r\n\t\t\tend\r\n\r\n\t\t\t@order_count = Order.count(@criteria.join(' AND '))\r\n\t\t\t@pages = Paginator.new(self, @order_count, @items_per_page, @page)\r\n\t\t\t@orders = Order.find(\r\n\t\t\t\t:all,\r\n\t\t\t\t:conditions => @criteria.join(' AND '),\r\n\t\t\t\t:order => 'created_at DESC',\r\n\t\t\t\t:offset => params[:download] ? 0 : @offset,\r\n\t\t\t\t:limit => params[:download] ? nil : @items_per_page\r\n\t\t\t)\r\n\r\n\t\t\t# make Excel file if download is selected - otherwise render in page\r\n\t\t\tif params[:download]\r\n\t\t\t\t@rows = @orders.collect { |x| [ x.id, [x.created_at, :date], x.user.to_s, x.delivery_address ? x.delivery_address.country : x.billing_address.country, x.items.count, [x.total, :price] ] }\r\n\r\n\t\t\t\t@report_title += ' ' + Date.today.strftime('%d/%m/%Y')\r\n\t\t\t\tfilename += '.xls'\r\n\r\n\t\t\t\treport = Report.new filename\r\n\t\t\t\treport.write 0, 0, @report_title, :title\r\n\t\t\t\treport.write 1, 0, [ 'ID', 'Date', 'User', 'Country', 'Items', 'Total' ], :heading\r\n\t\t\t\treport.write_rows @rows\r\n\t\t\t\treport.close\r\n\r\n\t\t\t\t@headers['Expires'] = '0'\r\n\t\t\t\t@headers['Cache-Control'] = 'must-revalidate,post-check=0,pre-check=0'\r\n\t\t\t\t@headers['Pragma'] = 'public'\r\n\r\n\t\t\t\tsend_file filename, :type => 'application/vnd.ms-excel', :stream => false\r\n\t\t\t\tFile.delete filename\r\n\t\t\tend\r\n\t\telse\r\n\t\t\t@start_date = @end_date = Date.today\r\n\t\tend\r\n\tend",
"def index # see model > order.rb\n # if current_user\n @orders = current_user.orders\n render \"index.json.jb\"\n # else\n # render json: [], status: :unauthorized\n # end\n end",
"def reports\n @orders_r = @branch.orders.where(:date=> Date.today).order(\"created_at desc\")\n @order_close = @branch.orders.find_by_mode_and_date(\"4\",Date.today)\n\n respond_to do |format|\n format.html\n format.json {render json: @order}\n end\n end",
"def index\n @user_reports = UserReport.find_all_by_spam(false, :include => :user, :order => 'user_reports.created_at DESC')\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @user_reports }\n end\n end",
"def index\n @orders = current_user.type == 'Referral' ? current_user.orders : Order\n @orders = @orders.success_order.page(params[:page]).per(100).order('orders.created_at DESC')\n end",
"def index\n @orders = orders_for_user.order(created_at: :desc)\n end",
"def index\n @planned_orders = PlannedOrder.where(:user => current_user.email).all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @planned_orders }\n end\n end",
"def index\n @orders = Order.user_orders current_user\n end",
"def my_reports\n @reports ||= Report.user(current_user).all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @reports }\n end\n end",
"def index_by_user\n # find the user by username\n user = User.find_by(username: params[:user_id])\n # find the fills by user.id\n @fills = Fill.where(user_id: user.id)\n render json: @fills, include: ['user', 'prompt', 'comments.user', 'comments.user.id', 'comments.user.username']\n end",
"def index\n @reports = Report.user_reports(current_user).order('created_at DESC').paginate(page: params[:page], per_page: 10)\n @report = Report.new(report_params)\n end",
"def index\n @reports = current_company.reports.reverse_order.page(params[:page]).per(10) if params[:sort] == nil && params[:uesr_id] == nil\n @reports = current_company.reports.order(params[:sort]).page(params[:page]).per(10) if params[:sort] != nil\n @reports = current_company.reports.where(user_id: params[:user_id]).reverse_order.page(params[:page]).per(10) if params[:user_id] != nil\n end",
"def index\n\n order_by = params[:order]\n\n if order_by\n order_by = \"users.name\" if order_by == \"salesperson\"\n @leads = Lead.includes(:user).order(order_by)\n else\n @leads = Lead.includes(:user).order(received_at: :desc)\n end\n @users = User.all\n\n respond_to do |format|\n format.html\n format.csv { send_data @leads.to_csv, filename: \"leadmailer-leads-#{Date.today}.csv\" }\n end\n\n @leads = Lead.all\n @leads = Lead.paginate(page: params[:page], per_page: 10)\n end",
"def index\n @user = current_user.id\n @users = User.order(sort_column + \" \" + sort_direction)\n respond_to do |format|\n format.html\n format.csv { render text: @users.to_csv }\n format.pdf do\n pdf = ReportPdf.new(@users)\n send_data pdf.render, filename: 'Report-'+ Time.now.strftime(\"%d/%m/%Y\") +'.pdf', type: 'application/pdf'\n end\n end\n end",
"def index\n @q = Order.order(id: :desc).search(params[:q])\n @orders = @q.result.includes(:user).page(params[:page]).per(20)\n end",
"def index\n @user_orders = Order.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @user_orders }\n end\n end",
"def index\n @orders = Order.for_today.includes(:user)\n @users_missing_orders = Lunch.for_today.users_missing_orders\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @orders }\n end\n end",
"def getorders(args={})\n {\n :method=> \"GetOrders\"\n }.to_json\n end",
"def list\n @reports_fetch = Report.all\n @reports = []\n\n @reports_fetch.each do |report|\n @reports << report if current_user == report.submitter\n end\n\n render status: 200, json: @reports.as_json(methods: [:url_title_string, :report_time_ms], include: { report_status_type: {}, report_type: {}, specified_submit_to_role: {} })\n end",
"def show_report\n report = User.find(params[:id]).reports.find(params[:r_id])\n render :json => report\n end",
"def index\n @orders = current_user.orders.order(\"created_at DESC\")\n end",
"def index\n @usr = current_user\n @orders = Order.order(:name).page(params[:page]).per(2)\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @orders }\n end\n end",
"def index\n @orders = Order.where(user_id: current_user.id)\n end",
"def single_customer_reports\n @id = params[:id] # stores customer id\n @user = User.find(@id)\n start_date = params[:start_date]\n if (start_date.nil?)\n @date_arr = @user.orders.all\n else\n end_date = params[:end_date]\n @date_arr = []\n @user.orders.each do |order|\n if (order.date.strftime(\"%Y-%m-%d\").to_date >= start_date.to_date && order.date.strftime(\"%Y-%m-%d\").to_date <= end_date.to_date)\n @date_arr.push(order)\n end\n end\n end\n end",
"def index\n @orders = Order.paginate page: params[:page], order: 'created_at desc', \n per_page: 10\n \n respond_to do |format|\n format.html\n format.json { render json: @orders } \n end\n end",
"def index\n @reports = Report.where(user_id: current_user.id, patient_id:@patient.id)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @reports }\n end\n end",
"def index\n from_time = Time.now\n render json: Invoice.where(invoice_status_id: 12).order(id: :desc).limit(10).map { |x|\n {\n username: x.user.username,\n plan: \"#{x.plan.name} - $#{x.plan.price} USD\",\n created_at: x.created_at\n }\n }\n end",
"def find_reports(user)\n @reports = Report.all(:conditions => { :user_id => user })\n end",
"def index\n @orders = current_user.orders.all.order(created_at: :desc)\n end",
"def show\n @orders = Order.where(user_id: @user.id)\n end",
"def user_report\n user = User.find_by_username(params[:username])\n raise Discourse::InvalidParameters.new(:username) if !user\n\n ignored_ids = DiscourseFingerprint.get_ignores(user)\n\n fingerprints =\n Fingerprint\n .where(user: user)\n .where.not(value: FlaggedFingerprint.select(:value).where(hidden: true))\n .order(updated_at: :desc)\n\n user_ids =\n Fingerprint\n .matches\n .where(value: fingerprints.pluck(:value))\n .to_h { |match| [match.value, match.user_ids - [user.id]] }\n\n users = User.where(id: user_ids.values.flatten.uniq).or(User.where(id: ignored_ids))\n\n render json: {\n user: BasicUserSerializer.new(user, root: false),\n ignored_ids: ignored_ids,\n fingerprints:\n serialize_data(fingerprints, FingerprintSerializer, scope: { user_ids: user_ids }),\n users: users.map { |u| [u.id, BasicUserSerializer.new(u, root: false)] }.to_h,\n }\n end",
"def orders\n params = { command: 'account_orders' }\n get('/json.php', params)\n end",
"def employee_repair_orders_index\n\n @employee = current_employee_user.id\n\n @employee_repair_orders = current_business_user.employee_users_repair_orders.where(\n employee_user_id: @employee )\n if @employee_repair_orders\n render json: { employee_repair_orders: @employee_repair_orders.as_json(include: [\n :repair_order,\n :client,\n :vehicle]) },\n status: :ok\n else\n render json: { employee_repair_orders: @employee_repair_orders.errors.full_messages },\n status: :unprocessable_entity\n end\n end",
"def index\n @orders = current_user.orders\n @involvedOrders = OrderUser.where('user_id = (?)',current_user.try(:id))\n end",
"def index\n @orders = Order.search(attach_owner_user_id)\n end",
"def index\n @orders = current_user.orders\n end",
"def index\n @orders = current_user.orders\n end",
"def index\n @orders = Order.order(\"id\").all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @orders }\n end\n end",
"def customer_reports\n @users = User.where(\"role = ?\", \"user\")\n end",
"def create\n @report_orders_by_user = ReportOrdersByUser.new(report_orders_by_user_params)\n\n respond_to do |format|\n if @report_orders_by_user.save\n format.html { redirect_to @report_orders_by_user, notice: 'Report orders by user was successfully created.' }\n format.json { render :show, status: :created, location: @report_orders_by_user }\n else\n format.html { render :new }\n format.json { render json: @report_orders_by_user.errors, status: :unprocessable_entity }\n end\n end\n end",
"def index\n @backend_user_content_reports = Backend::UserContentReport.paginate(:order => 'created_at DESC', :page => params[:page], :per_page => 50)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @backend_user_content_reports }\n end\n end",
"def show\n @order = Order.find(params[:id])\n @users = []\n\n @order.groupas.each do |ga|\n ga.groupa_users.each do |u|\n @users << u.user if u.user\n end\n end\n @order.groupbs.each do |gb|\n gb.groupb_users.each do |u|\n @users << u.user if u.user\n end\n end\n @order.groupcs.each do |gc|\n gc.groupc_users.each do |u|\n @users << u.user if u.user\n end\n end\n @users << @order.user\n @users.uniq!\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @order }\n end\n end",
"def index\n\n if current_user.status==User.STATUS_SHOPPER\n @orders=current_user.orders.order(\"created_at DESC\").all\n else\n @orders=Order.order(\"created_at DESC\").all\n end\n\n end",
"def index\n @user = User.find(params[:user_id])\n @reports = Report.where(user_id: @user.id, date: (start_of_year(@year)..end_of_year(@year))).order('date ASC')\n end",
"def index\n records = policy_scope(Record)\n if !params[:from] && !params[:from]\n records = Record.where(:user_id => @current_user.id)\n else\n records = Record.where(\"user_id = ? and created_at >= ? and created_at <= ?\", @current_user.id, params[:from], params[:to])\n end\n records = records.select(\"date(created_at) as created_date, sum(distance) as distance,sum(time) as time,(sum(distance) / sum(time)) as average_speed\").group(\"created_date\")\n render json:{ reports: records}\n\n end",
"def index\n if current_user.admin\n @orders = Order.find(:all)\n else\n @orders = current_user.orders.find(:all)\n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @orders }\n end\n end",
"def customer_single_orders\n @orders = Order.where(customer_id: current_user.customer_id, category: :single)\n render json: @orders, status: 200\n\n end",
"def index# not :post order. this is a :get index of previous orders.\n @orders = current_refinery_user.orders.order('created_at DESC')\n end",
"def index\n @q = Order.ransack(params[:q])\n @orders = @q.result.includes(:collector, :user).paginate(page: params[:page], per_page: params[:per_page] || 10)\n\n respond_to do |format|\n format.html\n format.xlsx {\n response.headers[\n 'Content-Disposition'\n ] = \"attachment; filename=pedidos.xlsx\"\n }\n end\n end",
"def recent_orders()\n\t\twith_auth nil do |options|\n\t\t\tself.class.get(\"/api/v1/orders\", options)\n \tend\n\tend",
"def index\n @order_users = OrderUser.all\n end",
"def index\n @orders = Order.all\n render json: @orders\n end",
"def index\n\t\t@orders = Order.all\n\t\trespond_with @orders\n\tend",
"def index\n #data = HTTParty.get(\"http://localhost:8081/customers.json\")\n #p data.parsed_response[0]['email']\n if params[:customerId].present?\n @orders = Order.where(\"customerId\": params[:customerId].to_i)\n render json: @orders, status: 200\n elsif params[:id].present?\n @orders = Order.find_by id: params[:id]\n render json: @orders, status:200\n elsif params[:email].present?\n res = HTTParty.get(\"http://localhost:8081/customers/?email=#{params['email']}\")\n p res\n res = res.parsed_response\n @orders = Order.where(\"customerId\": res['id'].to_i)\n render json: @orders, status:200\n else\n @orders = Order.all\n end\n end",
"def index\n @orders = Order.all\n respond_to do |format|\n format.html\n format.json { render :json => @orders }\n end\n end",
"def index\n @orders = Order.all\n render json: @orders, status: 200\n end",
"def index\n @orders = Order.all\n respond_to do |format|\n format.html { render layout: \"account\" }\n format.json { render :json => @orders }\n end\n end",
"def index\n @orders_grid = initialize_grid(@orders,\n :conditions => {:order_type => \"b2c\"}, :include => [:business, :keyclientorder, :user_logs],:order => 'created_at', :order_direction => 'desc')\n @orders_grid.with_resultset do |orders|\n @@orders_query_export = orders.order(created_at: :desc)\n end\n end",
"def index\n\n @orders = Order.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @orders }\n end\n end",
"def index\n #@orders = Order.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @orders }\n end\n end",
"def index\n @orders = Order.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @orders }\n end\n end",
"def index\n @orders = Order.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @orders }\n end\n end",
"def index\n @orders = Order.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @orders }\n end\n end",
"def index\n @orders = Order.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @orders }\n end\n end",
"def index\n @orders = Order.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @orders }\n end\n end",
"def index\n @admin_orders = Order.page(params[:page]).per(10)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @admin_orders }\n end\n end",
"def get_log_out_users_orders\n orders_details = []\n orders = Order.where(user_id: nil)\n\n orders.each do |order|\n bufor = []\n order_price = 0\n orders_products = OrdersProduct.where(order_id: order.id)\n\n # I need do it because I need to know product price, desc etc not only quantity and id\n orders_products.each do |order_product| \n product = Product.find(order_product.product_id)\n\n order_price += (product.price * order_product.quantity)\n \n bufor.push({\n product_description: product.description,\n product_price: product.price,\n quantity: order_product.quantity\n })\n end\n\n data_creation = order.dataCreation\n data = \"#{data_creation.year}:#{data_creation.month}:#{data_creation.day} #{data_creation.hour}:#{data_creation.minute}:#{data_creation.second}\"\n\n orders_details.push({\n dataPerson: order.dataPerson,\n deliveryAddress: order.deliveryAddress,\n dataCreated: data,\n details: bufor,\n orderPrice: order_price,\n orderID: order.id\n })\n end\n\n render json: orders_details\n end",
"def index\n @orders = current_user.orders\n .where(status: [Order.statuses[:initiated], Order.statuses[:deleted]])\n .includes(:items, :supplier)\n .order(id: :desc)\n .page(params[:page])\n .per(params[:per])\n end",
"def index\n @users = User.order(:idnum)\n respond_to do |format|\n format.html { render json: {:message => \"Here are the details of all #{@users.size} users.\", :users => @users }}\n end\n end",
"def index\n @orders = Order.all\n if @orders.count >= 1\n json_response(@orders)\n else\n json_response({ Message: Message.no_data }, :not_found)\n end\n end",
"def index\n @purchase_orders = current_user.purchase_orders\n @purchase_orders = @purchase_orders.map{ |purchase_order| purchase_order.attributes }\n render json: @purchase_orders\n end",
"def index\n if current_user\n #User.find(current_user.id).orders.to_a +\n @pagy, @orders = pagy_array(Order.find_by_sql(\"SELECT order_type,restaurant,joined_num ,invited_num,status, orders.user_id, orders.id from orders, user_join_orders WHERE orders.id = user_join_orders.order_id AND user_join_orders.user_id = #{current_user.id}\"),items: 2)\n else\n redirect_to new_user_session_path, notice: 'You are not logged in.'\n end\n end",
"def index\n @reports = current_user.reports.all\n end",
"def index\n # Admin users see all orders; non-Admins only see their own orders\n if current_user.admin\n @orders = Order.order(\"updated_at DESC\")\n else\n @orders = current_user.orders.order(\"updated_at DESC\")\n end\n end",
"def index\n @reports = current_user.reports.all\n\n end",
"def index\n\t\t#@admin_orders = Admin::Order.where(:status => [1,2,3])\n\n\t\t#logger.info params.to_yaml\n\n\t\trespond_to do |format|\n\t\t\tformat.html # index.html.erb\n\t\t\tformat.json { render json: OrdersDatatable.new(view_context) }\n\t\tend\n\tend",
"def index\n @users = User.all.select(\"id\", \"name\", \"progress\", \"created_at\", \"updated_at\")\n render :json => @users\n end",
"def index\n if current_user.client_user?\n redirect_to :root\n return\n end\n \n @users = User.order(\"users.created_at DESC\")\n\n respond_to do |format|\n format.html\n format.json {head :ok }\n end\n end",
"def index\n if current_user[:user_type] == :normal\n @orders = Order.where('email = ?', current_user[:login]).order(:created_at).reverse_order\n else\n @orders = Order.order(:created_at).reverse_order\n end\n @criteria = OrderCriteria.new\n end",
"def index\n @orders = Order.where(buyer: current_user)\n end",
"def report\n search = params[:event_name].strip unless params[:event_name].nil?\n column = params[:column].nil? ? 'event_name' : params[:column]\n direction = params[:direction].nil? ? 'asc' : params[:direction]\n items = Event.my_order(column, direction).where(:creator_user_id => user_id).joins(participants: [:attendee_types]).merge(Participant.where :user_id => user_id).merge(AttendeeType.where :id => AttendeeType.director_id)\n .title_like(search).select(\"events.id AS event_id, events.title AS event_name, 0 AS net_income, \"+\n \"0 AS payment_recived,\"+\n \"0 AS account_balance\")\n .group(\"events.id\")\n json_response_serializer_collection items, AdminReportSerializer\n end",
"def index\n @orders = @group.orders\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @orders }\n end\n end",
"def index\n @orders = @branch.orders.limit(100).paginate(:page=>params[:page], :per_page=>20)\n logger.debug @orders.inspect\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @orders }\n end\n end",
"def index\n token_ok, token_error = helpers.API_validate_token(request)\n if not token_ok\n render json: {message: token_error }, status: 401\n else\n\n # Get the order ID\n order_id = params[:order_id].to_i\n\n @order_events = OrderEvent\n .includes(:user)\n .joins(event: :tracking_milestone)\n .where(order_id: order_id)\n .order(created_at: :desc)\n .map do |o|\n {\n id: o.id,\n eventId: o.event_id,\n eventName: o.event.name,\n userId: o.user_id,\n userName: \"#{o.user.first_name} #{o.user.last_name}\",\n orderId: o.order_id,\n createdAt: o.created_at,\n observations: o.observations,\n scope: \"#{o.scope == nil || o.scope.blank? ? o.event.scope : o.scope}\",\n placeOrder: o.event.tracking_milestone.place_order,\n trackingMilestoneName: o.event.tracking_milestone.name\n }\n end\n \n respond_to do |format|\n format.json { render json: @order_events }\n end\n end\n end",
"def index\n @offices = Office.where(\"user_id = ?\", current_user).order('created_at DESC').page(params[:page])\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @offices }\n end\n end",
"def index\n @orders = Order.search(current_user, params[:customer_id]).paginate(:per_page => current_user.profile.orders_per_page, :page => params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.js # index.js.erb\n format.xml { render :xml => @orders }\n end\n end",
"def index\n @orders = index_resources\n respond_with(@orders)\n end",
"def orders\n authenticated_post(\"auth/r/orders\").body\n end",
"def destroy\n @report_orders_by_user.destroy\n respond_to do |format|\n format.html { redirect_to report_orders_by_users_url, notice: 'Report orders by user was successfully destroyed.' }\n format.json { head :no_content }\n end\n end"
] | [
"0.74549145",
"0.6940636",
"0.6805924",
"0.67801607",
"0.6735814",
"0.6698921",
"0.6564662",
"0.6469378",
"0.646403",
"0.64369553",
"0.642714",
"0.6426518",
"0.64190584",
"0.6406126",
"0.6399302",
"0.63771755",
"0.63243294",
"0.6317526",
"0.6313019",
"0.63079965",
"0.63002",
"0.6276106",
"0.6270139",
"0.62353975",
"0.62317985",
"0.622749",
"0.62216914",
"0.6219591",
"0.61989945",
"0.6196354",
"0.61901015",
"0.61833954",
"0.6161966",
"0.61601126",
"0.61550725",
"0.6150498",
"0.6143387",
"0.61431414",
"0.6106636",
"0.6106601",
"0.60892683",
"0.6081068",
"0.6068031",
"0.60595566",
"0.60527474",
"0.60402703",
"0.6039606",
"0.6039606",
"0.6021544",
"0.6011028",
"0.60096294",
"0.59952074",
"0.59926903",
"0.59916896",
"0.59745353",
"0.5974352",
"0.59708655",
"0.59691966",
"0.5957297",
"0.594591",
"0.59444034",
"0.59353083",
"0.5928758",
"0.5913332",
"0.5910332",
"0.5909396",
"0.5906621",
"0.5905531",
"0.5896743",
"0.58855575",
"0.58838934",
"0.58833694",
"0.58833694",
"0.58833694",
"0.58833694",
"0.588327",
"0.5880907",
"0.5878772",
"0.5877619",
"0.5866017",
"0.58549905",
"0.58502406",
"0.58483636",
"0.5840118",
"0.58359337",
"0.5828718",
"0.581217",
"0.5794514",
"0.57942206",
"0.57936084",
"0.57853067",
"0.5781909",
"0.5776794",
"0.5773225",
"0.5770852",
"0.57676363",
"0.57649624",
"0.5759947",
"0.57596874",
"0.5757689"
] | 0.6132172 | 38 |
POST /report_orders_by_users POST /report_orders_by_users.json | def create
@report_orders_by_user = ReportOrdersByUser.new(report_orders_by_user_params)
respond_to do |format|
if @report_orders_by_user.save
format.html { redirect_to @report_orders_by_user, notice: 'Report orders by user was successfully created.' }
format.json { render :show, status: :created, location: @report_orders_by_user }
else
format.html { render :new }
format.json { render json: @report_orders_by_user.errors, status: :unprocessable_entity }
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_report_orders_by_user\n @report_orders_by_user = ReportOrdersByUser.find(params[:id])\n end",
"def report_orders_by_user_params\n params.require(:report_orders_by_user).permit(:date_start, :date_end, :file_path)\n end",
"def index\n @report_orders_by_users = ReportOrdersByUser.all\n end",
"def user_report\n user = User.find_by_username(params[:username])\n raise Discourse::InvalidParameters.new(:username) if !user\n\n ignored_ids = DiscourseFingerprint.get_ignores(user)\n\n fingerprints =\n Fingerprint\n .where(user: user)\n .where.not(value: FlaggedFingerprint.select(:value).where(hidden: true))\n .order(updated_at: :desc)\n\n user_ids =\n Fingerprint\n .matches\n .where(value: fingerprints.pluck(:value))\n .to_h { |match| [match.value, match.user_ids - [user.id]] }\n\n users = User.where(id: user_ids.values.flatten.uniq).or(User.where(id: ignored_ids))\n\n render json: {\n user: BasicUserSerializer.new(user, root: false),\n ignored_ids: ignored_ids,\n fingerprints:\n serialize_data(fingerprints, FingerprintSerializer, scope: { user_ids: user_ids }),\n users: users.map { |u| [u.id, BasicUserSerializer.new(u, root: false)] }.to_h,\n }\n end",
"def show_orders\n @user = User.find_by_sql [\"select * from users where email = ? and users.status = 'admin'\", params[:email]]\n if @user.count != 0\n @orders = UsersOrder.find_by_sql [\"select users_orders.id, users.email, books.title, books.genre from users_orders\n LEFT JOIN users ON users_orders.user_id = users.id\n LEFT JOIN books ON users_orders.book_id = books.id where users_orders.status = ? ORDER BY users_orders.created_at ASC\", params[:status]]\n end\n render json: @orders\n end",
"def index\n @user = User.find(params[:user_id])\n @orders = User.find(params[:user_id]).orders\n end",
"def create\n @order = Order.new(order_params)\n @order.status=\"waiting\"\n if params[:userid]\n users=User.find(params[:userid])\n @order.users<<(users)\n @order.user_id=current_user.id\n end\n \n \n\n \n# render plain: params[:userid]\n respond_to do |format|\n if !users\n format.html { redirect_to request.referer, alert: 'No Users Detected!' }\n format.json { render json: @order.errors, status: :unprocessable_entity }\n\n elsif @order.save\n users.each do |x| \n n=Notification.find_by({user_id:x.id,order_id:@order.id}); \n n.body=\"the #{current_user.email} add #{x.email} To0o this order\";\n n.status=\"bending\";\n n.save\n end\n @activity=\"order for \"+@order.order_for+\" from \"+@order.from\n Activite.create(action:@activity,user:current_user)\n flash[:success] = 'Order was successfully created.'\n format.html { redirect_to @order}\n format.json { render :show, status: :created, location: @order }\n else\n format.html { render :new }\n format.json { render json: @order.errors, status: :unprocessable_entity }\n end\n end\n end",
"def questionnaire_report_by_users\r\n\r\n range = @when_start .. @when_end\r\n activity_id = Activity.get_activity('submit questionnaire_answer').id\r\n\r\n user_activities = UserActivity.where(:activity_id => activity_id).where(:created_at => range).joins(:user).all\r\n users = {}\r\n user_activities.each do |au|\r\n unless users[au.user.email]\r\n users[au.user.email] = {:user => \"#{au.user.email} #{au.user.first_name} #{au.user.last_name}\", attendance: {}}\r\n end\r\n users[au.user.email][:attendance][au.created_at.to_date] = true\r\n end\r\n\r\n users\r\n end",
"def create\n @user = current_user\n @order = @user.order.new(order_params)\n respond_to do |format|\n if @order.save\n group_params['group_ids'].each do |g|\n gu = GroupUser.where(group_id: g)\n gu.each do |u|\n @u = User.find(u.user_id)\n @u.orders << Order.find(@order.id)\n end\n end\n\n format.html { redirect_to orders_path, notice: 'Order was successfully created.' }\n # format.json { render :show, status: :created, location: @order }\n else\n format.html { render :new }\n # format.json { render json: @order.errors, status: :unprocessable_entity }\n end\n end\n end",
"def index\n @user = current_user.id\n @users = User.order(sort_column + \" \" + sort_direction)\n respond_to do |format|\n format.html\n format.csv { render text: @users.to_csv }\n format.pdf do\n pdf = ReportPdf.new(@users)\n send_data pdf.render, filename: 'Report-'+ Time.now.strftime(\"%d/%m/%Y\") +'.pdf', type: 'application/pdf'\n end\n end\n end",
"def single_customer_reports\n @id = params[:id] # stores customer id\n @user = User.find(@id)\n start_date = params[:start_date]\n if (start_date.nil?)\n @date_arr = @user.orders.all\n else\n end_date = params[:end_date]\n @date_arr = []\n @user.orders.each do |order|\n if (order.date.strftime(\"%Y-%m-%d\").to_date >= start_date.to_date && order.date.strftime(\"%Y-%m-%d\").to_date <= end_date.to_date)\n @date_arr.push(order)\n end\n end\n end\n end",
"def post_users(users)\n self.class.post('https://api.yesgraph.com/v0/users', {\n :body => users.to_json,\n :headers => @options,\n })\n end",
"def get_log_out_users_orders\n orders_details = []\n orders = Order.where(user_id: nil)\n\n orders.each do |order|\n bufor = []\n order_price = 0\n orders_products = OrdersProduct.where(order_id: order.id)\n\n # I need do it because I need to know product price, desc etc not only quantity and id\n orders_products.each do |order_product| \n product = Product.find(order_product.product_id)\n\n order_price += (product.price * order_product.quantity)\n \n bufor.push({\n product_description: product.description,\n product_price: product.price,\n quantity: order_product.quantity\n })\n end\n\n data_creation = order.dataCreation\n data = \"#{data_creation.year}:#{data_creation.month}:#{data_creation.day} #{data_creation.hour}:#{data_creation.minute}:#{data_creation.second}\"\n\n orders_details.push({\n dataPerson: order.dataPerson,\n deliveryAddress: order.deliveryAddress,\n dataCreated: data,\n details: bufor,\n orderPrice: order_price,\n orderID: order.id\n })\n end\n\n render json: orders_details\n end",
"def get_user_report\n service_response = AdminManagement::Report::User.new(params).perform\n render_api_response(service_response)\n end",
"def orders\n authenticated_post(\"auth/r/orders\").body\n end",
"def attendance_report_by_users\r\n range = @when_start.beginning_of_day .. @when_end.end_of_day\r\n activity = Activity.get_activity 'submit questionnaire_answer'\r\n\r\n result = []\r\n\r\n if @users_group_id != 0\r\n # :include => [:user, {:user => :activities}]\r\n userlist = UserList.where(:users_group_id => @users_group_id).includes([:user, {:user => :activities}])\r\n userlist.all().each { |ul|\r\n unless ul.user.nil?\r\n ul.user.first_name = ul.first_name\r\n ul.user.last_name = ul.last_name\r\n user = ul.user\r\n has_user = true\r\n else\r\n user = ul\r\n has_user = false\r\n end\r\n result << fill_in_months_4user(user, range, activity.id, has_user)\r\n }\r\n else\r\n # All users\r\n User.all(:include => :user_activities).each { |user|\r\n result << fill_in_months_4user(user, range, activity.id)\r\n }\r\n end\r\n\r\n result.sort_by { |u|\r\n [\r\n order_by_total == 1 ? 100-u.total_attended : u.status,\r\n u.status,\r\n u.user[:last_name] ? u.user[:last_name] : '',\r\n u.user[:first_name] ? u.user[:first_name] : '',\r\n u.user[:email] ? u.user[:email] : '',\r\n 100-u.total_attended,\r\n ]\r\n }\r\n end",
"def create\n @order = current_user.orders.build(order_params)\n @orderUser = @order.order_users.build(:user_id => current_user.try(:id) , :status => 1)\n respond_to do |format|\n if @order.save && @orderUser.save\n format.html { redirect_to @order, notice: 'Order was successfully created.' }\n format.json { render :show, status: :created, location: @order }\n else\n format.html { render :new }\n format.json { render json: @order.errors, status: :unprocessable_entity }\n end\n end\n end",
"def export\n send_data current_user.records.select(:json).order('updated_at desc').collect(&:json).to_json, filename: 'records.json'\n end",
"def student_all_report\n @user = User.find(params[:id])\n report = StringIO.new\n CSV::Writer.generate(report, ',') do |csv|\n #Get Words\n @words = @user.word_answers.find(:all, :order => \"question_id ASC\")\n csv << %w(question answer date)\n @words.each do |answer|\n csv << [answer.word.value, answer.value, answer.created_at]\n end\n #Get Situations\n @situation_answers = @user.completion_answers.find(:all, :order => \"question_id ASC\")\n @situation_answers.each do |answer|\n csv << [answer.completion.value, answer.value, answer.created_at]\n end\n #Get Scenarios\n @scenario_answers = @user.scenario_answers.find(:all, :order => \"question_id ASC\")\n @scenario_answers.each do |answer|\n csv << [answer.scenario.value, answer.value, answer.created_at]\n end\n \n #Get posts\n @posts = @user.posts.find(:all, :order => \"created_at DESC\")\n @posts.each do |post|\n csv << [post.topic.title, post.body, post.created_at]\n end\n end\n export_as_csv(report,@user.whole_name+\"-all\")\n end",
"def orders\r\n\t\t@current_area = 'orders_report'\r\n\t\t@current_menu = 'reports'\r\n\r\n\t\tif request.post? || (request.get? && params[:page])\r\n\t\t\t@report_title = 'Orders'\r\n\t\t\tfilename = 'reports/orders'\r\n\t\t\t@criteria = [\"status='completed'\"]\r\n\r\n\t\t\t@page = (params[:page] || 1).to_i\r\n\t\t\t@items_per_page = 20\r\n\t\t\t@offset = (@page - 1) * @items_per_page\r\n\r\n\t\t\tif params[:start_date]\r\n\t\t\t\t@start_date = ffs_parse_date(params[:start_date])\r\n\r\n\t\t\t\t@criteria << \"(created_at >= '\" + @start_date.strftime('%Y-%m-%d') + \"')\"\r\n\t\t\t\tfilename += '-' + @start_date.strftime('%Y-%m-%d')\r\n\t\t\t\t@report_title += ': ' + @start_date.strftime('%d/%m/%Y')\r\n\t\t\tend\r\n\r\n\t\t\tif params[:end_date]\r\n\t\t\t\t# We want to show records that fall before the day after the end date\r\n\t\t\t\t@end_date = ffs_parse_date(params[:end_date])\r\n\t\t\t\tquery_end_date = @end_date + 1\r\n\r\n\t\t\t\t@criteria << \"(created_at <= '\" + query_end_date.strftime('%Y-%m-%d') + \"')\"\r\n\t\t\t\tfilename += '-to-' + @end_date.strftime('%Y-%m-%d')\r\n\t\t\t\t@report_title += ' to ' + @end_date.strftime('%d/%m/%Y')\r\n\t\t\telse\r\n\t\t\t\t@report_title += ' to present'\r\n\t\t\tend\r\n\r\n\t\t\t@order_count = Order.count(@criteria.join(' AND '))\r\n\t\t\t@pages = Paginator.new(self, @order_count, @items_per_page, @page)\r\n\t\t\t@orders = Order.find(\r\n\t\t\t\t:all,\r\n\t\t\t\t:conditions => @criteria.join(' AND '),\r\n\t\t\t\t:order => 'created_at DESC',\r\n\t\t\t\t:offset => params[:download] ? 0 : @offset,\r\n\t\t\t\t:limit => params[:download] ? nil : @items_per_page\r\n\t\t\t)\r\n\r\n\t\t\t# make Excel file if download is selected - otherwise render in page\r\n\t\t\tif params[:download]\r\n\t\t\t\t@rows = @orders.collect { |x| [ x.id, [x.created_at, :date], x.user.to_s, x.delivery_address ? x.delivery_address.country : x.billing_address.country, x.items.count, [x.total, :price] ] }\r\n\r\n\t\t\t\t@report_title += ' ' + Date.today.strftime('%d/%m/%Y')\r\n\t\t\t\tfilename += '.xls'\r\n\r\n\t\t\t\treport = Report.new filename\r\n\t\t\t\treport.write 0, 0, @report_title, :title\r\n\t\t\t\treport.write 1, 0, [ 'ID', 'Date', 'User', 'Country', 'Items', 'Total' ], :heading\r\n\t\t\t\treport.write_rows @rows\r\n\t\t\t\treport.close\r\n\r\n\t\t\t\t@headers['Expires'] = '0'\r\n\t\t\t\t@headers['Cache-Control'] = 'must-revalidate,post-check=0,pre-check=0'\r\n\t\t\t\t@headers['Pragma'] = 'public'\r\n\r\n\t\t\t\tsend_file filename, :type => 'application/vnd.ms-excel', :stream => false\r\n\t\t\t\tFile.delete filename\r\n\t\t\tend\r\n\t\telse\r\n\t\t\t@start_date = @end_date = Date.today\r\n\t\tend\r\n\tend",
"def create\n @order = @circle.orders.new(order_params)\n @order.circleName = @circle.name\n @order.requestUserName = @user.name\n respond_to do |format|\n if @order.save\n # filter users by circle id and loop through each use and send them an email\n UserMailer.order_placed_email(@user).deliver\n format.html { redirect_to @circle, notice: 'Order was successfully created.' }\n # format.json { render :show, status: :created, location: @order }\n else\n format.html { render :new }\n format.json { render json: @order.errors, status: :unprocessable_entity }\n end\n end\n end",
"def index\n @user_orders = UserOrder.all\n end",
"def create\n @user = User.all\n \n \n # @report = Report.new(report_params)\n\n # respond_to do |format|\n # if @report.save\n # format.html { redirect_to @report, notice: 'Report was successfully created.' }\n # format.json { render :show, status: :created, location: @report }\n # else\n # format.html { render :new }\n # format.json { render json: @report.errors, status: :unprocessable_entity }\n # end\n # end\n end",
"def index\n\n order_by = params[:order]\n\n if order_by\n order_by = \"users.name\" if order_by == \"salesperson\"\n @leads = Lead.includes(:user).order(order_by)\n else\n @leads = Lead.includes(:user).order(received_at: :desc)\n end\n @users = User.all\n\n respond_to do |format|\n format.html\n format.csv { send_data @leads.to_csv, filename: \"leadmailer-leads-#{Date.today}.csv\" }\n end\n\n @leads = Lead.all\n @leads = Lead.paginate(page: params[:page], per_page: 10)\n end",
"def create\n @order = Order.new(order_user_params)\n\n respond_to do |format|\n if @order.save && order_update_items && order_update_labels\n format.html { redirect_to @order, notice: 'Order was successfully created.' }\n format.json { render :show, status: :created, location: @order }\n else\n format.html { render :new }\n format.json { render json: @order.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n skip_authorization\n if !params[:from] && !params[:from]\n records = Record.where(:user_id => @current_user.id)\n else\n records = Record.where(\"user_id = ? and created_at >= ? and created_at <= ?\", @current_user.id, params[:from], params[:to])\n end\n\n records = records.select(\"date(created_at) as created_date, sum(distance) as distance,sum(time) as time,(sum(distance) / sum(time)) as average_speed\").group(\"created_date\")\n @filename = \"report-#{Date.today}.csv\"\n attributes = %w{created_date distance time}\n csvfile = CSV.generate(headers: true) do |csv|\n csv << attributes\n\n records.each do |data|\n csv << attributes.map{ |attr| data.send(attr)}\n end\n end\n\n render json:{ csvdata: csvfile}\n end",
"def destroy\n @report_orders_by_user.destroy\n respond_to do |format|\n format.html { redirect_to report_orders_by_users_url, notice: 'Report orders by user was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def create\n @order = Order.new(params[:order])\n respond_to do |format|\n if User.exists?(params[:order][:user_id])\n if @order.save\n format.html { redirect_to @order, notice: 'Order was successfully created.' }\n format.json { render json: @order, status: :created, location: @order }\n else\n format.html { render action: \"new\" }\n format.json { render json: @order.errors, status: :unprocessable_entity }\n end\n else\n format.html { render action: \"new\" }\n format.json { render json: @order.errors, status: :unprocessable_entity }\n end\n end\n end",
"def show\n @order = Order.find(params[:id])\n @users = []\n\n @order.groupas.each do |ga|\n ga.groupa_users.each do |u|\n @users << u.user if u.user\n end\n end\n @order.groupbs.each do |gb|\n gb.groupb_users.each do |u|\n @users << u.user if u.user\n end\n end\n @order.groupcs.each do |gc|\n gc.groupc_users.each do |u|\n @users << u.user if u.user\n end\n end\n @users << @order.user\n @users.uniq!\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @order }\n end\n end",
"def create\n @order = current_user.orders.build(params[:order])\n\n respond_to do |format|\n if @order.save\n format.html { redirect_to(@order, :notice => 'Order was successfully created.') }\n format.js {\n @orders = Order.search(current_user, nil).paginate(:per_page => current_user.profile.orders_per_page, :page => params[:page])\n } # create.js.erb\n format.xml { render :xml => @order, :status => :created, :location => @order }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @order.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def index\n page = params[:page] || 1\n page_size = params[:page_size] || 8\n\n @orders = Order.all.includes(:user).where(user: @current_user)\n @orders = @orders.order(created_at: :desc).offset(page_size * (page - 1)).limit(page_size)\n @orders_count = @orders.count\n @dto = OrderListDto.new(@orders, @orders_count, self.request.path, page, page_size)\n render json: @dto, status: :created\n end",
"def create\n @order = Order.new(order_params)\n @order.user_id = $user_id \n \n\n #validate user_id includes in friend_list of user #not yet\n\n #add user to order_users\n\n if @order.save\n # @order_users.order_id = @order.id\n @invited_friends = []\n @auth_user = User.find_by_id($user_id)\n\n #invaite friends to order\n puts json: order_users_params[:users]\n order_users_params[:users].each do |order_user|\n\n if(@auth_user.friends.where(friend_id: order_user[:user_id]).length > 0 )\n @order_user = OrderUser.new(user_id: order_user[:user_id] ,order_id: @order.id)\n @invited_friends.push (User.find(order_user[:user_id]) )\n @order_user.save \n \n \n @notif = Notification.create(user_id: order_user[:user_id], notif_type: \"invite\", \n order_finished: false, order_id: @order[:id],\n name: @auth_user.name, viewed: false)\n p @notif\n if @notif.save\n ActionCable.server.broadcast \"notifications_#{friend}\",{\n notif_type: \"invite\",\n order_id: @order[:id],\n name: @auth_user.name\n } \n \n end\n end\n\n end\n\n #convert group to users if group\n order_users_params[\"groups\"].each do |group|\n # @group = Group.find(group[\"group_id\"])\n @group_details = GroupDetail.where(group_id: group[\"group_id\"])\n #get all group memebers and add them to this order\n @group_details.each do |group_record|\n @invited_friends.push( group_record.user )\n @order_user = OrderUser.new(user_id: group_record.user.id ,order_id: @order.id)\n @order_user.save \n end \n end\n\n #optimize this query\n @all_users = User.all\n @all_users.each { |u|\n #send notif to all users that has order owner as a friend \n if Friend.where(user_id: u[:id] , friend_id: $user_id).length > 0\n ActionCable.server.broadcast \"activities_#{u.id}\",{\n order_id: @order[:id],\n name: @auth_user.name,\n restaurant: @order.restaurant_name,\n } \n end\n }\n\n\n\n render json: {message:\"success\"} #[order: @order,invited_friends: @invited_friends], status: :created, location: @order\n else\n render json: @order.errors, status: :unprocessable_entity\n end\n end",
"def update\n respond_to do |format|\n if @report_orders_by_user.update(report_orders_by_user_params)\n format.html { redirect_to @report_orders_by_user, notice: 'Report orders by user was successfully updated.' }\n format.json { render :show, status: :ok, location: @report_orders_by_user }\n else\n format.html { render :edit }\n format.json { render json: @report_orders_by_user.errors, status: :unprocessable_entity }\n end\n end\n end",
"def index\n\n # render :json => users.to_json(include: :reports)\n\n reports = current_user.reports\n # render :json => reports\n\n render :json => reports.to_json(include: :inputs)\n end",
"def index\n @orders = Order.order(\"id DESC\").page(params[:page])\n\n if params[:user_id]\n @orders = @orders.where(:user_id => params[:user_id])\n end\n\n if Rails.configuration.orders_status.select{|k, v| v[:real]}.keys.include? params[:status]\n @orders = @orders.where(:status => params[:status])\n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @orders }\n end\n end",
"def index\n @orders = orders_for_user.order(created_at: :desc)\n end",
"def charts_data_for(user)\n charts_data = {}\n\n ### chart user hours ### \n\n # time period\n from = user.registered_at.to_date\n to = Time.now.to_date + 1.week\n charts_data[:user_hours_from] = from \n charts_data[:user_hours_to] = to\n\n # prepare data \n charts_data[:user_hours] = groups_total_hours(current_user.records, from, to, 30) \n\n ### chart user submission ###\n\n # time period\n from = Time.now.to_date.prev_month\n to = Time.now.to_date \n charts_data[:user_submission_from] = from \n charts_data[:user_submission_to] = to\n\n # prepare data \n user_submission = []\n user.projects.each do |project|\n # records are grouped with project\n records = project.records.where(\"records.created_at >= ? and user_id = ?\", from, user.id)\n records.each do |record|\n user_submission << {project: project.name, date: record.created_at.to_date, \n time: record.created_at.strftime(\"%H-%M-%S\"), hours: record.hours}\n end\n end\n charts_data[:user_submission] = user_submission\n \n charts_data.to_json\n end",
"def employee_repair_orders_index\n\n @employee = current_employee_user.id\n\n @employee_repair_orders = current_business_user.employee_users_repair_orders.where(\n employee_user_id: @employee )\n if @employee_repair_orders\n render json: { employee_repair_orders: @employee_repair_orders.as_json(include: [\n :repair_order,\n :client,\n :vehicle]) },\n status: :ok\n else\n render json: { employee_repair_orders: @employee_repair_orders.errors.full_messages },\n status: :unprocessable_entity\n end\n end",
"def sales\n @orders = Order.where(seller: current_user).order(\"created_at DESC\").paginate(:page => params[:page], :per_page => 48)\n respond_to do |format|\n format.html\n format.csv { send_data @orders.to_csv(@orders) } \n end\n end",
"def order_user_params\n params.require(:order).permit(:user_id)\n end",
"def date_reports\n # Parámetros de búsqueda\n @date_start = params[:date_start]\n @date_end = params[:date_end]\n @product_id = params[:product_id]\n @order_type = params[:order_type]\n @product_category = params[:product_category]\n\n # Nombre del producto en caso exista\n @product_name = @product_id.blank? ? '' : Product.find(@product_id).name\n\n # Parámetros de ordenamiento\n @ob_product_name = params[:ob_product_name]\n @ob_product_category = params[:ob_product_category]\n @ob_amount = params[:ob_amount]\n\n @results = Array.new\n\n respond_to do |format|\n format.html do\n if params.length > 3\n @results = OrderDetail.search(params)\n end\n end\n\n format.json {render json: @orders_r}\n format.csv do\n\n @results = OrderDetail.search(params)\n logger.debug \"Parametros\" if params.empty?\n report_csv = CSV.generate(encoding: \"UTF-8\") do |csv|\n csv << ['# de Orden', 'Producto', 'Categoria', 'Cantidad', 'Unidades', 'TipoOrden', 'PrecioTotal']\n\n @results.each do |r|\n order = r.order_id\n productname = r.product.name\n productcat = r.product.category\n quantity = r.quantity\n unidad = r.product.units\n mode = r.order.order_type_text\n var = r.quantity*r.product.price\n precio = var\n\n @row = Array.new\n @row << order\n @row << productname\n @row << productcat\n @row << quantity\n @row << unidad\n @row << mode\n @row << precio\n csv << @row\n end\n end\n filename = \"report.csv\"\n send_data report_csv, :disposition => \"atachment;filename=#{filename}\"\n end\n end\n end",
"def index_by_user\n # find the user by username\n user = User.find_by(username: params[:user_id])\n # find the fills by user.id\n @fills = Fill.where(user_id: user.id)\n render json: @fills, include: ['user', 'prompt', 'comments.user', 'comments.user.id', 'comments.user.username']\n end",
"def create\n @users_xorder = UsersXorder.new(users_xorder_params)\n\n respond_to do |format|\n if @users_xorder.save\n format.html { redirect_to @users_xorder, notice: 'Users xorder was successfully created.' }\n format.json { render :show, status: :created, location: @users_xorder }\n else\n format.html { render :new }\n format.json { render json: @users_xorder.errors, status: :unprocessable_entity }\n end\n end\n end",
"def show_user_reports\n reports = User.find(params[:id]).reports\n render :json => reports\n end",
"def show\n @report = @report_orders_by_user.gen_report.each(:as => :hash)\n\n respond_to do |format|\n format.html\n format.pdf do\n pdf = ReportOrdersByUsers.new(@report, view_context)\n send_data pdf.render, filename: \"report_orders_by_users.pdf\",\n type: \"application/pdf\",\n disposition: \"inline\"\n end\n end\n\n end",
"def index\n @orders = current_user.type == 'Referral' ? current_user.orders : Order\n @orders = @orders.success_order.page(params[:page]).per(100).order('orders.created_at DESC')\n end",
"def user_order_params\n params.require(:user_order).permit(:Username, :OrderID, :Listofitems, :Total)\n end",
"def orders\n authenticated_post(\"orders\").body\n end",
"def create\n @users_order = Order.new(params[:order])\n respond_to do |format|\n if @users_order.save\n format.html { redirect_to [:users, @users_order], notice: 'Order was successfully created.' }\n else\n format.html { render action: \"new\" }\n end\n end\n end",
"def repair_order_employees_create\n @business_id = current_business_user.id\n @client_id = current_client.id\n @vehicle_id = current_vehicle.id\n\n @employee_repair_order = current_repair_order.employee_users_repair_orders.new(\n business_user_id: @business_id,\n client_id: @client_id,\n vehicle_id: @vehicle_id,\n employee_user_id: params[:id])\n\n\n if @employee_repair_order.save\n render json: {employee_repair_order: @employee_repair_order.as_json(include: [:repair_order, :vehicle, :client])},\n status: :created\n else\n render json: { errors: @employee_repair_order.errors.full_messages },\n status: :unprocessable_entity\n end\n end",
"def customers\r\n\t\t@current_area = 'customers_report'\r\n\t\t@current_menu = 'reports'\r\n\r\n\t\tif request.post? || (request.get? && params[:page])\r\n\t\t\t@report_title = 'Customers'\r\n\t\t\tfilename = 'reports/customers'\r\n\t\t\t# Filter out the demo admin. This should only need to happen when demo mode is enabled.\r\n\t\t\t# We re-check the config here as the @demo_user is tested against the currently-logged-in user.\r\n\t\t\tdemo_admin_local = !(!@configurator[:demo] or !@configurator[:demo][:enabled] or !@configurator[:demo][:enabled][:value])\r\n\t\t\t@criteria = demo_admin_local ? ['email <> \\'' + @configurator[:demo][:user][:value] + '\\''] : ['1']\r\n\r\n\t\t\t@page = (params[:page] || 1).to_i\r\n\t\t\t@items_per_page = 20\r\n\t\t\t@offset = (@page - 1) * @items_per_page\r\n\r\n\t\t\t@user_count = User.count(@criteria.join(' AND '))\r\n\t\t\t@pages = Paginator.new(self, @user_count, @items_per_page, @page)\r\n\t\t\t@users = User.find(\r\n\t\t\t\t:all,\r\n\t\t\t\t:conditions => @criteria.join(' AND '),\r\n\t\t\t\t:order => 'last_name ASC, first_name ASC',\r\n\t\t\t\t:offset => params[:download] ? 0 : @offset,\r\n\t\t\t\t:limit => params[:download] ? nil : @items_per_page\r\n\t\t\t)\r\n\r\n\t\t\t# make Excel file if download is selected - otherwise render in page\r\n\t\t\tif params[:download]\r\n\t\t\t\t@rows = @users.collect { |x| [ x.id, x.first_name, x.last_name, x.email, c = x.orders.count, x.orders.inject(0) { |sum, o| sum + o.items.inject(0) { |i_total, i| i_total + i.quantity } }, [ t = x.orders.inject(0.0) { |sum, o| sum + o.total }, :price ], [ (c > 0 ? t / c : 0.0), :price ] ] }\r\n\r\n\t\t\t\t@report_title += ' ' + Date.today.strftime('%d/%m/%Y')\r\n\t\t\t\tfilename += '.xls'\r\n\r\n\t\t\t\treport = Report.new filename\r\n\t\t\t\treport.write 0, 0, @report_title, :title\r\n\t\t\t\treport.write 1, 0, [ 'ID', 'First Name', 'Last Name', 'Email', 'Orders', 'Items', 'Total', 'Average' ], :heading\r\n\t\t\t\treport.write_rows @rows\r\n\t\t\t\treport.close\r\n\r\n\t\t\t\t@headers['Expires'] = '0'\r\n\t\t\t\t@headers['Cache-Control'] = 'must-revalidate,post-check=0,pre-check=0'\r\n\t\t\t\t@headers['Pragma'] = 'public'\r\n\r\n\t\t\t\tsend_file filename, :type => 'application/vnd.ms-excel', :stream => false\r\n\t\t\t\tFile.delete filename\r\n\t\t\tend\r\n\t\telse\r\n\r\n\t\tend\r\n\tend",
"def customer_report_params_create\n defaults = { user_id: current_user.id}\n params.permit(:report_date, :description, :token, :report_state, :report_code, :count, :customer_id, :contact_id, :user_id, :cost_center_id, :email, :update_user, :report_ids => []).reverse_merge(defaults)\n end",
"def userrequests\n @requests = Request.where(user_id: params[:user_id])\n render json: { total: @requests.size, requests: @requests.as_json(:methods => [:is_republishable] ) }, status: 200\n end",
"def view_log\n transactions = Transaction.sort_user_transactions(params[:user_id]) # sort by created_date\n render json: transactions, each_serializer: TransactionShowSerializer\n end",
"def index\n @reports = Report.user_reports(current_user).order('created_at DESC').paginate(page: params[:page], per_page: 10)\n @report = Report.new(report_params)\n end",
"def orders\n params = { command: 'account_orders' }\n get('/json.php', params)\n end",
"def create\n @order = Order.new(attach_owner_user_id(order_params))\n respond_to do |format|\n if @order.save\n format.html { redirect_to @order, notice: 'Order was successfully created.' }\n format.json { render :show, status: :created, location: @order }\n else\n format.html { render :new }\n format.json { render json: @order.errors, status: :unprocessable_entity }\n end\n end\n end",
"def index\n\t\t@orders = Order.includes(:user).paginate(page: params[:page], per_page: 10).order(order_date: :desc)\n\tend",
"def create\n @user = current_user\n @report = @user.reports.build\n @report.attributes = params[:report]\n\n respond_to do |format|\n if @user.save\n format.html { redirect_to @report, notice: 'Report was successfully created.' }\n format.json { render json: @report, status: :created, location: @report }\n else\n format.html { render action: \"new\" }\n format.json { render json: @report.errors, status: :unprocessable_entity }\n end\n end\n end",
"def order_params\n params.require(:order).permit(:user_id, :status, :orderType, :orderFrom, :image, :user_ids => [])\n end",
"def create\n\n @order = Order.new(order_params)\n\n respond_to do |format|\n if @order.save && ( current_user ? @order.users << current_user : true )\n\n OrdersMailer.order_notification(@order, current_user).deliver_later\n\n # format.html { redirect_to @order, notice: 'Заявка была успешно создана.' }\n # format.html { redirect_to root_path, notice: 'Заявка была успешно создана.' }\n format.html { redirect_to (session[:return_to].blank? ? root_path : session[:return_to]), notice: 'Заявка была успешно создана.' } \n # format.html { redirect_back(fallback_location: root_path, notice: 'Заявка была успешно создана.') }\n format.json { render :show, status: :created, location: @order }\n else\n format.html { render :new }\n format.json { render json: @order.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @user_report = UserReport.new(:reported_user => params[:reported_id], :user_id=>current_user.id, :description => params[:description])\n\n respond_to do |format|\n if @user_report.save\n format.html { redirect_to request.referer, notice: 'User report was successfully created.' }\n format.json { render json: @user_report, status: :created, location: @user_report }\n else\n format.html { render action: \"new\" }\n format.json { render json: @user_report.errors, status: :unprocessable_entity }\n end\n end\n end",
"def index\n if current_user\n #User.find(current_user.id).orders.to_a +\n @pagy, @orders = pagy_array(Order.find_by_sql(\"SELECT order_type,restaurant,joined_num ,invited_num,status, orders.user_id, orders.id from orders, user_join_orders WHERE orders.id = user_join_orders.order_id AND user_join_orders.user_id = #{current_user.id}\"),items: 2)\n else\n redirect_to new_user_session_path, notice: 'You are not logged in.'\n end\n end",
"def create\n\n\t\tuser_email = params[:user_email].presence\n\t\tuser = user_email && User.find_by_email(user_email)\n\n\t\treport = Report.new(report_params)\n\t\treport.user_id = user.id\n\n\t\tif report.save\n\t\t\trender :json => {:success => true, :report_id => report.id }\n\t\telse\n\t\t\trender :json => '{\"success\" : \"false\", \"error\" : \"problem saving report\"}'\n\t\tend\n\tend",
"def create\n @order = current_user.orders.new(order_params)\n\n respond_to do |format|\n if @order.save\n format.html { redirect_to @order, notice: 'Order was successfully created.' }\n format.json { render :show, status: :created, location: @order }\n else\n format.html { render :new }\n format.json { render json: @order.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @order_user = OrderUser.new(order_user_params)\n\n respond_to do |format|\n if @order_user.save\n format.html { redirect_to @order_user, notice: 'Order user was successfully created.' }\n format.json { render :show, status: :created, location: @order_user }\n else\n format.html { render :new }\n format.json { render json: @order_user.errors, status: :unprocessable_entity }\n end\n end\n end",
"def report_bulk_users(custom_fields = false, filter = nil, sort = nil)\n res = query(\"report-bulk-users\", \"custom-fields\" => custom_fields, \"filter\" => filter, \"sort\" => sort)\n data = XmlSimple.xml_in(res.body)\n rows = []\n if data[\"report-bulk-users\"]\n data[\"report-bulk-users\"].each do |trans|\n rows = trans[\"row\"]\n end\n end\n return AdobeConnectAPI::Result.new(data[\"status\"][0][\"code\"], rows)\n end",
"def index # see model > order.rb\n # if current_user\n @orders = current_user.orders\n render \"index.json.jb\"\n # else\n # render json: [], status: :unauthorized\n # end\n end",
"def order_params\n params.require(:order).permit(:order_date, :status, :user_id)\n end",
"def users_xorder_params\n params.require(:users_xorder).permit(:idUsers, :idOrders)\n end",
"def create\n #set order and user differs slightly from majority of actions\n @order = Order.new(order_params)\n if @order.save\n @this_user.orders.push(@order)\n redirect_to @this_user, notice: \"Order saved\"\n else\n render action: 'new'\n end\n end",
"def stats_users\n call_path = \"status/userTypes\"\n request = \"\"\n data = build_post_data(request)\n perform_post(build_url(call_path), data)\n end",
"def index\n @orders = Order.user_orders current_user\n end",
"def reports\n @orders_r = @branch.orders.where(:date=> Date.today).order(\"created_at desc\")\n @order_close = @branch.orders.find_by_mode_and_date(\"4\",Date.today)\n\n respond_to do |format|\n format.html\n format.json {render json: @order}\n end\n end",
"def create\n @trip = Trip.new(trip_params)\n\n\n user_ids = params[:trip][:users_attributes]\n\n puts user_ids\n if not user_ids.nil?\n user_ids.keys().each do |k|\n user = User.find(user_ids[k][\"id\"])\n @trip.users << user if user_ids[k][\"_destroy\"] != \"1\" and not @trip.users.include? user\n end\n end\n\n\n respond_to do |format|\n if @trip.save\n format.html { redirect_to @trip, flash: {success: \"Trip was successfully created.\" } }\n format.json { render :show, status: :created, location: @trip }\n else\n format.html { render :new }\n format.json { render json: @trip.errors, status: :unprocessable_entity }\n end\n end\n end",
"def order_user_params\n params.require(:order_user).permit(:username, :orderID, :listOfItems)\n end",
"def customer_reports\n @users = User.where(\"role = ?\", \"user\")\n end",
"def create\n @user = User.find(params[:user_id])\n @report = @user.reports.create(report_params)\n @report.date = prepare_date(params[:date])\n prepare_report()\n @report.balance = @report_summary.working_hours_balance\n @report.workingHours = @report_summary.working_hours\n\n success = false\n begin\n if @report.save\n success = true\n end\n rescue ActiveRecord::RecordNotUnique\n flash[:alert] = I18n.t('controllers.reports.already_exists_for_date')\n end\n\n respond_to do |format|\n if success\n format.html { redirect_to [@report.user, @report], notice: I18n.t('controllers.reports.successfully_created') }\n format.json { render :show, status: :created, location: @report }\n else\n format.html { render :new }\n format.json { render json: @report.errors, status: :unprocessable_entity }\n end\n end\n end",
"def index\n @order_users = OrderUser.all\n end",
"def index\n @orders = current_user.orders.order(\"created_at DESC\")\n end",
"def create\n @order = Order.new(order_params)\n\n if @order.user.nil?\n respond_to do |format|\n flash.now[:notice] = \"O id informado não pertence a nenhum usuário.\"\n format.html { render :new } \n end\n\n return\n end \n\n if @order.user.user_type != 'customer'\n respond_to do |format|\n flash.now[:notice] = \"Comandas só estão disponíveis para usuários do tipo cliente.\"\n format.html { render :new } \n end\n\n return\n end\n\n if user_has_order_already\n respond_to do |format|\n flash.now[:notice] = \"Já existe uma comanda para o usuário: \" + @order.user.name + \".\"\n format.html { render :new } \n end\n\n return\n end\n\n respond_to do |format|\n if @order.save\n\n user = @order.user\n user.active = true\n user.save\n\n format.html { redirect_to @order, notice: 'A comanda foi criada com sucesso.' }\n format.json { render :show, status: :created, location: @order }\n else\n format.html { render :new }\n format.json { render json: @order.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n\t\tisuser = params[:order][:user_id]\n\t\tif isuser.nil?\n\t\t\t@user = current_user\n\t\telse\n\t\t\t@user = User.find_by(id: isuser.to_i)\n\t\tend\n\t\t@order = @user.orders.build(order_params)\n\t\t\n\t\tif @order.name.blank?\n\t\t\t@order.name = 'unnamed'\n\t\tend\n\t\t\n\t\tif @order.save\n\t\t\tflash[:success] = \"Order created!\"\n\t\t\tredirect_to @user and return\n\t\telse\n#\t\t\tdebugger\n\t\t\tflash[:danger] = \"Order failed, not saved\"\n\t\t\tredirect_to new_order_path and return # was render 'new'\n\t\tend\n\tend",
"def report\n search = params[:event_name].strip unless params[:event_name].nil?\n column = params[:column].nil? ? 'event_name' : params[:column]\n direction = params[:direction].nil? ? 'asc' : params[:direction]\n items = Event.my_order(column, direction).where(:creator_user_id => user_id).joins(participants: [:attendee_types]).merge(Participant.where :user_id => user_id).merge(AttendeeType.where :id => AttendeeType.director_id)\n .title_like(search).select(\"events.id AS event_id, events.title AS event_name, 0 AS net_income, \"+\n \"0 AS payment_recived,\"+\n \"0 AS account_balance\")\n .group(\"events.id\")\n json_response_serializer_collection items, AdminReportSerializer\n end",
"def all_users\n @date = (params[:date])? Date.parse(params[:date]) : Date.today\n users_ungroup = User.all(:conditions => {:status => User::STATUS_ACTIVE}, :order => 'login').sort\n @user_counts = users_ungroup.size\n @reported = false\n @daily_todo_users_group = Array.new\n @daily_todo_groups = Group.all().sort\n @daily_todo_groups.each do |group|\n users_of_group = group.users.sort_by { |u| u.name }\n no_todo_users, todo_users = users_of_group.partition do |user|\n DailyTodo.first(:conditions => {:user_id => user.id, :date => @date}).nil?\n end\n\n hash_users_of_group = {:todo => todo_users, :no_todo => no_todo_users}\n @daily_todo_users_group.push(hash_users_of_group)\n # Check if the current user has written todo for this date\n @reported = @reported || todo_users.any? { |user|\n user.id == User.current.id\n }\n\n users_of_group.each do |user_of_group|\n users_ungroup.delete_if do |user_ungroup|\n user_ungroup.id == user_of_group.id\n end\n end\n end\n\n no_todo_ungroup_users, todo_ungroup_users = users_ungroup.partition do |user|\n DailyTodo.first(:conditions => {:user_id => user.id, :date => @date}).nil?\n end\n @daily_todo_users_ungroup = {:todo => todo_ungroup_users, :no_todo => no_todo_ungroup_users}\n @reported = @reported || todo_ungroup_users.any? do |user|\n user.id == User.current.id\n end\n end",
"def order_params\n params.require(:order).permit(:user_id, :status)\n end",
"def create_hourly_report(url)\n @total_serv_time = 0\n @time_spent_g = 0\n @time_spent_p = 0\n @user_list = []\n @g_count = 0\n @p_count = 0\n @n = 1\n puts \"24 Hour Report for #{url}\"\n puts \"---------------------------------------------------------------------------------------------\"\n puts \"TH HOUR---# USER---# GET---# POST---TOTAL_TIME_GET(ms)---TOTAL_TIME_POST(ms)---TOTAL_TIME(ms)\"\n puts \"---------------------------------------------------------------------------------------------\"\n for n in 1..24\n $all_user_data.each do |k,v|\n if v[:th_hour] == n && !v[:uri].to_s.string_contains(url).nil? \n @total_serv_time += v[:time].to_i\n if v[:method] == 'G'\n @time_spent_g += v[:time].to_i\n @g_count += 1 \n end\n if v[:method] == 'P'\n @time_spent_p += v[:time].to_i\n @p_count += 1 \n end\n @user_list << v[:user].to_s\n end \n end\n #puts \"#{n}TH HOUR---#{@user_list.uniq.length} users---#{@g_count} GET REQs---#{@p_count} POST REQs---#{@time_spent_g}ms in GET---#{@time_spent_p}ms in POST---#{@total_serv_time}ms in Total\"\n puts \"#{n}TH HOUR---#{@user_list.length} users---#{@g_count} GET REQs---#{@p_count} POST REQs---#{@time_spent_g}ms in GET---#{@time_spent_p}ms in POST---#{@total_serv_time}ms in Total\"\n #pp @@user_list.uniq\n @total_serv_time = 0\n @time_spent_g = 0\n @time_spent_p = 0\n @g_count = 0\n @p_count = 0\n @user_list.clear\n end\n end",
"def index\n \n \n @clients = Client.all\n if current_user.role==\"Wholesaler\" && params[:user]\n if params[:fecha]\n #@orders=Order.where(:commerce => params[:user], 'DATE(created_at) = :se_fech')\n @orders = Order.where(\n 'DATE(created_at) = :fecha and commerce = :comercio_u',\n fecha: params[:fecha], comercio_u: params[:user]\n ).desc\n else\n @orders=Order.where(:commerce => params[:user])\n end\n \n elsif current_user.role==\"Admin\" || current_user.role==\"Transfer\"\n if params[:created_at]==\"true\"\n @orders = Order.where(created_at: Time.zone.now.beginning_of_day..Time.zone.now.end_of_day, status: params[:status]\n \n ).desc\n elsif params[:status]\n @orders = Order.where(\n 'status= :status',\n status: params[:status]\n ).desc\n else \n @orders = Order.all.desc\n #@orders = @orders.paginate(:page => 1, :per_page => 20)\n end\n \n if params[:search] && params[:valor_se]\n if params[:search] == \"Documento\"\n @orders = Order.where(\n 'document = :se_value',\n se_value: params[:valor_se]\n ).desc\n @orders = @orders.paginate(:page => 1, :per_page => 20)\n elsif params[:search] == \"Nombre\"\n @orders = Order.where(\n 'name = :se_value',\n se_value: params[:valor_se]\n ).desc\n #@orders = @orders.paginate(:page => 1, :per_page => 20)\n \n elsif params[:search] == \"Fecha\"\n @orders = Order.where(\n 'DATE(created_at) = :se_value',\n se_value: params[:valor_se]\n ).desc\n #@orders = @orders.paginate(:page => 1, :per_page => 20)\n \n end\n end\n \n elsif current_user.role==\"Commerce\" \n if params[:created_at]\n # @orders = Order.where(\n # 'created_at >= :today and commerce= :commerce',\n # :today => Time.now - 1.days, commerce: current_user.email\n #).desc\n #puts \"fskadljkjdfsalkjñasdfkñldjasfñldasfjdfaslñjasdflñkdsaffskadljkjdfsalkjñasdfkñldjasfñldasfjdfaslñjasdflñkdsaffskadljkjdfsalkjñasdfkñldjasfñldasfjdfaslñjasdflñkdsaffskadljkjdfsalkjñasdfkñldjasfñldasfjdfaslñjasdflñkdsaffskadljkjdfsalkjñasdfkñldjasfñldasfjdfaslñjasdflñkdsaffskadljkjdfsalkjñasdfkñldjasfñldasfjdfaslñjasdflñkdsaffskadljkjdfsalkjñasdfkñldjasfñldasfjdfaslñjasdflñkdsaffskadljkjdfsalkjñasdfkñldjasfñldasfjdfaslñjasdflñkdsaffskadljkjdfsalkjñasdfkñldjasfñldasfjdfaslñjasdflñkdsaffskadljkjdfsalkjñasdfkñldjasfñldasfjdfaslñjasdflñkdsaffskadljkjdfsalkjñasdfkñldjasfñldasfjdfaslñjasdflñkdsaffskadljkjdfsalkjñasdfkñldjasfñldasfjdfaslñjasdflñkdsaffskadljkjdfsalkjñasdfkñldjasfñldasfjdfaslñjasdflñkdsaffskadljkjdfsalkjñasdfkñldjasfñldasfjdfaslñjasdflñkdsaffskadljkjdfsalkjñasdfkñldjasfñldasfjdfaslñjasdflñkdsaffskadljkjdfsalkjñasdfkñldjasfñldasfjdfaslñjasdflñkdsaffskadljkjdfsalkjñasdfkñldjasfñldasfjdfaslñjasdflñkdsaffskadljkjdfsalkjñasdfkñldjasfñldasfjdfaslñjasdflñkdsaffskadljkjdfsalkjñasdfkñldjasfñldasfjdfaslñjasdflñkdsaffskadljkjdfsalkjñasdfkñldjasfñldasfjdfaslñjasdflñkdsaffskadljkjdfsalkjñasdfkñldjasfñldasfjdfaslñjasdflñkdsaffskadljkjdfsalkjñasdfkñldjasfñldasfjdfaslñjasdflñkdsaffskadljkjdfsalkjñasdfkñldjasfñldasfjdfaslñjasdflñkdsaffskadljkjdfsalkjñasdfkñldjasfñldasfjdfaslñjasdflñkdsaffskadljkjdfsalkjñasdfkñldjasfñldasfjdfaslñjasdflñkdsaffskadljkjdfsalkjñasdfkñldjasfñldasfjdfaslñjasdflñkdsaffskadljkjdfsalkjñasdfkñldjasfñldasfjdfaslñjasdflñkdsaffskadljkjdfsalkjñasdfkñldjasfñldasfjdfaslñjasdflñkdsaffskadljkjdfsalkjñasdfkñldjasfñldasfjdfaslñjasdflñkdsaffskadljkjdfsalkjñasdfkñldjasfñldasfjdfaslñjasdflñkdsaffskadljkjdfsalkjñasdfkñldjasfñldasfjdfaslñjasdflñkdsaffskadljkjdfsalkjñasdfkñldjasfñldasfjdfaslñjasdflñkdsaffskadljkjdfsalkjñasdfkñldjasfñldasfjdfaslñjasdflñkdsaffskadljkjdfsalkjñasdfkñldjasfñldasfjdfaslñjasdflñkdsaffskadljkjdfsalkjñasdfkñldjasfñldasfjdfaslñjasdflñkdsaffskadljkjdfsalkjñasdfkñldjasfñldasfjdfaslñjasdflñkdsaffskadljkjdfsalkjñasdfkñldjasfñldasfjdfaslñjasdflñkdsaffskadljkjdfsalkjñasdfkñldjasfñldasfjdfaslñjasdflñkdsaffskadljkjdfsalkjñasdfkñldjasfñldasfjdfaslñjasdflñkdsaffskadljkjdfsalkjñasdfkñldjasfñldasfjdfaslñjasdflñkdsaffskadljkjdfsalkjñasdfkñldjasfñldasfjdfaslñjasdflñkdsaffskadljkjdfsalkjñasdfkñldjasfñldasfjdfaslñjasdflñkdsaffskadljkjdfsalkjñasdfkñldjasfñldasfjdfaslñjasdflñkdsaffskadljkjdfsalkjñasdfkñldjasfñldasfjdfaslñjasdflñkdsaffskadljkjdfsalkjñasdfkñldjasfñldasfjdfaslñjasdflñkdsaffskadljkjdfsalkjñasdfkñldjasfñldasfjdfaslñjasdflñkdsaffskadljkjdfsalkjñasdfkñldjasfñldasfjdfaslñjasdflñkdsaffskadljkjdfsalkjñasdfkñldjasfñldasfjdfaslñjasdflñkdsaf\"\n @orders = Order.where(created_at: Time.zone.now.beginning_of_day..Time.zone.now.end_of_day, :commerce => current_user.email, :status => params[:status])\n else\n #puts \"fskadljkjdfsalkjñasdfkñldjasfñldasfjdfaslñjasdflñkdsaffskadljkjdfsalkjñasdfkñldjasfñldasfjdfaslñjasdflñkdsaffskadljkjdfsalkjñasdfkñldjasfñldasfjdfaslñjasdflñkdsaffskadljkjdfsalkjñasdfkñldjasfñldasfjdfaslñjasdflñkdsaffskadljkjdfsalkjñasdfkñldjasfñldasfjdfaslñjasdflñkdsaffskadljkjdfsalkjñasdfkñldjasfñldasfjdfaslñjasdflñkdsaffskadljkjdfsalkjñasdfkñldjasfñldasfjdfaslñjasdflñkdsaffskadljkjdfsalkjñasdfkñldjasfñldasfjdfaslñjasdflñkdsaffskadljkjdfsalkjñasdfkñldjasfñldasfjdfaslñjasdflñkdsaffskadljkjdfsalkjñasdfkñldjasfñldasfjdfaslñjasdflñkdsaffskadljkjdfsalkjñasdfkñldjasfñldasfjdfaslñjasdflñkdsaffskadljkjdfsalkjñasdfkñldjasfñldasfjdfaslñjasdflñkdsaffskadljkjdfsalkjñasdfkñldjasfñldasfjdfaslñjasdflñkdsaffskadljkjdfsalkjñasdfkñldjasfñldasfjdfaslñjasdflñkdsaffskadljkjdfsalkjñasdfkñldjasfñldasfjdfaslñjasdflñkdsaffskadljkjdfsalkjñasdfkñldjasfñldasfjdfaslñjasdflñkdsaffskadljkjdfsalkjñasdfkñldjasfñldasfjdfaslñjasdflñkdsaffskadljkjdfsalkjñasdfkñldjasfñldasfjdfaslñjasdflñkdsaffskadljkjdfsalkjñasdfkñldjasfñldasfjdfaslñjasdflñkdsaffskadljkjdfsalkjñasdfkñldjasfñldasfjdfaslñjasdflñkdsaffskadljkjdfsalkjñasdfkñldjasfñldasfjdfaslñjasdflñkdsaffskadljkjdfsalkjñasdfkñldjasfñldasfjdfaslñjasdflñkdsaffskadljkjdfsalkjñasdfkñldjasfñldasfjdfaslñjasdflñkdsaffskadljkjdfsalkjñasdfkñldjasfñldasfjdfaslñjasdflñkdsaffskadljkjdfsalkjñasdfkñldjasfñldasfjdfaslñjasdflñkdsaffskadljkjdfsalkjñasdfkñldjasfñldasfjdfaslñjasdflñkdsaffskadljkjdfsalkjñasdfkñldjasfñldasfjdfaslñjasdflñkdsaffskadljkjdfsalkjñasdfkñldjasfñldasfjdfaslñjasdflñkdsaffskadljkjdfsalkjñasdfkñldjasfñldasfjdfaslñjasdflñkdsaffskadljkjdfsalkjñasdfkñldjasfñldasfjdfaslñjasdflñkdsaffskadljkjdfsalkjñasdfkñldjasfñldasfjdfaslñjasdflñkdsaffskadljkjdfsalkjñasdfkñldjasfñldasfjdfaslñjasdflñkdsaffskadljkjdfsalkjñasdfkñldjasfñldasfjdfaslñjasdflñkdsaffskadljkjdfsalkjñasdfkñldjasfñldasfjdfaslñjasdflñkdsaffskadljkjdfsalkjñasdfkñldjasfñldasfjdfaslñjasdflñkdsaffskadljkjdfsalkjñasdfkñldjasfñldasfjdfaslñjasdflñkdsaffskadljkjdfsalkjñasdfkñldjasfñldasfjdfaslñjasdflñkdsaffskadljkjdfsalkjñasdfkñldjasfñldasfjdfaslñjasdflñkdsaffskadljkjdfsalkjñasdfkñldjasfñldasfjdfaslñjasdflñkdsaffskadljkjdfsalkjñasdfkñldjasfñldasfjdfaslñjasdflñkdsaffskadljkjdfsalkjñasdfkñldjasfñldasfjdfaslñjasdflñkdsaffskadljkjdfsalkjñasdfkñldjasfñldasfjdfaslñjasdflñkdsaffskadljkjdfsalkjñasdfkñldjasfñldasfjdfaslñjasdflñkdsaffskadljkjdfsalkjñasdfkñldjasfñldasfjdfaslñjasdflñkdsaffskadljkjdfsalkjñasdfkñldjasfñldasfjdfaslñjasdflñkdsaffskadljkjdfsalkjñasdfkñldjasfñldasfjdfaslñjasdflñkdsaffskadljkjdfsalkjñasdfkñldjasfñldasfjdfaslñjasdflñkdsaffskadljkjdfsalkjñasdfkñldjasfñldasfjdfaslñjasdflñkdsaf\"\n @orders = Order.where(commerce: current_user.email).desc\n end\n elsif current_user.role==\"Distributor\" \n if params[:fecha] && params[:user]\n #@orders=Order.where(:commerce => params[:user], 'DATE(created_at) = :se_fech')\n @orders = Order.where(\n 'DATE(created_at) = :fecha and commerce = :comercio_u',\n fecha: params[:fecha], comercio_u: params[:user]\n ).desc\n elsif params[:user]\n @orders=Order.where(:commerce => params[:user], :distributor => current_user.email)\n elsif params[:created_at]\n @orders = Order.where(\n 'created_at >= :today and distributor= :distributor',\n :today => Time.now - 1.days, distributor: current_user.email\n ).desc\n @orders = Order.where(created_at: Time.zone.now.beginning_of_day..Time.zone.now.end_of_day, :distributor => current_user.email)\n else\n @orders = Order.where(distributor: current_user.email).desc\n end\n else\n redirect_to home_index_url\n end\n \n @orders = @orders.paginate(:page => 1, :per_page => 20).desc\n end",
"def completed_orders\n orders = current_user.restaurant.orders.where(\"status = ? OR status = ? \", 7, 8)\n render json: orders, status: :ok\n end",
"def index\n @planned_orders = PlannedOrder.where(:user => current_user.email).all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @planned_orders }\n end\n end",
"def index\n @users = User.where(params[:sort] + \" <> ''\").order(params[:sort] + \" \" + params[:direction]).page params[:page]\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @users, :except => [:email] }\n end\n end",
"def by_user\r\n tweets = Tweet.where(user_id: params[:user_id])\r\n render json: tweets\r\n end",
"def create\n\t\tname = params[\"name\"]\n\t\temail_address = params[\"email_address\"]\n\t\tshipping_address = params[\"shipping_address\"]\n\t\torder_details = params[\"order_details\"]\n\t\treferred_by_id = params[\"referred_by_id\"]\n\t\tauth_token = params[\"auth_token\"]\n\t\t@current_user = User.find_by(email_address: email_address)\n\t\tif @current_user\n\t\t\tcheck = (referred_by_id == @current_user.referral_id)\n\t\t\tif check\n\t\t\t\terror_message = [\"Invalid referred by id. Can't use your own referral id\"]\n\t\t\telse\n\t\t\t\t@user = User.authenticate_user(auth_token, email_address)\n\t\t\t\t@check_if_referrer_exists = User.find_by(referral_id: referred_by_id)\n\t\t\t\tif referred_by_id.blank? || @check_if_referrer_exists\n\t\t\t\t\tif @user\n\t\t\t\t\t\t@order = Order.new(name: name, email_address: email_address, shipping_address: shipping_address, order_details: order_details, referred_by: referred_by_id, user_id: @user.id)\n\t\t\t\t\telse\n\t\t\t\t\t\terror_message = [\"User authentication failed\"]\n\t\t\t\t\tend\n\t\t\t\telse\n\t\t\t\t\terror_message = [\"Invalid referral id.\"]\n\t\t\t\tend\n\t\t\tend\n\t\telse\n\t\t\terror_message = [\"Need to create user first\"]\n\t\tend\n\n\n\t\trespond_to do |format|\n\t\t\tif (@order && @order.save)\n\t\t\t\tformat.html { redirect_to @order, notice: 'Order was successfully created.' }\n\t\t\t\tformat.json { render json: {\n\t\t\t\t\t\turls: {\n\t\t\t\t\t\t\tedit_link: (url_for :controller => 'orders', :action => 'edit', :id => @order.id),\n\t\t\t\t\t\t\tdelete_link: (url_for :controller => 'orders', :action => 'delete', :id => @order.id),\n\t\t\t\t\t\t\treferral_link: (url_for :controller => 'orders', :action => 'referral', :id => @order.id, :referred_by_id => @order.user.referral_id)\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\telse\n\t\t\t\tformat.html { render :new }\n\t\t\t\tformat.json { render json: {\n\t\t\t\t\t\terrors: error_message\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\tend\n\t\tend\n\tend",
"def index# not :post order. this is a :get index of previous orders.\n @orders = current_refinery_user.orders.order('created_at DESC')\n end",
"def sent_invitations\n user = User.find(params[:user_id])\n @invitations = Invitation.created_by_user(user)\n\n render json: @invitations\n end",
"def order_params\n params.require(:order).permit( :order_date, :user_id, :status)\n end",
"def tickets_report\n manage_filter_state\n id = params[:Id]\n user = params[:User]\n office = params[:OfficeT]\n from = params[:From]\n to = params[:To]\n category = params[:Category]\n priority = params[:Priority]\n status = params[:Status]\n technician = params[:Technician]\n destination = params[:Destination]\n # OCO\n init_oco if !session[:organization]\n\n search = Ticket.search do\n fulltext params[:search]\n if session[:organization] != '0'\n with :organization_id, session[:organization]\n end\n if !id.blank?\n with :id, id\n end\n if !user.blank?\n with :created_by, user\n end\n if !office.blank?\n with :office_id, office\n end\n if !from.blank?\n any_of do\n with(:created_at).greater_than(from)\n with :created_at, from\n end\n end\n if !to.blank?\n any_of do\n with(:created_at).less_than(to)\n with :created_at, to\n end\n end\n if !category.blank?\n with :ticket_category_id, category\n end\n if !priority.blank?\n with :ticket_priority_id, priority\n end\n if !status.blank?\n with :ticket_status_id, status\n end\n if !technician.blank?\n with :technician_id, technician\n end\n if !destination.blank?\n with :hd_email, destination\n end\n order_by :id, :desc\n paginate :page => params[:page] || 1, :per_page => Ticket.count\n end\n\n @tickets_report = search.results\n\n if !@tickets_report.blank?\n title = t(\"activerecord.models.ticket.few\")\n @to = formatted_date(@tickets_report.first.created_at)\n @from = formatted_date(@tickets_report.last.created_at)\n respond_to do |format|\n # Render PDF\n format.pdf { send_data render_to_string,\n filename: \"#{title}_#{@from}-#{@to}.pdf\",\n type: 'application/pdf',\n disposition: 'inline' }\n end\n end\n end",
"def all_index\n\n @options = {holidays: Rails.configuration.holidays, weekdays: Rails.configuration.weekdays}\n @date = params[:date] ? Date.parse(params[:date]) : Date.current\n @order_date = params[:order_date] ? Date.parse(params[:order_date]) : Date.current\n @all_orders = Order.includes(:user, :menu, :course_type).where(\"order_date='#{@order_date}' \").order(:user_id, :course_type_id)\n currency_id = @all_orders.first ? @all_orders.first.menu.currency_type_id : CurrencyType.first.id\n @currency_name = CurrencyType.find_by_id(currency_id).name\n @all_sum = 0.00\n if @all_orders.size > 0\n sum = Order.select(\"sum(menus.cost) as all_sum\").joins(\"JOIN menus on orders.menu_id = menus.id\").where(\"order_date='#{@order_date}' \").order(\"all_sum\")\n @all_sum = sum.first.all_sum\n end\n\n \n @users = User.all.sort\n\n @all_orders_by_user_id = @all_orders.group_by(&:user_id)\n\n\n respond_to do |format|\n format.html {render 'all_index'}\n \n format.js\n end\n end",
"def index\n records = policy_scope(Record)\n if !params[:from] && !params[:from]\n records = Record.where(:user_id => @current_user.id)\n else\n records = Record.where(\"user_id = ? and created_at >= ? and created_at <= ?\", @current_user.id, params[:from], params[:to])\n end\n records = records.select(\"date(created_at) as created_date, sum(distance) as distance,sum(time) as time,(sum(distance) / sum(time)) as average_speed\").group(\"created_date\")\n render json:{ reports: records}\n\n end",
"def order_params\n params.require(:order).permit(:name_on_order, :user_id)\n end",
"def index\n @reports = current_company.reports.reverse_order.page(params[:page]).per(10) if params[:sort] == nil && params[:uesr_id] == nil\n @reports = current_company.reports.order(params[:sort]).page(params[:page]).per(10) if params[:sort] != nil\n @reports = current_company.reports.where(user_id: params[:user_id]).reverse_order.page(params[:page]).per(10) if params[:user_id] != nil\n end"
] | [
"0.66577274",
"0.64084363",
"0.63864094",
"0.5824153",
"0.5812877",
"0.57943356",
"0.5770415",
"0.5760044",
"0.5687011",
"0.5639972",
"0.562532",
"0.5625303",
"0.56098807",
"0.5601437",
"0.5571733",
"0.55702835",
"0.55526996",
"0.55346286",
"0.5531137",
"0.5522815",
"0.55199546",
"0.5514068",
"0.551316",
"0.5505167",
"0.54902226",
"0.5478757",
"0.5478209",
"0.5467395",
"0.54516107",
"0.54414916",
"0.543922",
"0.5431344",
"0.5425835",
"0.5416397",
"0.5411853",
"0.54078424",
"0.5406782",
"0.5386858",
"0.5345202",
"0.5343423",
"0.53379583",
"0.5332844",
"0.53256583",
"0.532319",
"0.5321751",
"0.5314855",
"0.53085864",
"0.52997816",
"0.5299184",
"0.529795",
"0.5286589",
"0.5277133",
"0.5267546",
"0.5264248",
"0.5259728",
"0.5245649",
"0.523454",
"0.5232935",
"0.5232029",
"0.52253294",
"0.5224601",
"0.52118915",
"0.52018857",
"0.5187022",
"0.51858234",
"0.517849",
"0.5171325",
"0.5166286",
"0.5153584",
"0.51520026",
"0.515135",
"0.51498145",
"0.5129468",
"0.5127655",
"0.51270974",
"0.51245916",
"0.5120479",
"0.51202226",
"0.511834",
"0.51151437",
"0.51098806",
"0.51098603",
"0.51073265",
"0.5102667",
"0.50985396",
"0.50882834",
"0.5083712",
"0.50816774",
"0.5078194",
"0.50609833",
"0.5055036",
"0.50522774",
"0.5050004",
"0.50483024",
"0.50419724",
"0.5041825",
"0.5037443",
"0.50345474",
"0.50276613",
"0.50256824"
] | 0.67492145 | 0 |
PATCH/PUT /report_orders_by_users/1 PATCH/PUT /report_orders_by_users/1.json | def update
respond_to do |format|
if @report_orders_by_user.update(report_orders_by_user_params)
format.html { redirect_to @report_orders_by_user, notice: 'Report orders by user was successfully updated.' }
format.json { render :show, status: :ok, location: @report_orders_by_user }
else
format.html { render :edit }
format.json { render json: @report_orders_by_user.errors, status: :unprocessable_entity }
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_report_orders_by_user\n @report_orders_by_user = ReportOrdersByUser.find(params[:id])\n end",
"def update #only patch owned reports, do not edit client/user since their ids are in the routing\n @report = Report.find_by(id: params[:id])\n if current_user == @report.user\n #reset bool values that have n/a option\n @report.positive = nil\n @report.appointment = nil\n @report.payment = nil\n @report.update(report_params)\n @report.client_id = report_params[:client_id] if report_params[:client_id]\n redirect_to user_report_path(current_user, @report), notice: \"Report updated\"\n else\n redirect_to user_reports_path(current_user), alert: \"That's not your report\"\n end\n end",
"def update\n @users_order = Order.find(params[:id])\n\n respond_to do |format|\n if @users_order.update_attributes(params[:order])\n format.html { redirect_to [:users, @users_order], notice: 'Order was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n end\n end\n end",
"def update\n @report = current_user.reports.find(params[:id])\n\n respond_to do |format|\n if @report.update_attributes(params[:report])\n format.html { redirect_to @report, notice: 'Report was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @report.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update!(**args)\n @report_requests = args[:report_requests] if args.key?(:report_requests)\n end",
"def update!(**args)\n @report_requests = args[:report_requests] if args.key?(:report_requests)\n end",
"def update\n if @customer_report.update(customer_report_params_update.merge!(update_user: current_user.id)) \n render :json => {\n message: \"¡El Registro fue actualizado con exito!\",\n type: \"success\"\n }\n else \n render :json => {\n message: \"¡El Registro no fue actualizado!\",\n type: \"error\",\n message_error: @customer_report.errors.full_messages\n }\n\n end\n\n end",
"def update\n respond_to do |format|\n if @order.update(order_user_params) && order_update_items && order_update_labels\n format.html { redirect_to orders_url, notice: 'Order was successfully updated.' }\n format.json { render :show, status: :ok, location: @order }\n else\n format.html { render :edit }\n format.json { render json: @order.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @user_reports = UserReport.find(params[:id])\n\n respond_to do |format|\n if @user_reports.update_attributes(params[:user_report])\n flash[:notice] = 'UserReport was successfully updated.'\n format.html { redirect_to(@user_reports) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @user_reports.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @order = Order.find(params[:id])\n\n respond_to do |format|\n if @order.update_attributes(params[:user])\n format.html { redirect_to @order, notice: 'User was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @order.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @user_order.update(user_order_params)\n format.html { redirect_to @user_order, notice: 'User order was successfully updated.' }\n format.json { render :show, status: :ok, location: @user_order }\n else\n format.html { render :edit }\n format.json { render json: @user_order.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @user_report = UserReport.find(params[:id])\n\n respond_to do |format|\n if @user_report.update_attributes(params[:user_report])\n flash[:notice] = 'UserReport was successfully updated.'\n format.html { redirect_to(@user_report) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @user_report.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @order = Order.find(params[:id])\n redirect_to :action => \"index\" and return if current_admin.limited_sales_rep && !current_admin.users.include?(@order.user)\n respond_to do |format|\n if @order.update_attributes(params[:order])\n format.html { redirect_to(admin_orders_url, :notice => 'Order was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @order.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @customer = current_user.customers.find(params[:id])\n\n respond_to do |format|\n if @customer.update_attributes(params[:customer])\n @customer.orders.create(:user_id => @customer.user.id, \n :total => params[:total], :name => @customer.name, :phone => @customer.phone,\n :address => @customer.address, :instruction => params[:instruction]) if params[:order] == 'true'\n format.html { redirect_to(@customer, :notice => 'Customer was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @customer.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n batch = Batch.where(\"reference_batch = ?\", params[:reference_batch])\n if params[:action_batch] == \"Close\"\n # Find all orders for this batch id\n orders = Order.where(\"batch_id = ?\", batch[0].id)\n # Update status of orders to closing\n orders.update(status: Order.statuses['closing'])\n render json: {status: 'SUCCESS', message: 'Orders closed for batch', number_of_orders_in_batch: orders.size, data: batch}, status: :ok\n elsif params[:action_batch] == \"Send\"\n if params[:delivery_service]\n # Find all orders for this batch id and delivery service\n orders = Order.where(\"batch_id = ? AND delivery_service = ?\", batch[0].id, params[:delivery_service])\n # Update status of orders to sent\n orders.update(status: Order.statuses['sent'])\n render json: {status: 'SUCCESS', message: 'Orders sent for batch', delivery_service_sent: params[:delivery_service], number_of_orders_in_sent: orders.size, data: batch}, status: :ok\n else\n render json: {status: 'ERROR', message: 'Please provide a delivery service!!'}\n end\n else\n render json: {status: 'ERROR', message: 'I do not know this action!!'}\n end\n end",
"def update\n@users = User.all.order(nombre1: :asc)\n if params[:work][:user_ids]\n params[:work][:user_ids] = params[:work][:user_ids].map{|k, v| k}\n else\n params[:work][:user_ids] = []\n end\n \n respond_to do |format|\n if @work.update(work_params)\n format.html { redirect_to @work, notice: 'La actividad se actualizo con exito.' }\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\n end",
"def update\n respond_to do |format|\n attrs = admin_report_params\n\n if !@report.reunion_confirmed && attrs[:reunion_confirmed]\n @report.reunion_confirmed_at = Time.now\n end\n\n if @report.update(attrs)\n format.html { redirect_to @report, notice: 'Report was successfully updated.' }\n format.json { render :show, status: :ok, location: @report }\n else\n format.html { render :edit }\n format.json { render json: @report.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @users_xorder.update(users_xorder_params)\n format.html { redirect_to @users_xorder, notice: 'Users xorder was successfully updated.' }\n format.json { render :show, status: :ok, location: @users_xorder }\n else\n format.html { render :edit }\n format.json { render json: @users_xorder.errors, status: :unprocessable_entity }\n end\n end\n end",
"def edit #only edit owned reports\n @report = Report.find_by(id: params[:id])\n\n @clients = Client.all\n end",
"def update\n @power_order.update(power_order_params)\n render json: @power_order\n end",
"def update\n @users_support = User.all.select { |u| u.role != 'user' }\n if current_user.role != 'user'\n @bug_ticket.bug_ticket_users.clear\n params[:users][:id].each do |user|\n @bug_ticket.bug_ticket_users.build(user_id: user) unless user.empty?\n end\n end\n respond_to do |format|\n if @bug_ticket.update(bug_ticket_params)\n format.html { redirect_to @bug_ticket, notice: 'Bug ticket was successfully updated.' }\n format.json { render :show, status: :ok, location: @bug_ticket }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @bug_ticket.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n render json: Users.update(params[\"id\"], params[\"user\"])\n end",
"def update\n @order = current_user.orders.find(params[:id])\n\n respond_to do |format|\n if @order.update_attributes(params[:order])\n format.html { redirect_to(@order, :notice => 'Order was successfully updated.') }\n format.js { \n @orders = Order.search(current_user, nil).paginate(:per_page => current_user.profile.orders_per_page, :page => params[:page])\n } # update.js.erb\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @order.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @vehicles = Vehicle.all\n @users = User.all\n @customers = Customer.all\n respond_to do |format|\n if @work_order.update(work_order_params)\n if !@work_order.work_dones.blank? && @work_order.status == WORK_ORDER_STATUS[0] && !@work_order.budget.blank?\n @work_order.status = WORK_ORDER_STATUS[1]\n @work_order.save\n end\n if @work_order.status == WORK_ORDER_STATUS[1] && !@work_order.delivered_by.blank?\n @work_order.status = WORK_ORDER_STATUS[2]\n @work_order.save\n end\n format.html { redirect_to @work_order, notice: 'La orden se ha actualizada correctamente.' }\n format.json { render json: { :status => 'success', :message => 'El presupuesto se ha guardado correctamente.' } }\n else\n format.html { render :edit }\n format.json { render json: { :status => 'error', :message => @work_order.errors.messages } }\n end\n end\n end",
"def update\n @custom_report = CustomReport.find(params[:id])\n\n if @custom_report.update(params[:custom_report])\n head :no_content\n else\n render json: @custom_report.errors, status: :unprocessable_entity\n end\n end",
"def update_report\n prepare_params\n end",
"def update\n @report.user = current_user\n\n if @report.update(report_params)\n redirect_to @report, notice: t(\"activerecord.attributes.report.updated\")\n else\n render :edit\n end\n end",
"def update\n @order = Order.find(params[:id])\n sns = params[:order][:serial_numbers_attributes] || {}\n @order.editing = true\n @client = Client.find_by_id(@order.client_id)\n @bill = Bill.find_by_id((@order.bill_id))\n @render = \"#{@order.product_type.downcase}_fields\"\n @product = @order.product_type.downcase.pluralize\n respond_to do |format|\n if @order.update_attributes(params[:order])\n total_due = 0\n @order.parts.each do |part|\n total_due = part.cost + total_due\n end\n @order.client_needs.each do |client_need|\n total_due = client_need.cost + total_due\n end\n @order.update_attribute(:total_due, total_due)\n Progress.create(:short_description => @order.short_description, :full_description => @order.full_description, :user_id => current_user.id, :order_id => @order.id, :branch_id => @order.branch_id) \n format.html { redirect_to @order, notice: 'Order was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @order.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @report = Report.find(params[:id])\n respond_to do |format|\n if @report.update(report_params)\n format.html { redirect_to [@report.user, @report], notice: I18n.t('controllers.reports.successfully_updated') }\n format.json { render :show, status: :ok, location: @report }\n else\n format.html { render :edit }\n format.json { render json: @report.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @client = Client.find(params[:id])\n @client.report_header = nil if params[:remove_report_header]\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 respond_to do |format|\n if @report.update(report_params)\n format.html { redirect_to admin_reports_path, notice: t('shared.msgs.success_updated',\n obj: t('activerecord.models.report', count: 1)) }\n format.json { render :show, status: :ok, location: @report }\n else\n set_date\n format.html { render :edit }\n format.json { render json: @report.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n authorize @expense_report\n\n\n @expense_report.actual_expenses.each do |exp|\n exp.requests.each do |req|\n req.amount_from_total = req.percentrequested * exp.total\n req.destination = @expense_report.trip.destination\n req.expense_type = 'actual'\n end\n end\n\n\n respond_to do |format|\n if @expense_report.update(expense_report_params)\n format.html { redirect_to @expense_report, notice: 'Expense report was successfully updated.' }\n format.json { render :show, status: :ok, location: @expense_report }\n else\n format.html { render :edit }\n format.json { render json: @expense_report.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @order_user.update(order_user_params)\n format.html { redirect_to @order_user, notice: 'Order user was successfully updated.' }\n format.json { render :show, status: :ok, location: @order_user }\n else\n format.html { render :edit }\n format.json { render json: @order_user.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n render json: User.update(params[\"id\"], params[\"user\"])\n end",
"def update(data)\n\n orders = JSON.generate(data)\n\n pp = {\n :input => orders\n }\n\n request = Google::Apis::ScriptV1::ExecutionRequest.new(\n function: 'update_report',\n parameters: pp\n )\n\n begin\n AstmServer.log(\"updating following results to LIS\")\n AstmServer.log(request.parameters.to_s)\n resp = $service.run_script(self.script_id, request)\n if resp.error\n AstmServer.log(\"Error updating results to LIS, message follows\")\n AstmServer.log(\"error: #{resp.error.message} : code: #{resp.error.code}\")\n false\n else\n AstmServer.log(\"Updating results to LIS successfull\")\n true\n end\n rescue => e\n AstmServer.log(\"Error updating results to LIS, backtrace follows\")\n AstmServer.log(e.backtrace.to_s)\n false\n end\n\n end",
"def update\n respond_to do |format|\n if @purchase_order.update(purchase_order_params)\n\n @purchase_order.record_update(current_user, purchase_order_params)\n \n format.html { redirect_to @purchase_order, notice: 'Purchase order was successfully updated.' }\n format.json { respond_with_bip @purchase_order }\n else\n format.html { render action: 'edit' }\n format.json { render json: @purchase_order.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n@users = User.all.order(nombre1: :asc)\n if params[:research][:user_ids]\n params[:research][:user_ids] = params[:research][:user_ids].map{|k, v| k}\n else\n params[:research][:user_ids] = []\n end\n \n respond_to do |format|\n if @research.update(research_params)\n format.html { redirect_to @research, notice: 'La actividad se actualizo con exito.' }\n format.json { render :show, status: :ok, location: @research }\n else\n format.html { render :edit }\n format.json { render json: @research.errors, status: :unprocessable_entity }\n end\n end\n\n end",
"def update_many\n if @users.update_all(user_params)\n render json: @users, status: :ok, location: users_url\n else\n render json: @users.errors, status: :unprocessable_entity\n end\n end",
"def update\n if @report.update(report_params)\n @report.create_activity action: 'update', owner: current_user\n redirect_to @report, flash: { success: 'Report updated.' }\n else\n render :edit\n end\n end",
"def report_orders_by_user_params\n params.require(:report_orders_by_user).permit(:date_start, :date_end, :file_path)\n end",
"def update\n @statusreport = current_user.organization.statusreports.find(params[:id])\n#for update time change date format params\n #params[:statusreport][:report_date] = change_date_format(params[:statusreport][:report_date]) if !(params[:statusreport][:report_date]).blank?\n\n\n respond_to do |format|\n if @statusreport.update_attributes(params[:statusreport])\n format.html { redirect_to @statusreport, notice: 'Statusreport was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @statusreport.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @backend_user_content_report = Backend::UserContentReport.find(params[:id])\n\n respond_to do |format|\n if @backend_user_content_report.update_attributes(params[:backend_user_content_report])\n format.html { redirect_to @backend_user_content_report, notice: 'User content report was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @backend_user_content_report.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @office_report.update(office_report_params)\n format.html { redirect_to @office_report, notice: 'Report was successfully updated.' }\n format.json { render :show, status: :ok, location: @office_report }\n else\n format.html { render :edit }\n format.json { render json: @office_report.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @report.update(report_params)\n format.html { redirect_to [:admin, @report], notice: 'Report was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @report.errors, status: :unprocessable_entity }\n end\n end\n end",
"def send_report\n @user_attentions = current_user.attention.where(:report => 'open')\n respond_to do |format|\n @user_attentions.update_all(report: \"send\")\n format.html { redirect_to swatenttions_url, notice: 'El Reporte ha sido enviado con éxito.' }\n format.json { head :no_content }\n end \n end",
"def update\n #Finding the specific chore where the id matches the one we pass in with the body\n @v1_chore = Chore.where(id: params[:id]).first\n #Here we're checking if we have user_id in our body, and if we do, we'll change the selected chore's properties\n #with the parameters of the body, we go through the specific group to our specific chore with the path\n if v1_chore_params[:user_id]\n @v1_chore.user_id = params[:user_id]\n @v1_chore.assigned = true\n if @v1_chore.save\n render :show, status: :ok\n end\n else\n render json: @v1_chore.errors, status: :unprocessable_entity\n end\n end",
"def update_order_of_items\n result = Catalog.do_update_order_of_items(params[:sort_orders])\n \n # return a success message, wouldn't make sense to call this API method as html, but for debugging\n # just return json anyway\n respond_to do |format|\n format.html { render json: result}\n format.json { render json: result}\n end\n end",
"def update\n@users = User.all.order(nombre1: :asc)\n if params[:extension][:user_ids]\n params[:extension][:user_ids] = params[:extension][:user_ids].map{|k, v| k}\n else\n params[:extension][:user_ids] = []\n end\n \n respond_to do |format|\n if @extension.update(extension_params)\n format.html { redirect_to @extension, notice: 'La actividad se actualizo con exito.' }\n format.json { render :show, status: :ok, location: @extension }\n else\n format.html { render :edit }\n format.json { render json: @extension.errors, status: :unprocessable_entity }\n end\n end\n \n end",
"def update\n respond_to do |format|\n if @order.update(order_params)\n @users = User.order(:user_name)\n @restaurants = Restaurant.order(:rest_name)\n @parts = params[:part_ids]\n \tif !(@parts.nil?)\n \t @parts.each do |part|\n\t\t \tif (part != @order.order_organizer)\n\t\t\t @thispart = Participant.create!({:part_user => part, :part_order => @order.id, :part_role => \"participant\", :part_cost => 0.00})\n \t end\n \t end\n \tend\n format.html { redirect_to @order, notice: 'Order was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @order.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @report.update(report_params)\n format.html { redirect_to @report}\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @report.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @client_report.update(client_report_params)\n format.html { redirect_to @client_report, notice: 'Report was successfully updated.' }\n format.json { render :show, status: :ok, location: @client_report }\n else\n format.html { render :edit }\n format.json { render json: @client_report.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n # @user = current_user\n # @order = @user.order.new(order_params)\n @order = Order.find(params[:id])\n @order.update_attributes(order_params)\n # @friend = User.find(order_friend['friend'])\n # @friend.orders << @order\n respond_to do |format|\n if @order.update(order_params)\n format.html { redirect_to @order, notice: 'Order was successfully updated.' }\n format.json { render :show, status: :ok, location: @order }\n else\n format.html { render :edit }\n format.json { render json: @order.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n # @company.users = []\n # unless params[:user][:user_ids].nil?\n # params[:user][:user_ids].each do |user_id|\n # @company.users << User.find(user_id) unless user_id.empty?\n # end\n # end\n #\n # respond_to do |format|\n # if @company.update(company_params)\n # format.html { redirect_to @company, notice: 'Company was successfully updated.' }\n # format.json { render :show, status: :ok, location: @company }\n # else\n # format.html { render :edit }\n # format.json { render json: @company.errors, status: :unprocessable_entity }\n # end\n # end\n @company.update(company_params)\n end",
"def approve\n User.where(id: params[:user_ids]).update_all(approved: true)\n\n respond_to do |format|\n format.html { redirect_to users_url(filter: \"unapproved\"), notice: 'Benutzer wurden freigeschaltet.' }\n format.json { head :no_content }\n end\n end",
"def update\n @users = User.find(params[:id])\n if params[:approved]\n if current_user && current_user.is_admin?\n if @users.update(user_params)\n # Tell the UserMailer to send a welcome email after approval\n UserMailer.user_approved(@users).deliver_later\n render json: { status: 200, msg: 'User details have been updated.' }\n end\n else\n render json: { error: 'You are not authorized to modify this data'} , status: 401\n end\n else\n if @users.update(user_params)\n render json: { status: 200, msg: 'User details have been updated.' }\n end\n end\n end",
"def update\n @breadcrumb = 'update'\n @work_order_status = WorkOrderStatus.find(params[:id])\n @work_order_status.updated_by = current_user.id if !current_user.nil?\n\n respond_to do |format|\n if @work_order_status.update_attributes(params[:work_order_status])\n format.html { redirect_to @work_order_status,\n notice: (crud_notice('updated', @work_order_status) + \"#{undo_link(@work_order_status)}\").html_safe }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @work_order_status.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n # update the attribs\n @report.assign_attributes(params[:report])\n \n # if report is not valid, can't run it\n if @report.valid?\n # save\n @report.save\n # re-run the report, handling errors\n run_and_handle_errors\n end\n \n # return data in json format\n render(:json => {:report => @report}.to_json)\n end",
"def update\n @breadcrumb = 'update'\n @order_status = OrderStatus.find(params[:id])\n @order_status.updated_by = current_user.id if !current_user.nil?\n\n respond_to do |format|\n if @order_status.update_attributes(params[:order_status])\n format.html { redirect_to @order_status,\n notice: (crud_notice('updated', @order_status) + \"#{undo_link(@order_status)}\").html_safe }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @order_status.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @all_report.update(all_report_params)\n format.html { redirect_to @all_report, notice: 'All report was successfully updated.' }\n format.json { render :show, status: :ok, location: @all_report }\n else\n format.html { render :edit }\n format.json { render json: @all_report.errors, status: :unprocessable_entity }\n end\n end\n end",
"def edit_existing(order)\n @data.order = order\n @data.user = User.with_id(order.order_user_id)\n\n order_common(false)\n end",
"def update\n @cta = Cta.find(params[:id])\n params[:users].each do |p|\n @cta.cta_relations.first.users << UserGroup.find(p)\n end\n @user.user_groups.uniq!\n\n respond_to do |format|\n if @cta.update_attributes(params[:cta])\n format.html { redirect_to @cta, notice: 'Cta was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @cta.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @report.update(report_params)\n format.html { redirect_to @report, notice: 'Report was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @report.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @report.update(report_params)\n format.html { redirect_to @report, notice: 'Report was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @report.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @report_orders_by_user = ReportOrdersByUser.new(report_orders_by_user_params)\n\n respond_to do |format|\n if @report_orders_by_user.save\n format.html { redirect_to @report_orders_by_user, notice: 'Report orders by user was successfully created.' }\n format.json { render :show, status: :created, location: @report_orders_by_user }\n else\n format.html { render :new }\n format.json { render json: @report_orders_by_user.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update \n user = User.find(params[:id])\n # byebug\n user.update(user_params)\n\n render json: user\n end",
"def UpdateUser params = {}\n \n APICall(path: 'users.json',method: 'PUT',payload: params.to_json)\n \n end",
"def update\n respond_to do |format|\n if @admin_report.update(admin_report_params)\n format.html { redirect_to @admin_report, notice: 'Report was successfully updated.' }\n format.json { render :show, status: :ok, location: @admin_report }\n else\n format.html { render :edit }\n format.json { render json: @admin_report.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @updateallorder.update(updateallorder_params)\n format.html { redirect_to @updateallorder, notice: 'Updateallorder was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @updateallorder.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @report.update(report_params)\n format.html { redirect_to reports_path, notice: 'Report was successfully updated.' }\n format.json { render :index, status: :ok, location: @report }\n else\n format.html { render :edit }\n format.json { render json: @report.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n group_ids = params[:group_id]\n org_id = params[:organization_id]\n @user = User.find_by_id(params[:user_id])\n current_group_ids = @user.user_group_ids\n\n respond_to do |format|\n if @user.update_attributes(full_name: params[:full_name], abbreviation: params[:abbreviation], email: params[:email], status: params[:status], staff_number: params[:employee_id], career_path: params[:career_path])\n\n is_logged = !@user.previous_changes.blank?\n if current_group_ids != group_ids\n @user.user_group_ids = group_ids\n format.json { render json: @user }\n end\n else\n format.json { render json: @user.errors.messages, status: :unprocessable_entity }\n end\n end\n end",
"def update!(**args)\n @reports = args[:reports] if args.key?(:reports)\n end",
"def update!(**args)\n @http_request = args[:http_request] if args.key?(:http_request)\n @report_location = args[:report_location] if args.key?(:report_location)\n @source_references = args[:source_references] if args.key?(:source_references)\n @user = args[:user] if args.key?(:user)\n end",
"def update\n @report = Report.find(params[:id])\n\n respond_to do |format|\n if @report.update_attributes(params[:report])\n format.html { redirect_to @report, notice: 'Report was successfully updated.' }\n # format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n # format.json { render json: @report.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @report = Report.find(params[:id])\n respond_to do |format|\n if @report.update_attributes(params[:report])\n format.html { redirect_to @report, notice: 'Report was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @report.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @order.update(order_params)\n format.html { redirect_to @order, notice: 'Order was successfully updated.' }\n format.json { render :show, status: :ok, location: @order }\n else\n set_groups\n format.html { render :edit }\n format.json { render json: @order.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @report = Report.find(params[:id])\n\n respond_to do |format|\n if @report.update_attributes(params[:report])\n format.html { redirect_to @report, notice: 'Report was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @report.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @report = Report.find(params[:id])\n\n respond_to do |format|\n if @report.update_attributes(params[:report])\n format.html { redirect_to @report, notice: 'Report was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @report.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n\n @orders = Order.all\n @order = Order.find(params[:id])\n\n @order.update_attributes(order_params)\n\n=begin\n respond_to do |format|\n if @order.update(order_params)\n format.html { redirect_to @order, notice: 'Order was successfully updated.' }\n format.json { render :show, status: :ok, location: @order }\n else\n format.html { render :edit }\n format.json { render json: @order.errors, status: :unprocessable_entity }\n end\n end\n=end\n end",
"def update\n @users = User.all.order(nombre1: :asc)\n if params[:coference][:user_ids]\n params[:coference][:user_ids] = params[:coference][:user_ids].map{|k, v| k}\n else\n params[:coference][:user_ids] = []\n end\n\n respond_to do |format|\n if @coference.update(coference_params)\n format.html { redirect_to @coference, notice: 'La actividad se actualizo con exito.' }\n format.json { render :show, status: :ok, location: @coference }\n else\n format.html { render :edit }\n format.json { render json: @coference.errors, status: :unprocessable_entity }\n end\n end\n\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 if params[:order][:taxis][:taxi_id].blank?\n orders_taxi.destroy if orders_taxi = OrdersTaxi.where([\"order_id = ?\", @order.id]).first\n else\n unless OrdersTaxi.where([\"order_id = ? AND taxi_id = ?\", @order.id, params[:order][:taxis][:taxi_id]]).first\n unless @order.taxis.blank?\n orders_taxi = OrdersTaxi.where([\"order_id = ?\", @order.id]).first\n orders_taxi.destroy\n end\n OrdersTaxi.create(order_id: @order.id, taxi_id: params[:order][:taxis][:taxi_id])\n end\n end\n\n respond_to do |format|\n params[:order][:assigned_at] = Time.now + params[:order][:assigned_at].to_i * 60 unless params[:order][:assigned_at].blank?\n if @order.update(order_params)\n # send_notification(@order) unless @order.assigned_at.blank? || @order.taxis.first.nil?\n format.html { redirect_to orders_path, notice: t(\"activerecord.models.order\") + t(\"messages.updated\") }\n format.json { render :show, status: :ok, location: @order }\n else\n format.html { render :edit }\n format.json { render json: @order.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @allorder.update(allorder_params)\n format.html { redirect_to @allorder, notice: 'Allorder was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @allorder.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n render json: UserBoards.update(params[\"id\"], params[\"user_board\"])\n end",
"def update\n respond_to do |format|\n if @order.update(order_params)\n params[:order][:orders_wares_attributes].each do | item |\n product = OrdersWare.find(item[1][:id])\n product.update_attributes(quantity: item[1][:quantity], total: item[1][:total], observations: item[1][:observations])\n end\n format.html { redirect_to @order, notice: 'Order was successfully updated.' }\n format.json { render :show, status: :ok, location: @order }\n else\n format.html { render :edit }\n format.json { render json: @order.errors, status: :unprocessable_entity }\n end\n end\n end",
"def index\n @report_orders_by_users = ReportOrdersByUser.all\n end",
"def update\n respond_to do |format|\n if @report.update(report_params)\n format.html { redirect_to @report, notice: \"Report was successfully updated.\" }\n format.json { render :show, status: :ok, location: @report }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @report.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @report.update(report_params)\n format.html { redirect_to report_path(@report.id), notice: 'Report was successfully updated.' }\n format.json { render :show, status: :ok, location: report_path(@report.id) }\n else\n format.html { render :edit }\n format.json { render json: @report.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @report.update(report_params)\n format.html { redirect_to @report, notice: 'Report was successfully updated.' }\n format.json { render :show, status: :ok, location: @report }\n else\n format.html { render :edit }\n format.json { render json: @report.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @report.update(report_params)\n format.html { redirect_to @report, notice: 'Report was successfully updated.' }\n format.json { render :show, status: :ok, location: @report }\n else\n format.html { render :edit }\n format.json { render json: @report.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @report.update(report_params)\n format.html { redirect_to @report, notice: 'Report was successfully updated.' }\n format.json { render :show, status: :ok, location: @report }\n else\n format.html { render :edit }\n format.json { render json: @report.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @report.update(report_params)\n format.html { redirect_to @report, notice: 'Report was successfully updated.' }\n format.json { render :show, status: :ok, location: @report }\n else\n format.html { render :edit }\n format.json { render json: @report.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @report.update(report_params)\n format.html { redirect_to @report, notice: 'Report was successfully updated.' }\n format.json { render :show, status: :ok, location: @report }\n else\n format.html { render :edit }\n format.json { render json: @report.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @report.update(report_params)\n format.html { redirect_to @report, notice: 'Report was successfully updated.' }\n format.json { render :show, status: :ok, location: @report }\n else\n format.html { render :edit }\n format.json { render json: @report.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @report.update(report_params)\n format.html { redirect_to @report, notice: 'Report was successfully updated.' }\n format.json { render :show, status: :ok, location: @report }\n else\n format.html { render :edit }\n format.json { render json: @report.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @report.update(report_params)\n format.html { redirect_to @report, notice: 'Report was successfully updated.' }\n format.json { render :show, status: :ok, location: @report }\n else\n format.html { render :edit }\n format.json { render json: @report.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @report.update(report_params)\n format.html { redirect_to @report, notice: 'Report was successfully updated.' }\n format.json { render :show, status: :ok, location: @report }\n else\n format.html { render :edit }\n format.json { render json: @report.errors, status: :unprocessable_entity }\n end\n end\n end",
"def of_update_charge_account_from_order\n order = params[:order]\n projects = projects_dropdown\n charge_account_id = 0\n store_id = 0\n if order != '0'\n @order = WorkOrder.find(order)\n @project = @order.project\n @charge_account = @order.charge_account\n charge_account_id = @charge_account.id rescue 0\n @store = @order.store\n store_id = @store.id rescue 0\n if @charge_account.blank?\n @charge_account = @project.blank? ? projects_charge_accounts(projects) : charge_accounts_dropdown_edit(@project)\n end\n if @store.blank?\n @store = project_stores(@project)\n end\n else\n @charge_account = projects_charge_accounts(projects)\n @store = stores_dropdown\n end\n @json_data = { \"charge_account\" => @charge_account, \"store\" => @store,\n \"charge_account_id\" => charge_account_id, \"store_id\" => store_id }\n render json: @json_data\n end",
"def updateReportsNum\n\n\t\tif !params[:email].nil? || !params[:reports_num].nil?\n\t\t\tuser = User.find_by_email(params[:email])\n\t\t\tif user\n\t\t\t\tif user.update_attributes(reports_count: params[:reports_num].to_i)\n\t\t\t\t\trender json: user, status: :ok\n\t\t\t\telse\n\t\t\t\t\trender json: {message: 'User not updated'}, status: :not_found\n\t\t\t\tend\n\t\t\telse\n\t\t\t\trender json: {message: 'User not found'}, status: :not_found\n\t\t\tend\n\t\telse\n\t\t\trender json: {message: 'Username don\\'t provided'}, status: :bad_request\n\t\tend\n\tend",
"def update\n\n old_assigned_to_user = @request.assigned_to_user.to_s \n new_assigned_to_user = params[:request][:assigned_to_user]\n\n respond_to do |format|\n\n params[:request][:issue_ids] ||= []\n if @request.update(request_params)\n\n # save new comments\n if params[:request][:comment] != nil\n comment = @request.comments.create\n comment.comment = params[:request][:comment]\n comment.user_id = current_user.id\n comment.save\n # make sure updated_at gets updated\n @request.touch\n end\n \n if current_user.worker?\n if params[:status] == \"approved\"\n @request.approved!\n elsif params[:status] == \"completed\"\n @request.completed!\n @request.requester!\n end \n elsif current_user.approver?\n if params[:status] == \"approved\"\n @request.approved!\n @request.worker!\n elsif params[:status] == \"disapproved\"\n @request.disapproved!\n @request.requester!\n end \n\n else\n add_issues_to_request \n end\n\n # send email notification when assigned_to_user field has changed\n if old_assigned_to_user != new_assigned_to_user && !new_assigned_to_user.nil?\n RequestMailer.assignee_email(@request).deliver_later\n end\n\n\n format.html { redirect_to @request, notice: 'Request was successfully updated.' }\n format.json { render :show, status: :ok, location: @request }\n else\n format.html { render :edit }\n format.json { render json: @request.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @report.update(report_params)\n format.html { redirect_to reports_url, notice: 'Report was successfully updated.' }\n format.json { render :show, status: :ok, location: @report }\n else\n format.html { render :edit }\n format.json { render json: @report.errors, status: :unprocessable_entity }\n end\n end\n end"
] | [
"0.64363295",
"0.6355397",
"0.60047567",
"0.5926511",
"0.5862247",
"0.5862247",
"0.5828066",
"0.57878584",
"0.5785959",
"0.5712101",
"0.5700746",
"0.57002056",
"0.57001054",
"0.5678302",
"0.5658115",
"0.56548655",
"0.5648543",
"0.56467175",
"0.56434417",
"0.5591606",
"0.5587291",
"0.55771244",
"0.5566235",
"0.55472004",
"0.55456066",
"0.5537141",
"0.55337054",
"0.5531763",
"0.5513476",
"0.5508168",
"0.54954225",
"0.54885083",
"0.5468606",
"0.5454535",
"0.54528683",
"0.5449527",
"0.5424188",
"0.54210687",
"0.54148775",
"0.5383486",
"0.5381383",
"0.53795666",
"0.5373904",
"0.5369217",
"0.53657675",
"0.5353002",
"0.5350778",
"0.5347473",
"0.5337924",
"0.53300637",
"0.532996",
"0.5306606",
"0.53054607",
"0.53017545",
"0.5291711",
"0.5284305",
"0.5282891",
"0.52827805",
"0.5282277",
"0.52814996",
"0.52769864",
"0.52744687",
"0.52744687",
"0.52734786",
"0.52696663",
"0.52604103",
"0.52590746",
"0.525122",
"0.5250716",
"0.52485985",
"0.5246993",
"0.5240886",
"0.52401155",
"0.52264035",
"0.52262944",
"0.5225172",
"0.5225172",
"0.52220124",
"0.52211857",
"0.52201575",
"0.521388",
"0.52134454",
"0.5199647",
"0.51985276",
"0.51972395",
"0.51958746",
"0.5195226",
"0.51943433",
"0.51943433",
"0.51943433",
"0.51943433",
"0.51943433",
"0.51943433",
"0.51943433",
"0.51943433",
"0.51943433",
"0.5188625",
"0.5186726",
"0.5183631",
"0.51836073"
] | 0.71874124 | 0 |
DELETE /report_orders_by_users/1 DELETE /report_orders_by_users/1.json | def destroy
@report_orders_by_user.destroy
respond_to do |format|
format.html { redirect_to report_orders_by_users_url, notice: 'Report orders by user was successfully destroyed.' }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @user_reports = UserReport.find(params[:id])\n @user_reports.destroy\n\n respond_to do |format|\n format.html { redirect_to(user_reports_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @user_report = UserReport.find(params[:id])\n @user_report.destroy\n\n respond_to do |format|\n format.html { redirect_to(user_reports_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @report = current_user.reports.find(params[:id])\n @report.destroy\n\n respond_to do |format|\n format.html { redirect_to reports_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @report = current_user.reports.find(params[:id])\n @report.destroy\n\n respond_to do |format|\n format.html { redirect_to user_path(current_user), notice: \"Report was deleted!\" }\n format.json { head :no_content }\n end\n end",
"def destroy\n @report.destroy!\n render json: {status: :ok}\n end",
"def destroy\n @report.destroy\n respond_to do |format|\n format.html { redirect_to user_reports_url, notice: I18n.t('controllers.reports.successfully_updated') }\n format.json { head :no_content }\n end\n end",
"def destroy\n @backend_user_content_report = Backend::UserContentReport.find(params[:id])\n @backend_user_content_report.destroy\n\n respond_to do |format|\n format.html { redirect_to backend_user_content_reports_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @report.destroy\n respond_to do |format|\n format.html { redirect_to admin_reports_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @statusreport = current_user.organization.statusreports.find(params[:id])\n @statusreport.destroy\n respond_to do |format|\n format.html { redirect_to statusreports_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @report.destroy\n respond_to do |format|\n format.html { redirect_to reports_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @report.destroy\n respond_to do |format|\n format.html { redirect_to reports_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @report.destroy\n respond_to do |format|\n format.html { redirect_to reports_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @report.destroy\n respond_to do |format|\n format.html { redirect_to reports_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @user_reported_statistic = UserReportedStatistic.find(params[:id])\n @user_reported_statistic.destroy\n\n respond_to do |format|\n format.html { redirect_to user_reported_statistics_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n if @customer_report.destroy\n render :json => @customer_report\n else \n render :json => @customer_report.errors.full_messages\n end\n end",
"def destroy\n @client_report.destroy\n respond_to do |format|\n format.html { redirect_to client_reports_url, notice: 'Report was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @report.destroy\n respond_to do |format|\n format.html { redirect_to admin_reports_url, notice: t('shared.msgs.success_destroyed',\n obj: t('activerecord.models.report', count: 1)) }\n format.json { head :no_content }\n end\n end",
"def destroy\n @admin_report.destroy\n respond_to do |format|\n format.html { redirect_to admin_reports_url, notice: 'Report was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @admins_direct_report.destroy\n respond_to do |format|\n format.html { redirect_to admins_direct_reports_url, notice: 'Direct report was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @purchase_order.record_activity(:delete, current_user, \"Deleted PO\")\n @purchase_order.destroy\n respond_to do |format|\n\n format.html { redirect_to purchase_orders_url, notice: \"Purchase Order #{@purchase_order.po_id} has been deleted.\" }\n format.json { head :no_content }\n end\n end",
"def destroy\n @report = Report.find(params[:id])\n @report.destroy\n\n respond_to do |format|\n format.html { redirect_to reports_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @report = Report.find(params[:id])\n @report.destroy\n\n respond_to do |format|\n format.html { redirect_to reports_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @report = Report.find(params[:id])\n @report.destroy\n\n respond_to do |format|\n format.html { redirect_to reports_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @report = Report.find(params[:id])\n @report.destroy\n\n respond_to do |format|\n format.html { redirect_to reports_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @id = params[:id]\n visit_order_details = OrderDetail.find(@id)\n visit_order_details.destroy\n #.destroy\n respond_to do |format|\n format.html { redirect_to visits_url, notice: 'Visit was successfully destroyed.' }\n format.json { head :no_content }\n format.js { render 'delete_row', id: @id}\n end\n end",
"def destroy\n @custom_report = CustomReport.find(params[:id])\n @custom_report.destroy\n\n head :no_content\n end",
"def destroy\n @report = Report.find(params[:id])\n @report.destroy\n\n respond_to do |format|\n format.html { redirect_to reports_url }\n #format.json { head :ok }\n end\n end",
"def destroy\n @all_report.destroy\n respond_to do |format|\n format.html { redirect_to all_reports_url, notice: 'All report was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @stores_report = Stores::Report.find(params[:id])\n @stores_report.destroy\n\n respond_to do |format|\n format.html { redirect_to stores_reports_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @action_report.destroy\n respond_to do |format|\n format.html { redirect_to action_reports_url, notice: 'Action report was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def delete(user: nil, account_id: nil, service: nil, endpoint: nil, sort: nil, extra_path: nil, range: nil, ids: nil, query: {}, headers: {}, count: nil, entries: nil)\n get(user: user, account_id: account_id, service: service, endpoint: endpoint, sort: sort, extra_path: extra_path, range: range, ids: ids, query: query, headers: headers, count: count, entries: entries, method: :delete)\n end",
"def destroy\n @report.destroy\n respond_to do |format|\n format.html { redirect_to reports_url, notice: 'El Reporte fue Eliminado Exitosamente.' }\n format.json { head :no_content }\n end\n end",
"def DeleteUser id\n \n APICall(path: \"users/#{id}.json\",method: 'DELETE')\n \n end",
"def destroy\n @report.destroy\n respond_to do |format|\n format.html { redirect_to reports_find_url, notice: 'Report was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @order_log = OrderLog.find(params[:id])\n @order_log.destroy\n\n respond_to do |format|\n format.html { redirect_to order_logs_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n store_location\n @report.destroy\n respond_to do |format|\n format.html { redirect_to session.delete(:return_to)}\n format.json { head :no_content }\n end\n end",
"def destroy\n @reporte = Reporte.find(params[:id])\n @reporte.destroy\n\n respond_to do |format|\n format.html { redirect_to reportes_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @dynamic_report.destroy\n respond_to do |format|\n format.html { redirect_to dynamic_reports_url, notice: 'Dynamic report was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @time_report = TimeReport.find(params[:id])\n @time_report.destroy\n\n respond_to do |format|\n format.html { redirect_to time_reports_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @office_report.destroy\n respond_to do |format|\n format.html { redirect_to office_reports_url, notice: 'Report was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @users_xorder.destroy\n respond_to do |format|\n format.html { redirect_to users_xorders_url, notice: 'Users xorder was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def report_delete(id)\r\n\t\tpost= { \"token\" => @token, \"report\" => id } \r\n\t\tdocxml=nessus_request('report/delete', post)\r\n\t\treturn docxml\r\n\tend",
"def destroy\n @report.destroy\n respond_to do |format|\n format.html { redirect_to reports_url, notice: 'Report was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @report.destroy\n respond_to do |format|\n format.html { redirect_to reports_url, notice: 'Report was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @report.destroy\n respond_to do |format|\n format.html { redirect_to reports_url, notice: 'Report was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @report.destroy\n respond_to do |format|\n format.html { redirect_to reports_url, notice: 'Report was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @report.destroy\n respond_to do |format|\n format.html { redirect_to reports_url, notice: 'Report was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @report.destroy\n respond_to do |format|\n format.html { redirect_to reports_url, notice: 'Report was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @report.destroy\n respond_to do |format|\n format.html { redirect_to reports_url, notice: 'Report was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @report.destroy\n respond_to do |format|\n format.html { redirect_to reports_url, notice: 'Report was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @report.destroy\n respond_to do |format|\n format.html { redirect_to reports_url, notice: 'Report was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @report.destroy\n respond_to do |format|\n format.html { redirect_to reports_url, notice: 'Report was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @report.destroy\n respond_to do |format|\n format.html { redirect_to reports_url, notice: 'Report was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @report.destroy\n respond_to do |format|\n format.html { redirect_to reports_url, notice: 'Report was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @report.destroy\n respond_to do |format|\n format.html { redirect_to reports_url, notice: 'Report was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @report.destroy\n respond_to do |format|\n format.html { redirect_to reports_url, notice: 'Report was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @report.destroy\n respond_to do |format|\n format.html { redirect_to reports_url, notice: 'Report was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @report.destroy\n respond_to do |format|\n format.html { redirect_to reports_url, notice: 'Report was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @allorder.destroy\n respond_to do |format|\n format.html { redirect_to allorders_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @report.destroy\n respond_to do |format|\n format.html { redirect_to reports_url, notice: \"Report was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"def destroy\n @report.destroy\n respond_to do |format|\n format.html { redirect_to reports_url, notice: \"Report was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"def destroy\n @crunch_report.destroy\n respond_to do |format|\n format.html { redirect_to crunch_reports_url, notice: 'Crunch report was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @pod_report.destroy\n respond_to do |format|\n format.html { redirect_to pod_reports_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @users_order = Order.find(params[:id])\n @users_order.destroy\n\n respond_to do |format|\n format.html { redirect_to users_orders_url }\n end\n end",
"def destroy\n @bus_report.destroy\n respond_to do |format|\n format.html { redirect_to bus_reports_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @survey_report = SurveyReport.find(params[:id])\n @survey_report.destroy\n\n respond_to do |format|\n format.html { redirect_to survey_reports_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @counter_order = CounterOrder.find(params[:id])\n @counter_order.destroy\n\n respond_to do |format|\n format.html { redirect_to counter_orders_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @theft_report.destroy\n respond_to do |format|\n format.html { redirect_to theft_reports_url }\n format.json { head :no_content }\n end\n end",
"def delete\n render json: Users.delete(params[\"id\"])\n end",
"def destroy\n authorize :report, :destroy?\n @report.destroy\n respond_to do |format|\n format.html { redirect_to reports_url, notice: 'Report was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @user_order.destroy\n respond_to do |format|\n format.html { redirect_to user_orders_url, notice: 'User order was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @failure_report.destroy\n respond_to do |format|\n format.html { redirect_to failure_reports_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @updateallorder.destroy\n respond_to do |format|\n format.html { redirect_to updateallorders_url }\n format.json { head :no_content }\n end\n end",
"def delete\n @user = User.find(params[:id])\n @user.rvsps.delete_all()\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to(users_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @et_report.destroy\n respond_to do |format|\n format.html { redirect_to et_reports_url, notice: '削除が完了しました。' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @user_checkout_stat.destroy\n\n respond_to do |format|\n format.html { redirect_to user_checkout_stats_url }\n format.json { head :no_content }\n end\n end",
"def delete\n render json: User.delete(params[\"id\"])\n end",
"def repair_order_employees_delete\n @repair_order_employee = current_business_user.employee_users_repair_orders.find(params[:id])\n\n @repair_order_employee.destroy\n if @repair_order_employee\n render json: { repair_order_employees: @repair_order_employee.as_json },\n status: :ok\n else\n render json: { errors: @repair_order_employee.errors.full_messages },\n status: :unprocessable_entity\n end\n end",
"def destroy\n @report_date.destroy\n respond_to do |format|\n format.html { redirect_to report_dates_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n #@team_report = TeamReport.find(params[:id])\n @team_report.destroy\n\n respond_to do |format|\n format.html { redirect_to action: :index }\n format.json { head :no_content }\n end\n end",
"def destroy\n @user_log = UserLog.find(params[:id])\n @user_log.destroy\n\n respond_to do |format|\n format.html { redirect_to user_logs_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @weekly_report.destroy\n respond_to do |format|\n format.html { redirect_to weekly_reports_url, notice: 'Weekly report was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @report.destroy\n\n respond_to do |format|\n format.html { redirect_to(reports_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @report.destroy\n\n respond_to do |format|\n format.html { redirect_to(reports_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @accounting_report.destroy\n respond_to do |format|\n format.html { redirect_to accounting_reports_url, notice: 'Accounting report was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @inventory_report = InventoryReport.find(params[:id])\n @inventory_report.destroy\n\n respond_to do |format|\n format.html { redirect_to inventory_reports_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @batch_progress_report.destroy\n respond_to do |format|\n format.html { redirect_to batch_progress_reports_url, notice: 'Batch progress report was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @event_report.destroy\n respond_to do |format|\n format.html { redirect_to event_reports_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @daily_report.destroy\n respond_to do |format|\n format.html { redirect_to daily_reports_url, notice: 'Daily report was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def delete_user_for_tenant(args = {}) \n delete(\"/tenants.json/#{args[:tenantId]}/users/#{args[:userId]}\", args)\nend",
"def destroy\n @report_content.destroy\n respond_to do |format|\n format.html { redirect_to report_contents_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @reportabus.destroy\n respond_to do |format|\n format.html { redirect_to reportabuses_url, notice: 'Reportabuse was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @applicant_report.destroy\n respond_to do |format|\n format.html { redirect_to applicant_reports_url, notice: 'Reporte de becario eliminado correctamente.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @journal_doc_report.destroy\n respond_to do |format|\n format.html { redirect_to journal_doc_reports_url, notice: 'Journal doc report was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @report_file = ReportFile.find(params[:id])\n @report_file.destroy\n\n respond_to do |format|\n format.html { redirect_to report_files_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @invoice_row.destroy\n respond_to do |format|\n format.html { redirect_to invoice_rows_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @fin_report = FinReport.find(params[:id])\n @fin_report.destroy\n\n respond_to do |format|\n format.html { redirect_to fin_reports_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @hivdrugreport = Hivdrugreport.find(params[:id])\n @hivdrugreport.destroy\n\n respond_to do |format|\n format.html { redirect_to hivdrugreports_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @reportable = @report.reportable\n @report.destroy\n respond_to do |format|\n format.html {redirect_to @reportable, notice: 'Report was successfully destroyed.'}\n format.json {head :no_content}\n end\n end",
"def destroy\n @tbdotreport = Tbdotreport.find(params[:id])\n @tbdotreport.destroy\n\n respond_to do |format|\n format.html { redirect_to tbdotreports_url }\n format.json { head :no_content }\n end\n end"
] | [
"0.69389147",
"0.6922593",
"0.6921318",
"0.688571",
"0.68740296",
"0.6824981",
"0.6777517",
"0.6749769",
"0.6729472",
"0.6608752",
"0.66079783",
"0.66079783",
"0.66079783",
"0.6607709",
"0.6603542",
"0.65991527",
"0.65624213",
"0.6513876",
"0.64958704",
"0.6470223",
"0.64554447",
"0.64554447",
"0.64554447",
"0.64554447",
"0.6442279",
"0.6433218",
"0.6432007",
"0.64316654",
"0.6422073",
"0.6421711",
"0.64032114",
"0.6386644",
"0.6375284",
"0.63698655",
"0.63664937",
"0.6366145",
"0.6357351",
"0.63566285",
"0.6342925",
"0.63408977",
"0.6339283",
"0.63363796",
"0.6333992",
"0.6333992",
"0.6333992",
"0.6333992",
"0.6333992",
"0.6333992",
"0.6333992",
"0.6333992",
"0.6333992",
"0.6333992",
"0.6333992",
"0.6333992",
"0.6333992",
"0.6333992",
"0.6333992",
"0.6333992",
"0.6325734",
"0.63245547",
"0.63245547",
"0.632319",
"0.6319592",
"0.6307931",
"0.6306551",
"0.63017875",
"0.6299078",
"0.62942404",
"0.62848496",
"0.6283967",
"0.62801033",
"0.6276768",
"0.62741333",
"0.62726384",
"0.6269469",
"0.62665147",
"0.62636775",
"0.62614626",
"0.6257064",
"0.624314",
"0.624158",
"0.6241294",
"0.62410295",
"0.62410295",
"0.62407327",
"0.6240237",
"0.62386066",
"0.62280035",
"0.6227369",
"0.6221386",
"0.6216752",
"0.6214824",
"0.6212519",
"0.62121934",
"0.6199653",
"0.6197366",
"0.61910397",
"0.61888367",
"0.61887896",
"0.61824334"
] | 0.7641855 | 0 |
Use callbacks to share common setup or constraints between actions. | def set_report_orders_by_user
@report_orders_by_user = ReportOrdersByUser.find(params[:id])
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_required_actions\n # TODO: check what fields change to asign required fields\n end",
"def action_hook; end",
"def run_actions; end",
"def define_action_hook; end",
"def actions; end",
"def define_action_helpers\n if super && action == :save\n @instance_helper_module.class_eval do\n define_method(:valid?) do |*args|\n self.class.state_machines.fire_event_attributes(self, :save, false) { super(*args) }\n end\n end\n end\n end",
"def add_actions; end",
"def callbacks; end",
"def callbacks; end",
"def setup *actions, &proc\n (@setup_procs ||= []) << [proc, actions.size > 0 ? actions : [:*]]\n end",
"def define_action_helpers; end",
"def post_setup\n end",
"def action_methods; end",
"def action_methods; end",
"def action_methods; end",
"def before_setup; end",
"def action_run\n end",
"def execute(setup)\n @action.call(setup)\n end",
"def define_action_helpers?; end",
"def set_actions\n actions :all\n end",
"def action_done(action)\n dispatch = { :migrate => :done_migrating, :map => :done_mapping, :reduce =>\n :done_reducing, :finalize => :done_finalizing } \n self.send dispatch[action[:action]], action\n end",
"def dependencies action, &block\n @actions.each do |other|\n if action[:requires].include? other[:provide]\n block.call other\n end\n end\n end",
"def setup!\n return unless @setup_procs\n http_actions = actions\n @setup_procs.each do |setup_proc|\n proc, actions = setup_proc\n @setup__actions = actions.map do |action|\n\n action.is_a?(Regexp) ?\n http_actions.select { |a| a.to_s =~ action } :\n action.is_a?(String) && action =~ /\\A\\./ ?\n http_actions.map { |a| a.to_s << action if format?(a).include?(action) }.compact :\n action\n\n end.flatten\n self.class_exec &proc\n @setup__actions = nil\n end\n @setup_procs = nil\n end",
"def setup_handler\n end",
"def before_actions(*logic)\n self.before_actions = logic\n end",
"def set_action(opts)\n opts = check_params(opts,[:actions])\n super(opts)\n end",
"def setup(action)\n @targets.clear\n unless action.item.target_filters.empty?\n @targets = SES::TargetManager.make_targets(action)\n else\n item = action.item\n if item.for_opponent?\n @targets = $game_troop.alive_members\n elsif item.for_dead_friend?\n @targets = $game_party.battle_members.select { |actor| actor.dead? }\n else\n $game_party.battle_members.select { |actor| actor.alive? }\n end\n end\n @item_max = @targets.size\n create_contents\n refresh\n show\n activate\n end",
"def action; end",
"def action; end",
"def action; end",
"def action; end",
"def action; end",
"def revisable_shared_setup(args, block)\n class << self\n attr_accessor :revisable_options\n end\n options = args.extract_options!\n self.revisable_options = Options.new(options, &block)\n \n self.send(:include, Common)\n self.send(:extend, Validations) unless self.revisable_options.no_validation_scoping?\n self.send(:include, WithoutScope::QuotedColumnConditions)\n end",
"def workflow\n end",
"def setup\n @action = SampleActionAndroid.new(os_name: 'android',\n app_name: APP_PATH)\n end",
"def before(action)\n invoke_callbacks *self.class.send(action).before\n end",
"def process_action(...)\n send_action(...)\n end",
"def before_dispatch(env); end",
"def setup\n # override and do something appropriate\n end",
"def after_actions(*logic)\n self.after_actions = logic\n end",
"def setup(client)\n return unless @setup\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n actions.each do |action|\n action.execute(client)\n end\n self\n end",
"def setup(_context)\n end",
"def setup(resources) ; end",
"def validate_actions\n errors.add(:base, :should_give_at_least_one_action) if !manage? && !forecasting? && !read? && !api?\n end",
"def setup\n @resource_config = {\n :callbacks => {\n :before_create => nil,\n :after_create => nil,\n :before_update => nil,\n :after_update => nil,\n :before_destroy => nil,\n :after_destroy => nil,\n },\n :child_assoc => nil,\n :model => nil,\n :parent => nil,\n :path => nil,\n :permission => {},\n :properties => {},\n :relation => {\n :create => nil,\n :delete => nil,\n },\n :roles => nil,\n }\n end",
"def determine_valid_action\n\n end",
"def process_shared\n handle_taxes\n handle_shippings\n create_adjustments_from_params\n handle_status\n handle_inventory_refunds\n handle_payment_transactions\n order.updater.update\n end",
"def init_actions\n am = action_manager()\n am.add_action(Action.new(\"&Disable selection\") { @selection_mode = :none; unbind_key(32); bind_key(32, :scroll_forward); } )\n am.add_action(Action.new(\"&Edit Toggle\") { @edit_toggle = !@edit_toggle; $status_message.value = \"Edit toggle is #{@edit_toggle}\" })\n end",
"def startcompany(action)\n @done = true\n action.setup\n end",
"def event_callbacks(event, metadata={})\n case event\n when :reset, :review\n if confirmed\n update_attributes(confirmed: false)\n end\n when :confirm\n confirm\n # trigger :order for all applicable items\n # NOTE: :order event is common to both physical and digital items\n items.each do |i|\n if i.event_permitted(:order)\n user_id = last_transition.user_id\n i.trigger!(:order, { order_id: id, user_id: user_id })\n end\n end\n when :complete_work\n request = metadata[:request]\n work_complete_notification(request)\n when :close\n close\n end\n if event != :close && !open\n reopen\n end\n end",
"def setup_action\n return unless PONY::ERRNO::check_sequence(current_act)\n new_sequence = @action_sequence[@sequence_index+1...@action_sequence.size]\n @sequence_index = 0\n new_sequence = DND::SkillSequence::ACTS[@acts[1]] + new_sequence\n execute_sequence\n end",
"def define_tasks\n define_weave_task\n connect_common_tasks\n end",
"def setup(&block)\n define_method(:setup, &block)\n end",
"def setup\n transition_to(:setup)\n end",
"def setup\n transition_to(:setup)\n end",
"def action\n end",
"def setup( *args )\n\t\t\tself.class.setupBlocks.each {|sblock|\n\t\t\t\tdebugMsg \"Calling setup block method #{sblock}\"\n\t\t\t\tself.send( sblock )\n\t\t\t}\n\t\t\tsuper( *args )\n\t\tend",
"def config(action, *args); end",
"def setup\n @setup_proc.call(self) if @setup_proc\n end",
"def before_action \n end",
"def setup_callbacks\n defined_callbacks.each do |meth|\n unless respond_to?(\"call_#{meth}_callbacks\".to_sym)\n self.class.module_eval <<-EOE\n def call_#{meth}_callbacks(*args)\n plugin_store.each {|a| a.call_#{meth}_callbacks(*args) } if respond_to?(:plugin_store) && plugin_store\n self.send :#{meth}, *args if respond_to?(:#{meth})\n end\n EOE\n end\n end\n end",
"def action\n end",
"def matt_custom_action_begin(label); end",
"def setup\n # override this if needed\n end",
"def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend",
"def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend",
"def action(options,&callback)\n new_action = Action===options ? options : Action.new(options,&callback)\n # replace any with (shared name/alias or both default) + same arity\n @actions.delete_if do |existing_action|\n ((existing_action.names & new_action.names).size > 0 ||\n existing_action.default? && new_action.default?) &&\n existing_action.required.size == new_action.required.size &&\n existing_action.optional.size <= new_action.optional.size\n end\n @actions = (@actions + [new_action]).sort\n new_action\n end",
"def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action\n end",
"def after(action)\n invoke_callbacks *options_for(action).after\n end",
"def pre_task\n end",
"def setup(server)\n server.on('beforeMethod', method(:before_method), 10)\n end",
"def add_actions\n attribute = machine.attribute\n name = self.name\n \n owner_class.class_eval do\n define_method(name) {self.class.state_machines[attribute].events[name].fire(self)}\n define_method(\"#{name}!\") {self.class.state_machines[attribute].events[name].fire!(self)}\n define_method(\"can_#{name}?\") {self.class.state_machines[attribute].events[name].can_fire?(self)}\n end\n end",
"def init_actions\n @select_action = SelectAction.new\n @endpoint_mouse_action = EndpointMouseAction.new\n @move_action = MoveAction.new\n end",
"def setup_signals; end",
"def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend",
"def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend",
"def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action.respond_to?('weak!') ? action.weak! : action\n end",
"def initialize(*args)\n super\n @action = :set\nend",
"def setup\n #implement in subclass;\n end",
"def after_set_callback; end",
"def lookup_action; end",
"def setup &block\n if block_given?\n @setup = block\n else\n @setup.call\n end\n end",
"def setup_action\n return TSBS.error(@acts[0], 1, @used_sequence) if @acts.size < 2\n actions = TSBS::AnimLoop[@acts[1]]\n if actions.nil?\n show_action_error(@acts[1])\n end\n @sequence_stack.push(@acts[1])\n @used_sequence = @acts[1]\n actions.each do |acts|\n @acts = acts\n execute_sequence\n break if @break_action\n end\n @sequence_stack.pop\n @used_sequence = @sequence_stack[-1]\n end",
"def release_actions; end",
"def setup(easy)\n super\n easy.customrequest = @verb\n end",
"def around_hooks; end",
"def save_action; end",
"def action_target()\n \n end",
"def setup\n callback(:setup) do\n notify(:setup)\n migration_check.last_deployed_commit\n end\n end",
"def setup\n return unless @setup\n\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n run_actions_and_retry(actions)\n self\n end",
"def before_setup\n # do nothing by default\n end",
"def my_actions(options)\n @setup = false\n get_template_part(\"custom_used\",\"action_users\",true)\n end",
"def default_action; end",
"def setup(&blk)\n @setup_block = blk\n end",
"def callback_phase\n super\n end",
"def advice\n end",
"def _handle_action_missing(*args); end",
"def shared_action(name, &block)\n @controller.shared_actions[name] = block\n end",
"def setup_initial_state\n\n state_a = State.new(\"a\", 0)\n state_b = State.new(\"b\", 0)\n state_c = State.new(\"c\", 10)\n\n move_to_b = Action.new(\"move_to_b\", 1, state_b)\n\n move_to_c = Action.new(\"move_to_c\", 1, state_c)\n\n state_a.actions = [move_to_b, move_to_c]\n\n return state_a\n \nend",
"def before_action action, &block\n @audience[:before][action] ||= Set.new\n @audience[:before][action] << block\n end",
"def duas1(action)\n action.call\n action.call\nend"
] | [
"0.6165152",
"0.60463154",
"0.59467196",
"0.5917112",
"0.5890387",
"0.58345735",
"0.57773316",
"0.56991524",
"0.56991524",
"0.565454",
"0.5622282",
"0.54232633",
"0.54119074",
"0.54119074",
"0.54119074",
"0.53937256",
"0.53801376",
"0.5358599",
"0.53412294",
"0.5340814",
"0.53314966",
"0.53114754",
"0.52984965",
"0.52977055",
"0.5296272",
"0.5260649",
"0.5245076",
"0.52388334",
"0.52388334",
"0.52388334",
"0.52388334",
"0.52388334",
"0.5235081",
"0.52321917",
"0.5228592",
"0.5220735",
"0.52198535",
"0.52139324",
"0.5208539",
"0.5206585",
"0.5178542",
"0.5175199",
"0.5173538",
"0.5167041",
"0.51614195",
"0.51577675",
"0.5153909",
"0.51528823",
"0.5152225",
"0.51429904",
"0.5141399",
"0.51345575",
"0.51145",
"0.5114052",
"0.5114052",
"0.5110216",
"0.5108656",
"0.50935394",
"0.5089196",
"0.5081936",
"0.5079627",
"0.50675833",
"0.5056105",
"0.5053687",
"0.5050475",
"0.5050475",
"0.503471",
"0.5028311",
"0.501982",
"0.50157547",
"0.5013552",
"0.50014806",
"0.50011593",
"0.49976763",
"0.4990292",
"0.4990292",
"0.49882022",
"0.4981269",
"0.49792367",
"0.49766538",
"0.4967978",
"0.49667212",
"0.4958987",
"0.49572337",
"0.49550423",
"0.4954479",
"0.4952353",
"0.494726",
"0.4944055",
"0.4935437",
"0.4931248",
"0.49283475",
"0.49281213",
"0.49268973",
"0.4921738",
"0.49204507",
"0.4918924",
"0.49182287",
"0.4916538",
"0.49158585",
"0.49156788"
] | 0.0 | -1 |
Never trust parameters from the scary internet, only allow the white list through. | def report_orders_by_user_params
params.require(:report_orders_by_user).permit(:date_start, :date_end, :file_path)
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 |
(This method is generated in Translator_defaultbuildImpl) | def get_id
return @m_id
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def translation_target\n super\n end",
"def build; end",
"def translations; end",
"def init_translations; end",
"def build=(_arg0); end",
"def build\r\n raise \"Not implemented\"\r\n end",
"def build\r\n end",
"def build\r\n end",
"def build\n end",
"def label_translation; end",
"def build!\n end",
"def create_translations\n end",
"def translatable\n self._translatable[base_name]\n end",
"def translate(settings); end",
"def translations_hash; end",
"def build\n end",
"def setup_mass_copy_translations\n end",
"def _lex_trans_keys=(_arg0); end",
"def _lex_trans_keys=(_arg0); end",
"def _lex_trans_keys=(_arg0); end",
"def _lex_trans_keys=(_arg0); end",
"def private; end",
"def translate()\n\nend",
"def translate()\n\nend",
"def translate()\n\nend",
"def translate()\n\nend",
"def translate()\n\nend",
"def translate()\n\nend",
"def translate()\n\nend",
"def translate()\n\nend",
"def translatable\n self._translatable[base_name] ||= []\n end",
"def build(params); end",
"def _lex_trans_keys; end",
"def _lex_trans_keys; end",
"def _lex_trans_keys; end",
"def _lex_trans_keys; end",
"def translate!( *args )\n super( *args )\n reset_positions_inside\n end",
"def _lex_trans_actions; end",
"def _lex_trans_actions; end",
"def _lex_trans_actions; end",
"def _lex_trans_actions; end",
"def build\n method_proxy(:build)\n\n true\n end",
"def create_translation(other)\n end",
"def definition_builder; end",
"def definition_builder; end",
"def build(**)\n raise NotImplementedError\n end",
"def lang=(_arg0); end",
"def lang=(_arg0); end",
"def _lex_trans_actions=(_arg0); end",
"def _lex_trans_actions=(_arg0); end",
"def _lex_trans_actions=(_arg0); end",
"def _lex_trans_actions=(_arg0); end",
"def make; end",
"def translate q, target=@target_lang, source=@source_lang\n return \"[#{source}->#{target}]#{q.to_s}\"\n end",
"def build_script\n raise NotImplementedError\n end",
"def translator\n @translator ||= Translator.new\n end",
"def set_translation_target(opts)\n opts = check_params(opts,[:targets])\n super(opts)\n end",
"def build(*args)\n raise \"Method 'build' not implemented for #{self.class.name}\"\n end",
"def translate(eng_word) # here call to Max's ending code\n Multitran.translate(eng_word)\n end",
"def _lex_trans_targs; end",
"def _lex_trans_targs; end",
"def _lex_trans_targs; end",
"def _lex_trans_targs; end",
"def translate(*args, **opts); end",
"def build_html\n # the first one should not use a locale, for the default:\n generate_all_html_pages\n\n # now translate, if necessary:\n if translation.should_translate?\n translation.prepare\n translation.available_locales.each do |locale|\n translation.current_locale = locale\n generate_all_html_pages\n end\n end\n end",
"def builder; end",
"def builder; end",
"def builder; end",
"def build_gem; end",
"def _lex_trans_targs=(_arg0); end",
"def _lex_trans_targs=(_arg0); end",
"def _lex_trans_targs=(_arg0); end",
"def _lex_trans_targs=(_arg0); end",
"def create\n @user = current_user\n @project = Project.find(params[:project_id])\n @preferedlang = Language.find_by_id(@project.source_lang_id)\n @slanguages = Language.where(\"id != ?\", @preferedlang.id).order('iso_code asc') \n @slanguages.unshift(@preferedlang)\n #from railsrecipes recipe 22 - refactor\n # @user = current_user\n\n\n @mostpopulartarlang = Language.find_by_id(@project.translations.maximum(\"source_lang_id\"))\n if @mostpopulartarlang\n @tlanguages = Language.where(\"id != ?\", @mostpopulartarlang.id).order('iso_code asc')\n @tlanguages.unshift(@mostpopulartarlang)\n else\n @tlanguages = Language.order('iso_code desc')\n end\n\n\n @translation = @project.translations.build(params[:translation])\n @translation.owner_id = @user.id\n\n# @project = Project.find(params[:id])\n\n# @translation = Translation.new(params[:translation])\n# @translation.owner_id = current_user.id\n# @translation.project_id = Project.find_by_id(params[:project_id]).id\n # @user = User.find(params[:user_id])\n # @project = Project.find(params[:project_id])\n # @translation = Translation.new(params[:translation])\n # @project = current_user.projects.build\n # @translation = @project.translations.build\n # @user = current_user\n # @project = Project.find_by_user_id(@user)\n # @translation = @project.translations.build(params[:translation])\n @languages = Language.all(:order => 'iso_code')\n # #process information from checkbox\n\n if @translation.save\n flash[:notice] = \"Translation was successfully created\"\n # redirect_to user_project_translations_path(@user, @project)\n redirect_to user_project_path(current_user, @project)\n else\n render 'new'\n end\nend",
"def target_version=(_arg0); end",
"def translate(input_text, src_lang, target_lang)\n raise \"Not Implemented. Class #{self.class.name} doesn't implement translate\"\n end",
"def process_and_build_components \n end",
"def build_method\nend",
"def build_method\nend",
"def originalsourceform; end",
"def transforms; end",
"def rebuild\n build addl_cmake_bld_args: '--clean-first'\n end",
"def lang(orig); end",
"def initialize b\n @build = b\n end",
"def internal; end",
"def after_build\n cleanup_nontarget_files\n run_help_indexer\nend",
"def inject_translatable_block\n inject_into_class model_path, class_name, generate_translatable_block\n end",
"def target; end",
"def target; end",
"def inspect\n \"#<Translations (#{backend}) @names=#{names.join(\", \")}>\"\n end",
"def command_builder; end",
"def translate\n if self.products && self.products.first\n ContentTranslation.auto_translate(self, self.products.first.brand)\n end\n end",
"def check_starting(_lang_result)\n end",
"def build_with_lto(pass_manager, internalize = false, run_inliner = false)\n raise \"build_with_lto is not currently supported\"\n end",
"def mozart_german; end",
"def translated_msg(translate, message, src_lang, target_lang)\n return message unless translate \n use_src = nil \n if (src_lang.nil? || src_lang.empty?)\n # We don't need to infer again and again\n begin\n @inferred_src_lang ||= infer_languages.first\n rescue StandardError => e \n raise LangDetectionFailureException.new(\"Failed to infer language due to #{e.message}\")\n end\n use_src = @inferred_src_lang\n else\n use_src = src_lang\n end\n return message if use_src.eql?(target_lang)\n @translator.translate(message, use_src, target_lang)\n end",
"def make_dic_lists_class_from_ts_from_current_version(sFrTSFilePath, sEnTSFilePath, sJaTSFilePath, hQmFileBaseNamePath=Hash.new(), coTranslateSummaries=TranslateSummaries.new())\n#\t\tSTDOUT.puts \"Check1:#{sTSFilePath}\"\n\t\t#return false unless sFrTSFilePath =~ /_msg_(.+?)\\.ts$/\n\t\treturn false unless sFrTSFilePath =~ /_(\\w{2})\\.ts$/\n\t\tsLang = $1.to_s\n\t\tsTSFileBaseName_temp = File.basename(sFrTSFilePath).gsub(/\\.ts$/, \"\")\n\t\t#sTSFileBaseName = sTSFileBaseName_temp.gsub(/_msg_(en|ja)$/, \"_msg_fr\")\n\t\tsTSFileBaseName = sTSFileBaseName_temp.gsub(/_(en|ja)$/, \"_fr\")\n\t\t#return true if hQmFileBaseNamePath[sTSFileBaseName] == true\n\t\tsTargetTSFilePath = sFrTSFilePath.gsub(/\\.ts$/, \"\")\n\t\t#sTargetTSFilePath = sTargetTSFilePath.gsub(/_msg_(en|ja)$/, \"_msg_fr\")\n\t\tsTargetTSFilePath = sTargetTSFilePath.gsub(/_(en|ja)$/, \"_fr\")\n\t\t# modified by takeru on 2012.5.2\n\t\t# modified by takeru on 2012.5.12\n\t\tcoTranslateDicLists = coTranslateSummaries[sTSFileBaseName]\n\t\t#coTranslateDicLists = coTranslateSummaries[sTargetTSFilePath]\n\t\tif coTranslateDicLists == nil then\n\t\t\tcoTranslateDicLists = TranslateDicLists.new()\n\t\t\t#coTranslateDicLists.create_dic_lists(sTSFileBaseName, coTranslateSummaries) \n\t\t\tcoTranslateDicLists.create_dic_lists(sTSFileBaseName, coTranslateSummaries) \n\t\tend\n\n\t\t#PP.pp(coTranslateDicLists, STDERR)\n\t\t#STDERR.puts coTranslateDicLists\n\t\t# modified by takeru on 2012.5.2\n\t\t# modified by takeru on 2012.5.12\n\t\t#coTranslateDicLists.create_dic_lists(sTargetTSFilePath, coTranslateSummaries) \n\t\t\n\t\tdoc = nil\n\t\t#File.open(sTSFilePath) {|xmlfile|\n\t\t#\tdoc = REXML::Document.new(xmlfile)\n\t\t#}\n\t\t#nTotalCount = TranslateTsLIB.traverse_count_translate_tag(doc.root)\n\t\t#nCount = traverse_install_keyword(coTranslateDicLists, sLang, doc.root, nTotalCount, 0)\n\n\t\trexmlDocFr = nil\n\t\trexmlDocEn = nil\n\t\trexmlDocJa = nil\n#\t\tSTDOUT.puts \"Check2:#{sTSFilePath}\"\n\t\tif File.exist?(sFrTSFilePath) == true then\n\t\t\tFile.open(sFrTSFilePath) do |sXmlFile|\n\t\t\t\t#STDERR.puts sXmlFile\n\t\t\t\trexmlDocFr = REXML::Document.new(sXmlFile)\n\t\t\tend\n\t\telse\n\t\t\trexmlDocFr = REXML::Document.new(\"\")\n\t\tend\n\t\tif File.exist?(sEnTSFilePath) == true then\n\t\t\tFile.open(sEnTSFilePath) do |sXmlFile|\n\t\t\t\t#STDERR.puts sXmlFile\n\t\t\t\trexmlDocEn = REXML::Document.new(sXmlFile)\n\t\t\tend\n\t\telse\n\t\t\trexmlDocEn = REXML::Document.new(\"\")\n\t\tend\n\t\tif File.exist?(sJaTSFilePath) == true then\n\t\t\tFile.open(sJaTSFilePath) do |sXmlFile|\n\t\t\t\t#STDERR.puts sXmlFile\n\t\t\t\trexmlDocJa = REXML::Document.new(sXmlFile)\n\t\t\tend\n\t\telse\n\t\t\trexmlDocJa = REXML::Document.new(\"\")\n\t\tend\n\t\tTranslateTsLIB.make_dic_files_from_current_version(coTranslateDicLists, rexmlDocFr, rexmlDocEn, rexmlDocJa)\n\n\t\tPP.pp(coTranslateDicLists, STDERR)\n\t\t#STDERR.puts coTranslateDicListC\n\t\thQmFileBaseNamePath[sTSFileBaseName] = true\n\n\t\treturn true\n\n\tend",
"def transitive_tags=(_arg0); end",
"def project=(_arg0); end",
"def translator_for(t_key, template = nil, parameters = nil)\n o_translator = translators[t_key]\n if template\n translator = Translator.new(template,\n :parameters => parameters)\n if o_translator\n o_translator.flagged.each do |i|\n translator.flag_ref(i)\n end\n end\n translators[t_key] = translator\n o_translator = translator\n else\n unless o_translator\n o_translator = Translator.new({},\n :parameters => {})\n end\n end\n o_translator\n end",
"def build\n @values.fetch('ai.application.build') { \n @values['ai.application.build'] = nil\n }\n end"
] | [
"0.6882901",
"0.653592",
"0.63217664",
"0.6284657",
"0.61551243",
"0.61091876",
"0.605949",
"0.605949",
"0.60470265",
"0.59335953",
"0.5844821",
"0.5795114",
"0.5761158",
"0.56754434",
"0.56447375",
"0.5643845",
"0.5639414",
"0.5635945",
"0.5635945",
"0.5635945",
"0.5635945",
"0.563406",
"0.5602086",
"0.5602086",
"0.5602086",
"0.5602086",
"0.5602086",
"0.5602086",
"0.5602086",
"0.5602086",
"0.5539237",
"0.5517182",
"0.5505295",
"0.5505295",
"0.5505295",
"0.5505295",
"0.54820263",
"0.5475904",
"0.5475904",
"0.5475904",
"0.5475904",
"0.547027",
"0.5437076",
"0.54157394",
"0.54157394",
"0.5398866",
"0.5386972",
"0.5386972",
"0.53822404",
"0.53822404",
"0.53822404",
"0.53822404",
"0.5361637",
"0.5323374",
"0.5308725",
"0.52835053",
"0.5282656",
"0.52782214",
"0.5275988",
"0.5274997",
"0.5274997",
"0.5274997",
"0.5274997",
"0.5241623",
"0.52328515",
"0.52266777",
"0.52266777",
"0.52266777",
"0.52109337",
"0.5204789",
"0.5204789",
"0.5204789",
"0.5204789",
"0.5192355",
"0.5190386",
"0.51832217",
"0.5179127",
"0.51784027",
"0.51784027",
"0.5175266",
"0.5170668",
"0.51630884",
"0.5160946",
"0.5158187",
"0.51568115",
"0.51486707",
"0.51343715",
"0.51235247",
"0.51235247",
"0.5122161",
"0.51212776",
"0.5117833",
"0.5116379",
"0.50977826",
"0.5095889",
"0.50931627",
"0.5088532",
"0.5056332",
"0.50559413",
"0.5053341",
"0.5048526"
] | 0.0 | -1 |
(This method is generated in Translator_defaultbuildImpl) | def get_name
return @m_name
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def translation_target\n super\n end",
"def build; end",
"def translations; end",
"def init_translations; end",
"def build=(_arg0); end",
"def build\r\n raise \"Not implemented\"\r\n end",
"def build\r\n end",
"def build\r\n end",
"def build\n end",
"def label_translation; end",
"def build!\n end",
"def create_translations\n end",
"def translatable\n self._translatable[base_name]\n end",
"def translate(settings); end",
"def translations_hash; end",
"def build\n end",
"def setup_mass_copy_translations\n end",
"def _lex_trans_keys=(_arg0); end",
"def _lex_trans_keys=(_arg0); end",
"def _lex_trans_keys=(_arg0); end",
"def _lex_trans_keys=(_arg0); end",
"def private; end",
"def translate()\n\nend",
"def translate()\n\nend",
"def translate()\n\nend",
"def translate()\n\nend",
"def translate()\n\nend",
"def translate()\n\nend",
"def translate()\n\nend",
"def translate()\n\nend",
"def translatable\n self._translatable[base_name] ||= []\n end",
"def build(params); end",
"def _lex_trans_keys; end",
"def _lex_trans_keys; end",
"def _lex_trans_keys; end",
"def _lex_trans_keys; end",
"def translate!( *args )\n super( *args )\n reset_positions_inside\n end",
"def _lex_trans_actions; end",
"def _lex_trans_actions; end",
"def _lex_trans_actions; end",
"def _lex_trans_actions; end",
"def build\n method_proxy(:build)\n\n true\n end",
"def create_translation(other)\n end",
"def definition_builder; end",
"def definition_builder; end",
"def build(**)\n raise NotImplementedError\n end",
"def lang=(_arg0); end",
"def lang=(_arg0); end",
"def _lex_trans_actions=(_arg0); end",
"def _lex_trans_actions=(_arg0); end",
"def _lex_trans_actions=(_arg0); end",
"def _lex_trans_actions=(_arg0); end",
"def make; end",
"def translate q, target=@target_lang, source=@source_lang\n return \"[#{source}->#{target}]#{q.to_s}\"\n end",
"def build_script\n raise NotImplementedError\n end",
"def translator\n @translator ||= Translator.new\n end",
"def set_translation_target(opts)\n opts = check_params(opts,[:targets])\n super(opts)\n end",
"def build(*args)\n raise \"Method 'build' not implemented for #{self.class.name}\"\n end",
"def translate(eng_word) # here call to Max's ending code\n Multitran.translate(eng_word)\n end",
"def _lex_trans_targs; end",
"def _lex_trans_targs; end",
"def _lex_trans_targs; end",
"def _lex_trans_targs; end",
"def translate(*args, **opts); end",
"def build_html\n # the first one should not use a locale, for the default:\n generate_all_html_pages\n\n # now translate, if necessary:\n if translation.should_translate?\n translation.prepare\n translation.available_locales.each do |locale|\n translation.current_locale = locale\n generate_all_html_pages\n end\n end\n end",
"def builder; end",
"def builder; end",
"def builder; end",
"def build_gem; end",
"def _lex_trans_targs=(_arg0); end",
"def _lex_trans_targs=(_arg0); end",
"def _lex_trans_targs=(_arg0); end",
"def _lex_trans_targs=(_arg0); end",
"def create\n @user = current_user\n @project = Project.find(params[:project_id])\n @preferedlang = Language.find_by_id(@project.source_lang_id)\n @slanguages = Language.where(\"id != ?\", @preferedlang.id).order('iso_code asc') \n @slanguages.unshift(@preferedlang)\n #from railsrecipes recipe 22 - refactor\n # @user = current_user\n\n\n @mostpopulartarlang = Language.find_by_id(@project.translations.maximum(\"source_lang_id\"))\n if @mostpopulartarlang\n @tlanguages = Language.where(\"id != ?\", @mostpopulartarlang.id).order('iso_code asc')\n @tlanguages.unshift(@mostpopulartarlang)\n else\n @tlanguages = Language.order('iso_code desc')\n end\n\n\n @translation = @project.translations.build(params[:translation])\n @translation.owner_id = @user.id\n\n# @project = Project.find(params[:id])\n\n# @translation = Translation.new(params[:translation])\n# @translation.owner_id = current_user.id\n# @translation.project_id = Project.find_by_id(params[:project_id]).id\n # @user = User.find(params[:user_id])\n # @project = Project.find(params[:project_id])\n # @translation = Translation.new(params[:translation])\n # @project = current_user.projects.build\n # @translation = @project.translations.build\n # @user = current_user\n # @project = Project.find_by_user_id(@user)\n # @translation = @project.translations.build(params[:translation])\n @languages = Language.all(:order => 'iso_code')\n # #process information from checkbox\n\n if @translation.save\n flash[:notice] = \"Translation was successfully created\"\n # redirect_to user_project_translations_path(@user, @project)\n redirect_to user_project_path(current_user, @project)\n else\n render 'new'\n end\nend",
"def target_version=(_arg0); end",
"def translate(input_text, src_lang, target_lang)\n raise \"Not Implemented. Class #{self.class.name} doesn't implement translate\"\n end",
"def process_and_build_components \n end",
"def build_method\nend",
"def build_method\nend",
"def originalsourceform; end",
"def transforms; end",
"def rebuild\n build addl_cmake_bld_args: '--clean-first'\n end",
"def lang(orig); end",
"def initialize b\n @build = b\n end",
"def internal; end",
"def after_build\n cleanup_nontarget_files\n run_help_indexer\nend",
"def inject_translatable_block\n inject_into_class model_path, class_name, generate_translatable_block\n end",
"def target; end",
"def target; end",
"def inspect\n \"#<Translations (#{backend}) @names=#{names.join(\", \")}>\"\n end",
"def command_builder; end",
"def translate\n if self.products && self.products.first\n ContentTranslation.auto_translate(self, self.products.first.brand)\n end\n end",
"def check_starting(_lang_result)\n end",
"def build_with_lto(pass_manager, internalize = false, run_inliner = false)\n raise \"build_with_lto is not currently supported\"\n end",
"def mozart_german; end",
"def translated_msg(translate, message, src_lang, target_lang)\n return message unless translate \n use_src = nil \n if (src_lang.nil? || src_lang.empty?)\n # We don't need to infer again and again\n begin\n @inferred_src_lang ||= infer_languages.first\n rescue StandardError => e \n raise LangDetectionFailureException.new(\"Failed to infer language due to #{e.message}\")\n end\n use_src = @inferred_src_lang\n else\n use_src = src_lang\n end\n return message if use_src.eql?(target_lang)\n @translator.translate(message, use_src, target_lang)\n end",
"def make_dic_lists_class_from_ts_from_current_version(sFrTSFilePath, sEnTSFilePath, sJaTSFilePath, hQmFileBaseNamePath=Hash.new(), coTranslateSummaries=TranslateSummaries.new())\n#\t\tSTDOUT.puts \"Check1:#{sTSFilePath}\"\n\t\t#return false unless sFrTSFilePath =~ /_msg_(.+?)\\.ts$/\n\t\treturn false unless sFrTSFilePath =~ /_(\\w{2})\\.ts$/\n\t\tsLang = $1.to_s\n\t\tsTSFileBaseName_temp = File.basename(sFrTSFilePath).gsub(/\\.ts$/, \"\")\n\t\t#sTSFileBaseName = sTSFileBaseName_temp.gsub(/_msg_(en|ja)$/, \"_msg_fr\")\n\t\tsTSFileBaseName = sTSFileBaseName_temp.gsub(/_(en|ja)$/, \"_fr\")\n\t\t#return true if hQmFileBaseNamePath[sTSFileBaseName] == true\n\t\tsTargetTSFilePath = sFrTSFilePath.gsub(/\\.ts$/, \"\")\n\t\t#sTargetTSFilePath = sTargetTSFilePath.gsub(/_msg_(en|ja)$/, \"_msg_fr\")\n\t\tsTargetTSFilePath = sTargetTSFilePath.gsub(/_(en|ja)$/, \"_fr\")\n\t\t# modified by takeru on 2012.5.2\n\t\t# modified by takeru on 2012.5.12\n\t\tcoTranslateDicLists = coTranslateSummaries[sTSFileBaseName]\n\t\t#coTranslateDicLists = coTranslateSummaries[sTargetTSFilePath]\n\t\tif coTranslateDicLists == nil then\n\t\t\tcoTranslateDicLists = TranslateDicLists.new()\n\t\t\t#coTranslateDicLists.create_dic_lists(sTSFileBaseName, coTranslateSummaries) \n\t\t\tcoTranslateDicLists.create_dic_lists(sTSFileBaseName, coTranslateSummaries) \n\t\tend\n\n\t\t#PP.pp(coTranslateDicLists, STDERR)\n\t\t#STDERR.puts coTranslateDicLists\n\t\t# modified by takeru on 2012.5.2\n\t\t# modified by takeru on 2012.5.12\n\t\t#coTranslateDicLists.create_dic_lists(sTargetTSFilePath, coTranslateSummaries) \n\t\t\n\t\tdoc = nil\n\t\t#File.open(sTSFilePath) {|xmlfile|\n\t\t#\tdoc = REXML::Document.new(xmlfile)\n\t\t#}\n\t\t#nTotalCount = TranslateTsLIB.traverse_count_translate_tag(doc.root)\n\t\t#nCount = traverse_install_keyword(coTranslateDicLists, sLang, doc.root, nTotalCount, 0)\n\n\t\trexmlDocFr = nil\n\t\trexmlDocEn = nil\n\t\trexmlDocJa = nil\n#\t\tSTDOUT.puts \"Check2:#{sTSFilePath}\"\n\t\tif File.exist?(sFrTSFilePath) == true then\n\t\t\tFile.open(sFrTSFilePath) do |sXmlFile|\n\t\t\t\t#STDERR.puts sXmlFile\n\t\t\t\trexmlDocFr = REXML::Document.new(sXmlFile)\n\t\t\tend\n\t\telse\n\t\t\trexmlDocFr = REXML::Document.new(\"\")\n\t\tend\n\t\tif File.exist?(sEnTSFilePath) == true then\n\t\t\tFile.open(sEnTSFilePath) do |sXmlFile|\n\t\t\t\t#STDERR.puts sXmlFile\n\t\t\t\trexmlDocEn = REXML::Document.new(sXmlFile)\n\t\t\tend\n\t\telse\n\t\t\trexmlDocEn = REXML::Document.new(\"\")\n\t\tend\n\t\tif File.exist?(sJaTSFilePath) == true then\n\t\t\tFile.open(sJaTSFilePath) do |sXmlFile|\n\t\t\t\t#STDERR.puts sXmlFile\n\t\t\t\trexmlDocJa = REXML::Document.new(sXmlFile)\n\t\t\tend\n\t\telse\n\t\t\trexmlDocJa = REXML::Document.new(\"\")\n\t\tend\n\t\tTranslateTsLIB.make_dic_files_from_current_version(coTranslateDicLists, rexmlDocFr, rexmlDocEn, rexmlDocJa)\n\n\t\tPP.pp(coTranslateDicLists, STDERR)\n\t\t#STDERR.puts coTranslateDicListC\n\t\thQmFileBaseNamePath[sTSFileBaseName] = true\n\n\t\treturn true\n\n\tend",
"def transitive_tags=(_arg0); end",
"def project=(_arg0); end",
"def translator_for(t_key, template = nil, parameters = nil)\n o_translator = translators[t_key]\n if template\n translator = Translator.new(template,\n :parameters => parameters)\n if o_translator\n o_translator.flagged.each do |i|\n translator.flag_ref(i)\n end\n end\n translators[t_key] = translator\n o_translator = translator\n else\n unless o_translator\n o_translator = Translator.new({},\n :parameters => {})\n end\n end\n o_translator\n end",
"def build\n @values.fetch('ai.application.build') { \n @values['ai.application.build'] = nil\n }\n end"
] | [
"0.6882901",
"0.653592",
"0.63217664",
"0.6284657",
"0.61551243",
"0.61091876",
"0.605949",
"0.605949",
"0.60470265",
"0.59335953",
"0.5844821",
"0.5795114",
"0.5761158",
"0.56754434",
"0.56447375",
"0.5643845",
"0.5639414",
"0.5635945",
"0.5635945",
"0.5635945",
"0.5635945",
"0.563406",
"0.5602086",
"0.5602086",
"0.5602086",
"0.5602086",
"0.5602086",
"0.5602086",
"0.5602086",
"0.5602086",
"0.5539237",
"0.5517182",
"0.5505295",
"0.5505295",
"0.5505295",
"0.5505295",
"0.54820263",
"0.5475904",
"0.5475904",
"0.5475904",
"0.5475904",
"0.547027",
"0.5437076",
"0.54157394",
"0.54157394",
"0.5398866",
"0.5386972",
"0.5386972",
"0.53822404",
"0.53822404",
"0.53822404",
"0.53822404",
"0.5361637",
"0.5323374",
"0.5308725",
"0.52835053",
"0.5282656",
"0.52782214",
"0.5275988",
"0.5274997",
"0.5274997",
"0.5274997",
"0.5274997",
"0.5241623",
"0.52328515",
"0.52266777",
"0.52266777",
"0.52266777",
"0.52109337",
"0.5204789",
"0.5204789",
"0.5204789",
"0.5204789",
"0.5192355",
"0.5190386",
"0.51832217",
"0.5179127",
"0.51784027",
"0.51784027",
"0.5175266",
"0.5170668",
"0.51630884",
"0.5160946",
"0.5158187",
"0.51568115",
"0.51486707",
"0.51343715",
"0.51235247",
"0.51235247",
"0.5122161",
"0.51212776",
"0.5117833",
"0.5116379",
"0.50977826",
"0.5095889",
"0.50931627",
"0.5088532",
"0.5056332",
"0.50559413",
"0.5053341",
"0.5048526"
] | 0.0 | -1 |
(This method is generated in Translator_defaultbuildImpl) | def get_storage_class
return @m_storage_class
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def translation_target\n super\n end",
"def build; end",
"def translations; end",
"def init_translations; end",
"def build=(_arg0); end",
"def build\r\n raise \"Not implemented\"\r\n end",
"def build\r\n end",
"def build\r\n end",
"def build\n end",
"def label_translation; end",
"def build!\n end",
"def create_translations\n end",
"def translatable\n self._translatable[base_name]\n end",
"def translate(settings); end",
"def build\n end",
"def translations_hash; end",
"def setup_mass_copy_translations\n end",
"def _lex_trans_keys=(_arg0); end",
"def _lex_trans_keys=(_arg0); end",
"def _lex_trans_keys=(_arg0); end",
"def _lex_trans_keys=(_arg0); end",
"def private; end",
"def translate()\n\nend",
"def translate()\n\nend",
"def translate()\n\nend",
"def translate()\n\nend",
"def translate()\n\nend",
"def translate()\n\nend",
"def translate()\n\nend",
"def translate()\n\nend",
"def translatable\n self._translatable[base_name] ||= []\n end",
"def build(params); end",
"def _lex_trans_keys; end",
"def _lex_trans_keys; end",
"def _lex_trans_keys; end",
"def _lex_trans_keys; end",
"def translate!( *args )\n super( *args )\n reset_positions_inside\n end",
"def _lex_trans_actions; end",
"def _lex_trans_actions; end",
"def _lex_trans_actions; end",
"def _lex_trans_actions; end",
"def build\n method_proxy(:build)\n\n true\n end",
"def create_translation(other)\n end",
"def definition_builder; end",
"def definition_builder; end",
"def build(**)\n raise NotImplementedError\n end",
"def lang=(_arg0); end",
"def lang=(_arg0); end",
"def _lex_trans_actions=(_arg0); end",
"def _lex_trans_actions=(_arg0); end",
"def _lex_trans_actions=(_arg0); end",
"def _lex_trans_actions=(_arg0); end",
"def make; end",
"def translate q, target=@target_lang, source=@source_lang\n return \"[#{source}->#{target}]#{q.to_s}\"\n end",
"def build_script\n raise NotImplementedError\n end",
"def translator\n @translator ||= Translator.new\n end",
"def set_translation_target(opts)\n opts = check_params(opts,[:targets])\n super(opts)\n end",
"def build(*args)\n raise \"Method 'build' not implemented for #{self.class.name}\"\n end",
"def translate(eng_word) # here call to Max's ending code\n Multitran.translate(eng_word)\n end",
"def _lex_trans_targs; end",
"def _lex_trans_targs; end",
"def _lex_trans_targs; end",
"def _lex_trans_targs; end",
"def translate(*args, **opts); end",
"def build_html\n # the first one should not use a locale, for the default:\n generate_all_html_pages\n\n # now translate, if necessary:\n if translation.should_translate?\n translation.prepare\n translation.available_locales.each do |locale|\n translation.current_locale = locale\n generate_all_html_pages\n end\n end\n end",
"def builder; end",
"def builder; end",
"def builder; end",
"def build_gem; end",
"def _lex_trans_targs=(_arg0); end",
"def _lex_trans_targs=(_arg0); end",
"def _lex_trans_targs=(_arg0); end",
"def _lex_trans_targs=(_arg0); end",
"def create\n @user = current_user\n @project = Project.find(params[:project_id])\n @preferedlang = Language.find_by_id(@project.source_lang_id)\n @slanguages = Language.where(\"id != ?\", @preferedlang.id).order('iso_code asc') \n @slanguages.unshift(@preferedlang)\n #from railsrecipes recipe 22 - refactor\n # @user = current_user\n\n\n @mostpopulartarlang = Language.find_by_id(@project.translations.maximum(\"source_lang_id\"))\n if @mostpopulartarlang\n @tlanguages = Language.where(\"id != ?\", @mostpopulartarlang.id).order('iso_code asc')\n @tlanguages.unshift(@mostpopulartarlang)\n else\n @tlanguages = Language.order('iso_code desc')\n end\n\n\n @translation = @project.translations.build(params[:translation])\n @translation.owner_id = @user.id\n\n# @project = Project.find(params[:id])\n\n# @translation = Translation.new(params[:translation])\n# @translation.owner_id = current_user.id\n# @translation.project_id = Project.find_by_id(params[:project_id]).id\n # @user = User.find(params[:user_id])\n # @project = Project.find(params[:project_id])\n # @translation = Translation.new(params[:translation])\n # @project = current_user.projects.build\n # @translation = @project.translations.build\n # @user = current_user\n # @project = Project.find_by_user_id(@user)\n # @translation = @project.translations.build(params[:translation])\n @languages = Language.all(:order => 'iso_code')\n # #process information from checkbox\n\n if @translation.save\n flash[:notice] = \"Translation was successfully created\"\n # redirect_to user_project_translations_path(@user, @project)\n redirect_to user_project_path(current_user, @project)\n else\n render 'new'\n end\nend",
"def target_version=(_arg0); end",
"def translate(input_text, src_lang, target_lang)\n raise \"Not Implemented. Class #{self.class.name} doesn't implement translate\"\n end",
"def process_and_build_components \n end",
"def build_method\nend",
"def build_method\nend",
"def originalsourceform; end",
"def transforms; end",
"def rebuild\n build addl_cmake_bld_args: '--clean-first'\n end",
"def lang(orig); end",
"def initialize b\n @build = b\n end",
"def internal; end",
"def after_build\n cleanup_nontarget_files\n run_help_indexer\nend",
"def inject_translatable_block\n inject_into_class model_path, class_name, generate_translatable_block\n end",
"def target; end",
"def target; end",
"def command_builder; end",
"def inspect\n \"#<Translations (#{backend}) @names=#{names.join(\", \")}>\"\n end",
"def check_starting(_lang_result)\n end",
"def translate\n if self.products && self.products.first\n ContentTranslation.auto_translate(self, self.products.first.brand)\n end\n end",
"def build_with_lto(pass_manager, internalize = false, run_inliner = false)\n raise \"build_with_lto is not currently supported\"\n end",
"def mozart_german; end",
"def translated_msg(translate, message, src_lang, target_lang)\n return message unless translate \n use_src = nil \n if (src_lang.nil? || src_lang.empty?)\n # We don't need to infer again and again\n begin\n @inferred_src_lang ||= infer_languages.first\n rescue StandardError => e \n raise LangDetectionFailureException.new(\"Failed to infer language due to #{e.message}\")\n end\n use_src = @inferred_src_lang\n else\n use_src = src_lang\n end\n return message if use_src.eql?(target_lang)\n @translator.translate(message, use_src, target_lang)\n end",
"def make_dic_lists_class_from_ts_from_current_version(sFrTSFilePath, sEnTSFilePath, sJaTSFilePath, hQmFileBaseNamePath=Hash.new(), coTranslateSummaries=TranslateSummaries.new())\n#\t\tSTDOUT.puts \"Check1:#{sTSFilePath}\"\n\t\t#return false unless sFrTSFilePath =~ /_msg_(.+?)\\.ts$/\n\t\treturn false unless sFrTSFilePath =~ /_(\\w{2})\\.ts$/\n\t\tsLang = $1.to_s\n\t\tsTSFileBaseName_temp = File.basename(sFrTSFilePath).gsub(/\\.ts$/, \"\")\n\t\t#sTSFileBaseName = sTSFileBaseName_temp.gsub(/_msg_(en|ja)$/, \"_msg_fr\")\n\t\tsTSFileBaseName = sTSFileBaseName_temp.gsub(/_(en|ja)$/, \"_fr\")\n\t\t#return true if hQmFileBaseNamePath[sTSFileBaseName] == true\n\t\tsTargetTSFilePath = sFrTSFilePath.gsub(/\\.ts$/, \"\")\n\t\t#sTargetTSFilePath = sTargetTSFilePath.gsub(/_msg_(en|ja)$/, \"_msg_fr\")\n\t\tsTargetTSFilePath = sTargetTSFilePath.gsub(/_(en|ja)$/, \"_fr\")\n\t\t# modified by takeru on 2012.5.2\n\t\t# modified by takeru on 2012.5.12\n\t\tcoTranslateDicLists = coTranslateSummaries[sTSFileBaseName]\n\t\t#coTranslateDicLists = coTranslateSummaries[sTargetTSFilePath]\n\t\tif coTranslateDicLists == nil then\n\t\t\tcoTranslateDicLists = TranslateDicLists.new()\n\t\t\t#coTranslateDicLists.create_dic_lists(sTSFileBaseName, coTranslateSummaries) \n\t\t\tcoTranslateDicLists.create_dic_lists(sTSFileBaseName, coTranslateSummaries) \n\t\tend\n\n\t\t#PP.pp(coTranslateDicLists, STDERR)\n\t\t#STDERR.puts coTranslateDicLists\n\t\t# modified by takeru on 2012.5.2\n\t\t# modified by takeru on 2012.5.12\n\t\t#coTranslateDicLists.create_dic_lists(sTargetTSFilePath, coTranslateSummaries) \n\t\t\n\t\tdoc = nil\n\t\t#File.open(sTSFilePath) {|xmlfile|\n\t\t#\tdoc = REXML::Document.new(xmlfile)\n\t\t#}\n\t\t#nTotalCount = TranslateTsLIB.traverse_count_translate_tag(doc.root)\n\t\t#nCount = traverse_install_keyword(coTranslateDicLists, sLang, doc.root, nTotalCount, 0)\n\n\t\trexmlDocFr = nil\n\t\trexmlDocEn = nil\n\t\trexmlDocJa = nil\n#\t\tSTDOUT.puts \"Check2:#{sTSFilePath}\"\n\t\tif File.exist?(sFrTSFilePath) == true then\n\t\t\tFile.open(sFrTSFilePath) do |sXmlFile|\n\t\t\t\t#STDERR.puts sXmlFile\n\t\t\t\trexmlDocFr = REXML::Document.new(sXmlFile)\n\t\t\tend\n\t\telse\n\t\t\trexmlDocFr = REXML::Document.new(\"\")\n\t\tend\n\t\tif File.exist?(sEnTSFilePath) == true then\n\t\t\tFile.open(sEnTSFilePath) do |sXmlFile|\n\t\t\t\t#STDERR.puts sXmlFile\n\t\t\t\trexmlDocEn = REXML::Document.new(sXmlFile)\n\t\t\tend\n\t\telse\n\t\t\trexmlDocEn = REXML::Document.new(\"\")\n\t\tend\n\t\tif File.exist?(sJaTSFilePath) == true then\n\t\t\tFile.open(sJaTSFilePath) do |sXmlFile|\n\t\t\t\t#STDERR.puts sXmlFile\n\t\t\t\trexmlDocJa = REXML::Document.new(sXmlFile)\n\t\t\tend\n\t\telse\n\t\t\trexmlDocJa = REXML::Document.new(\"\")\n\t\tend\n\t\tTranslateTsLIB.make_dic_files_from_current_version(coTranslateDicLists, rexmlDocFr, rexmlDocEn, rexmlDocJa)\n\n\t\tPP.pp(coTranslateDicLists, STDERR)\n\t\t#STDERR.puts coTranslateDicListC\n\t\thQmFileBaseNamePath[sTSFileBaseName] = true\n\n\t\treturn true\n\n\tend",
"def project=(_arg0); end",
"def transitive_tags=(_arg0); end",
"def translator_for(t_key, template = nil, parameters = nil)\n o_translator = translators[t_key]\n if template\n translator = Translator.new(template,\n :parameters => parameters)\n if o_translator\n o_translator.flagged.each do |i|\n translator.flag_ref(i)\n end\n end\n translators[t_key] = translator\n o_translator = translator\n else\n unless o_translator\n o_translator = Translator.new({},\n :parameters => {})\n end\n end\n o_translator\n end",
"def build\n @values.fetch('ai.application.build') { \n @values['ai.application.build'] = nil\n }\n end"
] | [
"0.68817186",
"0.65369207",
"0.6321141",
"0.62845916",
"0.615637",
"0.6109931",
"0.60604465",
"0.60604465",
"0.60479015",
"0.5932485",
"0.5845947",
"0.57954335",
"0.5760728",
"0.5675109",
"0.5644751",
"0.56444913",
"0.5639846",
"0.56361425",
"0.56361425",
"0.56361425",
"0.56361425",
"0.5633098",
"0.56018454",
"0.56018454",
"0.56018454",
"0.56018454",
"0.56018454",
"0.56018454",
"0.56018454",
"0.56018454",
"0.55388796",
"0.5518295",
"0.5504906",
"0.5504906",
"0.5504906",
"0.5504906",
"0.5481526",
"0.54758626",
"0.54758626",
"0.54758626",
"0.54758626",
"0.54716736",
"0.5437328",
"0.5416311",
"0.5416311",
"0.5399947",
"0.5386728",
"0.5386728",
"0.5382812",
"0.5382812",
"0.5382812",
"0.5382812",
"0.5363339",
"0.5323567",
"0.53094083",
"0.52838165",
"0.5282898",
"0.52789646",
"0.5275353",
"0.5275166",
"0.5275166",
"0.5275166",
"0.5275166",
"0.52421623",
"0.52336013",
"0.5228393",
"0.5228393",
"0.5228393",
"0.5213472",
"0.5205329",
"0.5205329",
"0.5205329",
"0.5205329",
"0.51931447",
"0.5190921",
"0.5183133",
"0.5180216",
"0.5179652",
"0.5179652",
"0.51753426",
"0.5170482",
"0.5163469",
"0.5160195",
"0.51595324",
"0.51566213",
"0.5148235",
"0.5134333",
"0.5123306",
"0.5123306",
"0.51224506",
"0.5121962",
"0.5116965",
"0.5116881",
"0.50983524",
"0.5094694",
"0.509384",
"0.50898236",
"0.50563735",
"0.5056186",
"0.5053347",
"0.5049086"
] | 0.0 | -1 |
(This method is generated in Translator_defaultbuildImpl) | def api_deserialize_impl(r)
@is_new = (r).nil?
r = {} if @is_new
@is_incomplete = false
if Saklient::Util::exists_path(r, 'ID')
@m_id = (Saklient::Util::get_by_path(r, 'ID')).nil? ? nil : Saklient::Util::get_by_path(r, 'ID').to_s
else
@m_id = nil
@is_incomplete = true
end
@n_id = false
if Saklient::Util::exists_path(r, 'Name')
@m_name = (Saklient::Util::get_by_path(r, 'Name')).nil? ? nil : Saklient::Util::get_by_path(r, 'Name').to_s
else
@m_name = nil
@is_incomplete = true
end
@n_name = false
if Saklient::Util::exists_path(r, 'StorageClass')
@m_storage_class = (Saklient::Util::get_by_path(r, 'StorageClass')).nil? ? nil : Saklient::Util::get_by_path(r, 'StorageClass').to_s
else
@m_storage_class = nil
@is_incomplete = true
end
@n_storage_class = false
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def translation_target\n super\n end",
"def build; end",
"def translations; end",
"def init_translations; end",
"def build=(_arg0); end",
"def build\r\n raise \"Not implemented\"\r\n end",
"def build\r\n end",
"def build\r\n end",
"def build\n end",
"def label_translation; end",
"def build!\n end",
"def create_translations\n end",
"def translatable\n self._translatable[base_name]\n end",
"def translate(settings); end",
"def translations_hash; end",
"def build\n end",
"def setup_mass_copy_translations\n end",
"def _lex_trans_keys=(_arg0); end",
"def _lex_trans_keys=(_arg0); end",
"def _lex_trans_keys=(_arg0); end",
"def _lex_trans_keys=(_arg0); end",
"def private; end",
"def translate()\n\nend",
"def translate()\n\nend",
"def translate()\n\nend",
"def translate()\n\nend",
"def translate()\n\nend",
"def translate()\n\nend",
"def translate()\n\nend",
"def translate()\n\nend",
"def translatable\n self._translatable[base_name] ||= []\n end",
"def build(params); end",
"def _lex_trans_keys; end",
"def _lex_trans_keys; end",
"def _lex_trans_keys; end",
"def _lex_trans_keys; end",
"def translate!( *args )\n super( *args )\n reset_positions_inside\n end",
"def _lex_trans_actions; end",
"def _lex_trans_actions; end",
"def _lex_trans_actions; end",
"def _lex_trans_actions; end",
"def build\n method_proxy(:build)\n\n true\n end",
"def create_translation(other)\n end",
"def definition_builder; end",
"def definition_builder; end",
"def build(**)\n raise NotImplementedError\n end",
"def lang=(_arg0); end",
"def lang=(_arg0); end",
"def _lex_trans_actions=(_arg0); end",
"def _lex_trans_actions=(_arg0); end",
"def _lex_trans_actions=(_arg0); end",
"def _lex_trans_actions=(_arg0); end",
"def make; end",
"def translate q, target=@target_lang, source=@source_lang\n return \"[#{source}->#{target}]#{q.to_s}\"\n end",
"def build_script\n raise NotImplementedError\n end",
"def translator\n @translator ||= Translator.new\n end",
"def set_translation_target(opts)\n opts = check_params(opts,[:targets])\n super(opts)\n end",
"def build(*args)\n raise \"Method 'build' not implemented for #{self.class.name}\"\n end",
"def translate(eng_word) # here call to Max's ending code\n Multitran.translate(eng_word)\n end",
"def _lex_trans_targs; end",
"def _lex_trans_targs; end",
"def _lex_trans_targs; end",
"def _lex_trans_targs; end",
"def translate(*args, **opts); end",
"def build_html\n # the first one should not use a locale, for the default:\n generate_all_html_pages\n\n # now translate, if necessary:\n if translation.should_translate?\n translation.prepare\n translation.available_locales.each do |locale|\n translation.current_locale = locale\n generate_all_html_pages\n end\n end\n end",
"def builder; end",
"def builder; end",
"def builder; end",
"def build_gem; end",
"def _lex_trans_targs=(_arg0); end",
"def _lex_trans_targs=(_arg0); end",
"def _lex_trans_targs=(_arg0); end",
"def _lex_trans_targs=(_arg0); end",
"def create\n @user = current_user\n @project = Project.find(params[:project_id])\n @preferedlang = Language.find_by_id(@project.source_lang_id)\n @slanguages = Language.where(\"id != ?\", @preferedlang.id).order('iso_code asc') \n @slanguages.unshift(@preferedlang)\n #from railsrecipes recipe 22 - refactor\n # @user = current_user\n\n\n @mostpopulartarlang = Language.find_by_id(@project.translations.maximum(\"source_lang_id\"))\n if @mostpopulartarlang\n @tlanguages = Language.where(\"id != ?\", @mostpopulartarlang.id).order('iso_code asc')\n @tlanguages.unshift(@mostpopulartarlang)\n else\n @tlanguages = Language.order('iso_code desc')\n end\n\n\n @translation = @project.translations.build(params[:translation])\n @translation.owner_id = @user.id\n\n# @project = Project.find(params[:id])\n\n# @translation = Translation.new(params[:translation])\n# @translation.owner_id = current_user.id\n# @translation.project_id = Project.find_by_id(params[:project_id]).id\n # @user = User.find(params[:user_id])\n # @project = Project.find(params[:project_id])\n # @translation = Translation.new(params[:translation])\n # @project = current_user.projects.build\n # @translation = @project.translations.build\n # @user = current_user\n # @project = Project.find_by_user_id(@user)\n # @translation = @project.translations.build(params[:translation])\n @languages = Language.all(:order => 'iso_code')\n # #process information from checkbox\n\n if @translation.save\n flash[:notice] = \"Translation was successfully created\"\n # redirect_to user_project_translations_path(@user, @project)\n redirect_to user_project_path(current_user, @project)\n else\n render 'new'\n end\nend",
"def target_version=(_arg0); end",
"def translate(input_text, src_lang, target_lang)\n raise \"Not Implemented. Class #{self.class.name} doesn't implement translate\"\n end",
"def process_and_build_components \n end",
"def build_method\nend",
"def build_method\nend",
"def originalsourceform; end",
"def transforms; end",
"def rebuild\n build addl_cmake_bld_args: '--clean-first'\n end",
"def lang(orig); end",
"def initialize b\n @build = b\n end",
"def internal; end",
"def after_build\n cleanup_nontarget_files\n run_help_indexer\nend",
"def inject_translatable_block\n inject_into_class model_path, class_name, generate_translatable_block\n end",
"def target; end",
"def target; end",
"def inspect\n \"#<Translations (#{backend}) @names=#{names.join(\", \")}>\"\n end",
"def command_builder; end",
"def translate\n if self.products && self.products.first\n ContentTranslation.auto_translate(self, self.products.first.brand)\n end\n end",
"def check_starting(_lang_result)\n end",
"def build_with_lto(pass_manager, internalize = false, run_inliner = false)\n raise \"build_with_lto is not currently supported\"\n end",
"def mozart_german; end",
"def translated_msg(translate, message, src_lang, target_lang)\n return message unless translate \n use_src = nil \n if (src_lang.nil? || src_lang.empty?)\n # We don't need to infer again and again\n begin\n @inferred_src_lang ||= infer_languages.first\n rescue StandardError => e \n raise LangDetectionFailureException.new(\"Failed to infer language due to #{e.message}\")\n end\n use_src = @inferred_src_lang\n else\n use_src = src_lang\n end\n return message if use_src.eql?(target_lang)\n @translator.translate(message, use_src, target_lang)\n end",
"def make_dic_lists_class_from_ts_from_current_version(sFrTSFilePath, sEnTSFilePath, sJaTSFilePath, hQmFileBaseNamePath=Hash.new(), coTranslateSummaries=TranslateSummaries.new())\n#\t\tSTDOUT.puts \"Check1:#{sTSFilePath}\"\n\t\t#return false unless sFrTSFilePath =~ /_msg_(.+?)\\.ts$/\n\t\treturn false unless sFrTSFilePath =~ /_(\\w{2})\\.ts$/\n\t\tsLang = $1.to_s\n\t\tsTSFileBaseName_temp = File.basename(sFrTSFilePath).gsub(/\\.ts$/, \"\")\n\t\t#sTSFileBaseName = sTSFileBaseName_temp.gsub(/_msg_(en|ja)$/, \"_msg_fr\")\n\t\tsTSFileBaseName = sTSFileBaseName_temp.gsub(/_(en|ja)$/, \"_fr\")\n\t\t#return true if hQmFileBaseNamePath[sTSFileBaseName] == true\n\t\tsTargetTSFilePath = sFrTSFilePath.gsub(/\\.ts$/, \"\")\n\t\t#sTargetTSFilePath = sTargetTSFilePath.gsub(/_msg_(en|ja)$/, \"_msg_fr\")\n\t\tsTargetTSFilePath = sTargetTSFilePath.gsub(/_(en|ja)$/, \"_fr\")\n\t\t# modified by takeru on 2012.5.2\n\t\t# modified by takeru on 2012.5.12\n\t\tcoTranslateDicLists = coTranslateSummaries[sTSFileBaseName]\n\t\t#coTranslateDicLists = coTranslateSummaries[sTargetTSFilePath]\n\t\tif coTranslateDicLists == nil then\n\t\t\tcoTranslateDicLists = TranslateDicLists.new()\n\t\t\t#coTranslateDicLists.create_dic_lists(sTSFileBaseName, coTranslateSummaries) \n\t\t\tcoTranslateDicLists.create_dic_lists(sTSFileBaseName, coTranslateSummaries) \n\t\tend\n\n\t\t#PP.pp(coTranslateDicLists, STDERR)\n\t\t#STDERR.puts coTranslateDicLists\n\t\t# modified by takeru on 2012.5.2\n\t\t# modified by takeru on 2012.5.12\n\t\t#coTranslateDicLists.create_dic_lists(sTargetTSFilePath, coTranslateSummaries) \n\t\t\n\t\tdoc = nil\n\t\t#File.open(sTSFilePath) {|xmlfile|\n\t\t#\tdoc = REXML::Document.new(xmlfile)\n\t\t#}\n\t\t#nTotalCount = TranslateTsLIB.traverse_count_translate_tag(doc.root)\n\t\t#nCount = traverse_install_keyword(coTranslateDicLists, sLang, doc.root, nTotalCount, 0)\n\n\t\trexmlDocFr = nil\n\t\trexmlDocEn = nil\n\t\trexmlDocJa = nil\n#\t\tSTDOUT.puts \"Check2:#{sTSFilePath}\"\n\t\tif File.exist?(sFrTSFilePath) == true then\n\t\t\tFile.open(sFrTSFilePath) do |sXmlFile|\n\t\t\t\t#STDERR.puts sXmlFile\n\t\t\t\trexmlDocFr = REXML::Document.new(sXmlFile)\n\t\t\tend\n\t\telse\n\t\t\trexmlDocFr = REXML::Document.new(\"\")\n\t\tend\n\t\tif File.exist?(sEnTSFilePath) == true then\n\t\t\tFile.open(sEnTSFilePath) do |sXmlFile|\n\t\t\t\t#STDERR.puts sXmlFile\n\t\t\t\trexmlDocEn = REXML::Document.new(sXmlFile)\n\t\t\tend\n\t\telse\n\t\t\trexmlDocEn = REXML::Document.new(\"\")\n\t\tend\n\t\tif File.exist?(sJaTSFilePath) == true then\n\t\t\tFile.open(sJaTSFilePath) do |sXmlFile|\n\t\t\t\t#STDERR.puts sXmlFile\n\t\t\t\trexmlDocJa = REXML::Document.new(sXmlFile)\n\t\t\tend\n\t\telse\n\t\t\trexmlDocJa = REXML::Document.new(\"\")\n\t\tend\n\t\tTranslateTsLIB.make_dic_files_from_current_version(coTranslateDicLists, rexmlDocFr, rexmlDocEn, rexmlDocJa)\n\n\t\tPP.pp(coTranslateDicLists, STDERR)\n\t\t#STDERR.puts coTranslateDicListC\n\t\thQmFileBaseNamePath[sTSFileBaseName] = true\n\n\t\treturn true\n\n\tend",
"def transitive_tags=(_arg0); end",
"def project=(_arg0); end",
"def translator_for(t_key, template = nil, parameters = nil)\n o_translator = translators[t_key]\n if template\n translator = Translator.new(template,\n :parameters => parameters)\n if o_translator\n o_translator.flagged.each do |i|\n translator.flag_ref(i)\n end\n end\n translators[t_key] = translator\n o_translator = translator\n else\n unless o_translator\n o_translator = Translator.new({},\n :parameters => {})\n end\n end\n o_translator\n end",
"def build\n @values.fetch('ai.application.build') { \n @values['ai.application.build'] = nil\n }\n end"
] | [
"0.6882901",
"0.653592",
"0.63217664",
"0.6284657",
"0.61551243",
"0.61091876",
"0.605949",
"0.605949",
"0.60470265",
"0.59335953",
"0.5844821",
"0.5795114",
"0.5761158",
"0.56754434",
"0.56447375",
"0.5643845",
"0.5639414",
"0.5635945",
"0.5635945",
"0.5635945",
"0.5635945",
"0.563406",
"0.5602086",
"0.5602086",
"0.5602086",
"0.5602086",
"0.5602086",
"0.5602086",
"0.5602086",
"0.5602086",
"0.5539237",
"0.5517182",
"0.5505295",
"0.5505295",
"0.5505295",
"0.5505295",
"0.54820263",
"0.5475904",
"0.5475904",
"0.5475904",
"0.5475904",
"0.547027",
"0.5437076",
"0.54157394",
"0.54157394",
"0.5398866",
"0.5386972",
"0.5386972",
"0.53822404",
"0.53822404",
"0.53822404",
"0.53822404",
"0.5361637",
"0.5323374",
"0.5308725",
"0.52835053",
"0.5282656",
"0.52782214",
"0.5275988",
"0.5274997",
"0.5274997",
"0.5274997",
"0.5274997",
"0.5241623",
"0.52328515",
"0.52266777",
"0.52266777",
"0.52266777",
"0.52109337",
"0.5204789",
"0.5204789",
"0.5204789",
"0.5204789",
"0.5192355",
"0.5190386",
"0.51832217",
"0.5179127",
"0.51784027",
"0.51784027",
"0.5175266",
"0.5170668",
"0.51630884",
"0.5160946",
"0.5158187",
"0.51568115",
"0.51486707",
"0.51343715",
"0.51235247",
"0.51235247",
"0.5122161",
"0.51212776",
"0.5117833",
"0.5116379",
"0.50977826",
"0.5095889",
"0.50931627",
"0.5088532",
"0.5056332",
"0.50559413",
"0.5053341",
"0.5048526"
] | 0.0 | -1 |
GET /species GET /species.json | def index
@species = Species.eager_load(:family, :species_locations, :images).order('families.name')
respond_to do |format|
format.html {
not_found
}
format.xml { render :xml => @species }
format.json {
render :template => 'species/index.json'
}
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def show\n @species = Specie.find(params[:id])\n\n @pets = Pet.where(:specie_id => @species).all\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: {:secie => @species, :pets => @pets } }\n end\n end",
"def show\n dinosaurs = Dinosaur.filter_by_species(params[:species])\n\n if dinosaurs\n render json: dinosaurs\n else\n render json: dinosaurs.errors, status: :unprocessable_entity\n end\n end",
"def show\n @species = Species.find(params[:id])\n @animals = Animal.where(:species_id => @species.id).order(\"name ASC\")\n \n respond_with(@species)\n end",
"def show\n @species = Species.find(params[:id])\n @animals = Animal.where(species_id: @species.id).order('name ASC')\n\n respond_with(@species)\n end",
"def index\n @species = Species.all\n end",
"def index\n @species = Species.all\n end",
"def index\n @search = Species.includes(:animals).organization(current_user).search(params[:q])\n @species = @search.result.paginate(page: params[:page], per_page: 10).order('updated_at DESC')\n\n respond_with(@species)\n end",
"def show\n @specie = Specie.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @specie }\n end\n end",
"def index\n @search = Species.includes(:animals).organization(current_user).search(params[:q])\n @species = @search.result.paginate(:page => params[:page], :per_page => 10).order(\"updated_at DESC\")\n \n respond_with(@species)\n end",
"def species_url()\n\t\t@species = @pokemon_api[\"species\"][\"url\"]\n\t\treturn @species\n\tend",
"def species_request(pokemon_data)\n\t\tspecies_request = HTTParty.get(pokemon_data.species_url)\n\t\tspecies = PokeapiSpecies.new(species_request)\n\t\treturn species\n\tend",
"def sites_by_species\n respond_to do |format|\n format.html \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 species\n @species\n end",
"def show\n @variety = Variety.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @variety }\n end\n end",
"def show \n bird = Bird.find_by(id: params[:id])\n if bird \n render bird.json: {id: bird.id, name: bird.name, species: bird.species}\n else \n render {\"Bird not found\"}\n end\nend",
"def set_species\n @species = Species.find(params[:id])\n end",
"def set_species\n @species = Species.find(params[:id])\n end",
"def set_species\n @species = Species.find(params[:id])\n end",
"def set_species\n @species = Fishery.friendly.find(params[:id]).species\n end",
"def show\n @owner = Owner.find(params[:id])\n @species = Species.find(:all, :order => \"name ASC\")\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @owner }\n end\n end",
"def show\n @species = Species.find_by_name(params[:species_name])\n @pet = Pet.first(:conditions => ['species_id = ? AND regid = ?', @species.id, params[:regid]])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @pet }\n end\n end",
"def show\n @socio = Socio.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @socio }\n end\n end",
"def new\n @species = Species.new\n\n respond_with(@species)\n end",
"def show\n @socio = Socio.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @socio }\n end\n end",
"def index # public\n if params[:shelter_id]\n set_shelter\n render json: @shelter.animals\n else\n @animals = Animal.includes(:shelter).all\n render 'index.json.jbuilder'\n end\n end",
"def index\n @varieties = Variety.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @varieties }\n end\n end",
"def show\n @genotype = Genotype.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @genotype }\n end\n end",
"def species\n return text_get(1, id)\n end",
"def create\n @species = Species.new(species_params)\n\n respond_to do |format|\n if @species.save\n format.html { redirect_to @species, notice: 'Species was successfully created.' }\n format.json { render :show, status: :created, location: @species }\n else\n format.html { render :new }\n format.json { render json: @species.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n\t\trespond_with Species.create(species_params)\n\tend",
"def show\n @study = Study.find(params[:id])\n render json: @study\n end",
"def species=(species)\n @species = species\n return @species\n end",
"def show \n bird = Bird.find(params[:id])\n if bird \n render json: bird.slice(:id, :name, :species)\n else \n render json: {message: \"Bird not found\"}\n end\n # {id: bird.id, name: bird.name, species: bird.species}\n end",
"def name\n self.species\n end",
"def species\r\n villagers.map{ |villager| villager.species}\r\n end",
"def show\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @neuropsychologist }\n end\n end",
"def show\n render json: @dog\n end",
"def show\n @socioeconomic_study = SocioeconomicStudy.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n\n\n format.json { render json: @socioeconomic_study }\n end\n end",
"def species; end",
"def show\n render json: @shelter\n end",
"def index\n @specialties = Specialty.all\n\n render json: @specialties\n end",
"def make_species\n EndangeredSpecies::Scraper.new.make_species\n end",
"def show\n @especy = Especie.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @especy }\n end\n end",
"def show\n pet = BattlePet.find(params[:id])\n render json: pet, status: :ok\n end",
"def show\n @moose = Moose.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @moose }\n end\n end",
"def index\n info = Aws.get_recipes_from_db\n render :json => info\n end",
"def species(year = Time.zone.now.year)\n bg_species = Species.joins(birds: {user: :subscriptions})\n .with_translations([I18n.locale])\n .where(\"(birds.published = 'true') AND (birds.species_id IS NOT NULL) AND (birds.expert_id IS NOT NULL) \")\n .where('birds.big_year = ?', year)\n .where('subscriptions.year = ?', year)\n .distinct('species.id')\n bg_species.sort_by { |s| s.name } #TODO:: user sql order\n end",
"def show\n @major = Major.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @major }\n end\n end",
"def index\n @shoes = Shoe.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @shoes }\n end\n end",
"def show\n @family = get_family(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @family }\n end\n end",
"def show\n @sitio = Sitio.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @sitio }\n end\n end",
"def show\n @county = County.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @county }\n end\n end",
"def show\n render json: @hero\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 @coisa = Coisa.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @coisa }\n end\n end",
"def show\n render json: @pet\n end",
"def show\n @pet = Pet.find_by(id: params[:id])\n if @pet\n render json: @pet\n else\n render json: {}, status: 404\n end\n end",
"def show\n @shichoson = Shichoson.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @shichoson }\n end\n end",
"def show\n recipe = Recipe.find(params[:id])\n # recipes = Recipe.find_by(params[:id])\n # render json: recipe\n render json: recipe\n end",
"def show\n @therapist = Therapist.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @therapist }\n end\n end",
"def hotness artist\n url = \"http://developer.echonest.com/api/v4/artist/hotttnesss?api_key=#{ECHONEST_API_KEY}&name=#{artist}&format=json\"\n result = parseURL url\n result[\"response\"][\"artist\"][\"hotttnesss\"]\nend",
"def show\n @fixture = Fixture.find(params[:id])\n\n respond_to do |format|\n format.json { render json: @fixture }\n end\n end",
"def familiarity artist\n url = \"http://developer.echonest.com/api/v4/artist/familiarity?api_key=#{ECHONEST_API_KEY}&name=#{artist}&format=json\"\n result = parseURL url\n result[\"response\"][\"artist\"][\"familiarity\"]\nend",
"def show\n @gene_name = GeneName.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @gene_name }\n end\n end",
"def show\n @taxonomy = Taxonomy.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @taxonomy }\n end\n end",
"def show\n @shoe = Shoe.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @shoe }\n end\n end",
"def index\n @heroes = Hero.all\n\n render json: @heroes\n end",
"def show\n dog = Dog.find(params[:id])\n render json: dog\n end",
"def show\n @human_name = HumanName.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @human_name }\n end\n end",
"def show\n @human = Human.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @human }\n end\n end",
"def show\n @human = Human.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @human }\n end\n end",
"def show\n @county = Entity.where(id: params[:id]).where(entity_type: 'County').first\n respond_with(@county) do |format|\n format.geojson { render text: @county.to_geojson }\n end\n end",
"def show\n render json: Server.where(name: params[:name]).first\n end",
"def show\n @galaxy = Galaxy.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @galaxy }\n end\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 @socioeconomic_studies = SocioeconomicStudy.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @socioeconomic_studies }\n end\n end",
"def show\n @spaethi = Spaethi.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @spaethi }\n end\n end",
"def show\n @ginasio = Ginasio.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @ginasio }\n end\n end",
"def show\n @kind = Kind.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @kind }\n end\n end",
"def show\n @food = Food.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @food }\n end\n end",
"def food_info(food_id)\n get(\"/foods/#{food_id}.json\")\n end",
"def show\n @study = Study.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @study }\n end\n end",
"def show\n @galaxies_lenticular_galaxy = Galaxies::LenticularGalaxy.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @galaxies_lenticular_galaxy }\n end\n end",
"def show\n\n @food = Food.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @food }\n end\n end",
"def show\n @stone = Stone.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @stone }\n end\n end",
"def show\n @housing_feature = HousingFeature.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @housing_feature }\n end\n end",
"def show\n render json: @car\n end",
"def show\n @ope_kind = OpeKind.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @ope_kind }\n end\n end",
"def index\n if params[:species_name].nil?\n @dinosaurs = Dinosaur.all\n else\n @dinosaurs = Species.name_filter(params[:species_name]).joins :dinosaurs\n end\n #TODO generate errors for invalid parameters/valuies\n exposes @dinosaurs\n end",
"def show\n render json: @recipe\n end",
"def show\n @forest = Forest.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @forest }\n end\n end",
"def index\n @genotypes = Genotype.paginate(:page => params[:page], :per_page => 10)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @genotypes }\n end\n end",
"def show\n @taxon = Taxon.find(params[:id])\n @page_title = @taxon.common_name\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: [@taxon.as_json(:include => { :sightings => { :include => [ :trip ] }, :locations => { }, :photos => { :include => [ :taxon, :trip, :location ], :methods => [ :photo_URL ] } } )]}\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 set_species\n @species_selected = Species.friendly.find(params[:id])\n end",
"def show\n @component = service.components.find_by(slug: params[:id])\n\n render json: @component\n end",
"def show\n @harvesting = Harvesting.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @harvesting }\n end\n end",
"def show\n @harvesting = Harvesting.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @harvesting }\n end\n end"
] | [
"0.74926984",
"0.7128608",
"0.7106667",
"0.7081946",
"0.6837834",
"0.6837834",
"0.66536605",
"0.66435784",
"0.6591989",
"0.6590886",
"0.6578471",
"0.6507737",
"0.64643115",
"0.64603895",
"0.63464314",
"0.63357216",
"0.63233966",
"0.631391",
"0.631391",
"0.62862813",
"0.62586594",
"0.61682105",
"0.6161191",
"0.61495805",
"0.6124888",
"0.61122996",
"0.6060346",
"0.6052701",
"0.60510653",
"0.60356456",
"0.60250103",
"0.59498316",
"0.59433067",
"0.59410775",
"0.5936456",
"0.59305155",
"0.59081966",
"0.59041715",
"0.58826816",
"0.5881848",
"0.58765876",
"0.58657736",
"0.5849013",
"0.5848341",
"0.5837238",
"0.5836948",
"0.58304244",
"0.58296037",
"0.5828137",
"0.5807357",
"0.58004415",
"0.57852906",
"0.5782968",
"0.57758534",
"0.57741827",
"0.57741827",
"0.5773733",
"0.57660216",
"0.57571685",
"0.57570237",
"0.5754657",
"0.5734515",
"0.573233",
"0.5727887",
"0.57171726",
"0.5704482",
"0.5700193",
"0.56971526",
"0.569054",
"0.56758285",
"0.56717104",
"0.56662226",
"0.56662226",
"0.5663136",
"0.5660563",
"0.566013",
"0.566005",
"0.5660002",
"0.5655938",
"0.56540686",
"0.56535846",
"0.5651767",
"0.56499714",
"0.56477326",
"0.5646654",
"0.56450874",
"0.5643678",
"0.5642822",
"0.5641388",
"0.5641319",
"0.5641148",
"0.5637974",
"0.5633332",
"0.5624894",
"0.5624595",
"0.5623653",
"0.56216705",
"0.5620764",
"0.56136084",
"0.56136084"
] | 0.6781164 | 6 |
Use callbacks to share common setup or constraints between actions. | def set_species
@species_selected = Species.friendly.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 species_params
params(:species).permit(:species_locations_attributes => [:lat, :lon])
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 valid_params_request?; 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 filtering_params\n params.permit(:email)\n end",
"def ip_address_params\n\t\t\tparams.require(:ip_address).permit!\n end",
"def valid_params(params)\n params.permit(:user_id, :photo_id, :originX, :originY, :width, :height)\n end",
"def reserved_params\n params.require(:reserved).permit(:name, :email, :pax, :address, :KTP, :title)\n end",
"def pull_request_params\n whitelist = [\n :url,\n :id,\n :html_url,\n :diff_url,\n :patch_url,\n :issue_url,\n :number,\n :state,\n :locked,\n :title\n ]\n params.require(:pull_request).permit(whitelist)\n end",
"def post_params\n if current_user.admin? \n params.permit(:title, :body, :city, :country, :gps_location, :privacy, :visible, :latitude, :longitude, images: [], files: [])\n else \n params.permit(:title, :body, :city, :country, :gps_location, :privacy,:latitude, :longitude, images: [], files: [])\n end \n end",
"def list_params\n params.permit(:name)\n end",
"def filter_parameters; end",
"def filter_parameters; end",
"def vineyard_params\n params.permit(:vineyard_name, :email, :website_url, :phone, :address, :city, :region, :postcode, :country, :specialty, :description, :pet_friendly, :holiday, :tours, :events, :family_friendly, :cover_image, :image_one, :image_two, :image_three, :image_four, :user_id, :base64)\n end",
"def available_activity_params\n # params.require(:available_activity).permit(:type,:geometry,:properties)\n whitelisted = ActionController::Parameters.new({\n type: params.require(:available_activity)[:type],\n geometry: params.require(:available_activity)[:geometry].try(:permit!).to_h,\n properties: params.require(:available_activity)[:properties].try(:permit!).to_h\n }).try(:permit!)\n end",
"def user_params\n params.permit(:name, :username, :email, :password, :img_url, :bg_url, :coinbank)\n end",
"def user_params_pub\n\t \tparams[:user].permit(:hruid)\n\t end",
"def user_params\n params.permit(:id, :email, :password, :nickname, :status, :avatar, :flat_picture, :flatsharing_id, :member,\n :user, :color, :solde)\n end",
"def validate_search_inputs\n @whitelisted = params.fetch(:user, nil)\n if @whitelisted.blank?\n render_error(400, \"#{I18n.t('general_error.params_missing_key')}\": [I18n.t('general_error.params_missing_value', model: \"review\")])\n return\n else\n @whitelisted = @whitelisted.permit(:name, :uen, :description)\n end\n end",
"def url_whitelist; end",
"def param_whitelist\n [\n :title,\n :description,\n :organization,\n :team_id,\n :started_at,\n :finished_at,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n end",
"def admin_social_network_params\n params.require(:social_network).permit!\n end",
"def 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 permit_request_params\n params.permit(:address)\n end",
"def sensitive_params=(params)\n @sensitive_params = params\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 backend_user_params\n params.permit!\n end",
"def url_params\n params[:url].permit(:full)\n end",
"def filter_params\n\t\treturn params[:candidate].permit(:name_for_filter)\n\tend",
"def user_params\n params.permit(:name, :age, :username, :display_photo, :password)\n end",
"def speed_measurement_params\n\n #fuckit, to lazy to deal with permit crap right now\n ActionController::Parameters.permit_all_parameters = true\n\n params[:speed_measurement]\n end",
"def get_params\r\n #params.require(:article).permit(:title, :permalink, :content, :source_site, :introtext, :type_id, :order_by, :searchable, :created_by, :edited_by, :published_by, :published_on, :user_id)\r\n params.require(:article).permit!\r\n\r\n end",
"def pub_params\n params.require(:pub).permit(:name, :description, :phone, :email, :hidden, :city_id, :address)\n end",
"def 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.6981273",
"0.6783789",
"0.67460483",
"0.6742222",
"0.67354137",
"0.65934366",
"0.65028495",
"0.6497783",
"0.64826745",
"0.6479415",
"0.6456823",
"0.6440081",
"0.63800216",
"0.6376521",
"0.636652",
"0.6319898",
"0.6300256",
"0.62994003",
"0.6293621",
"0.6292629",
"0.6291586",
"0.629103",
"0.6282451",
"0.6243152",
"0.62413",
"0.6219024",
"0.6213724",
"0.62103724",
"0.61945",
"0.61786324",
"0.61755824",
"0.6173267",
"0.6163613",
"0.6153058",
"0.61521065",
"0.6147508",
"0.61234015",
"0.61168665",
"0.6107466",
"0.6106177",
"0.6091159",
"0.60817343",
"0.6071238",
"0.6062299",
"0.6021663",
"0.60182893",
"0.6014239",
"0.6011563",
"0.60080767",
"0.60080767",
"0.60028875",
"0.60005623",
"0.59964156",
"0.5993086",
"0.5992319",
"0.5992299",
"0.59801805",
"0.59676576",
"0.59606016",
"0.595966",
"0.59591126",
"0.59589803",
"0.5954058",
"0.5953234",
"0.5944434",
"0.5940526",
"0.59376484",
"0.59376484",
"0.5935253",
"0.5930846",
"0.5926387",
"0.59256274",
"0.5917907",
"0.5910841",
"0.590886",
"0.59086543",
"0.59060425",
"0.58981544",
"0.5898102",
"0.5896809",
"0.5895416",
"0.58947027",
"0.58923644",
"0.5887903",
"0.58830196",
"0.5880581",
"0.5873854",
"0.58697754",
"0.5869004",
"0.58669055",
"0.5866886",
"0.58664906",
"0.5864619",
"0.58630043",
"0.5862495",
"0.5861368",
"0.5859712",
"0.5855544",
"0.58551925",
"0.5851284",
"0.5850602"
] | 0.0 | -1 |
A method we're giving you. This "flattens" Arrays of Arrays so: [[1,2], [3,4,5], [6]] => [1,2,3,4,5,6]. | def flatten_a_o_a(aoa)
result = []
i = 0
while i < aoa.length do
k = 0
while k < aoa[i].length do
result << aoa[i][k]
k += 1
end
i += 1
end
result
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def flatten(array)\n new_array = []\n array.each do |x|\n if x.class == Array\n x.each {|y| new_array.push(y)}\n else\n new_array.push(x)\n end\n end\n new_array\nend",
"def flatten_array(array, result = [])\n array.each do |element|\n if element.is_a? Array\n flatten_array(element, result)\n else\n result << element\n end\n end\n result\nend",
"def using_flatten(array)\n array.flatten()\nend",
"def using_flatten(array)\n \n array.flatten\n \nend",
"def using_flatten(array)\n array.flatten\n end",
"def flatten_array(arr)\n arr.flatten\nend",
"def flatten(array, result = [])\n array.each do |element|\n if element.is_a?(Array)\n flatten(element, result)\n else\n result << element\n end\n end\n result\nend",
"def one_line_flatten(array, ret = [])\n array.each { |x| x.is_a?(Array) ? one_line_flatten(x, ret) : ret << x }; ret\nend",
"def using_flatten(array)\n array.flatten\nend",
"def using_flatten(array)\n array.flatten\nend",
"def flatten(array)\n container = []\n\n array.each do |element|\n if element.is_a?(Array)\n container += element\n else\n container << element\n end\n end\n\n container\nend",
"def using_flatten(arr)\n arr.flatten\nend",
"def using_flatten (array)\n return array.flatten!\nend",
"def flatten(array)\n return [] if array.empty?\n\n res = []\n array.each do |el|\n if el.is_a? Array\n res += flatten(el)\n else\n res << el\n end\n end\n res\nend",
"def using_flatten(array)\n array.flatten\n \nend",
"def using_flatten(array)\n array.flatten\nend",
"def using_flatten(array)\n array.flatten\nend",
"def using_flatten(array)\n array.flatten\nend",
"def using_flatten(array)\n array.flatten\nend",
"def using_flatten(array)\n array.flatten\nend",
"def using_flatten(array)\n array.flatten\nend",
"def flatten(array)\n array.flatten(1)\nend",
"def flatten(array)\n array.flatten(1)\nend",
"def flatt(arr, flat_arr = [])\n arr.each do |element|\n if element.is_a?(Array)\n flatt(element, flat_arr)\n else\n flat_arr << element\n end\n end\n flat_arr\nend",
"def flat(a)\n\tnew_arr = []\n\ta.each do |el|\n\t\tif el.is_a? Array\n\t\t\tel.each do |n|\n\t\t\t\tif el.is_a? Array\n\t\t\t\t\ta << n\n\t\t\t\telse\n\t\t\t\t\tnew_arr << n\n\t\t\t\tend\n\t\t\tend\n\t\telse\n\t\t\tnew_arr << el\t\n\t\tend\n\tend\n\tp new_arr\nend",
"def flatten(nested_array, result = [])\n nested_array.each do |integer|\n if integer.class == Array\n flatten(integer, result)\n else\n result << integer\n end\n end\n result\nend",
"def flatten(array)\n a = []\n array.each do |n|\n if n.is_a? Array\n b = flatten(n)\n b.each { |x| a << x }\n else\n a << n\n end\n end\n a\nend",
"def flatten(*args)\n new_array = []\n self.each do |v|\n if v.is_a?(Array)\n new_array.push( *(v.flatten(*args)) )\n else\n new_array << v\n end\n end\n new_array\n end",
"def arr\n a = [1,2,[3,4,[5]]]\n return a.flatten\nend",
"def my_flatten\n arr = []\n i = 0\n while i < self.length\n if self[i].is_a? Array\n arr += self[i].my_flatten\n else\n arr << self[i]\n end\n i += 1\n end\n return arr\n end",
"def flatten\n\t\tmake_flat(@array)\n\tend",
"def applying_flatten array_value\n return array_value.flatten!\n end",
"def recursive_flatten(incoming_array, new_flattened_array = [])\n incoming_array.each do |item|\n if item.class == Array\n # Recursion\n recursive_flatten(item, new_flattened_array)\n else\n new_flattened_array << item\n end\n end\n new_flattened_array\n end",
"def my_flatten(array)\n print array.flatten\n end",
"def flatten!\n\t\t@array = make_flat(@array)\n\tend",
"def multi_dimensional_sum(array)\n array.flatten\nend",
"def my_flatten\n flattened = []\n self.my_each do |el|\n if el.is_a? Array\n flattened += el.my_flatten\n else\n flattened << el\n end\n end\n flattened\n end",
"def my_flatten\n flattened = []\n self.my_each do |el|\n el.is_a?(Array) ? flattened += el.my_flatten : flattened << el\n end\n flattened\n end",
"def my_flatten\n flattened = []\n self.my_each do |el|\n el.is_a?(Array) ? flattened.concat(el.my_flatten) : flattened << el\n end\n flattened\n end",
"def my_flatten\n # return self unless self.is_a?(Array)\n new_arr = []\n self.each do |el|\n if el.is_a?(Array)\n new_arr += el.my_flatten\n else\n new_arr << el\n end\n end\n new_arr\n end",
"def flatten() end",
"def flatten(array)\n raise NonArrayError, 'argument must be an array' unless array.is_a? Array\n\n array.each_with_object([]) do |element, memo|\n if element.is_a?(Array)\n memo.push(*flatten(element))\n else\n memo.push(element)\n end\n end\nend",
"def flatten!() end",
"def flatten(data, level = 0)\n return [data] unless data.is_a?(Array) \n flat = []\n data.each do |ele|\n if ele.is_a?(Array)\n flat += flatten(ele, level + 1)\n else\n flat << ele\n end\n end\n flat\nend",
"def flatten(a, flat=[])\n if a.class != Array\n # base case\n flat << a\n else\n a.each {|v| flatten(v, flat)}\n end\n flat\nend",
"def flat(arr1=[],arr2=[],i=0)\n if i >= arr1.length\n return arr2\n else\n if arr1[i].kind_of?(Array)\n flat(arr1[i],arr2) \n else\n arr2.push(arr1[i])\n end\n return flat(arr1,arr2,i+1)\n end\nend",
"def my_flatten\n flattened_array = []\n each do |item|\n if item.class != Array\n flattened_array << item\n else\n #recursevly call my flatten\n item.my_flatten.each { |sub_item| flattened_array << sub_item }\n end\n end\n flattened_array\n end",
"def flatten(arr)\n\n flat = []\n\n arr.each do |el|\n if el.class != Array\n flat << el \n else\n #flatten(el).each {|char| flat << char}\n flat.push(*flatten(el))\n end\n end\n flat \nend",
"def flatten(array)\n return [] if array.empty? \n list = []\n head = array[0]\n rest = array[1..-1]\n if head.is_a? Array \n flatten(head) + flatten(rest)\n else \n list += [head] + flatten(rest)\n end \nend",
"def zip_and_flatten(array1,array2)\t\n\t\t(array1.zip(array2)).flatten(1).reject{|x| x.nil?}\n\tend",
"def my_flatten(arr, flattened_arr = [])\nend",
"def unflatten(flat_array)\n result = []\n x = 0\n\n while x < flat_array.length do \n if flat_array[x] < 3 \n result.push flat_array[x]\n x += 1\n else\n temp = [*flat_array[x...x + flat_array[x]]]\n result.push temp \n x += flat_array[x]\n end\n end\n result \nend",
"def test_fix_nested_array\n array = [1, [2], [3, [4,[5]]], 6]\n array = array.flatten\n assert_equal [1,2,3,4,5,6], array\n end",
"def flattened_results\n\n f2 = results.flatten(2)\n f2.any? ? [ f2.shift ] + f2.flatten(2) : []\n end",
"def my_flatten_recursive \n results = []\n self.my_each do |ele|\n if ele.is_a? Array \n results.concat(ele.my_flatten_recursive)\n else \n results<< ele\n end\n end\n results\n\n end",
"def flatten\n map {|item| item.respond_to?(:flatten) ? item.flatten : item }.flatten\n end",
"def to_flat_array\n ary = Array.new(self.size)\n self.each.with_index { |v,i| ary[i] = v }\n ary\n end",
"def flatten_deeper(array)\n array.collect { |element| element.respond_to?(:flatten) ? element.flatten : element }.flatten\n end",
"def sub_arrays(arr)\n sub_arr = []\n i_arr = []\n arr.length.times do |x|\n arr.map do |ele1|\n i_arr += [ele1]\n sub_arr << i_arr\n end\n i_arr = []\n arr.shift\n end\n sub_arr\nend",
"def _recursively_flatten_to!(array, out)\n array.each do |o|\n if NodeList === o\n _recursively_flatten_to!(o.nodes, out)\n elsif o.respond_to?(:to_ary)\n ary = Array === o ? o : o.to_ary\n _recursively_flatten_to!(ary, out)\n else\n out << o\n end\n end\n end",
"def array_subsets(arr)\n return arr if arr.length == 0 || arr.length == 1\n new_arr = []\n new_arr << [arr[0]] + array_subsets(arr[1..-1])\n \n # length = 1\n # new_arr = [[]]\n # while length <= arr.length\n # arr.each do |el|\n # new_arr << Array.new(length) { el }\n # end\n # length += 1\n # end\nend",
"def double_array(array)\n array.concat(array)\nend",
"def flatten(list)\n list.flatten\nend",
"def array_joiner( *arr)\n p arr\n array = [] \n array << arr\n array.flatten.flatten\n\nend",
"def flatten_array(arr)\n arr.each_with_object([]) do |item, flat|\n if item.is_a? Integer\n flat << item\n else\n flatten_array(item).each do |num|\n flat << num\n end\n end\n end\nend",
"def flatten_aoi_recursive(array)\n return nil if array.nil?\n result = []\n array.each do |element|\n if element.is_a?(Array)\n f_array = flatten_aoi_recursive(element)\n f_array.each do |f_element|\n result << f_element\n end\n else\n result << element\n end\n end\n result\nend",
"def flatten_vertically(arrs)\n result = []\n arrs = arrs.map {|sub| sub.is_a?(Array) ? sub.dup : Array(sub)}\n until arrs.empty?\n arrs.reject! do |arr|\n result << arr.shift\n arr.empty?\n end\n end\n result\n end",
"def union(*arr)\n final =[] #setting up an array to populate\n #--- Iterate through outer and inner arrays to shovel in single elements\n arr.each do |inner_array|\n inner_array.each do |elem|\n final << elem\n end\n end\n #--- Return a single array with elements\n return final\n end",
"def my_flatten(final_arr = []) \n self.my_each do |el|\n debugger\n if el.class == Integer\n final_arr << el\n else\n el.my_flatten(final_arr)\n end\n end\n result\n end",
"def convert_1_level_deep(arr, result=[])\n arr.flatten.each_slice(3) { |ele| result.push(ele)}\n result\nend",
"def array_concat(array_1, array_2)\n\treturn (array_1 << array_2).flatten\nend",
"def array_concat (*args)\n\t\tfull = Array.new\n\t\targs.each { |item|\n\t\t\tfull << item\n\t\t}\n\n\t\tfull.flatten!\n\t\tfull\n\tend",
"def array_subsets(arr)\n return [[]] if arr.empty?\n partial_subset = array_subsets(arr[0..-2])\n addition = partial_subset.map {|ele| ele + [arr[-1]]}\n partial_subset + addition\nend",
"def test_flatten_once\n ary = [1, [2, [3, 4]], [5]]\n flatter_ary = [1, 2, [3, 4], 5]\n assert_equal flatter_ary, OneLiner.flatten_once(ary)\n end",
"def join_arrays(arr1,arr2)\n arr1.concat(arr2)\nend",
"def array_concat(array_1, array_2)\n\tcombined_array=Array.new\n\tcombined_array.push(array_1, array_2)\n\treturn combined_array.flatten\nend",
"def union(*arrays)\n arrays.flatten\nend",
"def flatten\n dup\n end",
"def my_controlled_flatten(n)\n flattened = []\n self.my_each do |el|\n if n > 0 && el.is_a?(Array)\n flattened += el.my_controlled_flatten(n - 1)\n else\n flattened << el\n end\n end\n flattened\n end",
"def flatten_a_o_a(aoa)\n result = []\n x = 0\n while x < aoa.length do\n y = 0\n while y < aoa[x].length do\n result.push(aoa[x][y])\n y += 1\n end\n x += 1\n end\n return result\nend",
"def array_of_array_multi(array)\n # YOUR CODE HERE\n multiArr = array.map{ |arr| arr.map{ |num| num * num } }\n p multiArr\n p array\n # array\nend",
"def flatten_grid\n height = grid.row_size\n width = grid.column_size\n for i in 0...height\n for j in 0...width\n @grid[i,j].flatten!\n end\n end\n end",
"def test_flatten_once\n ary = [1, [2, [3, 4]]]\n flatter_ary = [1, 2, [3, 4]]\n assert_equal flatter_ary, OneLiner.flatten_once(ary)\n end",
"def flatten!\n # buggerit\n raise NotImplementedError\n end",
"def my_controlled_flatten(n)\n return self if n == 0\n result = []\n self.each do |el|\n result << el unless el.is_a? Array\n result += el.my_controlled_flatten(n - 1) if el.is_a? Array\n end\n result\n end",
"def my_controlled_flatten(n)\n return self if n == 0\n result = []\n self.each do |el|\n result << el unless el.is_a? Array\n result += el.my_controlled_flatten(n - 1) if el.is_a? Array\n end\n result\n end",
"def array_concat(array_1, array_2)\n array_2.each {|x| array_1.push(x).to_a}\n return array_1\n \nend",
"def flatten!\n self.replace(flatten)\n end",
"def interleave(arr1,arr2)\n arr1.zip(arr2).flatten\nend",
"def flatten_ranges\n new = []\n \n flatten.sort_by(&:begin).each do |range|\n if new.last.nil?\n new << range\n else\n last = new.pop + range\n\n new = last.is_a?(Array) ?\n new.old_plus(last) : (new << last)\n end\n end\n\n array = Array.new(new).flatten\n array.length == 1 ? array[0] : array\n end",
"def flatten_sequence(list); end",
"def multi_dimensional_sum(array)\n result = array.flatten.inject { |single, ele| single + ele}\n result\nend",
"def interzip(array1, array2)\n array1.zip(array2).flatten\nend",
"def array_concat(array_1, array_2)\n # Your code here\n combined_array = []\n\n array_1.each { |i| \n combined_array.push(i)\n }\n\n array_2.each do |j| \n combined_array.push(j)\n end\n\n return combined_array\nend",
"def combined_array(multid_array)\n new_array = Array.new(multid_array.first.count) { |x| Array.new }\n\n multid_array.each do |array|\n array.each_index do |index|\n new_array[index] = new_array[index] + array[index]\n end\n end\n\n return new_array\n end",
"def my_transpose(arr) \n new_arr = []\n (0...arr.length).each do |outer_el| # the second dimension of a matrix\n outer_arr = []\n (0...arr.length).each do |inner_el| \n outer_arr << arr[inner_el][outer_el] # flip everything inside the array and place in the outer_arr\n end\n new_arr << outer_arr # nest that outer_arr inside the new_arr\n end\n new_arr\nend",
"def jagged_transpose(arrays)\n max_length = arrays.map{ |a| a.length }.max\n arrays.map{ |a| a.fill(0, a.length, max_length - a.length) }.transpose\n end",
"def flatten!\n nil\n end",
"def interleave(array1, array2)\n array1.zip(array2).flatten\nend",
"def interleave(array1, array2)\n array1.zip(array2).flatten\nend",
"def interleave(array1, array2)\n array1.zip(array2).flatten\nend"
] | [
"0.78232366",
"0.7692211",
"0.7686781",
"0.7621407",
"0.7619965",
"0.7610996",
"0.7607118",
"0.75867724",
"0.7550593",
"0.7550593",
"0.75319374",
"0.7515053",
"0.7506415",
"0.75036424",
"0.7501594",
"0.74890965",
"0.74890965",
"0.74890965",
"0.74890965",
"0.74890965",
"0.74890965",
"0.74815035",
"0.74815035",
"0.7446066",
"0.7435731",
"0.73955846",
"0.73926336",
"0.7388383",
"0.7326936",
"0.73208505",
"0.72392637",
"0.71711785",
"0.71643263",
"0.7056634",
"0.701948",
"0.6886056",
"0.6882747",
"0.6873736",
"0.68632793",
"0.6860016",
"0.68516225",
"0.681959",
"0.68151426",
"0.67977566",
"0.67582893",
"0.6741959",
"0.6721064",
"0.6713723",
"0.6683899",
"0.6645652",
"0.6619562",
"0.66194266",
"0.65879995",
"0.6579442",
"0.6565696",
"0.6523603",
"0.6484371",
"0.645252",
"0.64335036",
"0.64148664",
"0.6411312",
"0.6403092",
"0.6398689",
"0.63814783",
"0.6352753",
"0.63520557",
"0.63486797",
"0.6339226",
"0.6338999",
"0.6293384",
"0.62519836",
"0.62506396",
"0.6232178",
"0.62211233",
"0.62142277",
"0.6190869",
"0.61629474",
"0.61542344",
"0.61438525",
"0.6129436",
"0.6119616",
"0.6101277",
"0.6099639",
"0.6082841",
"0.60733664",
"0.60733664",
"0.6060214",
"0.605691",
"0.6055061",
"0.6039914",
"0.6030536",
"0.6030386",
"0.6029554",
"0.60271454",
"0.6024577",
"0.6020031",
"0.60174644",
"0.6004892",
"0.6004495",
"0.6004495",
"0.6004495"
] | 0.0 | -1 |
Your code after this point | def movies_with_director_key(name, movies_collection)
dir_movie_array = []
movie_index = 0
while movie_index < movies_collection.length do
dir_movie_array << movie_with_director_name(name, movies_collection[movie_index])
movie_index += 1
end
dir_movie_array
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def probers; 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 post_process; end",
"def run() end",
"def private; end",
"def refutal()\n end",
"def finished; end",
"def finish()\n #This is a stub, used for indexing\n end",
"def schubert; end",
"def post_loop; end",
"def suivre; end",
"def after; end",
"def after; end",
"def reap; end",
"def after_processing_hook; end",
"def after_cycle; end",
"def at_end; end",
"def run\n end",
"def starting; end",
"def finalized; end",
"def perform\n \n end",
"def after_processing\n end",
"def running; end",
"def running; end",
"def pre_loop; end",
"def post_init\n end",
"def final; end",
"def run\n end",
"def processor; end",
"def done; end",
"def post_process\n end",
"def run\n \n end",
"def run\n \n end",
"def next()\n \n end",
"def next()\n \n end",
"def ready; end",
"def ready; end",
"def zuruecksetzen()\n end",
"def apply\n\t\t\n\tend",
"def apply\n\t\t\n\tend",
"def finish; end",
"def finish; end",
"def finish; end",
"def finish; end",
"def finish; end",
"def finish; end",
"def finish; end",
"def finish; end",
"def postloop\n end",
"def resume()\n #This is a stub, used for indexing\n end",
"def weber; end",
"def run\n end",
"def run\n end",
"def process; end",
"def process; end",
"def process; end",
"def process; end",
"def process; end",
"def process; end",
"def process; end",
"def process; end",
"def refresh; end",
"def advance; end",
"def advance; end",
"def advance; 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 finish\r\n #\r\n end",
"def retire\n\n end",
"def after\n end",
"def post_init\n end",
"def do()\r\n\tend",
"def finalize\n end",
"def start_after; end",
"def stage; end",
"def stage; end",
"def placebo?; false end"
] | [
"0.6601133",
"0.6556763",
"0.6556763",
"0.6556763",
"0.6556763",
"0.6556763",
"0.6556763",
"0.6556763",
"0.6556763",
"0.6556763",
"0.65511525",
"0.6542253",
"0.65339035",
"0.6486297",
"0.63979787",
"0.6376763",
"0.6359356",
"0.632939",
"0.6325425",
"0.62865126",
"0.62865126",
"0.6275538",
"0.62609935",
"0.6224737",
"0.6191572",
"0.61789227",
"0.61537975",
"0.61483485",
"0.6126145",
"0.61172795",
"0.6110218",
"0.6110218",
"0.61007947",
"0.60856456",
"0.60855955",
"0.60769194",
"0.60507745",
"0.6045479",
"0.60286397",
"0.6028629",
"0.6028629",
"0.6025522",
"0.6025522",
"0.6011969",
"0.6011969",
"0.5992806",
"0.59801537",
"0.59801537",
"0.59757483",
"0.59757483",
"0.59757483",
"0.59757483",
"0.59757483",
"0.59757483",
"0.59757483",
"0.59757483",
"0.5968721",
"0.5968407",
"0.5961687",
"0.59549886",
"0.59549886",
"0.59549224",
"0.59549224",
"0.59549224",
"0.59549224",
"0.59549224",
"0.59549224",
"0.59549224",
"0.59549224",
"0.594973",
"0.59351534",
"0.59351534",
"0.59351534",
"0.59335864",
"0.59335864",
"0.59335864",
"0.59335864",
"0.59335864",
"0.59335864",
"0.59335864",
"0.59335864",
"0.59335864",
"0.59335864",
"0.59335864",
"0.59335864",
"0.59335864",
"0.59335864",
"0.59335864",
"0.59335864",
"0.59335864",
"0.59335864",
"0.59216076",
"0.59124255",
"0.5906291",
"0.59007084",
"0.58989424",
"0.5897196",
"0.58823156",
"0.5880755",
"0.5880755",
"0.5876448"
] | 0.0 | -1 |
End of Your Code Region Don't edit the following code! Make the methods above work with this method call code. You'll have to "seesaw" to get this to work! | def studios_totals(nds)
a_o_a_movies_with_director_names = movies_with_directors_set(nds)
movies_with_director_names = flatten_a_o_a(a_o_a_movies_with_director_names)
return gross_per_studio(movies_with_director_names)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def private; end",
"def schubert; end",
"def probers; end",
"def weber; end",
"def refutal()\n end",
"def zuruecksetzen()\n end",
"def who_we_are\r\n end",
"def suivre; end",
"def spouse; end",
"def calls; end",
"def calls; end",
"def rossini; end",
"def villian; end",
"def call\n\n\tend",
"def call\n\n\tend",
"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 terpene; 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 custom; end",
"def custom; end",
"def how_it_works\r\n end",
"def jack_handey; end",
"def strain; end",
"def under; end",
"def cobasysprog\n end",
"def spice; end",
"def run\n \n end",
"def run\n \n end",
"def callbacks; end",
"def callbacks; end",
"def methods; end",
"def methods; end",
"def methods; end",
"def methods; end",
"def guct\n end",
"def invention; end",
"def eplore\n end",
"def call\n end",
"def berlioz; end",
"def operations; end",
"def operations; end",
"def sharing \n end",
"def methods() end",
"def mitch_hedberg; end",
"def whiny; end",
"def bellini; end",
"def main\n\n end",
"def retire\n\n end",
"def ready; end",
"def ready; end",
"def private_method\n end",
"def code; end",
"def code; end",
"def code; end",
"def code; end",
"def code; end",
"def code; end",
"def code; end",
"def waiver\n end",
"def run\n end",
"def implementation; end",
"def implementation; end",
"def autorun; end",
"def scientist; end",
"def stderrs; end",
"def celebration; end",
"def functions\n\n end",
"def test03_L1DLT03_TC_24418\n\t\t#skipping for now, currently unable to interact with the \"Like\" button\n\tend",
"def p15\n\t\nend",
"def relatorios\n end",
"def specie; end",
"def specie; end",
"def specie; end",
"def specie; end",
"def call() end",
"def call\n end",
"def apis; end",
"def ...\nend",
"def do()\r\n\tend",
"def run\n end",
"def internal; end",
"def method\n\t\t# code code\n\tend",
"def before_run; end",
"def pausable; end",
"def heroine; end",
"def onLoad\n end"
] | [
"0.674975",
"0.66719484",
"0.6555628",
"0.6523894",
"0.6433259",
"0.6353814",
"0.6320868",
"0.63047004",
"0.6243553",
"0.62368774",
"0.62368774",
"0.6209098",
"0.61626875",
"0.61532307",
"0.61532307",
"0.61210454",
"0.61210454",
"0.61210454",
"0.61210454",
"0.61210454",
"0.61210454",
"0.61210454",
"0.61210454",
"0.6094692",
"0.60679877",
"0.60679877",
"0.60679877",
"0.60679877",
"0.60679877",
"0.60679877",
"0.60679877",
"0.60679877",
"0.60679877",
"0.60661817",
"0.60661817",
"0.604612",
"0.60219026",
"0.6010846",
"0.5928421",
"0.5922041",
"0.58827823",
"0.58597803",
"0.58597803",
"0.5852466",
"0.5852466",
"0.5843843",
"0.5843843",
"0.5843843",
"0.5843843",
"0.584277",
"0.5840161",
"0.58389574",
"0.58228034",
"0.5819661",
"0.5813588",
"0.5813588",
"0.58124614",
"0.5808735",
"0.5790878",
"0.57838124",
"0.57707846",
"0.5762863",
"0.5762664",
"0.5762209",
"0.5762209",
"0.5762036",
"0.5757284",
"0.5757284",
"0.5757284",
"0.5757284",
"0.5757284",
"0.5757284",
"0.5757284",
"0.5753282",
"0.5732073",
"0.57161105",
"0.57161105",
"0.5705193",
"0.5704235",
"0.56955194",
"0.56930506",
"0.5691909",
"0.56745493",
"0.5673425",
"0.5664692",
"0.5658943",
"0.5658943",
"0.5658943",
"0.5658943",
"0.5654389",
"0.56536496",
"0.56471556",
"0.5646084",
"0.5636041",
"0.56167936",
"0.56082296",
"0.5605384",
"0.5586496",
"0.55824226",
"0.55714583",
"0.5569692"
] | 0.0 | -1 |
Like book! but doesn't throw | def book_safe!(room)
book! room
rescue RestClient::Exception
false
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def keep_it_in\n raise \"rawr\"\nrescue\n # ahem\nend",
"def boom\n raise \"boom\"\n end",
"def exception; end",
"def exception; end",
"def exception; end",
"def exception; end",
"def exception; end",
"def exception\n raise \"It's a bad one!\"\n end",
"def exceptions; end",
"def throw(symb, *rest) end",
"def sharp; accidental; end",
"def awaken!\n\t\traise 'Not implemented'\n\tend",
"def continued_exception; end",
"def catch_exceptions; end",
"def miss_reason; end",
"def raise(exception); end",
"def best_hand\n raise\n end",
"def regardless(&block)\n yield\nrescue\nend",
"def fail\n\t\t# throw up this code and feed plezi your own lines :)\n\t\traise \"Plezi raising hell!\"\n\tend",
"def too_many_hops?; end",
"def miss_reason=(_arg0); end",
"def missed?; end",
"def br3ak\n raise RuntimeError, \"OMFG!!1!\"\n end",
"def missing?; 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_print_books_negative\n\t\tassert_raises(\"Cannot have fewer than 0 books\") { print_books(-1,-1) }\n\tend",
"def raise(*rest) end",
"def raise(*rest) end",
"def foo\n return raise\n#> xxxxxx\n end",
"def pass?\n raise \"NYI\"\n end",
"def is_exception?; end",
"def silly_adjective; end",
"def pass\n throw :pass\n end",
"def big_bad; end",
"def complain\n\n end",
"def throw _args\n \"throw _args;\" \n end",
"def bye; end",
"def continued_exception=(_arg0); end",
"def faint; end",
"def faint; end",
"def wont_throw(sym, msg=nil)\n ThrowAssay.refute!(sym, :message=>msg, :backtrace=>caller, &self)\n end",
"def rescue_action(e); raise e; end",
"def phantom_load_raise?(e); end",
"def hermes_catchphrase; end",
"def abort_on_exception(*) end",
"def x\n # ...\nrescue\n # ...\nend",
"def abort_on_exception=(*) end",
"def cause; end",
"def cause; end",
"def try_soft_loud\n begin\n yield\n rescue => e\n puts \"PROBLEM!! #{e}\"\n puts e.backtrace\n end\nend",
"def test_wrong_play\n \tassert_raise (SyntaxError) {RockPaperScissors.play('huracan')}\n \tend",
"def invalid; end",
"def boomtown!\n e = ArgumentError.new(\"BOOMTOWN\")\n report(e)\n end",
"def simple_blind_ror\n \n end",
"def safely\n yield\n rescue Exception\n nil\n end",
"def exception_on_syntax_error=(_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 ignores; end",
"def false a\n # catch cuts\n catch :rubylog_cut do\n a.prove { return }\n end\n yield\n end",
"def rescue_from(exception); end",
"def consume_bad_url; end",
"def semact?; false; end",
"def refute_throws(sym, msg=nil, &blk)\n ThrowFailure.refute(sym, :message=>msg, :backtrace=>caller, &blk)\n end",
"def error?; end",
"def error?; end",
"def error?; end",
"def raise_deprecations; end",
"def try &bk\n yield\n rescue Exception => ex\n ex\n end",
"def one\n too { yield }\nendbegin;1;rescue => e1;e1;end",
"def hiss; end",
"def exception(*rest) end",
"def retry!\n raise 'Not implemented!'\n end",
"def ignore; end",
"def catch_phrase; end",
"def catch_phrase; end",
"def missing; end",
"def reason(*) end",
"def original_exception; end",
"def almost_die\n puts 'Eva almost die!'\n end",
"def wrapped_exception; end",
"def my_method\n\nrescue\n\nend",
"def as_you_like_it_quote; end",
"def fail\n # no-op\n end",
"def test_extra_tweet\n assert_raises(Exceptions::InvalidTweet) { @storm.tweet_content(25) }\n end",
"def a_method(num)\n if num >= 10\n raise ArgumentError, \"Please don't. Just don't.\"\n return\n end\n\n puts \"Good number: #{num}\"\nend",
"def complain something\n puts angry_dude_format something\n end",
"def abort_on_exception=(_arg0); end",
"def example_failed(_)\n end",
"def guard; end",
"def foo(bar)\n unless allowed?(bar)\n raise \"bad bar: #{bar.inspect}\"\n end\nend",
"def abort; end",
"def abort; end",
"def abort; end",
"def never?; end",
"def suivre; end",
"def fatal?; end",
"def fatal?; end",
"def t__79!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in(__method__, 24)\n\n type = T__79\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 30:9: 'throws'\n match(\"throws\")\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out(__method__, 24)\n\n end"
] | [
"0.6861369",
"0.6712461",
"0.6515613",
"0.6515613",
"0.6515613",
"0.6515613",
"0.6515613",
"0.64641786",
"0.6450136",
"0.64198446",
"0.638035",
"0.6380043",
"0.628864",
"0.62843823",
"0.627845",
"0.626154",
"0.621801",
"0.61744595",
"0.615924",
"0.61458874",
"0.60940135",
"0.60820353",
"0.60301805",
"0.602498",
"0.59950376",
"0.5993077",
"0.5980981",
"0.5980981",
"0.59562683",
"0.5954421",
"0.5946375",
"0.5939274",
"0.593697",
"0.593127",
"0.5931131",
"0.59213096",
"0.5907404",
"0.58963406",
"0.5892827",
"0.5892827",
"0.58900136",
"0.58864313",
"0.58716565",
"0.58401024",
"0.5807183",
"0.57760733",
"0.57744175",
"0.57627374",
"0.57627374",
"0.57421017",
"0.5735486",
"0.5730267",
"0.57241607",
"0.5717276",
"0.57127166",
"0.57045585",
"0.57042485",
"0.57042485",
"0.57042485",
"0.57042485",
"0.5697926",
"0.56850076",
"0.56698287",
"0.56478655",
"0.5627756",
"0.56277084",
"0.56265324",
"0.56265324",
"0.56265324",
"0.5623137",
"0.5616649",
"0.56158143",
"0.56123084",
"0.5612024",
"0.55991226",
"0.55905324",
"0.55861294",
"0.55861294",
"0.558545",
"0.5584591",
"0.55836666",
"0.5574812",
"0.55745643",
"0.5572632",
"0.5570145",
"0.55675685",
"0.55540246",
"0.55370307",
"0.55231804",
"0.5507596",
"0.54977",
"0.5495182",
"0.5494623",
"0.5487879",
"0.5487879",
"0.5487879",
"0.5475827",
"0.54651195",
"0.5461883",
"0.5461883",
"0.5461552"
] | 0.0 | -1 |
Time duration of the event | def duration
finished? ? finished_at.to_f - started_at.to_f : -1
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def duration; end",
"def duration; end",
"def duration; end",
"def duration; end",
"def duration; end",
"def duration\n self.end_time - self.start_time\n end",
"def duration\n self.end - time\n end",
"def duration; ((endtime()- starttime()) / 60).to_i; end",
"def duration\n 30\n end",
"def durations; end",
"def end_time\n start_time + event.event_type.length.minutes\n end",
"def duration\n\t\tt =(Time.now- @start)\n\t\treturn t\n\tend",
"def duration\n @duration\n end",
"def duration\n (Time.now.to_f - @start) * 1000\n end",
"def duration\n @duration ||= timestamp_delta / 256.0\n end",
"def duration # (in seconds)\n if self.end_time and self.start_time \n return (self.end_time - self.start_time).to_i\n end\n walk_time.to_i +\n transit_time.to_i +\n wait_time.to_i\n end",
"def duration\n (finish - start)/3600\n end",
"def duration\n TingYun::Helper.time_to_millis(@exit_timestamp - @entry_timestamp)\n end",
"def event_duration(event)\n days = hours = minutes = nil\n\n difference = (event.end_at - event.start_at).to_i\n\n days, difference = difference / 86400, difference % 86400\n hours, difference = difference / 3600, difference % 3600\n minutes, difference = difference / 60, difference % 60\n\n if days >= 1\n days += 1 if hours > 12 # round up\n t(\"events.show.duration.days\", count: days)\n elsif hours < 1\n t(\"events.show.duration.minutes\", minutes: minutes)\n else\n hours, minutes = \"%02d\" % hours, \"%02d\" % minutes\n t(\"events.show.duration.hours\", count: hours, minutes: minutes)\n end\n end",
"def duration\n if start_time && end_time\n end_time.to_i - start_time.to_i\n else\n 0.0\n end\n end",
"def end_time\n start_time + duration\n end",
"def duration\n (@stop_time.nil? ? Time.now : @stop_time) - @start_time\n end",
"def duration\n 0\n end",
"def time_duration\n t1 = Time.now.to_f\n Time.now.to_f - t1\nend",
"def duration\n return @duration\n end",
"def duration\n return @duration\n end",
"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 duration\n vpm * 0.01\n end",
"def time_remaining\n\n end",
"def duration\n data.duration\n end",
"def time\n end_time - start_time\n end",
"def timeInterval()\n\t\t@duration\n\tend",
"def get_duration\n ((finish - start) / 60 / 60) - (break_length / 60)\n end",
"def calc_duration\n @duration = (Time.now - @start) * 1000.0\n end",
"def duration=(_arg0); end",
"def entry_duration(entry)\n (entry.scheduled_datetime - entry.completed_datetime) / 1.hour\n end",
"def time_remaining\n end",
"def time\n each_item.reduce(0) { |a, e| a + e.duration }\n end",
"def time_elapsed\n\t\treturn Time.now - self.start_time\n\tend",
"def total_time; end",
"def duration()\n\t\t\treturn @duration\n\t\tend",
"def shift_duration #get the duration of a shift\n ((self.start_time && self.end_time) ? self.end_time - self.start_time : 0)/60/60\n end",
"def duration\n @started_at ? Time.now - @started_at : nil\n end",
"def duration\n start = start_time.to_i\n end_with_delay = end_time.to_i + (@parts.last.target_delay * 1.minutes)\n\n end_with_delay - start\n end",
"def duration\n @duration ||= tick * @data.values[0].length\n end",
"def duration\n @ole.Duration\n end",
"def duration\n @ole.Duration\n end",
"def duration\n @ole.Duration\n end",
"def getDuration\r\n\t\t\t\t\treturn @duration\r\n\t\t\t\tend",
"def duration\n return -1.0 if @start_time.nil? || @end_time.nil?\n (@end_time - @start_time) / 60.0\n end",
"def duration\n @duration ||=\n self.starts_at && self.ends_at &&\n ((self.ends_at - self.starts_at) / 60.0 / 60.0)\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 duration\n raw_duration.to_f/time_scale\n end",
"def duration\n raw_duration.to_f/time_scale\n end",
"def transition_time\n end",
"def time_elapsed\n Time.now - @start_time\n end",
"def duration\n 1 + (@end_date - @start_date).to_i\n end",
"def process_duration\n return 0.0 unless process_ended_at && process_started_at\n\n (process_ended_at - process_started_at).ceil(3)\n end",
"def duration\n @end_date - @begin_date\n end",
"def get_duration\n duration_instance.span\n end",
"def time_elapsed\n if !self.finished.blank?\n ((self.finished - self.started) / 60).to_i\n end\n end",
"def duration_in_seconds\n return @duration_in_seconds\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 elapsed\n Time.now - self\n end",
"def duration\n (Time.mktime(0)+(tracks.map(&:duration).inject(:+) || 0)).strftime(\"%H:%M:%S\")\n end",
"def duration\n if leg_a_answered_at.nil?\n return 0\n else\n if hangup? \n (leg_a_hangup_at - leg_a_answered_at).round\n else\n (Time.now - leg_a_answered_at).round\n end\n end\n end",
"def elapsed\n (Time.now - @start_time).round\n end",
"def success\n calc_duration\n end",
"def timed_event_remaining_time(event_id = @event_id, map_id = @map_id)\n return ($user_data.dig(:tjn_events, map_id, event_id)&.first || current_time) - current_time\n end",
"def seconds() self end",
"def elapsed\n Time.now - @time_start\n end",
"def elapsed_time\n (Time.now.to_f - @start_time) * 1000\n end",
"def time_duration(mytime, start_time, end_time)\n # implement this\n return 9999999\n end",
"def duration\n @duration ||= (range[1] - range[0]) / 1000.0\n end",
"def duration\n (self.end_date.to_i/60/60/24) - (self.start_date.to_i/60/60/24)\n end",
"def duration\n ran? ? (completed_at || failed_at) - started_at : 0\n end",
"def elapsed_time\n if end_time && start_time\n return ((end_time - start_time)/60).round\n else\n return 0\n end\n end",
"def elapsed_time\n seconds = (self.end_at.to_i - self.start_at.to_i)\n (seconds / 60)\n end",
"def get_duration()\n puts \"The task will take #{(@date_end - @date_start).to_i} days\"\n end",
"def duration\n assignment.duration + (extension&.time_delta || 0)\n end",
"def elapsed\n duration_since(self.class.now)\n end",
"def duration_before_escalation\n return @duration_before_escalation\n end",
"def elapsed_time\n (Time.now.to_f - @start_time) * 1000000\n end",
"def duration\n duration = data(\"duration\")\n duration_to_seconds(duration.to_f) if duration\n end",
"def set_duration\n if self.end_time\n # self.duration = (end_time - start_time).to_i\n self.duration = (end_time - start_time).to_i\n else\n self.duration = DEFAULT_DURATION\n self.end_time = self.start_time + self.duration\n end\n end",
"def get_time_remaining\n\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 duration(state = :started)\n state = state_to_const(state)\n if state == @state\n Time.now - state_at(state)\n elsif state < @state and state_at(state)\n next_state_at(state) - state_at(state)\n else\n nil\n end\n end",
"def duration\n return unless finished_at\n\n elapsed_time(started_at, finished_at)\n end",
"def duration\n @duration = to_seconds @data.fetch('duration', 0)\n end",
"def execution_duration\n duration = nil\n unless self.stopped_at.nil?\n duration_seconds = self.stopped_at - self.started_at\n dhc = duration_seconds / 3600 # hours component\n dhc_mod = duration_seconds % 3600\n dhm = dhc_mod / 60 # minutes component\n dhs = dhc_mod % 60 # seconds component\n\n duration = format('%02d:%02d:%02d', dhc, dhm, dhs)\n end\n\n duration\n end",
"def duration(proc)\n start = Time.now\n proc.call\n dur = Time.now - start\nend",
"def duration\n @range.last - @range.first\n end",
"def time_ended\n return @time_ended\n end",
"def duration\n self.updated_at - self.created_at\n end",
"def calculate_duration_of(task) ; 5 ; end",
"def duration(input)\n process(:duration, input)\n end",
"def timeDifference\n receive_timestamp-@startTime\n end",
"def length\n return 0.0/0.0 unless depart_time && return_time\n (return_time - depart_time)/60\n end"
] | [
"0.7956794",
"0.7956794",
"0.7956794",
"0.7956794",
"0.7956794",
"0.77477765",
"0.7715676",
"0.7612803",
"0.75276846",
"0.7369925",
"0.7343884",
"0.73265237",
"0.7320158",
"0.7308015",
"0.73071915",
"0.72824293",
"0.7270667",
"0.72617936",
"0.72474813",
"0.7207984",
"0.7159133",
"0.71554595",
"0.71509707",
"0.7101611",
"0.70815164",
"0.70815164",
"0.70568603",
"0.7047373",
"0.7042205",
"0.7032378",
"0.7020528",
"0.70116764",
"0.7009382",
"0.6998505",
"0.69967175",
"0.699403",
"0.69707555",
"0.6969978",
"0.6967939",
"0.6967483",
"0.6928203",
"0.69169235",
"0.69084173",
"0.6893384",
"0.6866169",
"0.6865707",
"0.6865707",
"0.6865707",
"0.68585217",
"0.6854787",
"0.6845832",
"0.68252504",
"0.68252504",
"0.6817826",
"0.6817826",
"0.68022084",
"0.67980546",
"0.6781453",
"0.67734694",
"0.6762925",
"0.6752693",
"0.67476785",
"0.67447525",
"0.67321163",
"0.6730207",
"0.67239594",
"0.67164403",
"0.67118824",
"0.67047703",
"0.6694524",
"0.6694328",
"0.66732574",
"0.667008",
"0.66565365",
"0.6648506",
"0.6647477",
"0.6644524",
"0.66163564",
"0.6611033",
"0.6597007",
"0.65946054",
"0.65933317",
"0.6588127",
"0.6587259",
"0.65834004",
"0.6578911",
"0.6576119",
"0.65744257",
"0.6572429",
"0.6570451",
"0.6565353",
"0.6562709",
"0.6559533",
"0.6556431",
"0.65510774",
"0.654169",
"0.6539705",
"0.653242",
"0.65187204",
"0.64891154"
] | 0.6770404 | 59 |
change the name of the title(setter mehtod) | def initialize(title, author)
@title = title
@author = author
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def title_set(title)\n self.sirname.set title\n end",
"def set_title(title)\n @title = title\n end",
"def setTitle(title)\r\n\t\t\t\t\t@title = title\r\n\t\t\t\tend",
"def title=(value)\n @title = value\n end",
"def title=(value)\n @title = value\n end",
"def title=(value)\n @title = value\n end",
"def title=(value)\n @title = value\n end",
"def title=(value)\n @title = value\n end",
"def title=(value)\n @title = value\n end",
"def title=(value)\n @title = value\n end",
"def title=(value)\n\t\t\t@title = value\n\t\tend",
"def set_title\n @title = \"#{controller_name}.#{action_name}.title\"\n end",
"def title(title)\n @title=title\n end",
"def title(title)\n @title = title\n end",
"def setTitle (title)\n @title = title.to_s\n end",
"def set_title\n unless self.title\n if self.parent\n if last_untitled_page = self.parent.children.where(:title => /Untitled /i).asc(:title).last\n last_untitled_number = last_untitled_page.title.split(\" \").last.to_i\n self.title = \"Untitled #{last_untitled_number+1}\"\n else\n self.title = \"Untitled 1\"\n end\n else\n self.title = \"Untitled 1\"\n end\n end\n end",
"def title=(new_title = nil)\n @info[:Title] = new_title\n end",
"def title=(value)\n super(value)\n self.set_prefix\n return self.title\n end",
"def update_window_title(new_title)\n hc_main_view.title = new_title\n end",
"def ctitle(title)\n self.title = title\n end",
"def title=( new_title ) ##(main\n unless @read_only\n @title = new_title \n end \n end",
"def set_Title(value)\n set_input(\"Title\", value)\n end",
"def set_Title(value)\n set_input(\"Title\", value)\n end",
"def set_page_title(title)\n\t\t@page_title = @current_action.titleize + title\n\tend",
"def set_Title(value)\n set_input(\"Title\", value)\n end",
"def set_Title(value)\n set_input(\"Title\", value)\n end",
"def set_Title(value)\n set_input(\"Title\", value)\n end",
"def set_Title(value)\n set_input(\"Title\", value)\n end",
"def set_Title(value)\n set_input(\"Title\", value)\n end",
"def set_Title(value)\n set_input(\"Title\", value)\n end",
"def set_Title(value)\n set_input(\"Title\", value)\n end",
"def set_Title(value)\n set_input(\"Title\", value)\n end",
"def set_Title(value)\n set_input(\"Title\", value)\n end",
"def title=( new_title )\n if not @read_only\n @title = new_title\n end\n end",
"def title=(value)\n write_attribute(:title, value.capitalize)\n end",
"def title=( new_title )\n unless @read_only\n @title = new_title\n end\n end",
"def set_Title(value)\n set_input(\"Title\", value)\n end",
"def title= title\n @title = title\n end",
"def title=(text); end",
"def title=(text); end",
"def capitalize_title\n self.title = title.capitalize\n end",
"def set_name_title\n @name_title = NameTitle.find(params[:id])\n end",
"def title(val)\n args_def.title = val\n end",
"def set_window_title(window, title)\n window.custom_title.set(title)\n end",
"def set_window_title(window, title)\n window.custom_title.set(title)\n end",
"def set_window_title(window, title)\n window.custom_title.set(title)\n end",
"def title_name; end",
"def set_title_locally(title)\n @title = title\n end",
"def set_page_title\n @page_title = \"Race Results Management\"\n end",
"def title(new_title=nil)\n if new_title\n @title = new_title\n end\n Lolita::Utils.dynamic_string(@title, :default => @name && @dbi.klass.human_attribute_name(@name))\n end",
"def SetTitle(title)\n\t\t#Title of document\n\t\t@title = title\n\tend",
"def title\n name.capitalize.bold.sub('_', ' ')\n end",
"def dmpSetTitle(k,title) ;\n @title[k] = title ;\n end",
"def name; title end",
"def title=(title)\n @attributes.occi!.core!.title = title\n end",
"def set_title(new_title, opts={})\n if self.datastreams.has_key?(\"descMetadata\")\n desc_metadata_ds = self.datastreams[\"descMetadata\"]\n if desc_metadata_ds.respond_to?(:title_values)\n desc_metadata_ds.title_values = new_title\n else\n desc_metadata_ds.title = new_title\n end\n end\n end",
"def set(args, ac=true)\n super(args, ac)\n @title_label.value = @style[:title] if @title_label\n end",
"def set(args, ac=true)\n super(args, ac)\n @title_label.value = @style[:title] if @title_label\n end",
"def set_title(params)\n name, name_formula = process_names(params[:name], params[:name_formula])\n\n data_id = get_data_id(name_formula, params[:data])\n\n @title_name = name\n @title_formula = name_formula\n @title_data_id = data_id\n\n # Set the font properties if present.\n @title_font = convert_font_args(params[:name_font])\n end",
"def title=(s)\n \tsuper s.titleize\n\tend",
"def title=(title)\n\t super(standardize_title(title))\n\t\t\t#self[:title] = title.strip\n\tend",
"def title=(value)\n if value\n @title = value if value.is_a? String\n end\n end",
"def title=(title)\n title = nil unless title.present?\n settings.title = title\n end",
"def title=(new_title)\n @title = new_title\n self.cache_object.title = new_title unless self.cache_object.nil?\n end",
"def set_page_title(title)\n @page_title = title\n end",
"def set_title(str)\n if @currently_executing_block\n output \"set name to '#{str}'\"\n else\n execute_block { set_title = str }\n end\n end",
"def name() title; end",
"def name() title; end",
"def title(title)\n filename(title)\n @methods[:title] = title\n end",
"def handle_title(name, attrs) \n \n end",
"def set_title\n @title = File.basename(@absolute_path)\n @title.sub!(/^[0-9][0-9]-/, '')\n @title.gsub!(/_/, ' ')\n @title.gsub!(/-/, ', ')\n end",
"def change_title\n @status_window.deactivate\n @title_window.select_last\n @title_window.show.activate\n @title_window.refresh\n @help_window.show\n end",
"def title(title = nil)\n @title = title if title\n @title\n end",
"def title=(new_title)\n new_title.capitalize!\n arr = ['over', 'the', 'and', 'in', 'of', 'a', 'an']\n @title = new_title.split(' ').map! { |word| arr.include?(word) ? word : word.capitalize }.join(' ')\n end",
"def title=(t)\n @options[:title] = t\n end",
"def titlecase_title\n self.title = self.title.titlecase\n end",
"def titlecase_title\n self.title=(title().titlecase())\n end",
"def name\n\t\tself.title\n\tend",
"def title=(title)\n Element.attr self, 'title', title\n end",
"def title=(title)\n title = nil if title.blank?\n @settings.title = title\n end",
"def title=(title)\n t = Title.new\n t.content = title\n self.dc_titles = [t]\n title\n end",
"def title=(new_title)\n @title= Book.titleize(new_title)\n end",
"def title\n end",
"def title=(title)\n @title = @template.instance_variable_set(\"@title\", title)\n end",
"def title=(v)\n if @title != v\n @needs_commit = true\n @title = v\n end\n end",
"def setTitle(title)\n if title\n DOM.setAttribute(@element, \"title\", title)\n else\n DOM.removeAttribute(@element, \"title\")\n end\n end",
"def title=(text)\n STDOUT.write \"\\e]0;#{text}\\007\"\n end",
"def title title = nil\n if title\n @title = title.to_s\n else\n @title ||= name[/([^:]+)$/, 1]\n end\n end",
"def set_page_title\n case @title\n when 'Winter', 'Spring', 'Summer', 'Fall'\n parent_content = Content.new(@parent_path)\n @page_title = @title + ' ' + parent_content.title\n else\n @page_title = @title\n end\n end",
"def set_page_title\n\t\t@page_title = \"#{self.action_name.capitalize}: Abstract /\" <<\n\t\t\t\" #{Abstract.sections.find{|a|a[:controller] == self.class.name.demodulize}[:label]}\"\n\tend",
"def retitle(retitle)\n @o_title = title\n @title = retitle.upcase\n conf_message(@o_title, \"retitled\")\n end",
"def setTitre(str)\n\t\t@@fenetre.set_title(str)\n\t\tself\n\tend",
"def title(name)\n Runner.instance.name = name\n end",
"def title\n name\n end",
"def title\n name\n end",
"def title=(title)\n if self.kind == TITLE && !title.blank? && title.first == \"\\r\"\n write_attribute(:title, \" #{title}\")\n else\n write_attribute(:title, title)\n end\n end",
"def set_title title\n self.status_bar_item.title = title\n NSApplication.sharedApplication.hide(nil)\n end",
"def capitalize_title\n self.title = title.capitalize if title.present?\n end",
"def title; end",
"def title; end",
"def title; end"
] | [
"0.862705",
"0.8352795",
"0.8214968",
"0.8148792",
"0.8148792",
"0.8148792",
"0.8148792",
"0.8148792",
"0.8148792",
"0.8148792",
"0.81452745",
"0.81070685",
"0.80770546",
"0.8038164",
"0.80043256",
"0.79982096",
"0.799686",
"0.79796237",
"0.79556036",
"0.79473424",
"0.7940597",
"0.78397197",
"0.78397197",
"0.78295505",
"0.78283226",
"0.78283226",
"0.78283226",
"0.78283226",
"0.78283226",
"0.78283226",
"0.78283226",
"0.78283226",
"0.78283226",
"0.78190106",
"0.78166974",
"0.77820396",
"0.77699167",
"0.7755235",
"0.77542156",
"0.77542156",
"0.77466667",
"0.7708048",
"0.77035713",
"0.7688579",
"0.7688579",
"0.7688579",
"0.76851255",
"0.7678385",
"0.76343626",
"0.76307076",
"0.7625285",
"0.760684",
"0.76017296",
"0.75982165",
"0.75880945",
"0.75769967",
"0.75733244",
"0.75733244",
"0.7572473",
"0.75719243",
"0.7564759",
"0.7552899",
"0.7541551",
"0.7540461",
"0.7535728",
"0.753487",
"0.75288075",
"0.75288075",
"0.7517322",
"0.75023067",
"0.74957633",
"0.74857146",
"0.74798036",
"0.7468087",
"0.7453613",
"0.74503493",
"0.7442883",
"0.74304026",
"0.74235",
"0.74163157",
"0.74097663",
"0.74074584",
"0.7396737",
"0.73856336",
"0.73852944",
"0.7381082",
"0.73645",
"0.73615015",
"0.7357193",
"0.7343621",
"0.73423135",
"0.73181075",
"0.73173535",
"0.73140985",
"0.73140985",
"0.7312234",
"0.72967035",
"0.7289789",
"0.72867477",
"0.72867477",
"0.72867477"
] | 0.0 | -1 |
Renders a diagram or html which is used in a sandboxed iframe when rendering this block's partial in an article | def show
# Get the html, svg, css, and js code to render
@code = get_article_code
# The default layouts are not added as this page will be
# embeded in an iframe
render layout: false
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def render\n Debug.debug { \"Now rendering #{@context} block for #{self}\" }\n @document.playback_attributes @attributes\n out = renderer.render(\"block_#{@context}\", self)\n @document.callouts.next_list if @context == :colist\n out\n end",
"def _remove_iframe_edit()\n @parent.render(partial: 'dc_common/iframe_edit', formats: [:html])\nend",
"def wymiframe\n render :template => \"/wymiframe\", :layout => false\n end",
"def render(options = nil, extra_options = {}, &block) #:doc:\n @flash=flash\nputs \"RENGINE RENDER #1\"\n options=interpret_rengine_options(options)\nputs \"RENGINE RENDER #2\"\n #no layout\n super(options,extra_options,&block)\nputs \"RENGINE RENDER #3\"\n unless self.no_wrap\nputs \"RENGINE RENDER #4a\"\n \n \n txx=render_weblab(setUserJavascript+ self.response_body.join(\"\\n\"))\n puts \"RENGINE RENDER #4b\"\n\n # puts \"===========================\\n\"+txx.join(\"\\n\")+\"\\n!================================!\"\n\n if $render_translation_link\n txx << \"\\n<div style=\\\"background-color:#aaa;color:#0ff;\\\">\\n\"\n txx << translation_tool(@displayed_blurb_names)\n txx << \"\\n</div>\\n\"\n end\nputs \"RENGINE RENDER #5\"\n\n self.response_body=txx\n \n end\n end",
"def render_viewer_in_context(document, block)\n canvas = choose_canvas_id(block)\n if params[:controller] == 'spotlight/catalog'\n render partial: current_exhibit.required_viewer.to_partial_path,\n locals: { document: document, block: block, canvas: canvas }\n else\n render partial: current_exhibit.required_viewer.default_viewer_path,\n locals: { document: document, block: block, canvas: canvas }\n end\n end",
"def html_blocklike_show(title, content)\n render('layouts/block', :title => title, :content => content) unless content.blank?\n end",
"def render_show_page\n render_buffer current_theme.questions_show_html.read\n end",
"def iframe\r\n return '' if @page.if_url.blank?\r\n\r\n html = \"\\n<iframe\"\r\n html << \" id=\\\"#{@page.if_id}\\\"\" if @page.if_id.present?\r\n html << \" class=\\\"#{@page.if_class}\\\"\" if @page.if_class.present?\r\n html << \" border=\\\"#{@page.if_border}\\\"\" \r\n html << \" height=\\\"#{@page.if_height}\\\"\" if @page.if_height.present?\r\n html << \" width=\\\"#{@page.if_width}\\\"\" if @page.if_width.blank?\r\n html << \" scrolling=\\\"#{@page.if_scroll}\\\"\"\r\n # Parameters\r\n parameters = @page.if_url.match(/\\?/) ? '' : '?' \r\n params = YAML.load(@page.if_params) rescue {}\r\n params = {} unless params.class == Hash\r\n params.each do |key, value|\r\n val = @parent.dc_internal_var(value['object'], value['method'])\r\n parameters << \"&#{key}=#{val}\" if val # only when not nil\r\n end\r\n url = @page.if_url + (parameters.blank? ? '' : parameters)\r\n html << \"src=\\\"#{url}\\\" ></iframe>\\n\"\r\n html\r\nend",
"def content\n super\n @renderer = @widget.content\n div :id => 'doc3' do\n if @renderer.render? :header\n div :id => 'hd' do\n if @renderer.render? :top_line\n render_top_line\n end\n if @renderer.render? :title\n h1 @page_title || 'Missing :page_title'\n end \n end\n end\n div :id => 'bd' do\n render_body\n end\n if @renderer.render? :footer\n div :id => 'ft' do\n render_footer\n end\n end\n end\n end",
"def html_block!\n @page << @html_block\n end",
"def assemble_markup\n\n design_renderer = liquid_for(@design.markup)\n view_renderer = liquid_for(@view_template.markup)\n params = node_template_data.merge(global_template_data)\n\n # Render the view template.\n rendered_view = view_renderer.render(params, :filters => liquid_filters)\n\n # Render the design and merge in the view.\n design_renderer.render(params.merge('content' => rendered_view), :filters => liquid_filters)\n\n end",
"def iframe\n end",
"def render_parent_block(name, context, blocks = {})\n # ob_start();\n display_parent_block(name, context, blocks)\n # return ob_get_clean();\n end",
"def render_facebook_sdk\n render_to_string(partial: 'layouts/facebook_sdk').html_safe\n end",
"def donate_iframe\n #do not delete this function. It is necessary to render the corresponding view.\n end",
"def render\n content_tag(:section, class: \"umm-preview #{form_id}\") do\n render_preview_accordion\n end\n end",
"def partial\n instance = load_instance()\n instance ||= Media_Container.find(1).with(Media_Container.asset_id == param(:asset_id_child)).entity\n article = instance.article\n \n editor = view_string(:container_attachments, \n :article => instance.article, \n :media_container => instance, \n :media_asset_list => Media_Asset_Controller.choice_list(:selected => instance.media_assets))\n \n GUI::Article_Partial.new(:article => article, \n :partial => HTML.div { editor }, \n :entity => instance)\n end",
"def render_document; end",
"def parse_block_html; end",
"def render\n content\n end",
"def body_content\n call_block\n end",
"def sbs\n page = wikipage_selector(\"Choose page to view side-by-side with the current page\")\n exit unless page\n\n if cururl.index(\"localhost/wiki\")\n url = cururl.to_s + \"?do=edit&vecdo=print\"\n else\n # uses Instapaper to nicely format the article text, for fitting into a split-screen window\n url = \"http://www.instapaper.com/text?u=\\\"+encodeURIComponent(\\\"#{cururl}\\\")+\\\"\"\n end\n newurl = \"http://localhost/wiki/#{page.gsub(\" \",\"_\")}\"\n\n js = \"var MyFrame=\\\"<frameset cols=\\'*,*\\'><frame src=\\'#{url}\\'><frame src=\\'#{newurl}?do=edit&vecdo=print\\'></frameset>\\\";with(document) { write(MyFrame);};return false;\"\n @chrome.windows[1].get.tabs[@chrome.windows[1].get.active_tab_index.get].get.execute(:javascript => js)\nend",
"def render(format = :html, params = {}, parent_context = nil)\n render_inline(format, params, parent_context)\n end",
"def render_simple_node(page, locals={})\n @current_node = page\n locals.reverse_merge!(:level => 0, :simple => false).merge!(:page => page)\n render :partial => 'wysiwyg/node', :locals => locals\n end",
"def placeholder_html \n widget_url = @url.gsub('/app/','/widget/')\n widget_url = widget_url.gsub('http:','https:')\n \"<div style='width:100%; height:190px; display:block; background-color:black; color:white;'><div style='padding:10px;'><h2>Steam Store Widget onebox preview for: #{widget_url}</h2><p>Will be replaced with the real listing when posted.</p></div></div>\"\n rescue\n @url\n end",
"def render\n \"<div id=\\\"#{self.area_type}_#{self.id}\\\">#{self.html}</div>\"\n end",
"def render\n \"<div id=\\\"#{self.area_type}_#{self.id}\\\">#{self.html}</div>\"\n end",
"def render_iframe_updates(page_updates)\n script = apotomo_request_processor.render_page_updates(page_updates)\n escaped_script = Apotomo::JavascriptGenerator.escape(script)\n \n render :text => \"<html><body><script type='text/javascript' charset='utf-8'>\nvar loc = document.location;\nwith(window.parent) { setTimeout(function() { window.eval('#{escaped_script}'); window.loc && loc.replace('about:blank'); }, 1) }\n</script></body></html>\", :content_type => 'text/html'\n end",
"def to_html\n w = 400\n h = 300\n id = @url.match(REGEX)[1]\n embed_image = \"#{BASE_URL}/embed.html?mid=#{id}&width=#{w}&height=#{h}&etp=im\"\n embed_3d = \"#{BASE_URL}/embed.html?mid=#{id}&width=#{w}&height=#{h}\"\n <<HTML\n<div class=\"onebox-3dwh\" id=\"#{id}\">\n <iframe src=\"#{embed_image}\" frameborder=\"0\" scrolling=\"no\" marginheight=\"0\" marginwidth=\"0\" width=\"#{w}\" height=\"#{h}\" allowfullscreen></iframe>\n <div class=\"onebox-3dwh-circle\" onclick=\"$('##{id} iframe').attr('src', '#{embed_3d}'); $(this).remove()\" />\n</div>\nHTML\n end",
"def render(context)\n api = URI.parse('https://www.planttext.com/api/scripting')\n http = Net::HTTP.new(api.host, api.port)\n http.use_ssl = true\n request = Net::HTTP::Post.new(api.request_uri)\n request['Content-Type'] = 'application/x-www-form-urlencoded'\n uml = \"\\n@startuml\\n#{super}\\n@enduml\\n\"\n request.set_form_data(type: 'svg', plantuml: uml)\n response = http.request(request)\n return \"<p>Can't render PlantUML diagram.</p>\" unless response.code == '200'\n url = response.body.gsub(/^\"|\"$/, '')\n puts \"PlantUML SVG generated: #{url}\"\n \"<p><object data='#{url}' type='image/svg+xml' #{@markup}></object></p>\"\n end",
"def content_for(capture)\n @layout_block.call(capture)\n end",
"def render_question_entities\n article = find_entity # article with questionnaire\n @question_entities = article.questionnaires\n base_div_id = params[:base_div_id] # id of div to add \n render :update do |page| \n page.replace_html base_div_id, \n :partial => \"article_threads/question_entities\"\n end\n end",
"def content\n call_block\n end",
"def render(context)\n file = Tempfile.new('')\n file.write(super)\n file.close # close temp file; flush content\n output = `python #{file.path}`\n file.unlink # Delete temp file\n \"<figure><embed src=\\\"#{output}\\\" /></figure>\"\n end",
"def render(&block)\n API::Composition.render(&block)\n end",
"def render\n content\n end",
"def render\n content\n end",
"def render\n content\n end",
"def render\n if @block\n instance_eval(&@block)\n end\n end",
"def cms_block_render(identifier, blockable = @cms_page)\n return '' unless tag = ComfortableMexicanSofa::ViewMethods.cms_block_tag(identifier, blockable)\n render :inline => ComfortableMexicanSofa::Tag.process_content(blockable, tag.render)\n end",
"def content(data = {}, &block)\n @renderer.render(get_data(data), &block)\n end",
"def rendered_asset_view(asset)\n return '' unless asset.can_download?\n\n our_renderer = Seek::Renderers::RendererFactory.instance.renderer(asset.content_blob)\n if our_renderer.external_embed? && !cookie_consent.allow_embedding?\n # If embedding external content is not allowed, then server a link instead\n content = \"This embedded content is blocked due to your cookie settings\"\n else\n content = Rails.cache.fetch(\"#{asset.cache_key}/#{asset.content_blob.cache_key}\") do\n our_renderer.render\n end\n end\n if content.blank?\n ''\n else\n content_tag(:div, class: 'renderer') do\n content.html_safe\n end\n end\n end",
"def content\n @blocks.map {|b| b.render } * EOL\n end",
"def render_views_in_this(block)\n html = ''\n block.views.each do |view|\n models_view = view.models_view(block)\n \n if view.model_name =~ /(tag)|(image)/ && !view.scope.blank?\n scope_model = view.owner_id.blank? ? eval(\"@#{view.scope}\") : model_class(view.scope).find(view.owner_id)\n data = eval(\"scope_model.#{view.model_name.pluralize}\")\n \n elsif view.model_name == 'post' && view.scope == 'tag'\n tag = view.owner_id.blank? ? eval(\"@tag\") : Tag.find(view.owner_id)\n data = Post.find(:all, :conditions => models_view.conditions).select { |p| p.tags.map(&:name).include? tag.name }\n data = data.paginate(:per_page => 15, :page => params[:page]) if models_view.paginate\n \n else\n data = view.model.all(view_find_options(view, models_view))\n end\n \n html << render(:partial => \"#{view_types_dir}#{models_view.view_type}\", :locals => { :data => data })\n end\n html\n #rescue\n # resource = block.class.to_controller_str\n # block_str = current_user && current_user.has_permission?(resource, 'edit', params) ? \"<a href='/#{resource}/#{block.id}/edit'>#{block.title}</a>\" : block.title\n # \"<div class='flash error'>And error occured loading view in block: #{block_str}</div>\"\n end",
"def render_views_in_this(block)\n html = ''\n block.views.each do |view|\n models_view = view.models_view(block)\n \n if view.model_name =~ /(tag)|(image)/ && !view.scope.blank?\n scope_model = view.owner_id.blank? ? eval(\"@#{view.scope}\") : model_class(view.scope).find(view.owner_id)\n data = eval(\"scope_model.#{view.model_name.pluralize}\")\n \n elsif view.model_name == 'post' && view.scope == 'tag'\n tag = view.owner_id.blank? ? eval(\"@tag\") : Tag.find(view.owner_id)\n data = Post.find(:all, :conditions => models_view.conditions).select { |p| p.tags.map(&:name).include? tag.name }\n data = data.paginate(:per_page => 15, :page => params[:page]) if models_view.paginate\n \n else\n data = view.model.all(view_find_options(view, models_view))\n end\n \n html << render(:partial => \"#{view_types_dir}#{models_view.view_type}\", :locals => { :data => data })\n end\n html\n #rescue\n # resource = block.class.to_controller_str\n # block_str = current_user && current_user.has_permission?(resource, 'edit', params) ? \"<a href='/#{resource}/#{block.id}/edit'>#{block.title}</a>\" : block.title\n # \"<div class='flash error'>And error occured loading view in block: #{block_str}</div>\"\n end",
"def content\n div :id => 'doc3' do\n div :id => 'hd' do\n render_top_line\n h1 @page_title || 'Missing :page_title' \n end\n div :id => 'bd' do\n render_body\n end\n div :id => 'ft' do\n render_footer\n end\n end\n end",
"def emit_standard_frame(output, object_stack, &blk)\n # create the frame and the label, and let every element\n # to render its own widget\n css = 'surv-block'\n css += ' error' if object_stack.error?\n css += \" #{element.options[:class]}\" if element.options[:class]\n emit_tag(output, 'div', :class => css) do |output|\n emit_tag(output, 'label', :for => object_stack.dom_id) do |output|\n output << element.label\n emit_tag(output, 'span', Element.required_label) if element.options[:required]\n end\n if element.options[:tip]\n emit_tag(output, 'div', I18n.t(element.options[:tip], :default => element.options[:tip].to_s),\n :class => 'tip')\n end\n emit_tag(output, 'div', :class => \"widget #{element.type}\") do |output|\n blk.call(output)\n end\n end\n end",
"def iframes; end",
"def _render_\n document.to_s\n end",
"def content_outline record\n blocks = record.content_blocks if record.parsed_content.present?\n return unless blocks\n\n content_tag :ul, class: 'content-outline' do\n # Loop through each block in the record, and generate a short piece of text describing that block.\n for block in blocks\n case block['type']\n when 'paragraph'\n text = block['data']['text']\n if block['data']['type'] == 'header'\n result = tag.strong(text)\n else\n result = block['data']['text'].truncate(200)\n end\n\n when 'list'\n result = ''\n result = \"<em>#{translate('admin.javascript.blocks.list.type.contents')}</em><br>\" if block['data']['type'] == 'contents'\n result += block['data']['items'].map { |i|\n depth = (i.is_a?(Hash) ? (i.dig('level') || 'h2')[1].to_i : 2) - 1\n text = i.is_a?(Hash) ? i['text'] : i\n \"#{'—' * depth} #{text}\".truncate(60)\n }.join('<br>')\n result = sanitize(result, tags: %w[em br])\n\n when 'layout'\n result = block['data']['items'].map { |i| \"— #{i['title']}\" }.join('<br>')\n result = sanitize(result, tags: %w[br])\n\n when 'catalog'\n result = translate(\"activerecord.models.#{block['data']['type'].singularize}.other\")\n result += \": #{translate('admin.content.items', count: block['data']['items'].length)}\"\n\n when 'textbox'\n result = ''\n result += \"<strong>#{block['data']['title']}</strong><br>\" if block['data']['title'].present?\n result += \"#{block['data']['text']&.truncate(60)}<br>\" if block['data']['text'].present?\n result += tag.span(\"[#{block['data']['action']}] → \") + tag.small(block['data']['url']) if block['data']['action'].present? && block['data']['url'].present?\n result = sanitize(result, tags: %w[strong br])\n\n when 'action'\n result = tag.span(\"[#{block['data']['action']}] → \") + tag.small(block['data']['url']) if block['data']['action'] && block['data']['url']\n\n when 'media'\n result = if block['data']['type'] == 'image'\n block['data']['items'].map { |i| \"#{tag.i(class: 'image icon')} <a href=\\\"#{i['image']['preview']}\\\" target=\\\"_blank\\\">#{i['image']['preview'].split('/').last}</a>#{\" - \\\"#{i['caption'].truncate(100)}\\\"\" if i['caption']}\" }\n elsif block['data']['type'] == 'audio'\n block['data']['items'].map { |i| \"#{tag.i(class: 'volume up icon')} <a href=\\\"#{i['audio']['preview']}\\\" target=\\\"_blank\\\">#{i['title']}</a>\" }\n elsif block['data']['type'] == 'youtube'\n tag.span('[YouTube Embed] → ') + tag.small(\"https://www.youtube.com/watch?v=#{block['data']['youtube_id']}\") if block['data']['youtube_id'] # TODO: Translate\n else\n block['data']['items'].map { |i| \"#{tag.i(class: \"#{block['data']['type']} icon\")} #{i['name']} (#{i['id']})\" }\n end\n result = result.join('<br>') if result.kind_of?(Array)\n result = sanitize(result, tags: %w[i a br], attributes: %w[href class target])\n\n when 'vimeo'\n result = block['data']['items'].map { |i| \"#{tag.i(class: 'video icon')} #{i['title']}\" }.join('<br>')\n result = sanitize(result, tags: %w[i a br])\n\n when 'whitespace'\n separators = {\n large: '==',\n medium: '—',\n small: '--',\n }\n\n result = separators[block['data']['size'].to_sym] * 3\n\n else\n concat block.inspect\n end\n\n concat content_tag :li, result, class: \"content-outline__#{block['type']} content-outline__#{block['type']}--#{block['data']['type']}\"\n end\n end\n end",
"def preview\n render :template => \"preview\", :layout => false\n end",
"def make_render_in_view exp\n make_render exp, true\n end",
"def snippet(page, options={})\n haml page, options.merge!(:layout => false)\n end",
"def render_chart_html(chart_swf,str_url,str_xml,chart_id,chart_width,chart_height,debug_mode,&block)\n chart_width=chart_width.to_s\n chart_height=chart_height.to_s\n \n debug_mode_num=\"0\"\n if debug_mode==true\n debug_mode_num=\"1\"\n end \n str_flash_vars=\"\"\n if str_xml==\"\"\n str_flash_vars=\"chartWidth=\"+chart_width+\"&chartHeight=\"+chart_height+\"&debugmode=\"+debug_mode_num+\"&dataURL=\"+str_url\n logger.info(\"The method used is setDataURL.The URL is \" + str_url)\n else\n str_flash_vars=\"chartWidth=\"+chart_width+\"&chartHeight=\"+chart_height+\"&debugmode=\"+debug_mode_num+\"&dataXML=\"+str_xml\n logger.info(\"The method used is setDataXML.The XML is \" + str_xml)\n end\n concat(\"\\t\\t<!-- START Code Block for Chart -->\\n\\t\\t\",block.binding)\n \n object_attributes={:classid=>\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\"}\n object_attributes=object_attributes.merge(:codebase=>\"http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0\")\n object_attributes=object_attributes.merge(:width=>chart_width)\n object_attributes=object_attributes.merge(:height=>chart_height)\n object_attributes=object_attributes.merge(:id=>chart_id)\n \n param_attributes1={:name=>\"allowscriptaccess\",:value=>\"always\"}\n param_tag1=content_tag(\"param\",\"\",param_attributes1)\n \n param_attributes2={:name=>\"movie\",:value=>chart_swf}\n param_tag2=content_tag(\"param\",\"\",param_attributes2)\n \n param_attributes3={:name=>\"FlashVars\",:value=>str_flash_vars}\n param_tag3=content_tag(\"param\",\"\",param_attributes3)\n \n param_attributes4={:name=>\"quality\",:value=>\"high\"}\n param_tag4=content_tag(\"param\",\"\",param_attributes4)\n \n embed_attributes={:src=>chart_swf}\n embed_attributes=embed_attributes.merge(:FlashVars=>str_flash_vars)\n embed_attributes=embed_attributes.merge(:quality=>\"high\")\n embed_attributes=embed_attributes.merge(:width=>chart_width)\n embed_attributes=embed_attributes.merge(:height=>chart_height).merge(:name=>chart_id)\n embed_attributes=embed_attributes.merge(:allowScriptAccess=>\"always\")\n embed_attributes=embed_attributes.merge(:type=>\"application/x-shockwave-flash\")\n embed_attributes=embed_attributes.merge(:pluginspage=>\"http://www.macromedia.com/go/getflashplayer\")\n \n embed_tag=content_tag(\"embed\",\"\",embed_attributes)\n \n concat(content_tag(\"object\",\"\\n\\t\\t\\t\\t\"+param_tag1+\"\\n\\t\\t\\t\\t\"+param_tag2+\"\\n\\t\\t\\t\\t\"+param_tag3+\"\\n\\t\\t\\t\\t\"+param_tag4+\"\\n\\t\\t\\t\\t\"+embed_tag+\"\\n\\t\\t\",object_attributes),block.binding)\n concat(\"\\n\\t\\t<!-- END Code Block for Chart -->\\n\",block.binding)\n end",
"def build_html\n ApplicationController.render(partial: partial, locals: locals)\n end",
"def get_design_and_render(design_doc)\n layout = @site.site_layout.blank? ? 'content' : @site.site_layout\n site_top = '<%= dc_page_top %>'\n site_bottom = '<%= dc_page_bottom %>'\n# design defined in design doc \n if design_doc\n if !design_doc.rails_view.blank? \n if design_doc.rails_view.downcase != 'site'\n return render design_doc.rails_view, layout: layout\n end\n elsif !design_doc.body.blank?\n design = site_top + design_doc.body + site_bottom\n return render(inline: design, layout: layout)\n end\n end\n# design defined in site\n if @site.rails_view.blank? \n design = site_top + @site.design + site_bottom\n return render(inline: design, layout: layout)\n end\n render @site.rails_view, layout: layout\nend",
"def render_block(name, context, blocks = {}, use_blocks = true)\n # ob_start();\n display_block(name, context, blocks, use_blocks)\n # return ob_get_clean();\n end",
"def div\n @adapter.generate_body(@chart)\n end",
"def inject_cms_toolbar\n response.body = %(\n <html>\n <head>\n </head>\n <body style=\"margin: 0\">\n #{cms_toolbar_with_iframe_html}\n </body>\n </html>\n )\n end",
"def render\n generate_content\n @pdf.render\n end",
"def markup_context; end",
"def render( render_state )\n\t\treturn nil\n\tend",
"def html_block_show(block)\n title, content = send(block.class.to_s.underscore, block)\n html_blocklike_show(title, content)\n end",
"def oauth_fancybox_scripts\n render :partial => 'oauth_consumers/oauth_fancybox_scripts'\n end",
"def html_contents\n layout_contents\n end",
"def process_complex_block_opener(tk); end",
"def render_partial(context, options, &block); end",
"def rendered; end",
"def merchant_contract_html\n send_data MachovyRails::Application.assets.find_asset(VendorMailer::LEGAL_AGREEMENT_HTML).to_s, \n :type => \"text/html\", \n :disposition => 'inline' \n end",
"def inner_content\n return \"\" if inner_template == nil\n if inner_presenter == nil\n return GentleREST::Template.render(inner_template)\n else\n return GentleREST::Template.render(inner_template, inner_presenter)\n end\n end",
"def render_plain\n template_content\n end",
"def preview\n render 'preview', :layout => false\n end",
"def contents\n rendered_contents\n end",
"def render(snip, part=:content, args=[], enclosing_snip=snip)\n prepare(snip, part, args, enclosing_snip)\n processed_text = render_without_including_snips(snip, part)\n include_snips(processed_text, snip)\n end",
"def prepare_render\n @content = '## Página no encontrada'\n event = Event.find(params[:event_id])\n if (event)\n pages = event.pages.select{ |page| page.path == params[:page_path]}\n unless(pages.empty?)\n @content = MarkdownEventParser.add_event_details(event, pages[0].content)\n end\n end\n @content = MARKDOWN.render(@content)\n render\n end",
"def render(_context)\n @browser_url = @attributes['url']\n render_header + render_contents + render_url + render_footer\n end",
"def cms_block_render(identifier, blockable = @cms_page)\n tag = blockable && (block = blockable.blocks.find_by_identifier(identifier)) && block.tag\n return '' unless tag\n render :inline => ComfortableMexicanSofa::Tag.process_content(blockable, tag.render)\n end",
"def content\n @bgs, @gbs = [], []\n img = image(\"#{HH::STATIC}/hhhello.png\")\n img.move 305, 42\n @bgs << img\n @bgs << rect(38, 0, width-38, 35, fill: \"#CDC\")\n @bgs << rect(38, 0, width-38, 38, fill: black.push(0.05)..black.push(0.2))\n @tabs, @tables = [], HH::DB.tables\n @scripts = HH.scripts\n\n hometab \"Programs\", true, 50, 13 do\n @slot.append do\n @homepane.clear{home_scripts}\n flush\n end\n end\n hometab \"Samples\", false, 168, 13 do\n @slot.append do\n @homepane.clear{sample_scripts}\n flush\n end\n end\n @bgs << rect(38, 38, 300, 4, fill: rgb(233, 239, 224))\n\n @slot.append do\n stack(height: 40){}\n @homepane = flow(margin_top: 10){home_scripts}\n flush\n end\n\n=begin\n stack :margin_left => 12 do\n background rgb(233, 239, 224, 0.85)..rgb(233, 239, 224, 0.0)\n image 10, 70\n end\n @bulletin_stack = stack do\n end\n=end\n end",
"def render\n return ro_standard if @readonly\n set_initial_value\n#\n# @yaml['html'] ||= {}\n# value_send_as = 'p_' + @yaml['name']\n# @yaml['html']['value'] = @parent.params[value_send_as] if @parent.params[value_send_as]\n\n record = record_text_for(@yaml['name'])\n @html << @parent.text_area(record, @yaml['name'], @yaml['html'])\n self\nend",
"def render_block(block, options = {})\n render partial: partial_name_for(block, options), object: block, as: :block\n end",
"def guest_stub_markup guest, show_link\n \n html = ''\n html << %(<div id=\"story-guest-section\">)\n \n if !guest.image_name.nil? and guest.image_name.length > 0\n html << %(<img alt=\"Guest thumbnail\" class=\"guest_thumbnail\" src=\"#{ENV['KYC_STATIC_PHOTOS_URL']}#{guest.image_name}.jpg\" />)\n end\n \t\n html << %(<h4 id=\"guest-thumbnail-title\">As Told By...</h4>)\n \n if show_link\n html << %(<p>#{link_to(guest.name, guest)}</p>)\n else\n html << %(<p><strong>#{guest.name}</strong></p>)\n end\n \t\n html << %(<p>#{guest.title}</p>)\n html << %(<p>#{guest.organization}</p>)\n if !guest.guest_url.nil? and guest.guest_url.length > 0 \n html << %(<p>Website: <a href=\"#{guest.guest_url}\">#{guest.guest_url_text}</a></p>)\n end\n html << %(<p>#{guest.bio}</p>)\n html << %(</div>)\n \n html.html_safe\n end",
"def preview\n @text = params[:deliverable][:description]\n render :partial => 'common/preview'\n end",
"def render(object)\n @block.call(object)\n end",
"def render\n <<-HTML\n <div class=\"relative\">\n <a href=\"#{url}\"class=\"#{position_classes}f6 link dim br2 ph3 pv2 dib white bg-blue\" data-help-link=\"Y\" target=\"cbf-help\">#{Icon.new(:question).render} #{text}</a>\n </div>\n HTML\n end",
"def block_html(raw)\n raw = unindent(raw)\n\n if md = raw.match(/\\<(.+?)\\>(.*)\\<(\\/.+?)\\>/m)\n open_tag, content, close_tag = md.captures\n \"<#{open_tag}>\\n#{recursive_render(unindent(content))}<#{close_tag}>\"\n else\n raw\n end\n end",
"def show\n @iframe = @video.iFrame_Source.html_safe\n end",
"def render_layout(output, layout, info); end",
"def single_content_for(name, content = nil, &block)\n @view_flow.set(name, ActiveSupport::SafeBuffer.new)\n content_for(name, content, &block)\n end",
"def content_for_preview( layout_options )\r\n content = self.body.dup\r\n content.gsub!( /<%=\\s?(@[^%]+)\\s?%>/, '<code>\\1</code>' )\r\n mail = Mail.new( :token => \"\" )\r\n mail.content = Render::Base.new( content ).mail_content\r\n template = IO.read(\"#{RAILS_ROOT}/app/views/mail_tasks/mailer/this_mail.text.html.rhtml\")\r\n \r\n render = Render::Base.new( template, layout_options.merge( :mail => mail ) )\r\n render.mail_content\r\n end",
"def html\n @resume = Resume.find(params[:id])\n\t @resume.fix_line_break_issue\n\t @html_resume = RDiscount.new(@resume.content).to_html\t\t\t\t# Markdown only. C binary. Fast\n render :layout => \"output\"\n end",
"def render_all\n render(self, reveal: false)\n end",
"def render(data = {}, &block)\n output = content(data, &block)\n output = layout.render(get_data(data)) { output } unless layout.nil?\n output\n end",
"def show\n\tcnv = ODT_to_XHTML.new\n\txmldata = cnv.get_html(@document.content, @document.styles)\n\t@head = xmldata[:head].get_text(\"style\")\n\t@body = xmldata[:body].to_s.sub(/<body>/,\"<div class=\\\"document\\\">\").sub(/<\\/body>/,\"</div>\")\n end",
"def embedded_partial(path,name,opts={})\n additional_opts = opts\n additional_opts.merge!({ :partial => name, :locals => { :___embedded_html___ => element_at(path).inner_html }.merge(opts[:locals]||{}) })\n renderer.view.instance_eval { render(additional_opts) }\n end",
"def blocks_to_embed(block_xml)\n return block_xml\n end",
"def render(content = 'No template provided')\n # get Nokogiri object with html source\n html = Nokogiri::HTML(htmlbody)\n\n # pick image tags from source and inject the right images\n mailskinassets.each do |mailskinasset|\n html.css('img').each do |image|\n # do we have the filename of our mailskinasset in the source attribute?\n if image.attributes['src'].value.to_s.include? mailskinasset.mailskinasset_file_name\n # replace he whole source with correct url\n image.attributes['src'].value = mailskinasset.absolute_asset_url.to_s\n end\n end\n end\n html.to_s.gsub('{yield}', content)\n end",
"def rich_data(gym)\n \t\t\"\"\"\n \t\t<div class='well'>\n \t\t\t<img style='width:100px' src=#{gym.logo}/>\n <h2>\n \t\t\t#{gym.name}\n \t\t\t</h2>\n \t\t\t<p>\n \t\t\t#{gym.description.html_safe}\n \t\t\t</p>\n <a class='btn btn-info linkbutton' href='#{gym_path(gym)}'>Más Información</a>\n \t\t</div>\n\t\t\"\"\"\n \tend",
"def liquid_renderer; end",
"def render_license\n return 'No license recorded' unless @document\n return 'No license recorded' unless @document[:license_tesim]\n license = @document[:license_tesim].first\n if license.match?(/creativecommons.org/)\n data = license_markup\n data.html_safe # rubocop:disable Rails/OutputSafety\n else\n license\n end\n end",
"def designer_content text, context={}\n return if text.blank?\n ApplicationController.render inline: text,\n assigns: { _resource: designer_resource }.merge(context)\n end"
] | [
"0.6632256",
"0.65122867",
"0.62836945",
"0.6240952",
"0.6211991",
"0.6149152",
"0.60650676",
"0.6040899",
"0.60390836",
"0.5912978",
"0.588273",
"0.58550835",
"0.58016735",
"0.5790005",
"0.5787996",
"0.5773915",
"0.57377756",
"0.57092065",
"0.5708593",
"0.5685544",
"0.5681378",
"0.56797004",
"0.5679612",
"0.56749386",
"0.56655914",
"0.5641224",
"0.5641224",
"0.5637003",
"0.56210077",
"0.56209433",
"0.5612168",
"0.5603436",
"0.55557746",
"0.55549663",
"0.55508333",
"0.555007",
"0.555007",
"0.555007",
"0.5540653",
"0.5539178",
"0.55387115",
"0.5537932",
"0.5536474",
"0.5506472",
"0.5506472",
"0.5502066",
"0.5502062",
"0.54980916",
"0.5491521",
"0.5488365",
"0.5472501",
"0.54593366",
"0.54500985",
"0.5450028",
"0.5449786",
"0.5438145",
"0.542891",
"0.5425611",
"0.54254687",
"0.54191715",
"0.541863",
"0.5412365",
"0.5407619",
"0.5401169",
"0.53980047",
"0.53942937",
"0.538487",
"0.5383408",
"0.53772116",
"0.53708965",
"0.5362111",
"0.53613234",
"0.5357848",
"0.53548485",
"0.53431064",
"0.5342796",
"0.5342633",
"0.5341577",
"0.5335222",
"0.5330306",
"0.532549",
"0.53244317",
"0.5320455",
"0.53202105",
"0.5317997",
"0.53171843",
"0.53143746",
"0.53132105",
"0.53057647",
"0.53056085",
"0.5299176",
"0.52990633",
"0.52986616",
"0.5291022",
"0.52792025",
"0.52777857",
"0.52770364",
"0.5275541",
"0.5264892",
"0.52642244"
] | 0.6471512 | 2 |
Use callbacks to share common setup or constraints between actions. | def set_article_diagram_block
# Get the record if it exists
@article_diagram_block = ArticleDiagramBlock.find(params[:id])
rescue ActiveRecord::RecordNotFound
@article_diagram_block = nil
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_required_actions\n # TODO: check what fields change to asign required fields\n end",
"def action_hook; end",
"def run_actions; end",
"def define_action_hook; end",
"def actions; end",
"def define_action_helpers\n if super && action == :save\n @instance_helper_module.class_eval do\n define_method(:valid?) do |*args|\n self.class.state_machines.fire_event_attributes(self, :save, false) { super(*args) }\n end\n end\n end\n end",
"def add_actions; end",
"def callbacks; end",
"def callbacks; end",
"def setup *actions, &proc\n (@setup_procs ||= []) << [proc, actions.size > 0 ? actions : [:*]]\n end",
"def define_action_helpers; end",
"def post_setup\n end",
"def action_methods; end",
"def action_methods; end",
"def action_methods; end",
"def before_setup; end",
"def action_run\n end",
"def execute(setup)\n @action.call(setup)\n end",
"def define_action_helpers?; end",
"def set_actions\n actions :all\n end",
"def action_done(action)\n dispatch = { :migrate => :done_migrating, :map => :done_mapping, :reduce =>\n :done_reducing, :finalize => :done_finalizing } \n self.send dispatch[action[:action]], action\n end",
"def dependencies action, &block\n @actions.each do |other|\n if action[:requires].include? other[:provide]\n block.call other\n end\n end\n end",
"def setup!\n return unless @setup_procs\n http_actions = actions\n @setup_procs.each do |setup_proc|\n proc, actions = setup_proc\n @setup__actions = actions.map do |action|\n\n action.is_a?(Regexp) ?\n http_actions.select { |a| a.to_s =~ action } :\n action.is_a?(String) && action =~ /\\A\\./ ?\n http_actions.map { |a| a.to_s << action if format?(a).include?(action) }.compact :\n action\n\n end.flatten\n self.class_exec &proc\n @setup__actions = nil\n end\n @setup_procs = nil\n end",
"def setup_handler\n end",
"def before_actions(*logic)\n self.before_actions = logic\n end",
"def set_action(opts)\n opts = check_params(opts,[:actions])\n super(opts)\n end",
"def setup(action)\n @targets.clear\n unless action.item.target_filters.empty?\n @targets = SES::TargetManager.make_targets(action)\n else\n item = action.item\n if item.for_opponent?\n @targets = $game_troop.alive_members\n elsif item.for_dead_friend?\n @targets = $game_party.battle_members.select { |actor| actor.dead? }\n else\n $game_party.battle_members.select { |actor| actor.alive? }\n end\n end\n @item_max = @targets.size\n create_contents\n refresh\n show\n activate\n end",
"def action; end",
"def action; end",
"def action; end",
"def action; end",
"def action; end",
"def revisable_shared_setup(args, block)\n class << self\n attr_accessor :revisable_options\n end\n options = args.extract_options!\n self.revisable_options = Options.new(options, &block)\n \n self.send(:include, Common)\n self.send(:extend, Validations) unless self.revisable_options.no_validation_scoping?\n self.send(:include, WithoutScope::QuotedColumnConditions)\n end",
"def workflow\n end",
"def setup\n @action = SampleActionAndroid.new(os_name: 'android',\n app_name: APP_PATH)\n end",
"def before(action)\n invoke_callbacks *self.class.send(action).before\n end",
"def process_action(...)\n send_action(...)\n end",
"def before_dispatch(env); end",
"def setup\n # override and do something appropriate\n end",
"def after_actions(*logic)\n self.after_actions = logic\n end",
"def setup(client)\n return unless @setup\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n actions.each do |action|\n action.execute(client)\n end\n self\n end",
"def setup(_context)\n end",
"def setup(resources) ; end",
"def validate_actions\n errors.add(:base, :should_give_at_least_one_action) if !manage? && !forecasting? && !read? && !api?\n end",
"def setup\n @resource_config = {\n :callbacks => {\n :before_create => nil,\n :after_create => nil,\n :before_update => nil,\n :after_update => nil,\n :before_destroy => nil,\n :after_destroy => nil,\n },\n :child_assoc => nil,\n :model => nil,\n :parent => nil,\n :path => nil,\n :permission => {},\n :properties => {},\n :relation => {\n :create => nil,\n :delete => nil,\n },\n :roles => nil,\n }\n end",
"def determine_valid_action\n\n end",
"def process_shared\n handle_taxes\n handle_shippings\n create_adjustments_from_params\n handle_status\n handle_inventory_refunds\n handle_payment_transactions\n order.updater.update\n end",
"def init_actions\n am = action_manager()\n am.add_action(Action.new(\"&Disable selection\") { @selection_mode = :none; unbind_key(32); bind_key(32, :scroll_forward); } )\n am.add_action(Action.new(\"&Edit Toggle\") { @edit_toggle = !@edit_toggle; $status_message.value = \"Edit toggle is #{@edit_toggle}\" })\n end",
"def startcompany(action)\n @done = true\n action.setup\n end",
"def event_callbacks(event, metadata={})\n case event\n when :reset, :review\n if confirmed\n update_attributes(confirmed: false)\n end\n when :confirm\n confirm\n # trigger :order for all applicable items\n # NOTE: :order event is common to both physical and digital items\n items.each do |i|\n if i.event_permitted(:order)\n user_id = last_transition.user_id\n i.trigger!(:order, { order_id: id, user_id: user_id })\n end\n end\n when :complete_work\n request = metadata[:request]\n work_complete_notification(request)\n when :close\n close\n end\n if event != :close && !open\n reopen\n end\n end",
"def setup_action\n return unless PONY::ERRNO::check_sequence(current_act)\n new_sequence = @action_sequence[@sequence_index+1...@action_sequence.size]\n @sequence_index = 0\n new_sequence = DND::SkillSequence::ACTS[@acts[1]] + new_sequence\n execute_sequence\n end",
"def define_tasks\n define_weave_task\n connect_common_tasks\n end",
"def setup(&block)\n define_method(:setup, &block)\n end",
"def setup\n transition_to(:setup)\n end",
"def setup\n transition_to(:setup)\n end",
"def action\n end",
"def setup( *args )\n\t\t\tself.class.setupBlocks.each {|sblock|\n\t\t\t\tdebugMsg \"Calling setup block method #{sblock}\"\n\t\t\t\tself.send( sblock )\n\t\t\t}\n\t\t\tsuper( *args )\n\t\tend",
"def config(action, *args); end",
"def setup\n @setup_proc.call(self) if @setup_proc\n end",
"def before_action \n end",
"def setup_callbacks\n defined_callbacks.each do |meth|\n unless respond_to?(\"call_#{meth}_callbacks\".to_sym)\n self.class.module_eval <<-EOE\n def call_#{meth}_callbacks(*args)\n plugin_store.each {|a| a.call_#{meth}_callbacks(*args) } if respond_to?(:plugin_store) && plugin_store\n self.send :#{meth}, *args if respond_to?(:#{meth})\n end\n EOE\n end\n end\n end",
"def action\n end",
"def matt_custom_action_begin(label); end",
"def setup\n # override this if needed\n end",
"def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend",
"def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend",
"def action(options,&callback)\n new_action = Action===options ? options : Action.new(options,&callback)\n # replace any with (shared name/alias or both default) + same arity\n @actions.delete_if do |existing_action|\n ((existing_action.names & new_action.names).size > 0 ||\n existing_action.default? && new_action.default?) &&\n existing_action.required.size == new_action.required.size &&\n existing_action.optional.size <= new_action.optional.size\n end\n @actions = (@actions + [new_action]).sort\n new_action\n end",
"def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action\n end",
"def after(action)\n invoke_callbacks *options_for(action).after\n end",
"def pre_task\n end",
"def setup(server)\n server.on('beforeMethod', method(:before_method), 10)\n end",
"def add_actions\n attribute = machine.attribute\n name = self.name\n \n owner_class.class_eval do\n define_method(name) {self.class.state_machines[attribute].events[name].fire(self)}\n define_method(\"#{name}!\") {self.class.state_machines[attribute].events[name].fire!(self)}\n define_method(\"can_#{name}?\") {self.class.state_machines[attribute].events[name].can_fire?(self)}\n end\n end",
"def init_actions\n @select_action = SelectAction.new\n @endpoint_mouse_action = EndpointMouseAction.new\n @move_action = MoveAction.new\n end",
"def setup_signals; end",
"def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend",
"def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend",
"def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action.respond_to?('weak!') ? action.weak! : action\n end",
"def initialize(*args)\n super\n @action = :set\nend",
"def setup\n #implement in subclass;\n end",
"def after_set_callback; end",
"def lookup_action; end",
"def setup &block\n if block_given?\n @setup = block\n else\n @setup.call\n end\n end",
"def setup_action\n return TSBS.error(@acts[0], 1, @used_sequence) if @acts.size < 2\n actions = TSBS::AnimLoop[@acts[1]]\n if actions.nil?\n show_action_error(@acts[1])\n end\n @sequence_stack.push(@acts[1])\n @used_sequence = @acts[1]\n actions.each do |acts|\n @acts = acts\n execute_sequence\n break if @break_action\n end\n @sequence_stack.pop\n @used_sequence = @sequence_stack[-1]\n end",
"def release_actions; end",
"def setup(easy)\n super\n easy.customrequest = @verb\n end",
"def around_hooks; end",
"def save_action; end",
"def action_target()\n \n end",
"def setup\n callback(:setup) do\n notify(:setup)\n migration_check.last_deployed_commit\n end\n end",
"def setup\n return unless @setup\n\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n run_actions_and_retry(actions)\n self\n end",
"def before_setup\n # do nothing by default\n end",
"def my_actions(options)\n @setup = false\n get_template_part(\"custom_used\",\"action_users\",true)\n end",
"def default_action; end",
"def setup(&blk)\n @setup_block = blk\n end",
"def callback_phase\n super\n end",
"def advice\n end",
"def _handle_action_missing(*args); end",
"def shared_action(name, &block)\n @controller.shared_actions[name] = block\n end",
"def setup_initial_state\n\n state_a = State.new(\"a\", 0)\n state_b = State.new(\"b\", 0)\n state_c = State.new(\"c\", 10)\n\n move_to_b = Action.new(\"move_to_b\", 1, state_b)\n\n move_to_c = Action.new(\"move_to_c\", 1, state_c)\n\n state_a.actions = [move_to_b, move_to_c]\n\n return state_a\n \nend",
"def before_action action, &block\n @audience[:before][action] ||= Set.new\n @audience[:before][action] << block\n end",
"def duas1(action)\n action.call\n action.call\nend"
] | [
"0.6165152",
"0.60463154",
"0.59467196",
"0.5917112",
"0.5890387",
"0.58345735",
"0.57773316",
"0.56991524",
"0.56991524",
"0.565454",
"0.5622282",
"0.54232633",
"0.54119074",
"0.54119074",
"0.54119074",
"0.53937256",
"0.53801376",
"0.5358599",
"0.53412294",
"0.5340814",
"0.53314966",
"0.53114754",
"0.52984965",
"0.52977055",
"0.5296272",
"0.5260649",
"0.5245076",
"0.52388334",
"0.52388334",
"0.52388334",
"0.52388334",
"0.52388334",
"0.5235081",
"0.52321917",
"0.5228592",
"0.5220735",
"0.52198535",
"0.52139324",
"0.5208539",
"0.5206585",
"0.5178542",
"0.5175199",
"0.5173538",
"0.5167041",
"0.51614195",
"0.51577675",
"0.5153909",
"0.51528823",
"0.5152225",
"0.51429904",
"0.5141399",
"0.51345575",
"0.51145",
"0.5114052",
"0.5114052",
"0.5110216",
"0.5108656",
"0.50935394",
"0.5089196",
"0.5081936",
"0.5079627",
"0.50675833",
"0.5056105",
"0.5053687",
"0.5050475",
"0.5050475",
"0.503471",
"0.5028311",
"0.501982",
"0.50157547",
"0.5013552",
"0.50014806",
"0.50011593",
"0.49976763",
"0.4990292",
"0.4990292",
"0.49882022",
"0.4981269",
"0.49792367",
"0.49766538",
"0.4967978",
"0.49667212",
"0.4958987",
"0.49572337",
"0.49550423",
"0.4954479",
"0.4952353",
"0.494726",
"0.4944055",
"0.4935437",
"0.4931248",
"0.49283475",
"0.49281213",
"0.49268973",
"0.4921738",
"0.49204507",
"0.4918924",
"0.49182287",
"0.4916538",
"0.49158585",
"0.49156788"
] | 0.0 | -1 |
Returns the point offset in a 3D space | def view_offset
@position + Moon::Vector3[@view.position, 0]
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def dot(point3)\n (@x*point3.x)+(@y*point3.y)+(@z*point3.z)\n end",
"def distance_to(point3)\n Math.sqrt(((@x-point3.x)**2)+((@y-point3.y)**2)+((@z-point3.z)**2))\n end",
"def to_p\n Point3.new(@x, @y, @z)\n end",
"def to_ole_point3d(pt)\n case pt\n when ole_point3d?(pt)\n pt\n when Point3d\n create_ole_point(pt.x, pt.y, pt.z)\n when Array\n pt1 = pt.map(&:to_f)\n x, y, z = pt1\n z ||= 0.0\n create_ole_point(x, y, z)\n end\n end",
"def to_point3d(pt)\n case pt\n when Array\n pt_a = pt.map(&:to_f)\n x, y, z = pt_a\n z ||= 0.0\n Point3d.new(x, y, z)\n when Point3d\n pt\n when WIN32OLE_RECORD\n Point3d.from_ole(pt) if pt.typename == \"Point3d\"\n end\n end",
"def coords_to_pos(point)\n (size - 1 - point.y) * size + point.x\n end",
"def x_offset; end",
"def center\n a, b, c, d = @points\n\n Geom::Point3d.new(\n (a.x + b.x + c.x + d.x) / 4,\n (a.y + b.y + c.y + d.y) / 4,\n (a.z + b.z + c.z + d.z) / 4\n )\n end",
"def offset\n\t\t\t@position + @offset\n\t\tend",
"def view_offset\n @position + @view.position\n end",
"def Segment3dClosestPointXY(arg0, arg1, arg2, arg3)\n ret = _invoke(1610744258, [arg0, arg1, arg2, arg3], [VT_BYREF | VT_DISPATCH, VT_BYREF | VT_DISPATCH, VT_BYREF | VT_DISPATCH, VT_BYREF | VT_R8])\n @lastargs = WIN32OLE::ARGV\n ret\n end",
"def determine_offset( image )\n offset_value = offset.is_a?( Rational ) ? image.size( axis ) * offset.to_f : offset\n return offset_value.to_i\n end",
"def content_offset(offset, dimension)\n return 0 unless offset >= dimension\n\n offset - dimension\n end",
"def relative_offset\n active_position = self.game.player.position\n if self.position >= active_position\n return (active_position - self.position) / 10\n else\n return (active_position - self.position - self.game.number_of_players) / 10\n end\n end",
"def Point3dOne\n ret = _invoke(1610743847, [], [])\n @lastargs = WIN32OLE::ARGV\n ret\n end",
"def offset_distance(x1, y1, x2, y2)\n ac = offset_to_cube(x1, y1)\n bc = offset_to_cube(x2, y2)\n cube_distance(ac, bc)\nend",
"def offset\n @offset ||= (position.unitless? || position.unit_str == \"px\") ? position.value : 0\n end",
"def viewport_offset\n @viewport_offset ||= {x: part_layout.x.to_i, y: part_layout.y.to_i}\n end",
"def point_to_index(x,y)\n return (x*(bpp >> 3))+(y*((bpp >> 3)*(width)))\n end",
"def Point3dZero\n ret = _invoke(1610743846, [], [])\n @lastargs = WIN32OLE::ARGV\n ret\n end",
"def OffsetFromClosestPointToOrigin ()\n\t\toffset = @radius - Math.sqrt(0.5 * @radius**2)\n\t\treturn offset,offset\n\tend",
"def get_offset\n @offset\n end",
"def get_offset\n if @offset == nil and @rep\n attribs = @rep.get_attributes \"camera\"\n if( attribs )\n eo = attribs[\"eo\"]\n if( eo.kind_of?(Array) and eo.length == 3 )\n @offset = eo\n end\n end\n @offset = false if @offset == nil\n end\n @offset\nend",
"def Point3dFromXY(arg0, arg1)\n ret = _invoke(1610743849, [arg0, arg1], [VT_R8, VT_R8])\n @lastargs = WIN32OLE::ARGV\n ret\n end",
"def byte_offset(loc) loc.y * line_byte_size + loc.x * pixel_byte_size; end",
"def xy(offset_x, offset_y)\n @board[3 * offset_y + offset_x - 4]\n end",
"def element_center_pos(eid, part = nil)\n if part\n e = parts[part].elements[eid.to_i]\n else\n e = elements[eid]\n end\n if e.nil?\n raise ( \"Element #{eid}\" + (part ? \" in #{part}\" : \"\") + \" is not found\" )\n end\n x = 0.0\n y = 0.0\n z = 0.0\n n = 0\n e.nodes.each do |nid|\n if part\n nd = parts[part].nodes[nid]\n else\n nd = nodes[nid]\n end\n x += nd.x\n y += nd.y\n z += nd.z\n n += 1\n end\n return [x / n, y / n, z / n]\n end",
"def Ray3dClosestPointXY(arg0, arg1, arg2, arg3)\n ret = _invoke(1610744263, [arg0, arg1, arg2, arg3], [VT_BYREF | VT_DISPATCH, VT_BYREF | VT_DISPATCH, VT_BYREF | VT_DISPATCH, VT_BYREF | VT_R8])\n @lastargs = WIN32OLE::ARGV\n ret\n end",
"def find_princess_position\n position_coordinates('p')\n end",
"def screen_z_formula\n @shadow_point.screen_y + additional_z\n # Real Y position (without jumping) + Additional Z value\n end",
"def offset()\n @offset__\n end",
"def Point3dFromSegment3dTangent(arg0)\n ret = _invoke(1610744250, [arg0], [VT_BYREF | VT_DISPATCH])\n @lastargs = WIN32OLE::ARGV\n ret\n end",
"def triangle_point(sPoint, a, b, c)\r\n pts = []\r\n pts[0] = sPoint\r\n pts[1] = Geom::Point3d.new(sPoint[0] + a, sPoint[1], sPoint[2])\r\n a = a.to_f\r\n b = b.to_f\r\n c = c.to_f\r\n dx = (b*b - c*c + a*a) / (2*a)\r\n dy = Math.sqrt(b*b - dx*dx)\r\n pts[2] = Geom::Point3d.new(sPoint[0] + dx, sPoint[1] + dy, sPoint[2])\r\n return pts\r\nend",
"def Point3dFromVector3d(arg0)\n ret = _invoke(1610744207, [arg0], [VT_BYREF | VT_DISPATCH])\n @lastargs = WIN32OLE::ARGV\n ret\n end",
"def z\n return nil unless @grpc.position\n @grpc.position.z\n end",
"def Vector3dFromPoint3d(arg0)\n ret = _invoke(1610744187, [arg0], [VT_BYREF | VT_DISPATCH])\n @lastargs = WIN32OLE::ARGV\n ret\n end",
"def getOffset\r\n div = (@stepOver >= 0.75) ? 3 : 2\r\n if (@stepOver >= 0.85)\r\n div = 4\r\n end\r\n if @keyflag == 1\r\n offset = @bit_diameter * @stepOver / div\r\n else\r\n offset = @bit_diameter * 0.5 + @bit_diameter * @stepOver / div\r\n end\r\n# if @keyflag == 1 # then only zigzag\r\n# offset = @bit_diameter * 0.1\r\n# else\r\n# offset = @bit_diameter * 0.6 #zigzag plus outline so leave space for outline\r\n# end\r\n return offset\r\n end",
"def unit(x=1,y=1,z=1)\n point3.unit!\n end",
"def Point3dDotDifferenceVector3d(arg0, arg1, arg2)\n ret = _invoke(1610744206, [arg0, arg1, arg2], [VT_BYREF | VT_DISPATCH, VT_BYREF | VT_DISPATCH, VT_BYREF | VT_DISPATCH])\n @lastargs = WIN32OLE::ARGV\n ret\n end",
"def object_position(obj)\n return obj.x\n end",
"def object_position(obj)\n return obj.x\n end",
"def Transform3dGetPointComponent(arg0, arg1)\n ret = _invoke(1610743921, [arg0, arg1], [VT_BYREF | VT_DISPATCH, VT_I4])\n @lastargs = WIN32OLE::ARGV\n ret\n end",
"def global_position_of_elmt elmt\n elmt_offset_at find_elmt_index(elmt)\n end",
"def Segment3dClosestPoint(arg0, arg1, arg2, arg3)\n ret = _invoke(1610744256, [arg0, arg1, arg2, arg3], [VT_BYREF | VT_DISPATCH, VT_BYREF | VT_DISPATCH, VT_BYREF | VT_DISPATCH, VT_BYREF | VT_R8])\n @lastargs = WIN32OLE::ARGV\n ret\n end",
"def distance_to(pt)\n if pt.is_valid?\n vect = GeoFunctions.point_minus_point(pt,@origin)\n GeoFunctions.vector_dot_product(vect, @z_axis)\n else\n nil\n end\n end",
"def get_point_position(index)\n MSPhysics::Newton::CurvySlider.get_point_position(@address, index)\n end",
"def get_point_position(index)\n MSPhysics::Newton::CurvySlider.get_point_position(@address, index)\n end",
"def Point3dFromXYZ(arg0, arg1, arg2)\n ret = _invoke(1610743848, [arg0, arg1, arg2], [VT_R8, VT_R8, VT_R8])\n @lastargs = WIN32OLE::ARGV\n ret\n end",
"def calc_input_offset\n if input_count.zero?\n 0\n else\n buffer.abs_offset\n end\n end",
"def Point3dFromRay3dTangent(arg0)\n ret = _invoke(1610744260, [arg0], [VT_BYREF | VT_DISPATCH])\n @lastargs = WIN32OLE::ARGV\n ret\n end",
"def Range3dFromPoint3dPoint3dPoint3d(arg0, arg1, arg2)\n ret = _invoke(1610744084, [arg0, arg1, arg2], [VT_BYREF | VT_DISPATCH, VT_BYREF | VT_DISPATCH, VT_BYREF | VT_DISPATCH])\n @lastargs = WIN32OLE::ARGV\n ret\n end",
"def x_location_vertex\n return @ob_vx_location\n end",
"def Vector3dUnitPerpendicularXY(arg0)\n ret = _invoke(1610744176, [arg0], [VT_BYREF | VT_DISPATCH])\n @lastargs = WIN32OLE::ARGV\n ret\n end",
"def center\n @vbuffer.buffer.min(1).to_a.zip(@vbuffer.buffer.max(1).to_a).map {|min,max| min + ((max-min)/2).abs }\n end",
"def get_3d_polygon()\n height = get_keyword_value(\"HEIGHT\").to_f\n width = get_keyword_value(\"WIDTH\").to_f\n x = self.check_keyword?(\"X\")? self.get_keyword_value(\"X\").to_f : 0.0\n y = self.check_keyword?(\"Y\")? self.get_keyword_value(\"Y\").to_f : 0.0\n #counter clockwise\n origin = OpenStudio::Point3d.new( x, y , 0.0 )\n p2 = OpenStudio::Point3d.new(x + width , y,0.0 )\n p3 = OpenStudio::Point3d.new(x + width , y + height , 0.0 )\n p4 = OpenStudio::Point3d.new(x, y + height,0.0 )\n return [origin,p2,p3,p4]\n end",
"def Range3dFromPoint3d(arg0)\n ret = _invoke(1610744080, [arg0], [VT_BYREF | VT_DISPATCH])\n @lastargs = WIN32OLE::ARGV\n ret\n end",
"def Ray3dClosestPoint(arg0, arg1, arg2, arg3)\n ret = _invoke(1610744261, [arg0, arg1, arg2, arg3], [VT_BYREF | VT_DISPATCH, VT_BYREF | VT_DISPATCH, VT_BYREF | VT_DISPATCH, VT_BYREF | VT_R8])\n @lastargs = WIN32OLE::ARGV\n ret\n end",
"def coords\n Vector[@ob.x, @ob.y, @ob.z]\n end",
"def closest_point(pt)\n if pt.is_valid?\n vect = GeoFunctions.point_minus_point(pt, @origin)\n dist = GeoFunctions.vector_dot_product(vect, @z_axis)\n delta = GeoFunctions.vector_times(@z_axis, dist)\n GeoFunctions.point_minus_vector(pt, delta)\n else\n GeoFunctions.invalid_a_point\n end\n end",
"def Point3dFromTransform3dTimesXYZ(arg0, arg1, arg2, arg3)\n ret = _invoke(1610743923, [arg0, arg1, arg2, arg3], [VT_BYREF | VT_DISPATCH, VT_R8, VT_R8, VT_R8])\n @lastargs = WIN32OLE::ARGV\n ret\n end",
"def offset_x_position(offset)\n offset = offset % 32\n return if offset <= 0\n \n change = 1.0 / 32.0 * offset\n @x = @x.floor + change\n end",
"def to_s\n \"Point3: x #{x} y #{y} z #{z}\"\n end",
"def coords_ahead\n dx = (dir_index - 2).remainder(2).to_i\n dy = (dir_index - 1).remainder(2).to_i\n [posx - dx, posy - dy]\n end",
"def xyz_to_index(x, y, z)\n case @cell_order\n when CELL_ORDER_COLS then (x % columns) +\n (y * columns) +\n (z * columns * rows)\n when CELL_ORDER_ROWS then (x * rows * layers) +\n (y % rows) +\n (z * rows)\n when CELL_ORDER_LAYS then (x * layers) +\n (y * layers * columns) +\n (z % layers)\n end\n end",
"def screen_z\n # Return after calculating z-coordinate by order of members in party\n if self.index != nil\n return 4 - self.index\n else\n return 0\n end\n end",
"def offset\n address(relative: true)\n end",
"def offset; end",
"def offset; end",
"def offset; end",
"def offsetX\n\t\t@db.hget('sgt-sector:' + @id, 'offsetx').to_i\n\tend",
"def origin\n Entities::Point.new(\n (Game::WIDTH - map.pixel_width) / 2,\n (Game::HEIGHT - map.pixel_height) / 2\n )\n end",
"def center()\n Vector.new(x + w / 2, y + h / 2, z)\n end",
"def object_position(obj)\n return obj.y\n end",
"def object_position(obj)\n return obj.y\n end",
"def offset(*) end",
"def farpoint() origin + size end",
"def offset_of(member)\n self::MEMBERS_HASH[member].offset\n end",
"def position\n V[x, y]\n end",
"def Point3dInPolygonXY(arg0, arg1, arg2 = nil)\n ret = _invoke(1610744132, [arg0, arg1, arg2], [VT_BYREF | VT_DISPATCH, VT_BYREF | VT_ARRAY | VT_DISPATCH, VT_R8])\n @lastargs = WIN32OLE::ARGV\n ret\n end",
"def Point3dFromMatrix3dInverseTimesPoint3d(arg0, arg1)\n ret = _invoke(1610743902, [arg0, arg1], [VT_BYREF | VT_DISPATCH, VT_BYREF | VT_DISPATCH])\n @lastargs = WIN32OLE::ARGV\n ret\n end",
"def get_index(position:)\n row = (position - 1) / 3\n col = (position - 1) % 3\n return row, col\n end",
"def Range3dFromPoint3dPoint3d(arg0, arg1)\n ret = _invoke(1610744081, [arg0, arg1], [VT_BYREF | VT_DISPATCH, VT_BYREF | VT_DISPATCH])\n @lastargs = WIN32OLE::ARGV\n ret\n end",
"def convert_coords(screen, x, y, z)\n\t\txd = x * $persp / (z + $space_size) + screen.width / 2\n\t\tyd = y * $persp / (z + $space_size) + screen.height / 2\n\t\treturn xd, yd\n\tend",
"def dot(*args)\n vx, vy, vz = args.extract_vector3i!\n x * vx + y * vy + z * vz\n end",
"def neighbor_points point\n validate_point(point)\n row, col, height = point[0], point[1], point[2]\n offsets = [[-1,-1,0], [-1,0,0], [0,-1,0], [0,1,0], [1,0,0], \\\n [1,1,0], [0,0,1], [0,0,-1]]\n offsets.map do |r,c,h|\n [row+r, col+c, height+h]\n end\n end",
"def offset\n operation.offset\n end",
"def get_block_position(x, y, z)\n position = get_tile_position(x,y)\n position.y -= (assets.block_height / 2.0).round * (z + 1)\n position\n end",
"def tile_offset index\n\t\t\t@unit_size * index\n\t\tend",
"def Point3dDotDifference(arg0, arg1, arg2)\n ret = _invoke(1610743843, [arg0, arg1, arg2], [VT_BYREF | VT_DISPATCH, VT_BYREF | VT_DISPATCH, VT_BYREF | VT_DISPATCH])\n @lastargs = WIN32OLE::ARGV\n ret\n end",
"def Point3dFromTransform3d(arg0)\n ret = _invoke(1610743937, [arg0], [VT_BYREF | VT_DISPATCH])\n @lastargs = WIN32OLE::ARGV\n ret\n end",
"def offset\n self[:ip_off]\n end",
"def position_along_axis(axis, point)\n axis.dot(point)\n end",
"def getPosIndex(pos)\n (x,y,z) = pos ;\n dx = x + @offset[0] - @origin[0] ;\n dy = y + @offset[1] - @origin[1] ;\n dz = z + @offset[2] - @origin[2] ;\n ix = (dx / @gridSize[0]).floor ;\n iy = (dy / @gridSize[1]).floor ;\n iz = (dz / @gridSize[2]).floor ;\n return [ix, iy, iz] ;\n end",
"def paddle_x\n @cr[8]\n end",
"def previous_offset\n @previous_offset ||= if after\n offset_from_cursor(after)\n elsif before\n offset_from_cursor(before) - (last ? last : 0) - 1\n else\n 0\n end\n end",
"def lon\n @position[1]\n end",
"def center\n @center ||= begin\n xs, ys = vertices.transpose\n [xs.inject(:+)/xs.size.to_f, ys.inject(:+)/ys.size.to_f]\n end\n end",
"def Segment3dClosestPointBoundedXY(arg0, arg1, arg2, arg3)\n ret = _invoke(1610744259, [arg0, arg1, arg2, arg3], [VT_BYREF | VT_DISPATCH, VT_BYREF | VT_DISPATCH, VT_BYREF | VT_DISPATCH, VT_BYREF | VT_R8])\n @lastargs = WIN32OLE::ARGV\n ret\n end",
"def x\n OFFSET_FROM_LEFT + (coordinates.x * 700).to_i\n end",
"def screen_position_relative_to(px,py,xi,yi,sextx,sexty)\n tx = @wrapped_surface.tile_x\n ty = @wrapped_surface.tile_y\n xoff = offset_from_screen(xi*tx, px, sextx)\n yoff = offset_from_screen(yi*ty, py, sexty)\n [xoff,yoff]\n end"
] | [
"0.6346933",
"0.6281096",
"0.60767937",
"0.60765",
"0.5999813",
"0.5917599",
"0.59052354",
"0.5872226",
"0.57737666",
"0.5761197",
"0.5752305",
"0.57245857",
"0.5684961",
"0.56696993",
"0.5660874",
"0.5654038",
"0.56280303",
"0.5623192",
"0.5601071",
"0.55684835",
"0.5563004",
"0.55601007",
"0.5558345",
"0.55545473",
"0.55430514",
"0.55272335",
"0.552379",
"0.55021244",
"0.5471569",
"0.54661214",
"0.54650414",
"0.546494",
"0.5447857",
"0.54370195",
"0.54269725",
"0.5421206",
"0.5420405",
"0.54025406",
"0.5400304",
"0.54001456",
"0.53987706",
"0.53919804",
"0.53832793",
"0.53796816",
"0.5364275",
"0.5359784",
"0.5359784",
"0.53558564",
"0.5340725",
"0.53359294",
"0.5330177",
"0.53296864",
"0.529761",
"0.5296571",
"0.52766347",
"0.5252146",
"0.52480125",
"0.5247637",
"0.5239665",
"0.52173764",
"0.52161056",
"0.52145773",
"0.52112246",
"0.5207734",
"0.52040064",
"0.52021766",
"0.5200443",
"0.5200443",
"0.5200443",
"0.5199261",
"0.5197901",
"0.5197003",
"0.5190338",
"0.5190338",
"0.5189742",
"0.51834863",
"0.5181571",
"0.5181227",
"0.51788896",
"0.5176309",
"0.5176275",
"0.51643527",
"0.51638234",
"0.5160688",
"0.51595336",
"0.5150137",
"0.5149614",
"0.51477605",
"0.51455355",
"0.5144136",
"0.51370347",
"0.5131859",
"0.51283157",
"0.5123263",
"0.51190335",
"0.50976145",
"0.5094998",
"0.5092811",
"0.5092589",
"0.50925726"
] | 0.654384 | 0 |
Retrieve a response from the Solr endpoint for a faceted query | def get_fq_solr_response(fq)
solr_url = @blacklight_context.connection_config[:url]
conn = Faraday.new(url: solr_url) do |faraday|
faraday.request :url_encoded # form-encode POST params
faraday.adapter Faraday.default_adapter # make requests with Net::HTTP
end
facet_request = \
"#{core_url}select?fq=#{fq}&fl=id,title_display,author_display,\
isbn_display,issn_display,lccn_display,oclc_s,holdings_1display,electronic_portfolio_s\
&rows=#{@rows}&wt=json"
conn.get facet_request
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def response\n @solr_response\n end",
"def facet_field_response(facet_field, extra_controller_params = {})\n query = search_builder.with(search_state).facet(facet_field)\n repository.search(query.merge(extra_controller_params))\n end",
"def get_facet_field_response(facet_field, req_params = nil, eds_params = nil)\n search_service.get_facet_field_response(\n facet_field,\n (req_params || params),\n eds_params\n )\n end",
"def browse(_params, doc_centric)\n target = _params.delete(:q)\n ref = _params[:ref] # reference point, used for paging\n dir = _params[:dir]\n per_page = _params.fetch(:per_page, blacklight_config.default_per_page).to_i\n\n @facet = blacklight_config.facet_fields[_params[:id]]\n\n (@response, @document_list, @display_facet, @display_facet_window) =\n search_results_with_xfacets(_params, @facet, target, ref, dir, per_page, doc_centric)\n\n respond_to do |format|\n format.html\n format.json\n end\n end",
"def facet\n @facet = blacklight_config.facet_fields[params[:id]]\n raise ActionController::RoutingError, 'Not Found' unless @facet\n\n @response = search_service.facet_field_response(@facet.key)\n @display_facet = @response.aggregations[@facet.field]\n\n @presenter = @facet.presenter.new(@facet, @display_facet, view_context)\n @pagination = @presenter.paginator\n respond_to do |format|\n format.html do\n # Draw the partial for the \"more\" facet modal window:\n return render layout: false if request.xhr?\n # Otherwise draw the facet selector for users who have javascript disabled.\n end\n format.json\n end\n end",
"def facets\n @solr_data[:facets]\n end",
"def search\n query = params[:q]\n works = ActiveFedora::SolrService.query(query, fq: @fq, fl: @fl, df: @df, rows: @max_rows) \n format_solr_keys(works)\n render(json: works)\n end",
"def facet\n # raise\n @facet = blacklight_config.facet_fields[params[:id]]\n return render json: nil, status: :bad_request unless @facet\n\n # Allow callers to pass in extra params, that won't be sanitized-out by\n # the processing that 'params' undergoes\n extra_params = params[:extra_params] || {}\n\n @response = get_facet_field_response(@facet.key, params, extra_params)\n @display_facet = @response.aggregations[@facet.key]\n\n @pagination = facet_paginator(@facet, @display_facet)\n\n # 2/23/2017 - turned off after two weeks of data collection (NEXT-908)\n # # 2/7/2017 - get some info on see-more sizes, hopefully to be\n # # turned off pretty soon. Hardcode test to current limit, 500)\n # limit = (@display_facet.items.size == 501) ? ' - HIT LIMIT' : ''\n # Rails.logger.warn \"FACET-SEE-MORE name: #{@display_facet.name} count: #{@display_facet.items.size}#{limit}\"\n\n respond_to do |format|\n # Draw the facet selector for users who have javascript disabled:\n format.html\n format.json { render json: render_facet_list_as_json }\n\n # Draw the partial for the \"more\" facet modal window:\n format.js { render layout: false }\n end\n end",
"def facet\n # raise\n @facet = blacklight_config.facet_fields[params[:id]]\n return render json: nil, status: :bad_request unless @facet\n\n # Allow callers to pass in extra params, that won't be sanitized-out by\n # the processing that 'params' undergoes\n extra_params = params[:extra_params] || {}\n\n @response = get_facet_field_response(@facet.key, params, extra_params)\n @display_facet = @response.aggregations[@facet.key]\n\n @pagination = facet_paginator(@facet, @display_facet)\n\n # 2/23/2017 - turned off after two weeks of data collection (NEXT-908)\n # # 2/7/2017 - get some info on see-more sizes, hopefully to be\n # # turned off pretty soon. Hardcode test to current limit, 500)\n # limit = (@display_facet.items.size == 501) ? ' - HIT LIMIT' : ''\n # Rails.logger.warn \"FACET-SEE-MORE name: #{@display_facet.name} count: #{@display_facet.items.size}#{limit}\"\n\n respond_to do |format|\n # Draw the facet selector for users who have javascript disabled:\n format.html { render layout: false }\n format.json { render json: render_facet_list_as_json }\n\n # Draw the partial for the \"more\" facet modal window:\n format.js { render layout: false }\n end\n end",
"def fetch_facets(query, facets_array, include_zero)\n Rails.logger.debug(\"Finding facets for query '#{query}'\")\n criteria = {}\n criteria[:page_size] = 1\n criteria['facet[]'] = facets_array\n criteria['facet.mincount'] = 1 if !include_zero\n data = archivesspace.search(query, 1, criteria) || {}\n faceting = {}\n if !data['facets'].blank? && !data['facets']['facet_fields'].blank?\n faceting = data['facets']['facet_fields']\n end\n end",
"def facets\n @solr_data[:facets]\n end",
"def results\n filter = params[:filter] || {}\n \n if stale?(base.facet_cache_key)\n\n @results = base.refine(filter).to_a\n\n respond_to do |format|\n format.html { render @results, :layout => false }\n format.json { render :json => @results }\n end\n end\n end",
"def get_opensearch_response(field=nil, extra_controller_params={})\n solr_params = solr_opensearch_params(extra_controller_params)\n response = Blacklight.solr.find(solr_params)\n a = [solr_params[:q]]\n a << response.docs.map {|doc| doc[solr_params[:fl]].to_s }\n end",
"def search\n @hits = []\n\n if params[:query]\n search = DesignMethod.solr_search do\n fulltext params[:query] do\n highlight\n minimum_match 0\n end\n end\n store_location\n @hits = search.hits\n @results = search.results\n end\n\n respond_to do |format|\n format.html\n format.json { render json: @results }\n end\n end",
"def subfacet(key, req, rsp)\n case req[:type]\n when 'query'\n count = rsp[:count]\n return Blacklight::Solr::Response::Facets::FacetItem.new(value: key, hits: count, label: key, subs: subs(req, rsp, {count: count}))\n when 'terms'\n # most info/stats/facets are at the level of the individual term\n # here we ignore top-level \"count\", but TODO: perhaps in some contexts it could be relevant?\n # count = rsp['count']\n field_name = req[:field]\n parent_fq = nil #nocommit: should populate parent_fq to be meaningful?\n return rsp['buckets'].map do |bucket|\n val = bucket[:val]\n count = bucket[:count]\n Blacklight::Solr::Response::Facets::FacetItem.new(\n value: val,\n hits: count,\n field: field_name,\n fq: parent_fq,\n subs: subs(req, bucket, {val: val, count: count})\n )\n end\n else\n raise StandardError, \"unsupported facet type: #{req[:type]}\" # range, heatmap\n end\n end",
"def facets\n facet_name = request.params[\"f_name\"]\n if facet_name == nil\n render :json => nil\n return\n end\n @presenter = execute_search(-1)\n facet_data = @presenter.facets.find {|f| f.name == facet_name }\n render :json => facet_data.values\n rescue => ex\n backtrace = ex.backtrace.join(\"\\r\\n\")\n Rails.logger.error(\"Could not render facets as JSON. Exception: #{ex} \\r\\n #{backtrace}\")\n render :json => nil, status: 500\n end",
"def fetch_for_field(field_name, facet_params)\n example_count = facet_params[:examples]\n example_fields = facet_params[:example_fields]\n\n facet_options = @response_facets.fetch(field_name, {}).fetch(\"terms\", [])\n\n slugs = facet_options.map { |option|\n option[\"term\"]\n }\n if slugs.empty?\n {}\n else\n fetch_by_slug(field_name, slugs, example_count, example_fields)\n end\n end",
"def solr_response(solr_params, req_handler='select')\n response = solr.send_and_receive(req_handler, {:method => :get, :params => solr_params})\n RSpecSolr::SolrResponseHash.new(response)\n end",
"def results\n facet_results = blacklight_config.repository.search(query)\n facet_results.facet_fields[depositor_field].each_slice(2)\n end",
"def wrap_solr_request\n\n # Get fq parameters from request object\n fq =[]\n request.query_string.split(\"&\").each do |p|\n if p.starts_with?(\"fq=\")\n fq.push(URI.decode_www_form_component(p[3..-1]))\n end\n end\n\n q = params[:q] || \"*:*\"\n wt = params[:wt] || \"json\"\n start = params[:start] || 0\n rows = params[:rows] || 10\n sort = params[:sort] || 'pubyear desc,modified desc'\n\n\n response = solr.get 'select', :params => {:q => q, :fq => fq, :wt=> wt, :sort => sort, :start => start.to_i, :rows => rows.to_i}\n\n if wt.eql?(\"xml\")\n render xml: response\n elsif wt.eql?(\"json\")\n render json: response\n else\n render nothing: true\n end\n end",
"def search\n @q = params[:q]\n @results = Series.external_search(@q)\n\n respond_to do |format|\n format.html # search.html.haml\n format.json { render json: @results.to_json }\n end\n end",
"def facet\n @pagination = get_facet_pagination\n end",
"def get_opensearch_response(field=nil, extra_controller_params={})\n solr_params = solr_opensearch_params().merge(extra_controller_params)\n response = find(solr_params)\n a = [solr_params[:q]]\n a << response.docs.map {|doc| doc[solr_params[:fl]].to_s }\n end",
"def solr_response(solr_params, req_handler = 'select')\n RSpecSolr::SolrResponseHash.new(\n solr_conn.send_and_receive(req_handler,\n method: :get,\n params: solr_params.merge(\n 'testing' => 'trlnbib_index_testing'\n ))\n )\n end",
"def show\n # Render 404 if category_id not valid\n raise(ActionController::RoutingError, 'not found') unless collections_config[params[:category_id].to_sym]\n\n # If category_id is valid look up any additional solr parameters\n @category = send params[:category_id].to_sym\n facet_name = @category.use_queries ? \"featured_search\" : @category.facet\n response = AcademicCommons.search do |parameters|\n parameters.rows(0).facet_limit(-1)\n if @category.use_queries # {!ex=pt key=valueKey}field:query\n @category.values.each { |key, value| parameters.add_facet_query \"{!ex=featured_search key=#{key}}#{value.query}\" }\n else\n parameters.facet_by(facet_name)\n @category.filter.each { |f, v| parameters.filter(f, v) }\n end\n end\n\n facet_counts = @category.use_queries ? response.facet_queries : response.facet_fields[facet_name].each_slice(2).to_a.to_h\n facet_counts.keep_if { |k, _| @category.values.keys.include?(k) } if @category.values.present?\n\n @collections = facet_counts.map do |value, count|\n filters = { facet_name => value }.merge(@category.filter)\n c = @category.values.fetch(value, OpenStruct.new(label: value))\n c.count = count\n c.search_url = search_url(filters)\n c\n end\n end",
"def test_facet_search_with_query\n records = Electronic.find_with_facet \"memory\", :facets => {:query => [\"price:[* TO 200.00]\",\n \"price:[200.00 TO 500.00]\",\n \"price:[500.00 TO *]\"]},\n :field_types => {:price => :range_float}\n assert_equal 4, records[:docs].size\n assert_equal({\"facet_queries\" => {\"price_rf:[* TO 200.00]\"=>2,\n \"price_rf:[500.00 TO *]\"=>1,\n \"price_rf:[200.00 TO 500.00]\"=>1}, \n \"facet_fields\" => {}}, records[:facets])\n end",
"def xhr_search\n endpoint = params[:endpoint]\n\n @query = params_q_scrubbed\n\n searcher = search_service.one(endpoint)\n\n respond_to do |format|\n format.html {\n render :json => { endpoint => render_to_string(\n :partial => \"search/xhr_response\",\n :layout => false,\n :locals => { module_display_name: t(\"#{endpoint}_search.display_name\"),\n searcher: searcher,\n search: '',\n service_name: endpoint\n })}\n }\n\n format.json {\n\n # prevents openstruct object from results being nested inside tables\n # See: http://stackoverflow.com/questions/7835047/collecting-hashes-into-openstruct-creates-table-entry\n result_list = []\n searcher.results.each do |result|\n result_list << result.to_h\n end\n\n render :json => { :endpoint => endpoint,\n :total => searcher.total,\n :results => result_list\n }\n }\n end\n end",
"def cjk_adv_solr_resp(solr_params, req_handler = 'select')\n q_val = solr_params['q']\n if num_cjk_uni(q_val) == 0\n RSpecSolr::SolrResponseHash.new(solr_conn.send_and_receive(req_handler, method: :get, params: solr_params.merge(solr_args)))\n else\n if q_val =~ /\\{(.*)\\}(.*)/\n qf_pf_args = Regexp.last_match(1)\n terms = Regexp.last_match(2)\n end\n RSpecSolr::SolrResponseHash.new(solr_conn.send_and_receive(req_handler, method: :get,\n params: solr_params.merge(solr_args).merge(cjk_mm_qs_params(terms ? terms : q_val))))\n end\n end",
"def facet\n @pagination = get_facet_pagination(params[:id])\n end",
"def filtered_results\n results = PropertyResults.paginated_results(params[:facets], params[:page], params[:per_page], params[:offset], params[:query])\n respond_to do |format|\n format.json { render json: results.to_json }\n end\n end",
"def facet_solr_results unfaceted_results\n\n groups = unfaceted_results\n max_relevancy_scores = {}\n output = {}\n\n\n groups.each do |g|\n # Each group is a format, e.g., Book\n bento_set = BentoSearch::Results.new\n bento_set.total_items = g['doclist']['numFound']\n docs = g['doclist']['docs']\n # Iterate through each book search result and create a ResultItem for it.\n docs.each do |d|\n\n item = BentoSearch::ResultItem.new\n if d['fulltitle_vern_display'].present?\n item.title = d['fulltitle_vern_display'] + ' / ' + d['fulltitle_display']\n else\n item.title = d['fulltitle_display']\n end\n [d['author_display']].each do |a|\n next if a.nil?\n # author_display comes in as a combined name and date with a pipe-delimited display name.\n # bento_search does some slightly odd things to author strings in order to display them,\n # so the raw string coming out of *our* display value turns into nonsense by default\n # Telling to create a new Author with an explicit 'display' value seems to work.\n item.authors << BentoSearch::Author.new({:display => a})\n end\n if d['pub_info_display']\n item.publisher = d['pub_info_display'][0]\n end\n if d['pub_date_display']\n item.year = d['pub_date_display'][0].to_s\n item.year.tr!('[]','')\n end\n #item.link = \"http://\" + @catalog_host + \"/catalog/#{d['id']}\"\n item.unique_id = \"#{d['id']}\"\n item.link = \"/catalog/#{d['id']}\"\n item.custom_data = {\n 'url_online_access' => helpers.access_url_single(d),\n 'availability_json' => d['availability_json'],\n }\n\n item.format = d['format']\n bento_set << item\n\n # The first search result should have the maximum relevancy score. Save this for later\n max_relevancy_scores[g['groupValue']] ||= d['score']\n end\n\n output[g['groupValue']] = bento_set\n end\n\n return output, max_relevancy_scores\n\n end",
"def show\n @facet = Facet.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @facet }\n end\n end",
"def results\n @solr_data[:docs]\n end",
"def lookup_payload\n {\n query: {\n bool: {\n should: [\n { match: { exact_query: @query } },\n { match: { stemmed_query: @query } },\n ],\n },\n },\n post_filter: {\n bool: { must: { match: { document_type: \"best_bet\" } } },\n },\n size: 1000,\n _source: {\n includes: %i[details stemmed_query_as_term],\n },\n }\n end",
"def get_facet_pagination(facet_field, extra_controller_params={})\n solr_params = solr_facet_params(facet_field, extra_controller_params)\n response = Blacklight.solr.find(solr_params)\n\n limit = \n if respond_to?(:facet_list_limit)\n facet_list_limit.to_s.to_i\n elsif solr_params[:\"f.#{facet_field}.facet.limit\"]\n solr_params[:\"f.#{facet_field}.facet.limit\"] - 1\n else\n nil\n end\n \n intended_facets = response.facets.select {|facet| facet.name.include?(facet_field)}.first.items\n intended_paginator = Blacklight::Solr::FacetPaginator.new(intended_facets, \n :prefix => solr_params['facet.prefix'],\n :offset => solr_params['facet.offset'],\n :limit => limit,\n :sort => response[\"responseHeader\"][\"params\"][\"f.#{facet_field}.facet.sort\"] || response[\"responseHeader\"][\"params\"][\"facet.sort\"]\n )\n\n if Blacklight.config[:facet][:a_to_z].has_key? facet_field\n extra_controller_params.delete(Blacklight.config[:facet][:a_to_z][facet_field])\n prefix = extra_controller_params[\"catalog_facet.prefix\"]\n extra_controller_params.delete(\"catalog_facet.prefix\") # in order to retrieve the a-z facet listing\n extra_controller_params[\"catalog_facet.offset\"]=0\n extra_controller_params[\"catalog_facet.sort\"]= \"index\"\n solr_params = solr_facet_params(facet_field, extra_controller_params)\n response = Blacklight.solr.find(solr_params)\n a_to_z_facets = response.facets.select {|facet| facet.name.include?(Blacklight.config[:facet][:a_to_z][facet_field])}.first.items\n a_to_z_paginator = Blacklight::Solr::FacetPaginator.new(a_to_z_facets,\n :prefix => prefix,\n :offset => solr_params['facet.offset'],\n :limit => limit,\n :sort => response[\"responseHeader\"][\"params\"][\"f.#{facet_field}.facet.sort\"] || response[\"responseHeader\"][\"params\"][\"facet.sort\"]\n )\n return { facet_field => intended_paginator, Blacklight.config[:facet][:a_to_z][facet_field] => a_to_z_paginator }\n else\n return intended_paginator\n end\n \n end",
"def extract_facet_by_field_name field_name\n facet_field = facet_configuration_for_field(field_name)\n case \n when (facet_field.respond_to?(:query) and facet_field.query)\n create_facet_field_response_for_query_facet_field field_name, facet_field \n when (facet_field.respond_to?(:pivot) and facet_field.pivot)\n create_facet_field_response_for_pivot_facet_field field_name, facet_field \n else\n @response.facet_by_field_name(field_name)\n end\n end",
"def facets\n @facets ||= raw_response['facet_counts'] || {}\n end",
"def response\n @response ||= search.execute!\n end",
"def get_solr_response_for_doc_id(id=nil, extra_controller_params={})\n Blacklight.solr.find solr_doc_params(id, extra_controller_params)\n end",
"def results\n facet_results, _docs = search_service.search_results\n facet_results.facet_fields[IndexesWorkflow.suppressed_field].each_slice(2)\n end",
"def render_search_results_as_json\n @presenter = Blacklight::JsonPresenter.new(@response, blacklight_config)\n { response: { docs: @document_list, facets: @presenter.search_facets, pages: @presenter.pagination_info } }\n end",
"def results\n @solr_data[:docs]\n end",
"def get_solr_response_for_doc_id(doc_id)\n # TODO: shouldn't hardcode id field; should be setable to unique_key field in schema.xml\n # Note: hardcoding is also in rsolr connection base find_by_id() method\n solr_params = {:qt=>:document, :id=>doc_id}\n raw_response = Blacklight.solr.select(solr_params)\n RSolr::Ext::Response::Standard.new(raw_response)\n end",
"def get_search_results(extra_controller_params={})\n Blacklight.solr.find self.solr_search_params(extra_controller_params)\n end",
"def tracking_suggestions\n # temporarily removing solr for now - June 2012\n return [0, {}]\n \n facet_results_hsh = {:my_people_tracked_facet => [], :my_issues_tracked_facet => [], :my_bills_tracked_facet => []}\n my_trackers = 0\n\n begin\n users = User.find_by_solr('placeholder:placeholder', :facets => {:fields => [:my_people_tracked, :my_issues_tracked, :my_bills_tracked], :browse => [\"my_people_tracked:#{self.id}\"], :limit => 6, :zeros => false, :sort => true}, :limit => 1)\n rescue\n return [0, {}] unless Rails.env == 'production'\n raise\n end\n \n facets = users.facets\n facet_results_ff = facets['facet_fields']\n if facet_results_ff && facet_results_ff != []\n \n facet_results_ff.each do |fkey, fvalue|\n facet_results = facet_results_ff[fkey]\n \n #solr running through acts as returns as a Hash, or an array if running through tomcat...hence this stuffs\n facet_results_temp_hash = Hash[*facet_results] unless facet_results.class.to_s == \"Hash\"\n facet_results_temp_hash = facet_results if facet_results.class.to_s == \"Hash\"\n\n facet_results_temp_hash.each do |key,value|\n if key == self.id.to_s && fkey == \"my_people_tracked_facet\"\n my_trackers = value\n else\n unless facet_results_hsh[fkey.to_sym].length == 5\n object = Person.find_by_id(key) if fkey == \"my_people_tracked_facet\"\n object = Subject.find_by_id(key) if fkey == \"my_issues_tracked_facet\"\n object = Bill.find_by_ident(key) if fkey == \"my_bills_tracked_facet\"\n facet_results_hsh[fkey.to_sym] << {:object => object, :trackers => value}\n end\n end\n end\n end \n else\n return [my_trackers,{}]\n end\n \n unless facet_results_hsh.empty?\n #sort the hashes\n facet_results_hsh[:my_people_tracked_facet].sort!{|a,b| b[:trackers]<=>a[:trackers] }\n facet_results_hsh[:my_issues_tracked_facet].sort!{|a,b| b[:trackers]<=>a[:trackers] }\n facet_results_hsh[:my_bills_tracked_facet].sort!{|a,b| b[:trackers]<=>a[:trackers] }\n \n return [my_trackers, facet_results_hsh]\n else\n return [my_trackers,{}]\n end\n end",
"def facets\n @facets ||= raw[:facets]\n end",
"def overview\n authorize! :show, @pool\n (@response, @document_list) = get_search_results(rows:0)\n respond_to do |format|\n format.json { render :json=>{id:@pool.id, models:@pool.models.as_json, perspectives:@pool.exhibits.as_json, facets:@response[\"facet_counts\"][\"facet_fields\"], numFound:@response[\"response\"][\"numFound\"] } } \n end\n end",
"def search\n spotyfy_client = SpotyfyClient.new(params[:search])\n spotyfy_client.perform\n items = SpotyfyService.parse_hash(spotyfy_client.body)\n render :json => items.to_json\n end",
"def solr\n @solr_fields = get_solr_fields\n @solr_info = get_solr_information\n end",
"def find_by_facet(opts)\n\t\t\t\turl = \"api/v2/interactions/facet\"\n\t\t\t\tget_objects(:get, :interactions, url, opts)\n\t\t\tend",
"def getResultsFromSearch(query, type, guts, ppOverride)\n request('getResultsFromSearch', {'query' => query, 'type' => type, 'guts' => guts, 'ppOverride' => ppOverride})\nend",
"def query(term, opts = {})\n parse_response(Defcli.read_url(search_url(term)), opts)\n end",
"def query(query, args = {})\n args[:q] = query\n args[:qt] = 'standard'\n conn = ActiveFedora::SolrService.instance.conn\n result = conn.post('select', data: args)\n result.fetch('response').fetch('docs')\n end",
"def getQuery\n\t\tquery = params[:query]\n\t\tresults = GetQueryFromSpotify.build.call(query)\n\t\trender json: results\n\tend",
"def index\n @solr = Solr.instance.connect\n callback = params.delete('callback') || 'callback'\n rows = [params.delete('rows').to_i, 100].min\n data = begin\n @solr.get('select', params: params.except(:action, :format, :controller).merge(rows: rows))\n rescue => e\n # RSolr dictates that responses be ruby data structures,\n # but the eval still scares me.\n eval(e.response[:body])\n end\n json = JSON.pretty_generate(data)\n respond_to do |format|\n format.js do\n render text: \"#{callback}(#{json});\",\n status: data['error'] ? 500 : 200\n end\n format.json do\n render text: json,\n status: data['error'] ? 500 : 200\n end\n format.xml do\n render text: data.to_xml,\n status: data['error'] ? 500 : 200\n end\n end\n end",
"def show\n if cookies[:message_shown].nil? && request.env['HTTP_USER_AGENT'] =~ /Firefox/\n flash.now[:notice] = \"To view the high-quality images for this item in Firefox, you'll need to change some browser settings\"\n end\n deprecated_response, @document = search_service.fetch(solr_id)\n @response = ActiveSupport::Deprecation::DeprecatedObjectProxy.new(deprecated_response, 'The @response instance variable is deprecated; use @document.response instead.')\n respond_to do |format|\n format.html { @search_context = setup_next_and_previous_documents }\n format.json\n additional_export_formats(@document, format)\n end\n if @document[:has_model_ssim][0] == 'Collection'\n facet_member_of_collections = blacklight_config.facet_fields['member_of_collections_ssim']\n if facet_member_of_collections\n @response_collection = search_service.facet_field_response(facet_member_of_collections.key, \"f.member_of_collections_ssim.facet.contains\" => @document[:title_tesim][0])\n @display_facet = @response_collection.aggregations[facet_member_of_collections.field]\n if @display_facet&.items && @display_facet.items.first\n @collection_count = @display_facet.items.first.hits\n end\n end\n end\n end",
"def execute\n reset\n params = @query.to_params\n @solr_result = @connection.request(\"/#{request_handler}\", params, {:header => {'Content-Type' => 'application/x-www-form-urlencoded'}})\n self\n end",
"def get\n @research_output = @service.get({type: params[:graph], detail: params[:detail], id: params[:id]},\n host: request.env[\"HTTP_HOST\"], limit: params[:num_results], offset: params[:start_offset], :per_project => params[:per_project], format: params[:format])\n\n respond_with @research_output\n end",
"def query(query, args = {})\n args.merge!(q: query, qt: 'standard')\n conn = ActiveFedora::SolrService.instance.conn\n result = conn.post('select', data: args)\n result.fetch('response').fetch('docs')\n end",
"def get_solr_response_for_field_values(field, values, extra_controller_params = {})\n # solr_response = query_solr(params, extra_controller_params.merge(solr_documents_by_field_values_params(field, values)))\n #\n # [solr_response, solr_response.documents]\n\n # Updated Blacklight 5.10.x version of this deprecated function...\n\n query =\n search_builder.with(params).merge(extra_controller_params).merge(solr_documents_by_field_values_params(field, values))\n\n solr_response = repository.search(query)\n\n [solr_response, solr_response.documents]\n end",
"def facets\n self.facet_list.any? ? SearchFacet.where(:identifier.in => self.facet_list) : SearchFacet.visible\n end",
"def single_facet_values(facet_field)\n query_params = { q: '', rows: '0', 'facet.limit'=> -1, 'facet.field' => facet_field}\n solr_results = repository.search(query_params)\n facet_field_results = solr_results.facet_counts['facet_fields']\n collect_facet_field_values(facet_field_results).fetch(facet_field,[])\n end",
"def solr_resp_single_doc(doc_id, solr_params = {})\n solr_response(solr_params.merge({'qt'=>'document','id'=>doc_id}))\nend",
"def faceted_search(*args)\n search(*args)\n end",
"def add_facetting_to_solr(solr_params)\n if %w[collection_context online_contents].include? blacklight_params[:view]\n return solr_params\n end\n\n super(solr_params)\n end",
"def find_features(query)\n puts \"find_features:url =#{search_feed_url}?#{CGI.escape query}\"\n response = @@client.get \"#{search_feed_url}?#{CGI.escape query}\"\n end",
"def paginated_solr_query solr, params = { q: '*:*' }, page = 1, per_page = ApplicationController::SOLR_RESULTS_PER_PAGE\n params[:start] = (page - 1) * per_page\n response = solr.get 'select', params: params rescue response = nil\n\n # Replace fields with highlighting.\n if response != nil && response['highlighting'] != nil\n response['response']['docs'].each do |doc|\n h = response['highlighting'][doc['id']]\n if h != nil\n doc['title'] = h['title'][0] if h['title']\n doc['description'] = h['description'][0] if h['description']\n doc['body'] = h['body'][0] if h['body']\n end\n end\n end\n response\n end",
"def search\n send_request\n parse_response\n end",
"def test_faceted_search_basic\n records = Electronic.find_with_facet \"memory\", :facets => {:fields =>[:category]}\n assert_equal 4, records[:docs].size\n assert_match /Apple 60 GB Memory iPod/, records[:docs].first.name\n assert_equal({\"category_facet\" => {\"Electronics\" => 1, \n \"Memory\" => 2, \n \"Hard Drive\" => 1}}, \n records[:facets]['facet_fields'])\n end",
"def facet_queries\n @facet_queries ||= facet_counts['facet_queries'] || {}\n end",
"def facet_queries\n @facet_queries ||= facet_counts['facet_queries'] || {}\n end",
"def facet_search_url(field:, value:)\n query = { \"f[#{field}][]\" => value }.to_param\n \"#{root_path}?#{query}\"\n end",
"def execute client, request_context\n #data = request_context[:data]\n #data = data.to_xml if data.respond_to?(:to_xml)\n url = [request_context[:path], request_context[:query]].join(\"?\")\n url = \"/\" + url unless url[0].chr == \"/\"\n begin\n body = direct.request(url, request_context[:data])\n rescue\n $!.extend RSolr::Error::SolrContext\n $!.request = request_context\n raise $!\n end\n {\n :status => 200,\n :body => body,\n :headers => {}\n }\n end",
"def get_facet_pagination(facet_field, query_type=nil)\n query_type ||= Blacklight.config[:default_qt]\n mapper = RSolr::Ext::Request::Standard.new\n limit = (params[:limit] || 6)\n solr_params = mapper.map({\n :qt => query_type,\n :q => params[:q],\n :phrase_filters => params[:f],\n :facet => true,\n 'facet.offset' => params[:offset],\n 'facet.limit' => limit\n })\n raw_response = Blacklight.solr.select(solr_params)\n response = RSolr::Ext::Response::Standard.new(raw_response)\n Blacklight::FacetPagination.new(response.facets.first.items, params[:offset], limit)\n end",
"def to_facet\n TermsFacet.new(\n default_params.merge(\n :label => prefix_label('display_result'),\n :size => (@num_result_rows || self.class::DEFAULT_NUM_RESULTS) + checked_rows.length,\n :exclude => exclude,\n :facet_filter => facet_filter\n )\n )\n end",
"def search\n search = Favorite.search do\n fulltext params[:query]\n end\n \n @favorites = search.results\n \n respond_with @favorites\n end",
"def show\n \n \n \n title = Title.find(params[:id])\n params[:query] = title.title\n \n breadcrumbs.add 'TITLES', titles_path(:queryTitleId=>params[:id])\n breadcrumbs.add params[:query].upcase\n \n shelf0 = []\n shelf0 << title\n @shelf_name= title.title\n \n newSearch = Sunspot.new_more_like_this(title, Title) do\n facet(:category_id, :publisher_id, :author_id)\n end\n \n newSearch.build do \n with(:category_id, params[:cat_id]) \n end if params[:cat_id].to_i > 0\n\n newSearch.build do \n with(:publisher_id, params[:facetPublisher]) \n end if params[:facetPublisher].to_i > 0\n\n newSearch.build do \n with(:author_id, params[:facetAuthor]) \n end if params[:facetAuthor].to_i > 0\n newSearch.build do \n with(:branch).any_of Title::BRANCH\n end\n searchResults = newSearch.execute\n searchResults.results.each do |sr|\n shelf0 << sr\n end\n @shelf0 = shelf0.paginate(:page => params[:page], :per_page => 9)\n# @searchResults = Sunspot.more_like_this(@title, Title) do\n# fields :title, :publisher, :author\n# paginate(:page => params[:page], :per_page => 15)\n# facet(:category_id, :publisher_id, :author_id)\n# end\n end",
"def query_result(**args)\n solr_service.query_result(build, **args)\n end",
"def get_solr_response_for_field_values(field, values, extra_solr_params = {})\n values ||= []\n values = [values] unless values.respond_to? :each\n value_str = \"(\\\"\" + values.to_a.join(\"\\\" OR \\\"\") + \"\\\")\"\n solr_params = {\n :defType => \"lucene\", # need boolean for OR\n :q => \"#{field}:#{value_str}\",\n # not sure why fl * is neccesary, why isn't default solr_search_params\n # sufficient, like it is for any other search results solr request? \n # But tests fail without this. I think because some functionality requires\n # this to actually get solr_doc_params, not solr_search_params. Confused\n # semantics again. \n :fl => \"*\", \n :facet => 'false',\n :spellcheck => 'false'\n }.merge(extra_solr_params)\n \n solr_response = find( self.solr_search_params().merge(solr_params) )\n document_list = solr_response.docs.collect{|doc| SolrDocument.new(doc, solr_response) }\n [solr_response,document_list]\n end",
"def show\n respond_to do |format|\n format.html do\n # this strips the counter when we don't want it, ie when there is no search\n redirect_to(:action => \"show\", :id => params[:id]) if session[:search].blank? && params[:counter]\n\n # this cleans out the search criteria when we're coming from a copy/paste URL without counter\n # because we don't want the context of whatever search we were in\n session[:search] = {} unless params[:counter]\n\n @response = get_solr_response_for_doc_id(params[:id])\n @document = SolrDocument.new(@response.docs.first)\n\n setup_previous_document\n setup_next_document\n end\n format.xml do\n @response = get_solr_response_for_doc_id(params[:id])\n @document = SolrDocument.new(@response.docs.first)\n render :xml => @document.to_xml\n end\n end\n\n end",
"def facet\n @browse_config = BlacklightFacetBrowse::ConfigInfo.new(blacklight_config, params[:id])\n\n if ! @browse_config.browse_configured?\n # first do no harm, do nothing if the facet ain't configured\n # for browse. \n super\n else\n # Mostly copied and modified from current BL 4.4, although will work\n # with older BL, in some cases adding features. Use\n # our custom get_browse_facet_pagination\n\n # If no other sort is specified, and we have no prefix query,\n # insist on defaulting to 'index', anything else is confusing. \n if params[\"catalog_facet.sort\"].blank? && params[ @browse_config.query_param_name ].present?\n params[\"catalog_facet.sort\"] = \"index\"\n end\n\n\n @pagination = get_browse_facet_pagination(params[:id], params)\n\n respond_to do |format| \n format.html do \n # we're going to use a custom view, possibly user specified,\n # but the default is \"browsable_facet\"\n render @browse_config.browsable_facet_template\n end\n\n # Draw the partial for the \"more\" facet modal window,\n # without layout. \n format.js { render @browse_config.browsable_facet_template, :layout => false }\n\n # Json format copied from BL 4.4, there was no json response in\n # BL 3.5, we need one, sure let's use that one to try and be compat -- \n # we intentionally don't use a hook method that lets someone redefine\n # this, because if they redefine it our js won't understand it!\n format.json { render json: {response: {facets: @pagination }}}\n end\n end\n end",
"def index\n @response, @documents = get_solr_response_for_field_values(\"id\",session[:folder_document_ids] || [])\n end",
"def render\n\t\t\t@wiki_query.query_result.to_json\n\t\tend",
"def search_results_with_xfacets(search_params, facet, target, ref, dir, per_page, doc_centric)\n # over-fetch items so we can determine whether to display prev/next buttons.\n # when paging forward => ref point is last item, which should be at position 0 in new results\n # when paging back => ref point is first item, which should be at last position in new results\n offset = 1\n expected_pos_in_results = 1\n if dir == 'forward'\n offset = 0\n expected_pos_in_results = 0\n elsif dir == 'back'\n offset += per_page\n expected_pos_in_results = per_page + 1\n end\n\n if doc_centric\n facet_target = target.present? ? target : ''\n # ref is a composite key (target/targetDoc) to disambiguate target\n if ref\n pieces = ref.split('|', 2)\n ref = pieces[0]\n facet_target = pieces[1]\n end\n else\n facet_target = ref || target || ''\n end\n\n (response, document_list) = search_results(search_params.merge(:rows => 0)) do |search_builder|\n additional_params = {\n # distrib.singlePass is required in order to make solrplugins\n # include documents in the doc-centric xfacet payloads when running\n # distributed Solr\n 'distrib.singlePass': 'true',\n \"f.#{facet.field}.facet.target\": JSON.dump(facet_target),\n \"f.#{facet.field}.facet.sort\": 'index',\n \"f.#{facet.field}.facet.offset\": offset,\n \"f.#{facet.field}.facet.limit\": per_page + 2 }\n if ref\n additional_params[\"f.#{facet.field}.facet.target.strict\"] = true\n end\n if doc_centric\n additional_params[\"f.#{facet.field}.facet.targetDoc\"] = ref || ''\n end\n search_builder.merge(additional_params)\n end\n\n display_facet = response.aggregations[facet.key]\n display_facet_window =\n BlacklightSolrplugins::FacetFieldWindow.new(display_facet, per_page, expected_pos_in_results)\n\n return [response, document_list, display_facet, display_facet_window]\n end",
"def xhr_search\n endpoint = params[:endpoint]\n\n if params[:template] == 'with_paging'\n template = 'xhr_response_with_paging'\n else\n template = 'xhr_response'\n end\n\n @query = params_q_scrubbed\n @page = page\n @per_page = per_page(endpoint)\n @offset = offset(@page,@per_page)\n\n http_client = HTTPClient.new\n update_searcher_timeout(http_client, endpoint, true)\n\n benchmark \"%s xhr #{endpoint}\" % CGI.escape(@query.to_str) do\n\n klass = \"QuickSearch::#{endpoint.camelize}Searcher\".constantize\n searcher = klass.new(http_client,\n extracted_query(params_q_scrubbed),\n @per_page,\n @offset,\n @page,\n on_campus?(ip),\n extracted_scope(params_q_scrubbed))\n searcher.search\n\n searcher_partials = {}\n searcher_cfg = searcher_config(endpoint)\n unless searcher_cfg.blank?\n services = searcher_cfg['services'].blank? ? [] : searcher_cfg['services']\n else\n services = []\n end\n services << endpoint\n\n respond_to do |format|\n\n format.html {\n services.each do |service|\n service_template = render_to_string(\n :partial => \"quick_search/search/#{template}\",\n :layout => false,\n :locals => { module_display_name: t(\"#{endpoint}_search.display_name\"),\n searcher: searcher,\n search: '',\n service_name: service\n })\n searcher_partials[service] = service_template\n end\n render :json => searcher_partials\n }\n\n format.json {\n\n # prevents openstruct object from results being nested inside tables\n # See: http://stackoverflow.com/questions/7835047/collecting-hashes-into-openstruct-creates-table-entry\n result_list = []\n searcher.results.each do |result|\n result_list << result.to_h\n end\n\n render :json => { :endpoint => endpoint,\n :per_page => @per_page.to_s,\n :page => @page.to_s,\n :total => searcher.total,\n :results => result_list\n }\n }\n end\n end\n end",
"def opensearch_response(field = nil, extra_controller_params = {})\n field ||= blacklight_config.view_config(:opensearch).title_field\n\n query = search_builder.with(search_state).merge(solr_opensearch_params(field)).merge(extra_controller_params)\n response = repository.search(query)\n\n [search_state.query_param, response.documents.flat_map { |doc| doc[field] }.uniq]\n end",
"def map_facet_values\n map_facet_field = blacklight_config.view.maps.facet_mode == 'coordinates' ?\n blacklight_config.view.maps.coordinates_facet_field :\n blacklight_config.view.maps.geojson_field\n @response.aggregations[map_facet_field]&.items || []\n end",
"def query_for_rendering(file_set_id)\n ::SolrDocument.find(file_set_id)\n end",
"def search_for_item\n search_service.fetch(params[:solr_document_id])\n end",
"def search\n terms = @authority.search(url_search)\n render json: terms\n end",
"def facets\n @facets ||= search.facets\n end",
"def response_advanced(params, query, model, filter_settings)\n response(params, query, model, filter_settings)\n end",
"def test_faceted_search_multiple_fields\n records = Electronic.find_with_facet \"memory\", :facets => {:fields =>[:category, :manufacturer]}\n assert_equal 4, records[:docs].size\n assert_equal({\"category_facet\" => {\"Electronics\" => 1, \n \"Memory\" => 2, \n \"Hard Drive\" => 1},\n \"manufacturer_facet\" => {\n \"Samsung Electronics Co. Ltd.\" => 1, \n \"Corsair Microsystems Inc.\" => 1, \n \"A-DATA Technology Inc.\" => 1,\n \"Apple Computer Inc.\" => 1}}, records[:facets]['facet_fields'])\n end",
"def index\n @searches = Sunspot.search(Drug, Review, Condition) do\n fulltext params[:search]\n end\n @results=@searches.results\n @drugresults=Array.new\n @conditionresults=Array.new\n @reviewresults=Array.new\n @results.each do |result|\n if result.instance_of?Drug\n @drugresults.push(result)\n elsif result.instance_of?Condition\n @conditionresults.push(result)\n else\n @reviewresults.push(result)\n end\n end\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @searches }\n end\n end",
"def facet_queries\n @facet_queries ||= facets['facet_queries'] || {}\n end",
"def solr(url, handler, params={})\n connection, solr_url = connection(url)\n req_url = solr_url.path + '/select?' + hash_to_query_string(params.merge(:qt => handler))\n # puts \"*** requesting to Solr: #{req_url}\"\n connection.get(req_url)\nend",
"def Search query\n \n APICall(path: \"search.json?query=#{query}\",method: 'GET')\n \n end",
"def details\n\t\tquery_params = QueryFormat.details_format()\n\t\tbegin\n\t\t\tQueryFormat.transform_raw_parameters(params)\n\t\t\tquery = QueryFormat.create_solr_query(query_params, params, request.remote_ip)\n\t\t\tis_test = Rails.env == 'test' ? :test : :live\n\t\t\tis_test = :shards if params[:test_index]\n\t\t\tsolr = Solr.factory_create(is_test)\n\t\t\t@document = solr.details(query)\n\n\t\t\trespond_to do |format|\n\t\t\t\tformat.html # index.html.erb\n\t\t\t\tformat.json { render json: { document: @document } }\n\t\t\t\tformat.xml\n\t\t\tend\n\t\trescue ArgumentError => e\n\t\t\trender_error(e.to_s)\n\t\trescue SolrException => e\n\t\t\trender_error(e.to_s, e.status())\n\t\trescue Exception => e\n\t\t\tExceptionNotifier.notify_exception(e, :env => request.env)\n\t\t\trender_error(\"Something unexpected went wrong.\", :internal_server_error)\n\t\tend\n\tend",
"def index\n# @resumes = Resume.all\n# names=@resumes.map(&:name).join(\",\")\n @resumes=Resume.search(params)\n @facets= @resumes.facets\n end",
"def execute\n reset\n params = @query.to_params\n @solr_result = @connection.post \"#{request_handler}\", :data => params\n self\n end"
] | [
"0.7313156",
"0.6917074",
"0.68818057",
"0.67214376",
"0.67175853",
"0.66293263",
"0.6620243",
"0.66040045",
"0.65962744",
"0.6509962",
"0.64730144",
"0.64703125",
"0.64196396",
"0.64146954",
"0.64047676",
"0.6392621",
"0.6349886",
"0.6235467",
"0.62038237",
"0.61694777",
"0.6150256",
"0.61463207",
"0.612932",
"0.6125895",
"0.61205304",
"0.61203176",
"0.6080998",
"0.6070395",
"0.60692245",
"0.6054352",
"0.6049606",
"0.60493696",
"0.6031012",
"0.60291433",
"0.6023696",
"0.60234237",
"0.6011668",
"0.597138",
"0.59519386",
"0.5929157",
"0.592391",
"0.5911385",
"0.58897924",
"0.58884096",
"0.5877866",
"0.5876011",
"0.58745235",
"0.58715034",
"0.58582896",
"0.5847541",
"0.5845301",
"0.58397067",
"0.5839503",
"0.58250225",
"0.5815396",
"0.5814604",
"0.58023",
"0.5796424",
"0.57931304",
"0.57923347",
"0.5784874",
"0.57807136",
"0.57759553",
"0.57665473",
"0.5759731",
"0.573892",
"0.57361126",
"0.5735785",
"0.5735748",
"0.5732584",
"0.5732584",
"0.5720171",
"0.5718496",
"0.57055175",
"0.57051426",
"0.5699883",
"0.56952107",
"0.5689475",
"0.56704015",
"0.56672996",
"0.56652814",
"0.5663716",
"0.56598115",
"0.56596017",
"0.56558424",
"0.5650047",
"0.56467503",
"0.56413186",
"0.56363875",
"0.563549",
"0.56321275",
"0.56318384",
"0.5627692",
"0.56259936",
"0.5623297",
"0.5622249",
"0.56186956",
"0.5613882",
"0.5613876",
"0.5609414"
] | 0.7855126 | 0 |
Retrieve the URL for the current Blacklight Solr core | def core_url
@blacklight_context.default_index.connection.uri.to_s.gsub(%r{^.*\/solr}, '/solr')
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def solr_url\n @solr_url ||= @configurations[:solr_url]\n end",
"def solr_url(interactive = false)\n #proto = 'http'\n #host = 'junco.lib.virginia.edu'\n #port = '8080'\n #path = [\"#{proto}://#{host}:#{port}\"]\n #path << 'solr'\n #path << '#' if interactive\n #path << 'test_core'\n #path.join('/')\n return ENV['SOLR_URL'] if interactive == false\n return ENV['SOLR_URL'].gsub( \"/solr/\", \"/solr/#/\" )\n end",
"def url\n \"http://127.0.0.1:#{port}/solr/\"\n end",
"def solr_url\n @solr_url ||= endpoint_url.gsub(/\\/select$/, '')\n end",
"def solr_url\n if ENV['SOLR_URL'] || ENV['WEBSOLR_URL']\n URI.parse(ENV['SOLR_URL'] || ENV['WEBSOLR_URL'])\n end\n end",
"def render_solr_core\n unless request.host == 'search.library.cornell.edu' or request.host == 'catalog.library.cornell.edu'\n core = Blacklight.connection_config[:url]\n # Remove http protocol string\n start = core.rindex(/:\\/\\//) + 3\n display = '<p class=\"solr-core\">Solr core: ' + core[start..-1] + '</p>'\n display.html_safe\n end\n end",
"def solr_url(solr_config)\n return solr_config[:url] if solr_config.key?(:url)\n return solr_config['url'] if solr_config.key?('url')\n if @index_full_text == true && solr_config.key?(:fulltext) && solr_config[:fulltext].key?('url')\n solr_config[:fulltext]['url']\n elsif solr_config.key?(:default) && solr_config[:default].key?('url')\n solr_config[:default]['url']\n else\n raise URI::InvalidURIError\n end\n end",
"def solr\n @solr ||= RSolr.connect(url: solr_url)\n end",
"def solr_root\n url = URI.parse(search_engine_url)\n host = url.scheme + '://' + url.host\n if url.port\n host += ':' + url.port.to_s\n end\n host\n end",
"def scheme\n unless defined?(@scheme)\n @scheme = solr_url.scheme if solr_url\n @scheme ||= user_configuration_from_key('solr', 'scheme')\n @scheme ||= default_scheme\n end\n @scheme\n end",
"def solr_document_url(solr_document, options = {})\n search_state.url_for_document(solr_document, options)\n end",
"def determine_solr_update_url\n if settings['solr.update_url']\n check_solr_update_url(settings['solr.update_url'])\n else\n derive_solr_update_url_from_solr_url(settings['solr.url'])\n end\n end",
"def base_uri\n suite_configuration.core_uri\n end",
"def base_url\n GlobalConstant::Base.aml_config[:search][:base_url]\n end",
"def url\n uri\n end",
"def url\n uri\n end",
"def solr_home\n File.join(configuration.solr_home)\n end",
"def solr_home\n File.join(configuration.solr_home)\n end",
"def path\n unless defined?(@path)\n @path = solr_url.path if solr_url\n @path ||= user_configuration_from_key('solr', 'path')\n @path ||= default_path\n end\n @path\n end",
"def getSolrDescription\n uri = URI.parse(\"http://#{@host}:#{@port}/solr/admin/cores\")\n out = Net::HTTP.get_response(uri)\n if out.code.to_i == 200 \n return out.body\n else \n STDERR.puts \"Error reaching Solr: \" + \n \"#{out.header.code} -- #{out.header.message}\"\n return nil\n end \n end",
"def url\n uri.to_s\n end",
"def initialize url = nil\n @solr = url.nil? ? RSolr.connect(:url => RH_CONFIG[\"solr_discovery\"]) : RSolr.connect(:url => url)\n end",
"def url\n uri.to_s\n end",
"def uri_host; end",
"def getURL\r\n\t\t\t\t\treturn @url\r\n\t\t\t\tend",
"def getURL\r\n\t\t\t\t\treturn @url\r\n\t\t\t\tend",
"def getURL\r\n\t\t\t\t\treturn @url\r\n\t\t\t\tend",
"def getURL\r\n\t\t\t\t\treturn @url\r\n\t\t\t\tend",
"def getURL\r\n\t\t\t\t\treturn @url\r\n\t\t\t\tend",
"def url\n \"http://#{self.cms_site.hostname}#{self.full_path}\"\n end",
"def url_str\n SiteProcessor.new(self).url_str\n end",
"def solr_url=(v)\n @solr_url = v\n writer_settings[\"solr.url\"] = v if writer_settings\n end",
"def api_url\n @api_url ||= URI.parse(\"#{super}?#{URI.encode_www_form(query_params)}\")\n end",
"def url\n end",
"def url\n @url\n end",
"def url\n @url\n end",
"def url\n @url\n end",
"def server_url\n @uri\n end",
"def path\n @path ||=\n if user_configuration.has_key?('solr')\n \"#{user_configuration['solr']['path'] || '/solr'}\"\n end\n end",
"def website_url; website end",
"def url\n Config.site.url.chomp('/') + self.path\n end",
"def base_url\n GlobalConstant::CompanyOtherProductUrls.kit_root_url\n end",
"def resolved_uri; end",
"def solr_home\n File.join(FileUtils.pwd, 'solr')\n end",
"def geturl() \n\t\treturn self.response.geturl()\n end",
"def url_for_document doc, options = {}\n if respond_to?(:blacklight_config) and\n blacklight_config.show.route and\n (!doc.respond_to?(:to_model) or doc.to_model.is_a? SolrDocument)\n route = blacklight_config.show.route.merge(action: :show, id: doc).merge(options)\n route[:controller] = controller_name if route[:controller] == :current\n route\n else\n doc\n end\n end",
"def base_url\n @url.to_s.split('?').first\n end",
"def determine_solr_update_url\n url = if settings['solr.update_url']\n check_solr_update_url(settings['solr.update_url'])\n else\n derive_solr_update_url_from_solr_url(settings['solr.url'])\n end\n\n parsed_uri = URI.parse(url)\n user_from_uri, password_from_uri = parsed_uri.user, parsed_uri.password\n parsed_uri.user, parsed_uri.password = nil, nil\n\n basic_auth_user = @settings[\"solr_writer.basic_auth_user\"] || user_from_uri\n basic_auth_password = @settings[\"solr_writer.basic_auth_password\"] || password_from_uri\n\n return [parsed_uri.to_s, basic_auth_user, basic_auth_password]\n end",
"def baseurl; end",
"def base_uri\t\t\t\n\t\tURI.parse( \"http://\" + @factory.site_name + \".\" + @factory.api_host_base + @path )\n\tend",
"def url\n @url = \"#{@http_mode}://#{self.config.servers[0]}\"\n @url << \"/#{self.config.context}\" if(!self.config.context.empty?)\n #self.config.log.debug_msg(\"Request base URL: #{@url}\")\n @url\n end",
"def site_url\n get_url(:site)\n end",
"def web_url\n return @web_url\n end",
"def web_url\n return @web_url\n end",
"def web_url\n return @web_url\n end",
"def uri\n @uri\n end",
"def uri\n @uri\n end",
"def uri\n @uri\n end",
"def uri\n @uri\n end",
"def get_url\n @url\n end",
"def site_url\n SiteProcessor.new(self).site_url\n end",
"def solr_home\n @solr_home ||=\n if user_configuration_from_key('solr', 'solr_home')\n user_configuration_from_key('solr', 'solr_home')\n else\n File.join(::Rails.root, 'solr')\n end\n end",
"def uri\n return @uri\n end",
"def uri\n return @uri\n end",
"def getserverurl\r\n return getvalue(@@SERVER_URL)\r\n end",
"def coreApiEP\n\t\tCORE_API_URL_83\n\tend",
"def show_solr_document_url doc, options\n if options[:controller]\n case options[:controller]\n when 'collections'\n collection_url doc\n when 'institutions'\n institution_url doc\n end\n else\n solr_document_url doc, options\n end\n\n end",
"def base_url\n return url\n end",
"def base_url\n service.base_url\n end",
"def term_url\n Config.config_value(term_config, :url)\n end",
"def url\n api_url\n end",
"def onliner_url\n @url ||= (CONSTANT_URL + @options.to_query)\n end",
"def url\n self.class.url\n end",
"def url\n end",
"def show_solr_document_url(doc, options)\n if options[:controller]\n case options[:controller]\n when 'collections'\n collection_url doc\n when 'institutions'\n institution_url doc\n end\n else\n solr_document_url doc, options\n end\n end",
"def url\n @doc.url\n end",
"def url_for_document doc, options = {}\n require 'cgi'\n if respond_to?(:blacklight_config) and\n blacklight_config.show.route and\n (!doc.respond_to?(:to_model) or doc.to_model.is_a? SolrDocument)\n route = blacklight_config.show.route.merge(action: :show, id: doc).merge(options)\n route[:controller] = controller_name if route[:controller] == :current\n route\n else\n # This branch is the one executed for a search results index page \n if doc and doc[\"DocId\"]\n # IF doc exists and has this field\n Rails.logger.debug(\"Route - returning doc #{doc['DocId']}\" )\n # One mechanism is to return the doc itself (Ruby can recognize that it is an object and create the appropriate url)\n # In that case, the url would be catalog/id\n # but here, we want to ensure we pass the DocId parameter and we are escaping the ID in the parameter \n # Additionally, we tried updating the doc id to be the escaped uri, but that did not work correctly\n # What we are doing here is passing the local name (which has no slashes, etc. that could throw either apache or ruby off)\n # and then utilizing the normal behavior for showing a document but passing in the parameter as well\n # Code on the solr document helper side knows to expect that parameter and utilize that for the solr document id if it exists\n # Not passing in a local name in the url would make the code expect this was some search query, and without a query it jsut\n # goes back to the front page\n id = doc[\"DocId\"]\n uri_sliced = id.split(\"/\")\n local_name = uri_sliced.last\n uri_escaped = CGI::escape(id)\n # This was there originally before but let's try it without this, this would be useful if we were passing back doc\n # instead of passing the parameter in the URL\n # doc[\"id\"] = local_name \n \"/catalog/\" + local_name + \"?DocId=\" + id\n else \n #Does what this code would do without our updates \n doc \n end\n \n end\n end",
"def url\n @parser.request_url\n end",
"def url\n @url.to_s\n end",
"def url\n ''\n end",
"def url\n @gapi[\"selfLink\"]\n end",
"def url\n @gapi[\"selfLink\"]\n end",
"def uri\n @uri.to_s\n end",
"def request_uri; end",
"def solr_document_path(solr_document)\n if controller.is_a?(SitesController) and !solr_document.site_result?\n # TODO: refactor after local site searches are implemented\n url_for(params.merge(action: 'show', id: solr_document, controller: 'catalog', slug: nil))\n else\n url_for(params.merge(action: 'show', id: solr_document))\n end\n end",
"def url\n URL_MAPPING[@docid]\n end",
"def base_url\n self.class.base_url\n end",
"def api_url\n base_url.concat api_query_parameter\n end",
"def api_url\n base_url.concat api_query_parameter\n end",
"def url\n endpoint+'?'+query_string\n end",
"def url\n unless new_record?\n Engine.routes.url_helpers.quickie_url(self, :host => Kublog.default_url_options[:host])\n end\n end",
"def uri; end",
"def uri; end",
"def uri; end",
"def uri; end",
"def uri; end",
"def uri; end",
"def uri; end",
"def uri; end",
"def uri; end"
] | [
"0.7646296",
"0.7452171",
"0.74510896",
"0.7385991",
"0.7316113",
"0.73108196",
"0.6834491",
"0.67645246",
"0.6702329",
"0.65297663",
"0.65108895",
"0.6494828",
"0.64305025",
"0.63882464",
"0.63510615",
"0.63510615",
"0.63382876",
"0.63382876",
"0.633765",
"0.6331339",
"0.6301348",
"0.62597096",
"0.6227472",
"0.61664027",
"0.61364156",
"0.61364156",
"0.61364156",
"0.61364156",
"0.61364156",
"0.613442",
"0.6122683",
"0.61130184",
"0.6111836",
"0.6109048",
"0.61032957",
"0.61032957",
"0.6098783",
"0.6095202",
"0.6089125",
"0.6057025",
"0.6045665",
"0.6036673",
"0.60188943",
"0.6018865",
"0.6005035",
"0.5998908",
"0.5993257",
"0.5993003",
"0.5990473",
"0.5987286",
"0.5980523",
"0.5979092",
"0.59748566",
"0.59748566",
"0.59748566",
"0.59626126",
"0.59626126",
"0.5956178",
"0.5956178",
"0.5948768",
"0.59345865",
"0.59313744",
"0.59248513",
"0.59248513",
"0.59186316",
"0.5907401",
"0.5905227",
"0.589705",
"0.58873934",
"0.5884956",
"0.58831763",
"0.5882648",
"0.5879095",
"0.5875233",
"0.58665466",
"0.58638847",
"0.5850683",
"0.58475035",
"0.5845952",
"0.58450663",
"0.5829972",
"0.5829972",
"0.58296084",
"0.5827929",
"0.58254963",
"0.58219266",
"0.581921",
"0.58133787",
"0.58133787",
"0.58108217",
"0.5803748",
"0.57992315",
"0.57992315",
"0.57992315",
"0.57992315",
"0.57992315",
"0.57992315",
"0.57992315",
"0.57992315",
"0.57992315"
] | 0.85916424 | 0 |
GET /nostros/1 GET /nostros/1.xml | def show
@nostro = Nostro.find(params[:id])
respond_to do |format|
format.html # show.html.erb
format.xml { render :xml => @nostro }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def show\n @nossos_servico = NossosServico.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @nossos_servico }\n end\n end",
"def xml(id)\n http.get(\"/nfse/#{id}/xml\") do |response|\n response.headers.fetch(\"Location\") { \"\" }\n end\n end",
"def index\n @cuentas = Cuenta.all\n\n @cadena = getcuentasxml\n \n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @cadena }\n end\n end",
"def show\n @nano = Nano.find(params[:id])\n\n respond_to do |format|\n format.html # show.rhtml\n format.xml { render :xml => @nano.to_xml }\n end\n end",
"def index\n @nanos = Nano.find(:all)\n\n respond_to do |format|\n format.html # index.rhtml\n format.xml { render :xml => @nanos.to_xml }\n end\n end",
"def index\n @novidades = Novidade.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @novidades }\n end\n end",
"def new\n @nossos_servico = NossosServico.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @nossos_servico }\n end\n end",
"def index\n @noticias = Noticia.sorted\n respond_to do |format|\n format.html # index.html.erb\n format.rss { render :action => \"index.rxml\", :layout => false }\n format.xml { render :xml => @noticias }\n end\n end",
"def index\n @tipo_notas = TipoNota.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @tipo_notas }\n end\n end",
"def index\n @tipo_lancamentos = TipoLancamento.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @tipo_lancamentos }\n end\n end",
"def index\n @clienteles = @paramun.clienteles\n\n respond_to do |format|\n if @clienteles.empty?\n format.xml { render request.format.to_sym => \"ccliErreurA\" } ## Aucune Clientele\n else \n format.xml { render xml: @clienteles }\n end\n end\n end",
"def index\n @nodes = Node.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @nodes }\n end\n end",
"def index\n @nodes = Node.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @nodes }\n end\n end",
"def index\n @node = Fedora.rest('rest/')\n end",
"def new\n @nostro = Nostro.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @nostro }\n end\n end",
"def show\n @relatestagiario = Relatestagiario.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @relatestagiario }\n end\n end",
"def show\n @silo = Silo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @silo }\n end\n end",
"def show\n @node = Node.scopied.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @node }\n end\n end",
"def index\n @lancamentos = Lancamento.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @lancamentos }\n end\n end",
"def show\n @tservicio = Tservicio.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @tservicio }\n end\n end",
"def download_xml\n\t\turi = URI.parse(\"http://www.esmadrid.com/opendata/tiendas_v1_es.xml\")\n\t\tresponse = Net::HTTP.get_response(uri)\n\t\tcontent = response.body\n\n\t\txml = REXML::Document.new(content)\n\n\t\treturn xml\n\tend",
"def index\n @solicitudes = Solicitud.all\n \n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @solicitudes }\n end\n end",
"def show\n @tso = Tso.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @tso.to_xml(:except => [ :created_at, :updated_at ]) }\n end\n end",
"def show\n @domino = Domino.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @domino }\n end\n end",
"def show\n @distribuidora = Distribuidora.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @distribuidora }\n end\n end",
"def show\n @estagiarios = Estagiario.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @estagiarios }\n end\n end",
"def rest_get(uri)\n \n request = Net::HTTP::Get.new uri\n request.add_field(\"Accept\",\"application/xml\")\n auth_admin(request)\n \n Net::HTTP.start(uri.host, uri.port) do |http|\n response = http.request request\n response.value\n\n doc = REXML::Document.new response.body\n \n return doc\n \n end\n \nend",
"def show\n @tipo_nota = TipoNota.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @tipo_nota }\n end\n end",
"def show\n @tipo_lancamento = TipoLancamento.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @tipo_lancamento }\n end\n end",
"def index\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @ciclos }\n end\n end",
"def get_xml\n response = @api.request(:get, @location, type: 'xml')\n response.body if response.status == 200\n end",
"def show\n @livro = Livro.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @livro }\n end\n end",
"def show\n @rendezvouz = Rendezvouz.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @rendezvouz }\n end\n end",
"def index\n @nodes = Node.all\n @title = \"List of taxonomy nodes - Browse organisms\"\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @nodes }\n end\n end",
"def index\n @tipo_restaurantes = TipoRestaurante.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @tipo_restaurantes }\n end\n end",
"def show\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @numerador }\n end\n end",
"def show\n @tipo_vinculo = TipoVinculo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @tipo_vinculo }\n end\n end",
"def show\n @suministro = Suministro.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @suministro }\n end\n end",
"def novo\n @disciplina = Disciplina.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @disciplina }\n end\n end",
"def index\n @documentos = @externo.documentos.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @documentos }\n end\n end",
"def show\n @lancamento = Lancamento.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @lancamento }\n end\n end",
"def show\n @reclamo = Reclamo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @reclamo }\n end\n end",
"def show\n @tiposproceso = Tiposproceso.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @tiposproceso }\n end\n end",
"def index\n @datos = Dato.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @datos }\n end\n end",
"def show\n @situacoes_juridica = SituacoesJuridica.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @situacoes_juridica }\n end\n end",
"def show\n @Roc = Roc.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @Roc }\n end\n end",
"def index\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @documentos }\n end\n end",
"def show\n @title = \"Show Networks\"\n @network = Network.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @network }\n end\n end",
"def show\n @estagio = Estagio.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @estagio }\n end\n end",
"def show\n @tipo_de_documento = TipoDeDocumento.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @tipo_de_documento }\n end\n end",
"def show\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @tipo_recibo }\n end\n end",
"def show\n @revenu = @foyer.revenus.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @revenu }\n end\n end",
"def index\n @notas = Nota.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @notas }\n end\n end",
"def show\n @noticium = Noticium.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @noticium }\n end\n end",
"def index\n @procesos = Proceso.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @procesos }\n end\n end",
"def index\n @asistencias = Asistencia.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @asistencias }\n end\n end",
"def show\n @novidade = Novidade.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @novidade }\n end\n end",
"def index\n @st_pis = StPi.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @st_pis }\n end\n end",
"def index\n @feria2010observaciones = Feria2010observacion.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @feria2010observaciones }\n end\n end",
"def show\n @glosario = Glosario.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @glosario }\n end\n end",
"def index\n @neuropsyches = Neuropsych.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @neuropsyches }\n end\n end",
"def show\n @contratosinterventoria = Contratosinterventoria.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @contratosinterventoria }\n end\n end",
"def show\n @estudiante = Estudiante.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @estudiante }\n end\n end",
"def show\n @estudiante = Estudiante.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @estudiante }\n end\n end",
"def index\n @avisos = Aviso.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @avisos }\n end\n end",
"def show\n @relatorios = Relatorio.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @relatorios }\n end\n end",
"def show\n @remocao = Remocao.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @remocao }\n end\n end",
"def show\n @razontiporesolucion = Razontiporesolucion.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @razontiporesolucion }\n end\n end",
"def show\n @sentidoresolucion = Sentidoresolucion.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @sentidoresolucion }\n end\n end",
"def show\n @estacion = Estacion.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @estacion }\n end\n end",
"def show\n @arrendamientosprorroga = Arrendamientosprorroga.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @arrendamientosprorroga }\n end\n end",
"def show\n @tipo_restaurante = TipoRestaurante.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @tipo_restaurante }\n end\n end",
"def show\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @instituto }\n end\n end",
"def show\n @regiaos = Regiao.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @regiaos }\n end\n end",
"def show\n @estatu = Estatu.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @estatu }\n end\n end",
"def show\n @lien = Lien.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @lien }\n end\n end",
"def show\n @documento = @externo.documentos.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @documento }\n end\n end",
"def show\n @nspirefile = Nspirefile.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @nspirefile }\n end\n end",
"def index\n @ingresos = Ingreso.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @ingresos }\n end\n end",
"def index\n @nspirefiles = Nspirefile.all(:order => \"updated_at DESC\")\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @nspirefiles }\n end\n end",
"def show\n @segmento = Segmento.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @segmento }\n end\n end",
"def show\n @carro = Carro.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @carro }\n end\n end",
"def index\n @omatsuris = Omatsuri.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @omatsuris }\n format.json { render :json => @omatsuris }\n end\n end",
"def show\n @reputacao_veiculo = ReputacaoVeiculo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @reputacao_veiculo }\n end\n end",
"def show\n @proceso = Proceso.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @proceso }\n end\n end",
"def show\n @niveis_ensino = NiveisEnsino.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @niveis_ensino }\n end\n end",
"def read(id=nil)\r\n request = Net::HTTP.new(@uri.host, @uri.port)\r\n if id.nil?\r\n response = request.get(\"#{@uri.path}.xml\") \r\n else\r\n response = request.get(\"#{@uri.path}/#{id}.xml\") \r\n end\r\n response.body\r\n end",
"def show\n @coleccionista = Coleccionista.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @coleccionista }\n end\n end",
"def show\n @sitio = Sitio.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @sitio }\n end\n end",
"def index\n @estatus = Estatu.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @estatus }\n end\n end",
"def index\n @tiposcontratos = Tiposcontrato.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @tiposcontratos }\n end\n end",
"def index\n @clientes = Cliente.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @clientes }\n end\n end",
"def show\n @compras_documento = ComprasDocumento.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @compras_documento }\n end\n end",
"def show\n @sotto_categoria = SottoCategoria.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @sotto_categoria }\n end\n end",
"def index\n @csos = Cso.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @csos }\n end\n end",
"def novo\n @usuario = Usuario.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @usuario }\n end\n end",
"def show\n @lance_unico = LanceUnico.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @lance_unico }\n end\n end",
"def show\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @ciclo }\n end\n end",
"def show\n @tramo = Tramo.find(params[:id])\n @proyecto_id = params[:proyecto_id]\n @vanos = @tramo.vanos\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @tramo }\n end\n end",
"def show\n @network = Network.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @network } \n end\n end"
] | [
"0.6901335",
"0.6396159",
"0.6196773",
"0.61746377",
"0.6161963",
"0.6118572",
"0.61151767",
"0.60900253",
"0.6072972",
"0.6067995",
"0.60664916",
"0.60654014",
"0.60654014",
"0.60650927",
"0.60551906",
"0.60236746",
"0.6004392",
"0.5989335",
"0.59885484",
"0.596438",
"0.59608406",
"0.59422463",
"0.5937402",
"0.5931253",
"0.59224224",
"0.59187657",
"0.59155685",
"0.5913546",
"0.59057957",
"0.59030145",
"0.5901181",
"0.5897487",
"0.58895457",
"0.5879836",
"0.58695185",
"0.5866001",
"0.586471",
"0.58571804",
"0.585677",
"0.5855087",
"0.5854231",
"0.58494544",
"0.58446056",
"0.5844202",
"0.5842255",
"0.58329415",
"0.58319795",
"0.582491",
"0.5824767",
"0.5824553",
"0.58094597",
"0.58065546",
"0.5803105",
"0.58029306",
"0.5801049",
"0.5798152",
"0.57973623",
"0.57963896",
"0.5795831",
"0.57947874",
"0.5790704",
"0.5789594",
"0.57894725",
"0.57885104",
"0.5785859",
"0.57802784",
"0.5780168",
"0.577822",
"0.5776055",
"0.5773666",
"0.57720816",
"0.576439",
"0.5764339",
"0.5759652",
"0.57582366",
"0.5757662",
"0.57566696",
"0.5753456",
"0.5753018",
"0.5743585",
"0.5739327",
"0.5738065",
"0.5735207",
"0.5735207",
"0.57311094",
"0.57276064",
"0.57188475",
"0.57182866",
"0.5717315",
"0.5714901",
"0.57142794",
"0.5711542",
"0.5709859",
"0.5708572",
"0.5705262",
"0.57028866",
"0.5701656",
"0.57003677",
"0.56996554",
"0.56970555"
] | 0.6946634 | 0 |
GET /nostros/new GET /nostros/new.xml | def new
@nostro = Nostro.new
respond_to do |format|
format.html # new.html.erb
format.xml { render :xml => @nostro }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def new\n @nossos_servico = NossosServico.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @nossos_servico }\n end\n end",
"def new\n @node = Node.scopied.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @node }\n end\n end",
"def new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @nomina }\n end\n end",
"def create\n @nostro = Nostro.new(params[:nostro])\n\n respond_to do |format|\n if @nostro.save\n flash[:notice] = 'Nostro was successfully created.'\n format.html { redirect_to(@nostro) }\n format.xml { render :xml => @nostro, :status => :created, :location => @nostro }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @nostro.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => new_vurl }\n end\n end",
"def new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @instituto }\n end\n end",
"def new\n @recurso = Recurso.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @recurso }\n end\n end",
"def new\n @node = Node.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @node }\n end\n end",
"def new\n @node = Node.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @node }\n end\n end",
"def new\n @domino = Domino.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @domino }\n end\n end",
"def new\n @tiposproceso = Tiposproceso.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @tiposproceso }\n end\n end",
"def new\n @proceso = Proceso.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @proceso }\n end\n end",
"def new\n @solicitud = Solicitud.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @solicitud }\n end\n end",
"def new\n @silo = Silo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @silo }\n end\n end",
"def new\n @omatsuri = Omatsuri.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @omatsuri }\n end\n end",
"def new\n @tservicio = Tservicio.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @tservicio }\n end\n end",
"def new\n @lien = Lien.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @lien }\n end\n end",
"def new\n @relatestagiario = Relatestagiario.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @relatestagiario }\n end\n end",
"def new\n @rssnew = Rssnews.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @rssnew }\n end\n end",
"def new\n @tipo_nota = TipoNota.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @tipo_nota }\n end\n end",
"def new\n @nom = Nom.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @nom }\n end\n end",
"def novo\n @usuario = Usuario.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @usuario }\n end\n end",
"def new\n @nota = Nota.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @nota }\n end\n end",
"def new\n @nota = Nota.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @nota }\n end\n end",
"def new\n @precio = Precio.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @precio }\n end\n end",
"def new\n @Roc = Roc.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @Roc }\n end\n end",
"def novo\n @disciplina = Disciplina.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @disciplina }\n end\n end",
"def new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @ciclo }\n end\n end",
"def new\n @novel = Novel.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @novel }\n end\n end",
"def new\n @noticia = Noticia.new \n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @noticia }\n end\n end",
"def new\n @tso = Tso.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @tso }\n end\n end",
"def new\n @curso = Curso.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @curso }\n end\n end",
"def new\n @colo = Colo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @colo }\n end\n end",
"def new\n @remocao = Remocao.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @remocao }\n end\n end",
"def new\n @protocolo = Protocolo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @protocolo }\n end\n end",
"def new\n @vestimenta = Vestimenta.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @vestimenta }\n end\n end",
"def new\n @distribuidora = Distribuidora.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @distribuidora }\n end\n end",
"def new\n @estacion = Estacion.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @estacion }\n end\n end",
"def new\n @suministro = Suministro.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @suministro }\n end\n end",
"def new\n @lancamento = Lancamento.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @lancamento }\n end\n end",
"def new\n @noami = Noami.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @noami }\n end\n end",
"def create\n @nossos_servico = NossosServico.new(params[:nossos_servico])\n\n respond_to do |format|\n if @nossos_servico.save\n format.html { redirect_to(@nossos_servico, :notice => 'Nossos servico was successfully created.') }\n format.xml { render :xml => @nossos_servico, :status => :created, :location => @nossos_servico }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @nossos_servico.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def new\n @promos = Promos.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @promos }\n end\n end",
"def newX\n @server = Server.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @server }\n end\n end",
"def new\n @estatu = Estatu.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @estatu }\n end\n end",
"def new\n @tipo_lancamento = TipoLancamento.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @tipo_lancamento }\n end\n end",
"def new\n @ponto = Ponto.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @ponto }\n end\n end",
"def new\n @spiel = Spiel.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @spiel }\n end\n end",
"def new\n @regiaos = Regiao.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @regiaos }\n end\n end",
"def new\n @contrato = Contrato.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @contrato }\n end\n end",
"def new\n @news = News.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @news }\n end\n end",
"def new\n @news = News.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @news }\n end\n end",
"def new\n @news = News.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @news }\n end\n end",
"def new\n @novidade = Novidade.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @novidade }\n end\n end",
"def new\n @reclamo = Reclamo.new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @reclamo }\n end\n \n end",
"def new\n @documento = Documento.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @documento }\n end\n end",
"def new\n respond_to do |format|\n format.html { render_template } # new.html.erb\n format.xml { render xml: @system }\n end\n end",
"def new\n @tipo_curso = TipoCurso.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @tipo_curso }\n end\n end",
"def new\n @segmento = Segmento.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @segmento }\n end\n end",
"def new\n @relatorios = Relatorio.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @relatorios }\n end\n end",
"def new\n @node = Node.new(:displayed => true)\n @node.template = Template.new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @node }\n end\n end",
"def new\n @tipo_contrato = TipoContrato.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @tipo_contrato }\n end\n end",
"def new\n @contratosinterventoria = Contratosinterventoria.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @contratosinterventoria }\n end\n end",
"def new\n respond_to do |format|\n format.html { render :layout => 'application' }\n format.xml { render :xml => @recommand }\n end\n end",
"def new\n @tcliente = Tcliente.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @tcliente }\n end\n end",
"def new\n @carro = Carro.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @carro }\n end\n end",
"def new\n @curta = Curta.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @curta }\n end\n end",
"def new\n @crianca = Crianca.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @crianca }\n end\n end",
"def new\n @tipo_proy = TipoProy.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @tipo_proy }\n end\n end",
"def new\n @estagio = Estagio.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @estagio }\n end\n end",
"def new\n @nota_destacada = NotaDestacada.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @nota_destacada }\n end\n end",
"def new\n @produto = ProdutoSimples.new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @produto }\n end\n end",
"def new\n @asistencia = Asistencia.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @asistencia }\n end\n end",
"def new\n @movimiento = Movimiento.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @movimiento }\n end\n end",
"def new\n @lore = Lore.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @lore }\n end\n end",
"def new\n @dossier = Dossier.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @dossier }\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 @news = News.new\n @title = \"New news\"\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @news }\n end\n end",
"def new\n @receita = Receita.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @receita }\n end\n end",
"def new\n @promocao = Promocao.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @promocao }\n end\n end",
"def new\n @senhas = Senha.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @senhas }\n end\n end",
"def new\n @newz = Newz.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @newz }\n end\n end",
"def new\n @puesto = Puesto.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @puesto }\n end\n end",
"def new\n @glosario = Glosario.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @glosario }\n end\n end",
"def new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @ontology }\n end\n end",
"def new\n @tipo_de_documento = TipoDeDocumento.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @tipo_de_documento }\n end\n end",
"def new_nonva_porca_pupazza\n @person= Person.new\n respond_to do |format|\n format.html\n format.xml { render :xml => @person }\n end\n end",
"def new\n @convenio = Convenio.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @convenio }\n end\n end",
"def new\n @po = Po.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @po }\n end\n end",
"def new\n @norma = Norma.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @norma }\n end\n end",
"def new\n @estagiarios = Estagiario.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @estagiarios }\n end\n end",
"def new\n @coleccionista = Coleccionista.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @coleccionista }\n end\n end",
"def new\n @serie = Serie.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @serie }\n end\n end",
"def new\n @tipo_lista = TipoLista.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @tipo_lista }\n end\n end",
"def new\n @arrendamientosprorroga = Arrendamientosprorroga.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @arrendamientosprorroga }\n end\n end",
"def new\n @situacoes_juridica = SituacoesJuridica.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @situacoes_juridica }\n end\n end",
"def new\n @premio = Premio.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @premio }\n end\n end",
"def new\n @title = \"New Networks\"\n @network = Network.new\n @computers = Computer.find(:all)\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @network }\n end\n end",
"def new\n @status = Status.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @status }\n end\n end"
] | [
"0.7445369",
"0.72307926",
"0.7074972",
"0.7062118",
"0.69354063",
"0.6826278",
"0.6825546",
"0.6811856",
"0.6811856",
"0.6792888",
"0.67503744",
"0.6748164",
"0.67480785",
"0.6734063",
"0.67285764",
"0.6708153",
"0.67050153",
"0.67032295",
"0.6697795",
"0.66938704",
"0.6693035",
"0.6683117",
"0.6661131",
"0.6661131",
"0.66585505",
"0.66505516",
"0.66479266",
"0.66441953",
"0.6626693",
"0.66154945",
"0.66071737",
"0.6604892",
"0.66020906",
"0.65958154",
"0.65837735",
"0.65800864",
"0.65782356",
"0.6568734",
"0.65618825",
"0.6551985",
"0.65486443",
"0.6546088",
"0.65434223",
"0.65428394",
"0.65363497",
"0.65308976",
"0.6527171",
"0.6524013",
"0.6522816",
"0.65199715",
"0.6512556",
"0.6512556",
"0.6512556",
"0.651209",
"0.6510197",
"0.6507852",
"0.6502528",
"0.6498632",
"0.6494692",
"0.6493613",
"0.6490617",
"0.6490206",
"0.64876956",
"0.64875907",
"0.64872295",
"0.6486457",
"0.64820844",
"0.64819914",
"0.6481774",
"0.64797246",
"0.6478699",
"0.64784753",
"0.6478406",
"0.6476187",
"0.6475753",
"0.64730775",
"0.6467773",
"0.6467773",
"0.6466756",
"0.64643365",
"0.6462265",
"0.64620435",
"0.6461552",
"0.64599895",
"0.64525276",
"0.6452361",
"0.6449725",
"0.6446264",
"0.6443595",
"0.6443422",
"0.6443156",
"0.6442561",
"0.64422375",
"0.6438854",
"0.6433934",
"0.6431372",
"0.6429001",
"0.6428868",
"0.6427248",
"0.64261043"
] | 0.7582463 | 0 |
POST /nostros POST /nostros.xml | def create
@nostro = Nostro.new(params[:nostro])
respond_to do |format|
if @nostro.save
flash[:notice] = 'Nostro was successfully created.'
format.html { redirect_to(@nostro) }
format.xml { render :xml => @nostro, :status => :created, :location => @nostro }
else
format.html { render :action => "new" }
format.xml { render :xml => @nostro.errors, :status => :unprocessable_entity }
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n @nossos_servico = NossosServico.new(params[:nossos_servico])\n\n respond_to do |format|\n if @nossos_servico.save\n format.html { redirect_to(@nossos_servico, :notice => 'Nossos servico was successfully created.') }\n format.xml { render :xml => @nossos_servico, :status => :created, :location => @nossos_servico }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @nossos_servico.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def gerar_nfse\n #puts load_xml\n self.cliente_soap.call(:gerar_nfse, soap_action: \"http://nfse.goiania.go.gov.br/ws/GerarNfse\", message: { arquivo_xml: self.load_xml.to_s })\n end",
"def create\n @nitrou = Nitrou.new(nitrou_params)\n\n respond_to do |format|\n if @nitrou.save\n format.html { redirect_to @nitrou, notice: 'Nitrou was successfully created.' }\n format.json { render :show, status: :created, location: @nitrou }\n else\n format.html { render :new }\n format.json { render json: @nitrou.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n @nostro = Nostro.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @nostro }\n end\n end",
"def novo\n @disciplina = Disciplina.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @disciplina }\n end\n end",
"def create\n doc = Nokogiri::XML(request.body.read)\n cvNode = doc.xpath('elwak/checklisten_vorlage')\n cv = ChecklistenVorlage.new({\n objekt_id: cvNode.xpath('objekt_id').text.to_s, \n bezeichner: cvNode.xpath('bezeichner').text.to_s, \n version: cvNode.xpath('version').text.to_s.to_i, \n inaktiv: cvNode.xpath('inaktiv').text.to_s.to_bool \n })\n cv.save\n\n cvNode.xpath('checklisten_eintrags/checklisten_eintrag').each do |ceNode|\n ce = ChecklistenEintrag.new({\n checklisten_vorlage_id: cv.id,\n bezeichner: ceNode.xpath('bezeichner').text.to_s,\n was: ceNode.xpath('was').text.to_s,\n wann: ceNode.xpath('wann').text.to_s,\n typ: ceNode.xpath('typ').text.to_s.to_i,\n position: ceNode.xpath('position').text.to_s.to_i\n })\n ce.save\n end\n\n respond_to do |format|\n format.xml {render :xml => '<?xml version=\"1.0\" encoding=\"UTF-8\"?><success />'}\n end\n end",
"def create\n @niveis_ensino = NiveisEnsino.new(params[:niveis_ensino])\n\n respond_to do |format|\n if @niveis_ensino.save\n format.html { redirect_to(@niveis_ensino, :notice => 'Niveis ensino cadastrado com sucesso.') }\n format.xml { render :xml => @niveis_ensino, :status => :created, :location => @niveis_ensino }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @niveis_ensino.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def new\n @nossos_servico = NossosServico.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @nossos_servico }\n end\n end",
"def create\n @nippou = Nippou.new(nippou_params)\n\n respond_to do |format|\n if @nippou.save\n format.html { redirect_to @nippou, notice: 'Nippou was successfully created.' }\n format.json { render action: 'show', status: :created, location: @nippou }\n else\n format.html { render action: 'new' }\n format.json { render json: @nippou.errors, status: :unprocessable_entity }\n end\n end\n end",
"def post_nodes_with_root\n serialize_service.post_nodes_serialized\n end",
"def create\n @nodo = Nodo.new(nodo_params)\n\n respond_to do |format|\n if @nodo.save\n #format.html { redirect_to @nodo, notice: 'Nodo was successfully created.' }\n #format.json { render action: 'show', status: :created, location: @nodo }\n format.html { redirect_to nodos_url }\n format.json { head :no_content }\n else\n format.html { render action: 'new' }\n format.json { render json: @nodo.errors, status: :unprocessable_entity }\n end\n end\n end",
"def post(xmldoc)\n headers = {'Content-Type' => 'text/xml'}\n check_response( @httpcli.post(@endpoint, xmldoc, headers) )\n end",
"def create\n @novidade = Novidade.new(params[:novidade])\n\n respond_to do |format|\n if @novidade.save\n flash[:notice] = 'Novidade was successfully created.'\n format.html { redirect_to(@novidade) }\n format.xml { render :xml => @novidade, :status => :created, :location => @novidade }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @novidade.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 destroy\n @nostro = Nostro.find(params[:id])\n @nostro.destroy\n\n respond_to do |format|\n format.html { redirect_to(nostros_url) }\n format.xml { head :ok }\n end\n end",
"def create\n @rendezvouz = Rendezvouz.new(params[:rendezvouz])\n\n respond_to do |format|\n if @rendezvouz.save\n flash[:notice] = 'Rendezvouz was successfully created.'\n format.html { redirect_to(@rendezvouz) }\n format.xml { render :xml => @rendezvouz, :status => :created, :location => @rendezvouz }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @rendezvouz.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @nino = Nino.new(nino_params)\n\n respond_to do |format|\n if @nino.save\n format.html { redirect_to ninos_path, notice: \"El niño #{@nino.nombre} ha sido creado.\" }\n format.json { render action: 'show', status: :created, location: @nino }\n else\n format.html { render action: 'new' }\n format.json { render json: @nino.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @noto = Noto.new(params[:noto])\n\n respond_to do |format|\n if @noto.save\n format.html { redirect_to @noto, :notice => 'Noto was successfully created.' }\n format.json { render :json => @noto, :status => :created, :location => @noto }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @noto.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @domino = Domino.new(params[:domino])\n\n respond_to do |format|\n if @domino.save\n flash[:notice] = 'Domino was successfully created.'\n format.html { redirect_to(@domino) }\n format.xml { render :xml => @domino, :status => :created, :location => @domino }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @domino.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @noshow = Noshow.new(noshow_params)\n\n respond_to do |format|\n if @noshow.save\n format.html { redirect_to @noshow, notice: 'Noshow was successfully created.' }\n format.json { render :show, status: :created, location: @noshow }\n else\n format.html { render :new }\n format.json { render json: @noshow.errors, status: :unprocessable_entity }\n end\n end\n end",
"def novo\n @usuario = Usuario.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @usuario }\n end\n end",
"def create\n @trnodo = Trnodo.new(params[:trnodo])\n\n respond_to do |format|\n if @trnodo.save\n format.html { redirect_to @trnodo, notice: 'Trnodo was successfully created.' }\n format.json { render json: @trnodo, status: :created, location: @trnodo }\n else\n format.html { render action: \"new\" }\n format.json { render json: @trnodo.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @nebulosa = Nebulosa.new(nebulosa_params)\n\n respond_to do |format|\n if @nebulosa.save\n format.html { redirect_to @nebulosa, notice: 'Nebulosa was successfully created.' }\n format.json { render :show, status: :created, location: @nebulosa }\n else\n format.html { render :new }\n format.json { render json: @nebulosa.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n megam_rest.post_node(to_hash)\n end",
"def create\n @torneo = Torneo.new(torneo_params)\n\n respond_to do |format|\n if @torneo.save\n format.html { redirect_to @torneo, notice: 'Torneo fue creado exitosamente.' }\n format.json { render :show, status: :created, location: @torneo }\n else\n format.html { render :new }\n format.json { render json: @torneo.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create(name=\"Default Name\", age=\"50\")\r\n xml_req =\r\n \"<?xml version='1.0' encoding='UTF-8'?>\r\n <person>\r\n <name>#{name}</name>\r\n <age>#{age}</age>\r\n </person>\"\r\n \r\n request = Net::HTTP::Post.new(@url)\r\n request.add_field \"Content-Type\", \"application/xml\"\r\n request.body = xml_req\r\n \r\n http = Net::HTTP.new(@uri.host, @uri.port)\r\n response = http.request(request)\r\n response.body \r\n end",
"def create\n @node_config = NodeConfig.new(params[:node_config])\n\n respond_to do |format|\n if @node_config.save\n format.xml { render :xml => @node_config, :status => :created, :location => @node_config }\n format.any { render :json => @node_config, :status => :created, :location => @node_config }\n else\n format.xml { render :xml => @node_config.errors, :status => :unprocessable_entity }\n format.any { render :json => @node_config.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create(params)\n http.post(\"/nfse\", { body: params }) do |response|\n respond_with_entity(response)\n end\n end",
"def create\n @sinistro = Sinistro.new(sinistro_params)\n\n respond_to do |format|\n if @sinistro.save\n format.html { redirect_to @sinistro, notice: 'Sinistro was successfully created.' }\n format.json { render :show, status: :created, location: @sinistro }\n else\n format.html { render :new }\n format.json { render json: @sinistro.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @nineteen = Nineteen.new(nineteen_params)\n\n respond_to do |format|\n if @nineteen.save\n format.html { redirect_to @nineteen, notice: 'Nineteen was successfully created.' }\n format.json { render action: 'show', status: :created, location: @nineteen }\n else\n format.html { render action: 'new' }\n format.json { render json: @nineteen.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @node = Node.new(params[:node])\n\n respond_to do |format|\n if @node.save\n format.html { redirect_to(@node, :notice => 'Node was successfully created.') }\n format.xml { render :xml => @node, :status => :created, :location => @node }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @node.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @node = Node.new(params[:node])\n\n respond_to do |format|\n if @node.save\n format.html { redirect_to(@node, :notice => 'Node was successfully created.') }\n format.xml { render :xml => @node, :status => :created, :location => @node }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @node.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @regra_negocio = RegraNegocio.new(regra_negocio_params)\n\n respond_to do |format|\n if @regra_negocio.save\n format.html { redirect_to @regra_negocio, notice: 'Regra negocio was successfully created.' }\n format.json { render :show, status: :created, location: @regra_negocio }\n else\n format.html { render :new }\n format.json { render json: @regra_negocio.errors, status: :unprocessable_entity }\n end\n end\n end",
"def post(uri, xml)\r\n req = Net::HTTP::Post.new(uri)\r\n req[\"content-type\"] = \"application/xml\"\r\n req.body = xml\r\n request(req)\r\n end",
"def create\n @torneo = Torneo.new(params[:torneo])\n\n respond_to do |format|\n if @torneo.save\n format.html { redirect_to @torneo, notice: 'Torneo was successfully created.' }\n format.json { render json: @torneo, status: :created, location: @torneo }\n else\n format.html { render action: \"new\" }\n format.json { render json: @torneo.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @suministro = Suministro.new(params[:suministro])\n\n respond_to do |format|\n if @suministro.save\n format.html { redirect_to(@suministro, :notice => 'Suministro was successfully created.') }\n format.xml { render :xml => @suministro, :status => :created, :location => @suministro }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @suministro.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @node = Node.new(params[:node])\n \n respond_to do |format|\n if @node.save\n format.html { redirect_to(@node, :notice => 'Node was successfully created.') }\n format.xml { render :xml => @node, :status => :created, :location => @node }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @node.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @node = Node.new(params[:node])\n\n respond_to do |format|\n if @node.save\n @node.broadcast_add_me\n Cue.send_all_pending\n format.html { redirect_to(@node, :notice => 'Node was successfully created.') }\n format.xml { render :xml => @node, :status => :created, :location => @node }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @node.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def nessus_request(uri, post_data) \r\n\t\tbody=nessus_http_request(uri, post_data)\r\n\t\t# puts response.body\r\n\t\tdocxml = REXML::Document.new(body)\r\n\t\tbegin \r\n\t\tstatus = docxml.root.elements['status'].text\r\n\t\trescue\r\n\t\t\tputs \"[e] error in XML parsing\"\r\n\t\tend\r\n\t\tif status == \"OK\"\r\n\t\t\treturn docxml \r\n\t\telse \r\n\t\t\treturn ''\r\n\t\tend\r\n\tend",
"def create\n @nap = Nap.new(nap_params)\n\n respond_to do |format|\n if @nap.save\n format.html { redirect_to @nap, notice: 'Nap was successfully created.' }\n format.json { render :show, status: :created, location: @nap }\n else\n format.html { render :new }\n format.json { render json: @nap.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @node = Node.new(params[:node])\n @title = \"Taxonomy node - organism relationships\"\n\n respond_to do |format|\n if @node.save\n format.html { redirect_to(@node, :notice => 'Node was successfully created.') }\n format.xml { render :xml => @node, :status => :created, :location => @node }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @node.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @noticium = Noticium.new(params[:noticium])\n\n respond_to do |format|\n if @noticium.save\n format.html { redirect_to(@noticium, :notice => 'Noticium was successfully created.') }\n format.xml { render :xml => @noticium, :status => :created, :location => @noticium }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @noticium.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @onsen = Onsen.new(onsen_params)\n\n respond_to do |format|\n if @onsen.save\n format.html { redirect_to @onsen, notice: 'Onsen was successfully created.' }\n format.json { render :show, status: :created, location: @onsen }\n else\n format.html { render :new }\n format.json { render json: @onsen.errors, status: :unprocessable_entity }\n end\n end\n end",
"def nebulosa_params\n params.require(:nebulosa).permit(:Nebulosa, :TipoNebulosa)\n end",
"def create(name=\"Default name\")\n xml_req =\n \"<?xml version='1.0' encoding='UTF-8'?>\n <customer>\n <name>#{name}</name>\n </customer>\"\n\n request = Net::HTTP::Post.new(@url)\n request.add_field \"Content-Type\", \"application/xml\"\n request.body = xml_req\n\n http = Net::HTTP.new(@uri.host, @uri.port)\n response = http.request(request)\n\n response.body\n end",
"def create\n @tiposproceso = Tiposproceso.new(params[:tiposproceso])\n\n respond_to do |format|\n if @tiposproceso.save\n format.html { redirect_to(@tiposproceso, :notice => 'Tiposproceso was successfully created.') }\n format.xml { render :xml => @tiposproceso, :status => :created, :location => @tiposproceso }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @tiposproceso.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @node = Node.new(params[:node])\n\n respond_to do |format|\n if @node.save!\n format.html { redirect_to @node, notice: 'Встречная продажа создана' }\n format.json { render json: @node, status: :created, location: @node }\n else\n format.html { render action: \"new\" }\n format.json { render json: @node.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @csosn = Csosn.new(params[:csosn])\n\n respond_to do |format|\n if @csosn.save\n format.html { redirect_to @csosn, notice: 'Csosn was successfully created.' }\n format.json { render json: @csosn, status: :created, location: @csosn }\n else\n format.html { render action: \"new\" }\n format.json { render json: @csosn.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @selecciones = Seleccion.where(\"cliente_id = ?\",usuario_actual.id)\n @peso_total = Seleccion.peso_total(usuario_actual.id)\n @precio_total = Seleccion.precio_total(usuario_actual.id)\n @tarjetas = usuario_actual.tdc\n \n #Cobro en el banco\n client = Savon::Client.new(\"http://localhost:3001/servicios/wsdl\")\n tdc = Tarjeta.where(\"id = ? AND cliente_id = ?\",params[:orden][:tarjeta_id],usuario_actual.id)\n total_pagar = params[:orden][:total]\n pago = '<Message>\n <Request>\n <numero_tdc>'+tdc.numero+'</numero_tdc>\n <nombre_tarjetahabiente>'+tdc.tarjetahabiente+'</nombre_tarjetahabiente>\n <fecha_vencimiento>'+tdc.mes_vencimiento+'/'+tdc.ano_vencimiento+'</fecha_vencimiento>\n <codigo_seguridad>'+tdc.codigo+'</codigo_seguridad>\n <tipo_tarjeta>'+tdc.tipo+'</tipo_tarjeta>\n <direccion_cobro>'+tdc.direccion+'</direccion_cobro>\n <total_pagar>'+total_pagar+'</total_pagar>\n <cuenta_receptora>'+cuenta_receptora+'</cuenta_receptora>\n </Request>\n </Message>'\n #response = client.request :verificar_pago, body: { \"value\" => pago } \n #if response.success?\n # data = response.to_hash[:verificar_pago_response][:value][:response].first\n # @respuesta = XmlSimple.xml_in(data)\n #end\n\n #NAMESPACE = 'pagotdc'\n #URL = 'http://localhost:8080/'\n #banco = SOAP::RPC::Driver.new(URL, NAMESPACE)\n #banco.add_method('verificar_pago', 'numero_tdc', 'nombre_tarjetahabiente', 'fecha_vencimiento', 'codigo_seguridad', 'tipo_tarjeta', 'direccion_cobro', 'total_pagar', 'cuenta_receptora')\n #\n \n #respuesta = banco.verificar_pago(tdc.numero, tdc.tarjetahabiente, tdc.mes_vencimiento.to_s+'/'+tdc.ano_vencimiento.to_s, tdc.codigo, tdc.tipo, params[:orden][:total], tdc.direccion)\n \n if true #respuesta.ack.eql?(0)\n params[:orden][:cliente_id] = usuario_actual.id\n params[:orden][:total] = Seleccion.precio_total(usuario_actual.id)\n params[:orden][:fecha_entrega] = \"0000-00-00\"\n @orden = Orden.new(params[:orden])\n \n if @orden.save\n @selecciones = Seleccion.where(\"cliente_id = ?\",usuario_actual.id)\n @selecciones.each do |seleccion|\n p = Producto.find(seleccion.producto_id)\n @venta = Venta.new(:producto_id=>p.id, \n :orden_id=>@orden.id,\n :categoria_id=>p.categoria_id, \n :cantidad=>seleccion.cantidad,\n :costo=>p.precio)\n @venta.save\n end\n \n Seleccion.vaciar_carro(usuario_actual.id)\n respond_to do |format|\n format.html { redirect_to ver_ordenes_path, notice: 'Orden generada correctamente.' }\n end\n else\n respond_to do |format|\n format.html { render action: \"new\" }\n end\n end\n else\n respond_to do |format|\n format.html { render action: \"new\", notice: respuesta.mensaje }\n end\n end\n end",
"def create(params)\n\nxml =<<XML\n<entry xmlns=\"http://purl.org/atom/ns#\">\n <title>#{params[:title]}</title>\n <link rel=\"related\" type=\"text/html\" href=\"#{params[:url]}\" />\n <summary type=\"text/plain\">#{params[:comment]}</summary>\n</entry>\nXML\n\n post('/post', xml)\n end",
"def method_missing(method, *args, &block)\n data = { method: method, parameters: args }\n request.post(path: nodes_path, data: data, auth_token: auth_token)\n end",
"def create\n @estatu = Estatu.new(params[:estatu])\n\n respond_to do |format|\n if @estatu.save\n format.html { redirect_to(@estatu, :notice => 'Registro creado correctamente.') }\n format.xml { render :xml => @estatu, :status => :created, :location => @estatu }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @estatu.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @strosek = Strosek.new(strosek_params)\n\n respond_to do |format|\n if @strosek.save\n format.html { redirect_to @strosek, notice: 'Strosek was successfully created.' }\n format.json { render action: 'show', status: :created, location: @strosek }\n else\n format.html { render action: 'new' }\n format.json { render json: @strosek.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @cancellation = Cancellation.new_from_xml(request.body.read)\n respond_to do |format|\n if @cancellation.save! \n format.xml { render :action => 'show', :status => :created, :location => @cancellation }\n else\n format.xml { render :xml => @cancellation.errors, :status => :unprocessable_entity }\n end\n end \n \n #@orders.each do |order|\n end",
"def create\n @nasfile = Nasfile.new(nasfile_params)\n\n respond_to do |format|\n if @nasfile.save\n format.html { redirect_to @nasfile, notice: 'Nasfile was successfully created.' }\n format.json { render :show, status: :created, location: @nasfile }\n else\n format.html { render :new }\n format.json { render json: @nasfile.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @ngo = Ngo.new(ngo_params)\n\n respond_to do |format|\n if @ngo.save\n format.html { redirect_to @ngo, notice: 'Ngo was successfully created.' }\n format.json { render :show, status: :created, location: @ngo }\n else\n format.html { render :new }\n format.json { render json: @ngo.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n neo = Neography::Rest.new\n city = neo.create_node(params[:city])\n redirect_to cities_path\n end",
"def create\n @tipo_nota = TipoNota.new(params[:tipo_nota])\n\n respond_to do |format|\n if @tipo_nota.save\n format.html { redirect_to(@tipo_nota, :notice => 'TipoNota was successfully created.') }\n format.xml { render :xml => @tipo_nota, :status => :created, :location => @tipo_nota }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @tipo_nota.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @nspirefile = Nspirefile.new(params[:nspirefile])\n\n respond_to do |format|\n if @nspirefile.save\n flash[:notice] = 'TI-Nspire file \"' + @nspirefile.title + '\" was successfully created.'\n format.html { redirect_to(@nspirefile) }\n format.xml { render :xml => @nspirefile, :status => :created, :location => @nspirefile }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @nspirefile.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @sotrudniki = Sotrudniki.new(params[:sotrudniki])\n\n respond_to do |format|\n if @sotrudniki.save\n format.html { redirect_to @sotrudniki, notice: 'Sotrudniki was successfully created.' }\n format.json { render json: @sotrudniki, status: :created, location: @sotrudniki }\n else\n format.html { render action: \"new\" }\n format.json { render json: @sotrudniki.errors, status: :unprocessable_entity }\n end\n end\n end",
"def rastreamento_params\n params.require(:rastreamento).permit(:visitante, :url, :titulo, :data_hora)\n end",
"def create\n @consultorio_n = ConsultorioN.new(consultorio_n_params)\n\n respond_to do |format|\n if @consultorio_n.save\n format.html { redirect_to @consultorio_n, notice: 'Consultorio n was successfully created.' }\n format.json { render :show, status: :created, location: @consultorio_n }\n else\n format.html { render :new }\n format.json { render json: @consultorio_n.errors, status: :unprocessable_entity }\n end\n end\n end",
"def post_xml(url, ls_data)\n uri = URI.parse(url)\n request = Net::HTTP::Post.new(uri.request_uri, HEADER_XML)\n request.body = ls_data\n request.basic_auth(@nsx_user, @nsx_password)\n response = Net::HTTP.start(uri.host, uri.port, :use_ssl => true,\n :verify_mode => OpenSSL::SSL::VERIFY_NONE) do |https|\n https.request(request)\n end\n return response.body if check_response(response, 201)\n end",
"def post_headers\n {\"Content-Type\" => 'text/xml; charset=utf-8'}\n end",
"def torneo_params\n params.require(:torneo).permit(:nombre, :fecha_inicio, :fecha_fin, :hoja_calculo,:numero_canchas)\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 new\n @node = Node.scopied.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @node }\n end\n end",
"def create\n @snp = Snp.new(params[:snp])\n\n respond_to do |format|\n if @snp.save\n format.html { redirect_to @snp, notice: 'Snp was successfully created.' }\n format.json { render json: @snp, status: :created, location: @snp }\n else\n format.html { render action: \"new\" }\n format.json { render json: @snp.errors, status: :unprocessable_entity }\n end\n end\n end",
"def nino_params\n params.require(:nino).permit(:nombre, :fecha_nacimiento, :edad, :sexo, :fecha_ingreso, :fecha_egreso, :motivo_ingreso, :motivo_egreso, :fecha_vencimiento_medida, :oficina_id, :familia_id, :tipo_acogimiento, :iglesia_id,:grupo_hermanos,:numero_hermanos,:subvencionado,:discapacidad,:referencia,:medida_proteccion,:situacion_legal,:codigo_alternativa,:subsidio_aprobado,:fecha_medida_proteccion,:ayudas_instituciones,:tipo_discapacidad,:causa_permanencia,:escolaridad,:servicio_apoyo,:causa_egreso)\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 doc = Nokogiri::XML(request.body.read)\n bNode = doc.xpath('elwak/benutzer')\n\n @benutzer = Benutzer.new(benutzer_params(bNode))\n if @benutzer.save\n if bNode.xpath('objekt_zuordnungs').length > 0\n objekt_ids = bNode.xpath('objekt_zuordnungs/objekt_id').map{|oz| oz.text.to_s.to_i}\n @benutzer.setze_objekt_zuordnungen(objekt_ids)\n end\n success(@benutzer.id)\n else\n error(@benutzer.errors)\n end\n end",
"def create\n @nisarga = Nisarga.new(nisarga_params)\n\n respond_to do |format|\n if @nisarga.save\n format.html { redirect_to @nisarga, notice: 'Nisarga was successfully created.' }\n format.json { render :show, status: :created, location: @nisarga }\n else\n format.html { render :new }\n format.json { render json: @nisarga.errors, status: :unprocessable_entity }\n end\n end\n end",
"def post_config(url_prefix, xml)\n post_data(url_prefix, xml, 'application/xml;charset=UTF-8')\n end",
"def create\n @synonymprotein = Synonymprotein.new(synonymprotein_params)\n\n respond_to do |format|\n if @synonymprotein.save\n format.html { redirect_to @synonymprotein, notice: 'Synonymprotein was successfully created.' }\n format.json { render :show, status: :created, location: @synonymprotein }\n else\n format.html { render :new }\n format.json { render json: @synonymprotein.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @tipo_negocio = TipoNegocio.new(params[:tipo_negocio])\n\n respond_to do |format|\n if @tipo_negocio.save\n format.html { redirect_to @tipo_negocio, notice: 'Tipo negocio was successfully created.' }\n format.json { render json: @tipo_negocio, status: :created, location: @tipo_negocio }\n else\n format.html { render action: \"new\" }\n format.json { render json: @tipo_negocio.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @nr_parameter = NrParameter.new(params[:nr_parameter])\n\n respond_to do |format|\n if @nr_parameter.save\n flash[:notice] = 'NetRestore parameter was successfully created.'\n format.html { redirect_to(@nr_parameter) }\n format.xml { render :xml => @nr_parameter, :status => :created, :location => @nr_parameter }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @nr_parameter.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @snail = Snail.new(snail_params)\n\n respond_to do |format|\n if @snail.save\n format.html { redirect_to @snail, notice: 'Snail was successfully created.' }\n format.json { render :show, status: :created, location: @snail }\n else\n format.html { render :new }\n format.json { render json: @snail.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @distribuidora = Distribuidora.new(params[:distribuidora])\n\n respond_to do |format|\n if @distribuidora.save\n format.html { redirect_to(@distribuidora, :notice => 'Distribuidora was successfully created.') }\n format.xml { render :xml => @distribuidora, :status => :created, :location => @distribuidora }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @distribuidora.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n #@server_node = ServerNode.new(params[:server_node])\n #@server_node = ServerNode.create() do |n|\n # n.name = params[:node][:name]\n\t# n.region = params[:node][:region]\n\t# n.status = params[:node][:status]\n\n #end\n\n respond_to do |format|\n if @server_node.save\n format.html { redirect_to @server_node, notice: 'Server node was successfully created.' }\n format.json { render json: @server_node, status: :created, location: @server_node }\n else\n format.html { render action: \"new\" }\n format.json { render json: @server_node.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @nnb = Nnb.new(nnb_params)\n respond_to do |format|\n if @nnb.save\n format.html { redirect_to @nnb, notice: 'Nnb was successfully created.' }\n format.json { render action: 'show', status: :created, location: @nnb }\n else\n format.html { render action: 'new' }\n format.json { render json: @nnb.errors, status: :unprocessable_entity }\n end\n end\n end",
"def post(method, params = {})\n url = make_url method, params\n query = url.query\n url.query = nil\n\n req = Net::HTTP::Post.new url.path\n req.body = query\n req.content_type = 'application/x-www-form-urlencoded'\n\n res = Net::HTTP.start url.host, url.port do |http|\n http.request req\n end\n\n xml = Nokogiri::XML(res.body, nil, nil, 0)\n\n check_error xml\n\n parse_response xml\n rescue SystemCallError, SocketError, Timeout::Error, IOError,\n Nokogiri::XML::SyntaxError => e\n raise CommunicationError.new(e)\n rescue Net::HTTPError => e\n xml = Nokogiri::XML(e.res.body) { |cfg| cfg.strict }\n check_error xml\n raise CommunicationError.new(e)\n end",
"def create\n @nepal = Nepal.new(nepal_params)\n\n if @nepal.save\n render json: @nepal, status: :created, location: @nepal\n else\n render json: @nepal.errors, status: :unprocessable_entity\n end\n end",
"def nessus_request(uri, post_data)\n\t\t\tbody=nessus_http_request(uri, post_data)\n\t\t\t# puts response.body\n\t\t\tdocxml = REXML::Document.new(body)\n\t\t\tbegin\n\t\t\t\tstatus = docxml.root.elements['status'].text\n\t\t\trescue\n\t\t\t\tputs(\"Error connecting/logging to the server!\")\n\t\t\t\treturn\n\t\t\tend\n\t\t\tif status == \"OK\"\n\t\t\t\treturn docxml\n\t\t\telse\n\t\t\t\treturn ''\n\t\t\tend\n\t\tend",
"def create\n @omatsuri = Omatsuri.new(params[:omatsuri])\n\n respond_to do |format|\n if @omatsuri.save\n flash[:notice] = 'Omatsuri was successfully created.'\n format.html { redirect_to(@omatsuri) }\n format.xml { render :xml => @omatsuri, :status => :created, :location => @omatsuri }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @omatsuri.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @sentidoresolucion = Sentidoresolucion.new(params[:sentidoresolucion])\n\n respond_to do |format|\n if @sentidoresolucion.save\n format.html { redirect_to(@sentidoresolucion, :notice => 'Sentidoresolucion was successfully created.') }\n format.xml { render :xml => @sentidoresolucion, :status => :created, :location => @sentidoresolucion }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @sentidoresolucion.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @rastreamento = Rastreamento.new(rastreamento_params)\n\n respond_to do |format|\n if @rastreamento.save\n format.html { redirect_to @rastreamento, notice: 'Rastreamento was successfully created.' }\n format.json { render :show, status: :created, location: @rastreamento }\n else\n format.html { render :new }\n format.json { render json: @rastreamento.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n \n @selecciones = Seleccion.where(\"cliente_id = ?\",usuario_actual.id)\n respond_to do |format|\n unless @selecciones.empty?\n @peso_total = Seleccion.peso_total(usuario_actual.id)\n @precio_total = Seleccion.precio_total(usuario_actual.id)\n @tarjetas = usuario_actual.tdc\n @orden = Orden.new(:direccion_entrega=>usuario_actual.direccion)\n t = Time.now\n fecha = t.strftime(\"%Y-%m-%d\")\n client = Savon::Client.new(\"http://192.168.1.121/DistribuidorFIF/webservices/servicio.php?wsdl\")\n preorden = \"<solicitud_pedido>\n <num_orden>001</num_orden>\n <nombre_comercio>Tukiosquito</nombre_comercio>\n <fecha_solicitud>\"+fecha.to_s+\"</fecha_solicitud>\n <nombre_cliente>\"+usuario_actual.nombre+\" \"+usuario_actual.apellido+\"</nombre_cliente>\n <direccion_comercio>\n <avenida>Sucre</avenida>\n <calle>-</calle>\n <edificio_casa>CC Millenium</edificio_casa>\n <local_apt>C1-15</local_apt>\n <parroquia>Leoncio Martinez</parroquia>\n <municipio>Sucre</municipio>\n <ciudad>Caracas</ciudad>\n <estado>Miranda</estado>\n <pais>Venezuela</pais>\n </direccion_comercio>\n <direccion_destino>\n <avenida>Santa Rosa</avenida>\n <calle>Tierras Rojas</calle>\n <edificio_casa>Villa Magica</edificio_casa>\n <local_apt>69</local_apt>\n <parroquia> </parroquia>\n <municipio>Zamora</municipio>\n <ciudad>Cua</ciudad>\n <estado>Miranda</estado>\n <pais>Venezuela</pais>\n </direccion_destino>\"\n @selecciones.each do |seleccion|\n p = Producto.find(seleccion.producto_id)\n preorden = preorden+\"\n <articulo>\n <id>\"+p.id.to_s+\"</id>\n <descripcion>\"+p.descripcion+\"</descripcion>\n <peso>\"+p.peso.to_s+\"</peso>\n <cantidad>\"+seleccion.cantidad.to_s+\"</cantidad>\n <precio>\"+p.precio.to_s+\"</precio>\n </articulo>\"\n end\n preorden = preorden+\"</solicitud_pedido>\"\n response = client.request :ejemplo, body: { \"value\" => preorden } \n if response.success? \n respuesta = response.to_hash[:ejemplo_response][:return]\n datos = XmlSimple.xml_in(respuesta)\n end\n\n @precio_envio = datos[\"num_orden\"][0]\n #@arreglo = XmlSimple.xml_in('')\n #@xml = XmlSimple.xml_out(@arreglo, { 'RootName' => 'solicitud_pedido' })\n #url = 'http://192.168.1.101/Antonio/tukyosquito/proyecto/servicio/servicio.php'\n #cotizacion = SOAP::RPC::Driver.new(url)\n #cotizacion.add_method('obtener','asd')\n #tdc = Tarjeta.where(\"id = ? AND cliente_id = ?\",params[:orden][:tarjeta_id],usuario_actual.id)\n #@respuesta = cotizacion.obtener('123')\n format.html # new.html.erb\n else\n format.html { redirect_to carrito_path, notice: 'No tiene productos agregados al carro de compras para generar una orden.' }\n end\n end\n end",
"def create\n @noyau = Noyau.new(noyau_params)\n\n respond_to do |format|\n if @noyau.save\n format.html { redirect_to @noyau, notice: 'Noyau was successfully created.' }\n format.json { render :show, status: :created, location: @noyau }\n else\n format.html { render :new }\n format.json { render json: @noyau.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @estagio = Estagio.new(params[:estagio])\n\n respond_to do |format|\n if @estagio.save\n flash[:notice] = 'Estagio was successfully created.'\n format.html { redirect_to(@estagio) }\n format.xml { render :xml => @estagio, :status => :created, :location => @estagio }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @estagio.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @restaurantes_proximo = RestaurantesProximo.new(restaurantes_proximo_params)\n\n respond_to do |format|\n if @restaurantes_proximo.save\n format.html { redirect_to @restaurantes_proximo, notice: 'Restaurantes proximo was successfully created.' }\n format.json { render :show, status: :created, location: @restaurantes_proximo }\n else\n format.html { render :new }\n format.json { render json: @restaurantes_proximo.errors, status: :unprocessable_entity }\n end\n end\n end",
"def newsrss\n # already have global $news = News.returnNews\n render_without_layout\n @headers[\"Content-Type\"] = \"application/xml; charset=utf-8\" \n\n end",
"def create\n @orden = Orden.new(params[:orden])\n @usuario = Usuario.find(@orden.usuario_id)\n respond_to do |format|\n if @orden.save\n flash[:notice] = 'La Orden de Trabajo fue exitosamente generada.'\n Notificador.deliver_nueva_tarea(@usuario)\n format.html { redirect_to(:action => \"show\", :id => @orden) }\n format.xml { render :xml => @orden, :status => :created, :location => @orden }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @orden.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @revenu = @foyer.revenus.build(params[:revenu])\n\n respond_to do |format|\n if @revenu.save\n flash[:notice] = 'Revenu a bien été rajouté.'\n format.html { redirect_to foyer_revenus_url(@foyer) }\n format.xml { render :xml => @revenu, :status => :created, :location => @revenu }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @revenu.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @estagiarios = Estagiario.new(params[:estagiario])\n\n respond_to do |format|\n if @estagiarios.save\n flash[:notice] = 'ESTAGIÁRIO CADASTRADO COM SUCESSO.'\n format.html { redirect_to(@estagiarios) }\n format.xml { render :xml => @estagiarios, :status => :created, :location => @estagiarios }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @estagiarios.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def send_request( xml )\n write( xml )\n read\n end",
"def create\n @ntransaction = Ntransaction.new(ntransaction_params)\n\n respond_to do |format|\n if @ntransaction.save\n format.html { redirect_to @ntransaction, notice: 'Ntransaction was successfully created.' }\n format.json { render :show, status: :created, location: @ntransaction }\n else\n format.html { render :new }\n format.json { render json: @ntransaction.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @tipo_lancamento = TipoLancamento.new(params[:tipo_lancamento])\n\n respond_to do |format|\n if @tipo_lancamento.save\n flash[:notice] = 'TipoLancamento was successfully created.'\n format.html { redirect_to(tipo_lancamentos_path) }\n format.xml { render :xml => @tipo_lancamento, :status => :created, :location => @tipo_lancamento }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @tipo_lancamento.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n n = Node.create! params\n render api_show :node, Node, n.id.to_s, nil, n\n end",
"def create\n puts \"CREATE!!!!!!!!!!!!!!!!!11\"\n puts \"params[:s]: #{params[:s]}\"\n @segnalazione = Segnalazione.new(params[:segnalazione])\n\n respond_to do |format|\n if @segnalazione.save\n format.html { redirect_to(@segnalazione, :notice => 'Segnalazione inserita con successo.') }\n format.xml { render :xml => @segnalazione, :status => :created, :location => @segnalazione }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @segnalazione.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @studnet = Studnet.new(studnet_params)\n\n respond_to do |format|\n if @studnet.save\n format.html { redirect_to @studnet, notice: 'Studnet was successfully created.' }\n format.json { render :show, status: :created, location: @studnet }\n else\n format.html { render :new }\n format.json { render json: @studnet.errors, status: :unprocessable_entity }\n end\n end\n end"
] | [
"0.6355915",
"0.58120847",
"0.5717723",
"0.56872594",
"0.56658995",
"0.5664846",
"0.5642912",
"0.5571463",
"0.5539087",
"0.5535714",
"0.55220515",
"0.5521727",
"0.5511493",
"0.54980856",
"0.5478035",
"0.54765356",
"0.5456686",
"0.5408036",
"0.53966355",
"0.53667223",
"0.53656274",
"0.5360422",
"0.53413385",
"0.5318578",
"0.5316501",
"0.53065115",
"0.52943784",
"0.5292632",
"0.5282157",
"0.5261099",
"0.5260606",
"0.52605426",
"0.5258109",
"0.52577066",
"0.5246774",
"0.5242421",
"0.5236269",
"0.5215789",
"0.5212916",
"0.5207493",
"0.5205215",
"0.52050066",
"0.5198165",
"0.5198011",
"0.51966554",
"0.51850003",
"0.5172104",
"0.5137652",
"0.51263165",
"0.5120743",
"0.51144266",
"0.51117325",
"0.5108175",
"0.5108026",
"0.5106686",
"0.50985265",
"0.50589097",
"0.50524795",
"0.5047709",
"0.5046999",
"0.5043889",
"0.50429153",
"0.50357497",
"0.50328016",
"0.50262576",
"0.50259835",
"0.5024397",
"0.50141525",
"0.5011524",
"0.5009319",
"0.5003555",
"0.49973163",
"0.49919164",
"0.49898845",
"0.49895355",
"0.49884674",
"0.49843132",
"0.49794447",
"0.4979314",
"0.4978678",
"0.49766096",
"0.49757224",
"0.49715284",
"0.49678907",
"0.49578723",
"0.49538586",
"0.49503472",
"0.49498928",
"0.494969",
"0.49496052",
"0.49494553",
"0.4948202",
"0.49425977",
"0.4940495",
"0.49391145",
"0.49343598",
"0.49341425",
"0.4932248",
"0.49275964",
"0.49247652"
] | 0.69210804 | 0 |
PUT /nostros/1 PUT /nostros/1.xml | def update
@nostro = Nostro.find(params[:id])
respond_to do |format|
if @nostro.update_attributes(params[:nostro])
flash[:notice] = 'Nostro was successfully updated.'
format.html { redirect_to(@nostro) }
format.xml { head :ok }
else
format.html { render :action => "edit" }
format.xml { render :xml => @nostro.errors, :status => :unprocessable_entity }
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update opts = {}\n opts[:headers] ||= {}\n opts[:headers]['Content-Type'] ||= 'text/xml'\n post 'update', opts\n end",
"def put(uri, xml)\r\n req = Net::HTTP::Put.new(uri)\r\n req[\"content-type\"] = \"application/xml\"\r\n req.body = xml\r\n request(req)\r\n end",
"def update\n @nossos_servico = NossosServico.find(params[:id])\n\n respond_to do |format|\n if @nossos_servico.update_attributes(params[:nossos_servico])\n format.html { redirect_to(@nossos_servico, :notice => 'Nossos servico was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @nossos_servico.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def rest_update(uri, method: Net::HTTP::Put)\n request = Net::HTTP::Get.new uri\n request.add_field(\"Accept\",\"application/xml\")\n auth_admin(request)\n \n Net::HTTP.start(uri.host, uri.port) do |http|\n response = http.request request\n response.value\n\n doc = REXML::Document.new response.body\n \n doc = strip_class_attributes(yield doc)\n \n request2 = method.new uri\n request2.content_type = 'application/xml'\n auth_admin(request2)\n\n request2.body=doc.to_s\n \n response2 = http.request request2\n response.value\n\n end\n \nend",
"def test_put_invoices_1_xml\n @parameters = {:invoice => {:number => 'NewNumber'}}\n \n Redmine::ApiTest::Base.should_allow_api_authentication(:put,\n '/invoices/1.xml',\n {:invoice => {:number => 'NewNumber'}},\n {:success_code => :ok})\n \n assert_no_difference('Invoice.count') do\n put '/invoices/1.xml', @parameters, credentials('admin')\n end\n \n invoice = Invoice.find(1)\n assert_equal \"NewNumber\", invoice.number\n \n end",
"def put!\n request! :put\n end",
"def put(*args)\n request :put, *args\n end",
"def update\n @node = Node.scopied.find(params[:id])\n\n respond_to do |format|\n if @node.update_attributes(params[:node])\n format.html { redirect_to(@node, :notice => 'Node was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @node.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update(id, name= \"Updated Name\")\n xml_req =\n \"<?xml version='1.0' encoding='UTF-8'?>\n <customer>\n <id type='integer'>#{id}</id>\n <name>#{name}</name>\n </customer>\"\n\n request = Net::HTTP::Put.new(\"#{@url}/#{id}.xml\")\n request.add_field \"Content-Type\", \"application/xml\"\n request.body = xml_req\n\n http = Net::HTTP.new(@uri.host, @uri.port)\n response = http.request(request)\n\n # no response body will be returned\n case response\n when Net::HTTPSuccess\n return \"#{response.code} OK\"\n else\n return \"#{response.code} ERROR\"\n end\n end",
"def update(url, data)\n RestClient.put url, data, :content_type => :json\nend",
"def destroy\n @nostro = Nostro.find(params[:id])\n @nostro.destroy\n\n respond_to do |format|\n format.html { redirect_to(nostros_url) }\n format.xml { head :ok }\n end\n end",
"def update\n doc = Nokogiri::XML(request.body.read)\n cvNode = doc.xpath('elwak/checklisten_vorlage')\n\n update_params = {inaktiv: cvNode.xpath('inaktiv').text.to_s.to_bool}\n respond_to do |format|\n if @checklisten_vorlage.update(update_params)\n format.xml {render :xml => '<?xml version=\"1.0\" encoding=\"UTF-8\"?><success />'}\n else\n format.xml {render :xml => '<?xml version=\"1.0\" encoding=\"UTF-8\"?><error />'}\n end\n end\n end",
"def update\n @nano = Nano.find(params[:id])\n\n respond_to do |format|\n if @nano.update_attributes(params[:nano])\n flash[:notice] = 'Nano was successfully updated.'\n format.html { redirect_to nano_url(@nano) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @nano.errors.to_xml }\n end\n end\n end",
"def xml(id)\n http.get(\"/nfse/#{id}/xml\") do |response|\n response.headers.fetch(\"Location\") { \"\" }\n end\n end",
"def rm_update path, data, msg\n\n re = rm_request path, data, 'PUT'\n puts re.body\n chk (re.code!='200'), msg + \"\\n#{re.code} #{re.msg}\\n\\n\"\n return true\n\nend",
"def update(id, name=\"Updated Name\", age=\"55\")\r\n xml_req =\r\n \"<?xml version='1.0' encoding='UTF-8'?>\r\n <person>\r\n <id type='integer'>#{id}</id>\r\n <name>#{name}</name>\r\n <age>#{age}</age> \r\n </person>\"\r\n request = Net::HTTP::Put.new(\"#{@url}/#{id}.xml\")\r\n request.add_field \"Content-Type\", \"application/xml\"\r\n request.body = xml_req\r\n http = Net::HTTP.new(@uri.host, @uri.port)\r\n response = http.request(request)\r\n # no response body will be returned\r\n case response\r\n when Net::HTTPSuccess\r\n return \"#{response.code} OK\"\r\n else\r\n return \"#{response.code} ERROR\"\r\n end\r\n end",
"def put_datastream(pid, dsID, xml)\n uri = URI.parse(@fedora + '/objects/' + pid + '/datastreams/' + dsID ) \n RestClient.put(uri.to_s, xml, :content_type => \"application/xml\")\n rescue => e\n e.response \n end",
"def update\n @niveis_ensino = NiveisEnsino.find(params[:id])\n\n respond_to do |format|\n if @niveis_ensino.update_attributes(params[:niveis_ensino])\n format.html { redirect_to(@niveis_ensino, :notice => 'Niveis ensino atualizado com sucesso.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @niveis_ensino.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @nossos_servico = NossosServico.new(params[:nossos_servico])\n\n respond_to do |format|\n if @nossos_servico.save\n format.html { redirect_to(@nossos_servico, :notice => 'Nossos servico was successfully created.') }\n format.xml { render :xml => @nossos_servico, :status => :created, :location => @nossos_servico }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @nossos_servico.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @node = Node.find(params[:id])\n @title = \"Taxonomy node - organism relationships\"\n\n respond_to do |format|\n if @node.update_attributes(params[:node])\n format.html { redirect_to(@node, :notice => 'Node was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @node.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @domino = Domino.find(params[:id])\n\n respond_to do |format|\n if @domino.update_attributes(params[:domino])\n flash[:notice] = 'Domino was successfully updated.'\n format.html { redirect_to(@domino) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @domino.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def destroy\n @nossos_servico = NossosServico.find(params[:id])\n @nossos_servico.destroy\n\n respond_to do |format|\n format.html { redirect_to(nossos_servicos_url) }\n format.xml { head :ok }\n end\n end",
"def override\n document_id = params[:document_id]\n document = params[:document]\n document_type = params[:document_type]\n ticket = Document.ticket(Alfresco::Document::ALFRESCO_USER, Alfresco::Document::ALFRESCO_PASSWORD)\n\n builder = Nokogiri::XML::Builder.new(:encoding => 'UTF-8') do |xml|\n xml.entry(:xmlns => \"http://www.w3.org/2005/Atom\",\n \"xmlns:cmisra\" => \"http://docs.oasis-open.org/ns/cmis/restatom/200908/\",\n \"xmlns:cmis\" => \"http://docs.oasis-open.org/ns/cmis/core/200908/\") {\n xml.title document.original_filename if document\n xml.summary document_type\n if document\n xml.content(:type => document.content_type) {\n xml.text Base64.encode64(document.read)\n }\n end\n }\n end\n\n url = Document::PATH + \"cmis/i/#{document_id}?alf_ticket=\" + ticket\n\n begin\n RestClient.put url, builder.to_xml, {:content_type => 'application/atom+xml;type=entry'}\n rescue => e\n Rails.logger.info \"#\"*50\n Rails.logger.info \"Error updating file\"\n Rails.logger.info e.message\n Rails.logger.info \"#\"*50\n end\n\n redirect_to :controller => 'related_service_requests', :action => 'show', :anchor => 'documents', :service_request_id => params[:friendly_id], :id => params[:ssr_id]\n end",
"def create\n @nostro = Nostro.new(params[:nostro])\n\n respond_to do |format|\n if @nostro.save\n flash[:notice] = 'Nostro was successfully created.'\n format.html { redirect_to(@nostro) }\n format.xml { render :xml => @nostro, :status => :created, :location => @nostro }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @nostro.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @tiposproceso = Tiposproceso.find(params[:id])\n\n respond_to do |format|\n if @tiposproceso.update_attributes(params[:tiposproceso])\n format.html { redirect_to(@tiposproceso, :notice => 'Tiposproceso was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @tiposproceso.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @sinistro.update(sinistro_params)\n format.html { redirect_to @sinistro, notice: 'Sinistro was successfully updated.' }\n format.json { render :show, status: :ok, location: @sinistro }\n else\n format.html { render :edit }\n format.json { render json: @sinistro.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @node = Node.find(params[:id])\n\n respond_to do |format|\n if @node.update_attributes(params[:node])\n format.html { redirect_to(@node, :notice => 'Node was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @node.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @tservicio = Tservicio.find(params[:id])\n\n respond_to do |format|\n if @tservicio.update_attributes(params[:tservicio])\n format.html { redirect_to(@tservicio, :notice => 'Tservicio was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @tservicio.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @voluntario = Voluntario.find(params[:id])\n params[:voluntario].delete :inclusoes\n\n respond_to do |format|\n if @voluntario.update_attributes(params[:voluntario])\n format.html { redirect_to(@voluntario, :notice => 'Voluntário atualizado com sucesso.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @voluntario.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @node = Node.find(params[:id])\n\n respond_to do |format|\n if @node.update_attributes(params[:node])\n format.html { redirect_to(@node, :notice => 'Node was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @node.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def put(*args)\n request(:put, *args)\n end",
"def update\n @suministro = Suministro.find(params[:id])\n\n respond_to do |format|\n if @suministro.update_attributes(params[:suministro])\n format.html { redirect_to(@suministro, :notice => 'Suministro was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @suministro.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @noto = Noto.find(params[:id])\n\n respond_to do |format|\n if @noto.update_attributes(params[:noto])\n format.html { redirect_to @noto, :notice => 'Noto was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @noto.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @node = Node.find(params[:id])\n\n respond_to do |format|\n if @node.update_attributes(params[:node])\n flash[:notice] = 'Node was successfully updated.'\n format.html { redirect_to(@node) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @node.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update_xml\n self.xml= dumpRouteAsXml\n self.save\n end",
"def update\n @torneo = Torneo.find(params[:id])\n\n respond_to do |format|\n if @torneo.update_attributes(params[:torneo])\n format.html { redirect_to @torneo, notice: 'Torneo was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @torneo.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @sivic_discipulo.update(sivic_discipulo_params_netested)\n format.html { redirect_to @sivic_discipulo, notice: 'Registro alterado com sucesso.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @sivic_discipulo.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @socio = Socio.find(params[:id])\n\n respond_to do |format|\n if @socio.update_attributes(params[:socio])\n format.html { redirect_to @socio, :notice => 'Socio atualizado com sucesso.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @socio.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @novidade = Novidade.find(params[:id])\n\n respond_to do |format|\n if @novidade.update_attributes(params[:novidade])\n flash[:notice] = 'Novidade was successfully updated.'\n format.html { redirect_to(@novidade) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @novidade.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create_update_volumes(username, token, workset_name, volume_ids)\n\n #<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n #<volumes xmlns=\"http://registry.htrc.i3.illinois.edu/entities/workset\">\n # <volume>\n # <id>9999999</id>\n # </volume>\n # <volume>\n # <id>3333333</id>\n # </volume>\n # </volumes>\n volumes_xml =\n \"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"yes\\\"?>\" +\n \"<volumes xmlns=\\\"http://registry.htrc.i3.illinois.edu/entities/workset\\\">\";\n\n for id in volume_ids\n volumes_xml += \"<volume><id>#{id}</id></volume>\"\n end\n volumes_xml += \"</volumes>\"\n\n\n # curl -v --data @new_volumes.xml -X PUT \\\n # -H \"Content-Type: application/vnd.htrc-volume+xml\" \\\n # -H \"Accept: application/vnd.htrc-volume+xml\" \\\n # http://localhost:9763/ExtensionAPI-0.1.0/services/worksets/workset1/volumes?user=fred\n\n url = URI.parse(\"#{APP_CONFIG['registry_url']}/worksets/#{workset_name}\")\n http = Net::HTTP.new(url.host, url.port)\n if Rails.env.development?\n http.set_debug_output($stdout)\n end\n http.use_ssl = true\n http.verify_mode = OpenSSL::SSL::VERIFY_NONE\n\n request = Net::HTTP::Put.new(url.path)\n request[\"Content-Type\"] = \"application/vnd.htrc-volume+xml\"\n request.add_field(\"Authorization\", \"Bearer #{token}\")\n\n request.body = volumes_xml\n response = http.request(request)\n\n #xml = response.body\n\n case response\n when Net::HTTPUnauthorized then\n raise Exceptions::SessionExpiredError.new(\"Session expired. Please login again\")\n when Net::HTTPSuccess then\n # Do nothing\n else\n raise Exceptions::SystemError.new(\"Error retrieving worksets (HTTP #{response.code})\")\n end\n end",
"def update\n @estagio = Estagio.find(params[:id])\n\n respond_to do |format|\n if @estagio.update_attributes(params[:estagio])\n flash[:notice] = 'Estagio was successfully updated.'\n format.html { redirect_to(@estagio) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @estagio.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @node_rack = @object\n\n respond_to do |format|\n if @node_rack.update_attributes(params[:node_rack])\n flash[:notice] = 'NodeRack was successfully updated.'\n format.html { redirect_to node_rack_url(@node_rack) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @node_rack.errors.to_xml, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @centro = Centro.find(params[:id])\n\n respond_to do |format|\n if @centro.update_attributes(params[:centro])\n format.html { redirect_to(@centro, :notice => 'Centro atualizado com sucesso.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @centro.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def put(uri, doc = nil, options = {})\n execute(uri, :put, options, doc)\n end",
"def set_node\n params[:id] = params[:id] + '/' if (params[:id] == 'rest')\n @node = Fedora.rest(params[:id])\n end",
"def update_volumes(username, token, workset_name, volume_ids)\n\n #<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n #<volumes xmlns=\"http://registry.htrc.i3.illinois.edu/entities/workset\">\n # <volume>\n # <id>9999999</id>\n # </volume>\n # <volume>\n # <id>3333333</id>\n # </volume>\n # </volumes>\n volumes_xml =\n \"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"yes\\\"?>\" +\n \"<volumes xmlns=\\\"http://registry.htrc.i3.illinois.edu/entities/workset\\\">\";\n\n for id in volume_ids\n volumes_xml += \"<volume><id>#{id}</id></volume>\"\n end\n volumes_xml += \"</volumes>\"\n\n\n # curl -v --data @new_volumes.xml -X PUT \\\n # -H \"Content-Type: application/vnd.htrc-volume+xml\" \\\n # -H \"Accept: application/vnd.htrc-volume+xml\" \\\n # http://localhost:9763/ExtensionAPI-0.1.0/services/worksets/workset1/volumes?user=fred\n\n url = URI.parse(\"#{APP_CONFIG['registry_url']}/worksets/#{workset_name}/volumes\")\n http = Net::HTTP.new(url.host, url.port)\n if Rails.env.development?\n http.set_debug_output($stdout)\n end\n http.use_ssl = true\n http.verify_mode = OpenSSL::SSL::VERIFY_NONE\n\n request = Net::HTTP::Put.new(url.request_uri)\n request[\"Content-Type\"] = \"application/vnd.htrc-volume+xml\"\n request.add_field(\"Authorization\", \"Bearer #{token}\")\n\n request.body = volumes_xml\n response = http.request(request)\n\n #xml = response.body\n\n case response\n when Net::HTTPUnauthorized then\n raise Exceptions::SessionExpiredError.new(\"Session expired. Please login again\")\n when Net::HTTPSuccess then\n # Do nothing\n else\n raise Exceptions::SystemError.new(\"Error retrieving worksets (HTTP #{response.code})\")\n end\n\n end",
"def destroy\n RestClient.delete \"#{REST_API_URI}/contents/#{id}.xml\" \n self\n end",
"def update\n @serie = Serie.find(params[:id])\n\n respond_to do |format|\n if @serie.update_attributes(params[:serie])\n format.html { redirect_to(niveis_ensino_serie_url(@nivel,@serie), :notice => 'Serie atualizado com sucesso.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @serie.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @solexame.update(solexame_params)\n flash[:notice] = 'Solicitação foi alterada com sucesso.'\n format.html { redirect_to(@solexame) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @solexame.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def test_put_expenses_1_xml\n @parameters = {:expense => {:description => 'NewDescription'}}\n if ActiveRecord::VERSION::MAJOR < 4\n Redmine::ApiTest::Base.should_allow_api_authentication(:put,\n '/expenses/1.xml',\n {:expense => {:description => 'NewDescription'}},\n {:success_code => :ok})\n end\n\n assert_no_difference('Expense.count') do\n put '/expenses/1.xml', @parameters, credentials('admin')\n end\n\n expense = Expense.find(1)\n assert_equal \"NewDescription\", expense.description\n end",
"def update\n respond_to do |format|\n name = Server.find(params[:id]).name\n n = Neography::Node.find('servers', 'name', name)\n n.name = server_params[:name]\n n.add_to_index('servers', 'name', server_params[:name]) #TODO: is this necessary?\n if @server.update(server_params)\n format.html { redirect_to @server, notice: 'Server was successfully updated.' }\n format.json { render :show, status: :ok, location: @server }\n else\n format.html { render :edit }\n format.json { render json: @server.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n format.xml { head :method_not_allowed }\n format.json { head :method_not_allowed }\n end\n end",
"def put(path, parameters = {})\n request(:put, path, parameters)\n end",
"def update\n doc = Nokogiri::XML(request.body.read)\n bNode = doc.xpath('elwak/benutzer')\n\n @benutzer = Benutzer.find(params[:id])\n \n #Sicherstellen, dass Benutzer synchronisiert wird auch wenn nur Objekt-Zuordnungen anders sind!\n @benutzer.updated_at = DateTime.now \n\n if bNode.xpath('objekt_zuordnungs').length > 0\n @benutzer.setze_objekt_zuordnungen(bNode.xpath('objekt_zuordnungs/objekt_id').map{|oz| oz.text.to_s.to_i})\n end\n if @benutzer.update(benutzer_params(bNode))\n success(nil)\n else\n error(@benutzer.errors)\n end\n end",
"def update\n @documentotipo = Documentotipo.find(params[:id])\n\n respond_to do |format|\n if @documentotipo.update_attributes(params[:documentotipo])\n format.html { redirect_to @documentotipo, notice: 'Documentotipo was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @documentotipo.errors, status: :unprocessable_entity }\n end\n end\n end",
"def show\n @nossos_servico = NossosServico.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @nossos_servico }\n end\n end",
"def put(path, params={})\n RestClient.put request_base+path, params\n end",
"def update\n @safra_verdoso = SafraVerdoso.find(params[:id])\n\n respond_to do |format|\n if @safra_verdoso.update_attributes(params[:safra_verdoso])\n format.html { redirect_to \"/safra_produtos/#{@safra_verdoso.safra_produto_id}/descontos\"}\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @safra_verdoso.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @node = Node.find(params[:id])\n\n respond_to do |format|\n if @node.update_attributes(params[:node])\n format.html { redirect_to @node, notice: 'Встречная продажа обновлена' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @node.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @tipo_negocio = TipoNegocio.find(params[:id])\n\n respond_to do |format|\n if @tipo_negocio.update_attributes(params[:tipo_negocio])\n format.html { redirect_to @tipo_negocio, notice: 'Tipo negocio was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @tipo_negocio.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @torneo.update(torneo_params)\n format.html { redirect_to @torneo, notice: 'Torneo fue editado exitosamente.' }\n format.json { render :show, status: :ok, location: @torneo }\n else\n format.html { render :edit }\n format.json { render json: @torneo.errors, status: :unprocessable_entity }\n end\n end\n end",
"def put(path, params = {})\n request(:put, path, params)\n end",
"def put(path, params = {})\n request(:put, path, params)\n end",
"def put(path, params = {})\n request(:put, path, params)\n end",
"def update\n @trnodo = Trnodo.find(params[:id])\n\n respond_to do |format|\n if @trnodo.update_attributes(params[:trnodo])\n format.html { redirect_to @trnodo, notice: 'Trnodo was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @trnodo.errors, status: :unprocessable_entity }\n end\n end\n end",
"def put(uri, parameters)\n response = Unirest.put uri, parameters: parameters\n response.body\n end",
"def update\n @estagiarios = Estagiario.find(params[:id])\n\n respond_to do |format|\n if @estagiarios.update_attributes(params[:estagiario])\n flash[:notice] = 'ESTAGIÁRIO SALVO COM SUCESSO.'\n format.html { redirect_to(@estagiarios) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @estagiarios.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n params.permit!\n @silo = Silo.find(params[:id])\n\n respond_to do |format|\n if @silo.update_attributes(params[:silo])\n format.html { redirect_to(@silo, :notice => 'Silo was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @silo.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @recursorevision = @solicitud.recursosrevision.find(params[:id])\n\n respond_to do |format|\n if @recursorevision.update_attributes(params[:recursorevision])\n format.html { redirect_to([@solicitud,@recursorevision], :notice => 'Recurso revisión actualizado con exito.') }\n format.xml { head :ok }\n else \n format.html { render :action => \"edit\" }\n format.xml { render :xml => @recursorevision.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @servicio = Servicio.find(params[:id])\n\n respond_to do |format|\n if @servicio.update_attributes(params[:servicio])\n format.html { redirect_to @servicio, :notice => 'Servicio was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @servicio.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @csosn = Csosn.find(params[:id])\n\n respond_to do |format|\n if @csosn.update_attributes(params[:csosn])\n format.html { redirect_to @csosn, notice: 'Csosn was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @csosn.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @negocio.update(negocio_params)\n format.html { redirect_to @negocio, notice: 'Negocio was successfully updated.' }\n format.json { render :show, status: :ok, location:@negocio}\n else\n format.html { render :edit }\n format.json { render json: @negocio.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @node_config = NodeConfig.find(params[:id])\n\n respond_to do |format|\n if @node_config.update_attributes(params[:node_config])\n format.html { redirect_to(@node_config, :notice => 'NodeConfig was successfully updated.') }\n format.json { render :json => @node_config, :status => :ok }\n format.xml { render :xml => @node_config, :status => :ok }\n else\n format.xml { render :xml => @node_config.errors, :status => :unprocessable_entity }\n format.any { render :json => @node_config.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @tipo_de_documento = TipoDeDocumento.find(params[:id])\n\n respond_to do |format|\n if @tipo_de_documento.update_attributes(params[:tipo_de_documento])\n format.html { redirect_to(@tipo_de_documento, :notice => 'Tipo de documento atualizado com sucesso.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @tipo_de_documento.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @nodo.update(nodo_params)\n #format.html { redirect_to @nodo, notice: 'Nodo was successfully updated.' }\n #format.json { head :no_content }\n format.html { redirect_to nodos_url+'?lat=' + @nodo.lat + '&lng=' + @nodo.lng }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @nodo.errors, status: :unprocessable_entity }\n end\n end\n end",
"def put(uri, params = {})\n send_request(uri, :put, params)\n end",
"def update_tenant_circle(args = {}) \n put(\"/tenantcircles.json/#{args[:circleId]}\", args)\nend",
"def put(*args)\n prepare_request(:put, args)\n @@client.add(:put, @path, *args)\n end",
"def update\n @segmento = Segmento.find(params[:id])\n\n respond_to do |format|\n if @segmento.update_attributes(params[:segmento])\n flash[:notice] = 'Segmento was successfully updated.'\n format.html { redirect_to(@segmento) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @segmento.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @stanza = Stanza.find_by_no(params[:id])\n\n respond_to do |format|\n if @stanza.update_attributes(params[:stanza])\n format.html { redirect_to @stanza, notice: 'Stanza was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @stanza.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @socio = Socio.find(params[:id])\n\n respond_to do |format|\n if @socio.update_attributes(params[:socio])\n format.html { redirect_to @socio, notice: 'Socio was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @socio.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @srticle.update(srticle_params)\n format.html { redirect_to @srticle, notice: 'Srticle was successfully updated.' }\n format.json { render :show, status: :ok, location: @srticle }\n else\n format.html { render :edit }\n format.json { render json: @srticle.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update options={}\n client.put(\"/#{id}\", options)\n end",
"def update\n @omatsuri = Omatsuri.find(params[:id])\n\n respond_to do |format|\n if @omatsuri.update_attributes(params[:omatsuri])\n flash[:notice] = 'Omatsuri was successfully updated.'\n format.html { redirect_to(@omatsuri) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @omatsuri.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 put(path, params={})\n request(:put, path, params)\n end",
"def put(path, params={})\n request(:put, path, params)\n end",
"def put(path, params={})\n request(:put, path, params)\n end",
"def put(path, params={})\n request(:put, path, params)\n end",
"def put(path, params={})\n request(:put, path, params)\n end",
"def put(path, params={})\n request(:put, path, params)\n end",
"def put(path, params={})\n request(:put, path, params)\n end",
"def put(path, params={})\n request(:put, path, params)\n end",
"def update\n respond_to do |format|\n if @rubro.update_attributes(params[:rubro])\n format.html { redirect_to(@rubro, :notice => \"Se actualizó el rubro #{@rubro.nombre}.\") }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @rubro.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @nineteen.update(nineteen_params)\n format.html { redirect_to @nineteen, notice: 'Nineteen was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @nineteen.errors, status: :unprocessable_entity }\n end\n end\n end",
"def put(path, doc = nil, options = {})\n execute('PUT', path, options, doc)\n end",
"def put(path = '/files/', params = {})\n request :put, path, params\n end",
"def update\n respond_to do |format|\n if @socio_serasa.update(socio_serasa_params)\n format.html { redirect_to @socio_serasa, notice: 'Socio serasa was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @socio_serasa.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @livro = Livro.find(params[:id])\n respond_to do |format|\n if @livro.update_attributes(params[:livro])\n flash[:notice] = 'Livro was successfully updated.'\n format.html { redirect_to(@livro) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @livro.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @documentos_simposio.update(documentos_simposio_params)\n format.html { redirect_to @documentos_simposio, notice: 'Documentos simposio was successfully updated.' }\n format.json { render :show, status: :ok, location: @documentos_simposio }\n else\n format.html { render :edit }\n format.json { render json: @documentos_simposio.errors, status: :unprocessable_entity }\n end\n end\n end"
] | [
"0.6370278",
"0.63426214",
"0.6155868",
"0.61191624",
"0.57217777",
"0.5525689",
"0.5482707",
"0.5466387",
"0.54594505",
"0.54000205",
"0.53993857",
"0.5356155",
"0.5313663",
"0.53050476",
"0.5301918",
"0.5300883",
"0.52949166",
"0.52779555",
"0.52771497",
"0.52547383",
"0.5250507",
"0.52233213",
"0.52178645",
"0.52110195",
"0.52086025",
"0.52074695",
"0.5188225",
"0.51881766",
"0.518715",
"0.51869166",
"0.5183044",
"0.5182112",
"0.5175049",
"0.5171512",
"0.5165269",
"0.516038",
"0.51502043",
"0.51447386",
"0.5140252",
"0.51341695",
"0.51341665",
"0.5132676",
"0.51251763",
"0.5110081",
"0.5104019",
"0.5103983",
"0.50893325",
"0.50893295",
"0.5088059",
"0.5087217",
"0.5080732",
"0.50795305",
"0.50713056",
"0.50704443",
"0.5066665",
"0.5064303",
"0.5056855",
"0.50541425",
"0.5051622",
"0.50498825",
"0.50488514",
"0.50467384",
"0.50467384",
"0.50467384",
"0.5046566",
"0.504531",
"0.5042408",
"0.50424033",
"0.50377405",
"0.50367147",
"0.50345147",
"0.5033084",
"0.5032905",
"0.5031668",
"0.5030931",
"0.5022613",
"0.502143",
"0.50212806",
"0.50209355",
"0.5018942",
"0.5008238",
"0.5003129",
"0.50027716",
"0.5002182",
"0.50008863",
"0.500017",
"0.500017",
"0.500017",
"0.500017",
"0.500017",
"0.500017",
"0.500017",
"0.500017",
"0.49989894",
"0.49984208",
"0.4997262",
"0.4997191",
"0.49937752",
"0.49934897",
"0.49931908"
] | 0.631824 | 2 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.