query
stringlengths 7
9.55k
| document
stringlengths 10
363k
| metadata
dict | negatives
listlengths 0
101
| negative_scores
listlengths 0
101
| document_score
stringlengths 3
10
| document_rank
stringclasses 102
values |
|---|---|---|---|---|---|---|
Builds the audit configuration as a hash
|
def build
{ audit: @config }
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def build_config_audit(eh)\n if controller_name == \"ops\" && @sb[:active_tab] == \"settings_server\"\n server = MiqServer.find(@sb[:selected_server_id])\n message = \"Server [#{server.name}] (#{server.id}) in Zone [#{server.my_zone}] VMDB config updated\"\n else\n message = \"VMDB config updated\"\n end\n\n build_audit_payload(nil, eh[:new], eh[:current], \"vmdb_config_update\", message, \"\")\n end",
"def to_hash\n self.config.to_hash\n end",
"def to_hash\n configuration\n end",
"def config_hash\n digest = Digest::MD5.hexdigest(\n \"#{@x}-#{@y}-#{@hires_factor}-#{@render_type}-#{@format}-#{CONVERTER_VERSION}\")\n digest\n end",
"def to_h\n config\n end",
"def to_hash\n @configuration\n end",
"def to_hash\n @configuration\n end",
"def get_hash()\n\t\t\treturn @config.clone()\n\t\tend",
"def to_h\n @config\n end",
"def to_h\n @config\n end",
"def to_hash\n ChefConfig::Config.save(true)\n end",
"def build\n { logging: @config }\n end",
"def to_h\n @configuration\n end",
"def to_hash\n @configuration_data\n end",
"def config_to_hash\n data = {}\n Pkg::Params::BUILD_PARAMS.each do |param|\n data.store(param, self.instance_variable_get(\"@#{param}\"))\n end\n data.store(:platform_data, platform_data)\n data\n end",
"def audit\n conf['dashboard']['audit']\n end",
"def to_hash\n {\n \"deployment_id\" => deployment_id, \"created_at\" => created_at, \"hot_deploy\" => hot_deploy,\n \"force_clean_build\" => force_clean_build, \"ref\" => ref, \"sha1\" => sha1, \"artifact_url\" => artifact_url, \"activations\" => activations\n }\n end",
"def to_h\n to_config.merge(\n task_id: task_id,\n job_id: job_id\n )\n end",
"def configuration\n cfg = {}\n cfg[:author_avpair] = @author_avpair.name if (@author_avpair)\n cfg[:command_authorization_profile] = @command_authorization_profile.name if (@command_authorization_profile)\n cfg[:enable_acl] = @enable_acl.name if (@enable_acl)\n cfg[:login_acl] = @login_acl.name if (@login_acl)\n return(cfg)\n end",
"def configuration\n cfg = {}\n cfg[:author_avpair] = @author_avpair.name if (@author_avpair)\n cfg[:command_authorization_profile] = @command_authorization_profile.name if (@command_authorization_profile)\n cfg[:disabled] = self.disabled? if (self.disabled?)\n cfg[:enable_password] = @enable_password if (@enable_password)\n cfg[:enable_password_expires_on] = @enable_password_expires_on.to_s if (@enable_password_expires_on)\n cfg[:enable_password_lifespan] = @enable_password_lifespan if (@enable_password_lifespan != 0)\n cfg[:enable_acl] = @enable_acl.name if (@enable_acl)\n cfg[:encryption] = @encryption.to_s if (@encryption)\n cfg[:login_acl] = @login_acl.name if (@login_acl)\n cfg[:login_password] = @login_password if (@login_password)\n cfg[:login_password_expires_on] = @login_password_expires_on.to_s if (@login_password_expires_on)\n cfg[:login_password_lifespan] = @login_password_lifespan if (@login_password_lifespan != 0)\n cfg[:salt] = @salt if (@salt)\n cfg[:user_group] = @user_group.name if (@user_group)\n return(cfg)\n end",
"def to_config\n HashWithIndifferentAccess.new({\n type: self.class.to_s,\n config: self.config,\n prices: self.prices,\n source_type: self.source\n })\n end",
"def config\n @config = ActiveSupport::HashWithIndifferentAccess.new(@config) if @config.is_a? Hash\n @config\n end",
"def hash\n [application, authorized_entity, platform, attest_status, app_signer, connection_type, connect_date, rel].hash\n end",
"def build_logstash_configuration()\n logstash_configuration= LogStash::Outputs::MicrosoftSentinelOutputInternal::LogstashLoganalyticsOutputConfiguration::new(@client_app_Id, @client_app_secret, @tenant_id, @data_collection_endpoint, @dcr_immutable_id, @dcr_stream_name, @compress_data, @create_sample_file, @sample_file_path, @logger)\n logstash_configuration.key_names = @key_names\n logstash_configuration.plugin_flush_interval = @plugin_flush_interval\n logstash_configuration.decrease_factor = @decrease_factor\n logstash_configuration.amount_resizing = @amount_resizing\n logstash_configuration.max_items = @max_items\n logstash_configuration.proxy_aad = @proxy_aad || @proxy || ENV['http_proxy']\n logstash_configuration.proxy_endpoint = @proxy_endpoint || @proxy || ENV['http_proxy']\n logstash_configuration.retransmission_time = @retransmission_time\n \n return logstash_configuration\n end",
"def to_h!\n h = {}\n @schema.keys.each do |k|\n v = self[k]\n h[k] = Configuration.config?(v) ? v.to_h! : v.inspect\n end\n h\n end",
"def serialize_config\n final_conf = []\n config.each do |key, val|\n if val.respond_to?(:call)\n final_conf << Config.new(key, val.call)\n elsif val.is_a?(Array)\n final_conf += val.map { |v| Config.new(key, v) }\n\n # Hashes can have some inner nesting, but only to a certain point.\n elsif val.is_a?(Hash)\n val.each do |k, v|\n if v.is_a?(Array)\n final_conf += v.map { |e| Config.new(key, \"#{k}=#{e}\") }\n else\n final_conf << Config.new(key, \"#{k}=#{v}\")\n end\n end\n else\n final_conf << Config.new(key, val)\n end\n end\n final_conf\n end",
"def hash\n [audit, username, ereq_id, level, comp, error_code, s2comp, req_id, ent_id, security, subcomp].hash\n end",
"def type_to_form_ready_hash_logsettings\n {\n # settings: {\n logDir: resource[:logdir],\n logLevel: resource[:serverloglevel],\n maxLogFileAge: resource[:logmaxfileage],\n maxErrorReportsCount: resource[:logmaxerrorreports],\n # },\n }\n end",
"def configuration\n cfg = {}\n cfg[:acl] = @acl.name if (@acl)\n\n if (@command)\n cfg[:command] = @command.source\n else\n cfg[:shell_command_object_group] = @shell_command_object_group.name\n end\n return(cfg)\n end",
"def to_hash\n config = { database: database, hosts: hosts }\n if username && password\n config.merge!(username: username, password: password)\n end\n config\n end",
"def config_metadata\n Mash.new(\n encryption_format: config[:encryption_format],\n decryption_format: config[:decryption_format],\n encrypted_keys: encrypted_keys,\n encrypt: true,\n secret: secret\n )\n end",
"def hash\n [account_id, account_name, is_default, base_uri, organization].hash\n end",
"def config_hash\n certs_path = File.join(__dir__, '..', 'our_certs')\n\n { contract_id: '356936003', # from CP signed contract\n customer_id: 'L03051', # from CP signed contract\n certificate_path: File.join(certs_path, 'squared_VCA12032726_2022.pem'),\n private_key_password: File.read(File.join(certs_path, 'keypass.txt')),\n private_key_path: File.join(certs_path, 'squared_private_2022.key'),\n sending_post_office_code: 12_000 }\n end",
"def auditable_attributes\n @@auditable_attributes ||= {} \n @@auditable_attributes\n end",
"def to_h\n {}.tap do |result|\n self.class.each_attribute do |attribute|\n value = send(attribute.name)\n if value&.respond_to?(:to_h) && !value.is_a?(Array) && !value.is_a?(ConfigList)\n value = value.to_h\n elsif value&.respond_to?(:to_a)\n value = value.to_a\n end\n result[attribute.name.to_s] = value\n end\n end\n end",
"def to_rb\n configuration.map { |k,v| \"#{k}(#{v.inspect})\" }.join(\"\\n\")\n end",
"def configuration\n cfg = {:service => @service}\n cfg[:acl] = @acl.name if (@acl)\n cfg[:avpairs] = @avpairs if (@avpairs)\n cfg[:network_av] = @network_av.configuration if (@network_av)\n cfg[:shell_command_av] = @shell_command_av.configuration if (@shell_command_av)\n return(cfg)\n end",
"def build_event_hash\n\t\t@event_hash = {}\n\t\t\n\t\teach_event { |event| @event_hash[event.id] = event }\n\tend",
"def build_config\n file = [options[:config_file], DEFAULT_CONFIG_FILE_LOCATION].\n compact.find {|f| File.exists?(f) }\n\n hash =\n if file\n YAML.load_file(file).each do |key, value|\n stderr.puts(\"Warn: Unknown key in config file: #{key}\") unless\n self.class.configs.find {|opt| opt.first.to_s == key.to_s }\n end\n else\n {}\n end\n\n options[:config_option].map {|str| str.split('=') }.\n inject(hash) {|m, (k,v)| m.merge(k.to_sym => v) }\n end",
"def applied_config\n @applied_config ||= {}\n end",
"def configuration\n cfg = {}\n if (@command)\n cfg[:command] = @command.source\n else\n cfg[:shell_command_object_group] = @shell_command_object_group.name\n end\n\n cfg[:acl] = @acl.name if (@acl)\n return(cfg)\n end",
"def configuration\n cfg = {:default_policy => @default_policy.to_s, :disabled_prompt => @disabled_prompt, :delimiter => @delimiter, :ip => @ip,\n :log_accounting => @log_accounting, :log_authentication => @log_authentication, :log_authorization => @log_authorization,\n :log_level => @logger_level, :login_prompt => @login_prompt, :max_clients => @max_clients, :password_expired_prompt => @password_expired_prompt,\n :password_prompt => @password_prompt, :port => @port, :sock_timeout => @sock_timeout, :testing => @testing }\n cfg[:dump_file] = @dump_file if (@dump_file)\n cfg[:key] = @key if (@key)\n cfg[:logger] = @logger if (@logger)\n cfg[:name] = @name if (@name)\n return(cfg)\n end",
"def to_config\n {\n id: id,\n cron: cron,\n worker: worker,\n args: args,\n queue: queue\n }\n end",
"def to_hash\n config = { database: database, hosts: hosts }\n if username && password\n config.merge!(username: username, password: password)\n end\n config\n end",
"def config\n options.to_smash.deep_merge(opts.to_smash)\n end",
"def config\n options.to_smash.deep_merge(opts.to_smash)\n end",
"def hash\n [configured_alert_ids, created_at, creator, description, groups, id, modified_at, monitor_ids, monitor_tags, name, query, tags, target_threshold, thresholds, timeframe, type, warning_threshold].hash\n end",
"def to_h\n h = {\n :rev => rev,\n :log => message,\n :author => author,\n :timestamp => timestamp,\n :has_children? => has_children?,\n }\n h[:changed_paths] = changed_paths if changed_paths\n h\n end",
"def config_data\n {}\n end",
"def to_h\n infer_project_type\n {'job' => config}\n end",
"def hash\n [mean, median, count, high, low, std_dev, revisions_upward, revisions_downward, mean_7_days_ago, mean_30_days_ago, mean_60_days_ago, mean_90_days_ago, revisions_upward_last_7_days, revisions_downward_last_7_days, revisions_upward_last_30_days, revisions_downward_last_30_days, revisions_upward_last_60_days, revisions_downward_last_60_days, revisions_upward_last_90_days, revisions_downward_last_90_days, revisions_upward_last_120_days, revisions_downward_last_120_days, revisions_upward_last_150_days, revisions_downward_last_150_days, security].hash\n end",
"def hash\n [admin, created_at, customer_id, description, event_type, ip, metadata, service_id, user_id, token_id].hash\n end",
"def to_hash\n @scoped_config\n end",
"def hash\n [action, attachments, attendees, description, duration, repeat, summary, trigger].hash\n end",
"def chronomodel_configuration\n @chronomodel_configuration ||=\n if defined?(@configuration_hash)\n @configuration_hash\n else\n configuration.with_indifferent_access\n end\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 build_saved_audit(rec, eh)\n build_audit_payload(rec, eh[:new], eh[:current], \"#{rec.class.to_s.downcase}_record_update\", \"Record updated\")\n end",
"def hash\n \"#{self.class.name}-#{self.id}-#{@__metadata__.cas}-#{@__attributes__.hash}\".hash\n end",
"def report\n audit_store.to_h\n end",
"def audit=(value)\n conf['dashboard']['audit'] = value\n end",
"def otm_config_hash\n if @otm_confile_file_hash.nil?\n @otm_confile_file_hash = YAML.load(File.read(self.otm_config_file))\n end\n @otm_confile_file_hash \n end",
"def otm_config_hash\n if @otm_confile_file_hash.nil?\n @otm_confile_file_hash = YAML.load(File.read(self.otm_config_file))\n end\n @otm_confile_file_hash \n end",
"def to_h\n {\n status: @status,\n config: @config.to_h,\n timings: @timer.to_h,\n log: @logger.to_h,\n data_log: @data_log\n }\n end",
"def optionsHash(length = 12)\n # Don't want to always need this as this may be difficult to compile\n require 'sha3'\n\n # Get only hash relevant options\n # Filter out paths\n toHash = @Options.reject { |i| i =~ %r{.*/.*(/|$)}i }\n\n # Reject some known keys\n toHash.delete :epoch\n\n SHA3::Digest::SHA256.hexdigest(JSON.generate(toHash).to_s)[0..length - 1]\n end",
"def to_h\n {\n date_format: date_format,\n filters: filters.to_h,\n formatter: formatter,\n handlers: handlers,\n level: level,\n max_bytes: max_bytes,\n max_depth: max_depth,\n metadata: metadata,\n output: output,\n time_format: time_format,\n types: types\n }\n end",
"def job_hash\n [@image,@config].hash\n end",
"def job_hash\n [@image,@config].hash\n end",
"def create_hash\n require 'digest/md5'\n digest_string = [self.id, self.url, self.referrer, self.created_at].join(\"\")\n self.record_hash = Digest::MD5.hexdigest(digest_string)\n end",
"def to_s\n hashForOutput = {\n GAConfigurationScheme => @scheme,\n GAConfigurationWorkspace => @workspace,\n GAConfigurationTarget => @target,\n GAConfigurationSuffix => @suffix,\n GAConfigurationReporter => @reporter,\n GAConfigurationXctoolPath => @xctool_path,\n GAConfigurationProject => @project\n }\n \n return hashForOutput.to_s\n end",
"def set_audit_informations\n self.event_id = routing_key.split('.')[-3, 2].join(':')\n self.log_type = routing_key.split('.').slice(1, 2).join('.')\n self.routing_type = routing_key.split('.')[3]\n end",
"def hash\n [event_count, hour, index_id, index_name, org_name, public_id, retention].hash\n end",
"def configuration\n cfg = []\n @entries.each {|e| cfg.push(e.configuration)}\n return(cfg)\n end",
"def configuration\n cfg = []\n @entries.each {|e| cfg.push(e.configuration)}\n return(cfg)\n end",
"def configuration\n cfg = []\n @entries.each {|e| cfg.push(e.configuration)}\n return(cfg)\n end",
"def build_config\n return unless build?\n build_config_terraform\n end",
"def build\n { database: @config }\n end",
"def configuration_for_repository\n {\n \"name\" => self.configuration_name,\n \"namespace\" => self.configuration_namespace,\n \"methodConfigVersion\" => self.configuration_snapshot,\n \"methodRepoMethod\" => {\n \"methodName\" => self.name,\n \"methodNamespace\" => self.namespace,\n \"methodVersion\" => self.snapshot\n },\n \"inputs\" => self.repository_parameter_list(:inputs),\n \"outputs\" => self.repository_parameter_list(:outputs),\n \"prerequisites\" => {},\n \"rootEntityType\" => self.entity_type,\n \"deleted\" => false\n }\n end",
"def to_hash\n\t\t\trhash = {}\n\t\t\t@hash.each {|k,v|\n\t\t\t\tcase v\n\t\t\t\twhen ConfigStruct\n\t\t\t\t\trhash[k] = v.to_h\n\t\t\t\twhen NilClass, FalseClass, TrueClass, Numeric\n\t\t\t\t\t# No-op (can't dup)\n\t\t\t\t\trhash[k] = v\n\t\t\t\twhen Symbol\n\t\t\t\t\trhash[k] = v.to_s\n\t\t\t\telse\n\t\t\t\t\trhash[k] = v.dup\n\t\t\t\tend\n\t\t\t}\n\t\t\treturn rhash\n\t\tend",
"def to_hash\n result = super\n result[:source_type] = :git\n result[:location] = location\n result[:commitish_type] = commitish_type\n result[:commitish] = commitish\n result\n end",
"def hash\n [check_id, exceptions, key, links, port, proof, protocol, since, status].hash\n end",
"def hash\n [created, changed_by, updated, id, domain, action, organization_id, webhook_id, entity_id, destination_url, format, ack_enabled, entity, changes, last_send_attempt, next_send_attempt, final_send_attempt, total_send_attempts, state, acked].hash\n end",
"def hash\n [access_key_id, address, arn, aws_session_name, connection_type, event_source, exchange_server_hostname, exchange_user, folder_path, id, ldap_server, links, name, port, protocol, region, scan_engine_is_inside_aws, secret_access_key, status, username, win_rm_server].hash\n end",
"def generate_config(resource)\n resource = symbolize_hash(convert_to_hash(resource))\n config = []\n config << \"lxc.utsname = #{resource[:utsname]}\"\n if(resource[:aa_profile])\n config << \"lxc.aa_profile = #{resource[:aa_profile]}\"\n end\n [resource[:network]].flatten.each do |net_hash|\n nhsh = Mash.new(net_hash)\n flags = nhsh.delete(:flags)\n %w(type link).each do |k|\n config << \"lxc.network.#{k} = #{nhsh.delete(k)}\" if nhsh[k]\n end\n nhsh.each_pair do |k,v|\n config << \"lxc.network.#{k} = #{v}\"\n end\n if(flags)\n config << \"lxc.network.flags = #{flags}\"\n end\n end\n if(resource[:cap_drop])\n config << \"lxc.cap.drop = #{Array(resource[:cap_drop]).join(' ')}\"\n end\n %w(include pts tty arch devttydir mount mount_entry rootfs rootfs_mount pivotdir).each do |k|\n config << \"lxc.#{k.sub('_', '.')} = #{resource[k.to_sym]}\" if resource[k.to_sym]\n end\n prefix = 'lxc.cgroup'\n resource[:cgroup].each_pair do |key, value|\n if(value.is_a?(Array))\n value.each do |val|\n config << \"#{prefix}.#{key} = #{val}\"\n end\n else\n config << \"#{prefix}.#{key} = #{value}\"\n end\n end\n config.join(\"\\n\") + \"\\n\"\n end",
"def setup_with_audit!\n self.settings = audit_user.settings\n self.treatments = reified_actives_for(\"treatments\").map do |t|\n # uniq_name = \"treatment_#{t[\"name\"]}\"\n # quantity, unit = settings[\"#{uniq_name}_quantity\"], settings[\"#{uniq_name}_unit\"]\n\n {name: t[\"name\"], quantity: nil, unit: nil}\n end\n self.conditions = reified_actives_for(\"conditions\").map(&:name)\n self.catalogs = self.conditions.map { |c| CATALOG_CONDITIONS[c] }.compact\n\n save_without_processing\n self\n end",
"def to_audit_event\n {\n user_name: to_s,\n user_email: email\n }\n end",
"def to_hash\n index_hash = {}\n index_hash['json_claz'] = self.class.name\n index_hash['id'] = id\n index_hash['provided_by'] = provided_by\n index_hash['cattype'] = cattype\n index_hash['flavor'] = flavor\n index_hash['image'] = image\n index_hash['catorder'] = catorder\n index_hash['url'] = url\n index_hash['envs'] = envs\n index_hash['options'] = options\n index_hash['plans'] = plans\n index_hash['created_at'] = created_at\n index_hash['updated_at'] = updated_at\n index_hash['status'] = status\n index_hash['inputs'] = inputs\n index_hash['outputs'] = outputs\n index_hash['acl_policies'] = acl_policies\n index_hash[\"some_msg\"] = some_msg\n index_hash\n end",
"def build_hash data\n digest = OpenSSL::Digest::Digest.new('md5')\n OpenSSL::HMAC.hexdigest(digest, @project_secret, data)\n end",
"def to_hash\n {}.tap do |hash|\n hash[:requirement] = requirement\n hash[:used] = version_used\n hash[:latest] = latest\n hash[:status] = status\n hash[:changelog] = changelog\n end\n end",
"def to_jaxb_json_hash\n _h = super\n _h['cronExpression'] = cronExpression.to_jaxb_json_hash unless cronExpression.nil?\n _h['location'] = location.to_jaxb_json_hash unless location.nil?\n _h['releases'] = releases.to_jaxb_json_hash unless releases.nil?\n _h['snapshots'] = snapshots.to_jaxb_json_hash unless snapshots.nil?\n _h['blockRedeployments'] = blockRedeployments.to_jaxb_json_hash unless blockRedeployments.nil?\n _h['stagingRepository'] = stagingRepository.to_jaxb_json_hash unless stagingRepository.nil?\n _h['scanned'] = scanned.to_jaxb_json_hash unless scanned.nil?\n _h['daysOlder'] = daysOlder.to_jaxb_json_hash unless daysOlder.nil?\n _h['retentionCount'] = retentionCount.to_jaxb_json_hash unless retentionCount.nil?\n _h['deleteReleasedSnapshots'] = deleteReleasedSnapshots.to_jaxb_json_hash unless deleteReleasedSnapshots.nil?\n _h['stageRepoNeeded'] = stageRepoNeeded.to_jaxb_json_hash unless stageRepoNeeded.nil?\n _h['resetStats'] = resetStats.to_jaxb_json_hash unless resetStats.nil?\n _h['skipPackedIndexCreation'] = skipPackedIndexCreation.to_jaxb_json_hash unless skipPackedIndexCreation.nil?\n return _h\n end",
"def config\n @config ||= {}\n end",
"def config\n @config ||= {}\n end",
"def to_h\n res = {\n email: email,\n api_key: api_key,\n org_id: org_id,\n mkp_name: mkp_name,\n version: version,\n assemblyname: assemblyname,\n componentname: componentname,\n domain: domain,\n region: region,\n resource: resource,\n storage_hddtype: storage_hddtype,\n oneclick: oneclick,\n ipv4private: ipv4private,\n ipv4public: ipv4public,\n ipv6private: ipv6private,\n ipv6public: ipv6public,\n sshkey: keypairname,\n keypairoption: keypairoption,\n cattype: cattype,\n cpu: @flavor.cpu,\n ram: @flavor.ram,\n hdd: @flavor.hdd,\n options: options,\n envs: envs,\n provider: provider\n }\n\n set_git(res)\n res\n end",
"def hash\n [format, display_header, display_from_email_address, display_email_address, display_to_email_address, display_cc_email_address, display_bcc_email_address, time_zone_offset, convert_attachments, field_labels, preserve_original_date].hash\n end",
"def to_hash\n @to_hash ||= Util::NonNilHashBuilder.build do |h|\n h.add(:application, application)\n h.add(:class_name, class_name)\n h.add(:file, file)\n h.add(:function, function)\n h.add(:line, line)\n h.add(:module_name, module_name)\n h.add(:vm_pid, vm_pid)\n end\n end",
"def attributes\n self.class.config.full_config.map { |attribute| [attribute, send(attribute)] }.to_h\n end",
"def audit options={}\n # Loop through each org at a time\n Organization.all.each do |org|\n # Only process operational assets\n write_to_activity_log org, \"Performing #{context.name} on asset inventory\"\n all_assets = Rails.application.config.asset_base_class_name.constantize.operational\n\n if Rails.application.config.try(:asset_auditor_config).present?\n all_assets = Rails.application.config.asset_auditor_config[:class_name].constantize.operational.where(Rails.application.config.asset_auditor_config[:query])\n else\n all_assets = Rails.application.config.asset_base_class_name.constantize.operational\n end\n\n all_assets.where('transam_assets.in_service_date <= ?', context.end_date).where(:organization => org).pluck(:object_key).each do |obj_key|\n asset = Rails.application.config.asset_base_class_name.constantize.find_by(object_key: obj_key)\n update_status asset, context.start_date, context.end_date, context.filterable_class_name\n end\n end\n\n end",
"def config_body_for(config)\n res = <<-EOH.gsub(/^ +/, '')\n # This file is managed by Chef.\n # Any changes to it will be overwritten.\n EOH\n res << Hash[config.sort].map { |k, v| config_for(k, v) }.compact\n .join(\"\\n\")\n end",
"def config\n to_ret = as_json\n to_ret.delete('auto_publish')\n to_ret.delete('id')\n to_ret\n end",
"def config\n to_ret = as_json\n to_ret.delete('auto_publish')\n to_ret.delete('id')\n to_ret\n end",
"def create_version_hash\n new_version = {}\n new_version['created'] = ''\n new_version['message'] = ''\n new_version['user'] = {}\n # user is #name, # address.\n new_version['user']['name'] = ''\n new_version['user']['address'] = ''\n new_version['state'] = {}\n new_version\n end"
] |
[
"0.65356696",
"0.63442874",
"0.62737966",
"0.62154245",
"0.615035",
"0.6049359",
"0.6049359",
"0.6045917",
"0.600022",
"0.600022",
"0.5992351",
"0.5975883",
"0.5943585",
"0.58664787",
"0.58277136",
"0.5798916",
"0.576725",
"0.57396424",
"0.57336843",
"0.5659829",
"0.558553",
"0.55792207",
"0.55785733",
"0.55656654",
"0.55636626",
"0.55308163",
"0.5513524",
"0.5503841",
"0.54844934",
"0.5477183",
"0.5461063",
"0.54565465",
"0.54534376",
"0.5438793",
"0.5433",
"0.54269284",
"0.54096305",
"0.54064155",
"0.54040956",
"0.5403961",
"0.53764206",
"0.53631157",
"0.5355433",
"0.5344285",
"0.5340763",
"0.5340763",
"0.5328145",
"0.5322693",
"0.5313279",
"0.53021294",
"0.5291187",
"0.5289994",
"0.5287973",
"0.5277708",
"0.52775824",
"0.52727133",
"0.527006",
"0.5269981",
"0.5240338",
"0.5238002",
"0.5234923",
"0.5233748",
"0.5227975",
"0.5226051",
"0.52133596",
"0.52090544",
"0.52090544",
"0.5206907",
"0.52058357",
"0.5203953",
"0.52037287",
"0.51988244",
"0.51988244",
"0.51988244",
"0.5197431",
"0.5189572",
"0.51654804",
"0.5160475",
"0.51593566",
"0.5152904",
"0.51472366",
"0.51401144",
"0.51392",
"0.5135002",
"0.5125199",
"0.5123369",
"0.5122764",
"0.5108115",
"0.5106437",
"0.51052034",
"0.51052034",
"0.51049215",
"0.50909215",
"0.50859225",
"0.50700366",
"0.506649",
"0.50655746",
"0.50591695",
"0.50591695",
"0.5050012"
] |
0.8067966
|
0
|
Initializes a new parser instance with given log format.
|
def initialize(format)
@regexp = nil
@names = []
@format = parse_format(format)
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def initialize(log, time_format=\"%Y-%m-%d %H:%M:%S\")\n @log = log\n @time_format = time_format\n end",
"def initialize(format)\n @regexp = nil\n @names = []\n @format = parse_format(format)\n end",
"def initialize( logger, format=HTML_LOG_FORMAT ) # :notnew:\n\t\t\t@logger = logger\n\t\t\t@format = format\n\t\t\tsuper()\n\t\tend",
"def initialize(log, options = {})\n @options = DEFAULT_OPTIONS.dup.merge options\n\n if log.is_a? String\n # This means that the log is a path to the file. We'll try to open it.\n raise FileError unless @log = File.open(log, \"r\")\n else\n if log.respond_to?(:lines)\n @log = log\n else\n raise FileError\n end\n end\n end",
"def initialize( logger, format=DEFAULT_FORMAT, debug=DEFAULT_DEBUG_FORMAT ) # :notnew:\n\t\t\t@logger = logger\n\t\t\t@format = format\n\t\t\t@debug_format = debug\n\n\t\t\tsuper()\n\t\tend",
"def initialize(log)\n @log = log\n end",
"def initialize( logger, settings={} ) # :notnew:\n\t\t\tsettings = LEVEL_FORMATS.merge( settings )\n\n\t\t\t@logger = logger\n\t\t\t@settings = settings\n\n\t\t\tsuper()\n\t\tend",
"def initialize(format)\r\n if format =~ /[+-]?(\\d+(\\.\\d+)?)/\r\n @format = $PREMATCH + $POSTMATCH\r\n @parm_str = $MATCH\r\n\r\n if (@parm_str) =~ /\\./\r\n @parms = [$PREMATCH, $POSTMATCH]\r\n else\r\n @parms = [@parm_str]\r\n end\r\n\r\n else\r\n @format = format\r\n @parm_str = \"\"\r\n @parms = nil\r\n end\r\n end",
"def initialize(duration_string_chunk, format_chunk)\n @duration_string_chunk = duration_string_chunk\n @format_chunk = format_chunk\n parse\n end",
"def initialize(file_format)\n @lines = []\n @attributes = {}\n register_file_format(file_format)\n end",
"def parse(parser_options)\n if file_ext == '.log'\n log_reader = LogReader.new(@file_path, parser_options)\n log_reader.read\n else\n raise Parsento::ValidationError, \"Correct reader engine for selected #{file_ext} file was not found.\"\n end\n end",
"def initialize parser\n @parser = parser\n end",
"def initialize(file_path, log, debug=false)\n @config_file = file_path\n @parsed_hash = {}\n @log = log\n @debug = debug\n @errors_count = 0\n end",
"def initialize(logdev, opts = {})\n @level = opts[:level] || DEBUG\n @progname = opts[:progname]\n @default_formatter = Formatter.new\n @datetime_format = opts[:datetime_format]\n @formatter = opts[:formatter]\n @logdev = logdev ? LogDevice.new(logdev) : nil\n end",
"def initialize(logdev, shift_age=0, shift_size=0)\n @default_shift_age = shift_age\n @default_shift_size = shift_size\n target = ::Logger.new(logdev, shift_age, shift_size)\n target.formatter = DEFAULT_FORMATTER\n @targets = [target]\n end",
"def initialize(filename)\n @filename = filename\n # log_format: url(without spaces) followed by ip\n @log_format = /^(?<url>[^ ]+) (?<ip>\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3})$/\n @logs = []\n @logs_unique = nil\n end",
"def initialize(log_file, config)\n @log_file = log_file\n @config = config\n end",
"def initialize device = STDOUT, level = INFO\n self.level = level\n @logformat = '%d{%Y-%m-%d %H:%M:%S}%t%L%t%m %s %e'\n @placeholder = {\n 'n' => \"\\n\",\n 'p' => $$,\n 't' => \"\\t\",\n 'x' => File.basename($0),\n 'X' => File.expand_path($0)\n }\n\n @filename = nil\n if device.kind_of? IO then\n raise \"log destination already closed #{ device }\" if device.closed?\n @device = device\n @fileformat = nil\n else\n @device = nil\n @fileformat = device.to_s\n reopen\n end\n\n @sign = @mark = false\n end",
"def initialize(logger)\n @log = logger\n end",
"def initialize(token_match)\n pattern = token_match\n\n module_eval do\n define_method(:initialize) do |progress|\n @progress = progress\n end\n\n define_method(:matcher) { pattern }\n define_method(:progress) { @progress }\n\n # Determines whether this formatter is applied or not.\n #\n # @param [Object] value\n #\n # @return [Boolean]\n #\n # @api private\n define_method(:matches?) do |value|\n !!(value.to_s =~ pattern)\n end\n end\n end",
"def initialize(*args)\n old_initialize(*args)\n self.formatter = SimpleFormatter.new\n end",
"def initialize(format, options = {})\n @options = options\n @file_format = format\n end",
"def initialize(logdev)\n @progname = nil\n @level = DEBUG\n @default_formatter = Formatter.new\n @formatter = nil\n @logdev = nil\n if logdev\n @logdev = LogDevice.new(logdev)\n end\n end",
"def initialize_log\n if @configuration[:debug].nil?\n @logger = Yell.new format: Yell::ExtendedFormat do |l|\n l.adapter :datefile, 'send.log'\n l.adapter STDOUT\n end\n else\n @logger = Yell.new format: Yell::ExtendedFormat do |l|\n l.adapter :datefile, 'test.log'\n l.adapter STDOUT\n end\n end\n end",
"def initialize(filename)\r\n @log = {}\r\n @size = 0\r\n\r\n @logFile = File.new(filename) # Open the log file\r\n\r\n # Read in the Log file\r\n @logFile.each do |line|\r\n values = line.split(',') # Split the line at the commas\r\n dateParts = values[0].split('/') # Split the date field up at the slashes\r\n\r\n date = Date.parse(\"#{dateParts[2]}-#{dateParts[0]}-#{dateParts[1]}\") # Parse the date string into a valid Date object\r\n\r\n add_logItem(values[1].chomp!, date)\r\n end\r\n end",
"def initialize(str, debug=false)\n setup_parser(str, debug)\n end",
"def initialize(str, debug=false)\n setup_parser(str, debug)\n end",
"def initialize(str, debug=false)\n setup_parser(str, debug)\n end",
"def initialize(format = DEFAULT_FORMAT, width = nil)\n super()\n @format_string = format\n @width = width || Console.width || -1\n mark = java.lang.String.format(@format_string, Time.now,\n '', '', '', '!$!', nil, nil)\n @indent = mark.lines.first.index('!$!')\n @level_labels = Hash.new{ |h, k| h[k] = k }\n @level_labels[JavaUtilLogger::Level::WARNING] = 'WARN'\n @level_labels[JavaUtilLogger::Level::SEVERE] = 'ERROR'\n @level_labels[JavaUtilLogger::Level::FINEST] = 'DEBUG'\n end",
"def initialize\n log_path = @@log[:path] + 'one2influx.log'\n begin\n $LOG = Logger.new(log_path, 'daily', 30)\n rescue Exception => e\n raise \"Unable to create log file. #{e.message}\"\n end\n $LOG.level = @@log[:level]\n\n convert_to_sec\n prepare_storage_ids\n prepare_vm_config\n end",
"def initialize(options = {})\n @numFmtId = 0\n @formatCode = \"\"\n parse_options options\n end",
"def initialize(filename, verbose)\n @src = \"\"\n @verbose = verbose\n @filename = filename\n @logger = Logger.new('log/logLatex.log')\n @logger.level = Logger::DEBUG\n @tokens = []\n @tokenModel = Struct.new(:id,:value,:pos)\n @pos = 0\n end",
"def initialize(hash, from, path, args)\n @hash = hash\n @from = from\n @path = path\n begin\n @format = path.match(/\\.([A-z]+)$/).to_a[1].to_sym\n rescue\n @format = nil\n end\n @args = args\n end",
"def initialize(str)\n @raw = str # Keeps th original string for later use\n @buffer = StringScanner.new(str) # Create StringScanner buffer\n @attributes = {} # Initialize the attributes hash\n @stack = [Stacker.new(0)] # Initialize the parser stack with initial \"state\"\n parse # Start parsing\n end",
"def initialize\n @formatter = nil\n reset!\n end",
"def new\n @log = Log.new\n end",
"def initialize\n @log = Logging::Logger[self]\n @options = self.default_options\n end",
"def initialize(str = nil)\n parse(str) if str\n end",
"def initialize(input)\n super()\n @io = input\n @eof = false\n @lineno = 0\n @fields = nil\n @separator = ';'\n parse!\n end",
"def initialize()\n @log = {}\n end",
"def initialize(parse_tree)\n @parse_tree = parse_tree\n end",
"def initialize(source)\n self.source = source\n self.fields = []\n self.lines = []\n self.parse!\n end",
"def initialize\n @format = configatron.log_format #'%h %l %u %t \\\"%r\\\" %>s %O \\\"%{Referer}i\\\" \\\"%{User-Agent}i\\\"'\n @counter = 0\n @start = Time.now\n @h_ip_hits = Hash.new(0) #ip => hits\n @h_status_hits = Hash.new(0) #status => hits\n @parser = ApacheLogRegex.new(@format)\n @oh = ActiveSupport::OrderedHash.new\n# @oh_status = ActiveSupport::OrderedHash.new\n@h = {}\n end",
"def initialize(command_line)\n parse(command_line)\n end",
"def initialize(input, logfile)\n @logfile =\n\tif logfile.nil?\n\t nil\n\telse\n\t File.open(logfile, File::CREAT|File::APPEND|File::WRONLY, 0600)\n\tend\n @message = if input.is_a?(RMail::Message)\n\t\t input\n\t\t else\n\t\t RMail::Parser.new.parse(input)\n\t\t end\n @logging_level = 2\n end",
"def initialize( logger )\n @logger = logger\n end",
"def initialize(logdev, shift_age=0, shift_size=1048576)\n @log = (logdev.kind_of?(::Logger) ? logdev : ::Logger.new(logdev, shift_age, shift_size))\n @name = nil\n end",
"def initialize(log, db)\n @log = log\n @database = db\n end",
"def initialize(path, format=:markdown)\n raise ArgumentError, \"File [#{path}] does not exist!\" unless File.exists?(path)\n raise ArgumentError, \"File required!\" unless File.file?(path)\n @path = path\n @format = detect_format(path)\n @content = \"\"\n end",
"def initialize(history_path=\"~/.config/fish/fishistory\")\n @history_path = File.expand_path(history_path)\n @parsed_path = File.join(@history_path, 'parsed')\n end",
"def initialize\n @log = Logging::Logger[self]\n end",
"def initialize logger = Nacreon.log\n\t\t\tself.log = logger\n\t\tend",
"def initialize_log(log)\n close if @log # be sure that we don't leave open files laying around.\n\n if log.respond_to?(:write)\n @log = log\n elsif File.exist?(log)\n @log = open(log, (File::WRONLY | File::APPEND))\n @log.sync = true\n else\n FileUtils.mkdir_p(File.dirname(log)) unless File.directory?(File.dirname(log))\n @log = open(log, (File::WRONLY | File::APPEND | File::CREAT))\n @log.sync = true\n @log.write(\"#{Time.now.httpdate} #{delimiter} info #{delimiter} Logfile created\\n\")\n end\n end",
"def initialize(version)\n @string = version.to_s\n @parsed = parse @string\n end",
"def initialize(logger)\n\t\t\t\t\t@logger = logger\n\t\t\t\tend",
"def initialize(tag)\n\t\tannotation = Git.get_tag_annotation(tag)\n\t\t@date = Date.parse(Git.get_tag_date(tag))\n\t\tif annotation\n\t\t\tannotation = annotation.split(\"\\n\")\n\t\t\t@heading = annotation.shift\n\t\t\t@heading = @heading.split(' ')[1..-1].join(' ') if @heading\n\t\t\tfilter = ChangelogFilter.FromArray(annotation)\n\t\t\t@text = filter.other_text.remove_indent if filter.other_text\n\t\t\t@changelog = filter.changelog\n\t\tend\n\tend",
"def initialize\n @formatter = Yolo::Formatters::ProgressFormatter.new\n @error = Yolo::Formatters::ErrorFormatter.new\n check_config\n update_config\n end",
"def initialize(filename, info_line) \n @filename = filename\n revision = info_line[0...info_line.index(' ')]\n @revision = Integer(revision[1..-1]) # remove #\n datetime = info_line.scan(/\\d\\d\\d\\d\\/\\d\\d\\/\\d\\d \\d\\d:\\d\\d:\\d\\d/)[0]\n @datetime = DateTime.strptime(datetime, '%Y/%m/%d %H:%M:%S')\n end",
"def initialize\n @formats = []\n end",
"def initialize options = {}\n @flog = Flog.new options\n end",
"def initialize(to_commit, from_commit)\n\t\tpattern = ChangelogFilter.pattern\n\t\tmessages = Git.get_filtered_messages(from_commit, to_commit, pattern)\n\t\tfilter = ChangelogFilter.FromString(messages)\n\t\t@changelog = filter.changelog\n\tend",
"def initialize_logger\n return if @logger.blank?\n log = @logger\n log = log.to_s if log.is_a?(Pathname)\n if log.is_a?(String)\n log = File.join(TMP_ROOT_DIR, log) unless log.start_with?('/')\n @logger =\n Logger.new(log).tap { |l| l.level = Logger.const_get(@log_level) }\n end\n unless @logger.is_a?(Logger)\n raise \"expected String, got #{log.class} #{log.inspect}\"\n end\n end",
"def initialize(mode = :normal)\n self.mode = mode\n time = Time.now.strftime(LOG_TIMESTAMP_FORMAT)\n @log_file = \"#{Dir.pwd}/logs/#{time}.log\"\n @log_modes = [:warn, :error]\n end",
"def call\n @logs = []\n @logs_unique = nil\n File.foreach(@filename) do |line|\n if m = line.match(@log_format)\n @logs.push Log.new(*m.captures)\n else\n raise Error, \"Unmatched lines: #{line}\"\n end\n end\n end",
"def initialize(at_init)\n @at_init = at_init.to_s # quelquefois, on envoie un nombre (annulation)\n parse\n end",
"def initialize(logger, file_reader_class = StandardCSVReader)\n @file_reader_class = file_reader_class\n @logger = logger\n end",
"def initialize filename, kept_span = nil\n\t\t\t@log_filename = filename.tosjis\n\t\t\tremove_old_logs kept_span if kept_span\n\t\tend",
"def initialize(log, cache)\n @log, @cache = log, cache\n end",
"def parse_format(format)\n format = format.to_s\n format.chomp! # remove carriage return\n format.strip! # remove leading and trailing space\n format.gsub!(/[ \\t]+/, ' ') # replace tabulations or spaces with a space\n\n pattern = format.split(' ').map do |element|\n has_quotes = element =~ /^\\\\\"/\n element = element.gsub(/^\\\\\"/, '').gsub(/\\\\\"$/, '') if has_quotes\n\n self.names << rename_this_name(element)\n\n case\n when has_quotes\n if element == '%r' || element =~ /^%{Referer}/ || element =~ /^%{User-agent}/\n /\"([^\"\\\\]*(?:\\\\.[^\"\\\\]*)*)\"/\n else\n '\\\"([^\\\"]*)\\\"'\n end\n when element =~ /^%.*t$/\n '(\\[[^\\]]+\\])'\n when element == '%U'\n '(.+?)'\n else\n '(\\S*)'\n end\n end.join(' ')\n\n @regexp = Regexp.new(\"^#{pattern}$\")\n format\n end",
"def initialize(sprint_string)\n sprint_string.match(/\\[(.*?)\\]/) do |match|\n params = match[0]\n\n @id = params[/id=(.*?),/, 1]\n @state = params[/state=(.*?),/, 1]\n @name = params[/name=(.*?),/, 1]\n @startDate = params[/startDate=(.*?),/, 1]\n @endDate = params[/endDate=(.*?),/, 1]\n\n @startDate = nil if (@startDate == \"<null>\") # JIRA format\n @endDate = nil if (@endDate == \"<null>\") # JIRA format\n\n @startDate = Date.parse(@startDate) if @startDate\n @endDate = Date.parse(@endDate) if @endDate\n end\n\n abort if (@id.nil? || @state.nil? || @name.nil?)\n end",
"def parse(params) new(params).parse end",
"def initialize_logger(level)\n FFMPEG.logger.progname = 'FFmpeg'\n FFMPEG.logger.level = level || Logger::ERROR\n FFMPEG.logger.formatter = proc do |severity, time, progname, msg|\n \"#{time.strftime('%F %T')} #{progname} - #{severity} - #{msg}\\n\"\n end\n FFMPEG.logger.debug 'Logger initialized.'\n end",
"def log_formatter=(_arg0); end",
"def log_formatter=(_arg0); end",
"def create_formatter(config)\n log_format = get_format_config(config)\n formatter = Log4r::PatternFormatter.new(:pattern => log_format)\n return formatter\n end",
"def initialize(data, delim1 = DELIM_SECTION, delim2 = DELIM_RECORD, delim3 = DELIM_FIELD)\n @fields = self.class.parseData(data, delim1, delim2, delim3)\n end",
"def initialize(logger, options = T.unsafe(nil)); end",
"def initialize(str)\n s = str.strip.chomp\n @priority = s.scan(@@PRIREG).flatten.first\n @contexts = s.scan(@@CONREG).flatten.uniq || []\n @projects = s.scan(@@PROREG).flatten.uniq || []\n @done = !s.match(@@DONREG).nil?\n @text = s\n end",
"def initialize(options = {}, &block)\n # Backward compatibility\n options = { level: options } unless options.is_a?(Hash)\n options = options.dup\n level = options.delete(:level)\n filter = options.delete(:filter)\n @formatter = extract_formatter(options.delete(:formatter), &block)\n @app_name = options.delete(:app_name)\n @host = options.delete(:host)\n fail(ArgumentError, \"Unknown options: #{options.inspect}\") unless options.empty?\n\n # Subscribers don't take a class name, so use this class name if an subscriber\n # is logged to directly\n super(self.class, level, filter)\n end",
"def initialize(file_name, file_contents, log_lines = false, parse_signatures = false)\n\n # set up basic options and defaults\n self.file_name = file_name\n self.file_contents = file_contents\n self.file_ext = File.extname(file_name)\n self.parts = []\n self.lines = 0\n @@log_lines = log_lines\n @@parse_signatures = parse_signatures\n\n # set the doc type based on extension\n case self.file_ext\n when '.rb'\n self.type = :RUBY\n when '.md', '.txt', '.markdown', '.mdown'\n self.type = :MARKDOWN\n end\n\n # set parser with file type\n self.parser = Rain::Parser.new(self.type)\n\n # set the default title to the proper-case file name\n # without the extension and underscores/dashes\n self.title = self.file_name.sub(self.file_ext, '')\n self.title.gsub!(/_|-/, ' ')\n\n # very simple proper-caser\n self.title.gsub!(/\\w+/) { |word| word.capitalize }\n end",
"def initialize(line)\n fields = line.split\n @ip = fields[0]\n @event = nil\n @status = fields[8]\n @method = fields[5].sub('\"', '')\n @path = fields[6].sub(/\\?.*/, '')\n @event_time = parse_time(fields[3] + fields[4])\n @pid = nil\n @agent = line.split('\"')[5]\n end",
"def initialize(io, options = {})\n @io = io\n @format = options[:format] || FILE_FORMATS.first\n \n raise ArgumentError, \"Invalid format option provided #{options[:format]}\" unless FILE_FORMATS.include?(format)\n end",
"def initialize(mapping, format)\n @mapping, @format = mapping, format\n end",
"def initialize\n @logger = Logging::Logger[self]\n end",
"def initialize(logger: default_logger)\n @logger = logger\n end",
"def initialize\n @logger = Logger.new('cf_flattener.log')\n end",
"def set_log(log, log_level = nil, delimiter = \" ~ \", auto_flush = false)\n if log_level && Levels[log_level.to_sym]\n @level = Levels[log_level.to_sym]\n else\n @level = Levels[:debug]\n end\n @buffer = []\n @delimiter = delimiter\n @auto_flush = auto_flush\n\n initialize_log(log)\n end",
"def initialize(url: 'http://localhost:9200',\n index: 'semantic_logger',\n type: 'log',\n level: nil,\n formatter: nil,\n filter: nil,\n application: nil,\n host: nil,\n &block)\n\n @url = url\n @index = index\n @type = type\n\n super(level: level, formatter: formatter, filter: filter, application: application, host: host, &block)\n reopen\n end",
"def initialize(index: \"semantic_logger\",\n type: \"log\",\n url: \"http://localhost:9200\",\n **http_args,\n &block)\n\n @index = index\n @type = type\n super(url: url, **http_args, &block)\n\n @request_path = \"#{@path.end_with?('/') ? @path : \"#{@path}/\"}#{@index}-%Y.%m.%d\"\n @logging_path = \"#{@request_path}/#{type}\"\n end",
"def initialize(log_dir = VidazingLogger::LOG_DIR, name:)\n @name = name\n @log_dir = log_dir\n\n create_log_dir\n end",
"def initialize options\n self.class.constants.each do |x|\n klass = eval x.to_s\n @reader = klass.new options\n break if @reader\n end\n raise 'Unknown format' unless @reader\n end",
"def initialize(args={})\n @log = args[:log] # will contain an instance of some type of Logger object (Ruby, Log4R, etc.)\n log.debug \"#{self.class} initialize called..\"\n @errors = [] # an array of error messages\n @exercise = nil # will contain the exercise created upon import\n end",
"def parse \n raise \"This has not been implemented yet. Due to the variability of report format, will need to implement a series of specialized parsers\"\n end",
"def initialize(*args)\n @init_args = args\n set_log(*args)\n end",
"def initialize\n @formatter = method(:default_formatter)\n end",
"def initialize(logger = T.unsafe(nil)); end",
"def initialize(target, logger=nil)\r\n @target=target \r\n \r\n @log=logger || $logger || nil\r\n \r\n if @log == nil\r\n @log = Logger.new(STDOUT)\r\n @log.level = Logger::INFO\r\n @log.datetime_format = \"%Y-%m-%d %H:%M:%S\" \r\n @log.formatter = proc do |severity, datetime, progname, msg|\r\n \"#{datetime}: #{msg}\\n\"\r\n end \r\n end\r\n end",
"def initialize(logger: nil)\n @logger = logger || default_logger\n end",
"def init filename \n @metrics = MGT::MetricFactory.new(MGT::ParamsParser.new(filename).parse)\n end",
"def initialize(*, verbose: '1', log_file: STDERR, **)\n v = (verbose =~ /\\d+/) ? verbose.to_i : verbose.to_sym\n self.logger = Logger.new(log_file, v)\n end"
] |
[
"0.7170875",
"0.7076628",
"0.6831184",
"0.64820826",
"0.6418098",
"0.6329344",
"0.63275045",
"0.619786",
"0.608086",
"0.6065458",
"0.60419685",
"0.60283697",
"0.60096717",
"0.59981817",
"0.5991251",
"0.59633297",
"0.5961695",
"0.5938126",
"0.58910626",
"0.5880602",
"0.5869023",
"0.58481795",
"0.58006334",
"0.5784543",
"0.57750887",
"0.57735765",
"0.57735765",
"0.57735765",
"0.57531106",
"0.5744425",
"0.5730119",
"0.56850356",
"0.56782323",
"0.5668214",
"0.56411266",
"0.56357944",
"0.5632501",
"0.56261635",
"0.56103045",
"0.5607062",
"0.55963486",
"0.5587988",
"0.5567896",
"0.5562929",
"0.55526304",
"0.5551963",
"0.55361265",
"0.55214685",
"0.55126417",
"0.5507935",
"0.54981583",
"0.5490278",
"0.5489443",
"0.5477187",
"0.5464443",
"0.544971",
"0.5446379",
"0.54448",
"0.54354787",
"0.5434602",
"0.54182595",
"0.5416582",
"0.5411676",
"0.5409778",
"0.5397858",
"0.5397491",
"0.53804845",
"0.5355095",
"0.53497475",
"0.5348907",
"0.53302187",
"0.5322794",
"0.53217447",
"0.53217447",
"0.53207636",
"0.52995914",
"0.5287541",
"0.527943",
"0.527758",
"0.5277228",
"0.52619815",
"0.52585995",
"0.525808",
"0.5252874",
"0.52508277",
"0.5249445",
"0.52436787",
"0.5243517",
"0.52425873",
"0.52378494",
"0.5232738",
"0.5229848",
"0.5213224",
"0.52128965",
"0.52072364",
"0.5204183",
"0.5199984",
"0.51969653",
"0.51967067",
"0.51944155"
] |
0.70526594
|
2
|
Parses line according to current log format and returns an hash of log field => value on success. Returns nil if line doesn't match current log format.
|
def parse(line)
row = line.to_s
row.chomp!
row.strip!
return unless match = regexp.match(row)
data = {}
names.each_with_index { |field, index| data[field] = match[index + 1] } # [0] == line
data
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def parse_logline(line) \n line.strip!\n split_line = line.split(/\\|/)\n addr = split_line[0].split(',').last.strip\n\n unless (addr =~ /[\\s|\\-]+/) \n @dns_map.synchronize do\n addr = @dns_map[addr] if @dns_map.include? addr\n end\n details = {}\n details[:upstream_response_time] = split_line[1].split(',').last.strip.to_f\n details[:time_local] = DateTime.strptime(split_line[2], '%d/%b/%Y:%H:%M:%S %Z')\n details[:status] = split_line[3].to_i\n details[:request_length] = split_line[4].to_i\n details[:body_bytes_sent] = split_line[5].to_i\n\n\n @log_entries.synchronize do\n @log_entries[addr] << details\n end\n end \n end",
"def parse_line_to_format(line,file,path_item)\r\n tmp_hash = { message: line, filebot: { format_from: path_item['format'], path_from: file.path, size_from: file.size } }.merge(path_item['fields'] || {})\r\n case path_item['format']\r\n when 'log' then tmp_hash\r\n when 'csv' then\r\n csv_arr = CSV.parse_line(line,path_item['options'].reject { |k,_| k == :headers }) rescue []\r\n if csv_arr.size == 0\r\n tags = [tmp_hash['tags'].to_a]\r\n tags.push('_csvparsefailure')\r\n tmp_hash['tags'] = tags\r\n else\r\n res = []\r\n path_item['options'][:headers].each_with_index { |field_name,i| res << [field_name,csv_arr[i]] }\r\n if res.size < csv_arr.size\r\n res << [ 'tail_csv', csv_arr[res.size..csv_arr.size-1].join(\"\\t\") ]\r\n end\r\n tmp_hash = tmp_hash.merge(res.to_h)\r\n end\r\n tmp_hash\r\n else tmp_hash\r\n end\r\n end",
"def process_line(line)\n return true if line.empty?\n\n chunks = line.split(SPLIT_PATTERN, fmt.length)\n enough_fields?(line) # can raise exception\n\n point = { path: extract_path(chunks),\n value: extract_value(chunks) }\n\n tags = line_tags(chunks)\n\n point.tap do |p|\n p[:tags] = tags unless tags.empty?\n p[:ts] = extract_ts(chunks) if fmt.include?('t')\n p[:source] = extract_source(chunks) if fmt.include?('s')\n p[:interval] = options[:interval] || 'm' if fmt.include?('d')\n end\n end",
"def log_line_parse(line, options={})\n options={\n :link_to_url => nil, #url /browse/server/#chatroom/00000000\n }.update options\n if line =~ /^---/\n \"\" #strip log open/close stuff. \n else\n date = line[0..7] #ignore 00:00:00\n hx = Digest::MD5.hexdigest(date)\n line = line[8..-1]\n type = case line\n when /^ * [^ ]+ /\n :action_line\n when /^<.[^>]+>/\n :message_line\n when /^-!-/\n case line\n when /now known as/\n :nick_change_line\n when /has (joined|left|quit)/\n :join_part_quit_line\n when /^-!- mode\\//\n :mode_change_line\n end\n end\n type = :unknown_line unless type\n date_line = '<span class=\"line-date\">'\n date_line << \"<a href=\\\"#{options[:link_to_url]}##{hx}\\\">\" if options[:link_to_url]\n date_line << date\n date_line << '</a>' if options[:link_to_url]\n date_line << '</span>'\n%s{<span class=\"line-date\">#{date}</span>}\n<<-END\n <div class=\"#{type}\"><a name=\"#{hx}\">\n #{date_line}\n <span class=\"line-body\">\n #{send(type, line)}\n </span>\n </a></div>\nEND\n end\nend",
"def handle_record_line(line, record)\n ret = nil\n if record.respond_to?(:process)\n if ret = record.send(:process, line.dup)\n unless ret.is_a?(Hash)\n raise Puppet::DevError,\n \"Process record type #{record.name} returned non-hash\"\n end\n else\n return nil\n end\n elsif regex = record.match\n # In this case, we try to match the whole line and then use the\n # match captures to get our fields.\n if match = regex.match(line)\n fields = []\n ret = {}\n record.fields.zip(match.captures).each do |field, value|\n if value == record.absent\n ret[field] = :absent\n else\n ret[field] = value\n end\n end\n else\n nil\n end\n else\n ret = {}\n sep = record.separator\n\n # String \"helpfully\" replaces ' ' with /\\s+/ in splitting, so we\n # have to work around it.\n if sep == \" \"\n sep = / /\n end\n line_fields = line.split(sep)\n record.fields.each do |param|\n value = line_fields.shift\n if value and value != record.absent\n ret[param] = value\n else\n ret[param] = :absent\n end\n end\n\n if record.rollup and ! line_fields.empty?\n last_field = record.fields[-1]\n val = ([ret[last_field]] + line_fields).join(record.joiner)\n ret[last_field] = val\n end\n end\n\n if ret\n ret[:record_type] = record.name\n return ret\n else\n return nil\n end\n end",
"def parse\n out = {}\n begin \n o = @line.match(/(.*?\\d\\d:\\d\\d:\\d\\d) (.*?) (.*?) (.*$)/ )\n out[\"date\"] = o.captures[0].to_ElasticDate\n out[\"machine\"] = o.captures[1]\n out[\"service\"] = o.captures[2]\n m = out[\"service\"].match(/\\[(\\d+)\\]\\:{0,1}/)\n if m then \n out[\"servicePid\"] = m.captures[0]\n out[\"serviceName\"] = out[\"service\"].sub(/\\[\\d+\\]\\:{0,1}/,\"\")\n elsif \n out[\"servicePid\"] = -1\n out[\"serviceName\"] = out[\"service\"].sub(/\\:$/,\"\")\n end\n out[\"message\"] = o.captures[3]\n out[\"parseFails\"] = false\n rescue => ex\n STDERR.puts \"--- Exception in parsing ----\"\n STDERR.puts \"#{@line}\"\n out[\"date\"] = DateTime.now().to_ElasticDate\n out[\"machine\"] = \"\"\n out[\"service\"] = \"\"\n out[\"serviceName\"] = \"\"\n out[\"servicePid\"] = \"\"\n out[\"message\"] = @line\n out[\"parseFails\"] = true\n end\n return out\n end",
"def parse_line(line)\n ln, fn, mi, sex, fav_color, dob = line.split(' | ')\n LineParser.to_h(fn, ln, mi, sex, fav_color, parse_dob(dob))\n end",
"def parse_line(line)\n host_ip, date, method_file_protocol, http_code, _ = @line_regex.match(line).captures\n file = @mfp_regex.match(method_file_protocol).captures[0]\n ip_token = host_ip.split(':')[1]\n\n date = Time.strptime(date, '%d/%b/%Y:%H:%M:%S %z').iso8601\n query_params = CGI::parse(URI(file).query)\n\n return {\n access_date: date,\n ip_token: ip_token,\n page_number: query_params[\"seq\"] || -1,\n http_code: http_code,\n volume_id: query_params[\"id\"]\n }\n end",
"def parse_line(line)\n ln, fn, sex, fav_color, dob = line.split(', ')\n LineParser.to_h(fn, ln, nil, sex, fav_color, parse_dob(dob))\n end",
"def parse_entry(log_entry)\n @column = {}; i = 1;\n if attributes = log_entry.match(regexp)\n @args.each {|f| @column[f] = attributes[i]; i += 1}\n parse_datetime! if @column[:time]\n parse_request! if @column[:request]\n end\n @column\n end",
"def parse(line)\n\t\titems = line.split(' ')\n\t\trecord = {}\n\t\t# debugger\n\t\trecord[:event] = items[0]\n\t\trecord[:time] = items[1]\n\t\trecord[:fnode] = items[2]\n\t\trecord[:tnode] = items[3]\n\t\trecord[:pktype] = items[4]\n\t\trecord[:pktsize] = items[5]\n\t\trecord[:fid] = items[7]\n\t\trecord[:srcadd] = items[8]\n\t\trecord[:desadd] = items[9]\n\t\trecord[:seqnum] = items[10]\n\t\trecord[:pktid] = items[11]\n\t\trecord\n\tend",
"def create_record(line, path, log_state, process_fields)\r\n directives = {}\r\n\r\n # If we have directive information about fields in the logs parse it.\r\n if log_state.log_directives.fields != nil\r\n directives = Hash[log_state.log_directives.fields.zip(line.split(\" \"))]\r\n end\r\n\r\n if process_fields && log_state.log_directives.fields != nil\r\n record = directives\r\n elsif\r\n record = {'message' => line }\r\n end\r\n\r\n # Add information about where the log entry came from.\r\n record['log-path'] = path\r\n # Attempt to get a timestamp from the fields and/or directives.\r\n timestamp = get_timestamp(directives['date'], directives['time'], log_state.log_directives.date)\r\n record['timestamp'] = timestamp if timestamp != nil\r\n return record\r\n end",
"def parse(line)\n row = line.to_s\n row.chomp!\n row.strip!\n return unless match = regexp.match(row)\n\n data = {}\n names.each_with_index { |field, index| data[field] = match[index + 1] } # [0] == line\n data\n end",
"def parse_line(line)\n results = LineRegexp.match(line)\n if results \n @elements[:line] = results[-1]\n results[-1] # remaining line \n else\n @elements[:line] = line\n line \n end\n end",
"def parse_audit_line(line)\n event = {}\n parse_metadata(event, line.split)\n return normalize(event, line)\n end",
"def handle_text_line(line, record)\n line =~ record.match ? {:record_type => record.name, :line => line} : nil\n end",
"def scan_line(line)\n e = { orig: line }\n entry_pattern.match(line) do |m|\n e.update(extract_groups(m))\n end\n e\n end",
"def parse_line(line)\n catch :line_parsed do\n UNDERSTOOD_ROWS.each do |record_type|\n if line.start_with?(record_type)\n send \"parse_#{record_type.downcase}_line\", line.chomp\n throw :line_parsed\n end\n end\n\n if line[0].eql?('/')\n parse_comment_line line.chomp\n throw :line_parsed\n end\n\n logger.error \"Can't understand line: #{line.chomp.inspect}\"\n end\n end",
"def parser(line)\n return Hash[line.split(\"\\t\").map{|f| f.split(\":\", 2)}]\n end",
"def parse(line)\n unless line.is_a?(String)\n raise(IOStreams::Errors::TypeMismatch, \"Format is :fixed. Invalid parse input: #{line.class.name}\")\n end\n\n hash = {}\n index = 0\n fixed_layout.each do |map|\n value = line[index..(index + map.size - 1)]\n index += map.size\n hash[map.key] = value.to_s.strip\n end\n hash\n end",
"def get_log_time(line)\n data_string = line.match(/[\\w]*[\\s]*[\\w]*[\\s]*[^\\s]*/)[0]\n # the year is not included, so this will fail if the current year is different\n # for now we'll hack it to be the current year\n date = DateTime.parse(\"#{data_string} #{REPORT_YEAR}\")\nend",
"def parser_received(line)\n\t\tif line.include? MailHeader.received\n @count=@count+1\n # fields=line.split(MailHeader.key_separator)\n if line.length>1\n @received_value=@received_value+line\n end #end fields.length\n else\n if line.include? MailHeader.key_separator\n if received_value.start_with? MailHeader.received\n #get the received value\n # puts @received_value\n end\n @received_value=\"\"\n else\n @received_value=@received_value+line\n end\n end #end line include?\n\n # parser the received from the mail header\n if received_value.include? MailHeader.smtp_code_550 or received_value.include? MailHeader.smtp_code_551 or received_value.include? MailHeader.smtp_code_553 or received_value.include? MailHeader.smtp_code_554\n mail_header_output.correct_email_format=MailHeader.unknown\n elsif received_value.include? MailHeader.smtp_code_552\n #the address is correct\n end\n\tend",
"def parse_line(line)\n begin\n @loggie.write(\"#{line}\\n\")\n line = line.split(\" \")\n if line[9] == 'voice'\n return Message.new(line[12],line[15],'started.',line[0].to_f,GROUP,line[8])\n elsif line[9] == 'end'\n return Message.new(line[14],line[17].gsub(',',''),'ended.',line[0].to_f,GROUP,line[8])\n elsif line[7] == \"audio\"\n led(\"rx\", line[-2].split('/')[0].to_i / 141.0)\n return \"audio\"\n elsif line[6] == 'group'\n return Message.new(line[4],line[7],line.last,line[0].to_f,GROUP,\"RF\")\n elsif line =~ /Call from/\n return Message.new(line[4],line[6],line.last,line[0].to_f,PRIV,\"RF\")\n end\n rescue => e\n @@logger.debug(e.inspect)\n @@logger.debug(e.backtrace)\n exit 1\n end\n end",
"def parse_line(line)\n raise Puppet::DevError, \"No record types defined; cannot parse lines\" unless records?\n\n @record_order.each do |record|\n # These are basically either text or record lines.\n method = \"handle_#{record.type}_line\"\n if respond_to?(method)\n if result = send(method, line, record)\n record.send(:post_parse, result) if record.respond_to?(:post_parse)\n return result\n end\n else\n raise Puppet::DevError,\n \"Somehow got invalid line type #{record.type}\"\n end\n end\n\n nil\n end",
"def log_entry(line)\n raw = line.split(@@break)\n map = Hash.new\n raw.each do |keys|\n parts = keys.split(@@value)\n map.store(parts[0],parts[1])\n end\n #unless USEMEMCACHE != true\n # if Staticentry.get_cache(Digest::MD5.hexdigest(map['data'] + map['logtype_id'].to_s)).nil?\n # static = Logtype.find(map['logtype_id']).staticentries.new\n # static.data = map['data']\n # static.save\n # end\n #else\n static = Logtype.find(map['logtype_id']).staticentries.new\n static.data = map['data']\n static.save\n #end\n unless USEMEMCACHE != true\n static = Staticentry.get_cache(Digest::MD5.hexdigest(map['data'] + map['logtype_id'].to_s))\n else\n static = Staticentry.find(Digest::MD5.hexdigest(map['data'] + map['logtype_id'].to_s))\n end\n event = static.events.new\n event.etime = map['etime'].to_i\n event.loglevel_id = map['loglevel_id'].to_i\n event.payload = map['payload']\n event.logtype_id = map['logtype_id'].to_i\n event.agent_id = map['agent_id'].to_i\n begin\n a = Agent.find(map['agent_id'])\n l = Logtype.find(map['logtype_id'])\n if a.logtypes.member?(l)\n if check_key(a, map['authkey']) \n event.save\n else\n ActiveRecord::Base.logger.error \"Event dropped -- invalid agent authkey sent for #{a.name}\"\n send_data \"1\"\n end\n else\n ActiveRecord::Base.logger.error \"Event dropped -- Agent #{a.name} is not a member of logtype #{l.name}\"\n send_data \"2\"\n end\n rescue ActiveRecord::RecordNotFound\n ActiveRecord::Base.logger.error \"Event dropped -- invalid agent_id or logtype_id specified\"\n send_data \"3\"\n end\n port, ip = Socket.unpack_sockaddr_in(get_peername)\n host = Socket.getaddrinfo(ip, 0, Socket::AF_UNSPEC, Socket::SOCK_STREAM, nil, Socket::AI_CANONNAME)[0][2]\n ActiveRecord::Base.logger.debug \"New event logged from #{host} \\n -- Log data: #{line}\"\n end",
"def _parse_line(line, config_hash, overrides)\n line.strip!\n line = _strip_comment(line)\n\n if line.empty?\n # Nothing to do here\n return\n end\n\n section = _get_section_title(line)\n if section\n _process_section(section, config_hash)\n return\n end\n\n key_value_hash = _get_key_value_hash(line)\n if key_value_hash\n unless $_current_section\n raise 'Key-value pair must be part of a section'\n end\n _process_key_value(key_value_hash, config_hash, overrides)\n return\n end\n\n raise 'Malformed config file: ' << line\n end",
"def parse_line(line)\n line_arr = line.split(':')\n type = line_arr.first.downcase\n days = line_arr.last.split(',')\n [type, days]\n end",
"def parse_entry(line)\n\n return nil if line.nil? || line.length <= 0\n meta,msg = line.split(' : ',2)\n msg = msg.chomp unless msg.nil?\n\n parts=meta.split(' ')\n\n fields=[]\n\n unless parts.length < 3\n fields_str=parts[2][1..-2]\n fields = fields_str.split(',')\n end\n\n Entry.new(parts[0], parts[1], fields, msg, line)\n end",
"def parse_status_line(line, header)\n split_line = line.split(',').map(&:strip)\n if split_line.first == '' && split_line.length == 1 # Empty line\n nil\n else\n { pxname: split_line[header.index('pxname')],\n svname: split_line[header.index('svname')],\n status: split_line[header.index('status')] }\n end\n end",
"def parse_line(line)\n # Remove comment text\n line = strip_comments(line)\n\n # Read key/value pair if one exists in this line\n (key, value) = line.split(\"=\", 2)\n\n if key && value\n # Remove any extra whitespace or line endings\n # and handle any type boolean type conversions\n key = key.strip\n value = convert_booleans(value.strip)\n\n # Save the configuration values in a hash\n @config[key] = value\n end\n end",
"def parse(line)\n res='unknown'\n raw=line.split(':')\n res=raw[1] if raw[1]!=nil\n res.strip\n end",
"def parse_header(line)\n case line\n when /^#%checkm/\n match = /^#%checkm_(\\d+)\\.(\\d+)/.match line\n @version = \"#{match[1]}.#{match[2]}\" if match\n when /^#%eof/\n @eof = true\n when /^#%fields/\n list = line.split('|')\n list.shift\n @fields = list.map { |v| v.strip.downcase }\n when /^#%prefix/, /^#%profile/\n # do nothing\n end\n end",
"def parse(line)\n line.strip!\n\n match = line.match(@@full_match)\n return unless match\n\n source_ip, destination_ip, source_port, destination_port = match[1..4]\n\n OpenStruct.new(\n :source_ip => source_ip,\n :destination_ip => destination_ip,\n :source_port => source_port.to_i,\n :destination_port => destination_port.to_i\n )\n end",
"def line_parse(validated_line)\n return unless validated_line\n row = validated_line.split(',')\n return unless row.any?\n if @headers.empty?\n @headers = row\n else\n @data_hash.merge!(row_to_hsh(row))\n @valid_rows << @data_hash\n end\n end",
"def parse_line\n s0 = @scanner.pos\n match_spaces\n s2 = parse_te\n if s2 == :failed\n @scanner.pos = s0\n s0 = :failed\n else\n match_spaces\n s4 = @scanner.pos\n s5 = parse_fugou\n if s5 == :failed\n @scanner.pos = s4\n s4 = :failed\n else\n s6 = parse_from\n if s6 == :failed\n @scanner.pos = s4\n s4 = :failed\n else\n @reported_pos = s4\n s4 = transform_teban_fugou_from(s2, s5, s6)\n end\n end\n if s4 == :failed\n s4 = @scanner.pos\n s5 = []\n s6 = match_regexp(/[^\\r\\n ]/)\n while s6 != :failed\n s5 << s6\n s6 = match_regexp(/[^\\r\\n ]/)\n end\n @reported_pos = s4\n s4 = s5.join\n end\n if s4 == :failed\n @scanner.pos = s0\n s0 = :failed\n else\n match_spaces\n s6 = parse_time\n s6 = nil if s6 == :failed\n match_str('+')\n if parse_nl == :failed\n @scanner.pos = s0\n s0 = :failed\n else\n @reported_pos = s0\n s0 = { 'move' => s4, 'time' => s6 }\n end\n end\n end\n s0\n end",
"def parse_and_validate_line(line)\n\n entry = parse_entry(line)\n return entry unless entry.parse_ok?\n\n valid_chain=is_valid_hash(entry)\n @invalid += 1 if valid_chain === false\n @num += 1\n\n entry\n end",
"def parse_line(line)\n is = new\n line =~ /(.+)\\s+<-\\s+(.+?)\\s+\\((\\d+\\.\\d)(?:\\/(\\d+))?,\\s+(\\d+\\.\\d)\\)/\n consequent, antecedent, support, transactions, confidence = $1, $2, $3, $4, $5\n is.consequent = consequent \n is.antecedent = antecedent.split(/\\s+/)\n is.support = support.to_f\n is.num_antecedent_transactions = transactions ? transactions.to_i : nil\n is.confidence = confidence.to_f\n is\n end",
"def parse\n logs = File.open(log_file).read\n raise InvalidFile if (logs.empty?)\n logs.each_line do |line|\n api_path, ip_address = line.split\n raise InvalidFile if (api_path.nil? || ip_address.nil?)\n parsed_results[api_path] << ip_address\n end\n parsed_results\n end",
"def hash_from source, line\n line_elements = line.split(source[:delim]).map(&:strip)\n Hash[source[:headers].zip(line_elements)].tap do |h|\n h[:birth_date] = Date.strptime( h[:birth_date].to_s.gsub('-','/'), '%m/%d/%Y' )\n end\n end",
"def config_parse(line)\n line.strip!\n return nil if line.nil? || line.empty? || line[0] == '#'\n action, line = line.split(' ', 2)\n return :domain, [line] if action == 'domain'\n return :substitution, line.split(' ', 2) if action.start_with?('sub')\n nil\n end",
"def parse_line(line, tags, values, open_tags)\n if line.match(TAG)\n tags = handle_adding_tag($2, tags)\n values = handle_add_to_top_open_tag(get_tag($2), open_tags, values)\n values = handle_add_line_to_value(\"\", $2, values)\n elsif line.match(OPEN_TAG)\n open_tags.push($2)\n tags = handle_adding_tag($2, tags)\n elsif line.match(CLOSE_TAG)\n values, open_tags = handle_close_tag($2, values, open_tags)\n elsif line.match(VALUE_TEXT)\n values = handle_add_to_top_open_tag($1, open_tags, values)\n elsif line.match(BRACE_TEXT)\n values = handle_add_to_top_open_tag($1, open_tags, values)\n else\n puts \"Error: didn't match '#{line}'\"\n exit 1\n end\n \n whole = $1\n if line.sub(whole, '') != nil and line.sub(whole, '') != \"\"\n return parse_line(line.sub(whole,''), tags, values, open_tags)\n else \n return tags, values, open_tags\n end\n end",
"def parse\n line = @io.gets until md = /\\ATime before run:\\s+(?<time>.*)\\Z/.match(line)\n return unless md\n @db.date_time ||= DateTime.parse(md[:time])\n super\n @db[\"lparstat_out\"] = @db[\"lparstat_sum\"]\n end",
"def match_line line\n @hash.each_pair {| k , p|\n if line =~ k\n return p\n end\n }\n return @default_colors\n end",
"def parse(line)\n raise EntryFileError, \"Do not know how to parse the entries in #{File.basename(@data_file)}!\"\n end",
"def hashes(log)\n return log.split(\"\\n\").map{|line| parser(line) }\n end",
"def parse(input)\n entries = []\n input = input.respond_to?(:readline) ? input : StringIO.new(input.to_s)\n begin\n while line = input.readline\n line.chomp!\n if line =~ /^([\\d.]+|-) .* \\[([^\\]]+)\\] \"((?:\\\\\"|[^\"])+)\" (\\d+)(?: (\\d+))?(?: (\\d+))? (\\d+) \"([^\"]+)\" \"([^\"]*)\"/\n # LogFormat \"%{X-mobile-source-IP}i via %h %l %u %t \\\"%r\\\" %>s %O \\\"%{Referer}i\\\" \\\"%{User-Agent}i\\\"\" debug_combined\n # - via 127.0.0.1 - - [15/May/2013:00:00:01 +0200] \"GET /jkmanager?mime=txt HTTP/1.0\" 200 26841 \"-\" \"Wget/1.12 (linux-gnu)\"\n # - via 10.38.252.251 - - [17/Jun/2013:00:28:01 +0200] \"~\\x81\\x10\\xb8\\xa8\\xa2\\x9fd3x\\x94\\x12\\\"2\\xedW\\xe1d\\xact\\xfdB&\\\"\\xe8\\xb0!\\xed\\xfc\\xe9M\\x92\\xf1\\xf3\\x97or\\rzP}FN^\\x18'\\xad\\x0c\\x8a\\xc9T\\x82)\\xb64\\x04\\xaa\\xa8\\xa9X\\xb3V\\x9a\\x87\\xa7G\\xc7}O^~\\\"\\xc3\" 400 88 205 679 \"-\" \"-\"\n entry = Entry.new\n entry.source_ip = $1\n entry.request = $3\n entry.status = $4.to_i\n entry.serve_time = $5.to_i if $5 # in microseconds\n entry.bytes_received = $6.to_i if $6\n entry.bytes_sent = $7.to_i # including headers\n entry.referer = $8\n entry.user_agent = $9\n entry.timestamp = DateTime.parse($2.sub(/:/, ' '))\n entries << entry\n else\n raise \"unrecognized input line: #{line}\"\n end\n end\n rescue EOFError\n end\n\n @entries += entries\n entries\n end",
"def parse_line(line)\n case line\n when /^SF:(.+)/\n @current_filename = $~[1].gsub(/^\\.\\//, '')\n source_files[@current_filename] = []\n when /^DA:(\\d+),(\\d+)/\n line_no = $~[1]\n covered = $~[2]\n source_files[@current_filename] << [line_no.to_i, covered.to_i]\n when /^(BRF|BRH):(\\d+)/\n # branches found/hit; no-op\n when /^BRDA:(\\d+),(\\d+),(\\d+),(-|\\d+)/\n line_no = $~[1]\n block_no = $~[2]\n branch_no = $~[3]\n covered = ($~[4] == '-' ? '0' : $~[4])\n source_files[@current_filename] << [line_no.to_i, block_no.to_i, branch_no.to_i, covered.to_i]\n when /^end_of_record$/, /^$/\n @current_filename = nil\n else\n raise LcovParseError, \"could not recognise '#{line}' as valid LCOV\"\n end\n end",
"def parse_line(line)\n return nil unless valid?(line)\n\n # it isn't a tag if it doesnt begin with #\n return M3U8ParsedTag.new(nil, nil, line) unless line[0] == '#'\n\n # is it an idependent tag?\n return M3U8ParsedTag.new(line[1..-1]) if independent_tag?(line)\n return nil unless (pos = line.index(':'))\n\n # is it a VALUE tag?\n tag, attr_or_val = [line[1..pos - 1], line[pos + 1..-1]]\n return M3U8ParsedTag.new(tag, nil, attr_or_val) if value_tag?(line[0..pos - 1])\n return M3U8ParsedTag.new(tag, attr_or_val) if attribute_tag?(line[0..pos - 1])\n\n # I don't know wtf it is!\n nil\n end",
"def convert_line_to_event(line, es)\n\t\t\tbegin\n\t\t\t\tline.chomp! # remove \\n\n\t\t\t\t@parser.parse(line) { |time, record|\n\t\t\t\t\tif time && record\n\t\t\t\t\t\tes.add(time, record)\n identifier = record[@identifier].gsub(/\\s+/, '')\n if !@redis.get identifier\n @redis.set identifier, true\n @redis.expire identifier, 60*60*24*45\n get_additional_data(identifier)\n end\n else\n\t\t\t\t\t\tlog.warn \"pattern not match\"\n\t\t\t\t\tend\n\t\t\t\t}\n\t\t\trescue => e\n\t\t\t\tlog.warn line.dump, :error => e.to_s\n\t\t\t\tlog.debug_backtrace(e.backtrace)\n\t\t\tend\n\t\tend",
"def convert_line_to_event(line, es)\n begin\n line.chomp! # remove \\n\n @parser.parse(line) { |time, record|\n if time && record\n es.add(time, record)\n identifier = record[@identifier].gsub(/\\s+/, '')\n if identifier && identifier.length > 4\n @identifier_array.push(\"#{identifier}\")\n if @identifier_array.size >= chunk_size\n batchArray = @identifier_array.join(\",\").split(\",\")\n resp = get_from_solr\n if @mongo_merge_enabled\n coll = get_from_mongo(batchArray)\n mresp = merge_mongo_and_solr(coll,resp)\n log_from_response(mresp)\n else\n log_from_response(resp)\n end\n end\n end\n else\n log.warn \"pattern not match: #{line.inspect}\"\n end\n }\n rescue => e\n log.warn line.dump, :error => e.to_s\n log.debug_backtrace(e.backtrace)\n end\n end",
"def parse_commit_line!(commit_line)\n # Parse the full commit line\n line_parts = commit_line.split(\"\\t\")\n sha = line_parts.fetch(0)\n message = line_parts.fetch(1)\n author = line_parts.fetch(2)\n date = Time.parse(line_parts.fetch(3))\n message_data = parse_commit_message!(message)\n pr_number = message_data.fetch(\"pr_number\")\n\n attributes =\n {\n \"sha\" => sha,\n \"message\" => message,\n \"author\" => author,\n \"date\" => date,\n \"pr_number\" => pr_number\n }\n\n # Parse the stats\n stats = get_commit_stats(attributes.fetch(\"sha\"))\n if /^\\W*\\p{Digit}+ files? changed,/.match(stats)\n stats_attributes = parse_commit_stats!(stats)\n attributes.merge!(stats_attributes)\n end\n\n attributes\nend",
"def parse_header(line)\n if (match = line.match(/^(.+?):\\s*(.+)#{@nl}$/))\n key = match[1].downcase\n set_header_special_values(key, match[2])\n parse_normal_header(line, key, match[1], match[2])\n elsif (match = line.match(/^HTTP\\/([\\d\\.]+)\\s+(\\d+)\\s+(.+)$/))\n @response.code = match[2]\n @response.http_version = match[1]\n @http2.on_content_call(@args, line)\n else\n raise \"Could not understand header string: '#{line}'.\"\n end\n end",
"def each_log_line\n File.readlines('/var/log/syslog').each do |line|\n line.chomp!\n \n timestamp, rest = Time.parse(line), line[16..-1]\n yield [timestamp, rest]\n end\n end",
"def parse_field_format(fn)\n ctr = 0\n name = nil\n field_format = {}\n\n File.read(fn).each_line{|l|\n\n ctr += 1\n l.strip!\n\n next if (iscomment(l) || isblank(l))\n t = l.split\n\n if (t.size != 3)\n raise \"error: field format line #{ctr}\"\n end\n\n mne, args, needspc = t\n\n if (!['true', 'false'].include?(needspc))\n raise \"error: field format line #{ctr} column 3\"\n end\n\n field_format[mne] = [args, needspc == 'true']\n }\n\n return field_format\nend",
"def parse_message_from_log_entry\r\n\r\n unique_messages = { }\r\n\r\n id = \"\"\r\n\r\n ARGF.each do |line|\r\n\r\n block_id = line.match(/Loaded suite (.*)/)\r\n failure_msg = line.match(/[1-9]+ failures/)\r\n err_msg = line.match(/[1-9]+ errors/)\r\n\r\n if ! block_id.nil?\r\n\r\n id = block_id[1]\r\n\r\n elsif ! failure_msg.nil?\r\n\r\n unique_messages[\"FAIL: #{id}\"] = \"\"\r\n\r\n elsif ! err_msg.nil?\r\n\r\n unique_messages[\"ERROR: #{id}\"] = \"\"\r\n\r\n end\r\n\r\n\r\n end\r\n\r\n puts unique_messages.keys.join(\"\\n\")\r\n\r\n\r\nend",
"def parse_flog_output(output)\n res = {\n :total => 0,\n :per_method => []\n }\n output.lines do |line|\n next if line.strip.empty?\n split_result = line.split(' ')\n next if split_result[1].eql? 'flog/method'\n if split_result[1..2].join(' ').eql? 'flog total'\n res[:total] = split_result[0].gsub(/:/,'')\n else\n res[:per_method] << {\n :method => split_result[1],\n :complexity => split_result[0].gsub(/:/,'')\n }\n end\n end\n res\n end",
"def parse(text)\n # match = text.scan(/^(\\/[^:]+):\\s([^:]+):\\s(.+)$/)[0]\n rows = text.split(/\\n/)\n \n rows.shift(rows.length-3) if rows.length > 3\n \n match = rows[0].scan(/^(\\d+)\\t([^\\t]+)\\t([^\\t]+)\\t(.+)$/)[0]\n \n result = {\n :linenumber => match[0],\n :file => match[1],\n :filename => match[2],\n :type => match[3] =~ /warning/i ? \"warning\" : \"error\",\n :description => match[3],\n :code => rows[1],\n :position => rows[2].scan(/^(.*)\\^$/)[0][0].length\n }\n return result\nend",
"def parse_decl_line line\n result = {}\n until line.empty?\n # Peel a key off our line.\n line =~ /^(; )?(\\w+): / or raise \"Can't parse: #{line}\"\n key, line = $2, $POSTMATCH\n \n # Peel a value off our line.\n case line\n when /^([^;\"]+)/\n result[key], line = $1, $POSTMATCH\n when /^\"([^\"]*(\"\"[^\"]*)*)\"/\n str, line = $1, $POSTMATCH\n result[key] = str.gsub(/\"\"/, '\"')\n else\n raise \"Can't parse argument: #{line}\"\n end\n end\n result\n end",
"def capture_value(line)\n value = line.dup\n [@cell_mapping['capture']].flatten.each do |pattern|\n if matchdata = value.to_s.match(pattern)\n value = matchdata[1]\n else\n value = nil\n end\n end\n value.nil? ? value : value.strip\n end",
"def parse_shadow_line(line)\n x = line.split(':')\n {\n 'user' => x.at(0),\n 'password' => x.at(1),\n 'last_change' => x.at(2),\n 'min_days' => x.at(3),\n 'max_days' => x.at(4),\n 'warn_days' => x.at(5),\n 'inactive_days' => x.at(6),\n 'expiry_date' => x.at(7),\n 'reserved' => x.at(8),\n }\n end",
"def read_full_log_entry\n if @reached_eof\n return nil\n end\n\n lines = []\n log_entry = nil\n begin\n loop do\n line = @rfr.readline\n if line.match(MATCHER)\n log_entry = LogLine.new(line, $1 || @log_alias, $2, $3, $4)\n break\n end\n lines.unshift line\n end\n rescue EOFError\n @reached_eof = true\n # Disguard any lines built up as the line starting the log message has not been found\n return nil\n end\n log_entry.append(lines.join(\"\"))\n log_entry\n end",
"def line_level(line)\n if (m = /^(?<level>[A-Z]+): (?<line>.*)$/.match(line))\n line_level = m[:level].downcase.to_sym\n return [line_level, m[:line]] if level?(line_level)\n end\n\n [level, line]\n end",
"def analyze line,&block\n record = []\n ## insert the value into the record\n @fields_range.each do |field,range|\n record.push((line[range] || \"\").strip)\n end\n\n @json[@type][:values] << record\n end",
"def parse_entry(raw_entry)\n match_data = /#{@entry_regexp}/.match(raw_entry)\n return nil unless match_data\n values = match_data.captures\n values.shift if @multiline\n entry_hash([raw_entry, values].flatten)\n end",
"def parse_line line, contexts\n line = line.encode Encoding::UTF_8 if encode_lines?\n\n handler = handler_for_line line\n\n handler.process line, contexts\n end",
"def fill_hash_record_from_line(column_names, headers, line)\n hash_record = {}\n fields = line.split(@sep)\n\n fields.each_with_index do |field, field_id|\n hash_record[headers[field_id]] = field if column_names.include?(headers[field_id])\n end\n\n hash_record\n end",
"def add_parsed_line (parsed_line)\n value_hash = parsed_line[:line_definition].convert_captured_values(parsed_line[:captures], self)\n value_hash[:line_type] = parsed_line[:line_definition].name\n value_hash[:lineno] = parsed_line[:lineno]\n add_line_hash(value_hash)\n end",
"def extract_status_line(line)\n line =~ /RTSP\\/(\\d\\.\\d) (\\d\\d\\d) ([^\\r\\n]+)/\n @rtsp_version = $1\n @code = $2.to_i\n @message = $3\n\n if @rtsp_version.nil?\n raise RTSP::Error, \"Status line corrupted: #{line}\"\n end\n end",
"def parse_args(line)\n match = @pattern.match(line)\n return {} if match.nil?\n\n args = match.to_a.drop(1)\n\n # If the syntax has no arguments, it should parse its command name as arg1\n return { arg1: match.to_a.first } if args.empty?\n\n Hash[*[:arg1, :arg2].zip(args).flatten]\n end",
"def construct_hash(path, line)\n host = Socket.gethostname\n \n {\n :source_path => path,\n :line => line,\n :source_host => host,\n :timestamp => Time.now.utc.iso8601(6),\n :source => Addressable::URI.new(:scheme => 'file', :host => host, :path => path),\n :type => '',\n :fields => {},\n :tags => []\n }\n end",
"def parse_line(line, tags, values, open_tags)\n if line.match(TAG)\n tags = handle_adding_tag($1, tags)\n elsif line.match(OPEN_TAG)\n open_tags.push($1)\n tags = handle_adding_tag($1, tags)\n elsif line.match(CLOSE_TAG)\n open_tags = handle_close_tag($1, open_tags)\n end\n \n values = handle_add_line_to_values(line, values, open_tags)\n \n return tags, values, open_tags\n end",
"def parse_logfile(logfile)\n uploaded_files = { }\n uploaded_files_log = open(logfile).read\n uploaded_files_log.split(/\\s/).each do |line|\n type,local_filename, server_filename = line.split(':')\n uploaded_files[local_filename] = [type, server_filename.sub(@vortex_path,'')]\n end\n return uploaded_files\n end",
"def handle(line)\n parsed = parse(line)\n return unless parsed\n\n handle_parsed(parsed)\n end",
"def parse_header_lines\n if @parsed_values[\"\"].nil? || @parsed_values[\"\"][1].nil?\n @parsed_values[\"\"] = {}\n return\n end\n\n headers = {}\n # Heading lines may have escaped newlines in them\n @parsed_values[\"\"][1].split(/\\\\n/).each do |line|\n next if line.size == 0\n\n if line =~ /(.*?):(.*)/\n key, value = $1, $2\n if headers[key] && headers[key].size > 0\n @errors << [\"Duplicate header line: #{line}\"]\n elsif key =~ /#-#-#-#-#/\n @errors << [\"Marker in header line: #{line}\"]\n else\n headers[key] = value\n end\n else\n @errors << [\"Malformed header #{line}\"]\n end\n end\n\n @parsed_values[\"\"] = headers\n end",
"def parse_lines(lines)\n result = {}\n for l in lines\n fname, desc, time = l.split(/\\t/)\n result[desc] = time.to_f\n end\n return result\n end",
"def log_source\n if is_info?\n file, line = words[1].split(':')\n return [file, line.to_i]\n else\n nil\n end\n end",
"def parse(collector)\n @stream.each_line do |line|\n if match = FORMAT.match(line)\n\n key, value, timestamp = match[:data].split(\"|\")\n\n case match[:type]\n when \"counts\"\n collector.increment(key, value, timestamp)\n when \"gauges\"\n collector.gauge(key, value, timestamp)\n when \"sets\", \"timers\"\n collector.gauge_absolute(key, value, timestamp)\n end\n else\n @errors << \"Unable to process: #{line}\"\n end\n end\n end",
"def _parse_unit_output(line)\n line_match = /^\\[([AB])\\:([A-Z]+)\\#(\\d+)\\@(\\d+)\\](.*)$/.match line\n return nil unless line_match\n {\n :team => line_match[1],\n :unit_type => line_match[2],\n :unit_id => line_match[3].to_i,\n :round => line_match[4].to_i,\n :output => line_match[5]\n }\n end",
"def parse(text)\n logprefix_match = LOG_LINE_PREFIX.match(text)\n database_name = \"UNKNOWN\"\n if logprefix_match\n text = \"LOG:\" + logprefix_match.post_match\n prefix = logprefix_match[1]\n database_match = DATABASE_NAME.match(prefix)\n if database_match\n database_name = database_match[1]\n end\n end\n logdebug_match = LOG_OR_DEBUG_LINE.match(text)\n if logdebug_match\n\n query_match = QUERY_STARTER.match(logdebug_match.post_match)\n if query_match\n return PGQueryStarter.new(query_match.post_match, nil, database_name)\n end\n\n duration_match = DURATION.match(logdebug_match.post_match)\n if duration_match\n additionnal_info = duration_match.post_match.strip.chomp\n if additionnal_info == \"\"\n return PGDurationLine.new(duration_match[1].strip, duration_match[2])\n else\n return PGQueryStarterWithDuration.new(additionnal_info, duration_match[1].strip, duration_match[2], database_name)\n end\n end\n\n status_match = STATUS.match(logdebug_match.post_match)\n if status_match\n return PGStatusLine.new(logdebug_match.post_match)\n end\n\n # $stderr.puts \"Unrecognized LOG or DEBUG line: #{text}\"\n return nil\n end\n\n error_match = ERROR_LINE.match(text)\n if error_match\n return PGErrorLine.new(error_match.post_match)\n end\n\n context_match = CONTEXT_LINE.match(text)\n if context_match\n return PGContextLine.new(context_match.post_match)\n end\n\n continuation_match = CONTINUATION_LINE.match(text)\n if continuation_match\n return PGContinuationLine.new(continuation_match.post_match)\n end\n\n statement_match = STATEMENT_LINE.match(text)\n if statement_match\n return PGStatementLine.new(statement_match.post_match)\n end\n\n hint_match = HINT_LINE.match(text)\n if hint_match\n return PGHintLine.new(hint_match.post_match)\n end\n\n detail_match = DETAIL_LINE.match(text)\n if detail_match\n return PGDetailLine.new(detail_match.post_match)\n end\n\n if text.strip.chomp == \"\"\n return PGContinuationLine.new(\"\")\n end\n\n # $stderr.puts \"Unrecognized PostgreSQL log line: #{text}\"\n return nil\n end",
"def parse_event_line(s)\n minute, word_1, word_2 = s.scan(/.+ ..:(..)\\] (\\S+) (\\S+)/).flatten\n [minute.to_i, word_1, word_2]\n end",
"def parse(report)\n lines = report.split(\"\\n\")\n #puts \"lines: #{lines}\"\n header = lines.shift # remove first line \n lines.collect do |line|\n #puts \"line: #{line}\"\n provider, country, sku, developer, title, version, product_type_id, units, developer_proceeds, begin_date, end_date, currency, country_code, currency_of_proceeds, apple_id, customer_price, promo_code, parent_id, subscription, period = line.split(\"\\t\")\n p = { :provider => provider.strip, \n :country => country.strip, \n :sku => sku.strip, \n :developer => developer.strip, \n :title => title.strip, \n :version => version.strip, \n :product_type_id => product_type_id.strip, \n :units => units.to_i, \n :developer_proceeds => developer_proceeds.to_f, \n :begin_date => Date.strptime(begin_date.strip, '%m/%d/%Y'), \n :end_date => Date.strptime(end_date.strip, '%m/%d/%Y'), \n :currency => currency.strip, \n :country_code => country_code.strip, \n :currency_of_proceeds => currency_of_proceeds.strip, \n :apple_id => apple_id.to_i, \n :customer_price => customer_price.to_f, \n :promo_code => promo_code.strip, \n :parent_id => parent_id.strip, \n :subscription => subscription.strip, \n :period => period\n }\n puts \"parsing failed\".red if p==nil\n p\n end #lines collect\nend",
"def parse_line_data(line)\n line.strip.gsub('\"', '').split ' = '\n end",
"def process_line(line)\n @line = line\n if line =~ /^=/ then\n process_heading_line(line)\n elsif (listtype = special_list_line_type(line)) then\n special_list_line(listtype, line)\n elsif line =~ /^\\s*:/ then\n special_list_continuation_line(line)\n else\n @interp.normal_line(line)\n end\n end",
"def parse_line(lineno, tokens)\n #need to look in the ::TAGS hash for tags that match the level this line is on.\n #Annoyingly, Level 0 has the data and the TAG, reversed for xrefs. \n current_level = @parse_state.level\n new_level = tokens.level\n \n if current_level > new_level\n #Reduce the parse state stack until we are at the new level\n while current_level > new_level\n current_level -= 1\n @parse_state.pop\n end\n process_line(lineno, tokens) #We are now at the same level, so we process the line\n elsif current_level == new_level\n process_line(lineno, tokens) #We are already at the same level, so we just process the line\n elsif current_level < new_level\n raise \"Level increased by more than 1 (current_level = #{current_level}, new_level = #{new_level})\"\n end\n end",
"def decode(line)\n time, tag, *args = line.split\n [tag.to_s.to_sym, decode_args(args), decode_time(time)]\n end",
"def parseLine(line)\n\tif line.include? \"Failed password\" and !line.include? \"invalid user\"\n\t\tlineArray = line.split(pattern=\" \")\n\t\t$attempts.push(Attempt.new(lineArray[0], lineArray[1], lineArray[2], lineArray[10]))\t\n\t#noticed someone was brute forcing my ssh while I left it on overnight, noticed having\n\t#an invalid user changed the wording in /var/log/secure and had to change to this logic\n\telsif line.include? \"Failed password\" and line.include? \"invalid user\"\n\t\tlineArray = line.split(pattern=\" \")\n\t\t$attempts.push(Attempt.new(lineArray[0], lineArray[1], lineArray[2], lineArray[12]))\n\tend\nend",
"def lex_line\n @chunks = @line.scan(/#{BRACKET_RE}|#{DATE_RE}|#{MOD_RE}|#{ATTR_REGEX}|#{OTHER_RE}/).chunk do |seg|\n case seg\n when BRACKET_RE then :bracket\n when MOD_RE then :modifier\n when DATE_RE then :date\n when ATTR_REGEX then :attr\n when OTHER_RE then :other\n else :error\n end\n end.to_a\n # it should be impossible to encounter errors, but cry if they happen\n check_for_errors\n @chunks\n end",
"def parse(log_contents)\n cabrillo_info = Hash.new { |h,k| h[k] = [] }\n log_contents.lines.each do |line|\n line = line.strip\n\n # Ignore comments. (See README.md for info.)\n next if line.start_with? '#' or line.start_with? '//' or line.empty?\n\n # If we already parsed in a contest then we're good. If not, we don't\n # know what to parse as, so skip.\n if line.start_with? \"QSO: \"\n if cabrillo_info[:contest]\n cabrillo_info[:qsos] << parse_qso(line, cabrillo_info[:contest])\n end\n else\n line_key, line_value = line.split(/:\\s+/, 2)\n meta = HEADER_META[line_key]\n next unless meta\n data_key, validators = meta[:data_key], meta[:validators]\n line_value = split_basic_line(line_key, line_value, validators)\n if line_value\n if meta[:multi_line]\n cabrillo_info[data_key] << line_value unless line_value.empty?\n else\n cabrillo_info[data_key] = line_value\n end\n end\n end\n end\n Cabrillo.new(cabrillo_info)\n end",
"def line_postprocess(line)\n # Forces the values to be ASCII strings\n asciify(line)\n\n line[:quotation_time] = ::Nordea.parse_time(line[:quotation_time])\n line[:reserved].strip! if line[:reserved].respond_to? :strip!\n fill_proper_rate_type(line)\n\n line[:euro_area] = (line[:euro_area] == '1')\n\n line[:euro_adoption_date] = if line[:euro_area]\n Nordea.parse_date(line[:euro_adoption_date])\n else\n nil\n end\n\n line[:currency_expiry] = (line[:currency_expiry] == 'K')\n line[:currency_convertability] = (line[:currency_convertability] == 'K')\n floatify(line)\n\n line\n end",
"def recordize line\n line.split(\"\\t\") rescue nil\n end",
"def process_line line\n\tcase line\n\n\twhen /^([a-z]+) is ([I|V|X|L|C|D|M])$/\n\t\tset_space_unit($1, $2)\n\n\twhen /^([a-z ]+)([A-Z]\\w+) is (\\d+) Credits$/\n\t\tget_metals_value($1.split, $2, $3)\n\n\twhen /^how much is ((\\w+ )+)\\?$/ # Get space_units and convert to numeral\n\t\tres = get_numeral_from_space_unit($1.split)\n\t\tputs \"#{$1}is #{res}\"\n\n\twhen /^how many Credits is ([a-z ]+)([A-Z]\\w+) \\?$/\n\t\tres = (get_numeral_from_space_unit($1.split) * @metals_values[$2]).to_i\n\t\tputs \"#{$1}#{$2} is #{res} Credits\"\n\n\telse\n\t\tputs \"I have no idea what you are talking about\"\n\tend\nend",
"def parse(lineno, line)\n tokens = GedLine.new *line.chomp.strip.split(/\\s/)\n parse_line(lineno, tokens)\n end",
"def parse\n @line_count = 0\n @text.each do |line|\n @line_count += 1\n case line\n \n when /^DATE: ?(.*)/\n save_current_match\n parse_date($1)\n\n when /^PLAYER: ?(.*)/\n parse_player($1)\n\n when /^SET/\n parse_set\n \n when /^GAME: ?(.*)/\n parse_game($1)\n \n when /^(\\d\\w\\w?)/\n parse_point($1)\n end\n end\n \n save_current_match\n return @matches\n end",
"def parse_line(line)\n price = 0\n symbol = '---'\n line.children.each do |element|\n if element['class'].include? '__price'\n price = element.text\n elsif element['class'].include? '__symbol'\n symbol = element.text\n end\n end\n result = Hash.new\n result[symbol] = parse_price(price)\n return result\nend",
"def parse_hash\n \thash = {}\n \t# Remove the first five lines of the file\n \ttemp_array = @readin[5, @readin.length]\n \t# Split the input at the semicolon: the left hand side is a timestamp and the right hand side\n \t# is the value (either power in W, or energy in Wh depending on the file type).\n \t# This is committed to a hash with time as the key and the W/Wh as the value.\n \ttemp_array.each do |s|\n \t\tk,v = s.split(/;/)\n \t\t# the Aurora reports time as seconds since 1/1/0000 and Ruby reports time utilizing an epoch\n \t\t# that began on 1/1/1970. The time stamp is adjusted for the time in seconds between these\n \t\t# two dates.\n \t\thash[Time.at(k.to_i - 62167104000)] = v.to_f\n \tend\n \treturn hash\n end",
"def parse(line)\n line = line.gsub('(', '')\n line = line.gsub(')', '')\n tokens = line.split(',')\n\n start_row, start_col = tokens[1].split(':')\n end_row, end_col = tokens[2].split(':')\n\n {\n id: tokens[0],\n end_row: end_row.to_i,\n end_col: end_col.to_i,\n start_row: start_row.to_i,\n start_col: start_col.to_i\n }\n end",
"def format_log(raw)\n return \"...\" unless raw\n raw.split(\"\\n\").map do |l|\n # clean stuff we don't need\n l.gsub!(/I\\s+|\\(\\w*\\)|within bounds/, \"\") # gsub(/\\(\\w*\\)/, \"\"\")\n # if ok, span is green\n ok = l =~ /\\[ok\\]/\n if l =~ /\\[\\w*\\]/\n # get some data we want...\n l.gsub(/\\[\\S*\\s(\\S*)\\]\\W+INFO: (\\w*-?\\w*|.*)?\\s\\[(\\w*)?\\]/, \"<span class='gray'>\\\\1</span> | <span class='#{ok ? 'green' : 'red'}'>\\\\3</span> |\").\n # take only the integer from cpu\n gsub(/cpu/, \"cpu %\").gsub(/(\\d{1,3})\\.\\d*%/, \"\\\\1\").\n # show mem usage in mb\n gsub(/memory/, \"mem mb\").gsub(/(\\d*kb)/) { ($1.to_i / 1000).to_s }\n else\n l.gsub(/\\[\\S*\\s(\\S*)\\]\\W+INFO: \\w*\\s(\\w*)/, \"<span class='gray'>\\\\1</span> | <span class='act'>act</span> | \\\\2\")\n end\n\n end.reverse.join(\"</br>\")\n end",
"def parse_line(line)\n # If the previous line didn't and a logical line, we're not going to start one. If it did,\n # we're indeed going to start a new logical line\n @state[:ll_start] = @state[:ll_end]\n\n # We will start with the assumption that we're going to end the current logical line. We may layer\n # find out that we did not, in fact, do so.\n @state[:ll_end] = true\n\n # Reset the line continuator flag the the last line may have set to true\n @state[:line_continuator] = false\n\n # Find the first non-(space/tab) character\n index = 0\n while index < line.length && [\" \", \"\\t\"].include?(line[index])\n index += 1\n end\n @state[:indent_string] = line[0...index]\n\n # Iterate over the line's characters as long as there are any. We use different iteration\n # methods depending on whether we're inside a string or not\n index = 0\n while index < line.length\n if @state[:in_string].nil?\n index = parse_characters_normal(line, index)\n else\n index = parse_characters_in_string(line, index)\n end\n end\n\n # We have reached the end of the line. Decide whether or not the logical line ends here.\n @state[:ll_end] = @state[:in_string].nil? && @state[:open_braces] == 0 && !@state[:line_continuator]\n end",
"def parse\n current = {}\n @data.split(\"\\n\").each do |line|\n line.chomp!\n next if line.empty?\n\n if line == \"^\"\n unless current.empty?\n @transactions<< current\n current = {}\n end\n\n next\n end\n\n f, v = field_value(line)\n current[f] = v\n end\n\n @transactions<< current unless current.empty?\n end",
"def parse(use_line)\n load_properties(use_line.split(\",\"))\n self\n end"
] |
[
"0.7272941",
"0.6927233",
"0.68746567",
"0.66892266",
"0.6687989",
"0.66836727",
"0.654533",
"0.6504401",
"0.6448429",
"0.63262045",
"0.62551224",
"0.6179464",
"0.61556685",
"0.60570973",
"0.6013876",
"0.5992747",
"0.59810877",
"0.59615934",
"0.59511036",
"0.5940239",
"0.5886486",
"0.58764076",
"0.58510464",
"0.5840577",
"0.58341205",
"0.5829751",
"0.57950425",
"0.5781119",
"0.57758754",
"0.5750071",
"0.5691831",
"0.5689441",
"0.5666604",
"0.5660865",
"0.56263727",
"0.5608096",
"0.55291986",
"0.5493162",
"0.54745543",
"0.54707325",
"0.5464342",
"0.5435322",
"0.5431676",
"0.541675",
"0.5408568",
"0.5376663",
"0.53729546",
"0.5360206",
"0.5344242",
"0.5342499",
"0.5339324",
"0.5332879",
"0.5317561",
"0.5301257",
"0.5277487",
"0.52697384",
"0.5251701",
"0.52355",
"0.5231954",
"0.5224156",
"0.52094626",
"0.5208045",
"0.5200713",
"0.5184438",
"0.51827914",
"0.51801014",
"0.51718795",
"0.5168022",
"0.51569426",
"0.51543736",
"0.51376957",
"0.5112975",
"0.5112899",
"0.51055795",
"0.51012784",
"0.5096689",
"0.50932664",
"0.50892645",
"0.5088825",
"0.5077683",
"0.5065459",
"0.506151",
"0.50582224",
"0.50367564",
"0.502896",
"0.5024924",
"0.5022745",
"0.50168085",
"0.49885896",
"0.49837407",
"0.4983463",
"0.4981918",
"0.49706686",
"0.49654433",
"0.4949792",
"0.49476668",
"0.4936262",
"0.49310103",
"0.49274752",
"0.49217352"
] |
0.60574394
|
13
|
Overwrite this method if you want to use some humanreadable name for log fields. This method is called only once at parse_format time.
|
def rename_this_name(name)
name
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def name_format\n self.name.gsub!(/[^0-9a-z\\-_ ]/i, '_') unless self.name.nil?\n self.name.gsub!(/\\s+/, '-') unless self.name.nil?\n self.name = self.name.downcase unless self.name.nil?\n end",
"def name_format\n self.name.gsub!(/[^0-9a-z\\-_ ]/i, '_') unless self.name.nil?\n self.name.gsub!(/\\s+/, '-') unless self.name.nil?\n self.name = self.name.downcase unless self.name.nil?\n end",
"def field_name\r\n @field_name ||= begin\r\n %r/(\\w+)Field$/.match(name)[1]\r\n rescue\r\n %r/(\\w+)$/.match(name)[1]\r\n end\r\n end",
"def format_name\n title\n end",
"def to_field_name(name)\n # camelize strips leading underscores, which is undesirable.\n if name.to_s.starts_with?('_')\n \"_#{to_field_name(name.to_s[1..-1])}\"\n elsif Rails.config.camel_case\n name.to_s.camelize(:lower)\n else\n name.to_s\n end\n end",
"def field_name\n self.class.name.split(\"::\").last.downcase.sub(\"of\", \"_of_\"). \\\n sub(\"field\", \"\").downcase\n end",
"def set_formats_for_name_and_filename\n self.name = self.name.tr(' ', '_')\n self.filename = self.filename.tr(' ', '_')\n end",
"def format_name\n put_together_name(:full)\n end",
"def [](name)\n ProcessLog.instance_variable_get(:@format)[name]\n end",
"def set_field(field_name, field_value)\n super field_name.to_s, field_value.to_s\n end",
"def human_from_name; end",
"def format=(name)\n @format = name.to_s\n end",
"def log_name\n \"##{id || was || \"?\"}\"\n end",
"def format=(value)\n super(value.to_s.underscore.gsub(/[\\s_]+/,'-'))\n end",
"def name\n base = config[:name]\n @formatted ? \"#{base} (#{@formatted})\" : base\n end",
"def pretty_name\n super || name.humanize\n end",
"def human_name=(_arg0); end",
"def human_name=(_arg0); end",
"def format(name=nil)\n @format = name.to_s if name\n @format || DEFAULT_FORMAT\n end",
"def unique_format_name\n string_with_id(format_name)\n end",
"def field(name); end",
"def display_name(opts)\n opts = check_params(opts,[:field_names])\n super(opts)\n end",
"def format_name(level, full_name)\n lnname = ' '*level+full_name\n if (lnname.length > 60)\n lnname[0..3]+'...'+lnname[-54,lnname.length-1]\n else\n lnname\n end\n end",
"def format_field key\n key.downcase.gsub(%r{[^A-Z0-9]+}xoi,' ').strip.gsub(' ','_')\n end",
"def field_human_name(field)\n I18n.translate(\"#{model_name}.attributes.#{field}\", :count => 1, :default => Inflections.humanize(field), :scope => :models)\n end",
"def unique_format_name\n display_name + \" (#{id || \"?\"})\"\n end",
"def human_to_name; end",
"def get_field_name\n\t\tend",
"def name_with_formatting\n (self.name.blank?) ? 'N/A' : self.name\n end",
"def set_name(info)\n # Do NOT override the value if it's returned from the CAS server\n return info['name'] if info['name']\n info['name'] = case options.name_format\n when :cn\n info['common_name']\n when :full_name\n info['full_name']\n when :first_last_name\n \"#{info['first_name']} #{info['last_name']}\"\n end\n info['name'] ||= info['common_name'] || info['full_name'] ||\n \"#{info['first_name']} #{info['last_name']}\"\n end",
"def unique_format_name\n format_name + \" (#{id || \"?\"})\"\n end",
"def unique_format_name\n title + \" (#{id || \"?\"})\"\n end",
"def human_attribute_name(field_name, options={})\n \"\"\n end",
"def name\n return \"New Log\" if !id\n source.capitalize + \" log at \" + fault_time.strftime(\"%FT%T\")\n end",
"def transform_field_name(key, name)\n hash = ::CUSTOM_FIELD_NAMES\n class_name = self.class.name.demodulize.underscore.to_sym\n return name if hash.nil? || hash[class_name].nil? || hash[class_name][key.to_sym].nil?\n hash[class_name][key.to_sym]\n end",
"def define_field_name(field)\n (field.to_s + '_field').to_sym.tap do |field_method_name|\n field_method_names << field_method_name\n end\n end",
"def format_name\n @site_name ? @site_name : \"\"\n end",
"def proper_name\n\t\t\"#{self.first_name} #{self.last_name}\"\n\tend",
"def name(formatter = :first_last)\n if formatter\n eval('\"' + (USER_FORMATS[formatter] || USER_FORMATS[:first_name_last_name]) + '\"')\n else\n @name ||= eval('\"' + (USER_FORMATS[Setting.user_format] || USER_FORMATS[:first_name_last_name]) + '\"')\n end\n end",
"def format_name(name)\n name.split(' ').join('_')\n end",
"def format_name(name)\n name.split(' ').join('_')\n end",
"def format_name\n name.observation_name\n end",
"def get_string_field(field_name)\n\t\tend",
"def nice_name(node)\n name = attr(node)\n defect_fields[name] || name\n end",
"def log_formatter=(_arg0); end",
"def log_formatter=(_arg0); end",
"def field_names\n internal_format.keys\n end",
"def formatted_name\n @formatted_name ||= self.name.gsub(/\\s?\\+/, ' plus')\n end",
"def name\n super.to_s.titleize\n end",
"def format_name\n [@comment[:first], @comment[:last]].join(' ')\n end",
"def unique_format_name\n if target\n if target.respond_to?(:unique_format_name)\n target.unique_format_name\n else\n target.format_name + \" (#{target_id || \"?\"})\"\n end\n else\n orphan_title\n end\n end",
"def unique_format_name\n if target\n if target.respond_to?(:unique_format_name)\n target.unique_format_name\n else\n target.format_name + \" (#{target_id || \"?\"})\"\n end\n else\n orphan_title\n end\n end",
"def field_name\n @field.name\n end",
"def format_name\n if target\n target.format_name\n else\n orphan_title.sub(/ (\\d+)$/, \"\")\n end\n end",
"def format_name\n if target\n target.format_name\n else\n orphan_title.sub(/ (\\d+)$/, \"\")\n end\n end",
"def field_name\n case @cmd_switch\n when 'add_forgroups'\n 'dc.subject.forgroup'\n\n when 'replace_type'\n 'dc.type'\n\n else\n STDERR.puts \"Invalid command line switch: #{@cmd_switch}\"\n exit 1\n end\n end",
"def update_field_name\n self.field = field_name\n end",
"def full_name\n if name == event.full_name\n name\n elsif event.full_name[name]\n event.full_name\n else\n \"#{event.full_name}: #{name}\"\n end\n end",
"def unique_format_name\n string_with_id(name.observation_name)\n rescue StandardError\n \"\"\n end",
"def format\n self.class.name.split('::').last.downcase.to_sym\n end",
"def log_formatter; end",
"def log_formatter; end",
"def named(name)\n new_name = self.progname.to_s.dup\n new_name << \".\" unless new_name.empty?\n new_name << name\n new_logger = Logger.new(*@base_args)\n [:level, :formatter, :datetime_format].each do |m|\n new_logger.send(\"#{m}=\", self.send(m))\n end\n new_logger.progname = new_name\n new_logger\n end",
"def format_username\n \t_email_base = self.email[/[^@]+/]\n \tself.username ||= _email_base.camelize.underscore.gsub(/\\./,\"_\") unless _email_base.nil?\n\n end",
"def field_def(name)\n @@known_fields_lookup[name] || # the fast way\n @@known_fields.find{|hfd| hfd === name} || # the slow way\n FieldDesc.new(name.to_s.downcase.gsub(/^.|[-_\\s]./) { |x| x.upcase }.gsub('_', '-'), :repeatable => true) # make up as we go\n end",
"def process_field(field_name)\n if ['id', 'name', 'first_name', 'node_id'].include?(field_name)\n \"#{table}.#{field_name}\"\n else\n super # raises\n end\n end",
"def log_prefix\n \"[#{tag}: #{name}]\"\n end",
"def formatted_name\n \"#{self.id} - #{self.name}\"\n #This is used to bring value on each page.\n end",
"def get_verbose_name\n # [Steve, 20140725] This is surely excessively long/repetitive too:\n \"#{edition} #{description} #{header_year} - #{get_federation_type} - (#{begin_date ? begin_date.strftime('%Y') : '?'}/#{end_date ? end_date.strftime('%y') : '?'}) \"\n end",
"def format_name(name)\n name[2..-2].humanize.downcase.gsub ' | ', ': '\n end",
"def readable_name\n \"(#{@type}) #{@name}\"\n end",
"def to_responsys_field(s)\n if @@system_fields.include?(s)\n s.to_s.upcase + \"_\"\n else\n s.to_s.upcase\n end\n end",
"def document_show_field_label(document, field)\n lookup_display_name(document, field) || super\n end",
"def field_title(field)\n field['title'] || last_field_key(field).titleize\n end",
"def parse_names\n strings = bibliography ? bibliography.strings.values : []\n\n NAME_FIELDS.each do |key|\n if name = fields[key]\n name = name.dup.replace(strings).join.to_name\n fields[key] = name unless name.nil?\n end\n end\n\n self\n end",
"def localize(field)\n if klass.fields[field.to_s].try(:localized?)\n field = \"#{field}.#{::I18n.locale}\".to_sym\n end\n field\n end",
"def get_verbose_name\n \"'#{name}' (#{description}), e-mail: #{email}, class: #{year_of_birth}, swimmer ID: #{swimmer_id}\"\n end",
"def formatted_name(data)\n '' << data[:Title] << ' ' <<\n initials(data[:\"First Names\"]) <<\n data[:Surname]\n end",
"def username_format\n return if self.username.nil?\n self.username.gsub!(/[^0-9a-z\\- ]/i, '_')\n self.username.gsub!(/\\s+/, '-')\n self.username = self.username.downcase\n self.username = self.username.byteslice(0, 24) #substring 24\n end",
"def format_name\n name ? name.observation_name : \"\"\n end",
"def converted_field_name\n FIELD_NAMES_TABLE[@token.field_name] || @token.field_name\n end",
"def make_field( field_name, value )\n\t\treturn '' if value.nil? || (value.is_a?(String) && value.empty?)\n\n\t\treturn \"; %s=%s\" % [\n\t\t\tfield_name.capitalize,\n\t\t\tvalue\n\t\t]\n\tend",
"def formal_format(user)\n user.last_name + ', ' + user.first_name + '.'\n end",
"def get_full_name\n # [Steve, 20140725] Too long/repetitive: \"#{description} #{header_year} - #{get_federation_type}\"\n description\n end",
"def translation_for(field)\n object.class.human_attribute_name(field)\n end",
"def log_key\n @log_key ||= \"#{super}: #{name}\"\n end",
"def log_key\n @log_key ||= \"#{super}: #{name}\"\n end",
"def log_key\n @log_key ||= \"#{super}: #{name}\"\n end",
"def log_key\n @log_key ||= \"#{super}: #{name}\"\n end",
"def format_name(attribute_name)\n attribute_name.to_s\n end",
"def unique_partial_format_name\n string_with_id(partial_format_name)\n end",
"def human_name\n @human_name ||= self.to_s.demodulize.titleize\n end",
"def field_name\n @gapi.field_name\n end",
"def index_field_label(document, field)\n lookup_display_name(document, field) || super\n end",
"def fix_format_string(fmt)\n\t\t\tfmt.gsub(\"__\",\"%s\").gsub(\"_\",\"%s\")\n\tend",
"def record_name(n)\n @name = n\n end",
"def attribute_field_name(attr)\n attr.to_s.camelize(:lower)\n end",
"def first_name_field\n $tracer.trace(format_method(__method__))\n return ToolTag.new(@tag.find.input.className(create_ats_regex_string(\"ats-fnamefield\")), format_method(__method__))\n end",
"def field_name(field=nil)\n result = field_name_fragment\n result << \"[#{field}]\" if field\n result\n end",
"def formatter=(_arg0); end",
"def formatter=(_arg0); end"
] |
[
"0.6288333",
"0.6288054",
"0.62814194",
"0.6247554",
"0.6212916",
"0.6185795",
"0.6135804",
"0.61193115",
"0.61130023",
"0.6069614",
"0.6020953",
"0.59954834",
"0.5993604",
"0.59858114",
"0.59818935",
"0.59571743",
"0.59559774",
"0.59559774",
"0.5946609",
"0.593987",
"0.5931262",
"0.592287",
"0.59205693",
"0.5909815",
"0.59095705",
"0.58963466",
"0.58896255",
"0.5873608",
"0.5872499",
"0.5861542",
"0.584872",
"0.5835123",
"0.580994",
"0.58056396",
"0.57645893",
"0.5764569",
"0.5760288",
"0.5749094",
"0.5742675",
"0.57330954",
"0.57330954",
"0.5725141",
"0.5722802",
"0.5719421",
"0.5702776",
"0.5702776",
"0.56987864",
"0.5696127",
"0.5686918",
"0.5681551",
"0.56678355",
"0.56678355",
"0.56674814",
"0.5656694",
"0.5654848",
"0.56422645",
"0.56399953",
"0.56286097",
"0.562245",
"0.5617456",
"0.5616265",
"0.5616265",
"0.5608046",
"0.56060505",
"0.56048423",
"0.55937743",
"0.5589896",
"0.55861765",
"0.5583659",
"0.5581867",
"0.5575667",
"0.55665374",
"0.55548745",
"0.553974",
"0.5536098",
"0.55279106",
"0.55259573",
"0.55238056",
"0.5523213",
"0.5522935",
"0.550987",
"0.54881644",
"0.54876757",
"0.54861134",
"0.54837656",
"0.54806936",
"0.54806936",
"0.54806936",
"0.54806936",
"0.5479876",
"0.54778814",
"0.5475347",
"0.54733217",
"0.5469096",
"0.5468228",
"0.5461882",
"0.5461388",
"0.545501",
"0.5452271",
"0.5445021",
"0.5445021"
] |
0.0
|
-1
|
Parse log format into a suitable Regexp instance.
|
def parse_format(format)
format = format.to_s
format.chomp! # remove carriage return
format.strip! # remove leading and trailing space
format.gsub!(/[ \t]+/, ' ') # replace tabulations or spaces with a space
strip_quotes = proc { |string| string.gsub(/^\\"/, '').gsub(/\\"$/, '') }
find_quotes = proc { |string| string =~ /^\\"/ }
find_percent = proc { |string| string =~ /^%.*t$/ }
find_referrer_or_useragent = proc { |string| string =~ /Referer|User-Agent/ }
pattern = format.split(' ').map do |element|
has_quotes = !!find_quotes.call(element)
element = strip_quotes.call(element) if has_quotes
self.names << rename_this_name(element)
case
when has_quotes
if element == '%r' or find_referrer_or_useragent.call(element)
/"([^"\\]*(?:\\.[^"\\]*)*)"/
else
'\"([^\"]*)\"'
end
when find_percent.call(element)
'(\[[^\]]+\])'
when element == '%U'
'(.+?)'
else
'(\S*)'
end
end.join(' ')
@regexp = Regexp.new("^#{pattern}$")
format
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def parse_entry(log_entry)\n @column = {}; i = 1;\n if attributes = log_entry.match(regexp)\n @args.each {|f| @column[f] = attributes[i]; i += 1}\n parse_datetime! if @column[:time]\n parse_request! if @column[:request]\n end\n @column\n end",
"def parse_format(format)\n format = format.to_s\n format.chomp! # remove carriage return\n format.strip! # remove leading and trailing space\n format.gsub!(/[ \\t]+/, ' ') # replace tabulations or spaces with a space\n\n pattern = format.split(' ').map do |element|\n has_quotes = element =~ /^\\\\\"/\n element = element.gsub(/^\\\\\"/, '').gsub(/\\\\\"$/, '') if has_quotes\n\n self.names << rename_this_name(element)\n\n case\n when has_quotes\n if element == '%r' || element =~ /^%{Referer}/ || element =~ /^%{User-agent}/\n /\"([^\"\\\\]*(?:\\\\.[^\"\\\\]*)*)\"/\n else\n '\\\"([^\\\"]*)\\\"'\n end\n when element =~ /^%.*t$/\n '(\\[[^\\]]+\\])'\n when element == '%U'\n '(.+?)'\n else\n '(\\S*)'\n end\n end.join(' ')\n\n @regexp = Regexp.new(\"^#{pattern}$\")\n format\n end",
"def setup_regex\n @to_from_match = /(\\d+:\\d+:\\d+,\\d+) --> (\\d+:\\d+:\\d+,\\d+)/\n @whitespace_only = /^\\s*$/\n end",
"def log_line_parse(line, options={})\n options={\n :link_to_url => nil, #url /browse/server/#chatroom/00000000\n }.update options\n if line =~ /^---/\n \"\" #strip log open/close stuff. \n else\n date = line[0..7] #ignore 00:00:00\n hx = Digest::MD5.hexdigest(date)\n line = line[8..-1]\n type = case line\n when /^ * [^ ]+ /\n :action_line\n when /^<.[^>]+>/\n :message_line\n when /^-!-/\n case line\n when /now known as/\n :nick_change_line\n when /has (joined|left|quit)/\n :join_part_quit_line\n when /^-!- mode\\//\n :mode_change_line\n end\n end\n type = :unknown_line unless type\n date_line = '<span class=\"line-date\">'\n date_line << \"<a href=\\\"#{options[:link_to_url]}##{hx}\\\">\" if options[:link_to_url]\n date_line << date\n date_line << '</a>' if options[:link_to_url]\n date_line << '</span>'\n%s{<span class=\"line-date\">#{date}</span>}\n<<-END\n <div class=\"#{type}\"><a name=\"#{hx}\">\n #{date_line}\n <span class=\"line-body\">\n #{send(type, line)}\n </span>\n </a></div>\nEND\n end\nend",
"def parse_logline(line) \n line.strip!\n split_line = line.split(/\\|/)\n addr = split_line[0].split(',').last.strip\n\n unless (addr =~ /[\\s|\\-]+/) \n @dns_map.synchronize do\n addr = @dns_map[addr] if @dns_map.include? addr\n end\n details = {}\n details[:upstream_response_time] = split_line[1].split(',').last.strip.to_f\n details[:time_local] = DateTime.strptime(split_line[2], '%d/%b/%Y:%H:%M:%S %Z')\n details[:status] = split_line[3].to_i\n details[:request_length] = split_line[4].to_i\n details[:body_bytes_sent] = split_line[5].to_i\n\n\n @log_entries.synchronize do\n @log_entries[addr] << details\n end\n end \n end",
"def line_regex\n @line_regex ||= /\\<(\\d+)\\>(1) (\\d\\d\\d\\d-\\d\\d-\\d\\dT\\d\\d:\\d\\d:\\d\\d(?:\\.\\d+)?\\+00:00) ([a-z0-9\\-\\_\\.]+) ([a-z0-9\\.-]+) ([a-z0-9\\-\\_\\.]+) (\\-) (.*)$/\n end",
"def log_series_parse(*log_regexes)\n\t\t\n\t\t\n\t\t#First we initialize a temporary array\n\t\ttemparr = []\n\t\t\n\t\t#And we open the output file\n\t\t#!! Throw--Catch this...\n\t\t\n\t\tparseout = CSV.open(\"#{self.to_path}.csv\",'wb')\n\t\t#parseout = CSV.open(\"parseout.csv\",'wb')\n\t\n\t\t#For each line in the IO stream\n\t\tself.each_line do |line|\n\t\t\n\t\t\t#Compare it to each regular expression\n\t\t\tlog_regexes.each do |lr|\n\t\t\t\t\n\t\t\t\t# If it matches,\n\t\t\t\tif m = line.match(lr)\n\t\t\t\t\t\n\t\t\t\t\t#Find out if it's a set, subsection, or none\n\t\t\t\t\tcase lr.type\n\t\t\t\t\t\n\t\t\t\t\t#When it's a set delimiter, \n\t\t\t\t\twhen MatchType::SET\n\t\t\t\t\t\n\t\t\t\t\t\t#If it has a replacement string\n\t\t\t\t\t\tif !lr.replacement_string.empty?\n\t\t\t\t\t\t\t#send the temporary array to the csv\n\t\t\t\t\t\t\tparseout << temparr\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t#reset the temporary array to the replacement str\n\t\t\t\t\t\t\ttemparr = [m[lr.replacement_string.to_sym]]\n\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t#send the temporary array to the csv\n\t\t\t\t\t\t\tparseout << temparr\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t#reset the temporary array\n\t\t\t\t\t\t\ttemparr = []\t\t\t\t\t\t\t\n\t\t\t\t\t\tend\n\t\t\t\t\t\n\t\t\t\t\t#When it's a SUBSECTION delimiter, \n\t\t\t\t\twhen MatchType::SUBSECTION\n\t\t\t\t\t\n\t\t\t\t\t\t#If it has a replacement string\n\t\t\t\t\t\tif !lr.replacement_string.empty?\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t#add a spacer and the replacement string to temparr\n\t\t\t\t\t\t\ttemparr.concat([\"\",m[lr.replacement_string.to_sym]])\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t#add a spacer\n\t\t\t\t\t\t\ttemparr << \"\"\n\t\t\t\t\t\t\t\n\t\t\t\t\t\tend\n\t\t\t\t\t\n\t\t\t\t\t#When it's just a match, \n\t\t\t\t\twhen MatchType::NONE\n\t\t\t\t\t\t\n\t\t\t\t\t\t#Add the contents of the match to the temporary array\n\t\t\t\t\t\ttemparr.concat(m.captures)\n\t\t\t\t\t\n\t\t\t\t\t#When the type is not set, or is none of the above\n\t\t\t\t\telse\n\t\t\t\t\t\tputs \"LogRegexp has an invalid type\"\n\t\t\t\t\tend\n\n\t\t\t\tend\n\t\t\t\t\n\t\t\t\t#no constraint on not matching\n\t\t\t\t\n\t\t\tend\n\t\t\n\t\t\n\t\tend\n\t\t\n\t\t#Then we close out the new csv\n\t\tparseout.close\n\t\t\n\tend",
"def fm_date_to_regexp(fm_format)\n @date_regexp[fm_format] ||= \n Regexp.new('\\A' + fm_format.gsub(FM_DATETIME_FORMAT_MATCHER, FM_DATE_TO_REGEXP_SUBSTITUTIONS) + '\\Z').freeze\n end",
"def call\n @logs = []\n @logs_unique = nil\n File.foreach(@filename) do |line|\n if m = line.match(@log_format)\n @logs.push Log.new(*m.captures)\n else\n raise Error, \"Unmatched lines: #{line}\"\n end\n end\n end",
"def regexp\n pattern = '(?:' + Regexp.union([@name] + @aliases).source + ')'\n\n @arguments.each_value do |format|\n arg_regexp = case format\n when Array then Regexp.union(format)\n when Regexp then format\n when Symbol then ARG_FORMATS.fetch(format)\n else Regexp.escape(format.to_s)\n end\n\n pattern << ' (' << arg_regexp.source << ')'\n end\n\n # match the full message\n pattern << '$'\n\n return Regexp.new(pattern)\n end",
"def parse(text)\n logprefix_match = LOG_LINE_PREFIX.match(text)\n database_name = \"UNKNOWN\"\n if logprefix_match\n text = \"LOG:\" + logprefix_match.post_match\n prefix = logprefix_match[1]\n database_match = DATABASE_NAME.match(prefix)\n if database_match\n database_name = database_match[1]\n end\n end\n logdebug_match = LOG_OR_DEBUG_LINE.match(text)\n if logdebug_match\n\n query_match = QUERY_STARTER.match(logdebug_match.post_match)\n if query_match\n return PGQueryStarter.new(query_match.post_match, nil, database_name)\n end\n\n duration_match = DURATION.match(logdebug_match.post_match)\n if duration_match\n additionnal_info = duration_match.post_match.strip.chomp\n if additionnal_info == \"\"\n return PGDurationLine.new(duration_match[1].strip, duration_match[2])\n else\n return PGQueryStarterWithDuration.new(additionnal_info, duration_match[1].strip, duration_match[2], database_name)\n end\n end\n\n status_match = STATUS.match(logdebug_match.post_match)\n if status_match\n return PGStatusLine.new(logdebug_match.post_match)\n end\n\n # $stderr.puts \"Unrecognized LOG or DEBUG line: #{text}\"\n return nil\n end\n\n error_match = ERROR_LINE.match(text)\n if error_match\n return PGErrorLine.new(error_match.post_match)\n end\n\n context_match = CONTEXT_LINE.match(text)\n if context_match\n return PGContextLine.new(context_match.post_match)\n end\n\n continuation_match = CONTINUATION_LINE.match(text)\n if continuation_match\n return PGContinuationLine.new(continuation_match.post_match)\n end\n\n statement_match = STATEMENT_LINE.match(text)\n if statement_match\n return PGStatementLine.new(statement_match.post_match)\n end\n\n hint_match = HINT_LINE.match(text)\n if hint_match\n return PGHintLine.new(hint_match.post_match)\n end\n\n detail_match = DETAIL_LINE.match(text)\n if detail_match\n return PGDetailLine.new(detail_match.post_match)\n end\n\n if text.strip.chomp == \"\"\n return PGContinuationLine.new(\"\")\n end\n\n # $stderr.puts \"Unrecognized PostgreSQL log line: #{text}\"\n return nil\n end",
"def parse\n out = {}\n begin \n o = @line.match(/(.*?\\d\\d:\\d\\d:\\d\\d) (.*?) (.*?) (.*$)/ )\n out[\"date\"] = o.captures[0].to_ElasticDate\n out[\"machine\"] = o.captures[1]\n out[\"service\"] = o.captures[2]\n m = out[\"service\"].match(/\\[(\\d+)\\]\\:{0,1}/)\n if m then \n out[\"servicePid\"] = m.captures[0]\n out[\"serviceName\"] = out[\"service\"].sub(/\\[\\d+\\]\\:{0,1}/,\"\")\n elsif \n out[\"servicePid\"] = -1\n out[\"serviceName\"] = out[\"service\"].sub(/\\:$/,\"\")\n end\n out[\"message\"] = o.captures[3]\n out[\"parseFails\"] = false\n rescue => ex\n STDERR.puts \"--- Exception in parsing ----\"\n STDERR.puts \"#{@line}\"\n out[\"date\"] = DateTime.now().to_ElasticDate\n out[\"machine\"] = \"\"\n out[\"service\"] = \"\"\n out[\"serviceName\"] = \"\"\n out[\"servicePid\"] = \"\"\n out[\"message\"] = @line\n out[\"parseFails\"] = true\n end\n return out\n end",
"def format_log(raw)\n return \"...\" unless raw\n raw.split(\"\\n\").map do |l|\n # clean stuff we don't need\n l.gsub!(/I\\s+|\\(\\w*\\)|within bounds/, \"\") # gsub(/\\(\\w*\\)/, \"\"\")\n # if ok, span is green\n ok = l =~ /\\[ok\\]/\n if l =~ /\\[\\w*\\]/\n # get some data we want...\n l.gsub(/\\[\\S*\\s(\\S*)\\]\\W+INFO: (\\w*-?\\w*|.*)?\\s\\[(\\w*)?\\]/, \"<span class='gray'>\\\\1</span> | <span class='#{ok ? 'green' : 'red'}'>\\\\3</span> |\").\n # take only the integer from cpu\n gsub(/cpu/, \"cpu %\").gsub(/(\\d{1,3})\\.\\d*%/, \"\\\\1\").\n # show mem usage in mb\n gsub(/memory/, \"mem mb\").gsub(/(\\d*kb)/) { ($1.to_i / 1000).to_s }\n else\n l.gsub(/\\[\\S*\\s(\\S*)\\]\\W+INFO: \\w*\\s(\\w*)/, \"<span class='gray'>\\\\1</span> | <span class='act'>act</span> | \\\\2\")\n end\n\n end.reverse.join(\"</br>\")\n end",
"def validate_cron_line_format\n cron_parser = CronParser.new(cron_line)\n cron_parser.next(Time.zone.now)\n rescue ArgumentError\n errors.add(:cron_line, \"is not a valid crontab entry\")\n end",
"def validate_cron_line_format\n cron_parser = CronParser.new(cron_line)\n cron_parser.next(Time.zone.now)\n rescue ArgumentError\n errors.add(:cron_line, \"is not a valid crontab entry\")\n end",
"def _process_format(format); end",
"def _process_format(format); end",
"def assert_log_match(re)\n assert_match(re, log, \"#{re.inspect} was not found in log.\")\n end",
"def pattern2regex(pattern); end",
"def parse(regexp)\n Parser.parse_regexp(regexp)\n end",
"def initialize(format)\n @regexp = nil\n @names = []\n @format = parse_format(format)\n end",
"def parse_date(text)\n begin\n @current_match = Match.new( Date.parse(text.strip) )\n rescue ArgumentError\n parse_error \"Invalid date format: please use YYYY-MM-DD.\"\n end\n end",
"def matching_lines(regex); end",
"def extract_data_by_pattern(regexp, message_pattern)\n if match = regexp.match(raw_message) then\n # Creates a hash maching :field_x => data\n new_data = Hash[match.names.zip(match.captures)].symbolize_keys\n\n new_data[:timestamp] = DateTime.strptime new_data[:timestamp], \n message_pattern.source.timestamp_definition\n new_data[:timestamp] += log.time_bias.seconds\n\n self.attributes = new_data\n self.message_pattern = message_pattern\n self.save\n end\n end",
"def consider(log)\n log = @parser.parse(log)\n return if log.nil?\n\n update_counters(log)\n end",
"def initialize(format)\n @regexp = nil\n @names = []\n @format = parse_format(format)\n end",
"def parseLog log_name\n\tlog_file = File.open(log_name, \"r\")\n\tcount = 1\n\tfor line in log_file\n\t\tfields = (line.scan LOG_REGEX)[0]\n\t\tsource_addr = fields[0]\n\t\tpayload = fields[4]\n\t\thttp_code = fields[5].to_i\n\t\t# Check if nmap is named\n\t\tif line =~ /\\bnmap\\b/i\n\t\t\tputs \"#{count}. ALERT: NMAP scan is detected from #{source_addr} (HTTP) (#{payload})!\"\n\t\t\tcount += 1\n\t\tend\n\t\t# Check whether code was in error range (400s)\n\t\tif http_code / 100 == 4\n\t\t\tputs \"#{count}. ALERT: HTTP error is detected from #{source_addr} (HTTP) (#{payload})!\"\n\t\t\tcount += 1\n\t\tend\n\t\t# Check both that a shellcode pattern is found, and that a command is attempted\n\t\tif payload =~ SHELL_REGEX and payload =~ REMOTE_REGEX\n\t\t\tputs \"#{count}. ALERT: Shellcode attack is detected from #{source_addr} (HTTP) (#{payload})!\"\n\t\t\tcount += 1\n\t\tend\n\tend\n\tlog_file.close\nend",
"def parse_event_line(s)\n minute, word_1, word_2 = s.scan(/.+ ..:(..)\\] (\\S+) (\\S+)/).flatten\n [minute.to_i, word_1, word_2]\n end",
"def get_matcher\n @matcher_string = self.class.to_s.split('::').last.gsub(/([A-Z][a-z]+)/,'\\1_').chomp('_').upcase\n @log_line_matcher = RailsLogStat.const_get( @matcher_string )\n end",
"def format_regex\n callback.options[:live_validator] || callback.options[:with]\n end",
"def parse_logfilter_file\n path = logfilter_path()\n if path.nil?\n puts \"*** WARNING: filt cannot find expression file #{FILTER_FILENAME}\"\n return\n end\n\n # Determine where to persist compiled file (to avoid unnecessary recompilation)\n persist_path = path + \".compiled_dfa\"\n if File.exist?(persist_path) && File.mtime(persist_path) < File.mtime(path)\n File.delete(persist_path)\n end\n script = FileUtils.read_text_file(path)\n script = precompile_token_script(script)\n @filter_dfa = Tokn::DFA.from_script(script,persist_path)\n end",
"def rematch_on_change!(log_ptn)\r\n return if not self.appended?\r\n return if not log_ptn.multiline?\r\n self.md = log_ptn.match(log)\r\n end",
"def read_full_log_entry\n if @reached_eof\n return nil\n end\n\n lines = []\n log_entry = nil\n begin\n loop do\n line = @rfr.readline\n if line.match(MATCHER)\n log_entry = LogLine.new(line, $1 || @log_alias, $2, $3, $4)\n break\n end\n lines.unshift line\n end\n rescue EOFError\n @reached_eof = true\n # Disguard any lines built up as the line starting the log message has not been found\n return nil\n end\n log_entry.append(lines.join(\"\"))\n log_entry\n end",
"def test_format\n\n\t data = analyse_log(@filename,@keywords, @start, Time.parse(\"31.12.3000\"), @output_file)\n \tdata_hist = prepare_data(data, @keywords, @start, 3600)\n\n \tassert_equal(true, data_hist.keys[0].class == String)\n \tassert_equal(true, data_hist[@keywords[0]].keys[0].class == Time)\n \tassert_equal(true, data_hist[@keywords[0]][0].class == Fixnum)\n\tend",
"def task_2(log)\n result = []\n unless log.nil? || log == 0\n errors = log.scan(/(?i).*error.*/) #If finds error or ERROR returns whole string\n if !errors[0].nil?\n log.sub!(errors[0] + \"\\n\", '') # Removes errors from log\n end\n begin\n log.each_line do |line|\n datetime = line.match(/\\[(.*?)\\]/)[1] # Returns dates\n ip_addres = line.match(/^\\b\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\b/) # Retruns IPs\n endpoint_path = line.match(/\"POST \\/.*\"/)[0].split[1].upcase\n result << \"#{datetime} FROM: #{ip_addres} TO: #{endpoint_path}\"\n end\n result\n rescue NoMethodError # No the best way, but works.\n ''\n end\n end\nend",
"def parse\n @line_count = 0\n @text.each do |line|\n @line_count += 1\n case line\n \n when /^DATE: ?(.*)/\n save_current_match\n parse_date($1)\n\n when /^PLAYER: ?(.*)/\n parse_player($1)\n\n when /^SET/\n parse_set\n \n when /^GAME: ?(.*)/\n parse_game($1)\n \n when /^(\\d\\w\\w?)/\n parse_point($1)\n end\n end\n \n save_current_match\n return @matches\n end",
"def parse_line(line)\n begin\n @loggie.write(\"#{line}\\n\")\n line = line.split(\" \")\n if line[9] == 'voice'\n return Message.new(line[12],line[15],'started.',line[0].to_f,GROUP,line[8])\n elsif line[9] == 'end'\n return Message.new(line[14],line[17].gsub(',',''),'ended.',line[0].to_f,GROUP,line[8])\n elsif line[7] == \"audio\"\n led(\"rx\", line[-2].split('/')[0].to_i / 141.0)\n return \"audio\"\n elsif line[6] == 'group'\n return Message.new(line[4],line[7],line.last,line[0].to_f,GROUP,\"RF\")\n elsif line =~ /Call from/\n return Message.new(line[4],line[6],line.last,line[0].to_f,PRIV,\"RF\")\n end\n rescue => e\n @@logger.debug(e.inspect)\n @@logger.debug(e.backtrace)\n exit 1\n end\n end",
"def syslog_packet_formatter(log)\n packet = SyslogProtocol::Packet.new\n packet.hostname = host\n packet.facility = @facility\n packet.severity = @level_map[log.level]\n packet.tag = application.gsub(' ', '')\n packet.content = formatter.call(log, self)\n packet.time = log.time\n packet.to_s\n end",
"def validates_format_of(*attr_names)\n configuration = {:on => :publish,:message=>\"has invalid format\"}\n configuration.update(attr_names.extract_options!)\n \n format_errors = []\n \n datastream_name, fields = attr_names\n\n raise(ArgumentError, \"A regular expression must be supplied as the :with option of the configuration hash\") unless configuration[:with].is_a?(Regexp)\n\n values = self.datastreams[datastream_name].get_values(fields)\n if !values.empty? && !values.first.empty?\n values.each_with_index do |val,index|\n match = val.match(configuration[:with])\n next if match\n format_errors << construct_message(datastream_name,fields,configuration[:message])\n end\n end\n format_errors.each {|e| self.errors << e }\n\n format_errors.empty?\n end",
"def parse\n lines = text.lines.to_a\n\n @header = lines.shift.strip\n\n parse_release_stamp(@header)\n\n # remove blank lines from top\n lines.shift until lines.first !~ /^\\s+$/\n\n idx = find_changes(lines)\n\n if idx.nil?\n @notes = lines.join\n @changes = ''\n elsif idx > 0\n @notes = lines[0...idx].join\n @changes = lines[idx..-1].join\n else # hmmm... is this ever used?\n gap = lines.index{ |line| /^\\s*$/ =~ line }\n @changes = lines[0...gap].join\n @notes = lines[gap..-1].join\n end\n end",
"def parse(str)\n match_data = str.match(DATE_REGEXP)\n # Oh my god, I hate this shit. Basically it prepares dates for \n # Time.parse consuming because it's so stupid and ignorant it wants\n # to make me puke :(\n from = extract_time_string_from_match_data(match_data)\n to = extract_time_string_from_match_data(match_data, 12)\n\n begin\n from = Time.parse(from) unless from.nil?\n rescue ArgumentError\n from = nil\n end\n\n begin\n if to.nil? and not from.nil?\n case extract_context_from_match_data(match_data)\n when :year\n to = from.end_of_year\n when :month\n to = from.end_of_month\n when :day\n to = from.end_of_day\n when :hour\n to = from + (59 - from.min).minutes + (59 - from.sec)\n when :minute\n to = from + (59 - from.sec)\n end \n else\n to = Time.parse(to)\n end\n rescue ArgumentError\n to = nil\n end\n\n [from, to]\n end",
"def parse_log_file0(file)\n File.open(file) { |input|\n input.each_line.inject(Array.new) { |acc, text|\n entry = handling do\n handle MalformedLogEntryError do\n end\n parse_log_entry(text)\n end\n entry ? acc << entry : acc\n }\n }\nend",
"def parse(log_contents)\n cabrillo_info = Hash.new { |h,k| h[k] = [] }\n log_contents.lines.each do |line|\n line = line.strip\n\n # Ignore comments. (See README.md for info.)\n next if line.start_with? '#' or line.start_with? '//' or line.empty?\n\n # If we already parsed in a contest then we're good. If not, we don't\n # know what to parse as, so skip.\n if line.start_with? \"QSO: \"\n if cabrillo_info[:contest]\n cabrillo_info[:qsos] << parse_qso(line, cabrillo_info[:contest])\n end\n else\n line_key, line_value = line.split(/:\\s+/, 2)\n meta = HEADER_META[line_key]\n next unless meta\n data_key, validators = meta[:data_key], meta[:validators]\n line_value = split_basic_line(line_key, line_value, validators)\n if line_value\n if meta[:multi_line]\n cabrillo_info[data_key] << line_value unless line_value.empty?\n else\n cabrillo_info[data_key] = line_value\n end\n end\n end\n end\n Cabrillo.new(cabrillo_info)\n end",
"def regexp; end",
"def regexp; end",
"def parse(line)\n row = line.to_s\n row.chomp!\n row.strip!\n return unless match = regexp.match(row)\n\n data = {}\n names.each_with_index { |field, index| data[field] = match[index + 1] } # [0] == line\n data\n end",
"def convert_line_to_event(line, es)\n\t\t\tbegin\n\t\t\t\tline.chomp! # remove \\n\n\t\t\t\t@parser.parse(line) { |time, record|\n\t\t\t\t\tif time && record\n\t\t\t\t\t\tes.add(time, record)\n identifier = record[@identifier].gsub(/\\s+/, '')\n if !@redis.get identifier\n @redis.set identifier, true\n @redis.expire identifier, 60*60*24*45\n get_additional_data(identifier)\n end\n else\n\t\t\t\t\t\tlog.warn \"pattern not match\"\n\t\t\t\t\tend\n\t\t\t\t}\n\t\t\trescue => e\n\t\t\t\tlog.warn line.dump, :error => e.to_s\n\t\t\t\tlog.debug_backtrace(e.backtrace)\n\t\t\tend\n\t\tend",
"def initialize(filename)\n @filename = filename\n # log_format: url(without spaces) followed by ip\n @log_format = /^(?<url>[^ ]+) (?<ip>\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3})$/\n @logs = []\n @logs_unique = nil\n end",
"def parse(input)\n entries = []\n input = input.respond_to?(:readline) ? input : StringIO.new(input.to_s)\n begin\n while line = input.readline\n line.chomp!\n if line =~ /^([\\d.]+|-) .* \\[([^\\]]+)\\] \"((?:\\\\\"|[^\"])+)\" (\\d+)(?: (\\d+))?(?: (\\d+))? (\\d+) \"([^\"]+)\" \"([^\"]*)\"/\n # LogFormat \"%{X-mobile-source-IP}i via %h %l %u %t \\\"%r\\\" %>s %O \\\"%{Referer}i\\\" \\\"%{User-Agent}i\\\"\" debug_combined\n # - via 127.0.0.1 - - [15/May/2013:00:00:01 +0200] \"GET /jkmanager?mime=txt HTTP/1.0\" 200 26841 \"-\" \"Wget/1.12 (linux-gnu)\"\n # - via 10.38.252.251 - - [17/Jun/2013:00:28:01 +0200] \"~\\x81\\x10\\xb8\\xa8\\xa2\\x9fd3x\\x94\\x12\\\"2\\xedW\\xe1d\\xact\\xfdB&\\\"\\xe8\\xb0!\\xed\\xfc\\xe9M\\x92\\xf1\\xf3\\x97or\\rzP}FN^\\x18'\\xad\\x0c\\x8a\\xc9T\\x82)\\xb64\\x04\\xaa\\xa8\\xa9X\\xb3V\\x9a\\x87\\xa7G\\xc7}O^~\\\"\\xc3\" 400 88 205 679 \"-\" \"-\"\n entry = Entry.new\n entry.source_ip = $1\n entry.request = $3\n entry.status = $4.to_i\n entry.serve_time = $5.to_i if $5 # in microseconds\n entry.bytes_received = $6.to_i if $6\n entry.bytes_sent = $7.to_i # including headers\n entry.referer = $8\n entry.user_agent = $9\n entry.timestamp = DateTime.parse($2.sub(/:/, ' '))\n entries << entry\n else\n raise \"unrecognized input line: #{line}\"\n end\n end\n rescue EOFError\n end\n\n @entries += entries\n entries\n end",
"def get_log_time(line)\n data_string = line.match(/[\\w]*[\\s]*[\\w]*[\\s]*[^\\s]*/)[0]\n # the year is not included, so this will fail if the current year is different\n # for now we'll hack it to be the current year\n date = DateTime.parse(\"#{data_string} #{REPORT_YEAR}\")\nend",
"def extract_lines\n reg = Regexp.new('^\\[' + @date + ':\\d\\d:\\d\\d:\\d\\d\\].*\\n', Regexp::MULTILINE)\n if File.exists?(@@gzlogfile)\n require 'zlib'\n gzfile = open(@@gzlogfile)\n @gz = Zlib::GzipReader.new(gzfile)\n @gz.read.match(reg).to_s.split(\"\\n\")\n end\n @file.read.match(reg).to_s.split(\"\\n\")\n end",
"def parse_message_from_log_entry\r\n\r\n unique_messages = { }\r\n\r\n id = \"\"\r\n\r\n ARGF.each do |line|\r\n\r\n block_id = line.match(/Loaded suite (.*)/)\r\n failure_msg = line.match(/[1-9]+ failures/)\r\n err_msg = line.match(/[1-9]+ errors/)\r\n\r\n if ! block_id.nil?\r\n\r\n id = block_id[1]\r\n\r\n elsif ! failure_msg.nil?\r\n\r\n unique_messages[\"FAIL: #{id}\"] = \"\"\r\n\r\n elsif ! err_msg.nil?\r\n\r\n unique_messages[\"ERROR: #{id}\"] = \"\"\r\n\r\n end\r\n\r\n\r\n end\r\n\r\n puts unique_messages.keys.join(\"\\n\")\r\n\r\n\r\nend",
"def parse_log_entry(log_entry, reversed=false)\n uuid = log_entry[0].to_guid\n attributes = @@data_store.get(:logs, log_entry[1], uuid)\n attributes[\"uuid\"] = uuid\n new(attributes)\n end",
"def parse\n logs = File.open(log_file).read\n raise InvalidFile if (logs.empty?)\n logs.each_line do |line|\n api_path, ip_address = line.split\n raise InvalidFile if (api_path.nil? || ip_address.nil?)\n parsed_results[api_path] << ip_address\n end\n parsed_results\n end",
"def hashes(log)\n return log.split(\"\\n\").map{|line| parser(line) }\n end",
"def search_logs(pattern)\n raise \"Not implemented\"\n end",
"def parse \n raise \"This has not been implemented yet. Due to the variability of report format, will need to implement a series of specialized parsers\"\n end",
"def initialize(log, time_format=\"%Y-%m-%d %H:%M:%S\")\n @log = log\n @time_format = time_format\n end",
"def validate!\n unless @pattern.kind_of? String\n raise InvalidCronPatternError.new(\"cron pattern must be a string\".squish)\n end\n fix_common_typos! # how nasty!\n # do you know that cron has some pretty good fields, huh?\n # go and,\n validate_fields!\n end",
"def parse_logfile\n each_successful_run do |timestamp, host|\n last[host] = LastRun.new(host, timestamp)\n end\n end",
"def passive(target)\n m = []\n\n if /=~=~=~=~=~=~=~=~=~=~=~= PuTTY log [0-9]{4}.[0-9]{2}.[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2} =~=~=~=~=~=~=~=~=~=~=~=/.match?(target.body)\n\n # Telnet\n if /^Connected to ([^\\s]+)[\\s]+Escape character is '\\^\\]'/.match?(target.body)\n modules = target.body.scan(/^Connected to ([^\\s]+)[\\s]+Escape character is '\\^\\]'/)\n m << { module: modules }\n end\n\n # SSH\n if /^([0-9a-zA-Z\\-\\.\\@_]+)'s password:/.match?(target.body)\n modules = target.body.scan(/^([0-9a-zA-Z\\-\\.\\@_]+)'s password:/)\n m << { module: modules }\n elsif /^login as: ([0-9a-zA-Z\\-\\._]+)/.match?(target.body)\n modules = target.body.scan(/^login as: ([0-9a-zA-Z\\-\\._]+)/)\n m << { module: modules }\n end\n\n if /^Event Log: Writing new session log \\(SSH packets mode\\) to file: /.match?(target.body)\n if /^Event Log: Looking up host \"([^\\\"]+)\"/.match?(target.body)\n account = target.body.scan(/^Event Log: Looking up host \"([^\\\"]+)\"/)\n m << { account: account }\n end\n if /^Event Log: Server version:[\\s]+([^\\s]+)/.match?(target.body)\n version = target.body.scan(/^Event Log: Server version:[\\s]+([^\\s]+)/)\n m << { version: version }\n end\n end\n\n end\n\n m\n end",
"def create_formatter(config)\n log_format = get_format_config(config)\n formatter = Log4r::PatternFormatter.new(:pattern => log_format)\n return formatter\n end",
"def handle_text_line(line, record)\n line =~ record.match ? {:record_type => record.name, :line => line} : nil\n end",
"def create_record(line, path, log_state, process_fields)\r\n directives = {}\r\n\r\n # If we have directive information about fields in the logs parse it.\r\n if log_state.log_directives.fields != nil\r\n directives = Hash[log_state.log_directives.fields.zip(line.split(\" \"))]\r\n end\r\n\r\n if process_fields && log_state.log_directives.fields != nil\r\n record = directives\r\n elsif\r\n record = {'message' => line }\r\n end\r\n\r\n # Add information about where the log entry came from.\r\n record['log-path'] = path\r\n # Attempt to get a timestamp from the fields and/or directives.\r\n timestamp = get_timestamp(directives['date'], directives['time'], log_state.log_directives.date)\r\n record['timestamp'] = timestamp if timestamp != nil\r\n return record\r\n end",
"def match_data\n Pdfh.verbose_print \"~~~~~~~~~~~~~~~~~~ Match Data RegEx\"\n Pdfh.verbose_print \" Using regex: #{@type.re_date}\"\n Pdfh.verbose_print \" named: #{@type.re_date.named_captures}\"\n matched = @type.re_date.match(@text)\n raise ReDateError unless matched\n\n Pdfh.verbose_print \" captured: #{matched.captures}\"\n\n return matched.captures.map(&:downcase) if @type.re_date.named_captures.empty?\n\n extra = matched.captures.size > 2 ? matched[:d] : nil\n [matched[:m].downcase, matched[:y], extra]\n end",
"def parse_line(line)\n ln, fn, mi, sex, fav_color, dob = line.split(' | ')\n LineParser.to_h(fn, ln, mi, sex, fav_color, parse_dob(dob))\n end",
"def parse_log_file(file)\n File.open(file) { |input|\n input.each_line.inject(Array.new) { |acc, text|\n entry = restartable do\n restart :skip_log_entry do\n leave\n end\n parse_log_entry(text)\n end\n entry ? acc << entry : acc\n }\n }\nend",
"def parse_log_file(file_name)\n\n raise ArgumentError, \"Log file does not exist.\" unless File.file?(file_name)\n\n records = []\n\n CSV.foreach(file_name, col_sep: \" \", quote_char: \"'\") do |row|\n # Omit any paths that do not begin with path=/api/users\n if row[4].start_with?(\"path=/api/users/\")\n records.push(LogRecord.new(row))\n end\n end\n\n return records\nend",
"def parse(collector)\n @stream.each_line do |line|\n if match = FORMAT.match(line)\n\n key, value, timestamp = match[:data].split(\"|\")\n\n case match[:type]\n when \"counts\"\n collector.increment(key, value, timestamp)\n when \"gauges\"\n collector.gauge(key, value, timestamp)\n when \"sets\", \"timers\"\n collector.gauge_absolute(key, value, timestamp)\n end\n else\n @errors << \"Unable to process: #{line}\"\n end\n end\n end",
"def regexp\n @regexp ||= Regexp.compile(source.to_s, Regexp::IGNORECASE)\n end",
"def match(regexp); end",
"def parse_time_data input\n while line = input.gets\n line.chomp!\n @line_no += 1\n\n if line =~ /^[\\#;]/\n # ignore comment lines\n elsif line =~ /^(\\d{1,2})\\/(\\d{1,2})\\/(\\d{2}|\\d{4})$/\n # mm/dd/yy or mm/dd/yyyy\n handle_new_day($1, $2, $3)\n elsif line =~ /^([0-9.:]+)\\s*[-]\\s*([0-9.]+)\\s+(\\S+.*)/\n # t1 - t2 description for example:\n # 7.1-13.6 Mantis issues OR (for Jordan :)\n # 7:30-10 Mantis issues\n handle_new_entry($1, $2, $3)\n elsif line.strip.empty?\n # ignore blank lines\n else\n raise \"parse error - invalid line\"\n end\n end\n rescue Exception => e\n puts \"line #{@line_no}: #{e.message}\"\n end",
"def parse(string, type, options={})\n return string unless string.is_a?(String)\n options.reverse_merge!(:strict => true)\n\n sets = if options[:format]\n options[:strict] = true\n [ send(\"#{type}_expressions\").assoc(options[:format]) ]\n else\n expression_set(type, string)\n end\n\n matches = nil\n processor = sets.each do |format, regexp, proc|\n full = /\\A#{regexp}\\Z/ if options[:strict]\n full ||= case type\n when :date then /\\A#{regexp}/\n when :time then /#{regexp}\\Z/\n when :datetime then /\\A#{regexp}\\Z/\n end\n break(proc) if matches = full.match(string.strip)\n end\n last = options[:include_offset] ? 8 : 7\n if matches\n values = processor.call(*matches[1..last]) \n values[0..2] = dummy_date_for_time_type if type == :time\n return values\n end\n end",
"def parse(line)\n row = line.to_s\n row.chomp!\n row.strip!\n return unless match = regexp.match(row)\n\n data = {}\n names.each_with_index { |field, index| data[field] = match[index + 1] } # [0] == line\n data\n end",
"def parse_pattern(pattern)\n return pattern if pattern.is_a?(Regexp)\n\n pattern = pattern.split(/\\//).map do |part|\n if /^:/ =~ part\n \"(?<#{part.sub(\":\", \"\")}>\\\\d+)\"\n else\n part\n end\n end.join(\"/\")\n\n Regexp.new(\"^#{pattern}$\")\n end",
"def line_filter(line)\n entry_pattern.match(line)\n end",
"def regex\n Regexp.new(@str)\n end",
"def parse_date\n REGEX_DATE.match(@request[FTIME]) ? Date.parse($1) : nil\n end",
"def parse_date(input, msg = T.unsafe(nil)); end",
"def format(log_record)\n msg_txt = self.formatMessage(log_record)\n msg_txt = msg_proc.call(log_record, msg_txt) if msg_proc\n return unless msg_txt\n\n lvl = @level_labels[log_record.level]\n indent = @indent || 0\n spacer = ''\n wrap_width = @width - indent\n if log_record.level.intValue < JavaUtilLogger::Level::INFO.intValue\n spacer = ' '\n wrap_width -= 2\n end\n msg = wrap_width > 0 ? Console.wrap_text(msg_txt, wrap_width) : [msg_txt]\n sb = java.lang.StringBuilder.new()\n msg.each_with_index do |line, i|\n if i == 0\n fmt = java.lang.String.format(@format_string,\n log_record.millis,\n log_record.logger_name,\n log_record.logger_name,\n lvl,\n msg[i],\n log_record.thrown,\n spacer)\n else\n fmt = java.lang.String.format(@format_string,\n log_record.millis, '', '', '', msg[i], nil, spacer)\n end\n sb.append(fmt)\n sb.append(LINE_END) if @width < 0 || fmt.length < @width\n end\n sb.toString()\n end",
"def re; end",
"def validate_fields!\n pattern_fields = @pattern.split\n if pattern_fields.size != FIELDS.size\n raise InvalidCronPatternError.new(\"cron pattern must contain exact\n #{FIELDS.size} fields seperated by whitespaces\".squish)\n end\n FIELDS.map.with_index do |field, index|\n field_class = self.class.name + \"::\" + field.split(\"_\"). \\\n map(&:capitalize).join + \"Field\".squish. \\\n classify\n @fields[field.to_sym] = field_class.safe_constantize. \\\n new(pattern_fields[index])\n end\n end",
"def parse(line)\n @pattern, *@owners = line.split(/\\s+/)\n @whitespace = line.split('@').first.count(' ') - 1\n @spec = parse_spec(@pattern)\n end",
"def parse(jid)\n jid.match(PATTERN).captures\n end",
"def parse(line)\n\t\titems = line.split(' ')\n\t\trecord = {}\n\t\t# debugger\n\t\trecord[:event] = items[0]\n\t\trecord[:time] = items[1]\n\t\trecord[:fnode] = items[2]\n\t\trecord[:tnode] = items[3]\n\t\trecord[:pktype] = items[4]\n\t\trecord[:pktsize] = items[5]\n\t\trecord[:fid] = items[7]\n\t\trecord[:srcadd] = items[8]\n\t\trecord[:desadd] = items[9]\n\t\trecord[:seqnum] = items[10]\n\t\trecord[:pktid] = items[11]\n\t\trecord\n\tend",
"def web_log(_log)\n\tinfile = File.open(_log, \"r\")\n\twhile (word = infile.gets)\n\t\tif word =~ /4[0-9][0-9]/\n\t\t\tparse_line(word, \"HTTP 4** Error found\")\t\n\t\t\t#$s404s += 1\n\t\tend\n\t\tif word =~ /[n|N][m|M][a|A][p|P]/ \n\t\t\tparse_line(word, \"nmap found\")\n\t\t\t#$nmaps += 1\n\t\tend\n\t\t#patterns for \\x hex hex (hex)? (hex)? (hex)? \\\n\t\tif word =~ /\\\\x[0-9|a-f|A-F][0-9|a-f|A-F]([0-9|a-f|A-F])?([0-9|a-f|A-F])?([0-9|a-f|A-F])?\\\\/\n\t\t\t#$shells += 1\n\t\t\tparse_line(word, \"Shellcode found\")\n\t\tend\t\n\t\t\n\tend\nend",
"def parse_flog_output(output)\n res = {\n :total => 0,\n :per_method => []\n }\n output.lines do |line|\n next if line.strip.empty?\n split_result = line.split(' ')\n next if split_result[1].eql? 'flog/method'\n if split_result[1..2].join(' ').eql? 'flog total'\n res[:total] = split_result[0].gsub(/:/,'')\n else\n res[:per_method] << {\n :method => split_result[1],\n :complexity => split_result[0].gsub(/:/,'')\n }\n end\n end\n res\n end",
"def lex_line\n @chunks = @line.scan(/#{BRACKET_RE}|#{DATE_RE}|#{MOD_RE}|#{ATTR_REGEX}|#{OTHER_RE}/).chunk do |seg|\n case seg\n when BRACKET_RE then :bracket\n when MOD_RE then :modifier\n when DATE_RE then :date\n when ATTR_REGEX then :attr\n when OTHER_RE then :other\n else :error\n end\n end.to_a\n # it should be impossible to encounter errors, but cry if they happen\n check_for_errors\n @chunks\n end",
"def perform(log)\n if input.is_a?(String)\n sputs(\"Input string: #{input}\")\n elsif input.is_a?(File)\n file = log\n #puts(\"Input is a file\")\n end\n\n sec = section(log)\n\n if @configs[\"matches\"][\"relations\"]\n expr = @configs[\"matches\"][\"relations\"].dup\n expr = @configs[\"matches\"][\"patterns\"].inject(expr) do |e, pattern|\n e = e.gsub(/#{pattern[\"name\"]}/,\"#{match(pattern[\"regexp\"],sec)}\")\n end\n #p expr\n\n if eval(expr)\n p @configs[\"output\"]\n else\n end\n return eval(expr)\n end\n end",
"def parse_logfile\n File.open(\"DietLog.txt\", \"r\") do |f|\n f.each_line do |line|\n line.chomp!\n command = line.split(\",\")\n date = command[0]\n food = command[1]\n addLog(food, date)\n end\n end\n end",
"def match regexp, opt = {}, &block\n opt = { in: :line, match: :first }.merge opt\n (opt[:in] == :output ? receive_update_callbacks : receive_line_callbacks) << lambda do |data|\n matches = data.scan regexp\n if matches.length > 0\n case opt[:match]\n when :first\n EM.next_tick do\n block.call *matches[0]\n end\n when :last\n EM.next_tick do\n block.call *matches[matches.length-1]\n end\n end\n end\n end\n end",
"def parse\n line = @io.gets until md = /\\ATime before run:\\s+(?<time>.*)\\Z/.match(line)\n return unless md\n @db.date_time ||= DateTime.parse(md[:time])\n super\n @db[\"lparstat_out\"] = @db[\"lparstat_sum\"]\n end",
"def match(line)\n regex = self.to_regexp\n regex.match(line.value)\n end",
"def regexp(r0, which)\n source, stop_index = r0.source, r0.stop_index\n return factor_result(source, stop_index, stop_index+$&.length) \\\n if source.index(@regexps[which],stop_index)==stop_index\n terminal_parse_failure(r0, which)\n end",
"def format_expression_generator(string_format)\n regexp = string_format.dup \n order = {}\n regexp.gsub!(/([\\.\\\\])/, '\\\\\\\\\\1') # escapes dots and backslashes\n \n format_tokens.each do |token|\n token_name = token.keys.first\n token_regexp, regexp_str, arg_key = *token.values.first\n \n # hack for lack of look-behinds. If has a capture group then is \n # considered an anchor to put straight back in the regexp string.\n regexp.gsub!(token_regexp) {|m| \"#{$1}\" + regexp_str }\n order[arg_key] = $~.begin(0) if $~ && !arg_key.nil?\n end\n\n return Regexp.new(regexp), format_proc(order)\n rescue\n raise \"The following format regular expression failed to compile: #{regexp}\\n from format #{string_format}.\"\n end",
"def parse_line\n s0 = @scanner.pos\n match_spaces\n s2 = parse_te\n if s2 == :failed\n @scanner.pos = s0\n s0 = :failed\n else\n match_spaces\n s4 = @scanner.pos\n s5 = parse_fugou\n if s5 == :failed\n @scanner.pos = s4\n s4 = :failed\n else\n s6 = parse_from\n if s6 == :failed\n @scanner.pos = s4\n s4 = :failed\n else\n @reported_pos = s4\n s4 = transform_teban_fugou_from(s2, s5, s6)\n end\n end\n if s4 == :failed\n s4 = @scanner.pos\n s5 = []\n s6 = match_regexp(/[^\\r\\n ]/)\n while s6 != :failed\n s5 << s6\n s6 = match_regexp(/[^\\r\\n ]/)\n end\n @reported_pos = s4\n s4 = s5.join\n end\n if s4 == :failed\n @scanner.pos = s0\n s0 = :failed\n else\n match_spaces\n s6 = parse_time\n s6 = nil if s6 == :failed\n match_str('+')\n if parse_nl == :failed\n @scanner.pos = s0\n s0 = :failed\n else\n @reported_pos = s0\n s0 = { 'move' => s4, 'time' => s6 }\n end\n end\n end\n s0\n end",
"def process_line(line)\n return true if line.empty?\n\n chunks = line.split(SPLIT_PATTERN, fmt.length)\n enough_fields?(line) # can raise exception\n\n point = { path: extract_path(chunks),\n value: extract_value(chunks) }\n\n tags = line_tags(chunks)\n\n point.tap do |p|\n p[:tags] = tags unless tags.empty?\n p[:ts] = extract_ts(chunks) if fmt.include?('t')\n p[:source] = extract_source(chunks) if fmt.include?('s')\n p[:interval] = options[:interval] || 'm' if fmt.include?('d')\n end\n end",
"def parse\n\tloop do\n\t\tif await =~ /(\\S+) (\\S+) (\\S+) \\[(.*?)\\] \"(\\S+) (\\S+) (\\S+)\" (\\S+) (\\S+)/\n\t\t\tlog_entry = $~.captures.zip(COLNAMES, COLTYPES).\n\t\t\t\tmap{|val, name, type| [name, val.send(type)] }.\n\t\t\t\tout_connect(Hash.new)\n\t\t\tyield log_entry\n\t\tend\n\tend\nend",
"def valid_line_for line, regexp\n @has_id_col = nil\n @line_id = nil\n return nil unless line_match = line.match(regexp)\n return nil if @options[:id] &&\n has_id_col?(line_match) &&\n @options[:id] != line_id(line_match)\n line_match\n end",
"def read_to(pattern); end"
] |
[
"0.64167714",
"0.6319797",
"0.601778",
"0.5882583",
"0.5825373",
"0.5782248",
"0.57726985",
"0.57099605",
"0.5661816",
"0.56097394",
"0.5558915",
"0.55182856",
"0.55079406",
"0.5492829",
"0.5492829",
"0.54644716",
"0.54644716",
"0.5458618",
"0.54085565",
"0.53458816",
"0.53288823",
"0.5317714",
"0.52876955",
"0.5224047",
"0.5213128",
"0.51979446",
"0.5195875",
"0.5173959",
"0.5139296",
"0.5133874",
"0.5099992",
"0.5089431",
"0.5075021",
"0.50323665",
"0.5031505",
"0.50144976",
"0.50000393",
"0.49904215",
"0.498979",
"0.49790654",
"0.49786627",
"0.49578798",
"0.49550748",
"0.49517095",
"0.49517095",
"0.4949735",
"0.49471262",
"0.49452153",
"0.4938097",
"0.49358085",
"0.49324378",
"0.4922226",
"0.49213827",
"0.49166098",
"0.4911281",
"0.49003714",
"0.48987004",
"0.4897388",
"0.48934212",
"0.48924863",
"0.48755217",
"0.48663485",
"0.48567182",
"0.48500153",
"0.4844538",
"0.4840823",
"0.48290667",
"0.4816217",
"0.48131716",
"0.48108676",
"0.4807853",
"0.47986913",
"0.47931468",
"0.47855064",
"0.4783217",
"0.47800714",
"0.47782958",
"0.47765186",
"0.47683528",
"0.47662574",
"0.47600776",
"0.47600248",
"0.4751388",
"0.47380424",
"0.47365773",
"0.4733737",
"0.47334927",
"0.47300926",
"0.4728733",
"0.47260302",
"0.471669",
"0.4714825",
"0.4713156",
"0.47119874",
"0.47092807",
"0.47083503",
"0.4701787",
"0.4692536",
"0.46887818",
"0.4669727"
] |
0.5866498
|
4
|
POST /questions POST /questions.json
|
def create
@question = Question.new(question_params)
respond_to do |format|
if @question.save
format.html { redirect_to @question, notice: NoticeMessages::SUCCESS_CREATE_QUESTION }
format.json { render :show, status: :created, location: @question }
else
format.html { render :new }
format.json { render json: @question.errors, status: :unprocessable_entity }
end
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def create\n @question = Question.new(question_params)\n\n if @question.save\n render json: @question\n else\n render status: 400, nothing: true\n end\n end",
"def create\n json = params[:survey]\n json[:questions] = JSON.parse(json[:questions])\n json[:questions].each_with_index do |question, idx|\n json[:questions][idx]['id'] = idx + 1\n end\n @survey = Survey.new(json)\n respond_to do |format|\n if @survey.save\n format.html { redirect_to @survey, notice: 'Survey was successfully created.' }\n format.json { render json: @survey, status: :created, location: @survey }\n else\n format.html { render action: \"new\" }\n format.json { render json: @survey.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @question = SurveyQuestion.new(question_params)\n if @question.save\n render json: @question\n else\n render json: @question.errors.full_messages.join(\", \"), status: :unprocessable_entity\n end\n end",
"def create\n @question = Question.new(params[:question])\n\n respond_to do |format|\n if @question.save\n format.html { redirect_to api_v1_question_path(@question), notice: 'Question was successfully created.' }\n format.json { render json: @question, status: :created, location: @question }\n else\n format.html { render action: \"new\" }\n format.json { render json: @question.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n question = @current_user.question.create!(question_params)\n render json: { question: question }\n end",
"def add_question\n form_param = params.require(:form).permit(:id)\n\n render json: Question.add_new_question(form_param)\n end",
"def create\n\t# Finding the current surgeon \n\tsurgeon = current_user\n\t# creating the question with current surgeon\n\tquestion = surgeon.questions.new(question_params)\n\tif question.save\n\t# response to the JSON\n\t\trender json: { success: true,message: \"Question Successfully Created.\", response: QuestionSerializer.new(question).as_json(root: false) },:status=>200\n else\n render :json=> { success: false, message: question.errors },:status=> 203\n end\n\tend",
"def create\n @test_question = TestQuestion.new(params[:test_question])\n\n respond_to do |format|\n if @test_question.save\n format.html { redirect_to @test_question, :notice => 'Test question was successfully created.' }\n format.json { render :json => @test_question, :status => :created, :location => @test_question }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @test_question.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @question = Question.new(question_params)\n\n respond_to do |format|\n if @question.save\n format.html { redirect_to questions_path, notice: 'Question was successfully created.' }\n format.json { render :show, status: :created, location: @question }\n else\n format.html { render :new }\n format.json { render json: @question.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @question = Question.new(params[:question])\n\n respond_to do |format|\n if @question.save\n format.html { redirect_to @question, notice: 'Question was successfully created.' }\n format.json { render json: @question, status: :created, location: @question }\n else\n format.html { render action: \"new\" }\n format.json { render json: @question.errors, status: :unprocessable_entity }\n end\n end\n end",
"def manage_question(body)\n upload_questions(JSON.parse(body)['questions'])\n get_questions\nend",
"def create\n @question = Question.create!(question_params.merge({user_id: 1}))\n if question_params[:answers]\n question_params[:answers].with_indifferent_access.each do |answer|\n Answer.create!(name: answer[:name], question_id: @question.id)\n end\n end\n @question.prepare\n @question.broadcast\n render json: @question, status: :created\n end",
"def create\n @question = Question.new(question_params)\n respond_to do |format|\n if @question.save\n # format.html { redirect_to @question, notice: 'Question was successfully created.' }\n format.json { render json: @question, status: :created, location: @question }\n else\n # format.html { render :new }\n format.json { render json: @question.errors, status: :bad_request }\n end\n end\n end",
"def create\n @question = Question.new(question_params)\n\n respond_to do |format|\n if @question.save\n format.html { redirect_to @question }\n format.json { render :show, status: :created, location: @question }\n else\n format.html { render :new }\n format.json { render json: @question.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @question = Question.new(question_params)\n\n respond_to do |format|\n if @question.save\n format.html { redirect_to @question, notice: 'Question was successfully created.' }\n format.json { render :show, status: :created, location: @question }\n else\n format.html { render :new }\n format.json { render json: @question.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @question = Question.new(question_params)\n\n respond_to do |format|\n if @question.save\n format.html { redirect_to @question, notice: 'Question was successfully created.' }\n format.json { render :show, status: :created, location: @question }\n else\n format.html { render :new }\n format.json { render json: @question.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @question = Question.new(question_params)\n\n respond_to do |format|\n if @question.save\n format.html { redirect_to @question, notice: 'Question was successfully created.' }\n format.json { render :show, status: :created, location: @question }\n else\n format.html { render :new }\n format.json { render json: @question.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @question = Question.new(question_params)\n\n respond_to do |format|\n if @question.save\n format.html { redirect_to @question, notice: 'Question was successfully created.' }\n format.json { render :show, status: :created, location: @question }\n else\n format.html { render :new }\n format.json { render json: @question.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @question = Question.new(question_params)\n\n respond_to do |format|\n if @question.save\n format.html { redirect_to @question, notice: 'Question was successfully created.' }\n format.json { render :show, status: :created, location: @question }\n else\n format.html { render :new }\n format.json { render json: @question.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @question = Question.new(question_params)\n\n respond_to do |format|\n if @question.save\n format.html { redirect_to @question, notice: 'Question was successfully created.' }\n format.json { render :show, status: :created, location: @question }\n else\n format.html { render :new }\n format.json { render json: @question.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @question = Question.new(question_params)\n\n respond_to do |format|\n if @question.save\n format.html { redirect_to @question, notice: 'Question was successfully created.' }\n format.json { render :show, status: :created, location: @question }\n else\n format.html { render :new }\n format.json { render json: @question.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @question = Question.new(question_params)\n\n respond_to do |format|\n if @question.save\n format.html { redirect_to @question, notice: 'Question was successfully created.' }\n format.json { render :show, status: :created, location: @question }\n else\n format.html { render :new }\n format.json { render json: @question.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @question = Question.new(question_params)\n\n respond_to do |format|\n if @question.save\n format.html { redirect_to @question, notice: 'Question was successfully created.' }\n format.json { render :show, status: :created, location: @question }\n else\n format.html { render :new }\n format.json { render json: @question.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @question = Question.new(question_params)\n\n respond_to do |format|\n if @question.save\n format.html { redirect_to @question, notice: 'Question was successfully created.' }\n format.json { render :show, status: :created, location: @question }\n else\n format.html { render :new }\n format.json { render json: @question.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @question = Question.new(question_params)\n\n respond_to do |format|\n if @question.save\n format.html { redirect_to @question, notice: 'Question was successfully created.' }\n format.json { render :show, status: :created, location: @question }\n else\n format.html { render :new }\n format.json { render json: @question.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @v1_question = V1::Question.new(v1_question_params)\n\n if @v1_question.save\n render json: @v1_question, status: :created\n else\n render json: get_errors, status: :unprocessable_entity\n end\n end",
"def create\n @question = Question.new(question_params)\n\n respond_to do |format|\n if @question.save\n format.html { redirect_to @question, notice: \"Question was successfully created.\" }\n format.json { render :show, status: :created, location: @question }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @question.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @add_question = AddQuestion.new(add_question_params)\n\n respond_to do |format|\n if @add_question.save\n format.json { head :no_content }\n else\n format.html { render :new }\n format.json { render json: @add_question.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @test_question = TestQuestion.new(test_question_params)\n\n respond_to do |format|\n if @test_question.save\n format.html { redirect_to @test_question, notice: 'Test question was successfully created.' }\n format.json { render :show, status: :created, location: @test_question }\n else\n format.html { render :new }\n format.json { render json: @test_question.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @test_question = TestQuestion.new(test_question_params)\n\n respond_to do |format|\n if @test_question.save\n format.html { redirect_to @test_question, notice: 'Test question was successfully created.' }\n format.json { render :show, status: :created, location: @test_question }\n else\n format.html { render :new }\n format.json { render json: @test_question.errors, status: :unprocessable_entity }\n end\n end\n end",
"def question_params\n params.require(:question).permit(:title, :body)\n #require returns question array\n #of everything being posted, work with the questions part, and allow these two things to be submitted\n end",
"def create\n @question = current_user.questions.new(params[:question])\n\n respond_to do |format|\n if @question.save\n format.html { redirect_to @question, notice: params.inspect}#'Question was successfully created.' }\n format.json { render json: @question, status: :created, location: @question }\n else\n format.html { render action: \"new\" }\n format.json { render json: @question.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @api_v1_question = Api::V1::Question.new(api_v1_question_params)\n\n respond_to do |format|\n if @api_v1_question.save\n format.html { redirect_to @api_v1_question, notice: 'Question was successfully created.' }\n format.json { render :show, status: :created, location: @api_v1_question }\n else\n format.html { render :new }\n format.json { render json: @api_v1_question.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @question = Question.new(question_params)\n respond_to do |format|\n if @question.save\n format.html { redirect_to new_question_url, notice: \"已经成功创建题目:#{@question.title}.\" }\n format.json { render :show, status: :created, location: @question }\n else\n format.html { render :new }\n format.json { render json: @question.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @my_question = MyQuestion.new(params[:my_question])\n\n respond_to do |format|\n if @my_question.save\n format.html { redirect_to @my_question, notice: 'My question was successfully created.' }\n format.json { render json: @my_question, status: :created, location: @my_question }\n else\n format.html { render action: \"new\" }\n format.json { render json: @my_question.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n result = Question.new.create_question(question_params)\n if result\n return render json: {message: 'Question was created succesfully', error: false}\n else\n return render json: {message: 'Error: Question was not created succesfully', error: true}\n end\n end",
"def add_question\n\t\t\tif(current_instructor.quizzes.exists?(:id => params[:quiz_id]))\n\t\t\t\tquiz = current_instructor.quizzes.find(params[:quiz_id])\n\t\t\t\tno = quiz.no_of_MCQ + quiz.no_of_rearrangeQ\t\n\t\t\t\tno.times do |n|\n\t\t\t\t\tquestion = Question.create((params[\"_json\"][n]).permit([:text, :mark, :right_answer, :choices => []]))\n\t\t\t\t\tquiz.questions << question\n\t\t\t\tend\n\t\t\t\trender json: { info: \"created\"}, status: 201\n\t\t\telse\n\t\t\t\trender json: { error:\"Quiz is not found\" }, status: 422\n\t\t\tend\n\t\tend",
"def create\n\t\t@question = Question.create(params[:question])\n\t\t@question.user = current_user\n\t\trespond_to do |format|\n\t\t\tif @question.save\n\t\t\t\tformat.html { redirect_to @question, notice: 'Question was successfully created.' }\n\t\t\t\tformat.json { render json: @question, status: :created, location: @question }\n\t\t\telse\n\t\t\t\tformat.html { render action: \"new\" }\n\t\t\t\tformat.json { render json: @question.errors, status: :unprocessable_entity }\n\t\t\tend\n\t\tend\n\tend",
"def questions\n self.class.get(\"/2.2/questions\", @options)\n end",
"def new\n @question = Question.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @question }\n end\n end",
"def new\n @question = Question.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @question }\n end\n end",
"def new\n @question = Question.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @question }\n end\n end",
"def new\n @question = Question.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @question }\n end\n end",
"def new\n @question = Question.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @question }\n end\n end",
"def new\n #@question = Question.new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @question }\n end\n end",
"def create\n filtered_params = filter_params(question_params)\n @question = @form.questions.new(filtered_params)\n\n respond_to do |format|\n if @question.save\n format.html { redirect_to admin_form_questions_path, notice: 'Вопрос успешно создан' }\n format.json { render :show, status: :created, location: @question }\n else\n format.html { render :new }\n format.json { render json: @question.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n @questions = Question.all\n @question = Question.new\n @answers = @question.answers.build\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @question }\n end\n end",
"def create\n @question = Question.new(question_params)\n\n respond_to do |format|\n if @question.save\n format.js\n format.json { render :show, status: :created, location: @question }\n else\n format.html { render :new }\n format.json { render json: @question.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n @test_question = TestQuestion.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @test_question }\n end\n end",
"def create\t\n\tquestion_param = question_params.merge(:words => in_words(question_params[\"answer\"].to_i))\n @question = Question.new(question_param)\n respond_to do |format|\n if @question.save\n format.html { redirect_to @question, notice: 'Question was successfully created.' }\n format.json { render :show, status: :created, location: @question }\n else\n format.html { render :new }\n format.json { render json: @question.errors, status: :unprocessable_entity }\n end\n end\n\t#=end\n end",
"def new\n @question = Question.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @question }\n end\n end",
"def create\n @question = Question.new(params[:question])\n\n respond_to do |format|\n if @question.save(params[:question])\n format.html { redirect_to new_question_url, notice: 'questions was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @question.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @quiz = Quiz.new(quiz_params)\n questions_arr.each do |i|\n question = Question.new(question_params(i))\n choices_arr(i).each do |j|\n choice = Choice.new(choice_params(j))\n choice.save\n question.choices << choice\n end\n @quiz.questions << question\n end\n\n if @quiz.save\n User.find(params[:user_id]).quizzes << @quiz\n render json: @quiz, status: :created, location: @quiz\n else\n render json: @quiz.errors, status: :unprocessable_entity\n end\n end",
"def handle_post(body)\n make_response(200, validate_questions(body))\nend",
"def create\n #@question = Question.new(params[:question])\n #@question.node = current_node\n @question.user_id = current_user.id\n respond_to do |format|\n if @question.save\n format.html { redirect_to @question, notice: t('alert.question.create_success', default: 'Question was successfully created.') }\n format.json { render json: @question, status: :created, location: @question }\n else\n format.html { render action: \"new\" }\n format.json { render json: @question.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n @question = Question.new\n respond_to do |format|\n format.html # new.html.erb\n #format.json { render json: @question }\n end\n end",
"def create\n workout = Workout.find params[:workout_id]\n result = Question.create(workout, { \n :body => params[:body], \n :answer_type => params[:answer_type] }, \n params[:answers].values\n )\n\n @question = result[:question]\n\n respond_to do |format|\n unless @question.persisted?\n format.json { render :json => @question.errors.full_messages, :status => :unprocessable_entity }\n else\n format.json { render :json => @question.as_json({:include => :answers}) }\n end\n \n end\n\n end",
"def question_params\n params.require(:question).permit(:title, :body, :answer)\n end",
"def question(data)\n xml = xml_root(\"questions\")\n\n arrayed(data).each do |name|\n xml.root << (XML::Node.new(\"question\") << name)\n end\n\n send_and_process('questions/add', 'questions/question', xml)\n end",
"def create\n @quiz = current_user.quizzes.build(quiz_params)\n\n @quiz.questions.each do |q|\n if q.question_type == \"free_answer\"\n q.answers = []\n end\n end\n\n puts @quiz.questions\n\n respond_to do |format|\n if @quiz.save\n format.html { redirect_to current_user, notice: 'Quiz was successfully created.' }\n format.json { render :show, status: :created, location: @quiz }\n else\n format.html { render :new }\n format.json { render json: @quiz.errors, status: :unprocessable_entity }\n end\n end\n end",
"def question_params\n params.require(:question).permit(:question)\n end",
"def question_params\n params.require(:question).permit(:question, :answer)\n end",
"def question_params\n params.require(:question).permit(:question, :answer)\n end",
"def create\n @question = Question.new(question_params)\n @question.user = current_user\n\n respond_to do |format|\n if @question.save\n format.html { redirect_to @question, notice: 'Question was successfully created.' }\n format.json { render json: @question, status: :created, location: @question }\n else\n format.html { render action: \"new\" }\n format.json { render json: @question.errors, status: :unprocessable_entity }\n end\n end\n end",
"def question_params\n params.require(:question).permit(:title, :answer)\n end",
"def create\n quiz = Quiz.new(set_quiz_params)\n\n respond_to do |format|\n format.json do\n \n if quiz.valid?\n if quiz.save!\n render json: success_api({ question: quiz.question }, \"You fill correct answer!\")\n else\n render json: failed_api({ question: quiz.question }, \"You fill incorrect answer!\")\n end\n else\n render json: failed_api({}, quiz.errors.full_messages.first)\n end\n end\n end\n end",
"def new\n @my_question = MyQuestion.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @my_question }\n end\n end",
"def new\n @question = Question.new\n # @question.save\n render :json => {:question_id => @question.id}.to_json\n # respond_to do |format|\n # format.html # new.html.erb\n # format.xml { render :xml => @question }\n # end\n end",
"def create\n @form = Form.new(form_params)\n return unless can_form_be_created?(@form)\n @form.created_by = current_user\n @form.form_questions = create_form_questions\n if @form.save\n render :show, status: :created, location: @form\n else\n render json: @form.errors, status: :unprocessable_entity\n end\n end",
"def index\n render_json(current_user.created_questions)\n end",
"def index\n @questions = Question.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @questions }\n end\n end",
"def create\n @question = Question.new(question_params)\n @question.user_id = current_user.id\n\n respond_to do |format|\n if @question.save\n format.html { redirect_to @question, notice: 'Question was successfully created.' }\n format.json { render :show, status: :created, location: @question }\n else\n format.html { render :new }\n format.json { render json: @question.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n respond_to do |format|\n if @question.save\n @question_link = QuizQuestion.create!(:qtype => params[:qtype], :qid => @question.id, :quizid => params[:quizid], :points => params[:points])\n @question_link.save\n @question.update(:questionid => @question_link.id)\n @quiz = Quiz.find_by_id(params[:quizid])\n format.html { redirect_to admin_quiz_path(@quiz), notice: 'Quiz multiple choice question was successfully created.' }\n format.json { render :show, status: :created, location: @question }\n else\n format.html { render :new }\n format.json { render json: @question.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n authorize_action_for Question\n @question = current_user.questions.new(question_params)\n @question.user = current_user\n\n respond_to do |format|\n if @question.save\n format.html { redirect_to @question, notice: 'Question was successfully created.' }\n format.json { render :show, status: :created, location: @question }\n else\n format.html { render :new }\n format.json { render json: @question.errors, status: :unprocessable_entity }\n end\n end\n end",
"def question_params\n # params.require(:tst).permit(:name, :description, :status, :contributors)\n params.require(:question).permit(:name, :description, :status, :hint, :image_url, :explanation, :kind, :correct_response, :pause_at)\n end",
"def ask_questions\n if request.post?\n @album = Album.find( params[:answers][:album_id])\n @user = @album.user\n @question = Question.find params[:answers][:question_id]\n Answer.create(question: @question,\n content: params[:answers][:content],\n guest: current_guest)\n logger.info \"GUEST: #{current_guest}\"\n @questions = params[:answers][:questions].gsub('[','').\n gsub(']','').\n split(',').\n map{|id| id.to_i}\n if @questions.any?\n @album_id = @album.id\n @question = Question.find(@questions.first)\n @questions = @questions[1..-1]\n respond_to do |format|\n format.js\n format.html\n end\n else\n #reset_session\n render 'guests/thank_you'\n end\n end\n end",
"def create\n @cards_question = Cards::Question.new(params[:cards_question])\n\n respond_to do |format|\n if @cards_question.save\n format.html { redirect_to @cards_question, notice: 'Question was successfully created.' }\n format.json { render json: @cards_question, status: :created, location: @cards_question }\n else\n format.html { render action: \"new\" }\n format.json { render json: @cards_question.errors, status: :unprocessable_entity }\n end\n end\n end",
"def delete_question\n question_params = params.permit(:id, :form_id, :question_type_id)\n\n render json: Question.delete_question(question_params)\n end",
"def get_question_list\n json= RestClient.get(\"http://localhost:3000/questions\")\n JSON.parse(json)\n end",
"def create\n @question = Question.new question_params.merge user_id: current_user.id\n @question.build_post embedded_post_params\n\n respond_to do |format|\n if @question.save\n format.html { redirect_to @question, notice: 'Question was successfully created.' }\n format.json { render :show, status: :created, location: @question }\n else\n format.html { render :new }\n format.json { render json: @question.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n\t\t@question = Question.new\n\n\t\trespond_to do |format|\n\t\t\tformat.html # new.html.erb\n\t\t\tformat.json { render json: @question }\n\t\tend\n\tend",
"def create\n @question = Question.find(params[:question_id])\n @answer = @question.answers.new(answer_params)\n\n respond_to do |format|\n if @answer.save\n format.html { redirect_to question_answer_url(@question, @answer), notice: \"Answer was successfully created.\" }\n format.json { render :show, status: :created, location: @answer }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @answer.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create_mod\n if params[:title] != nil && params[:content] != nil && params[:subId] != nil && params[:userId] != nil && params[:groupId] != nil\n @question.title = params[:title]\n @question.content = params[:content]\n @question.subId = params[:subId].to_i\n @question.userId = params[:userId].to_i\n @question.groupId = params[:groupId].to_i\n\n question_json = @question.to_h.to_json\n\n url = @httpIp+'/pet.com/api/question/createQuestion'\n uri = URI(url)\n res = Net::HTTP.post(uri, question_json, \"Content-Type\" => \"application/json\")\n puts res.body\n flash[:notice] = \"successfully created\"\n redirect_to questions_path\n\n end\n end",
"def question_params\n params.require(:question).permit(:title, :body, :answer, :tag_list, :slug)\n end",
"def create\n @question = Question.new(question_params)\n @question.zavrseno = \"N\"\n @question.user = @current_user\n @question.uposlenik = User.find(params[:uposlenik_id])\n respond_to do |format|\n if @question.save\n format.json { render json: @question, status: :created, location: api_question_url(@question) }\n else\n format.json { render json: @question.errors, status: :unprocessable_entity }\n end\n end\n end",
"def index\n @questions = Question.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @questions }\n end\n end",
"def create\n @mongo_question = MongoQuestion.new(mongo_question_params)\n @mongo_question.topics = params['mongo_question']['topics']\n respond_to do |format|\n if @mongo_question.save\n format.html { redirect_to @mongo_question, notice: 'Mongo question was successfully created.' }\n format.json { render :show, status: :created, location: @mongo_question }\n else\n format.html { render :new }\n format.json { render json: @mongo_question.errors, status: :unprocessable_entity }\n end\n end\n\n Question.create mongo_id: @mongo_question._id, registrant_id: current_registrant_id\n end",
"def create\n #before_action :set_tag\n #ログインしているユーザーが質問を作る\n @question = current_user.questions.build(question_params)\n # respond_to: リクエストされるフォーマットがHTML形式の場合とJSON形式の場合で処理を分けることができる\n respond_to do |format|\n if @question.save\n # TODO: 経験値機能の処理\n # current_user.get_exp(10)\n # current_user.check_level_up\n format.html { redirect_to @question, notice: \"質問を投稿しました\" }\n format.json { render :show, status: :created, location: @question }\n else\n #savaできなかった場合\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @question.errors, status: :unprocessable_entity }\n end\n end\n end",
"def question_params\n params.require(:question).permit()\n end",
"def new\n @question = current_user.questions.new\n\t2.times do\n\t @question.choices.build\n\tend\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @question }\n end\n end",
"def create\n @question = Question.new(params[:question])\n @question.user_id = current_user.id\n render :json => @question.id if @question.save\n # respond_to do |format|\n # if @question.save \n # format.html { redirect_to(@question, :notice => 'Question was successfully created.') }\n # format.xml { render :xml => @question, :status => :created, :location => @question }\n # else \n # format.html { render :action => \"new\" }\n # format.xml { render :xml => @question.errors, :status => :unprocessable_entity }\n # end\n # end\n end",
"def create\n\t@question = Question.new(params[:question])\n\n\n\trespond_to do |format|\n\t if @question.save\n\t\tformat.html { redirect_to(@question, :notice => 'Question was successfully created.') }\n\t\tformat.xml { render :xml => @question, :status => :created, :location => @question }\n\t else\n\t\tformat.html { render :action => \"new\" }\n\t\tformat.xml { render :xml => @question.errors, :status => :unprocessable_entity }\n\t end\n\tend\n end",
"def answered\n @the_question = Question.find(params[:id])\n @the_question.answered = true\n @the_question.save\n render json: [{question: @the_question}]\n end",
"def question_params\n params.require(:question).permit(:title, :quest, :answer,:category)\n end",
"def index\n render json: @test_module.test_questions, status: :ok\n end",
"def question_params\n params.require(:question).permit(:title, :content)\n end",
"def question_params\n params.require(:question).permit(:title, :content)\n end",
"def question_params\n params.require(:question).permit(:title, :content)\n end",
"def question_params\n params.require(:question).permit(:title, :content)\n end",
"def create\n @question = Question.new(question_params)\n\n respond_to do |format|\n if @question.save\n QuestionMailer.trial_email(@question).deliver_now\n format.html { redirect_to root_path, notice: 'Your submission was successfully submitted.' }\n format.json { render :show, status: :created, location: @question }\n else\n format.html { render :new }\n format.json { render json: @question.errors, status: :unprocessable_entity }\n end\n end\n end"
] |
[
"0.7366109",
"0.72979563",
"0.7059195",
"0.7000753",
"0.6956294",
"0.68727475",
"0.67733675",
"0.6729471",
"0.67116046",
"0.6706642",
"0.6705714",
"0.6689426",
"0.6647686",
"0.6635359",
"0.662669",
"0.662669",
"0.662669",
"0.662669",
"0.662669",
"0.662669",
"0.662669",
"0.662669",
"0.662669",
"0.662669",
"0.6625894",
"0.662092",
"0.6601877",
"0.6558875",
"0.6548659",
"0.6548659",
"0.65406907",
"0.65115905",
"0.646109",
"0.6445682",
"0.64166427",
"0.6414391",
"0.6404002",
"0.639564",
"0.63947415",
"0.6387393",
"0.6387393",
"0.6387393",
"0.6387393",
"0.6387393",
"0.6386238",
"0.63760614",
"0.63557696",
"0.6340648",
"0.63274425",
"0.6314545",
"0.6312669",
"0.6299439",
"0.62768507",
"0.62720907",
"0.6270051",
"0.6265692",
"0.62607133",
"0.62591845",
"0.62558407",
"0.62556267",
"0.6251766",
"0.6247266",
"0.6247266",
"0.62400955",
"0.6235286",
"0.62129605",
"0.6205474",
"0.6200678",
"0.61998135",
"0.61994785",
"0.6198937",
"0.61715096",
"0.6167117",
"0.61634505",
"0.61620706",
"0.6159416",
"0.6155171",
"0.615452",
"0.6149144",
"0.61482686",
"0.61474997",
"0.614291",
"0.61420697",
"0.61375695",
"0.6135676",
"0.61338896",
"0.6133791",
"0.6133205",
"0.6128408",
"0.61057246",
"0.6105505",
"0.6104671",
"0.6096927",
"0.6096527",
"0.6096222",
"0.6083402",
"0.6083402",
"0.6083402",
"0.6083402",
"0.608301"
] |
0.658238
|
27
|
PATCH/PUT /questions/1 PATCH/PUT /questions/1.json
|
def update
check_delete_flg
respond_to do |format|
if @question.update_attributes(question_params)
format.html { redirect_to @question, notice: 'Question was successfully updated.' }
format.json { render :show, status: :ok, location: @question }
else
format.html { render :edit }
format.json { render json: @question.errors, status: :unprocessable_entity }
end
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def update\n @question = Question.find(params[:id])\n\n respond_to do |format|\n if @question.update_attributes(params[:question])\n format.html { redirect_to api_v1_question_path(@question), notice: 'Question was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @question.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n question = Question.find(params[:id_question])\n if question.update(params_question)\n render json: question, status: 200\n else\n render json: question.errors, status: 422\n end\n\n end",
"def update\n @survey = Survey.find(params[:id])\n json = params[:survey]\n json[:questions] = JSON.parse(json[:questions])\n json[:questions].each_with_index do |question, idx|\n json[:questions][idx]['id'] = idx + 1\n end\n\n respond_to do |format|\n if @survey.update_attributes(json)\n format.html { redirect_to @survey, notice: 'Survey was successfully updated.' }\n format.json { render json: @survey }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @survey.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @question = Question.find(params[:id])\n\n respond_to do |format|\n if @question.update_attributes(params[:question])\n format.json { render :json => 'Question updated OK' }\n format.xml { head :ok }\n else\n format.json { render :json => @question.errors }\n format.xml { render :xml => @question.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @question = Question.find(params[:id])\n\n respond_to do |format|\n if @question.update_attributes(params[:question])\n format.html { redirect_to new_question_path, notice: 'questions was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @question.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @api_v1_question.update(api_v1_question_params)\n format.html { redirect_to @api_v1_question, notice: 'Question was successfully updated.' }\n format.json { render :show, status: :ok, location: @api_v1_question }\n else\n format.html { render :edit }\n format.json { render json: @api_v1_question.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @question = Question.find(params[:id])\n\n respond_to do |format|\n if @question.update_attributes(params[:question])\n format.html { redirect_to @question, :notice => 'Question was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @question.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @question = Question.find(params[:id])\n\n respond_to do |format|\n if @question.update_attributes(params[:question])\n format.html { redirect_to @question, notice: 'Question was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @question.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @question = Question.find(params[:id])\n\n respond_to do |format|\n if @question.update_attributes(params[:question])\n format.html { redirect_to @question, notice: 'Question was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @question.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @question = Question.find(params[:id])\n\n respond_to do |format|\n if @question.update_attributes(params[:question])\n format.html { redirect_to @question, notice: 'Question was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @question.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @question = Question.find(params[:id])\n\n respond_to do |format|\n if @question.update_attributes(params[:question])\n format.html { redirect_to @question, notice: 'Question was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @question.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @question = Question.find(params[:id])\n\n respond_to do |format|\n if @question.update_attributes(params[:question])\n format.html { redirect_to @question, notice: 'Question was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @question.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @question = Question.update(params[:id], { \n :body => params[:body], \n :answer_type => params[:answer_type] }, \n params[:answers].values\n )\n\n respond_to do |format|\n format.json { render :json => @question.as_json({:include => :answers}) }\n\n # if @question.update_attributes(params[:question])\n # format.html { redirect_to @question, :notice => 'Question was successfully updated.' }\n # format.json { head :no_content }\n # else\n # format.html { render :action => \"edit\" }\n # format.json { render :json => @question.errors, :status => :unprocessable_entity }\n # end\n end\n end",
"def update\n @question = Question.find(params[:id])\n\n respond_to do |format|\n if @question.update_attributes(params[:question])\n format.html { redirect_to @question, notice: 'Question was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @question.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n if @v1_question.update(v1_question_params)\n render json: @v1_question, status: :ok\n else\n render json: get_errors, status: :unprocessable_entity\n end\n end",
"def update\n @question = Question.find(params[:id])\n\n respond_to do |format|\n if @question.update_attributes(question_params)\n format.html { redirect_to @question, notice: 'Question was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @question.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update_mod\n if params[:title] != nil && params[:content] != nil\n @question.title = params[:title]\n @question.content = params[:content]\n\n question_json = @question.to_h.to_json\n\n url = @httpIp+'/pet.com/api/question/updateQuestion'\n uri = URI(url)\n res = Net::HTTP.post(uri, question_json, \"Content-Type\" => \"application/json\")\n puts res.body\n flash[:notice] = \"successfully updated\"\n redirect_to questions_path\n end\n end",
"def update\n #@question = Question.find(params[:id])\n respond_to do |format|\n if @question.update_attributes(params[:question])\n format.html { redirect_to @question, notice: t('alert.question.update_success', default: 'Question was successfully updated.') }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @question.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @question = Question.find(params[:id])\n @question.update_attributes(params[:question])\n render :json => @question.id if @question.save\n # respond_to do |format|\n # if @question.update_attributes(params[:question])\n # format.html { redirect_to(@question, :notice => 'Question was successfully updated.') }\n # format.xml { head :ok }\n # else\n # format.html { render :action => \"edit\" }\n # format.xml { render :xml => @question.errors, :status => :unprocessable_entity }\n # end\n # end\n end",
"def update\n question = Question.find_by!(id: params[:id])\n if question\n question.name = params[:name]\n question.description = params[:description]\n question.user_id = params[:user_id]\n question.category_id = params[:category_id]\n question.zavrseno = params[:zavrseno]\n question.uposlenik_id = params[:uposlenik_id]\n question.save\n render json: question, status: 200 \n else\n render json: { errors: \"This link is invalid.\"}, status: 404\n end\n end",
"def update\n @test_question = TestQuestion.find(params[:id])\n\n respond_to do |format|\n if @test_question.update_attributes(params[:test_question])\n format.html { redirect_to @test_question, :notice => 'Test question was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @test_question.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @question.update(question_params)\n format.html { redirect_to @question, notice: 'Question was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @question.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @question.update(question_params)\n format.html { redirect_to @question, notice: 'Question was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @question.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @question.update(question_params)\n format.html { redirect_to @question, notice: 'Question was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @question.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @question = Question.find(params[:id])\n\n respond_to do |format|\n if @question.update_attributes(params[:question])\n format.html { redirect_to @question.course, notice: 'Question was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @question.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @question = Question.find(params[:id])\n\n respond_to do |format|\n if @question.update_attributes(params[:question])\n format.html { redirect_to(@question, :notice => 'Question was successfully updated.') }\n format.xml { head :ok }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @question.errors, :status => :unprocessable_entity }\n\t\t\t\tformat.json { render :json => @question.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @question.update(question_params)\n format.html { redirect_to edit_question_path(@question), notice: 'Question was successfully updated.' }\n format.json\n else\n format.html { render :edit }\n format.json { render json: @question.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @my_question = MyQuestion.find(params[:id])\n\n respond_to do |format|\n if @my_question.update_attributes(params[:my_question])\n format.html { redirect_to @my_question, notice: 'My question was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @my_question.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @question.update(question_params)\n format.html { redirect_to @question, :notice =>'Question was successfully updated.' }\n format.json { render :show, :status => :ok, :location => @question }\n else\n format.html { render :edit }\n format.json { render :json => @question.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @question.update(question_params)\n format.html { redirect_to @question, notice: 'Question was successfully updated.' }\n format.json { render :show, status: :ok, location: @question }\n else\n format.html { render :edit }\n format.json { render json: @question.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @question.update(question_params)\n format.html { redirect_to @question, notice: 'Question was successfully updated.' }\n format.json { render :show, status: :ok, location: @question }\n else\n format.html { render :edit }\n format.json { render json: @question.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @question.update(question_params)\n format.html { redirect_to @question, notice: 'Question was successfully updated.' }\n format.json { render :show, status: :ok, location: @question }\n else\n format.html { render :edit }\n format.json { render json: @question.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @question.update(question_params)\n format.html { redirect_to @question, notice: 'Question was successfully updated.' }\n format.json { render :show, status: :ok, location: @question }\n else\n format.html { render :edit }\n format.json { render json: @question.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @question.update(question_params)\n format.html { redirect_to @question, notice: 'Question was successfully updated.' }\n format.json { render :show, status: :ok, location: @question }\n else\n format.html { render :edit }\n format.json { render json: @question.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @question.update(question_params)\n format.html { redirect_to @question, notice: 'Question was successfully updated.' }\n format.json { render :show, status: :ok, location: @question }\n else\n format.html { render :edit }\n format.json { render json: @question.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @question.update(question_params)\n format.html { redirect_to @question, notice: 'Question was successfully updated.' }\n format.json { render :show, status: :ok, location: @question }\n else\n format.html { render :edit }\n format.json { render json: @question.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @question.update(question_params)\n format.html { redirect_to @question, notice: 'Question was successfully updated.' }\n format.json { render :show, status: :ok, location: @question }\n else\n format.html { render :edit }\n format.json { render json: @question.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @question.update(question_params)\n format.html { redirect_to @question, notice: 'Question was successfully updated.' }\n format.json { render :show, status: :ok, location: @question }\n else\n format.html { render :edit }\n format.json { render json: @question.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @question.update(question_params)\n format.html { redirect_to @question, notice: 'Question was successfully updated.' }\n format.json { render :show, status: :ok, location: @question }\n else\n format.html { render :edit }\n format.json { render json: @question.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @question.update(question_params)\n format.html { redirect_to @question, notice: 'Question was successfully updated.' }\n format.json { render :show, status: :ok, location: @question }\n else\n format.html { render :edit }\n format.json { render json: @question.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @question.update(question_params)\n format.html { redirect_to @question, notice: 'Question was successfully updated.' }\n format.json { render :show, status: :ok, location: @question }\n else\n format.html { render :edit }\n format.json { render json: @question.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @question.update(question_params)\n format.html { redirect_to @question, notice: 'Question was successfully updated.' }\n format.json { render :show, status: :ok, location: @question }\n else\n format.html { render :edit }\n format.json { render json: @question.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @question.update(question_params)\n format.html { redirect_to @question, notice: 'Question was successfully updated.' }\n format.json { render :show, status: :ok, location: @question }\n else\n format.html { render :edit }\n format.json { render json: @question.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @question.update(question_params)\n format.html { redirect_to @question, notice: 'Question was successfully updated.' }\n format.json { render :show, status: :ok, location: @question }\n else\n format.html { render :edit }\n format.json { render json: @question.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @question.update(question_params)\n format.html { redirect_to @question, notice: 'Question was successfully updated.' }\n format.json { render :show, status: :ok, location: @question }\n else\n format.html { render :edit }\n format.json { render json: @question.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @question.update(question_params)\n format.html { redirect_to @question, notice: 'Question was successfully updated.' }\n format.json { render :show, status: :ok, location: @question }\n else\n format.html { render :edit }\n format.json { render json: @question.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @question.update(question_params)\n format.html { redirect_to @question, notice: 'Question was successfully updated.' }\n format.json { render :show, status: :ok, location: @question }\n else\n format.html { render :edit }\n format.json { render json: @question.errors, status: :unprocessable_entity }\n end\n end\n end",
"def edit_question\n\t\t\tquizzes = current_instructor.quizzes\n\t\t\t@found = 0\n\t\t\tquizzes.each do |quiz|\n\t\t\t\tif(quiz.questions.exists?(:id => params[:question_id]))\n\t\t\t\t\t@found = @found + 1\n\t\t\t\tend \n\t\t\tend\n\t\t\tif (@found > 0)\n\t\t\t\tquestion = Question.find(params[:question_id])\n\t\t\t\tif (question.update(question_params))\n\t\t\t\t\trender json: { success: true, data: { :question => question }, info:{} }, status: 200\n\t\t\t\telse\n\t\t\t\t\trender json: { error: question.errors }, status: 422 \n\t\t\t\tend\t\n\t\t\telse\n\t\t\t\trender json: { error:\"Question is not found\" }, status: 422\n\t\t\tend\n\t\tend",
"def update\n\t\t@question = Question.find(params[:id])\n\n\t\trespond_to do |format|\n\t\t\tif @question.update_attributes(params[:question])\n\t\t\t\tformat.html { redirect_to @question, notice: 'Question was successfully updated.' }\n\t\t\t\tformat.json { head :no_content }\n\t\t\telse\n\t\t\t\tformat.html { render action: \"edit\" }\n\t\t\t\tformat.json { render json: @question.errors, status: :unprocessable_entity }\n\t\t\tend\n\t\tend\n\tend",
"def update\n respond_to do |format|\n if @question.update(question_params)\n format.html { redirect_to @question, notice: \"Question was successfully updated.\" }\n format.json { render :show, status: :ok, location: @question }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @question.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @question = Question.find(params[:id])\n\n respond_to do |format|\n if @question.update_attributes(params[:question])\n if (@question.question_type.short_text? || @question.question_type.open_ended_text?)\n path = survey_path(params[:survey_id])\n else\n path = survey_question_path(params[:survey_id],@question.id)\n end\n format.html { redirect_to path, notice: 'Question was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @question.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n authorize @question\n respond_to do |format|\n if @question.update(question_params)\n format.html { redirect_to @question, notice: 'Question was successfully updated.' }\n format.json { render :show, status: :ok, location: @question }\n else\n format.html { render :edit }\n format.json { render json: @question.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @question.update(question_params)\n format.html { redirect_to [@category, @question], notice: 'Question was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @question.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update_question\n respond_to do |format|\n if @question.update(question_params)\n format.html { redirect_to :planner, notice: 'Question was successfully updated.' }\n format.json { respond_with_bip(@question) }\n else\n format.html { render :edit }\n format.json { render json: @question.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n\n respond_to do |format|\n if @question.update_attributes(params[:question])\n format.html { redirect_to quiz_path(@question.subsection_id), notice: 'Question was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @question.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @questions_option = QuestionsOption.find(params[:id])\n\n respond_to do |format|\n if @questions_option.update_attributes(params[:questions_option])\n format.html { redirect_to @questions_option, notice: 'Questions option was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @questions_option.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @question.update(question_params)\n format.html { redirect_to @question, notice: 'La pregunta fue modificada correctamente.' }\n format.json { render :show, status: :ok, location: @question }\n else\n format.html { render :edit }\n format.json { render json: @question.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @questionset = Questionset.find(params[:id])\n\n respond_to do |format|\n if @questionset.update_attributes(params[:questionset])\n format.html { redirect_to @questionset, notice: 'Questionset was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @questionset.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update_correct_answer\n question_params = params.permit(:question_id, :question_type_id, :option_id)\n \n render json: Question.update_correct_option(question_params)\n end",
"def update\n @question_set = QuestionSet.find(params[:id])\n\n respond_to do |format|\n if @question_set.update_attributes(params[:question_set])\n format.html { redirect_to @question_set, notice: 'Question set was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @question_set.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n # before_action :set_question\n #before_action :set_tag\n respond_to do |format|\n if @question.update(question_params)\n format.html { redirect_to @question, notice: \"更新しました\" }\n format.json { render :show, status: :ok, location: @question }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @question.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @question.update(question_params)\n format.html { redirect_to @question, notice: 'Question was successfully updated.' }\n format.json { head :no_content }\n format.js { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @question.errors, status: :unprocessable_entity }\n format.js { head :unprocessable_entity }\n end\n end\n end",
"def update\n authorize_action_for @question\n respond_to do |format|\n if @question.update(question_params)\n format.html { redirect_to @question, notice: 'Question was successfully updated.' }\n format.json { render :show, status: :ok, location: @question }\n else\n format.html { render :edit }\n format.json { render json: @question.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n\n qp = question_params\n if qp[:question_type] == \"vignette\" or qp[:question_type] == \"nonchoice\"\n qp[:answer] = \"\"\n end\n\n respond_to do |format|\n if @question.update(qp)\n format.html { redirect_to paper_questions_path(question_params[:paper_id],question_params[:id]), notice: '題目已被成功編輯' }\n format.json { render :show, status: :ok, location: @question }\n else\n format.html { redirect_to edit_paper_question_path, notice: '上傳檔案大小不可超過500KB' }\n format.json { render json: paper_questions_path.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @question = Question.find(params[:id])\n \n respond_to do |format|\n if @question.update_attributes(params[:question])\n format.html { redirect_to(@question, :notice => 'Question was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @question.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update_question_type\n form_params = params.require(:form).permit(:question_id, :question_type)\n\n render json: Question.update_question_type(form_params)\n end",
"def update\n @question = @quiz.questions.find(params[:id])\n\n respond_to do |format|\n if @question.update_attributes(params[:question])\n flash[:notice] = 'Question was successfully updated.'\n format.html { redirect_to(quiz_questions_path(@quiz)) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @question.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @test_question.update(test_question_params)\n format.html { redirect_to @test_question, notice: 'Test question was successfully updated.' }\n format.json { render :show, status: :ok, location: @test_question }\n else\n format.html { render :edit }\n format.json { render json: @test_question.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n\t@question = Question.find(params[:id])\n\n\trespond_to do |format|\n\t if @question.update_attributes(params[:question])\n\t\tformat.html { redirect_to(@question, :notice => 'Question was successfully updated.') }\n\t\tformat.xml { head :ok }\n\t else\n\t\tformat.html { render :action => \"edit\" }\n\t\tformat.xml { render :xml => @question.errors, :status => :unprocessable_entity }\n\t end\n\tend\n end",
"def update\n if @question.status == 'published' || @question.version_independent_id != question_params[:version_independent_id]\n render json: @question.errors, status: :unprocessable_entity\n else\n update_response_sets(params)\n @question.update_concepts('Question')\n @question.updated_by = current_user\n if @question.update(question_params)\n @question.groups.each do |group|\n @question.add_to_group(group.id)\n end\n render :show, status: :ok, location: @question\n else\n @categories = Category.all\n render json: @question.errors, status: :unprocessable_entity\n end\n end\n end",
"def update\n question = Question.find(params[:id])\n authorize question\n\n new_version = question.template.generate_version?\n\n old_question_ids = {}\n if new_version\n # get a map from option number to id\n old_number_to_id = {}\n question.question_options.each do |opt|\n old_number_to_id[opt.number] = opt.id\n end\n\n # get a map from question versionable id to old id\n question.template.questions.each do |q|\n old_question_ids[q.versionable_id] = q.id\n end\n end\n\n question = get_modifiable(question)\n\n question_id_map = {}\n if new_version\n # params now out of sync (after versioning) with the question_options\n # so when we do the question.update it'll mess up\n # need to remap params to keep them consistent\n old_to_new_opts = {}\n question.question_options.each do |opt|\n old_id = old_number_to_id[opt.number]\n old_to_new_opts[old_id.to_s] = opt.id.to_s\n end\n\n question.template.questions.each do |q|\n question_id_map[old_question_ids[q.versionable_id].to_s] = q.id.to_s\n end\n end\n\n # rewrite the question_option ids so they match the new\n # version of the question\n # and also rewrite the remove_data question ids\n attrs = question_params\n attrs = update_option_ids(attrs, old_to_new_opts) if new_version && !attrs['question_options_attributes'].nil?\n\n # Need to reattach the incoming annotation's and question_options to the\n # modifiable (versioned) question\n attrs = transfer_associations(attrs, question) if new_version\n\n # If the user unchecked all of the themes set the association to an empty array\n # add check for number present to ensure this is not just an annotation\n attrs[:theme_ids] = [] if attrs[:theme_ids].blank? && attrs[:number].present?\n if question.update(attrs)\n if question.update_conditions(sanitize_hash(params['conditions']),\n old_to_new_opts, question_id_map)\n flash.now[:notice] = success_message(question, _('updated'))\n end\n else\n flash.now[:alert] = flash.now[:alert] = failure_message(question, _('update'))\n end\n if question.section.phase.template.customization_of.present?\n redirect_to org_admin_template_phase_path(\n template_id: question.section.phase.template.id,\n id: question.section.phase.id,\n section: question.section.id\n )\n else\n redirect_to edit_org_admin_template_phase_path(\n template_id: question.section.phase.template.id,\n id: question.section.phase.id,\n section: question.section.id\n )\n end\n end",
"def update\n @intake_question = IntakeQuestion.find(params[:id])\n\n respond_to do |format|\n if @intake_question.update_attributes(params[:intake_question])\n format.html { redirect_to @intake_question, notice: 'Intake question was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @intake_question.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @question = Question.find(params[:id])\n\n respond_to do |format|\n if @question.update_attributes(params[:question])\n format.html { redirect_to(@question, :notice => 'Question was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @question.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @question = Question.find(params[:id])\n\n respond_to do |format|\n if @question.update_attributes(params[:question])\n format.html { redirect_to(@question, :notice => 'Question was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @question.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @question = Question.find(params[:id])\n\n respond_to do |format|\n if @question.update_attributes(params[:question])\n format.html { redirect_to(@question, :notice => 'Question was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @question.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @question = Question.find(params[:id])\n\n respond_to do |format|\n if @question.update_attributes(params[:question])\n format.html { redirect_to(@question, :notice => 'Question was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @question.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @question = Question.find(params[:id])\n\n respond_to do |format|\n if @question.update_attributes(params[:question])\n format.html { redirect_to(@question, :notice => 'Question was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @question.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def patch!\n request! :patch\n end",
"def update\n authorize! :update, @admin_question\n\n respond_to do |format|\n if @admin_question.update(admin_question_params)\n format.html { redirect_to @admin_question, notice: 'Question was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @admin_question.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update_question_content\n question_params = params.require(:question).permit(:id, :content)\n\n render json: Question.update_question_content(question_params)\n end",
"def update\n @critical_question = CriticalQuestion.find(params[:id])\n\n respond_to do |format|\n if @critical_question.update_attributes(params[:critical_question])\n format.html { redirect_to @critical_question, notice: 'Critical question was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @critical_question.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @cards_question = Cards::Question.find(params[:id])\n\n respond_to do |format|\n if @cards_question.update_attributes(params[:cards_question])\n format.html { redirect_to @cards_question, notice: 'Question was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @cards_question.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @examquestion.update(examquestion_params)\n format.html { redirect_to @examquestion, notice: 'Examquestion was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @examquestion.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @question = Question.find(params[:id])\n\n respond_to do |format|\n if @question.update_attributes(params[:question])\n format.html { redirect_to(@question) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @question.errors,\n :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @multiple_choice_question = MultipleChoiceQuestion.find(params[:id])\n\n respond_to do |format|\n if @multiple_choice_question.update_attributes(params[:multiple_choice_question])\n format.html { redirect_to @multiple_choice_question, notice: 'Multiple choice question was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @multiple_choice_question.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @question.update(question_params)\n format.js\n format.json { render :show, status: :ok, location: @question }\n else\n format.html { render :edit }\n format.json { render json: @question.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n redirect_to \"/\"\n\n # respond_to do |format|\n # if @question.update(question_params)\n # format.html { redirect_to @question, notice: 'Question was successfully updated.' }\n # format.json { render :show, status: :ok, location: @question }\n # else\n # format.html { render :edit }\n # format.json { render json: @question.errors, status: :bad_request }\n # end\n # end\n end",
"def update\n respond_to do |format|\n if @add_question.update(add_question_params)\n format.html { redirect_to @add_question, notice: 'Add question was successfully updated.' }\n format.json { render :show, status: :ok, location: @add_question }\n else\n format.html { render :edit }\n format.json { render json: @add_question.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @survey_question = SurveyQuestion.find(params[:id])\n\n respond_to do |format|\n if @survey_question.update_attributes(params[:survey_question])\n format.html { redirect_to survey_questions_path(@survey_question.survey_id),\n notice: 'Survey question was successfully updated.' }\n #format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n #format.json { render json: @survey_question.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @poll_question = PollQuestion.find(params[:id])\n\n respond_to do |format|\n if @poll_question.update_attributes(params[:poll_question])\n format.html { redirect_to @poll_question, notice: 'Poll question was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @poll_question.errors, status: :unprocessable_entity }\n end\n end\n end",
"def api_patch(path, data = {})\n api_request(:patch, path, :data => data)\n end",
"def update\n @question = Question.find(params[:id])\n respond_to do |format|\n if @question.update_attributes(params[:question])\n flash[:notice] = 'Question was successfully updated.'\n format.html { redirect_to(@question) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @question.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @mongo_question.update(mongo_question_params)\n format.html { redirect_to @mongo_question, notice: 'Mongo question was successfully updated.' }\n format.json { render :show, status: :ok, location: @mongo_question }\n else\n format.html { render :edit }\n format.json { render json: @mongo_question.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @questionset.update(questionset_params)\n format.html { redirect_to @questionset, notice: 'Questionset was successfully updated.' }\n format.json { render :show, status: :ok, location: @questionset }\n else\n format.html { render :edit }\n format.json { render json: @questionset.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @b_question.update(b_question_params)\n format.html { redirect_to @b_question }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @b_question.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @faq = Faq.find(params[:id])\n\n respond_to do |format|\n if @faq.update_attributes(params[:faq])\n format.html { redirect_to @faq, notice: 'FAQ atualizada com sucesso.' }\n format.json { head :no_content }\n else\n @subjects = Subject.all\n format.html { render action: \"edit\" }\n format.json { render json: @faq.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @template_question.update(template_question_params)\n format.html { redirect_to @template_question, notice: 'Template question was successfully updated.' }\n format.json { render :show, status: :ok, location: @template_question }\n else\n format.html { render :edit }\n format.json { render json: @template_question.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n authorize! :edit, @questionnaire\n\n @questionnaire.load_JSON(params[:questionnaire], current_user)\n\n respond_to do |format|\n# if @questionnaire.update_attributes(params[:questionnaire])\n format.html { redirect_to @questionnaire, notice: 'Kysymyslomakkeen muokkaaminen onnistui.' }\n format.json { head :no_content }\n# else\n# format.html { render action: \"edit\" }\n# format.json { render json: @questionnaire.errors, status: :unprocessable_entity }\n# end\n\n end\n end",
"def patch\n headers = {\"If-Match\" => @version}\n response = @context.request :patch, \"#{@path}/#{@id}\", @data.to_json, headers\n @version += 1\n response\n # 'X-HTTP-Method-Override' => 'PATCH'\n end",
"def update_question\n @question = Question.find(params[:id])\n @question.update(params[:question])\n redirect \"/questions/#{@question.id}\"\n end"
] |
[
"0.7183178",
"0.70807135",
"0.695786",
"0.6922571",
"0.6889465",
"0.6880434",
"0.6878839",
"0.6821033",
"0.6821033",
"0.6821033",
"0.6821033",
"0.6821033",
"0.68146294",
"0.6812733",
"0.68119365",
"0.6737482",
"0.6735343",
"0.6730865",
"0.67231053",
"0.6695253",
"0.6678821",
"0.66701066",
"0.66701066",
"0.66701066",
"0.66545284",
"0.6624419",
"0.6617468",
"0.6595732",
"0.65824646",
"0.6531159",
"0.6531159",
"0.6531159",
"0.6531159",
"0.6531159",
"0.6531159",
"0.6531159",
"0.6531159",
"0.6531159",
"0.6531159",
"0.6531159",
"0.6531159",
"0.6531159",
"0.6531159",
"0.6531159",
"0.6531159",
"0.6531159",
"0.6531159",
"0.6513254",
"0.64890057",
"0.64877987",
"0.6482824",
"0.64826524",
"0.64747363",
"0.6470178",
"0.64661026",
"0.6452267",
"0.64365095",
"0.6419857",
"0.6414948",
"0.6409869",
"0.6407697",
"0.63868016",
"0.63718927",
"0.6365139",
"0.6356592",
"0.6349624",
"0.6319361",
"0.6316111",
"0.6310064",
"0.63046455",
"0.6303072",
"0.6301615",
"0.6285857",
"0.6285857",
"0.6285857",
"0.6285857",
"0.6285857",
"0.6280885",
"0.62801695",
"0.62782955",
"0.6266148",
"0.6258764",
"0.6252379",
"0.6244655",
"0.6243343",
"0.6242085",
"0.6237081",
"0.6234868",
"0.62273955",
"0.6216151",
"0.61961716",
"0.6187033",
"0.6178805",
"0.6177645",
"0.6173976",
"0.61699736",
"0.61697835",
"0.616718",
"0.6164463",
"0.6162138"
] |
0.6273291
|
80
|
DELETE /questions/1 DELETE /questions/1.json
|
def destroy
@question.destroy
respond_to do |format|
format.html { redirect_to questions_url, notice: 'Question was successfully destroyed.' }
format.json { head :no_content }
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def destroy\n @question = Question.find(params[:id])\n @question.destroy\n\n respond_to do |format|\n format.html { redirect_to api_v1_questions_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n if @v1_question.destroy\n render json: {'message': 'Deleted question successfully'}, status: :ok\n else\n render json: get_errors, status: :unprocessable_entity\n end\n\n end",
"def destroy\n @api_v1_question.destroy\n respond_to do |format|\n format.html { redirect_to api_v1_questions_url, notice: 'Question was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @question = Question.find(params[:id])\n @question.destroy\n\n respond_to do |format|\n format.html { redirect_to questions_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @question = Question.find(params[:id])\n @question.destroy\n\n respond_to do |format|\n format.html { redirect_to questions_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @question = Question.find(params[:id])\n @question.destroy\n\n respond_to do |format|\n format.html { redirect_to questions_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @question = Question.find(params[:id])\n @question.destroy\n\n respond_to do |format|\n format.html { redirect_to questions_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @question = Question.find(params[:id])\n @question.destroy\n\n respond_to do |format|\n format.html { redirect_to questions_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @question = Question.find(params[:id])\n @question.destroy\n\n respond_to do |format|\n format.html { redirect_to questions_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @question = Question.find(params[:id])\n @question.destroy\n\n respond_to do |format|\n format.html { redirect_to questions_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @question = Question.find(params[:id])\n @question.destroy\n\n respond_to do |format|\n format.html { redirect_to questions_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @question = Question.find(params[:id])\n @question.destroy\n\n respond_to do |format|\n format.html { redirect_to questions_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @question = Question.find(params[:id])\n @question.destroy\n\n respond_to do |format|\n format.html { redirect_to questions_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n #@question = Question.find(params[:id])\n @question.destroy\n\n respond_to do |format|\n format.html { redirect_to questions_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @question.destroy\n respond_to do |format|\n format.html { redirect_to questions_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @question.destroy\n respond_to do |format|\n format.html { redirect_to questions_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @question.destroy\n respond_to do |format|\n format.html { redirect_to questions_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @question.destroy\n respond_to do |format|\n format.html { redirect_to questions_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @question.destroy\n respond_to do |format|\n format.html { redirect_to questions_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @question.destroy\n respond_to do |format|\n format.html { redirect_to questions_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @question.destroy\n respond_to do |format|\n format.html { redirect_to questions_url }\n format.json { head :no_content }\n end\n\tend",
"def delete_question\n question_params = params.permit(:id, :form_id, :question_type_id)\n\n render json: Question.delete_question(question_params)\n end",
"def destroy\n @test_question = TestQuestion.find(params[:id])\n @test_question.destroy\n\n respond_to do |format|\n format.html { redirect_to test_questions_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @question = Question.find(params[:id])\n @question.destroy\n\n respond_to do |format|\n format.html { redirect_to survey_url(params[:survey_id]) }\n format.json { head :no_content }\n end\n end",
"def destroy\n @examquestion.destroy\n respond_to do |format|\n format.html { redirect_to examquestions_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @questionnaire.destroy\n respond_to do |format|\n format.html { redirect_to questionnaires_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @question.destroy\n respond_to do |format|\n format.html { redirect_to admin_questions_path }\n format.json { head :no_content }\n end\n end",
"def delete\n question = QuestionTest.where(test_id: params[:test_id], question_id: params[:id])\n if question.delete_all\n return render json: {message: 'Question was removed succesfully.', error: false}\n else\n return render json: {message: 'Error: Something went wrong. Question was not removed.', error: true}\n end\n end",
"def destroy\n @my_question = MyQuestion.find(params[:id])\n @my_question.destroy\n\n respond_to do |format|\n format.html { redirect_to my_questions_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @question.active = !@question.active\n\n questions_json = @question.to_h.to_json\n\n url = @httpIp+'/pet.com/api/question/updateQuestion'\n uri = URI(url)\n res = Net::HTTP.post(uri, questions_json, \"Content-Type\" => \"application/json\")\n puts res.body\n flash[:notice] = \"successfully deleted\"\n redirect_to questions_path\n end",
"def destroy\n @question.destroy\n respond_to do |format|\n format.html { redirect_to root_path, notice: 'La pregunta ha sido eliminada!' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @questionnaire = Questionnaire.find(params[:id])\n @questionnaire.destroy\n\n respond_to do |format|\n format.html { redirect_to questionnaires_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @questionnaire = Questionnaire.find(params[:id])\n @questionnaire.destroy\n\n respond_to do |format|\n format.html { redirect_to questionnaires_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @question = Question.find(params[:id])\n @question.destroy\n\n respond_to do |format|\n format.html { redirect_to :back }\n format.json { head :no_content }\n end\n end",
"def destroy\n\n @question.destroy\n \n respond_to do |format|\n format.html { redirect_to questions_url, notice: 'DNS was successfully removed.' }\n format.json { head :no_content }\n \nend\n end",
"def destroy\n @question.destroy\n head :no_content\n end",
"def destroy\n @b_question.destroy\n respond_to do |format|\n format.html { redirect_to questions_path }\n format.json { head :no_content }\n end\n end",
"def delete\n supprimer = QuestionOuverteService.instance.supprimerQuestion(params[:id])\n (supprimer) ? (render json: true, status: :ok) : (render json: false, status: :not_found)\n end",
"def destroy\n @base_question = BaseQuestion.find(params[:id])\n @base_question.destroy\n\n respond_to do |format|\n format.html { redirect_to base_questions_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @test_question.destroy\n respond_to do |format|\n format.html { redirect_to test_questions_url, notice: 'Test question was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @test_question.destroy\n respond_to do |format|\n format.html { redirect_to test_questions_url, notice: 'Test question was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @question.destroy\n respond_to do |format|\n format.html { redirect_to questions_url, notice: \"Question was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"def destroy\n @questionable = @question.questionable\n @question.destroy\n respond_to do |format|\n format.html\n format.json { head :no_content }\n end\n end",
"def destroy\n @questionset = Questionset.find(params[:id])\n @questionset.destroy\n\n respond_to do |format|\n format.html { redirect_to questionsets_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @question.destroy\n respond_to do |format|\n format.html { redirect_to questions_url, :notice => 'Question was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @quest = Quest.find(params[:id])\n @quest.destroy\n\n respond_to do |format|\n format.html { redirect_to quests_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @question = Question.find(params[:id])\n\n @question.destroy\n \n respond_to do |format|\n format.html { redirect_to(questions_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @add_question.destroy\n respond_to do |format|\n format.html { redirect_to add_questions_url, notice: 'Add question was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @question.destroy\n respond_to do |format|\n format.html { redirect_to paper_questions_path, notice: '題目已被成功刪除' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @question.destroy\n respond_to do |format|\n format.html { redirect_to category_questions_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @question.destroy\n respond_to do |format|\n format.html { redirect_to questions_url, notice: '質問を削除しました' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @survey_question = SurveyQuestion.find(params[:id])\n @survey_question.destroy\n\n respond_to do |format|\n format.html { redirect_to survey_questions_url }\n # format.json { head :no_content }\n end\n end",
"def destroy\n #na real, cada question pertence a um quiz, basta achar a question de mesma id\n @qq = QuizQuestion.where(question: @question)\n @qq.destroy\n @question.destroy\n respond_to do |format|\n format.html { redirect_to questions_url, notice: 'Question was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @question = Question.find(params[:id])\n @question.destroy\n\n respond_to do |format|\n format.html { redirect_to questions_url }\n format.xml { head :ok }\n end\n end",
"def destroy\n @question = Question.find(params[:id])\n @question.destroy\n respond_to do |format|\n format.html { redirect_to questions_url, notice: '削除しました。' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @question.destroy\n respond_to do |format|\n format.html { redirect_to admin_form_questions_path, notice: 'Вопрос успешно удалена' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @question_set = QuestionSet.find(params[:id])\n @question_set.destroy\n\n respond_to do |format|\n format.html { redirect_to question_sets_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @question = Question.find(params[:id])\n @question.destroy\n\n respond_to do |format|\n format.html { redirect_to(questions_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @question = Question.find(params[:id])\n @question.destroy\n\n respond_to do |format|\n format.html { redirect_to(questions_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @question = Question.find(params[:id])\n @question.destroy\n\n respond_to do |format|\n format.html { redirect_to(questions_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @question = Question.find(params[:id])\n @question.destroy\n\n respond_to do |format|\n format.html { redirect_to(questions_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @question = Question.find(params[:id])\n @question.destroy\n\n respond_to do |format|\n format.html { redirect_to(questions_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @question = Question.find(params[:id])\n @question.destroy\n\n respond_to do |format|\n format.html { redirect_to(questions_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @question = Question.find(params[:id])\n @question.destroy\n\n respond_to do |format|\n format.html { redirect_to(questions_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n redirect_to \"/\"\n # @question.destroy\n # respond_to do |format|\n # format.html { redirect_to questions_url, notice: 'Question was successfully destroyed.' }\n # format.json { head :no_content }\n # end\n end",
"def destroy\n @question.destroy\n respond_to do |format|\n format.html { redirect_to :back, notice: '質問を削除しました' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @critical_question = CriticalQuestion.find(params[:id])\n @critical_question.destroy\n\n respond_to do |format|\n format.html { redirect_to critical_questions_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @quiz.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end",
"def destroy\n @questionstatu.destroy\n respond_to do |format|\n format.html { redirect_to questionstatus_index_path, notice: 'Mytest was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @question = @quiz.questions.find(params[:id])\n @question.destroy\n\n respond_to do |format|\n format.html { redirect_to(quiz_questions_url(@quiz)) }\n format.xml { head :ok }\n end\n end",
"def destroy\n question = Question.find params[:id]\n question.destroy\n redirect_to root_path\n end",
"def destroy\n # before_action :set_question\n @question.destroy\n respond_to do |format|\n format.html { redirect_to questions_url, notice: \"質問を削除しました\" }\n format.json { head :no_content }\n end\n end",
"def destroy\n @tutorial_quest = Tutorial::Quest.find(params[:id])\n @tutorial_quest.destroy\n\n respond_to do |format|\n format.html { redirect_to tutorial_quests_url }\n format.json { head :ok }\n end\n end",
"def destroy\n authorize! :destroy, @admin_question\n\n @admin_question.destroy\n respond_to do |format|\n format.html { redirect_to admin_questions_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @questionnaire.destroy\n respond_to do |format|\n format.html { redirect_to questionnaires_url, notice: \"Questionnaire was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"def destroy\n @multiple_choice_question = MultipleChoiceQuestion.find(params[:id])\n @multiple_choice_question.destroy\n\n respond_to do |format|\n format.html { redirect_to multiple_choice_questions_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @questionnaire.destroy\n respond_to do |format|\n format.html { redirect_to questionnaires_url, notice: 'Questionnaire was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @question_answer = Question::Answer.find(params[:id])\n @question_answer.destroy\n\n respond_to do |format|\n format.html { redirect_to question_answers_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @question_datum = QuestionDatum.find(params[:id])\n @question_datum.destroy\n\n respond_to do |format|\n format.html { redirect_to question_data_url }\n format.json { head :no_content }\n end\n end"
] |
[
"0.7801243",
"0.77760345",
"0.762556",
"0.76092136",
"0.76092136",
"0.75923663",
"0.7591492",
"0.7591492",
"0.7591492",
"0.7591492",
"0.7591492",
"0.7591492",
"0.75907475",
"0.7587306",
"0.75842667",
"0.75842667",
"0.75842667",
"0.75842667",
"0.75842667",
"0.75842667",
"0.75230396",
"0.7521938",
"0.75034994",
"0.7487404",
"0.7483059",
"0.74802965",
"0.7471379",
"0.74472755",
"0.7411523",
"0.7400327",
"0.7396278",
"0.73958933",
"0.73958933",
"0.73786706",
"0.7357377",
"0.73282695",
"0.731888",
"0.7307296",
"0.7281833",
"0.7275456",
"0.7275456",
"0.7273961",
"0.72726333",
"0.72662324",
"0.7254097",
"0.72344744",
"0.72318906",
"0.7231518",
"0.7224935",
"0.7218936",
"0.72042894",
"0.71963614",
"0.7191909",
"0.7189872",
"0.7188845",
"0.7180424",
"0.7174741",
"0.7171938",
"0.7171938",
"0.7171938",
"0.7171938",
"0.7171938",
"0.7171938",
"0.7171938",
"0.7169605",
"0.71628475",
"0.7159758",
"0.7157889",
"0.7155177",
"0.7153101",
"0.7137531",
"0.7134621",
"0.7131761",
"0.7128248",
"0.7119295",
"0.71157247",
"0.71132",
"0.71129984",
"0.71128994"
] |
0.72688025
|
62
|
Use callbacks to share common setup or constraints between actions.
|
def set_question
@question = Question.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_handler\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 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 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 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 before_action \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 setup_signals; end",
"def init_actions\n @select_action = SelectAction.new\n @endpoint_mouse_action = EndpointMouseAction.new\n @move_action = MoveAction.new\n 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 after_set_callback; end",
"def initialize(*args)\n super\n @action = :set\nend",
"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 around_hooks; 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 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 default_action; end",
"def setup(&blk)\n @setup_block = blk\n end",
"def my_actions(options)\n @setup = false\n get_template_part(\"custom_used\",\"action_users\",true)\n end",
"def callback_phase\n super\n end",
"def advice\n end",
"def _handle_action_missing(*args); end",
"def call\n setup_context\n super\n end",
"def duas1(action)\n action.call\n action.call\nend",
"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.6163754",
"0.6045816",
"0.5944853",
"0.59169096",
"0.58892167",
"0.58342934",
"0.5776148",
"0.57057375",
"0.57057375",
"0.56534296",
"0.56209534",
"0.54244673",
"0.54101455",
"0.54101455",
"0.54101455",
"0.53951085",
"0.5378493",
"0.53563684",
"0.53399915",
"0.5338049",
"0.53307265",
"0.5312121",
"0.5298173",
"0.5296388",
"0.52952695",
"0.5258086",
"0.52430934",
"0.5237911",
"0.5237911",
"0.5237911",
"0.5237911",
"0.5237911",
"0.52335346",
"0.5232943",
"0.5226392",
"0.52221715",
"0.5217978",
"0.52136153",
"0.52076435",
"0.52067244",
"0.5175402",
"0.5174649",
"0.5173085",
"0.5165201",
"0.5162052",
"0.5157932",
"0.5152905",
"0.5152353",
"0.5150909",
"0.514719",
"0.5138596",
"0.51333916",
"0.51139015",
"0.5113431",
"0.5113431",
"0.5109581",
"0.51066816",
"0.5091428",
"0.5089407",
"0.5082971",
"0.50822043",
"0.50668514",
"0.5055155",
"0.50525695",
"0.50499475",
"0.50499475",
"0.5034445",
"0.50249445",
"0.5022226",
"0.50167644",
"0.5014211",
"0.4999924",
"0.49996212",
"0.49978727",
"0.4989682",
"0.4989682",
"0.49851838",
"0.49817684",
"0.4979687",
"0.49787104",
"0.49688423",
"0.49664098",
"0.49564412",
"0.49561828",
"0.49547398",
"0.4953481",
"0.4952925",
"0.4946049",
"0.494379",
"0.49319315",
"0.49313048",
"0.49269778",
"0.49263066",
"0.49257493",
"0.4924526",
"0.49212465",
"0.49173486",
"0.4915802",
"0.49151486",
"0.49150333",
"0.49147308"
] |
0.0
|
-1
|
Never trust parameters from the scary internet, only allow the white list through.
|
def question_params
params[:question][:selects_attributes].each do |key,select|
if action_name == 'create' && select[:desc] == '' && key.to_i >= 2 then
params[:question][:selects_attributes].delete(key)
end
end
params.require(:question).permit(:title, :desc, :limit_at, :delete_flg, selects_attributes: [:id, :desc], question_tags_attributes: [:id, :tag_id])
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def strong_params\n params.require(:user).permit(param_whitelist)\n end",
"def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end",
"def allow_params_authentication!; end",
"def allowed_params\n ALLOWED_PARAMS\n end",
"def default_param_whitelist\n [\"mode\"]\n end",
"def param_whitelist\n [:role, :title]\n end",
"def expected_permitted_parameter_names; end",
"def safe_params\n params.except(:host, :port, :protocol).permit!\n end",
"def strong_params\n params.require(:team_member).permit(param_whitelist)\n end",
"def permitir_parametros\n \t\tparams.permit!\n \tend",
"def strong_params\n params.require(:community).permit(param_whitelist)\n end",
"def permitted_strong_parameters\n :all #or an array of parameters, example: [:name, :email]\n end",
"def strong_params\n params.require(:education).permit(param_whitelist)\n end",
"def restricted_params\n #params.require(self.controller_name.classify.underscore.to_sym).permit([])\n raise(\"No strong params set, override restricted_params method in your controller. E.g. params.require(:model).permit(:attribute1, :attribute2)\")\n end",
"def allowed_params\n params.require(:user).permit(:username, :email, :password, :password_confirmation)\n end",
"def param_whitelist\n [:rating, :review]\n end",
"def param_whitelist\n whitelist = [\n :username, :name,\n :parent_id,\n :headline, :description, :video,\n :policy, :signup_mode, :category,\n :website, :facebook, :twitter, :linkedin,\n :founded_at,\n privacy: [\n :events,\n :resources\n ],\n permission: [\n :profile,\n :members,\n :children,\n :statistics,\n :posts,\n :listings,\n :resources,\n :events\n ],\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:parent_id)\n unless current_user.role_in(@community) === 'owner'\n whitelist.delete(:privacy)\n whitelist.delete(:permission)\n end\n end\n \n whitelist\n end",
"def param_whitelist\n if @user.present? && current_user != @user\n return [:followed]\n end\n \n whitelist = [\n :username, :email, :password,\n :first_name, :last_name,\n :birthday, :gender,\n :headline, :biography, :ask_about, :focus,\n :website, :facebook, :linkedin, :twitter, :github,\n roles: [],\n skills: [],\n interests: [],\n privacy: { contact: [] },\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:email)\n whitelist.delete(:password)\n end\n \n whitelist\n end",
"def user_params \n \tparams.require(:user).permit(:name, :email, :password, :password_confirmation)# preventing CSTR\n end",
"def user_params\n params.permit(:name, :phoneNumber, :address, :postalCode, :local, :link, :counter, :latitude, :longitude) \n end",
"def valid_params_request?; end",
"def strong_params\n params.require(:experience).permit(param_whitelist)\n end",
"def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end",
"def whitelist_url_params\n params.require(:whitelist_url).permit(:domain)\n end",
"def allowed_params\n params.require(:allowed).permit(:email)\n end",
"def permitted_params\n []\n end",
"def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end",
"def safe_params\n params.permit(:id, :name, :origin, :emails => []); #emails is an array\n end",
"def query_param\n\t\tparams.permit(:first_name, :last_name, :phone)\n\tend",
"def strong_params\n params.require(:success_metric).permit(param_whitelist)\n end",
"def devise_filter\r\n logger.debug(\"In devise_filter =>PARAMS: #{params.inspect}\")\r\n\r\n # White list for sign_up\r\n devise_parameter_sanitizer.for(:sign_up) { |u| u.permit(user_whitelist) }\r\n\r\n # White list for account update\r\n devise_parameter_sanitizer.for(:account_update) { |u| u.permit(user_whitelist, :current_password) }\r\n\r\n # White list for Invitation creation\r\n devise_parameter_sanitizer.for(:invite) { |u| u.permit(:account_type, :email, :invitation_token)}\r\n\r\n # White list for accept invitation\r\n devise_parameter_sanitizer.for(:accept_invitation) { |u| u.permit(user_whitelist, :invitation_token)}\r\n\r\n end",
"def whitelisted_user_params\n params.require(:user).\n permit( :first_name, :last_name, :email,:password,:password_confirmation,:birthday,:gender)\n end",
"def user_params\n ActionController::Parameters.permit_all_parameters = true\n params.require(:user) #.permit(:name, :surname, :phone, :password, :email, :time_zone)\n end",
"def strong_params\n params.require(:metric_change).permit(param_whitelist)\n end",
"def safe_params\n params.require(:user).permit(:name)\n end",
"def get_params\n\t\treturn ActionController::Parameters.new(self.attributes).permit(\"account_id\", \"title\", \"category\", \"introduction\", \"tags\", \"segment_type\", \"visible\", \"status\", \"main_image\")\n\tend",
"def grant_params\n @whitelisted = params.require(:grant).permit(:name, :description, :agency_id, :acronym)\n end",
"def check_params; true; end",
"def param_whitelist\n whitelist = [\n :description,\n :progress,\n :kpi_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:kpi_id)\n end\n \n whitelist\n end",
"def quote_params\n params.permit!\n end",
"def valid_params?; end",
"def paramunold_params\n params.require(:paramunold).permit!\n end",
"def user_params\n\t\tparams.permit(:nickname, :avatar, :description, :password, :gender, :birthday, :email, :phone, :qq_id, :wechat_id)\n\tend",
"def filtered_parameters; end",
"def user_params\n params.permit(\n \t:id,\n \t:email, \n \t:first_name, \n \t:last_name, \n \t:password, \n \t:confirm_token, \n \t:phone_number,\n \t:facebook_link,\n \t:car_model,\n \t:license_plate)\n end",
"def filtering_params\n params.permit(:email, :name)\n end",
"def check_params\n true\n end",
"def wx_public_params\n params.require(:wx_public).permit(:nickname, :manager, :alias)\n end",
"def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end",
"def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end",
"def listing_params\n\t\tparams.permit(:address, :transit_info, :rules, :other_info, :lat, :lng)\n\tend",
"def social_account_params\n\t\t\tparams.require(:social_account).permit!\n\t\tend",
"def safe_params\n resurce_name = self.class.resource_name\n params_method_name = \"#{resurce_name}_params\".to_sym\n if params[resurce_name]\n if respond_to?(params_method_name) || private_methods.include?(params_method_name)\n send(params_method_name)\n else\n raise ActiveModel::ForbiddenAttributesError, \"Please, define the '#{params_method_name}' method in #{self.class.name}\"\n end\n end\n end",
"def url_params\n params.require(:url).permit(:short_url, :original_url, :clicks, :ip_addresses)\n end",
"def user_params\n params.require(:user).permit(:uri, :username, :password, :realname, :email, :publicvisible)\n end",
"def model_params\n\t\tparams.require(:manager).permit(\n\t :user_name,\n :password,\n :email,\n \t\t\t)\n\tend",
"def article_params_whitelist\n params.require(:article).permit(:title, :description, category_ids: [])\n end",
"def college_whitelist_params\n params.require(:college_whitelist).permit(:status)\n end",
"def filtering_params\n params.permit(:email)\n end",
"def active_code_params\n params[:active_code].permit\n end",
"def valid_params(params)\n params.permit(:user_id, :photo_id, :originX, :originY, :width, :height)\n end",
"def 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 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 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 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 unwanted_params\n params.require(:unwanted).permit(:title, :description, :image)\n end",
"def maintenance_request_params\n params[:maintenance_request].permit! #allow all parameters for now\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 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.6978086",
"0.6780264",
"0.6742658",
"0.6738813",
"0.67338693",
"0.65908474",
"0.6501793",
"0.6495506",
"0.64796513",
"0.64755446",
"0.6454826",
"0.6437561",
"0.6377127",
"0.63722163",
"0.6364058",
"0.63178706",
"0.62979764",
"0.62968165",
"0.62913024",
"0.6289789",
"0.6289145",
"0.62875307",
"0.6280997",
"0.62420976",
"0.62388235",
"0.6216686",
"0.62122375",
"0.6208949",
"0.619173",
"0.6176307",
"0.6173907",
"0.6170346",
"0.616111",
"0.6150513",
"0.6150023",
"0.61446756",
"0.6120429",
"0.6112975",
"0.6104845",
"0.6102966",
"0.6087884",
"0.6079323",
"0.60699135",
"0.60602236",
"0.60191786",
"0.60170597",
"0.60100305",
"0.6009527",
"0.60052776",
"0.60052776",
"0.600042",
"0.5999317",
"0.59933805",
"0.5991528",
"0.5991221",
"0.5990094",
"0.5979497",
"0.5966058",
"0.5958738",
"0.59579456",
"0.5957759",
"0.5956938",
"0.5951788",
"0.59511644",
"0.59423065",
"0.59373474",
"0.59361076",
"0.59361076",
"0.59331447",
"0.5928005",
"0.5924882",
"0.5924011",
"0.59169155",
"0.5908037",
"0.5907541",
"0.59061426",
"0.59056246",
"0.5897408",
"0.58960444",
"0.58951247",
"0.5893136",
"0.5892312",
"0.5890385",
"0.58853275",
"0.58801144",
"0.58784765",
"0.5872648",
"0.58682626",
"0.5867028",
"0.58661693",
"0.586578",
"0.58643955",
"0.5863193",
"0.58609086",
"0.5859997",
"0.5858935",
"0.5858632",
"0.5853379",
"0.5852741",
"0.584806",
"0.5847703"
] |
0.0
|
-1
|
Tests for release 0:
|
def test_array
assert_equal("Alex", @students[0].first_name, "The first student's name is not Alex.")
assert_equal(5, @students[0].scores.length, "The first student does not have exactly 5 scores.")
assert_not_equal(@students[0].scores[0], @students[0].scores[4], "The first student's first and third score aren't different.")
assert_equal(88, @students[0].scores[3], "The first student's forth score is not 88")
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def test_prerelease?(_)\n false\n end",
"def test_method_release\n value_ = ::Versionomy.create(:major => 1, :minor => 9, :tiny => 2, :release_type => :alpha, :alpha_version => 4)\n value2_ = value_.release\n assert_equal([1, 9, 2, 0, :final, 0, 0], value2_.values_array)\n value_ = ::Versionomy.create(:major => 1, :minor => 9, :tiny => 2)\n value2_ = value_.release\n assert_equal(value_, value2_)\n end",
"def test_method_prereleasep\n value_ = ::Versionomy.create([1, 9, 2, 'a', 2], :rubygems)\n assert_equal(true, value_.prerelease?)\n value_ = ::Versionomy.create([1, 9, 2, 2], :rubygems)\n assert_equal(false, value_.prerelease?)\n end",
"def validate_release \n if !system(\"origen examples\") #|| !system(\"origen specs\") \n puts \"Sorry but you can't release with failing tests, please fix them and try again.\" \n exit 1 \n else \n puts \"All tests passing, proceeding with release process!\" \n end \n end",
"def test_method_prereleasep\n value_ = ::Versionomy.create([1, 9, 2, 'a2'], :semver)\n assert_equal(true, value_.prerelease?)\n value_ = ::Versionomy.create([1, 9, 2], :semver)\n assert_equal(false, value_.prerelease?)\n end",
"def validate_release\n if !system(\"origen specs\") || !system(\"origen examples\")\n puts \"Sorry but you can't release with failing tests, please fix them and try again.\"\n exit 1\n else\n puts \"All tests passing, proceeding with release process!\"\n end\n end",
"def test_prerelease?(version)\n !@version.stable? && @version.major == version.major && @version.minor == version.minor && @version.patch == version.patch\n end",
"def validate_release\n if !system(\"origen examples\")\n puts \"Sorry but you can't release with failing tests, please fix them and try again.\"\n exit 1\n else\n puts \"All tests passing, proceeding with release process!\"\n end\n end",
"def test_truth\n assert_kind_of Release, @release\n end",
"def released? # for readability\n released\n end",
"def release\n @release ||= ENV[\"RELEASE\"] || \"1\"\n end",
"def test_method_release\n value_ = ::Versionomy.create([1, 9, 2, 'a', 2], :rubygems)\n value2_ = value_.release\n assert_equal([1, 9, 2, 0, 0, 0, 0, 0], value2_.values_array)\n value_ = ::Versionomy.create([1, 9, 2, 5, 2], :rubygems)\n value2_ = value_.release\n assert_equal(value_, value2_)\n end",
"def prerelease_specs; end",
"def test_bump_preview_to_release\n value_ = ::Versionomy.create(:major => 2, :tiny => 1, :release_type => :preview)\n value_ = value_.bump(:release_type)\n assert_equal(2, value_.major)\n assert_equal(0, value_.minor)\n assert_equal(1, value_.tiny)\n assert_equal(0, value_.tiny2)\n assert_equal(:final, value_.release_type)\n assert_equal(0, value_.patchlevel)\n assert_equal(0, value_.patchlevel_minor)\n end",
"def test_version\n skip\n assert_equal 2, BookKeeping::VERSION\n end",
"def release?\n prerelease.empty? && build.empty?\n end",
"def test_that_it_has_a_version_number\n refute_nil ::Malody::VERSION\n end",
"def test_default_banner\n release = @rogerfile.release(scm: :fixed)\n\n # Set fixed version\n date = Time.now\n release.scm.version = \"1.0.0\"\n release.scm.date = date\n\n lines = release.banner.split(\"\\n\")\n\n assert_equal \"/* ====================== */\", lines[0]\n assert_equal \"/* = Version : 1.0.0 = */\", lines[1]\n assert_equal \"/* = Date : #{date.strftime('%Y-%m-%d')} = */\", lines[2]\n assert_equal \"/* ====================== */\", lines[3]\n end",
"def test_bookkeeping\n # skip\n assert_equal 1, BookKeeping::VERSION\n end",
"def test_bookkeeping\n skip\n assert_equal 4, BookKeeping::VERSION\n end",
"def test_it_has_a_version_number\n refute_nil ::ApMessageIo::VERSION\n end",
"def test_bookkeeping\n skip\n assert_equal 1, BookKeeping::VERSION\n end",
"def test_bookkeeping\n skip\n assert_equal 1, BookKeeping::VERSION\n end",
"def test_bookkeeping\n skip\n assert_equal 1, BookKeeping::VERSION\n end",
"def test_bookkeeping\n skip\n assert_equal 1, BookKeeping::VERSION\n end",
"def test_bookkeeping\n skip\n assert_equal 1, BookKeeping::VERSION\n end",
"def test_bookkeeping\n skip\n assert_equal 1, BookKeeping::VERSION\n end",
"def test_bookkeeping\n skip\n assert_equal 1, BookKeeping::VERSION\n end",
"def test_bookkeeping\n skip\n assert_equal 2, BookKeeping::VERSION\n end",
"def test_bookkeeping\n skip\n assert_equal 2, BookKeeping::VERSION\n end",
"def test_bookkeeping\n skip\n assert_equal 2, BookKeeping::VERSION\n end",
"def test_bookkeeping\n skip\n assert_equal 2, BookKeeping::VERSION\n end",
"def test_bookkeeping\n skip\n assert_equal 2, BookKeeping::VERSION\n end",
"def test_bookkeeping\n skip\n assert_equal 2, BookKeeping::VERSION\n end",
"def test_comparison_release_type\n value1_ = ::Versionomy.create(:major => 2, :release_type => :alpha, :alpha_version => 5)\n value2_ = ::Versionomy.create(:major => 2, :release_type => :release_candidate, :release_candidate_version => 2)\n assert(value2_ > value1_)\n end",
"def test_bump_release_candidate_to_release\n value_ = ::Versionomy.create(:major => 2, :tiny => 1, :release_type => :release_candidate, :release_candidate_version => 2)\n value_ = value_.bump(:release_type)\n assert_equal(2, value_.major)\n assert_equal(0, value_.minor)\n assert_equal(1, value_.tiny)\n assert_equal(0, value_.tiny2)\n assert_equal(:final, value_.release_type)\n assert_equal(0, value_.patchlevel)\n assert_equal(0, value_.patchlevel_minor)\n end",
"def make_prerelease\n fail AlreadyPreRelease if prerelease?\n @special = PRE_RELEASE.first\n end",
"def test_bookkeeping\n skip\n assert_equal 3, BookKeeping::VERSION\n end",
"def test_bookkeeping\n skip\n assert_equal 3, BookKeeping::VERSION\n end",
"def own_version(version)\n version.release_type == :final\n end",
"def test_version\n assert Snarl.version >= '1.1'\n end",
"def has_version?; end",
"def unstableRelease?(node)\n return getRelease(node)['type'] != 'stable'\n end",
"def released_specs; end",
"def prerelease?\n @prerelease ||= @version =~ /[a-zA-Z]/\n end",
"def matches_release(input, release)\n matches_code_name(input, release.code_name) || matches_version(input, release.version) || matches_api_level(input, release.api_level)\nend",
"def release_build?\n false # we currently have nothing that qualifies. previously LTS was a type of this\n end",
"def test_bookkeeping\n assert_equal 1, RunLengthEncoding::VERSION\n end",
"def prerelease?\n !@special.nil? && !@special.empty?\n end",
"def test_release\n\n checklist_0_1 = checklists(:checklist_0_1)\n \n # Try releasing without logging in.\n put(:release, { :id => checklist_0_1.id }, {})\n assert_redirected_to(:controller => 'user', :action => 'login')\n\n # Try releasing from a non-Admin account.\n checklist_count = Checklist.count\n\n checklist = Checklist.find(checklist_0_1.id)\n assert_equal(0, checklist.major_rev_number)\n assert_equal(1, checklist.minor_rev_number)\n\n put(:release, {:id => checklist_0_1.id}, rich_designer_session)\n assert_redirected_to(:controller => 'tracker', :action => 'index')\n #assert_equal(Pcbtr::MESSAGES[:admin_only], flash['notice'])\n\n put(:release, {:id => checklist_0_1.id}, cathy_admin_session)\n assert_redirected_to(:action => 'list')\n #assert_equal('Checklist successfully released', flash['notice'])\n assert_equal(checklist_count, Checklist.count)\n \n checklist = Checklist.find(checklist_0_1.id)\n assert_equal(@checklist_101.major_rev_number+1, checklist.major_rev_number)\n assert_equal(0, checklist.minor_rev_number)\n\n end",
"def test_version\n\n #prepare\n subject=Xcider::Xcodebuild.new\n\n #test\n v=subject.version\n\n #verify\n assert_not_nil v\n\n end",
"def test_that_it_has_a_version_number\n refute_nil ::Paddingoracle::VERSION\n end",
"def release_version!\n projects.each { |project| project.release_version!(tag_full_name) }\n print_log 'Versions released'\n slack_notifier.ping(release_message, icon_emoji: ':see_no_evil:')\n end",
"def test_bookkeeping\n assert_equal 1, BookKeeping::VERSION\n end",
"def test_bookkeeping\n assert_equal 1, BookKeeping::VERSION\n end",
"def testMissingVersion\n setupTest do |iTasksFileName, iTicketsFileName|\n executeProcess(\n [\n '--user', 'ReleaseUser',\n '--branch', 'BranchName',\n '--comment', 'ReleaseComment',\n '--tasksfile', iTasksFileName,\n '--ticketsfile', iTicketsFileName,\n '--svnco', 'MySVNRep',\n '--deliver', 'deliver %{DeliverablesDir}'\n ],\n :Error => WEACE::MissingVariableError\n )\n end\n end",
"def released?\n released\n # errors[:release_year] << \"Release Year can't be blank.\"\n # end\n end",
"def github_released\n puts green(\"Release completed\")\n end",
"def check_release_preconditions build_info\n return \"#{options[:path]} doesn't appear to be a valid package dir\" unless Util.is_a_wooget_package_dir options[:path]\n return \"Not a full release - #{build_info.version}\" if build_info.version =~ /prerelease/\n end",
"def test_that_bumping_with_prereleases\r\n v = Bumper::Version.new\r\n assert_equal '0.0.0.0', v.to_s\r\n assert_equal 1, v.bump_minor\r\n assert_equal '0.1.0.0', v.to_s\r\n assert_equal 'beta', v.bump_patch_tag('beta')\r\n assert_equal '0.1.1-beta.0', v.to_s\r\n assert_equal 'beta2', v.bump_patch_tag('beta')\r\n assert_equal '0.1.1-beta2.0', v.to_s\r\n assert_equal '1', v.bump_build\r\n assert_equal '0.1.1-beta2.1', v.to_s\r\n assert_equal 'rc', v.bump_patch_tag('rc') # replaces tag\r\n assert_equal '0.1.1-rc.0', v.to_s\r\n assert_equal 'rc2', v.bump_patch_tag('rc')\r\n assert_equal '0.1.1-rc2.0', v.to_s\r\n assert_equal 1, v.bump_patch # drops tag\r\n assert_equal '0.1.1.0', v.to_s\r\n assert_equal 2, v.bump_patch\r\n assert_equal '0.1.2.0', v.to_s\r\n assert_equal 2, v.bump_minor\r\n assert_equal '0.2.0.0', v.to_s\r\n assert_equal 'alpha', v.bump_patch_tag('alpha')\r\n assert_equal '0.2.1-alpha.0', v.to_s\r\n assert_equal 3, v.bump_minor\r\n assert_equal '0.3.0.0', v.to_s\r\n v.build = 'rc1'\r\n assert_equal '0.3.0.rc1', v.to_s\r\n assert_equal 'rc2', v.bump_build\r\n assert_equal '0.3.0.rc2', v.to_s\r\n end",
"def dev_minor() end",
"def test_scm_st_009\n printf \"\\n Test 009\"\n open_periodical_analysis_setting_tab\n assert is_text_present($display_scm[\"revision_field\"])\n assert is_element_present($display_scm_xpath[\"revision_field\"])\n assert_equal \"\",get_value($display_scm_xpath[\"revision_field\"])\n logout\n end",
"def test_bookkeeping\n assert_equal 3, BookKeeping::VERSION\n end",
"def test_0_dummy\n\t\tend",
"def released?\n released == true\n end",
"def release\n fail AlreadyRelease unless prerelease?\n @special = ''\n @metadata = ''\n end",
"def test_has_version_number\n assert_not_nil(Tree::VERSION)\n end",
"def target_version=(_arg0); end",
"def release\n begin\n unless auto_release?\n print \"Have you merged your code? Did you fetch and rebase against the upstream? Want to continue (y/n)?: \".yellow\n answer = gets.downcase.chomp\n if answer == 'n'\n return false\n end\n print \"Ready to release version #{version.next} to #{puppet_module.source}\\n and forever change history(y/n)?: \".yellow\n answer = gets.downcase.chomp\n if answer != 'y'\n puts \"Nah, forget it, this release wasn't that cool anyways.\".yellow\n return false\n end\n end\n # updates the metadata.js file to the next version\n bump\n # updates the changelog to the next version based on the metadata file\n id = bump_log\n # tags the r10k-module with the version found in the metadata.json file\n tag(id)\n rescue Rugged::TagError => e\n logger.fatal(e.message)\n logger.fatal(\"You might need to rebase your branch\")\n exit 1\n end\n end",
"def prerelease?\n comparable.prerelease?\n end",
"def release\n context.execute \"[ $(ls -A #{release_path} | wc -l) -gt 0 ] || ( cd #{release_path} && tar -xzf #{repo_path}/#{release_timestamp}.tar.gz )\"\n end",
"def released?\n released\n end",
"def released?\n released\n end",
"def security_release?\n matches = @version.match(Qa::Ref::AUTO_DEPLOY_TAG_REGEX)\n\n if matches && matches[:omnibus_commit]\n # Omnibus commit SHAs are not available in the canonical repository.\n begin\n GitlabClient\n .commit(Project::OmnibusGitlab, ref: matches[:omnibus_commit])\n\n false\n rescue Gitlab::Error::NotFound\n true\n end\n else\n tag_name = Version.new(@version).to_omnibus(ee: true)\n\n begin\n GitlabClient.tag(Project::OmnibusGitlab, tag: tag_name)\n false\n rescue Gitlab::Error::NotFound\n true\n end\n end\n end",
"def prerelease?\n unless instance_variable_defined? :@prerelease\n @prerelease = !!(@version =~ /[a-zA-Z]/)\n end\n @prerelease\n end",
"def test_that_it_should_bump_versions\r\n v = Bumper::Version.new\r\n assert_equal '1', v.bump_build\r\n assert_equal '0.0.0.1', v.to_s\r\n assert_equal 1, v.bump_patch\r\n assert_equal '0.0.1.0', v.to_s\r\n assert_equal 1, v.bump_minor\r\n assert_equal '0.1.0.0', v.to_s\r\n assert_equal 1, v.bump_major\r\n assert_equal '1.0.0.0', v.to_s\r\n end",
"def test_bookkeeping\n assert_equal 1, Pangram::VERSION\n end",
"def pre_0_12?\n VersionRequirement.new('< 0.12.0-alpha').satisfied_by?(version)\n end",
"def test_hack\n assert(true)\n end",
"def version_mismatch_detected\n end",
"def require_release_build\n if ENV[\"BUILD_STYLE\"] != 'Release'\n log_message(\"Deployment target requires 'Release' build style\")\n exit\n end\n end",
"def test_bump_development_to_alpha\n value_ = ::Versionomy.create(:major => 2, :tiny => 1, :release_type => :development, :development_version => 7)\n value_ = value_.bump(:release_type)\n assert_equal(2, value_.major)\n assert_equal(0, value_.minor)\n assert_equal(1, value_.tiny)\n assert_equal(0, value_.tiny2)\n assert_equal(:alpha, value_.release_type)\n assert_equal(1, value_.alpha_version)\n assert_equal(0, value_.alpha_minor)\n end",
"def check_license()\n return true\n end",
"def checkReleaseInfo(iReleaseDir, iReleaseInfo, iParams = {})\n lVersion = iParams[:version]\n if (lVersion == nil)\n lVersion = 'UnnamedVersion'\n end\n lTags = iParams[:tags]\n if (lTags == nil)\n lTags = []\n end\n assert(File.exists?(\"#{iReleaseDir}/Release/ReleaseInfo\"))\n lReleasedInfo = nil\n File.open(\"#{iReleaseDir}/Release/ReleaseInfo\", 'r') do |iFile|\n lReleasedInfo = eval(iFile.read)\n end\n assert(lReleasedInfo.kind_of?(Hash))\n assert_equal(lVersion, lReleasedInfo[:version])\n assert_equal(lTags, lReleasedInfo[:tags])\n assert_equal('Project:dev_status', lReleasedInfo[:dev_status])\n end",
"def target_version; end",
"def supports?\n !@version.nil?\n end",
"def test_bump_alpha_to_beta\n value_ = ::Versionomy.create(:major => 2, :tiny => 1, :release_type => :alpha)\n value_ = value_.bump(:release_type)\n assert_equal(2, value_.major)\n assert_equal(0, value_.minor)\n assert_equal(1, value_.tiny)\n assert_equal(0, value_.tiny2)\n assert_equal(:beta, value_.release_type)\n assert_equal(1, value_.beta_version)\n assert_equal(0, value_.beta_minor)\n end",
"def test_00sanity\n Time.now.to_i > 960312287 # Tue Jun 6 13:25:06 EDT 2000\n end",
"def initialized?\n !(version.zero?)\n end",
"def test_comparison_minor\n value1_ = ::Versionomy.create(:major => 2, :tiny => 1, :tiny2 => 3, :release_type => :release_candidate, :release_candidate_version => 2)\n value2_ = ::Versionomy.create(:major => 2, :minor => 1, :release_type => :alpha)\n assert(value2_ > value1_)\n end",
"def test_sources\n # just get whatever length fortunes\n LinuxFortune.short=false\n LinuxFortune.long=false\n\n sources = LinuxFortune.get_sources\n assert !sources.nil? and sources.size > 0\n end",
"def __dummy_test__\n end",
"def testBasicBinary\n execTest('Applications/Basic', [], 'ReleaseInfo_Exe.rb') do |iReleaseDir, iReleaseInfo|\n checkReleaseInfo(iReleaseDir, iReleaseInfo)\n checkReleaseNotes(iReleaseDir, iReleaseInfo)\n lExeFileName = \"#{iReleaseDir}/Release/ExeName\"\n assert(File.exists?(lExeFileName))\n # Unless the Executable file can contain other rb files (please Crate come faster !), files are still present.\n assert(File.exists?(\"#{iReleaseDir}/Release/Main.rb\"))\n # Test it in Ruby's environment\n assert_equal(\"Ruby found on current platform. Use it directly.\nHello World\\n\", runExe(lExeFileName))\n # TODO: Test it without Ruby's environment\n end\n end",
"def release_state\n \"public_release\"\n end",
"def live?\n configuration.release_stage?\n end",
"def prerelease?\n @prerelease || requirement.prerelease?\n end",
"def test_ruby_count_zeros\n pros = Prospector.new(0,0,0)\n assert pros.ruby_count.eql? \"After 0 days, Rubyist #0 found:\\n\\t0 rubies.\\n\\t0 fake rubies.\\n\"\n end",
"def test_get_version_number\n assert_equal 3, ChangeLogs.get_version_number(1,'test')\n end",
"def testMissingBranch\n setupTest do |iTasksFileName, iTicketsFileName|\n executeProcess(\n [\n '--user', 'ReleaseUser',\n '--comment', 'ReleaseComment',\n '--version', '0.0.1.20100317',\n '--tasksfile', iTasksFileName,\n '--ticketsfile', iTicketsFileName,\n '--svnco', 'MySVNRep',\n '--deliver', 'deliver %{DeliverablesDir}'\n ],\n :Error => WEACE::MissingVariableError\n )\n end\n end",
"def latest_specs(include_prerelease = T.unsafe(nil)); end",
"def usable?; end"
] |
[
"0.73116446",
"0.6761532",
"0.6675936",
"0.6674659",
"0.6583833",
"0.65824",
"0.6520728",
"0.65156156",
"0.64847535",
"0.6470528",
"0.6348684",
"0.63402945",
"0.6338741",
"0.62960804",
"0.6291086",
"0.6269317",
"0.6175935",
"0.6173145",
"0.6150502",
"0.6147146",
"0.6104929",
"0.6081614",
"0.6081614",
"0.6081614",
"0.6081614",
"0.6081614",
"0.6081614",
"0.6081614",
"0.6073408",
"0.6073408",
"0.6073408",
"0.6073408",
"0.6073408",
"0.6073408",
"0.6068992",
"0.604867",
"0.6039429",
"0.6017263",
"0.6017263",
"0.60070544",
"0.60019976",
"0.5968785",
"0.5962418",
"0.5949539",
"0.59355867",
"0.59277534",
"0.59152836",
"0.5906234",
"0.59047055",
"0.58967644",
"0.58795375",
"0.5871446",
"0.58403414",
"0.583333",
"0.583333",
"0.5825832",
"0.58203226",
"0.581542",
"0.58153784",
"0.5812946",
"0.58085316",
"0.5800017",
"0.57794017",
"0.57766503",
"0.57442033",
"0.57306176",
"0.572342",
"0.5707498",
"0.5696416",
"0.56808776",
"0.56718224",
"0.5667958",
"0.5667958",
"0.56648433",
"0.5663563",
"0.566155",
"0.56344765",
"0.56042415",
"0.5599695",
"0.5575068",
"0.55728483",
"0.55728054",
"0.5572383",
"0.55714524",
"0.5562935",
"0.5561264",
"0.5559939",
"0.5551305",
"0.55446804",
"0.55424327",
"0.55353785",
"0.5531467",
"0.5529364",
"0.55055785",
"0.5498796",
"0.54932547",
"0.5489597",
"0.547817",
"0.547437",
"0.54643184",
"0.5456402"
] |
0.0
|
-1
|
Tests for release 1:
|
def test_average
assert_equal(90, @students[0].average, "The first student's average score is not 90")
assert_equal("A", @students[0].letter_grade, "The first student's letter grade is not an A.")
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def test_prerelease?(_)\n false\n end",
"def prerelease_specs; end",
"def test_method_release\n value_ = ::Versionomy.create(:major => 1, :minor => 9, :tiny => 2, :release_type => :alpha, :alpha_version => 4)\n value2_ = value_.release\n assert_equal([1, 9, 2, 0, :final, 0, 0], value2_.values_array)\n value_ = ::Versionomy.create(:major => 1, :minor => 9, :tiny => 2)\n value2_ = value_.release\n assert_equal(value_, value2_)\n end",
"def test_method_prereleasep\n value_ = ::Versionomy.create([1, 9, 2, 'a', 2], :rubygems)\n assert_equal(true, value_.prerelease?)\n value_ = ::Versionomy.create([1, 9, 2, 2], :rubygems)\n assert_equal(false, value_.prerelease?)\n end",
"def test_version\n skip\n assert_equal 2, BookKeeping::VERSION\n end",
"def test_method_prereleasep\n value_ = ::Versionomy.create([1, 9, 2, 'a2'], :semver)\n assert_equal(true, value_.prerelease?)\n value_ = ::Versionomy.create([1, 9, 2], :semver)\n assert_equal(false, value_.prerelease?)\n end",
"def test_version\n assert Snarl.version >= '1.1'\n end",
"def validate_release \n if !system(\"origen examples\") #|| !system(\"origen specs\") \n puts \"Sorry but you can't release with failing tests, please fix them and try again.\" \n exit 1 \n else \n puts \"All tests passing, proceeding with release process!\" \n end \n end",
"def test_bookkeeping\n # skip\n assert_equal 1, BookKeeping::VERSION\n end",
"def test_bookkeeping\n skip\n assert_equal 1, BookKeeping::VERSION\n end",
"def test_bookkeeping\n skip\n assert_equal 1, BookKeeping::VERSION\n end",
"def test_bookkeeping\n skip\n assert_equal 1, BookKeeping::VERSION\n end",
"def test_bookkeeping\n skip\n assert_equal 1, BookKeeping::VERSION\n end",
"def test_bookkeeping\n skip\n assert_equal 1, BookKeeping::VERSION\n end",
"def test_bookkeeping\n skip\n assert_equal 1, BookKeeping::VERSION\n end",
"def test_bookkeeping\n skip\n assert_equal 1, BookKeeping::VERSION\n end",
"def test_default_banner\n release = @rogerfile.release(scm: :fixed)\n\n # Set fixed version\n date = Time.now\n release.scm.version = \"1.0.0\"\n release.scm.date = date\n\n lines = release.banner.split(\"\\n\")\n\n assert_equal \"/* ====================== */\", lines[0]\n assert_equal \"/* = Version : 1.0.0 = */\", lines[1]\n assert_equal \"/* = Date : #{date.strftime('%Y-%m-%d')} = */\", lines[2]\n assert_equal \"/* ====================== */\", lines[3]\n end",
"def test_bookkeeping\n skip\n assert_equal 2, BookKeeping::VERSION\n end",
"def test_bookkeeping\n skip\n assert_equal 2, BookKeeping::VERSION\n end",
"def test_bookkeeping\n skip\n assert_equal 2, BookKeeping::VERSION\n end",
"def test_bookkeeping\n skip\n assert_equal 2, BookKeeping::VERSION\n end",
"def test_bookkeeping\n skip\n assert_equal 2, BookKeeping::VERSION\n end",
"def test_bookkeeping\n skip\n assert_equal 2, BookKeeping::VERSION\n end",
"def test_bookkeeping\n skip\n assert_equal 4, BookKeeping::VERSION\n end",
"def test_bump_preview_to_release\n value_ = ::Versionomy.create(:major => 2, :tiny => 1, :release_type => :preview)\n value_ = value_.bump(:release_type)\n assert_equal(2, value_.major)\n assert_equal(0, value_.minor)\n assert_equal(1, value_.tiny)\n assert_equal(0, value_.tiny2)\n assert_equal(:final, value_.release_type)\n assert_equal(0, value_.patchlevel)\n assert_equal(0, value_.patchlevel_minor)\n end",
"def test_truth\n assert_kind_of Release, @release\n end",
"def test_method_release\n value_ = ::Versionomy.create([1, 9, 2, 'a', 2], :rubygems)\n value2_ = value_.release\n assert_equal([1, 9, 2, 0, 0, 0, 0, 0], value2_.values_array)\n value_ = ::Versionomy.create([1, 9, 2, 5, 2], :rubygems)\n value2_ = value_.release\n assert_equal(value_, value2_)\n end",
"def test_prerelease?(version)\n !@version.stable? && @version.major == version.major && @version.minor == version.minor && @version.patch == version.patch\n end",
"def test_that_it_has_a_version_number\n refute_nil ::Malody::VERSION\n end",
"def validate_release\n if !system(\"origen specs\") || !system(\"origen examples\")\n puts \"Sorry but you can't release with failing tests, please fix them and try again.\"\n exit 1\n else\n puts \"All tests passing, proceeding with release process!\"\n end\n end",
"def test_bookkeeping\n skip\n assert_equal 3, BookKeeping::VERSION\n end",
"def test_bookkeeping\n skip\n assert_equal 3, BookKeeping::VERSION\n end",
"def test_bookkeeping\n assert_equal 1, BookKeeping::VERSION\n end",
"def test_bookkeeping\n assert_equal 1, BookKeeping::VERSION\n end",
"def validate_release\n if !system(\"origen examples\")\n puts \"Sorry but you can't release with failing tests, please fix them and try again.\"\n exit 1\n else\n puts \"All tests passing, proceeding with release process!\"\n end\n end",
"def test_bookkeeping\n assert_equal 1, RunLengthEncoding::VERSION\n end",
"def test_version\n\n #prepare\n subject=Xcider::Xcodebuild.new\n\n #test\n v=subject.version\n\n #verify\n assert_not_nil v\n\n end",
"def test_comparison_release_type\n value1_ = ::Versionomy.create(:major => 2, :release_type => :alpha, :alpha_version => 5)\n value2_ = ::Versionomy.create(:major => 2, :release_type => :release_candidate, :release_candidate_version => 2)\n assert(value2_ > value1_)\n end",
"def release\n @release ||= ENV[\"RELEASE\"] || \"1\"\n end",
"def has_version?; end",
"def test_bookkeeping\n assert_equal 3, BookKeeping::VERSION\n end",
"def make_prerelease\n fail AlreadyPreRelease if prerelease?\n @special = PRE_RELEASE.first\n end",
"def test_bump_release_candidate_to_release\n value_ = ::Versionomy.create(:major => 2, :tiny => 1, :release_type => :release_candidate, :release_candidate_version => 2)\n value_ = value_.bump(:release_type)\n assert_equal(2, value_.major)\n assert_equal(0, value_.minor)\n assert_equal(1, value_.tiny)\n assert_equal(0, value_.tiny2)\n assert_equal(:final, value_.release_type)\n assert_equal(0, value_.patchlevel)\n assert_equal(0, value_.patchlevel_minor)\n end",
"def test_that_bumping_with_prereleases\r\n v = Bumper::Version.new\r\n assert_equal '0.0.0.0', v.to_s\r\n assert_equal 1, v.bump_minor\r\n assert_equal '0.1.0.0', v.to_s\r\n assert_equal 'beta', v.bump_patch_tag('beta')\r\n assert_equal '0.1.1-beta.0', v.to_s\r\n assert_equal 'beta2', v.bump_patch_tag('beta')\r\n assert_equal '0.1.1-beta2.0', v.to_s\r\n assert_equal '1', v.bump_build\r\n assert_equal '0.1.1-beta2.1', v.to_s\r\n assert_equal 'rc', v.bump_patch_tag('rc') # replaces tag\r\n assert_equal '0.1.1-rc.0', v.to_s\r\n assert_equal 'rc2', v.bump_patch_tag('rc')\r\n assert_equal '0.1.1-rc2.0', v.to_s\r\n assert_equal 1, v.bump_patch # drops tag\r\n assert_equal '0.1.1.0', v.to_s\r\n assert_equal 2, v.bump_patch\r\n assert_equal '0.1.2.0', v.to_s\r\n assert_equal 2, v.bump_minor\r\n assert_equal '0.2.0.0', v.to_s\r\n assert_equal 'alpha', v.bump_patch_tag('alpha')\r\n assert_equal '0.2.1-alpha.0', v.to_s\r\n assert_equal 3, v.bump_minor\r\n assert_equal '0.3.0.0', v.to_s\r\n v.build = 'rc1'\r\n assert_equal '0.3.0.rc1', v.to_s\r\n assert_equal 'rc2', v.bump_build\r\n assert_equal '0.3.0.rc2', v.to_s\r\n end",
"def test_that_it_should_bump_versions\r\n v = Bumper::Version.new\r\n assert_equal '1', v.bump_build\r\n assert_equal '0.0.0.1', v.to_s\r\n assert_equal 1, v.bump_patch\r\n assert_equal '0.0.1.0', v.to_s\r\n assert_equal 1, v.bump_minor\r\n assert_equal '0.1.0.0', v.to_s\r\n assert_equal 1, v.bump_major\r\n assert_equal '1.0.0.0', v.to_s\r\n end",
"def target_version; end",
"def test_bookkeeping\n assert_equal 1, Pangram::VERSION\n end",
"def released_specs; end",
"def version_mismatch_detected\n end",
"def released? # for readability\n released\n end",
"def test_it_has_a_version_number\n refute_nil ::ApMessageIo::VERSION\n end",
"def test_release\n\n checklist_0_1 = checklists(:checklist_0_1)\n \n # Try releasing without logging in.\n put(:release, { :id => checklist_0_1.id }, {})\n assert_redirected_to(:controller => 'user', :action => 'login')\n\n # Try releasing from a non-Admin account.\n checklist_count = Checklist.count\n\n checklist = Checklist.find(checklist_0_1.id)\n assert_equal(0, checklist.major_rev_number)\n assert_equal(1, checklist.minor_rev_number)\n\n put(:release, {:id => checklist_0_1.id}, rich_designer_session)\n assert_redirected_to(:controller => 'tracker', :action => 'index')\n #assert_equal(Pcbtr::MESSAGES[:admin_only], flash['notice'])\n\n put(:release, {:id => checklist_0_1.id}, cathy_admin_session)\n assert_redirected_to(:action => 'list')\n #assert_equal('Checklist successfully released', flash['notice'])\n assert_equal(checklist_count, Checklist.count)\n \n checklist = Checklist.find(checklist_0_1.id)\n assert_equal(@checklist_101.major_rev_number+1, checklist.major_rev_number)\n assert_equal(0, checklist.minor_rev_number)\n\n end",
"def dev_minor() end",
"def target_version=(_arg0); end",
"def standalone; end",
"def own_version(version)\n version.release_type == :final\n end",
"def release?\n prerelease.empty? && build.empty?\n end",
"def test_get_version_number\n assert_equal 3, ChangeLogs.get_version_number(1,'test')\n end",
"def test_bump_development_to_alpha\n value_ = ::Versionomy.create(:major => 2, :tiny => 1, :release_type => :development, :development_version => 7)\n value_ = value_.bump(:release_type)\n assert_equal(2, value_.major)\n assert_equal(0, value_.minor)\n assert_equal(1, value_.tiny)\n assert_equal(0, value_.tiny2)\n assert_equal(:alpha, value_.release_type)\n assert_equal(1, value_.alpha_version)\n assert_equal(0, value_.alpha_minor)\n end",
"def execute_ruby_release(type:)\n version_regex = %r{.version\\s*=\\s*'([\\d\\.]+)'}\n gemspec_path = Dir.glob(\"*.gemspec\").first\n gemspec_contents = File.read(gemspec_path)\n version = gemspec_contents.match(version_regex)[1]\n version = Semverse::Version.new(version)\n new_version = \"0.0.5\"\n gemspec_contents = gemspec_contents.sub(version_regex, \".version = '#{new_version}'\")\n\n gemspec_folder_obj = octokit.contents(@originating_repo,)\n gemspec_file_obj = gemspec_folder_obj.find { |file| file[:name] == gemspec_path }\n gemspec_file = octokit.blob(@originating_repo, gemspec_file_obj[:sha])\n gemspec_obj = octokit.contents(@originating_repo, path: gemspec_path)\n gemspec_sha = gemspec_file['sha']\n contents = Base64.encode64(gemspec_contents)\n json = {\n message: \"Updating to #{new_version}\",\n content: contents,\n sha: gemspec_sha\n }.to_json\n\n gemspec_file_obj = octokit.update_contents(@originating_repo, gemspec_path, \"Release #{new_version}\", gemspec_sha, gemspec_contents)\n octokit.add_comment(@originating_repo, @pr_number, \"Thanks! This is now out in #{new_version}\")\n end",
"def github_released\n puts green(\"Release completed\")\n end",
"def version; end",
"def version; end",
"def version; end",
"def version; end",
"def version; end",
"def version; end",
"def version; end",
"def version; end",
"def version; end",
"def version; end",
"def version; end",
"def version; end",
"def version; end",
"def version; end",
"def version; end",
"def version; end",
"def version; end",
"def version; end",
"def version; end",
"def version; end",
"def version; end",
"def version; end",
"def version; end",
"def patch_version; end",
"def release_version!\n projects.each { |project| project.release_version!(tag_full_name) }\n print_log 'Versions released'\n slack_notifier.ping(release_message, icon_emoji: ':see_no_evil:')\n end",
"def def_version; end",
"def test_has_version_number\n assert_not_nil(Tree::VERSION)\n end",
"def spec; end",
"def spec; end",
"def test_that_it_has_a_version_number\n refute_nil ::Paddingoracle::VERSION\n end",
"def major_version; end",
"def test_bump_alpha_to_beta\n value_ = ::Versionomy.create(:major => 2, :tiny => 1, :release_type => :alpha)\n value_ = value_.bump(:release_type)\n assert_equal(2, value_.major)\n assert_equal(0, value_.minor)\n assert_equal(1, value_.tiny)\n assert_equal(0, value_.tiny2)\n assert_equal(:beta, value_.release_type)\n assert_equal(1, value_.beta_version)\n assert_equal(0, value_.beta_minor)\n end",
"def testing\n # ...\n end",
"def prerelease?\n @prerelease ||= @version =~ /[a-zA-Z]/\n end",
"def setup; end",
"def setup; end",
"def setup; end",
"def setup; end",
"def setup; end",
"def setup; end"
] |
[
"0.7133334",
"0.6801476",
"0.6784073",
"0.6770783",
"0.6739839",
"0.66585684",
"0.6618336",
"0.6535496",
"0.6533273",
"0.6486486",
"0.6486486",
"0.6486486",
"0.6486486",
"0.6486486",
"0.6486486",
"0.6486486",
"0.6474132",
"0.647095",
"0.647095",
"0.647095",
"0.647095",
"0.647095",
"0.647095",
"0.64599305",
"0.64426655",
"0.64126045",
"0.641068",
"0.63773537",
"0.6371673",
"0.6362994",
"0.6359996",
"0.6359996",
"0.63539416",
"0.63539416",
"0.6350302",
"0.6350229",
"0.63483274",
"0.63283074",
"0.62554204",
"0.6223936",
"0.62124085",
"0.62022907",
"0.6183242",
"0.61710656",
"0.6161623",
"0.6133166",
"0.61082447",
"0.6093895",
"0.608584",
"0.6075055",
"0.6025422",
"0.6019828",
"0.6019413",
"0.6006959",
"0.59941167",
"0.59600264",
"0.59157944",
"0.59092385",
"0.59082466",
"0.5895923",
"0.5895446",
"0.588323",
"0.588323",
"0.588323",
"0.588323",
"0.588323",
"0.588323",
"0.588323",
"0.588323",
"0.588323",
"0.588323",
"0.588323",
"0.588323",
"0.588323",
"0.588323",
"0.588323",
"0.588323",
"0.588323",
"0.588323",
"0.588323",
"0.588323",
"0.588323",
"0.588323",
"0.588323",
"0.5880082",
"0.5879269",
"0.5868555",
"0.5854335",
"0.5852801",
"0.5852801",
"0.5844574",
"0.5841949",
"0.58349216",
"0.58049685",
"0.5799516",
"0.5789691",
"0.5789691",
"0.5789691",
"0.5789691",
"0.5789691",
"0.5789691"
] |
0.0
|
-1
|
Tests for release 2:
|
def test_linear_search
ls_sample = @students
assert_equal(0, linear_search(ls_sample, "Alex"), "Alex is not the first student.")
assert_equal(-1, linear_search(ls_sample, "NOT A STUDENT"), "Oddly, NOT A STUDENT, is the name of a student!")
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def test_version\n skip\n assert_equal 2, BookKeeping::VERSION\n end",
"def test_method_release\n value_ = ::Versionomy.create(:major => 1, :minor => 9, :tiny => 2, :release_type => :alpha, :alpha_version => 4)\n value2_ = value_.release\n assert_equal([1, 9, 2, 0, :final, 0, 0], value2_.values_array)\n value_ = ::Versionomy.create(:major => 1, :minor => 9, :tiny => 2)\n value2_ = value_.release\n assert_equal(value_, value2_)\n end",
"def test_bookkeeping\n skip\n assert_equal 2, BookKeeping::VERSION\n end",
"def test_bookkeeping\n skip\n assert_equal 2, BookKeeping::VERSION\n end",
"def test_bookkeeping\n skip\n assert_equal 2, BookKeeping::VERSION\n end",
"def test_bookkeeping\n skip\n assert_equal 2, BookKeeping::VERSION\n end",
"def test_bookkeeping\n skip\n assert_equal 2, BookKeeping::VERSION\n end",
"def test_bookkeeping\n skip\n assert_equal 2, BookKeeping::VERSION\n end",
"def prerelease_specs; end",
"def test_version\n assert Snarl.version >= '1.1'\n end",
"def test_prerelease?(_)\n false\n end",
"def test_bookkeeping\n skip\n assert_equal 4, BookKeeping::VERSION\n end",
"def test_bookkeeping\n # skip\n assert_equal 1, BookKeeping::VERSION\n end",
"def test_bookkeeping\n assert_equal 1, RunLengthEncoding::VERSION\n end",
"def test_bookkeeping\n skip\n assert_equal 3, BookKeeping::VERSION\n end",
"def test_bookkeeping\n skip\n assert_equal 3, BookKeeping::VERSION\n end",
"def test_bookkeeping\n skip\n assert_equal 1, BookKeeping::VERSION\n end",
"def test_bookkeeping\n skip\n assert_equal 1, BookKeeping::VERSION\n end",
"def test_bookkeeping\n skip\n assert_equal 1, BookKeeping::VERSION\n end",
"def test_bookkeeping\n skip\n assert_equal 1, BookKeeping::VERSION\n end",
"def test_bookkeeping\n skip\n assert_equal 1, BookKeeping::VERSION\n end",
"def test_bookkeeping\n skip\n assert_equal 1, BookKeeping::VERSION\n end",
"def test_bookkeeping\n skip\n assert_equal 1, BookKeeping::VERSION\n end",
"def spec; end",
"def spec; end",
"def test_method_release\n value_ = ::Versionomy.create([1, 9, 2, 'a', 2], :rubygems)\n value2_ = value_.release\n assert_equal([1, 9, 2, 0, 0, 0, 0, 0], value2_.values_array)\n value_ = ::Versionomy.create([1, 9, 2, 5, 2], :rubygems)\n value2_ = value_.release\n assert_equal(value_, value2_)\n end",
"def test_method_prereleasep\n value_ = ::Versionomy.create([1, 9, 2, 'a', 2], :rubygems)\n assert_equal(true, value_.prerelease?)\n value_ = ::Versionomy.create([1, 9, 2, 2], :rubygems)\n assert_equal(false, value_.prerelease?)\n end",
"def test_truth\n assert_kind_of Release, @release\n end",
"def test_bookkeeping\n assert_equal 3, BookKeeping::VERSION\n end",
"def self_test; end",
"def self_test; end",
"def test_bookkeeping\n assert_equal 1, BookKeeping::VERSION\n end",
"def test_bookkeeping\n assert_equal 1, BookKeeping::VERSION\n end",
"def testing\n # ...\n end",
"def validate_release \n if !system(\"origen examples\") #|| !system(\"origen specs\") \n puts \"Sorry but you can't release with failing tests, please fix them and try again.\" \n exit 1 \n else \n puts \"All tests passing, proceeding with release process!\" \n end \n end",
"def version_mismatch_detected\n end",
"def test_hack\n assert(true)\n end",
"def test_method_prereleasep\n value_ = ::Versionomy.create([1, 9, 2, 'a2'], :semver)\n assert_equal(true, value_.prerelease?)\n value_ = ::Versionomy.create([1, 9, 2], :semver)\n assert_equal(false, value_.prerelease?)\n end",
"def test_that_it_has_a_version_number\n refute_nil ::Malody::VERSION\n end",
"def test_comparison_release_type\n value1_ = ::Versionomy.create(:major => 2, :release_type => :alpha, :alpha_version => 5)\n value2_ = ::Versionomy.create(:major => 2, :release_type => :release_candidate, :release_candidate_version => 2)\n assert(value2_ > value1_)\n end",
"def test_bookkeeping\n assert_equal 1, Pangram::VERSION\n end",
"def setup; end",
"def setup; end",
"def setup; end",
"def setup; end",
"def setup; end",
"def setup; end",
"def setup; end",
"def setup; end",
"def setup; end",
"def setup; end",
"def setup; end",
"def setup; end",
"def setup; end",
"def setup; end",
"def setup; end",
"def setup; end",
"def setup; end",
"def setup; end",
"def setup; end",
"def tests; end",
"def tests; end",
"def released_specs; end",
"def __dummy_test__\n end",
"def test_version\n\n #prepare\n subject=Xcider::Xcodebuild.new\n\n #test\n v=subject.version\n\n #verify\n assert_not_nil v\n\n end",
"def validate_release\n if !system(\"origen specs\") || !system(\"origen examples\")\n puts \"Sorry but you can't release with failing tests, please fix them and try again.\"\n exit 1\n else\n puts \"All tests passing, proceeding with release process!\"\n end\n end",
"def validate_release\n if !system(\"origen examples\")\n puts \"Sorry but you can't release with failing tests, please fix them and try again.\"\n exit 1\n else\n puts \"All tests passing, proceeding with release process!\"\n end\n end",
"def test_get_version_number\n assert_equal 3, ChangeLogs.get_version_number(1,'test')\n end",
"def standalone; end",
"def test_release\n\n checklist_0_1 = checklists(:checklist_0_1)\n \n # Try releasing without logging in.\n put(:release, { :id => checklist_0_1.id }, {})\n assert_redirected_to(:controller => 'user', :action => 'login')\n\n # Try releasing from a non-Admin account.\n checklist_count = Checklist.count\n\n checklist = Checklist.find(checklist_0_1.id)\n assert_equal(0, checklist.major_rev_number)\n assert_equal(1, checklist.minor_rev_number)\n\n put(:release, {:id => checklist_0_1.id}, rich_designer_session)\n assert_redirected_to(:controller => 'tracker', :action => 'index')\n #assert_equal(Pcbtr::MESSAGES[:admin_only], flash['notice'])\n\n put(:release, {:id => checklist_0_1.id}, cathy_admin_session)\n assert_redirected_to(:action => 'list')\n #assert_equal('Checklist successfully released', flash['notice'])\n assert_equal(checklist_count, Checklist.count)\n \n checklist = Checklist.find(checklist_0_1.id)\n assert_equal(@checklist_101.major_rev_number+1, checklist.major_rev_number)\n assert_equal(0, checklist.minor_rev_number)\n\n end",
"def test_0_dummy\n\t\tend",
"def test_it_has_a_version_number\n refute_nil ::ApMessageIo::VERSION\n end",
"def test_default_banner\n release = @rogerfile.release(scm: :fixed)\n\n # Set fixed version\n date = Time.now\n release.scm.version = \"1.0.0\"\n release.scm.date = date\n\n lines = release.banner.split(\"\\n\")\n\n assert_equal \"/* ====================== */\", lines[0]\n assert_equal \"/* = Version : 1.0.0 = */\", lines[1]\n assert_equal \"/* = Date : #{date.strftime('%Y-%m-%d')} = */\", lines[2]\n assert_equal \"/* ====================== */\", lines[3]\n end",
"def private; end",
"def dev_minor() end",
"def test_that_it_should_bump_versions\r\n v = Bumper::Version.new\r\n assert_equal '1', v.bump_build\r\n assert_equal '0.0.0.1', v.to_s\r\n assert_equal 1, v.bump_patch\r\n assert_equal '0.0.1.0', v.to_s\r\n assert_equal 1, v.bump_minor\r\n assert_equal '0.1.0.0', v.to_s\r\n assert_equal 1, v.bump_major\r\n assert_equal '1.0.0.0', v.to_s\r\n end",
"def assertions; end",
"def assertions; end",
"def target_version; end",
"def test_bump_preview_to_release\n value_ = ::Versionomy.create(:major => 2, :tiny => 1, :release_type => :preview)\n value_ = value_.bump(:release_type)\n assert_equal(2, value_.major)\n assert_equal(0, value_.minor)\n assert_equal(1, value_.tiny)\n assert_equal(0, value_.tiny2)\n assert_equal(:final, value_.release_type)\n assert_equal(0, value_.patchlevel)\n assert_equal(0, value_.patchlevel_minor)\n end",
"def test_comparison_minor\n value1_ = ::Versionomy.create(:major => 2, :tiny => 1, :tiny2 => 3, :release_type => :release_candidate, :release_candidate_version => 2)\n value2_ = ::Versionomy.create(:major => 2, :minor => 1, :release_type => :alpha)\n assert(value2_ > value1_)\n end",
"def testNominalWithSeveralPlatforms\n setupTest do |iTasksFileName, iTicketsFileName|\n $Context[:OS_ExecAnswers] = [\n # svn co => success\n [ 0, '' ],\n # deliver => success, generating files\n [ 0, '', @@Generator_DummyGemAndWindows ]\n ]\n executeProcess(\n [\n '--user', 'ReleaseUser',\n '--branch', 'BranchName',\n '--comment', 'ReleaseComment',\n '--version', '0.0.1.20100317',\n '--tasksfile', iTasksFileName,\n '--ticketsfile', iTicketsFileName,\n '--svnco', 'MySVNRep',\n '--deliver', 'deliver %{DeliverablesDir}'\n ]\n ) do |iError, iSlaveActions|\n checkCallsMatch(\n [\n [ 'query', 'svn co MySVNRep' ],\n [ 'query', /^deliver .*$/ ]\n ],\n $Variables[:OS_Exec]\n )\n assert_equal( @@CommonSlaveActions.merge(\n {\n Tools::FilesManager => {\n Actions::File_Upload => [\n [ WEACE::Master::TransferFile.new(\"#{$Variables[:DeliverableDir]}/Releases/All/Gem/DummyGem.gem\"), 'All', 'Gem', 'BranchName', '0.0.1.20100317', 'ReleaseUser', 'ReleaseComment' ],\n [ WEACE::Master::TransferFile.new(\"#{$Variables[:DeliverableDir]}/Releases/Windows/Inst/Install.exe\"), 'Windows', 'Inst', 'BranchName', '0.0.1.20100317', 'ReleaseUser', 'ReleaseComment' ]\n ]\n }\n } ),\n iSlaveActions\n )\n end\n end\n end",
"def test_that_it_has_a_version_number\n refute_nil ::Paddingoracle::VERSION\n end",
"def setup\n\n end",
"def setup\n\n end",
"def setup\n\n end",
"def patch_version; end",
"def has_version?; end",
"def setup; end",
"def setup\n end",
"def setup\n end",
"def setup\n end",
"def setup\n end",
"def setup\n end",
"def setup\n end",
"def setup\n \n end",
"def setup\n \n end",
"def setup\n \n end",
"def setup\n \n end",
"def setup\n \n end",
"def setup\n \n end"
] |
[
"0.6921893",
"0.66968125",
"0.6682701",
"0.6682701",
"0.6682701",
"0.6682701",
"0.6682701",
"0.6682701",
"0.66439456",
"0.6642064",
"0.6597606",
"0.65617037",
"0.65609646",
"0.65239817",
"0.6505215",
"0.6505215",
"0.64898753",
"0.64898753",
"0.64898753",
"0.64898753",
"0.64898753",
"0.64898753",
"0.64898753",
"0.64633024",
"0.64633024",
"0.638783",
"0.63563615",
"0.634863",
"0.63365483",
"0.6335859",
"0.6335859",
"0.63300747",
"0.63300747",
"0.6317923",
"0.6308622",
"0.62922066",
"0.62749857",
"0.6269606",
"0.6212816",
"0.6192465",
"0.61737245",
"0.6162262",
"0.6162262",
"0.6162262",
"0.6162262",
"0.6162262",
"0.6162262",
"0.6162262",
"0.6162262",
"0.6162262",
"0.6162262",
"0.6162262",
"0.6162262",
"0.6162262",
"0.6162262",
"0.6162262",
"0.6162262",
"0.6162262",
"0.6162262",
"0.6162262",
"0.61560893",
"0.61560893",
"0.6144567",
"0.61388826",
"0.61340743",
"0.6086806",
"0.6023665",
"0.60119164",
"0.59797573",
"0.59690666",
"0.59656465",
"0.5944096",
"0.5940692",
"0.59249043",
"0.5920423",
"0.5895809",
"0.5882946",
"0.5882946",
"0.58790994",
"0.58742154",
"0.58565134",
"0.5823714",
"0.5820234",
"0.58161587",
"0.58161587",
"0.58161587",
"0.58144945",
"0.5806496",
"0.58007085",
"0.5796259",
"0.5796259",
"0.5796259",
"0.5796259",
"0.5796259",
"0.5796259",
"0.5780859",
"0.5780859",
"0.5780859",
"0.5780859",
"0.5780859",
"0.5780859"
] |
0.0
|
-1
|
GET /keeps GET /keeps.json
|
def index
@keeps = current_user.keeps
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def destroy\n @keep.destroy\n respond_to do |format|\n format.html { redirect_to keeps_url, notice: 'Keep was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def keep\n __flag__ :keep\n end",
"def create\n @keep = current_user.keeps.new(keep_params)\n\n respond_to do |format|\n if @keep.save\n format.html { redirect_to @keep, notice: 'Keep was successfully created.' }\n format.json { render :show, status: :created, location: @keep }\n else\n format.html { render :new }\n format.json { render json: @keep.errors, status: :unprocessable_entity }\n end\n end\n end",
"def get_files_to_keep\n return @resource[:files_to_keep]\n end",
"def keep_params\n params.require(:keep).permit(:name, :note)\n end",
"def set_keep\n @keep = current_user.keeps.find(params[:id])\n end",
"def keep_all\n @keep_all = true\n end",
"def keep(*files)\n @keep.concat(files.flatten)\n end",
"def keep_data\n new_kept_data = kept << Hanami::Utils::Json.generate({ count: 0, data: _data })\n\n update_kept(new_kept_data)\n end",
"def kept\n @session[KEPT_KEY] || []\n end",
"def delete_gists(id)\n result = self.class.delete(\"/gists/#{id}\", :headers => @headers)\n puts \"#{result.headers['x-ratelimit-remaining']} requests left!\"\n end",
"def keep_files; end",
"def keep(k = nil)\n k = k.to_s if k\n @discard.subtract Array(k || keys)\n k ? self[k] : self\n end",
"def delete\n render json: Like.delete(params[\"id\"])\n end",
"def index\n @bookkeepings = @group.bookkeepings.order(created_at: :desc)\n\n if params[:start_date]\n @bookkeepings = @bookkeepings.where(\"issue_date >= ?\", params[:start_date])\n end\n if params[:end_date]\n @bookkeepings = @bookkeepings.where(\"issue_date < ?\", Date.parse(params[:end_date]) + 1.day)\n end\n\n render json: @bookkeepings\n end",
"def update\n respond_to do |format|\n if @keep.update(keep_params)\n format.html { redirect_to @keep, notice: 'Keep was successfully updated.' }\n format.json { render :show, status: :ok, location: @keep }\n else\n format.html { render :edit }\n format.json { render json: @keep.errors, status: :unprocessable_entity }\n end\n end\n end",
"def deleted_request\n r = {}\n render json: r,\n root: :data,\n status: :no_content\n end",
"def get_files_to_purge(files, to_keep)\n to_purge = files - to_keep\n to_purge\n end",
"def deleted\n @client_assets = ClientAsset.inactive_client_assets.search(params[:search],params[:action]).order(sort_column(\"ClientAsset\", 'client_name') + ' ' + sort_direction).paginate(:page => params[:page], :per_page => 5)\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @client_assets }\n end\n end",
"def index\n birds = Bird.all\n render json: birds.to_json(except: [:created_at, :updated_at])\n end",
"def retrieve_unused_artifacts_by_age_test\n return [JSON.parse('{\"uri\": \"keeper2\"}'), JSON.parse('{\"uri\": \"a1\"}'), JSON.parse('{\"uri\": \"keeper3\"}'), JSON.parse('{\"uri\": \"a2\"}'), JSON.parse('{\"uri\": \"a3\"}'), JSON.parse('{\"uri\": \"keeper1\"}')]\nend",
"def recordings_list_stored\n get \"recordings/stored\"\n end",
"def deployments_to_keep(env)\n (env['OPENSHIFT_KEEP_DEPLOYMENTS'] || 1).to_i\n end",
"def deleted\n render :json => Project.where(\"deleted = 1\")\n end",
"def index\n @loves = Love.all\n render json: @loves\n end",
"def hard_save\n args = request_params\n @uncommitted = save_and_remove_all(args[:map_id], args[:round])\n render json: @uncommitted\n end",
"def index\n # sleep 3 # simulate a slow connection\n render json: Secret.all.reverse\n end",
"def destroy\n if @grab.destroy\n respond_to do |format|\n format.html { redirect_to grabs_url }\n format.json { head :no_content }\n end\n end\n end",
"def delete_remaining_s3_assets\n # This gets up to 1000 objects.\n # If the user has over 1000 objects that were not in the database then there may be some assets remaining.\n keys = S3_BUCKET.objects(prefix: user.unique_id).map(&:key)\n\n s3_deletion_service.bulk_delete(keys)\n end",
"def delete_json(url)\n JSON.parse(delete(url, :json, :json))\n end",
"def expire_kept\n new_kept_data = kept.reject do |kept_data|\n parsed = Hanami::Utils::Json.parse(kept_data)\n parsed['count'] >= 2 if is_hash?(parsed) && parsed['count'].is_a?(Integer)\n end\n\n update_kept(new_kept_data)\n end",
"def index\n response = prepare_store_response(params, Item.where(:removed => nil))\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => response }\n end\n end",
"def destroy\n @hold_request.destroy\n respond_to do |format|\n format.html { redirect_to hold_requests_url, notice: 'Hold request was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def index\n @bookmarks = Bookmark.all\n render json: { bookmarks: @bookmarks }, status: :ok\n end",
"def stashed\n @user = User.from_param params[:id]\n @beers = @user.stashed_beers\n\n respond_to do |format|\n format.json { render_for_api :public, :json => @beers }\n format.xml { render_for_api :public, :xml => @beers }\n end\n end",
"def destroy\n @get.destroy\n respond_to do |format|\n format.html { redirect_to gets_url, notice: 'Get was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @take = Take.find(params[:id])\n @take.destroy\n\n respond_to do |format|\n format.html { redirect_to takes_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @serving = Serving.find(params[:id])\n @serving.destroy\n\n respond_to do |format|\n format.html { redirect_to servings_url }\n format.json { head :no_content }\n end\n end",
"def pruned_clients\n now = Time.current.to_i\n\n out = []\n RedisInstance.hgetall(STATE_KEY).each do |uuid, raw|\n data = JSON.parse(raw)\n if stale?(data['last'])\n RedisInstance.hdel(STATE_KEY, uuid)\n else\n out << {\n uuid: sanitize(uuid),\n name: sanitize(data['name']),\n value: data['value'].to_f\n }\n end\n end\n out\n end",
"def index\r\n markers = Marker.all\r\n render json: markers\r\n end",
"def unused_taken_funds\n authenticated_post(\"unused_taken_funds\").body\n end",
"def destroy\n @still.destroy\n respond_to do |format|\n format.html { redirect_to stills_url, notice: 'Still was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def index\n @preservatives = Preservative.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @preservatives }\n end\n end",
"def user_holds opts= {}\n path, opts = build_user_path(\"holds\", opts)\n JSON.parse(get path, opts)\n end",
"def index\n render json: User.unliked_cats(current_user.liked_cats)\n end",
"def get_all_kids\n render json: Parent.find(params[:id]).kids\n end",
"def destroy\n @hold_request.destroy\n respond_to do |format|\n format.html { redirect_to student_requests_path, notice: 'Hold request was deleted.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @grab.destroy\n respond_to do |format|\n format.html { redirect_to grabs_url, notice: 'Grab was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def fetch_albums_prune(params = {})\n params = { :cmd => 'fetch-albums-prune', :no_perms => 'y' }.merge(params)\n send_request(params)\n end",
"def unseen\n messages = current_user.received_messages.where(seen: false)\n render json: messages\n end",
"def keep_dirs; end",
"def listofusers\n @users = User.follower_hash(current_user)\n @users.delete_if { |id, value| id.blank? }\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => [@users] }\n end\nend",
"def clearAPI\n persist = [\"ip\", \"session\", \"cuid\", \"lang\", \"site\", \"currentURI\", \"previousURI\", \"clientToken\", \"recContent\"]\n @request_data.keep_if {|key,value| persist.include? key} \n end",
"def destroy\n @disappeared.destroy\n respond_to do |format|\n format.html { redirect_to site_profile_relative_disappeareds_path(@relative), notice: t('.destroyed')}\n format.json { head :no_content }\n end\n end",
"def destroy\n @want.destroy\n respond_to do |format|\n format.html { redirect_to wants_url }\n format.json { head :no_content }\n end\n end",
"def slice(*keep)\n inject(Characterizable::BetterHash.new) do |memo, ary|\n if keep.include?(ary[0])\n memo[ary[0]] = ary[1]\n end\n memo\n end\n end",
"def ignorable_objects\n\t\t[]\n\tend",
"def backups_to_keep\n @backups_to_keep ||= 2\n end",
"def dresses\n render json: { collections: Collection.published_dresses }\n end",
"def keep_releases(arg = nil)\n [set_or_return(\n :keep_releases,\n arg,\n kind_of: [ Integer ]), 1].max\n end",
"def destroy\n @get = Get.find(params[:id])\n @get.destroy\n\n respond_to do |format|\n format.html { redirect_to gets_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @miss.destroy\n respond_to do |format|\n format.html { redirect_to misses_url }\n format.json { head :no_content }\n end\n end",
"def delete_json(path)\n url = [base_url, path].join\n resp = HTTParty.delete(url, headers: standard_headers)\n parse_json(url, resp)\n end",
"def index\n @requests = Request.all\n\n render json: @requests\n end",
"def index\n @keys = Key.all\n render json: @keys\n end",
"def purge_old_requests(seconds = 60)\n @requests.delete_if {|request_time| request_time < Time.now - seconds}\n end",
"def destroy\n @serving.destroy\n respond_to do |format|\n format.html { redirect_to servings_url, notice: 'Serving was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def index\n @snippets = Snippet.order(\"updated_at DESC\").where(private: false).paginate(page: params[:page], per_page: 10)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @snippets }\n end\n end",
"def destroy\n @kid.destroy\n respond_to do |format|\n format.html { redirect_to kids_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @wanted = Wanted.find(params[:id])\n @wanted.destroy\n\n respond_to do |format|\n format.html { redirect_to wanteds_url }\n format.json { head :no_content }\n end\n end",
"def allfeedseen\n\t\tusernews = News.where(:targetuser_id => current_user.id).all\n\t\tusernews.update_all(:seen => 1);\n\t\tusernews.order('created_at DESC').offset(20).destroy_all\n\n\t\trespond_to do |format|\n format.json { render json: {} , status: 200 }\n end\n\tend",
"def index \n @bookings = Booking.with_deleted\n end",
"def destroy\n @unwanted.destroy\n respond_to do |format|\n format.html { redirect_to unwanteds_url, notice: 'Unwanted was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @lost = Lost.find(params[:id])\n @lost.destroy\n\n respond_to do |format|\n format.html { redirect_to losts_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @need.destroy\n respond_to do |format|\n format.html { redirect_to needs_url }\n format.json { head :no_content }\n end\n end",
"def delete\n render json: Post.delete(params[\"id\"])\n end",
"def destroy\n @walk_request.destroy\n respond_to do |format|\n format.html { redirect_to walk_requests_url, notice: 'walk request was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @takeout.destroy\n respond_to do |format|\n format.html { redirect_to takeouts_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @nudge.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end",
"def cleanup_cached_images()\n\n # swap_dir = \"../public/swap\" # use when running locally from /lib/s3_bucket.rb\n swap_dir = \"./public/swap\" # use when running via app.rb\n swap_contents = \"#{swap_dir}/*\"\n gitkeep = \"#{swap_dir}/.gitkeep\"\n\n if File.directory?(swap_dir)\n FileUtils.rm_rf(Dir.glob(swap_contents)) # delete contents of /public/swap \n file = File.new(gitkeep, 'w') # recreate .gitkeep file\n file.close if file\n else\n puts \"sightings directory does not exist!\"\n end\n\nend",
"def keep_dirs\n site.keep_files.flat_map { |file| parent_dirs(site.in_dest_dir(file)) }.to_set\n end",
"def destroy\n @mk_missatge.destroy\n respond_to do |format|\n format.html { redirect_to mk_missatges_url, notice: 'Mk missatge was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def index\n @pubs = Pub.all\n\n render json: @pubs\n end",
"def destroy\n @watermark.destroy\n respond_to do |format|\n format.html { redirect_to watermarks_url }\n format.json { head :no_content }\n end\n end",
"def unneeded_a_records(recordsets, keepers)\n recordsets.filter { |r| r[\"Type\"] == \"A\" }.filter do |record|\n name = record[\"Name\"].sub(/\\.$/, \"\") # remove extra \".\" from the end of the DNS record name\n !keepers.include?(name)\n end\nend",
"def destroy\n @stuck.destroy\n respond_to do |format|\n format.html { redirect_to stucks_url }\n format.json { head :no_content }\n end\n end",
"def get_all\n hitches = ::Hitch.where(shared?: true).where(\"submit_time > now()\").near([params[:user_latitude],params[:user_longitude]], 20)\n\n serializer = HitchSerializer.new(hitches, { params: { user_latitude: params[:user_latitude], user_longitude: params[:user_longitude] } })\n render json: serializer.serializable_hash\n end",
"def destroy\n @market.destroy\n respond_to do |format|\n format.html { redirect_to markets_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @saving.destroy\n respond_to do |format|\n format.html { redirect_to savings_url, notice: \"Saving was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"def destroy\n @saving.destroy\n respond_to do |format|\n format.html { redirect_to savings_url, notice: 'Saving was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @request.destroy\n\n respond_to do |format|\n format.html { redirect_to requests_url }\n format.json { head :no_content }\n end\n end",
"def index\n @books = Book.find(:all, :conditions => { :deleted => false })\n @book_request = Book.count(:request, :conditions => { :request => false})\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @books }\n end\n end",
"def index\n @used_bikes = UsedBike.all\n\n render json: @used_bikes, each_serializer: Web::V1::UsedBikeSerializer\n end",
"def index\n @crawl_requests = CrawlRequest.includes(:urls)\n\n render json: @crawl_requests, :include => :urls\n end",
"def index\n @notes = Note.all\n render json: @notes\n end",
"def destroy\n @request.destroy\n respond_to do |format|\n format.html { redirect_to requests_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @request.destroy\n respond_to do |format|\n format.html { redirect_to requests_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @request.destroy\n respond_to do |format|\n format.html { redirect_to requests_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @stakeholder = Stakeholder.find(params[:id])\n @stakeholder.destroy\n\n respond_to do |format|\n format.html { redirect_to stakeholders_url }\n format.json { head :no_content }\n end\n end",
"def restored_objects(datetime)\n aws_init\n restored_objs = {}\n @bucket.versions.each do |version|\n if restored_objs[version.object.key].nil?\n restored_objs[version.object.key] = {}\n restored_objs[version.object.key][:obj] = version.object\n restored_objs[version.object.key][:retain_versions] = []\n restored_objs[version.object.key][:discard_versions] = []\n end\n\n if version.last_modified > datetime\n restored_objs[version.object.key][:discard_versions] << version\n else\n restored_objs[version.object.key][:retain_versions] << version\n end\n end\n\n # no action if no discard_versions found\n restored_objs.each do |key, value|\n if value[:discard_versions].empty?\n restored_objs.delete(key)\n end\n end\n\n restored_objs\n end"
] |
[
"0.61826485",
"0.5939061",
"0.578585",
"0.5736232",
"0.5604894",
"0.55700713",
"0.55409604",
"0.5297712",
"0.5288494",
"0.52320296",
"0.514387",
"0.5052219",
"0.5008525",
"0.4967727",
"0.495026",
"0.4914129",
"0.48160097",
"0.48013148",
"0.47971484",
"0.47622234",
"0.47618657",
"0.47617787",
"0.4753734",
"0.47529125",
"0.47528404",
"0.474963",
"0.47489032",
"0.47447166",
"0.4738949",
"0.47230425",
"0.4716892",
"0.47048387",
"0.46979377",
"0.46913275",
"0.46794668",
"0.46741688",
"0.4672592",
"0.46708935",
"0.46661696",
"0.4650075",
"0.4648518",
"0.46417797",
"0.46395454",
"0.46308035",
"0.4627266",
"0.46236524",
"0.46220055",
"0.4620241",
"0.46109205",
"0.460885",
"0.4607421",
"0.4603657",
"0.45941985",
"0.4588252",
"0.4583055",
"0.4582445",
"0.45726988",
"0.4559573",
"0.45574397",
"0.455333",
"0.4552049",
"0.45432517",
"0.45336837",
"0.45296934",
"0.45233718",
"0.45071357",
"0.4499977",
"0.44990617",
"0.44983143",
"0.44937068",
"0.4493458",
"0.44916067",
"0.44902176",
"0.4489737",
"0.4488618",
"0.44818628",
"0.44764155",
"0.44744182",
"0.44691974",
"0.44685116",
"0.44651523",
"0.44550693",
"0.44509903",
"0.44488665",
"0.44464308",
"0.44441164",
"0.44365418",
"0.44351065",
"0.44338283",
"0.44304776",
"0.44296718",
"0.44234243",
"0.4423381",
"0.44231203",
"0.44228137",
"0.44180894",
"0.44180894",
"0.44180894",
"0.44173053",
"0.44148776"
] |
0.6799335
|
0
|
GET /keeps/1 GET /keeps/1.json
|
def show
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def index\n @keeps = current_user.keeps\n end",
"def create\n @keep = current_user.keeps.new(keep_params)\n\n respond_to do |format|\n if @keep.save\n format.html { redirect_to @keep, notice: 'Keep was successfully created.' }\n format.json { render :show, status: :created, location: @keep }\n else\n format.html { render :new }\n format.json { render json: @keep.errors, status: :unprocessable_entity }\n end\n end\n end",
"def destroy\n @keep.destroy\n respond_to do |format|\n format.html { redirect_to keeps_url, notice: 'Keep was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def set_keep\n @keep = current_user.keeps.find(params[:id])\n end",
"def keep_params\n params.require(:keep).permit(:name, :note)\n end",
"def keep\n __flag__ :keep\n end",
"def update\n respond_to do |format|\n if @keep.update(keep_params)\n format.html { redirect_to @keep, notice: 'Keep was successfully updated.' }\n format.json { render :show, status: :ok, location: @keep }\n else\n format.html { render :edit }\n format.json { render json: @keep.errors, status: :unprocessable_entity }\n end\n end\n end",
"def get_files_to_keep\n return @resource[:files_to_keep]\n end",
"def delete\n render json: Like.delete(params[\"id\"])\n end",
"def keep_data\n new_kept_data = kept << Hanami::Utils::Json.generate({ count: 0, data: _data })\n\n update_kept(new_kept_data)\n end",
"def index\n @loves = Love.all\n render json: @loves\n end",
"def index\n @bookkeepings = @group.bookkeepings.order(created_at: :desc)\n\n if params[:start_date]\n @bookkeepings = @bookkeepings.where(\"issue_date >= ?\", params[:start_date])\n end\n if params[:end_date]\n @bookkeepings = @bookkeepings.where(\"issue_date < ?\", Date.parse(params[:end_date]) + 1.day)\n end\n\n render json: @bookkeepings\n end",
"def keep(k = nil)\n k = k.to_s if k\n @discard.subtract Array(k || keys)\n k ? self[k] : self\n end",
"def keep_all\n @keep_all = true\n end",
"def index\n @preservatives = Preservative.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @preservatives }\n end\n end",
"def index\r\n markers = Marker.all\r\n render json: markers\r\n end",
"def index\n @kids = Kid.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @kids }\n end\n end",
"def index\n birds = Bird.all\n render json: birds.to_json(except: [:created_at, :updated_at])\n end",
"def destroy\n @take = Take.find(params[:id])\n @take.destroy\n\n respond_to do |format|\n format.html { redirect_to takes_url }\n format.json { head :ok }\n end\n end",
"def index\n # sleep 3 # simulate a slow connection\n render json: Secret.all.reverse\n end",
"def index\n @bookmarks = Bookmark.all\n render json: { bookmarks: @bookmarks }, status: :ok\n end",
"def index\n @notes = Note.all\n render json: @notes\n end",
"def index\n @pubs = Pub.all\n\n render json: @pubs\n end",
"def index\n @stars = Star.all\n render :json => @stars\n end",
"def destroy\n @serving = Serving.find(params[:id])\n @serving.destroy\n\n respond_to do |format|\n format.html { redirect_to servings_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n if @grab.destroy\n respond_to do |format|\n format.html { redirect_to grabs_url }\n format.json { head :no_content }\n end\n end\n end",
"def delete_gists(id)\n result = self.class.delete(\"/gists/#{id}\", :headers => @headers)\n puts \"#{result.headers['x-ratelimit-remaining']} requests left!\"\n end",
"def show\n\n render json: @bookkeeping\n end",
"def index\n info = Aws.get_recipes_from_db\n render :json => info\n end",
"def kept\n @session[KEPT_KEY] || []\n end",
"def keep(*files)\n @keep.concat(files.flatten)\n end",
"def get_all_kids\n render json: Parent.find(params[:id]).kids\n end",
"def index\n wishes = Wish.all.with_attached_image.where(is_secret: false)\n render json: { wishes: generate_image_url(wishes) }\n end",
"def deleted\n render :json => Project.where(\"deleted = 1\")\n end",
"def index\n @trips = Trip.desc.all\n @latest_trip = @trips.first\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @trips }\n end\n end",
"def index\n @keys = Key.all\n render json: @keys\n end",
"def slice(*keep)\n inject(Characterizable::BetterHash.new) do |memo, ary|\n if keep.include?(ary[0])\n memo[ary[0]] = ary[1]\n end\n memo\n end\n end",
"def keep_releases(arg = nil)\n [set_or_return(\n :keep_releases,\n arg,\n kind_of: [ Integer ]), 1].max\n end",
"def destroy\n @grab.destroy\n respond_to do |format|\n format.html { redirect_to grabs_url, notice: 'Grab was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @preservative = Preservative.find(params[:id])\n @preservative.destroy\n\n respond_to do |format|\n format.html { redirect_to preservatives_url }\n format.json { head :ok }\n end\n end",
"def index\n @bucketlist_item = BucketlistItem.all\n # @bucketlist_item = @trip.bucketlist_item\n render json: @bucketlist_item\n end",
"def destroy\n @have = Have.find(params[:id])\n @have.destroy\n\n respond_to do |format|\n format.html { redirect_to haves_url }\n format.json { head :ok }\n end\n end",
"def index\n @used_bikes = UsedBike.all\n\n render json: @used_bikes, each_serializer: Web::V1::UsedBikeSerializer\n end",
"def index\n @requests = Request.all\n\n render json: @requests\n end",
"def index\n @requests = Request.where(status: -1)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @requests }\n end\n end",
"def destroy\n @bike = Bike.find(params[:id])\n @bike.destroy\n\n respond_to do |format|\n format.html { redirect_to bikes_url }\n format.json { head :no_content }\n end\n end",
"def index\n @parishes = Parish.all\n\n render json: @parishes\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 show\n @love = Love.find(params[:id])\n render json: @love\n end",
"def show\n @take = Take.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @take }\n end\n end",
"def index\n @thumbs = Thumb.all\n\n render json: @thumbs\n end",
"def destroy\n @kid.destroy\n respond_to do |format|\n format.html { redirect_to kids_url }\n format.json { head :no_content }\n end\n end",
"def recent\n @notes = Note.recently_added(12).paginate(:page => params[:page], :per_page => configatron.page_size)\n\n respond_to do |format|\n format.html # recent.html.erb\n format.json { render json: @bookmarks }\n end\n end",
"def new\n @except = Except.new\n @policy = Policy.find(:all)\n\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @except }\n end\n end",
"def show\n @store = Store.find(params[:id])\n hash = JSON.parse(@store.to_json)\n if params[:format] == 'json'\n hash.delete(\"img1\")\n hash.delete(\"img2\")\n hash.delete(\"img3\")\n end\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: hash }\n end\n end",
"def latest_artworks\n latest_artworks = Artwork.last(3).to_json(include: [ :comments, :likes, :user ])\n render json: latest_artworks\n end",
"def user_holds opts= {}\n path, opts = build_user_path(\"holds\", opts)\n JSON.parse(get path, opts)\n end",
"def index\n @signatures = Signature.page(params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @signatures }\n end\n end",
"def destroy\n @still.destroy\n respond_to do |format|\n format.html { redirect_to stills_url, notice: 'Still was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def expire_kept\n new_kept_data = kept.reject do |kept_data|\n parsed = Hanami::Utils::Json.parse(kept_data)\n parsed['count'] >= 2 if is_hash?(parsed) && parsed['count'].is_a?(Integer)\n end\n\n update_kept(new_kept_data)\n end",
"def index\n @snippets = Snippet.order(\"updated_at DESC\").where(private: false).paginate(page: params[:page], per_page: 10)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @snippets }\n end\n end",
"def index\n @notes = Note.where{project_id == my{@project.id}}\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @notes }\n end\n end",
"def get_models_for_make_id\n render json: vehicle_service.get_models_for_make_id(params[:make_id])\n end",
"def recordings_list_stored\n get \"recordings/stored\"\n end",
"def index\n @bids = Bid.where(\"auction_id = ?\", params[:auction_id])\n\n render json: @bids\n end",
"def index\n @parks = Park.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @parks }\n end\n end",
"def show\n response = Aws.list_recipe(params[:id])\n render :json => response\n end",
"def destroy\n @hold_request.destroy\n respond_to do |format|\n format.html { redirect_to hold_requests_url, notice: 'Hold request was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @click = Click.find(params[:id])\n @click.destroy\n\n respond_to do |format|\n format.html { redirect_to clicks_url }\n format.json { head :no_content }\n end\n end",
"def keep_files; end",
"def index\n @wks = Wk.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @wks }\n end\n end",
"def delete\n render json: Post.delete(params[\"id\"])\n end",
"def index\n @marks = Mark.all\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @marks }\n end\n end",
"def destroy\n @mk_missatge.destroy\n respond_to do |format|\n format.html { redirect_to mk_missatges_url, notice: 'Mk missatge was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def create\n @bookkeeping = @group.bookkeepings.new()\n @bookkeeping.attributes = bookkeeping_params\n @bookkeeping.writer_id = current_user.id\n if @bookkeeping.save\n render json: @bookkeeping, status: :created, location: @bookkeeping\n else\n render json: @bookkeeping.errors, status: :unprocessable_entity\n end\n end",
"def index\n @birds = Bird.where(visible: true)\n render json: @birds, status: 200\n end",
"def index \n misses = Miss.all.order(created_at: :desc)\n render json: misses \n end",
"def index\n @recipes = Recipe.all\n render json: @recipes\n end",
"def index\n response = prepare_store_response(params, Item.where(:removed => nil))\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => response }\n end\n end",
"def index\n gateway_alive = GatewayAlive.all\n render json: gateway_alive.to_json(:except => [:id])\n end",
"def stashed\n @user = User.from_param params[:id]\n @beers = @user.stashed_beers\n\n respond_to do |format|\n format.json { render_for_api :public, :json => @beers }\n format.xml { render_for_api :public, :xml => @beers }\n end\n end",
"def index\n @click_data = ClickData.all\n\n render json: @click_data\n end",
"def index\n # 讓這個 Controller 只會回覆 JSON 格式\n @todo3s = Todo3.all\n\n respond_to :json\n end",
"def new\n @serving = Serving.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @serving }\n end\n end",
"def new\n @take = Take.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @take }\n end\n end",
"def destroy\n @market.destroy\n respond_to do |format|\n format.html { redirect_to markets_url }\n format.json { head :no_content }\n end\n end",
"def index\n recipes = Recipe.all\n render status: :ok, json: recipes\n end",
"def index\n base_url = 'https://www.googleapis.com/books/v1/volumes?q=fiction&maxResults=20'\n and_key = '&key='\n key = ENV['GOOGLE_BOOKS_API_KEY'] \n googleurl = base_url + and_key + key\n\n response = RestClient.get(googleurl)\n @books = JSON.parse(response)\n\n respond_to do |format|\n format.html\n format.json { render json: @books }\n end\n\nend",
"def backups_to_keep\n @backups_to_keep ||= 2\n end",
"def index\n render json: Client.all\n end",
"def index\n @joys = Joy.all\n render json: @joys\n end",
"def delete\n render json: Item.delete(params[\"id\"])\n end",
"def show\n pub = Publication.find_by(id: params[:id])\n if pub.blank?\n head :not_found\n return\n elsif pub.deleted?\n head :gone\n return\n end\n render json: pub.pub_hash\n end",
"def destroy\n @nudge.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end",
"def destroy\n @lost = Lost.find(params[:id])\n @lost.destroy\n\n respond_to do |format|\n format.html { redirect_to losts_url }\n format.json { head :no_content }\n end\n end",
"def delete\n render json: Alien.delete(params[\"id\"])\n end",
"def destroy\n @kid.destroy\n respond_to do |format|\n format.html { redirect_to kids_url, notice: t('kid_destroyed') }\n format.json { head :no_content }\n end\n end",
"def destroy\n @coin_set = CoinSet.find(params[:id])\n @coin_set.destroy\n\n respond_to do |format|\n format.html { redirect_to coin_sets_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @wanted = Wanted.find(params[:id])\n @wanted.destroy\n\n respond_to do |format|\n format.html { redirect_to wanteds_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @monkey = Monkey.find(params[:id])\n @monkey.destroy\n\n respond_to do |format|\n format.html { redirect_to monkeys_url }\n format.json { head :no_content }\n end\n end",
"def index\n @kids = Kid.all\n end"
] |
[
"0.6873941",
"0.658599",
"0.63782775",
"0.61993",
"0.5789544",
"0.5743574",
"0.56037194",
"0.52863",
"0.51477486",
"0.5034365",
"0.5027886",
"0.50084805",
"0.49749145",
"0.49549726",
"0.49467292",
"0.49303037",
"0.49227002",
"0.49106556",
"0.48972327",
"0.4857236",
"0.482522",
"0.48100168",
"0.4778438",
"0.4755014",
"0.4752651",
"0.47515097",
"0.47505364",
"0.47499192",
"0.47495088",
"0.4744778",
"0.47406104",
"0.4730741",
"0.47280353",
"0.4724606",
"0.4721679",
"0.47113776",
"0.46740353",
"0.46638992",
"0.46578076",
"0.46534175",
"0.46527585",
"0.46464908",
"0.46401456",
"0.46354935",
"0.46262494",
"0.46200204",
"0.4618839",
"0.4605333",
"0.4604872",
"0.46039557",
"0.45992467",
"0.45969623",
"0.45949885",
"0.45908538",
"0.45730415",
"0.45727527",
"0.45722997",
"0.45693332",
"0.45689285",
"0.4564143",
"0.45639986",
"0.45619467",
"0.45612273",
"0.45497137",
"0.45482308",
"0.45474365",
"0.45428094",
"0.45386404",
"0.45285493",
"0.4523456",
"0.45220235",
"0.45219994",
"0.4515357",
"0.45124438",
"0.45074823",
"0.45038903",
"0.4502167",
"0.450076",
"0.44880304",
"0.44826823",
"0.44818044",
"0.44791895",
"0.44784117",
"0.4472304",
"0.44707966",
"0.44673157",
"0.44669864",
"0.44642627",
"0.44565395",
"0.44540894",
"0.4447747",
"0.44471744",
"0.44438058",
"0.44437453",
"0.444094",
"0.4439245",
"0.44387624",
"0.44385785",
"0.4435263",
"0.4427739",
"0.44265372"
] |
0.0
|
-1
|
POST /keeps POST /keeps.json
|
def create
@keep = current_user.keeps.new(keep_params)
respond_to do |format|
if @keep.save
format.html { redirect_to @keep, notice: 'Keep was successfully created.' }
format.json { render :show, status: :created, location: @keep }
else
format.html { render :new }
format.json { render json: @keep.errors, status: :unprocessable_entity }
end
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def keep_params\n params.require(:keep).permit(:name, :note)\n end",
"def destroy\n @keep.destroy\n respond_to do |format|\n format.html { redirect_to keeps_url, notice: 'Keep was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def index\n @keeps = current_user.keeps\n end",
"def keep\n __flag__ :keep\n end",
"def set_keep\n @keep = current_user.keeps.find(params[:id])\n end",
"def keep_data\n new_kept_data = kept << Hanami::Utils::Json.generate({ count: 0, data: _data })\n\n update_kept(new_kept_data)\n end",
"def keep_all\n @keep_all = true\n end",
"def keep(*files)\n @keep.concat(files.flatten)\n end",
"def expire_kept\n new_kept_data = kept.reject do |kept_data|\n parsed = Hanami::Utils::Json.parse(kept_data)\n parsed['count'] >= 2 if is_hash?(parsed) && parsed['count'].is_a?(Integer)\n end\n\n update_kept(new_kept_data)\n end",
"def hard_save\n args = request_params\n @uncommitted = save_and_remove_all(args[:map_id], args[:round])\n render json: @uncommitted\n end",
"def update\n respond_to do |format|\n if @keep.update(keep_params)\n format.html { redirect_to @keep, notice: 'Keep was successfully updated.' }\n format.json { render :show, status: :ok, location: @keep }\n else\n format.html { render :edit }\n format.json { render json: @keep.errors, status: :unprocessable_entity }\n end\n end\n end",
"def keep_files; end",
"def kept\n @session[KEPT_KEY] || []\n end",
"def create\n @bookkeeping = @group.bookkeepings.new()\n @bookkeeping.attributes = bookkeeping_params\n @bookkeeping.writer_id = current_user.id\n if @bookkeeping.save\n render json: @bookkeeping, status: :created, location: @bookkeeping\n else\n render json: @bookkeeping.errors, status: :unprocessable_entity\n end\n end",
"def deployments_to_keep(env)\n (env['OPENSHIFT_KEEP_DEPLOYMENTS'] || 1).to_i\n end",
"def destroy\n @hold_request.destroy\n respond_to do |format|\n format.html { redirect_to hold_requests_url, notice: 'Hold request was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def get_files_to_keep\n return @resource[:files_to_keep]\n end",
"def prune params = {}\n @connection.post(build_path(\"/containers/prune\", params))\n end",
"def keep_releases(arg = nil)\n [set_or_return(\n :keep_releases,\n arg,\n kind_of: [ Integer ]), 1].max\n end",
"def destroy\n @hold_request.destroy\n respond_to do |format|\n format.html { redirect_to student_requests_path, notice: 'Hold request was deleted.' }\n format.json { head :no_content }\n end\n end",
"def post_request_bookkeeping(user)\n if not @id_in_redis\n return\n end\n key = 'concurrent_requests_limiter.' + user\n removed = redis.zrem(key, @id_in_redis)\nend",
"def backups_to_keep\n @backups_to_keep ||= 2\n end",
"def purging\n @purging = true\n end",
"def keep(k = nil)\n k = k.to_s if k\n @discard.subtract Array(k || keys)\n k ? self[k] : self\n end",
"def delete_old_requests\n Request.where('created_at < ?', Time.now - 15.minutes).delete_all\n end",
"def delete_remaining_s3_assets\n # This gets up to 1000 objects.\n # If the user has over 1000 objects that were not in the database then there may be some assets remaining.\n keys = S3_BUCKET.objects(prefix: user.unique_id).map(&:key)\n\n s3_deletion_service.bulk_delete(keys)\n end",
"def delete_gists(id)\n result = self.class.delete(\"/gists/#{id}\", :headers => @headers)\n puts \"#{result.headers['x-ratelimit-remaining']} requests left!\"\n end",
"def purge_old_requests(seconds = 60)\n @requests.delete_if {|request_time| request_time < Time.now - seconds}\n end",
"def check_reject_for_service_coverage_map attributes\n keep = attributes['keep_record'].to_s == \"1\"\n exists = attributes['id'].present?\n\n if exists && !keep\n attributes.merge!({_destroy: 1})\n return false\n else\n return !keep\n end\n end",
"def destroy\n @still.destroy\n respond_to do |format|\n format.html { redirect_to stills_url, notice: 'Still was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def old_flush!\n keys, filename = save_keys\n push_to_s3!(filename) if @save_to_s3\n delete!(keys)\n end",
"def clearAPI\n persist = [\"ip\", \"session\", \"cuid\", \"lang\", \"site\", \"currentURI\", \"previousURI\", \"clientToken\", \"recContent\"]\n @request_data.keep_if {|key,value| persist.include? key} \n end",
"def get_files_to_purge(files, to_keep)\n to_purge = files - to_keep\n to_purge\n end",
"def update_kept_request_count\n new_kept_data = kept.map do |kept_data|\n parsed = Hanami::Utils::Json.parse(kept_data)\n parsed['count'] += 1 if is_hash?(parsed) && parsed['count'].is_a?(Integer)\n Hanami::Utils::Json.generate(parsed)\n end\n\n update_kept(new_kept_data)\n end",
"def keep_going; end",
"def delete_requests\n self.requests.each {|request| request.destroy}\n end",
"def prune params = {}\n @connection.post(build_path(\"/volumes/prune\", params))\n end",
"def destroy\n @mk_missatge.destroy\n respond_to do |format|\n format.html { redirect_to mk_missatges_url, notice: 'Mk missatge was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @walk_request.destroy\n respond_to do |format|\n format.html { redirect_to walk_requests_url, notice: 'walk request was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def create\n @user = User.find(params[:user_id])\n @post = @user.posts.new(post_params)\n if @post.privacy === nil\n @post.privacy = false\n end\n if not post_params[:images].nil?\n @post.images.purge\n end\n\n if not post_params[:attachments].nil?\n @post.attachments.purge\n end\n respond_to do |format|\n if @post.save\n format.html { redirect_to root_path, notice: 'Post was successfully created.' }\n else\n format.html { render root_path }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def destroy\n if @grab.destroy\n respond_to do |format|\n format.html { redirect_to grabs_url }\n format.json { head :no_content }\n end\n end\n end",
"def destroy\n @unlimited.destroy\n respond_to do |format|\n format.html { redirect_to unlimiteds_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @grab.destroy\n respond_to do |format|\n format.html { redirect_to grabs_url, notice: 'Grab was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @nudge.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end",
"def destroy\n @preservative = Preservative.find(params[:id])\n @preservative.destroy\n\n respond_to do |format|\n format.html { redirect_to preservatives_url }\n format.json { head :ok }\n end\n end",
"def purge_request(params, *titles)\n params[:action] = 'purge'\n params[:titles] = titles.join('|')\n\n post(params)['purge'].inject({}) do |result, hash|\n title = hash['title']\n result[title] = hash.key?('purged') && !hash.key?('missing')\n warn \"Invalid purge (#{title}) #{hash['invalidreason']}\" if hash.key?('invalid')\n result\n end\n end",
"def unused_taken_funds\n authenticated_post(\"unused_taken_funds\").body\n end",
"def destroy\n @watermark.destroy\n respond_to do |format|\n format.html { redirect_to watermarks_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @bookkeeping.destroy\n\n head :no_content\n end",
"def save\n destroy\n REDIS.sadd :players, to_json\n end",
"def prune\n return nil if @store.empty?\n \n count = 0\n \n @store.delete_if { |k, v| v.expired? && count += 1 }\n \n count == 0 ? nil : count\n end",
"def retain_except_on_create\n data[:retain_except_on_create]\n end",
"def destroy\n @kid.destroy\n respond_to do |format|\n format.html { redirect_to kids_url }\n format.json { head :no_content }\n end\n end",
"def parse_keep_options(values)\n proxy_options = Commander::Runner.instance.active_command.proxy_options\n\n saved = proxy_options.find { |switch, _| switch == :keep }\n if saved\n saved[1].concat(values)\n else\n proxy_options << [:keep, values]\n end\n end",
"def destroy\n @stash_element.destroy\n respond_to do |format|\n format.html { redirect_to controller: 'post', action: 'new_post', notice: 'Stash element was successfully created.' }\n format.json { head :no_content }\n end\n end",
"def deleted_request\n r = {}\n render json: r,\n root: :data,\n status: :no_content\n end",
"def destroy\n\n\t\turi = URI.parse(Counter::Application.config.simplyurl)\n\t\thttp = Net::HTTP.new(uri.host, uri.port)\n\t\t\n\t\trequest = Net::HTTP::Delete.new('/offsets/doit.json')\n\t\tputs params\n\t\tputs params.slice(*['custids','acctids'])\n\t\t\n\t\t# ok, this join stuff is bogus - it encodes properly, but the other side only sees the last element and loses the array type - it's just string\n\t\t# this way, i 'split' it at the other side to recover my array\n\t\t# it should work without the join/split crap, but it doesn't\n\t\trequest.set_form_data({:custids => ( params['custids'] || []).join(','), :acctids => ( params['acctids'] || []).join(','), :itemids => ( params['itemids'] || []).join(',')})\n\t\t\n\t\tputs request.body\n\t\t\n\t\tresponse = http.request(request)\n\t\tputs response.body\n\n respond_to do |format|\n format.html { render :text => response.code == :ok ? \"\" : response.body, status: response.code }\n format.json { render :text => response.code == :ok ? \"\" : response.body, status: response.code }\n end\n end",
"def destroy\n @take = Take.find(params[:id])\n @take.destroy\n\n respond_to do |format|\n format.html { redirect_to takes_url }\n format.json { head :ok }\n end\n end",
"def keep_files=(_arg0); end",
"def flush!\n keys, filename = save_keys\n push_to_s3!(filename) if @push_to_s3\n delete!(keys)\n end",
"def destroy\n @park.destroy\n respond_to do |format|\n format.html { redirect_to parks_url }\n format.json { head :no_content }\n end\n end",
"def unsafe_forget_past!\n slices.values.map(&:history).each{|h| h.recent(memory_size)}\n\n if multi_slices?\n to_delete = slices.values.reject{|s| keep_slice?(s)}\n to_delete.map(&:rack_id).map do |rack_id| \n slices.delete(rack_id)\n end\n end\n end",
"def destroy\n @stop_request.destroy\n respond_to do |format|\n format.html { redirect_to stop_requests_url, notice: 'Stop request was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @bluray_storage.destroy\n respond_to do |format|\n format.html { redirect_to bluray_storages_url, notice: 'Bluray storage was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def save_request\n session[:old_saved_params] = session[:saved_params] || {};\n saved_params = params.reject { |k, v| !(v.kind_of?(String) || v.kind_of?(Hash) || v.kind_of?(Array)) }\n saved_params.each { |key, val| saved_params[key] = val.reject { |k, v| !(v.kind_of?(String) || v.kind_of?(Hash) || v.kind_of?(Array)) } if val.kind_of?(Hash) }\n session[:saved_params] = saved_params\n end",
"def wipeout_unposted_works\n works.find(:all, :conditions => {:posted => false}).each do |w|\n w.destroy\n end\n end",
"def delete\n render json: Like.delete(params[\"id\"])\n end",
"def destroy\n @parse_request.destroy\n respond_to do |format|\n format.html { redirect_to parse_requests_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @yak.destroy\n respond_to do |format|\n format.html { redirect_to my_yaks_path, notice: 'Post was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @saving.destroy\n respond_to do |format|\n format.html { redirect_to savings_url, notice: 'Saving was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @saving.destroy\n respond_to do |format|\n format.html { redirect_to savings_url, notice: \"Saving was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"def cleanup_cached_images()\n\n # swap_dir = \"../public/swap\" # use when running locally from /lib/s3_bucket.rb\n swap_dir = \"./public/swap\" # use when running via app.rb\n swap_contents = \"#{swap_dir}/*\"\n gitkeep = \"#{swap_dir}/.gitkeep\"\n\n if File.directory?(swap_dir)\n FileUtils.rm_rf(Dir.glob(swap_contents)) # delete contents of /public/swap \n file = File.new(gitkeep, 'w') # recreate .gitkeep file\n file.close if file\n else\n puts \"sightings directory does not exist!\"\n end\n\nend",
"def destroy\n @travel_request.destroy\n respond_to do |format|\n format.html { redirect_to @back_path, notice: 'Travel request was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def create\n @post = Post.new(params[:post])\n\n respond_to do |format|\n if @post.save\n format.html { redirect_to @post, notice: 'Post was successfully created.' }\n format.json { render json: @post, status: :created, location: @post }\n else\n format.html { render action: \"new\" }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n delete_caches\n end",
"def destroy\n @mark.destroy\n respond_to do |format|\n format.html { redirect_to marks_url, notice: 'Mark was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @stuck.destroy\n respond_to do |format|\n format.html { redirect_to stucks_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @request.destroy\n\n respond_to do |format|\n format.html { redirect_to requests_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @visit_request.destroy\n respond_to do |format|\n format.html { redirect_to visit_requests_url, notice: 'Visit request was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def save_and_remove_all(map_id, round)\n records = @store.where(map_id: map_id, round: round)\n uncommitted = records.map { |record| record.link }\n\n unless records.empty?\n records.each do |record|\n previous = SubmissionViewingEvent.where(\n map_id: record.map_id,\n round: record.round,\n link: record.link\n ).first\n\n if previous\n # make sure to add the total time on this record\n # with what may have already been in the database\n previous.update_attribute(:total_time, record.merge(event))\n else\n # if a previous record doesn't exist,\n # we can delegate saving to `LocalStorage`\n @store.hard_save(record)\n end\n\n # once the data is updated or added to the database,\n # remove it from `LocalStorage`\n @store.remove(record)\n end\n end\n\n uncommitted\n end",
"def destroy\n @request.destroy\n respond_to do |format|\n format.html { redirect_to requests_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @request.destroy\n respond_to do |format|\n format.html { redirect_to requests_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @request.destroy\n respond_to do |format|\n format.html { redirect_to requests_url }\n format.json { head :no_content }\n end\n end",
"def tombstone_timehold_params_from_lomat\n params.permit(:tombstoneJSON, :permanent, :rating)\n end",
"def db_cleaner\n JSON.parse(params[:mongified_data][:data]).each do |data|\n data[\"lob\"] = params[:mongified_data][:lob]\n @client.destroy(data)\n end\n end",
"def destroy\n @holding.destroy\n respond_to do |format|\n format.html { redirect_to holdings_url, notice: 'Holding was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @short_leave_request\n if ShortLeaveApproval.exists?(short_leave_request_id: @short_leave_request.id)\n flash[:alert] = \"Record is created ! \"\n else\n @short_leave_request.destroy\n @short_leave_requests = ShortLeaveRequest.all\n end\n end",
"def destroy\n @takeout.destroy\n respond_to do |format|\n format.html { redirect_to takeouts_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @keystore.destroy\n respond_to do |format|\n format.html { redirect_to keystores_url, notice: 'Keystore was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def save\n File.open(@path, \"w\") do |f|\n f.write(JSON.pretty_generate(\n \"version\" => VERSION,\n \"reqs\" => reqs,\n ))\n end\n end",
"def destroy\n @miss.destroy\n respond_to do |format|\n format.html { redirect_to misses_url }\n format.json { head :no_content }\n end\n end",
"def leave_app\n leave_header\n puts \"Have a great day!\".center(@header_length).blue\n File.write(@file_path, @processed_favs.uniq.to_json)\n sleep(1.5)\n system 'clear'\n exit! \n end",
"def purge\n end",
"def keep_flash\n @keep_flash = true\n end",
"def store_request(request)\n @requests_lock.synchronize { @requests << request } if @keep_requests\n end",
"def create\n @trip = Trip.new(params[:trip])\n @trip.user = @current_user\n r = Request.find_by_url(@trip.url)\n if r; r.destroy; end\n\n respond_to do |format|\n if @trip.save\n format.html { redirect_to(@trip, :notice => 'Trip was successfully created.') }\n format.xml { render :xml => @trip, :status => :created, :location => @trip }\n format.json { render :json => @trip }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @trip.errors, :status => :unprocessable_entity }\n format.json { render :json => @trip.errors.full_messages, :status => :unprocessable_entity }\n end\n end\n end",
"def teardown\n # delete everything\n @client.delete('/words.json') rescue nil\n end",
"def teardown\n # delete everything\n @client.delete('/words.json') rescue nil\n end",
"def destroy\n @retention.destroy\n respond_to do |format|\n format.html { redirect_to retentions_url, notice: 'Retention was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @kid.destroy\n respond_to do |format|\n format.html { redirect_to kids_url, notice: t('kid_destroyed') }\n format.json { head :no_content }\n end\n end",
"def disappeared_params\n params.require(:disappeared)\n .permit(:name, :nickname,:email, :password, :notification_face, :id_number, :cpf, :drivers_license, :date_of_birth, :gender, :nationality, :state, :marital_status, :address, :telephone, :relatives_id, :cell_phone, {disappeared_photos:[]})\n end"
] |
[
"0.63878644",
"0.6159866",
"0.6089544",
"0.59637654",
"0.5772348",
"0.5732716",
"0.5611234",
"0.54059875",
"0.5142877",
"0.5059239",
"0.5031172",
"0.502622",
"0.4993139",
"0.49844244",
"0.49567896",
"0.49027336",
"0.48594236",
"0.48133045",
"0.47660825",
"0.47459084",
"0.47134888",
"0.47069615",
"0.46967998",
"0.46925977",
"0.468321",
"0.4657739",
"0.46554697",
"0.46522596",
"0.46378052",
"0.46107376",
"0.45888868",
"0.45493186",
"0.4547487",
"0.45395726",
"0.45327204",
"0.45186433",
"0.45156097",
"0.45150566",
"0.45077714",
"0.4506886",
"0.44843462",
"0.44563177",
"0.4447133",
"0.44450155",
"0.4427281",
"0.44252777",
"0.4417269",
"0.4414363",
"0.4406271",
"0.43974638",
"0.4385389",
"0.4384507",
"0.43639868",
"0.43611714",
"0.43548727",
"0.43539557",
"0.43519616",
"0.43430853",
"0.43414116",
"0.43386877",
"0.43301535",
"0.4330084",
"0.43216333",
"0.43213934",
"0.43189663",
"0.4318453",
"0.43168417",
"0.43027797",
"0.4302533",
"0.4297284",
"0.42955083",
"0.42954546",
"0.42766523",
"0.42755264",
"0.4269155",
"0.42691293",
"0.42687702",
"0.42638558",
"0.42602336",
"0.42599952",
"0.42599952",
"0.42599952",
"0.42537627",
"0.42496964",
"0.42496467",
"0.42492744",
"0.42487094",
"0.42483175",
"0.42454693",
"0.42452574",
"0.4244651",
"0.4244189",
"0.42423257",
"0.424122",
"0.42409748",
"0.42380714",
"0.42380714",
"0.42320317",
"0.42295218",
"0.42289257"
] |
0.65362144
|
0
|
PATCH/PUT /keeps/1 PATCH/PUT /keeps/1.json
|
def update
respond_to do |format|
if @keep.update(keep_params)
format.html { redirect_to @keep, notice: 'Keep was successfully updated.' }
format.json { render :show, status: :ok, location: @keep }
else
format.html { render :edit }
format.json { render json: @keep.errors, status: :unprocessable_entity }
end
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def keep_params\n params.require(:keep).permit(:name, :note)\n end",
"def update!(params)\n res = @client.put(path, nil, params, \"Content-Type\" => \"application/json\")\n @attributes = res.json if res.status == 201\n res\n end",
"def update\n if @bookkeeping.update(bookkeeping_params)\n head :no_content\n else\n render json: @bookkeeping.errors, status: :unprocessable_entity\n end\n end",
"def patch!\n request! :patch\n end",
"def update\n if params[:kid][:id]\n @kid = Kid.find(params[:kid][:id])\n else\n @kid = Kid.find_by_user_id_and_local_id(params[:kid][:user_id],params[:kid][:local_id])\n end\n params[:kid].delete(:user_id)\n params[:kid].delete(:id)\n if @kid.update_attributes(params[:kid])\n render json: @kid\n else\n render json: @kid.errors, status: :unprocessable_entity\n end\n end",
"def put!\n request! :put\n end",
"def destroy\n @keep.destroy\n respond_to do |format|\n format.html { redirect_to keeps_url, notice: 'Keep was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def create\n @keep = current_user.keeps.new(keep_params)\n\n respond_to do |format|\n if @keep.save\n format.html { redirect_to @keep, notice: 'Keep was successfully created.' }\n format.json { render :show, status: :created, location: @keep }\n else\n format.html { render :new }\n format.json { render json: @keep.errors, status: :unprocessable_entity }\n end\n end\n end",
"def set_keep\n @keep = current_user.keeps.find(params[:id])\n end",
"def patch(path, opts = {})\n request(:patch, path, opts).body\n end",
"def patch\n headers = {\"If-Match\" => @version}\n response = @context.request :patch, \"#{@path}/#{@id}\", @data.to_json, headers\n @version += 1\n response\n # 'X-HTTP-Method-Override' => 'PATCH'\n end",
"def patch(path, params)\n time(\"PATCH #{path}\") { Cloudflarer.new.patch(path, params) }\n end",
"def patch(path, params = {})\n request(:patch, path, params)\n end",
"def patch(path, params = {})\n request(:patch, path, params)\n end",
"def 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 patch\n end",
"def api_patch(path, data = {})\n api_request(:patch, path, :data => data)\n end",
"def save\n @client.patch(@endpoint, :content=>@changed)\n return nil\n end",
"def patch(path, **args); end",
"def update!(**args)\n @requests = args[:requests] if args.key?(:requests)\n end",
"def update!(**args)\n @requests = args[:requests] if args.key?(:requests)\n end",
"def update!(**args)\n @requests = args[:requests] if args.key?(:requests)\n end",
"def update!(**args)\n @requests = args[:requests] if args.key?(:requests)\n end",
"def update\n respond_with []\n end",
"def patch(path, opts = {}, &block)\n request(:patch, path, opts, &block)\n end",
"def patch(path, opts = {}, &block)\n request(:patch, path, opts, &block)\n end",
"def update\n @serving = Serving.find(params[:id])\n\n respond_to do |format|\n if @serving.update_attributes(params[:serving])\n format.html { redirect_to @serving, notice: 'Serving was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @serving.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @todo = Todo.find(params[:id])\n @todo.update_attributes(params[:todo])\n render :json => @todo\n end",
"def update\n @request.assign_json_attributes(params) if @request.resume?\n respond_to do |format|\n if @request.update(request_params)\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 destroy\n @patch.destroy\n respond_to do |format|\n format.html { redirect_to patches_url }\n format.json { head :no_content }\n end\n end",
"def update\n note = Note.find(params[\"id\"])\n note.update_attributes(note_params)\n respond_with note, json: note\n end",
"def hard_save\n args = request_params\n @uncommitted = save_and_remove_all(args[:map_id], args[:round])\n render json: @uncommitted\n end",
"def update(attrs, path=nil)\n resp = api_client.put(path || url, JSON.dump(attrs))\n refresh(JSON.load(resp.body))\n end",
"def update\n recipe = Recipe.find(params[:id])\n\n if recipe.user == current_user\n recipe.update(recipe_params)\n render json: { recipe: params[:id], deleted: true }\n else\n render json: { recipe: params[:id], deleted: false }\n end\n end",
"def patch(attrs = nil)\n attrs ||= attributes.changed_attributes\n execute_request do\n faraday_connection.patch { |req| req.body = adapter.serialize(attrs) }\n end\n end",
"def patch\n req.patch?\n end",
"def jsonapi_update!(attributes)\n assign_jsonapi_attributes(attributes)\n save!\n end",
"def update\n @todo = Todo.find(params[:id])\n if @todo.update_attributes(todo_params)\n render json: @todo, status: :ok\n else\n render json: @todo.errors, status: 422\n end\n end",
"def patch(path, data)\n request 'PATCH', path, body: data.to_json\n end",
"def update\n @request = Request.find(params[:id])\n\n if @request.update(params[:request])\n head :no_content\n else\n render json: @request.errors, status: :unprocessable_entity\n end\n end",
"def update\n puts \"update #{@need.as_json} #{updated_params.as_json}\"\n respond_to do |format|\n if @need.update(updated_params)\n puts \"brucep update success\"\n format.html { redirect_to new_need_path }\n format.json { render :show, status: :ok, location: @need }\n else\n format.html { render :edit }\n format.json { render json: @need.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update(&block)\n validate_request()\n\n # Params includes all of the PATCH data at the top level along with other\n # other Rails-injected params like 'id', 'action', 'controller'. These\n # are harmless given no namespace collision and we're only interested in\n # the 'Operations' key for the actual patch data.\n #\n render(json: yield(self.safe_params()[:id], self.safe_params().to_hash()))\n end",
"def patch(url, payload, headers={})\n RestClient.patch url, payload, headers\n end",
"def update\n request = Request.find_by_id(params[:id])\n if request\n request.status = 1\n if request.save\n render json: {\n status: 'success',\n message: 'Request marked as fulfilled',\n },\n status: :ok\n else\n render json: {\n status: 'error',\n message: 'Request failed',\n data: request.errors,\n },\n status: :unprocessable_entity\n end\n else\n render status: :unauthorized\n end\n end",
"def update_aos_version(args = {}) \n id = args['id']\n temp_path = \"/aosversions.json/{aosVersionId}\"\n path = temp_path\nargs.keys.each do |key|\n if (key == \"aosversionId\")\n args.delete(key)\n path = temp_path.gsub(\"{#{key}}\", id)\n end\nend\n puts \" PATH : #{path}\"\n put(path, args)\nend",
"def patch(type, info)\n path, info = type_info(type, :path), force_case(info)\n ida = type == :client ? 'client_id' : 'id'\n raise ArgumentError, \"info must include #{ida}\" unless id = info[ida]\n hdrs = headers\n if info && info['meta'] && (etag = info['meta']['version'])\n hdrs.merge!('if-match' => etag)\n end\n reply = json_parse_reply(@key_style,\n *json_patch(@target, \"#{path}/#{Addressable::URI.encode(id)}\", info, hdrs))\n\n # hide client endpoints that are not quite scim compatible\n type == :client && !reply ? get(type, info['client_id']): reply\n end",
"def update\n @wait = Wait.find(params[:id])\n\n respond_to do |format|\n if @wait.update_attributes(params[:wait])\n format.json { head :no_content }\n else\n format.json { render json: @wait.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @kid.update(kid_params)\n format.html { redirect_to @kid, notice: t('kid_updated') }\n format.json { render :show, status: :ok, location: @kid }\n else\n format.html { render :edit }\n format.json { render json: @kid.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @client_need = ClientNeed.find(params[:id])\n\n respond_to do |format|\n if @client_need.update_attributes(params[:client_need])\n format.html { redirect_to @client_need, notice: 'Client need was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @client_need.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update_kept_request_count\n new_kept_data = kept.map do |kept_data|\n parsed = Hanami::Utils::Json.parse(kept_data)\n parsed['count'] += 1 if is_hash?(parsed) && parsed['count'].is_a?(Integer)\n Hanami::Utils::Json.generate(parsed)\n end\n\n update_kept(new_kept_data)\n end",
"def update # PATCH\n raise NotImplementedError\n end",
"def keep_data\n new_kept_data = kept << Hanami::Utils::Json.generate({ count: 0, data: _data })\n\n update_kept(new_kept_data)\n end",
"def update_tenant_circle(args = {}) \n put(\"/tenantcircles.json/#{args[:circleId]}\", args)\nend",
"def update\n @bowl = Bowl.find(params[:id])\n \n # set bowl modify time\n @bowl.modified = Time.now\n \n respond_to do |format|\n if @bowl.update_attributes(params[:bowl])\n \n Rails.logger.info \"Updating Bowl Contents\"\n \n # remove all contents for this bowl and add new\n @bowl.contents.delete_all(\"bowl_id=\" + @bowl.id)\n \n params.keys.each do |param|\n if param.start_with?(\"input_\") and (params[param] != \"\") \n @bowl.contents.create(:bowl_id => @bowl.id, :dryfruit_id => param[6, 2], :quantity => params[param]) \n end\n end\n\n format.html { redirect_to bowls_path, :notice => 'Bowl was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @bowl.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def patch; end",
"def patch; end",
"def update\n recipe.update(recipe_params)\n render json: recipe\n end",
"def update!(**args)\n @remodelings = args[:remodelings] if args.key?(:remodelings)\n end",
"def update!(**args)\n @remodelings = args[:remodelings] if args.key?(:remodelings)\n end",
"def update!(**args)\n @remodelings = args[:remodelings] if args.key?(:remodelings)\n end",
"def update!(**args)\n @remodelings = args[:remodelings] if args.key?(:remodelings)\n end",
"def update!(**args)\n @remodelings = args[:remodelings] if args.key?(:remodelings)\n end",
"def update!(**args)\n @remodelings = args[:remodelings] if args.key?(:remodelings)\n end",
"def update!(**args)\n @remodelings = args[:remodelings] if args.key?(:remodelings)\n end",
"def update!(**args)\n @remodelings = args[:remodelings] if args.key?(:remodelings)\n end",
"def update\n if @note.update(note_params)\n render json: @note\n else\n render json: @note.errors, status: :unprocessable_entity\n end\n end",
"def update\n\t\t@request = Request.unscoped.find(params[:id])\n\n\t\trespond_to do |format|\n\t\t\tif @request.update_attributes( update_request_params )\n\t\t\t\tformat.json { render json: @request, status: :created }\t\t\t\t\n\t\t\telse\n\t\t\t\tformat.json { render json: @request.errors, status: :unprocessable_entity }\n\t\t\tend\n\t\tend\n\tend",
"def update\n respond_to do |format|\n if @kid.update(kid_params)\n format.html { redirect_to root_url, notice: 'Kid was successfully updated.' }\n format.json { render :show, status: :ok, location: @kid }\n else\n format.html { render :edit }\n format.json { render json: @kid.errors, status: :unprocessable_entity }\n end\n end\n end",
"def put(*args)\n request :put, *args\n end",
"def update\n @friendship = Friendship.find(params[:id])\n\n if (params[:ignore])\n @friendship.ignore = params[:ignore] == \"true\"\n end\n\n respond_to do |format|\n if @friendship.update_attributes(params[:friendship])\n format.html { render @friendship }\n format.json { render json: { success: true } }\n else\n format.html { render action: \"index\" }\n format.json { render json: @friendship.errors, \n status: :unprocessable_entity }\n end\n end\n end",
"def patch_model dataset_id, model_id, patched_model_gapi, etag = nil\n patch_with_backoff = false\n options = { skip_deserialization: true }\n if etag\n options[:header] = { \"If-Match\" => etag }\n # The patch with etag operation is considered idempotent\n patch_with_backoff = true\n end\n execute backoff: patch_with_backoff do\n json_txt = service.patch_model @project, dataset_id, model_id, patched_model_gapi, options: options\n JSON.parse json_txt, symbolize_names: true\n end\n end",
"def update\n req = ActiveSupport::JSON.decode(request.body)\n @bookmark = Bookmark.find(req)\n\n respond_to do |format|\n if @bookmark.update_attributes(params[:id])\n format.html { redirect_to @bookmark, notice: 'Bookmark was successfully updated.' }\n format.json { render json: @bookmark, status: :created, location: @bookmarks }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @bookmark.errors, status: :unprocessable_entity }\n end\n end\n end",
"def keep\n __flag__ :keep\n end",
"def update\n respond_to do |format|\n if @hold_request.update(hold_request_params)\n format.html { redirect_to @hold_request, notice: 'Hold request was successfully updated.' }\n format.json { render :show, status: :ok, location: @hold_request }\n else\n format.html { render :edit }\n format.json { render json: @hold_request.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @api_v1_todo.update(api_v1_todo_params)\n format.json { render json: @api_v1_todo, status: :ok }\n else\n format.json { render json: @api_v1_todo.errors, status: :unprocessable_entity }\n end\n end\n end",
"def patch(attrs = nil)\n attrs ||= attributes.changed_attributes\n\n execute_request('PATCH') do |uri, headers|\n HTTP.http_client.patch(\n uri,\n body: adapter.serialize(attrs),\n header: headers.merge(CONTENT_TYPE_HEADERS)\n )\n end\n end",
"def update\n @data = @recipe.update(params[:id], recipe_params)\n render json: @data\n end",
"def update!(**args)\n @create = args[:create] if args.key?(:create)\n @delete = args[:delete] if args.key?(:delete)\n @get = args[:get] if args.key?(:get)\n @set_iam_policy = args[:set_iam_policy] if args.key?(:set_iam_policy)\n @update = args[:update] if args.key?(:update)\n end",
"def update(url, data)\n RestClient.put url, data, :content_type => :json\nend",
"def update\n if @secret.update_attributes(secret_params)\n head :no_content\n else\n render json: @secret.errors, status: :unprocessable_entity\n end\n end",
"def update\n respond_to do |format|\n if @taking.update(taking_params)\n format.html { redirect_to @taking, notice: 'Taking was successfully updated.' }\n format.json { render :show, status: :ok, location: @taking }\n else\n format.html { render :edit }\n format.json { render json: @taking.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @todo = Todo.find(params[:todo][:id])\n if @todo.update_attributes(user_params)\n render json: @todo\n else\n render nothing: true, status: :bad_request\n end\n end",
"def update\n do_patch { return } # check if patch and do submission and return early if it is a patch (submission)\n # otherwise this is a PUT of the dataset metadata\n check_status { return } # check it's in progress, clone a submitted or raise an error\n respond_to do |format|\n format.json do\n dp = if @resource\n DatasetParser.new(hash: params['dataset'], id: @resource.identifier, user: @user) # update dataset\n else\n DatasetParser.new(hash: params['dataset'], user: @user, id_string: params[:id]) # upsert dataset with identifier\n end\n @stash_identifier = dp.parse\n ds = Dataset.new(identifier: @stash_identifier.to_s) # sets up display objects\n render json: ds.metadata, status: 200\n end\n end\n end",
"def destroy\n @patch = Patch.find(params[:id])\n @patch.destroy\n\n respond_to do |format|\n format.html { redirect_to patches_url }\n format.json { head :no_content }\n end\n end",
"def patch(payload)\n post_like payload, Net::HTTP::Patch.new(@uri.path)\n end",
"def update\n @supermarket = Supermarket.find(params[:id]) \n respond_to do |format|\n if @supermarket.update(supermarket_params)\n format.json { render json: @supermarket, status: :ok }\n end\n end\n end",
"def update\n respond_to do |format|\n if @serving.update(serving_params)\n format.html { redirect_to @serving, notice: 'Serving was successfully updated.' }\n format.json { render :show, status: :ok, location: @serving }\n else\n format.html { render :edit }\n format.json { render json: @serving.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update!(**args)\n @api_signatures = args[:api_signatures] if args.key?(:api_signatures)\n @unique_apis = args[:unique_apis] if args.key?(:unique_apis)\n end",
"def update!(**args)\n @drop_in_serving = args[:drop_in_serving] if args.key?(:drop_in_serving)\n end",
"def update\n if @diet.update(diet_params)\n head :no_content, status: 204\n else\n render json: @diet.errors, status: 422\n end\n end",
"def update\n @go_slim = GoSlim.find(params[:id])\n\n respond_to do |format|\n if @go_slim.update_attributes(params[:go_slim])\n format.html { redirect_to @go_slim, notice: 'Go slim was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @go_slim.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @animal.update(animal_params)\n respond_with(@shelter)\n end",
"def update\n logger.info('PUT Update:')\n logger.info(request_body)\n new_pub = hashed_request\n old_pub = Publication.find_by(id: params[:id])\n if old_pub.blank?\n head :not_found\n return\n elsif old_pub.deleted?\n head :gone\n return\n end\n if old_pub.harvested_pub? # only manually entered (i.e. non-harvested) publications may be updated with this method\n render json: {\n error: \"This record SulPubID #{old_pub.id} may not be modified. If you had originally entered details for the record, \" \\\n 'it has been superceded by a central record.'\n },\n status: :forbidden, format: 'json'\n return\n elsif !validate_or_create_authors(new_pub[:authorship])\n render json: { error: 'You have not supplied a valid authorship record.' }, status: :not_acceptable,\n format: 'json'\n return\n end\n logger.info(\"Update manual publication #{old_pub.inspect} with BibJSON:\")\n logger.info(request_body)\n old_pub.update_manual_pub_from_pub_hash(new_pub, request_body)\n old_pub.save!\n old_pub.reload\n logger.debug(\"resulting pub hash: #{old_pub.pub_hash}\")\n render json: old_pub.pub_hash, status: :accepted\n end",
"def update_plant\n @plant.deleted = false\n\n respond_to do |format|\n if set_attributes_from_filemaker(@plant)\n format.json do\n render status: :created,\n json: {\n id: @plant.id,\n botanical_name: @plant.botanical_name,\n alternative_names: @plant.alternative_names,\n updated_at: @plant.updated_at,\n visible: (!@plant.deleted).to_s\n }\n end\n else\n format.json do\n render json: @plant.errors, status: :unprocessable_entity\n end\n end\n end\n end",
"def put_clone\n response = self.class.put(\"/service/#{$service_id}/version/#{$service_version}/clone\", { \n headers: {\"Fastly-Key\" => $key} \n })\n end",
"def update\n job = Job.find(params[:id])\n job.update_attributes(job_params)\n render json: job\n end",
"def update\n respond_to do |format|\n if @unwanted.update(unwanted_params)\n format.html { redirect_to @unwanted, notice: 'Unwanted was successfully updated.' }\n format.json { render :show, status: :ok, location: @unwanted }\n else\n format.html { render :edit }\n format.json { render json: @unwanted.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @need.update(need_params)\n format.html { redirect_to @need, notice: 'Need was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @need.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n animal = Animal.find(params[:id])\n\n if validate_params(animal_params)\n animal.update(animal_params)\n render json: animal, status: 200, location: [:api, animal]\n else\n render json: { errors: animal.errors }, status: 422\n end\n end",
"def update\n render json: Post.update(params[\"id\"], params[\"post\"])\n end"
] |
[
"0.6169629",
"0.5838606",
"0.58272153",
"0.5804568",
"0.56894994",
"0.56139165",
"0.5543352",
"0.5519432",
"0.5514486",
"0.5481023",
"0.5462124",
"0.5448219",
"0.5445128",
"0.5445128",
"0.53900695",
"0.5244469",
"0.52325255",
"0.522228",
"0.52157545",
"0.51975554",
"0.51975554",
"0.51975554",
"0.51975554",
"0.5197419",
"0.5194433",
"0.5194433",
"0.51546115",
"0.5153879",
"0.51438254",
"0.5139158",
"0.5132273",
"0.5118693",
"0.5115623",
"0.51077545",
"0.5102071",
"0.50951564",
"0.50934094",
"0.50911355",
"0.5088312",
"0.5080256",
"0.507958",
"0.50692445",
"0.5062762",
"0.5055904",
"0.5050233",
"0.5045516",
"0.5016317",
"0.5009889",
"0.5009702",
"0.500309",
"0.4998182",
"0.4990795",
"0.49861228",
"0.49860394",
"0.4986015",
"0.4986015",
"0.49858904",
"0.49850354",
"0.49850354",
"0.49850354",
"0.49850354",
"0.49850354",
"0.49850354",
"0.49850354",
"0.49850354",
"0.49830785",
"0.49804515",
"0.49787295",
"0.4978101",
"0.49760723",
"0.49690035",
"0.49668172",
"0.4966681",
"0.49657068",
"0.49595904",
"0.49548706",
"0.49478927",
"0.49443322",
"0.49349105",
"0.4931173",
"0.49304274",
"0.49267408",
"0.492204",
"0.49202082",
"0.49194586",
"0.49151278",
"0.491484",
"0.4913714",
"0.49120152",
"0.49031767",
"0.48998097",
"0.48988107",
"0.48957896",
"0.48924726",
"0.4891918",
"0.4887026",
"0.48850656",
"0.4883547",
"0.48822853",
"0.48782167"
] |
0.6775914
|
0
|
DELETE /keeps/1 DELETE /keeps/1.json
|
def destroy
@keep.destroy
respond_to do |format|
format.html { redirect_to keeps_url, notice: 'Keep was successfully destroyed.' }
format.json { head :no_content }
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def delete_json(path)\n url = [base_url, path].join\n resp = HTTParty.delete(url, headers: standard_headers)\n parse_json(url, resp)\n end",
"def delete\n client.delete(url)\n @deleted = true\nend",
"def delete\n client.delete(\"/#{id}\")\n end",
"def delete path\n make_request(path, \"delete\", {})\n end",
"def delete(path, params)\n headers = {:Authorization => \"token #{token}\", :content_type => :json, :accept => :json}\n res = RestClient.delete(\"#{github_api_uri}/#{path}\", params.to_json, headers)\n Yajl.load(res)\n end",
"def delete(*rest) end",
"def delete(*args)\n Request.delete(*args)\n end",
"def delete(path, params)\n request(:delete, path, {})\n end",
"def delete\n request(:delete)\n end",
"def delete\n render json: Like.delete(params[\"id\"])\n end",
"def delete(path, params)\n parse_response @client[path].delete(:params => params)\n end",
"def delete(path)\n RestClient.delete request_base+path\n end",
"def delete(path)\n request(:delete, path)\n end",
"def delete!\n request! :delete\n end",
"def delete(path, params={})\n request(:delete, path, params)\n end",
"def delete(path, params={})\n request(:delete, path, params)\n end",
"def delete(path, params={})\n request(:delete, path, params)\n end",
"def delete(path, params={})\n request(:delete, path, params)\n end",
"def delete(path, params={})\n request(:delete, path, params)\n end",
"def delete(path, params={})\n request(:delete, path, params)\n end",
"def delete(path, params={})\n request(:delete, path, params)\n end",
"def destroy\n @todo3.destroy\n respond_to do |format|\n format.html { redirect_to todo3s_url }\n format.json { head :no_content }\n end\n end",
"def delete(path, params = {})\n request(:delete, path, params)\n end",
"def delete(path, params = {})\n request(:delete, path, params)\n end",
"def delete(path, params = {})\n request(:delete, path, params)\n end",
"def delete(path, opts = {})\n request(:delete, path, opts).body\n end",
"def delete\n response = WebPay.client.delete(path)\n response['deleted']\n end",
"def delete\n delete_from_server single_url\n end",
"def delete(*args)\n request(:delete, *args)\n end",
"def delete\n url = prefix + \"delete\"\n return response(url)\n end",
"def delete\n url = prefix + \"delete\"\n return response(url)\n end",
"def delete(path, params={})\n request(:delete, path, params)\n end",
"def delete(path, params = {})\n request(:delete, path, params)\n end",
"def delete(path, params = {})\n request(:delete, path, params)\n end",
"def delete(path = '/files/', params = {})\n request :delete, path, params\n end",
"def delete!( opts = {} )\n http_action :delete, nil, opts\n end",
"def delete\n res = HTTParty.get URL, headers: HEADERS\n message = JSON.parse res.body, symbolize_names: true\n if res.code == 200\n numSubs = message[:data].count\n if numSubs > 0\n message[:data].each do |sub|\n id = sub[:id]\n delRes = HTTParty.delete \"#{URL}/#{id}\", headers: HEADERS\n #TODO handle status codes\n end\n end\n end\n end",
"def delete(path)\n request 'DELETE', path\n end",
"def delete\n render json: Post.delete(params[\"id\"])\n end",
"def delete\n render json: Item.delete(params[\"id\"])\n end",
"def delete\n client.delete(url)\n @deleted = true\n end",
"def delete\n url = prefix + \"delete\" + id_param\n return response(url)\n end",
"def delete\n render json: Alien.delete(params[\"id\"])\n end",
"def delete(path)\n request(:delete, path)\n end",
"def test_del\n header 'Content-Type', 'application/json'\n\n data = File.read 'sample-traces/0.json'\n post('/traces', data, 'CONTENT_TYPE': 'application/json')\n\n id = last_response.body\n\n delete \"/traces/#{id}\"\n assert last_response.ok?\n\n get \"/traces/#{id}\"\n\n contents = JSON.parse last_response.body\n assert_kind_of(Hash, contents, 'Response contents is not a hash')\n assert contents.key? 'description'\n assert(!last_response.ok?)\n end",
"def delete(path, params = {})\n post(path, params.merge(\"_method\" => \"delete\"))\n end",
"def delete!(*rest) end",
"def destroy\n @ignore = Analytics::Ignore.find(params[:id])\n @ignore.destroy\n\n respond_to do |format|\n format.html { redirect_to(ignores_url) }\n end\n end",
"def delete(id)\n request(:delete, \"/recipes/#{id}.json\")\n end",
"def delete_gists(id)\n result = self.class.delete(\"/gists/#{id}\", :headers => @headers)\n puts \"#{result.headers['x-ratelimit-remaining']} requests left!\"\n end",
"def destroy\n @storage = @client.storages.find(params[:id])\n @storage.destroy\n\n respond_to do |format|\n format.html { redirect_to client_url(@client) }\n format.json { head :no_content }\n end\n end",
"def delete(path)\n\t\trequest(path, :delete)\n\tend",
"def delete(*uris); end",
"def destroy\n @have = Have.find(params[:id])\n @have.destroy\n\n respond_to do |format|\n format.html { redirect_to haves_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @kid.destroy\n respond_to do |format|\n format.html { redirect_to kids_url }\n format.json { head :no_content }\n end\n end",
"def delete(path)\n path = format_path(path)\n bucket_path = get_bucket_path(path)\n date = gmtdate\n headers = {\n 'Host' => @aliyun_upload_host,\n 'Date' => date,\n 'Authorization' => sign('DELETE', bucket_path, '', '', date)\n }\n url = path_to_url(path)\n response = RestClient.delete(url, headers)\n response.code == 204 ? url : nil\n end",
"def destroy\n @go_slim = GoSlim.find(params[:id])\n @go_slim.destroy\n\n respond_to do |format|\n format.html { redirect_to go_slims_url }\n format.json { head :no_content }\n end\n end",
"def delete_now\n revisions.each do |rev_id| \n CouchDB.delete( \"#{uri}?rev=#{rev_id}\" )\n end\n true \n end",
"def delete(splat)\n bad_request if splat.empty?\n _delete resolve_uri(splat[0])\n end",
"def delete(path)\n repository = path.split(/\\//)[2]\n objectid = path.split(/\\//)[3]\n if storage_fetch(repository, objectid) && storage_delete(repository, objectid)\n ['200', {}, []]\n else\n ['404', {}, [\"Repository #{repository} or ObjectID #{objectid} not found: #{path}\"]]\n end\n end",
"def delete\n start { |connection| connection.request http :Delete }\n end",
"def delete!\n Recliner.delete(uri)\n end",
"def delete(path, params = {}, request_options = {})\n request(:delete, path, params)\n end",
"def destroy\n @intake.destroy\n respond_to do |format|\n format.html { redirect_to intakes_url }\n format.json { head :no_content }\n end\n end",
"def delete(path, opts = {}, &block)\n request(:delete, path, opts, &block)\n end",
"def delete_json(url)\n JSON.parse(delete(url, :json, :json))\n end",
"def delete_and_give_me_a_json(additional_path, params = nil)\n if self.service_base_path != nil\n if params == nil\n params = Hash.new\n end\n params[:api_key] = self.access_token\n message = self.http_client.delete \"#{self.base_url}#{self.service_base_path}/#{additional_path}.json\", params\n trata_erro(message.content)\n end\n end",
"def destroy\n @jedi = Jedi.find(params[:id])\n @jedi.destroy\n\n respond_to do |format|\n format.html { redirect_to jedis_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @request = Request.find(params[:id])\n @request.destroy\n\n respond_to do |format|\n format.html { redirect_to requests_url }\n format.json { head :ok }\n end\n end",
"def delete(*args)\n prepare_request(:delete, args)\n @@client.add(:delete, @path, *args)\n end",
"def delete\n api_client.delete(url)\n end",
"def delete(path, params = {})\n debug_log \"DELETE #{@host}#{path} params:#{params}\"\n res = connection.delete path, params\n debug_log \"Response status:#{res.status}, body:#{res.body}\"\n res\n end",
"def delete\n \n end",
"def delete\n url = prefix + \"delete\"\n return response(url)\n end",
"def delete\n url = prefix + \"delete\"\n return response(url)\n end",
"def delete(_url)\n # do nothing since we can't find the key by url\n end",
"def destroy\n @crawl_request = CrawlRequest.find(params[:id])\n @crawl_request.destroy\n\n head :no_content\n end",
"def destroy\n @crawl_request = CrawlRequest.find(params[:id])\n @crawl_request.destroy\n\n head :no_content\n end",
"def delete\n Iterable.request(conf, base_path).delete\n end",
"def destroy\n @request = Request.find(params[:id])\n @request.destroy\n\n respond_to do |format|\n format.html { redirect_to requests_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @request = Request.find(params[:id])\n @request.destroy\n\n respond_to do |format|\n format.html { redirect_to requests_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @request = Request.find(params[:id])\n @request.destroy\n\n respond_to do |format|\n format.html { redirect_to requests_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @request = Request.find(params[:id])\n @request.destroy\n\n respond_to do |format|\n format.html { redirect_to requests_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @request = Request.find(params[:id])\n @request.destroy\n\n respond_to do |format|\n format.html { redirect_to requests_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @request = Request.find(params[:id])\n @request.destroy\n\n respond_to do |format|\n format.html { redirect_to requests_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n client=Client.find_by_id(params[:id])\n if client != nil\n if client.destroy\n head 204\n end\n else\n head 404\n end\n end",
"def destroy\n @gig_request = GigRequest.find(params[:id])\n @gig_request.destroy\n\n respond_to do |format|\n format.html { redirect_to gig_requests_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @advert3.destroy\n respond_to do |format|\n format.html { redirect_to advert3s_url, notice: 'Advert3 was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @click = Click.find(params[:id])\n @click.destroy\n\n respond_to do |format|\n format.html { redirect_to clicks_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @hold_request.destroy\n respond_to do |format|\n format.html { redirect_to hold_requests_url, notice: 'Hold request was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @preservative = Preservative.find(params[:id])\n @preservative.destroy\n\n respond_to do |format|\n format.html { redirect_to preservatives_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @take = Take.find(params[:id])\n @take.destroy\n\n respond_to do |format|\n format.html { redirect_to takes_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @monkey = Monkey.find(params[:id])\n @monkey.destroy\n\n respond_to do |format|\n format.html { redirect_to monkeys_url }\n format.json { head :no_content }\n end\n end",
"def delete_aos_version(args = {}) \n delete(\"/aosversions.json/#{args[:aosVersionId]}\", args)\nend",
"def deleteRequest\n\n end",
"def delete(url, headers = {})\n http :delete, \"#{url}.json\", headers\n end",
"def destroy\n @serving = Serving.find(params[:id])\n @serving.destroy\n\n respond_to do |format|\n format.html { redirect_to servings_url }\n format.json { head :no_content }\n end\n end",
"def delete(request_opts = {})\n store_result(http(request_opts).delete(resolved_path))\n end",
"def delete(url)\n do_request(\"delete\", url)\n end",
"def destroy\n @walk_request.destroy\n respond_to do |format|\n format.html { redirect_to walk_requests_url, notice: 'walk request was successfully destroyed.' }\n format.json { head :no_content }\n end\n end"
] |
[
"0.6477453",
"0.63981193",
"0.6344374",
"0.63188684",
"0.62339234",
"0.6199888",
"0.6199843",
"0.61940086",
"0.6188869",
"0.6167954",
"0.6146313",
"0.61321557",
"0.61170363",
"0.61096305",
"0.6093699",
"0.6093699",
"0.6093699",
"0.6093699",
"0.6093699",
"0.6093699",
"0.6093699",
"0.6084716",
"0.60817415",
"0.60817415",
"0.60817415",
"0.6073946",
"0.60714215",
"0.6062063",
"0.6051737",
"0.6034192",
"0.6034192",
"0.6020753",
"0.60143375",
"0.60143375",
"0.6003766",
"0.59922755",
"0.5989755",
"0.59894574",
"0.59893435",
"0.59523726",
"0.5946417",
"0.59345204",
"0.59342206",
"0.5933301",
"0.59279424",
"0.59141093",
"0.5909953",
"0.5909127",
"0.5904812",
"0.59025526",
"0.58994323",
"0.5892745",
"0.5890899",
"0.5889871",
"0.58794165",
"0.5872141",
"0.586672",
"0.5863853",
"0.58626133",
"0.5859888",
"0.5855967",
"0.58530414",
"0.5848021",
"0.5842206",
"0.58421326",
"0.58402103",
"0.5838726",
"0.5825068",
"0.5824896",
"0.582148",
"0.5816637",
"0.58128935",
"0.58107847",
"0.5810138",
"0.5810138",
"0.5800247",
"0.57988757",
"0.57988757",
"0.5789415",
"0.57798284",
"0.57798284",
"0.57798284",
"0.57798284",
"0.57798284",
"0.57798284",
"0.5779582",
"0.5774325",
"0.57643735",
"0.57641417",
"0.5745116",
"0.57446814",
"0.5742686",
"0.57302177",
"0.5721777",
"0.57164365",
"0.57142913",
"0.5708298",
"0.57073146",
"0.570355",
"0.56989765"
] |
0.7112117
|
0
|
Use callbacks to share common setup or constraints between actions.
|
def set_keep
@keep = current_user.keeps.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 keep_params
params.require(:keep).permit(:name, :note)
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
|
Gets (or sets if not existing) ZMQ context used by M2R to create sockets.
|
def zmq_context(zmq_io_threads = 1)
Thread.exclusive do
@zmq_context ||= ZMQ::Context.new(zmq_io_threads)
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def context\n @context ||= ::ZMQ::Context.new\n end",
"def zmq_context\n @zmq_context ||= create_zmq_context\n end",
"def context(worker_threads = 1)\n return @context if @context\n @context = ::ZMQ::Context.new(worker_threads)\n end",
"def context\n @context ||= begin\n require 'ffi-rzmq'\n ZMQ::Context.new\n end\n block_given? ? yield(@context) : @context\n end",
"def socket\n return @socket if @socket\n @socket = self.class.context.socket(ZMQ::DEALER)\n raise \"ZMQ error on socket creation: #{ZMQ::Util.error_string}\" if @socket.nil?\n if LogjamAgent.ensure_ping_at_exit\n ensure_ping_at_exit\n else\n pid = Process.pid\n at_exit { reset if Process.pid == pid}\n end\n @socket.setsockopt(ZMQ::LINGER, @config[:linger])\n @socket.setsockopt(ZMQ::SNDHWM, @config[:snd_hwm])\n @socket.setsockopt(ZMQ::RCVHWM, @config[:rcv_hwm])\n @socket.setsockopt(ZMQ::RCVTIMEO, @config[:rcv_timeo])\n @socket.setsockopt(ZMQ::SNDTIMEO, @config[:snd_timeo])\n spec = connection_specs.sort_by{rand}.first\n @socket.connect(spec)\n @socket\n end",
"def init(worker_threads = 1)\n @mutex.synchronize do\n unless @context\n @context = ZMQ.context(worker_threads)\n @sockets = Set.new\n end\n @context\n end\n end",
"def zmq_context(reload = false)\n self.class.zmq_context(reload)\n end",
"def socket(type, opts={})\n opts[:context] = self\n ZMQ::Socket.new type, opts\n end",
"def create_socket\n attempt_number = 0\n\n begin\n attempt_number += 1\n socket = zmq_context.socket(::ZMQ::REQ)\n\n if socket # Make sure the context builds the socket\n server_uri = lookup_server_uri\n socket.setsockopt(::ZMQ::LINGER, 0)\n zmq_error_check(socket.connect(server_uri), :socket_connect)\n socket = socket_to_available_server(socket) if first_alive_load_balance?\n end\n end while socket.try(:socket).nil? && attempt_number < socket_creation_attempts\n\n raise RequestTimeout, \"Cannot create new ZMQ client socket\" if socket.try(:socket).nil?\n socket\n end",
"def reset\n @socket = self.class.context { |c| c.socket(ZMQ::REQ) }\n @socket.connect @address\n end",
"def context\n Zuul::Context.new context_type, context_id\n end",
"def service_socket(name)\n service_sockets[name] ||= \n begin\n socket = rz_socket(ZMQ::DEALER)\n socket.setsockopt(ZMQ::IDENTITY,@rz_identity) if @rz_identity\n socket.connect(service_address(name))\n socket\n end\n end",
"def socket type\n sock = nil\n begin\n sock = Socket.new @context, type\n rescue ContextError => e\n sock = nil\n end\n\n sock\n end",
"def context\n Thread.current[:ctx] ||= {}\n Thread.current[:ctx]\n end",
"def context\n Thread.current[NAME] ||= Hash.new\n end",
"def socket\n if !block_given?\n if @cached_socket != nil\n return @cached_socket\n end\n return @cached_socket = ::Vertx::Util::Utils.safe_create(@j_del.java_method(:socket, []).call(),::Vertx::NetSocket)\n end\n raise ArgumentError, \"Invalid arguments when calling socket()\"\n end",
"def initialize(sock_type,address,sock_ctype)\n @context = ZMQ::Context.new(1)\n @socket = @context.socket(sock_type)\n if sock_ctype == :bind\n @socket.bind(address)\n else\n @socket.connect(address)\n end\n end",
"def context\n @_context ||= begin\n ptr = MemoryPointer::new( Context )\n error = OpenCL.clGetProgramInfo(self, CONTEXT, Context.size, ptr, nil)\n error_check(error)\n Context::new( ptr.read_pointer )\n end\n end",
"def active_local_sockets; end",
"def socket\n if !block_given?\n if @cached_socket != nil\n return @cached_socket\n end\n return @cached_socket = ::Vertx::Util::Utils.safe_create(@j_del.java_method(:socket, []).call(),::VertxWeb::SockJSSocket)\n end\n raise ArgumentError, \"Invalid arguments when calling socket()\"\n end",
"def context\n @_context ||= begin\n ptr = MemoryPointer::new( Context )\n error = OpenCL.clGetKernelInfo(self, CONTEXT, Context.size, ptr, nil)\n error_check(error)\n Context::new( ptr.read_pointer )\n end\n end",
"def get_or_create_context\n if !block_given?\n return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:getOrCreateContext, []).call(),::Vertx::Context)\n end\n raise ArgumentError, \"Invalid arguments when calling get_or_create_context()\"\n end",
"def get_context\n @context_hash ||= {}\n end",
"def context\n Thread.current[NAME] ||= Array.new\n end",
"def worker_socket(context, poller)\n worker = context.socket @zmq_const\n worker.setsockopt ZMQ::LINGER, 60000 # wait for messages to be delivered\n\n if @sockopt\n setopts(worker, @sockopt)\n end\n\n @address.each do |addr|\n setup(worker, addr)\n end\n\n poller.register_readable worker\n worker.send_string PPP_READY\n worker\n end",
"def context\n @_context ||= {\n :argv => START_CTX[:argv].map { |arg| arg.dup },\n :cwd => START_CTX[:cwd].dup,\n 0 => START_CTX[0].dup,\n }.tap do |ctx|\n rewrite_context(ctx)\n end\n end",
"def socket_setup()\n ctx = { 'Msf' => self.options['Msf'], 'MsfExploit' => self.options['MsfExploit'] }\n self.socket = case self.handle.protocol\n\n when 'ncacn_ip_tcp'\n Rex::Socket.create_tcp(\n 'PeerHost' => self.handle.address,\n 'PeerPort' => self.handle.options[0],\n 'Context' => ctx,\n 'Timeout' => self.options['connect_timeout']\n )\n\n when 'ncacn_np'\n begin\n socket = Rex::Socket.create_tcp(\n 'PeerHost' => self.handle.address,\n 'PeerPort' => 445,\n 'Context' => ctx,\n 'Timeout' => self.options['connect_timeout']\n )\n rescue ::Timeout::Error, Rex::ConnectionRefused\n socket = Rex::Socket.create_tcp(\n 'PeerHost' => self.handle.address,\n 'PeerPort' => 139,\n 'Context' => ctx,\n 'Timeout' => self.options['connect_timeout']\n )\n end\n socket\n else nil\n end\n\n # Add this socket to the exploit's list of open sockets\n options['MsfExploit'].add_socket(self.socket) if (options['MsfExploit'])\n end",
"def context\n ptr = FFI::MemoryPointer::new( Context )\n error = OpenCL.clGetKernelInfo(self, CONTEXT, Context.size, ptr, nil)\n error_check(error)\n return Context::new( ptr.read_pointer )\n end",
"def context\n unless @instance_context\n @instance_context = ConfigurationContext.new(@version , @params['chat_service_sid'])\n end\n @instance_context\n end",
"def context\n @context ||= Context.new(self)\n end",
"def context\n @context ||= new_context_mock(context_options, &finalize_proc)\n end",
"def context\n @context ||= Context.new(self)\n end",
"def context\n unless @instance_context\n @instance_context = ChannelContext.new(@version , @params['sid'])\n end\n @instance_context\n end",
"def contexts\n @contexts ||= @contexts = {}\n end",
"def socket #:nodoc:\n return @socket\n end",
"def contexts\n @contexts ||= {}\n end",
"def close\n unless closed?\n API::invoke :zmq_close, ptr\n @context, @ptr = nil, nil\n info \"Socket closed.\"\n end\n end",
"def message_context_session\n session\n end",
"def context\n unless @instance_context\n @instance_context = ChannelContext.new(@version , @params['service_sid'], @params['sid'])\n end\n @instance_context\n end",
"def context\n @context ||= {}\n end",
"def context\n @context ||= {}\n end",
"def service_sockets\n @service_sockets ||= {}\n end",
"def set_context(spark)\n # store in thread_store for later use\n sent_to spark[:sender]\n previous_sender spark[:sender]\n context_params({ reply_to: spark[:previous_sender], spark_uid: spark[:spark_uid]})\n end",
"def context\n unless @instance_context\n @instance_context = NotificationContext.new(@version, @params['chat_service_sid'], )\n end\n @instance_context\n end",
"def context\n unless @instance_context\n @instance_context = CurrentCallContext.new(@version, )\n end\n @instance_context\n end",
"def default_socket_class; end",
"def [] context\n self.class.new @server, context\n end",
"def get_zapp_server\n return self.plant_attributes[self.plant.intern][self.env.intern][:host], self.plant_attributes[self.plant.intern][self.env.intern][:soap_port]\n end",
"def mainContext\n # return Context.find( context )\n return context\n end",
"def redis_connections\n @redis_connections ||= Stockpile::RedisConnectionsFactory.build_connections\n end",
"def ssl_context\n @tls&.ssl_context\n end",
"def context\n unless @instance_context\n @instance_context = NotificationContext.new(@version , @params['chat_service_sid'])\n end\n @instance_context\n end",
"def context\n Context.instance\n end",
"def get_zk()\n require 'zookeeper'\n # todo: memoize\n return Zookeeper.new(@new_resource.connect_str)\nend",
"def connection_factory\n @connection_factory ||= begin\n if exists?(:gateway)\n logger.debug \"establishing connection to gateway `#{fetch(:gateway)}'\"\n GatewayConnectionFactory.new(fetch(:gateway), self)\n elsif(exists?(:winrm_running))\n logger.debug \"establishing connection to WinRM\"\n WinRMConnectionFactory.new(self)\n else\n DefaultConnectionFactory.new(self)\n end\n end\n end",
"def get_zookeeper_conn(config)\n zk = Zookeeper.new(\"#{config[:zoo_server]}:#{config[:zoo_port]}\")\n # TODO put in logic here to try the extra_zoos in case the primary zoo server is down\n return zk\nend",
"def context\n unless @instance_context\n @instance_context = UserDefinedMessageSubscriptionContext.new(@version , @params['account_sid'], @params['call_sid'], @params['sid'])\n end\n @instance_context\n end",
"def connection_factory\n @connection_factory ||= begin\n if exists?(:gateway)\n logger.debug \"establishing connection to gateway `#{fetch(:gateway).inspect}'\"\n GatewayConnectionFactory.new(fetch(:gateway), self)\n else\n DefaultConnectionFactory.new(self)\n end\n end\n end",
"def with_socket\n set_client_id unless @set_client_id.nil?\n\n yield(socket)\n end",
"def terminate\n unless @context.nil? || @context.null?\n remove_finalizer\n rc = LibZMQ.terminate_context(@context)\n @context = nil\n rc || 0\n else\n 0\n end\n end",
"def initialize(type, endpoint = nil, context = nil)\n @context = context || Context.instance.xs_context\n @sock = @context.socket xs_const(type)\n @endpoint = endpoint\n\n fail \"Creating socket #{type} failed\" unless @sock\n end",
"def main_context\n @main_context ||= Context.new\n end",
"def thread_context\n Thread.current[:runshell_context] ||= Context.new(main_context.to_h)\n end",
"def default_context\n @@default_context = Graph.new(:identifier => @store.identifier, :store => @store)\n end",
"def connection #:nodoc:\n Thread.current['connection'] ||= retrieve_connection\n Thread.current['connection']\n end",
"def context\n @context_stack.last\n end",
"def current\n all_contexts[Thread.current.object_id]\n end",
"def context\n unless @instance_context\n @instance_context = CallContext.new(@version , @params['sid'])\n end\n @instance_context\n end",
"def context\n Thread.current[\"#{@name}_dlogger_contexts\"] ||= []\n end",
"def connection_manager\n @connection_manager ||= TOAMQP::ConnectionManager.new\n end",
"def context(name)\n contexts[name] ||= []\n end",
"def context\n unless @instance_context\n @instance_context = CpsContext.new(@version, )\n end\n @instance_context\n end",
"def get_context_properties( options )\n properties = nil\n if options[:properties] then\n properties = MemoryPointer::new( :cl_context_properties, options[:properties].length + 1 )\n options[:properties].each_with_index { |e,i|\n properties[i].write_cl_context_properties(e.respond_to?(:to_ptr) ? e : e.to_i)\n }\n properties[options[:properties].length].write_cl_context_properties(0)\n end\n return properties\n end",
"def context\n init\n @context\n end",
"def fetch(context=nil)\n context.nil? ? global : named_context[context]\n end",
"def connection_manager\n @manager ||= (connection_base? ? Redis::ConnectionManager.new(@connection_specification) : superclass.connection_manager)\n end",
"def context\n unless @instance_context\n @instance_context = InteractionChannelContext.new(\n @version,\n @params['interaction_sid'],\n @params['sid'],\n )\n end\n @instance_context\n end",
"def default_socket_class=(_arg0); end",
"def setup_queue\n callback = ContextRequestSubscriber.fetch_queue_callback\n if callback\n exchange, queue = callback.call(self)\n else\n channel = create_channel(@session_params)\n exchange = fetch_exchange(channel, @exchange_type, @exchange_name,\n @exchange_opts)\n queue = bind_queue(channel, exchange)\n end\n [exchange, queue]\n end",
"def initialize(mode, type, **options)\n fail ArgumentError unless %i(bind connect).include? mode\n @context = options[:context] || EZMQ::Context.new\n @socket = @context.socket type\n @encode = options[:encode] || -> m { m }\n @decode = options[:decode] || -> m { m }\n endpoint = options.select { |k, _| %i(transport address port).include? k }\n method(mode).call endpoint\n end",
"def generate_redis_connection!\n redis_options ? Redis.new(**redis_options) : Redis.current\n end",
"def _zmq_read\n return unless @socket\n @poller = ::ZMQ::Poller.new\n\n @poller.register_readable @socket\n @poller.register_readable @child\n\n # read on the socket(s) and call the registered reader blocks for every message, always using\n # multipart and converting to ruby strings to avoid ZMQ::Message cleanup issues.\n count = 0\n @running = true\n while @running\n rc = @poller.poll(1)\n unless rc > 0\n sleep 0.01\n next\n end\n\n @poller.readables.each do |sock|\n rc = sock.recv_strings messages=[]\n if rc > -1\n if sock == @socket\n count += 1\n run_readers(messages, self)\n # the main thread can send messages through to be resent or \"exit\" to shut down this thread\n elsif sock == @child\n if messages[0] == \"exit\"\n verbose \"Got exit message. Exiting.\"\n @running = false\n elsif messages[0] == \"subscribe\"\n @socket.setsockopt ::ZMQ::SUBSCRIBE, messages[1]\n else\n @socket.send_strings messages\n end\n else\n raise \"BUG: couldn't match socket to a known socket\"\n end\n\n # stop reading after a set number of messages, regardless of whether there are any more waiting\n break if @limit and count >= @limit\n break unless @running\n else\n @error_count += 1\n break\n end\n end # @poller.readables.each\n\n break if @limit and count >= @limit\n end # while @running\n end",
"def create_socket\n\t\tiaddr = self.class.bind_addr\n\t\tsocket = UDPSocket.new\n\n\t\tsocket.setsockopt( :IPPROTO_IP, :IP_ADD_MEMBERSHIP, iaddr )\n\t\tsocket.setsockopt( :IPPROTO_IP, :IP_MULTICAST_TTL, self.class.multicast_ttl )\n\t\tsocket.setsockopt( :IPPROTO_IP, :IP_MULTICAST_LOOP, 1 )\n\t\tsocket.setsockopt( :SOL_SOCKET, :SO_REUSEPORT, 1 )\n\n\t\treturn socket\n\tend",
"def open_ssl_socket()\n require 'openssl' unless defined?(OpenSSL)\n begin # Any raised SSL exceptions\n ctx = @sslctx_newparm ? OpenSSL::SSL::SSLContext.new(@sslctx_newparm) : OpenSSL::SSL::SSLContext.new\n ctx.verify_mode = OpenSSL::SSL::VERIFY_NONE # Assume for now\n #\n # Note: if a client uses :ssl => true this would result in the gem using\n # the _default_ Ruby ciphers list. This is _known_ to fail in later\n # Ruby releases. The gem now detects :ssl => true, and replaces that\n # with:\n # * :ssl => Stomp::SSLParams.new\n #\n # The above results in the use of Stomp default parameters.\n #\n # To specifically request Stomp default parameters, use:\n # * :ssl => Stomp::SSLParams.new(..., :ciphers => Stomp::DEFAULT_CIPHERS)\n #\n # If connecting with an SSLParams instance, and the _default_ Ruby\n # ciphers list is actually required, use:\n # * :ssl => Stomp::SSLParams.new(..., :use_ruby_ciphers => true)\n #\n # If a custom ciphers list is required, connect with:\n # * :ssl => Stomp::SSLParams.new(..., :ciphers => custom_ciphers_list)\n #\n if @ssl != true\n #\n # Here @ssl is:\n # * an instance of Stomp::SSLParams\n # Control would not be here if @ssl == false or @ssl.nil?.\n #\n\n # Back reference the SSLContext\n @ssl.ctx = ctx\n\n # Server authentication parameters if required\n if @ssl.ts_files\n ctx.verify_mode = OpenSSL::SSL::VERIFY_PEER\n truststores = OpenSSL::X509::Store.new\n fl = @ssl.ts_files.split(\",\")\n fl.each do |fn|\n # Add next cert file listed\n raise Stomp::Error::SSLNoTruststoreFileError if !File::exists?(fn)\n raise Stomp::Error::SSLUnreadableTruststoreFileError if !File::readable?(fn)\n truststores.add_file(fn)\n end\n ctx.cert_store = truststores\n end\n\n # Client authentication parameters.\n # Both cert file and key file must be present or not, it can not be a mix.\n raise Stomp::Error::SSLClientParamsError if @ssl.cert_file.nil? && !@ssl.key_file.nil?\n raise Stomp::Error::SSLClientParamsError if !@ssl.cert_file.nil? && @ssl.key_file.nil?\n if @ssl.cert_file # Any check will do here\n raise Stomp::Error::SSLNoCertFileError if !File::exists?(@ssl.cert_file)\n raise Stomp::Error::SSLUnreadableCertFileError if !File::readable?(@ssl.cert_file)\n ctx.cert = OpenSSL::X509::Certificate.new(File.read(@ssl.cert_file))\n raise Stomp::Error::SSLNoKeyFileError if !File::exists?(@ssl.key_file)\n raise Stomp::Error::SSLUnreadableKeyFileError if !File::readable?(@ssl.key_file)\n ctx.key = OpenSSL::PKey::RSA.new(File.read(@ssl.key_file), @ssl.key_password)\n end\n\n # Cipher list\n # As of this writing, there are numerous problems with supplying\n # cipher lists to jruby. So we do not attempt to do that here.\n if !@ssl.use_ruby_ciphers # No Ruby ciphers (the default)\n if @ssl.ciphers # User ciphers list?\n ctx.ciphers = @ssl.ciphers # Accept user supplied ciphers\n else\n ctx.ciphers = Stomp::DEFAULT_CIPHERS # Just use Stomp defaults\n end\n end unless @jruby\n\n # Set SSLContext Options if user asks for it in Stomp::SSLParams\n # and SSL supports it.\n if @ssl.ssl_ctxopts && ctx.respond_to?(:options=)\n ctx.options = @ssl.ssl_ctxopts\n end\n\n end\n\n #\n ssl = nil\n slog(:on_ssl_connecting, log_params)\n # _dump_ctx(ctx)\n Timeout::timeout(@connect_timeout, Stomp::Error::SocketOpenTimeout) do\n tcp_socket = TCPSocket.open(@host, @port)\n ssl = OpenSSL::SSL::SSLSocket.new(tcp_socket, ctx)\n ssl.hostname = @host if ssl.respond_to? :hostname=\n ssl.sync_close = true # Sync ssl close with underlying TCP socket\n ssl.connect\n if (ssl.context.verify_mode != OpenSSL::SSL::VERIFY_NONE) && @ssl_post_conn_check\n ssl.post_connection_check(@host)\n end\n end\n def ssl.ready?\n ! @rbuffer.empty? || @io.ready?\n end\n if @ssl != true\n # Pass back results if possible\n if RUBY_VERSION =~ /1\\.8\\.[56]/\n @ssl.verify_result = \"N/A for Ruby #{RUBY_VERSION}\"\n else\n @ssl.verify_result = ssl.verify_result\n end\n @ssl.peer_cert = ssl.peer_cert\n end\n slog(:on_ssl_connected, log_params)\n ssl\n rescue Exception => ex\n lp = log_params.clone\n lp[:ssl_exception] = ex\n slog(:on_ssl_connectfail, lp)\n if ssl\n # shut down the TCP socket - we just failed to do the SSL handshake in time\n ssl.close\n end\n #\n puts ex.backtrace\n $stdout.flush\n raise # Reraise\n end\n end",
"def context(name = current_context)\n named_context(name)&.context\n end",
"def socket\n @socket ||= UDPSocket.new.tap do |socket|\n socket.setsockopt Socket::IPPROTO_IP,\n Socket::IP_ADD_MEMBERSHIP,\n multicast_group\n socket.setsockopt Socket::IPPROTO_IP,\n Socket::IP_MULTICAST_TTL,\n 1\n socket.setsockopt Socket::SOL_SOCKET,\n Socket::SO_REUSEPORT,\n 1 \n end\n end",
"def context\n @context || (parent.context if parent)\n end",
"def create(param)\n\t\tsock = nil\n\n\t\t# Notify handlers before we create the socket\n\t\tnotify_before_socket_create(self, param)\n\n\t\tcase param.proto\n\t\t\twhen 'tcp'\n\t\t\t\tsock = net.socket.create(param)\n\t\t\telse\n\t\t\t\traise Rex::UnsupportedProtocol.new(param.proto), caller\n\t\tend\n\n\t\t# Notify now that we've created the socket\n\t\tnotify_socket_created(self, sock, param)\n\n\t\t# Return the socket to the caller\n\t\tsock\n\tend",
"def context\n nil\n end",
"def context(name)\n contexts[name] = [] unless contexts.has_key?(name)\n contexts[name]\n end",
"def active_local_sockets\n @local_forwarded_sockets.keys\n end",
"def context\n unless @instance_context\n @instance_context = ConfigurationContext.new(@version )\n end\n @instance_context\n end",
"def rsocket\n return @rsocket if @rsocket\n send_relayopen unless @raddr\n linger = @heartbeat_timeout * 1000\n pubkey = Directory[@id].pubkey\n @rsocket = ClientServer.new @raddr, linger, pubkey\n end",
"def create_socket\n if @uri.scheme == 'wss'\n create_ssl_socket.tap(&:connect)\n else\n TCPSocket.new(@uri.host, @port)\n end\n end",
"def context\n unless @instance_context\n @instance_context = AnonymizeContext.new(@version , @params['room_sid'], @params['sid'])\n end\n @instance_context\n end",
"def incoming_context\n return @incoming_context\n end",
"def redis_pool\n Rails.redis_pool\n end",
"def context\n unless @instance_context\n @instance_context = CompositionContext.new(@version, @params['sid'], )\n end\n @instance_context\n end",
"def initialize(socket, context = nil)\n socket = socket.respond_to?(:io) ? socket.io || socket : socket\n context ? orig_initialize(socket, context) : orig_initialize(socket)\n end",
"def context\n self.current_custom_context || self.default_context\n end"
] |
[
"0.80110765",
"0.77416795",
"0.7644047",
"0.7222548",
"0.70305806",
"0.6727173",
"0.6614803",
"0.6547695",
"0.6252111",
"0.5859823",
"0.57611305",
"0.5709235",
"0.55524844",
"0.55137044",
"0.54587895",
"0.54320097",
"0.5410488",
"0.53804314",
"0.53791654",
"0.5347228",
"0.5342133",
"0.53407943",
"0.52927494",
"0.5262975",
"0.5212258",
"0.5194185",
"0.5182606",
"0.5131805",
"0.5129978",
"0.5118319",
"0.5115062",
"0.5089803",
"0.50470024",
"0.5041662",
"0.50293887",
"0.50263697",
"0.5000888",
"0.498684",
"0.49802306",
"0.49746025",
"0.49746025",
"0.49291977",
"0.4925474",
"0.49248484",
"0.49227622",
"0.48707953",
"0.4856746",
"0.48499653",
"0.4836454",
"0.48223045",
"0.47944158",
"0.47939396",
"0.47816974",
"0.4775801",
"0.4774956",
"0.47721446",
"0.47599328",
"0.47595495",
"0.47592205",
"0.47507557",
"0.47470507",
"0.47452664",
"0.47394598",
"0.47295916",
"0.47200695",
"0.47196308",
"0.47187364",
"0.4717675",
"0.4713253",
"0.471137",
"0.47085094",
"0.4697888",
"0.4695415",
"0.4689918",
"0.46895015",
"0.46853936",
"0.46832427",
"0.46779507",
"0.4677843",
"0.46764234",
"0.46566945",
"0.46557108",
"0.46543247",
"0.46519113",
"0.46485436",
"0.46474165",
"0.46433154",
"0.46417746",
"0.46408015",
"0.4619224",
"0.4610971",
"0.46099424",
"0.46060762",
"0.46042702",
"0.4603358",
"0.4593131",
"0.45822707",
"0.4579456",
"0.45765767",
"0.45716113"
] |
0.72608227
|
3
|
GET /evaluations GET /evaluations.json
|
def index
if params[:query]
@evaluations = Evaluation.text_search(params[:query]).paginate(page: params[:page]).
order(date: :asc).per_page(10)
flash[:notice] = 'Ningún resultado' if @evaluations.empty?
else
@evaluations = Evaluation.paginate(page: params[:page]).order(date: :asc).per_page(10)
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def get_eval\n\t\t@student = Student.find(params[:student_id])\n\t\t@evaluation = @student.evaluations.find(params[:eval_id])\n\t\trender json: @evaluation\n\tend",
"def index\n @score_evaluations = ScoreEvaluation.all\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @score_evaluations }\n end\n end",
"def evaluations(id)\n connection.get do |req|\n req.url \"job/#{id}/evaluations\"\n end\n end",
"def get_evaluations\n\t\tif current_student.id.to_i == params[:id].to_i\n\t\t\t@student = Student.find(params[:id])\n\t\t\t@evaluations = @student.evaluations\n\t\tend\n\t\trender 'get_evaluations'\n\tend",
"def index\n @evaluations = Evaluation.all\n end",
"def index\n @evaluations = @course.evaluations\n end",
"def index\n @evaluations = @course.evaluations\n end",
"def index\n @evaluations = Evaluation.all\n end",
"def index\n @evaluations = Evaluation.all\n end",
"def index\n @evaluations = Evaluation.all\n end",
"def index\n @evaluations = Evaluation.all\n end",
"def index\n @evaluations = Evaluation.all\n end",
"def getEvaluations\n\t\tharness.evaluations\n\tend",
"def index\n @evaluaciones = Evaluacion.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @evaluaciones }\n end\n end",
"def show\n @evaluations = Evaluation.find(params[:id])\n end",
"def index\n @evaluates = Evaluate.all\n end",
"def completed_evaluations_list\n\t\t@student = Student.find(params[:student_id])\n\t\t@evaluations = []\n\t\tfor evaluation in @student.evaluations\n\t\t\tif evaluation.isCompleted\n\t\t\t\t@evaluations << evaluation\n\t\t\tend\n\t\tend\n\t\trender json: @evaluations\n\tend",
"def index\r\n @evaluaciones = Evaluacione.all\r\n end",
"def index\n @evals = Eval.all\n respond_with(@evals) \n end",
"def show\n @score_evaluation = ScoreEvaluation.find(params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @score_evaluation }\n end\n end",
"def index\n @evaluation_results = EvaluationResult.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @evaluation_results }\n end\n end",
"def index\n @evaluations = Evaluation.accessible_by(current_ability, :read)\n end",
"def index\n \n @evaluation = Evaluation.find_by(user_id: params[:user_id], study_case_id: params[:study_case_id])\n\n if @evaluation.present?\n render :show\n else\n render json: nil\n end\n \n end",
"def show\n @evaluation_criterium = EvaluationCriterium.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @evaluation_criterium }\n end\n end",
"def evaluate\n response = Quiz.find(params[:quiz_id]).evaluate(params[:questions], current_user)\n @answers = response[:answers]\n @nota = response[:grade]\n\n respond_to do |format|\n format.html { render 'evaluate' }\n end\n end",
"def index\n @evaluations = Evaluation.all\n @evaluation = Evaluation.new\n end",
"def show\n @evaluacion = Evaluacion.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @evaluacion }\n end\n end",
"def evaluation\n @api_v1_reservation.evaluate(evaluation_params[:comment], evaluation_params[:rating].to_i) unless @api_v1_reservation.evaluation\n render json: { success: true }, status: 200\n rescue Exception => errors\n render json: errors, status: :unprocessable_entity\n end",
"def index\n @performance_evaluations = PerformanceEvaluation.all\n end",
"def index\n @course_evaluations = CourseEvaluation.all\n end",
"def list_model_evaluations request_pb, options = nil\n raise ::ArgumentError, \"request must be provided\" if request_pb.nil?\n\n verb, uri, query_string_params, body = ServiceStub.transcode_list_model_evaluations_request request_pb\n query_string_params = if query_string_params.any?\n query_string_params.to_h { |p| p.split \"=\", 2 }\n else\n {}\n end\n\n response = @client_stub.make_http_request(\n verb,\n uri: uri,\n body: body || \"\",\n params: query_string_params,\n options: options\n )\n operation = ::Gapic::Rest::TransportOperation.new response\n result = ::Google::Cloud::AutoML::V1::ListModelEvaluationsResponse.decode_json response.body, ignore_unknown_fields: true\n\n yield result, operation if block_given?\n result\n end",
"def list_model_evaluations request_pb, options = nil\n raise ::ArgumentError, \"request must be provided\" if request_pb.nil?\n\n verb, uri, query_string_params, body = ServiceStub.transcode_list_model_evaluations_request request_pb\n query_string_params = if query_string_params.any?\n query_string_params.to_h { |p| p.split \"=\", 2 }\n else\n {}\n end\n\n response = @client_stub.make_http_request(\n verb,\n uri: uri,\n body: body || \"\",\n params: query_string_params,\n options: options\n )\n operation = ::Gapic::Rest::TransportOperation.new response\n result = ::Google::Cloud::AutoML::V1beta1::ListModelEvaluationsResponse.decode_json response.body, ignore_unknown_fields: true\n\n yield result, operation if block_given?\n result\n end",
"def course_complete_eval\n\t\t@student_evals = Student.find(params[:student_id]).evaluations.where('course_id = ?', params[:course_id])\n\t\t@evaluations = []\n\t\tif @student_evals != nil\n\t\t\tfor e in @student_evals\n\t\t\t\tif e.isCompleted\n\t\t\t\t\t@evaluations << e\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\t\trender json: @evaluations\n\tend",
"def incomplete_evaluations_list\n\t\t@student = Student.find(params[:student_id])\n\t\t@evaluations = []\n\t\tfor evaluation in @student.evaluations\n\t\t\tif !evaluation.isCompleted\n\t\t\t\t@evaluations << evaluation\n\t\t\tend\n\t\tend\n\n\t\trender json: @evaluations\n\tend",
"def index\n @tutee = Tutee.find params[:tutee_id]\n @evaluations = @tutee.evaluations.where(:status => 'Pending')\n end",
"def index\n @project_evaluations = ProjectEvaluation.all\n end",
"def course_incomplete_eval\n\t\t@student_evals = Student.find(params[:student_id]).evaluations.where('course_id = ?', params[:course_id])\n\t\t@evaluations = []\n\t\tif @student_evals != nil\n\t\t\tfor e in @student_evals\n\t\t\t\tif !e.isCompleted\n\t\t\t\t\t@evaluations << e\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\t\trender json: @evaluations\n\tend",
"def show\n @evaluation_result = EvaluationResult.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @evaluation_result }\n end\n end",
"def new\n @score_evaluation = ScoreEvaluation.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @score_evaluation }\n end\n end",
"def show\n @competency_pertenece_evaluation = CompetencyPerteneceEvaluation.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @competency_pertenece_evaluation }\n end\n end",
"def index\n @evaluos = Evaluo.all\n end",
"def index\n iterations = policy_scope(Iteration)\n render json: iterations\n end",
"def project_evaluations\n ProjectEvaluation.where(user_id: @id)\n end",
"def index\n @evaluations = current_customer.customer_evaluations.order('evaluations.id desc')\n session[:left_service_orderitem] = 'theme'\n session[:right_service_orderitem] = 'theme'\n session[:right_service_query] = ''\n\n respond_to do |format|\n format.html # index.html.erb\n format.json {render json: @evaluations}\n end\n end",
"def index\n @expressions = Expression.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @expressions }\n end\n end",
"def show\r\n @evaluation = Evaluation.find(params[:id])\r\n @responses = Response.find_all_by_Evaluation_id params[:id]\r\n\r\n respond_to do |format|\r\n format.html # show.html.erb\r\n format.xml { render :xml => @evaluation }\r\n end\r\n end",
"def show\n @evaluable_competency = EvaluableCompetency.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @evaluable_competency }\n end\n end",
"def index\n @psicologic_evaluations = PsicologicEvaluation.all\n end",
"def index\n @student_goal_evaluations = StudentGoalEvaluation.all\n end",
"def create\n @evaluations = Evaluation.new(evaluation_params)\n\n respond_to do |format|\n if @evaluation.save\n format.html { redirect_to @evaluation, notice: 'evaluation was successfully created.' }\n format.json { render :show, status: :created, location: @evaluation }\n else\n format.html { render :new }\n format.json { render json: @evaluation.errors, status: :unprocessable_entity }\n end\n end\n end",
"def index\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @evaluators }\n end\n end",
"def index\n @dish_evaluations = DishEvaluation.all\n end",
"def new\n @evaluation_criterium = EvaluationCriterium.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @evaluation_criterium }\n end\n end",
"def show\n @evaluationstatus = Evaluationstatus.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @evaluationstatus }\n end\n end",
"def show\n @qc_evaluation = QcEvaluation.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @qc_evaluation }\n end\n end",
"def create\n @evaluation = Evaluation.new(evaluation_params)\n\n if @evaluation.save\n render :show, status: :created\n else\n render json: @evaluation.errors, status: :unprocessable_entity\n end\n end",
"def set_evaluacion\n @evaluacions = Evaluacion.find(params[:id])\n end",
"def index\n session[:evaluation_id] = nil\n if current_user.has_role? :admin\n @evaluations = Evaluation.all\n else\n @lesson = Lesson.find(session[:lesson_id]) if session[:lesson_id]\n @evaluations = Evaluation.where(user_id: current_user.id).order(updated_at: :desc)\n end\n\n end",
"def index\n @matrix_evaluation_types = MatrixEvaluationType.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @matrix_evaluation_types }\n end\n end",
"def new\n @evaluation = current_customer.customer_evaluations.new\n\n @evaluation.name = Evaluation.sample_evaluation.name if params[:testing]\n respond_to do |format|\n format.html # new.html.erb\n format.json {render json: @evaluation}\n end\n end",
"def update\n if @evaluation.update(evaluation_params)\n render :show, status: :ok\n else\n render json: @evaluation.errors, status: :unprocessable_entity\n end\n end",
"def show\n if @employee.type.nil?\n @evaluations = @employee.evaluations.paginate(page: params[:page]).order(date: :asc).per_page(10)\n end\n end",
"def index\n unless params[:assignment_id]\n render json: format_errors({ base: ['This Endpoint requires a assignment_id in the params'] }),\n status: :bad_request\n return\n end\n\n @iterations = current_user.iterations(includes: includes_array)\n .where(assignment_id: params[:assignment_id])\n serialize_collection @iterations, :ok\n end",
"def index\n @test_subject_evaluations = @test_subject.test_subject_evaluations.find(:all, :order => 'evaluated_on DESC')\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @test_subject_evaluations }\n end\n end",
"def index\n @evaluacion_servicios = EvaluacionServicio.all\n end",
"def show\n @current_team = current_team\n\n @not_evaluated_count = current_team.evaluations.where(evaluation_code_id: 1).count\n @watchlist_count = current_team.evaluations.where(evaluation_code_id: 2).count\n @reject_count = current_team.evaluations.where(evaluation_code_id: 3).count\n end",
"def evaluation_data_of(evaluations)\n class_index = Wikipedia::VandalismDetection::Instances::VANDALISM_CLASS_INDEX\n total_count = evaluations.count.to_f\n\n recall = evaluations.reduce(0.0) { |result, sample| result + sample.recall(class_index) } / total_count\n precision = evaluations.reduce(0.0) { |result, sample| result + sample.precision(class_index) } / total_count\n area_under_prc = evaluations.reduce(0.0) { |result, sample| result + sample.area_under_prc(class_index) } / total_count\n\n { precision: precision, recall: recall, area_under_prc: area_under_prc }\nend",
"def index\n @policy_valuations = PolicyValuation.all\n end",
"def update\n if ENV[\"NEW_EVALUATION\"] == nil\n raise ActionController::RoutingError\n return\n end\n respond_to do |format|\n if @evaluation.update(evaluation_params)\n format.html { redirect_to @evaluation, notice: 'Evaluation was successfully updated.' }\n format.json { render :show, status: :ok, location: @evaluation }\n else\n format.html { render :edit }\n format.json { render json: @evaluation.errors, status: :unprocessable_entity }\n end\n end\n end",
"def index\n if current_user\n @evaluations = current_user.readable_evaluations\n else\n @circle = Circle.where(name: 'Public').try(:first)\n @evaluations = @circle.present? ? @circle.evaluations : []\n end\n user_ids = @evaluations.map(&:created_by_id)\n @users = User.in(id: user_ids)\n @users = @users.index_by(&:id)\n end",
"def show\n @evaluation_sheet = EvaluationSheet.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @evaluation_sheet }\n end\n end",
"def show\n @evaluation = Evaluation.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @evaluation }\n end\n end",
"def create\n @evaluation = Evaluation.new(evaluation_params)\n\n respond_to do |format|\n if @evaluation.save\n format.html { redirect_to @evaluation, notice: 'Evaluation was successfully created.' }\n format.json { render :show, status: :created, location: @evaluation }\n else\n format.html { render :new }\n format.json { render json: @evaluation.errors, status: :unprocessable_entity }\n end\n end\n end",
"def index\n @expression_relationships = ExpressionRelationship.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @expression_relationships }\n end\n end",
"def create\n @evaluation = Evaluation.new(evaluation_params)\n\n respond_to do |format|\n if @evaluation.save\n format.html { redirect_to @evaluation, notice: 'Evaluation was successfully created.' }\n format.json { render action: 'show', status: :created, location: @evaluation }\n else\n format.html { render action: 'new' }\n format.json { render json: @evaluation.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @evaluation = Evaluation.new(evaluation_params)\n\n respond_to do |format|\n if @evaluation.save\n format.html { redirect_to @evaluation, notice: 'Evaluation was successfully created.' }\n format.json { render action: 'show', status: :created, location: @evaluation }\n else\n format.html { render action: 'new' }\n format.json { render json: @evaluation.errors, status: :unprocessable_entity }\n end\n end\n end",
"def index \n @calculation = Calculation.all # retrieve all calculations from calculations table \n json_response(@calculation) # respond with the array of calculations\n end",
"def index\n @requisitions = Requisition.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @requisitions }\n end\n end",
"def update\n respond_to do |format|\n if @evaluation.update(evaluation_params)\n format.html { redirect_to @evaluation, notice: 'Evaluation was successfully updated.' }\n format.json { render :show, status: :ok, location: @evaluation }\n else\n format.html { render :edit }\n format.json { render json: @evaluation.errors, status: :unprocessable_entity }\n end\n end\n end",
"def show\n @rcrieval = Rcrieval.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @rcrieval }\n end\n end",
"def new\n @competency_pertenece_evaluation = CompetencyPerteneceEvaluation.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @competency_pertenece_evaluation }\n end\n end",
"def index\n @educations = Education.all\n render json: @educations\n end",
"def show\n @evaluacion_servicios = EvaluacionServicio.find(params[:id])\n end",
"def set_evaluacione\r\n @evaluacione = Evaluacione.find(params[:id])\r\n end",
"def index\n if params[:project_team_id] && params[:project_id]\n @evaluations = Evaluation.joins(:project, team: :project_teams)\n .where project_teams: { id: params[:project_team_id] }, projects: { id: params[:project_id] }\n elsif params[:team_id]\n @evaluations = Evaluation.joins(:team).where teams: { id: params[:team_id] }\n elsif params[:project_id]\n @evaluations = Evaluation.joins(:project).where projects: { id: params[:project_id] }\n elsif params[:course_id]\n @evaluations = Evaluation.joins(:project).where(projects: { course_id: params[:course_id] })\n else\n @evaluations = Evaluation.all\n end\n end",
"def index\n\t\tevals = Evaluation.where(appliable: false, processed: false)\n\t\tif evals.count == 1\n\t\t\t@eval = evals[0]\n\t\t\tselected = Selected.where(developer_id: current_developer.id, evaluation_id: @eval.id)\n\t\t\tif selected.count == 1\n\t\t\t\tmappings = Mapping.where(rater_group_id: selected[0].rater_group_id)\n\t\t\t\tapplieds = []\n\t\t\t\tfor i in 0..mappings.count-1\n\t\t\t\t\tapplieds += Applied.where(ratee_group_id: mappings[i].ratee_group_id)\n\t\t\t\tend\n\n\t\t\t\t@jobs = []\n\t\t\t\tfor i in 0..applieds.count-1\n\t\t\t\t\t@jobs += Material.where(developer_id: applieds[i].developer_id)\n\t\t\t\tend\n\n\t\t\t\tresults = Result.where(evaluation_id: @eval.id)\n\t\t\t\tresulted_materials = []\n\t\t\t\tfor i in 0..results.count-1\n\t\t\t\t\tresulted_materials += [Material.find(results[i].material_id)]\n\t\t\t\tend\n\t\t\t\t@jobs = @jobs - resulted_materials\n\t\t\tend\n\t\tend\n\tend",
"def update\n respond_to do |format|\n if @evaluation.update(evaluation_params)\n format.html { redirect_to @evaluation, notice: 'Evaluation was successfully updated.' }\n format.json { render :show, status: :ok, location: @evaluation }\n else\n format.html { render :edit }\n format.json { render json: @evaluation.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @evaluation.update(evaluation_params)\n format.html { redirect_to @evaluation, notice: 'Evaluation was successfully updated.' }\n format.json { render :show, status: :ok, location: @evaluation }\n else\n format.html { render :edit }\n format.json { render json: @evaluation.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @evaluation.update(evaluation_params)\n format.html { redirect_to @evaluation, notice: 'Evaluation was successfully updated.' }\n format.json { render :show, status: :ok, location: @evaluation }\n else\n format.html { render :edit }\n format.json { render json: @evaluation.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @evaluation.update(evaluation_params)\n format.html { redirect_to @evaluation, notice: \"Evaluation was successfully updated.\" }\n format.json { render :show, status: :ok, location: @evaluation }\n else\n format.html { render :edit }\n format.json { render json: @evaluation.errors, status: :unprocessable_entity }\n end\n end\n end",
"def set_evaluacion\n @evaluacion = Evaluacion.find(params[:id])\n end",
"def index\n @decisions = Decision.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @decisions }\n end\n end",
"def show\n @run = Run.find(params[:id])\n \n if @run.evaluations.length > 0\n @globalMark = 0\n @run.evaluations.each do |eval|\n @globalMark += eval.note\n end\n \n @globalMark /= @run.evaluations.length\n end\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @run }\n end\n end",
"def index\n @expenses = find_expenses.all\n render json: @expenses\n end",
"def show\n @evaluation = Evaluation.find(params[:id])\n @observation = @evaluation.observation\n respond_to do |format|\n format.html { render :layout=>\"evaluation_tabs\"}\n format.json { render json: @evaluation }\n end\n end",
"def get_model_evaluation request_pb, options = nil\n raise ::ArgumentError, \"request must be provided\" if request_pb.nil?\n\n verb, uri, query_string_params, body = ServiceStub.transcode_get_model_evaluation_request request_pb\n query_string_params = if query_string_params.any?\n query_string_params.to_h { |p| p.split \"=\", 2 }\n else\n {}\n end\n\n response = @client_stub.make_http_request(\n verb,\n uri: uri,\n body: body || \"\",\n params: query_string_params,\n options: options\n )\n operation = ::Gapic::Rest::TransportOperation.new response\n result = ::Google::Cloud::AutoML::V1::ModelEvaluation.decode_json response.body, ignore_unknown_fields: true\n\n yield result, operation if block_given?\n result\n end",
"def get_model_evaluation request_pb, options = nil\n raise ::ArgumentError, \"request must be provided\" if request_pb.nil?\n\n verb, uri, query_string_params, body = ServiceStub.transcode_get_model_evaluation_request request_pb\n query_string_params = if query_string_params.any?\n query_string_params.to_h { |p| p.split \"=\", 2 }\n else\n {}\n end\n\n response = @client_stub.make_http_request(\n verb,\n uri: uri,\n body: body || \"\",\n params: query_string_params,\n options: options\n )\n operation = ::Gapic::Rest::TransportOperation.new response\n result = ::Google::Cloud::AutoML::V1beta1::ModelEvaluation.decode_json response.body, ignore_unknown_fields: true\n\n yield result, operation if block_given?\n result\n end",
"def show\n @evaluation = Evaluation.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @evaluation }\n format.pdf { render :layout=>false }\n end\n end",
"def show\n @eval = Eval.find(params[:id])\n end",
"def new\n @qc_evaluation = QcEvaluation.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @qc_evaluation }\n end\n end"
] |
[
"0.76482457",
"0.72792095",
"0.7244273",
"0.7142984",
"0.71408343",
"0.70979303",
"0.7047793",
"0.70243746",
"0.70243746",
"0.70243746",
"0.70243746",
"0.70243746",
"0.6987093",
"0.68509597",
"0.6796471",
"0.6765452",
"0.6702309",
"0.6669017",
"0.66395843",
"0.66221195",
"0.66124696",
"0.6588599",
"0.65219873",
"0.6496095",
"0.6493425",
"0.64923465",
"0.6426114",
"0.6425327",
"0.63875777",
"0.6382421",
"0.6334004",
"0.62998754",
"0.62907994",
"0.6277111",
"0.6174476",
"0.61393756",
"0.6135265",
"0.61262",
"0.612466",
"0.6105564",
"0.61034805",
"0.6094766",
"0.6081887",
"0.607547",
"0.60732806",
"0.60435486",
"0.6026932",
"0.60191035",
"0.5977977",
"0.5962583",
"0.59325624",
"0.5920112",
"0.5918962",
"0.58964217",
"0.5868676",
"0.5868405",
"0.58678216",
"0.58355385",
"0.5819651",
"0.5809564",
"0.57954353",
"0.57733387",
"0.57694864",
"0.57637185",
"0.5729059",
"0.5695383",
"0.56929654",
"0.5680074",
"0.5667684",
"0.5666158",
"0.5645681",
"0.5636634",
"0.5615673",
"0.55937403",
"0.55904263",
"0.55904263",
"0.5583903",
"0.5577917",
"0.5577367",
"0.5564025",
"0.556276",
"0.55363405",
"0.55338734",
"0.55248004",
"0.55162567",
"0.54941136",
"0.54938227",
"0.54938227",
"0.54938227",
"0.5493495",
"0.5490396",
"0.54769605",
"0.5474391",
"0.5464375",
"0.5461228",
"0.54590607",
"0.5458439",
"0.5454072",
"0.54458463",
"0.5427434"
] |
0.5647331
|
70
|
GET /evaluations/1 GET /evaluations/1.json
|
def show
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def get_eval\n\t\t@student = Student.find(params[:student_id])\n\t\t@evaluation = @student.evaluations.find(params[:eval_id])\n\t\trender json: @evaluation\n\tend",
"def show\n @evaluations = Evaluation.find(params[:id])\n end",
"def evaluations(id)\n connection.get do |req|\n req.url \"job/#{id}/evaluations\"\n end\n end",
"def show\n @score_evaluation = ScoreEvaluation.find(params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @score_evaluation }\n end\n end",
"def show\n @evaluacion = Evaluacion.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @evaluacion }\n end\n end",
"def get_evaluations\n\t\tif current_student.id.to_i == params[:id].to_i\n\t\t\t@student = Student.find(params[:id])\n\t\t\t@evaluations = @student.evaluations\n\t\tend\n\t\trender 'get_evaluations'\n\tend",
"def show\n @evaluation_criterium = EvaluationCriterium.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @evaluation_criterium }\n end\n end",
"def index\n @evaluations = Evaluation.all\n end",
"def index\n @score_evaluations = ScoreEvaluation.all\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @score_evaluations }\n end\n end",
"def index\n @evaluations = Evaluation.all\n end",
"def index\n @evaluations = Evaluation.all\n end",
"def index\n @evaluations = Evaluation.all\n end",
"def index\n @evaluations = Evaluation.all\n end",
"def index\n @evaluations = Evaluation.all\n end",
"def index\n \n @evaluation = Evaluation.find_by(user_id: params[:user_id], study_case_id: params[:study_case_id])\n\n if @evaluation.present?\n render :show\n else\n render json: nil\n end\n \n end",
"def index\n @evaluations = @course.evaluations\n end",
"def show\n @evaluation_result = EvaluationResult.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @evaluation_result }\n end\n end",
"def index\n @evaluations = @course.evaluations\n end",
"def index\n @evaluaciones = Evaluacion.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @evaluaciones }\n end\n end",
"def show\n @evaluationstatus = Evaluationstatus.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @evaluationstatus }\n end\n end",
"def index\n @evaluates = Evaluate.all\n end",
"def index\n @evaluation_results = EvaluationResult.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @evaluation_results }\n end\n end",
"def index\n @evaluations = Evaluation.all\n @evaluation = Evaluation.new\n end",
"def show\n @competency_pertenece_evaluation = CompetencyPerteneceEvaluation.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @competency_pertenece_evaluation }\n end\n end",
"def index\r\n @evaluaciones = Evaluacione.all\r\n end",
"def index\n @evals = Eval.all\n respond_with(@evals) \n end",
"def show\n @evaluable_competency = EvaluableCompetency.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @evaluable_competency }\n end\n end",
"def new\n @score_evaluation = ScoreEvaluation.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @score_evaluation }\n end\n end",
"def show\n @qc_evaluation = QcEvaluation.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @qc_evaluation }\n end\n end",
"def getEvaluations\n\t\tharness.evaluations\n\tend",
"def evaluation\n @api_v1_reservation.evaluate(evaluation_params[:comment], evaluation_params[:rating].to_i) unless @api_v1_reservation.evaluation\n render json: { success: true }, status: 200\n rescue Exception => errors\n render json: errors, status: :unprocessable_entity\n end",
"def show\r\n @evaluation = Evaluation.find(params[:id])\r\n @responses = Response.find_all_by_Evaluation_id params[:id]\r\n\r\n respond_to do |format|\r\n format.html # show.html.erb\r\n format.xml { render :xml => @evaluation }\r\n end\r\n end",
"def evaluate\n response = Quiz.find(params[:quiz_id]).evaluate(params[:questions], current_user)\n @answers = response[:answers]\n @nota = response[:grade]\n\n respond_to do |format|\n format.html { render 'evaluate' }\n end\n end",
"def show\n @rcrieval = Rcrieval.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @rcrieval }\n end\n end",
"def show\n @eval = Eval.find(params[:id])\n end",
"def new\n @evaluation_criterium = EvaluationCriterium.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @evaluation_criterium }\n end\n end",
"def index\n @evaluations = Evaluation.accessible_by(current_ability, :read)\n end",
"def new\n @evaluation = current_customer.customer_evaluations.new\n\n @evaluation.name = Evaluation.sample_evaluation.name if params[:testing]\n respond_to do |format|\n format.html # new.html.erb\n format.json {render json: @evaluation}\n end\n end",
"def index\n @tutee = Tutee.find params[:tutee_id]\n @evaluations = @tutee.evaluations.where(:status => 'Pending')\n end",
"def index\n @performance_evaluations = PerformanceEvaluation.all\n end",
"def show\n @matrix_evaluation_type = MatrixEvaluationType.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @matrix_evaluation_type }\n end\n end",
"def show\n @evaluation = Evaluation.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @evaluation }\n end\n end",
"def show\n @run = Run.find(params[:id])\n \n if @run.evaluations.length > 0\n @globalMark = 0\n @run.evaluations.each do |eval|\n @globalMark += eval.note\n end\n \n @globalMark /= @run.evaluations.length\n end\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @run }\n end\n end",
"def show\n @evaluacion_servicios = EvaluacionServicio.find(params[:id])\n end",
"def show\n @evaluation = Evaluation.find(params[:id])\n @observation = @evaluation.observation\n respond_to do |format|\n format.html { render :layout=>\"evaluation_tabs\"}\n format.json { render json: @evaluation }\n end\n end",
"def set_evaluacion\n @evaluacions = Evaluacion.find(params[:id])\n end",
"def show\n @evaluation_sheet = EvaluationSheet.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @evaluation_sheet }\n end\n end",
"def index\n @evaluos = Evaluo.all\n end",
"def index\n @course_evaluations = CourseEvaluation.all\n end",
"def index\n @project_evaluations = ProjectEvaluation.all\n end",
"def update\n if ENV[\"NEW_EVALUATION\"] == nil\n raise ActionController::RoutingError\n return\n end\n respond_to do |format|\n if @evaluation.update(evaluation_params)\n format.html { redirect_to @evaluation, notice: 'Evaluation was successfully updated.' }\n format.json { render :show, status: :ok, location: @evaluation }\n else\n format.html { render :edit }\n format.json { render json: @evaluation.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @evaluations = Evaluation.new(evaluation_params)\n\n respond_to do |format|\n if @evaluation.save\n format.html { redirect_to @evaluation, notice: 'evaluation was successfully created.' }\n format.json { render :show, status: :created, location: @evaluation }\n else\n format.html { render :new }\n format.json { render json: @evaluation.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n if @evaluation.update(evaluation_params)\n render :show, status: :ok\n else\n render json: @evaluation.errors, status: :unprocessable_entity\n end\n end",
"def index\n iterations = policy_scope(Iteration)\n render json: iterations\n end",
"def create\n @evaluation = Evaluation.new(evaluation_params)\n\n if @evaluation.save\n render :show, status: :created\n else\n render json: @evaluation.errors, status: :unprocessable_entity\n end\n end",
"def fetch_experiment(id)\n url = @base + \"experiments/#{id}.json?token=#{@token}\"\n puts url\n response = JSON.parse(RestClient.get(url))\nend",
"def completed_evaluations_list\n\t\t@student = Student.find(params[:student_id])\n\t\t@evaluations = []\n\t\tfor evaluation in @student.evaluations\n\t\t\tif evaluation.isCompleted\n\t\t\t\t@evaluations << evaluation\n\t\t\tend\n\t\tend\n\t\trender json: @evaluations\n\tend",
"def new\n @competency_pertenece_evaluation = CompetencyPerteneceEvaluation.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @competency_pertenece_evaluation }\n end\n end",
"def set_evaluacione\r\n @evaluacione = Evaluacione.find(params[:id])\r\n end",
"def new\n @qc_evaluation = QcEvaluation.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @qc_evaluation }\n end\n end",
"def index\n @expressions = Expression.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @expressions }\n end\n end",
"def set_evaluation\n @evaluation = Evaluation.find(params[:id])\n end",
"def set_evaluacion\n @evaluacion = Evaluacion.find(params[:id])\n end",
"def show\n @evaluation = Evaluation.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @evaluation }\n format.pdf { render :layout=>false }\n end\n end",
"def index\n @evaluations = current_customer.customer_evaluations.order('evaluations.id desc')\n session[:left_service_orderitem] = 'theme'\n session[:right_service_orderitem] = 'theme'\n session[:right_service_query] = ''\n\n respond_to do |format|\n format.html # index.html.erb\n format.json {render json: @evaluations}\n end\n end",
"def show\n if @employee.type.nil?\n @evaluations = @employee.evaluations.paginate(page: params[:page]).order(date: :asc).per_page(10)\n end\n end",
"def index\n @answers = Answer.where(url_params)\n if @answers.size == 1\n @answers.first!\n end\n render json: @answers\n end",
"def set_evaluation\n @evaluation = Evaluation.find(params[:id])\n end",
"def set_evaluation\n @evaluation = Evaluation.find(params[:id])\n end",
"def set_evaluation\n @evaluation = Evaluation.find(params[:id])\n end",
"def set_evaluation\n @evaluation = Evaluation.find(params[:id])\n end",
"def set_evaluation\n @evaluation = Evaluation.find(params[:id])\n end",
"def set_evaluation\n @evaluation = Evaluation.find(params[:id])\n end",
"def set_evaluation\n @evaluation = Evaluation.find(params[:id])\n end",
"def set_evaluation\n @evaluation = Evaluation.find(params[:id])\n end",
"def set_evaluation\n @evaluation = Evaluation.find(params[:id])\n end",
"def set_evaluation\n @evaluation = Evaluation.find(params[:id])\n end",
"def set_evaluation\n @evaluation = Evaluation.find(params[:id])\n end",
"def set_evaluation\n @evaluation = Evaluation.find(params[:id])\n end",
"def set_evaluation\n @evaluation = Evaluation.find(params[:id])\n end",
"def set_evaluation\n @evaluation = Evaluation.find(params[:id])\n end",
"def set_evaluation\n @evaluation = Evaluation.find(params[:id])\n end",
"def set_evaluation\n @evaluation = Evaluation.find(params[:id])\n end",
"def index\n @matrix_evaluation_types = MatrixEvaluationType.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @matrix_evaluation_types }\n end\n end",
"def create\n @evaluation = Evaluation.new(evaluation_params)\n\n respond_to do |format|\n if @evaluation.save\n format.html { redirect_to @evaluation, notice: 'Evaluation was successfully created.' }\n format.json { render action: 'show', status: :created, location: @evaluation }\n else\n format.html { render action: 'new' }\n format.json { render json: @evaluation.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @evaluation = Evaluation.new(evaluation_params)\n\n respond_to do |format|\n if @evaluation.save\n format.html { redirect_to @evaluation, notice: 'Evaluation was successfully created.' }\n format.json { render action: 'show', status: :created, location: @evaluation }\n else\n format.html { render action: 'new' }\n format.json { render json: @evaluation.errors, status: :unprocessable_entity }\n end\n end\n end",
"def show\n @scoring_method = ScoringMethod.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @scoring_method }\n end\n end",
"def create\n @evaluation = Evaluation.new(evaluation_params)\n\n respond_to do |format|\n if @evaluation.save\n format.html { redirect_to @evaluation, notice: 'Evaluation was successfully created.' }\n format.json { render :show, status: :created, location: @evaluation }\n else\n format.html { render :new }\n format.json { render json: @evaluation.errors, status: :unprocessable_entity }\n end\n end\n end",
"def show\n @evaluacione = Evaluacione.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @evaluacione }\n end\n end",
"def set_evaluation\n @evaluation = Evaluation.find(params[:id])\n end",
"def show\n @test_subject_evaluation = @test_subject.test_subject_evaluations.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @test_subject_evaluation }\n end\n end",
"def update\n respond_to do |format|\n if @evaluation.update(evaluation_params)\n format.html { redirect_to @evaluation, notice: 'Evaluation was successfully updated.' }\n format.json { render :show, status: :ok, location: @evaluation }\n else\n format.html { render :edit }\n format.json { render json: @evaluation.errors, status: :unprocessable_entity }\n end\n end\n end",
"def index\n session[:evaluation_id] = nil\n if current_user.has_role? :admin\n @evaluations = Evaluation.all\n else\n @lesson = Lesson.find(session[:lesson_id]) if session[:lesson_id]\n @evaluations = Evaluation.where(user_id: current_user.id).order(updated_at: :desc)\n end\n\n end",
"def course_complete_eval\n\t\t@student_evals = Student.find(params[:student_id]).evaluations.where('course_id = ?', params[:course_id])\n\t\t@evaluations = []\n\t\tif @student_evals != nil\n\t\t\tfor e in @student_evals\n\t\t\t\tif e.isCompleted\n\t\t\t\t\t@evaluations << e\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\t\trender json: @evaluations\n\tend",
"def new\n @evaluable_competency = EvaluableCompetency.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @evaluable_competency }\n end\n end",
"def index\n @psicologic_evaluations = PsicologicEvaluation.all\n end",
"def new\n @rcrieval = Rcrieval.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @rcrieval }\n end\n end",
"def index\n @student_goal_evaluations = StudentGoalEvaluation.all\n end",
"def set_evaluation\n @evaluation = @course.evaluations.find(params[:id])\n # @evaluation = Evaluation.find(params[:id])\n end",
"def update\n respond_to do |format|\n if @evaluation.update(evaluation_params)\n format.html { redirect_to @evaluation, notice: \"Evaluation was successfully updated.\" }\n format.json { render :show, status: :ok, location: @evaluation }\n else\n format.html { render :edit }\n format.json { render json: @evaluation.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @evaluation.update(evaluation_params)\n format.html { redirect_to @evaluation, notice: 'Evaluation was successfully updated.' }\n format.json { render :show, status: :ok, location: @evaluation }\n else\n format.html { render :edit }\n format.json { render json: @evaluation.errors, status: :unprocessable_entity }\n end\n end\n end"
] |
[
"0.77651966",
"0.6981567",
"0.69376636",
"0.68618554",
"0.68131685",
"0.673956",
"0.6719614",
"0.66970426",
"0.6682116",
"0.6674504",
"0.6674504",
"0.6674504",
"0.6674504",
"0.6674504",
"0.6662183",
"0.6624913",
"0.6612468",
"0.6604192",
"0.6585361",
"0.6463337",
"0.6439866",
"0.6418438",
"0.64081",
"0.6383968",
"0.63283354",
"0.63274026",
"0.6314842",
"0.63139963",
"0.63070405",
"0.6261652",
"0.62227035",
"0.6196579",
"0.61706907",
"0.61501515",
"0.6149359",
"0.6146265",
"0.6124738",
"0.61209923",
"0.6105141",
"0.60267425",
"0.6001848",
"0.5968201",
"0.5962146",
"0.59612155",
"0.594224",
"0.59250534",
"0.5923947",
"0.5923729",
"0.58915573",
"0.58747196",
"0.587416",
"0.5873449",
"0.5869326",
"0.5862706",
"0.5859015",
"0.5826688",
"0.5814887",
"0.58142364",
"0.58115005",
"0.5809642",
"0.57918155",
"0.5777523",
"0.5770148",
"0.57634306",
"0.57359034",
"0.5710632",
"0.57026166",
"0.57015824",
"0.57015824",
"0.57015824",
"0.57015824",
"0.57015824",
"0.57015824",
"0.57015824",
"0.57015824",
"0.57015824",
"0.57015824",
"0.57015824",
"0.57015824",
"0.57015824",
"0.57015824",
"0.57015824",
"0.57015824",
"0.5679493",
"0.56586933",
"0.56586933",
"0.56521726",
"0.5651783",
"0.56473315",
"0.5646016",
"0.5638159",
"0.5637608",
"0.5636687",
"0.56272775",
"0.5619288",
"0.5614598",
"0.5611355",
"0.5610692",
"0.56062996",
"0.56025195",
"0.56012195"
] |
0.0
|
-1
|
POST /evaluations POST /evaluations.json
|
def create
@evaluation = Evaluation.new(evaluation_params)
@evaluation.image.attach(params[:evaluation][:image])
if @evaluation.save
flash[:success] = 'Guardado correctamente'
redirect_to new_evaluation_path
else
flash[:danger] = 'Ocurrió un error'
render :new
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def create\n @evaluations = Evaluation.new(evaluation_params)\n\n respond_to do |format|\n if @evaluation.save\n format.html { redirect_to @evaluation, notice: 'evaluation was successfully created.' }\n format.json { render :show, status: :created, location: @evaluation }\n else\n format.html { render :new }\n format.json { render json: @evaluation.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @evaluation = Evaluation.new(evaluation_params)\n\n if @evaluation.save\n render :show, status: :created\n else\n render json: @evaluation.errors, status: :unprocessable_entity\n end\n end",
"def create\n @evaluation = Evaluation.new(evaluation_params)\n\n respond_to do |format|\n if @evaluation.save\n format.html { redirect_to @evaluation, notice: 'Evaluation was successfully created.' }\n format.json { render :show, status: :created, location: @evaluation }\n else\n format.html { render :new }\n format.json { render json: @evaluation.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @evaluation = Evaluation.new(evaluation_params)\n\n respond_to do |format|\n if @evaluation.save\n format.html { redirect_to @evaluation, notice: 'Evaluation was successfully created.' }\n format.json { render action: 'show', status: :created, location: @evaluation }\n else\n format.html { render action: 'new' }\n format.json { render json: @evaluation.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @evaluation = Evaluation.new(evaluation_params)\n\n respond_to do |format|\n if @evaluation.save\n format.html { redirect_to @evaluation, notice: 'Evaluation was successfully created.' }\n format.json { render action: 'show', status: :created, location: @evaluation }\n else\n format.html { render action: 'new' }\n format.json { render json: @evaluation.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\r\n @evaluation = Evaluation.new(params[:evaluation])\r\n @answers = @evaluation.responses\r\n\r\n respond_to do |format|\r\n if @evaluation.save && @answers.each{|a| a.save }.all?\r\n format.html { redirect_to(@evaluation, :notice => 'Evaluation was successfully created.') }\r\n format.xml { render :xml => @evaluation, :status => :created, :location => @evaluation }\r\n else\r\n format.html { render :action => \"new\" }\r\n format.xml { render :xml => @evaluation.errors, :status => :unprocessable_entity }\r\n end\r\n end\r\n end",
"def create\n \n \n @evaluation = @course.evaluations.new(evaluation_params)\n respond_to do |format|\n if @evaluation.save\n format.html { redirect_to course_evaluation_path(@course,@evaluation) , notice: 'La evaluación fue creada con éxito.' }\n format.json { render :show, status: :created, location: @evaluation }\n else\n format.html { render :new }\n format.json { render json: @evaluation.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @evaluation = Evaluation.new(evaluation_params)\n\n respond_to do |format|\n if @evaluation.save\n format.html { redirect_to @evaluation, notice: 'Avaliação criada.' }\n format.json { render :show, status: :created, location: @evaluation }\n else\n format.html { render :new }\n format.json { render json: @evaluation.errors, status: :unprocessable_entity }\n end\n end\n end",
"def post_evaluate(excon, body)\n excon.request(\n method: :post,\n path: '/evaluate',\n headers: { 'Content-Type' => 'application/json' },\n body: body\n )\nend",
"def create\n @evaluation = Evaluation.new(evaluation_params)\n @evaluation.collection = evaluation_params[:collection]\n \n\n respond_to do |format|\n if @evaluation.save\n format.html { redirect_to @evaluation, notice: \"Evaluation was successfully created.\" }\n format.json { render :show, status: :created, location: @evaluation }\n else\n format.html { render :new }\n format.json { render json: @evaluation.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\r\n @evaluacione = Evaluacione.new(evaluacione_params)\r\n\r\n respond_to do |format|\r\n if @evaluacione.save\r\n format.html { redirect_to @evaluacione, notice: 'Evaluacione was successfully created.' }\r\n format.json { render :show, status: :created, location: @evaluacione }\r\n else\r\n format.html { render :new }\r\n format.json { render json: @evaluacione.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end",
"def create\n \n if ENV[\"NEW_EVALUATION\"] == nil\n raise ActionController::RoutingError\n return\n end\n @entry = Entry.find(params[:id])\n @evaluation = @entry.evaluations.find_by(school_num:params[:evaluation][:school_num])\n success_flag = true\n begin \n if(@evaluation == nil)then\n \n @evaluation = Evaluation.create(evaluation_params)\n @entry.evaluations<<@evaluation\n else\n success_flag = @evaluation.update(evaluation_params)\n end\n rescue\n success_flag = false\n end\n\n if @evaluation.id == nil\n # @evaluation = Evaluation.new\n success_flag = false\n end\n respond_to do |format|\n if success_flag == true\n format.html { redirect_to @evaluation, notice: 'Evaluation was successfully created.' }\n format.json { render :show, status: :created, location: @evaluation }\n else\n format.html { redirect_to \"/evaluations/\"+params[:id].to_s + \"/new\", json: @evaluation.errors}\n format.json { render json: @evaluation.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @user_evaluation = ::UserEvaluation.new(user_evaluation_params)\n @user_evaluation.evaluation = @evaluation\n @user_evaluation.account = current_user.account\n \n if @user_evaluation.save\n render json: @user_evaluation, status: :created, \n serializer: ::Admin::Evaluation::UserEvaluationSerializer\n else\n render json: @user_evaluation.errors, status: :unprocessable_entity\n end\n end",
"def evaluation\n @api_v1_reservation.evaluate(evaluation_params[:comment], evaluation_params[:rating].to_i) unless @api_v1_reservation.evaluation\n render json: { success: true }, status: 200\n rescue Exception => errors\n render json: errors, status: :unprocessable_entity\n end",
"def create_evaluation\n @professor_form = ProfessorForm.new(professor_form_params)\n if @professor_form.save\n render json: @professor_form\n else\n render json: @professor_form.errors\n end\n end",
"def create\n @evaluation = Evaluation.new(evaluation_params)\n\n if @evaluation.save\n redirect_to action: \"index\", notice: 'Evaluation was successfully created.' \n else\n @evaluations = Evaluation.all\n\n render :new, locals: {evaluation: @evaluation, evaluations: @evaluations } \n end\n end",
"def create\n @evaluation = current_customer.customer_evaluations.new(evaluation_params)\n if params['clone'] == 'true'\n @evaluation = @evaluation.clone_last_evaluation\n @evaluation.name = params[:evaluation][:name]\n @evaluation.status = Evaluation::STATUSES.index(\"draft\")\n @evaluation.published_at = nil\n end\n\n if params[:testing] == 'true'\n @evaluation = Evaluation.sample_evaluation.clone_evaluation\n @evaluation.name = params[:evaluation][:name]\n @evaluation.status = Evaluation::STATUSES.index(\"draft\")\n @evaluation.published_at = nil\n @evaluation.distinguish_type = Evaluation::TYPES.index(:sandbox)\n end\n\n @evaluation.company_id = current_company.id\n @evaluation.customer_id = current_customer.id\n @evaluation.created_by = current_user.id\n\n respond_to do |format|\n if @evaluation.save\n @evaluation.create_default_evaluation_services if params['clone'] != 'true'\n format.html {redirect_to customer_evaluation_path(current_customer, @evaluation), notice: I18n.t('evaluations.messages.successfully_created')}\n format.json {render json: @evaluation, status: :created, location: @evaluation}\n else\n format.html {render action: \"new\"}\n format.json {render json: @evaluation.errors, status: :unprocessable_entity}\n end\n end\n end",
"def create\n @evaluation_criterium = EvaluationCriterium.new(params[:evaluation_criterium])\n\n respond_to do |format|\n if @evaluation_criterium.save\n format.html { redirect_to @evaluation_criterium, notice: 'Evaluation criterium was successfully created.' }\n format.json { render json: @evaluation_criterium, status: :created, location: @evaluation_criterium }\n else\n format.html { render action: \"new\" }\n format.json { render json: @evaluation_criterium.errors, status: :unprocessable_entity }\n end\n end\n end",
"def evaluation_params\n params.require(:evaluation).permit(:collection, :resource, :body, :result, :executor, :title, :metrics, :subject)\n end",
"def evaluation_params\n params.require(:evaluation).permit(:collection, :resource, :body, :result, :executor, :title, :metrics, :subject)\n end",
"def create\n @score_evaluation = ScoreEvaluation.new(params[:score_evaluation])\n \n respond_to do |format|\n if @score_evaluation.save\n format.html { redirect_to @score_evaluation, :notice => t('selecao_admin.flash_messages.successfully_created.', :model => @score_evaluation.class.model_name.human) }\n format.json { render :json => @score_evaluation, :status => :created, :location => @score_evaluation }\n format.js\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @score_evaluation.errors, :status => :unprocessable_entity }\n format.js\n end\n end\n end",
"def create\n @evaluation = Evaluation.new(params[:evaluation])\n\n respond_to do |format|\n if @evaluation.save\n flash[:notice] = 'Evaluation was successfully created.'\n format.html { redirect_to(@evaluation) }\n format.xml { render :xml => @evaluation, :status => :created, :location => @evaluation }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @evaluation.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def evaluation_params\n params.require(:evaluation).permit(:value, :study_case_id, :user_id)\n end",
"def create\n @eval = Eval.new(params[:eval])\n @eval.save and flash[:notice] = \"Yay! New Eval Created!\"\n respond_with(@eval)\n end",
"def create\n @competency_pertenece_evaluation = CompetencyPerteneceEvaluation.new(params[:competency_pertenece_evaluation])\n\n respond_to do |format|\n if @competency_pertenece_evaluation.save\n format.html { redirect_to @competency_pertenece_evaluation, notice: 'Competency pertenece evaluation was successfully created.' }\n format.json { render json: @competency_pertenece_evaluation, status: :created, location: @competency_pertenece_evaluation }\n else\n format.html { render action: \"new\" }\n format.json { render json: @competency_pertenece_evaluation.errors, status: :unprocessable_entity }\n end\n end\n end",
"def evaluation_params\n params.require(:evaluation).permit(:date, :time, :event, :name, :team, :parent, :email, :bodypart, :left, :right, :subjective, :visual, :palpation, :rom, :mmt, :neurological, :specialtests, :functionaltesting, :assessment, :plan, :rice, :taping, :mdreferral, :crutches, :instruction, :screen, :erreferral, :hospitalname, :notifiedparent, :whomnotified, :datetime)\n end",
"def create\n @student_goal_evaluation = StudentGoalEvaluation.new(student_goal_evaluation_params)\n\n respond_to do |format|\n if @student_goal_evaluation.save\n format.html { redirect_to root_path, notice: 'Evalueringen er gemt.' }\n format.json { render :show, status: :created, location: @student_goal_evaluation }\n else\n format.html { render :new }\n format.json { render json: @student_goal_evaluation.errors, status: :unprocessable_entity }\n end\n end\n end",
"def evaluation_params\n params.require(:evaluation).permit(:title, :approbation_grade, :date)\n end",
"def create\n @evaluate = Evaluate.new(evaluate_params)\n @evaluate.user_id= current_user.id\n @evaluate.review_id = @review.id\n\n respond_to do |format|\n if @evaluate.save\n format.html { redirect_to @review, notice: 'Evaluate was successfully created.' }\n format.json { render :show, status: :created, location: @evaluate }\n else\n format.html { render :new }\n format.json { render json: @evaluate.errors, status: :unprocessable_entity }\n end\n end\n end",
"def evaluation_params\n params.require(:evaluation).permit(:restaurant_id, :standards, :name, :message)\n end",
"def create\n # ToDo: 名前の変更\n score = params[:score]\n \n\n if @evaluation.update_attributes(score: score)\n render :show, status: :ok, location: @evaluation\n else\n render json: @evaluation.errors, status: :unprocessable_entity\n end\n end",
"def evaluation_params\n params.require(:evaluation).permit(:school_num, :evaluate1, :evaluate2, :evaluate3, :evaluate4, :comment)\n end",
"def create\n @evaluation = Evaluation.new(evaluation_params)\n @evaluation.course = @course\n respond_to do |format|\n if @evaluation.save\n format.html { redirect_to course_evaluations_url, notice: 'La evaluacion fue creada correctamente!' }\n else\n format.html { render :new }\n end\n end\n end",
"def create\n puts evaluation_params\n @evaluation = Evaluation.new(evaluation_params)\n #De aca en adelante es para lograr insertar datos en la tabla intermedia \n #La Tabla intermedia se la evaluation_question\n respond_to do |format|\n puts \"Entre al respond\"\n if @evaluation.save\n puts \"Pude guardarlo\"\n evaluation = Evaluation.last\n evaluation.update(course_id: params[:course_id])\n evaluation_id = evaluation.id\n question_ids = params[:questions]\n question_ids.each do |question_id|\n EvaluationQuestion.create(question_id: question_id, evaluation_id: evaluation_id)\n end\n format.html { redirect_to @evaluation, notice: 'La evaluación fue creada con éxito' }\n format.json { render :show, status: :created, location: @evaluation }\n else\n @question = Question.all\n @courses = Course.all\n format.html { render :new }\n format.json { render json: @evaluation.errors, status: :unprocessable_entity }\n end\n end\n end",
"def evaluation_params\n params.require(:evaluation).permit(:title, :description)\n end",
"def create\n @course_evaluation = CourseEvaluation.new(course_evaluation_params)\n\n respond_to do |format|\n if @course_evaluation.save\n format.html { redirect_to @course_evaluation, notice: 'Course evaluation was successfully created.' }\n format.json { render :show, status: :created, location: @course_evaluation }\n else\n format.html { render :new }\n format.json { render json: @course_evaluation.errors, status: :unprocessable_entity }\n end\n end\n end",
"def evaluation_params\n params.require(:evaluation).permit(:usuario_avaliado_id, :usuario_avaliador_id, :date, :done, :evaluation_model_id)\n end",
"def create\n @psicologic_evaluation = PsicologicEvaluation.new(psicologic_evaluation_params)\n\n respond_to do |format|\n if @psicologic_evaluation.save\n format.html { redirect_to @psicologic_evaluation, notice: 'Psicologic evaluation was successfully created.' }\n format.json { render :show, status: :created, location: @psicologic_evaluation }\n else\n format.html { render :new }\n format.json { render json: @psicologic_evaluation.errors, status: :unprocessable_entity }\n end\n end\n end",
"def evals_questions evaluation_id\n call_path = \"evals/questions\"\n request = {\"evaluationID\": evaluation_id}.to_json\n data = build_post_data(request)\n perform_post(build_url(call_path), data)\n end",
"def evaluation_params\n params.require(:evaluation).permit(:employee_id, :task_id, :result, :comment, :image, :date)\n end",
"def evaluations(id)\n connection.get do |req|\n req.url \"job/#{id}/evaluations\"\n end\n end",
"def create\n @evaluacione = Evaluacione.new(params[:evaluacione])\n\n respond_to do |format|\n if @evaluacione.save\n format.html { redirect_to(@evaluacione, :notice => 'Evaluacione was successfully created.') }\n format.xml { render :xml => @evaluacione, :status => :created, :location => @evaluacione }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @evaluacione.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def new\n @evaluation = current_customer.customer_evaluations.new\n\n @evaluation.name = Evaluation.sample_evaluation.name if params[:testing]\n respond_to do |format|\n format.html # new.html.erb\n format.json {render json: @evaluation}\n end\n end",
"def evaluation_params\n params.require(:evaluation).permit(:moyenne, :annee_scolaire, :matiere, :periode, :coefficient)\n end",
"def evaluation_params\n params.require(:evaluation).permit(:organization, :standard, :suitability, :funding, :assessment, :report)\n end",
"def evaluation_params\n params.permit(:evaluation, :evaluator_id, :evaluee_id, :project_id, :comment, :team_id)\n end",
"def create\n @evaluo = Evaluo.new(evaluo_params)\n\n respond_to do |format|\n if @evaluo.save\n format.html { redirect_to @evaluo, notice: 'Evaluo was successfully created.' }\n format.json { render :show, status: :created, location: @evaluo }\n else\n format.html { render :new }\n format.json { render json: @evaluo.errors, status: :unprocessable_entity }\n end\n end\n end",
"def evaluation_params\n params.require(:evaluation).permit(:candidate_id, :user_id, :attitude_id, :intention_id, :production_id, :localization_id, :comment, :boost)\n end",
"def evaluation_params\n params.require(:evaluation).permit(:score, :comment, :project_id, :team_member_id)\n end",
"def index\n @evaluations = Evaluation.all\n @evaluation = Evaluation.new\n end",
"def evaluation_params\n params.require(:evaluation).permit(:date_evaluation, :typeevaluation, :cla_id, :matiere_id, :anneeacademique_id, :user_id)\n end",
"def create\n @qc_evaluation = QcEvaluation.new(params[:qc_evaluation])\n\n respond_to do |format|\n if @qc_evaluation.save\n format.html { redirect_to @qc_evaluation, notice: 'Qc evaluation was successfully created.' }\n format.json { render json: @qc_evaluation, status: :created, location: @qc_evaluation }\n else\n format.html { render action: \"new\" }\n format.json { render json: @qc_evaluation.errors, status: :unprocessable_entity }\n end\n end\n end",
"def evaluation_params\n params.require(:evaluation).permit(:user_id, :lesson_id, :practice_id, :title, :material, :question, :answer, :your_answer, :score, :practice_score, :picture_ya, :end_at, :papertest)\n end",
"def evaluation_params\n params.require(:evaluation).permit(:objetivo, :fecha, :course_id)\n end",
"def create\n @evaluation = Evaluation.new(evaluation_params)\n if Evaluation.where('title=?', @evaluation.title).first\n @evaluation.errors[:nameexists] << \"An evaluation by that title already exists\"\n end\n\n resource = @evaluation.resource\n if (resource =~ /doi:/ or resource =~ /dx\\.doi\\.org/)\n canonicalizedDOI = resource.match(/(10.\\d{4,9}\\/[-\\._;()\\/:A-Z0-9]+$)/i)[1]\n @evaluation.resource = canonicalizedDOI\n end\n \n validate_orcid(@evaluation, @evaluation.executor) # sets an error if there was a problem\n \n respond_to do |format|\n if !@evaluation.errors.any? && @evaluation.save\n format.html { redirect_to @evaluation, notice: \"Evaluation was successfully created.\" }\n format.json { render :show, status: :created, location: @evaluation }\n else\n @collections = Collection.all\n format.html { render :new }\n format.json { render json: @evaluation.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @project_evaluation = ProjectEvaluation.new(project_evaluation_params)\n\n respond_to do |format|\n if @project_evaluation.save\n format.html { redirect_to @project_evaluation, notice: 'Project evaluation was successfully created.' }\n format.json { render :show, status: :created, location: @project_evaluation }\n else\n format.html { render :new }\n format.json { render json: @project_evaluation.errors, status: :unprocessable_entity }\n end\n end\n end",
"def evaluation_params\n params.require(:evaluation).permit(:user_id, :project_id, :comment, :rating)\n end",
"def update\n unless @submission.evaluated.blank?\n respond_to do |format|\n format.html { redirect_to test_submission_path(@test, @submission), info: \"Evaluated!\" }\n end\n return\n end\n\n unless Time.now > @timeout + 5.seconds\n @submission.answers_of_questions.each do |user_answer|\n user_answer.update(choice: submission_params.fetch(user_answer.answer_id.to_s, \"false\"))\n end\n end\n if Time.now > @timeout || params[:evaluate]\n @test.questions.each do |question|\n crrct = get_result(question)\n @submission.increment!(:point, question.point) if crrct\n @submission.question_evaluations.create({question_id: question.id, value: crrct})\n end\n @submission.update(evaluated: true)\n respond_to do |format|\n format.html { redirect_to test_submission_path(@test, @submission) }\n end\n else\n respond_to do |format|\n format.html { redirect_to submissions_path, success: 'Submission was successfully saved.' }\n end\n end\n\n end",
"def evaluate\n response = Quiz.find(params[:quiz_id]).evaluate(params[:questions], current_user)\n @answers = response[:answers]\n @nota = response[:grade]\n\n respond_to do |format|\n format.html { render 'evaluate' }\n end\n end",
"def update\n if @evaluation.update(evaluation_params)\n render :show, status: :ok\n else\n render json: @evaluation.errors, status: :unprocessable_entity\n end\n end",
"def new\n @evaluation_criterium = EvaluationCriterium.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @evaluation_criterium }\n end\n end",
"def evaluation_params\n params.require(:evaluation).permit(:course_id, :professor_id, :course_score, :teacher_score)\n end",
"def new\n @score_evaluation = ScoreEvaluation.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @score_evaluation }\n end\n end",
"def update\n if ENV[\"NEW_EVALUATION\"] == nil\n raise ActionController::RoutingError\n return\n end\n respond_to do |format|\n if @evaluation.update(evaluation_params)\n format.html { redirect_to @evaluation, notice: 'Evaluation was successfully updated.' }\n format.json { render :show, status: :ok, location: @evaluation }\n else\n format.html { render :edit }\n format.json { render json: @evaluation.errors, status: :unprocessable_entity }\n end\n end\n end",
"def evaluate_params\n params.require(:evaluate).permit(:rating, :comment)\n end",
"def create\n @employee = Employee.find(1)\n @performance_evaluation = @employee.performance_evaluations.build(performance_evaluation_params)\n #@performance_evaluation = PerformanceEvaluation.new(performance_evaluation_params)\n\n respond_to do |format|\n if @performance_evaluation.save\n format.html { redirect_to @performance_evaluation, notice: 'Performance evaluation was successfully created.' }\n format.json { render :show, status: :created, location: @performance_evaluation }\n else\n format.html { render :new }\n format.json { render json: @performance_evaluation.errors, status: :unprocessable_entity }\n end\n end\n end",
"def index\n @evaluations = Evaluation.all\n end",
"def index\n @evaluations = Evaluation.all\n end",
"def index\n @evaluations = Evaluation.all\n end",
"def index\n @evaluations = Evaluation.all\n end",
"def index\n @evaluations = Evaluation.all\n end",
"def get_eval\n\t\t@student = Student.find(params[:student_id])\n\t\t@evaluation = @student.evaluations.find(params[:eval_id])\n\t\trender json: @evaluation\n\tend",
"def create\n @evaluation = Evaluation.new(evaluation_params)\n @evaluation.project_id = params[:projectId]\n @evaluation.team_member_id = params[:teamMemberId]\n @evaluation.user_id = helpers.current_user.id\n\n respond_to do |format|\n if @evaluation.save\n format.html { redirect_to @evaluation, notice: 'Evaluation was successfully created.' }\n format.json { render :show, status: :created, location: @evaluation }\n else\n # restore relations\n if(@evaluation.project_id)\n @project = Project.find @evaluation.project_id\n end\n if(@evaluation.team_member_id)\n @member = TeamMember.find(@evaluation.team_member_id).user\n end\n\n format.html { render :new }\n format.json { render json: @evaluation.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @evaluationstatus = Evaluationstatus.new(params[:evaluationstatus])\n\n respond_to do |format|\n if @evaluationstatus.save\n format.html { redirect_to @evaluationstatus, notice: 'Evaluation status was successfully created.' }\n format.json { render json: @evaluationstatus, status: :created, location: @evaluationstatus }\n else\n format.html { render action: \"new\" }\n format.json { render json: @evaluationstatus.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @dish_evaluation = DishEvaluation.new(dish_evaluation_params)\n\n respond_to do |format|\n if @dish_evaluation.save\n format.html { redirect_to @dish_evaluation, notice: 'Dish evaluation was successfully created.' }\n format.json { render :show, status: :created, location: @dish_evaluation }\n else\n format.html { render :new }\n format.json { render json: @dish_evaluation.errors, status: :unprocessable_entity }\n end\n end\n end",
"def index\n @evaluations = Evaluation.all\n end",
"def index\n @score_evaluations = ScoreEvaluation.all\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @score_evaluations }\n end\n end",
"def create\n @anstoeval = Anstoeval.new(anstoeval_params)\n\n respond_to do |format|\n if @anstoeval.save\n format.html { redirect_to @anstoeval, notice: 'anstoeval was successfully created.' }\n format.json { render :show, status: :created, location: @anstoeval }\n else\n format.html { render :new }\n format.json { render json: @anstoeval.errors, status: :unprocessable_entity }\n end\n end\n end",
"def evaluation_params\n params.require(:evaluation).permit(:user_id, :mode)\n end",
"def create\n @restaurant_evaluation = RestaurantEvaluation.new(restaurant_evaluation_params)\n @restaurant_evaluation.user_id = current_user.id\n respond_to do |format|\n if @restaurant_evaluation.save\n format.html { redirect_to Restaurant.find_by_id(@restaurant_evaluation.restaurant_id), notice: 'Restaurant evaluation was successfully created.' }\n format.json { render :show, status: :created, location: @restaurant_evaluation }\n else\n format.html { render :new }\n format.json { render json: @restaurant_evaluation.errors, status: :unprocessable_entity }\n end\n end\n end",
"def user_evaluation_params\n params.require(:user_evaluation).permit(:evaluator_id)\n end",
"def evaluacion_params\n params.require(:evaluacion).permit(:pregunta_1, :pregunta_2, :pregunta_3, :pregunta_4, :pregunta_5, :pregunta_6, :pregunta_7, :pregunta_8, :observacion, :fecha_evaluacion, :nota, :nota_informe_practica)\n end",
"def send_evaluate_prop\n task = @proposal.evaluate_proposals.create\n task.workbench = Organization.find params[:organization][:organization_id]\n task.save\n redirect_to :action => \"pending\"\n end",
"def addEval\n #puts \"hi student being evaluatied\"\n #puts params[:evaluation][:student_evaluated]\n #@team_member = User.find_by(u_name: params[:evaluation][:student_evaluated])\n @specific_user = User.find_by(u_name: params[:evaluation][:student_evaluating])\n @current_project = Project.find_by(p_name: params[:evaluation][:project])\n\n #puts \"start11\"\n #puts @team_member.inspect\n #puts @specific_user.inspect\n #puts @current_project.inspect\n\n # Klass.create subject: 'Maths', student: bart, tutor: edna\n # object = Student.new(:name => \"a\", :age => 2)\n @evaluation = Evaluation.new(student_evaluated: params[:evaluation][:student_evaluated], content: params[:evaluation][:content], rating: params[:evaluation][:rating], user: @specific_user, project: @current_project)\n puts \"hi2\"\n puts @evaluation.inspect\n #@evaluation = Evaluation.new(student_evaluated: @team_member.u_name, content: params[:content], \n #rating: params[:rating], user: @specific_user, project: @current_project)\n if @evaluation.save\n redirect_to userSpecificProjects_url\n #format.html { redirect_to evalAndSuccess_url(@evaluation), notice: 'Evaluation was successfully created.' }\n #format.json { render :evalAddSuccess, status: :created, location: @evaluation }\n else\n redirect_to userSpecificProjects_url\n #format.html { render :ratingPage_path(:team_member => @team_member.id) }\n end\n end",
"def new\n @evaluations = Evaluation.new\n end",
"def create\n #@observation = Observation.find params[:observation_id]\n @evaluation = Evaluation.new(params[:evaluation])\n @observation = @evaluation.observation\n respond_to do |format|\n if @evaluation.save\n session.delete(:teacher_id)\n session.delete(:guarant_id)\n session.delete(:path)\n format.html { redirect_to observation_evaluation_path(@observation,@evaluation), notice: 'Hodnocení bylo úspěšně vytvořeno.' }\n format.json { render json: @evaluation, status: :created, location: @evaluation }\n else\n format.html { render action: \"new\", :layout => \"tabs\" }\n format.json { render json: @evaluation.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n if current_user.has_role? :admin\n @evaluation = Evaluation.new(evaluation_params)\n else\n @practice = Practice.find(session[:practice_id])\n @evaluation = Evaluation.new(evaluation_params)\n @evaluation.lesson_id = session[:lesson_id]\n @evaluation.user_id = current_user.id\n @evaluation.practice_id = @practice.id\n @evaluation.title = @practice.title\n @evaluation.material = @practice.material\n @evaluation.question = @practice.question\n @evaluation.answer = @practice.answer\n @evaluation.practice_score ||= @practice.score\n if session[:papertest_id]\n @papertest = Papertest.find(session[:papertest_id])\n if Time.now < @papertest.end_at\n @evaluation.end_at = @papertest.end_at\n @evaluation.papertest_id = @papertest.id\n else\n session[:papertest_id] = nil\n redirect_to paper_url(@papertest.paper_id), notice: \"考试已结束!\"\n return\n end\n end\n end\n respond_to do |format|\n if @evaluation.save\n if @practice.answer.gsub(/(<(\\w|\\/)+[^>]*>|\\s)/, \"\") == @evaluation.your_answer.gsub(/(<(\\w|\\/)+[^>]*>|\\s)/, \"\") # 如果答对了\n @justice = Justice.create!(\n user_id: 1,\n evaluation_user_id: @evaluation.user_id,\n practice_id: @evaluation.practice_id,\n\t evaluation_id: @evaluation.id,\n\t score: @evaluation.practice_score, # 得到满分\n\t p_score: @evaluation.practice_score,\n remark: \"完全正确!\",\n )\n @evaluation.update(score: @evaluation.practice_score)\n end\n format.html { redirect_to @evaluation, notice: '答案提交成功' }\n format.json { render :show, status: :created, location: @evaluation }\n else\n format.html { render :new }\n format.json { render json: @evaluation.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @evaluation = Evaluation.new(evaluation_params)\n\n if @evaluation.save\n flash[:success] = 'Evaluación creada con éxito.'\n if @evaluation.is_a? Course and params[:areas]\n params[:areas].each do |a|\n\n area = Area.find a\n area.inscriptions.preinscrito.each do |pr|\n pr.evaluation_id = @evaluation.id\n pr.save\n end\n\n @evaluation.area_courses.create(area_id: a)\n end\n end\n else\n flash[:danger] = \"Error: #{@evaluation.errors.full_messages.to_sentence}\"\n end\n\n redirect_back fallback_location: \"#{evaluations_path}?#{@evaluation.type}=true\"\n\n end",
"def create\n @evaluation = Evaluation.new(evaluation_params)\n @evaluation.group_id = params[:group_id]\n @evaluation.student_id = current_student.id\n respond_to do |format|\n if @evaluation.save\n format.html { redirect_to student_dashboard_path, notice: 'Evaluation was successfully created.' }\n format.json { render :show, status: :created, location: student_dashboard_path }\n else\n format.html { render :new }\n format.json { render json: @evaluation.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n @competency_pertenece_evaluation = CompetencyPerteneceEvaluation.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @competency_pertenece_evaluation }\n end\n end",
"def create\n @pacient = Pacient.find(params[:pacient_id])\n @evaluare = @pacient.evaluares.create(params[:evaluare])\n\n respond_to do |format|\n if @evaluare.save\n format.html { redirect_to @pacient, notice: 'Evaluare was successfully created.' }\n format.json { render json: @evaluare, status: :created, location: @evaluare }\n else\n format.html { render action: \"new\" }\n format.json { render json: @evaluare.errors, status: :unprocessable_entity }\n end\n end\n end",
"def completed_evaluations_list\n\t\t@student = Student.find(params[:student_id])\n\t\t@evaluations = []\n\t\tfor evaluation in @student.evaluations\n\t\t\tif evaluation.isCompleted\n\t\t\t\t@evaluations << evaluation\n\t\t\tend\n\t\tend\n\t\trender json: @evaluations\n\tend",
"def create\n @evaluation_result = current_evaluation.evaluation_results.new(evaluation_result_params)\n @evaluation_result.created = current_user\n @evaluation_result.updated_by = current_user.id\n @evaluation_result.company_branch_ids = params[\"evaluation_result\"][\"evaluation_result_company_branches\"].reject!{ |c| !c.present? }\n\n if params[:links].present? and params[:links].is_a?(Array)\n @evaluation_result.links = params[:links][1..-1].select(&:present?)\n end\n\n respond_to do |format|\n if @evaluation_result.save\n track_evaluation_update\n\n format.html { redirect_to customer_evaluation_path(current_customer, current_evaluation), notice: I18n.t('evaluation_results.messages.successfully_created') }\n format.json { render json: @evaluation_result, status: :created, location: @evaluation_result }\n else\n format.html { render action: :new }\n format.json { render json: @evaluation_result.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @evaluacion_servicio = EvaluacionServicio.new(evaluacion_servicio_params)\n \n respond_to do |format|\n if @evaluacion_servicio.save\n format.html { redirect_to servicio_sociales_path, notice: 'Evaluacion servicio was successfully created.' }\n format.json { render :show, status: :created, location: @evaluacion_servicio }\n else\n format.html { render :new }\n format.json { render json: @evaluacion_servicio.errors, status: :unprocessable_entity }\n end\n end\n end",
"def evaluacione_params\r\n params.require(:evaluacione).permit(:contestada, :curso_id, :encuesta_id, :nombre)\r\n end",
"def index\n @evaluates = Evaluate.all\n end",
"def update\n @response_to_the_evaluation = ResponseToTheEvaluation.find(params[:id])\n @response_to_the_evaluation.save\n respond_to do |format|\n if @response_to_the_evaluation.save\n format.json\n format.js\n end\n end\n end",
"def update\n respond_to do |format|\n if @evaluation.update(evaluation_params)\n format.html { redirect_to @evaluation, notice: 'La evaluación fue actualizada correctamente' }\n format.json { render :show, status: :ok, location: @evaluation }\n else\n format.html { render :edit }\n format.json { render json: @evaluation.errors, status: :unprocessable_entity }\n end\n end\n end",
"def index\n @evaluaciones = Evaluacion.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @evaluaciones }\n end\n end",
"def evaluate(id)\n connection.post do |req|\n req.url \"job/#{id}/evaluate\"\n end\n end",
"def create\n @current_student = Student.find_by(id: session[:student_id]) # ADDED THIS BUT NOT DONE\n # Get the two params then add the rest later? Still need to figure out how to get evaluee id\n @evaluation = Evaluation.new(evaluation_params)\n if @evaluation.save\n flash[:success] = \"Evaluation submitted\"\n redirect_to student_evaluation_path\n else\n flash[:warning] = \"Could not submit\"\n redirect_to student_evaluation_path\n end\n end"
] |
[
"0.7273974",
"0.70637333",
"0.69349927",
"0.6858234",
"0.6858234",
"0.6789653",
"0.67693055",
"0.6732888",
"0.6721708",
"0.66040987",
"0.6552739",
"0.6520129",
"0.64986",
"0.6492909",
"0.64158195",
"0.6408603",
"0.63761246",
"0.6324832",
"0.63137615",
"0.63137615",
"0.6295575",
"0.6277479",
"0.62640053",
"0.6252639",
"0.61895406",
"0.61878484",
"0.6182659",
"0.61731935",
"0.6157265",
"0.61422485",
"0.6108931",
"0.6097073",
"0.60879403",
"0.60830396",
"0.6081391",
"0.60725105",
"0.6060356",
"0.6056718",
"0.6048866",
"0.60442495",
"0.604424",
"0.60336435",
"0.6033484",
"0.60329705",
"0.6017782",
"0.6016468",
"0.6004926",
"0.6000799",
"0.5974908",
"0.59723276",
"0.5956593",
"0.5925222",
"0.59174913",
"0.5914246",
"0.590798",
"0.5907554",
"0.58920383",
"0.588781",
"0.5883795",
"0.58749986",
"0.58689237",
"0.5862783",
"0.5858798",
"0.5844147",
"0.5836803",
"0.5830056",
"0.5828253",
"0.5828253",
"0.5828253",
"0.5828253",
"0.5828253",
"0.5825644",
"0.58101255",
"0.5805122",
"0.5796112",
"0.57953316",
"0.5792183",
"0.578321",
"0.57771474",
"0.5773397",
"0.57646596",
"0.57620525",
"0.5731663",
"0.5718036",
"0.5716851",
"0.5699499",
"0.56916785",
"0.5690932",
"0.56813836",
"0.56693166",
"0.5658556",
"0.5657261",
"0.56486505",
"0.56478906",
"0.56372607",
"0.5632514",
"0.561434",
"0.5613847",
"0.5607543",
"0.56044555",
"0.5596483"
] |
0.0
|
-1
|
PATCH/PUT /evaluations/1 PATCH/PUT /evaluations/1.json
|
def update
if @evaluation.update(evaluation_params)
flash[:success] = 'Actualizado correctamente'
redirect_to evaluations_url
else
flash[:danger] = 'Ocurrió un error'
render :edit
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def update\n respond_to do |format|\n if @evaluation.update(evaluation_params)\n format.html { redirect_to @evaluation, notice: 'Evaluation was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @evaluation.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @evaluation.update(evaluation_params)\n format.html { redirect_to @evaluation, notice: 'Evaluation was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @evaluation.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n if ENV[\"NEW_EVALUATION\"] == nil\n raise ActionController::RoutingError\n return\n end\n respond_to do |format|\n if @evaluation.update(evaluation_params)\n format.html { redirect_to @evaluation, notice: 'Evaluation was successfully updated.' }\n format.json { render :show, status: :ok, location: @evaluation }\n else\n format.html { render :edit }\n format.json { render json: @evaluation.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @evaluacion = Evaluacion.find(params[:id])\n\n respond_to do |format|\n if @evaluacion.update_attributes(params[:evaluacion])\n format.html { redirect_to @evaluacion, notice: 'Evaluacion was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @evaluacion.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @evaluation = Evaluation.find(params[:id])\n\n respond_to do |format|\n if @evaluation.update_attributes(params[:evaluation])\n format.html { redirect_to @evaluation, notice: 'Avaliacao atualizada com sucesso.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @evaluation.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @evaluation.update(evaluation_params)\n format.html { redirect_to @evaluation, notice: \"Evaluation was successfully updated.\" }\n format.json { render :show, status: :ok, location: @evaluation }\n else\n format.html { render :edit }\n format.json { render json: @evaluation.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @evaluation.update(evaluation_params)\n format.html { redirect_to @evaluation, notice: 'Evaluation was successfully updated.' }\n format.json { render :show, status: :ok, location: @evaluation }\n else\n format.html { render :edit }\n format.json { render json: @evaluation.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @evaluation.update(evaluation_params)\n format.html { redirect_to @evaluation, notice: 'Evaluation was successfully updated.' }\n format.json { render :show, status: :ok, location: @evaluation }\n else\n format.html { render :edit }\n format.json { render json: @evaluation.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @evaluation.update(evaluation_params)\n format.html { redirect_to @evaluation, notice: 'Evaluation was successfully updated.' }\n format.json { render :show, status: :ok, location: @evaluation }\n else\n format.html { render :edit }\n format.json { render json: @evaluation.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n if @evaluation.update(evaluation_params)\n render :show, status: :ok\n else\n render json: @evaluation.errors, status: :unprocessable_entity\n end\n end",
"def update\n respond_to do |format|\n if @evaluate.update(evaluate_params)\n format.html { redirect_to @evaluate, notice: 'Evaluate was successfully updated.' }\n format.json { render :show, status: :ok, location: @evaluate }\n else\n format.html { render :edit }\n format.json { render json: @evaluate.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @evaluation.update(evaluation_params)\n format.html { redirect_to @evaluation, notice: 'Evaluation was successfully updated.' }\n format.json { render :show, status: :ok, location: @evaluation }\n else\n format.html { render :edit }\n format.json { render json: @evaluation.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @evaluation.update(evaluation_params)\n format.html { redirect_to @evaluation, notice: 'La evaluación fue actualizada correctamente' }\n format.json { render :show, status: :ok, location: @evaluation }\n else\n format.html { render :edit }\n format.json { render json: @evaluation.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @eval = Eval.find(params[:id])\n if @eval.update_attributes(params[:eval])\n flash[:notice] = \"Eval was successfully updated.\"\n respond_with(@eval)\n else\n respond_with(@eval.errors)\n end\n end",
"def update\n respond_to do |format|\n if @evaluation.update(evaluation_params)\n format.html { redirect_to @evaluation, notice: 'Avaliação atualizada.' }\n format.json { render :show, status: :ok, location: @evaluation }\n else\n format.html { render :edit }\n format.json { render json: @evaluation.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @evaluation.update(evaluation_params)\n format.html { redirect_to result_url(@evaluation), notice: \"\" }\n format.json { redirect_to result_url(@evaluation) }\n #else\n # format.html { render :edit }\n # format.json { render json: @evaluation.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @evaluation_criterium = EvaluationCriterium.find(params[:id])\n\n respond_to do |format|\n if @evaluation_criterium.update_attributes(params[:evaluation_criterium])\n format.html { redirect_to @evaluation_criterium, notice: 'Evaluation criterium was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @evaluation_criterium.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @evaluation = Evaluation.find(params[:id])\n\n respond_to do |format|\n if @evaluation.update_attributes(params[:evaluation])\n format.html { redirect_to(@evaluation, :notice => 'Evaluation was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @evaluation.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\r\n respond_to do |format|\r\n if @evaluacione.update(evaluacione_params)\r\n format.html { redirect_to @evaluacione, notice: 'Evaluacione was successfully updated.' }\r\n format.json { render :show, status: :ok, location: @evaluacione }\r\n else\r\n format.html { render :edit }\r\n format.json { render json: @evaluacione.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end",
"def update\n @evaluation.updated_by = current_user.id\n\n respond_to do |format|\n if @evaluation.update_attributes(evaluation_params)\n format.html {redirect_to customer_evaluation_path(current_customer, @evaluation), notice: I18n.t('evaluations.messages.successfully_updated')}\n format.json {head :no_content}\n else\n format.html {render action: \"edit\"}\n format.json {render json: @evaluation.errors, status: :unprocessable_entity}\n end\n end\n end",
"def update\n respond_to do |format|\n if @evaluation.update(evaluation_params)\n format.html { redirect_to course_evaluations_url, notice: 'La evaluación fue modificada correctamente!' }\n else\n format.html { render :edit }\n end\n end\n end",
"def update\n respond_to do |format|\n if @evaluo.update(evaluo_params)\n format.html { redirect_to @evaluo, notice: 'Evaluo was successfully updated.' }\n format.json { render :show, status: :ok, location: @evaluo }\n else\n format.html { render :edit }\n format.json { render json: @evaluo.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @evaluation_builder.update(evaluation_builder_params)\n format.html { redirect_to @evaluation_builder, notice: 'Evaluation builder was successfully updated.' }\n format.json { render :show, status: :ok, location: @evaluation_builder }\n else\n format.html { render :edit }\n format.json { render json: @evaluation_builder.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @evaluationstatus = Evaluationstatus.find(params[:id])\n\n respond_to do |format|\n if @evaluationstatus.update_attributes(params[:evaluationstatus])\n format.html { redirect_to @evaluationstatus, notice: 'Evaluation status was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @evaluationstatus.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @evaluare = Evaluare.find(params[:id])\n\n respond_to do |format|\n if @evaluare.update_attributes(params[:evaluare])\n format.html { redirect_to @evaluare, notice: 'Evaluare was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @evaluare.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @evaluation = Evaluation.find(params[:id])\n\n respond_to do |format|\n if @evaluation.update_attributes(params[:evaluation])\n flash[:notice] = 'Evaluation was successfully updated.'\n format.html { redirect_to(@evaluation) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @evaluation.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @response_to_the_evaluation = ResponseToTheEvaluation.find(params[:id])\n @response_to_the_evaluation.save\n respond_to do |format|\n if @response_to_the_evaluation.save\n format.json\n format.js\n end\n end\n end",
"def update\n @evaluacione = Evaluacione.find(params[:id])\n\n respond_to do |format|\n if @evaluacione.update_attributes(params[:evaluacione])\n format.html { redirect_to(@evaluacione, :notice => 'Evaluacione was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @evaluacione.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @anstoeval.update(anstoeval_params)\n format.html { redirect_to @anstoeval, notice: 'anstoeval was successfully updated.' }\n format.json { render :show, status: :ok, location: @anstoeval }\n else\n format.html { render :edit }\n format.json { render json: @anstoeval.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @performance_evaluation.update(performance_evaluation_params)\n format.html { redirect_to @performance_evaluation, notice: 'Performance evaluation was successfully updated.' }\n format.json { render :show, status: :ok, location: @performance_evaluation }\n else\n format.html { render :edit }\n format.json { render json: @performance_evaluation.errors, status: :unprocessable_entity }\n end\n end\n end",
"def patch!\n request! :patch\n end",
"def update\n respond_to do |format|\n if @psicologic_evaluation.update(psicologic_evaluation_params)\n format.html { redirect_to @psicologic_evaluation, notice: 'Psicologic evaluation was successfully updated.' }\n format.json { render :show, status: :ok, location: @psicologic_evaluation }\n else\n format.html { render :edit }\n format.json { render json: @psicologic_evaluation.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @qc_evaluation = QcEvaluation.find(params[:id])\n\n respond_to do |format|\n if @qc_evaluation.update_attributes(params[:qc_evaluation])\n format.html { redirect_to @qc_evaluation, notice: 'Qc evaluation was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @qc_evaluation.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @evaluation = Evaluation.find(params[:id])\n @observation = @evaluation.observation\n \n respond_to do |format|\n if @evaluation.update_attributes(params[:evaluation])\n session.delete(:teacher_id)\n session.delete(:guarant_id)\n session.delete(:path)\n format.html { redirect_to evaluation_path(@evaluation), notice: 'Hodnocení bylo úspěšně upraveno.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\", :layout => \"evaluation_tabs\" }\n format.json { render json: @evaluation.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @evaluacion_servicio.update(evaluacion_servicio_params)\n format.html { redirect_to @evaluacion_servicio, notice: 'Evaluacion servicio was successfully updated.' }\n format.json { render :show, status: :ok, location: @evaluacion_servicio }\n else\n format.html { render :edit }\n format.json { render json: @evaluacion_servicio.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n if @pe.update(update_project_evaluation_params)\n render json: @pe, status: :ok\n else\n render json: format_errors(@pe.errors), status: :unprocessable_entity\n end\n end",
"def update\n @rcrieval = Rcrieval.find(params[:id])\n\n respond_to do |format|\n if @rcrieval.update_attributes(params[:rcrieval])\n format.html { redirect_to @rcrieval, notice: 'Rcrieval was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @rcrieval.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @competency_pertenece_evaluation = CompetencyPerteneceEvaluation.find(params[:id])\n\n respond_to do |format|\n if @competency_pertenece_evaluation.update_attributes(params[:competency_pertenece_evaluation])\n format.html { redirect_to @competency_pertenece_evaluation, notice: 'Competency pertenece evaluation was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @competency_pertenece_evaluation.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @course_evaluation.update(course_evaluation_params)\n format.html { redirect_to @course_evaluation, notice: 'Course evaluation was successfully updated.' }\n format.json { render :show, status: :ok, location: @course_evaluation }\n else\n format.html { render :edit }\n format.json { render json: @course_evaluation.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n if @evaluation.update(evaluation_params)\n redirect_to action: \"index\", notice: 'Evaluation was successfully updated.' \n else\n render :edit \n end\n end",
"def update\n @expectation = Expectation.find(params[:id])\n\n respond_to do |format|\n if @expectation.update_attributes(params[:expectation])\n format.html { redirect_to @expectation, notice: 'Expectation was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @expectation.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update!(**args)\n @model_evaluations = args[:model_evaluations] if args.key?(:model_evaluations)\n @next_page_token = args[:next_page_token] if args.key?(:next_page_token)\n end",
"def update # PATCH\n raise NotImplementedError\n end",
"def update\n respond_to do |format|\n if @student_goal_evaluation.update(student_goal_evaluation_params)\n format.html { redirect_to root_path, notice: 'Evalueringen er opdateret.' }\n format.json { render :show, status: :ok, location: @student_goal_evaluation }\n else\n format.html { render :edit }\n format.json { render json: @student_goal_evaluation.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @evaluation_sheet = EvaluationSheet.find(params[:id])\n\n respond_to do |format|\n if @evaluation_sheet.update_attributes(params[:evaluation_sheet])\n format.html { redirect_to @evaluation_sheet, notice: 'Evaluation sheet was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @evaluation_sheet.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n authorize! :update, @theorem\n if @theorem.update(theorem_params)\n render json: @theorem, status: :ok, location: @theorem\n else\n render json: @theorem.errors, status: :unprocessable_entity\n end\n end",
"def update\n respond_to do |format|\n if @expression.update_attributes expression_params\n format.html { redirect_to @expression, notice: 'Expression was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @expression.errors, status: :unprocessable_entity }\n end\n end\n end",
"def patch\n headers = {\"If-Match\" => @version}\n response = @context.request :patch, \"#{@path}/#{@id}\", @data.to_json, headers\n @version += 1\n response\n # 'X-HTTP-Method-Override' => 'PATCH'\n end",
"def update\n respond_to do |format|\n \n if @evaluation.update(evaluation_params)\n if params[:evaluation][:grades_attributes].present?\n @evaluation.set_grade=true\n @evaluation.save\n end\n format.html { redirect_to course_evaluation_path(@course,@evaluation), notice: 'La evaluación fue actualizada con éxito.' }\n format.json { render :show, status: :ok, location: @evaluation }\n else\n if params[:evaluation][:grades_attributes].present?\n format.html { render :show }\n format.json { render json: @evaluation.errors, status: :unprocessable_entity }\n else\n format.html { render :edit }\n format.json { render json: @evaluation.errors, status: :unprocessable_entity }\n end\n end\n end\n end",
"def update\n respond_to do |format|\n if @project_evaluation.update(project_evaluation_params)\n format.html { redirect_to @project_evaluation, notice: 'Project evaluation was successfully updated.' }\n format.json { render :show, status: :ok, location: @project_evaluation }\n else\n format.html { render :edit }\n format.json { render json: @project_evaluation.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n render_json_auto @survey.update_logic_control_rule(params[:id].to_i, params[:logic]) and return\n end",
"def update\n respond_to do |format|\n if @restaurant_evaluation.update(restaurant_evaluation_params)\n format.html { redirect_to @restaurant_evaluation, notice: 'Restaurant evaluation was successfully updated.' }\n format.json { render :show, status: :ok, location: @restaurant_evaluation }\n else\n format.html { render :edit }\n format.json { render json: @restaurant_evaluation.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @survey = Survey.find(params[:id])\n json = params[:survey]\n json[:questions] = JSON.parse(json[:questions])\n json[:questions].each_with_index do |question, idx|\n json[:questions][idx]['id'] = idx + 1\n end\n\n respond_to do |format|\n if @survey.update_attributes(json)\n format.html { redirect_to @survey, notice: 'Survey was successfully updated.' }\n format.json { render json: @survey }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @survey.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @evaluable_competency = EvaluableCompetency.find(params[:id])\n\n respond_to do |format|\n if @evaluable_competency.update_attributes(params[:evaluable_competency])\n format.html { redirect_to @evaluable_competency, :notice => t('successfully_updated', :model => t('EvaluableCompetency.gender', :count => 1)) }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @evaluable_competency.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @test_subject_evaluation = @test_subject.test_subject_evaluations.find(params[:id])\n\n #Check if symptoms and past_medical is empty\n if !params.has_key?(:symptoms)\n @test_subject_evaluation.symptoms = []\n end\n if !params.has_key?(:past_medical)\n @test_subject_evaluation.past_medical = []\n end\n\n respond_to do |format|\n if @test_subject_evaluation.update_attributes(params[:test_subject_evaluation])\n flash[:notice] = \"#{TestSubject.title} Evaluation was successfully updated.\"\n format.html { redirect_to(test_subject_test_subject_evaluation_url(@test_subject, @test_subject_evaluation)) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @test_subject_evaluation.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @review = Review.find(params[:id])\n @review.update(review_params)\n render json: @review\n end",
"def update\n unless @submission.evaluated.blank?\n respond_to do |format|\n format.html { redirect_to test_submission_path(@test, @submission), info: \"Evaluated!\" }\n end\n return\n end\n\n unless Time.now > @timeout + 5.seconds\n @submission.answers_of_questions.each do |user_answer|\n user_answer.update(choice: submission_params.fetch(user_answer.answer_id.to_s, \"false\"))\n end\n end\n if Time.now > @timeout || params[:evaluate]\n @test.questions.each do |question|\n crrct = get_result(question)\n @submission.increment!(:point, question.point) if crrct\n @submission.question_evaluations.create({question_id: question.id, value: crrct})\n end\n @submission.update(evaluated: true)\n respond_to do |format|\n format.html { redirect_to test_submission_path(@test, @submission) }\n end\n else\n respond_to do |format|\n format.html { redirect_to submissions_path, success: 'Submission was successfully saved.' }\n end\n end\n\n end",
"def update\n @predict = Predict.find(params[:id])\n\n respond_to do |format|\n if @predict.update_attributes(params[:predict])\n format.html { redirect_to @predict, notice: 'Predict was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @predict.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n put :update\n end",
"def update\n if @review.update(review_params)\n render json: @review\n else\n render json: @review.errors, status: :unprocessable_entity\n end\nend",
"def update\n @specification = Specification.find(params[:id])\n\n respond_to do |format|\n if @specification.update_attributes(params[:specification])\n format.html { redirect_to @specification, notice: 'Specification was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @specification.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n #raise params.inspect\n @evaluation_result = EvaluationResult.find(params[:id])\n\n if params[:commit].to_s == \"Gravar Rascunho\"\n app = Appointment.find(params[:appoint_id].to_i)\n s = AppointmentStatus.find_by_name(\"Em Avaliacao\")\n app.appointment_status = s\n app.save\n else\n app = Appointment.find(params[:appoint_id].to_i)\n s = AppointmentStatus.find_by_name(\"Realizada\")\n app.appointment_status = s\n app.save\n end\n\n respond_to do |format|\n if @evaluation_result.update_attributes(params[:evaluation_result])\n if params[:commit].to_s == \"Gravar Rascunho\"\n format.html { redirect_to appointments_path, notice: 'Resultados da avaliacao guardados com sucesso.' }\n else\n format.html { redirect_to \"http://localhost:8000/reporting?report=Avaliacao&Appointment_Id=#{params[:appoint_id].to_s}\", notice: 'Resultados da avaliacao guardados com sucesso.' }\n end\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @evaluation_result.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @dish_evaluation.update(dish_evaluation_params)\n format.html { redirect_to @dish_evaluation, notice: 'Dish evaluation was successfully updated.' }\n format.json { render :show, status: :ok, location: @dish_evaluation }\n else\n format.html { render :edit }\n format.json { render json: @dish_evaluation.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @matrix_evaluation_type = MatrixEvaluationType.find(params[:id])\n\n respond_to do |format|\n if @matrix_evaluation_type.update_attributes(params[:matrix_evaluation_type])\n format.html { redirect_to @matrix_evaluation_type, :notice => 'Avaliação de Matriz atualizada com sucesso.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @matrix_evaluation_type.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @experiment = Experiment.find(params[:id])\n\n respond_to do |format|\n if @experiment.update_attributes(params[:experiment])\n format.html { redirect_to @experiment, notice: 'Experiment was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @experiment.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @experiment = Experiment.find(params[:id])\n\n respond_to do |format|\n if @experiment.update_attributes(params[:experiment])\n format.html { redirect_to @experiment, notice: 'Experiment was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @experiment.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @experiment = Experiment.find(params[:id])\n\n respond_to do |format|\n if @experiment.update_attributes(params[:experiment])\n format.html { redirect_to @experiment, notice: 'experiment was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @experiment.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n authorize! :edit, @questionnaire\n\n @questionnaire.load_JSON(params[:questionnaire], current_user)\n\n respond_to do |format|\n# if @questionnaire.update_attributes(params[:questionnaire])\n format.html { redirect_to @questionnaire, notice: 'Kysymyslomakkeen muokkaaminen onnistui.' }\n format.json { head :no_content }\n# else\n# format.html { render action: \"edit\" }\n# format.json { render json: @questionnaire.errors, status: :unprocessable_entity }\n# end\n\n end\n end",
"def update\n respond_to do |format|\n if @diff_expr.update(diff_expr_params)\n format.html { redirect_to @diff_expr, notice: 'Diff expr was successfully updated.' }\n format.json { render :show, status: :ok, location: @diff_expr }\n else\n format.html { render :edit }\n format.json { render json: @diff_expr.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @criterio_evalucion_servicio.update(criterio_evalucion_servicio_params)\n format.html { redirect_to @criterio_evalucion_servicio, notice: 'Criterio evalucion servicio was successfully updated.' }\n format.json { render :show, status: :ok, location: @criterio_evalucion_servicio }\n else\n format.html { render :edit }\n format.json { render json: @criterio_evalucion_servicio.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @calculation = Calculation.find(params[:id])\n\n respond_to do |format|\n if @calculation.update_attributes(params[:calculation])\n format.html { redirect_to @calculation, notice: 'Calculation was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @calculation.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\r\n @calculation = Calculation.find(params[:id])\r\n\r\n respond_to do |format|\r\n if @calculation.update_attributes(params[:calculation])\r\n format.html { redirect_to @calculation, notice: 'Calculation updated.' }\r\n format.json { head :no_content }\r\n else\r\n format.html { render action: \"edit\" }\r\n format.json { render json: @calculation.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end",
"def update\n respond_to do |format|\n if @question_learned.update(question_learned_params)\n format.html { redirect_to @question_learned, notice: 'Question learned was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @question_learned.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update(&block)\n validate_request()\n\n # Params includes all of the PATCH data at the top level along with other\n # other Rails-injected params like 'id', 'action', 'controller'. These\n # are harmless given no namespace collision and we're only interested in\n # the 'Operations' key for the actual patch data.\n #\n render(json: yield(self.safe_params()[:id], self.safe_params().to_hash()))\n end",
"def update\n if @specification.update(specification_params)\n audit(@specification, current_user)\n render json: @specification, status: :ok, serializer: Web::V1::SpecificationSerializer\n else\n render json: @specification.errors, status: :unprocessable_entity\n end\n end",
"def update\n if @v1_question.update(v1_question_params)\n render json: @v1_question, status: :ok\n else\n render json: get_errors, status: :unprocessable_entity\n end\n end",
"def update\n respond_to do |format|\n if @api_v1_exercise.update(api_v1_exercise_params)\n format.html { redirect_to @api_v1_exercise, notice: 'Exercise was successfully updated.' }\n format.json { render :show, status: :ok, location: @api_v1_exercise }\n else\n format.html { render :edit }\n format.json { render json: @api_v1_exercise.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @calculation.update(calculation_params)\n format.html { redirect_to calculation_path(@calculation, token: @calculation.edit_token) }\n format.json { render :show, status: :ok, location: @calculation }\n else\n format.html { render :edit }\n format.json { render json: @calculation.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @api_v1_outcome.update(api_v1_outcome_params)\n format.html { redirect_to @api_v1_outcome, notice: 'Outcome was successfully updated.' }\n format.json { render :show, status: :ok, location: @api_v1_outcome }\n else\n format.html { render :edit }\n format.json { render json: @api_v1_outcome.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @score_evaluation = ScoreEvaluation.find(params[:id])\n params[:score_evaluation][:discipline_ids] ||= []\n \n respond_to do |format|\n if @score_evaluation.update_attributes(params[:score_evaluation])\n format.html { redirect_to @score_evaluation, :notice => t('selecao_admin.flash_messages.successfully_updated', :model => @score_evaluation.class.model_name.human) }\n format.json { head :no_content }\n format.js\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @score_evaluation.errors, :status => :unprocessable_entity }\n format.js\n end\n end\n end",
"def update\n respond_to do |format|\n if @expression_of_interest.update(expression_of_interest_params)\n format.html { redirect_to @expression_of_interest, notice: 'Expression of interest was successfully updated.' }\n format.json { render :show, status: :ok, location: @expression_of_interest }\n else\n format.html { render :edit }\n format.json { render json: @expression_of_interest.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @answer = Answer.find(params[:id])\n\n if @answer.update(answer_params)\n head :no_content\n else\n render json: @answer.errors, status: :unprocessable_entity\n end\n end",
"def update\n #debugger\n if @enrollment.update(update_params)\n head :no_content\n else\n render json: @enrollment.errors, status: :unprocessable_entity\n end\n end",
"def update\n @request.assign_json_attributes(params) if @request.resume?\n respond_to do |format|\n if @request.update(request_params)\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 recipe.update(recipe_params)\n render json: recipe\n end",
"def update\n @criterion = Criterion.find(params[:id])\n\n if @criterion.update_attributes(params[:criterion])\n head :no_content\n else\n render json: @criterion.errors, status: :unprocessable_entity\n end\n end",
"def update\n respond_to do |format|\n if @exam.update(exam_params)\n format.html { redirect_to @exam, notice: 'Exam was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @exam.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @grade_calc.update(grade_calc_params)\n format.html { redirect_to @grade_calc, notice: 'Grade calc was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @grade_calc.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update!(**args)\n @model_evaluation = args[:model_evaluation] if args.key?(:model_evaluation)\n end",
"def update\n @scoring_method = ScoringMethod.find(params[:id])\n\n respond_to do |format|\n if @scoring_method.update_attributes(params[:scoring_method])\n format.html { redirect_to @scoring_method, notice: 'Scoring method was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @scoring_method.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n # @person = Person.find(params[:id])\n # @person.pct_complete = @person.requirement_progress\n respond_to do |format|\n if @person.update_attributes(params[:person])\n format.html { redirect_to @person, :notice => 'Person was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @person.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @formula.update(formula_params)\n format.html { redirect_to @formula, notice: 'Formula was successfully updated.' }\n format.json { render :show, status: :ok, location: @formula }\n else\n format.html { render :edit }\n format.json { render json: @formula.errors, status: :unprocessable_entity }\n end\n end\n end",
"def patch(path, data)\n request 'PATCH', path, body: data.to_json\n end",
"def update\n official = Official.find(params[:id])\n if official.update(official_params)\n render json: official, status: 200, location: [:api, official]\n else\n failed_to_update(official, \"official\")\n end\n end",
"def update_rest\n @entry_answer = EntryAnswer.find(params[:id])\n\n respond_to do |format|\n if @entry_answer.update_attributes(params[:entry_answer])\n flash[:notice] = 'EntryAnswer was successfully updated.'\n format.html { redirect_to(@entry_answer) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @entry_answer.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @testing_algorithm = TestingAlgorithm.find(params[:id])\n\n if @testing_algorithm.update(params[:testing_algorithm])\n head :no_content\n else\n render json : @testing_algorithm.errors, status : :unprocessable_entity\n end\n end",
"def update\n @exam = Exam.find(params[:id])\n\n respond_to do |format|\n if @exam.update_attributes(params[:exam])\n format.html { redirect_to exams_path, notice: 'Exam was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @exam.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @exp = Exp.find(params[:id])\n\n respond_to do |format|\n if @exp.update_attributes(params[:exp])\n format.html { redirect_to @exp, notice: 'Successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @exp.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @survey_choice = Survey::Choice.find(params[:id])\n\n respond_to do |format|\n if @survey_choice.update_attributes(params[:survey_choice])\n format.html { redirect_to @survey_choice, notice: 'Choice was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @survey_choice.errors, status: :unprocessable_entity }\n5 end\n end\n end",
"def update\n p = trial_params.clone\n if p[\"question_ids\"].nil?\n p[\"question_ids\"] = []\n end\n\n respond_to do |format|\n if @trial.update(p)\n format.html { redirect_to @trial, notice: 'Trial was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @trial.errors, status: :unprocessable_entity }\n end\n end\n end"
] |
[
"0.6757246",
"0.6757246",
"0.6750583",
"0.6687858",
"0.6585219",
"0.6557403",
"0.65512615",
"0.65512615",
"0.65512615",
"0.651603",
"0.65159357",
"0.64533395",
"0.64481455",
"0.6440528",
"0.6433122",
"0.64252967",
"0.63648576",
"0.63292396",
"0.63099295",
"0.62969625",
"0.6281699",
"0.6273121",
"0.6256495",
"0.623422",
"0.62232566",
"0.62140673",
"0.61978817",
"0.6183347",
"0.61638236",
"0.61347395",
"0.61167186",
"0.6111564",
"0.60962224",
"0.60748625",
"0.60717946",
"0.6070116",
"0.6055109",
"0.6046485",
"0.6031903",
"0.60295683",
"0.59821486",
"0.5977016",
"0.59758157",
"0.59709567",
"0.59685344",
"0.596798",
"0.59523994",
"0.59446883",
"0.5943445",
"0.5898821",
"0.5891829",
"0.5869189",
"0.5862096",
"0.58236104",
"0.5820641",
"0.5819503",
"0.57993823",
"0.5796372",
"0.5795002",
"0.5792075",
"0.57843024",
"0.57747483",
"0.57745206",
"0.5768951",
"0.57620746",
"0.57620746",
"0.5754793",
"0.57540023",
"0.57519525",
"0.57347715",
"0.57295024",
"0.5725384",
"0.57223755",
"0.57184374",
"0.5711665",
"0.5711501",
"0.57108206",
"0.5710341",
"0.5709145",
"0.5707604",
"0.57058513",
"0.569984",
"0.5693887",
"0.5691908",
"0.5691094",
"0.5689975",
"0.568732",
"0.56858903",
"0.5685574",
"0.56840855",
"0.5663017",
"0.5658385",
"0.56559056",
"0.56531847",
"0.5651867",
"0.565065",
"0.5645141",
"0.56451035",
"0.5637709",
"0.5633221"
] |
0.6026098
|
40
|
DELETE /evaluations/1 DELETE /evaluations/1.json
|
def destroy
@evaluation.destroy
flash[:success] = 'Eliminado correctamente'
redirect_to evaluations_url
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def destroy\n @evaluation.destroy\n respond_to do |format|\n format.html { redirect_to evaluations_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @evaluation.destroy\n respond_to do |format|\n format.html { redirect_to evaluations_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @evaluacion = Evaluacion.find(params[:id])\n @evaluacion.destroy\n\n respond_to do |format|\n format.html { redirect_to evaluaciones_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @evaluation = Evaluation.find(params[:id])\n @evaluation.destroy\n\n respond_to do |format|\n format.html { redirect_to evaluations_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @evaluation.destroy\n respond_to do |format|\n format.html { redirect_to evaluations_url, notice: 'La evaluación fue eliminada satisfactoriamente' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @evaluation.destroy\n respond_to do |format|\n format.html { redirect_to evaluations_url, notice: 'evaluation was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @evaluation.destroy\n respond_to do |format|\n format.html { redirect_to evaluations_url, notice: 'Evaluation was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @evaluation.destroy\n respond_to do |format|\n format.html { redirect_to evaluations_url, notice: 'Evaluation was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @evaluation.destroy\n respond_to do |format|\n format.html { redirect_to evaluations_url, notice: 'Evaluation was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @evaluation.destroy\n respond_to do |format|\n format.html { redirect_to evaluations_url, notice: 'Evaluation was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @evaluation.destroy\n respond_to do |format|\n format.html { redirect_to evaluations_url, notice: 'Evaluation was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @evaluation.destroy\n respond_to do |format|\n format.html { redirect_to evaluations_url, notice: 'Evaluation was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @evaluation.destroy\n respond_to do |format|\n format.html { redirect_to evaluations_url, notice: 'Avaliação deletada.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n entry = @evaluation.entry\n @evaluation.destroy\n respond_to do |format|\n format.html { redirect_to evaluations_url, notice: 'Evaluation was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @evaluation_criterium = EvaluationCriterium.find(params[:id])\n @evaluation_criterium.destroy\n\n respond_to do |format|\n format.html { redirect_to evaluation_criteria_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @evaluation = Evaluation.find(params[:id])\n @evaluation.destroy\n\n respond_to do |format|\n format.html { redirect_to(evaluations_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @evaluation = Evaluation.find(params[:id])\n @evaluation.destroy\n\n respond_to do |format|\n format.html { redirect_to(evaluations_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @evaluare = Evaluare.find(params[:id])\n @evaluare.destroy\n\n respond_to do |format|\n format.html { redirect_to evaluares_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @qc_evaluation = QcEvaluation.find(params[:id])\n @qc_evaluation.destroy\n\n respond_to do |format|\n format.html { redirect_to qc_evaluations_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @evaluate.destroy\n respond_to do |format|\n format.html { redirect_to evaluates_url, notice: 'Evaluate was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\r\n @evaluation = Evaluation.find(params[:id])\r\n @evaluation.destroy\r\n\r\n respond_to do |format|\r\n format.html { redirect_to(evaluations_url) }\r\n format.xml { head :ok }\r\n end\r\n end",
"def destroy\n @evaluationstatus = Evaluationstatus.find(params[:id])\n @evaluationstatus.destroy\n\n respond_to do |format|\n format.html { redirect_to evaluationstatuses_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @evaluacione = Evaluacione.find(params[:id])\n @evaluacione.destroy\n\n respond_to do |format|\n format.html { redirect_to(evaluaciones_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @evaluation_result = EvaluationResult.find(params[:id])\n @evaluation_result.destroy\n\n respond_to do |format|\n format.html { redirect_to evaluation_results_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @evaluation.destroy\n respond_to do |format|\n format.html { redirect_to evaluations_url, notice: 'Evaluation was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @rcrieval = Rcrieval.find(params[:id])\n @rcrieval.destroy\n\n respond_to do |format|\n format.html { redirect_to rcrievals_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @evaluator.destroy\n\n respond_to do |format|\n format.html { redirect_to(evaluators_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\r\n @evaluacione.destroy\r\n respond_to do |format|\r\n format.html { redirect_to evaluaciones_url, notice: 'Evaluacione was successfully destroyed.' }\r\n format.json { head :no_content }\r\n end\r\n end",
"def destroy\n @evaluo.destroy\n respond_to do |format|\n format.html { redirect_to evaluos_url, notice: 'Evaluo was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @competency_pertenece_evaluation = CompetencyPerteneceEvaluation.find(params[:id])\n @competency_pertenece_evaluation.destroy\n\n respond_to do |format|\n format.html { redirect_to competency_pertenece_evaluations_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @student_goal_evaluation.destroy\n respond_to do |format|\n format.html { redirect_to student_goal_evaluations_url, notice: 'Evalueringen er slettet.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @eval = Eval.find(params[:id])\n @eval.destroy\n redirect_to(evals_url)\n end",
"def destroy\n @test_subject_evaluation = @test_subject.test_subject_evaluations.find(params[:id])\n @test_subject_evaluation.destroy\n\n respond_to do |format|\n format.html { redirect_to(test_subject_test_subject_evaluations_url(@test_subject)) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @performance_evaluation.destroy\n respond_to do |format|\n format.html { redirect_to performance_evaluations_url, notice: 'Performance evaluation was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @evaluable_competency = EvaluableCompetency.find(params[:id])\n @evaluable_competency.destroy\n\n respond_to do |format|\n format.html { redirect_to evaluable_competencies_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @evaluation.destroy\n respond_to do |format|\n format.html { redirect_to course_evaluations_url, notice: 'La evaluación fue eliminada correctamente!' }\n end\n end",
"def destroy\n respond_to do |format|\n if @evaluation.destroy\n format.html { redirect_to course_evaluations_path(@course), notice: 'La evaluación fue eliminada con éxito.' }\n format.json { head :no_content }\n else\n format.html { render :show }\n format.json { render json: @evaluation.errors, status: :unprocessable_entity }\n end\n end\n end",
"def destroy\n @anstoeval.destroy\n respond_to do |format|\n format.html { redirect_to anstoevals_url, notice: 'anstoeval was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @score_evaluation = ScoreEvaluation.find(params[:id])\n @score_evaluation.destroy\n \n respond_to do |format|\n format.html { redirect_to score_evaluations_url }\n format.json { head :no_content }\n format.js\n end\n end",
"def destroy\n @evaluation.destroy\n respond_to do |format|\n format.html { redirect_to evaluations_url, notice: '答题记录已被删除' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @restaurant_evaluation.destroy\n respond_to do |format|\n format.html { redirect_to restaurant_evaluations_url, notice: 'Restaurant evaluation was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @psicologic_evaluation.destroy\n respond_to do |format|\n format.html { redirect_to psicologic_evaluations_url, notice: 'Psicologic evaluation was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @course_evaluation.destroy\n respond_to do |format|\n format.html { redirect_to course_evaluations_url, notice: 'Course evaluation was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @evaluation_builder.destroy\n respond_to do |format|\n format.html { redirect_to event_evaluation_builders_url(@event), notice: 'Evaluation builder was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @dish_evaluation.destroy\n respond_to do |format|\n format.html { redirect_to dish_evaluations_url, notice: 'Dish evaluation was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @expression.destroy\n respond_to do |format|\n format.html { redirect_to expressions_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @evaluation.destroy\n\n respond_to do |format|\n format.html {redirect_to customer_path(current_customer)}\n format.json {head :no_content}\n end\n end",
"def destroy\n @evaluation.destroy\n end",
"def destroy\n @project_evaluation.destroy\n respond_to do |format|\n format.html { redirect_to project_evaluations_url, notice: 'Project evaluation was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @evaluation.destroy\n redirect_to action: \"index\", notice: 'Evaluation was successfully destroyed.' \n end",
"def deleteExecution(execution_id)\n uri = URI(RUNDECKSERVER + ':' + RUNDECKPORT + '/api/12/execution/' + execution_id)\n http = Net::HTTP.new(uri.host, uri.port)\n headers = {'Content-Type'=> 'application/jsonr','X-RunDeck-Auth-Token'=> API_KEY }\n r = http.delete(uri.path, headers) \n return r\nend",
"def destroy\n @expectation = Expectation.find(params[:id])\n @expectation.destroy\n\n respond_to do |format|\n format.html { redirect_to expectations_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @evaluacion_servicio.destroy\n respond_to do |format|\n format.html { redirect_to evaluacion_servicios_url, notice: 'Evaluacion servicio was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def test_del\n header 'Content-Type', 'application/json'\n\n data = File.read 'sample-traces/0.json'\n post('/traces', data, 'CONTENT_TYPE': 'application/json')\n\n id = last_response.body\n\n delete \"/traces/#{id}\"\n assert last_response.ok?\n\n get \"/traces/#{id}\"\n\n contents = JSON.parse last_response.body\n assert_kind_of(Hash, contents, 'Response contents is not a hash')\n assert contents.key? 'description'\n assert(!last_response.ok?)\n end",
"def destroy\n @exercise_execution.destroy\n respond_to do |format|\n format.html { redirect_to exercise_executions_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @expectation = RiGse::Expectation.find(params[:id])\n @expectation.destroy\n\n respond_to do |format|\n format.html { redirect_to(expectations_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @exp = Exp.find(params[:id])\n @exp.destroy\n\n respond_to do |format|\n format.html { redirect_to exps_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @estimation.destroy\n respond_to do |format|\n format.html { redirect_to estimations_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @evaluation_sheet = EvaluationSheet.find(params[:id])\n @evaluation_sheet.destroy\n\n respond_to do |format|\n format.html { redirect_to evaluation_sheets_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @assumption.destroy\n respond_to do |format|\n format.html { redirect_to assumptions_url }\n format.json { head :no_content }\n end\n end",
"def delete!\n Recliner.delete(uri)\n end",
"def destroy\n @assertion.destroy\n respond_to do |format|\n format.html { redirect_to assertions_url, notice: 'Assertion was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @explaination = Explaination.find(params[:id])\n @explaination.destroy\n\n respond_to do |format|\n format.html { redirect_to explainations_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @accuracy = Accuracy.find(params[:id])\n @accuracy.destroy\n\n respond_to do |format|\n format.html { redirect_to accuracies_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @calculated_data_assessment = CalculatedDataAssessment.find(params[:id])\n @calculated_data_assessment.destroy\n\n respond_to do |format|\n format.html { redirect_to calculated_data_assessments_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @weekly_expectation = WeeklyExpectation.find(params[:id])\n @weekly_expectation.destroy\n\n respond_to do |format|\n format.html { redirect_to weekly_expectations_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @matrix_evaluation_type = MatrixEvaluationType.find(params[:id])\n @matrix_evaluation_type.destroy\n\n respond_to do |format|\n format.html { redirect_to matrix_evaluation_types_url, :notice => 'Avaliação de Matriz excluída com sucesso.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @expression_relationship = ExpressionRelationship.find(params[:id])\n @expression_relationship.destroy\n\n respond_to do |format|\n format.html { redirect_to expression_relationships_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @policy_valuation.destroy\n respond_to do |format|\n format.html { redirect_to policy_valuations_url, notice: 'Policy valuation was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @rh.destroy\n respond_to do |format|\n format.html { redirect_to rhs_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @evaluate_course = EvaluateCourse.find(params[:id])\n @evaluate_course.destroy\n\n respond_to do |format|\n format.html { redirect_to(evaluate_courses_url) }\n format.xml { head :ok }\n end\n end",
"def delete path\n make_request(path, \"delete\", {})\n end",
"def destroy\n @criterion = Criterion.find(params[:id])\n @criterion.destroy\n\n respond_to do |format|\n format.html { redirect_to criteria_url }\n format.json { head :no_content }\n end\n end",
"def delete\n request(:delete)\n end",
"def destroy\n @retroaspecto = Retroaspecto.find(params[:id])\n @retroaspecto.destroy\n\n respond_to do |format|\n format.html { redirect_to retroaspectos_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @predicate = Predicate.find(params[:id])\n @predicate.destroy\n\n respond_to do |format|\n format.html { redirect_to predicates_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @criterion_grade.destroy\n respond_to do |format|\n format.html { redirect_to criterion_grades_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n render_json_auto @survey.delete_logic_control_rule(params[:id].to_i) and return\n end",
"def destroy\n render_json_auto @survey.delete_filter(params[:id].to_i) and return\n end",
"def destroy\n @assert = Assert.find(params[:id])\n @assert.destroy\n\n respond_to do |format|\n format.html { redirect_to asserts_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @analyst_score.destroy\n respond_to do |format|\n format.html { redirect_to analyst_scores_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @enrollment.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end",
"def destroy\n @criterio_evalucion_servicio.destroy\n respond_to do |format|\n format.html { redirect_to criterio_evalucion_servicios_url, notice: 'Criterio evalucion servicio was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @predict = Predict.find(params[:id])\n @predict.destroy\n\n respond_to do |format|\n format.html { redirect_to predicts_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @experiment = Experiment.find(params[:id])\n @experiment.destroy\n\n respond_to do |format|\n format.html { redirect_to experiments_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @experiment = Experiment.find(params[:id])\n @experiment.destroy\n\n respond_to do |format|\n format.html { redirect_to experiments_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @experiment = Experiment.find(params[:id])\n @experiment.destroy\n\n respond_to do |format|\n format.html { redirect_to experiments_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @expression = Expression.find(params[:id])\n @expression.destroy\n\n respond_to do |format|\n format.html { redirect_to(expressions_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @rule.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end",
"def destroy\n @assert = Assert.find(params[:id])\n @assert.destroy\n\n respond_to do |format|\n format.html { redirect_to asserts_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @exam.destroy\n respond_to do |format|\n format.html { redirect_to exams_url }\n format.json { head :no_content }\n end\n end",
"def delete(name)\n raise('wrong type: String required') unless name.is_a?(String)\n raise('wrong value: name must be valid') unless !name.nil? && !name.empty?\n\n @client.post({\n 'action' => 'del',\n 'object' => 'htpl',\n 'values' => name,\n }.to_json)\n end",
"def destroy\n set_experiments\n @experiment.destroy\n respond_to do |format|\n format.html { redirect_to experiments_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @exam = Exam.find(params[:id])\n @exam.destroy\n\n respond_to do |format|\n format.html { redirect_to exams_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @requisition = Requisition.find(params[:id])\n @requisition.destroy\n\n respond_to do |format|\n format.html { redirect_to requisitions_url }\n format.json { head :no_content }\n end\n end",
"def delete\n client.delete(\"/#{id}\")\n end",
"def destroy\n @student_evaluation_case2.destroy\n respond_to do |format|\n format.html { redirect_to student_evaluation_case2s_url, notice: 'Student evaluation case2 was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @api_v1_outcome.destroy\n respond_to do |format|\n format.html { redirect_to api_v1_outcomes_url, notice: 'Outcome was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @formula.destroy\n respond_to do |format|\n format.html { redirect_to formulas_url, notice: 'Formula was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @criterium.destroy\n respond_to do |format|\n format.html { redirect_to criteria_url, notice: 'Criterium was successfully destroyed.' }\n format.json { head :no_content }\n end\n end"
] |
[
"0.7424398",
"0.7424398",
"0.74239624",
"0.7418971",
"0.71991944",
"0.71984005",
"0.7196096",
"0.7196096",
"0.7196096",
"0.7196096",
"0.7196096",
"0.7196096",
"0.7175757",
"0.71084785",
"0.707799",
"0.70726866",
"0.70726866",
"0.70583737",
"0.7045507",
"0.7034911",
"0.7001618",
"0.6989519",
"0.6980124",
"0.69706184",
"0.69396126",
"0.6934573",
"0.6931936",
"0.6919734",
"0.69118416",
"0.6869156",
"0.6852159",
"0.6843499",
"0.6832182",
"0.68126875",
"0.67937106",
"0.67629766",
"0.67534566",
"0.673234",
"0.6714534",
"0.6712898",
"0.67096704",
"0.66927516",
"0.6651952",
"0.6642102",
"0.6639231",
"0.66310483",
"0.6612732",
"0.6565487",
"0.65466756",
"0.65349054",
"0.6534555",
"0.65113026",
"0.65015423",
"0.6484896",
"0.6471664",
"0.6461054",
"0.64543676",
"0.6395296",
"0.6390541",
"0.63796234",
"0.63761985",
"0.63546276",
"0.6354478",
"0.63498104",
"0.6349689",
"0.6346973",
"0.63418484",
"0.6328654",
"0.6325087",
"0.6323059",
"0.6320074",
"0.6319457",
"0.63190436",
"0.6313495",
"0.63124466",
"0.6311663",
"0.6309388",
"0.6304786",
"0.62931824",
"0.62863916",
"0.6283693",
"0.62827563",
"0.62824994",
"0.6281507",
"0.62784725",
"0.62784725",
"0.62784725",
"0.6278297",
"0.62764066",
"0.625911",
"0.62580216",
"0.62542355",
"0.6248337",
"0.6243087",
"0.62416077",
"0.62394506",
"0.6238158",
"0.62357277",
"0.6235218",
"0.6223894"
] |
0.66127187
|
47
|
Use callbacks to share common setup or constraints between actions.
|
def set_evaluation
@evaluation = Evaluation.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 evaluation_params
params.require(:evaluation).permit(:employee_id, :task_id, :result, :comment, :image, :date)
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def strong_params\n params.require(:user).permit(param_whitelist)\n end",
"def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end",
"def allow_params_authentication!; end",
"def allowed_params\n ALLOWED_PARAMS\n end",
"def default_param_whitelist\n [\"mode\"]\n end",
"def param_whitelist\n [:role, :title]\n end",
"def expected_permitted_parameter_names; end",
"def safe_params\n params.except(:host, :port, :protocol).permit!\n end",
"def strong_params\n params.require(:team_member).permit(param_whitelist)\n end",
"def permitir_parametros\n \t\tparams.permit!\n \tend",
"def strong_params\n params.require(:community).permit(param_whitelist)\n end",
"def permitted_strong_parameters\n :all #or an array of parameters, example: [:name, :email]\n end",
"def strong_params\n params.require(:education).permit(param_whitelist)\n end",
"def restricted_params\n #params.require(self.controller_name.classify.underscore.to_sym).permit([])\n raise(\"No strong params set, override restricted_params method in your controller. E.g. params.require(:model).permit(:attribute1, :attribute2)\")\n end",
"def allowed_params\n params.require(:user).permit(:username, :email, :password, :password_confirmation)\n end",
"def param_whitelist\n [:rating, :review]\n end",
"def param_whitelist\n whitelist = [\n :username, :name,\n :parent_id,\n :headline, :description, :video,\n :policy, :signup_mode, :category,\n :website, :facebook, :twitter, :linkedin,\n :founded_at,\n privacy: [\n :events,\n :resources\n ],\n permission: [\n :profile,\n :members,\n :children,\n :statistics,\n :posts,\n :listings,\n :resources,\n :events\n ],\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:parent_id)\n unless current_user.role_in(@community) === 'owner'\n whitelist.delete(:privacy)\n whitelist.delete(:permission)\n end\n end\n \n whitelist\n end",
"def param_whitelist\n if @user.present? && current_user != @user\n return [:followed]\n end\n \n whitelist = [\n :username, :email, :password,\n :first_name, :last_name,\n :birthday, :gender,\n :headline, :biography, :ask_about, :focus,\n :website, :facebook, :linkedin, :twitter, :github,\n roles: [],\n skills: [],\n interests: [],\n privacy: { contact: [] },\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:email)\n whitelist.delete(:password)\n end\n \n whitelist\n end",
"def user_params \n \tparams.require(:user).permit(:name, :email, :password, :password_confirmation)# preventing CSTR\n end",
"def user_params\n params.permit(:name, :phoneNumber, :address, :postalCode, :local, :link, :counter, :latitude, :longitude) \n end",
"def valid_params_request?; end",
"def strong_params\n params.require(:experience).permit(param_whitelist)\n end",
"def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end",
"def whitelist_url_params\n params.require(:whitelist_url).permit(:domain)\n end",
"def allowed_params\n params.require(:allowed).permit(:email)\n end",
"def permitted_params\n []\n end",
"def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end",
"def safe_params\n params.permit(:id, :name, :origin, :emails => []); #emails is an array\n end",
"def query_param\n\t\tparams.permit(:first_name, :last_name, :phone)\n\tend",
"def strong_params\n params.require(:success_metric).permit(param_whitelist)\n end",
"def devise_filter\r\n logger.debug(\"In devise_filter =>PARAMS: #{params.inspect}\")\r\n\r\n # White list for sign_up\r\n devise_parameter_sanitizer.for(:sign_up) { |u| u.permit(user_whitelist) }\r\n\r\n # White list for account update\r\n devise_parameter_sanitizer.for(:account_update) { |u| u.permit(user_whitelist, :current_password) }\r\n\r\n # White list for Invitation creation\r\n devise_parameter_sanitizer.for(:invite) { |u| u.permit(:account_type, :email, :invitation_token)}\r\n\r\n # White list for accept invitation\r\n devise_parameter_sanitizer.for(:accept_invitation) { |u| u.permit(user_whitelist, :invitation_token)}\r\n\r\n end",
"def whitelisted_user_params\n params.require(:user).\n permit( :first_name, :last_name, :email,:password,:password_confirmation,:birthday,:gender)\n end",
"def user_params\n ActionController::Parameters.permit_all_parameters = true\n params.require(:user) #.permit(:name, :surname, :phone, :password, :email, :time_zone)\n end",
"def strong_params\n params.require(:metric_change).permit(param_whitelist)\n end",
"def safe_params\n params.require(:user).permit(:name)\n end",
"def get_params\n\t\treturn ActionController::Parameters.new(self.attributes).permit(\"account_id\", \"title\", \"category\", \"introduction\", \"tags\", \"segment_type\", \"visible\", \"status\", \"main_image\")\n\tend",
"def grant_params\n @whitelisted = params.require(:grant).permit(:name, :description, :agency_id, :acronym)\n end",
"def check_params; true; end",
"def param_whitelist\n whitelist = [\n :description,\n :progress,\n :kpi_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:kpi_id)\n end\n \n whitelist\n end",
"def quote_params\n params.permit!\n end",
"def valid_params?; end",
"def paramunold_params\n params.require(:paramunold).permit!\n end",
"def user_params\n\t\tparams.permit(:nickname, :avatar, :description, :password, :gender, :birthday, :email, :phone, :qq_id, :wechat_id)\n\tend",
"def filtered_parameters; end",
"def user_params\n params.permit(\n \t:id,\n \t:email, \n \t:first_name, \n \t:last_name, \n \t:password, \n \t:confirm_token, \n \t:phone_number,\n \t:facebook_link,\n \t:car_model,\n \t:license_plate)\n end",
"def filtering_params\n params.permit(:email, :name)\n end",
"def check_params\n true\n end",
"def wx_public_params\n params.require(:wx_public).permit(:nickname, :manager, :alias)\n end",
"def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end",
"def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end",
"def listing_params\n\t\tparams.permit(:address, :transit_info, :rules, :other_info, :lat, :lng)\n\tend",
"def social_account_params\n\t\t\tparams.require(:social_account).permit!\n\t\tend",
"def safe_params\n resurce_name = self.class.resource_name\n params_method_name = \"#{resurce_name}_params\".to_sym\n if params[resurce_name]\n if respond_to?(params_method_name) || private_methods.include?(params_method_name)\n send(params_method_name)\n else\n raise ActiveModel::ForbiddenAttributesError, \"Please, define the '#{params_method_name}' method in #{self.class.name}\"\n end\n end\n end",
"def url_params\n params.require(:url).permit(:short_url, :original_url, :clicks, :ip_addresses)\n end",
"def user_params\n params.require(:user).permit(:uri, :username, :password, :realname, :email, :publicvisible)\n end",
"def model_params\n\t\tparams.require(:manager).permit(\n\t :user_name,\n :password,\n :email,\n \t\t\t)\n\tend",
"def article_params_whitelist\n params.require(:article).permit(:title, :description, category_ids: [])\n end",
"def college_whitelist_params\n params.require(:college_whitelist).permit(:status)\n end",
"def active_code_params\n params[:active_code].permit\n end",
"def filtering_params\n params.permit(:email)\n end",
"def valid_params(params)\n params.permit(:user_id, :photo_id, :originX, :originY, :width, :height)\n end",
"def ip_address_params\n\t\t\tparams.require(:ip_address).permit!\n end",
"def pull_request_params\n whitelist = [\n :url,\n :id,\n :html_url,\n :diff_url,\n :patch_url,\n :issue_url,\n :number,\n :state,\n :locked,\n :title\n ]\n params.require(:pull_request).permit(whitelist)\n end",
"def reserved_params\n params.require(:reserved).permit(:name, :email, :pax, :address, :KTP, :title)\n end",
"def post_params\n if current_user.admin? \n params.permit(:title, :body, :city, :country, :gps_location, :privacy, :visible, :latitude, :longitude, images: [], files: [])\n else \n params.permit(:title, :body, :city, :country, :gps_location, :privacy,:latitude, :longitude, images: [], files: [])\n end \n end",
"def list_params\n params.permit(:name)\n end",
"def filter_parameters; end",
"def filter_parameters; end",
"def vineyard_params\n params.permit(:vineyard_name, :email, :website_url, :phone, :address, :city, :region, :postcode, :country, :specialty, :description, :pet_friendly, :holiday, :tours, :events, :family_friendly, :cover_image, :image_one, :image_two, :image_three, :image_four, :user_id, :base64)\n end",
"def available_activity_params\n # params.require(:available_activity).permit(:type,:geometry,:properties)\n whitelisted = ActionController::Parameters.new({\n type: params.require(:available_activity)[:type],\n geometry: params.require(:available_activity)[:geometry].try(:permit!).to_h,\n properties: params.require(:available_activity)[:properties].try(:permit!).to_h\n }).try(:permit!)\n end",
"def user_params\n params.permit(:name, :username, :email, :password, :img_url, :bg_url, :coinbank)\n end",
"def user_params_pub\n\t \tparams[:user].permit(:hruid)\n\t end",
"def user_params\n params.permit(:id, :email, :password, :nickname, :status, :avatar, :flat_picture, :flatsharing_id, :member,\n :user, :color, :solde)\n end",
"def validate_search_inputs\n @whitelisted = params.fetch(:user, nil)\n if @whitelisted.blank?\n render_error(400, \"#{I18n.t('general_error.params_missing_key')}\": [I18n.t('general_error.params_missing_value', model: \"review\")])\n return\n else\n @whitelisted = @whitelisted.permit(:name, :uen, :description)\n end\n end",
"def param_whitelist\n [\n :title,\n :description,\n :organization,\n :team_id,\n :started_at,\n :finished_at,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n end",
"def url_whitelist; end",
"def admin_social_network_params\n params.require(:social_network).permit!\n end",
"def filter_params\n params.require(:filters).permit(:letters)\n end",
"def origin_params\n params.permit(:country, :state, :city, :postal_code, :address, :description)\n end",
"def valid_params(params)\n params.permit(:login, :first_name, :last_name, \n :password, :password_confirmation)\n end",
"def sensitive_params=(params)\n @sensitive_params = params\n end",
"def permit_request_params\n params.permit(:address)\n end",
"def user_params\n # Ensure a user can't give themselves admin priveleges\n params.delete(:admin) if current_user.admin?\n params.require(:user).permit(:name, :email, :admin, :image)\n end",
"def secure_params\n params.require(:location).permit(:name)\n end",
"def strong_params\n params.require( :setting ).\n permit( :global_scan_limit, :per_user_scan_limit,\n :target_whitelist_patterns, :target_blacklist_patterns )\n end",
"def question_params\n params.require(:survey_question).permit(question_whitelist)\n end",
"def case_insensitive_params\n params.require(:case_insensitive).permit(:name)\n end",
"def empire_master_no_match_params\n params.require(:empire_master_no_match).permit(:uid, :last_name, :list, :search_date, :double, :source)\n end",
"def maintenance_request_params\n params[:maintenance_request].permit! #allow all parameters for now\n end",
"def unwanted_params\n params.require(:unwanted).permit(:title, :description, :image)\n end",
"def url_params\n params[:url].permit(:full)\n end",
"def backend_user_params\n params.permit!\n end",
"def filter_params\n\t\treturn params[:candidate].permit(:name_for_filter)\n\tend",
"def speed_measurement_params\n\n #fuckit, to lazy to deal with permit crap right now\n ActionController::Parameters.permit_all_parameters = true\n\n params[:speed_measurement]\n end",
"def user_params\n params.permit(:name, :age, :username, :display_photo, :password)\n end",
"def get_params\r\n #params.require(:article).permit(:title, :permalink, :content, :source_site, :introtext, :type_id, :order_by, :searchable, :created_by, :edited_by, :published_by, :published_on, :user_id)\r\n params.require(:article).permit!\r\n\r\n end",
"def pub_params\n params.require(:pub).permit(:name, :description, :phone, :email, :hidden, :city_id, :address)\n end",
"def pass_params\n params[:pass].permit(:name, :price, :description, :colour, :events)\n end",
"def droptraining_params\n params.permit(:training_id,:user_id, :utf8, :authenticity_token, :commit)\n end",
"def person_params\n # params whitelist does *not* include admin, sub, remember_token\n # TBD: share this whitelist with the list used by configuration_permitted_parameters\n # TBD: should current_password be on this list? -- for now, leaving off, since it seems to work without\n # NOTE: do not include 'admin' in this list!\n params.require(:person).permit(\n :name, \n :email, \n :description,\n :password, \n :password_confirmation\n )\n end",
"def parameter_params\n params.require(:parameter).permit(:name, :description, :param_code, :param_value, :active_from, :active_to)\n end"
] |
[
"0.69792545",
"0.6781151",
"0.67419964",
"0.674013",
"0.6734356",
"0.6591046",
"0.6502396",
"0.6496313",
"0.6480641",
"0.6477825",
"0.64565",
"0.6438387",
"0.63791263",
"0.63740575",
"0.6364131",
"0.63192815",
"0.62991166",
"0.62978333",
"0.6292148",
"0.6290449",
"0.6290076",
"0.62894756",
"0.6283177",
"0.6242471",
"0.62382483",
"0.6217549",
"0.6214457",
"0.6209053",
"0.6193042",
"0.6177802",
"0.6174604",
"0.61714715",
"0.6161512",
"0.6151757",
"0.6150663",
"0.61461",
"0.61213595",
"0.611406",
"0.6106206",
"0.6105114",
"0.6089039",
"0.6081015",
"0.6071004",
"0.60620916",
"0.6019971",
"0.601788",
"0.6011056",
"0.6010898",
"0.6005122",
"0.6005122",
"0.6001556",
"0.6001049",
"0.59943926",
"0.5992201",
"0.59909594",
"0.5990628",
"0.5980841",
"0.59669393",
"0.59589154",
"0.5958826",
"0.5957911",
"0.5957385",
"0.5953072",
"0.59526145",
"0.5943361",
"0.59386164",
"0.59375334",
"0.59375334",
"0.5933856",
"0.59292704",
"0.59254247",
"0.5924164",
"0.59167904",
"0.59088355",
"0.5907542",
"0.59064597",
"0.5906243",
"0.5898226",
"0.589687",
"0.5896091",
"0.5894501",
"0.5894289",
"0.5891739",
"0.58860534",
"0.5882406",
"0.587974",
"0.58738774",
"0.5869024",
"0.58679986",
"0.5867561",
"0.5865932",
"0.5864461",
"0.58639693",
"0.58617616",
"0.5861436",
"0.5860451",
"0.58602303",
"0.5854586",
"0.58537364",
"0.5850427",
"0.5850199"
] |
0.0
|
-1
|
create new array create counter start while loop that goes on while counter is less than length of array inside loop shovel the squared element into new array you created above increment counter return your new array at end of method end
|
def square_array(array)
squared = []
count = 0
while count < array.size do
squared << (array[count] ** 2)
count = count + 1
end
squared
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def square_array(array)\n new_array =[]\n\n counter = 0\n\nend",
"def square_array(array)\nnew_array = []\n array.length.times do |squared|\n new_array.push(array[squared]**2)\nend\n new_array\nend",
"def square_array(array)\n squared = []\n counter = 0\n while array[counter] do\n squared.push( array[counter] ** 2)\n counter +=1\n end\n squared\nend",
"def square_array(array)\n # your code here\n counter = 0\n squared_array = []\n while counter < array.length do\n squared = array[counter] ** 2\n squared_array.push(squared)\n counter += 1\n end\n squared_array\nend",
"def square_array(array)\nnew_array = []\ncounter = 0\nwhile counter < array.length do\n new_array << array[counter] ** 2 #**squaring incrments\ncounter += 1 #increments plus 1 after squaring elements\nend\nreturn new_array #can also just write new_array without the retun before it \nend",
"def square_array(square_array)\ncounter = 0\nnew_numbers = [] \n while counter < square_array.count do\n new_numbers << (square_array[counter] ** 2)\n counter += 1\n end\n new_numbers\nend",
"def square_array(array) #build square_array method\r\n\r\n new_array = [] #new array of squared numbers\r\n\r\n array.each do |integer|#implement own logic\r\n new_array << integer ** 2 #shovel /push logic into array \r\n end\r\n return new_array #returns array of these squared numbers\r\nend",
"def square_array(array)\n counter=0 \n new_array=[]\n \n while counter < array.length do\n puts new_array.push(array[counter]**2)\n counter += 1 \n end\nnew_array\nend",
"def square_array(numbers)\n counter = 0\n new_array = []\n while numbers[counter] do\n sqrd_nums = numbers[counter]**2\n new_array << sqrd_nums\n counter += 1\n end\n return new_array\nend",
"def square_array(array)\n counter = 0\n new_array = []\n while counter < array.length do\n new_array << array[counter] ** 2\n counter += 1\n end\n p new_array\nend",
"def square_array(array)\n counter = 0\n \n while array[counter] do\n puts ((array[counter]) ** 2) => new_array \n counter += 1\n end\nend",
"def square_array(array)\n new_numbers = []\n numbers = 0\n while array[numbers] do\n new_numbers << array[numbers] ** 2\n numbers += 1\n end\nreturn new_numbers\nend",
"def map_to_square(source_array)\n array = []\n index = 0 \n \n while index < source_array.size do \n array.push(source_array[index] ** 2)\n index += 1 \n end\n return array\nend",
"def map_to_square(source_array)\n \n i = 0\n new_array = []\n \n while i < source_array.length do\n new_array_value = source_array[i] ** 2\n new_array << new_array_value\n \n i += 1\n end\n \n new_array\nend",
"def square_array(array)\n squared = []\n array.each do |num|\n num**2\n squared << num**2\n end\n squared\nend",
"def square_array(array)\n # your code here\n newArray = []\n array.each do |num|\n number = num**2\n newArray.push(number)\n end\n return newArray\nend",
"def virus(array_input)\n new_array = [ ]\n number_of_loops = array_input.length\n index = array_input.length - 1\n\n number_of_loops.times do \n new_array << array_input[index]\n index = index - 1 \n end \n\n output = new_array\n return output\nend",
"def square_array(some_array)\n array_squared = []\n some_array.each do |number|\n array_squared << number * number\n end \n return array_squared\nend",
"def square_array(array)\n squared_array = []\n \n array.each do |number| \n squared_array << number**2 \n end\n \n squared_array\nend",
"def square_array (array)\n\nnewarray = []\n\narray.each do |element|\n newarray.push(element**2) \nend\n\nnewarray\n\nend",
"def grow(arr)\n i = 0\n y = 1\n while i < arr.size # I use the while loop to loop and multiple the number and increase by index number\n y = y * arr[i]\n i+= 1\n end\n puts y # I return the y\nend",
"def virus(input_array)\n i = input_array.length-1 \n new_array = []\n\n input_array.length.times do \n new_array << input_array[i]\n i -= 1\n end \n return new_array\nend",
"def double_arr(nums)\n numb_arr = [] # create empty arr\n i = 0 # the indice counter start @ 0\n\n while i < nums.length # for the length of indices in array \n new_num = nums[i] * 2 # variable new_num = looped var i * 2\n numb_arr << new_num # shovel the value of new_num into empty arr\n i += 1 # iterate into next indice of passed array\n end\n return numb_arr # the new array\n puts numb_arr # display the result of the new array\nend",
"def square_array(array)\n\n squared = []\n array.each do |num|\n squared.push(num * num)\n end\n\n squared\n \nend",
"def square_array(some_array)\n array_squared = []\n some_array.each do |item|\n array_squared << item*item\nend\n return array_squared\nend",
"def element_times_index(numbers)\n \n new_arr = []\n\n i = 0 \n while i < numbers.length\n new_num = numbers[i] * i\n new_arr << new_num\n i += 1\n end\n\n return new_arr\nend",
"def element_times_index(numbers)\n new_arry = []\n i = 0\n while i < numbers.length\n new_arry << numbers[i] * i\n i += 1\n end\n return new_arry\n\nend",
"def element_times_index(numbers)\n \n i = 0 # i represents to the index current index always\n \n new_array = []\n \n while i < numbers.length # We cant do less than or equal to here\n \n new_array << numbers[i] * i # You can shovel directly into a new array\n i += 1\n end\n return new_array\nend",
"def running_total1(array)\n array_new = []\n loop do\n break if array.empty?\n array_new << array[0]\n array[1] = array[0] + array[1] if array.size >= 2\n array.shift\n end\n array_new\nend",
"def custom_multiply(array, number)\n count = 0\n final =[]\n while count < number\n final = array + final\n count +=1\n end\n final\nend",
"def compute_squares(array)\n arrayFinal = []\n array.each do |element|\n arrayFinal << element * element\n end\n return arrayFinal\nend",
"def square_array(numbers)\n new_arr = []\n numbers.each do |number|\n new_arr << (number**2)\n end\n return new_arr\nend",
"def scatter\n sum_of_digits = @working_array.inject(:+).to_i\n @working_array = @length.times.collect do\n @working_array.rotate!(spin ^ sum_of_digits).pop\n end\n end",
"def double_array(input_array)\n \n double_array = []\n \n input_array.each do |number|\n double_array << number *= 2\n end\n return double_array\n\nend",
"def array_times_two!(arr)\n\n i = 0\n while i < arr.length\n arr[i] = arr[i] * 2\n i += 1\n end\n\n arr\n\nend",
"def square_array(array)\n\tsquared_nums = []\n\n array.each do |number|\n squared_nums << (number * number)\n end\n squared_nums\nend",
"def square_array(array)\n new_array = []\n array.each { |n| new_array << n*n }\n new_array\nend",
"def square_array(array)\n new_array = []\n array.each{|a| new_array.push(a*a)}\n return new_array\nend",
"def custom_multiply(array,number)\n new_array = []\n number.times {new_array+=array}\n return new_array\nend",
"def square_array(numbers)\n new_numbers = []\n numbers.each do |num|\n new_numbers << (num ** 2)\n end\n return new_numbers\nend",
"def get_products_improved(arr)\n product_array = Array.new(arr.length)\n product = 1\n\n i = 0\n while i < arr.length\n product_array[i] = product\n product *= arr[i]\n i += 1\n end\n\n product = 1\n i = arr.length - 1\n while i >= 0\n product_array[i] *= product\n product *= arr[i]\n i -= 1\n end\n\n product_array\n\nend",
"def square_array(array)\n squared = []\n array.each { |element| squared << element ** 2 }\n squared\nend",
"def doubler(arr)\n new = []\n arr.each do |i|\n new << i*2\n end\n return new\nend",
"def basic_9 (array_iterate)\n square_array = array_iterate.collect { |n| n * n}\n return square_array\nend",
"def square_array(pancakes)\n elephant = []\n pancakes.each do |num|\n elephant << num**2\n end\n return elephant\nend",
"def my_function4(arr)\n products_arr = []\n products_so_far = 1\n i = 0\n while i < arr.length\n products_arr[i] = products_so_far\n products_so_far *= arr[i]\n i += 1\n end\n\n products_so_far = 1\n i = arr.length - 1\n while i >= 0\n products_arr[i] *= products_so_far\n products_so_far *= arr[i]\n i -= 1\n end\n\n return \"Products: #{products_arr}\"\nend",
"def doubler(numbers)\n\ti = 0\n \tarry = []\n while i < numbers.length\n arry[i] = (numbers[i] * 2)\n i += 1\n end\n return arry\nend",
"def square_array(array)\n new_array = []\n array.each { |e| new_array << e ** 2 }\n new_array\nend",
"def double_numbers(array)\n new_array = []\n\n array.each do |number|\n new_array << number *= 2\n end\n return new_array\nend",
"def square_array(array)\n # your code here\n new_numbers = []\n #array.each {|num| puts num ** 2}\n array.each {|num| new_numbers << num ** 2} ## does << save value of squared numbers to new_numbers??\n\n # puts new_numbers\n return new_numbers\n\nend",
"def my_function2(arr)\n final_arr = []\n first_half = []\n first_product = 1\n last_half = []\n arr.each_with_index do |n, i|\n first_half = arr[0...i]\n last_half = arr[i+1..-1]\n first_product = first_half.reduce(:*) || 1\n last_product = last_half.reduce(:*) || 1\n products = first_product * last_product\n final_arr.push(products)\n end\n return \"Products: #{final_arr}\"\nend",
"def index_multiplier_method\n #@multiplied_integer_array = []\n @reversed_array.each_with_index do |value, index|\n if index.odd? == true\n value = value * 2\n @multiplied_integer_array << value\n else\n value = value\n @multiplied_integer_array << value\n end\n end\n return @multiplied_integer_array\n end",
"def square_array(array)\r\n solution = []\r\n array.each do |number|\r\n solution << number**2\r\n end\r\n solution \r\nend",
"def double_numbers(input_array)\n doubled_array =[]\n input_array.each {|num| doubled_array << num*2} \n doubled_array\nend",
"def small_numbers(input_array)\nnew_array = [ ]\nnumber_of_loops = input_array.length\nindex = 0\n\nnumber_of_loops.times do\n if input_array[index] < 10\n new_array << input_array[index]\n end\n index = index + 1\nend\n\noutput = new_array\nreturn output\nend",
"def doubler(numbers)\n new_arr = []\n i = 0\n while i < numbers.length\n old_numbers = numbers[i]\n new_numbers = old_numbers * 2\n new_arr << new_numbers\n i += 1\n end\n return new_arr\nend",
"def array_translate(array)\n new_arr = []\n \n array.each_with_index do |subArray, idx|\n if idx % 2 == 1\n subArray = ele\n else\n subArray = num\n \n #num.times { new_arr << ele }\n end\n end\n\n #return new_arr\nend",
"def virus(input_array)\n new_array = []\n number_of_loops = input_array.length\n index = 0\n\nnumber_of_loops.times do\n if input_array[index] > 7\n new_array << input_array[index]\n end\n index = index + 1\nend\n\nreturn new_array \nend",
"def repa(array, x)\n result = []\n (1..x).each do\n result.concat(array)\n end\n return result\nend",
"def virus(array_input)\n new_array = [ ]\n number_of_loops = array_input.length\n index = 0 \n\n number_of_loops.times do \n if array_input[index] > 7\n\tnew_array << array_input[index]\n end \n index = index + 1 \n end \n output = new_array\n return output\n\nend",
"def square_array(array)\n square = []\n \n array.each do |num|\n square << num * num\n end\n square\nend",
"def transform_array(array)\n i = 0\n array2 = []\n while i < array.length\n num1 = array[i]\n array2.push(square(num1))\n i += 1\n end\n return array2\n end",
"def calculate_doubles(arr)\n doubled_array = []\n arr.each {|int| doubled_array.push(int * 2)}\n doubled_array\nend",
"def my_function3(arr)\n final_arr = []\n first_product = 1\n last_half = []\n arr.each_with_index do |n, i|\n last_half = arr[i+1..-1]\n first_product *= arr[i-1] unless i == 0\n last_product = last_half.reduce(:*) || 1\n products = first_product * last_product\n final_arr.push(products)\n end\n return \"Products: #{final_arr}\"\nend",
"def buy_fruit(array)\n final_array = []\n array.each do |subarray|\n subarray[1].times do |_|\n final_array << subarray[0]\n end\n end\n final_array\nend",
"def square_array(array)\n numbers = []\n array.each do |number| numbers << number ** 2\n end\n numbers\nend",
"def scatter\n sum_of_digits = @working_array.inject(:+).to_i\n @working_array = 10.times.collect do \n @working_array.rotate!(spin ^ sum_of_digits).pop\n end\n end",
"def transform_array(array)\n i = 0\n array2 = []\n while i < array.length\n num1 = array[i]\n array2.push(square(num1))\n \n i += 1\n end\n # puts array2\n return return_sum(array2)\n end",
"def multiply(num_arr, num)\n counter = 0\n new_arr = []\n loop do\n break if counter >= num_arr.length\n new_arr << num_arr[counter] * num\n counter += 1\n end\n\n new_arr\nend",
"def square_array_2(array)\n array.collect { |i| i**2 }\n array\nend",
"def square_each_idx(array)\n final = Array.new(array.length)\n array.each_index { |i| final[i] = array[i]**2 }\n final\nend",
"def eveness(array)\n new_array = []\n index = 1\n while index < array.size\n new_array << array[index]\n index += 2\n end\n new_array\nend",
"def basic_7\n new_array = []\n i = 1\n while i <= 255\n new_array.push(i)\n i += 2\n end\n return new_array\nend",
"def transform_array(array)\n i = 0\n array2 = []\n while i < array.length\n num1 = array[i]\n array2.push(square(num1))\n i += 1\n end\n # puts array2\n i = 0\n sum = 0\n while i < array2.length\n if sum < array2[i]\n sum += array2[i]\n end\n # puts sum\n i += 1 \n end\n return sum\n end",
"def element_times_index(numbers)\n i = 0\n count = 0\n while i < numbers.length\n numbers[i] = numbers[i] * count\n count += 1\n i += 1\n end\n return numbers\nend",
"def product(array)\n products = []\n current = 0\n while (current < array.length)\n i = 0\n product = 1\n\n while (i < array.length)\n if i != current\n product *= array[i]\n end\n i += 1\n end\n\n products << product\n current += 1\n end\n\n products\nend",
"def element_times_index(numbers)\n\tnumber_multiplied = []\n\ti = 0\n\n\twhile i < numbers.length\n\t\tnumber = numbers[i] * i\n\t\tnumber_multiplied << number\n\n\t\ti += \n\tend\n\n\treturn number_multiplied\t\nend\n\n\n# ---------- Their Solution ----------\n# Line 37 is better than what I did in line 20-21\n\n# def element_times_index(numbers)\n# new_nums = []\n\n# i = 0\n# while i < numbers.length\n# new_nums << numbers[i] * i\n\n# i += 1\n# end\n\n# return new_nums\n# end\n\n# ---------- Tests ----------\nprint element_times_index([4, 7, 6, 5]) # => [0, 7, 12, 15]\nputs\nprint element_times_index([1, 1, 1, 1, 1, 1]) # => [0, 1, 2, 3, 4, 5]",
"def stretch(array)\n new_arr = []\n # can assign array to an variable and do only /2 once\n for i in 0...array.length\n # if element is a even number\n if array[i] % 2 == 0\n # add 1/2 value of the element for twice into the new array\n new_arr << array[i]/2\n # if element is an odd number\n else\n new_arr << array[i]/2 + 1\n end\n new_arr << array[i]/2\n end\n return new_arr\nend",
"def generate(num_rows)\n ans = [[1], [1, 1]]\n return [] if num_rows == 0\n return [[1]] if num_rows == 1\n return ans if num_rows == 2\n \n for i in 3..num_rows do \n curr_arr = [1] * i\n for j in 1..i - 2 do\n curr_arr[j] = ans[i - 2][j - 1] + ans[i - 2][j]\n end\n ans << curr_arr\n end\n ans\nend",
"def product_array(input_array)\n return_array = []\n input_array.each_with_index do |x, i|\n # puts \"x is #{x} and i is #{i}\"\n product = 1\n input_array.each_with_index do |y,j|\n if i!=j\n product *= y\n end\n end\n return_array << product\n end\n return return_array\nend",
"def squared_primes(array)\n\n a=[]\n array.each do |x| \n for i in (2..x-1)\n a << x if x % i == 0 \n end\n end\n array -= a\n array.map{ |p| p*p } \n\nend",
"def oddities(array)\n new_array = []\n i = 0\n while i < array.size\n new_array << array[i]\n i += 2\n end\n new_array\nend",
"def element_times_index(arr)\n result = []\n i = 0\n while i < arr.length\n result << arr[i] * i\n i+= 1\n end\n return result\nend",
"def square_array(some_array)\n\tcontainer = []\n\tsome_array.each do |number|\n\t\tcontainer << number * number\n\tend\nend",
"def double_array(array)\n output_array = []\n\n array.each do |thing|\n output_array << thing * 2\n end\n\n return output_array\nend",
"def array_times_two(array)\n new_array = array.map{ |el| el * 2}\n end",
"def productify(array)\n prods = [1] * array.length\n current = array[0]\n (1...array.length).each do |i|\n prods[i] *= current\n current *= array[i]\n end\n current = array[-1]\n (array.length - 2).downto(0).each do |i|\n prods[i] *= current\n current *= array[i]\n end\n\n prods\nend",
"def doubler(array)\r\n res = []\r\n array.each do |ele|\r\n res << ele * 2\r\n end\r\n res\r\nend",
"def evenities1(array)\n index = 1\n even_array = []\n while index < array.length\n even_array << array[index]\n index += 2\n end\n even_array\nend",
"def square_array(pixel_array_img)\n \tpixel_array_sq_img = []\n \tpixel_array_img.each_with_index do |array_pixel,i|\n \t\tnew_array = []\n \t\tarray_pixel.each_with_index do |number,j|\n \t\t\tnew_array[j] = number*number\n \t\t\t#pixel_array_sq_img1[i][j] = number*number\n \t\tend\n \t\tpixel_array_sq_img[i] = new_array\n \tend\n\n \treturn pixel_array_sq_img\n end",
"def num_of_squares(num)\n squares = []\n\n idx = 0\n\n while idx < num\n squares.push(idx * idx)\n\n idx = idx + 1\n end\n return squares\n\n puts squares\nend",
"def oddities(array)\n count = 0\n new_array = []\n loop do\n break if array.size == 0\n new_array << array[count]\n count += 2\n break if count >= array.size\n end\n new_array\nend",
"def multiply_arrnums_by_index(numbers) # array of ints\n new_array = [] # empty array\n i = 0 # start at indice 0\n while i < numbers.length\n new_array << numbers[i] * i # shovel value of int val of the indice * the indice\n # numb_to_mult = numbers[i]\n # numb_multd = numbers[i] * numb_to_mult\n # new_array << numb_multd\n i += 1 # next iteration\n end\n return new_array\nend",
"def productify(arr)\n products = Array.new(arr.length, 1)\n\n lower_prod = 1\n\n 0.upto(arr.size - 1) do |i|\n products[i] = products[i] * lower_prod\n lower_prod = lower_prod * arr[i]\n end\n\n upper_prod = 1\n\n (arr.size - 1).downto(0) do |i|\n products[i] = products[i] * upper_prod\n upper_prod = upper_prod * arr[i]\n end\n\n products\nend",
"def square_array(array)\n numbers = [1,2,3]\n array = numbers\n counter = 0\n while numbers[counter] do\n puts numbers[counter]\n counter += 1\n end\nend",
"def map_to_double(source_array)\n array = []\n index = 0 \n \n while index < source_array.size do \n array.push(source_array[index] * 2)\n index += 1 \n end\n return array\nend",
"def productify(arr)\n products = Array.new(arr.length, 1)\n\n lower_prod = 1\n 0.upto(arr.size - 1) do |i|\n products[i] = products[i] * lower_prod\n lower_prod = lower_prod * arr[i]\n end\n\n upper_prod = 1\n (arr.size - 1).downto(0) do |i|\n products[i] = products[i] * upper_prod\n upper_prod = upper_prod * arr[i]\n end\n\n products\nend",
"def productify(arr)\n\n up_product = 1\n up_array = []\n arr.length.times do |idx|\n up_product *= arr[idx]\n up_array << up_product\n end\n\n down_product = 1\n down_array = Array.new(arr.length)\n (arr.length - 1).downto(0) do |idx|\n down_product *= arr[idx]\n down_array[idx] = down_product\n end\n\n result = []\n arr.length.times do |idx|\n product = 1\n up_idx = idx - 1\n down_idx = idx + 1\n if up_idx >= 0\n product *= up_array[up_idx]\n end\n if down_idx < arr.length\n product *= down_array[down_idx]\n end\n result[idx] = product\n end\n\n result\n\nend",
"def doubler(arr)\n i = 0\n while i < arr.length\n arr[i] = arr[i] * 2\n i += 1\n end\n return arr\nend"
] |
[
"0.78806686",
"0.7704985",
"0.766338",
"0.760552",
"0.75770915",
"0.7572463",
"0.75372106",
"0.74659985",
"0.7316115",
"0.7306933",
"0.72722244",
"0.72264975",
"0.71411866",
"0.71235555",
"0.7055188",
"0.7005721",
"0.700134",
"0.6968619",
"0.69492733",
"0.6904648",
"0.68900365",
"0.6886238",
"0.6880809",
"0.6863041",
"0.68280417",
"0.67921966",
"0.6783385",
"0.6782035",
"0.6766919",
"0.6764834",
"0.67367464",
"0.67211795",
"0.67063445",
"0.66998506",
"0.6696863",
"0.6696466",
"0.6671897",
"0.6665038",
"0.6664641",
"0.66558105",
"0.6653112",
"0.664899",
"0.6644218",
"0.6638628",
"0.6628289",
"0.6622153",
"0.6598642",
"0.6594691",
"0.6584326",
"0.6578735",
"0.6554767",
"0.65530455",
"0.6552358",
"0.654289",
"0.6540809",
"0.65402246",
"0.6540165",
"0.6533504",
"0.6533009",
"0.65211576",
"0.6510875",
"0.6502223",
"0.6493705",
"0.6492535",
"0.6492437",
"0.6466419",
"0.6445278",
"0.6443635",
"0.6425857",
"0.64243853",
"0.6422483",
"0.6422473",
"0.63956875",
"0.63935995",
"0.6391946",
"0.6377011",
"0.63769877",
"0.63755715",
"0.6373819",
"0.63727814",
"0.6368708",
"0.63598454",
"0.63570285",
"0.63469744",
"0.63293576",
"0.6324008",
"0.6320273",
"0.63182575",
"0.6316569",
"0.6312432",
"0.63097066",
"0.63091063",
"0.62993735",
"0.62977326",
"0.6295171",
"0.62903327",
"0.6287981",
"0.6287533",
"0.62806"
] |
0.7265993
|
12
|
Alyssa noticed that this will fail if the input is 0, or a negative number, and asked Alan to change the loop. How can you change the loop construct (instead of using begin/end/until) to make this work? Note that we're not looking to find the factors for 0 or negative numbers, but we just want to handle it gracefully instead of raising an exception or going into an infinite loop. Correct answer
|
def factors(number)
dividend = number
divisors = []
while dividend > 0 do
divisors << number / dividend if number % dividend == 0
dividend -= 1
end
divisors
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def factors(number)\n return \"number must be greatr than zero\" if (number == 0 || number < 0 )\n \n divisor = number\n factors = []\n begin\n factors << number / divisor if number % divisor == 0\n divisor -= 1\n end until divisor == 0\n factors\nend",
"def factors(number)\n dividend = number\n divisors = []\n while dividend > 0\n divisors << number / dividend if number % dividend == 0\n dividend -= 1\n end\n if divisors.any?\n divisors\n else\n \"Sorry, can't find factors for negative numbers or zero.\"\n end\nend",
"def factors(number)\n divisor = number\n factors = []\n loop do\n if number == 0 || number < 0\n break\n else factors << number / divisor if number % divisor == 0\n divisor -= 1\n break if divisor == 0\n end\n end\n factors\n end",
"def factors(num)\r\n factors = []\r\n sqrt = Math.sqrt(num)\r\n until num == 1\r\n\r\n factor_founded = false\r\n (2..sqrt).each do |i|\r\n if (num % i).zero?\r\n num /= i\r\n factors << i\r\n factor_founded = true\r\n break\r\n end\r\n end\r\n unless factor_founded\r\n factors << num\r\n num /= num\r\n end\r\n end\r\n return factors\r\nend",
"def factors(number)\n factors = []\n divisor = number\n while divisor > 0 do\n factors << (number / divisor) if number % divisor == 0\n divisor -= 1\n end\n if divisor <= 0\n puts \"Invalid number: no 0's or negatives!\"\n else\n end\n factors\n end",
"def factors(number)\n divisor = number\n factors = []\n loop do\n break if number <= 0\n factors << number / divisor if number % divisor == 0\n divisor -= 1\n break if divisor == 0\n end \n factors\nend",
"def factors(number)\n divisor = number\n factors = []\n begin\n factors << number / divisor if number % divisor == 0\n divisor -= 1\n end until divisor == 0\n factors\nend",
"def factors(number)\n divisor = number\n factors = []\n begin\n factors << number / divisor if number % divisor == 0\n divisor -= 1\n end until divisor == 0\n factors\nend",
"def factors(number)\n divisor = number\n factors = []\n begin\n factors << number / divisor if number % divisor == 0\n divisor -= 1\n end until divisor == 0\n factors\nend",
"def factors(number)\n divisor = number\n factors = []\n begin\n factors << number / divisor if number % divisor == 0\n divisor -= 1\n end until divisor == 0\n factors\nend",
"def factors(number)\n divisor = number\n factors = []\n begin\n factors << number / divisor if number % divisor == 0\n divisor -= 1\n end until divisor == 0\n factors\nend",
"def factors(number)\n divisor = number\n factors = []\n begin\n factors << number / divisor if number % divisor == 0\n divisor -= 1\n end until divisor == 0\n factors\nend",
"def factors(number)\n divisor = number\n factors = []\n loop do\n factors << number / divisor if number % divisor == 0\n divisor -= 1\n break if divisor == 0\n end\n factors\n \nend",
"def factors(num)\n (1..Math::sqrt(num)).each do |x|\n if num % x == 0\n puts x\n puts num/x\n end\n end\n nil\nend",
"def factors(number)\n divisor = number\n factors = []\n loop do\n break if divisor <= 0\n factors << number / divisor if number % divisor == 0\n divisor -= 1\n end\n factors\nend",
"def factor(number)\r\n i = 1\r\n while i <= number\r\n puts i if number % i == 0\r\n i += 1\r\n end\r\nend",
"def factors() (1..self).select { |n| (self % n).zero? } end",
"def factors(num)\n 1.upto(num).select { |x| num % x == 0 }\nend",
"def factorial(input)\n if input < 0\n raise ArgumentError.new(\"Factorial of negative number is undefined.\")\n end\n\n result = 1\n\n for i in 1..input\n result *= i\n end\n\n result\nend",
"def factors(num)\n return nil if num < 0\n return 1 if num == 1\n (1..num).select { |n| num % n == 0}\n\n\nend",
"def factors(number)\n dividend = number\n divisors = []\n loop do\n break if dividend <= 0\n divisors << number / dividend if number % dividend == 0\n dividend -= 1\n end\n divisors\nend",
"def factors(number)\n dividend = number\n divisors = []\n begin\n divisors << number / dividend if number % dividend == 0\n dividend -= 1\n end until dividend == 0\ndivisors\nend",
"def factors(number)\n divisors = []\n if number > 0 \n dividend = number\n begin\n divisors << number / dividend if number % dividend == 0\n dividend -= 1\n end until dividend == 0\n divisors\n end\n divisors\nend",
"def factor(num)\n (1..num).select { |f| (num % f).zero? }\nend",
"def factor(n)\n n /= 2 while n.even?\n i = 3\n while i * i <= n\n n /= i while n % i == 0\n i += 2\n end\n n\nend",
"def factors(number)\n dividend = number\n divisors = []\n begin\n divisors << number / dividend if number % dividend == 0\n dividend -= 1\n end until dividend == 0\n divisors\nend",
"def factors(number)\n dividend = number\n divisors = []\n begin\n divisors << number / dividend if number % dividend == 0\n dividend -= 1\n end until dividend == 0\n divisors\nend",
"def factors(num)\n (1..num).select { |el| num % el == 0 }\nend",
"def factors(num)\n return nil if num <= 0\n return [1] if num == 0\n (1..num).select { |i| (num % i) == 0 }\nend",
"def factors(number)\n divisor = number\n factors = []\n while divisor != 0\n # not the cleanest way to do it, will return the same results\n # if we take the abs value of the number, removing the ternary operator\n factors << number / divisor if number % divisor == 0\n divisor > 0 ? divisor -= 1 : divisor += 1\n end\n factors\nend",
"def factors(num)\n (1..num).select{|i| num % i == 0 }\nend",
"def factors_of(num) # Define method with one param\n \n i = 1 # To prevent dividing by zero start at one because of future modula expression\n new_array = [] # Create and empty array to shovel numbers while they meet requirements of the if statement\n \n while i <= num \n \n if num % i == 0 # Parameter entered must be a factor of i since we are cycling through iterations and i is incrementing upwards\n \n new_array << i # Shovel iterations that fulfill logical conditions\n end\n \n i += 1 # Increment up 1 at a time\n end\n return new_array # Prints array after while loop ends; while loop conditions are met\n\nend",
"def factors(num)\n (1..num).select { |n| num%n == 0}\nend",
"def factorial(number)\n result = 1\n if number < 0\n puts \"number needs to be a positive integer\"\n elsif number != number.to_i\n puts \"number needs to be an integer\"\n elsif number == 0\n return result\n else\n array = []\n while number > 0\n array << number\n number -= 1\n end\n for i in array do\n result = result * i\n end\n end\n return result\nend",
"def factors(number)\n dividend = number\n divisors = [] # make an empty array called divisors\n begin\n # if the number / dividend is a whole number add it to the array\n divisors << number / dividend if number % dividend == 0\n # minus 1 from the dividend\n dividend -= 1\n # end when dividend is 0\n end until dividend == 0\n divisors\nend",
"def factors(num)\n (1..num).select {|x| num % x == 0 }\nend",
"def factors(number)\n dividend = number\n divisors = []\n while number >= 1\n divisors << number / dividend if number % dividend == 0\n dividend -= 1\n break if dividend == 0\n end\n divisors\nend",
"def factors(number)\n # TODO: can optimise by only going up to the square of the number\n (1..number).select { |x| number % x == 0 }.count\nend",
"def factors(num)\r\n # your code goes here\r\n\r\n factors = []\r\n for i in 1 .. num\r\n if num % i == 0\r\n factors << i\r\n end\r\n end\r\n factors\r\nend",
"def divide_by_zero_fail(number) \n while number != nil\n number = number_fail(number) \n if number == '0'\n puts 'You cant divide by 0. Please enter a new number'\n number = gets.chomp\n else \n return number\n end\n end\nend",
"def factorial(input)\n if input == 0 \n return 1\n end\n num = input - 1 \n result = input \n \n while num >= 1\n result = result * num\n num -= 1\n end\n return result\nend",
"def factors(number)\n divisor = number\n factors = []\n #begin\n\twhile divisor > 0\n factors << number / divisor if number % divisor == 0\n divisor -= 1\n #end until divisor == 1\n\tend\n factors\nend",
"def factorial(number)\n if number == nil\n raise ArgumentError, \"Please enter an integer, you've entered nil.\"\n elsif number == 0\n return 1\n elsif number < 0\n raise ArgumentError, \"Please enter a positive number.\"\n end\n\n lesser_number = number - 1\n (number - 2).times do\n number *= lesser_number\n lesser_number -= 1\n end\n\n return number\nend",
"def factors_of(num)\n (1..num).select{|ele| num % ele == 0}\nend",
"def factorial(number)\n if number < 0\n return \"Error, that is not a positive integer.\"\n else\n counter = number.to_i\n end\n total = 1\n while counter > 0\n total = total*counter\n counter -= 1\n end\n return total\nend",
"def factors(num)\n factors = []\n (1..num).each do |i| \n factors << i if num % i === 0\n end\n factors\nend",
"def factors(number)\n divisor = number\n factors = []\n while divisor > 0\n factors << (number / divisor) if ((number % divisor) == 0)\n divisor -= 1\n end\n factors\nend",
"def factorial(number)\n result = 1\n if number < 0\n puts \"number needs to be a positive integer\"\n elsif number != number.to_i\n puts \"number needs to be an integer\"\n elsif number == 0\n return result\n else\n array = []\n while number > 0\n array << number\n number -= 1\n end\n for i in array do\n result = result * i\n end\n end\n return result\nend",
"def find_factors(number)\n factors =[]\n for i in 1..number\n factors << i if number % i == 0\n end\n factors\nend",
"def factorial(num)\n if num.class != Fixnum || num < 0 || num > 10079\n raise ArgumentError.new(\"this bad\")\n elsif num == 0\n 1\n else\n answer = 1\n while num > 1\n answer *= num\n num -= 1\n end\n answer\n end\nend",
"def factors(number)\n divisor = number\n factors = []\n while divisor > 0 do\n factors << number / divisor if number % divisor == 0\n divisor -= 1\n end\n factors\nend",
"def factors(number)\n divisor = number\n factors = []\n while divisor > 0 do\n factors << number / divisor if number % divisor == 0\n divisor -= 1\n end\n factors\nend",
"def factors(number)\n divisor = number\n factors = []\n while divisor > 0 do\n factors << number / divisor if number % divisor == 0\n divisor -= 1\n end\n factors\nend",
"def factors(number)\n divisor = number\n factors = []\n while divisor > 0 do\n factors << number / divisor if number % divisor == 0\n divisor -= 1\n end\n factors\nend",
"def factors(number)\n divisor = number\n factors = []\n while divisor > 0 do\n factors << number / divisor if number % divisor == 0\n divisor -= 1\n end\n factors\nend",
"def factors(number)\n divisor = number\n factors = []\n while divisor > 0 do\n factors << number / divisor if number % divisor == 0\n divisor -= 1\n end\n factors\nend",
"def factors(number)\r\n divisor = number\r\n factors = []\r\n while divisor > 0 do \r\n factors << number / divisor if number % divisor == 0\r\n divisor -= 1\r\n end \r\n factors\r\nend",
"def factorial(number)\n counter = number.to_i - 1\n if number.to_i == 0\n return 1\n else\n while counter > 0\n number = number * counter\n counter = counter - 1\n end\nend\nreturn number\nend",
"def factors(number)\n divisor = number\n factors = []\n while divisor > 0\n factors << number / divisor if number % divisor == 0\n divisor -= 1\n end\n factors\nend",
"def factorial(number)\n accumulator = 1\n if number.nil?\n raise ArgumentError.new(\"You can't factorialize 'nil.' \")\n elsif\n number == 0 || number == 1\n return 1\n else\n until number == 0 do\n accumulator = number * accumulator\n number -= 1\n end\n end\n return accumulator\nend",
"def factor_primes(num)\n\n return \"Not a valid number\" if num < 2\n\n for divisor in 2..(num - 1)\n while num % divisor == 0 \n (divisor * divisor > num) ? (return num) : (num /= divisor)\n # puts \"The divisor is #{divisor}\"\n # puts \"The new num is #{num}\"\n end\n end\n puts \"only divisible by 1 and itself\"\nend",
"def check_factor(factor, max_divisor)\n is_factor = true\n \n # Start looping high, since higher numbers are less likely to be factors, so\n # the loop can bail out early if the highest number isn't a factor\n # Only loop down to 2, since everything is divisible by 1\n max_divisor.downto(2).each { |i|\n # Determine factor is evenly divisble by 1\n is_factor = is_factor && (factor % i == 0)\n\n # If factor is not evenly divisible by i, don't bother checking lower nums\n break if !is_factor\n }\n\n # Return whether or not it's a factor\n is_factor\nend",
"def factorial(number)\n if number < 0\n return \"Error, that is not a positive integer.\"\n else\n counter = number.to_i\n end\n total = 1\n while counter > 0\n total = total*counter\n counter -= 1\n end\n return total\nend",
"def sum_factors(number)\n sum = 1\n bound = Math.sqrt(number).to_i + 1\n (2..bound).each do |i|\n if number % i == 0\n sum += i\n sum += number/i if i != number/i\n end\n end\n return sum\nend",
"def factors(number)\n dividend = number\n divisors = []\n while number > 0\n divisors << number / dividend if number % dividend == 0\n dividend -= 1\n end\n divisors\nend",
"def factors num\n if num != 1\n #Start with 1 and num as the first factors\n c = 2\n 2.upto(num/2) { |f|\n if num % f == 0\n c += 1\n end\n }\n else\n c = 1\n end\n\n c\nend",
"def factors(number)\n dividend = number\n divisors = []\n while dividend > 0 do\n divisors << number / dividend if number % dividend == 0\n dividend -= 1\n end\nend",
"def factors(number)\n dividend = number\n divisors = []\n while dividend > 0\n divisors << number / dividend if number % dividend == 0\n dividend -= 1\n end \n divisors\nend",
"def factors(number)\n answer = []\n count = 1\n while count < (number + 1)\n result = number % count\n answer << count if result == 0\n count += 1\n end\n puts answer\nend",
"def factors(num)\n facs = []\n i = 1\n while i <= num\n if num % i == 0\n facs << i\n end\n i += 1\n end\n facs\nend",
"def factors(number)\n dividend = number\n divisors = []\n while dividend > 0\n divisors << number / dividend if number % dividend == 0\n dividend -= 1\n end \n divisors\nend",
"def old_factors(num)\n factors = []\n (1..num).each do |i|\n if num % i == 0\n factors << i\n end\n end\n factors\nend",
"def solution(n)\n factors = 0\n (1..Math.sqrt(n)).each do |i|\n if n % i == 0\n factors += i == Math.sqrt(n) ? 1 : 2\n end\n end\n factors\nend",
"def factorial(number)\n if number < 0\n 'Please check your input number! The given number is a negative number.'\n elsif number == 0\n \"The factorial of #{number} is 1.\"\n else\n result = (1..number).inject(:*)\n \"The factorial of #{number} is #{result}.\"\n end\nrescue StandardError\n 'Error: Please provide integer only!'\nend",
"def factorial(number)\n # Your code goes here\n if number < 0\n\n puts \"The number must be positive\"\n\n elsif number == 0\n\n p 1\n\n else\n\n number_array = []\n\n index = 0\n\n index_factorial = 0\n\n fact = 1\n\n while number>0\n\n number_array[index] = number\n\n index += 1\n\n number -=1\n end\n\n while index_factorial < number_array.length\n\n fact = fact * number_array[index_factorial]\n\n index_factorial +=1\n end\n\n p fact\n\n end\n\nend",
"def factors(number)\n dividend = 1\n divisors = []\n while dividend <= number\n divisors << dividend if number % dividend == 0\n dividend += 1\n end\n divisors\nend",
"def factors(num)\n\n factors = []\n # iterate through all nums from 1 to num\n # add to factors if evenly divisible\n # return factors\n\n i = 1\n while i <= num\n factors << i if num % i == 0\n i += 1\n end\n\n factors\n\nend",
"def factors2(number)\n dividend = number\n divisors = []\n while number > 0 do\n divisors << number / dividend if number % dividend == 0\n dividend -= 1\n break if dividend == 0\n end\n divisors\nend",
"def factors(number)\n dividend = number\n divisors = []\n while dividend > 0\n divisors << number / dividend if number % dividend == 0\n dividend -= 1\n end\n divisors\nend",
"def factors(number)\n dividend = number\n divisors = []\n while dividend > 0\n divisors << number / dividend if number % dividend == 0\n dividend -= 1\n end\n divisors\nend",
"def factors(number)\n dividend = number\n divisors = []\n while dividend > 0\n divisors << number / dividend if number % dividend == 0\n dividend -= 1\n end\n divisors\nend",
"def factors(number)\n dividend = number\n divisors = []\n while dividend > 0\n divisors << number / dividend if number % dividend == 0\n dividend -= 1\n end\n divisors\nend",
"def factors(number)\n dividend = number\n divisors = []\n while dividend > 0\n divisors << number / dividend if number % dividend == 0\n dividend -= 1\n end\n divisors\nend",
"def find_factors(targets)\n puts \"Finding factors for #{targets.join(\",\")}\"\n targets.each do |target|\n (2..target).each do |x|\n if x == target \n puts \"prime => #{target}\"\n else\n if (target % x) == 0\n find_factors [target / x, x]\n break\n end\n end\n end \n end\nend",
"def factorial(num)\n if num == 0\n return 1\n else\n value = num - 1\n until value == 0\n num *= value\n value -= 1\n end\n return num\n end\nend",
"def factors(number)\n dividend = number\n divisors = []\n number.times do\n divisors << number / dividend if number % dividend == 0\n dividend -= 1\n end\n divisors\nend",
"def factors(n)\n return (1..n).select {|x| n % x == 0}\nend",
"def iterative_factorial(num)\n if num < 0 || !is_integer?(num)\n return Float::NAN\n elsif num == 0 || num==1\n 1\n else\n (1..num).inject(:*) || 1\n end\nend",
"def get_factors(num)\n factors = []\n (1..num).each do |i|\n factors << i if num % i == 0\n end\n factors\nend",
"def factorial(number)\n if number\n factorial = 1\n until number == 0\n factorial *= number\n number -= 1\n end\n return factorial \n else\n raise ArgumentError\n end\nend",
"def factors(number)\n dividend = number\n divisors = []\n while dividend>0 do \n divisors << number / dividend if number % dividend == 0\n dividend -= 1\n end\n p divisors\nend",
"def factorial(number)\n num = 1\n until number == 0\n num *= number\n number -=1\n end\n num\nend"
] |
[
"0.76306397",
"0.7435003",
"0.740309",
"0.72838336",
"0.72518027",
"0.7232551",
"0.7080079",
"0.70794725",
"0.70794725",
"0.70794725",
"0.70794725",
"0.7078107",
"0.7075073",
"0.706096",
"0.69839674",
"0.6976663",
"0.6959994",
"0.69444776",
"0.69351053",
"0.6918714",
"0.6912587",
"0.68880516",
"0.68804526",
"0.6867559",
"0.68582207",
"0.6850383",
"0.6850383",
"0.68027174",
"0.6801767",
"0.67991364",
"0.6782313",
"0.67695796",
"0.67551833",
"0.6752545",
"0.6750615",
"0.6747612",
"0.673892",
"0.673159",
"0.6731402",
"0.6721118",
"0.6689846",
"0.6687686",
"0.66758585",
"0.66749996",
"0.6673577",
"0.6654761",
"0.66496444",
"0.6647085",
"0.66381085",
"0.6613483",
"0.6606545",
"0.6606545",
"0.6606545",
"0.6606545",
"0.6606545",
"0.6606545",
"0.65971273",
"0.6588331",
"0.6586232",
"0.6584328",
"0.6554167",
"0.654327",
"0.6540553",
"0.65344125",
"0.6531031",
"0.65294087",
"0.65254635",
"0.65252364",
"0.6522921",
"0.65115696",
"0.6507747",
"0.6503436",
"0.6500829",
"0.64972353",
"0.6493837",
"0.64873016",
"0.6481278",
"0.6480383",
"0.6477508",
"0.6477508",
"0.6477508",
"0.6477508",
"0.6477508",
"0.64761466",
"0.64719903",
"0.64712477",
"0.6468393",
"0.6460228",
"0.64531684",
"0.6453023",
"0.64474845",
"0.6443493"
] |
0.6492147
|
80
|
To publish an unpublished post!
|
def publish!
return false unless published_at.nil?
update_column :published_at, Time.zone.now
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def unpublish\n self.published = false\n end",
"def published_post\n if self.published && self.published_at.nil?\n self.published_at = Time.now\n end\n end",
"def publish_now!\n puts 'publish noew...'\n self.status = Post::PUBLISHED\n self.published_at = self.publish_at\n save!\n end",
"def publish\n @options['date'] ||= read_draft_date || Time.now.iso8601\n\n post_options = {\n 'title' => read_draft_title,\n 'date' => @options['date'],\n 'slug' => publish_slug,\n 'content' => read_draft_content,\n 'dir' => @options['dir'],\n 'type' => 'post from draft'\n }\n\n # Create a new post file\n #\n Post.new(post_options).write\n \n # Remove the old draft file\n #\n FileUtils.rm @options['path']\n\n end",
"def publish\n @options['date'] ||= read_post_yaml('date') || Time.now.iso8601\n @options['title'] = read_post_yaml('title')\n\n post_options = {\n 'title' => @options['title'],\n 'date' => @options['date'],\n 'slug' => path_slug(@options['path']),\n 'extension' => File.extname(@options['path']).sub(/^\\./, ''),\n 'content' => read_post_content,\n 'dir' => @options['dir'],\n 'type' => \"post from draft\",\n 'write_message' => \"Published: #{relative_path(path)} →\",\n 'force' => @options['force']\n }\n\n # Create a new post file\n #\n Post.new(site, post_options).write\n \n # Remove the old draft file\n #\n FileUtils.rm @options['path']\n\n end",
"def publish\n self.published = true\n end",
"def unpublished; end",
"def publish\n if self.draft\n self.published_at = nil\n else\n self.published_at ||= DateTime.now\n end\n end",
"def publish_n_unpublish\n @object = params[:class_name].constantize.find(params[:id])\n @object.update(published: !@object.published) if @object.author?(current_user)\n end",
"def published?; end",
"def published?; end",
"def publish!\n raise 'Not implemented!'\n end",
"def unpublish!\n self.is_published = false\n save\n end",
"def publish\n\t\tchanged = !published?\n\t\tself.status = 'published'\n\t\tchanged\n\tend",
"def unpublish\n self.status = \"Unpublished\"\n end",
"def publish!\n self.published = true\n save\n end",
"def unpublish\r\n return unless published?\r\n self.unpublish_at = 1.minute.ago\r\n end",
"def unpublish!\n self.update_attribute(:status, \"Unpublished\")\n end",
"def publish!(entry)\n # no-op (for now)\n end",
"def publish_directly\n publish!\n end",
"def publish!\n self.published = true\n if self.respond_to?(:publish_on)\n self.publish_on ||= Date.today\n end\n self.save\n end",
"def publish\r\n return if published?\r\n self.publish_at = Time.now\r\n self.unpublish_at = nil\r\n end",
"def publish\n respond_to do |format|\n if @post.publish!\n format.html { redirect_to blog_post_no_prefix_path(@blog, @post),\n notice: 'Post was successfully published.' }\n format.json { render :show, status: :ok, location: @post }\n else\n format.html { render :edit }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def publish\n end",
"def publish\n end",
"def publish\n end",
"def publish\n @post = Post.find(params[:id])\n @post.state = 'published'\n if @post.save\n flash[:notice] = \"published successfully\"\n # merge :id into params\n redirect_to edit_post_url(@post)\n end\n end",
"def publish!\n return true if published?\n publish_status!\n end",
"def publish!\n self.update_attribute(:published, true)\n end",
"def publish(_ = nil)\n answers.each do |answer|\n answer.publish! if answer.submitted?\n end\n self.publisher = User.stamper || User.system\n self.published_at = Time.zone.now\n end",
"def can_publish?\n !published_at\n end",
"def publish?\n false\n end",
"def unpublish!\n self.published = false\n self.previously_published = false\n save(:validate => false)\n end",
"def publish\n\n current_user_or_redirect ? nil : return\n\n @post = Post.find(params[:id])\n # topic = Topic.where(\"id = ?\", params[:topic]).first\n # if topic\n # @post.topics << topic unless @post.topics.include?(topic)\n # end\n \n if !@post.mine?(@current_user.id)\n redirect_to root_path\n return\n end\n \n @post.status = 'live'\n\n respond_to do |format|\n if @post.update_attributes(params[:post])\n @post.update_created_at\n @post.delay.add_interactions\n format.html { redirect_to @post.link_for_post, notice: 'Post was successfully published.' }\n format.json { head :no_content }\n format.js\n else\n format.html { render action: \"edit\" }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n format.js\n end\n end\n end",
"def publish!\r\n publish\r\n save!\r\n end",
"def publish_now(email, password)\n self.state = :published\n return edit(email,password) if post_id\n write(email,password)\n end",
"def publish!\n publish\n save\n end",
"def create\n @post = current_user.posts.new(params[:post])\n @post.edited_at = Time.current\n @post.published_at = Time.current if params[:publish]\n if @post.save\n flash[:success] = \"Post criado com sucesso.\"\n redirect_to admin_posts_path\n else\n @page_title = \"Novo Post\"\n render :action => 'new'\n end\n end",
"def unpublish!\r\n unpublish\r\n save!\r\n end",
"def unpublish!\n self.update_attributes(status: UNPUBLISHED, featured: false)\n end",
"def unpublish!\n self.update_attributes(status: UNPUBLISHED, featured: false)\n end",
"def unpublish!\n self.update_attributes(status: UNPUBLISHED, featured: false)\n end",
"def unpublish!\n self.update_attribute(:status, UNPUBLISHED)\n end",
"def publish\n status_id = STATUSES.index('published')\n set_published_at\n end",
"def unpublish\n status_id = STATUSES.index('draft')\n published_at = nil\n end",
"def publish_now!\n self.status = Micropost::PUBLISHED\n self.published_at = self.publish_at\n save!\n end",
"def publish\n\t\t@article.publish!\n\t\tredirect_to @article\n\tend",
"def publish\n return true if self.published_at\n\n if self.new_record?\n return false unless self.save\n end\n\n self.published_at = Time.now\n self.save\n end",
"def unpublished=(_arg0); end",
"def publish\n set_publish(true)\n end",
"def publish(args)\n if args.length == 0\n Dir.foreach('_drafts') do |filename|\n FileUtils.mv \"_drafts/#{filename}\", \"_posts/#{filename}\", :force => true\n end\n else\n args.each do |name|\n Dir.foreach('_drafts') do |filename|\n if filename.include? name\n FileUtils.mv \"_drafts/#{filename}\", \"_posts/#{filename}\", :force => true\n exec \"git add . && git commit -m 'Publish #{filename}'\"\n end\n end\n end\n end\n end",
"def publishPost(message,options)\n @me.put_wall_post(message,options)\n end",
"def unpublished?\n (status == UNPUBLISHED)\n end",
"def unpublished?\n (status == UNPUBLISHED)\n end",
"def unpublished?\n (status == UNPUBLISHED)\n end",
"def unpublished?\n (status == UNPUBLISHED)\n end",
"def unpublished?\n (status == UNPUBLISHED)\n end",
"def publish\n set_publish_state(Event::PUBLISHED_STATE)\n end",
"def publish!(current_time = Time.current)\n PublishPageJob.perform_later(id, public_on: current_time)\n end",
"def unpublished!\n self.update_attribute(:status, UNPUBLISHED)\n end",
"def can_publish?\n\t\ttrue\n\tend",
"def publish\n public_content.delete if public_content\n PublicContent.create!(\n content: self,\n topic:,\n text:,\n otu:\n )\n end",
"def p_publish( obj )\n puts \"## Page: #{ obj.link }, updated #{ obj.updated }\"\n end",
"def publish_me\n # Unpublish all other versions of the survey\n self.survey.survey_versions.published.update_all(:published => false)\n # Publish this version\n self.published = true\n self.locked = true\n self.save\n end",
"def unpublished?\n self.status == \"Unpublished\"\n end",
"def publish!\n @new = true if self.private?\n self.status = statuses.public\n self.save!\n end",
"def unpublish\n @article = Article.find(params[:id])\n @article.change_publish_status(0)\n flash[:notice] = \"Article status changed to un-published.\"\n redirect_to :back\n rescue Exception => e\n log_exception(e)\n flash[:warning] = \"Error!\"\n redirect_to :back\n end",
"def publish\n # fetching page via before filter\n @page.save\n flash[:notice] = _(\"page_published\") % {:name => @page.name}\n redirect_back_or_to_default(admin_pages_path)\n end",
"def publish\n p = Page.find_by_id(params[:id])\n p.published_on = Time.now\n p.save!\n respond_with p, :location => nil\n end",
"def after_numbered(post)\n return unless post.is_a?(Post)\n return unless post.topic\n return unless post.topic.status == 'publish'\n return unless post.floor and post.floor > 0\n send_mention(post)\n end",
"def unpublish\n render json: ErrorSerializer.serialize(resource_name => \"is already unpublished\"), status: 422 and return unless resource.published\n\n ResourcePublisher.new(resource).unpublish\n render json: resource, status: 200\n end",
"def publishable?\n false\n end",
"def unpublished_posts\n @blog_posts = BlogPost.where(:deleted => '0').where(:publish => \"0\").order('created_at DESC')\n end",
"def publication\n nil\n end",
"def publish_now\n self.publish_at = Time.now.utc\n self.save!\n end",
"def publish_front_page\n\t\tsystem 'clear'\n\t\t@post_list.each do |post|\n\t\t\tif post.sponsored == true\n\t\t\t\tputs \"*****Post #{post.title}*****\"\n\t\t\telse\n\t\t\t\tputs \"Post #{post.title}\"\n\t\t\tend\n\t\t\tputs \"#{post.text}\"\n\t\t\tputs \"#{post.creation_date}\"\n\t\t\tputs \"-----------------------\"\n\t\tend\n\tend",
"def published?\n if self.publish_at < Time.now.utc\n true\n else\n false\n end\n end",
"def publish\n if @item.publish\n flash[:notice] = 'Your item is published!'\n else\n flash[:notice] = 'There was an error'\n end\n\n redirect_to @item\n end",
"def published?\n !(data.key?(\"published\") && data[\"published\"] == false)\n end",
"def published?\n !(data.key?(\"published\") && data[\"published\"] == false)\n end",
"def publish!\n self.published = true\n\n # upgrade if necessary\n if upgrade_needed? || current_version.nil?\n upgrade_version!\n else\n save(:validate => false)\n end\n end",
"def publish( message )\n raise NotImplementedError, \"please implement 'publish'\"\n end",
"def publish_changes\n return unless resource.valid?\n private_publish resource\n end",
"def check_published\n \n if self.publishing_state == PublishingState::PUBLISHED\n self.publishing_date = Time.now\n self.publishing_publisher = connected_user.username\n end\n\n end",
"def test02_EmptyMPopGDPublish\n\t\t\tloginPost\n\t\t\t$browser.goto($patch_media)\n\t\t\tsleep 2\n\t\t\tif $post_pick_group.exists?\n\t\t\t\tpostGroupPop\n\t\t\t\t$post_media_description.set(\"Media Description #{random}.\")\n\t\t\t\tpostPublishLater\n\t\t\t\t$post_now.fire_event(\"onclick\")\n\t\t\telse puts \"PPL04T02: FAILED! User unable to locate Post button.\"\n\t\t\tend \t\t\t\t\n\t\t\t\n\t\t\tbegin\n\t\t\tassert $post_now.exists?\n\t\t\t\trescue => e\n\t\t\t\tputs (\"PPL04T02: FAILED! User able to Post.\")\n\t\t\t\tputs e\n\t\t\tend\n\t\tend",
"def publish\n # fetching page via before filter\n @page.publish!\n flash[:notice] = _t(:page_published, :name => @page.name)\n redirect_back_or_to_default(admin_pages_path)\n end",
"def require_unpublished\n if params[:id]\n Question.find(params[:id]).quiz.published and raise ArgumentError, \"can't manage a published quiz\"\n end\n end",
"def create\n @post = Post.new(params[:post])\n @post.published = true\n\n respond_to do |format|\n if @post.save\n flash[:notice] = 'Запись успешно создана.'\n format.html { redirect_to(@post) }\n format.xml { render :xml => @post, :status => :created, :location => @post }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @post.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def publish\r\n if update_attribute('published', true)\r\n log_activity\r\n true\r\n else\r\n false\r\n end\r\n end",
"def publish!(public_on:)\n Page.transaction do\n version = public_version(public_on)\n DeleteElements.new(version.elements).call\n\n repository = page.draft_version.element_repository\n ActiveRecord::Base.no_touching do\n Element.acts_as_list_no_update do\n repository.visible.not_nested.each.with_index(1) do |element, position|\n Alchemy::DuplicateElement.new(element, repository: repository).call(\n page_version_id: version.id,\n position: position\n )\n end\n end\n end\n page.update(published_at: public_on)\n end\n\n Alchemy.publish_targets.each { |p| p.perform_later(page) }\n end",
"def test04_EmptyGTDTiLDPublish\n\t\t\tloginPost\n\t\t\t$browser.goto($patch_event)\n\t\t\tsleep 2\n\t\t\tif $post_now.exists?\n\t\t\t\tpostPublishLater\n\t\t\t\t$post_now.fire_event(\"onclick\")\n\t\t\telse puts \"PPL04T04: FAILED! Unable to locate Post button.\"\n\t\t\tend\n\t\t\n\t\t\tbegin\n\t\t\tassert $post_now.exists?\n\t\t\t\trescue => e\n\t\t\t\tputs (\"PPL04T04: FAILED! User able to Post.\")\n\t\t\t\tputs e\n\t\t\tend\n\t\tend",
"def publish\n fail_with! 'Already published' if version.published?\n\n version.published_at = Time.zone.now\n version.active = true\n\n ActiveRecord::Base.transaction do\n save_or_die! version\n TosVersion.where.not(id: version.id).update_all(active: false)\n end\n\n reset_tos_acceptance\n end",
"def unpublished\n respond_with(published_query(false) + Page.where(:published_on.exists => false).all)\n end",
"def published?\n published.eql?(true)\n end",
"def create\n @post = Post.new(post_params)\n # authorize! :create, @post\n @post.user_id = current_user.id\n if current_user.is_admin\n @post.published = true\n else\n @post.published = false\n end\n respond_to do |format|\n if @post.save\n format.html { redirect_to dashboard_index_path, notice: 'Post was successfully created.' }\n format.json { render action: 'show', status: :created, location: @post }\n else\n format.html { render action: 'new' }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def published?\r\n (publish_at.nil? || (publish_at <=> Time.now) <= 0) && (unpublish_at.nil? || (unpublish_at <=> Time.now) >= 0)\r\n end",
"def publish\n load_resource\n resource_instance_variable.public = true\n resource_instance_variable.save\n flash[:notice] = t(\"page_published\", :name => resource_instance_variable.name)\n redirect_back_or_to_default(resources_path)\n end",
"def published?\n !published_at.nil?\n end",
"def publish(blog_posts)\n\t\tblog_posts.each do |key, value|\n\t\tputs (\"\\n Title: #{value[0]} \\n Created at: #{key} \\n Created by: #{value[1]} \\n Post: #{value[2]} \\n }\")\n\tend\n\tend",
"def publish\n @article = Article.find(params[:id])\n @article.change_publish_status(1)\n flash[:notice] = \"Article status changed to published.\"\n redirect_to :back\n rescue Exception => e\n log_exception(e)\n flash[:warning] = \"Error!\"\n redirect_to :back\n end"
] |
[
"0.7406649",
"0.7263694",
"0.72541285",
"0.7223113",
"0.71972275",
"0.71782094",
"0.7161214",
"0.7159091",
"0.71373683",
"0.71267724",
"0.71267724",
"0.7094058",
"0.70638865",
"0.7050111",
"0.70419884",
"0.70189637",
"0.70066524",
"0.7000333",
"0.69820297",
"0.6974708",
"0.6971594",
"0.6964187",
"0.6962371",
"0.6960098",
"0.6960098",
"0.6960098",
"0.6938645",
"0.69277984",
"0.69149756",
"0.6910585",
"0.6908506",
"0.690524",
"0.6899862",
"0.68923736",
"0.68274903",
"0.68122613",
"0.6811247",
"0.6780053",
"0.6703148",
"0.6695245",
"0.6695245",
"0.6695245",
"0.6694821",
"0.6651723",
"0.6650318",
"0.66388947",
"0.6615752",
"0.6597506",
"0.6582193",
"0.6562414",
"0.6536196",
"0.6533116",
"0.65105176",
"0.65105176",
"0.65105176",
"0.65105176",
"0.65105176",
"0.64501137",
"0.64406824",
"0.64380956",
"0.64120233",
"0.6403612",
"0.64003366",
"0.6387242",
"0.6376387",
"0.6370509",
"0.6360868",
"0.63518995",
"0.6344899",
"0.6340221",
"0.63187855",
"0.630687",
"0.6298763",
"0.6292588",
"0.628868",
"0.6277856",
"0.6273817",
"0.6266476",
"0.62664723",
"0.62664723",
"0.6255555",
"0.62389135",
"0.62311774",
"0.62307835",
"0.61986196",
"0.61898494",
"0.61852854",
"0.61845195",
"0.61773247",
"0.6176072",
"0.61705",
"0.61590075",
"0.6158315",
"0.61499304",
"0.61491686",
"0.61294127",
"0.61265594",
"0.6119186",
"0.6106142",
"0.6104771"
] |
0.66427946
|
45
|
To archive an published post!
|
def archive!
return false if published_at.nil?
update_column :published_at, nil
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def publish\n @options['date'] ||= read_draft_date || Time.now.iso8601\n\n post_options = {\n 'title' => read_draft_title,\n 'date' => @options['date'],\n 'slug' => publish_slug,\n 'content' => read_draft_content,\n 'dir' => @options['dir'],\n 'type' => 'post from draft'\n }\n\n # Create a new post file\n #\n Post.new(post_options).write\n \n # Remove the old draft file\n #\n FileUtils.rm @options['path']\n\n end",
"def publish\n @options['date'] ||= read_post_yaml('date') || Time.now.iso8601\n @options['title'] = read_post_yaml('title')\n\n post_options = {\n 'title' => @options['title'],\n 'date' => @options['date'],\n 'slug' => path_slug(@options['path']),\n 'extension' => File.extname(@options['path']).sub(/^\\./, ''),\n 'content' => read_post_content,\n 'dir' => @options['dir'],\n 'type' => \"post from draft\",\n 'write_message' => \"Published: #{relative_path(path)} →\",\n 'force' => @options['force']\n }\n\n # Create a new post file\n #\n Post.new(site, post_options).write\n \n # Remove the old draft file\n #\n FileUtils.rm @options['path']\n\n end",
"def archive\n perform_action(:post, 'archive')\n end",
"def published_post\n if self.published && self.published_at.nil?\n self.published_at = Time.now\n end\n end",
"def publish(args)\n if args.length == 0\n Dir.foreach('_drafts') do |filename|\n FileUtils.mv \"_drafts/#{filename}\", \"_posts/#{filename}\", :force => true\n end\n else\n args.each do |name|\n Dir.foreach('_drafts') do |filename|\n if filename.include? name\n FileUtils.mv \"_drafts/#{filename}\", \"_posts/#{filename}\", :force => true\n exec \"git add . && git commit -m 'Publish #{filename}'\"\n end\n end\n end\n end\n end",
"def archive\n @truncate_posts = true\n year = params[:year]\n month = params[:month]\n @date = Date.parse(\"#{year}-#{month}-01\").strftime('%B, %Y')\n @posts = Post.from_archive(year, month)\n\n if can? :read_drafts, Post\n @posts = @posts.recent\n else\n @posts = @posts.recently_published\n end\n\n respond_to do |format|\n format.html { @posts = @posts.page(params[:page]).per(10) }\n format.json { }\n end\n end",
"def publish_now!\n puts 'publish noew...'\n self.status = Post::PUBLISHED\n self.published_at = self.publish_at\n save!\n end",
"def publish(all_blog_posts)\n\t\tall_blog_posts.each do |blog_post|\n\t\t\tputs blog_post.title\n\t\t\tputs blog_post.created_at\n\t\t\tputs blog_post.content\n\tend\n end",
"def publish\n self.published = true\n end",
"def publish(blog_posts)\n\t\tblog_posts.each do |key, value|\n\t\tputs (\"\\n Title: #{value[0]} \\n Created at: #{key} \\n Created by: #{value[1]} \\n Post: #{value[2]} \\n }\")\n\tend\n\tend",
"def publish\n end",
"def publish\n end",
"def publish\n end",
"def publish!(entry)\n # no-op (for now)\n end",
"def export_post(post) end",
"def publish!\n self.published = true\n save\n end",
"def publish\n respond_to do |format|\n if @post.publish!\n format.html { redirect_to blog_post_no_prefix_path(@blog, @post),\n notice: 'Post was successfully published.' }\n format.json { render :show, status: :ok, location: @post }\n else\n format.html { render :edit }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def publish\n status_id = STATUSES.index('published')\n set_published_at\n end",
"def published?; end",
"def published?; end",
"def publish!\r\n publish\r\n save!\r\n end",
"def index\n @posts = Post.published.order('published_at DESC')\n end",
"def publish\n @post = Post.find(params[:id])\n @post.state = 'published'\n if @post.save\n flash[:notice] = \"published successfully\"\n # merge :id into params\n redirect_to edit_post_url(@post)\n end\n end",
"def posts; end",
"def publish_front_page\n\t\tsystem 'clear'\n\t\t@post_list.each do |post|\n\t\t\tif post.sponsored == true\n\t\t\t\tputs \"*****Post #{post.title}*****\"\n\t\t\telse\n\t\t\t\tputs \"Post #{post.title}\"\n\t\t\tend\n\t\t\tputs \"#{post.text}\"\n\t\t\tputs \"#{post.creation_date}\"\n\t\t\tputs \"-----------------------\"\n\t\tend\n\tend",
"def publish!\n publish\n save\n end",
"def publish\n if self.draft\n self.published_at = nil\n else\n self.published_at ||= DateTime.now\n end\n end",
"def publish(all_blog_posts) #something wrong with publish\n all_blog_posts.each do |blog_post| #something wrong with each here\n puts blog_post.title\n puts blog_post.created_at\n puts blog_post.content\n end\n end",
"def publish\r\n return if published?\r\n self.publish_at = Time.now\r\n self.unpublish_at = nil\r\n end",
"def publish!\n self.published = true\n if self.respond_to?(:publish_on)\n self.publish_on ||= Date.today\n end\n self.save\n end",
"def publish!\n self.update_attribute(:published, true)\n end",
"def p_publish( obj )\n puts \"## Page: #{ obj.link }, updated #{ obj.updated }\"\n end",
"def publish!\n return false unless published_at.nil?\n\n update_column :published_at, Time.zone.now\n end",
"def index\n @posts = Post.order(\"published_at DESC\").all\n end",
"def publish(all_posts)\n\t\tall_posts.each do |key, value|\n\t\t\tputs key\n\t\t\tputs value\t\t\t\n\t\t\tend\n\tend",
"def publish\n p = Page.find_by_id(params[:id])\n p.published_on = Time.now\n p.save!\n respond_with p, :location => nil\n end",
"def bulk_published\n true\n end",
"def publish\n\t\tchanged = !published?\n\t\tself.status = 'published'\n\t\tchanged\n\tend",
"def publish_n_unpublish\n @object = params[:class_name].constantize.find(params[:id])\n @object.update(published: !@object.published) if @object.author?(current_user)\n end",
"def create_post_action\n post = Post.create(:title => \"Untitled Post\", :title_html => \"\", :content => \"\", :content_html => \"\", :javascript => \"\", :css => \"\", :is_public => false, :sort_id => 1)\n post.tags = [Tag.get_tag_by_name(\"home\")]\n post.sort_id = post.id\n post.markdown!\n post.save!\n flash[:notice] = \"New post created.\"\n return redirect_to \"/edit_post/\" + post.id.to_s\n end",
"def unpublish\n self.published = false\n end",
"def post(post_name, tags: ['ruby'])\n time = Time.now\n file_name = time.to_date.to_s + '-' + Slugify.(post_name) + '.md'\n\n File.write(POSTS_PATH + file_name, FileContent.(post_name, time, tags))\nend",
"def publish(_ = nil)\n answers.each do |answer|\n answer.publish! if answer.submitted?\n end\n self.publisher = User.stamper || User.system\n self.published_at = Time.zone.now\n end",
"def create\n @post = current_user.posts.new(params[:post])\n @post.edited_at = Time.current\n @post.published_at = Time.current if params[:publish]\n if @post.save\n flash[:success] = \"Post criado com sucesso.\"\n redirect_to admin_posts_path\n else\n @page_title = \"Novo Post\"\n render :action => 'new'\n end\n end",
"def archive_for(month, year) \n from_date = Time.parse(\"#{month}/01/#{year}\") # mm/dd/yy\n to_date = from_date.end_of_month\n children.public.published_between(from_date, to_date).order_by('published_at DESC')\n end",
"def publish!\n return true if published?\n publish_status!\n end",
"def unpublished; end",
"def publish\n return true if self.published_at\n\n if self.new_record?\n return false unless self.save\n end\n\n self.published_at = Time.now\n self.save\n end",
"def publish\n\n current_user_or_redirect ? nil : return\n\n @post = Post.find(params[:id])\n # topic = Topic.where(\"id = ?\", params[:topic]).first\n # if topic\n # @post.topics << topic unless @post.topics.include?(topic)\n # end\n \n if !@post.mine?(@current_user.id)\n redirect_to root_path\n return\n end\n \n @post.status = 'live'\n\n respond_to do |format|\n if @post.update_attributes(params[:post])\n @post.update_created_at\n @post.delay.add_interactions\n format.html { redirect_to @post.link_for_post, notice: 'Post was successfully published.' }\n format.json { head :no_content }\n format.js\n else\n format.html { render action: \"edit\" }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n format.js\n end\n end\n end",
"def build_post_from_entry(entry, action)\n date = if (action == Service::SERVICE_ACTION_POST) || (self.posts.count == 0)\n entry[:pubDate]\n else\n Time.current\n end\n\n self.posts.build(\n :summary => (entry[:description].blank? ? '-' : entry[:description]),\n :service_action => action,\n :identifier => entry[:guid].to_s,\n :title => entry[:title],\n :markup => Post::PLAIN_MARKUP,\n :url => entry[:link],\n :published_at => date,\n :extra_content => {\n :author_name => entry[:author_name],\n :original_tags => entry[:categories] # array de tags\n }\n )\n end",
"def destroy\n @post.archive = true\n @post.save\n respond_to do |format|\n format.html { redirect_to posts_path, notice: 'Post was successfully archived.' }\n format.json { head :no_content }\n end\n end",
"def archive_mine\n\t\tif params[:user_id]\n\t\t\t@posts = Post.where(user_id: User.find(params[:user_id]).id).reverse\n\t\telse\n\t\t\t@posts = Post.where(user_id: current_user.id).reverse\n\t\tend\n\tend",
"def publish_now!\n self.status = Micropost::PUBLISHED\n self.published_at = self.publish_at\n save!\n end",
"def archive\n self.paper_trail_event = \"archive\"\n self.discard\n end",
"def post\n # TODO re-enable blog post creation. Requires a config file.\n #if @args.length > 0\n # new_post = BlogPost.new(@args.first, @config)\n #else\n # @stderr.puts 'create:post requires a filename. Try yuzu create:post \"Post Title Here\"'\n #end\n end",
"def publish_now(email, password)\n self.state = :published\n return edit(email,password) if post_id\n write(email,password)\n end",
"def archive\n self.snapshot_action = \"archive\"\n self.discard\n end",
"def store_blog_post(time, author, title, content)\n\t\tvalue = []\n\t\tvalue[0] = title\n\t\tvalue[1] = author\n\t\tvalue[2] = content\n\t\tget_blog_posts.store(time, value)\t\n\tend",
"def publish\n\t\t@article.publish!\n\t\tredirect_to @article\n\tend",
"def archives\n render :template => \"blog_posts/archives\"\n end",
"def archive_the_url\n if is_archived?\n logger.info \"Queued the archiving of the url with id: #{id}\"\n Resque.enqueue(BookmarkArchiver, id)\n end\n end",
"def can_publish?\n !published_at\n end",
"def publish\n Poll.published.each do |poll|\n poll.archive unless poll.id == self.id\n end\n node.make_visible\n end",
"def publish\n public_content.delete if public_content\n PublicContent.create!(\n content: self,\n topic:,\n text:,\n otu:\n )\n end",
"def show\n if params[:id] == 'last'\n @post = Post.published.order('published_at DESC').first\n else\n @post = Post.find(params[:id])\n end\n end",
"def publish!(current_time = Time.current)\n PublishPageJob.perform_later(id, public_on: current_time)\n end",
"def read_posts(dir)\n read_publishable(dir, \"_posts\", Document::DATE_FILENAME_MATCHER)\n end",
"def publish!\n raise 'Not implemented!'\n end",
"def create\n params[:post][:published_at] = \"#{params[:published_date]} #{params[:date][:hour]}:#{params[:date][:minute]}:00\"\n\n if params[:post_id]\n Post.find(params[:post_id]).update_attributes(params[:post])\n this_post_id = params[:post_id]\n else\n this_post = Post.create(params[:post])\n this_post_id = this_post.id\n end\n\n redirect_to blog_path(this_post_id)\n end",
"def archive(id:)\n client.execute(method: :put, path: \"/live_events/#{id}/archive\")\n end",
"def add_post(post)\n @posts << post #pushes post into post array so that we can compare the author with that author\n post.author = self\nend",
"def publish\n fail_with! 'Already published' if version.published?\n\n version.published_at = Time.zone.now\n version.active = true\n\n ActiveRecord::Base.transaction do\n save_or_die! version\n TosVersion.where.not(id: version.id).update_all(active: false)\n end\n\n reset_tos_acceptance\n end",
"def unarchive\n perform_action(:post, 'unarchive')\n end",
"def create\n redirect_to posts_path and return unless Mist.authorized?(:create_post, self)\n coerce_date(params[:post], 'published_at')\n @post = Mist::Post.new(params[:post])\n\n respond_to do |format|\n if @post.save\n format.html { redirect_to @post, :notice => 'Post was successfully created.' }\n format.json { render :json => @post, :status => :created, :location => @post }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @post.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def publish_directly\n publish!\n end",
"def unpublish\r\n return unless published?\r\n self.unpublish_at = 1.minute.ago\r\n end",
"def turn_to_status_post\n fail_with! 'Post already is StatusPost' if @post.status?\n\n if @post.uploads.count.zero?\n @post.type = 'StatusPost'\n @post.title = nil\n @post.save or fail_with! @post.errors\n\n FeedEventsManager.new(user: user, target: @post).turn_to_status_event\n\n @post.elastic_index_document\n @post\n end\n end",
"def publish\n self.status = 'published'\n self.pubilshed_at = DateTime.now\n self.html = Markdown.parse self.content\n self.slug = self.title.parameterize\n\n markdown = Redcarpet::Markdown.new(Redcarpet::Render::HTML, autolink: true, tables: true)\n self.html = md.render(self.content)\n\n save\n end",
"def archive\n self.archived_at = Time.current\n end",
"def publish_now\n self.publish_at = Time.now.utc\n self.save!\n end",
"def unpublished_posts\n @blog_posts = BlogPost.where(:deleted => '0').where(:publish => \"0\").order('created_at DESC')\n end",
"def publish!\n self.published = true\n\n # upgrade if necessary\n if upgrade_needed? || current_version.nil?\n upgrade_version!\n else\n save(:validate => false)\n end\n end",
"def preprocess_autopublish_drafts\n puts \"Beginning pre-process step for drafts.\"\n drafts.each do |d|\n if d.autopublish?\n puts \"Autopublishing draft: #{d.title} / #{d.slug}\"\n d.publish!\n end\n end\n end",
"def create\n @post = Post.new(params[:post])\n @post.published = true\n\n respond_to do |format|\n if @post.save\n flash[:notice] = 'Запись успешно создана.'\n format.html { redirect_to(@post) }\n format.xml { render :xml => @post, :status => :created, :location => @post }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @post.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create_posts\n end",
"def create_posts\n end",
"def unpublish!\n self.is_published = false\n save\n end",
"def archive!\n self.update(archived: true)\n NotificationMailer.new(self).document_toggle_archive\n end",
"def publish\n @page.publish\n respond_with(@page, location: published_api_pages_url)\n end",
"def archives\n return @archives if @archives\n dates = Post.one_per_month.collect { |p| p.publish_date }\n return [] if dates.empty?\n archive = []\n archives = [ archive ]\n current_year = dates.first.year\n dates.each do |date|\n if date.year != current_year\n archive = []\n archives << archive\n current_year = date.year\n end\n archive << date\n end\n @archives = archives\n end",
"def publish!\n self.published = true\n self.downloads = 0\n \n # upgrade if necessary\n if upgrade_needed? || current_version.nil?\n upgrade_version!\n else\n save(:validate => false)\n end\n end",
"def archive!\n archive\n save!(validate: false)\n end",
"def archive_params\n params.require(:archive).permit(:name, :title, :body, :publish_at)\n end",
"def index\n @posts = Mist::Post.recently_published(20, Mist.authorized?(:view_drafts, self))\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @posts }\n end\n end",
"def set_published_state; end",
"def publish\n @page = Page.find(params[:id])\n @page.published_on = Time.now\n @page.save\n\n respond_to do |format|\n format.json {render json: @pages}\n format.xml {render xml: @pages}\n end\n end",
"def publish\n @blog_post = BlogPost.find(params[:id])\n respond_to do |format|\n if @blog_post.publish\n format.html { redirect_to(@blog_post) }\n format.xml { head :ok }\n format.json { head :ok } \n else\n format.html { redirect_to(@blog_post) }\n format.xml { render :xml => @blog_post.errors, :status => :unprocessable_entity }\n format.json { render :json => @blog_post.errors.to_json, :status => :unprocessable_entity }\n end\n end\n end",
"def publish!(public_on:)\n Page.transaction do\n version = public_version(public_on)\n DeleteElements.new(version.elements).call\n\n repository = page.draft_version.element_repository\n ActiveRecord::Base.no_touching do\n Element.acts_as_list_no_update do\n repository.visible.not_nested.each.with_index(1) do |element, position|\n Alchemy::DuplicateElement.new(element, repository: repository).call(\n page_version_id: version.id,\n position: position\n )\n end\n end\n end\n page.update(published_at: public_on)\n end\n\n Alchemy.publish_targets.each { |p| p.perform_later(page) }\n end",
"def write_posts\n self.posts.each do |post|\n post.write(self.dest)\n end\n end",
"def write_posts\n self.posts.each do |post|\n post.write(self.dest)\n end\n end"
] |
[
"0.7297874",
"0.72712755",
"0.70562774",
"0.67503256",
"0.6705305",
"0.6694305",
"0.66251767",
"0.65788305",
"0.6553341",
"0.654689",
"0.6536898",
"0.6536898",
"0.6536898",
"0.65101534",
"0.6469682",
"0.6405118",
"0.6375614",
"0.63722783",
"0.63638103",
"0.63638103",
"0.6362257",
"0.6329627",
"0.6329103",
"0.6309327",
"0.6261534",
"0.62454337",
"0.624245",
"0.62316394",
"0.6225232",
"0.6174205",
"0.614945",
"0.61407655",
"0.6126763",
"0.6126428",
"0.611286",
"0.60980386",
"0.6060377",
"0.6043805",
"0.6035762",
"0.60050076",
"0.6004078",
"0.6001084",
"0.6000525",
"0.60001904",
"0.59996223",
"0.59864366",
"0.5947784",
"0.5942686",
"0.59420496",
"0.5928202",
"0.59268016",
"0.59251755",
"0.590633",
"0.590282",
"0.58876926",
"0.5886854",
"0.58751583",
"0.58699435",
"0.58685607",
"0.58619344",
"0.58612114",
"0.5856583",
"0.5844174",
"0.58430284",
"0.58423394",
"0.58322424",
"0.58306396",
"0.58223313",
"0.58161896",
"0.5815037",
"0.57995546",
"0.579342",
"0.5787486",
"0.5785059",
"0.57804245",
"0.57796293",
"0.5770148",
"0.5769982",
"0.5769849",
"0.5757654",
"0.5753463",
"0.5753041",
"0.5752199",
"0.57490623",
"0.57474154",
"0.57474154",
"0.5738998",
"0.57244146",
"0.5716166",
"0.57139844",
"0.5705693",
"0.56981164",
"0.5690987",
"0.568665",
"0.5681773",
"0.5680033",
"0.56794006",
"0.5675915",
"0.56748205",
"0.56748205"
] |
0.68940467
|
3
|
GET /admin/seasons GET /admin/seasons.json
|
def index
@admin_seasons = Season.order(:id).page params[:page]
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def seasons(season = nil)\n @server.make_json_request('show.seasons', tvdbid: @tvdbid, season: season)['data']\n end",
"def index\n @seasons = Season.all\n end",
"def index\n @seasons = Season.all\n end",
"def index\n @seasons = Season.all\n end",
"def index\n @seasons = Season.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @seasons }\n end\n end",
"def index\n render json: {episodes: @season.episodes, season: @season}\n end",
"def season(year, **options) = get(\"/seasons/#{year}\", **{ sportId: 1 }.merge(options))",
"def set_admin_season\n @admin_season = Season.find(params[:id])\n end",
"def show\n @runway_season = Runway::Season.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @runway_season }\n end\n end",
"def set_seasons\n @seasons = Campground.find(params[:campground_id]).seasons\n end",
"def season(series_id, season_id)\n get(\"/catalog/titles/series/#{series_id.to_s}/seasons/#{season_id.to_s}\")\n end",
"def index\n render json: {seasons: @serial.seasons, series: @serial}\n end",
"def index\n @episodes = @season.episodes\n end",
"def tournament_season(id, type = 'sr:tournament')\n get(\"sports/en/tournaments/#{type}:#{id}/seasons.xml\")\n end",
"def show\n render json: {season: @season, series: @serial}\n end",
"def index\n params[:season_url] ||= StepSeason.by_tournament(@tournament.id).last[:url]\n @season = StepSeason.by_tournament(@tournament.id).where(url: params[:season_url]).first\n\n # return error if no season with such url\n error!(\"Incorrect params\", 403) and return if @season.nil?\n\n @dates = Schedule.select(:match_on).joins(\n \"INNER JOIN steps_phases AS tours_phase ON (tours_phase.phase_id = schedules.tour_id) \" +\n \"INNER JOIN steps_phases AS seasons_phase ON (seasons_phase.phase_id = tours_phase.step_id) \"\n ).where(\"seasons_phase.step_id = ? \", @season.id).group(\"match_on\").order(\"match_on ASC\").collect{|item| item.match_on}\n\n respond_to do |format|\n format.json{ render json: {dates: @dates} }\n end\n end",
"def set_season\n @season = Season.find(params[:id])\n end",
"def set_season\n @season = Season.find(params[:id])\n end",
"def set_season\n @season = Season.find(params[:id])\n end",
"def set_season\n @season = Season.find(params[:id])\n end",
"def index\n @seasons = Season.all\n #@teams_sponsors = TeamsSponsor.all\n end",
"def season\n season_id.nil? ? nil : organization_membership.seasons.find(season_id)\n end",
"def index\n if isAdmin\n @seasonals = Seasonal.all\n elsif isGeneral\n @seasonals = Seasonal.where('seasonYear >= ? OR seasonYear is null', DateTime.now.year)\n else\n redirect_to :controller => 'sessions', :action => 'new'\n end\n end",
"def all_seasons_list\n Rails.cache.fetch(\"all_seasons_by_status_list\", :expires_in => 60.minutes) do\n get_all_seasons_by_status\n end\n end",
"def show\n @batting_season = BattingSeason.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @batting_season }\n end\n end",
"def show\n render json: {episode: @episode, season: @season}\n end",
"def index\n @leagues = League.all\n if !League.first.nil?\n @last_season = League.first.seasons.last\n end\n respond_to do |format|\n format.html #index.html.erb\n end\n end",
"def show\n @season = Season.find(session[:season_id])\n\n @divisions = @season.divisions\n @teams = @season.divisions.collect { |div| div.teams.order(\"id desc\").sort_by { |team| team.team_total }.reverse }.flatten\n @weeks = @season.schedule.weeks.order(:date)\n @max_week = @weeks.last\n\n\n @season ||= Season.find(session[:season_id])\n @schedule = @season.schedule\n render 'teams/index', :layout => 'season'\n # respond_to do |format|\n # format.html # show.html.erb\n # format.json { render json: @season }\n # end\n end",
"def set_season\n @season = @serial.seasons.find_by(number: params[:id])\n end",
"def list\n @studios = Studio.all;\n return render json: @studios.to_json, status: 200\n end",
"def index\n if @logged_in\n @teams = @season.teams #Team.all\n else\n @teams = Team.where(:active => true, :season_id => @season.id)\n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @teams.to_xml(:include => :players)}\n format.json { render :json => @teams.to_json(:include => :players) }\n end\n end",
"def create\n @admin_season = Season.new(admin_season_params)\n\n respond_to do |format|\n if @admin_season.save\n format.html { redirect_to @admin_season, success: 'Season was successfully created.' }\n format.json { render :show, status: :created, location: @admin_season }\n else\n format.html { render :new }\n format.json { render json: @admin_season.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n if @season.update(season_params)\n render :show, status: :ok\n else\n render json: @season.errors, status: :unprocessable_entity\n end\n end",
"def show\n \t@season_list = @title.season_list\n \t@episode_list = @title.episodes_for_season(params[:season_choice]||\"All\")\n \tif @episode_list.count == 0\n \t\tparams[:season_choice] = \"All\"\n\t\t\t@episode_list = @title.episodes_for_season(params[:season_choice]||\"All\")\n\t\tend\n \tlogger.debug @episode_list\n end",
"def admin_season_params\n params.require(:season).permit(:id, :league_id, :year, :day, :start_date, :number_of_weeks, :roll_off_weeks, :dates_off, :handicap_base, :handicap_percent, :location, :practice_length, :starts_at)\n end",
"def index\n # Get all the order seasons, active season first, then sort alphibetically\n @order_seasons = OrderSeason.all.order(current_season: :desc).order(:order_season_name)\n end",
"def update\n respond_to do |format|\n if @admin_season.update(admin_season_params)\n format.html { redirect_to @admin_season, success: 'Season was successfully updated.' }\n format.json { render :show, status: :ok, location: @admin_season }\n else\n format.html { render :edit }\n format.json { render json: @admin_season.errors, status: :unprocessable_entity }\n end\n end\n end",
"def sport_players(sport_id, season, **options) = get(\"/sports/#{sport_id}/players\", **options.merge(season:))",
"def index\n @weeks = Week.all.order(:season_id, :week_number)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @weeks }\n end\n end",
"def show\n @show = Show.find(params[:id])\n\n @seasons = {}\n @files = `ls \"public/tv/#{ @show.folder }\"`.split(\"\\n\")\n @files.each do |f|\n @seasons[f] = `find \"public/tv/#{ @show.folder }/#{ f }\" -type f`.split(\"\\n\").map { |ep| ep.gsub('public', '') }\n end\n\n respond_to do |format|\n format.html\n format.json { render json: @show }\n end\n end",
"def index\n if @logged_in\n @seasons = Season.order('start_date desc')\n else\n @seasons = Season.where(\"active = ? or current = ?\", true, true).order('start_date desc')\n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @seasons }\n end\n end",
"def index\n @games = @season.games #Game.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @games }\n end\n end",
"def show\n #@season = Season.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @season }\n end\n end",
"def set_season\n @season = Season.find(params[:id])\n unless @logged_in.update_site?\n @season.readonly!\n end\n end",
"def season\n @season ||= Season.find(@importer_hash.meeting.season_id)\n end",
"def set_season\n id = season_params[:id]\n @season = ::Season.find(id)\n authorize_action_for @season\n end",
"def load_season(year)\n puts \"Loading the #{year}-#{year.to_i+1} season...\"\n season = NbaAdvancedStats::Season.find_or_create_with_api(year)\n puts \"Data Ready.\"\n self.add_line_break\n self.main_menu(season)\n end",
"def index\n @lab_seminars = Lab::Seminar.all\n end",
"def retrieve_closed_seasons\n @season_type.seasons.where(['end_date < ?', Date.today])\n .sort_season_by_begin_date('DESC')\n end",
"def get_closed_seasons\n @closed_seasons ||= retrieve_closed_seasons\n end",
"def applied_season(season_id)\n seasons.where(org_season_id: BSON::ObjectId.from_string(season_id)).first\n end",
"def new\n @runway_season = Runway::Season.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @runway_season }\n end\n end",
"def index\n @studios = Studio.page(params[:page]).per(1000)\n end",
"def destroy\n @admin_season.destroy\n respond_to do |format|\n format.html { redirect_to admin_seasons_url, success: 'Season was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def set_seasonal\n @seasonal = Seasonal.find(params[:id])\n end",
"def create\n @season = Season.new(season_params)\n\n if @season.save\n render :show, status: :created\n else\n render json: @season.errors, status: :unprocessable_entity\n end\n end",
"def destroy\n if @season\n @season.destroy\n render json: {success: \"true\", message:\"Season was successfully deleted\", series: @serial}\n else\n render json: {success: \"false\", message:\"Season doesn't exists\", series: @serial}\n end\n end",
"def find_manageable_seasons( check_date = Date.today() )\n @seasons_found = true\n @seasons_ids = @user.\n team_managers.\n joins( team_affiliation: :season ).\n where( ['seasons.end_date >= ? and seasons.begin_date <= ?', check_date, check_date]).\n select( \"team_affiliations.season_id\" ).\n map{ |tm| tm.season_id }\n end",
"def index\n @game_studios = GameStudio.all\n end",
"def season\n Allocine::Season.new(document[\"parentSeason\"][\"code\"])\n end",
"def get_schedule\n response = @client.full_game_schedule(@options[:season])\n parse_schedule_response(response)\n end",
"def season_number\n @ole.SeasonNumber\n end",
"def get_all_seasons_by_status\n dateNow = DateTime.now.end_of_day\n all_seasons = Hash.new\n all_seasons[:upcoming] = Array.new\n all_seasons[:current] = Array.new\n all_seasons[:past] = Array.new\n seasons = Season.all\n\n seasons.each do |season|\n if (season.is_active) # current or upcoming season\n # going to assume if today is part the season end date that the league owner intentionally wanted the season to be current\n if (season.date_start <= dateNow)\n all_seasons[:current].push(season)\n else\n all_seasons[:upcoming].push(season)\n end\n else # past season\n all_seasons[:past].push(season)\n end\n end\n all_seasons\n end",
"def new\n @season = Season.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @season }\n end\n end",
"def season_sponsors\n season_id = params[:season_id].to_i\n @season = Season.find_by(:id => season_id)\n season_teams = get_teams_by_given_season(season_id, true)\n # get the list of teams in ever division\n season_team_ids = Array.new\n \n season_teams.each do |team|\n season_team_ids.push(team.id)\n end\n \n teams_sponsors = TeamsSponsor.where(:team_id => season_team_ids)\n @team_sponsors = sponsors_by_team(teams_sponsors)\n end",
"def index\n @semesters = Semester.all\n end",
"def index\n @semesters = Semester.all\n end",
"def show\n @round = @season.rounds.find(params[:id])\n\n if @round.published || signed_in_as_admin?\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @round }\n end\n else\n redirect_to season_path(@round.season)\n end\n end",
"def season_status\n season_st = []\n @organization = Organization.where(:_id => session[:current_org]).first\n @organization.seasons.each do |each_seasons|\n season_st << each_seasons.is_current\n end\n return season_st\n end",
"def index\n page_number = params[:page] ? params[:page][:number] : 1\n per_page = params[:per_page] ? params[:per_page] : 10\n\n @standings = Standing.paginate(page: page_number, per_page: per_page)\n\n render json: @standings\n end",
"def show\n @season.create_unfilled_memberships\n end",
"def new_episodes( season )\n return @seasons[season][1].flatten\n end",
"def index\n @team = Team.find(params[:team_id])\n @sprints = @team.sprints.find(:all)\n\n respond_to do |format|\n format.html\n format.json\n end\n end",
"def destroy\n @runway_season = Runway::Season.find(params[:id])\n @runway_season.destroy\n\n respond_to do |format|\n format.html { redirect_to runway_seasons_url }\n format.json { head :no_content }\n end\n end",
"def index\n @episodes = @series.episodes.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @episodes }\n end\n end",
"def get_searched_seasons\n current_seasons = if params['header_year'].present?\n Season.where( \"header_year LIKE '%#{ params['header_year'] }%'\" )\n else\n Season.is_not_ended\n end\n current_seasons.map{ |season| season.id }\n end",
"def update\n respond_to do |format|\n if @season.update(season_params)\n format.html { redirect_to @season, notice: 'Season was successfully updated.' }\n format.json { render :show, status: :ok, location: @season }\n else\n format.html { render :edit }\n format.json { render json: @season.errors, status: :unprocessable_entity }\n end\n end\n end",
"def season_params\n params.require(:season).permit(:campground_id, :name, :start_date, :end_date)\n end",
"def season_params\n params.permit(:id, :format, :game_id, :filters => [:season_id, :game_id])\n end",
"def add_season(season)\r\n seasons << season\r\n end",
"def destroy\n @season = Season.find(params[:id])\n @season.destroy\n\n respond_to do |format|\n format.html { redirect_to seasons_url }\n format.json { head :ok }\n end\n end",
"def show\n @skills = Announcament.find(params[:id]).skill\n @seasons = Announcament.find(params[:id]).season\n end",
"def index\n @sports = Sport.all.sort_by{|x| [x.season.start, x.start_date, x.name, x.group]}\n end",
"def update\n respond_with @season.update(season_params)\n end",
"def seasonal_params\n params.require(:seasonal).permit(:season, :seasonYear, :piecePay, :employee_id, :verified, :seasonals_id)\n end",
"def create\n @season = Season.new(season_params)\n\n respond_to do |format|\n if @season.save\n format.html { redirect_to @season, notice: 'Season was successfully created.' }\n format.json { render :show, status: :created, location: @season }\n else\n format.html { render :new }\n format.json { render json: @season.errors, status: :unprocessable_entity }\n end\n end\n end",
"def show\n @photos = @spot.photos.all\n @schools = @spot.schools.all\n gon.seasons = []\n @spot.seasons.each do |s|\n gon.seasons[s.sport.id] = s.get_months_array\n end\n\n\n if request.path != country_spot_path(@country, @spot)\n return redirect_to [@country, @spot], :status => :moved_permanently\n end\n \n end",
"def show\n @photos = @spot.photos.all\n @schools = @spot.schools.all\n gon.seasons = []\n @spot.seasons.each do |s|\n gon.seasons[s.sport.id] = s.get_months_array\n end\n\n\n if request.path != country_spot_path(@country, @spot)\n return redirect_to [@country, @spot], :status => :moved_permanently\n end\n \n end",
"def semesters\n uni_year = UniYear.find_by_id(params[:uni_year_id])\n @semesters = uni_year ? uni_year.semesters : []\n \n respond_to do |format|\n format.json { render json: @semesters }\n end\n end",
"def get_season_id\n season ? season.id : 0\n end",
"def division\n\t\tself.division_season\n\tend",
"def index\n @sprojects = current_user.sprojects.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @sprojects }\n end\n end",
"def index\n @liasons = Liason.all\n end",
"def scrape_season\n doc = Nokogiri::HTML(open(url))\n \n seasonality_url = doc.search(\"#survival-guide ul li:nth-child(2) a\").attr(\"href\").text #get country weather url\n weather_pg = Nokogiri::HTML(open(seasonality_url))\n \n #get high, low, and best time to visit information\n @high_season = weather_pg.search(\"div.card--page__content p:nth-child(1)\").text\n @low_season = weather_pg.search(\"div.card--page__content p:nth-child(5)\").first.text\n\n shoulder_season = weather_pg.search(\"div.card--page__content p:nth-child(3)\").first.text\n @best_visit_season = \"Best time to visit \" + shoulder_season[16..-1]\n end",
"def regular_season_rankings(season = nil)\n stats_request(\"regularSeasonStatRankings\", season).first\n end",
"def season_params\n params.require(:season).permit(:id, :name, :current, :active, :start_date, :game_duration)\n end",
"def index\n if params[:season] == \"both\"\n @sports = Sport.all\n elsif params[:season] == \"summer\"\n @sports = Sport.where(season: Season.find(1))\n elsif params[:season] == \"winter\"\n @sports = Sport.where(season: Season.find(2))\n elsif params[:season] == nil\n redirect_to '/'\n end\n puts \"GOT TO HERE\"\n \n\n # @sports = Sport.all\n\n # @winter_sports = []\n # @summer_sports = []\n \n\n # @sports.each do |sport| \n # if sport.season[:id] == 2\n # @winter_sports << sport\n # elsif\n # sport.season[:id] == 1\n # @summer_sports << sport\n # end\n # end \n #new variable (@season) when selected \n end",
"def destroy\n # @season = Season.find(params[:id])\n # @season.destroy\n\n respond_to do |format|\n format.html { redirect_to seasons_url }\n format.json { head :no_content }\n end\n end",
"def index\n @teams = @club.teams\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @teams }\n end\n end",
"def destroy\n @season.destroy\n respond_to do |format|\n format.html { redirect_to seasons_url, notice: 'Season was successfully destroyed.' }\n format.json { head :no_content }\n end\n end"
] |
[
"0.8196942",
"0.7891486",
"0.7891486",
"0.7891486",
"0.7738101",
"0.76770204",
"0.7667941",
"0.7503564",
"0.74072254",
"0.7363416",
"0.73052025",
"0.7289331",
"0.72162664",
"0.7134791",
"0.7009921",
"0.69439167",
"0.69180185",
"0.69180185",
"0.69180185",
"0.69180185",
"0.6905651",
"0.6851068",
"0.6844091",
"0.68226963",
"0.6806783",
"0.6756735",
"0.670656",
"0.6694405",
"0.6632085",
"0.662647",
"0.662503",
"0.6566926",
"0.6563179",
"0.65605724",
"0.65575504",
"0.65373164",
"0.6523516",
"0.6487307",
"0.6485008",
"0.64684236",
"0.6445815",
"0.64136356",
"0.6411567",
"0.6404016",
"0.6380253",
"0.63631684",
"0.63501114",
"0.63333714",
"0.63277006",
"0.63074285",
"0.62895197",
"0.6288281",
"0.6285309",
"0.62746495",
"0.6270391",
"0.62635434",
"0.626083",
"0.6259353",
"0.62534696",
"0.62477165",
"0.6246078",
"0.62217176",
"0.6218928",
"0.6213575",
"0.615842",
"0.61352307",
"0.61352307",
"0.61236256",
"0.61132264",
"0.6112455",
"0.6102532",
"0.6100032",
"0.6091892",
"0.60846394",
"0.60792464",
"0.6075885",
"0.60680014",
"0.60521847",
"0.60496587",
"0.60412234",
"0.60290545",
"0.6027491",
"0.60200214",
"0.6019748",
"0.60140127",
"0.6007493",
"0.6006467",
"0.6006467",
"0.6006202",
"0.59830755",
"0.59821486",
"0.5980924",
"0.59523696",
"0.5949917",
"0.5949114",
"0.5937416",
"0.59280103",
"0.5927759",
"0.59261996",
"0.59234804"
] |
0.78801215
|
4
|
GET /admin/seasons/1 GET /admin/seasons/1.json
|
def show
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def index\n @admin_seasons = Season.order(:id).page params[:page]\n end",
"def set_admin_season\n @admin_season = Season.find(params[:id])\n end",
"def index\n @seasons = Season.all\n end",
"def index\n @seasons = Season.all\n end",
"def index\n @seasons = Season.all\n end",
"def show\n @runway_season = Runway::Season.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @runway_season }\n end\n end",
"def seasons(season = nil)\n @server.make_json_request('show.seasons', tvdbid: @tvdbid, season: season)['data']\n end",
"def index\n @seasons = Season.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @seasons }\n end\n end",
"def index\n render json: {episodes: @season.episodes, season: @season}\n end",
"def season(year, **options) = get(\"/seasons/#{year}\", **{ sportId: 1 }.merge(options))",
"def season(series_id, season_id)\n get(\"/catalog/titles/series/#{series_id.to_s}/seasons/#{season_id.to_s}\")\n end",
"def index\n render json: {seasons: @serial.seasons, series: @serial}\n end",
"def show\n render json: {season: @season, series: @serial}\n end",
"def set_seasons\n @seasons = Campground.find(params[:campground_id]).seasons\n end",
"def show\n @batting_season = BattingSeason.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @batting_season }\n end\n end",
"def tournament_season(id, type = 'sr:tournament')\n get(\"sports/en/tournaments/#{type}:#{id}/seasons.xml\")\n end",
"def index\n @episodes = @season.episodes\n end",
"def set_season\n @season = Season.find(params[:id])\n end",
"def set_season\n @season = Season.find(params[:id])\n end",
"def set_season\n @season = Season.find(params[:id])\n end",
"def set_season\n @season = Season.find(params[:id])\n end",
"def show\n render json: {episode: @episode, season: @season}\n end",
"def index\n @leagues = League.all\n if !League.first.nil?\n @last_season = League.first.seasons.last\n end\n respond_to do |format|\n format.html #index.html.erb\n end\n end",
"def season\n season_id.nil? ? nil : organization_membership.seasons.find(season_id)\n end",
"def show\n @season = Season.find(session[:season_id])\n\n @divisions = @season.divisions\n @teams = @season.divisions.collect { |div| div.teams.order(\"id desc\").sort_by { |team| team.team_total }.reverse }.flatten\n @weeks = @season.schedule.weeks.order(:date)\n @max_week = @weeks.last\n\n\n @season ||= Season.find(session[:season_id])\n @schedule = @season.schedule\n render 'teams/index', :layout => 'season'\n # respond_to do |format|\n # format.html # show.html.erb\n # format.json { render json: @season }\n # end\n end",
"def index\n params[:season_url] ||= StepSeason.by_tournament(@tournament.id).last[:url]\n @season = StepSeason.by_tournament(@tournament.id).where(url: params[:season_url]).first\n\n # return error if no season with such url\n error!(\"Incorrect params\", 403) and return if @season.nil?\n\n @dates = Schedule.select(:match_on).joins(\n \"INNER JOIN steps_phases AS tours_phase ON (tours_phase.phase_id = schedules.tour_id) \" +\n \"INNER JOIN steps_phases AS seasons_phase ON (seasons_phase.phase_id = tours_phase.step_id) \"\n ).where(\"seasons_phase.step_id = ? \", @season.id).group(\"match_on\").order(\"match_on ASC\").collect{|item| item.match_on}\n\n respond_to do |format|\n format.json{ render json: {dates: @dates} }\n end\n end",
"def index\n if isAdmin\n @seasonals = Seasonal.all\n elsif isGeneral\n @seasonals = Seasonal.where('seasonYear >= ? OR seasonYear is null', DateTime.now.year)\n else\n redirect_to :controller => 'sessions', :action => 'new'\n end\n end",
"def update\n respond_to do |format|\n if @admin_season.update(admin_season_params)\n format.html { redirect_to @admin_season, success: 'Season was successfully updated.' }\n format.json { render :show, status: :ok, location: @admin_season }\n else\n format.html { render :edit }\n format.json { render json: @admin_season.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @admin_season = Season.new(admin_season_params)\n\n respond_to do |format|\n if @admin_season.save\n format.html { redirect_to @admin_season, success: 'Season was successfully created.' }\n format.json { render :show, status: :created, location: @admin_season }\n else\n format.html { render :new }\n format.json { render json: @admin_season.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n if @season.update(season_params)\n render :show, status: :ok\n else\n render json: @season.errors, status: :unprocessable_entity\n end\n end",
"def index\n @seasons = Season.all\n #@teams_sponsors = TeamsSponsor.all\n end",
"def show\n #@season = Season.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @season }\n end\n end",
"def set_season\n @season = @serial.seasons.find_by(number: params[:id])\n end",
"def new\n @runway_season = Runway::Season.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @runway_season }\n end\n end",
"def show\n @show = Show.find(params[:id])\n\n @seasons = {}\n @files = `ls \"public/tv/#{ @show.folder }\"`.split(\"\\n\")\n @files.each do |f|\n @seasons[f] = `find \"public/tv/#{ @show.folder }/#{ f }\" -type f`.split(\"\\n\").map { |ep| ep.gsub('public', '') }\n end\n\n respond_to do |format|\n format.html\n format.json { render json: @show }\n end\n end",
"def show\n \t@season_list = @title.season_list\n \t@episode_list = @title.episodes_for_season(params[:season_choice]||\"All\")\n \tif @episode_list.count == 0\n \t\tparams[:season_choice] = \"All\"\n\t\t\t@episode_list = @title.episodes_for_season(params[:season_choice]||\"All\")\n\t\tend\n \tlogger.debug @episode_list\n end",
"def new\n @season = Season.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @season }\n end\n end",
"def list\n @studios = Studio.all;\n return render json: @studios.to_json, status: 200\n end",
"def admin_season_params\n params.require(:season).permit(:id, :league_id, :year, :day, :start_date, :number_of_weeks, :roll_off_weeks, :dates_off, :handicap_base, :handicap_percent, :location, :practice_length, :starts_at)\n end",
"def set_season\n @season = Season.find(params[:id])\n unless @logged_in.update_site?\n @season.readonly!\n end\n end",
"def index\n @weeks = Week.all.order(:season_id, :week_number)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @weeks }\n end\n end",
"def index\n if @logged_in\n @teams = @season.teams #Team.all\n else\n @teams = Team.where(:active => true, :season_id => @season.id)\n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @teams.to_xml(:include => :players)}\n format.json { render :json => @teams.to_json(:include => :players) }\n end\n end",
"def show\n @round = @season.rounds.find(params[:id])\n\n if @round.published || signed_in_as_admin?\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @round }\n end\n else\n redirect_to season_path(@round.season)\n end\n end",
"def all_seasons_list\n Rails.cache.fetch(\"all_seasons_by_status_list\", :expires_in => 60.minutes) do\n get_all_seasons_by_status\n end\n end",
"def applied_season(season_id)\n seasons.where(org_season_id: BSON::ObjectId.from_string(season_id)).first\n end",
"def set_season\n id = season_params[:id]\n @season = ::Season.find(id)\n authorize_action_for @season\n end",
"def destroy\n @admin_season.destroy\n respond_to do |format|\n format.html { redirect_to admin_seasons_url, success: 'Season was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def index\n if @logged_in\n @seasons = Season.order('start_date desc')\n else\n @seasons = Season.where(\"active = ? or current = ?\", true, true).order('start_date desc')\n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @seasons }\n end\n end",
"def set_seasonal\n @seasonal = Seasonal.find(params[:id])\n end",
"def index\n @lab_seminars = Lab::Seminar.all\n end",
"def season\n @season ||= Season.find(@importer_hash.meeting.season_id)\n end",
"def load_season(year)\n puts \"Loading the #{year}-#{year.to_i+1} season...\"\n season = NbaAdvancedStats::Season.find_or_create_with_api(year)\n puts \"Data Ready.\"\n self.add_line_break\n self.main_menu(season)\n end",
"def index\n # Get all the order seasons, active season first, then sort alphibetically\n @order_seasons = OrderSeason.all.order(current_season: :desc).order(:order_season_name)\n end",
"def create\n @season = Season.new(season_params)\n\n if @season.save\n render :show, status: :created\n else\n render json: @season.errors, status: :unprocessable_entity\n end\n end",
"def index\n @games = @season.games #Game.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @games }\n end\n end",
"def destroy\n if @season\n @season.destroy\n render json: {success: \"true\", message:\"Season was successfully deleted\", series: @serial}\n else\n render json: {success: \"false\", message:\"Season doesn't exists\", series: @serial}\n end\n end",
"def season\n Allocine::Season.new(document[\"parentSeason\"][\"code\"])\n end",
"def show\n @sproject = current_user.sprojects.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @sproject }\n end\n end",
"def get_schedule\n response = @client.full_game_schedule(@options[:season])\n parse_schedule_response(response)\n end",
"def update\n respond_to do |format|\n if @season.update(season_params)\n format.html { redirect_to @season, notice: 'Season was successfully updated.' }\n format.json { render :show, status: :ok, location: @season }\n else\n format.html { render :edit }\n format.json { render json: @season.errors, status: :unprocessable_entity }\n end\n end\n end",
"def index\n @game_studios = GameStudio.all\n end",
"def index\n @studios = Studio.page(params[:page]).per(1000)\n end",
"def destroy\n @runway_season = Runway::Season.find(params[:id])\n @runway_season.destroy\n\n respond_to do |format|\n format.html { redirect_to runway_seasons_url }\n format.json { head :no_content }\n end\n end",
"def sport_players(sport_id, season, **options) = get(\"/sports/#{sport_id}/players\", **options.merge(season:))",
"def show\n @skills = Announcament.find(params[:id]).skill\n @seasons = Announcament.find(params[:id]).season\n end",
"def get_season_id\n season ? season.id : 0\n end",
"def season_number\n @ole.SeasonNumber\n end",
"def destroy\n @season = Season.find(params[:id])\n @season.destroy\n\n respond_to do |format|\n format.html { redirect_to seasons_url }\n format.json { head :ok }\n end\n end",
"def show\n @studio = Studio.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @studio }\n end\n end",
"def update\n respond_with @season.update(season_params)\n end",
"def index\n @episodes = @series.episodes.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @episodes }\n end\n end",
"def current_season\n self.seasons.find(:first,\n :conditions => {:date => Season.maximum('date')})\n end",
"def index\n @semesters = Semester.all\n end",
"def index\n @semesters = Semester.all\n end",
"def index\n @team = Team.find(params[:team_id])\n @sprints = @team.sprints.find(:all)\n\n respond_to do |format|\n format.html\n format.json\n end\n end",
"def index\n @sprojects = current_user.sprojects.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @sprojects }\n end\n end",
"def index\n page_number = params[:page] ? params[:page][:number] : 1\n per_page = params[:per_page] ? params[:per_page] : 10\n\n @standings = Standing.paginate(page: page_number, per_page: per_page)\n\n render json: @standings\n end",
"def create\n @season = Season.new(season_params)\n\n respond_to do |format|\n if @season.save\n format.html { redirect_to @season, notice: 'Season was successfully created.' }\n format.json { render :show, status: :created, location: @season }\n else\n format.html { render :new }\n format.json { render json: @season.errors, status: :unprocessable_entity }\n end\n end\n end",
"def show\n @season = Season.find(params[:season_id])\n @week = @season.weeks.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @week }\n end\n end",
"def destroy\n # @season = Season.find(params[:id])\n # @season.destroy\n\n respond_to do |format|\n format.html { redirect_to seasons_url }\n format.json { head :no_content }\n end\n end",
"def new\n @season = Season.new\n @seasons = Season.order('start_date desc')\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @season }\n end\n end",
"def get_closed_seasons\n @closed_seasons ||= retrieve_closed_seasons\n end",
"def show\n @season.create_unfilled_memberships\n end",
"def show\n render json: @league, status: :ok\n end",
"def season_params\n params.permit(:id, :format, :game_id, :filters => [:season_id, :game_id])\n end",
"def index\n @sprints = Sprint.find_all_by_project_id(@project_id)\n @current_submenu = \"sprints\"\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @sprints }\n end\n end",
"def semesters\n uni_year = UniYear.find_by_id(params[:uni_year_id])\n @semesters = uni_year ? uni_year.semesters : []\n \n respond_to do |format|\n format.json { render json: @semesters }\n end\n end",
"def retrieve_closed_seasons\n @season_type.seasons.where(['end_date < ?', Date.today])\n .sort_season_by_begin_date('DESC')\n end",
"def division\n\t\tself.division_season\n\tend",
"def create\n @season = Season.new(season_params)\n\n respond_to do |format|\n if @season.save\n format.html { redirect_to @season, notice: 'Season was successfully created.' }\n format.json { render json: @season, status: :created, location: @season }\n else\n format.html { render action: \"new\" }\n format.json { render json: @season.errors, status: :unprocessable_entity }\n end\n end\n end",
"def season_params\n params.require(:season).permit(:campground_id, :name, :start_date, :end_date)\n end",
"def index\n @division_syns = DivisionSyn.all\n\n render json: @division_syns\n end",
"def new\n @guardseason = Guardseason.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @guardseason }\n end\n end",
"def season_params\n params.require(:season).permit(:id, :name, :current, :active, :start_date, :game_duration)\n end",
"def destroy\n @season.destroy\n respond_to do |format|\n format.html { redirect_to seasons_url, notice: 'Season was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def show\n @photos = @spot.photos.all\n @schools = @spot.schools.all\n gon.seasons = []\n @spot.seasons.each do |s|\n gon.seasons[s.sport.id] = s.get_months_array\n end\n\n\n if request.path != country_spot_path(@country, @spot)\n return redirect_to [@country, @spot], :status => :moved_permanently\n end\n \n end",
"def show\n @photos = @spot.photos.all\n @schools = @spot.schools.all\n gon.seasons = []\n @spot.seasons.each do |s|\n gon.seasons[s.sport.id] = s.get_months_array\n end\n\n\n if request.path != country_spot_path(@country, @spot)\n return redirect_to [@country, @spot], :status => :moved_permanently\n end\n \n end",
"def index\n @teams = @club.teams\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @teams }\n end\n end",
"def show\n @rink_league = RinkLeague.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @rink_league }\n end\n end",
"def index\n @divisions = Division.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @divisions }\n end\n end",
"def find_manageable_seasons( check_date = Date.today() )\n @seasons_found = true\n @seasons_ids = @user.\n team_managers.\n joins( team_affiliation: :season ).\n where( ['seasons.end_date >= ? and seasons.begin_date <= ?', check_date, check_date]).\n select( \"team_affiliations.season_id\" ).\n map{ |tm| tm.season_id }\n end"
] |
[
"0.7799653",
"0.77242374",
"0.7644971",
"0.7644971",
"0.7644971",
"0.76306987",
"0.7597699",
"0.7596639",
"0.74972177",
"0.74609745",
"0.72930014",
"0.71832204",
"0.70913225",
"0.70664793",
"0.70366323",
"0.7016701",
"0.70062596",
"0.6957691",
"0.6957691",
"0.6957691",
"0.6957691",
"0.68557763",
"0.6823468",
"0.6811666",
"0.6760808",
"0.6747236",
"0.6736106",
"0.66964495",
"0.6678943",
"0.66492015",
"0.66185486",
"0.6615157",
"0.6611368",
"0.6573658",
"0.6530571",
"0.6522958",
"0.6493763",
"0.64856863",
"0.6469922",
"0.6456982",
"0.6452951",
"0.643739",
"0.6430104",
"0.63887894",
"0.638825",
"0.63557607",
"0.6351879",
"0.63474166",
"0.6322054",
"0.6311919",
"0.6311551",
"0.63009036",
"0.62963974",
"0.6254352",
"0.62212485",
"0.6206442",
"0.6191544",
"0.61859334",
"0.6165263",
"0.61650693",
"0.6162433",
"0.616013",
"0.6151618",
"0.61437935",
"0.6136442",
"0.61287314",
"0.6125952",
"0.608721",
"0.6080783",
"0.60769844",
"0.60677886",
"0.6063592",
"0.6062851",
"0.6062851",
"0.6038754",
"0.6031873",
"0.60253644",
"0.6010681",
"0.6004093",
"0.5992031",
"0.598877",
"0.59813184",
"0.597723",
"0.5974676",
"0.5958656",
"0.5951861",
"0.5949557",
"0.5939533",
"0.59284776",
"0.5928021",
"0.5920787",
"0.5917564",
"0.591102",
"0.59097874",
"0.5908827",
"0.58987236",
"0.58987236",
"0.58987135",
"0.5895902",
"0.5885663",
"0.58814603"
] |
0.0
|
-1
|
POST /admin/seasons POST /admin/seasons.json
|
def create
@admin_season = Season.new(admin_season_params)
respond_to do |format|
if @admin_season.save
format.html { redirect_to @admin_season, success: 'Season was successfully created.' }
format.json { render :show, status: :created, location: @admin_season }
else
format.html { render :new }
format.json { render json: @admin_season.errors, status: :unprocessable_entity }
end
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def create\n @season = Season.new(season_params)\n\n if @season.save\n render :show, status: :created\n else\n render json: @season.errors, status: :unprocessable_entity\n end\n end",
"def create\n @season = Season.new(season_params)\n\n respond_to do |format|\n if @season.save\n format.html { redirect_to @season, notice: 'Season was successfully created.' }\n format.json { render :show, status: :created, location: @season }\n else\n format.html { render :new }\n format.json { render json: @season.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @season = Season.new(season_params)\n\n respond_to do |format|\n if @season.save\n format.html { redirect_to @season, notice: 'Season was successfully created.' }\n format.json { render json: @season, status: :created, location: @season }\n else\n format.html { render action: \"new\" }\n format.json { render json: @season.errors, status: :unprocessable_entity }\n end\n end\n end",
"def admin_season_params\n params.require(:season).permit(:id, :league_id, :year, :day, :start_date, :number_of_weeks, :roll_off_weeks, :dates_off, :handicap_base, :handicap_percent, :location, :practice_length, :starts_at)\n end",
"def create\n @runway_season = Runway::Season.new(params[:runway_season])\n\n respond_to do |format|\n if @runway_season.save\n format.html { redirect_to @runway_season, notice: 'Season was successfully created.' }\n format.json { render json: @runway_season, status: :created, location: @runway_season }\n else\n format.html { render action: \"new\", layout: \"forms\" }\n format.json { render json: @runway_season.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @serial = Serial.find(params[:serial_id])\n @season = Season.create(season_params)\n @season.serial_id = @serial.id\n @serial.seasons << @season\n if @season.id\n render json: {success: \"true\", message: \"Season has been created\", season: @season, series: @serial}\n else\n render json: {success: \"false\", message: \"Season was not created\"}\n end\n end",
"def seasons(season = nil)\n @server.make_json_request('show.seasons', tvdbid: @tvdbid, season: season)['data']\n end",
"def set_seasons\n @seasons = Campground.find(params[:campground_id]).seasons\n end",
"def season_params\n params.require(:season).permit(:campground_id, :name, :start_date, :end_date)\n end",
"def create\n params[:season][:start_date] = Date.strptime(params[:season][:start_date], \"%m/%d/%Y\")\n params[:season][:end_date] = Date.strptime(params[:season][:end_date], \"%m/%d/%Y\")\n params[:season][:handicapping_method_attributes] = params[:handicapping_method]\n params[:season].delete(:wday)\n params[:season].delete('tee_time_start(5i)')\n\n @season = Season.new(params[:season])\n\n\n #Create divisions if any are added, else default to the below.\n\n respond_to do |format|\n if @season.save\n @season.reload\n session[:season_id]=@season.id\n set_session\n format.html { redirect_to @season, notice: 'Season was successfully created.' }\n format.json { render json: @season, status: :created, location: @season }\n else\n format.html { render action: \"new\" }\n format.json { render json: @season.errors, status: :unprocessable_entity }\n end\n end\n end",
"def seasonal_params\n params.require(:seasonal).permit(:season, :seasonYear, :piecePay, :employee_id, :verified, :seasonals_id)\n end",
"def season_params\n params.require(:season).permit(:id, :name, :current, :active, :start_date, :game_duration)\n end",
"def season_params\n params.require(:season).permit(:description, :date, :number, :serial_id)\n end",
"def index\n @seasons = Season.all\n end",
"def index\n @seasons = Season.all\n end",
"def index\n @seasons = Season.all\n end",
"def set_admin_season\n @admin_season = Season.find(params[:id])\n end",
"def index\n @seasons = Season.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @seasons }\n end\n end",
"def create\n @guardseason = Guardseason.new(params[:guardseason])\n\n respond_to do |format|\n if @guardseason.save\n format.html { redirect_to @guardseason, notice: 'Vartiokausi luotu.' }\n format.json { render json: @guardseason, status: :created, location: @guardseason }\n else\n format.html { render action: \"new\" }\n format.json { render json: @guardseason.errors, status: :unprocessable_entity }\n end\n end\n end",
"def season_params\n params.require(:season).permit(:title, :plot, :hd_price, :sd_price)\n end",
"def index\n render json: {episodes: @season.episodes, season: @season}\n end",
"def add_season(season)\r\n seasons << season\r\n end",
"def set_season\n @season = Season.find(params[:id])\n end",
"def set_season\n @season = Season.find(params[:id])\n end",
"def set_season\n @season = Season.find(params[:id])\n end",
"def set_season\n @season = Season.find(params[:id])\n end",
"def create_calendar\n League.current_seasons.each(&:start!)\n\n respond_to do |format|\n flash[:notice] = t('defaults.start_seasons_success')\n format.html{ redirect_to leagues_path}\n end\n end",
"def update\n if @season.update(season_params)\n render :show, status: :ok\n else\n render json: @season.errors, status: :unprocessable_entity\n end\n end",
"def new\n @runway_season = Runway::Season.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @runway_season }\n end\n end",
"def new\n @season = Season.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @season }\n end\n end",
"def index\n @admin_seasons = Season.order(:id).page params[:page]\n end",
"def season_params\n params.permit(:year_start, :year_end, :team_id)\n end",
"def create\n @batting_season = BattingSeason.new(params[:batting_season])\n\n respond_to do |format|\n if @batting_season.save\n format.html { redirect_to @batting_season, notice: 'Batting season was successfully created.' }\n format.json { render json: @batting_season, status: :created, location: @batting_season }\n else\n format.html { render action: \"new\" }\n format.json { render json: @batting_season.errors, status: :unprocessable_entity }\n end\n end\n end",
"def season_params\n params.require(:season).permit(:name, :beginning_date, :ending_date, memberships_attributes: [:id, :month_id, :member_id])\n end",
"def test_create_new_season\n login(:admin)\n now = Time.now\n post :edit_season, :season => {:tournament_starts_at => now, :buy_in => 10, :max_num_brackets => 1}\n season = Season.find_by_year(now.year)\n assert_not_nil season\n assert_redirected_to :action => :select_team_bids, :id => season.id\n end",
"def season(year, **options) = get(\"/seasons/#{year}\", **{ sportId: 1 }.merge(options))",
"def update\n respond_to do |format|\n if @admin_season.update(admin_season_params)\n format.html { redirect_to @admin_season, success: 'Season was successfully updated.' }\n format.json { render :show, status: :ok, location: @admin_season }\n else\n format.html { render :edit }\n format.json { render json: @admin_season.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n\t\t# league admin can add\n\t\t# anyone can add (own team) as pending iff league is addable\n\t\tds = DivisionSeason.find params[:division_season_id]\n\t\tteam = Team.find team[:team_id]\n\n\t\tif can? :manage_teams, ds\n\t\t\tTeamDSService.add_team(ds, team)\n\t\telse\n\t\t\tauthorize! :add_team, ds\n\t\t\tTeamDSService.add_pending_team(ds, team)\n\t\tend\n\n\t\trespond_with tdsr\n\tend",
"def season_params\n params.permit(:id, :format, :game_id, :filters => [:season_id, :game_id])\n end",
"def set_season\n id = season_params[:id]\n @season = ::Season.find(id)\n authorize_action_for @season\n end",
"def index\n @episodes = @season.episodes\n end",
"def index\n render json: {seasons: @serial.seasons, series: @serial}\n end",
"def set_season\n @season = @serial.seasons.find_by(number: params[:id])\n end",
"def update\n respond_with @season.update(season_params)\n end",
"def destroy\n if @season\n @season.destroy\n render json: {success: \"true\", message:\"Season was successfully deleted\", series: @serial}\n else\n render json: {success: \"false\", message:\"Season doesn't exists\", series: @serial}\n end\n end",
"def create\n # Stores all the parameters entered in for the order season\n @order_season = OrderSeason.new(order_season_params)\n\n # If user is saved, redirect to order season index page\n # with a message, if there is errors, redirect them back\n # to the same view with the errors listed\n if @order_season.save\n season_id = @order_season.order_season_id\n\n # Create the array for date range\n date_range = Array.new\n # Put the date range values in from start and end date\n date_range = (Date.parse(@order_season.pickup_date_start)..Date.parse(@order_season.pickup_date_end)).to_a\n\n # Loop through each date and add it to the database\n date_range.each do |date|\n @date = PickupDate.new(:order_season_id => season_id, :pickup_date => date)\n @date.save\n end\n\n # If current season was checked, unset any other active seasons\n if @order_season.current_season?\n set_active_order_season\n end\n\n # Send message to the user and redirect to the\n # season listing\n flash[:success] = \"Order Season: #{@order_season.order_season_name}\n has been added!\"\n redirect_to edit_order_season_url(@order_season)\n\n else\n render 'new'\n end\n end",
"def create\n @episode = Episode.new(params[:episode])\n @episode.season_id = params[:season_id] \n \n respond_to do |format|\n if @episode.save\n format.html { redirect_to(series_season_episode_url(@episode.season.series.id, @episode.season.id, @episode.id), :notice => 'Episode was successfully created.') }\n format.xml { render :xml => @episode, :status => :created, :location => @episode }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @episode.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def show\n @season.create_unfilled_memberships\n end",
"def show\n @runway_season = Runway::Season.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @runway_season }\n end\n end",
"def order_season_params\n params.require(:order_season).permit(:order_season_id, :order_season_name,\n :current_season, :pickup_date_start, :pickup_date_end,\n pickup_dates_attributes: [:pickup_date_id, :pickup_date ])\n end",
"def tournament_season(id, type = 'sr:tournament')\n get(\"sports/en/tournaments/#{type}:#{id}/seasons.xml\")\n end",
"def create\n #@game = Game.new(params[:game])\n @game = Game.new(game_params)\n @game.season_id = params[:season_id]\n @games = Game.where(:season_id => @game.season_id)\n\n respond_to do |format|\n if @logged_in.update_site? and @game.save\n format.html { redirect_to(season_game_path(@game.season_id, @game), :notice => 'Game was successfully created.') }\n format.xml { render :xml => @game, :status => :created, :location => @game }\n format.js\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @game.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def destroy\n @admin_season.destroy\n respond_to do |format|\n format.html { redirect_to admin_seasons_url, success: 'Season was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def season_finalize\n Params.inc_season\n end",
"def update\n respond_to do |format|\n if @season.update(season_params)\n format.html { redirect_to @season, notice: 'Season was successfully updated.' }\n format.json { render :show, status: :ok, location: @season }\n else\n format.html { render :edit }\n format.json { render json: @season.errors, status: :unprocessable_entity }\n end\n end\n end",
"def index\n params[:season_url] ||= StepSeason.by_tournament(@tournament.id).last[:url]\n @season = StepSeason.by_tournament(@tournament.id).where(url: params[:season_url]).first\n\n # return error if no season with such url\n error!(\"Incorrect params\", 403) and return if @season.nil?\n\n @dates = Schedule.select(:match_on).joins(\n \"INNER JOIN steps_phases AS tours_phase ON (tours_phase.phase_id = schedules.tour_id) \" +\n \"INNER JOIN steps_phases AS seasons_phase ON (seasons_phase.phase_id = tours_phase.step_id) \"\n ).where(\"seasons_phase.step_id = ? \", @season.id).group(\"match_on\").order(\"match_on ASC\").collect{|item| item.match_on}\n\n respond_to do |format|\n format.json{ render json: {dates: @dates} }\n end\n end",
"def acommodate_seasons\n new_year_season = @seasons.select{|season| season.end < season.start}.first\n\n first_seasion = Season.new(new_year_season)\n new_year_season.end = SeasonDate.last_day_of_year\n\n @seasons.push(first_seasion)\n end",
"def set_season\n @season = Season.find(params[:id])\n unless @logged_in.update_site?\n @season.readonly!\n end\n end",
"def create_period(season, options = {})\n post(\"seasons/#{season}/periods\", periods: [options]).pop\n end",
"def create\n @season = Season.new(season_params)\n\n respond_to do |format|\n if @season.save\n @season.model_after(params[:model_after])\n format.html { redirect_to(@season, :notice => 'Season was successfully created.') }\n format.xml { render :xml => @season, :status => :created, :location => @season }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @season.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def new\n if params[:course_id]\n @season = Season.new(params[:season])\n @show_the_js_link = true\n respond_to do |format|\n format.js {}\n end\n else\n session[:league_id]=params[:id] if params[:id]\n @season = Season.new(:league_id => session[:league_id], :start_date => 0.days.ago, :end_date => 0.days.ago)\n old_season = League.find(session[:league_id]).seasons.last\n hc = old_season.handicapping_method if old_season\n hc ||= HandicappingMethod.find(2)\n @season.handicapping_method= hc.dup\n @season.divisions = [Division.new(), Division.new(), Division.new()]\n @week=Week.new()\n @season.scoring_methods = ScoringMethod.where('season_id is null').order(:type).collect { |sm| sm.dup }\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @season }\n end\n end\n\n\n end",
"def season(series_id, season_id)\n get(\"/catalog/titles/series/#{series_id.to_s}/seasons/#{season_id.to_s}\")\n end",
"def destroy\n @runway_season = Runway::Season.find(params[:id])\n @runway_season.destroy\n\n respond_to do |format|\n format.html { redirect_to runway_seasons_url }\n format.json { head :no_content }\n end\n end",
"def new\n @season = Season.new\n @seasons = Season.order('start_date desc')\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @season }\n end\n end",
"def destroy\n @season.destroy\n respond_to do |format|\n format.html { redirect_to seasons_url, notice: 'Season was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def create_standings\n season.standings.create(result: self)\n end",
"def index\n @seasons = Season.all\n #@teams_sponsors = TeamsSponsor.all\n end",
"def new_episodes( season )\n return @seasons[season][1].flatten\n end",
"def show\n render json: {season: @season, series: @serial}\n end",
"def league_params\n params.require(:league).permit(:name, :season_id)\n end",
"def destroy\n @season = Season.find(params[:id])\n @season.destroy\n\n respond_to do |format|\n format.html { redirect_to seasons_url }\n format.json { head :ok }\n end\n end",
"def new\n @guardseason = Guardseason.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @guardseason }\n end\n end",
"def set_seasonal\n @seasonal = Seasonal.find(params[:id])\n end",
"def new\n @batting_season = BattingSeason.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @batting_season }\n end\n end",
"def create\n @season = Season.find(params[:season_id])\n @week = @season.weeks.new(params[:week])\n\n respond_to do |format|\n if @week.save\n format.html { redirect_to season_week_url(@season, @week) }\n format.xml { render :xml => @week, :status => :created, :location => @week }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @week.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def destroy\n @season.destroy\n end",
"def destroy\n # @season = Season.find(params[:id])\n # @season.destroy\n\n respond_to do |format|\n format.html { redirect_to seasons_url }\n format.json { head :no_content }\n end\n end",
"def to_seasons(seasons)\n if seasons\n seasons.collect do |season|\n season = season.values[0]\n Season.new(\n Date.strptime(season['start'], '%m-%d'),\n Date.strptime(season['end'], '%m-%d'),\n season['rate'][1..-1].to_f\n )\n end\n end\n end",
"def update\n @runway_season = Runway::Season.find(params[:id])\n\n respond_to do |format|\n if @runway_season.update_attributes(params[:runway_season])\n format.html { redirect_to @runway_season, notice: 'Season was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\", layout: \"forms\" }\n format.json { render json: @runway_season.errors, status: :unprocessable_entity }\n end\n end\n end",
"def show\n render json: {episode: @episode, season: @season}\n end",
"def add_new_episodes( season, *episodes)\n @seasons[season][1].concat(episodes)\n @seasons[season].flatten\n end",
"def new\n @season = Season.find(params[:season_id])\n @week = @season.weeks.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @week }\n end\n end",
"def season\n Allocine::Season.new(document[\"parentSeason\"][\"code\"])\n end",
"def sign_up_for_season\n if Season.season_accepting_signups\n UserSeason.create(season_id: Season.season_accepting_signups.id, user_id: id) \n else\n UserSeason.create(season_id: Season.current_season.id, user_id: id) \n end\n end",
"def destroy\n @seasonal.destroy\n respond_to do |format|\n format.html { redirect_to seasonals_url, notice: 'Seasonal was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def create\n @team = Team.new(team_params)\n\n respond_to do |format|\n if @team.save\n format.html { redirect_to(season_team_path(@team.season_id, @team), :notice => 'Team was successfully created.') }\n format.xml { render :xml => @team, :status => :created, :location => @team }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @team.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @employee = Employee.new(employee_params)\n @employee.editor_id = current_user.id\n @seasonal = Seasonal.new(seasonal_params)\n if isAdmin\n @seasonal.verified = 1\n end\n respond_to do |format|\n @seasonal.valid?\n if @employee.valid? && @seasonal.valid?\n if @employee.save\n @seasonal.employee = Employee.find(@employee.id)\n format.json { render :show, status: :created, location: @employee }\n if @seasonal.save\n @logs = Log.new\n @logs.employeeInfo = @employee.to_json\n @logs.additionalInfo = @seasonal.to_json\n @logs.CRUD = \"Create\"\n @logs.table = \"Seasonal Employee\"\n @logs.who = current_user.name\n @logs.save\n format.html { redirect_to @seasonal, notice: 'Full time employee was successfully created.' }\n format.json { render :show, status: :created, location: @seasonal }\n end\n end\n else\n format.html { render :new }\n format.json { render json: @employee.errors, status: :unprocessable_entity }\n\n #format.html { render :new }\n format.json { render json: @seasonal.errors, status: :unprocessable_entity }\n end\n end\n\n end",
"def create # rubocop:disable Metrics/AbcSize\n @studio = Studio.new(studio_params)\n\n respond_to do |format|\n if @studio.save\n format.html { redirect_to admin_studios_path, notice: 'Studio was successfully created.' }\n format.json { render :index }\n else\n format.html { render :new }\n format.json { render json: @studio.errors, status: :unprocessable_entity }\n end\n end\n end",
"def index\n @weeks = Week.all.order(:season_id, :week_number)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @weeks }\n end\n end",
"def season_sponsors\n season_id = params[:season_id].to_i\n @season = Season.find_by(:id => season_id)\n season_teams = get_teams_by_given_season(season_id, true)\n # get the list of teams in ever division\n season_team_ids = Array.new\n \n season_teams.each do |team|\n season_team_ids.push(team.id)\n end\n \n teams_sponsors = TeamsSponsor.where(:team_id => season_team_ids)\n @team_sponsors = sponsors_by_team(teams_sponsors)\n end",
"def create\n @studio = Studio.new(studio_params)\n\n if @studio.save\n return render json: @studio.to_json, status: 200\n else\n return render json: {\n error: \"could not create studio\"\n }, status: 400\n end\n\n end",
"def season\n season_id.nil? ? nil : organization_membership.seasons.find(season_id)\n end",
"def create\n @serial = Serial.find_by(id: params[:serial_id])\n @season = @serial.seasons.find_by(number: params[:season_id])\n @episode = Episode.create(episode_params)\n @episode.season_id = @season.id\n @season.episodes << @episode\n if @episode.id\n render json: {success: \"true\", message: \"Episode has been created\", episode: @episode, season: @season}\n else\n render json: {success: \"false\", message: \"Episode couldn't be created\", episode: @episode, season: @season, serial: @serial}\n end\n end",
"def show\n @batting_season = BattingSeason.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @batting_season }\n end\n end",
"def create\n @sport_odd = SportOdd.new(sport_odd_params)\n\n respond_to do |format|\n if @sport_odd.save\n format.html { redirect_to @sport_odd, notice: 'Sport odd was successfully created.' }\n format.json { render :show, status: :created, location: @sport_odd }\n else\n format.html { render :new }\n format.json { render json: @sport_odd.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @series = Series.find(params[:series_id].to_i)\n @episode = @series.episodes.new(episode_params)\n\n respond_to do |format|\n if @episode.save\n format.html { redirect_to series_episode_path(@series, @episode), notice: 'Episode was successfully created.' }\n format.json { render action: 'show', status: :created, location: series_episode_path(@series, @episode) }\n else\n format.html { render action: 'new' }\n format.json { render json: @episode.errors, status: :unprocessable_entity }\n end\n end\n end",
"def sport_params\n params.require(:sport).permit(:name, :season_id, :gender)\n end",
"def competition_params\n params.require(:competition).permit(:nr_teams, :knockout, :name, :season_id, team_season_ids: [])\n end",
"def index\n if isAdmin\n @seasonals = Seasonal.all\n elsif isGeneral\n @seasonals = Seasonal.where('seasonYear >= ? OR seasonYear is null', DateTime.now.year)\n else\n redirect_to :controller => 'sessions', :action => 'new'\n end\n end",
"def create\n @practice = Practice.new(practice_params)\n\n\n respond_to do |format|\n if @practice.save\n\n @practice.team_season.players.each do |pp|\n player_practice = PlayerPractice.new\n player_practice.player = pp\n player_practice.practice = @practice\n player_practice.save\n end\n\n format.html { redirect_to @practice, notice: 'Practice was successfully created.' }\n format.json { render :show, status: :created, location: @practice }\n else\n format.html { render :new }\n format.json { render json: @practice.errors, status: :unprocessable_entity }\n end\n end\n end"
] |
[
"0.76837736",
"0.7523077",
"0.7463524",
"0.7298656",
"0.7272153",
"0.7209834",
"0.7198521",
"0.7117333",
"0.7105351",
"0.70489275",
"0.7010434",
"0.7005163",
"0.6982686",
"0.69234407",
"0.69234407",
"0.69234407",
"0.689465",
"0.6885727",
"0.6819873",
"0.6817382",
"0.681178",
"0.67520493",
"0.67099977",
"0.67099977",
"0.67099977",
"0.67099977",
"0.6706368",
"0.6692327",
"0.66870445",
"0.6684947",
"0.6666937",
"0.66389",
"0.6635179",
"0.6619455",
"0.6604247",
"0.658244",
"0.65222603",
"0.6502567",
"0.64815795",
"0.6479434",
"0.64603937",
"0.64156616",
"0.6378335",
"0.6357886",
"0.6353079",
"0.63336813",
"0.632449",
"0.6296071",
"0.6285702",
"0.62741554",
"0.62687695",
"0.6265029",
"0.6254707",
"0.62241423",
"0.6213479",
"0.6204564",
"0.61981976",
"0.61677784",
"0.61633897",
"0.6127934",
"0.6125214",
"0.61218786",
"0.61101717",
"0.61027193",
"0.60930663",
"0.6063314",
"0.6059533",
"0.60526526",
"0.6050965",
"0.60260934",
"0.6024993",
"0.5992085",
"0.5985392",
"0.59674346",
"0.5958609",
"0.5955476",
"0.59322184",
"0.593201",
"0.59191436",
"0.59184176",
"0.59159946",
"0.58780116",
"0.5870093",
"0.58578473",
"0.5845368",
"0.58221066",
"0.58149695",
"0.58142406",
"0.58138555",
"0.5813244",
"0.5812612",
"0.58022255",
"0.57891786",
"0.57829434",
"0.5781498",
"0.5762121",
"0.5743062",
"0.571625",
"0.5711552",
"0.57039285"
] |
0.7867362
|
0
|
PATCH/PUT /admin/seasons/1 PATCH/PUT /admin/seasons/1.json
|
def update
respond_to do |format|
if @admin_season.update(admin_season_params)
format.html { redirect_to @admin_season, success: 'Season was successfully updated.' }
format.json { render :show, status: :ok, location: @admin_season }
else
format.html { render :edit }
format.json { render json: @admin_season.errors, status: :unprocessable_entity }
end
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def update\n if @season.update(season_params)\n render :show, status: :ok\n else\n render json: @season.errors, status: :unprocessable_entity\n end\n end",
"def update\n respond_with @season.update(season_params)\n end",
"def update\n respond_to do |format|\n if @season.update(season_params)\n format.html { redirect_to @season, notice: 'Season was successfully updated.' }\n format.json { render :show, status: :ok, location: @season }\n else\n format.html { render :edit }\n format.json { render json: @season.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @runway_season = Runway::Season.find(params[:id])\n\n respond_to do |format|\n if @runway_season.update_attributes(params[:runway_season])\n format.html { redirect_to @runway_season, notice: 'Season was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\", layout: \"forms\" }\n format.json { render json: @runway_season.errors, status: :unprocessable_entity }\n end\n end\n end",
"def set_admin_season\n @admin_season = Season.find(params[:id])\n end",
"def update\n #@season = Season.find(params[:id])\n\n respond_to do |format|\n #if @season.update_attributes(params[:season])\n if @season.update_attributes(season_params)\n format.html { redirect_to(@season, :notice => 'Season was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @season.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @guardseason = Guardseason.find(params[:id])\n\n respond_to do |format|\n if @guardseason.update_attributes(params[:guardseason])\n format.html { redirect_to @guardseason, notice: 'Vartiokausi päivitetty.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @guardseason.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @batting_season = BattingSeason.find(params[:id])\n\n respond_to do |format|\n if @batting_season.update_attributes(params[:batting_season])\n format.html { redirect_to @batting_season, notice: 'Batting season was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @batting_season.errors, status: :unprocessable_entity }\n end\n end\n end",
"def set_season\n @season = Season.find(params[:id])\n unless @logged_in.update_site?\n @season.readonly!\n end\n end",
"def update\n respond_to do |format|\n if @admin_stage.update(admin_stage_params)\n format.html { redirect_to admin_stage_url(@admin_stage.id), notice: 'Stage was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @admin_stage.errors, status: :unprocessable_entity }\n end\n end\n end",
"def admin_season_params\n params.require(:season).permit(:id, :league_id, :year, :day, :start_date, :number_of_weeks, :roll_off_weeks, :dates_off, :handicap_base, :handicap_percent, :location, :practice_length, :starts_at)\n end",
"def update\n @shelter = Shelter.find(params[:id])\n @shelter.update_attributes(params[:shelter])\n \n respond_with(@shelter, :location => admin_shelter_path(@shelter))\n end",
"def update\n @season = Season.find(params[:id])\n params[:season][:start_date] = Date.strptime(params[:season][:start_date], \"%m/%d/%Y\")\n params[:season][:end_date] = Date.strptime(params[:season][:end_date], \"%m/%d/%Y\")\n params[:season].delete(:wday)\n params[:season].delete('tee_time_start(5i)')\n\n\n respond_to do |format|\n if @season.update_attributes(params[:season])\n @season.handicapping_method.update_attributes(params[:handicapping_method])\n format.html { redirect_to @season, notice: 'Season was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @season.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n @tournament.admin = current_admin\n if @tournament.update(tournament_params)\n format.html { redirect_to @tournament, notice: 'Tournament was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @tournament.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update # rubocop:disable Metrics/AbcSize\n respond_to do |format|\n if @studio.update(studio_params)\n format.html { redirect_to admin_studios_path, notice: 'Studio was successfully updated.' }\n format.json { render :show, status: :ok, location: @studio }\n else\n format.html { render :edit }\n format.json { render json: @studio.errors, status: :unprocessable_entity }\n end\n end\n end",
"def set_season\n @season = Season.find(params[:id])\n end",
"def set_season\n @season = Season.find(params[:id])\n end",
"def set_season\n @season = Season.find(params[:id])\n end",
"def set_season\n @season = Season.find(params[:id])\n end",
"def update\n respond_to do |format|\n if @lab_seminar.update(lab_seminar_params)\n format.html { redirect_to @lab_seminar, notice: 'Seminar was successfully updated.' }\n format.json { render :show, status: :ok, location: @lab_seminar }\n else\n format.html { render :edit }\n format.json { render json: @lab_seminar.errors, status: :unprocessable_entity }\n end\n end\n end",
"def set_seasons\n @seasons = Campground.find(params[:campground_id]).seasons\n end",
"def update\n @species = Species.find(params[:id])\n @species.update_attributes(params[:species])\n \n respond_with(@species, :location => admin_species_path(@species))\n end",
"def update\n @studio = Studio.find(params[:id])\n\n respond_to do |format|\n if @studio.update_attributes(params[:studio])\n format.html { redirect_to studios_path, :notice => 'Studio was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @studio.errors, :event => :unprocessable_entity }\n end\n end\n end",
"def update\n @sprint = Sprint.find(params[:id])\n\n respond_to do |format|\n if @sprint.update_attributes(params[:sprint])\n format.html { redirect_to [:admin, @sprint], notice: 'Sprint was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @sprint.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @slayder.update(slayder_params)\n format.html { redirect_to admin_slayder_path(@slayder), notice: 'Slayder was successfully updated.' }\n format.json { render :show, status: :ok, location: @slayder }\n else\n format.html { render :edit }\n format.json { render json: @slayder.errors, status: :unprocessable_entity }\n end\n end\n end",
"def set_season\n id = season_params[:id]\n @season = ::Season.find(id)\n authorize_action_for @season\n end",
"def update\n @sproject = current_user.sprojects.find(params[:id])\n\n respond_to do |format|\n if @sproject.update_attributes(params[:sproject])\n format.html { redirect_to @sproject, notice: 'Sproject was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @sproject.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @stage_drymass = StageDrymass.find(params[:id])\n\n respond_to do |format|\n if @stage_drymass.update_attributes(params[:stage_drymass])\n format.html { redirect_to @stage_drymass, notice: 'Stage drymass was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @stage_drymass.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @survey.update(survey_params)\n respond_with( [ :admin, @survey] )\n end",
"def update\n\n respond_to do |format|\n if @studio_client.update(studio_client_params)\n format.html { redirect_to edit_admin_studio_client_path(@studio_client), notice: 'Studio client was successfully updated.' }\n format.json { render :show, status: :ok, location: @studio_client }\n else\n Rails.logger.info(@studio_client.errors.inspect)\n format.html { render :edit }\n format.json { render json: @studio_client.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @sproject.update(sproject_params)\n format.html { redirect_to @sproject, notice: 'Sproject was successfully updated.' }\n format.json { render :show, status: :ok, location: @sproject }\n else\n format.html { render :edit }\n format.json { render json: @sproject.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @admin_team.update(admin_team_params)\n format.html { redirect_to admin_teams_path, notice: 'Team was successfully updated.' }\n format.json { render :show, status: :ok, location: @admin_team }\n else\n format.html { render :edit }\n format.json { render json: @admin_team.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @stable = Stable.find(params[:id])\n\n respond_to do |format|\n if @stable.update_attributes(params[:stable])\n format.html { redirect_to @stable, notice: 'Stable was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @stable.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @admin_season = Season.new(admin_season_params)\n\n respond_to do |format|\n if @admin_season.save\n format.html { redirect_to @admin_season, success: 'Season was successfully created.' }\n format.json { render :show, status: :created, location: @admin_season }\n else\n format.html { render :new }\n format.json { render json: @admin_season.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @tv_series.update(tv_series_params)\n format.html { redirect_to root_path, notice: 'Сериал отредактирован!' }\n format.json { render :index, status: :ok, location: root_path }\n else\n format.html { render :edit }\n format.json { render json: @tv_series.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @stage.update(stage_params)\n format.html { redirect_to @stage, notice: 'Stage was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @stage.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @season = Season.find(params[:season_id])\n @week = Week.find(params[:id])\n\n respond_to do |format|\n if @week.update_attributes(params[:week])\n format.html { redirect_to(@week, :notice => 'Week was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @week.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @statusproject = Statusproject.find(params[:id])\n\n respond_to do |format|\n if @statusproject.update_attributes(params[:statusproject])\n flash[:notice] = 'Statusproject was successfully updated.'\n format.html { redirect_to(@statusproject) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @statusproject.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @sport_odd.update(sport_odd_params)\n format.html { redirect_to @sport_odd, notice: 'Sport odd was successfully updated.' }\n format.json { render :show, status: :ok, location: @sport_odd }\n else\n format.html { render :edit }\n format.json { render json: @sport_odd.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @shelter = Shelter.find(params[:id])\n\n if @shelter.update(shelter_params)\n head :no_content\n else\n render json: @shelter.errors, status: :unprocessable_entity\n end\n end",
"def update\n official = Official.find(params[:id])\n if official.update(official_params)\n render json: official, status: 200, location: [:api, official]\n else\n failed_to_update(official, \"official\")\n end\n end",
"def update\n respond_to do |format|\n if @game_studio.update(game_studio_params)\n format.html { redirect_to @game_studio, notice: 'Game studio was successfully updated.' }\n format.json { render :show, status: :ok, location: @game_studio }\n else\n format.html { render :edit }\n format.json { render json: @game_studio.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @schedule.update(schedule_params)\n format.html { redirect_to [:admin, @schedule], notice: '赛程更新成功' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @schedule.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @schedule.update(schedule_params)\n format.html { redirect_to [:admin, @schedule], notice: '赛程更新成功' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @schedule.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @team = Team.find(params[:team_id])\n @sprint = @team.sprints.find(params[:id])\n\n respond_to do |format|\n if @sprint.update_attributes(params[:sprint])\n format.html { redirect_to [@sprint.team, @sprint], notice: 'Sprint was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @sprint.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n #@game = Game.find(params[:id])\n\n respond_to do |format|\n #if @game.update_attributes(params[:game])\n if @game.update_attributes(game_params)\n format.html { redirect_to(season_game_path(@game.season_id, @game), :notice => 'Game was successfully updated.') }\n format.xml { head :ok }\n format.js\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @game.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @sales_stage.update(sales_stage_params)\n format.html { redirect_to sales_stages_path, notice: 'Sales stage was successfully updated.' }\n format.json { render :show, status: :ok, location: @sales_stage }\n else\n format.html { render :edit }\n format.json { render json: @sales_stage.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @team_admin = TeamAdmin.find(params[:id])\n\n respond_to do |format|\n if @team_admin.update_attributes(params[:team_admin])\n format.html { redirect_to @team_admin, notice: 'Team admin was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @team_admin.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n \n respond_to do |format|\n if @admin_action.update(stock_params)\n format.html { redirect_to root_path, notice: 'Admin action was successfully updated.' }\n format.json { render :show, status: :ok, location: @admin_action }\n else\n format.html { render :edit }\n format.json { render json: @admin_action.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @current_stage.update_attributes(params[:stage])\n format.html { redirect_to @current_stage, notice: 'Stage was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @current_stage.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @order_season = OrderSeason.find(params[:id]) # Get the order season\n @pickup_dates = PickupDate.where(:order_season_id => @order_season.order_season_id) # Get the pickup dates in the order season\n @pickup_date = PickupDate.new # For adding a new pickup date\n\n # Updates the order season if values are correct\n # Returns errors if the values are incorrect\n if @order_season.update_attributes(order_season_params)\n # If current season was checked, unset any other active seasons\n if @order_season.current_season?\n set_active_order_season\n end\n\n # Redirect to index with success message\n flash[:success] = \"#{@order_season.order_season_name} has been updated!\"\n redirect_to order_seasons_url\n else\n render 'edit'\n end\n end",
"def update\n respond_to do |format|\n if @admin_schedule.update(admin_schedule_params)\n format.html { redirect_to admin_schedule_url(@admin_schedule.id), notice: 'Schedule was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @admin_schedule.errors, status: :unprocessable_entity }\n end\n end\n end",
"def destroy\n @admin_season.destroy\n respond_to do |format|\n format.html { redirect_to admin_seasons_url, success: 'Season was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def update\n respond_to do |format|\n if @stage.update(stage_params)\n format.html { redirect_to @stage, notice: 'Stage was successfully updated.' }\n format.json { render :show, status: :ok, location: @stage }\n else\n format.html { render :edit }\n format.json { render json: @stage.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @stage = Stage.find(params[:id])\n\n if @stage.update_attributes(params[:stage])\n head :no_content\n else\n format.json { render json: @stage.errors, status: :unprocessable_entity }\n end\n end",
"def update\n @estudio = Estudio.find(params[:id])\n\n respond_to do |format|\n if @estudio.update_attributes(params[:estudio])\n format.js\n else\n format.js { render :form }\n end\n end\n end",
"def update\n respond_to do |format|\n if @sour.update(sour_params)\n format.html { redirect_to swits_path, notice: 'sour <3.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @sour.errors, status: :unprocessable_entity }\n end\n end\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 @scholar = Scholar.find(params[:id])\n\n respond_to do |format|\n if @scholar.update(scholar_params)\n format.html { redirect_to edit_admin_path, notice: 'Admin was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @scholar.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @admin_craftsman.update(admin_craftsman_params)\n format.html { redirect_to @admin_craftsman, notice: 'Craftsman was successfully updated.' }\n format.json { render :show, status: :ok, location: @admin_craftsman }\n else\n format.html { render :edit }\n format.json { render json: @admin_craftsman.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n if isAdmin\n @seasonal = Seasonal.find(params[:id])\n @employee = @seasonal.employee\n\n @seasonal.assign_attributes(seasonal_params)\n @employee.assign_attributes(employee_params)\n respond_to do |format|\n @seasonal.valid?\n if @employee.valid? && @seasonal.valid?\n @employee.editor_id = current_user.id\n if @seasonal.seasonals_id != nil\n @realFulltime = Seasonal.find(@seasonal.seasonals_id)\n @realEmployee = Employee.find(@realFulltime.employee_id)\n\n @realFulltime.dateOfHire = @seasonal.dateOfHire\n @realFulltime.dateofTermination = @seasonal.dateofTermination\n @realFulltime.hourlyRate = @seasonal.hourlyRate\n @realFulltime.verified = 1\n\n @realEmployee.lastName = @employee.lastName\n @realEmployee.firstName = @employee.firstName\n @realEmployee.sin = @employee.sin\n @realEmployee.dateOfBirth = @employee.dateOfBirth\n @realEmployee.reasonForLeaving = @employee.reasonForLeaving\n @realEmployee.company_id = @employee.company_id\n @realEmployee.editor_id = current_user.id\n\n @realEmployee.save\n @realFulltime.save\n\n @seasonal.destroy\n @employee.destroy\n else\n @logs = Log.new\n @logs.employeeInfo = @employee.to_json\n @logs.additionalInfo = @seasonal.to_json\n @logs.CRUD = \"Update\"\n @logs.table = \"Seasonal Employee\"\n @logs.who = current_user.name\n @logs.save\n @employee.save\n @seasonal.save\n end\n format.html { redirect_to @seasonal, notice: 'Full time employee was successfully updated.' }\n format.json { render :show, status: :ok, location: @seasonal }\n else\n format.html { render :new }\n format.json { render json: @employee.errors, status: :unprocessable_entity }\n\n #format.html { render :new }\n format.json { render json: @seasonal.errors, status: :unprocessable_entity }\n end\n end\n else\n @employee = Employee.new(employee_params)\n\n @employee.editor_id = current_user.id\n @seasonal = Seasonal.new(seasonal_params)\n @oldFullTime = Seasonal.find(params[:id])\n @oldFullTimeId = @oldFullTime.seasonals_id\n if @oldFullTimeId == nil\n @oldFullTimeId = @oldFullTime.id\n end\n @seasonal.seasonals_id = @oldFullTimeId\n @seasonal.hourlyRate = Seasonal.find(params[:id]).hourlyRate\n\n respond_to do |format|\n @seasonal.valid?\n if @employee.valid? && @seasonal.valid?\n if @employee.save\n @seasonal.employee = Employee.find(@employee.id)\n format.json { render :show, status: :created, location: @employee }\n @logs = Log.new\n @logs.employeeInfo = @employee.to_json\n @logs.additionalInfo = @seasonal.to_json\n @logs.CRUD = \"Update\"\n @logs.table = \"Seasonal Employee\"\n @logs.who = current_user.name\n @logs.save\n if @seasonal.save\n format.html { redirect_to @seasonal, notice: 'Full time employee was successfully created.' }\n format.json { render :show, status: :created, location: @seasonal }\n end\n end\n else\n format.html { render :new }\n format.json { render json: @employee.errors, status: :unprocessable_entity }\n\n #format.html { render :new }\n format.json { render json: @seasonal.errors, status: :unprocessable_entity }\n end\n end\n end\n end",
"def update\r\n @stage = Stage.find(params[:id])\r\n\r\n respond_to do |format|\r\n if @stage.update_attributes(params.required(:stage).permit!)\r\n format.html {redirect_to @stage, :notice => 'Stage was successfully updated.'}\r\n format.json {head :no_content}\r\n else\r\n format.html {render :action => \"edit\"}\r\n format.json {render :json => @stage.errors, :status => :unprocessable_entity}\r\n end\r\n end\r\n end",
"def update\n respond_to do |format|\n if @episode.update(episode_params)\n format.html { redirect_to series_path(@series), notice: 'Episode was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @episode.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @series = Series.find(params[:id])\n\n respond_to do |format|\n if @series.update_attributes(params[:series])\n format.html { redirect_to @series, notice: 'Series se ha actualizado correctamente.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @series.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @admin_update_club.update(admin_update_club_params)\n format.html { redirect_to @admin_update_club, notice: 'Club was successfully updated.' }\n format.json { render :show, status: :ok, location: @admin_update_club }\n else\n format.html { render :edit }\n format.json { render json: @admin_update_club.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @floor_stage.update(floor_stage_params)\n format.html { redirect_to @floor_stage, notice: 'Stage was successfully updated.' }\n format.json { render :show, status: :ok, location: @floor_stage }\n else\n format.html { render :edit }\n format.json { render json: @floor_stage.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @soda.update(soda_params)\n format.html { redirect_to @soda, notice: 'Soda was successfully updated.' }\n format.json { render :show, status: :ok, location: @soda }\n else\n format.html { render :edit }\n format.json { render json: @soda.errors, status: :unprocessable_entity }\n end\n end\n end",
"def set_season\n @season = @serial.seasons.find_by(number: params[:id])\n end",
"def update\n @sprint.update!(sprint_params)\n json_response(@sprint)\n end",
"def update\n respond_to do |format|\n if @variety.update(variety_params)\n format.html { redirect_to admin_varieties_path, notice: 'La variedad fue modificada' }\n format.json { render :show, status: :ok, location: @variety }\n else\n format.html { render :edit }\n format.json { render json: @variety.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @shoe.update(shoe_params)\n format.html { redirect_to runner_shoes_path, notice: 'Zapatilla actualizada satisfactoriamente.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @shoe.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @scool.update(scool_params)\n format.html { redirect_to @scool, notice: 'Scool was successfully updated.' }\n format.json { render :show, status: :ok, location: @scool }\n else\n format.html { render :edit }\n format.json { render json: @scool.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @series = Series.find(params[:id])\n\n respond_to do |format|\n if @series.update_attributes(params[:series])\n format.html { redirect_to @series, notice: 'Series was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @series.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @stock_option.update(stock_option_params)\n format.html { redirect_to @stock_option, notice: 'Stock option was successfully updated.' }\n format.json { render :show, status: :ok, location: @stock_option }\n else\n format.html { render :edit }\n format.json { render json: @stock_option.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n\n # update shops\n shops_edit = JSON.parse(params[:mall][:shops_in_mall])\n\n respond_to do |format|\n if @mall.update_with_shops(mall_params, shops_edit)\n format.html { redirect_to director_malls_path, notice: 'Mall was successfully updated.' }\n format.json { render :show, status: :ok, location: @mall }\n else\n format.html {\n @shops = Shop.to_options.to_json\n @shops_in_mall = @mall.shops.to_options.to_json\n render :edit\n }\n format.json { render json: @mall.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @sprint.update(sprint_params)\n format.html {redirect_to sprints_path, notice: 'Sprint was successfully updated.'}\n format.json {render :show, status: :ok, location: @sprint}\n else\n format.html {render :edit}\n format.json {render json: @sprint.errors, status: :unprocessable_entity}\n end\n end\n end",
"def update\n @slab = Slab.find(params[:id])\n\n respond_to do |format|\n if @slab.update_attributes(params[:slab])\n format.html { redirect_to @slab, :notice => 'Slab was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @slab.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @episode = @series.episodes.find(params[:id])\n\n respond_to do |format|\n if @episode.update_attributes(params[:episode])\n format.html { redirect_to [@series, @episode], notice: 'Episode was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @episode.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @event.update_attributes(event_params)\n format.html { redirect_to [@organization, @season, @event], notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n if :opr == 'edit'\n update\n else\n @team = Team.find_by_id(params[:id])\n @team.update_attributes({:id => params[:id], :name => params[:name], :status => params[:status]})\n\n if request.xhr?\n render :json => @team\n end\n end\n end",
"def update\n respond_to do |format|\n if @science_instance.update(science_instance_params)\n format.html { redirect_to @science_instance, notice: 'Science instance was successfully updated.' }\n format.json { render :show, status: :ok, location: @science_instance }\n else\n format.html { render :edit }\n format.json { render json: @science_instance.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @team_year.update(team_year_params)\n format.html { redirect_to @team_year, notice: 'Team year was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @team_year.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @samochod.update(samochod_params)\n format.html { redirect_to @samochod, notice: 'Samochod was successfully updated.' }\n format.json { render :show, status: :ok, location: @samochod }\n else\n format.html { render :edit }\n format.json { render json: @samochod.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @crew_big_sonu_schedule.update(crew_big_sonu_schedule_params)\n format.html { redirect_to @crew_big_sonu_schedule, notice: 'Big sonu schedule was successfully updated.' }\n format.json { render :show, status: :ok, location: @crew_big_sonu_schedule }\n else\n format.html { render :edit }\n format.json { render json: @crew_big_sonu_schedule.errors, status: :unprocessable_entity }\n end\n end\n end",
"def season_params\n params.require(:season).permit(:id, :name, :current, :active, :start_date, :game_duration)\n end",
"def update\n @my_studio_client = MyStudio::Client.find(params[:id])\n\n respond_to do |format|\n if @my_studio_client.update_attributes(params[:my_studio_client])\n format.html { redirect_to @my_studio_client, notice: 'Client was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @my_studio_client.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @series.update(series_params)\n format.html { redirect_to @series, notice: 'Series was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @series.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @solidarity.update(solidarity_params)\n format.html { redirect_to @solidarity, notice: 'Solidarity was successfully updated.' }\n format.json { render :show, status: :ok, location: @solidarity }\n else\n format.html { render :edit }\n format.json { render json: @solidarity.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @survey.update(survey_params)\n format.html { redirect_to admin_survey_path @survey, notice: 'Survey was successfully updated.' }\n format.json { render :show, status: :ok, location: @survey }\n else\n format.html { render :edit }\n format.json { render json: @survey.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @shelter.update(shelter_params)\n format.html { redirect_to @shelter, notice: 'Shelter was successfully updated.' }\n format.json { render :show, status: :ok, location: @shelter }\n else\n format.html { render :edit }\n format.json { render json: @shelter.errors, status: :unprocessable_entity }\n end\n end\n end",
"def edit\n\n\n admin_edit_prep\n\n respond_to do |format|\n format.html {render :layout => 'artist_admin'}\n format.json {\n render :json => {\n :success => true,\n :\"#{@hook}\" => render_to_string(\n :action => 'admin.html.erb',\n :layout => @layout,\n ),\n :\"edit\" => \"true\",\n :\"admin-show\" => \"true\",\n\n }\n }\n end\n end",
"def update\n @api_version = ApiVersion.find(params[:id])\n\n respond_to do |format|\n if @api_version.update_attributes(params[:api_version])\n format.html { redirect_to admin_api_versions_path, flash: {success: t('app.msgs.success_updated', :obj => t('mongoid.models.api_version.one'))} }\n format.json { head :no_content }\n else\n set_tabbed_translation_form_settings('advanced')\n format.html { render action: \"edit\" }\n format.json { render json: @api_version.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update_season_assignments\n @costume.update(costume_params)\n\n redirect_to season_assignments_path(@costume, season: costume_assignments_attributes.values[0].values[0])\n end",
"def update\n respond_to do |format|\n if @snowfall.update(snowfall_params)\n format.html { redirect_to @snowfall, notice: 'Snowfall was successfully updated.' }\n format.json { render :show, status: :ok, location: @snowfall }\n else\n format.html { render :edit }\n format.json { render json: @snowfall.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @team = @club.teams.find(params[:id])\n\n respond_to do |format|\n if @team.update_attributes(params[:team])\n format.html { redirect_to club_path(@club), notice: 'Mannschaft wurde aktualisiert.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @nightclub.update(nightclub_params)\n format.html { redirect_to @nightclub, notice: 'Nightclub was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @nightclub.errors, status: :unprocessable_entity }\n end\n end\n end",
"def seasonal_params\n params.require(:seasonal).permit(:season, :seasonYear, :piecePay, :employee_id, :verified, :seasonals_id)\n end",
"def update\n @stock = Stock.find(params[:id])\n\n respond_to do |format|\n if @stock.update_attributes(params[:stock])\n format.html { redirect_to stocks_url }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @stock.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @player_strong.update(player_strong_params)\n format.html { redirect_to project_strong_players_groups_path, notice: 'Zawodnik zmieniony pomyślnie.' }\n format.json { head :no_content} # <- best_in_place required\n else\n format.html { render :edit }\n format.json { render json: @player_strong.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @seminar.update(seminar_params)\n format.html { redirect_to @seminar, notice: \"Seminar was successfully updated.\" }\n format.json { render :show, status: :ok, location: @seminar }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @seminar.errors, status: :unprocessable_entity }\n end\n end\n end"
] |
[
"0.72138053",
"0.71359223",
"0.70761573",
"0.7051942",
"0.6991588",
"0.6871768",
"0.6759073",
"0.6624852",
"0.63472354",
"0.6291078",
"0.6265505",
"0.6259548",
"0.6250065",
"0.6246902",
"0.62152296",
"0.6158318",
"0.6158318",
"0.6158318",
"0.6158318",
"0.6152593",
"0.6124393",
"0.611846",
"0.61152333",
"0.6108854",
"0.60783017",
"0.60740995",
"0.6043174",
"0.60398483",
"0.5980646",
"0.59655714",
"0.59431195",
"0.59418225",
"0.5938956",
"0.5929976",
"0.59250355",
"0.5924152",
"0.5921327",
"0.5908819",
"0.5907104",
"0.590211",
"0.58824265",
"0.5882418",
"0.58822423",
"0.58822423",
"0.5879813",
"0.58773017",
"0.5863688",
"0.58632904",
"0.58568686",
"0.58531064",
"0.5852737",
"0.5852031",
"0.5843733",
"0.5837976",
"0.58322024",
"0.5825917",
"0.58223546",
"0.58212113",
"0.581651",
"0.58160776",
"0.58083254",
"0.58033866",
"0.5800899",
"0.58003616",
"0.57951766",
"0.578339",
"0.57764864",
"0.5774242",
"0.5773611",
"0.57722497",
"0.5771404",
"0.577051",
"0.5767401",
"0.57672817",
"0.57643265",
"0.5761082",
"0.5757309",
"0.57569784",
"0.5754163",
"0.57478464",
"0.57471544",
"0.574561",
"0.57402253",
"0.57302386",
"0.5729908",
"0.57244337",
"0.5724347",
"0.5724251",
"0.57177365",
"0.5717556",
"0.57139504",
"0.57107484",
"0.570482",
"0.57015383",
"0.5696618",
"0.56898886",
"0.56894135",
"0.5688278",
"0.56877655",
"0.5686137"
] |
0.7618151
|
0
|
DELETE /admin/seasons/1 DELETE /admin/seasons/1.json
|
def destroy
@admin_season.destroy
respond_to do |format|
format.html { redirect_to admin_seasons_url, success: 'Season was successfully destroyed.' }
format.json { head :no_content }
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def destroy\n # @season = Season.find(params[:id])\n # @season.destroy\n\n respond_to do |format|\n format.html { redirect_to seasons_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @season = Season.find(params[:id])\n @season.destroy\n\n respond_to do |format|\n format.html { redirect_to seasons_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @runway_season = Runway::Season.find(params[:id])\n @runway_season.destroy\n\n respond_to do |format|\n format.html { redirect_to runway_seasons_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @guardseason = Guardseason.find(params[:id])\n @guardseason.destroy\n\n respond_to do |format|\n format.html { redirect_to guardseasons_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @season.destroy\n respond_to do |format|\n format.html { redirect_to seasons_url, notice: 'Season was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @seasonal.destroy\n respond_to do |format|\n format.html { redirect_to seasonals_url, notice: 'Seasonal was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @batting_season = BattingSeason.find(params[:id])\n @batting_season.destroy\n\n respond_to do |format|\n format.html { redirect_to batting_seasons_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n #@season = Season.find(params[:id])\n @season.destroy\n\n respond_to do |format|\n format.html { redirect_to(seasons_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @season.destroy\n end",
"def destroy\n if @season\n @season.destroy\n render json: {success: \"true\", message:\"Season was successfully deleted\", series: @serial}\n else\n render json: {success: \"false\", message:\"Season doesn't exists\", series: @serial}\n end\n end",
"def destroy\n @stage_drymass = StageDrymass.find(params[:id])\n @stage_drymass.destroy\n\n respond_to do |format|\n format.html { redirect_to stage_drymasses_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @studio.destroy\n respond_to do |format|\n format.html { redirect_to admin_studios_path, notice: 'Studio was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n #@game = Game.find(params[:id])\n @game.destroy\n\n respond_to do |format|\n format.html { redirect_to(season_games_path(params[:season_id])) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @statusproject = Statusproject.find(params[:id])\n @statusproject.destroy\n\n respond_to do |format|\n format.html { redirect_to(statusprojects_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @my_studio_client = MyStudio::Client.find(params[:id])\n @my_studio_client.destroy\n\n respond_to do |format|\n format.html { redirect_to my_studio_clients_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @admin_update_club.destroy\n respond_to do |format|\n format.html { redirect_to admin_update_clubs_url, notice: 'Club was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @nightclub.destroy\n respond_to do |format|\n format.html { redirect_to nightclubs_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n #@team = Team.find(params[:id])\n @team.destroy\n\n respond_to do |format|\n format.html { redirect_to(season_teams_path(params[:season_id])) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @admin_club.destroy\n respond_to do |format|\n format.html { redirect_to admin_clubs_url, notice: 'Club was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @episode.destroy\n respond_to do |format|\n format.html { redirect_to serial_season_episodes_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @admin_schedule.destroy\n respond_to do |format|\n format.html { redirect_to admin_schedules_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @admin_stage.destroy\n respond_to do |format|\n format.html { redirect_to admin_stages_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @seo_datum = SeoDatum.find(params[:id])\n @seo_datum.destroy\n\n respond_to do |format|\n format.html { redirect_to seo_data_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @dailyStanding = DailyStanding.find(params[:id])\n @dailyStanding.destroy\n\n respond_to do |format|\n format.html { redirect_to dailyStanding_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @studio_client.destroy\n respond_to do |format|\n format.html { redirect_to studio_clients_url, notice: 'Studio client was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @game_studio.destroy\n respond_to do |format|\n format.html { redirect_to game_studios_url, notice: 'Game studio was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @variety.destroy\n respond_to do |format|\n format.html { redirect_to admin_varieties_path, notice: 'La variedad fue eliminada' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @lab_seminar.destroy\n respond_to do |format|\n format.html { redirect_to lab_seminars_url, notice: 'Seminar was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @sproject = current_user.sprojects.find(params[:id])\n @sproject.destroy\n\n respond_to do |format|\n format.html { redirect_to sprojects_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @admin_craftsman.destroy\n respond_to do |format|\n format.html { redirect_to admin_craftsmen_url, notice: 'Craftsman was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @sesh.destroy\n respond_to do |format|\n format.html { redirect_to root_path }\n format.json { head :no_content }\n end\n end",
"def destroy\n @slab = Slab.find(params[:id])\n @slab.destroy\n\n respond_to do |format|\n format.html { redirect_to slabs_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @shelf.destroy\n\n respond_to do |format|\n format.html { redirect_to shelves_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @nightclub = Nightclub.find(params[:id])\n @nightclub.destroy\n\n respond_to do |format|\n format.html { redirect_to nightclubs_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @three60.destroy\n respond_to do |format|\n format.html { redirect_to edit_admin_good_url(@good, anchor: \"three60\") }\n format.json { head :no_content }\n end\n end",
"def destroy\n @sport_odd.destroy\n respond_to do |format|\n format.html { redirect_to sport_odds_url, notice: 'Sport odd was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @games_of_week.destroy\n respond_to do |format|\n format.html { redirect_to games_of_weeks_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @sproject.destroy\n respond_to do |format|\n format.html { redirect_to sprojects_url, notice: 'Sproject was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @shelf.destroy\n respond_to do |format|\n format.html { redirect_to shelves_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @c_rodinny_stav.destroy\n respond_to do |format|\n format.html { redirect_to c_rodinny_stavs_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @chapter_view.destroy\n respond_to do |format|\n format.html { redirect_to :controller => 'seasons', :action => 'show', :id => Season.find(Chapter.find(@chapter_view.chapter_id).season_id)}\n format.json { head :no_content }\n end\n end",
"def destroy\n @season = Season.find(params[:season_id])\n @week = Week.find(params[:id])\n @week.destroy\n\n respond_to do |format|\n format.html { redirect_to season_weeks_path(@season) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @stable = Stable.find(params[:id])\n @stable.destroy\n\n respond_to do |format|\n format.html { redirect_to stables_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @studio = Studio.find(params[:id])\n @studio.destroy\n\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 @orbituarysite = Orbituarysite.find(params[:id])\n @orbituarysite.destroy\n\n respond_to do |format|\n format.html { redirect_to root_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n official = Official.find(params[:id])\n official.destroy\n head 204\n end",
"def destroy\n @design_version.destroy\n respond_to do |format|\n format.html { redirect_to design_versions_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @time_series.destroy\n\n respond_to do |format|\n format.html { redirect_to time_series_index_url(@owner), flash: {success: t('app.msgs.success_deleted', :obj => t('mongoid.models.time_series.one'))} }\n format.json { head :no_content }\n end\n end",
"def destroy\n @club.destroy\n respond_to do |format|\n format.html { redirect_to clubs_url }\n format.json { head :no_content }\n end\n\n end",
"def destroy\n @samochod.destroy\n respond_to do |format|\n format.html { redirect_to samochods_url, notice: 'Samochod was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @sportgood.destroy\n respond_to do |format|\n format.html { redirect_to \"/admin/manufacturers/category/sportgood\", notice: 'Sportgood was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @series_statement.destroy\n\n respond_to do |format|\n format.html { redirect_to series_statements_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @sondage.destroy\n respond_to do |format|\n format.html { redirect_to sondages_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @hwm_studio = HwmStudio.find(params[:id])\n @hwm_studio.destroy\n\n respond_to do |format|\n format.html { redirect_to hwm_studios_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @soda.destroy\n respond_to do |format|\n format.html { redirect_to sodas_url, notice: 'Soda was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @variant.destroy\n respond_to do |format|\n format.html { redirect_to edit_admin_good_url(@variant.good, anchor: \"variants\") }\n format.json { head :no_content }\n end\n end",
"def destroy\n @gamesofweek.destroy\n respond_to do |format|\n format.html { redirect_to gamesofweeks_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @go_slim = GoSlim.find(params[:id])\n @go_slim.destroy\n\n respond_to do |format|\n format.html { redirect_to go_slims_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @bracket_golfer.destroy\n respond_to do |format|\n format.html { redirect_to bracket_golfers_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @tv_series.destroy\n respond_to do |format|\n format.html { redirect_to tv_series_index_url, notice: 'Сериал удален!' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @team_has_d.destroy\n respond_to do |format|\n format.html { redirect_to team_has_ds_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @theory_day.destroy\n respond_to do |format|\n format.html { redirect_to theory_days_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @game_title.destroy\n respond_to do |format|\n format.html { redirect_to game_titles_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @club.destroy\n respond_to do |format|\n format.html { redirect_to clubs_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @club.destroy\n respond_to do |format|\n format.html { redirect_to clubs_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n # Get the user to be deleted\n OrderSeason.find(params[:id]).destroy\n # Deletes all pickup dates\n PickupDate.where(:order_season_id => params[:id]).delete_all\n # Deletes all orders\n Order.where(:order_season_id => params[:id]).delete_all\n # Deletes all order season products\n OrderSeasonProduct.where(:order_seasons_id => params[:id]).delete_all\n\n flash[:success]= \"Order season deleted\"\n redirect_to order_seasons_url # Redirect the user back to the same page with a success message\n end",
"def destroy\n redirect_to action: \"latest\"\n @davis = Davis.find(params[:id])\n @davis.destroy\n\n #respond_to do |format|\n # format.html { redirect_to davis_url }\n # format.json { head :no_content }\n #end\n end",
"def destroy\n @study_site.destroy\n respond_to do |format|\n format.html { redirect_to study_sites_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @stance.destroy\n respond_to do |format|\n format.html { redirect_to stances_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @stance.destroy\n respond_to do |format|\n format.html { redirect_to stances_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @seguidore = Seguidore.find(params[:id])\n @seguidore.destroy\n\n respond_to do |format|\n format.html { redirect_to seguidores_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @strosek.destroy\n respond_to do |format|\n format.html { redirect_to stroseks_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n puts @game.date.to_s\n @game.destroy\n respond_to do |format|\n format.html { redirect_to games_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n student.destroy\n respond_to do |format|\n format.html { redirect_to admin_students_path }\n format.json { head :no_content }\n end\n end",
"def destroy\n @baz54.destroy\n respond_to do |format|\n format.html { redirect_to baz54s_url, notice: \"Baz54 was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"def destroy\n @slam = Slam.find(params[:id])\n @slam.destroy\n\n respond_to do |format|\n format.html { redirect_to slams_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @baz35.destroy\n respond_to do |format|\n format.html { redirect_to baz35s_url, notice: \"Baz35 was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"def destroy\n @science_instance.destroy\n respond_to do |format|\n format.html { redirect_to science_instances_url, notice: 'Science instance was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @lesson.destroy\n respond_to do |format|\n format.html { redirect_to admin_path(:anchor => 'tab=lessons') , notice: 'Lesson was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @baz31.destroy\n respond_to do |format|\n format.html { redirect_to baz31s_url, notice: \"Baz31 was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"def destroy\n @tea_club.destroy\n respond_to do |format|\n format.html { redirect_to tea_clubs_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @semester.destroy\n respond_to do |format|\n format.html { redirect_to semesters_url, notice: 'Semester was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @semester.destroy\n respond_to do |format|\n format.html { redirect_to semesters_url, notice: 'Semester was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @community_health_station = CommunityHealthStation.find(params[:id])\n @community_health_station.destroy\n\n respond_to do |format|\n format.html { redirect_to community_health_stations_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @crew_big_sonu_schedule.destroy\n respond_to do |format|\n format.html { redirect_to crew_big_sonu_schedules_url, notice: 'Big sonu schedule was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @admin_game.destroy\n respond_to do |format|\n format.html { redirect_to admin_games_url, notice: 'Game was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @schedule.destroy\n respond_to do |format|\n format.html { redirect_to admin_schedules_url, notice: '赛程删除成功' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @admin.destroy\n\n render json: { operation: 'OK' }, status: :ok\n end",
"def destroy\n @seo.destroy\n respond_to do |format|\n format.html { redirect_to seos_url, notice: 'Seo was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @division = Division.find(params[:id])\n @division.destroy\n\n respond_to do |format|\n format.html { redirect_to league_divisions_url(params[:league_id]) }\n format.json { head :no_content }\n end\n end",
"def destroy\n @club = Club.find(params[:id])\n @club.destroy\n\n respond_to do |format|\n format.html { redirect_to root_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @schedule.destroy\n respond_to do |format|\n format.html { redirect_to admins_backoffice_schedules_path, notice: 'Horário foi deletado com sucesso!' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @socioeconomic_study = SocioeconomicStudy.find(params[:id])\n @socioeconomic_study.destroy\n\n respond_to do |format|\n format.html { redirect_to socioeconomic_studies_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @clapme_stage.destroy\n respond_to do |format|\n format.html { redirect_to website_stages_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @sportsfield = Sportsfield.find(params[:id])\n @sportsfield.destroy\n\n respond_to do |format|\n format.html { redirect_to sportsfields_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @step_seven.destroy\n respond_to do |format|\n format.html { redirect_to step_sevens_url, notice: 'Step seven was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @baz37.destroy\n respond_to do |format|\n format.html { redirect_to baz37s_url, notice: \"Baz37 was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"def destroy\n @harvest = Harvest.find(params[:id])\n @harvest.destroy\n\n respond_to do |format|\n format.html { redirect_to harvests_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @harvest = Harvest.find(params[:id])\n @harvest.destroy\n\n respond_to do |format|\n format.html { redirect_to harvests_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @stock.destroy\n respond_to do |format|\n format.html { redirect_to stocks_url }\n format.json { head :no_content }\n end\n end"
] |
[
"0.7915161",
"0.7884197",
"0.7858903",
"0.7802964",
"0.7740253",
"0.76941186",
"0.7636819",
"0.75907576",
"0.73634756",
"0.7242498",
"0.70923734",
"0.7075628",
"0.70716405",
"0.7067745",
"0.70570636",
"0.7053149",
"0.70393634",
"0.70211005",
"0.70117146",
"0.6993472",
"0.6988481",
"0.6945787",
"0.6943162",
"0.6907746",
"0.6901008",
"0.69001573",
"0.6892047",
"0.6854582",
"0.6850952",
"0.6837234",
"0.6833564",
"0.6832961",
"0.6830535",
"0.6830404",
"0.6828273",
"0.6827142",
"0.68121773",
"0.68062377",
"0.68052727",
"0.67980397",
"0.6795041",
"0.6792383",
"0.67905086",
"0.67856836",
"0.6781121",
"0.6777966",
"0.67733365",
"0.6771774",
"0.6771278",
"0.6770354",
"0.6759344",
"0.67524946",
"0.675151",
"0.6750124",
"0.6746897",
"0.6745931",
"0.674513",
"0.67407805",
"0.6736354",
"0.673276",
"0.6731582",
"0.6729969",
"0.6727716",
"0.67259616",
"0.67259616",
"0.67258674",
"0.67257637",
"0.67231023",
"0.67216355",
"0.67216355",
"0.67214596",
"0.671611",
"0.67149824",
"0.671319",
"0.67117476",
"0.6709715",
"0.67049295",
"0.67030877",
"0.67026335",
"0.6699083",
"0.66988224",
"0.66909057",
"0.66909057",
"0.66879404",
"0.66861004",
"0.6682544",
"0.667916",
"0.66783285",
"0.6676573",
"0.66764694",
"0.6676399",
"0.667301",
"0.6672482",
"0.66717166",
"0.6669051",
"0.6663092",
"0.66630036",
"0.66609025",
"0.66609025",
"0.6660438"
] |
0.8084412
|
0
|
Use callbacks to share common setup or constraints between actions.
|
def set_admin_season
@admin_season = Season.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 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 default_action; end",
"def my_actions(options)\n @setup = false\n get_template_part(\"custom_used\",\"action_users\",true)\n 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.6163927",
"0.6046165",
"0.59465253",
"0.59167755",
"0.58904207",
"0.58346355",
"0.577713",
"0.5703502",
"0.5703502",
"0.56531286",
"0.56215113",
"0.54224145",
"0.5410795",
"0.5410795",
"0.5410795",
"0.53924775",
"0.5379919",
"0.53580743",
"0.53401667",
"0.53397506",
"0.5332605",
"0.5312215",
"0.5296594",
"0.52965283",
"0.52957606",
"0.5259903",
"0.52443177",
"0.523896",
"0.523896",
"0.523896",
"0.523896",
"0.523896",
"0.52329034",
"0.52322394",
"0.5227445",
"0.5222394",
"0.5220348",
"0.5212759",
"0.5207747",
"0.5205933",
"0.5176468",
"0.5173833",
"0.5171983",
"0.51663405",
"0.5159596",
"0.5158247",
"0.51526845",
"0.5152398",
"0.5151361",
"0.5145775",
"0.5140135",
"0.51338995",
"0.51127726",
"0.5112607",
"0.5112607",
"0.5110613",
"0.51067513",
"0.5092337",
"0.508788",
"0.5081578",
"0.5080434",
"0.50679874",
"0.50567716",
"0.5051213",
"0.5048352",
"0.5048352",
"0.5035347",
"0.5026666",
"0.5023127",
"0.5016081",
"0.50129867",
"0.5000684",
"0.4999752",
"0.49979812",
"0.499026",
"0.499026",
"0.49866846",
"0.49800366",
"0.49795717",
"0.49771172",
"0.4968475",
"0.4965813",
"0.4958072",
"0.49561292",
"0.4954901",
"0.49536785",
"0.4953058",
"0.49468648",
"0.49424478",
"0.4932989",
"0.49291888",
"0.49273813",
"0.49271655",
"0.4925948",
"0.49236968",
"0.49203572",
"0.49181753",
"0.49173692",
"0.4916862",
"0.49161318",
"0.49155986"
] |
0.0
|
-1
|
Never trust parameters from the scary internet, only allow the white list through.
|
def admin_season_params
params.require(:season).permit(:id, :league_id, :year, :day, :start_date, :number_of_weeks, :roll_off_weeks, :dates_off, :handicap_base, :handicap_percent, :location, :practice_length, :starts_at)
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
|
Update the visibility of the work to match the correct state of the embargo, then clear the embargo date, etc. Saves the embargo and the work
|
def destroy
case work
when Valkyrie::Resource
embargo_manager = Hyrax::EmbargoManager.new(resource: work)
return if embargo_manager.embargo.embargo_release_date.blank?
embargo_manager.deactivate!
work.embargo = Hyrax.persister.save(resource: embargo_manager.embargo)
Hyrax::AccessControlList(work).save
else
work.embargo_visibility! # If the embargo has lapsed, update the current visibility.
work.deactivate_embargo!
work.embargo.save!
work.save!
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def deactivate_embargo!\n return if embargo.nil?\n # embargo.deactivate! whipes out work.visibility_after_embargo before it can be applied, so save it and apply it\n vis_after = visibility_after_embargo\n vis_after = Hydra::AccessControls::AccessRight::VISIBILITY_TEXT_VALUE_AUTHENTICATED if vis_after.nil?\n # Deepblue::LoggingHelper.bold_debug [ Deepblue::LoggingHelper.here,\n # Deepblue::LoggingHelper.called_from,\n # \"before\",\n # \"vis_after=#{vis_after}\",\n # \"id=#{id}\",\n # \"embargo_release_date=#{embargo_release_date}\",\n # \"visibility=#{visibility}\",\n # \"visibility_during_embargo=#{visibility_during_embargo}\",\n # \"visibility_after_embargo=#{visibility_after_embargo}\" ]\n embargo.deactivate!\n # Deepblue::LoggingHelper.bold_debug [ Deepblue::LoggingHelper.here,\n # Deepblue::LoggingHelper.called_from,\n # \"after\",\n # \"id=#{id}\",\n # \"embargo_release_date=#{embargo_release_date}\",\n # \"visibility=#{visibility}\",\n # \"visibility_during_embargo=#{visibility_during_embargo}\",\n # \"visibility_after_embargo=#{visibility_after_embargo}\" ]\n self.visibility = vis_after\n visibility_will_change!\n end",
"def update\n @saving_allowed = false\n update_state\n update_dialog\n end",
"def apply\n return false unless under_embargo?\n\n resource.visibility = embargo.visibility_during_embargo\n end",
"def update\n @work = Work.find(params[:id])\n if not (@current_user.mine?(@work) || @current_user.admin? || @current_user.produce? )\n redirect_to @current_user\n else\n\n @users = User.find(:all)\n @projects = Project.find(:all)\n @job_types = JobType.find(:all)\n @places = Place.find(:all)\n respond_to do |format|\n if @work.update_attributes(params[:work])\n flash[:notice] = 'Work was successfully updated.'\n format.html { redirect_to(@work) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @work.errors, :status => :unprocessable_entity }\n end\n end\n end\n end",
"def update\n if params[:work] && params[:work][:tag_list] && params[:work][:title]\n # Add the work's title to the list of tags\n params[:work][:tag_list].downcase!\n separated_title = params[:work][:title].downcase.split(/\\s+/)\n separated_title.each do |tag|\n unless params[:work][:tag_list].include? tag\n params[:work][:tag_list] = params[:work][:tag_list] + ', ' + tag\n end\n end\n end\n\n @work = Work.friendly.find(params[:id])\n @work.slug = nil\n\n if !params[:work][:novel_id].blank?\n @work.novel = Novel.find(params[:work][:novel_id])\n else\n @work.novel = nil\n end\n\n if @work.update(work_params)\n # Inform users who favourited the work that is has been updated\n send_new_update_notifications(@work) unless @work.is_private or @work.is_anonymous\n record_edit_history(@work, current_user)\n\n flash[:success] = 'The work was successfully edited.'\n redirect_to @work\n else\n @work_errors = {}\n @work.errors.each do |attr, msg|\n @work_errors[attr] = msg\n end\n render 'edit'\n end\n end",
"def modify_visibility\n @content = Content.find(params[:id])\n @content[params[:vis]] = !@content[params[:vis]]\n if @content.save\n flash[:project_success] = I18n.t('content.visibility_success')\n end\n redirect_to :back\n end",
"def update\n @entrenamiento = Entrenamiento.find(params[:id])\n @entrenamiento.show_or_wait=true\n @entrenamiento.save\n flash[:success] = \"Entrenamiento guardado!\"\n redirect_to entrenamientos_home_path\n end",
"def fill_out_work(work)\n work.title = self.title\n\n if self.bib_number.present?\n work.build_external_id(category: \"bib\", value: self.bib_number)\n end\n if self.accession_number.present?\n work.build_external_id(category: \"accn\", value: self.accession_number)\n end\n if self.museum_object_id.present?\n work.build_external_id(category: \"object\", value: self.museum_object_id)\n end\n if self.box.present? || self.folder.present?\n work.physical_container = {box: self.box.presence, folder: self.folder.presence}\n end\n if self.dimensions.present?\n work.extent = self.dimensions\n end\n\n if self.collecting_area == \"archives\"\n work.department = \"Archives\"\n elsif self.collecting_area == \"rare_books\" || self.collecting_area == \"modern_library\"\n work.department = \"Library\"\n elsif self.collecting_area == \"museum\"\n work.department = \"Museum\"\n end\n\n end",
"def update\n if @workout.update(workout_params)\n @workout.fetch_strava_data! if @workout.needs_strava_data?\n redirect_to workout_path(@workout),\n notice: t('.success')\n else\n page_meta[:workout_description] = @workout.short_description\n render :edit\n end\n end",
"def update\n @agile_task = AgileTask.find(params[:id])\n\n respond_to do |format|\n if developer?\n @agile_task.updated_by = current_user.login\n @agile_task.completion_date = Date.today if params[:task_completed].to_i == 1\n if params[:task_not_completed].to_i == 1\n @agile_task.completion_date = nil\n date_keys = params[:agile_task].keys.select {|k| k.match(/completion_date/)}\n date_keys.each {|k| params[:agile_task].delete(k)}\n end\n param_users = (params[:user_ids].map {|i| i.to_i} rescue []).to_set\n task_users = (@agile_task.task_owners.map {|i| i.user_id}).to_set\n (param_users - task_users).each {|uid| TaskOwner.create(:user => User.find(uid), :agile_task => @agile_task)}\n (task_users - param_users).each {|uid| TaskOwner.find(:first, :conditions => [\"agile_task_id = ? and user_id = ?\", @agile_task.id, uid]).destroy rescue nil }\n\n\n if @agile_task.update_attributes(params[:agile_task])\n story = Story.find(@agile_task.story_id)\n iteration = story.iteration\n format.html { redirect_to(iteration_stories_url(iteration,:anchor => \"task_\" + @agile_task.id.to_s)) }\n format.xml { head :ok }\n else\n format.html do \n @agile_task.reload\n @story = Story.find(@agile_task.story_id)\n @iteration = Iteration.find(@story.iteration_id)\n @project = @iteration.project\n render :action => \"edit\"\n end \n format.xml { render :xml => @agile_task.errors, :status => :unprocessable_entity }\n end\n else\n format.xml { render :xml => XML_ERRORS[:not_authorized]}\n end\n end\n end",
"def update\n @experiment = Experiment.find(params[:id])\n raise SecurityError unless (@experiment.user == current_user) or current_user_is_admin?\n\n # updates the visibility from checkbox to \"public\" or \"private\"\n params[:experiment][:visibility]= params[:experiment][:visibility] == \"1\" ? \"public\" : \"private\"\n\n respond_to do |format|\n if @experiment.update_attributes(params[:experiment])\n format.html { redirect_to @experiment, notice: 'Experiment was successfully updated.' }\n #format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n #format.json { render json: @experiment.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @work.update_attributes(work_params)\n if save_and_flash(@work)\n redirect_to work_path(@work)\n return\n else\n render :edit, status: :bad_request\n return\n end\n end",
"def update_document(obj)\n visibility_changed = visibility_status(obj)\n obj.attributes = work_params\n obj.date_modified = Time.current.ctime\n obj.save\n VisibilityCopyJob.perform_later(obj) if visibility_changed\n InheritPermissionsJob.perform_later(obj) if work_params.fetch(:permissions_attributes, nil)\n end",
"def update\n @partida = Partida.find(params[:id])\n @partida.show_or_wait=true\n @partida.save\n @competencia = @partida.competencia\n flash[:success] = \"La partida #{@partida.id} ha sido guardada\"\n redirect_to competencia_path(@competencia)\n end",
"def edit\n user_timezone_specified\n edit_params_setting\n assignment_staggered_deadline?\n update_due_date\n check_questionnaires_usage\n @due_date_all = update_nil_dd_deadline_name(@due_date_all)\n @due_date_all = update_nil_dd_description_url(@due_date_all)\n unassigned_rubrics_warning\n path_warning_and_answer_tag\n update_assignment_badges\n @assigned_badges = @assignment_form.assignment.badges\n @badges = Badge.all\n @use_bookmark = @assignment.use_bookmark\n @duties = Duty.where(assignment_id: @assignment_form.assignment.id)\n end",
"def save_employment\n self.current_stage = :references_stage\n self.save\n true\n end",
"def update\n @effort = Effort.find(params[:id])\n @effort.completed_at = Time.now if params[:commit] == \"Concluir atividade\"\n\n respond_to do |format|\n if @effort.update_attributes(params[:effort])\n format.html { redirect_to admin_efforts_path, notice: 'Alocação atualizada com sucesso.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @effort.errors, status: :unprocessable_entity }\n end\n end\n end",
"def complete_homework\n self.homeworks.where(\"status = ?\", \"incomplete\").each {|hw| hw.update(status: \"completed\")}\n end",
"def update\n respond_to do |format|\n if @work.update_attributes(params[:work])\n format.html { redirect_to @work, :notice => 'Obra atualizada com sucesso!' }\n format.json { head :no_content }\n else\n 1.times { @work.work_documents.build }\n load_cities_validate()\n format.html { render :action => \"edit\" }\n format.json { render :json => @work.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def approve\n if self.status == \"pending_presenter\" || self.status == \"pending_admin\"\n \n #move edit columns to permanent columns\n self.bio = self.bio_edit\n if self.picture_edit_stored?\n self.picture = self.picture_edit\n end\n\n #clear edit columns\n self.bio_edit = ''\n self.picture_edit = nil\n \n #update status to approved\n self.status = :approved\n return self.save\n else\n return false\n end\n end",
"def touch\n @saved = false\n end",
"def update\n params[:workout][:workout_date] = \"#{params[:workout][:workout_date]} #{params[:workout][:time]}\"\n params[:workout] = params[:workout].slice(:workout_date, :exercises_attributes)\n @lift_name = params[:workout][:exercises_attributes][\"0\"][:lift_id]\n params[:workout][:exercises_attributes][\"0\"][:lift_id] = Lift.find_by_lift_name(@lift_name).id\n @workout = Workout.find(params[:id])\n\n respond_to do |format|\n if @workout.update_attributes(params[:workout])\n format.html { redirect_to @workout, notice: 'Workout was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @workout.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n if (!user_signed_in? or !(@@institucion_cultural_roles.concat(@@sup_inc_roles).include?(current_user.role)) )\n respond_to do |format|\n format.html { redirect_to(new_user_session_path) }\n end\n return\n end\n \n @title_view = 'Cuidado y Mantenimiento'\n @cultural_heritage_care_and_maintenance = CulturalHeritage::CareAndMaintenance.find(params[:id])\n\n# @cultural_heritage_care_and_maintenance.start_date = DateTime.strptime(@cultural_heritage_care_and_maintenance.start_date, \"%d/%m/%Y\")\n# @cultural_heritage_care_and_maintenance.end_date = DateTime.strptime(@cultural_heritage_care_and_maintenance.end_date, \"%d/%m/%Y\")\n \n @cultural_heritages = CulturalHeritage::CulturalHeritage.all\n @cultural_institutions = CulturalHeritage::CulturalInstitution.all\n @cultural_care_and_maintenance_types = CulturalHeritage::CareAndMaintenanceType.all\n @security_person=Security::Person.all\n @care_and_maintenance_experts = User.find(:all,:conditions=>[\"role = ?\",@@exp_inc_roles])\n respond_to do |format|\n if @cultural_heritage_care_and_maintenance.update_attributes(params[:cultural_heritage_care_and_maintenance])\n format.html { redirect_to(@cultural_heritage_care_and_maintenance, :notice => 'El Cuidado y Mantenimiento fue actualizado satisfactoriamente.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @cultural_heritage_care_and_maintenance.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @step = @project.steps.find_by_position(params[:id])\n authorize! :update, @step \n\n # update corresponding collections\n @step.project.collections.each do |collection|\n collection.touch\n end\n \n @step.images.each do |image|\n image.update_attributes(:saved => true)\n end\n\n # remove question if question description is empty\n if params[:step][:question_attributes] && params[:step][:question_attributes][:description].length == 0 && @step.question\n @step.question.destroy\n end\n\n if params[:step][:published_on_date]\n date = params[:step][:published_on_date]\n logger.debug \"date: #{date}\"\n time = params[:step][:published_on_time]\n # retain the same seconds as the original published_on date\n time.insert 5, \":\" + @step.published_on.strftime(\"%S\")\n # logger.debug \"time: #{time}\"\n timeZone = params[:step][:timeZone]\n # logger.debug \"timeZone: #{timeZone}\"\n dateTime = date + \" \" + time + \" \" + timeZone\n # logger.debug \"dateTime: #{dateTime}\"\n dateTime = DateTime.strptime(dateTime, '%m/%d/%Y %I:%M:%S %p %Z')\n # logger.debug \"datetime: #{dateTime}\"\n \n params[:step][:published_on] = dateTime\n params[:step].delete :'published_on_date'\n params[:step].delete :\"published_on_time\"\n params[:step].delete :timeZone\n end\n\n # update the project \n @project.touch\n\n # update the user last updated date\n current_user.touch\n\n # remove any design attributes if they contain an ID that doesn't exist (the file had been removed)\n if params[:step][:design_files_attributes]\n params[:step][:design_files_attributes].values.each do |design_file|\n if DesignFile.exists?(design_file['id']) == false\n design_file.delete :id\n end\n end\n end\n \n respond_to do |format|\n\n if @step.update_attributes(params[:step])\n \n # clear label color if user didn't select color\n if @step.label == false\n @step.update_column(\"label_color\", nil)\n end\n\n # clear edit\n edit = Edit.where(\"user_id = ? AND step_id = ?\", current_user.id, @step.id).first\n edit.update_attributes(:started_editing_at => nil)\n if edit.project_id.blank?\n edit.update_attributes(:project_id => @project.id)\n end\n \n # check whether project is published\n if @project.public? || @project.privacy.blank?\n @project.set_published(current_user.id, @project.id, @step.id)\n end\n\n # check and set built attribute of project\n @project.set_built\n\n # create a public activity for any questions associated with the step if it doesn't already exist\n if @step.question && !PublicActivity::Activity.where(:trackable_type => \"Question\").where(:trackable_id => @step.question.id).exists?\n @step.question.create_activity :create, owner: current_user, primary: true\n end\n\n # create project on the village if the current user is a village user and the project doesn't already exist\n if @project.village_id.blank? && current_user.from_village? && !access_token.blank? && @project.public?\n create_village_project\n elsif !@project.village_id.blank? && !access_token.blank?\n update_village_project\n end\n\n format.html { \n redirect_to project_steps_path(@project), :notice => 'Step was successfully updated.', :flash => {:createdStep => @step.id} \n }\n format.json { head :no_content }\n else\n Rails.logger.info(@step.errors.inspect)\n format.html { render :action => \"edit\" }\n format.json { render :json => @step.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def draft\n @works = Work.draft\n render :index\n end",
"def create\n logger.debug \"**** WORK CREATE ****\"\n \n #Fix the value coming back from the check box\n if params[:work][:no_duration] == \"on\"\n params[:work][:no_duration] = \"true\"\n else\n params[:work][:no_duration] = \"false\"\n end\n @work = Work.new(params[:work])\n logger.debug \"Created work, fields are #{@work.to_yaml}\"\n\n \n @work.intended_duration = nil if params[:work][:intended_duration].blank?\n \n @main_category = @work.main_category #Used by form\n \n\t@composers = session[:composers]\n\t\n #add a superwork with the same name as the work in question if no superwork is attached\n if ! @work.superwork\n logger.info(\"No superwork assigned!\")\n\t\t\n\t\tcomposers_names = @composers.map{|c| c.contributor.role.contributor_names}.flatten.uniq.join(', ')\n \n\t\t@work.superwork=Superwork.create(:superwork_title=>@work.work_title + \" - \" + composers_names,:updated_by=>@login.login_id,:status_id=>params[:work][:status_id])\n end\n \n show_params(params)\n \n \n logger.debug \"WORK SUBCATS are #{@work.work_subcategories.length}\"\n \n #Create implicit FRBR relationships\n\n @work.login_updated_by = @login\n \n if @work.save_with_composers(@composers)\n logger.debug \"WORK SAVED OK\"\n @work.frbr_updateImplicitRelationships(@login.login_id)\n @subcategories=session[:work_subcategories]\n for subcategory in @subcategories\n @work.work_subcategories << subcategory\n end\n @work.save() \n flash[:notice] = 'Work was successfully created.'\n \n redirect_to :action => 'show', :id => @work\n else\n logger.debug \"WORK DID NOT SAVE - RENDERING NEW FORM\"\n prepare_new\n @interval_duration = IntervalDuration.create_from_string_no_validation(@work.intended_duration)\n\n \n render :action => 'new'\n end\n end",
"def ensure_embargo\n return true if publication_state == Databank::PublicationState::DRAFT\n\n return true if publication_state == embargo\n\n return true if embargo.nil?\n\n return true if embargo == Databank::PublicationState::Embargo::NONE\n\n return true if release_date <= Time.current\n\n self.publication_state = self.embargo\n self.save!\n end",
"def update\n respond_to do |format|\n if @work_exp.update(work_exp_params)\n format.html { redirect_to @work_exp, notice: 'Work exp was successfully updated.' }\n format.json { render :show, status: :ok, location: @work_exp }\n else\n format.html { render :edit }\n format.json { render json: @work_exp.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update_existed_works(existed_works_id) \n #self.work_ids = existed_works_id\n self.works = Work.where(id: existed_works_id)\n self.touch #update user's attribute \"updated_at\" (because cashing)\n end",
"def update\n ### Scoped properly\n\n @goal = Goal.find(params[:id])\n\n \n\n if !@goal.pushes_allowed_per_day\n @goal.pushes_allowed_per_day = 1\n end\n \n \n if current_user.id != @goal.user.id\n redirect_to(server_root_url) \n else \n ################################\n #Status Change Business Rules\n ################################\n\n # Theory: keep past data that's relevant for later analysis\n\n ##start --> hold \n ##monitor --> hold\n # 1) (keep any past/non-default checkpoints for future stats)\n\n #start --> monitor \n #hold --> monitor\n #monitor --> start\n #hold --> start\n # 1) (remove all existing checkpoints (as of 20110913))\n # 2) (set goal.start to today, stopping after goal.days_to_form_a_habit days)\n\n old_status = @goal.status\n\n old_publish = @goal.publish\n \n \n respond_to do |format|\n if @goal.update_attributes(params[:goal])\n\n\n\n ### if we just created this goal and then want to say\n ### start today instead of tomorrow\n if params[:delay_start_for_this_many_days] \n start_day_offset = params[:delay_start_for_this_many_days].to_i\n ### Set the standard dates\n @goal.start = @goal.start + start_day_offset\n @goal.stop = @goal.start + @goal.days_to_form_a_habit\n @goal.first_start_date == @goal.start\n end\n\n\n \n ### update last activity date\n @goal.user.last_activity_date = @goal.user.dtoday\n @goal.user.save\n \n @goal.title = @goal.response_question\n\n \n ##### SET THE HOUR THAT THE REMINDERS SHOULD GO OUT FOR THIS GOAL #############\n if @goal.usersendhour == nil\n\t @goal.usersendhour = 20 ### 8pm\n end\n\n Time.zone = @goal.user.time_zone\n utcoffset = Time.zone.formatted_offset(false)\n offset_seconds = Time.zone.now.gmt_offset \n send_time = Time.utc(2000, \"jan\", 1, @goal.usersendhour, 0, 0) #2000-01-01 01:00:00 UTC\n central_time_offset = 21600 #add this in since we're doing UTC\n server_time = send_time - offset_seconds - central_time_offset\n puts \"User lives in #{@goal.user.time_zone} timezone, UTC offset of #{utcoffset} (#{offset_seconds} seconds).\" #Save this value in each goal, and use that to do checkpoint searches w/ cronjob\n puts \"For them to get an email at #{send_time.strftime('%k')} their time, the server would have to send it at #{server_time.strftime('%k')} Central time\" \n @goal.serversendhour = server_time.strftime('%k')\n @goal.gmtoffset = utcoffset\n\n #############\n\n\n if @goal.daym == nil \n @goal.daym = true\n end\n if @goal.dayt == nil \n @goal.dayt = true\n end\n if @goal.dayw == nil \n @goal.dayw = true\n end\n if @goal.dayr == nil \n @goal.dayr = true\n end\n if @goal.dayf == nil \n @goal.dayf = true\n end\n if @goal.days == nil \n @goal.days = true\n end\n if @goal.dayn == nil \n @goal.dayn = true\n end\n\n if @goal.template_owner_is_a_template\n @goal.save \n flash[:notice] = 'Template was successfully updated.'\n logger.info 'SGJ Template was successfully updated.'\n else\n if @goal.status != \"hold\" and @goal.daym and @goal.dayt and @goal.dayw and @goal.dayr and @goal.dayf and @goal.days and @goal.dayn and (@goal.goal_days_per_week == nil or @goal.goal_days_per_week == 7)\n @goal.status = \"start\"\n else\n @goal.status = \"monitor\"\n end\n @goal.save \n flash[:notice] = 'Goal was successfully updated.'\n logger.info 'SGJ Goal was successfully updated.'\n end\n\n\n\n\n\n dnow = get_dnow\n \n logger.debug 'old_status =' + old_status\n logger.debug 'new status =' + @goal.status\n ##If status was changed to start or monitor, delete and re-create future checkpoints\n if old_status != @goal.status\n if (@goal.status == \"start\" or @goal.status == \"monitor\") \n #set_start_date(@goal.id, dnow)\n #set_stop_date(@goal.id, 0)\n @goal.start = dnow\n @goal.stop = @goal.start + @goal.days_to_form_a_habit\n\n ################################################################################################\n #### If someone is switching a goal from a \"monitor\" goal over to a \"start\" goal,\n #### then make sure all days-of-the week get saved as \"checked\", \n #### otherwise it won't create their checkpoints, and it will end their start date prematurely.\n if @goal.status == \"start\"\n @goal.daym = true\n @goal.dayt = true\n @goal.dayw = true\n @goal.dayr = true\n @goal.dayf = true\n @goal.days = true\n @goal.dayn = true\n end\n ################################################################################################\n ################################################################################################ \n \n ############################\n ### If someone is going from \"hold\" to \"re-activate\"\n ### delete the old checkpoints because keeping them messes up the success rate\n ### they have been warned of this happening already\n #if old_status == \"hold\"\n # ### Re-set days straight to 0\n # @goal.daysstraight = 0\n # \n # ### Destroy any associated Checkpoints\n # @checkpoints = Checkpoint.find(:all, :conditions => \"goal_id = '#{@goal.id}'\")\n # for checkpoint in @checkpoints\n # checkpoint.destroy\n # end \n #end \n ############################\n ############################\n\n end\n if @goal.status == \"hold\"\n @goal.start = Date.new(1900, 1, 1)\n @goal.stop = @goal.start \n end\n ### save date changes\n @goal.save\n\n\n #format.html { render :action => \"index\" } # index.html.erb\n #format.xml { render :xml => @goals }\n end\n\n\n ### when a goal is saved by user, if it's \"private\", remove any entries from \"encourage_items\"\n if @goal.publish == false and old_publish == true\n logger.info(\"sgj:goals_controller.rb:about to remove entries because publish status changing\")\n encourage_items = EncourageItem.find(:all, :conditions => \"goal_id = '#{@goal.id}'\")\n encourage_items.each do |e|\n e.destroy\n end\n end\n\n\n if @goal.template_owner_is_a_template\n flash[:notice] = 'Template was successfully updated.' + flash[:notice]\n else\n flash[:notice] = 'Goal was successfully updated.' + flash[:notice]\n end\n\n\n ### if this template is for a program, redirect to the program\n if @goal.template_owner_is_a_template and params[:program_id]\n format.html {redirect_to(\"/programs/#{params[:program_id]}#action_items\")}\n else\n\n if @goal.user.is_premium\n format.html { render :action => \"index\" } # index.html.erb\n format.xml { render :xml => @goal.errors, :status => :unprocessable_entity } \n else\n format.html {redirect_to(\"/widget/upgrade\")}\n end\n end\n\n\n\n\n end\n end\n end\n end",
"def show_edits!\n\t\treturn unless self.edited?\n\t\tself.edits.each do |k, v|\n\t\t\tnext if @@not_tracked.include? k\n\t\t\tself.send(\"#{k}=\", v)\n\t\tend\n\tend",
"def update\n respond_to do |format|\n if @work.update_attributes(params[:work])\n flash[:notice] = t('controller.successfully_updated', :model => t('activerecord.models.work'))\n format.html { redirect_to work_url(@work) }\n format.json { head :no_content }\n else\n prepare_options\n format.html { render :action => \"edit\" }\n format.json { render :json => @work.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @marketing_expense.update(marketing_expense_params)\n\n @project.create_activity :edited_marketing_expense, owner: current_user,\n parameters: { text: 'Edited ', object_id: @marketing_expense.id, form_data: params[:marketing_expense].to_s }\n\n ProjectMailer.marketing_expense(@project, @marketing_expense, current_user)\n\n format.html { redirect_to @marketing_expense, notice: 'Marketing expense was successfully updated.' }\n format.json { render :show, status: :ok, location: @marketing_expense }\n else\n format.html { render :edit }\n format.json { render json: @marketing_expense.errors, status: :unprocessable_entity }\n end\n end\n end",
"def end_form hwork\n nom_bouton = \n case itype(hwork)\n when 1\n 'Marquer ce travail fini'\n when 2\n 'Marquer cette page lue'\n else\n 'Marquer ce travail fini'\n end\n nom_bouton.in_a(href: \"unanunscript/bureau/#{task_type}?op=done_work&wid=#{hwork[:id]}\")\n end",
"def update\n @work.extra = process_extra if params[:work][:extra_keys] && params[:work][:extra_keys]!= \"\"\n respond_to do |format|\n if @work.update_attributes(params[:work].except(:extra_keys, :extra_values))\n Work.create_locations(@work) if @work.places#.changed?\n Location.destroy_unused\n format.html { redirect_to @work, notice: 'Work was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @work.errors, status: :unprocessable_entity }\n end\n end\n end",
"def tweak_duration_form\n logger.debug \"**** TWEAKING DURATION\"\n show_params(params)\n \n #Get a work if we can (ie not a new one)\n work_id = params[:id]\n if !work_id.blank?\n @work = Work.find(params[:id])\n end\n @no_duration_flag = params[:no_duration_flag]\n @show_duration = true\n if !@no_duration_flag.blank? and @no_duration_flag.to_s=='on'\n @show_duration = false\n end\n \n @work.no_duration = @show_duration\n \n logger.debug \"NO DURATION:#{@work.no_duration}\"\n\n end",
"def update\n @work_item = set_work\n\n respond_to do |format|\n if @work_item.update(params.require(:work).permit(:title, :subtitle, :body))\n format.html { redirect_to works_path, notice: 'work was successfully updated.' }\n else\n format.html { render :edit }\n end\n end\n end",
"def update \n data=params\n employee = Employee.find(params[:id])\n if update_lawyer_preferences(employee)\n flash[:notice] = \"Lawyer preferences updated successfully\"\n redirect_to :back\n return true\n else\n flash[:error] = \"<ul>\" + employee.errors.full_messages.collect {|e| \"<li>\" + e + \"</li>\"}.join(\" \") + \"</ul>\"\n redirect_to :back\n return false\n end\n @com_notes_entries = Communication.find(data[\"id\"].to_i)\n @note_priority = (data[:com_notes_entries][:note_priority] == 0 ||data[:com_notes_entries][:note_priority].eql?('0'))? 1 : 2 \n notes = data[:com_notes_entries][:description] if data[:com_notes_entries][:description]\n # Below code is common in \"Complete Task\" and \"Assign To\" logic.\n if data[:commit].eql?(\"Complete Task\") || data[:commit].eql?(\"Assign To\")\n notes_type = data[:task][:tasktype] unless data[:task][:tasktype].blank?\n task_details = {}\n task_details.merge!(data[:task])\n task_details.merge!(:name=>notes,:tasktype =>notes_type,:priority=>@note_priority)\n end\n if data[:commit].eql?(\"Save & Exit\")\n respond_to do |format| \n if @com_notes_entries.update_attributes(:description=>notes,:more_action =>data[:com_notes_entries][:more_action], :matter_id =>data[:com_notes_entries][:matter_id], :contact_id=>data[:com_notes_entries][:contact_id],:note_priority=>@note_priority.to_i)\n flash[:notice] = \"#{t(:text_task)} \" \"#{t(:flash_was_successful)} \" \"#{t(:text_saved)}\"\n format.html {redirect_to physical_liviaservices_livia_secretaries_url}\n else\n format.html { render :action => \"show\" }\n end\n end\n elsif data[:commit].eql?(\"Complete Task\") \n task_details.merge!(data[:task])\n task_details.merge!(:assigned_to_user_id =>@current_user.id,:status=>'complete',:completed_at=>Time.now,:completed_by_user_id=>@current_user.id)\n @task= UserTask.new(task_details)\n respond_to do |format|\n # Below mention transaction block basically revert Task entry and even revert the Communication to update.\n # Added by Ajay Arsud Date:09 Sept 2010\n UserTask.transaction do\n if @task.save\n @com_notes_entries = Communication.find(data[\"id\"].to_i)\n @task.update_attributes(:company_id=>@com_notes_entries.company_id)\n @com_notes_entries.update_attributes(:status => 'complete')\n flash[:notice] = \"#{t(:text_task)} \" \"#{t(:flash_was_successful)} \" \"#{t(:text_completed)}\"\n format.html { redirect_to physical_liviaservices_livia_secretaries_url }\n else\n flash[:error] = t(:flash_task_type)\n format.html { redirect_to physical_liviaservices_livia_secretaries_url }\n end\n end\n end\n elsif data[:commit].eql?(\"Assign To\")\n task_details.merge!(:assigned_to_user_id =>data[:task][:assigned_to_user_id])\n @task = UserTask.new(task_details)\n respond_to do |format|\n # Below mention transaction block basically revert Task entry and even revert the Communication to update.\n # Added by Ajay Arsud Date:09 Sept 2010\n Communication.transaction do\n if @task.save\n @com_notes_entries = Communication.find(data[\"id\"].to_i)\n @task.update_attributes(:company_id=>@com_notes_entries.company_id) \n @com_notes_entries.update_attributes(:status => 'complete')\n flash[:notice] = \"#{t(:text_task)} \" \"#{t(:flash_was_successful)} \" \"#{t(:text_assigned)}\"\n format.html { redirect_to physical_liviaservices_livia_secretaries_url }\n else\n flash[:error] = t(:flash_task_type)\n format.html { redirect_to physical_liviaservices_livia_secretaries_url }\n end\n end\n end\n end \n end",
"def update\n @workout_date = WorkoutDate.find(params[:id])\n @workout_date.n ||= WorkoutDate.next_free_n(@workout_date.workout_id)\n\n respond_to do |format|\n @workout_date.attributes = params[:workout_date]\n @workout_date.n ||= WorkoutDate.next_free_n(@workout_date.workout_id)\n\n if @workout_date.save\n format.html { redirect_to(@workout_date, :notice => 'Workout date was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @workout_date.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @pending_work.update(pending_work_params)\n format.html { redirect_to @pending_work, notice: 'Pending work was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @pending_work.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @work.update(work_params)\n process_work_contributors\n format.html { redirect_to @work, notice: 'Work was successfully updated.' }\n format.json { render :show, status: :ok, location: @work }\n else\n format.html { render :edit }\n format.json { render json: @work.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @post = Post.find(params[:id])\n\n temp_post = Post.new(params[:post])\n embargo = temp_post.publish_at.strftime(\"%a %b %d %H:%M:%S\") + \" +0100 \" + temp_post.publish_at.strftime(\"%Y\")\n\n puts \"requested post date: \"+ embargo\n\n success = @post.update_attributes(params[:post])\n\n if success\n testJob = @@scheduler.at embargo, :tags => @post.id.to_s do\n puts \"Setting visible to true...\"\n @post = Post.find(params[:id])\n @post.visible = true\n @post.save\n end\n end\n\n respond_to do |format|\n if success\n format.html { redirect_to @post, notice: 'Post was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update_captain_and_eligibility(*)\n reload # SQL caching causing users to be empty when creating team making all teams ineligible\n set_team_captain\n update_eligibility\n end",
"def update\n authorize @work_type\n respond_to do |format|\n if @work_type.update(work_type_params)\n format.html { redirect_to work_types_url, notice: t('Record has been saved') }\n format.json { render :show, status: :ok, location: @work_type }\n else\n format.html {\n @work_type.work_type_tools.build if @work_type.work_type_tools.blank?\n @work_type.work_type_materials.build if @work_type.work_type_materials.blank?\n @work_type.work_type_others.build if @work_type.work_type_others.blank?\n @work_type.work_type_additionals.build if @work_type.work_type_additionals.blank?\n render :edit\n }\n format.json { render json: @work_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update!(**args)\n @birthday_decoration_visibility = args[:birthday_decoration_visibility] if args.key?(:birthday_decoration_visibility)\n end",
"def update\n @work = Work.find(params[:id])\n work_params = params[:work]\n work_params.delete('progress')\n respond_to do |format|\n if @work.update_attributes(work_params)\n format.html { redirect_to @work, notice: 'Work was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @work.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n log = \"\\nCAMBIOS:\\n\"\n if @slide.slide_tag != slide_params[:slide_tag]\n log += \"\\n-ETIQUETA-\\nANTES:\" + @slide.slide_tag + \"\\n- DESPUÉS: -\\n\" + slide_params[:slide_tag]\n else\n log += \"\\n-ETIQUETA-\\nSIN CAMBIOS.\"\n end\n if @slide.description != slide_params[:description]\n log += \"\\n-DESCRIPCION-\\nANTES:\" + @slide.description + \"\\n- DESPUÉS: -\\n\" + slide_params[:description]\n else\n log += \"\\n-DESCRIPCION-\\nSIN CAMBIOS.\"\n end\n if @slide.stored != slide_params[:stored]\n log += \"\\n-GUARDADO-\\nANTES:\" + (@slide.stored == true ? 'Si' : 'No') + \"\\n- DESPUÉS: -\\n\" + (slide_params[:stored] == true ? 'Si' : 'No')\n else\n log += \"\\n-GUARDADO-\\nSIN CAMBIOS.\"\n end\n log += \"\\nFECHA: \" + Date.today.strftime('%d/%m/%Y') + \"\\nUSUARIO: \" + current_user.email.to_s + \"\\nEtiqueta: \" + slide_params[:slide_tag]\n\n if @slide.update(slide_params)\n @slide.objections.each do |objection|\n objection.closed = true\n objection.close_user_id = current_user.id\n objection.close_date = @slide.updated_at\n objection.description = objection.description + log\n objection.save\n end\n redirect_to inform_path(@inf), notice: 'La muestra ha sido exitosamente actualizada.'\n else\n render :edit\n end\n end",
"def update\n admin_check\n @job_metadata = JobMetadata.find(params[:id])\n edit_menu(@job_metadata)\n @offset = session[:tzOffset]\n time_error = false\n suspended = (params[:job_metadata][:suspend]).eql?(\"1\")\n\n if suspended \n stop_string = params[:job_metadata][:stop]\n resume_string = params[:job_metadata][:resume]\n offset = TimeUtils.offset_to_zone(session[:tzOffset])\n stop_string << ' ' << offset\n resume_string << ' ' << offset\n params[:job_metadata][:stop] = stop_string\n params[:job_metadata][:resume] = resume_string\n resume = Time.parse(resume_string)\n stop = Time.parse(stop_string)\n error_strings = []\n messages = OrderedHash.new()\n\n if (resume < stop)\n error_strings << 'The resume time must be later than the stop time.'\n messages[\"Update failed!\"] = error_strings\n flash[:error] = render_to_string( :partial => \"bulleted_flash\", :locals => {:messages => messages})\n time_error = true\n end\n if (resume < Time.now)\n error_strings << 'The resume time must be later than the current time.'\n flash[:error] = render_to_string( :partial => \"bulleted_flash\", :locals => {:messages => messages})\n time_error = true\n end\n end\n \n respond_to do |format|\n if (@job_metadata.update_attributes(params[:job_metadata]) && !time_error)\n flash[:notice] = 'JobMetadata was successfully updated.'\n format.html { redirect_to(job_metadatas_list_path) }\n format.xml { head :ok }\n else\n if time_error\n @job_metadata.suspend = false\n @job_metadata.save!\n @job_metadata.errors.add(:the, \" suspension times are not valid. The job data was saved without the suspension data.\")\n end\n\n messages = [\"Update Failed!\"]\n messages << errors_to_flash(@job_metadata.errors)\n\n flash.now[:error] = render_to_string(:partial => \"bulleted_flash_single_header\", :locals => {:messages => messages }) unless @job_metadata.errors.blank?\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @job_metadata.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @work = Work.find(params[:id])\n\n respond_to do |format|\n if @work.update_attributes(params[:work])\n format.html { redirect_to action: 'index', flash: {notice: 'Work item was successfully updated.' }}\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @work.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @task = Task.find(params[:id])\n if @task.closed = true\n @task.effective_achievement_date = Date.today\n @task.stopover_id = Stopover.find(:first, :conditions => \"name = 'Closed'\").id\n end\n\n respond_to do |format|\n if @task.update_attributes(params[:task])\n format.html { redirect_to @task, notice: 'Task was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @task.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @team_consultation = TeamConsultation.find(params[:id])\n params[:team_consultation][:draft] = false if params[:commit] == \"Save\" #the js in the view does not work in ff\n\n respond_to do |format|\n if @team_consultation.update_attributes(params[:team_consultation])\n if @team_consultation.draft?\n msg=\"<p>The concern note has been sent to #{@team_consultation.school_team}.</p> <p>A discussion about this student will occur at an upcoming team meeting.</p>\"\n else\n msg = 'TeamConsultation was successfully updated.'\n end\n format.html { redirect_to(@team_consultation.student) }\n format.js { flash.now[:notice] = msg; responds_to_parent{render :action => 'create'} }\n else\n format.html { render :action => \"new\" }\n format.js { responds_to_parent{render :action => 'new'} }\n end\n end\n end",
"def update_contents_and_resort_opinions(form)\n PaperTrail.request(enabled: false) do\n form.opinions.each do |prop_form|\n opinion = Opinion.where(component: form.current_component).find(prop_form.id)\n opinion.set_list_position(prop_form.position) if opinion.position != prop_form.position\n opinion.title = prop_form.title\n opinion.body = prop_form.body if opinion.participatory_text_level == ParticipatoryTextSection::LEVELS[:article]\n\n add_failure(opinion) unless opinion.save\n end\n end\n raise ActiveRecord::Rollback if @failures.any?\n end",
"def update\n begin\n data = params\n data[:lawyer_email] = \"mkd@ddiplaw.com\" if data[:lawyer_email].eql?(\"mdickinson@mdick.liviaservices.com\")\n data.delete(:action)\n data.delete(:controller)\n data[:start_date] = data[:start_date].to_date if data[:start_date]\n data[:end_date] = data[:end_date].to_date if data[:end_date]\n attributes = data\n @task = MatterTask.find_by_zimbra_task_id_and_lawyer_email_and_category(attributes[:zimbra_task_id], attributes[:lawyer_email], \"todo\")\n if @task\n attributes[:zimbra_task_status] = true\n # if the task is completed at zimbra mark it's completion in the portal also -- Mandeep (21/04/10).\n if attributes[:progress].eql?(\"COMP\") && attributes[:progress_percentage].eql?(\"100\")\n attributes.merge!({:completed => true, :completed_at => Time.zone.now.to_date})\n end\n # if the task is changed from completed to other, need to change it in portal -- Ketki (23/09/2010).\n if @task.completed and !attributes[:progress].eql?(\"COMP\")\n attributes.merge!({:completed => false, :completed_at => nil}) \n end\n @task.progress = attributes[:progress]\n @task.progress_percentage = attributes[:progress_percentage]\n data[:name] = CGI.unescape(data[:name])\n matter_name = Matter.find(@task.matter_id).name\n data[:name].slice!(\"<#{matter_name}>\")\n if(data[:description] != \"null\")\n data[:description] =CGI.unescape(data[:description])\n end\n if @task.update_attributes(attributes)\n render :xml=>{:success => \"Task is sucessfully updated\"} \n else\n render :xml=>{:error => @task.errors}\n end\n else\n @task = ZimbraActivity.find_by_zimbra_task_id(data[:zimbra_task_id])\n if @task\n data = ZimbraActivity.zimbra_task_params(data)\n data[:name] = CGI.unescape(data[:name])\n if @task.update_attributes(data)\n render :xml=>{:success => \"Task is sucessfully created\"}\n else\n render :xml=>{:error => @task.errors}\n end\n else\n render :xml => \"Hash not found\"\n end\n end\n rescue Exception=>e\n render :xml=>{:error=>e}\n end\n end",
"def update!(**args)\n @completed_work = args[:completed_work] if args.key?(:completed_work)\n @estimated_work = args[:estimated_work] if args.key?(:estimated_work)\n end",
"def update!(**args)\n @visibility = args[:visibility] if args.key?(:visibility)\n end",
"def update\n respond_to do |format|\n if @work_duration.update(work_duration_params)\n format.html { redirect_to @work_duration.employee, notice: 'Work duration was successfully updated.' }\n format.json { render :show, status: :ok, location: @work_duration }\n else\n format.html { render :edit }\n format.json { render json: @work_duration.errors, status: :unprocessable_entity }\n end\n end\n end",
"def edit\n\t\t@heating_choices = [ [\"Gas\", \"Gas\"], [\"Electric\", \"Electric\"], [\"Geothermal\", \"Geothermal\"], [\"Other\", \"Other\"]]\n\t\t@cooling_choices = [ [\"Central Air\", \"Central Air\"], [\"Geothermal\", \"Geothermal\"], [\"None\", \"None\"], [\"Other\", \"Other\"]]\n\t\t@property_types = [ [\"Single Family\", \"Single Family\"], [\"Condo\", \"Condo\"], [\"Multi Family\", \"Multi Family\"], [\"Vacant Land\", \"Vacant Land\"], [\"Mobile Home\", \"Mobile Home\"] ]\n\t\t@basement_types = [ [\"Finished\", \"Finished\"], [\"Partially Finished\", \"Partially Finished\"], [\"Unfinished\", \"Unfinished\"], [\"Other\", \"Other\"], [\"None\", \"None\"]]\n\n\t\t@bathroom_col = (1..10).step(0.25)\n\t\t@states = [\n\t [ \"Alabama\", \"AL\" ],\n\t [ \"Alaska\", \"AK\" ],\n\t [ \"Arizona\", \"AZ\" ],\n\t [ \"Arkansas\", \"AR\" ],\n\t [ \"California\", \"CA\" ],\n\t [ \"Colorado\", \"CO\" ],\n\t [ \"Connecticut\", \"CT\" ],\n\t [ \"Delaware\", \"DE\" ],\n\t [ \"Florida\", \"FL\" ],\n\t [ \"Georgia\", \"GA\" ],\n\t [ \"Hawaii\", \"HI\" ],\n\t [ \"Idaho\", \"ID\" ],\n\t [ \"Illinois\", \"IL\" ],\n\t [ \"Indiana\", \"IN\" ],\n\t [ \"Iowa\", \"IA\" ],\n\t [ \"Kansas\", \"KS\" ],\n\t [ \"Kentucky\", \"KY\" ],\n\t [ \"Louisiana\", \"LA\" ],\n\t [ \"Maine\", \"ME\" ],\n\t [ \"Maryland\", \"MD\" ],\n\t [ \"Massachusetts\", \"MA\" ],\n\t [ \"Michigan\", \"MI\" ],\n\t [ \"Minnesota\", \"MN\" ],\n\t [ \"Mississippi\", \"MS\" ],\n\t [ \"Missouri\", \"MO\" ],\n\t [ \"Montana\", \"MT\" ],\n\t [ \"Nebraska\", \"NE\" ],\n\t [ \"Nevada\", \"NV\" ],\n\t [ \"New Hampshire\", \"NH\" ],\n\t [ \"New Jersey\", \"NJ\" ],\n\t [ \"New Mexico\", \"NM\" ],\n\t [ \"New York\", \"NY\" ],\n\t [ \"North Carolina\", \"NC\" ],\n\t [ \"North Dakota\", \"ND\" ],\n\t [ \"Ohio\", \"OH\" ],\n\t [ \"Oklahoma\", \"OK\" ],\n\t [ \"Oregon\", \"OR\" ],\n\t [ \"Pennsylvania\", \"PA\" ],\n\t [ \"Rhode Island\", \"RI\" ],\n\t [ \"South Carolina\", \"SC\" ],\n\t [ \"South Dakota\", \"SD\" ],\n\t [ \"Tennessee\", \"TN\" ],\n\t [ \"Texas\", \"TX\" ],\n\t [ \"Utah\", \"UT\" ],\n\t [ \"Vermont\", \"VT\" ],\n\t [ \"Virginia\", \"VA\" ],\n\t [ \"Washington\", \"WA\" ],\n\t [ \"West Virginia\", \"WV\" ],\n\t [ \"Wisconsin\", \"WI\" ],\n\t [ \"Wyoming\", \"WY\" ]\n\t ].freeze\n\t \n\n\t\t@listing = Listing.find(params[:id])\n\t\t9.times { @listing.images.build }\n\tend",
"def update\n \n #add200114\n #viewで分解されたパラメータを、正常更新できるように復元させる。\n adjust_billing_due_date_params\n \n #住所のパラメータ変換\n if params[:addressX].present?\n params[:construction_datum][:address] = params[:addressX]\n end\n \n #現場名を登録 \n #add190124\n create_or_update_site\n \n if params[:directions].present?\n\t \n\t #手入力用IDの場合は、安全事項マスタへも登録する。\n @matter_name = nil\n if @construction_datum.working_safety_matter_id == 1\n \n #既に登録してないかチェック\n\t new_name = params[:construction_datum][:working_safety_matter_name]\n\t \n\t if new_name != \"\" then\n @check_matter = WorkingSafetyMatter.find_by(working_safety_matter_name: new_name)\n if @check_matter.nil?\n\t matter_params = { working_safety_matter_name: new_name }\n @matter_name = WorkingSafetyMatter.create(matter_params)\n end\n end \n end\n \n\t \n\tend\n\t\n \n respond_to do |format|\n\t\n document_flag = false\n \n\t @update = nil\n if params[:documents].nil?\n #通常のアップデート\n @update = @construction_datum.update(construction_datum_params)\n else\n #資料のみ更新した場合\n @update = @construction_datum.update_attributes(construction_datum_attachments_params)\n \n document_flag = true\n end\n \n \n if @update\n \n #add200114\n #set_cash_flow_detail\n #djangoの資金繰り用のデータ更新\n set_cash_flow = SetCashFlow.new\n set_cash_flow.set_cash_flow_detail_expected_for_construction(params, @construction_datum)\n \n\t #if @construction_datum.update(construction_datum_params)\n \n #add180903\n #OneDrive用のディレクトリを作る\n #makeDocumentsFolder\n \n \n #工事費集計表データも空で作成(データ存在しない場合のみ)\n #add170330\n construction_cost = ConstructionCost.where(:construction_datum_id => @construction_datum.id).first\n if construction_cost.blank?\n construction_cost_params = {construction_datum_id: @construction_datum.id, purchase_amount: 0, \n execution_amount: 0, purchase_order_amount: \"\"}\n\t\t\n @construction_cost = ConstructionCost.create(construction_cost_params)\n end\n #\n\t\tif document_flag = false\n format.html { redirect_to @construction_datum, notice: 'Construction datum was successfully updated.' }\n\t\telse\n #資料更新の場合、indexへそのまま戻る\n format.html { redirect_to action: \"index\", notice: 'Documents was successfully created.' }\n end\n \n\t\tif params[:directions].present?\n\t\t #指示書の発行\n\t\t \n\t\t #global set\n $construction_datum = @construction_datum \n\t\t \n\t\t #作業日をグローバルへセット\n\t\t #$working_date = params[:construction_datum][\"working_date(1i)\"] + \"/\" + \n # params[:construction_datum][\"working_date(2i)\"] + \"/\" + params[:construction_datum][\"working_date(3i)\"]\n working_date = params[:construction_datum][\"working_date(1i)\"] + \"/\" + \n params[:construction_datum][\"working_date(2i)\"] + \"/\" + params[:construction_datum][\"working_date(3i)\"]\n\t\t #upd191009\n #曜日を追加\n week = %w{日 月 火 水 木 金 土}[Date.parse(working_date).wday]\n $working_date = working_date + \"(\" + week + \")\"\n \n\t\t #発行日をグローバルへセット\n #191009~現在未使用\n $issue_date = params[:construction_datum][:issue_date]\n \n #復活した場合に残しておく\n #曜日を追加\n #issue_date = params[:construction_datum][:issue_date]\n\t\t #week = %w{日 月 火 水 木 金 土}[Date.parse(issue_date).wday]\n #$issue_date = issue_date + \"(\" + week + \")\"\n #復活~end\n \n\t\t #作業者をグローバルへセット\n\t\t staff_id = params[:construction_datum][:staff_id]\n\t\t @staff = Staff.find_by(id: staff_id)\n\t\t $staff_name = \"\"\n\t\t if @staff.present?\n\t\t $staff_name = @staff.staff_name\n\t\t end\n\t\t \n\t\t format.pdf do\n report = WorkingDirectionsPDF.create @working_dirctions\n\t\t # ブラウザでPDFを表示する\n # disposition: \"inline\" によりダウンロードではなく表示させている\n send_data(\n report.generate,\n filename: \"working_directions.pdf\",\n type: \"application/pdf\",\n disposition: \"inline\")\n end\n\t\t end\n\t\t\n if document_flag == false\n format.json { render :show, status: :ok, location: @construction_datum }\n end\n else\n format.html { render :edit }\n format.json { render json: @construction_datum.errors, status: :unprocessable_entity }\n end\n\t \n\t\n end\n \n \n end",
"def update\n respond_to do |format|\n if @diploma_work.update(diploma_work_params)\n format.html { redirect_to @diploma_work, notice: 'Diploma work was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @diploma_work.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update_visibility(attributes)\n interpret_visibility(attributes) # relies on CurationConcerns::ManagesEmbargoesActor to interpret and apply visibility\n end",
"def update\n @contestproblem.statement = params[:contestproblem][:statement]\n @contestproblem.origin = params[:contestproblem][:origin]\n if @contestproblem.at_most(:not_started_yet)\n @contestproblem.start_time = params[:contestproblem][:start_time]\n end\n if @contestproblem.at_most(:in_progress)\n @contestproblem.end_time = params[:contestproblem][:end_time]\n end\n if @date_problem\n render 'edit' and return\n end\n if @contestproblem.save\n flash[:success] = \"Problème modifié.\"\n update_contest_details\n update_problem_numbers\n redirect_to @contestproblem\n else\n render 'edit'\n end\n end",
"def update\n @visibility = Visibility.find(params[:id])\n\n respond_to do |format|\n if @visibility.update_attributes(params[:visibility])\n format.html { redirect_to @visibility, notice: 'Visibility was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @visibility.errors, status: :unprocessable_entity }\n end\n end\n end",
"def change_visibility\n # @timeline = Timeline.find(params[:id]) (done in load_and_authorize_resource)\n if (@timeline.visibility == VIS_PRIVATE)\n @timeline.visibility = VIS_PUBLIC\n else\n @timeline.visibility = VIS_PRIVATE\n end\n if @timeline.save()\n record_activity(\"t=#{@timeline.title}\")\n render :template => \"timelines/change_visibility\", :formats => [:js], :handlers => :haml\n else\n end\n end",
"def update\n respond_to do |format|\n if @work.update(work_params)\n format.html { redirect_to @work, notice: 'Work was successfully updated.' }\n format.json { render :show, status: :ok, location: @work }\n else\n format.html { render :edit }\n format.json { render json: @work.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @work.update(work_params)\n format.html { redirect_to @work, notice: 'Work was successfully updated.' }\n format.json { render :show, status: :ok, location: @work }\n else\n format.html { render :edit }\n format.json { render json: @work.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @work.update(work_params)\n format.html { redirect_to @work, notice: 'Work was successfully updated.' }\n format.json { render :show, status: :ok, location: @work }\n else\n format.html { render :edit }\n format.json { render json: @work.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @work.update(work_params)\n format.html { redirect_to @work, notice: 'Work was successfully updated.' }\n format.json { render :show, status: :ok, location: @work }\n else\n format.html { render :edit }\n format.json { render json: @work.errors, status: :unprocessable_entity }\n end\n end\n end",
"def working\n current_user.chef.toggle(:currently_working).save\n end",
"def set_visible_with_cascade!(state)\n set_visible(state)\n force_visibility_cascade\n self.save\n self\n end",
"def update\n authorize! :update, @dataset\n old_publication_state = @dataset.publication_state\n old_creator_state = @dataset.org_creators || false\n @dataset.release_date ||= Date.current\n\n respond_to do |format|\n if @dataset.update(dataset_params)\n if dataset_params[:org_creators] == \"true\" && old_creator_state == false\n # convert individual creators to additional contacts (contributors)\n @dataset.ind_creators_to_contributors\n params[\"context\"] = \"continue_edit\"\n elsif dataset_params[:org_creators] == \"false\" && old_creator_state == true\n # delete all institutional creators\n @dataset.institutional_creators.delete_all\n # convert all additional contacts (contributors) to individual authors\n @dataset.contributors_to_ind_creators\n params[\"context\"] = \"continue_edit\"\n end\n if params.has_key?(\"context\") && params[\"context\"] == \"exit\"\n if @dataset.publication_state == Databank::PublicationState::DRAFT\n format.html {\n redirect_to \"/datasets?q=&#{CGI.escape('editor')}=#{current_user.username}&context=exit_draft\"\n }\n else\n format.html {\n redirect_to \"/datasets?q=&#{CGI.escape('editor')}=#{current_user.username}&context=exit_doi\"\n }\n end\n elsif params.has_key?(\"context\") && params[\"context\"] == \"publish\"\n if Databank::PublicationState::DRAFT == @dataset.publication_state\n raise \"invalid publication state for update-and-publish\"\n # only update complete datasets\n elsif Dataset.completion_check(@dataset) == \"ok\"\n # set publication_state\n @dataset.publication_state = if @dataset.embargo && [Databank::PublicationState::Embargo::FILE,\n Databank::PublicationState::Embargo::METADATA].include?(@dataset.embargo)\n @dataset.embargo\n else\n Databank::PublicationState::RELEASED\n end\n if old_publication_state != Databank::PublicationState::RELEASED && @dataset.publication_state == Databank::PublicationState::RELEASED\n @dataset.release_date ||= Date.current\n end\n @dataset.save\n # send_dataset_to_medusa only sends metadata files unless old_publication_state is draft\n MedusaIngest.send_dataset_to_medusa(@dataset)\n if @dataset.is_test? || @dataset.update_doi\n format.html { redirect_to dataset_path(@dataset.key) }\n format.json { render :show, status: :ok, location: dataset_path(@dataset.key) }\n else\n format.html {\n redirect_to dataset_path(@dataset.key),\n notice: \"Error updating DataCite Metadata, details have been logged.\"\n }\n format.json { render json: @dataset.errors, status: :unprocessable_entity }\n end\n else # this else means completion_check was not ok within publish context\n Rails.logger.warn Dataset.completion_check(@dataset)\n raise \"Error: Cannot update published dataset with incomplete information.\"\n end\n elsif params.has_key?(\"context\") && params[\"context\"] == \"continue_edit\"\n format.html { redirect_to edit_dataset_path(@dataset) }\n format.json { render :edit, status: :ok, location: edit_dataset_path(@dataset) }\n else # this else means context was not set to exit or publish - this is the normal draft update\n format.html { redirect_to dataset_path(@dataset.key) }\n format.json { render :show, status: :ok, location: dataset_path(@dataset.key) }\n end\n else # this else means update failed\n format.html { render :edit }\n format.json { render json: @dataset.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n if @work.update(work_params)\n if @current_student.admin\n redirect_to works_all_url\n else\n redirect_to works_url, notice: 'Work was successfully updated.'\n end\n else\n format.html { render :edit }\n end\n end",
"def toggle\n @interest= Interest.model_toggle(params[:id])\n @interests = Interest.get_all_interests\n @deleted = Interest.is_deleted(params[:id])\n if !@deleted \n $savedinterest = true\n# if the interest was deleted and the admin restored it successfully a flash appears endicating that\n flash[:success] = \" Interest restored successfully $green\"\n else\n# if the interest wasn't deleted and the admin blocked it successfully a flash appears endicating that\n flash[:error] = \" You have just blocked this interest $red\"\n\n\n end\n# finally , we redirect to the main interest's page after adjusting the changes\n redirect_to @interest\n end",
"def destroy\n @social_work = SocialWork.find(params[:id])\n @social_work.state ? @social_work.update_attributes(:state => false) : @social_work.update_attributes(:state => true) \n\n respond_to do |format|\n format.html { redirect_to(social_works_url) }\n format.xml { head :ok }\n end\n end",
"def save!\n ScriptoriaCore::Ruote.engine.storage_participant.do_update(_workitem)\n end",
"def edit\n\n wid = get_wid or return\n\n load_workitem wid\n end",
"def update\n @experiment = Experiment.obfuscated(params[:id])\n page_group(@experiment.user.group)\n \n if @experiment.nil? or !@experiment.can_modify?(current_user)\n access_denied\n return\n end\n location = Location.obfuscated(params[:location_id])\n @experiment.location = location\n calendar = GoogleCalendar.obfuscated(params[:calendar_id])\n @experiment.google_calendar = calendar\n respond_to do |format|\n if @experiment.update_attributes(params[:experiment])\n flash[:notice] = 'Experiment was successfully updated.'\n format.html { redirect_to(@experiment) }\n format.xml { head :ok }\n else\n @calendars = self.calendars_select_array()\n @locations = self.locations_select_array()\n self.use_markdown_editor = true\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @experiment.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @tutorial_quest = Tutorial::Quest.find(params[:id])\n \n attributes_sent = params[:tutorial_quest]\n attributes_to_update = {}\n \n raise ForbiddenError.new (\"Access to quest state forbidden.\") unless admin? || staff? || @tutorial_quest.tutorial_state.owner == current_character\n \n if admin? || staff?\n attributes_to_update = attributes_sent\n else\n attributes_to_update[:status] = attributes_sent[:status] if attributes_sent.has_key?(:status)\n end\n \n if attributes_to_update.has_key?(:status) && attributes_to_update[:status] == Tutorial::Quest::STATE_DISPLAYED.to_s\n attributes_to_update[:displayed_at] = Time.now\n\n # Send Mail if required\n #quest_message = @tutorial_quest.quest[:message]\n #\n #if !quest_message.nil? && @tutorial_quest.status < Tutorial::Quest::STATE_DISPLAYED\n # Messaging::Message.create_tutorial_message(current_character, quest_message[I18n.locale][:subject], quest_message[I18n.locale][:body])\n #end\n end\n \n if attributes_sent.has_key?(:reward_displayed)\n attributes_to_update[:reward_displayed_at] = Time.now\n end\n\n respond_to do |format|\n if @tutorial_quest.update_attributes(attributes_to_update)\n format.html { redirect_to @tutorial_quest, notice: 'Quest was successfully updated.' }\n format.json { render json: {}, status: :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @tutorial_quest.errors, status: :unprocessable_entity }\n end\n end\n end",
"def edit\n @hidden = 2\n end",
"def commit_current_edit!\n ensure_active_edit!\n\n call_google_api { android_publisher.commit_edit(current_package_name, current_edit.id) }\n\n self.current_edit = nil\n self.current_package_name = nil\n end",
"def entomb!(epitaph)\n self.visibility = Hydra::AccessControls::AccessRight::VISIBILITY_TEXT_VALUE_PRIVATE\n self.depositor = 'TOMBSTONE-' + depositor\n self.tombstone = [epitaph]\n\n file_sets.each do |file_set|\n file_set.visibility = Hydra::AccessControls::AccessRight::VISIBILITY_TEXT_VALUE_PRIVATE\n end\n\n save\n end",
"def save\n if modified? and @entries and !@entries.empty?\n save!\n end\n end",
"def update\n authorize! :update, @dataset\n old_publication_state = @dataset.publication_state\n old_creator_state = @dataset.org_creators || false\n @dataset.release_date ||= Date.current\n\n respond_to do |format|\n if @dataset.update(dataset_params)\n if dataset_params[:org_creators] == 'true' && old_creator_state == false\n # convert individual creators to additional contacts (contributors)\n @dataset.ind_creators_to_contributors\n params['context'] = 'continue_edit'\n elsif dataset_params[:org_creators] == 'false' && old_creator_state == true\n # delete all institutional creators\n @dataset.institutional_creators.delete_all\n # convert all additional contacts (contributors) to individual authors\n @dataset.contributors_to_ind_creators\n params['context'] = 'continue_edit'\n end\n if params.has_key?('context') && params['context'] == 'exit'\n if @dataset.publication_state == Databank::PublicationState::DRAFT\n format.html {redirect_to \"/datasets?q=&#{URI.encode('depositors[]')}=#{current_user.name}&context=exit_draft\"}\n else\n format.html {redirect_to \"/datasets?q=&#{URI.encode('depositors[]')}=#{current_user.name}&context=exit_doi\"}\n end\n elsif params.has_key?('context') && params['context'] == 'publish'\n if Databank::PublicationState::DRAFT == @dataset.publication_state\n raise \"invalid publication state for update-and-publish\"\n # only update complete datasets\n elsif Dataset.completion_check(@dataset, current_user) == 'ok'\n # set publication_state\n if @dataset.embargo && [Databank::PublicationState::Embargo::FILE, Databank::PublicationState::Embargo::METADATA].include?(@dataset.embargo)\n @dataset.publication_state = @dataset.embargo\n else\n @dataset.publication_state = Databank::PublicationState::RELEASED\n end\n if old_publication_state != Databank::PublicationState::RELEASED && @dataset.publication_state == Databank::PublicationState::RELEASED\n @dataset.release_date ||= Date.current\n end\n @dataset.save\n # send_dataset_to_medusa only sends metadata files unless old_publication_state is draft\n MedusaIngest.send_dataset_to_medusa(@dataset)\n if @dataset.is_test? || @dataset.update_doi\n format.html {redirect_to dataset_path(@dataset.key)}\n format.json {render :show, status: :ok, location: dataset_path(@dataset.key)}\n else\n format.html {redirect_to dataset_path(@dataset.key), notice: 'Error updating DataCite Metadata, details have been logged.'}\n format.json {render json: @dataset.errors, status: :unprocessable_entity}\n end\n else #this else means completion_check was not ok within publish context\n Rails.logger.warn Dataset.completion_check(@dataset, current_user)\n raise \"Error: Cannot update published dataset with incomplete information.\"\n end\n elsif params.has_key?('context') && params['context'] == 'continue_edit'\n format.html {redirect_to edit_dataset_path(@dataset)}\n format.json {render :edit, status: :ok, location: edit_dataset_path(@dataset)}\n else #this else means context was not set to exit or publish - this is the normal draft update\n format.html {redirect_to dataset_path(@dataset.key)}\n format.json {render :show, status: :ok, location: dataset_path(@dataset.key)}\n end\n else #this else means update failed\n format.html {render :edit}\n format.json {render json: @dataset.errors, status: :unprocessable_entity}\n end\n end\n end",
"def update\n @experience = Experience.find(params[:id])\n\n if params[:experience][:working] == '1'\n params[:experience]['end(1i)'] = ''\n params[:experience]['end(2i)'] = ''\n params[:experience]['end(3i)'] = ''\n end\n\n if @experience.update_attributes(params[:experience])\n flash[:notice] = \"Experiência Profissional atualizada com sucesso.\"\n redirect_to :controller => \"profile\", :action => \"index\"\n else\n render :action => 'new'\n end\n end",
"def update\n @work.update_attributes!(work_params)\n render_success_format('Entrada actualizada', @work, true)\n rescue Exception => e\n render_default_error e, 401\n\n end",
"def update_draft\n if params[:commit] == \"Enregistrer le brouillon\"\n @context = 2\n update_submission\n elsif params[:commit] == \"Supprimer ce brouillon\"\n @submission.destroy\n flash[:success] = \"Brouillon supprimé.\"\n redirect_to @problem\n else\n @context = 3\n update_submission\n end\n end",
"def destroy\n if @work.avalon_items.size > 0\n respond_to do |format|\n format.html { redirect_to works_url, notice: \"The Work <i>#{@work.title}</i> cannot be destroyed because it is currently associated with Avalon Items\".html_safe }\n end\n else\n @work.destroy\n respond_to do |format|\n format.html { redirect_to works_url, notice: 'Work was successfully destroyed.' }\n end\n end\n end",
"def update_contest_details\n @contest.num_problems = @contest.contestproblems.count\n if @contest.num_problems > 0\n @contest.start_time = @contest.contestproblems.order(:start_time).first.start_time\n @contest.end_time = @contest.contestproblems.order(:end_time).last.end_time\n else\n @contest.start_time = nil\n @contest.end_time = nil\n end\n @contest.save\n end",
"def update\n #if session[:edit_code].present? && session[:edit_code] == @summit.edit_code\n #@summit.currency = \"$\"\n #@summit.location_country = \"USA\"\n\n @summit.deadline = create_deadline_json\n \n #@summit.published = false\n \n #@summit.attributes = summit_params\n \n #if @summit.valid?\n # @summit.published = true\n #end\n \n \n if @summit.update_attributes(summit_params)\n # log out && redirect\n #if @summit.published\n # reset_session\n #render(\"edit/edit\")\n redirect_to @summit\n# format.html { redirect_to @summit, notice: 'Summit was successfully updated.' }\n else\n #@summit.validation_check\n #@summit.errors.add(:name, \"roflmao\")\n #@summit.valid?\n render \"edit/edit\"\n end\n #else\n # render \"edit/edit\"\n #end\n #else\n # redirect_to @summit\n #end\n end",
"def hide_activity\n @activity = Activity.find(params[:id])\n\n #This updates the field \"hidden\" as it is the only field we need to update\n @activity.update_attribute(:hidden, true)\n\n if @activity.save\n flash[:success] = 'Activity hidden successfully!'\n end\n\n end",
"def update\n respond_to do |format|\n if @freeze_imm.update(freeze_imm_params)\n format.html { redirect_to @freeze_imm, notice: 'Freeze imm was successfully updated.' }\n format.json { render :show, status: :ok, location: @freeze_imm }\n else\n format.html { render :edit }\n format.json { render json: @freeze_imm.errors, status: :unprocessable_entity }\n end\n end\n end",
"def apply_pre_graduation_embargo\n return unless curation_concern.embargo_length # don't set a pre-graduation embargo unless there is an embargo length\n six_years_from_today = Time.zone.today + 6.years\n curation_concern.apply_embargo(\n six_years_from_today,\n Hydra::AccessControls::AccessRight::VISIBILITY_TEXT_VALUE_PUBLIC,\n Hydra::AccessControls::AccessRight::VISIBILITY_TEXT_VALUE_PUBLIC\n )\n return unless curation_concern.embargo\n curation_concern.embargo.save # see https://github.com/projecthydra/hydra-head/issues/226\n end",
"def update_fade_out\n if visible and !@stay_visible\n @fade_out = true\n self.face_opacity = (self.opacity -= 48)\n @name_window.opacity -= 48\n @city_sprite.opacity -= 48 if @city_sprite\n if opacity == 0\n @text_stack.dispose\n @face_stack.dispose\n self.visible = false\n @name_window.visible = false\n self.opacity = 255\n @fade_out = false\n $game_temp.message_window_showing = false\n end\n elsif @stay_visible and $game_temp.message_window_showing\n $game_temp.message_window_showing = false\n end\n return false\n end",
"def update\n @work = Work.find(params[:id])\n\n\n respond_to do |format|\n if @work.update_attributes(params[:work])\n flash[:notice] = 'Work was successfully updated.'\n if !params[:add_operation_from_user].blank? \n format.html { redirect_to :controller => \"account\", :action => \"menu_home\" }\n format.xml { head :ok }\n else\n format.html { redirect_to :controller => \"plans\", :action => \"week\" }\n format.xml { head :ok }\n end\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @work.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def move_worktime_to_another_day(date, duration=0)\n person = self.presence.person\n presence = person.presences.find_by_presence_date(date)\n unless presence\n presence = person.presences.new\n presence.presence_date = date\n presence.company_id = person.company_id\n end\n presence.presence_length_in_hours += (self.end_working - self.start_working)/3600.to_f\n presence.paid_hours = presence.presence_length_in_hours\n self.save!\n end",
"def set_visible_with_cascade!(state)\n apply_set_visible(state, nil)\n save\n cascade_visibility(state, id)\n end",
"def update\n @work = Work.find(params[:id])\n\n respond_to do |format|\n if @work.update_attributes(params[:work])\n flash[:notice] = 'Work was successfully updated.'\n format.html { redirect_to(@work) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @work.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @secondary_publication = SecondaryPublication.find(params[:id])\n @secondary_publication.study_id = params[:study_id]\n @study_id = @secondary_publication.study_id\n\t@study = Study.find(@study_id)\n\t@project = Project.find(@study.project_id)\t\n if @saved = @secondary_publication.update_attributes(params[:secondary_publication])\n\t\t\n\t# update any changes to previously specified publication numbers\n\t@spi_ids = []\n\tif !params[:secondary_publication_numbers_attributes].nil?\n\t\tparams[:secondary_publication_numbers_attributes].each do |item|\n\t\t\t@existing_id = item[1][:id]\n\t\t\t@spi_ids << @existing_id\n\t\t\t@spi = SecondaryPublicationNumber.find(@existing_id)\n\t\t\t@spi.number = item[1][:number]\n\t\t\t@spi.number_type = item[1][:number_type]\n\t\t\t@spi.secondary_publication_id = @secondary_publication.id\n\t\t\t@spi.save\n\t\tend\n\tend\n\t\n\t@spis_to_delete = SecondaryPublicationNumber.where([\"secondary_publication_id=(?) AND id NOT IN (?)\", @secondary_publication.id, @spi_ids]).all\n\t@spis_to_delete.each do |tp|\n\t\ttp.destroy\n\tend\n\n\t@secondary_publications = SecondaryPublication.find(:all, :order => 'display_number ASC', :conditions => {:study_id => @secondary_publication.study_id, :extraction_form_id => @secondary_publication.extraction_form_id})\t\n\t@extraction_form_id = @secondary_publication.extraction_form_id\n\t@secondary_publication = SecondaryPublication.new\n\t@message_div = \"saved_indicator_2\"\n\t@modal = true\n\telse\n\t\tproblem_html = create_error_message_html(@secondary_publication.errors)\n\t\tflash[:modal_error] = problem_html\n\tend\n\t@error_div = \"validation_message\"\n end",
"def release\n return false if under_embargo?\n return true if embargo.visibility_after_embargo.nil?\n\n resource.visibility = embargo.visibility_after_embargo\n end",
"def publish_edits!\n\t\tself.edits ||= {}\n\t\tself.edits[\"publish\"] = true\n\t\tself.save!\n\tend",
"def update\n respond_to do |format|\n if @work.update(work_params)\n format.html { redirect_to user_work_path(@user.id, @work.id), notice: 'Work was successfully updated.' }\n format.json { render :show, status: :ok, location: @work }\n else\n format.html { render :edit }\n format.json { render json: @work.errors, status: :unprocessable_entity }\n end \n end\n end"
] |
[
"0.5976257",
"0.59403116",
"0.5825746",
"0.56778425",
"0.5637207",
"0.56207114",
"0.5617127",
"0.5612085",
"0.54693437",
"0.5466499",
"0.54524815",
"0.5413655",
"0.5394189",
"0.5387808",
"0.537591",
"0.5370347",
"0.5364161",
"0.5341061",
"0.53320587",
"0.53238064",
"0.5314773",
"0.5298166",
"0.52859735",
"0.5278122",
"0.5273451",
"0.5272399",
"0.5268827",
"0.52682704",
"0.52507496",
"0.52446204",
"0.52392215",
"0.5224461",
"0.5218987",
"0.52173305",
"0.5206946",
"0.52058303",
"0.519912",
"0.51943815",
"0.51925075",
"0.5188511",
"0.51856124",
"0.51826614",
"0.5177448",
"0.5170655",
"0.5169572",
"0.51674026",
"0.51533854",
"0.51528543",
"0.514448",
"0.51420015",
"0.5135259",
"0.5131089",
"0.5129303",
"0.5128254",
"0.5119365",
"0.5112744",
"0.51090324",
"0.51054394",
"0.50922024",
"0.508494",
"0.50807625",
"0.5072891",
"0.50689226",
"0.5066622",
"0.5066622",
"0.5066622",
"0.5066622",
"0.50665003",
"0.5063652",
"0.5061491",
"0.5056858",
"0.5054713",
"0.504729",
"0.504545",
"0.50389415",
"0.50384974",
"0.5037227",
"0.5034117",
"0.5033556",
"0.5032359",
"0.5028391",
"0.5028046",
"0.5027966",
"0.5025951",
"0.5025522",
"0.5023683",
"0.5023597",
"0.502095",
"0.5020592",
"0.50133485",
"0.5005735",
"0.50035733",
"0.5002926",
"0.50017494",
"0.4995642",
"0.49933198",
"0.49870938",
"0.49835607",
"0.49834532",
"0.4981939"
] |
0.6435617
|
0
|
lesende Methoden def x()
|
def oben()
return @fahrbahn.obere_linke_ecke().y()
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def x\n end",
"def x\n end",
"def x\n end",
"def x; end",
"def x; end",
"def x; end",
"def x; end",
"def x; end",
"def x() @x end",
"def x \n @x \n end",
"def x #getter method\n\t\t@x\n\tend",
"def x\n @x\n end",
"def get_x; \t\t@x \t\t\tend",
"def x; 1; end",
"def getX() \n @x \n end",
"def x() self[0]; end",
"def x\n 0\n end",
"def zuruecksetzen()\n end",
"def x()\n @view__.x\n end",
"def y; end",
"def y; end",
"def y; end",
"def x; self[X]; end",
"def x; self[X]; end",
"def x; self[X]; end",
"def y\n end",
"def mev; xparam(4); end",
"def z\n end",
"def x(n)\n end",
"def y\n end",
"def y\n end",
"def x(y)\n raise NotImplementedError, \"Define #{__method__}() in the inherited class.\"\n end",
"def x1; p1.x; end",
"def foo (x)\nend",
"def z\n end",
"def getX\n @x\n end",
"def trg; xparam(9); end",
"def x!() @x.value end",
"def r; end",
"def r; end",
"def y() self[1]; end",
"def suivre; end",
"def f\n end",
"def setX(x) \n @x = x\n end",
"def m(x) x end",
"def x; return self[0]; end",
"def mrg; xparam(8); end",
"def g; end",
"def g; end",
"def method; end",
"def method; end",
"def method; end",
"def method; end",
"def method; end",
"def method; end",
"def method; end",
"def method; end",
"def method; end",
"def method; end",
"def method; end",
"def method; end",
"def mrf; xparam(5); end",
"def x\n self[0]\n end",
"def call; end",
"def call; end",
"def call; end",
"def call; end",
"def call; end",
"def call; end",
"def call; end",
"def call; end",
"def x=(x)\n end",
"def x______________STRUCTURE\r\nend",
"def x______________STRUCTURE\r\nend",
"def call() end",
"def x=(_arg0); end",
"def x=(_arg0); end",
"def x=(_arg0); end",
"def s1\n end",
"def methods() end",
"def setX(x)\n @x = x\n end",
"def square(x)\nend",
"def x=(_); end",
"def x=(_); end",
"def plusOne(x)\n\tputs x+1\nend",
"def call(*) end",
"def call(*) end",
"def mostrarX()\n case @x\n when 1\n puts \"Número um\"\n when 2\n puts \"Número dois\"\n when \"LOL\", \"FATEC\"\n puts \"PALAVRA LOL OU FATEC\"\n when String\n puts \"QUALQUER STRING\"\n when Numeric \n puts \"QUALQUER PONTO FLUTUANTE\"\n when Integer\n puts \"SÓ INTEIRO\"\n when Symbol \n puts \"NÃO SOU STRING, MAS QUASE SOU\"\n else\n puts \"Caiu no caso do default\"\n end\n end",
"def attack_bonus; xparam(0); end",
"def f1(x, x); end",
"def add_two(x)\n\tx + 5\nend",
"def sqr(x)\n puts x*x\nend",
"def x\n # ...\nrescue\n # ...\nend",
"def cuadrado(x)\n x * x\nend",
"def x\n @p[0]\n end",
"def x\n @p[0]\n end",
"def m\nend",
"def m\nend",
"def s(x); 1; end",
"def fun(x)\n puts x\nend",
"def square(x)\n\tx*x\nend"
] |
[
"0.8510884",
"0.83706814",
"0.83706814",
"0.786324",
"0.786324",
"0.786324",
"0.786324",
"0.786324",
"0.77257115",
"0.73334944",
"0.72962934",
"0.7136934",
"0.704187",
"0.68973565",
"0.68889916",
"0.66692376",
"0.6666214",
"0.6652548",
"0.66471565",
"0.6534988",
"0.6534988",
"0.6534988",
"0.65195656",
"0.65195656",
"0.65195656",
"0.65044934",
"0.646693",
"0.6396212",
"0.6395767",
"0.63878804",
"0.63878804",
"0.6384982",
"0.6364182",
"0.6338112",
"0.6328901",
"0.63143694",
"0.6304343",
"0.61921483",
"0.61534727",
"0.61534727",
"0.61173546",
"0.6112472",
"0.610223",
"0.60759217",
"0.60648733",
"0.60599875",
"0.6054014",
"0.60362875",
"0.60362875",
"0.6004617",
"0.6004617",
"0.6004617",
"0.6004617",
"0.6004617",
"0.6004617",
"0.6004617",
"0.6004617",
"0.6004617",
"0.6004617",
"0.6004617",
"0.6004617",
"0.597963",
"0.5977924",
"0.5956303",
"0.5956303",
"0.5956303",
"0.5956303",
"0.5956303",
"0.5956303",
"0.5956303",
"0.5956303",
"0.59508604",
"0.5932769",
"0.5932769",
"0.5904674",
"0.59033036",
"0.59033036",
"0.59033036",
"0.5899518",
"0.5891304",
"0.5876175",
"0.58690315",
"0.58382034",
"0.58382034",
"0.5837494",
"0.58311063",
"0.58311063",
"0.5794877",
"0.5779751",
"0.57740533",
"0.5764556",
"0.5761543",
"0.57487875",
"0.5747795",
"0.57408524",
"0.57408524",
"0.5739025",
"0.5739025",
"0.5737146",
"0.5732954",
"0.57311285"
] |
0.0
|
-1
|
TODO: Optimize to not calculate on every read. Cache total expenses and update on add
|
def total_expenses
expenses.sum(:amount) || 0.0
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def total_expenses\n self.expenses.sum(\"amount\")\n end",
"def expenses\n @expenses ||= Harvest::API::Expenses.new(credentials)\n end",
"def expense_total\n self.expenses.sum(:amount).to_f\n end",
"def calc_sum_of_exp(expenses)\n prices = []\n expenses.each do |num|\n prices << num['price'].to_f\n end\n return prices.inject(0, :+)\nend",
"def get_expense_details\n @total_expenses = 0.0\n @billed_expenses = 0.0\n @expense_entries = {}\n @expense_entries = @saved_expense_entries\n for time_entry in @saved_time_entries\n @expense_entries += time_entry.tne_invoice_expense_entries\n end\n unless @expense_entries.empty?\n @total_expenses = @expense_entries.map(&:expense_amount).inject(0) do |total,amount|\n total + amount\n end\n @billed_expenses = @expense_entries.map(&:final_expense_amount).inject(0) do |total,amount|\n total + amount\n end\n @billed_expenses = @billed_expenses.to_f.roundf2(2)\n end\n end",
"def sum_expense(expenses)\n sum = expenses.sum\n return sum\nend",
"def get_total_expense\n\t\tbills.pluck(:amount).inject(:+) rescue 0\n\tend",
"def total_value\r\n return 0 if self.value.nil?\r\n self.value + self.expenses.includes(:expense).map{ |e|\r\n (e.quantity || 0) * (e.expense.signed_price || 0)\r\n }.sum\r\n end",
"def build_all_expenses\n expenses = Expense.includes(:financial_type).current.all\n loans = Loan.includes(:financial_type).current.all\n result = []\n\n expenses.each do |e|\n holder = {}\n holder[:expense_id] = e.id\n holder[:name] = e.name\n holder[:monthly_payment] = e.monthly_payment\n holder[:financial_type] = e.financial_type.name\n holder[:notes] = e.notes\n result << holder\n end\n\n loans.each do |l|\n holder = {}\n holder[:loan_id] = l.id\n holder[:name] = l.org_name\n holder[:monthly_payment] = l.monthly_payment\n holder[:financial_type] = l.financial_type.name\n holder[:notes] = l.notes\n result << holder\n end\n\n gon.totalExpenses = result\n end",
"def actual_travel\n actual_travel = travel_expenses.reduce(0) {|sum, expense| sum += expense.amount }\n end",
"def offenses; end",
"def offenses; end",
"def offenses; end",
"def total_expenses\n binding.pry\n self.total_rent + self.total_pay\n end",
"def all_expense_items\n owing_expense_items + paid_expense_items\n end",
"def amount_spent_on(project)\n self.expenses.where(:project_id => project.id).sum(:amount)\n end",
"def total_exp\n base_exp + time_bonus_exp + extra_bonus_exp\n end",
"def apply_to(expenses)\n matches = expenses.select { |e| e.description.match(/#{keyphrase}/)}\n\n Expense.update_all({\n :category_id => category_id,\n :creditor_id => creditor_id\n }, {\n :id => matches.map(&:id)\n }) unless matches.empty?\n\n return matches\n end",
"def index\n @expenses = Expense.all\n @expenses_sum = Expense.sum(:amount)\n @insurances_sum = Insurance.includes(:expense).pluck(:amount).sum\n @breaks_sum = Break.includes(:expense).pluck(:amount).sum\n @damages_sum = Damage.includes(:expense).pluck(:amount).sum\n @owner_takes_sum = OwnerTake.includes(:expense).pluck(:amount).sum\n end",
"def expenses_for(m)\n d = Date.parse(m)\n exp = self.expenses.within_range(d, ((d + 1.month) - 1.day)).sum(:amount)\n exp.nil? ? 0 : exp\n end",
"def actual_income\n outgoing_invoices.where(:status => \"deposited\").inject(0) do |mem, invoice|\n mem += invoice.amount\n end # inject invoice\n end",
"def expense_by_party_and_line_item_subtype party, line_item_sub_type, invoiced=nil, document_id=nil\n sub_total = expense_subtotal_by_party(party)\n accum = Money.new(0)\n\n filter_invoiced(line_items, invoiced, document_id).select{|li| li.line_item_sub_type == line_item_sub_type}.each do |li|\n if li.after_subtotal\n\n if li.billable_party == party\n accum -= li.percentage_of_subtotal ? li.revenue_total_with_percentage(sub_total) : li.revenue_total\n end\n\n if li.payable_party == party\n accum += li.percentage_of_subtotal ? li.expense_total_with_percentage(sub_total) : li.expense_total\n end\n\n else\n\n if li.billable_party == party\n accum -= li.revenue_total\n end\n\n if li.payable_party == party\n accum += li.expense_total\n end\n \n end\n\n end\n accum\n end",
"def recalc_totals_from_db!\n self.subtotal = self.time_entries.sum(:total_amount) + self.expense_entries.sum(:total_amount)\n self.paid = self.payment_allocates.sum(:amount)\n self.save!\n end",
"def update_invested\n self.invested_amount = self.investments.map(&:amount).sum\n self.goal_investment = 0 unless self.goal_investment\n self.equity_offered = 0 unless self.equity_offered\n self.save\n end",
"def expense_list\n\n end",
"def tot_deposits_made\n Rails.logger.debug(\"*** tot_deposits_made\")\n # note cannot use database sum because big_deposit is not native to database\n dep_result = 0.0\n EmployeeBenefit.where(\n \"employee_id = ? and eff_month = ? and eff_year = ? and deposited_at IS NOT NULL\",\n self.employee_id.to_s,\n self.eff_month.to_s,\n self.eff_year.to_s\n ).each do |eb|\n dep_result += round_money(eb.deposit)\n end\n Rails.logger.debug(\"*** dep_result: #{dep_result.inspect}\")\n return dep_result\n end",
"def expense_total_by_party party, invoiced=nil, document_id=nil\n expense_subtotal_by_party(party, invoiced, document_id) + expense_general_tax_by_party(party, invoiced, document_id) + expense_after_subtotal_by_party(party, invoiced, document_id)\n end",
"def order_expenses\n total_expenses_per_subsection = {}\n total_expenses_per_subsection.default = 0.0\n details = self.order_details\n details.each do |detail|\n total_expenses_per_subsection[detail.subsection] += detail.last_value.amount\n end\n total_expenses_per_subsection\n end",
"def total\n Money.new(self.expense_entries.sum('unit_cost_pence * qty'))\n end",
"def index\n @expenses = Expense.all\n end",
"def index\n @expenses = Expense.get_expenses(\n current_user[:id],\n session[:budget]['dateStart'],\n session[:budget]['dateEnd'],\n sort\n )\n\n get_tag_forms\n\n @expenses_sum = calculate_expenses_sum @expenses\n\n get_charts_and_tags @expenses\n end",
"def set_total_calories\n sum_of_cal = 0\n self.user_workout_exercises.each { |uwe| sum_of_cal += uwe.custom_calories}\n self.update(total_calories: sum_of_cal)\n end",
"def update_amount\n self.amount = purchase_entries\n .find_all(&:price?)\n .sum { |journal_entry| journal_entry.price * journal_entry.quantity }\n \n self.vat_amount = purchase_entries\n .find_all(&:vat_amount?)\n .sum { |journal_entry| journal_entry.vat_amount * journal_entry.quantity }\n end",
"def index\n @depenses = Depense.all\n @total = 0\n @depenses.each do |dep|\n @total += dep.value\n end\n @solde = User.find(1).solde\n end",
"def defense\n total_for(:defense)\n end",
"def index\n @expenses = current_user.user_account.expenses\n #DZF get totals\n\t\tunless @expenses.blank?\n\t\t\t@expense_total_price = current_user.user_account.get_expenses_total_price\n\t\t\t@expense_total_payed_price = current_user.user_account.get_expenses_total_total_payed_price\n\t\t\t@expense_total_payed_percentage = @expense_total_payed_price / @expense_total_price * 100\n\t\t\t@expense_total_remaining_price = current_user.user_account.get_expenses_total_remaining_price\n\t\t\t#DZF get payers percentage\n\t\t\t@payer_types_totals = {}\n\t\t\tPayerType.all.each do |pt|\n\t\t\t\t@payer_types_totals.merge!({pt.name => (current_user.user_account.get_payer_total_price_by_id(pt.id) * 100 / @expense_total_price) } )\n\t\t\tend\n\t\tend\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @expenses }\n end\n end",
"def gain_experience(exp)\n self.experience += exp\n save\n end",
"def total_paid\n self.user_expenses.reduce(0) { |sum, user_expense| user_expense.paid + sum }\n end",
"def expense_after_subtotal_by_party party, invoiced=nil, document_id=nil\n sub_total = expense_subtotal_by_party(party)\n accum = Money.new(0)\n\n filter_invoiced(line_items, invoiced, document_id).each do |li|\n if li.after_subtotal\n\n if li.billable_party == party\n accum -= li.percentage_of_subtotal ? li.revenue_total_with_percentage(sub_total) : li.revenue_total\n end\n\n if li.payable_party == party\n accum += li.percentage_of_subtotal ? li.expense_total_with_percentage(sub_total) : li.expense_total\n end\n\n end\n\n end\n accum\n end",
"def update_totals\n # update_adjustments\n self.payment_total = payments.completed.map(&:amount).sum\n self.item_total = line_items.map(&:amount).sum\n \n self.adjustment_total = adjustments.eligible.map(&:amount).sum\n self.total = item_total + adjustment_total + gift_packaging_total\n end",
"def sum_array(expenses)\n total_expense = 0;\n expenses.each do |entry|\n total_expense += entry\n end\n return total_expense\nend",
"def update_cached_usd_amounts\n rate = self.currency ? Money.default_bank.get_rate(self.currency, \"USD\") : 0\n self.budget_in_usd = (self.budget || 0) * rate\n self.spend_in_usd = (self.spend || 0) * rate\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 index\n redirect_to home_entries_path\n\n @entries = current_user.entries.expenses\n end",
"def total_direct_client_expenses\n staffing.present? ? staffing.total_direct_client_expenses : nil\n end",
"def profit_calculation\r\n @total_profit = @cocktail_profit + @beer_profit + @water_profit\r\n end",
"def index\n @expenses = Expense.includes(:place, :account, sub_category: :category).order('paid_at DESC').page(params[:page])\n end",
"def expense_total_charge(expenses, lease)\n charges_start = lease.start_date\n charges_end = lease.end_date\n \n total = 0.0\n expenses.each do |expense|\n # Complete charge. Expense falls inside lease duration completely\n if charges_start <= expense.start_date && charges_end >= expense.end_date\n total += expense.amount\n else\n # Expense started after lease started, but lease ended before expense ended\n if charges_start <= expense.start_date && charges_end <= expense.end_date\n num_days = (expense.start_date..charges_end).count\n # Expense started before lease started, but expense ended before lease ended\n elsif charges_start >= expense.start_date && charges_end >= expense.end_date \n num_days = (charges_start..expense.end_date).count\n else\n num_days = 0\n end\n expense_num_days = (expense.start_date..expense.end_date).count\n total += (num_days/expense_num_days.to_f * expense.amount)\n end\n end\n total\n end",
"def index\n @expenses_props = Expense.all\n end",
"def current_exp\n self.experience % 100\n end",
"def calories_burned(db, member_id)\n total_calories= []\n calories_person = db.execute(\"SELECT * FROM calories WHERE member_id='#{member_id}' \")\n calories_person.each do |cals|\n total_calories << cals['amt_burned']\n end \n total_calories.inject(:+)\nend",
"def index\n @expenses = Expense.includes(:author).where('author_id = ?',\n current_user.id).joins(:groups_expenses).most_recent\n end",
"def index\n @record_expenses = RecordExpense.all\n end",
"def total_investment_over_lifetime\n fetch(:total_investment_over_lifetime) do\n total_initial_investment + decommissioning_costs\n end\n end",
"def update_total\n self.total = self.line_items.reload.map(&:total).inject(:+).to_f\n end",
"def addup_total\n\t\tget_total\n\t\tupdate_total = {}\n\t\tupdate_total[\"c_ExpScopingTotal\"] = @total\n\t\tif(@total>0)\n\t\t\trally = @query_result.get_rally_object\n\t\t\tupdate = rally.update(\"portfolioitem\",\"FormattedID|#{@feature_id}\",update_total)\n\t\t\tif(update)\n\t\t\t\t@logger.info(\"Total for #{@feature_id} is updated to #{@total}\")\n\t\t\telse\n\t\t\t\t@logger.info(\"Total could not be updated\")\n\t\t\tend\n\t\tend\n\tend",
"def offense_counts; end",
"def offense_counts; end",
"def increase_pets_sold(increase, total)\n return increase[:admin][:pets_sold] += total\nend",
"def you_are_owed\n detailed_expenses = self.expenses.includes(:expense_details)\n amount = 0\n more_details = Hash.new {|h,k| h[k] = k }\n detailed_expenses.each do |ex|\n id = Friend.includes(:profile).find(ex.payable_id)\n friend_id = self.id != id.profile_id ? id.profile_id : id.friend_id\n ex.expense_details.each do |ed|\n if ed.paid_by == self.id\n amount += (ed.amount_paid / 2.0)\n more_details[friend_id] ||= {}\n more_details[friend_id] += ed.amount_paid / 2.0\n end\n end\n end\n [amount, more_details]\n end",
"def add_to_expenses(db, user_name, dolla_dolla_bills_yall)\r\n\tnew_expenses_total = (dolla_dolla_bills_yall.to_i + current_expenses(db, user_name))\r\n\tchange_expenses = '\r\n\r\n\tUPDATE users\r\n\r\n\tSET expenses = ?\r\n\tWHERE name = ?'\r\n\tdb.execute(change_expenses, [new_expenses_total, user_name])\r\nend",
"def offenses=(_); end",
"def get_expenses ( filepath )\n # ROWS:\n # [0]Date [1]Description [2]Context [3]Cost\n count = 0\n data = LEWT::LEWTBook.new\n CSV.foreach(filepath) do |row|\n if count > 0\n date = Time.parse(row[0])\n desc = row[1]\n context = row[2]\n cost = row[3].to_f * -1\n if self.is_target_date?( date ) == true && self.is_target_context?(context) == true\n # create ledger entry and append to books\n row_data = LEWT::LEWTLedger.new({\n :date_start => date, \n :date_end => date, \n :category => @category, \n :entity => context,\n :description => desc,\n :quantity => 1, \n :unit_cost => cost\n })\n data.push(row_data) \n end\n end\n # increment our row index counter\n count += 1\n end\n\n # return our data as per specification!\n return data\n end",
"def index\n @shared_expenses = SharedExpense.all\n end",
"def index\n @monthly_expenses = MonthlyExpense.all\n end",
"def calculate_totals\n self.build_food unless self.food\n self.food.protein = self.meals.inject(0){|sum, m| sum += m.protein}\n self.food.carbohydrate = self.meals.inject(0){|sum, m| sum += m.carbohydrate}\n self.food.fat = self.meals.inject(0) {|sum, m| sum += m.fat}\n self.food.energy = self.meals.inject(0) {|sum, m| sum += m.energy}\n self.size = self.meals.inject(0) {|sum, m| sum += m.size}\n self.save\n end",
"def index\n @rec_expenses = RecExpense.all\n end",
"def index\n @marketing_expenses = MarketingExpense.all\n end",
"def local_sum_exempt_vat\n invoice_lines.joins(:official_fee_type).where(:official_fee_types => {:apply_vat => false}).sum('total_official_fee')\n end",
"def update\n #render :text => \"stop\" and return\n @expense = current_user.organization.expenses.find(params[:id])\n params[:expense][:date] = change_date_format(params[:expense][:date]) if !(params[:expense][:date]).blank?\n\n respond_to do |format|\n if @expense.update_attributes(params[:expense])\n @total_expense_amount = 0\n @total_approved_amt = 0#\n @tot_amt = []\n @tot_approved_amt = []#\n @total_amount = @expense.payments\n @total_amount.each do |k|\n @tot_amt << k.amount\n end \n @total_app_amt = @expense.payments#\n @total_app_amt.each do |a|#\n @tot_approved_amt << a.approved_amt#\n end #\n @tot_amt.each do |t|\n @total_expense_amount = @total_expense_amount + t\n end \n @tot_approved_amt.each do |t1|#\n @total_approved_amt = @total_approved_amt + t1#\n end #\n @total_paid_amt = 0##\n @tot_paid_amt = []##\n @total_paid_amount = @expense.payments##\n @total_paid_amount.each do |p|##\n @tot_paid_amt << p.pay_amount##\n end ##\n @tot_paid_amt.each do |t2|##\n @total_paid_amt = @total_paid_amt + t2##\n end ##\n @expense.update_attribute(\"paid_expense_amt\",@total_paid_amt)##\n @expense.update_attribute(\"amount\",@total_expense_amount)\n @expense.update_attribute(\"total_approved_amt\",@total_approved_amt)#\n format.html { redirect_to @expense, notice: 'Expense was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @expense.errors, status: :unprocessable_entity }\n end\n end\n end",
"def total_amount\n self.tickets.inject(0) do |amount, ticket|\n amount += ticket.price_minus_discount\n end\n end",
"def index\n @expenses = Expense.for_user(current_user).all\n @sum = Expense.for_user(current_user).sum(:price)\n \n respond_to do |format|\n format.html # index.html.erb\n format.iphone {render :layout => false}\n format.xml { render :xml => @expenses }\n end\n end",
"def index\n @expenses = Expense.search(params[:search])\n end",
"def index\n @financial_objects_expenses = manager.index(current_user)\n @pagy, @financial_objects_expenses = pagy(@financial_objects_expenses)\n end",
"def existing_clients_new_revenue \n existing_clients.where(new_money: true).sum(:first_year_comp)\nend",
"def sum_expenses_by_status(status)\n expenses.where(\"expenses.status = \" + (status ? \"true\" : \"false\")).sum(:total)\n end",
"def index\n @api_v1_expenses = Api::V1::Expense.all\n end",
"def total_life\n items.map(&:life).inject(0) { |sum, current| sum += current }\n end",
"def index\n @office_expenses = OfficeExpense.all\n end",
"def index\n @expense_trackers = ExpenseTracker.all\n \n #Create a hash to keep track of total expenses per month\n #Keys for this hash will be \"Month- value specified from form\"\n @total_expense = Hash.new\n @savings = Hash.new\n \n #Loop through each row in expense tracker (per month)\n @expense_trackers.each do |expense_tracker|\n @total_expense[expense_tracker.month] = 0\n if(expense_tracker.grocery != NIL)\n @total_expense[expense_tracker.month] += expense_tracker.grocery\n end\n if(expense_tracker.mortgage != NIL)\n @total_expense[expense_tracker.month] += expense_tracker.mortgage\n end\n if(expense_tracker.gas != NIL)\n @total_expense[expense_tracker.month] += expense_tracker.gas\n end\n if(expense_tracker.shopping != NIL)\n @total_expense[expense_tracker.month] += expense_tracker.shopping\n end\n if(expense_tracker.restaurant != NIL)\n @total_expense[expense_tracker.month] += expense_tracker.restaurant\n end\n if(expense_tracker.utilities != NIL)\n @total_expense[expense_tracker.month] += expense_tracker.utilities\n end\n if(expense_tracker.other != NIL)\n @total_expense[expense_tracker.month] += expense_tracker.other\n end\n @savings[expense_tracker.month] = expense_tracker.income - @total_expense[expense_tracker.month]\n end\n \n end",
"def expense_attributes\n {}\n end",
"def index\n if User.count < 1\n @user = User.new\n @user.current_balance = 0.0\n @user.save\n else\n @user = User.all.first\n end\n @expense_this_week = Expense.where(:created_at => Time.now.beginning_of_week..Time.now, :gains => false).sum(\"amount\")\n @expense = Expense.new\n @category = Category.new\n category = Category.all\n @category_data = category.map{|c| [c.name,c.expenses.sum(\"amount\")]}.to_h\n @daily_expense_data = Expense.group_by_day(:created_at).sum(\"amount\")\n @expenses = Expense.paginate(:page => params[:page], :per_page => 10).where(:date => 30.days.ago..Time.now).order(\"date DESC\")\n end",
"def get_expenses_for_public_agency( id_public_agency )\n total_expense = Expense.where( \n public_agency_id: id_public_agency ).sum( :value )\n return total_expense\n end",
"def current_amount\n items.reduce(0) do |sum, item|\n sum + item.current_amount * item.price\n end\n end",
"def set_expense_entry_expense_amount\n data=params\n @tne_invoice_expense_entry = TneInvoiceExpenseEntry.find(data[:id])\n expense_amount = !data[:value].blank? ? data[:value].to_i : 0\n @error=false\n if expense_amount > 0\n @tne_invoice_expense_entry.update_attribute(:expense_amount,expense_amount)\n @final_expense_amount = @tne_invoice_expense_entry.calculate_final_expense_amount\n else\n @error=true\n flash[:error]= t(:flash_enter_valid_expense_amt)\n end\n end",
"def index\n @filters = {}\n @expenses = Expense.all\n @subtotal = calculate_subtotal(@expenses)\n\n render :index\n end",
"def gain_exp\n rate = Grade.rate(:exp)\n $game_party.all_members.each do |actor|\n actor.gain_exp_cpv($game_troop.exp_total, rate)\n end\n return $game_troop.exp_total * rate / 100\n end",
"def update_totals\n # update_adjustments\n self.payment_total = payments.completed.map(&:amount).sum\n self.item_total = line_items.map(&:amount).sum\n self.adjustment_total = adjustments.eligible.map(&:amount).sum\n self.total = item_total + adjustment_total\n end",
"def user_expenses\n unless @current_admin.is_super_admin\n unless @current_admin.privilages.include? '1'\n flash.now[:error]=\"You are not authorized to navigate to this page \"\n redirect_to admin_index_path\n empty_user_id\n return\n end\n end\n if session[:user]\n @searched_user = User.find(session[:user])\n if @searched_user\n @user_codes = Expense.where(\"(code_id is not null) and user_id =?\", @searched_user.id)\n @user_renew = Expense.where(\"is_master = ? and (code_id is null) and (sale_id is null) and user_id=?\", true, @searched_user.id)\n\n #show_first_product\n @first_product_info= FirstProduct.find_by_user_id(@searched_user.id)\n if @first_product_info\n @first_product=Product.find(@first_product_info.product_id)\n if File.exist?(\"app/assets/images/data/products/#{@first_product.id}\")\n @product_images=Dir.glob(\"app/assets/images/data/products/#{@first_product.id}/*\").map do |f|\n File.basename f\n end.sort\n end\n end\n\n #show user sales\n @user_expenses_sales=Expense.where(\"(sale_id is not null) and user_id=?\", @searched_user.id)\n end\n else\n redirect_to admin_index_path\n end\n end",
"def index\n convert_date if (params[:search] && params[:search]['date_lte(1i)'])\n @search = current_user.expenses.order_by_date.search(params[:search]) \n @expenses = @search.all.uniq\n # TODO Count does not working in HEroku\n #@count = @expenses.count\n @sum = @expenses.inject(0){|sum, item| sum + item.amount}\n @categories = Category.all\n @tags = current_user.owned_tags\n @expense_types = ExpenseType.all\n @payment_method = PaymentMethod.all\n \n @description = t('menu.expenses.index.description') \n @single_column = true\n \n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @expenses }\n end\n end",
"def calc_total_xp\n total = 0\n get_shared_xp_fields.each do |m|\n total += send(m) \n end\n self.total_xp = total\n\n self.level = XPModel.level(total_xp)\n self.xp_to_next_level = XPModel.xp_to_next(total_xp)\n end",
"def computeTotal\n # get rule for total\n rule = @rules.find{ |obj| obj.getCode == \"total\" } \n # sum item prices\n total = @items.inject(0){|sum, x| sum + x.getPrice} \n # if rule exists and condition is met, apply discount\n if rule && total > rule.getThreshold \n total = rule.getPercent ? total * (1-rule.getValue) : total - rule.getValue\n end\n return total\n end",
"def get_total_apply_amount\n total=0\n if self.doc_type==1\n total+= amount_for :borrow_doc_details\n end\n if doc_type==2\n total+= amount_for :pay_doc_details\n end\n if doc_type==3\n total+= amount_for :rec_notice_details\n end\n if doc_type==4 and inner_remittance!=nil\n total=inner_remittance.amount || 0\n end\n if doc_type==5 and inner_transfer !=nil\n total=inner_transfer.amount || 0\n end\n if doc_type==6 and inner_cash_draw!=nil\n inner_cash_draw.cash_draw_items.each do |c_item|\n next if c_item.apply_amount==nil or c_item.marked_for_destruction?\n total+=c_item.apply_amount\n end\n end\n if doc_type==7 and buy_finance_product!=nil\n total=buy_finance_product.amount\n end\n if doc_type==8 and redeem_finance_product!=nil\n total=redeem_finance_product.amount\n end\n if doc_type==9\n %w(rd_travels rd_transports rd_lodgings other_riems).each do |rd|\n total+=amount_for rd \n end\n end\n if doc_type==10\n total+=amount_for :rd_communicates\n end\n if doc_type==11\n %w(rd_extra_work_cars rd_extra_work_meals).each do |rd|\n total+=amount_for rd\n end\n end\n if doc_type==12\n %w(rd_common_transports rd_work_meals common_riems).each do |rd|\n total+=amount_for rd\n end\n end\n if doc_type==13\n total+= amount_for :rd_benefits\n end\n if doc_type==14\n # todo\n # total+=amount_for :fixed_properties\n end\n total\n end",
"def recalculate_price!\n self.total_price = service_type_reservations.where(paid: false).inject(0.0){|sum, service_type_reservation| sum += service_type_reservation.price }\n save!\n end",
"def quota()\n (@quota) + (@experience / 2)\nend",
"def potential_revenue\n @inventory.inject(0) do |total, inventory|\n total += inventory.first.price * inventory.last\n end\n end",
"def update_actual_cost\n cost = BigDecimal(0.00, 10)\n self.activities.each do |activity|\n cost += activity.actualCost\n end\n self.actual_cost = cost\n end",
"def index\n d = Date.today\n @expenses = @household.expenses.monthly_statement(d.month, d.year).order(spent_at: :desc)\n end",
"def index\n @utility_expenses = UtilityExpense.all\n end",
"def percentage\n \tamount / expense.cost\n end"
] |
[
"0.73743963",
"0.7148933",
"0.69950455",
"0.6750977",
"0.67007786",
"0.66225916",
"0.64900327",
"0.63648957",
"0.6335158",
"0.6327137",
"0.6282385",
"0.6282385",
"0.6282385",
"0.61668694",
"0.61641157",
"0.61548376",
"0.6149582",
"0.6143987",
"0.61340106",
"0.61119473",
"0.61086416",
"0.6097299",
"0.60742563",
"0.60648406",
"0.6061575",
"0.6058108",
"0.60573727",
"0.605261",
"0.6018976",
"0.59957206",
"0.5977017",
"0.5953547",
"0.59220135",
"0.59185326",
"0.5918402",
"0.58739823",
"0.5869318",
"0.58599365",
"0.5855822",
"0.58548903",
"0.5810848",
"0.57900214",
"0.57821405",
"0.5773385",
"0.5734258",
"0.5725883",
"0.57234126",
"0.57126856",
"0.56987834",
"0.5689403",
"0.56840926",
"0.56715584",
"0.566917",
"0.5659536",
"0.5658009",
"0.5650138",
"0.5640603",
"0.5640603",
"0.5637464",
"0.56364924",
"0.5627345",
"0.56264126",
"0.5615977",
"0.56159085",
"0.5613512",
"0.56059474",
"0.5604012",
"0.55996853",
"0.5583967",
"0.5580336",
"0.55769527",
"0.5572938",
"0.5568345",
"0.5566644",
"0.556281",
"0.5558994",
"0.5557402",
"0.55564797",
"0.55558085",
"0.55557173",
"0.5555254",
"0.55511975",
"0.55486405",
"0.5548474",
"0.55315053",
"0.5528724",
"0.5517297",
"0.5509088",
"0.5505381",
"0.5499605",
"0.5491158",
"0.5490402",
"0.5487867",
"0.5482859",
"0.5464415",
"0.5461962",
"0.546007",
"0.5455962",
"0.5454361",
"0.5436645"
] |
0.7099819
|
2
|
GET /breweries GET /breweries.json
|
def index
@last5ratings = Rating.last5
@ratings = Rating.includes(:beer, :user).all
TestJob.perform_async
#Rails.cache.write('brewery top 3', Brewery.top(3), expires_in: 15.minutes)
@top_breweries = brewery.top(3)
#Rails.cache.write('beers top 3', Beer.top(3), expires_in: 15.minutes)
@top_beers = beer.top(3)
#Rails.cache.write('style top 3', Style.top(3), expires_in: 15.minutes)
@top_styles = style.top(3)
@most_active = User.most_active(3)
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def index\n @active_breweries = Brewery.active\n\t\t@retired_breweries = Brewery.retired\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @breweries }\n end\n end",
"def state_breweries\n render json: BreweryDb::ShowBreweries.new('state', params[:state]).results\n end",
"def index\n\t\t\t\t@breweries = Brewery.all.sort_by { |b| b.send(params[:order] || 'name') }\n\t\t\t\t@active_breweries = Brewery.active\n\t\t\t\t@retired_breweries = Brewery.retired\n\n\t\t\t\trespond_to do |format|\n\t\t\t\t\t\tformat.html # index.html.erb\n\t\t\t\t\t\tformat.json { render json: @breweries }\n\t\t\t\tend\n\t\tend",
"def postal_breweries\n render json: BreweryDb::ShowBreweries.new('postal', params[:postal]).results\n end",
"def results\n if (@location_type == 'state')\n breweries = brewery_db.locations.all(region: @location)\n elsif (@location_type == 'postal')\n breweries = brewery_db.locations.all(postalCode: @location)\n end\n\n brewery_arr = []\n breweries.each do |b|\n content = {}\n content['name'] = b.brewery.name\n content['id'] = b.breweryId\n content['website'] = b.brewery.website\n brewery_arr << content\n end\n\n return brewery_arr\n end",
"def show\n @brewery = Brewery.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @brewery }\n end\n end",
"def index\n if @user\n @breweries = @user.breweries.all\n else\n @breweries = Brewery.all\n end\n end",
"def show\n\t\t\t\t@brewery = Brewery.find(params[:id])\n\n\t\t\t\trespond_to do |format|\n\t\t\t\t\t\tformat.html # show.html.erb\n\t\t\t\t\t\tformat.json { render json: @brewery }\n\t\t\t\tend\n\t\tend",
"def all_breweries_in_us\n state_names.collect do |state|\n name_iterate_through_json(state)\n end\n end",
"def db_list\n beername = params[:name]\n @beer_info = BREWERY.search.beers(q: beername, withBreweries: 'Y').first(10)\n @beers_with_breweries = []\n @beerlist = @beer_info.map do |drink|\n drink_object(drink)\n end\n render json: @beerlist\n end",
"def index\n @super_bowl_picks = SuperBowlPick.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @super_bowl_picks }\n end\n end",
"def series_get_all\n begin\n api = \"#{$config['sonarr']['api_url']}/series\"\n\n url = URI.parse(api)\n\n req = Net::HTTP::Get.new(url.path)\n req.add_field('Content-Type', 'application/json')\n req.add_field('X-Api-Key',$config['sonarr']['api_key'])\n\n res = Net::HTTP.new(url.host, url.port).start do |http|\n http.request(req)\n end\n\n json = JSON.parse(res.body)\n #if json.class.to_s == 'Array'\n # json.each do |row|\n # log_debug (\"#{row['title']}\")\n # end\n #end\n\n rescue => e\n log_debug \"failed #{e}\"\n end\n return json\n end",
"def index\n @satellites = Satellite.all\n @sat_json = Satellite.includes(:barrels).map { |sat| sat.as_json.merge({barrels: sat.barrels.as_json}) }\n end",
"def get_brandings\n request :get, \"/v3/brandings.json\"\n end",
"def index\n @wears = Wear.all.order(brand: :asc)\n render json: @wears\n end",
"def index\n @used_bikes = UsedBike.all\n\n render json: @used_bikes, each_serializer: Web::V1::UsedBikeSerializer\n end",
"def index\n @bounties = Bounty.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @bounties }\n end\n end",
"def index\n @buisnesses = Buisness.all\n\n render json: @buisnesses \n end",
"def breweries_list \n Brewery.all.each.with_index(1) do |brewery, i|\n puts \"\"\n puts \"\"\n puts \"#{i}. #{brewery.name}\"\n end \n brewery_selection\n end",
"def by_id\n get_brewery\n end",
"def index\n @beverages = Beverage.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @beverages }\n end\n end",
"def index\n @brochures = Brochure.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @brochures }\n end\n end",
"def index\n @specialties = Specialty.all\n\n render json: @specialties\n end",
"def index\n @breeds = Breed.all\n\n render json: @breeds\n end",
"def index\n @birds = Bird.all.to_a\n begin\n respond_to do |format|\n format.json { render json: {items: @birds, description: \"List all visible birds in the registry\", additionalProperties: false, title: \"POST /birds [request]\",:status => OK } }\n end\n rescue => e\n render json: ({:status => INTERNAL_SERVER_ERROR})\n end\n end",
"def index\n @recipes = Recipe.all\n render json: @recipes\n end",
"def index\n @career_specialties = CareerSpecialty.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @career_specialties }\n end\n end",
"def index\n @bikes = Bike.all.order(\"display_order\")\n render json: @bikes.includes(:specifications) #each_serializer: Web::V1::BikeSerializer\n end",
"def items\n @beverages = Beverage.available\n respond_to do |format|\n format.json { render :json => @beverages.to_json(methods: :image_url)}\n end\n end",
"def index\n @baskets = Basket.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @baskets }\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 index\n @athleteseries = Athleteseries.all\n end",
"def index\n skickers = Skicker.order(power: :asc)\n render json: { status: 'SUCCESS', message: 'Loaded skickers', value: skickers }\n end",
"def iterate_through_json(state) #should be called: make all breweries in a state\n (1..number_of_json_pages(state)).collect do |number|\n load_db_json(\"locations?region=#{state}&key=#{@key}&p=#{number}\")[\"data\"].collect do |hash|\n hash[\"id\"] # eventually Brewery.build(:name => hash[\"brewery\"][\"name\"], :state_id => :state_id)\n end\n end.flatten\n end",
"def index\n @lugars = Lugar.all\n\n render json: @lugars\n end",
"def index\n info = Aws.get_recipes_from_db\n render :json => info\n end",
"def index\n recipes = Recipe.all\n render status: :ok, json: recipes\n end",
"def getbatteries\n puts params\n buildid = params[\"buildingid\"]\n\n batteries = Battery.where(:building_id => buildid)\n\n puts batteries.inspect\n puts \"#################################################\"\n \n respond_to do |format|\n format.json { render json: batteries }\n end\n end",
"def index\n ingredients = params[:ingredients]\n if params[:limit]\n searchlimit = params[:limit]\n else\n searchlimit = '10'\n end\n\n require 'nokogiri'\n require 'uri-handler'\n require 'open-uri'\n\n ingredients = ingredients.to_uri\n doc = Nokogiri::HTML(open(\"http://www.webtender.com/cgi-bin/search?name=&ingr=#{ingredients}&what=drink&show=#{searchlimit}&verbose=on\"))\n index = 0\n\n drinknames = []\n ings = []\n cocktails = Hash.new\n\n doc.css(\"td[width='90%']\").each do |node|\n # puts node.xpath('/a').text\n drinknames[index] = node.css('a').text\n ings = node.css(\"small\")[1].text\n\n ings.gsub!('Ingredients: ', '')\n ings = ings.split(', ')\n\n\n cocktails[drinknames[index]] = [ings]\n\n index += 1\n end\n\n respond_to do |format|\n format.json { render :json => cocktails }\n end\n end",
"def new\n @brewery = Brewery.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @brewery }\n end\n end",
"def index\n @physical_racks = PhysicalRack.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @physical_racks }\n end\n end",
"def index\n @user_figures = UserFigure.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @user_figures }\n end\n end",
"def index\n @picks = PickName.order(:id).all\n\n respond_to do |format|\n format.html # index.html.haml\n format.json { render json: @picks }\n end\n end",
"def index\n authorize! :read, Roxiware::BookSeries\n @series = Roxiware::BookSeries.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @series }\n end\n end",
"def index\n weathers = Weather.all\n render json: weathers, status: 200\n end",
"def index\n @bowlers = Bowler.all\n respond_with(@bowlers)\n end",
"def index\n @tacks = Tack.all\n\n render json: @tacks\n end",
"def index\n @yarns = Yarn.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @yarns }\n end\n end",
"def get_beer\n beer_id = params['id'];\n response = HTTP.get('http://api.brewerydb.com/v2/beer/' + beer_id,\n :params=> {\n :key => ENV[\"BREWERYDB_BEERRATER_KEY\"],\n :withBreweries => \"y\"\n }\n )\n\n body = response.parse\n\n # check for success\n if body[\"status\"] == \"success\"\n data = body[\"data\"]\n unless data.nil?\n render json: {\n status: 200,\n message: \"#{params['id']} found\",\n data: data}\n else\n render json: {\n status: 200,\n message: \"#{params['id']} not found\",\n data: []\n }\n end\n else\n render json: { status: 401, message: body[\"errorMessage\"]}\n end\n end",
"def index\n @cookbooks = Cookbook.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @cookbooks }\n end\n end",
"def index\n @ducks = Duck.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @ducks }\n end\n end",
"def index\n @briefs = Brief.includes(:user).order(created_at: :desc).all\n render json: @briefs, each_serializer: BriefsSerializer\n end",
"def index\n @careers = Career.all\n json_response(@careers)\n end",
"def index\n @shop_section = ShopSection.find_by_short_url(\"brands\")\n @brands = Brand.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @brands }\n end\n end",
"def index\n @scrobbles = Scrobble.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @scrobbles }\n end\n end",
"def index\n @breeds = Breed.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @breeds }\n end\n end",
"def index\n @recipes = Recipe.all\n respond_to do |format|\n format.html {}\n format.json { render json: @recipes }\n end\n end",
"def index\n render json: Recipe.all\n end",
"def index\n @trucks = Truck.all\n\n render json: @trucks\n end",
"def index\n @air_qualities = AirQuality.all\n\n render json: @air_qualities\n end",
"def new\n\t\t\t\t@brewery = Brewery.new\n\n\t\t\t\trespond_to do |format|\n\t\t\t\t\t\tformat.html # new.html.erb\n\t\t\t\t\t\tformat.json { render json: @brewery }\n\t\t\t\tend\n\t\tend",
"def index\n @episodes = @series.episodes.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @episodes }\n end\n end",
"def index\n @cloth_measures = ClothMeasure.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @cloth_measures }\n end\n end",
"def index\n @pizzas = Pizza.all\n render json: @pizzas\n end",
"def index\n @bike_types = BikeType.all.order(\"updated_at DESC\").order(\"created_at DESC\")\n\n render json: @bike_types #each_serializer: Web::V1::BikeTypeSerializer\n end",
"def index\n @tracks = Track.all\n render json: {tracks: @tracks}\n end",
"def index\n @non_smoking_bars = NonSmokingBar.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @non_smoking_bars }\n end\n end",
"def index\n @batting_lines = BattingLine.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @batting_lines }\n end\n end",
"def serv_json\n \"http://api.dribbble.com/shots/popular?page=1\"\n end",
"def index\n waiver_picks_decorator = WaiverPicksDecorator.new(\n @fpl_team.waiver_picks.where(round_id: (params[:round_id] || Round.current_round.id))\n )\n\n render json: { waiver_picks: waiver_picks_decorator.all_data }\n end",
"def index\n @guys = Guy.all\n respond_to do |format|\n format.json { render json: @guys }\n end\n end",
"def index\n\t\tboats = Boat.all\n \trender json: boats, status: 200\n\tend",
"def index\n @brags = Brag.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @brags }\n end\n end",
"def find_beers\n # Use wild cards to get any beer with search string in name\n beer_name = \"*#{params['name']}*\"\n response = HTTP.get('http://api.brewerydb.com/v2/beers',\n :params=> {\n :key => ENV[\"BREWERYDB_BEERRATER_KEY\"],\n :name => beer_name,\n :withBreweries => \"y\"\n }\n )\n\n body = response.parse\n\n # check for success\n if body[\"status\"] == \"success\"\n data = body[\"data\"]\n unless data.nil?\n render json: { status: 200, message: \"#{params['name']} found\", data: data}\n else\n render json: {\n status: 200,\n message: \"#{params['name']} not found\",\n data: []}\n end\n else\n render json: { status: 401, message: body[\"errorMessage\"] }\n end\n end",
"def index\n @economy_hands = EconomyHand.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @economy_hands }\n end\n end",
"def buyers\n result = get_buyers(params, false)\n render json: result, status: 200\n end",
"def index\n @recipes = Recipe.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @recipes }\n end\n end",
"def index\n @albums = Album.all\n render json: @albums\n end",
"def index\n @episodes = Episode.all\n\n render json: @episodes\n end",
"def birds_list\n birds = ::Bird.all\n render status: HttpCodes::OK,json: birds.extend(BirdRepresenter).to_a.as_json unless birds.empty?\n render status: HttpCodes::OK,json: {} if birds.empty?\n end",
"def index\n @bookings = Booking.all\n\n render json: @bookings\n end",
"def index\n @settlement_histories = Settlement::History.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @settlement_histories }\n end\n end",
"def bakeries\n dessert.map do |dessert|\n dessert.bakery\n end\n \n end",
"def create\n @brewery = @user.breweries.new(brewery_params)\n\n respond_to do |format|\n if @brewery.save\n format.html { redirect_to user_breweries_path(@user), notice: 'Brewery was successfully created.' }\n format.json { render :show, status: :created, location: @brewery }\n else\n format.html { render :new }\n format.json { render json: @brewery.errors, status: :unprocessable_entity }\n end\n end\n end",
"def favourite_artists\n @favourite_artists = FavouriteArtist.all\n render :json => @favourite_artists.to_json\n end",
"def state_beers\n render json: BreweryDb::ShowBeers.new('state', params[:state]).results\n end",
"def index\n render json: {seasons: @serial.seasons, series: @serial}\n end",
"def rating(food)\n url = 'https://thereportoftheweek-api.herokuapp.com/reports'\n uri = URI(url)\n response = Net::HTTP.get(uri)\n result = JSON.parse(response)\n puts result[7]['product']\n \n end",
"def index\n @decks = Deck.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @decks }\n end\n end",
"def index\n @decks = Deck.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @decks }\n end\n end",
"def markets\n get('/markets')['markets']\n end",
"def show\n @beer = BreweryDB.beer(params[:id]) \n render json: @beer\n end",
"def index\n if params[:album_id]\n @artists = Album.resolve(params[:album_id]).artist\n else\n @artists = Artist.order(:name)\n end\n\n render json: @artists\n end",
"def index\n @karyalay_caterers = KaryalayCaterer.all\n render json: @karyalay_caterers\n end",
"def index\n locations = Location.all\n render json: locations\n end",
"def index\n @harvestings = Harvesting.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @harvestings }\n end\n end",
"def index\n meals = json_decode(RestClient::Resource.new(BASE_URL).get({:accept => :json}).body)\n\n styled_array(meals.map do |meal|\n [(meal['today'] ? '*' : ''), day_of_week(meal['date']), meal['summary']]\n end, :sort => false)\n end",
"def index\n @joys = Joy.all\n render json: @joys\n end",
"def index\n @rentable_items = RentableItem.all\n render json: @rentable_items\n end",
"def artists\n # TODO: add param for albums and songs\n a = Artist.all\n render json: a\n end",
"def index\n @alleys = Alley.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @alleys }\n end\n end"
] |
[
"0.77884763",
"0.7670918",
"0.7586876",
"0.75477356",
"0.6680661",
"0.642776",
"0.6395458",
"0.63518757",
"0.61870176",
"0.61443573",
"0.61317825",
"0.60553575",
"0.6040625",
"0.6007967",
"0.5992113",
"0.59805167",
"0.5946019",
"0.594275",
"0.59425575",
"0.5938999",
"0.5933452",
"0.58856416",
"0.58209586",
"0.581104",
"0.58040875",
"0.57793283",
"0.57641214",
"0.57639587",
"0.57509875",
"0.5737245",
"0.5727715",
"0.57184917",
"0.57149935",
"0.57076555",
"0.57053673",
"0.5703279",
"0.56649953",
"0.56589353",
"0.565148",
"0.5640675",
"0.5634722",
"0.5634635",
"0.56272477",
"0.561861",
"0.5615277",
"0.5615133",
"0.5615058",
"0.5610616",
"0.56066936",
"0.5598227",
"0.55912405",
"0.5589198",
"0.55852437",
"0.55837286",
"0.55826825",
"0.55644375",
"0.55527645",
"0.55415285",
"0.55383086",
"0.553227",
"0.5530326",
"0.55302536",
"0.5527386",
"0.5526402",
"0.5523838",
"0.5523222",
"0.55206424",
"0.55201805",
"0.5511958",
"0.5509102",
"0.5507494",
"0.5505226",
"0.5503621",
"0.55031025",
"0.55020887",
"0.5500071",
"0.54985666",
"0.54959124",
"0.5494941",
"0.54873985",
"0.5487046",
"0.5485984",
"0.5484623",
"0.5484268",
"0.54760855",
"0.5474512",
"0.5473997",
"0.54739773",
"0.5459567",
"0.5459567",
"0.5456999",
"0.5445633",
"0.543924",
"0.54373604",
"0.5434937",
"0.54338235",
"0.54331565",
"0.54323477",
"0.543106",
"0.54263675",
"0.5425442"
] |
0.0
|
-1
|
Use callbacks to share common setup or constraints between actions.
|
def set_rating
@rating = Rating.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 rating_params
params.require(:rating).permit(:score, :beer_id)
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def strong_params\n params.require(:user).permit(param_whitelist)\n end",
"def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end",
"def allow_params_authentication!; end",
"def allowed_params\n ALLOWED_PARAMS\n end",
"def default_param_whitelist\n [\"mode\"]\n end",
"def param_whitelist\n [:role, :title]\n end",
"def expected_permitted_parameter_names; end",
"def safe_params\n params.except(:host, :port, :protocol).permit!\n end",
"def strong_params\n params.require(:team_member).permit(param_whitelist)\n end",
"def permitir_parametros\n \t\tparams.permit!\n \tend",
"def strong_params\n params.require(:community).permit(param_whitelist)\n end",
"def permitted_strong_parameters\n :all #or an array of parameters, example: [:name, :email]\n end",
"def strong_params\n params.require(:education).permit(param_whitelist)\n end",
"def restricted_params\n #params.require(self.controller_name.classify.underscore.to_sym).permit([])\n raise(\"No strong params set, override restricted_params method in your controller. E.g. params.require(:model).permit(:attribute1, :attribute2)\")\n end",
"def allowed_params\n params.require(:user).permit(:username, :email, :password, :password_confirmation)\n end",
"def param_whitelist\n [:rating, :review]\n end",
"def param_whitelist\n whitelist = [\n :username, :name,\n :parent_id,\n :headline, :description, :video,\n :policy, :signup_mode, :category,\n :website, :facebook, :twitter, :linkedin,\n :founded_at,\n privacy: [\n :events,\n :resources\n ],\n permission: [\n :profile,\n :members,\n :children,\n :statistics,\n :posts,\n :listings,\n :resources,\n :events\n ],\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:parent_id)\n unless current_user.role_in(@community) === 'owner'\n whitelist.delete(:privacy)\n whitelist.delete(:permission)\n end\n end\n \n whitelist\n end",
"def param_whitelist\n if @user.present? && current_user != @user\n return [:followed]\n end\n \n whitelist = [\n :username, :email, :password,\n :first_name, :last_name,\n :birthday, :gender,\n :headline, :biography, :ask_about, :focus,\n :website, :facebook, :linkedin, :twitter, :github,\n roles: [],\n skills: [],\n interests: [],\n privacy: { contact: [] },\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:email)\n whitelist.delete(:password)\n end\n \n whitelist\n end",
"def valid_params_request?; end",
"def user_params \n \tparams.require(:user).permit(:name, :email, :password, :password_confirmation)# preventing CSTR\n end",
"def user_params\n params.permit(:name, :phoneNumber, :address, :postalCode, :local, :link, :counter, :latitude, :longitude) \n end",
"def strong_params\n params.require(:experience).permit(param_whitelist)\n end",
"def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end",
"def whitelist_url_params\n params.require(:whitelist_url).permit(:domain)\n end",
"def allowed_params\n params.require(:allowed).permit(:email)\n end",
"def permitted_params\n []\n end",
"def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end",
"def safe_params\n params.permit(:id, :name, :origin, :emails => []); #emails is an array\n end",
"def query_param\n\t\tparams.permit(:first_name, :last_name, :phone)\n\tend",
"def strong_params\n params.require(:success_metric).permit(param_whitelist)\n end",
"def devise_filter\r\n logger.debug(\"In devise_filter =>PARAMS: #{params.inspect}\")\r\n\r\n # White list for sign_up\r\n devise_parameter_sanitizer.for(:sign_up) { |u| u.permit(user_whitelist) }\r\n\r\n # White list for account update\r\n devise_parameter_sanitizer.for(:account_update) { |u| u.permit(user_whitelist, :current_password) }\r\n\r\n # White list for Invitation creation\r\n devise_parameter_sanitizer.for(:invite) { |u| u.permit(:account_type, :email, :invitation_token)}\r\n\r\n # White list for accept invitation\r\n devise_parameter_sanitizer.for(:accept_invitation) { |u| u.permit(user_whitelist, :invitation_token)}\r\n\r\n end",
"def whitelisted_user_params\n params.require(:user).\n permit( :first_name, :last_name, :email,:password,:password_confirmation,:birthday,:gender)\n end",
"def user_params\n ActionController::Parameters.permit_all_parameters = true\n params.require(:user) #.permit(:name, :surname, :phone, :password, :email, :time_zone)\n end",
"def safe_params\n params.require(:user).permit(:name)\n end",
"def strong_params\n params.require(:metric_change).permit(param_whitelist)\n end",
"def get_params\n\t\treturn ActionController::Parameters.new(self.attributes).permit(\"account_id\", \"title\", \"category\", \"introduction\", \"tags\", \"segment_type\", \"visible\", \"status\", \"main_image\")\n\tend",
"def grant_params\n @whitelisted = params.require(:grant).permit(:name, :description, :agency_id, :acronym)\n end",
"def check_params; true; end",
"def param_whitelist\n whitelist = [\n :description,\n :progress,\n :kpi_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:kpi_id)\n end\n \n whitelist\n end",
"def quote_params\n params.permit!\n end",
"def valid_params?; end",
"def paramunold_params\n params.require(:paramunold).permit!\n end",
"def user_params\n\t\tparams.permit(:nickname, :avatar, :description, :password, :gender, :birthday, :email, :phone, :qq_id, :wechat_id)\n\tend",
"def filtered_parameters; end",
"def user_params\n params.permit(\n \t:id,\n \t:email, \n \t:first_name, \n \t:last_name, \n \t:password, \n \t:confirm_token, \n \t:phone_number,\n \t:facebook_link,\n \t:car_model,\n \t:license_plate)\n end",
"def filtering_params\n params.permit(:email, :name)\n end",
"def check_params\n true\n end",
"def wx_public_params\n params.require(:wx_public).permit(:nickname, :manager, :alias)\n end",
"def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end",
"def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end",
"def social_account_params\n\t\t\tparams.require(:social_account).permit!\n\t\tend",
"def listing_params\n\t\tparams.permit(:address, :transit_info, :rules, :other_info, :lat, :lng)\n\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 model_params\n\t\tparams.require(:manager).permit(\n\t :user_name,\n :password,\n :email,\n \t\t\t)\n\tend",
"def url_params\n params.require(:url).permit(:short_url, :original_url, :clicks, :ip_addresses)\n end",
"def article_params_whitelist\n params.require(:article).permit(:title, :description, category_ids: [])\n end",
"def college_whitelist_params\n params.require(:college_whitelist).permit(:status)\n end",
"def active_code_params\n params[:active_code].permit\n end",
"def valid_params(params)\n params.permit(:user_id, :photo_id, :originX, :originY, :width, :height)\n end",
"def filtering_params\n params.permit(:email)\n end",
"def ip_address_params\n\t\t\tparams.require(:ip_address).permit!\n end",
"def reserved_params\n params.require(:reserved).permit(:name, :email, :pax, :address, :KTP, :title)\n end",
"def pull_request_params\n whitelist = [\n :url,\n :id,\n :html_url,\n :diff_url,\n :patch_url,\n :issue_url,\n :number,\n :state,\n :locked,\n :title\n ]\n params.require(:pull_request).permit(whitelist)\n end",
"def post_params\n if current_user.admin? \n params.permit(:title, :body, :city, :country, :gps_location, :privacy, :visible, :latitude, :longitude, images: [], files: [])\n else \n params.permit(:title, :body, :city, :country, :gps_location, :privacy,:latitude, :longitude, images: [], files: [])\n end \n end",
"def filter_parameters; end",
"def filter_parameters; end",
"def list_params\n params.permit(:name)\n 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 valid_params(params)\n params.permit(:login, :first_name, :last_name, \n :password, :password_confirmation)\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 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 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.6980629",
"0.67819995",
"0.67467666",
"0.67419875",
"0.67347664",
"0.65928614",
"0.6504013",
"0.6498014",
"0.64819515",
"0.64797956",
"0.64562726",
"0.64400834",
"0.6380117",
"0.6377456",
"0.63656694",
"0.6320543",
"0.63002014",
"0.62997127",
"0.629425",
"0.6293866",
"0.62909746",
"0.62904227",
"0.62837297",
"0.6240993",
"0.6239739",
"0.6217764",
"0.6214983",
"0.62112504",
"0.6194765",
"0.6178",
"0.61755055",
"0.61729854",
"0.61636627",
"0.6153461",
"0.6151674",
"0.61478525",
"0.6122671",
"0.61188513",
"0.61075556",
"0.6105721",
"0.6092412",
"0.6081011",
"0.6071054",
"0.6064436",
"0.6022111",
"0.6018135",
"0.60151577",
"0.60108894",
"0.60070235",
"0.60070235",
"0.6000806",
"0.6000464",
"0.5998811",
"0.59926987",
"0.5992257",
"0.5991173",
"0.5980311",
"0.59660876",
"0.59596545",
"0.5959415",
"0.59589994",
"0.5957478",
"0.5953214",
"0.5952233",
"0.5944033",
"0.59396756",
"0.59396756",
"0.59386414",
"0.59345603",
"0.5931261",
"0.5926345",
"0.5925795",
"0.59174526",
"0.59108645",
"0.5909469",
"0.5908263",
"0.59053195",
"0.58980685",
"0.5897738",
"0.589657",
"0.5895971",
"0.58942044",
"0.5892847",
"0.588742",
"0.58834344",
"0.5880024",
"0.58739793",
"0.5868253",
"0.5867907",
"0.58670515",
"0.58668053",
"0.5865756",
"0.5863549",
"0.5863236",
"0.5862728",
"0.5861283",
"0.58591247",
"0.5855159",
"0.5854291",
"0.58512247",
"0.58498096"
] |
0.0
|
-1
|
Returns all helper classes under the Hyde::Helpers module.
|
def get_helpers
Hyde::Helpers.constants.inject([Hyde::Helpers]) do |a, constant|
mod = Hyde::Helpers.const_get(constant)
a << mod if mod.is_a? Module
a
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def find_app_helper_classes\n klasses = []\n expression = \"#{Jets.root}app/helpers/**/*\"\n Dir.glob(expression).each do |path|\n next unless File.file?(path)\n class_name = path.sub(\"#{Jets.root}app/helpers/\",\"\").sub(/\\.rb/,'')\n unless class_name == \"application_helper\"\n klasses << class_name.classify.constantize # autoload\n end\n end\n klasses\n end",
"def get_helpers\n @helpers\n end",
"def all_application_helpers\n extract = /^#{Regexp.quote(helpers_dir)}\\/?(.*)_helper.rb$/\n Dir[\"#{helpers_dir}/**/*_helper.rb\"].map { |file| file.sub extract, '\\1' }\n end",
"def all_application_helpers\n map = []\n helpers_dirs.each do |helpers_dir|\n extract = /^#{Regexp.quote(helpers_dir)}\\/?(.*)_helper.rb$/\n map += Dir[\"#{helpers_dir}/**/*_helper.rb\"].map { |file| file.sub extract, '\\1' }\n end\n map\n end",
"def __list_helper_methods\n # avoiding '__self__' and '__id__' symbols with last regex part\n methods.grep(/^#{@@helper_start_with}.*?[^__]$/) do |method|\n method.to_s\n end\n end",
"def helpers\n Blush.helpers\n end",
"def all_application_helpers\n all_helpers_from_path(helpers_path)\n end",
"def use_class_helpers!\n self.class.class_helpers.each { |helper| use helper }\n end",
"def adapter_helpers(adapter)\n adapter.class.ancestors.each_with_object([]) do |klass, ret|\n next unless klass.is_a?(Class)\n next unless klass.const_defined?(HELPERS_MODULE_NAME)\n ret.unshift klass.const_get(HELPERS_MODULE_NAME)\n end\n end",
"def extract_helper_methods\n @helper_methods ||= __list_helper_methods\n @check_methods ||= __list_check_methods\n end",
"def helpers\r\n Helper.instance\r\n end",
"def helpers\n Helper.instance\n end",
"def helpers_paths; end",
"def helpers_paths; end",
"def helpers_paths; end",
"def helpers_paths; end",
"def modules_for_helpers(modules_or_helper_prefixes); end",
"def mounted_helpers\n MountedHelpers\n end",
"def load_helpers\n paths = Dir.glob @site.helpers_path.join(\"**.rb\")\n HelperLoader.new(paths: paths).extend_instance(self)\n end",
"def helpers(&block)\n mod = (const_get(:Helpers) rescue const_set(:Helpers, Module.new))\n mod.module_eval(&block) if block_given?\n mod\n end",
"def helper_module(object)\n (object.class.name + 'Helper').constantize\n end",
"def helpers\n ActionController::Base.helpers\n end",
"def helpers(helper_name)\r\n extend _package_.load_helper(helper_name)\r\n end",
"def define_helpers; end",
"def boring_classes\n return [::Class, *::Class.included_modules,\n ::Module, *::Module.included_modules,\n ::Kernel, *::Kernel.included_modules,\n ::Object, *::Object.included_modules,\n ::BasicObject, *::BasicObject.included_modules].uniq\n end",
"def helpers\n unless @helper_proxy\n @helper_proxy = ActionView::Base.new\n @helper_proxy.extend master_helper_module\n else\n @helper_proxy\n end\n end",
"def all_application_helpers; end",
"def helper(helper_module)\n (config.app.helpers << helper_module).uniq!\n end",
"def modules_for_helpers(args)\n args.flatten.map! do |arg|\n case arg\n when String, Symbol\n file_name = \"#{arg.to_s.underscore}_helper\"\n begin\n require_dependency(file_name)\n rescue LoadError => e\n raise AbstractController::Helpers::MissingHelperError.new(e, file_name)\n end\n\n mod_name = file_name.camelize\n begin\n mod_name.constantize\n rescue LoadError\n # dependencies.rb gives a similar error message but its wording is\n # not as clear because it mentions autoloading. To the user all it\n # matters is that a helper module couldn't be loaded, autoloading\n # is an internal mechanism that should not leak.\n raise NameError, \"Couldn't find #{mod_name}, expected it to be defined in helpers/#{file_name}.rb\"\n end\n when Module\n arg\n else\n raise ArgumentError, \"helper must be a String, Symbol, or Module\"\n end\n end\n end",
"def clear_helpers\n inherited_helper_methods = _helper_methods\n self._helpers = Module.new\n self._helper_methods = Array.new\n\n inherited_helper_methods.each { |meth| helper_method meth }\n default_helper_module! unless anonymous?\n end",
"def helpers\n unless @helper_proxy\n @helper_proxy = Engine::View::Base.new(self)\n @helper_proxy.extend master_helper_module\n else\n @helper_proxy\n end\n end",
"def helpers\n ApplicationController.helpers\n end",
"def helpers\n ApplicationController.helpers\n end",
"def load_helpers\n load_glob File.join(File.dirname(__FILE__), 'helpers', '*.rb')\n end",
"def helpers\n ActionController::Base.helpers # you can also try @template.helpers OR self.class.helpers OR include ActionView::Helpers\n end",
"def helpers\n dsl.helpers\n end",
"def include_helpers(scope)\n ActiveSupport.on_load(:action_controller) do\n include scope::Helpers if defined?(scope::Helpers)\n #include scope::UrlHelpers\n end\n\n ActiveSupport.on_load(:action_view) do\n include scope::ViewHelpers\n end\n end",
"def helper_files\n glob = File.join(config[:test_base_path], 'helpers', '*/**/*')\n Dir.glob(glob).reject { |f| File.directory?(f) }\n end",
"def helpers\n ActionController::Base.helpers\n end",
"def helpers\n ActionController::Base.helpers\n end",
"def helpers(&block)\n Helpers.class_eval(&block)\n end",
"def mounted_helpers; end",
"def classes_and_modules\n classes + modules\n end",
"def classes_and_modules\n classes + modules\n end",
"def app_helpers\n @app_helpers ||= Class.new do\n include Rails.application.routes.url_helpers\n include ::ApplicationHelper\n end.new\n end",
"def global_helpers_dependency_tree\n @global_helpers_dependency_tree ||= begin\n classes = Curlybars.configuration.global_helpers_provider_classes\n classes.map(&:dependency_tree).inject({}, :merge)\n end\n end",
"def derive_default_helpers(options)\n []\n end",
"def helper(*klazzes)\n klazzes.each { |klazz| self.class.send(:include, klazz) }\n end",
"def helper\n @helper ||= ApplicationController.helpers\n end",
"def helper_files\n glob = File.join(\"helpers\", \"*/**/*\")\n Util.safe_glob(config[:test_base_path], glob).reject { |f| File.directory?(f) }\n end",
"def helpers(*extensions, &block)\n self.class.helpers(*extensions, &block)\n end",
"def load_helpers\n @helpers_loaded ||= helper_loader.load_helpers\n end",
"def include_helpers_in_class(view_klass)\n view_klass.send(:include, self.class.master_helper_module)\n end",
"def include_helpers_in_class(view_klass)\n view_klass.send(:include, self.class.master_helper_module)\n end",
"def include_helpers_in_class(view_klass)\n view_klass.send(:include, self.class.master_helper_module)\n end",
"def include_helpers_in_class(view_klass)\n view_klass.send(:include, self.class.master_helper_module)\n end",
"def modules_for_helpers(args)\n args += all_application_helpers if args.delete(:all)\n super(args)\n end",
"def helpers\n ActionController::Base.helpers\nend",
"def helpers; end",
"def helpers; end",
"def helpers; end",
"def helpers_require\n ruby_file_path @api, \"#{service_name_full}::Helpers\"\n end",
"def load_helpers(helper_path = nil)\n helper_path ||= HSS::DEFAULT_LIB\n helper_path = File.expand_path(helper_path)\n Dir.glob(File.join(helper_path, '*')).sort.each do |helper|\n require helper\n @helpers << helper\n rescue LoadError, SyntaxError\n raise LoadError, \"Failed to load helper: #{helper}\"\n end\n end",
"def helper(*helpers)\r\n helper_object.extend *helpers\r\n end",
"def include_helpers(scope); end",
"def helper(*mods, &block)\n helpers.concat mods\n helpers << Module.new.tap { |mod| mod.class_eval(&block) } if block\n end",
"def helper( *modules )\n machine.helper *modules\n end",
"def helper\n @helper ||= Helpers.new\n end",
"def helper_files\n glob = Dir.glob(File.join(test_folder, \"helpers\", \"*/**/*\"))\n glob.reject { |f| File.directory?(f) }\n end",
"def sinatra_helpers\n @sinatra_helpers ||= []\n end",
"def modules_for_helpers(args); end",
"def clear_helpers; end",
"def helper\n @helper\n end",
"def helper\n @helper\n end",
"def helper_class\n @helper_class ||= \"spree/uploader/helpers/#{mime_types[file_mime_type]}\".classify.constantize\n end",
"def path_helpers_module; end",
"def install_helpers # :nodoc:\n mod = @module\n ActionView::Base.class_eval do\n include mod\n end\n end",
"def regenerate_helpers!; end",
"def helper_path\n @helper_path ||= File.join(Mutton.template_path, 'helpers')\n end",
"def application_helpers\n copy_file \"app/helpers/layout_helper.rb\"\n copy_file \"app/helpers/retina_image_helper.rb\"\n copy_file \"app/helpers/meta_tag_helper.rb\"\nend",
"def form_helpers\n ::RPH::FormAssistant::FORM_HELPERS\n end",
"def faker_modules\n FFaker\n .constants\n .reject { |const| UTILS_MODULES.include?(const) }\n .select { |const| FFaker.const_get(const).instance_of?(Module) }\n .sort\n .map { |const| FFaker.const_get(const) }\nend",
"def helper\n unless @helper\n @helper = Object.new\n @helper.extend ActionView::Helpers::TextHelper # for truncate\n @helper.extend ActionView::Helpers::OutputSafetyHelper # for safe_join\n end\n return @helper\n end",
"def helpers_including_recipes(included_recipes)\n @known_helpers_including_recipes.merge!(included_recipes)\n end",
"def libraries\n modules = YARD::Registry.all(:module)\n classes = YARD::Registry.all(:class)\n root_definitions = YARD::Registry.all(:method).select { |m| m.path =~ /^root#/ }\n\n classes + modules + root_definitions\n end",
"def helper *helpers, &proc\n helpers.each { |h| @helpers[h] = proc }\n self\n end",
"def load_helper( helper_dir )\n Dir.foreach(helper_dir) do |helper_file|\n unless helper_file =~ /^(#{design_id}_helper).rb$/ or helper_file =~ /^(base_helper).rb$/\n next\n end\n Ziya.logger.info( \">>> ZiYa loading custom helper `#{$1}\" )\n # BOZO !! This will only work in rails ??\n if defined? RAILS_ROOT\n require_dependency File.join(helper_dir, $1) \n else\n require File.join(helper_dir, $1)\n end\n helper_module_name = \"Ziya::\" + $1.gsub(/(^|_)(.)/) { $2.upcase } \n # helper_module_name = $1.to_s.gsub(/\\/(.?)/) { \"::\" + $1.upcase }.gsub(/(^|_)(.)/) { $2.upcase }\n Ziya.logger.debug( \"Include module #{helper_module_name}\")\n Ziya::Gauges::Base.class_eval(\"include #{helper_module_name}\") \n true\n end\n false\n end",
"def helpers(*mods, type: nil, &blk)\n new_helpers = []\n # loop over the list of arguments, making sure they're all modules, and\n # then add them to the list of new helpers\n mods.each do |mod|\n unless mod.is_a?(Module)\n raise ArgumentError, 'Helpers must be defined in a module or block'\n end\n\n new_helpers << mod\n end\n # if block is given, turn it into a module and add it to the helpers list\n new_helpers << Module.new(&blk) if blk\n\n if new_helpers.present?\n # extend the current Config instance with the helpers, making them available\n # to the rest of the configuration block\n extend(*new_helpers.reverse) if type.nil? || type.to_sym == :config\n # add our new helpers to our array of all helpers\n @helper_modules += new_helpers if type.nil? || type.to_sym == :template\n end\n\n self\n end",
"def included_methods\n included_modules.map(&:instance_methods).flatten\n end",
"def helper_loader\n @helper_loader ||= NagiosHerald::HelperLoader.new\n end",
"def prepare_helpers\n base = File.join(config[:test_base_path], \"helpers\")\n\n helper_files.each do |src|\n dest = File.join(sandbox_suites_dir, src.sub(\"#{base}/\", \"\"))\n FileUtils.mkdir_p(File.dirname(dest))\n FileUtils.cp(src, dest, preserve: true)\n end\n end",
"def all_classes_and_modules\n result = []\n ObjectSpace.each_object(Module) { |m| result << m }\n result.sort_by {|m| m.name}\nend",
"def dsl_methods\n (Chef::Node.public_instance_methods +\n Chef::Mixin::RecipeDefinitionDSLCore.included_modules.map{|mixin| mixin.public_instance_methods}).flatten.sort.uniq\n end",
"def helpers\n @_helper_proxy ||= view_context\n end",
"def get_helper(name)\n @helpers[name] ||= load_helper(name)\n end",
"def scope_helper(*helpers)\n helpers.each do |helper|\n raise 'scope_helper should be a Module' unless helper.instance_of? Module\n @scope_helpers << helper\n end\n end",
"def uses(*classes)\n class_helpers.push(*classes).uniq!\n end",
"def classes\n @classes\n end",
"def build_and_install_helpers_for_resource(resource) # :nodoc:\n build_index_helper(resource)\n build_search_helper(resource)\n build_show_helper(resource)\n build_new_helper(resource)\n build_edit_helper(resource)\n build_destroy_helper(resource)\n build_list_helpers(resource)\n build_table_helpers(resource)\n build_create_helper(resource)\n build_update_helper(resource)\n memorize_helpers(resource)\n install_helpers\n end",
"def helpers &blk\n @helpers = blk\n end"
] |
[
"0.8000439",
"0.7471334",
"0.7220933",
"0.71666306",
"0.7035728",
"0.6984757",
"0.6959735",
"0.6859301",
"0.67870086",
"0.67782754",
"0.6773248",
"0.6769744",
"0.6736882",
"0.6736882",
"0.6736882",
"0.6736882",
"0.6625418",
"0.6603668",
"0.6567974",
"0.65569323",
"0.65351605",
"0.65066916",
"0.6466973",
"0.6443344",
"0.6404536",
"0.638407",
"0.63592744",
"0.63585055",
"0.63569903",
"0.6346952",
"0.6323413",
"0.6237702",
"0.6237702",
"0.6219483",
"0.62139606",
"0.621093",
"0.6205675",
"0.61942095",
"0.61928034",
"0.61928034",
"0.61701524",
"0.61629164",
"0.61607623",
"0.61607623",
"0.61580485",
"0.6153144",
"0.6148739",
"0.61420506",
"0.6131262",
"0.6123538",
"0.6121975",
"0.610996",
"0.60906464",
"0.60906464",
"0.60906464",
"0.60906464",
"0.6070303",
"0.60425234",
"0.60364723",
"0.60364723",
"0.60364723",
"0.6009672",
"0.5982904",
"0.59796923",
"0.59660983",
"0.5959215",
"0.5955673",
"0.5924063",
"0.59013593",
"0.58900064",
"0.58812606",
"0.5872483",
"0.58653504",
"0.58653504",
"0.5831376",
"0.5808722",
"0.57390326",
"0.5723472",
"0.57135296",
"0.5694693",
"0.56737393",
"0.56657326",
"0.5637022",
"0.5635431",
"0.56141233",
"0.55682033",
"0.55617654",
"0.55527174",
"0.5530337",
"0.5528339",
"0.55241823",
"0.5519323",
"0.54788715",
"0.5472528",
"0.5461304",
"0.5459777",
"0.54587233",
"0.54560155",
"0.5445648",
"0.54334515"
] |
0.8618396
|
0
|
Add an other attribute to the class list
|
def eav_attribute name, type = String
name = name.to_s if !name.is_a? String
self.class_eav_attributes[name] = type
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def add_class(current_attributes, new_attributes)\n current_attributes ||= ''\n current_attributes.split(' ').push(new_attributes).join(' ')\n end",
"def append_class! klass\n return if already_marked? klass\n if has_class_attribute?\n add_class_to_attribute klass\n else\n add_class_and_attribute klass\n end\n end",
"def insert_attribute m\n @attributes.add m\n end",
"def attribute(*args)\n @attributes = attributes\n @attributes += args\n @attributes.uniq!\n end",
"def add_attribute(name, &block); end",
"def lively_attributes(*args)\n self._active_attributes += args.collect(&:to_s)\n end",
"def + (name, value = nil, &block) add_attribute name, value, &block end",
"def decorate(klass, *attributes, **set_options)\n attributes.flatten.each do |attribute|\n decorable[klass] << attribute.to_s\n options[klass][attribute.to_s] = set_options.deep_dup\n end\n end",
"def add_class class_name\n each do |el|\n next unless el.respond_to? :get_attribute\n classes = el.get_attribute('class').to_s.split(\" \")\n el.set_attribute('class', classes.push(class_name).uniq.join(\" \"))\n end\n self\n end",
"def add_class c\n each do |q|\n str = q.get_attribute(\"class\")\n\n if str.empty?\n str = c.to_s\n else\n str = str+\" #{c}\"\n end\n \n q.set_attribute(\"class\",str)\n end\n end",
"def method_missing (name, *args, &block)\n add_attribute(name, *args, &block)\n end",
"def method_missing (name, *args, &block)\n add_attribute(name, *args, &block)\n end",
"def method_missing (name, *args, &block)\n add_attribute(name, *args, &block)\n end",
"def add_attributes(item)\n [:class, :instance].each do |attr_loc|\n # Grab attributes for the current location (class or instance)\n attrs = item.attributes[attr_loc]\n attrs.each do |name, attribute|\n reader = attribute[:read]\n writer = attribute[:write]\n\n unless reader || writer\n Logging.warn(\"attribute is not readable or writable somehow, skipping\", attribute)\n next\n end\n\n # Get all given types\n yard_types = []\n if reader\n next if @hide_private && reader.visibility == :private\n yard_types += reader.tags('return').flat_map(&:types).compact.reject { |x| x.downcase == 'void' } +\n reader.tags('param').flat_map(&:types)\n end\n if writer\n next if @hide_private && writer.visibility == :private\n yard_types += writer.tags('return').flat_map(&:types).compact.reject { |x| x.downcase == 'void' } +\n writer.tags('param').flat_map(&:types)\n end\n\n # Use untyped if not types specified anywhere, otherwise try to\n # compute Parlour type given all these types\n if yard_types.empty?\n Logging.omit(\"no YARD type given for #{name.inspect}, using untyped\", reader || writer)\n parlour_type = Parlour::Types::Untyped.new\n elsif yard_types.all? { |x| x == 'nil' }\n # Nil attributes are extremely unusual, so just use untyped\n parlour_type = Parlour::Types::Untyped.new\n else\n parlour_type = TypeConverter.yard_to_parlour(\n yard_types, reader || writer, @type_converter_config)\n end\n\n # Generate attribute\n if reader && writer\n kind = :accessor\n elsif reader\n kind = :reader\n elsif writer\n kind = :writer\n end\n\n if @exclude_untyped && parlour_type.is_a?(Parlour::Types::Untyped)\n Logging.omit(\"excluding untyped attribute\", reader || writer, immediate: true)\n next\n end\n\n case @mode\n when :rbi\n @current_object.create_attribute(\n name.to_s,\n kind: kind,\n type: parlour_type,\n class_attribute: (attr_loc == :class)\n ) do |m|\n add_comments(reader || writer, m)\n end\n when :rbs\n if attr_loc == :class\n # RBS doesn't support class attr_accessors so create individual methods\n\n if reader\n @current_object.create_method(\n name.to_s,\n [Parlour::RbsGenerator::MethodSignature.new([], parlour_type)],\n class_method: true\n ) do |m|\n add_comments(reader, m)\n end\n end\n\n if writer\n @current_object.create_method(\n \"#{name}=\",\n [Parlour::RbsGenerator::MethodSignature.new([Parlour::RbsGenerator::Parameter.new(\n \"value\",\n type: parlour_type,\n required: true\n )], parlour_type)],\n class_method: true\n ) do |m|\n add_comments(writer, m)\n end\n end\n else\n @current_object.create_attribute(\n name.to_s,\n kind: kind,\n type: parlour_type,\n ) do |m|\n add_comments(reader || writer, m)\n end\n end\n end\n end\n end\n end",
"def attr_writer(*vars)\n # avoid tracking attributes that are added by the class_attribute\n # as these are class attributes and not instance attributes.\n tracked_vars = vars.reject {|var| respond_to? var }\n add_tracked_attrs(false, true, *tracked_vars)\n vars.extract_options!\n super\n end",
"def copy_attrs(other)\n (ActsAsArtifact::ARTIFACT_ATTRIBUTES + [:name, :requirement]).each do |attr|\n value = other.instance_variable_get(\"@#{attr}\")\n value = value.dup if value && !value.kind_of?(Numeric) && !value.kind_of?(Symbol)\n instance_variable_set(\"@#{attr}\", value)\n end\n end",
"def add_checked_attribute(clazz, attribute)\r\n eval <<END\r\n class #{clazz}\r\n\r\n def #{attribute}=(value)\r\n raise 'Invalid attribute' unless value\r\n @#{attribute}=value\r\n end\r\n\r\n def #{attribute}\r\n #{attribute}\r\n end\r\n end\r\nEND\r\nend",
"def add_additional_attributes\n\n\t\t#gets an array of scraped attributes from the Scraper Class method #scrape_specific_concert\n\t\tattribute_array = SfBayAreaConcertsCliApp::Scraper.scrape_specific_concert(self.url)\n\t\n\t\t#assigns the attributes to the concert instance based on the array index\n\t\tself.ticket_price = attribute_array[0]\n\t\tself.bio = attribute_array[1]\n\t\tself.artist_website = attribute_array[2]\n\t\tself.where_to_find_music = attribute_array[3]\n\t\tself.facebook = attribute_array[4]\n\t\tself.twitter = attribute_array[5]\n\t\tself.instagram = attribute_array[6]\n\t\tself.youtube = attribute_array[7]\n\t\tself.buy_tickets_link = attribute_array[8]\n\t\t\n\tend",
"def add_attribute(attribute)\n @attributes << attribute\n end",
"def add_state_attr(attr)\n new_attrs = (self.class.state_attrs << attr).uniq\n self.class.state_attrs(*new_attrs)\n end",
"def install_attr(attr)\n #Add reader/writer\n inner = code_attr(attr)\n estr = \"class Qml::#{@class}\\n #{inner}\\n end\"\n eval(estr, nil, attr.file, attr.line)\n @cache_load << [:accessor, @class, inner]\n\n name = attr[2]\n\n if(!Special.include? name)\n @init += \"Qml::prop_add(self, #{name.inspect})\\n\"\n end\n end",
"def add(attribute, value)\n update(attribute => public_send(attribute).dup << value)\n end",
"def append_class(name); end",
"def append_class(name); end",
"def attribute(*args, **opt)\n add_single_property(*args, **opt)\n end",
"def add_attr(name, value)\n attr_name = ActiveSupport::Inflector.underscore(name).to_sym\n\n if @attrs.key?(attr_name)\n if @attrs[attr_name].is_a?(Array)\n # An existing array value means just push the new value onto\n # the array.\n @attrs[attr_name].push(value)\n else\n # An existing, non-array value means we must convert the existing\n # value into an array and then push the new value onto it.\n existing_scalar_value = @attrs[attr_name]\n @attrs[attr_name] = [existing_scalar_value, value]\n end\n else\n # If no existing value, then just set the value.\n @attrs[attr_name] = value\n end\n end",
"def attribute(name, *args, **opt)\n add_single_property(name, *args, **opt)\n end",
"def attribute_definition(class_def)\n\n\n\n \t attribute = AttributeDefinition.new\n \t attributes = []\n\n\n # 75:5: modifier[attribute] type[attribute] attributes_list[attribute, attributes] ';'\n modifier(attribute)\n\n type(attribute)\n\n attributes_list(attribute, attributes)\n\n match(:SEMICOLON)\n\n attributes.each do |attribute|\n class_def.add_member(attribute)\n end\n \n\n\n\n end",
"def add_attribute(attr)\n C.LLVMAddAttribute(self, attr)\n end",
"def attr_writer(sym, *more) end",
"def class_attribute(*attributes)\n attributes.each do |attr|\n singleton_class.class_eval %(\n def #{attr} # def foo\n class_attributes[:#{attr}] # class_attributes[:foo]\n end # end\n #\n def #{attr}=(value) # def foo=(value)\n class_attributes[:#{attr}] = value # class_attributes[:foo] = value\n end # end\n ), __FILE__, __LINE__ - 8\n end\n end",
"def attr_reader(*args)\n super\n comparison_attrs.concat(args)\n end",
"def method_missing(meth, *args, &blk)\n if args.length > 0\n self.class.add_custom_attribute meth\n send meth, *args, &blk\n else\n super meth, *args, &blk\n end\n end",
"def append_attribute(key_, value_)\n attribute(key_, value_, :append)\n end",
"def class_attributes; end",
"def appendAttr(k,v)\n\t\told = @attributes[k]\n\t\tif old && @multiple.include?(k)\n\t\t\tv = \"#{old} #{v}\"\n\t\tend\n\t\t@attributes[k] = v\n\t\tself\n\tend",
"def append_class_name(original_value, new_value)\n (original_value || \"\") << \" #{new_value}\"\n end",
"def set_attribute(name, value); end",
"def attribute(opts)\n raise ArgumentError unless opts.is_a?(Hash)\n @attributes << Attribute.new(opts)\n end",
"def on_sentiment(attr)\n @attributes << attr\n end",
"def combine(name, attribute)\n attribute.name = name\n\n children << attribute\n end",
"def add_class(name); end",
"def add_class(name); end",
"def merge_attributes(new_attributes)\n new_attributes = new_attributes.current_attributes if new_attributes.is_a?(Attributable)\n\n new_attributes.deep_symbolize_keys!\n\n raise AttributeError, 'No attributes exist. Have you defined any for this class?' if attributes.nil?\n\n extraneous_attrs = []\n\n new_attributes.each do |new_attribute, value|\n if attributes.has_key?(new_attribute)\n public_send(\"#{new_attribute}=\", value)\n else\n extraneous_attrs << new_attribute\n end\n end\n\n warn \"skipping attribute(s) `#{extraneous_attrs.join(',')}` for #{self.class} as they are not specified for this class.\" if extraneous_attrs.any?\n end",
"def attr_list\n\t\ta_list \n\tend",
"def attr(name); end",
"def <<(attribute)\n @allowed_attributes[attribute.name.downcase] = attribute\n end",
"def assign name, a = nil\n\t\t\tinit_classlist\n\t\t\tif a == nil\n\t\t\t\ta = name \n\t\t\t\tname = a.shift # drop name from list\n\t\t\tend\n\t\t\t@cf.classlist.add(name,a)\n\t\tend",
"def add_attribute(id, *attr)\n\t\t\t@current_context.add_attribute(id, *attr)\n\t\tend",
"def update_attr_with_ial(attr, ial)\n ial[:refs]&.each do |ref|\n update_attr_with_ial(attr, ref) if (ref = @alds[ref])\n end\n ial.each do |k, v|\n if k == IAL_CLASS_ATTR\n attr[k] = \"#{attr[k]} #{v}\".lstrip\n elsif k.kind_of?(String)\n attr[k] = v\n end\n end\n end",
"def add_attribute(name, definition)\n @attributes << Attribute.new(name, definition)\n end",
"def attribute(name)\n attributes << name\n\n if !method_defined?(name) || name == :id\n attr_accessor name\n end\n end",
"def attribute name, *attr\n\n # Add the attribute\n _attr = AttributeDefinition.new( name, *attr )\n attribute_definitions << _attr\n\n # Inject object with getter and setter for attribute\n define_setter_and_getter(name, _attr)\n end",
"def tributes *attrs\n if attrs.empty? \n @tributes ||= []\n else \n @tributes = attrs\n super *attrs\n end \n end",
"def decorate!(klass, *attributes, **options)\n decorate(klass, *attributes, **options)\n attributes.flatten.map do |attribute|\n type = klass.attribute_types[attribute.to_s]\n lookup(type, klass, attribute.to_s)\n end\n end",
"def acts_as_list(attr = :position)\n @_list_attribute_name = attr\n\n @generated_accessor_module.module_eval do\n define_method('_list_attribute') do\n model.public_send(attr)\n end\n\n define_method('_list_attribute=') do |x|\n model.public_send(:\"#{attr}=\", x)\n end\n end\n end",
"def add_attribute attribute\n return attribute unless @document_self\n\n # mainly to check for redefinition of an attribute as a method\n # TODO find a policy for 'attr_reader :foo' + 'def foo=()'\n register = false\n\n key = nil\n\n if attribute.rw.index 'R' then\n key = attribute.pretty_name\n known = @methods_hash[key]\n\n if known then\n known.comment = attribute.comment if known.comment.empty?\n elsif registered = @methods_hash[attribute.pretty_name + '='] and\n RDoc::Attr === registered then\n registered.rw = 'RW'\n else\n @methods_hash[key] = attribute\n register = true\n end\n end\n\n if attribute.rw.index 'W' then\n key = attribute.pretty_name + '='\n known = @methods_hash[key]\n\n if known then\n known.comment = attribute.comment if known.comment.empty?\n elsif registered = @methods_hash[attribute.pretty_name] and\n RDoc::Attr === registered then\n registered.rw = 'RW'\n else\n @methods_hash[key] = attribute\n register = true\n end\n end\n\n if register then\n attribute.visibility = @visibility\n add_to @attributes, attribute\n resolve_aliases attribute\n end\n\n attribute\n end",
"def add_checked_attribute(klass, attribute)\n klass.class_eval do\n define_method attribute do\n instance_variable_get(\"@#{attribute}\")\n end\n\n define_method \"#{attribute}=\" do |value|\n raise 'Invalid attribute' unless value\n \n instance_variable_set(\"@#{attribute}\", value)\n end\n end\nend",
"def attribute(name)\n @attribute_names << name\n attr_reader(name)\n end",
"def setup_attribute_type(klass)\n klass.schema.each do |attr, config|\n klass._attribute_types[attr] = self.setup_layer_type(klass, config.split(/[|]/), 0)\n end\n end",
"def attribute(name); end",
"def other_attrs\n @other_attrs ||= {}\n end",
"def add_property(name)\n Compass::Configuration::ATTRIBUTES.push(name)\n inherited_accessor(name)\n end",
"def add_attribute_to_type\n check_type_exists\n type_content = File.read(type_path)\n unless parameter_in_type?(type_content)\n type_content.sub!(END_PARAMETER_BLOCK,\"\\t\\t#{@attribute_type} :#{@attribute_name}\\n#{END_PARAMETER_TEXT}\")\n save_file(type_path, type_content)\n Puppet.notice \"#{@attribute_type.capitalize} #{@attribute_name} added to #{type_path}\"\n else\n Puppet.notice \"#{@attribute_type.capitalize} #{@attribute_name} already in #{type_path}\"\n end\n end",
"def extend_other(other)\n other.extend(Hash[removed_attributes.zip])\n end",
"def set_attribute(a,b)\n write_attribute(a,b)\n end",
"def add_attrs\n yield self\n end",
"def process_attrasgn exp\n exp = exp.dup\n exp.target = process exp.target\n exp.arglist = process exp.arglist\n exp\n end",
"def add_attrs(h)\n @app.log << \"add_attrs #{h.inspect[1..-2]}\"\n @app.add_attrs(h)\nend",
"def new_attribute(name, type)\n attributes[name] = type\n define_attr_reader(name)\n define_attr_writer(name, type)\n name\n end",
"def register_attributes\n raise \"Not implemented in #{self.class}\"\n end",
"def update_class_list_variable(element)\n element.children.each do |child_elem|\n elem_name = child_elem.name.to_sym\n next unless self.class.constants.include?(elem_name)\n\n # Ex. Ekispert::DataVersion.new(child_elem)\n sub_instance = self.class.const_get(elem_name).new(child_elem)\n class_list_name = \"#{snakecase(elem_name)}_list\"\n # Ex. sub_instance.version_list << sub_instance\n self.send(class_list_name) << sub_instance\n end\n end",
"def add_attribute attribute\n @display.print_attribute attribute\n end",
"def attr_class_accessor(*args)\n\t\targs.each{|arg|\n\t\t\tclass_eval %(\n\t\t\t\tdef #{arg}; self.class.#{arg}; end\n\t\t\t\tdef #{arg}=(v); self.class.#{arg} = v; end\n\t\t\t)\n\t\t}\n\tend",
"def attribute=(_arg0); end",
"def attribute=(_arg0); end",
"def create_attributes(klass, members); end",
"def attr_set_ub2(attr_type, attr_value)\n #This is a stub, used for indexing\n end",
"def attribute_to_set; end",
"def additional_attributes=(input)\n @additional_attributes = Array(input).map do |attribute_name|\n ADDITIONAL_ATTRIBUTE_MAP.fetch(attribute_name)\n end\n end",
"def on_property(attr)\n @attributes << attr\n\n @buffer_targets = true\n end",
"def attr; end",
"def preloadable_attribute(*args)\n args.each do |arg|\n @@preloadable_attributes ||= []\n @@preloadable_attributes << arg\n define_method(arg.to_sym) do |*args|\n preload\n super(*args)\n end\n define_method(\"#{arg}=\".to_sym) do |*args|\n preload\n super(*args)\n end\n end\n end",
"def add_class(new_class)\n @classes << new_class\n end",
"def update_attr_with_ial(attr, ial); end",
"def file_list_attr_writer(*names)\n names.each do |name|\n class_eval <<-end_ruby\n undef #{name}=\n def #{name}=(value) \n value = FileList[value.to_str] if value.respond_to?(:to_str)\n @#{name} = value\n end\n end_ruby\n end\n end",
"def serialize\n super(ATTR_NAME_ARY)\n end",
"def serialize\n super(ATTR_NAME_ARY)\n end",
"def serialize\n super(ATTR_NAME_ARY)\n end",
"def serialize\n super(ATTR_NAME_ARY)\n end",
"def serialize\n super(ATTR_NAME_ARY)\n end",
"def add_attrs(*args)\n if args.is_a? Array and args.length == 1\n args.first.gsub(/[-.,]/, '').split.each do |s|\n name, field_type = s.split(\":\")\n add_attr(name, field_type)\n end\n end\n end",
"def assoc_attr\n return @assoc_attr if @assoc_attr\n\n aa = list_class.attribute_names.select { |a| a.end_with?('_id') }\n aa -= %w[id master_id record_id user_id]\n @assoc_attr = aa.first\n end",
"def update(original, attr_name, value)\n instance_variable_set(:\"@#{attr_name}\", value) if original.class.identifier_names.include?(attr_name)\n end",
"def ext_attr\n attribute_prop(10)\n end",
"def setDirectConfAttrList(klass = self.class())\n setDirectConfAttrList(klass.superclass()) if(klass != WithConfParam) ;\n if(klass.const_defined?(:DirectConfAttrList)) then\n setDirectConfAttr(klass::DirectConfAttrList) ;\n end\n end",
"def update_attrs(hashit)\n hashit.instance_variables.each do |name|\n singleton_class.class_eval {attr_accessor \"#{name[1..-1]}\"} #remove leading @ from varname\n send(\"#{name[1..-1]}=\", hashit.instance_variable_get(name))\n end\n end",
"def serializable_attr_accessor(*syms)\n attr_accessor(*syms)\n attribute_keys.push(*syms)\n end",
"def attribute_list(el); end",
"def a_plusieurs( klass, *args )\n DBC.require( klass.class == Class,\n \"*** L'argument a a_plusieurs doit etre une classe:\n klass = #{klass} (.class = #{klass.class}) \" )\n\n association = (klass.to_s.downcase + \"s\").to_sym\n\n definir_reader_et_writer( association )\n set_attribut association, args\n\n # Validation: doit avoir un ou plusieurs elements et etre de la bonne classe.\n @validations[association] = lambda do\n (a = get_attribut association) &&\n a.size >= 1 &&\n a.all? { |x| x.kind_of? klass }\n end\n\n self\n end",
"def add_special(pattern, name)\n @attribute_manager.add_special(pattern, name)\n end"
] |
[
"0.65757895",
"0.64962447",
"0.64871544",
"0.6478442",
"0.6456498",
"0.6345784",
"0.61744887",
"0.60497695",
"0.6031806",
"0.59720886",
"0.5936943",
"0.5936943",
"0.5936943",
"0.591825",
"0.5908023",
"0.5903104",
"0.5894154",
"0.5884344",
"0.5871898",
"0.5870103",
"0.5865091",
"0.5863189",
"0.5862759",
"0.5862759",
"0.5853935",
"0.5815542",
"0.5811641",
"0.5796408",
"0.5784908",
"0.57612103",
"0.57087874",
"0.5695117",
"0.56901103",
"0.5684515",
"0.5681337",
"0.56764793",
"0.56483424",
"0.56407297",
"0.5637824",
"0.56372",
"0.5636673",
"0.5634784",
"0.5634784",
"0.5624611",
"0.56127447",
"0.56105715",
"0.5604887",
"0.5596884",
"0.55965257",
"0.5594705",
"0.55894345",
"0.55850405",
"0.5571528",
"0.5569583",
"0.5566909",
"0.5566754",
"0.5561029",
"0.5555609",
"0.5545757",
"0.55351686",
"0.54888535",
"0.54846394",
"0.5483359",
"0.5482962",
"0.5482842",
"0.5479092",
"0.5461934",
"0.5447366",
"0.54282874",
"0.5425234",
"0.5410898",
"0.5397632",
"0.5395448",
"0.53856075",
"0.5384543",
"0.5384543",
"0.5366671",
"0.53583854",
"0.5353779",
"0.53450716",
"0.5338596",
"0.5329413",
"0.5327777",
"0.5323383",
"0.53129125",
"0.5310201",
"0.5297042",
"0.5297042",
"0.5297042",
"0.5297042",
"0.5297042",
"0.5291458",
"0.5285912",
"0.5285177",
"0.5273758",
"0.52608293",
"0.52494323",
"0.52409875",
"0.52395505",
"0.52373075",
"0.52309865"
] |
0.0
|
-1
|
class accessor when the superclass != AR::Base asume we are in STI mode
|
def class_eav_attributes # :nodoc:
if superclass != ActiveRecord::Base
if superclass.class_eav_attributes.nil?
@eav_attributes
else
@eav_attributes.nil? ? superclass.class_eav_attributes : superclass.class_eav_attributes.merge(@eav_attributes)
end
else
@eav_attributes
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def base_class\n S::Model\n end",
"def subclass_from_attributes(attrs)\n active_authorizer[:default].deny?(inheritance_column) ? nil : super\n end",
"def subclass_from_attrs(attrs)\n active_authorizer[:default].deny?(inheritance_column) ? nil : super\n end",
"def super_class; end",
"def super_class; end",
"def inherited(subclass)\n super\n sk = sti_key\n sd = sti_dataset\n sdr = sti_dataset_root\n skm = sti_key_map\n smm = sti_model_map\n key = skm[subclass]\n ska = [key].reject { |k| k.blank? }\n subclass.instance_eval do\n @sti_key = sk\n @sti_key_array = ska\n @sti_subclasses_array = [skm[subclass]]\n @sti_dataset = sd\n @sti_key_map = skm\n @sti_model_map = smm\n @simple_table = nil\n @sti_dataset_root = sdr\n end\n sti_subclass_added(key, subclass)\n end",
"def inherited(subclass); end",
"def model\n if object[inheritance_column]\n object[inheritance_column].constantize\n else\n original_class\n end\n end",
"def child_class\n Objekt\n end",
"def inherited(klass); end",
"def inherited(klass); end",
"def base_class; end",
"def base\n @parent ? @parent.model_instance.send(@name.to_s.pluralize) : model_class\n end",
"def orig_cls\n\t\treturn self.class.orig_cls\n\tend",
"def discriminate_class_for_record(record)\n if using_single_table_inheritance?(record)\n find_sti_class(record[inheritance_column])\n else\n super\n end\n end",
"def discriminate_class_for_record(record)\n if using_single_table_inheritance?(record)\n find_sti_class(record[inheritance_column])\n else\n super\n end\n end",
"def direct_superclass\n @superclass\n end",
"def direct_superclass\n @superclass\n end",
"def base_model\n BaseModel\n end",
"def becomes!(klass)\n became = becomes(klass)\n sti_type = nil\n if !klass.descends_from_active_record?\n sti_type = klass.sti_name\n end\n became.public_send(\"#{klass.inheritance_column}=\", sti_type)\n became\n end",
"def inherited(subclass)\n super\n ivs = subclass.instance_variables\n inherited_instance_variables.each do |iv, dup|\n next if ivs.include?(iv)\n if (sup_class_value = instance_variable_get(iv)) && dup\n sup_class_value = case dup\n when :dup\n sup_class_value.dup\n when :hash_dup\n h = {}\n sup_class_value.each{|k,v| h[k] = v.dup}\n h\n when Proc\n dup.call(sup_class_value)\n else\n raise Error, \"bad inherited instance variable type: #{dup.inspect}\"\n end\n end\n subclass.instance_variable_set(iv, sup_class_value)\n end\n\n unless ivs.include?(\"@dataset\")\n if @dataset && self != Model\n subclass.set_dataset(@dataset.clone, :inherited=>true)\n elsif (n = subclass.name) && !n.to_s.empty?\n db\n subclass.set_dataset(subclass.implicit_table_name)\n end\n end\n end",
"def inherited(subclass)\n super\n ivs = subclass.instance_variables.map(&:to_s)\n inherited_instance_variables.each do |iv, dup|\n next if ivs.include?(iv.to_s)\n if (sup_class_value = instance_variable_get(iv)) && dup\n sup_class_value = case dup\n when :dup\n sup_class_value.dup\n when :hash_dup\n h = {}\n sup_class_value.each{|k,v| h[k] = v.dup}\n h\n when Proc\n dup.call(sup_class_value)\n else\n raise Error, \"bad inherited instance variable type: #{dup.inspect}\"\n end\n end\n subclass.instance_variable_set(iv, sup_class_value)\n end\n\n unless ivs.include?(\"@dataset\")\n if @dataset && self != Model\n subclass.set_dataset(@dataset.clone, :inherited=>true)\n elsif (n = subclass.name) && !n.to_s.empty?\n db\n subclass.set_dataset(subclass.implicit_table_name)\n end\n end\n end",
"def superclass\n\t\t\t\treturn Object\n\t\t\tend",
"def superclass() end",
"def class_trait\n respond_to?(:ancestors) ? trait : self.class.trait\n end",
"def eav_class # :nodoc:\n if superclass != ActiveRecord::Base \n @eav_class ? @eav_class : superclass.eav_class \n else\n @eav_class\n end\n end",
"def ensure_proper_type\n unless self.class.descends_from_active_record?\n write_attribute(self.class.inheritance_column, Inflector.demodulize(self.class.name))\n end\n end",
"def discriminate_class_for_record(record)\n if using_single_table_inheritance?(record)\n find_sti_class(record[inheritance_column])\n elsif using_multi_table_inheritance?(base_class)\n find_mti_class(record)\n else\n super\n end\n end",
"def super_class\n return nil\n end",
"def inherited(subclass)\n subclass.field :id, from: 'Id'\n end",
"def inherited(subclass)\n subclass.field :id, from: 'Id'\n end",
"def superclass=(object); end",
"def all_models_superclass\n ActiveRecord::VERSION::MAJOR >= 5 ? ApplicationRecord : ActiveRecord::Base\n end",
"def base_class\n unless self < Base\n raise ActiveRecordError, \"#{name} doesn't belong in a hierarchy descending from ActiveRecord\"\n end\n\n if superclass == Base || superclass.abstract_class?\n self\n else\n superclass.base_class\n end\n end",
"def inherited(subclass)\n object_alias = subclass.name.demodulize.chomp('Serializer').underscore\n subclass.object_as(object_alias) unless method_defined?(object_alias)\n super\n end",
"def entity_class\n self.class.entity_class\n end",
"def subclass\n (assoc_name = subclass_assoc_name) ? send(assoc_name) : nil\n end",
"def inherited subclass\n Daylight::ResourceProxy[subclass]\n end",
"def type; super; end",
"def descends_from_active_record?\n superclass.descends_from_active_record?\n end",
"def superclass\n @store.find_class_named(@superclass) || @superclass\n end",
"def hook_model_klass\n fail 'child class to return a model klass here'\n end",
"def inherited(child)\n super\n child.attribute_names = self.attribute_names ? self.attribute_names.dup : [:id]\n child.reverse_solr_name_cache = self.reverse_solr_name_cache ? self.reverse_solr_name_cache.dup : {}\n child.attribute_cache = self.attribute_cache ? self.attribute_cache.dup : {}\n child.facets = self.facets ? self.facets.dup : []\n child.solr_calc_attributes = self.solr_calc_attributes.present? ? self.solr_calc_attributes.dup : {}\n # child.derived_af_class\n\n # If there's no class between +LockedLdpObject+ and this child that's\n # already had +visibility+ and +owner+ defined, define them.\n child.class_eval do\n unless attribute_names.include?(:visibility)\n has_attribute :visibility, ::VOCABULARY[:jupiter_core].visibility, solrize_for: [:exact_match, :facet]\n end\n unless attribute_names.include?(:owner)\n has_attribute :owner, ::VOCABULARY[:jupiter_core].owner, solrize_for: [:exact_match]\n end\n unless attribute_names.include?(:record_created_at)\n has_attribute :record_created_at, ::VOCABULARY[:jupiter_core].record_created_at, type: :date,\n solrize_for: [:sort]\n end\n end\n end",
"def supermodel\n if superclass.respond_to?(:register_submodel)\n superclass\n end\n end",
"def resource_singular() self.class.read_inheritable_attribute(:resource_singular) end",
"def supermodel\n if superclass.respond_to?(:register_submodel)\n superclass\n end\n end",
"def concrete_model\n self.class\n end",
"def base_class!\n @base_class = self\n end",
"def inherited(base); end",
"def base_class\n unless self < Base\n raise DuckRecordError, \"#{name} doesn't belong in a hierarchy descending from DuckRecord\"\n end\n\n if superclass == Base || superclass.abstract_class?\n self\n else\n superclass.base_class\n end\n end",
"def descends_from_active_record?\n if self == Base\n false\n elsif superclass.abstract_class?\n superclass.descends_from_active_record?\n else\n superclass == Base || !columns_hash.include?(inheritance_column)\n end\n end",
"def descends_from_active_record?\n if self == Base\n false\n elsif superclass.abstract_class?\n superclass.descends_from_active_record?\n else\n superclass == Base || !columns_hash.include?(inheritance_column)\n end\n end",
"def inherited(subclass)\n unless class_variable_defined?(:@@content_model)\n class_variable_set(:@@content_model, subclass)\n subclass.send :include, Spontaneous::Model::Core\n end\n super\n end",
"def sti_name\n superclass.sti_name\n end",
"def subclass_from_attributes(attrs)\n attrs = attrs.to_h if attrs.respond_to?(:permitted?)\n if attrs.is_a?(Hash)\n subclass_name = attrs[inheritance_column] || attrs[inheritance_column.to_sym]\n\n if subclass_name.present?\n find_sti_class(subclass_name)\n end\n end\n end",
"def subclass_from_attributes(attrs)\n attrs = attrs.to_h if attrs.respond_to?(:permitted?)\n if attrs.is_a?(Hash)\n subclass_name = attrs[inheritance_column] || attrs[inheritance_column.to_sym]\n\n if subclass_name.present?\n find_sti_class(subclass_name)\n end\n end\n end",
"def target_class\n if reflection.polymorphic?\n base_model.send(reflection.foreign_type).constantize\n else\n reflection.klass\n end\n end",
"def can_get_class?(klass); true; end",
"def inherited(subclass)\n super\n [:@deleted_timestamp_field, :@deleted_timestamp_overwrite].each do |iv|\n subclass.instance_variable_set(iv, instance_variable_get(iv))\n end\n end",
"def type\n raise 'derived should implement'\n end",
"def true_class\n return ModelProxy\n end",
"def inherited(subclass)\n super\n subclass.acts_as_cacheable_cache = acts_as_cacheable_cache\n subclass.acts_as_cacheable_time_to_live = acts_as_cacheable_time_to_live\n subclass.acts_as_cacheable_logger = acts_as_cacheable_logger\n end",
"def master_class\n association.active_record\n end",
"def child_class\n Room\n end",
"def inherited(subclass)\n instance_variables.grep(/^@\\w+_group_accessor$/) do |v|\n subclass.instance_variable_set(v, instance_variable_get(v).clone)\n end\n super\n end",
"def model_class; end",
"def inherited(klass)\n return unless klass.name\n\n type = klass.name.gsub(/([A-Z])/) { |a| \"_#{a.downcase}\" }.gsub(\"::\", \"/\")[1..-1].intern\n klass.star_type(type)\n end",
"def class_obj\n self.class\n end",
"def instance_of?(klass)\n super || __getobj__.instance_of?(klass)\n end",
"def type\n record.class.name or super\n end",
"def class_info?; \"#{self.class.name}\" end",
"def abstract_class?\n self == Base\n end",
"def inherited(subclass)\n # Copy properties from parent to subclass\n resource_class.properties.each do |_name, config|\n subclass.property config.term, predicate: config.predicate, class_name: config.class_name\n end\n\n subclass.configure_model\n end",
"def get_db_superclass name #:nodoc:\n# @actual_class_hash = get_classes( 'name', 'superClass') if @actual_class_hash.nil? \n z= @actual_class_hash.find{|x,y| x['name'] == name.to_s } \n z['superClass'] unless z.nil?\n end",
"def find_sti_class(type_name)\n type_name = base_class.type_for_attribute(inheritance_column).cast(type_name)\n subclass = begin\n if store_full_sti_class\n type_name.constantize\n else\n compute_type(type_name)\n end\n rescue NameError\n raise ActiveRecord::SubclassNotFound,\n \"The single-table inheritance mechanism failed to locate the subclass: '#{type_name}'. \" \\\n \"This error is raised because the column '#{inheritance_column}' is reserved for storing the class in case of inheritance. \" \\\n \"Please rename this column if you didn't intend it to be used for storing the inheritance class \" \\\n \"or overwrite #{name}.inheritance_column to use another column for that information.\"\n end\n #### our code starts here\n # Consider this class hierarchy\n # class Parent < ActiveRecord::Base; end\n # class Child < Parent; end\n # class ExtendedParent < ActiveType::Record[Parent]; end\n # class ExtendedChild < ActiveType::Record[Child]; end\n if self < subclass\n # i.e. ExtendendChild.find(child.id)\n # => self = ExtendedChild; subclass = Child\n # instantiate as ExtendedChild\n subclass = self\n elsif subclass < extended_record_base_class\n # i.e. ExtendedParent.find(child.id)\n # => subclass = Child; self = ExtendedParent; extended_record_base_class = Parent\n # There is no really good solution here, since we cannot instantiate as both ExtendedParent\n # and Child. We opt to instantiate as ExtendedParent, since the other option can be\n # achieved by using Parent.find(child.id)\n subclass = self\n end\n #### our code ends here\n unless subclass == self || descendants.include?(subclass)\n raise ActiveRecord::SubclassNotFound, \"Invalid single-table inheritance type: #{subclass.name} is not a subclass of #{name}\"\n end\n subclass\n end",
"def instance_type; end",
"def base_type\n self\n end",
"def instance_of?(klass)\n super || object.instance_of?(klass)\n end",
"def inherited(subclass)\n [:resource_ivar_name, :nested_resource_ivar_name].each do |inheritable_attribute|\n instance_var = \"@#{inheritable_attribute}\"\n subclass.instance_variable_set(instance_var, instance_variable_get(instance_var))\n end\n end",
"def model_class\n self.class_name.constantize\n end",
"def owner_class; end",
"def parent_class_name(obj)\n if obj.class.superclass != ActiveRecord::Base\n return obj.class.superclass.name\n end\n return obj.class.name\n end",
"def ensure_proper_type\n klass = self.class\n if klass.finder_needs_type_condition?\n _write_attribute(klass.inheritance_column, klass.sti_name)\n end\n end",
"def ensure_proper_type\n klass = self.class\n if klass.finder_needs_type_condition?\n _write_attribute(klass.inheritance_column, klass.sti_name)\n end\n end",
"def subclass_loaded?\n (assoc_name = subclass_assoc_name) ? association(assoc_name).loaded? : false\n end",
"def schema\n @schema || (superclass.schema unless superclass == Model)\n end",
"def model_instance(subclass_sym)\n\t\tvalues = model_instances(subclass_sym)\n\t\traise \"model_instances for '#{subclass_sym}' returned more than one\" if values.count > 1\n\t\tvalues[0]\n\tend",
"def class\n (class << self; self; end).superclass\n end",
"def accessor_strategy\n @accessor_strategy_klass\n end",
"def model\n self.public_send(self.class._attributes.first)\n end",
"def base_class?\n base_class == self\n end",
"def object_class\n self.class.object_class\n end",
"def inherited(subclass)\n subclass.definition_location = call_stack\n super\n register_submodel(subclass)\n subclass.permanent_model = true\n end",
"def sti_class_for(type_name)\n if store_full_sti_class && store_full_class_name\n type_name.constantize\n else\n compute_type(type_name)\n end\n rescue NameError\n raise SubclassNotFound,\n \"The single-table inheritance mechanism failed to locate the subclass: '#{type_name}'. \" \\\n \"This error is raised because the column '#{inheritance_column}' is reserved for storing the class in case of inheritance. \" \\\n \"Please rename this column if you didn't intend it to be used for storing the inheritance class \" \\\n \"or overwrite #{name}.inheritance_column to use another column for that information.\"\n end",
"def class\n object.class\n end",
"def +@\n self.class[ self ]\n end",
"def BaseClass name\n name == \"string\" ? String : Object\nend",
"def model_class\n @model_class ||= derived_model_class_name.constantize\n end",
"def extend_relation_class(klass)\n klass\n end",
"def discriminate_class_for_record(record)\n self\n end",
"def inherited(subclass)\n super\n\n subclass.serialization.replace serialization\n subclass.fields.replace fields\n end"
] |
[
"0.6882637",
"0.66980875",
"0.6634569",
"0.6632972",
"0.6632972",
"0.6532066",
"0.6491501",
"0.6488903",
"0.6456936",
"0.64501745",
"0.64501745",
"0.64480627",
"0.64428705",
"0.6394114",
"0.6393843",
"0.6393843",
"0.63448036",
"0.63448036",
"0.62826717",
"0.62527287",
"0.62458605",
"0.6226609",
"0.6210546",
"0.61884975",
"0.61883986",
"0.6172288",
"0.6146859",
"0.61463106",
"0.61453706",
"0.6139789",
"0.6139789",
"0.6093351",
"0.60697675",
"0.6068093",
"0.6050754",
"0.6027592",
"0.6025272",
"0.6019841",
"0.596597",
"0.59601486",
"0.5950537",
"0.59454817",
"0.5942526",
"0.59366286",
"0.59223104",
"0.5903213",
"0.5896414",
"0.58952004",
"0.58839804",
"0.58675814",
"0.585896",
"0.585896",
"0.58488",
"0.58362484",
"0.5836047",
"0.5836047",
"0.58326995",
"0.58288354",
"0.5821512",
"0.5814977",
"0.58088684",
"0.57899266",
"0.5786509",
"0.57609344",
"0.576018",
"0.5735948",
"0.5734016",
"0.57297355",
"0.57238245",
"0.57178235",
"0.57087255",
"0.56875813",
"0.56837344",
"0.5679295",
"0.56769234",
"0.5670933",
"0.56643486",
"0.5662002",
"0.5658978",
"0.5654236",
"0.564777",
"0.5635697",
"0.5629485",
"0.56294096",
"0.5622566",
"0.5612406",
"0.5606703",
"0.56062114",
"0.5600266",
"0.5600089",
"0.5598678",
"0.55936533",
"0.5584595",
"0.5576956",
"0.5560854",
"0.55593866",
"0.55575323",
"0.55436385",
"0.5542922",
"0.5542547",
"0.5540546"
] |
0.0
|
-1
|
class accessor when the superclass != AR::Base asume we are in STI mode
|
def eav_class # :nodoc:
if superclass != ActiveRecord::Base
@eav_class ? @eav_class : superclass.eav_class
else
@eav_class
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def base_class\n S::Model\n end",
"def subclass_from_attributes(attrs)\n active_authorizer[:default].deny?(inheritance_column) ? nil : super\n end",
"def subclass_from_attrs(attrs)\n active_authorizer[:default].deny?(inheritance_column) ? nil : super\n end",
"def super_class; end",
"def super_class; end",
"def inherited(subclass)\n super\n sk = sti_key\n sd = sti_dataset\n sdr = sti_dataset_root\n skm = sti_key_map\n smm = sti_model_map\n key = skm[subclass]\n ska = [key].reject { |k| k.blank? }\n subclass.instance_eval do\n @sti_key = sk\n @sti_key_array = ska\n @sti_subclasses_array = [skm[subclass]]\n @sti_dataset = sd\n @sti_key_map = skm\n @sti_model_map = smm\n @simple_table = nil\n @sti_dataset_root = sdr\n end\n sti_subclass_added(key, subclass)\n end",
"def inherited(subclass); end",
"def model\n if object[inheritance_column]\n object[inheritance_column].constantize\n else\n original_class\n end\n end",
"def child_class\n Objekt\n end",
"def inherited(klass); end",
"def inherited(klass); end",
"def base_class; end",
"def base\n @parent ? @parent.model_instance.send(@name.to_s.pluralize) : model_class\n end",
"def orig_cls\n\t\treturn self.class.orig_cls\n\tend",
"def discriminate_class_for_record(record)\n if using_single_table_inheritance?(record)\n find_sti_class(record[inheritance_column])\n else\n super\n end\n end",
"def discriminate_class_for_record(record)\n if using_single_table_inheritance?(record)\n find_sti_class(record[inheritance_column])\n else\n super\n end\n end",
"def direct_superclass\n @superclass\n end",
"def direct_superclass\n @superclass\n end",
"def base_model\n BaseModel\n end",
"def becomes!(klass)\n became = becomes(klass)\n sti_type = nil\n if !klass.descends_from_active_record?\n sti_type = klass.sti_name\n end\n became.public_send(\"#{klass.inheritance_column}=\", sti_type)\n became\n end",
"def inherited(subclass)\n super\n ivs = subclass.instance_variables\n inherited_instance_variables.each do |iv, dup|\n next if ivs.include?(iv)\n if (sup_class_value = instance_variable_get(iv)) && dup\n sup_class_value = case dup\n when :dup\n sup_class_value.dup\n when :hash_dup\n h = {}\n sup_class_value.each{|k,v| h[k] = v.dup}\n h\n when Proc\n dup.call(sup_class_value)\n else\n raise Error, \"bad inherited instance variable type: #{dup.inspect}\"\n end\n end\n subclass.instance_variable_set(iv, sup_class_value)\n end\n\n unless ivs.include?(\"@dataset\")\n if @dataset && self != Model\n subclass.set_dataset(@dataset.clone, :inherited=>true)\n elsif (n = subclass.name) && !n.to_s.empty?\n db\n subclass.set_dataset(subclass.implicit_table_name)\n end\n end\n end",
"def inherited(subclass)\n super\n ivs = subclass.instance_variables.map(&:to_s)\n inherited_instance_variables.each do |iv, dup|\n next if ivs.include?(iv.to_s)\n if (sup_class_value = instance_variable_get(iv)) && dup\n sup_class_value = case dup\n when :dup\n sup_class_value.dup\n when :hash_dup\n h = {}\n sup_class_value.each{|k,v| h[k] = v.dup}\n h\n when Proc\n dup.call(sup_class_value)\n else\n raise Error, \"bad inherited instance variable type: #{dup.inspect}\"\n end\n end\n subclass.instance_variable_set(iv, sup_class_value)\n end\n\n unless ivs.include?(\"@dataset\")\n if @dataset && self != Model\n subclass.set_dataset(@dataset.clone, :inherited=>true)\n elsif (n = subclass.name) && !n.to_s.empty?\n db\n subclass.set_dataset(subclass.implicit_table_name)\n end\n end\n end",
"def superclass\n\t\t\t\treturn Object\n\t\t\tend",
"def class_trait\n respond_to?(:ancestors) ? trait : self.class.trait\n end",
"def superclass() end",
"def ensure_proper_type\n unless self.class.descends_from_active_record?\n write_attribute(self.class.inheritance_column, Inflector.demodulize(self.class.name))\n end\n end",
"def discriminate_class_for_record(record)\n if using_single_table_inheritance?(record)\n find_sti_class(record[inheritance_column])\n elsif using_multi_table_inheritance?(base_class)\n find_mti_class(record)\n else\n super\n end\n end",
"def super_class\n return nil\n end",
"def inherited(subclass)\n subclass.field :id, from: 'Id'\n end",
"def inherited(subclass)\n subclass.field :id, from: 'Id'\n end",
"def superclass=(object); end",
"def all_models_superclass\n ActiveRecord::VERSION::MAJOR >= 5 ? ApplicationRecord : ActiveRecord::Base\n end",
"def base_class\n unless self < Base\n raise ActiveRecordError, \"#{name} doesn't belong in a hierarchy descending from ActiveRecord\"\n end\n\n if superclass == Base || superclass.abstract_class?\n self\n else\n superclass.base_class\n end\n end",
"def inherited(subclass)\n object_alias = subclass.name.demodulize.chomp('Serializer').underscore\n subclass.object_as(object_alias) unless method_defined?(object_alias)\n super\n end",
"def entity_class\n self.class.entity_class\n end",
"def subclass\n (assoc_name = subclass_assoc_name) ? send(assoc_name) : nil\n end",
"def inherited subclass\n Daylight::ResourceProxy[subclass]\n end",
"def type; super; end",
"def descends_from_active_record?\n superclass.descends_from_active_record?\n end",
"def superclass\n @store.find_class_named(@superclass) || @superclass\n end",
"def hook_model_klass\n fail 'child class to return a model klass here'\n end",
"def inherited(child)\n super\n child.attribute_names = self.attribute_names ? self.attribute_names.dup : [:id]\n child.reverse_solr_name_cache = self.reverse_solr_name_cache ? self.reverse_solr_name_cache.dup : {}\n child.attribute_cache = self.attribute_cache ? self.attribute_cache.dup : {}\n child.facets = self.facets ? self.facets.dup : []\n child.solr_calc_attributes = self.solr_calc_attributes.present? ? self.solr_calc_attributes.dup : {}\n # child.derived_af_class\n\n # If there's no class between +LockedLdpObject+ and this child that's\n # already had +visibility+ and +owner+ defined, define them.\n child.class_eval do\n unless attribute_names.include?(:visibility)\n has_attribute :visibility, ::VOCABULARY[:jupiter_core].visibility, solrize_for: [:exact_match, :facet]\n end\n unless attribute_names.include?(:owner)\n has_attribute :owner, ::VOCABULARY[:jupiter_core].owner, solrize_for: [:exact_match]\n end\n unless attribute_names.include?(:record_created_at)\n has_attribute :record_created_at, ::VOCABULARY[:jupiter_core].record_created_at, type: :date,\n solrize_for: [:sort]\n end\n end\n end",
"def supermodel\n if superclass.respond_to?(:register_submodel)\n superclass\n end\n end",
"def resource_singular() self.class.read_inheritable_attribute(:resource_singular) end",
"def supermodel\n if superclass.respond_to?(:register_submodel)\n superclass\n end\n end",
"def concrete_model\n self.class\n end",
"def base_class!\n @base_class = self\n end",
"def inherited(base); end",
"def base_class\n unless self < Base\n raise DuckRecordError, \"#{name} doesn't belong in a hierarchy descending from DuckRecord\"\n end\n\n if superclass == Base || superclass.abstract_class?\n self\n else\n superclass.base_class\n end\n end",
"def descends_from_active_record?\n if self == Base\n false\n elsif superclass.abstract_class?\n superclass.descends_from_active_record?\n else\n superclass == Base || !columns_hash.include?(inheritance_column)\n end\n end",
"def descends_from_active_record?\n if self == Base\n false\n elsif superclass.abstract_class?\n superclass.descends_from_active_record?\n else\n superclass == Base || !columns_hash.include?(inheritance_column)\n end\n end",
"def inherited(subclass)\n unless class_variable_defined?(:@@content_model)\n class_variable_set(:@@content_model, subclass)\n subclass.send :include, Spontaneous::Model::Core\n end\n super\n end",
"def sti_name\n superclass.sti_name\n end",
"def subclass_from_attributes(attrs)\n attrs = attrs.to_h if attrs.respond_to?(:permitted?)\n if attrs.is_a?(Hash)\n subclass_name = attrs[inheritance_column] || attrs[inheritance_column.to_sym]\n\n if subclass_name.present?\n find_sti_class(subclass_name)\n end\n end\n end",
"def subclass_from_attributes(attrs)\n attrs = attrs.to_h if attrs.respond_to?(:permitted?)\n if attrs.is_a?(Hash)\n subclass_name = attrs[inheritance_column] || attrs[inheritance_column.to_sym]\n\n if subclass_name.present?\n find_sti_class(subclass_name)\n end\n end\n end",
"def target_class\n if reflection.polymorphic?\n base_model.send(reflection.foreign_type).constantize\n else\n reflection.klass\n end\n end",
"def can_get_class?(klass); true; end",
"def inherited(subclass)\n super\n [:@deleted_timestamp_field, :@deleted_timestamp_overwrite].each do |iv|\n subclass.instance_variable_set(iv, instance_variable_get(iv))\n end\n end",
"def type\n raise 'derived should implement'\n end",
"def true_class\n return ModelProxy\n end",
"def inherited(subclass)\n super\n subclass.acts_as_cacheable_cache = acts_as_cacheable_cache\n subclass.acts_as_cacheable_time_to_live = acts_as_cacheable_time_to_live\n subclass.acts_as_cacheable_logger = acts_as_cacheable_logger\n end",
"def master_class\n association.active_record\n end",
"def child_class\n Room\n end",
"def inherited(subclass)\n instance_variables.grep(/^@\\w+_group_accessor$/) do |v|\n subclass.instance_variable_set(v, instance_variable_get(v).clone)\n end\n super\n end",
"def model_class; end",
"def inherited(klass)\n return unless klass.name\n\n type = klass.name.gsub(/([A-Z])/) { |a| \"_#{a.downcase}\" }.gsub(\"::\", \"/\")[1..-1].intern\n klass.star_type(type)\n end",
"def class_obj\n self.class\n end",
"def instance_of?(klass)\n super || __getobj__.instance_of?(klass)\n end",
"def type\n record.class.name or super\n end",
"def class_info?; \"#{self.class.name}\" end",
"def abstract_class?\n self == Base\n end",
"def inherited(subclass)\n # Copy properties from parent to subclass\n resource_class.properties.each do |_name, config|\n subclass.property config.term, predicate: config.predicate, class_name: config.class_name\n end\n\n subclass.configure_model\n end",
"def get_db_superclass name #:nodoc:\n# @actual_class_hash = get_classes( 'name', 'superClass') if @actual_class_hash.nil? \n z= @actual_class_hash.find{|x,y| x['name'] == name.to_s } \n z['superClass'] unless z.nil?\n end",
"def find_sti_class(type_name)\n type_name = base_class.type_for_attribute(inheritance_column).cast(type_name)\n subclass = begin\n if store_full_sti_class\n type_name.constantize\n else\n compute_type(type_name)\n end\n rescue NameError\n raise ActiveRecord::SubclassNotFound,\n \"The single-table inheritance mechanism failed to locate the subclass: '#{type_name}'. \" \\\n \"This error is raised because the column '#{inheritance_column}' is reserved for storing the class in case of inheritance. \" \\\n \"Please rename this column if you didn't intend it to be used for storing the inheritance class \" \\\n \"or overwrite #{name}.inheritance_column to use another column for that information.\"\n end\n #### our code starts here\n # Consider this class hierarchy\n # class Parent < ActiveRecord::Base; end\n # class Child < Parent; end\n # class ExtendedParent < ActiveType::Record[Parent]; end\n # class ExtendedChild < ActiveType::Record[Child]; end\n if self < subclass\n # i.e. ExtendendChild.find(child.id)\n # => self = ExtendedChild; subclass = Child\n # instantiate as ExtendedChild\n subclass = self\n elsif subclass < extended_record_base_class\n # i.e. ExtendedParent.find(child.id)\n # => subclass = Child; self = ExtendedParent; extended_record_base_class = Parent\n # There is no really good solution here, since we cannot instantiate as both ExtendedParent\n # and Child. We opt to instantiate as ExtendedParent, since the other option can be\n # achieved by using Parent.find(child.id)\n subclass = self\n end\n #### our code ends here\n unless subclass == self || descendants.include?(subclass)\n raise ActiveRecord::SubclassNotFound, \"Invalid single-table inheritance type: #{subclass.name} is not a subclass of #{name}\"\n end\n subclass\n end",
"def instance_type; end",
"def base_type\n self\n end",
"def instance_of?(klass)\n super || object.instance_of?(klass)\n end",
"def inherited(subclass)\n [:resource_ivar_name, :nested_resource_ivar_name].each do |inheritable_attribute|\n instance_var = \"@#{inheritable_attribute}\"\n subclass.instance_variable_set(instance_var, instance_variable_get(instance_var))\n end\n end",
"def model_class\n self.class_name.constantize\n end",
"def owner_class; end",
"def parent_class_name(obj)\n if obj.class.superclass != ActiveRecord::Base\n return obj.class.superclass.name\n end\n return obj.class.name\n end",
"def ensure_proper_type\n klass = self.class\n if klass.finder_needs_type_condition?\n _write_attribute(klass.inheritance_column, klass.sti_name)\n end\n end",
"def ensure_proper_type\n klass = self.class\n if klass.finder_needs_type_condition?\n _write_attribute(klass.inheritance_column, klass.sti_name)\n end\n end",
"def subclass_loaded?\n (assoc_name = subclass_assoc_name) ? association(assoc_name).loaded? : false\n end",
"def schema\n @schema || (superclass.schema unless superclass == Model)\n end",
"def model_instance(subclass_sym)\n\t\tvalues = model_instances(subclass_sym)\n\t\traise \"model_instances for '#{subclass_sym}' returned more than one\" if values.count > 1\n\t\tvalues[0]\n\tend",
"def class\n (class << self; self; end).superclass\n end",
"def accessor_strategy\n @accessor_strategy_klass\n end",
"def model\n self.public_send(self.class._attributes.first)\n end",
"def base_class?\n base_class == self\n end",
"def object_class\n self.class.object_class\n end",
"def inherited(subclass)\n subclass.definition_location = call_stack\n super\n register_submodel(subclass)\n subclass.permanent_model = true\n end",
"def sti_class_for(type_name)\n if store_full_sti_class && store_full_class_name\n type_name.constantize\n else\n compute_type(type_name)\n end\n rescue NameError\n raise SubclassNotFound,\n \"The single-table inheritance mechanism failed to locate the subclass: '#{type_name}'. \" \\\n \"This error is raised because the column '#{inheritance_column}' is reserved for storing the class in case of inheritance. \" \\\n \"Please rename this column if you didn't intend it to be used for storing the inheritance class \" \\\n \"or overwrite #{name}.inheritance_column to use another column for that information.\"\n end",
"def class\n object.class\n end",
"def +@\n self.class[ self ]\n end",
"def BaseClass name\n name == \"string\" ? String : Object\nend",
"def model_class\n @model_class ||= derived_model_class_name.constantize\n end",
"def extend_relation_class(klass)\n klass\n end",
"def discriminate_class_for_record(record)\n self\n end",
"def inherited(subclass)\n super\n\n subclass.serialization.replace serialization\n subclass.fields.replace fields\n end"
] |
[
"0.6883738",
"0.6696335",
"0.6632882",
"0.6631841",
"0.6631841",
"0.6531633",
"0.64903426",
"0.6488659",
"0.6456729",
"0.6448828",
"0.6448828",
"0.64467263",
"0.6443674",
"0.63933545",
"0.6393048",
"0.6393048",
"0.6344293",
"0.6344293",
"0.6283801",
"0.6251904",
"0.62458587",
"0.6226589",
"0.62097555",
"0.61876947",
"0.6187538",
"0.614692",
"0.6145627",
"0.6144027",
"0.6138748",
"0.6138748",
"0.60931283",
"0.60713243",
"0.6069022",
"0.6050924",
"0.6027065",
"0.6024052",
"0.6018788",
"0.59644634",
"0.59613883",
"0.595008",
"0.5945852",
"0.59427935",
"0.59377843",
"0.5921764",
"0.5904405",
"0.58963203",
"0.5894304",
"0.5883566",
"0.58680105",
"0.58597636",
"0.58597636",
"0.58498746",
"0.5836322",
"0.5835106",
"0.5835106",
"0.58329993",
"0.5827891",
"0.5821128",
"0.5813631",
"0.58090985",
"0.5789645",
"0.57863486",
"0.57603556",
"0.5759487",
"0.5736159",
"0.5733002",
"0.57286155",
"0.5724049",
"0.5717237",
"0.57078063",
"0.56877154",
"0.5683256",
"0.567935",
"0.5677039",
"0.56696135",
"0.56631684",
"0.56620735",
"0.5658001",
"0.5654807",
"0.56470835",
"0.5636822",
"0.56291234",
"0.56290495",
"0.5623408",
"0.561287",
"0.560627",
"0.56050056",
"0.5599492",
"0.5599469",
"0.5598271",
"0.55934924",
"0.55853176",
"0.55761737",
"0.55600375",
"0.5558413",
"0.5557582",
"0.5544085",
"0.5542443",
"0.55408525",
"0.55398893"
] |
0.61714816
|
25
|
get the class eav attributes
|
def class_eav_attributes
self.class.class_eav_attributes
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def class_attributes; end",
"def attrs\n self.class.attrs\n end",
"def attributes\n self.class::ATTRIBUTES\n end",
"def class_attributes\n @__class_attributes\n end",
"def attributes\n self.class.class_variable_get(:@@attributes)\n end",
"def attr_info; end",
"def attributes\n @attrs\n end",
"def eav_attributes\n @eav_attributes ||= eav_class.all(\n :conditions => { self_key => self.id }\n )\n end",
"def instance_eav_attributes\n []\n end",
"def attributes_get\n h = {}\n self.class.attributes.each do |a|\n h[a] = attribute_get(a)\n end\n h\n end",
"def attributes_get\n h = {}\n self.class.attributes.each do |a|\n h[a] = attribute_get(a)\n end\n h\n end",
"def get_attributes\n\t\t\t@@attributes\n\t\tend",
"def attributes\r\n self.class.attributes\r\n end",
"def attributes\n @@attributes\n end",
"def attrs\n @attrs\n end",
"def attrs\n @attrs\n end",
"def attributes\n @attrs.keys\n end",
"def attributes\n self.class.attributes\n end",
"def attribs\n\t\t@attributes\n\tend",
"def attributes\n ATTRIBUTES\n end",
"def attributes; end",
"def attributes; end",
"def attributes; end",
"def attributes; end",
"def attributes; end",
"def attributes; end",
"def attributes; end",
"def attributes; end",
"def attributes; end",
"def attributes; end",
"def attributes; end",
"def class_eav_attributes # :nodoc:\n if superclass != ActiveRecord::Base\n if superclass.class_eav_attributes.nil?\n @eav_attributes\n else\n @eav_attributes.nil? ? superclass.class_eav_attributes : superclass.class_eav_attributes.merge(@eav_attributes)\n end\n else\n @eav_attributes\n end\n end",
"def attributes\n instance_values\n end",
"def eav_attributes_list # :nodoc:\n (\n self.instance_eav_attributes + self.class_eav_attributes.keys\n ).collect { |attribute| attribute.to_s }.uniq\n end",
"def attributes\n self._attributes.inject({}) do |hash, attr|\n hash[attr.to_s] = send(attr)\n hash\n end\n end",
"def attributes\n data[:attributes]\n end",
"def attributes\n self.class.attributes\n end",
"def attributes\n self.class.attributes\n end",
"def attributes\n @attributes\n end",
"def attributes\n @attributes\n end",
"def attributes\n @attributes\n end",
"def attributes\n end",
"def attributes\n @_attributes\n end",
"def attributes\n instance_values\n end",
"def attributes\n @attributes\n end",
"def attributes\n @attributes\n end",
"def attributes\n self.class.fields.inject({}) do |attribute_hash, field|\n attribute_hash[field] = send(field)\n attribute_hash\n end\n end",
"def attributes\n instance_variables.map{ |iv| iv.sub('@','') }\n end",
"def attributes\n @_attributes\n end",
"def attributes\n end",
"def attributes_for(klass)\n @attributes ||= begin\n YAML.load_file(File.expand_path('../data/attributes.json', __dir__)).freeze\n end\n\n name = unify klass.name.snakecase\n @attributes[name]\n end",
"def attributes\n if self.class_variable_defined?(:@@attributes)\n class_variable_get(:@@attributes)\n else\n class_variable_set(:@@attributes, [])\n class_variable_get(:@@attributes)\n end\n end",
"def attributes_for( an_instance )\n attrs = self.class.attributes[an_instance.class.name] \n raise \"Unable to get attributes for #{an_instance}\" unless attrs\n attrs\n end",
"def attributes\n Hash[instance_variables.map{|attrib| [attrib.to_s[1..attrib.to_s.size], nil]}]\n end",
"def attributes\n attributes = {}\n self.instance_variables.each do |i| \n meth = i.gsub(\"@\",\"\")\n attributes[meth.to_sym] = self.send meth\n end\n attributes\n end",
"def attributes(tf = true)\n results = handle_inherited_hash(tf, :local_attributes)\n # if an instance, include the singleton_class attributes\n #p [:attributes, @this, @this.singleton_class, @this.singleton_class.methods(false), results]\n if !@this.kind_of?(Class) && @this.singleton_class.doodle.respond_to?(:attributes)\n results = results.merge(@this.singleton_class.doodle.attributes)\n end\n results\n end",
"def attributes\n self.class.attribute_names.map do |name|\n [name.to_s, self.send(name)]\n end.to_h\n end",
"def instance_attributes; end",
"def attributes\n ATTRIBUTE_NAMES\n end",
"def full_attributes \n self.class.attributes\n end",
"def attributes\n self.class.config.full_config.map { |attribute| [attribute, send(attribute)] }.to_h\n end",
"def attributes\n load_attributes! unless attributes_loaded?\n @attributes.values\n end",
"def attributes\n @attributes ||= []\n end",
"def attributes\n _fast_attributes\n\n rescue NameError\n\n method = \"def _fast_attributes\\n\"\n method << \" @_attributes ||=\\n\"\n method << \" begin\\n\"\n method << \" h = {}\\n\"\n\n self.class.attributes.each do |name|\n method << \" h[:\\\"#{name}\\\"] = send(:\\\"#{name}\\\") if include_#{name}?\\n\"\n end\n\n method << \" h\\n\"\n method << \" end\\n\"\n method << \"end\"\n\n self.class.class_eval method\n\n _fast_attributes\n end",
"def attributes\n @metadata\n end",
"def attribute_values\n self.class.attributes.map{ |attr| self.send(attr) }\n end",
"def attributes\n # ...\n # debugger\n # f = method_missing(name)\n @attributes ||= {}\n # attributes = Hash.new {|h,k| h[k] = []}\n # @attributes = @colm.map {|colm| attributes[colm]}\n # unless instance_variables(false).include?(f)\n # # print f\n # end\n\n # @attribute ={}\n end",
"def attributes\n @attributes ||= {}\n @attributes\n end",
"def attributes\n @attributes ||= @internal_struct[:attributes]\n end",
"def result_attrs\n main_result[\"@attr\"] rescue {}\n end",
"def attributes\n scraper.attributes.keys + uri_response_attributes + [:feed]\n end",
"def attributes\n Hash[instance_variables.map { |name| [name, instance_variable_get(name)] }]\n end",
"def attributes\n @attributes ||= []\n @attributes\n end",
"def attributes\n instance_values.with_indifferent_access.slice(*USER_ATTRIBUTES)\n end",
"def attributes\n hash = HashWithIndifferentAccess.new\n\n self.class.attribute_names.each_with_object(hash) do |name, attrs|\n attrs[name] = read_attribute(name)\n end\n end",
"def attributes\n @attributes ||= begin\n attrs = {}\n self.class.key_attrs.values.each { |a| attrs[a.name] = a.initial_value }\n self.class.other_attrs.values.each { |a| attrs[a.name] = a.initial_value }\n attrs\n end\n end",
"def attributes\n @attributes ||= self.class.class_attributes.clone\n end",
"def attributes\n @context[:attributes]\n end",
"def class_variables() end",
"def attr_strings\n @attr_strings\n end",
"def class_attributes\n attrs = Doodle::OrderedHash.new\n if @this.kind_of?(Class)\n attrs = collect_inherited(:class_attributes).inject(Doodle::OrderedHash.new){ |hash, item|\n hash.merge(Doodle::OrderedHash[*item])\n }.merge(@this.singleton_class.doodle.respond_to?(:attributes) ? @this.singleton_class.doodle.attributes : { })\n attrs\n else\n @this.class.doodle.class_attributes\n end\n end",
"def attributes\n node[1]\n end",
"def attributes\n self.class.attribute_names.map do |attr|\n type = self.class.attribute_types[attr.to_s]\n value = public_send(attr)\n [attr, type ? type.serialize(value) : value]\n end.to_h\n end",
"def attributes\n attrs = sort_members(@context.attributes).find_all{|a| @options.show_all || a.visibility == :public || a.visibility == :protected}\n attrs.collect{|a| {:name=>a.name, :visibility=>a.visibility, :rw=>a.rw, :description=>markup(a.comment, true)}}\n end",
"def attributes\n\t\treturn attributes_of @current_node\n\tend",
"def attributes\n @attributes ||= get_field_by_type(ATTRIBUTE_FIELDS)\n end",
"def attributes\n @data.keys\n end",
"def class_variables; end",
"def attributes\n self.attribute_keys.inject({}) do |hash, key|\n hash[key] = self.__send__(key) if self.__send__(key)\n hash\n end\n end",
"def inspect\n vals = ATTRS.map { |field| \"#{field}: #{public_send(field).inspect}\" }\n \"#<#{self.class.name} #{vals.join(', ')}>\"\n end",
"def attributes\n self\n .class\n .attribute_names\n .map { |attr| [attr, send(attr)] }\n .reject { |_, value| value.nil? }\n .map do |attr, value|\n [attr, value.respond_to?(:attributes) ? value.attributes : value]\n end\n .to_h\n end",
"def class_attrs(hash)\n eigenclass = class << self; self; end \n eigenclass.class_eval { attributes(hash) }\n end",
"def values\n @attrs.values\n end",
"def attr; end",
"def attributes\n @cache[:attributes]\n end",
"def hash\n @attrs\n end",
"def attrs\n @options[:attrs]\n end",
"def attributes\n @element_map\n end",
"def attributes\n ATTRIBUTES.inject({}) do |hash, attribute|\n hash[attribute] = self.send(attribute)\n hash\n end\n end",
"def attributes\n ATTRIBUTES.inject({}) do |hash, attribute|\n hash[attribute] = self.send(attribute)\n hash\n end\n end"
] |
[
"0.78152573",
"0.74947804",
"0.74825466",
"0.7437369",
"0.7332412",
"0.7282562",
"0.7260009",
"0.7175514",
"0.7144768",
"0.7137381",
"0.7137381",
"0.709971",
"0.709194",
"0.70870787",
"0.70865947",
"0.707456",
"0.7071141",
"0.7063033",
"0.7062979",
"0.7024419",
"0.7016693",
"0.7016693",
"0.7016693",
"0.7016693",
"0.7016693",
"0.7016693",
"0.7016693",
"0.7016693",
"0.7016693",
"0.7016693",
"0.7016693",
"0.6992846",
"0.698441",
"0.6979983",
"0.69339347",
"0.69309425",
"0.68974143",
"0.68974143",
"0.6884863",
"0.6884863",
"0.6884863",
"0.6881144",
"0.68756074",
"0.68693435",
"0.68446517",
"0.6841093",
"0.6756235",
"0.67514044",
"0.6749672",
"0.67476887",
"0.6724202",
"0.67154413",
"0.67072326",
"0.67009073",
"0.66994053",
"0.6695543",
"0.66889936",
"0.668508",
"0.6678162",
"0.6663313",
"0.6613701",
"0.6613473",
"0.6607544",
"0.6604658",
"0.66007453",
"0.65777284",
"0.6573598",
"0.6566062",
"0.6564553",
"0.65587413",
"0.6551865",
"0.6538517",
"0.6537969",
"0.65340006",
"0.6532225",
"0.6517966",
"0.65168935",
"0.6516086",
"0.6500594",
"0.64971966",
"0.6495464",
"0.64838946",
"0.6482957",
"0.6461781",
"0.64594764",
"0.6458659",
"0.64544237",
"0.6437055",
"0.6435692",
"0.6426385",
"0.6419095",
"0.64120686",
"0.639922",
"0.63899726",
"0.6384217",
"0.638407",
"0.6379475",
"0.63752407",
"0.6371517",
"0.6371517"
] |
0.8413792
|
0
|
Override this to get some usable attributes Cowardly refusing to adhere to all
|
def instance_eav_attributes
[]
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def attributes; end",
"def attributes; end",
"def attributes; end",
"def attributes; end",
"def attributes; end",
"def attributes; end",
"def attributes; end",
"def attributes; end",
"def attributes; end",
"def attributes; end",
"def attributes; end",
"def attributes\n end",
"def attributes\n end",
"def attr_info; end",
"def attribs\n\t\t@attributes\n\tend",
"def get_attributes\n\t\t\t@@attributes\n\t\tend",
"def attributes\n _fast_attributes\n\n rescue NameError\n\n method = \"def _fast_attributes\\n\"\n method << \" @_attributes ||=\\n\"\n method << \" begin\\n\"\n method << \" h = {}\\n\"\n\n self.class.attributes.each do |name|\n method << \" h[:\\\"#{name}\\\"] = send(:\\\"#{name}\\\") if include_#{name}?\\n\"\n end\n\n method << \" h\\n\"\n method << \" end\\n\"\n method << \"end\"\n\n self.class.class_eval method\n\n _fast_attributes\n end",
"def attrs\n @attrs\n end",
"def attrs\n @attrs\n end",
"def _attributes\n @_attributes = superclass.try(:_attributes)&.dup || {} unless defined?(@_attributes)\n @_attributes\n end",
"def attrs\n self.class.attrs\n end",
"def attributes\n @attrs\n end",
"def class_attributes; end",
"def attributes # :nodoc:\n @attributes ||= {}\n end",
"def attr; end",
"def attributes=(_arg0); end",
"def derived_attributes\n @derive_attribute ||= {}\n end",
"def allowed_attributes=(_arg0); end",
"def allowed_attributes=(_arg0); end",
"def attributes\n @attributes ||= {}\n @attributes\n end",
"def attributes\n @_attributes\n end",
"def attrs_authoritative\n @authority = :attributes\n self\n end",
"def tributes *attrs\n if attrs.empty? \n @tributes ||= []\n else \n @tributes = attrs\n super *attrs\n end \n end",
"def attributes\n self._attributes.inject({}) do |hash, attr|\n hash[attr.to_s] = send(attr)\n hash\n end\n end",
"def attributes; @attributes ||= []; end",
"def attributes(_record)\n raise 'Abstract method attributes should be overriden'\n end",
"def attributes(requested_attrs = nil, reload = false)\n @attributes = nil if reload\n @attributes ||= self.class._attributes_data.each_with_object({}) do |(key, attr), hash|\n next if attr.excluded?(self)\n next unless requested_attrs.nil? || requested_attrs.include?(key)\n hash[key] = attr.value(self)\n end\n end",
"def model_attributes\n raise NotImplementedError\n end",
"def attributes\n ATTRIBUTES.each_with_object({}) do |name, buffer|\n buffer[name] = public_send(name)\n end\n end",
"def attributes\n self.class::ATTRIBUTES\n end",
"def attributes\n ATTRIBUTES\n end",
"def attributes\n @attributes = @attributes || {}\n end",
"def attributes\n @attributes ||= begin\n attrs = {}\n self.class.key_attrs.values.each { |a| attrs[a.name] = a.initial_value }\n self.class.other_attrs.values.each { |a| attrs[a.name] = a.initial_value }\n attrs\n end\n end",
"def attributes\n @attributes ||= []\n end",
"def attributes\n @allowed_attributes\n end",
"def attributes\n @_attributes\n end",
"def instance_attributes; end",
"def attributes\n @attributes ||= get_field_by_type(ATTRIBUTE_FIELDS)\n end",
"def attributes\n check_for_nil_error\n @loaded ? super : load.attributes\n end",
"def attributes\n # ...\n # debugger\n # f = method_missing(name)\n @attributes ||= {}\n # attributes = Hash.new {|h,k| h[k] = []}\n # @attributes = @colm.map {|colm| attributes[colm]}\n # unless instance_variables(false).include?(f)\n # # print f\n # end\n\n # @attribute ={}\n end",
"def attributes(requested_attrs = nil, reload = false)\n @attributes = nil if reload\n @attributes ||= self.class._attributes_data.each_with_object({}) do |(key, attr), hash|\n next if attr.excluded?(self)\n next unless requested_attrs.nil? || requested_attrs.include?(key)\n hash[key] = attr.value(self)\n end\n end",
"def attributes\n @attributes ||= {}\n end",
"def attributes\n @attributes ||= {}\n end",
"def attributes\n @attributes ||= {}\n end",
"def attributes\n @attributes ||= {}\n end",
"def attributes\n @attributes ||= {}\n end",
"def attributes\n @attributes ||= {}\n end",
"def attributes\n @attributes ||= {}\n end",
"def attributes\n @attributes ||= {}\n end",
"def attributes\n self.class.class_variable_get(:@@attributes)\n end",
"def attributes\n _fast_attributes\n rescue NameError\n method = \"def _fast_attributes\\n\"\n\n method << \" h = {}\\n\"\n\n _attributes.each do |name,key|\n method << \" h[:\\\"#{key}\\\"] = read_attribute_for_serialization(:\\\"#{name}\\\") if include?(:\\\"#{name}\\\")\\n\"\n end\n method << \" h\\nend\"\n\n self.class.class_eval method\n _fast_attributes\n end",
"def all_attributes\n the_attrs = Hash[accessors.collect {|v| [v, send(v.to_s)] if respond_to? \"#{v}\".to_sym}]\n (respond_to?(:attributes) && attributes.merge(the_attrs)) || the_attrs\n end",
"def attributes\n @attributes ||= @internal_struct[:attributes]\n end",
"def attributes\n # Note: the values returned here are ignored by\n # ActiveModel::Serializers#serializable_hash; just the keys are\n # used to again call those getter methods... But we do want to\n # check the values so we can leave 'nil' out of the hash.\n attribute_keys.inject(\n ActiveSupport::HashWithIndifferentAccess.new) do |result, key|\n value = send(key)\n result[key] = value unless value == nil\n result\n end\n end",
"def attributes(*args)\n attr_accessor(*args)\n end",
"def readable_attributes \n return attributes if permitted_to?(ReadAllPrivilege)\n attributes.reject do |k,v|\n !allowed?(:read, k)\n end\n end",
"def attributes\n restricted = defined?(self.class::NON_ATTRIBUTE_PARAMS) ? self.class::NON_ATTRIBUTE_PARAMS : []\n (self.class::PARAM_DEFAULTS.keys - restricted).index_with { |attr| send(attr) }.with_indifferent_access\n end",
"def attributes\n data[:attributes]\n end",
"def accessible_attributes # :nodoc:\n read_inheritable_attribute(:attr_accessible)\n end",
"def attributes_before_type_cast\n @attributes\n end",
"def attributes\n @attributes\n end",
"def attributes\n @attributes\n end",
"def required_attributes\n self.class::REQUIRED_ATTRIBUTES\n end",
"def attributes\n attrs = super\n if attrs['user'] && attrs['user']['id']\n attrs.merge!('user_id' => attrs['user']['id'])\n attrs.delete 'user'\n end\n attrs\n end",
"def base_attributes\n kind.attributes\n end",
"def attributes\n @attributes ||= []\n @attributes\n end",
"def method_missing(method_name, *args, &block)\n return super unless define_attribute_methods\n self.send(method_name, *args, &block)\n end",
"def attr_strings\n @attr_strings\n end",
"def method_missing(name, *args, &block)\n unless self.attributes.include?(name.to_s)\n super(name, *args, &block)\n else\n self.attributes[name.to_s]\n end\n end",
"def method_missing(name, *args, &block)\n unless self.attributes.include?(name.to_s)\n super(name, *args, &block)\n else\n self.attributes[name.to_s]\n end\n end",
"def custom_data\n super.attributes\n end",
"def data_attributes\n end",
"def attribute; end",
"def attribute; end",
"def attribute; end",
"def attribute; end",
"def attribute; end",
"def attribute; end",
"def attribute; end",
"def attr_reader(*vars)\n super *(add_tracked_attrs(true, false, *vars))\n end",
"def attributes\n {}.tap do |attributes|\n attribute_names.each do |key|\n attributes[key] = send(key)\n end\n end\n end",
"def attributes_hash\n fail 'sub class to implement'\n end",
"def create_accessible_attributes\n read_inheritable_attribute(:attr_create_accessible)\n end",
"def attributes; Common.attributes(@handle); end",
"def attributes\n @attributes\n end",
"def attributes\n @attributes\n end",
"def attributes\n @attributes\n end",
"def attr(name); end",
"def initialize(attributes = {})\n @attributes = attributes\n super @attributes.slice(*self.class.special_attrs).merge(data: @attributes.except(*self.class.special_attrs))\n end",
"def attributes_get\n h = {}\n self.class.attributes.each do |a|\n h[a] = attribute_get(a)\n end\n h\n end",
"def attributes_get\n h = {}\n self.class.attributes.each do |a|\n h[a] = attribute_get(a)\n end\n h\n end"
] |
[
"0.7786013",
"0.7786013",
"0.7786013",
"0.7786013",
"0.7786013",
"0.7786013",
"0.7786013",
"0.7786013",
"0.7786013",
"0.7786013",
"0.7786013",
"0.74917036",
"0.7422734",
"0.74148524",
"0.7285061",
"0.7225994",
"0.718594",
"0.7170905",
"0.7168279",
"0.7099865",
"0.7087319",
"0.70798475",
"0.70289165",
"0.7012435",
"0.7009905",
"0.69672257",
"0.6964757",
"0.6956832",
"0.6956832",
"0.6954591",
"0.69172406",
"0.6915789",
"0.6912067",
"0.6911315",
"0.689884",
"0.6866212",
"0.6865392",
"0.6863828",
"0.68458146",
"0.6844057",
"0.6842922",
"0.68397295",
"0.68069494",
"0.6791889",
"0.67898816",
"0.67892087",
"0.67705667",
"0.67648655",
"0.67603964",
"0.6754123",
"0.6752896",
"0.67503554",
"0.67503554",
"0.67503554",
"0.6735857",
"0.6735857",
"0.6735857",
"0.6735857",
"0.6735857",
"0.67278534",
"0.67252177",
"0.6711239",
"0.67057717",
"0.6699306",
"0.6697988",
"0.66944665",
"0.66903055",
"0.6689737",
"0.6685988",
"0.6675315",
"0.6660624",
"0.6658679",
"0.6650557",
"0.6647554",
"0.66447407",
"0.6644567",
"0.66380143",
"0.6630003",
"0.6623115",
"0.6623115",
"0.66219187",
"0.6621271",
"0.66196036",
"0.66196036",
"0.66196036",
"0.66196036",
"0.66196036",
"0.66196036",
"0.66196036",
"0.6617657",
"0.66170794",
"0.66123617",
"0.66091615",
"0.66087836",
"0.66066545",
"0.66066545",
"0.66066545",
"0.6598366",
"0.6593533",
"0.65929186",
"0.65929186"
] |
0.0
|
-1
|
get all the eav attribute instances available for this model instance eg: if you model says 'has_eav :through => :post_attribute' these are all PostAttribute's
|
def eav_attributes
@eav_attributes ||= eav_class.all(
:conditions => { self_key => self.id }
)
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def eav_attributes_list # :nodoc:\n (\n self.instance_eav_attributes + self.class_eav_attributes.keys\n ).collect { |attribute| attribute.to_s }.uniq\n end",
"def instance_eav_attributes\n []\n end",
"def class_eav_attributes\n self.class.class_eav_attributes\n end",
"def attribute_values\n self.class.attributes.map{ |attr| self.send(attr) }\n end",
"def attributes\n query[ model_name ]\n end",
"def attribute_values \n columns = self.class.columns\n columns.map { |col| self.send(col) } #=> ex. [:id, :name, :owner_id]\n end",
"def attribute_values\n attributes.values\n end",
"def attr_associations\n @attr_associations\n end",
"def get_attribute_values() \n @attribute_values_flat\n end",
"def attribute_sets\n return @attribute_sets\n end",
"def attributes\n @attribute_ids.collect { |idx| BAttribute.store[idx] }\n end",
"def attribute_values\n self.class.columns.map { |attr| self.send(attr) }\n end",
"def values\n @attrs.values\n end",
"def attributes\n instance_values\n end",
"def class_eav_attributes # :nodoc:\n if superclass != ActiveRecord::Base\n if superclass.class_eav_attributes.nil?\n @eav_attributes\n else\n @eav_attributes.nil? ? superclass.class_eav_attributes : superclass.class_eav_attributes.merge(@eav_attributes)\n end\n else\n @eav_attributes\n end\n end",
"def attribute_values\n self.class.columns.map { |col| self.send(col) }\n end",
"def attribute_values(attributes)\n attributes.map { |attribute| self.send(attribute) }\n end",
"def index\n @exp_attributes = ExpAttribute.all\n end",
"def index\n if @inspection==nil then\n @attrs = Attr.all\n else\n @attrs = @inspection.attrs\n end\n end",
"def attribute_values\n self.class.columns.map { |column| send(column) }\n end",
"def attributions_objects\n self.parent.attributions.collect { |a| a.other_object }\n end",
"def attributes\n Address.attribute_list.index_with { |_attr| nil }\n end",
"def attributes\n @attrs.keys\n end",
"def stored_attributes\n @attributes.select(&:store)\n end",
"def attributes\n instance_values\n end",
"def attributes\n load_attributes! unless attributes_loaded?\n @attributes.values\n end",
"def attributes\n @list.map(&:attributes)\n end",
"def attributes\n @attributes ||= []\n @attributes\n end",
"def attribute_values\n # call Array#map on SQLObject::columns, call send on the instance to \n # get the value\n self.class.columns.map { |attribute| self.send(attribute) }\n end",
"def attributes\n @attributes ||= []\n end",
"def public_values\n self.class.public_attributes.map do |attribute|\n self.send(\"#{attribute}\")\n end\n end",
"def attributes\n self.attribute_keys.inject({}) do |hash, key|\n hash[key] = self.__send__(key) if self.__send__(key)\n hash\n end\n end",
"def index\n @collectible_attribute_lists = CollectibleAttributeList.all\n end",
"def attribute_values\n @columns.map do |column|\n @attributes[column.to_sym]\n end\n end",
"def all_attributes(key, posts=articles)\n attribs = []\n posts.each do |article|\n case article[key]\n when NilClass\n next\n when String\n attribs << article[key]\n when Array\n attribs << article[key].map { |e| e }\n end\n end\n attribs.flatten.compact.sort.uniq\n end",
"def amee_ivds\n @amee_ivds||=amee_item_definition.item_value_definition_list.select{|x|x.versions.include?(\"2.0\")}\n end",
"def get_attributes\n\t\t\t@@attributes\n\t\tend",
"def find_attributes(name)\n\t\t\tr=[]\n\t\t\tp=self\n\t\t\twhile(p)\n\t\t\t\tif(p.respond_to?(name))\n\t\t\t\t\tv=p.send(name)\n\t\t\t\t\tr << v if(v)\n\t\t\t\tend\n\t\t\t\tbreak if(!p.respond_to?(\"container\"))\n\t\t\t\tp=p.container\n\t\t\tend\n\t\t\tr\n\t\tend",
"def attributes\n attrs = Hash.new\n attribute_list.each do |attribute|\n value = self.send(attribute)\n attrs[attribute] = value unless value.nil?\n end\n attrs\n end",
"def attributes_get\n h = {}\n self.class.attributes.each do |a|\n h[a] = attribute_get(a)\n end\n h\n end",
"def attributes_get\n h = {}\n self.class.attributes.each do |a|\n h[a] = attribute_get(a)\n end\n h\n end",
"def attributes\n @cache[:attributes]\n end",
"def model_filters(model)\n model.attribute_names + model.reflection_names\n end",
"def attribute_values\n @attribute_values ||= {}\n end",
"def get_virtual_attributes(attribute_names, cols, field_to_match = :display_name)\n sp_hash = {\n model_name: :attribute,\n filter: [:oneof, field_to_match, attribute_names],\n cols: Aux.array_add?(cols, field_to_match)\n }\n get_children_from_sp_hash(:attribute, sp_hash)\n end",
"def attr_list\n\t\ta_list \n\tend",
"def serializable_hash options=nil\n hash = super\n eav_attributes_list.each do |attribute|\n hash[attribute] = self.send(attribute)\n end\n\n hash\n end",
"def attributes\n @attributes\n end",
"def contained_attributes\n @images.map(&:attribute).uniq\n end",
"def attributes\n @attrs\n end",
"def index\n @attributes = Attribute.all\n end",
"def attributes_for( an_instance )\n attrs = self.class.attributes[an_instance.class.name] \n raise \"Unable to get attributes for #{an_instance}\" unless attrs\n attrs\n end",
"def index\n @attractives = Attractive.all\n end",
"def attributes\n @@attributes\n end",
"def attributes\n @attributes\n end",
"def attributes\n @attributes\n end",
"def attributes\n @attributes\n end",
"def attribute_list # :nodoc:\n [:id, :version, :uid, :user, :timestamp, :changeset, :tags]\n end",
"def export_attrs\n self.class.export_attrs || []\n end",
"def attribute_keys\n self.class.attribute_keys\n end",
"def attributes\n @attributes\n end",
"def attribute_keys\n return [] unless self[:attributes]\n self[:attributes].keys\n end",
"def save_eav_attributes # :nodoc:\n eav_attributes.select { |a| a.changed? }.each do |a|\n if a.new_record?\n a.send( :write_attribute, self_key, self.id )\n end\n\n a.save!\n end\n end",
"def destroy_eav_attributes # :nodoc:\n eav_class.send :delete_all, \"#{self_key} = #{self.id}\"\n end",
"def attributes\n @data.keys\n end",
"def attributes\n self.class.attribute_names.map do |attr|\n type = self.class.attribute_types[attr.to_s]\n value = public_send(attr)\n [attr, type ? type.serialize(value) : value]\n end.to_h\n end",
"def attribute_list # :nodoc:\n [:id, :version, :uid, :user, :timestamp, :changeset]\n end",
"def non_foreign_key_values\n vals = []\n non_foreign_key_fields.each do |field|\n vals << self.send(field)\n end\n vals\n end",
"def loaded_attributes\n properties.map{|p| p.name if attribute_loaded?(p.name)}.compact\n end",
"def index\n @attribute_lists = AttributeList.all\n end",
"def attribute_list\n [:id, :version, :uid, :user, :timestamp, :lon, :lat, :changeset]\n end",
"def attributes\n self.class.attributes\n end",
"def user_attribute_assignments\n return @user_attribute_assignments\n end",
"def attributes\n self.class.fields.inject({}) do |attribute_hash, field|\n attribute_hash[field] = send(field)\n attribute_hash\n end\n end",
"def attributes\n []\n end",
"def object_attributes\n []\n end",
"def attributes\n @attributes ||= Set.new\n end",
"def attribute_list(el); end",
"def index\n @admin_attributes = Admin::Attribute.all\n end",
"def attributes\n scraper.attributes.keys + uri_response_attributes + [:feed]\n end",
"def searchable_attribute_names\n if model.respond_to?(:searchable_alchemy_resource_attributes)\n model.searchable_alchemy_resource_attributes\n else\n attributes.select { |a| searchable_attribute?(a) }\n .concat(searchable_relation_attributes(attributes))\n .collect { |h| h[:name] }\n end\n end",
"def attributes\n ATTRIBUTES.inject({}) do |hash, attribute|\n hash[attribute] = self.send(attribute)\n hash\n end\n end",
"def attributes\n ATTRIBUTES.inject({}) do |hash, attribute|\n hash[attribute] = self.send(attribute)\n hash\n end\n end",
"def all_attributes\n the_attrs = Hash[accessors.collect {|v| [v, send(v.to_s)] if respond_to? \"#{v}\".to_sym}]\n (respond_to?(:attributes) && attributes.merge(the_attrs)) || the_attrs\n end",
"def proxyable_attributes\n return proxyable.proxyable_attributes if proxyable.respond_to?(:proxyable_attributes)\n attribute_names = proxyable.attribute_names - ExcludedAttributes\n proxyable.attributes.select{ |key, value| attribute_names.include?(key) }\n end",
"def attributes\n self.class::ATTRIBUTES\n end",
"def attributes_to_set\n []\n end",
"def get_contained_attribute_ids(_opts = {})\n get_directly_contained_object_ids(:attribute) || []\n end",
"def index\n @vigs = @member.vigs.active.desc(:created_at).limit(4)\n @vigs_old = @member.vigs.closed.desc(:created_at).limit(6)\n @attr = Vig.test_applicate(@vigs)\n end",
"def attributes\n self._attributes.inject({}) do |hash, attr|\n hash[attr.to_s] = send(attr)\n hash\n end\n end",
"def attributes\n @_attributes\n end",
"def attributes\n @attributes ||= get_field_by_type(ATTRIBUTE_FIELDS)\n end",
"def attributes\n [@attribute,@value].inject(Hash.new([])) do |memo,c|\n case c \n when Sower::Relation::Statement, Sower::Relation::Attribute, Sower::Relation::Value::Base\n memo.merge!(c.attributes){|k,v,n| v | n}\n end\n memo\n end\n end",
"def list_attributes\n if @attributes.empty?\n fetch_configuration()\n end\n return @attributes.keys\n end",
"def all_association_reflections\n association_reflections.values\n end",
"def values(language = DEFAULT_LANGUAGE)\n @attributes[language].values.map {|attribute| attribute.value}\n end",
"def attributes\n @attributes ||= descriptors_fields.select{|field| field.scope == ATTRIBUTE_FIELDS }\n end",
"def klass_attributes(all: false)\n attributes = (klass.new().attributes rescue nil)\n return [] unless attributes\n\n names = attributes.keys - belong_tos.map { |reference| reference.foreign_key }\n names = names - [klass.primary_key, 'created_at', 'updated_at'] unless all\n\n attributes = names.map do |name|\n if klass.respond_to?(:column_for_attribute) # Rails 4+\n Effective::Attribute.new(name, klass.column_for_attribute(name).type)\n else\n Effective::Attribute.new(name, klass.columns_hash[name].type)\n end\n end\n\n sort_by_written_attributes(attributes)\n end",
"def _filtered_attributes\n return accessible_attributes.to_a if accessible_attributes.present?\n\n return self.new.attributes.keys - protected_attributes.to_a\n end",
"def members\n attributes.keys\n end"
] |
[
"0.7160483",
"0.71404773",
"0.6560422",
"0.62237036",
"0.6057279",
"0.6022066",
"0.6004467",
"0.5991975",
"0.5979192",
"0.5960487",
"0.5939792",
"0.58464634",
"0.58055544",
"0.57552516",
"0.5714781",
"0.57125956",
"0.5695753",
"0.56900287",
"0.56176496",
"0.5597341",
"0.5591325",
"0.5570004",
"0.5568022",
"0.5561036",
"0.5556425",
"0.5554314",
"0.5545758",
"0.5501374",
"0.550056",
"0.54834366",
"0.545549",
"0.54554373",
"0.54499507",
"0.5445825",
"0.5437096",
"0.5426948",
"0.54233396",
"0.5418518",
"0.5397199",
"0.5383631",
"0.5383631",
"0.53747225",
"0.53713465",
"0.5358843",
"0.5358433",
"0.5357314",
"0.53476995",
"0.5341179",
"0.53407097",
"0.5338636",
"0.53374076",
"0.5333391",
"0.53316313",
"0.5314404",
"0.5313305",
"0.5313305",
"0.5313305",
"0.5301955",
"0.52853966",
"0.5260556",
"0.5256153",
"0.5239113",
"0.5236287",
"0.523471",
"0.5233046",
"0.52302396",
"0.52268696",
"0.5226191",
"0.52168787",
"0.5210636",
"0.51899433",
"0.51734614",
"0.517236",
"0.51674545",
"0.51634645",
"0.51581275",
"0.5152873",
"0.51482344",
"0.51479185",
"0.513894",
"0.51330316",
"0.513244",
"0.513244",
"0.51321834",
"0.513073",
"0.51201373",
"0.5119296",
"0.51189023",
"0.511484",
"0.5113154",
"0.5112923",
"0.5109556",
"0.5108214",
"0.5107705",
"0.5107546",
"0.51037633",
"0.5099815",
"0.5099224",
"0.5099127",
"0.5098934"
] |
0.72051424
|
0
|
save the list of eav_attribute back to the database
|
def save_eav_attributes # :nodoc:
eav_attributes.select { |a| a.changed? }.each do |a|
if a.new_record?
a.send( :write_attribute, self_key, self.id )
end
a.save!
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def save_save_list\n save_list.each do |obj|\n obj.save!\n end\n end",
"def store_values\n self.parent.write_attribute(self.field_name, self.ids)\n end",
"def save_flex_attributes\n @save_flex_attr ||= []\n attribute_class = self.flex_options[:class_name].constantize\n base_foreign_key = self.flex_options[:base_foreign_key] # e.g. location_id\n value_field = self.flex_options[:value_field]\n name_field = self.flex_options[:name_field]\n foreign_key = self.flex_options[:foreign_key]\n \n # first, delete everything, unless we're not making changes:\n if self.flex_options[:purge] || !@save_flex_attr.empty?\n attribute_class.delete_all(deletion_query(foreign_key))\n related_attrs.reload\n self.flex_options.delete(:purge)\n end\n \n #now, rebuild things:\n @save_flex_attr.each do |pair|\n attr_name, value = pair\n parameters = {\n foreign_key => self.id,\n value_field => value,\n name_field => attr_name\n }\n parameters[self.flex_options[:version_column]] = self.send(flex_options[:version_column]) if self.flex_options[:versioned]\n \n build_related_attr_field( parameters )\n end\n @save_flex_attr = []\n end",
"def save \n attributes = []\n \n instance_variables.each do |i| \n attributes << i.to_s.delete(\"@\") \n end \n \n \n query_hash = {} \n \n attributes.each do |a| #each with object \n value = self.send(a)\n query_hash[a] = value \n end \n\n query_hash.each do |key, value|\n DATABASE.execute(\"UPDATE students SET #{key} = ? WHERE id = #{@id}\", value)\n end \n end",
"def save\n values.save\n end",
"def save\n @data.map(&:save)\n end",
"def instance_eav_attributes\n []\n end",
"def save_amee(values)\n AmeeMemoised.zip(values).each do |prop,val|\n instance_variable_set(\"@#{prop.to_s}\",val)\n end\n end",
"def map_saved_attributes(attrs)\n attrs.each do |key, value|\n send(\"#{key}=\", value)\n end\n end",
"def map_saved_attributes(attrs)\n attrs.each do |key, value|\n send(\"#{key}=\", value)\n end\n end",
"def save_offers\n # delete nil elements, first one usually\n @new_offers.delete_if{|o| o.name.nil?}\n @new_offers.each do |offer|\n offer.save\n end\n end",
"def save_many(collection)\n collection.each do |data|\n save(data)\n end\n end",
"def persistanse_data\n @attributes.to_json\n end",
"def save_dynamic_attributes\n return if @dynamic_attr_cache.blank?\n\t\t\t\n @dynamic_attr_cache.each do |attr_name, attr_value|\n dynamic_attribute = self.dynamic_attributes.where(:key => attr_name).first\n if dynamic_attribute.blank?\n\t\t\t\t\tunless attr_value.nil?\n\t # Create a new attribute\n\t dynamic_attribute = DynamicAttribute.create(:target => self, :key => attr_name.to_s, :value => attr_value.to_s)\n\t self.dynamic_attributes << dynamic_attribute \n\t\t\t\t\tend\n elsif attr_value.nil?\n # Destory the attribute if nil\n dynamic_attribute.destroy\n else\n # Update the attribute\n dynamic_attribute.update_attribute(:value, attr_value.to_s)\n end\n end\n \n end",
"def save_everything\r\n\t\tself.pictures = ImageAsset.where(attachable_id: self.id, attachable_type: \"Product\")\r\n\t\tself.pictures.each do |asset|\r\n\t\t\tasset.product_id = self.id\r\n\t\t\tasset.user_id = self.user.id\r\n\t\t\tasset.save!\r\n\t\tend\r\n\t\tif !self.pictures.empty?\r\n\t\t\tself.product_pic = self.pictures.last\r\n\t\tend\r\n\t\tself.feature_groups.each do |f|\r\n\t\t\tf.product = self\r\n\t\t\tf.product_id = self.id\r\n\t\t\tf.save!\r\n\t\tend\r\n\t\t\r\n\tend",
"def save_ssdb_attrs\n params = (changes.keys & self.class.ssdb_attr_names).map do |attr|\n [\"#{ssdb_attr_key(attr)}\", changes[attr][1]]\n end\n\n ssdb_attr_pool.with do |conn|\n conn.mset(*params.flatten)\n end if params.length > 0\n end",
"def update attributes\n attributes.each do |name, value|\n send \"#{name}=\", value if respond_to? \"#{name}=\"\n end\n save\n end",
"def eav_attributes_list # :nodoc:\n (\n self.instance_eav_attributes + self.class_eav_attributes.keys\n ).collect { |attribute| attribute.to_s }.uniq\n end",
"def __save_on_database(db, t)\n t.rubyrel_catalog.base_relvar_attributes << __to_catalog_tuple\n end",
"def save!\n @data.map(&:save!)\n end",
"def save\n attributes = []\n \n instance_variables.each do |i|\n attributes << i.to_s.delete(\"@\")\n end\n \n query_components_array = []\n \n attributes.each do |a|\n value = self.send(a)\n \n if value.is_a?(Integer)\n query_components_array << \"#{a} = #{value}\"\n else\n query_components_array << \"#{a} = '#{value}'\"\n end\n end\n \n query_string = query_components_array.join(\", \")\n # name = 'Sumeet', age = 75, hometown = 'San Diego'\n\n DATABASE.execute(\"UPDATE slides SET #{query_string} WHERE id = #{id}\")\n return self\n end",
"def op_savea\n push vm.save(pop)\n end",
"def stored_attributes\n @attributes.select(&:store)\n end",
"def save\n attributes = []\n \n instance_variables.each do |i|\n attributes << i.to_s.delete(\"@\") if i != :@table\n end\n \n query_components_array = []\n \n attributes.each do |a|\n value = self.send(a)\n \n if value.is_a?(Integer)\n query_components_array << \"#{a} = #{value}\"\n else\n query_components_array << \"#{a} = '#{value}'\"\n end\n end\n \n query_string = query_components_array.join(\", \")\n # name = 'Sumeet', age = 75, hometown = 'San Diego'\n\n DATABASE.execute(\"UPDATE students SET #{query_string} WHERE id = #{id}\")\n return self\n end",
"def destroy_eav_attributes # :nodoc:\n eav_class.send :delete_all, \"#{self_key} = #{self.id}\"\n end",
"def store_product_attributes(listing_attrs)\n sku = listing_attrs[:vendor_sku]\n url = listing_attrs[:vendor_url]\n Listing.append_menards_url(sku, url)\n Listing.append_vendor_attrs(sku, listing_attrs)\n end",
"def values_for_database!(all_attribute_keys, attributes)\n all_attribute_keys.each do |key|\n next unless attributes.key?(key)\n\n if (type = serializable_keys[key])\n attributes[key] = type.serialize(attributes[key])\n end\n end\n attributes\n end",
"def attributes_to_set\n []\n end",
"def save; end",
"def save; end",
"def save; end",
"def save; end",
"def save; end",
"def save; end",
"def save; end",
"def save; end",
"def set_collectible_attribute_list\n @collectible_attribute_list = CollectibleAttributeList.find(params[:id])\n end",
"def attr_list\n\t\ta_list \n\tend",
"def save_vigencias\n #raise @tags.to_yaml\n unless @vigencias.nil?\n @vigencias.each do |vigencia_id|\n Tienevigencia.create(producto_id:self.id,vigencia_id:vigencia_id)\n end\n end\n\n end",
"def save\n @domain.put_attributes(@key, @attributes, :replace => :all)\n end",
"def save_new_tag_to_tag_table(tag_attributes)\n\n tag_attributes.split(\",\").each do |value|\n value=value.strip\n available_tag = Tag.where('tagname = ?', value).first #checking if added tag is available in the list/not.\n new_tag = Tag.create(:tagname => value) if available_tag.blank? #If it's a new tag then create and Add it to Tag list.\n available_tag.blank? ? self.insert_ids_to_post_tags(new_tag.id) : self.insert_ids_to_post_tags(available_tag.id) #Depending on tag available or it's a new tag, updating post_tags tag.\n end\n\n end",
"def save_to_spree\n ::Product.save_from_amazon({\n :attributes =>{\n :amazon_id => self.id,\n :sku => self.id,\n :name => self.name,\n :count_on_hand => 10,\n :available_on => 1.day.ago,\n :description => self.description,\n :price => self.price.to_f\n },\n\n :price => self.price.to_f,\n :images => self.images\n\n })\n end",
"def save(user)\n if valid?\n user.update(Hash[ATTRIBUTES.map { |attribute_name| [attribute_name, send(attribute_name.to_sym)] }])\n end\n end",
"def save_features\n self.features.each { |c| if c.destroy_association? then c.destroy else c.save end }\n self.added_features.each { |c| c.save unless c.nil? } unless self.added_features.nil?\n end",
"def save\n end",
"def after_save\n for a in changes.keys\n next if [\"updated_at\"].include? a\n oldv, newv = changes[a]\n e = Edit.new\n e.item_id = self.id\n e.attribute = a\n e.old_value = oldv\n e.new_value = newv\n e.save! # raises on failure\n end\n end",
"def save_to_list(list_id)\n elements=CartItem.where(:cart_id=>self.id)\n list=List.find(list_id)\n elements.each do |element|\n item=Item.find(element.item_id)\n list.list_items.build(:item_id=>item.id, :quantity=>element.quantity)\n end\n list.save\n end",
"def save\n\t\tend",
"def values_for_database!(all_attribute_keys, attributes)\n # TODO(lsmola) we'll need to fill default value from the DB to the NOT_NULL columns here, since sending NULL\n # to column with NOT_NULL constraint always fails, even if there is a default value\n all_attribute_keys.each do |key|\n next unless attributes.key?(key)\n\n if (type = serializable_keys[key])\n attributes[key] = type.serialize(attributes[key])\n end\n end\n attributes\n end",
"def set_attribute_list\n @character = Character.find(params[:character_id])\n @attribute_list = @character.attribute_list\n end",
"def save()\n @@list.push(self)\n end",
"def save\n json = JSON.dump @attributes\n\n @dbm[@id] = json\n\n true\n end",
"def save\n self.class.insert(key, attributes)\n true\n end",
"def save\n self.class.insert(key, attributes)\n true\n end",
"def update_attributes_on_list(sorted_list, attribute_list, options={})\n \n unless attribute_list.blank?\n 0.upto(sorted_list.length - 1) {|idx|\n if sorted_list[idx]\n if (attr = attribute_list[idx].delete_if{|x, y| x.to_s == 'number'}).any?\n sorted_list[idx].attributes = attr\n sorted_list[idx].save if options[:create]\n sorted_list[idx].save! if options[:create!]\n end\n elsif options[:create]\n sorted_list[idx] = self.send(options[:create], attribute_list[idx])\n end\n }\n end\n sorted_list\n end",
"def save\n end",
"def save\n end",
"def store_record_to_database(action, attribute_names_to_update = [])\n row = row_for_record\n row.values = attributes_to_row_values_hash(attribute_names_to_update)\n row.save\n end",
"def save\n @@all << self\n end",
"def save_atributos\n\n unless @pre.nil?\n @pre[:llave].each do |key,value|\n Atributo.create(producto_id:self.id,llave:value,valor:@pre[:valor][key],campo:'precio')\n end\n end\n\n unless @compraAtributo.nil?\n @compraAtributo[:llave].each do |key,value|\n Atributo.create(producto_id:self.id,llave:value,valor:@compraAtributo[:valor][key],campo:'compra')\n end\n end\n\n unless @polizaAtributo.nil?\n @polizaAtributo[:llave].each do |key,value|\n Atributo.create(producto_id:self.id,llave:value,valor:@polizaAtributo[:valor][key],campo:'poliza')\n end\n end\n\n unless @tipovehiculoAtributo.nil?\n @tipovehiculoAtributo[:llave].each do |key,value|\n Atributo.create(producto_id:self.id,llave:value,valor:@tipovehiculoAtributo[:valor][key],campo:'tipovehiculo')\n end\n end\n\n unless @tipoproductoAtributo.nil?\n @tipoproductoAtributo[:llave].each do |key,value|\n Atributo.create(producto_id:self.id,llave:value,valor:@tipoproductoAtributo[:valor][key],campo:'tipoproducto')\n end \n end\n \n unless @aseguradoraAtributo.nil?\n @aseguradoraAtributo[:llave].each do |key,value|\n Atributo.create(producto_id:self.id,llave:value,valor:@aseguradoraAtributo[:valor][key],campo:'aseguradora')\n end\n end\n \n unless @destacadoAtributo.nil?\n @destacadoAtributo[:llave].each do |key,value|\n Atributo.create(producto_id:self.id,llave:value,valor:@destacadoAtributo[:valor][key],campo:'destacado')\n end\n end\n\n unless @vigenciaAtributo.nil?\n @vigenciaAtributo[:llave].each do |key,value|\n Atributo.create(producto_id:self.id,llave:value,valor:@vigenciaAtributo[:valor][key],campo:'vigencia')\n end\n end\n\n end",
"def save_model\n refresh_catalog_record_id_from_form = catalog_record_ids.find { |id| id.refresh && id._destroy != \"1\" }&.value\n non_refresh_catalog_record_ids_from_form = catalog_record_ids.filter_map { |id| id.value if id.refresh != true && id._destroy != \"1\" }\n catalog_record_ids_from_form = [refresh_catalog_record_id_from_form].compact + non_refresh_catalog_record_ids_from_form\n\n new_catalog_links = CatalogRecordId.serialize(model, catalog_record_ids_from_form, refresh: refresh_catalog_record_id_from_form.present?)\n\n # now store everything in the cocina object\n updated_object = model\n identification_props = updated_object.identification.new(catalogLinks: new_catalog_links)\n updated_object = updated_object.new(identification: identification_props)\n Repository.store(updated_object)\n end",
"def save_version\n\t\t\t\t\t$TRACE.debug 9, \"save_version: at beginning: #{self.inspect}\"\n\t\t\t\t\tself.changed_attributes_aado ||= []\n\t\t\t\t\t$TRACE.debug 5, \"save_version, changed_attributes = #{changed_attributes_aado.inspect}\"\n\t\t\t\t\t#save_version_on_create if save_version?\n\t\t\t\t\tif (dobj = get_database_object) && !changed_attributes_aado.empty? then\n\t\t\t\t\t\tdobj.save_version(changed_attributes_aado)\n\t\t\t\t\tend\n\t\t\t\tend",
"def save\n @@all << self\n @@all = @@all.uniq\n end",
"def save_list_tb\n @saved_list_tb = @list\n end",
"def save\n indices = {}\n model.indices.each do |field|\n next unless (value = send(field))\n indices[field] = Array(value).map(&:to_s)\n end\n\n uniques = {}\n model.uniques.each do |field|\n next unless (value = send(field))\n uniques[field] = value.to_s\n end\n\n features = {\n \"name\" => model.name\n }\n\n if defined?(@id)\n features[\"id\"] = @id\n end\n\n @id = script(LUA_SAVE, 0,\n features.to_json,\n _sanitized_attributes.to_json,\n indices.to_json,\n uniques.to_json\n )\n\n return self\n end",
"def eav_attributes\n @eav_attributes ||= eav_class.all(\n :conditions => { self_key => self.id }\n )\n end",
"def save_item_reservations\n item_reservations.each do |ir| \n ir.save(false) \n end\n end",
"def save(options) \n table = options[\"table\"] \n attributes = []\n item_id = options[\"item_id\"]\n \n instance_variables.each do |i| \n attributes << i.to_s.delete(\"@\") \n end \n \n query_components_array = [] \n \n attributes.each do |a| \n value = self.send(a) \n \n if value.is_a?(Integer) \n query_components_array << \"#{a} = #{value}\" \n else \n query_components_array << \"#{a} = '#{value}'\" \n end \n end \n \n query_components_array.shift \n \n query_string = query_components_array.join(\", \")\n\n\n DATABASE.execute(\"UPDATE #{table} SET #{query_string} WHERE id = #{item_id}\")\n \n end",
"def _save\n properties\n end",
"def saveActivites(parms)\n if parms\n self.activite_ids = parms.values\n else\n self.activites.clear\n end\n end",
"def save_associations\n self.class.associations.each do |association_data|\n association_name = association_data[:name]\n\n next unless send(\"#{association_name}_used?\") && association = send(association_name)\n\n inline_creation = association_data[:inline] == :create && new_record?\n changed = association.is_a?(Collection) || association.changed?\n\n if association.respond_to?(:save) && changed && !inline_creation && association.save\n send(\"#{association_name}=\", association) # set id/ids columns\n end\n\n if (association_data[:inline] == true || inline_creation) && changed\n attributes[association_name] = association.to_param\n end\n end\n end",
"def save_all\n return if @loading_data\n\n json_data = JSON.dump(@model.to_h)\n\n LocalStorage['volt-store'] = json_data\n end",
"def save \n @@all << self\n end",
"def save_meta_value\n company.metadata.active.each do |md|\n case md.field_type\n when 'dropdown'\n meta_value = select_values.where(metadatum_id: md.id).first_or_initialize\n when 'textfield'\n meta_value = text_values.where(metadatum_id: md.id).first_or_initialize\n when 'textarea'\n meta_value = text_values.where(metadatum_id: md.id).first_or_initialize\n when 'checkbox'\n meta_value = checkbox_values.where(metadatum_id: md.id).first_or_initialize\n when 'date'\n meta_value = date_values.where(metadatum_id: md.id).first_or_initialize\n when 'datetime'\n meta_value = datetime_values.where(metadatum_id: md.id).first_or_initialize\n when 'number'\n meta_value = number_values.where(metadatum_id: md.id).first_or_initialize\n end\n meta_value.value = metadata[md.label]\n meta_value.save\n end\n end",
"def save\n @@all << self #The particular concert's copy of @all\n end",
"def save\n @@all.push(self)\n end",
"def save\n end",
"def saved_amee\n AmeeMemoised.map{|x|instance_variable_get(\"@#{x.to_s}\")}\n end",
"def save_elements\n self.custom_form_elements.each do |element|\n element.save(false) if element.changed?\n end\n\n # If we deleted any elements during the update process, they will now have a NULL\n # id. We actually want to delete them.\n # TODO not ideal solution\n CustomFormElement.destroy_all(\"custom_form_id IS NULL\")\n \n return true\n end",
"def save\n @@all << self\n end",
"def save\n end",
"def save\n end",
"def serialize_attrs\n @serialize_attrs ||= []\n end",
"def save_product_presentations\n product_presentations.each do |product_presentation|\n #the false param, bypasses validation.\n product_presentation.save(false)\n end\n end",
"def attributes\n list.values.map { |field| [field.name, field.value] }.to_h\n end",
"def save(place, history)\n @values.each { |v| v.save(place, history) }\n end",
"def save\n @@all << self\n end",
"def save\n @@all << self\n end",
"def save\n @@all << self\n end",
"def save\n @@all << self\n end",
"def save\n @@all << self\n end",
"def save\n @@all << self\n end",
"def save\n @@all << self\n end",
"def save\n @@all << self\n end",
"def save\n\n end",
"def save_all_fields_from_record(record)\n self.save_base_attributes(record)\n self.changed_keys = record.attributes.keys\n self.old_values ||= Hash.new\n self.new_values ||= Hash.new\n record.attributes.keys.each do |key|\n self.old_values[key] = record.attributes[key]\n self.new_values[key] = nil\n end\n self.filter_attributes(record)\n end",
"def save\n @@all << self\n end",
"def save_habtm_associations(version)\n @record.class.reflect_on_all_associations(:has_and_belongs_to_many).each do |a|\n next unless save_habtm_association?(a)\n habtm_assoc_ids(a).each do |id|\n PaperTrail::VersionAssociation.create(\n version_id: version.transaction_id,\n foreign_key_name: a.name,\n foreign_key_id: id\n )\n end\n end\n end",
"def save\n on_each_node :save\n end",
"def saved_list\n @savedToListModel = Array.new\n\n Image.where(saved_to_list: true).find_each do |item|\n @savedToListModel.append(item.url_name)\n end\n\n if @savedToListModel.empty?\n @savedToListModel.append(\"no_item.png\")\n else\n @@imageSavedList = @savedToListModel\n @@currentIndex = 0\n @currIfSaved = \"Saved\";\n end\n end"
] |
[
"0.6415177",
"0.6237235",
"0.61945754",
"0.6173415",
"0.6088706",
"0.6061614",
"0.5941664",
"0.5883169",
"0.58692884",
"0.5864993",
"0.5863809",
"0.57627577",
"0.5724682",
"0.5711941",
"0.56883806",
"0.5686315",
"0.5654714",
"0.5646488",
"0.5631958",
"0.5616012",
"0.55745417",
"0.55741906",
"0.5567467",
"0.5557297",
"0.55515176",
"0.5531233",
"0.5497787",
"0.54856455",
"0.5467593",
"0.5467593",
"0.5467593",
"0.5467593",
"0.5467593",
"0.5467593",
"0.5467593",
"0.5467593",
"0.5467069",
"0.5459653",
"0.5454658",
"0.54487395",
"0.5442751",
"0.5435895",
"0.5430547",
"0.54217017",
"0.54207164",
"0.5414863",
"0.5412344",
"0.5411323",
"0.5400631",
"0.5392916",
"0.5382784",
"0.5381717",
"0.5381535",
"0.5381535",
"0.53664434",
"0.5361186",
"0.5361186",
"0.53394854",
"0.53345805",
"0.5327575",
"0.53242487",
"0.5323693",
"0.5317929",
"0.5313751",
"0.5306735",
"0.53067064",
"0.530158",
"0.52935946",
"0.52902454",
"0.5288861",
"0.5286491",
"0.52831393",
"0.5275654",
"0.52610767",
"0.52512",
"0.52498454",
"0.52489066",
"0.5238626",
"0.5234405",
"0.52324235",
"0.52229756",
"0.52229756",
"0.52077353",
"0.5205699",
"0.5204476",
"0.52002555",
"0.5199313",
"0.5199313",
"0.5199313",
"0.5199313",
"0.5199313",
"0.5199313",
"0.5199313",
"0.5199313",
"0.5197706",
"0.5197507",
"0.5195284",
"0.5179441",
"0.5178843",
"0.5175593"
] |
0.7276086
|
0
|
destroy eav_attributes from database
|
def destroy_eav_attributes # :nodoc:
eav_class.send :delete_all, "#{self_key} = #{self.id}"
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def destroy\n row.delete_attribute(attr_name)\n row.save\n end",
"def destroy\n @exp_attribute.destroy\n end",
"def destroy\n @image_attrib.destroy\n end",
"def destroy\n @attr_val = AttrVal.find(params[:id])\n @attr_val.destroy\n \n respond_to do |format|\n format.html { redirect_to databaseformalizer_attr_vals_url }\n format.json { head :no_content }\n end\n end",
"def delete_attribute(key); end",
"def destroy\n @item_attribute_type.destroy\n end",
"def destroy\n @attribute_master.destroy\n @attribute_masters = AttributeMaster.all\n end",
"def remove_attribute(name); end",
"def remove_attribute(name); end",
"def remove_attribute(name); end",
"def remove_attribute(name); end",
"def destroy\n @ais_attribute = AisAttribute.find(params[:id])\n @ais_attribute.destroy\n\n respond_to do |format|\n format.html { redirect_to ais_attributes_url, notice: 'Record was successfully deleted.' }\n format.json { head :no_content }\n end\n end",
"def delete_attribute(attr_name)\n debug(\"Model#delete_attribute(#{attr_name.inspect})\")\n set_attribute(attr_name, nil)\n end",
"def delete_all_attributes\n model = Sketchup.active_model\n model.definitions.each { |d|\n delete_attributes(d.instances)\n }\n dicts = model.attribute_dictionaries\n if dicts\n dicts.delete('MSPhysics')\n dicts.delete('MSPhysics Sounds')\n dicts.delete('MSPhysics Replay')\n end\n end",
"def clear_attributes\n @attributes = nil\n end",
"def destroy\n update_attributes! deleted:true\n end",
"def destroy\n @actattribute = Actattribute.find(params[:id])\n @actattribute.destroy\n\n respond_to do |format|\n format.html { redirect_to(actattributes_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @attractive.destroy\n respond_to do |format|\n format.html { redirect_to attractives_url, notice: 'Attractive was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @attr.destroy\n respond_to do |format|\n format.html { redirect_to attrs_url }\n format.json { head :no_content }\n end\n end",
"def cleanup_after_destroy\n ActiveRecord::Base.connection.execute(\"DELETE FROM dynamo_field_values WHERE model_id = #{self.id}\")\n end",
"def destroy\n @norma.destroy\n end",
"def delete_attributes(ents)\n ents.each { |e|\n e.delete_attribute('MSPhysics') if e.get_attribute('MSPhysics', 'Type', 'Body') == 'Body'\n e.delete_attribute('MSPhysics Body')\n #~ e.delete_attribute('MSPhysics Joint')\n dict = e.attribute_dictionary('MSPhysics Joint')\n if dict\n dict.keys.each { k|\n e.delete_attribute('MSPhysics Joint', k) if k != 'Type'\n }\n end\n e.delete_attribute('MSPhysics Script')\n e.delete_attribute('MSPhysics Buoyancy Plane')\n }\n end",
"def destroy\n @catalog_product_attributes = CatalogProductAttributes.find(params[:id])\n @catalog_product_attributes.destroy\n\n respond_to do |format|\n format.html { redirect_to(catalog_product_attributes_url) }\n format.xml { head :ok }\n end\n end",
"def delete(attribute); end",
"def clear_ssdb_attrs\n ssdb_attr_pool.with do |conn|\n self.class.ssdb_attr_names.each { |attr| conn.del(ssdb_attr_key(attr)) }\n end\n end",
"def destroy\n @attribute = Attribute.find(params[:id])\n @attribute.destroy\n\n respond_to do |format|\n format.html { redirect_to attributes_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @attribute = Attribute.find(params[:id])\n @attribute.destroy\n\n respond_to do |format|\n format.html { redirect_to attributes_url }\n format.json { head :no_content }\n end\n end",
"def - (name) remove_attribute name end",
"def remove_attr(name); end",
"def remove_attr(name); end",
"def destroy\n @admin_attribute.destroy\n respond_to do |format|\n format.html { redirect_to admin_attributes_url, notice: 'Attribute was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @user_attribute = UserAttribute.find(params[:id])\n @user_attribute.destroy\n\n respond_to do |format|\n format.html { redirect_to(user_attributes_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @collection_attribute = CollectionAttribute.find(params[:id])\n @collection_attribute.destroy\n\n respond_to do |format|\n format.html { redirect_to(collection_attributes_url) }\n format.xml { head :ok }\n end\n end",
"def delete_attribute(ents, handle, name = nil)\n ents.each { |e|\n name ? e.delete_attribute(handle, name) : e.delete_attribute(handle)\n }\n end",
"def mark_for_destruction(attributes)\n self.class.embeddings.each do |embed|\n if attributes[embed]\n updates = attributes[embed].map { |model| model[:id] }.compact\n destroy = updates.empty? ? send(\"_super_#{embed}\".to_sym).select(:id) : send(\"_super_#{embed}\".to_sym).select(:id).where('id NOT IN (?)', updates)\n destroy.each { |model| attributes[embed] << { :id => model.id, :_destroy => '1' } }\n end\n end\n\n attributes\n end",
"def destroye\n self.update_attribute(:status,7)\n end",
"def destroy\n @attri = Attri.find(params[:id])\n @attri.destroy\n\n respond_to do |format|\n format.html { redirect_to attris_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @site_attribute = @site.site_attributes.find(params[:id])\n @site_attribute.destroy\n\n respond_to do |format|\n format.html { redirect_to(site_site_attributes_url(@site)) }\n format.xml { head :ok }\n end\n end",
"def destroy!\n @domain.delete_attributes(@key)\n end",
"def remove_attr name\n each do |el|\n next unless el.respond_to? :remove_attribute\n el.remove_attribute(name)\n end\n self \n end",
"def destroy\n # @idp_attribute.destroy\n respond_to do |format|\n format.html { redirect_to idp_attributes_url, notice: 'IdP attribute can not be destroyed.' }\n format.json { head :no_content }\n end\n end",
"def kwattr_remove(attribute_name, keywords); end",
"def clean_attributes\n attributes.delete(:bare_metal)\n attributes.delete(:flavor_id)\n attributes.delete(:ephemeral_storage)\n end",
"def destroy\n @collectible_attribute_list.destroy\n respond_to do |format|\n format.html { redirect_to collectible_attribute_lists_url, notice: 'Collectible attribute list was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @prd_attribute = PrdAttribute.find(params[:id])\n @prd_attribute.destroy\n\n #delete_rules()\n\n respond_to do |format|\n format.html { redirect_to(prd_attributes_url) }\n format.xml { head :ok }\n format.json { head :ok }\n end\n end",
"def destroy\n @attribute_set.destroy\n respond_to do |format|\n format.html { redirect_to attribute_sets_url, notice: 'Attribute set was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @attribute_display.destroy\n respond_to do |format|\n format.html { redirect_to models_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @gen_attraction.destroy\n respond_to do |format|\n format.html { redirect_to gen_attractions_url, notice: 'Gen attraction was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @karyalay_attribute.destroy\n respond_to do |format|\n format.html { redirect_to karyalay_attributes_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @product_attribute_field = ProductAttributeField.find(params[:id])\n @product_attribute_field.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_product_attribute_fields_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @attribute.destroy\n respond_to do |format|\n format.html { redirect_to attributes_url, notice: 'Attribute was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @ezr_content_class_attribute = EzrContentClassAttribute.find(params[:id])\n @ezr_content_class_attribute.destroy\n\n respond_to do |format|\n format.html { redirect_to(ezr_content_class_attributes_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @default_attribute.destroy\n CharacterAttribute.where(default_attribute_id: @default_attribute.id).destroy_all\n respond_to do |format|\n format.html { redirect_to({ controller: 'default_attributes', action: 'index', book_id: @book.id }) }\n format.json { head :no_content }\n end\n end",
"def destroy\n @topic_attribute = TopicAttribute.find(params[:id])\n \n @topic_attribute.opinions.each do |opinion|\n opinion.destroy\n end\n \n @topic_attribute.destroy\n\n respond_to do |format|\n format.html { \n redirect_to(root_path)\n #topic_attributes_url\n }\n format.xml { head :ok }\n end\n end",
"def destroy\n @attribute_list.destroy\n respond_to do |format|\n format.html { redirect_to attribute_lists_url }\n format.json { head :no_content }\n end\n end",
"def undestroy\n self.update_attribute(:deleted, nil)\n self.update_attribute(:deleted_at, nil)\n end",
"def destroy\n @property_hash[:ensure] = :absent\n end",
"def destroy\n @alignment = Alignment.get(params[:id])\n alignments = Alignment.all(:alignment_name => @alignment.alignment_name)\n alignments.each do |a|\n a.deleted_at = Time.now\n a.save\n end\n\n respond_to do |format|\n format.html { redirect_to(alignments_url) }\n format.xml { head :ok }\n end\n end",
"def delete_attribute(*args)\n end",
"def destroy\n @iconographic_attribute.destroy\n respond_to do |format|\n format.html { redirect_to iconographic_attributes_url, notice: 'Iconographic attribute was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @c_attribute.destroy\n respond_to do |format|\n format.html { redirect_to c_attributes_url, notice: 'C attribute was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def delete(key)\n removeAttribute(key.to_s)\n end",
"def delete(key)\n removeAttribute(key.to_s)\n end",
"def delete(key)\n removeAttribute(key.to_s)\n end",
"def destroy\n clear\n save\n end",
"def destroy\n @question_attribute = QuestionAttribute.find(params[:id])\n @question_attribute.destroy\n\n respond_to do |format|\n format.html { redirect_to(question_attributes_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @media_attribute = MediaAttribute.find(params[:id])\n @media_attribute.destroy\n\n respond_to do |format|\n format.html { redirect_to(media_attributes_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @device_attribute.destroy\n\n respond_to do |format|\n format.html { redirect_to(device_attributes_url) }\n format.xml { head :ok }\n end\n end",
"def delete_record\n self.remote_attributes = self.class.identify(self).delete_instance if persisted?\n @destroyed = true\n end",
"def destroy\n @profile_attribute = current_user.profile_attributes.find(params[:id])\n @profile_attribute.destroy\n\n respond_to do |format|\n format.html { redirect_to(profile_attributes_url) }\n format.xml { head :ok }\n format.json { render :json => {:profile_attribute => @profile_attribute} }\n end\n end",
"def destroy\n @aws_dhcp_option_attribute.destroy\n respond_to do |format|\n format.html { redirect_to aws_dhcp_option_attributes_url, notice: 'Aws dhcp option attribute was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @user_attribute.destroy\n respond_to do |format|\n format.html { redirect_to user_attributes_url }\n format.json { head :no_content }\n end\n end",
"def DeleteAttributes(args)#(key, domainName, itemName, attributes)\n raise Error::NoSuchDomain.new if @storge.find_domain_by_name(args[:key],args[:domainName]).blank?\n @storge.delete_one_item_attrs(args[:key], args[:domainName], args[:itemName], args[:attributes])\n end",
"def destroy\n @ref_attribute.destroy\n respond_to do |format|\n format.html { redirect_to ref_attributes_url, notice: 'Ref attribute was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def persist\n prepare do\n document.attributes.delete(field)\n execute(\"$unset\")\n end\n end",
"def destroy\n @ad.destroy\n end",
"def destroy\n assert_keys_present!\n metal_scope.delete\n transient!\n self\n end",
"def destroy\n @evac_center.destroy\n end",
"def cleanup\n self.objectives.destroy_all\n end",
"def destroy; delete end",
"def delete\n results = submit_cmd('delete app instance',:db, \" -env #{self.belongs_to.env} -app_instance #{self.name}\")\n\n\t if ( results.to_s =~ /failure/i || results.to_s =~ /error/i)\n\t \t raise \"update attribute failed\" \n\t else\n\t \t self.belongs_to.appTemplates.delete(self)\n\t end\n\n end",
"def destroy\n self.update_attribute :deleted, true\n end",
"def destroy\n @farm_field.destroy\n end",
"def remove_videos_from_db\n Video.delete_all(\"cart_id = 1\" )\n end",
"def clear_attributes\n self.attribute_names.clear\n self.public_attribute_names.clear\n self.protected_attribute_names.clear\n\n true\n end",
"def clear(opts={})\n attribs = normalize_attribute_list opts[:attributes]\n except = opts[:except]\n if attribs\n if opts[:index]\n idx = opts[:index]\n values = @attributes[idx]\n if values\n attrs = except ? (values.keys-attribs) : attribs\n attrs.each {|a| values.delete(a)}\n @attributes[idx] = nil if values.empty?\n end\n else\n @attributes.each_with_index do |values,idx|\n if values\n attrs = except ? (values.keys-attribs) : attribs\n attrs.each {|a| values.delete(a)}\n @attributes[idx] = nil if values.empty?\n end\n end\n end\n while @attributes[-1].nil? && @attributes.size > 0 do\n @attributes.pop\n end\n else\n initialize\n end\n end",
"def destroy\n @cargapp_ad.destroy \n end",
"def destroy\n @data_attribute.destroy\n respond_to do |format|\n format.html { destroy_redirect @data_attribute, notice: 'Data attribute was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @taxon_attribute = TaxonAttribute.find(params[:id])\n @taxon_attribute.destroy\n\n respond_to do |format|\n format.html { redirect_to taxon_attributes_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @configattribdetail.destroy\n respond_to do |format|\n format.html { redirect_to configattribdetails_url, notice: 'Configattribdetail was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy()\n urn_check()\n @sparql.delete([ @urn, :p, :o ])\n @sparql.delete([ :s, :p, @urn ])\n end",
"def after_destroy\n ExhibitItem.destroy_all( [ \"exhibiting_id=? AND exhibiting_type=?\", self.id, self.class.name ] )\n ResourceListItem.destroy_all( [ \"resource_listing_id=? AND resource_listing_type=?\", self.id, self.class.name ] )\n PackageItem.destroy_all( [ \"packaging_id=? AND packaging_type=?\", self.id, self.class.name ] )\n end",
"def revoke(params)\n params[:key] = 'attributes'\n\n run_command :revoke, :domain, params\n end",
"def destroy\n Attend.all.each do |attend|\n if (attend.eventID == @event.id)\n attend.destroy\n end\n end\n @event.destroy\n redirect_to my_events_path\n end",
"def remove_orcid_attributes(cid )\n return if cid.blank?\n\n puts \"==> clearing ORCID attributes for #{cid}\"\n status = ServiceClient::OrcidAccessClient.instance.del_attribs_by_cid( cid )\n\n if ServiceClient::OrcidAccessClient.instance.ok?( status ) == false\n puts \"ERROR: ORCID service returns #{status}\"\n end\n end",
"def delete_kapp_attribute_definition(kapp_slug, name, headers=default_headers)\n @logger.info(\"Deleting the \\\"#{name}\\\" Kapp attribute definition from the \\\"#{kapp_slug}\\\" kapp.\")\n delete(\"#{@api_url}/kapps/#{kapp_slug}/kappAttributeDefinitions/#{encode(name)}\", headers)\n end",
"def destroy; end",
"def destroy; end",
"def destroy; end",
"def destroy; end"
] |
[
"0.7304668",
"0.72847164",
"0.71885896",
"0.7016078",
"0.68958515",
"0.6863548",
"0.67528373",
"0.66602373",
"0.66602373",
"0.66602373",
"0.66602373",
"0.6653157",
"0.66492736",
"0.6625578",
"0.66135097",
"0.6468355",
"0.64663786",
"0.64618444",
"0.6456652",
"0.64319843",
"0.63772124",
"0.63682324",
"0.6351293",
"0.635094",
"0.63456887",
"0.6337738",
"0.6337738",
"0.63095254",
"0.62776226",
"0.62776226",
"0.62669545",
"0.626471",
"0.6264685",
"0.6233564",
"0.6211531",
"0.62026954",
"0.61642385",
"0.6162679",
"0.61557597",
"0.61475074",
"0.61352104",
"0.61189604",
"0.6111413",
"0.61029094",
"0.61006105",
"0.6091863",
"0.60916907",
"0.6085474",
"0.6082795",
"0.6081089",
"0.6078257",
"0.6066232",
"0.60644406",
"0.6035413",
"0.60294664",
"0.6025487",
"0.60242105",
"0.6022685",
"0.60195947",
"0.60186136",
"0.601282",
"0.60003656",
"0.60003656",
"0.60003656",
"0.600022",
"0.5991938",
"0.5987831",
"0.5980119",
"0.5966162",
"0.59605426",
"0.59576565",
"0.59423953",
"0.59374577",
"0.59355605",
"0.5927256",
"0.59247965",
"0.59067315",
"0.5902329",
"0.5900888",
"0.58891726",
"0.5881741",
"0.5872047",
"0.5867001",
"0.5853489",
"0.58533096",
"0.58469033",
"0.5843003",
"0.5832149",
"0.5830183",
"0.58293766",
"0.5826169",
"0.5794516",
"0.57915354",
"0.5790759",
"0.5785604",
"0.57849705",
"0.57782364",
"0.57782364",
"0.57782364",
"0.57782364"
] |
0.83372605
|
0
|
override changed if any of the eav_attributes has changed, the object has changed.
|
def changed?
eav_attributes.each do |attribute|
return true if ( attribute.changed? || attribute.new_record? )
end
super
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def save_eav_attributes # :nodoc:\n eav_attributes.select { |a| a.changed? }.each do |a|\n if a.new_record?\n a.send( :write_attribute, self_key, self.id )\n end\n\n a.save!\n end\n end",
"def changed_attributes\n @_hr_changed.select{|k,v| v}.keys.inject({}) {|h,k| h[k]=self[k]; h}\n end",
"def changed_attributes\n @changed_attributes ||= {}.with_indifferent_access\n end",
"def values_changed?\n unless tracked_attributes.present?\n raise TrackChangesError, 'Object has not been configured for change tracking.'\n end\n changed = marked_for_destruction? ? true : false\n tracked_attributes.each do |attr|\n break if changed\n if send(\"#{attr}_changed?\")\n changed = send(attr) == send(\"#{attr}_was\") ? false : true\n end\n end\n self.exclude_from_save = !changed\n changed\n end",
"def changed_attributes\n @changed_attributes ||= {}\n end",
"def changed_attributes\n @changed_attributes ||= {}\n end",
"def original_attributes\n {}.with_indifferent_access.merge(attributes).merge(changed_attributes)\n end",
"def changed(attribute_name)\n end",
"def change\n attributes.fetch(:change)\n end",
"def attribute_will_change!(attr)\n begin\n value = __send__(attr)\n value = value.duplicable? ? value.clone : value\n rescue TypeError, NoMethodError\n end\n\n changed_attributes[attr] = value\n end",
"def changed_attributes\r\n attributes = HashWithIndifferentAccess.new\r\n \r\n if self.edited\r\n %w{rate name}.each do |attr|\r\n if self.different?(attr)\r\n attributes[attr] = self.send(attr)\r\n end\r\n end\r\n end\r\n attributes\r\n end",
"def changed?\n !changed_attributes.empty?\n end",
"def write_changed_attributes\n @properties.each do |attribute, value|\n write_attribute(attribute, value) if changed_attributes.has_key?(attribute)\n end\n end",
"def clear_changed_attributes\n\t\t\t \t\t$TRACE.debug 5, \"clear_changed_attributes\"\n\t\t\t \tself.changed_attributes_aado = []\n\t\t\t \tend",
"def changed\n @deleted = false\n @changed = true\n end",
"def attribute_changed_value_message=(_arg0); end",
"def write_changed_attributes\n @_properties.each do |attribute, value|\n write_property_from_db(attribute, value) if changed_attributes.has_key?(attribute)\n end\n end",
"def old_attributes\n (audited_changes || {}).inject({}.with_indifferent_access) do |attrs, (attr, values)|\n attrs[attr] = Array(values).first\n attrs\n end\n end",
"def log_attr_changes(obj)\n pre_update_attrs = obj.attributes.clone\n yield obj\n ADMIN_AUDIT_LOG.info([\n current_user.try(:login_name),\n \"#{obj.class.name}<#{obj.id}>\",\n \"new:#{Hash[obj.attributes.select{|k, v| pre_update_attrs[k] != v}].inspect}\",\n \"old:#{Hash[pre_update_attrs.select{|k, v| obj.attributes[k] != v}].inspect}\",\n ].compact.join(' '))\n end",
"def changed_attributes\n return {} if @_hr_changed.nil?\n @_hr_changed.select{|k,v| v}.keys.inject({}) {|h,k| h[k]=self[k]; h}\n end",
"def class_eav_attributes # :nodoc:\n if superclass != ActiveRecord::Base\n if superclass.class_eav_attributes.nil?\n @eav_attributes\n else\n @eav_attributes.nil? ? superclass.class_eav_attributes : superclass.class_eav_attributes.merge(@eav_attributes)\n end\n else\n @eav_attributes\n end\n end",
"def changed?(attr_name = nil)\n\t\t\t\t\tself.changed_attributes_aado ||= []\n\t\t\t \tattr_name.nil? ?\n\t\t\t \t\t(changed_attributes_aado and changed_attributes_aado.length > 0) :\n\t\t\t \t\t(changed_attributes_aado and changed_attributes_aado.include?(attr_name.to_s))\n\t\t\t \tend",
"def anything_changed?\n self.changed?;\n end",
"def changed?\n return true if attributes_changed?\n return true if associations_changed?\n false\n end",
"def changed=(value)\n @changed = value\n @deleted = false if value == true\n end",
"def previously_changed_attributes\n @previously_changed || {}\n end",
"def changed\n self.class.fields.select do |field|\n field[0] != '_' and self._old_values[field] != self.send(field)\n end\n end",
"def filter_attributes(record)\n self.changed_keys ||= []\n if !record.auditable_attributes.nil?\n self.changed_keys &= record.auditable_attributes\n end\n if !record.unauditable_attributes.nil?\n self.changed_keys -= record.unauditable_attributes\n end\n self.changed_keys -= %w{updated_at created_at _id}\n self.changed_keys\n end",
"def after_save\n for a in changes.keys\n next if [\"updated_at\"].include? a\n oldv, newv = changes[a]\n e = Edit.new\n e.item_id = self.id\n e.attribute = a\n e.old_value = oldv\n e.new_value = newv\n e.save! # raises on failure\n end\n end",
"def post_is_changed?\n if @post_permitted_attributes[:_changed]\n true\n end\n end",
"def save_state_as_change!(attributes={})\n @cached_recordable_attributes = { 'attributes' => {}, 'associations' => {} }\n self.write_changes!(attributes)\n end",
"def changed?(*args)\n attributes.changed?(*args)\n end",
"def dirty_attributes\n changed.inject({}) { |h, k| h[k] = attributes[k.to_s]; h }\n end",
"def attribute_changed?(attribute_name)\n (self.diff['attributes']['new']||{})[attribute] != (self.diff['attributes']['old']||{})[attribute]\n end",
"def changed_notably?\n if ignored_attr_has_changed?\n timestamps = @record.send(:timestamp_attributes_for_update_in_model).map(&:to_s)\n (notably_changed - timestamps).any?\n else\n notably_changed.any?\n end\n end",
"def attribute_change(attr)\n [changed_attributes[attr], __send__(attr)] if attribute_changed?(attr)\n end",
"def track_attribute _name, _new_value\n unless self.send(_name).eql?(_new_value)\n self.modified_attributes << _name.to_sym\n end\n end",
"def changed\n changed_attributes.keys\n end",
"def remote_update(*)\n super(changed)\n end",
"def mark_unchanged\r\n @changed = false\r\n end",
"def revert_changes!\n # Reassign the first value since we started tracking\n @changed_attributes.each_pair do |key, value|\n @attributes[key] = value.first\n end\n\n clear_tracked_changes!\n end",
"def attribute_previously_changed?(attr_name, **options) # :nodoc:\n mutations_before_last_save.changed?(attr_name.to_s, **options)\n end",
"def on_change(*attributes, &block)\n on_update(*attributes.push([NotNil, NotNil]), &block)\n end",
"def reset_persistence_values\n self.id = nil\n\n if respond_to?(:updated_at=)\n self.updated_at = nil\n self.updated_at_will_change!\n end\n\n if respond_to?(:created_at=)\n self.created_at = nil\n self.created_at_will_change!\n end\n\n # mark all other attributes is changing\n (attributes.keys - changes.keys).each{ |key| self.send(:\"#{key}_will_change!\") }\n end",
"def reset_changes_if_unchanged(record, name, previous)\n if record.versioned_changes.empty?\n name = name.to_s\n\n if previous\n __compat_set_attribute_was(name, previous)\n else\n __compat_clear_attribute_changes(name)\n end\n end\n end",
"def modified_properties=(value)\n @modified_properties = value\n end",
"def mark_changed\n self.last_changed = Time.now\n end",
"def attribute_changed?(attr)\n changed_attributes.include?(attr)\n end",
"def write_changed_attributes\n @_properties.each do |attribute, value|\n write_property_to_db(attribute, value) if changed_attributes.has_key?(attribute)\n end\n end",
"def instance_eav_attributes\n []\n end",
"def stamp_changed\n return unless changed?\n\n self.dateChanged = Time.now\n self.changedBy = ApplicationController.application_name\n end",
"def attribute_changes\n attributes.changes\n end",
"def modified?( original )\n DATA_ATTRIBUTES.any? { |e| send( e ) != original.send( e )}\n end",
"def alter_for_changes\n # attributes changes\n if @attributes_before_change\n alter_for.altered_attribute_names.each {|attribute|\n before = @attributes_before_change[attribute]\n after = alter_for.send(attribute)\n next if before == after || (before.blank? && after.blank?)\n add_attribute_detail(attribute, before, after)\n }\n end\n start\n end",
"def original_attributes_before_type_cast\n ensure_original_attributes_stored\n clone_attributes :read_original_attribute_before_type_cast\n end",
"def anything_changed?\n self.changed? || collection_anything_changed([self.general_fields, self.input_parameters, self.method_fields])\n end",
"def visiblity_changed\n # ::Deepblue::LoggingHelper.bold_debug [ Deepblue::LoggingHelper.here,\n # Deepblue::LoggingHelper.called_from,\n # Deepblue::LoggingHelper.obj_class( 'class', self ),\n # \"\" ]\n @update_attr_key_values = curation_concern.provenance_log_update_before( form_params: params[PARAMS_KEY].dup )\n if visibility_to_private?\n mark_as_set_to_private\n elsif visibility_to_public?\n mark_as_set_to_public\n end\n end",
"def update_received_modified\n self.received_at = Time.now if received_changed?\n end",
"def clean_attributes\n @attribute_changes = {}\n end",
"def record_object_changes?\n !@is_touch && super\n end",
"def association_changed(record)\n\t\ttouch if persisted?\n\tend",
"def eav_attributes\n @eav_attributes ||= eav_class.all(\n :conditions => { self_key => self.id }\n )\n end",
"def visiblity_changed\n # ::Deepblue::LoggingHelper.bold_debug [ Deepblue::LoggingHelper.here,\n # Deepblue::LoggingHelper.called_from,\n # Deepblue::LoggingHelper.obj_class( 'class', self ),\n # \"\" ]\n @update_attr_key_values = curation_concern.provenance_log_update_before( form_params: params[PARAMS_KEY].dup )\n if visibility_to_private?\n mark_as_set_to_private\n elsif visibility_to_public?\n mark_as_set_to_public\n end\n end",
"def destroy_eav_attributes # :nodoc:\n eav_class.send :delete_all, \"#{self_key} = #{self.id}\"\n end",
"def changed? \n @changed == true\n end",
"def audit_changed?(attr_name = nil)\n attr_name ? excepted_changes[attr_name.to_s] : !excepted_changes.empty?\n end",
"def override\n attributes.override\n end",
"def save_version\n\t\t\t\t\t$TRACE.debug 9, \"save_version: at beginning: #{self.inspect}\"\n\t\t\t\t\tself.changed_attributes_aado ||= []\n\t\t\t\t\t$TRACE.debug 5, \"save_version, changed_attributes = #{changed_attributes_aado.inspect}\"\n\t\t\t\t\t#save_version_on_create if save_version?\n\t\t\t\t\tif (dobj = get_database_object) && !changed_attributes_aado.empty? then\n\t\t\t\t\t\tdobj.save_version(changed_attributes_aado)\n\t\t\t\t\tend\n\t\t\t\tend",
"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 set_old_values\n self._old_values = {}\n\n self.class.fields.each do |field|\n self._old_values[field] = self.send(field) unless field[0] == '_'\n end\n end",
"def changed_attributes(update_value, student)\n\t\t@change_attribute= update_value.keys\n\t\t@change_attribute.each do |key|\n\t\t\tActivity.create_activity(\"update #{key} from #{update_value[key][0]} to #{update_value[key][1]}\", student)\n\t\tend\n\tend",
"def update_attributes!(attributes)\n super(mark_for_destruction(attributes))\n end",
"def set_whats_changed\n\n self.post_nodes.each do |post_node|\n if post_node.node.attributes[:_changed]\n post_node.attributes[:_changed] = true\n end\n\n if post_node.node.attributes[:_should_destroy]\n post_node.attributes[:_should_destroy] = true\n end\n end\n\n self.post_thumbs.each do |post_thumb|\n if post_thumb.node.attributes[:_changed]\n post_thumb.attributes[:_changed] = true\n end\n\n if post_thumb.node.attributes[:_should_destroy]\n post_thumb.attributes[:_should_destroy] = true\n end\n end\n\n end",
"def nested_attributes_update(meta, obj, attributes)\n nested_attributes_update_attributes(meta, obj, attributes)\n delay_validate_associated_object(meta[:reflection], obj)\n # Don't need to validate the object twice if :validate association option is not false\n # and don't want to validate it at all if it is false.\n after_save_hook{obj.save_changes(:validate=>false)}\n obj\n end",
"def new_version_additional_behaviour_after_save(old, new, params)\n\t\t# change report/block/delete\n\t\tchange_rbc old, new, 0\n\t\tcopy_mixed_fields old, new\n\t\tmixed_fields_update_series_references old, new\n\tend",
"def after_update\n super\n touch_associations\n end",
"def ignored_attr_has_changed?\n ignored = @record.paper_trail_options[:ignore] + @record.paper_trail_options[:skip]\n ignored.any? && (changed_in_latest_version & ignored).any?\n end",
"def changed_in_place?(raw_old_value, new_value)\n deserialize(raw_old_value) != new_value\n end",
"def changed_in_place?(raw_old_value, new_value)\n deserialize(raw_old_value) != new_value\n end",
"def dirty_attributes\n dirty_attributes = {}\n properties = self.properties\n\n original_values.each do |name, old_value|\n property = properties[name]\n new_value = property.get!(self)\n\n dirty = case property.track\n when :hash then old_value != new_value.hash\n else\n property.value(old_value) != property.value(new_value)\n end\n\n if dirty\n property.hash\n dirty_attributes[property] = property.value(new_value)\n end\n end\n\n dirty_attributes\n end",
"def update_attributes(attributes)\n super(mark_for_destruction(attributes))\n end",
"def changed?(uploaded_file)\n record.reload\n super\n end",
"def changed(_data)\n raise NotImplementedError.new\n end",
"def SetModified\n @modified = true\n\n nil\n end",
"def SetModified\n @modified = true\n\n nil\n end",
"def SetModified\n @modified = true\n\n nil\n end",
"def SetModified\n @modified = true\n\n nil\n end",
"def old_value; end",
"def visiblity_changed\n # ::Deepblue::LoggingHelper.bold_debug [ Deepblue::LoggingHelper.here,\n # Deepblue::LoggingHelper.called_from,\n # Deepblue::LoggingHelper.obj_class( 'class', self ),\n # \"\" ] if hyrax_my_collections_controller_debug_verbose\n @update_attr_key_values = curation_concern.provenance_log_update_before( form_params: params[PARAMS_KEY].dup )\n if visibility_to_private?\n mark_as_set_to_private\n elsif visibility_to_public?\n mark_as_set_to_public\n end\n end",
"def map_provenance_attributes_override!( event:, # rubocop:disable Lint/UnusedMethodArgument\n attribute:, # rubocop:disable Lint/UnusedMethodArgument\n ignore_blank_key_values:, # rubocop:disable Lint/UnusedMethodArgument\n prov_key_values: ) # rubocop:disable Lint/UnusedMethodArgument\n\n handled = false\n return handled\n end",
"def mark_as_saved!\n self.saved_attributes = attributes.dup\n self\n end",
"def notify_attribute_changes\n ignore = [\"updated_at\", \"user_id\"]\n changed.each do |property|\n delta = changes[property]\n event_name = \"user_update_item_#{property}\" \n ActivityLogger.send(event_name, :from => self.user, :for => [self], :changes => delta) unless ignore.include? property\n end \n end",
"def notify_attribute_changes\n ignore = [\"updated_at\", \"user_id\"]\n changed.each do |property|\n delta = changes[property]\n event_name = \"user_update_item_#{property}\" \n ActivityLogger.send(event_name, :from => self.user, :for => [self], :changes => delta) unless ignore.include? property\n end \n end",
"def attribute_changed_in_latest_version?(attr_name)\n if @in_after_callback && RAILS_GTE_5_1\n @record.saved_change_to_attribute?(attr_name.to_s)\n else\n @record.attribute_changed?(attr_name.to_s)\n end\n end",
"def changed\n mutations_from_database.changed_attribute_names\n end",
"def field_modified!(modified_field = nil)\n serialize_fields\n end",
"def after_update\n super\n clear_instance_filters\n end"
] |
[
"0.68536747",
"0.64793795",
"0.64159346",
"0.63754934",
"0.6277467",
"0.6277467",
"0.6178014",
"0.6160696",
"0.61295795",
"0.6078641",
"0.60720426",
"0.5986306",
"0.5982237",
"0.5976874",
"0.5960141",
"0.59529346",
"0.5917471",
"0.59070575",
"0.5902903",
"0.58974177",
"0.58773065",
"0.58317125",
"0.58285314",
"0.58074087",
"0.5799326",
"0.5796453",
"0.57897717",
"0.57737887",
"0.5767975",
"0.5752089",
"0.5751648",
"0.57420087",
"0.5737657",
"0.57360816",
"0.5727461",
"0.57272726",
"0.57196885",
"0.57186747",
"0.5714901",
"0.5712673",
"0.57036877",
"0.5700004",
"0.5684231",
"0.5679528",
"0.56794405",
"0.5668783",
"0.56621915",
"0.5652835",
"0.5649292",
"0.56147337",
"0.5612513",
"0.56016743",
"0.5601304",
"0.55965966",
"0.5593005",
"0.55920273",
"0.5583999",
"0.5576494",
"0.5565831",
"0.5544786",
"0.5544461",
"0.5543122",
"0.5538602",
"0.55323035",
"0.5530052",
"0.55293465",
"0.55283153",
"0.5527989",
"0.5524593",
"0.5524593",
"0.5524593",
"0.5524593",
"0.5521248",
"0.55154526",
"0.5501995",
"0.54996175",
"0.54900587",
"0.54886377",
"0.5485993",
"0.54819965",
"0.5475342",
"0.5475342",
"0.5470568",
"0.54667616",
"0.5463878",
"0.54624766",
"0.5458392",
"0.5458392",
"0.5458392",
"0.5458392",
"0.5455346",
"0.5447072",
"0.5433741",
"0.54126877",
"0.5409166",
"0.5409166",
"0.54067314",
"0.53942436",
"0.538641",
"0.53859115"
] |
0.72777396
|
0
|
get a complete list of eav_attributes (class + instance)
|
def eav_attributes_list # :nodoc:
(
self.instance_eav_attributes + self.class_eav_attributes.keys
).collect { |attribute| attribute.to_s }.uniq
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def instance_eav_attributes\n []\n end",
"def class_eav_attributes\n self.class.class_eav_attributes\n end",
"def eav_attributes\n @eav_attributes ||= eav_class.all(\n :conditions => { self_key => self.id }\n )\n end",
"def attributes\n @list.map(&:attributes)\n end",
"def class_eav_attributes # :nodoc:\n if superclass != ActiveRecord::Base\n if superclass.class_eav_attributes.nil?\n @eav_attributes\n else\n @eav_attributes.nil? ? superclass.class_eav_attributes : superclass.class_eav_attributes.merge(@eav_attributes)\n end\n else\n @eav_attributes\n end\n end",
"def attributes\n @attributes ||= []\n @attributes\n end",
"def list_attributes\n list = \"Age: #{@age} Earth years old\\nSize: #{@size}\\nVisitor Count: #{@visitor_count}\\nInhabitants: #{@inhabitants}\\n\"\n return list\n end",
"def attributes\n @attribute_ids.collect { |idx| BAttribute.store[idx] }\n end",
"def attributes\n instance_values\n end",
"def extract_attributes(klass)\n model_attribute_match = klass.inspect.scan(/\\((.*)\\)/).flatten[0]\n\n if model_attribute_match\n raw_model_attributes = model_attribute_match.split(\", \")\n \n raw_model_attributes.inject([]) do |attributes, raw_attribute_pair| \n \n # Add attribute if it not an a rails id or a rails timestamp\n attributes << YAML::load(raw_attribute_pair) unless raw_attribute_pair =~ /[\\w+_]*id|created_at|updated_at/\n \n attributes\n end\n else\n []\n end\n end",
"def attribute_values\n self.class.attributes.map{ |attr| self.send(attr) }\n end",
"def attributes\n @attributes ||= []\n end",
"def list_attributes\n if @attributes.empty?\n fetch_configuration()\n end\n return @attributes.keys\n end",
"def attributes\n @attrs.keys\n end",
"def get_attributes\n\t\t\t@@attributes\n\t\tend",
"def attributes_for( an_instance )\n attrs = self.class.attributes[an_instance.class.name] \n raise \"Unable to get attributes for #{an_instance}\" unless attrs\n attrs\n end",
"def attributes\n self.class.attribute_names.map do |attr|\n type = self.class.attribute_types[attr.to_s]\n value = public_send(attr)\n [attr, type ? type.serialize(value) : value]\n end.to_h\n end",
"def attributes_get\n h = {}\n self.class.attributes.each do |a|\n h[a] = attribute_get(a)\n end\n h\n end",
"def attributes_get\n h = {}\n self.class.attributes.each do |a|\n h[a] = attribute_get(a)\n end\n h\n end",
"def attributes\n attrs = Hash.new\n attribute_list.each do |attribute|\n value = self.send(attribute)\n attrs[attribute] = value unless value.nil?\n end\n attrs\n end",
"def attributes\n @attrs\n end",
"def attributes\n list.values.map { |field| [field.name, field.value] }.to_h\n end",
"def attributes\n load_attributes! unless attributes_loaded?\n @attributes.values\n end",
"def attributes\n @attributes\n end",
"def attributes\n @attributes\n end",
"def attributes\n @attributes\n end",
"def attributes\n self.class::ATTRIBUTES\n end",
"def attributes\n self._attributes.inject({}) do |hash, attr|\n hash[attr.to_s] = send(attr)\n hash\n end\n end",
"def attributes\n self\n .class\n .attribute_names\n .map { |attr| [attr, send(attr)] }\n .reject { |_, value| value.nil? }\n .map do |attr, value|\n [attr, value.respond_to?(:attributes) ? value.attributes : value]\n end\n .to_h\n end",
"def attributes\n instance_values\n end",
"def attributes\n @@attributes\n end",
"def attr_list\n\t\ta_list \n\tend",
"def class_attributes; end",
"def values\n @attrs.values\n end",
"def to_a\n result = []\n each do |elem|\n result << elem[:attrs]\n end\n result\n end",
"def attributes\n data[:attributes]\n end",
"def attributes\n @attributes ||= get_field_by_type(ATTRIBUTE_FIELDS)\n end",
"def attributes\n self.class.attributes\n end",
"def object_attributes\n []\n end",
"def attributes\n @attributes\n end",
"def attribute_list(el); end",
"def attributes\n self.class.attribute_names.map do |name|\n [name.to_s, self.send(name)]\n end.to_h\n end",
"def attributes\n @attributes\n end",
"def attribute_list\n [:id, :version, :uid, :user, :timestamp, :lon, :lat, :changeset]\n end",
"def entries_attributes\n entries.map(&:attributes)\n end",
"def attributes\n []\n end",
"def attributes\n ATTRIBUTES\n end",
"def attribute_values\n attributes.values\n end",
"def attributes\n @_attributes\n end",
"def attributes\n scraper.attributes.keys + uri_response_attributes + [:feed]\n end",
"def attribute_list # :nodoc:\n [:id, :version, :uid, :user, :timestamp, :changeset, :tags]\n end",
"def attribute_list # :nodoc:\n [:id, :version, :uid, :user, :timestamp, :changeset]\n end",
"def klass_attributes(all: false)\n attributes = (klass.new().attributes rescue nil)\n return [] unless attributes\n\n names = attributes.keys - belong_tos.map { |reference| reference.foreign_key }\n names = names - [klass.primary_key, 'created_at', 'updated_at'] unless all\n\n attributes = names.map do |name|\n if klass.respond_to?(:column_for_attribute) # Rails 4+\n Effective::Attribute.new(name, klass.column_for_attribute(name).type)\n else\n Effective::Attribute.new(name, klass.columns_hash[name].type)\n end\n end\n\n sort_by_written_attributes(attributes)\n end",
"def attributes\n instance_values.with_indifferent_access.slice(*USER_ATTRIBUTES)\n end",
"def attributes\n if self.class_variable_defined?(:@@attributes)\n class_variable_get(:@@attributes)\n else\n class_variable_set(:@@attributes, [])\n class_variable_get(:@@attributes)\n end\n end",
"def list_of_attributes\n @list_of_attributes ||= []\n end",
"def attributes\n ATTRIBUTE_NAMES\n end",
"def attributes\n self.class.class_variable_get(:@@attributes)\n end",
"def attributes\n attrs = sort_members(@context.attributes).find_all{|a| @options.show_all || a.visibility == :public || a.visibility == :protected}\n attrs.collect{|a| {:name=>a.name, :visibility=>a.visibility, :rw=>a.rw, :description=>markup(a.comment, true)}}\n end",
"def attributes\n self.class.fields.inject({}) do |attribute_hash, field|\n attribute_hash[field] = send(field)\n attribute_hash\n end\n end",
"def attributes(table)\r\n resourceSet = @xquery.query(\"//classes/\" + table.to_s + \"[1]\")\r\n \r\n xmlfile = File.new( resourceSet.getMembersAsResource().getContent() )\r\n xmldoc = Document.new(xmlfile)\r\n \r\n fields = { }\r\n xmldoc.elements.each(\"//\" + table){ \r\n |e|\r\n e.attributes.keys.each { \r\n |attribute|\r\n fields[attribute] = e.attributes[attribute]\r\n }\r\n }\r\n return fields\r\n end",
"def attributes\n Address.attribute_list.index_with { |_attr| nil }\n end",
"def attrs\n self.class.attrs\n end",
"def full_attributes \n self.class.attributes\n end",
"def attributes\n @_attributes\n end",
"def attributes\r\n self.class.attributes\r\n end",
"def attributes\n @ldap_entry.attribute_names.each_with_object({}) do |key, hsh|\n hsh[key] = get_value(key)\n end\n end",
"def serializable_hash options=nil\n hash = super\n eav_attributes_list.each do |attribute|\n hash[attribute] = self.send(attribute)\n end\n\n hash\n end",
"def attributes\n @attributes ||= {}\n @attributes\n end",
"def attributes\n self.attribute_keys.inject({}) do |hash, key|\n hash[key] = self.__send__(key) if self.__send__(key)\n hash\n end\n end",
"def export_attrs\n self.class.export_attrs || []\n end",
"def attributes\n ATTRIBUTES.inject({}) do |hash, attribute|\n hash[attribute] = self.send(attribute)\n hash\n end\n end",
"def attributes\n ATTRIBUTES.inject({}) do |hash, attribute|\n hash[attribute] = self.send(attribute)\n hash\n end\n end",
"def attributes\n hash = HashWithIndifferentAccess.new\n\n self.class.attribute_names.each_with_object(hash) do |name, attrs|\n attrs[name] = read_attribute(name)\n end\n end",
"def attrs\n @attrs\n end",
"def attrs\n @item_data ||= @active_domain.nil? ? EMPTY_ITEM_DATA : get_items(@query)\n @item_data[:attrs]\n end",
"def attributes\n instance_variables.map{ |iv| iv.sub('@','') }\n end",
"def class_attributes\n @__class_attributes\n end",
"def attributes\n @data.keys\n end",
"def attributes\n @attributes ||= descriptors_fields.select{|field| field.scope == ATTRIBUTE_FIELDS }\n end",
"def display_attributes\n self.class.display_attribute_names.map do |name|\n [name.to_s, self.send(name)]\n end.to_h\n end",
"def attributes\n @metadata\n end",
"def attribute_names\n self.class.attributes.map { |a| a[:name] }\n end",
"def inspect_attributes\n %i[uuid name type slug status email]\n end",
"def attrs\n @attrs\n end",
"def attributes\n if @attributes.empty?\n fetch_configuration()\n end\n return @attributes\n end",
"def attribs\n\t\t@attributes\n\tend",
"def inspect\n \"#<Attributes (#{backend_name}) @names=#{names.join(\", \")}>\"\n end",
"def get_attributes\n necessary_attributes = PageVersioning::Config[klass + '_revision_attributes']\n attributes = self.attributes\n attributes.delete_if { |key, value| !necessary_attributes.include?(key) }\n attributes\n end",
"def loaded_attributes\n properties.map{|p| p.name if attribute_loaded?(p.name)}.compact\n end",
"def attributes\n query[ model_name ]\n end",
"def attributes; @attributes ||= []; end",
"def attributes\n self.class.attributes\n end",
"def attributes\n self.class.attributes\n end",
"def get_attribute_values() \n @attribute_values_flat\n end",
"def instance_attributes; end",
"def attributes(tf = true)\n results = handle_inherited_hash(tf, :local_attributes)\n # if an instance, include the singleton_class attributes\n #p [:attributes, @this, @this.singleton_class, @this.singleton_class.methods(false), results]\n if !@this.kind_of?(Class) && @this.singleton_class.doodle.respond_to?(:attributes)\n results = results.merge(@this.singleton_class.doodle.attributes)\n end\n results\n end",
"def attribute_values \n columns = self.class.columns\n columns.map { |col| self.send(col) } #=> ex. [:id, :name, :owner_id]\n end",
"def attributes\n @attributes ||= self.class.class_attributes.clone\n end",
"def attributes\n @cache[:attributes]\n end"
] |
[
"0.8126298",
"0.79447365",
"0.768488",
"0.71056926",
"0.6892443",
"0.67610013",
"0.6665689",
"0.6635092",
"0.6618549",
"0.6616941",
"0.66059387",
"0.6604837",
"0.6596148",
"0.6564673",
"0.6551039",
"0.64977753",
"0.6489918",
"0.64826006",
"0.64826006",
"0.6474307",
"0.6459152",
"0.64581114",
"0.6427458",
"0.64238",
"0.64238",
"0.64238",
"0.6389076",
"0.63733554",
"0.63653266",
"0.63534194",
"0.634507",
"0.63427967",
"0.6329128",
"0.63282967",
"0.63206685",
"0.63146937",
"0.6302815",
"0.62873244",
"0.6283334",
"0.62813306",
"0.6274526",
"0.62695915",
"0.6257642",
"0.6257041",
"0.6252816",
"0.62509197",
"0.62455624",
"0.62398714",
"0.62384826",
"0.623209",
"0.62308705",
"0.6228645",
"0.62243354",
"0.6210683",
"0.6201402",
"0.6199594",
"0.61985666",
"0.61819863",
"0.617847",
"0.61657614",
"0.6152037",
"0.6151808",
"0.6149234",
"0.6144393",
"0.6131833",
"0.61288065",
"0.6108926",
"0.60993534",
"0.6097267",
"0.60970676",
"0.60955334",
"0.608844",
"0.608844",
"0.6085619",
"0.6072616",
"0.6060095",
"0.6057249",
"0.6050854",
"0.6042594",
"0.60417086",
"0.6037493",
"0.60298735",
"0.60228974",
"0.6018437",
"0.6012654",
"0.60122335",
"0.59990144",
"0.59952533",
"0.5977964",
"0.59764814",
"0.5967531",
"0.59630275",
"0.59598583",
"0.59598583",
"0.5944314",
"0.5937964",
"0.59372354",
"0.593687",
"0.59279394",
"0.5926093"
] |
0.84049815
|
0
|
get the key to my <3
|
def self_key # :nodoc:
klass = self.class
if klass.superclass != ActiveRecord::Base
if klass.superclass.eav_class == klass.eav_class
klass = klass.superclass
end
end
"#{klass.name.underscore}_id".to_sym
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def read_key; end",
"def key2\n self.key('key2')\n end",
"def key; end",
"def key; end",
"def key; end",
"def key; end",
"def key; end",
"def key; end",
"def key; end",
"def key; end",
"def key; end",
"def key; end",
"def key; end",
"def key; end",
"def key; end",
"def key; end",
"def key; end",
"def key; end",
"def key; end",
"def key; end",
"def key; end",
"def key; end",
"def key1\n self.key('key1')\n end",
"def get_min_key()\n \n end",
"def key\n Key.new(text: @head.fetch[3])\n end",
"def key\n @key.id2name\n end",
"def keypair; end",
"def keypair; end",
"def keypair; end",
"def keypair; end",
"def keypair; end",
"def key\n @key\n end",
"def key\n @key\n end",
"def key\n @key\n end",
"def key\n @key\n end",
"def get_key(line)\n line.match(/-k ([^ ]+)/)[1]\n end",
"def getKey; argSetTextual.to_sym end",
"def key_for(entry)\n entry\n end",
"def key\n return @key\n end",
"def key\n return @key\n end",
"def get_key record\n record\n end",
"def key\n raise 'Not implemented'\n end",
"def key\n raise 'Not implemented'\n end",
"def get(key); end",
"def get(key); end",
"def get(key); end",
"def get(key); end",
"def get(key)\n \n end",
"def code_to_key\n @code[0..2]\n end",
"def key\n long || short\n end",
"def to_key; end",
"def key_id; end",
"def cti_key; sti_key; end",
"def key\n @key ||= name.to_s\n end",
"def key_field\n 'key'\n end",
"def key=(_arg0); end",
"def key=(_arg0); end",
"def key=(_arg0); end",
"def flexible_key; end",
"def get key; call key; end",
"def key_data; end",
"def key_data; end",
"def key_for_three_in_row(brd, mark = marker)\n brd.unmarked_keys.each do |key|\n win_combos_with_key = Board::WINNING_COMBOS.select do |combo|\n combo.include?(key)\n end\n win_combos_wout_key = win_combos_with_key.map { |combo| combo - [key] }\n win_combos_wout_key.each do |array_check|\n return key if brd[array_check[0]] == mark &&\n brd[array_check[1]] == mark\n end\n end\n nil\n end",
"def key\n @key or raise MissingKey\n end",
"def synckey(item)\n key = @itemkey.to_sym\n item[key]\n end",
"def getKey; @args.map { |a| a.to_s }.join(':').to_sym end",
"def get_max_key()\n \n end",
"def get(key)\n end",
"def key\n return KEY_APOCALYPSE if apocalypse?\n return KEY_BATTLEGROUND if battleground?\n KEY_PLANET\n end",
"def key\n int = @declared_fields['key'].value(java_self)\n int < 256 ? int.chr : int\n end",
"def key\n int = @declared_fields['key'].value(java_self)\n int < 256 ? int.chr : int\n end",
"def map_key(key)\n key\n end",
"def key\n `return #{self}.__key__ || #{nil};`\n end",
"def key\n params.k\n end",
"def get(key)\n row = key >> 10\n column = @a[row].index{|(i,v)| i == key}\n if column\n return @a[row][column][1] \n else\n return -1\n end\n end",
"def to_key; nil end",
"def generate_key; end",
"def key?(p0) end",
"def get_key(name)\n return data_bag_item('rndc_keys', name).to_hash if node['dhcp']['use_bags']\n node['dhcp']['rndc_keys'].fetch name, ''\n end",
"def get_k( key )\n HTMapHelper.get_map( self, key )\n end",
"def get_key_name(name)\n key_id = GameKeys[name.downcase]\n return GameKeys[0] unless key_id\n key_value = Input::Keys[key_id][0]\n return \"J#{-(key_value + 1) / 32 + 1}K#{(-key_value - 1) % 32}\" if key_value < 0\n keybd = Input::Keyboard\n keybd.constants.each do |key_name|\n return key_name.to_s if keybd.const_get(key_name) == key_value\n end\n return GameKeys[0]\n end",
"def key_name\n data[:key_name]\n end",
"def return_key\n return item_in_use.return_key if !item_in_use.return_key.empty?\n return data_battler.return_key\n end",
"def Key ()\n\nend",
"def get(key)\n end",
"def key\n to_a[0..(num_key_fields-1)].join(\"-\")\n end",
"def key?(*) end",
"def get_key(data)\n\t\t keys = data.keys\n\t\t if keys.length != 1 || INDICES.none? { |key| key.to_sym == keys.first.to_sym }\n\t\t raise ArgumentError.new(\"`find_by` accepts only one of #{INDICES.join(\" or \")} as argument. none provided\")\n\t\t end\n\t\t keys.first\n\t\t end",
"def key\n @key ||= self.project.key + '-' + self.no.to_s\n end",
"def extract_key(ctx); end",
"def get_first_key(hash)\n return \nend",
"def key_for(entry)\n raise NotImplementedError, \"#{self}#key_for must be implemented\"\n end",
"def get_key(id)\n @keys[id]\n end",
"def key\n attributes[:key]\n end",
"def possible_keys(key); end",
"def key_id\n return @key_id\n end",
"def key_id\n return @key_id\n end",
"def key_id\n return @key_id\n end",
"def hash_key(name); end",
"def key\n self.keys.first\n end",
"def key_skill; end"
] |
[
"0.7160324",
"0.70946294",
"0.70882124",
"0.70882124",
"0.70882124",
"0.70882124",
"0.70882124",
"0.70882124",
"0.70882124",
"0.70882124",
"0.70882124",
"0.70882124",
"0.70882124",
"0.70882124",
"0.70882124",
"0.70882124",
"0.70882124",
"0.70882124",
"0.70882124",
"0.70882124",
"0.70882124",
"0.70882124",
"0.7059431",
"0.6950341",
"0.68791395",
"0.67361283",
"0.6717067",
"0.6717067",
"0.6717067",
"0.6717067",
"0.6717067",
"0.66370314",
"0.66370314",
"0.6605592",
"0.6605592",
"0.65633714",
"0.6521205",
"0.64966303",
"0.6494156",
"0.6494156",
"0.6459905",
"0.6411886",
"0.6411886",
"0.63976926",
"0.63976926",
"0.63976926",
"0.63976926",
"0.63914436",
"0.6370204",
"0.6359075",
"0.6351513",
"0.6350159",
"0.6319543",
"0.6305436",
"0.62928385",
"0.6287628",
"0.6287628",
"0.6287628",
"0.62752616",
"0.6269474",
"0.6258096",
"0.6258096",
"0.6242114",
"0.62381667",
"0.6237555",
"0.620584",
"0.6204358",
"0.61827993",
"0.6178278",
"0.61724246",
"0.6171734",
"0.6162739",
"0.61608344",
"0.61532813",
"0.6138488",
"0.613482",
"0.6131222",
"0.61300975",
"0.6129963",
"0.61250836",
"0.6123583",
"0.6117322",
"0.6110257",
"0.6105968",
"0.6103824",
"0.6102698",
"0.6097532",
"0.6092333",
"0.60871726",
"0.60806745",
"0.6079307",
"0.60752124",
"0.606549",
"0.6063565",
"0.6058362",
"0.6055659",
"0.6055659",
"0.6055659",
"0.605231",
"0.6050661",
"0.6048826"
] |
0.0
|
-1
|
make sure EAV is included in as_json, to_json and to_xml
|
def serializable_hash options=nil
hash = super
eav_attributes_list.each do |attribute|
hash[attribute] = self.send(attribute)
end
hash
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def attributes_before_type_cast\n json_attributes_before_type_cast\n end",
"def serializer; end",
"def e(object)\n require 'json'\n object.respond_to?(:to_json) ? object.to_json : object.to_s.to_json\n end",
"def json_serialize\n end",
"def to_serialized_json\n # @sighting.to_json(:include => {\n # :bird => {:only => [:name, :species]},\n # :location => {:only => [:latitude, :longitude]}\n # }, :except => [:updated_at])\n\n# This is still super messy, we could choose to leave it at this point\n# and work with controller (OPTON GO TO CONTROLLER)\n# or we can continue and rework this code\n#To do that, we can create a hash called options\n#This hash will say:\n#\"Include the bird and location I am tied with, only list specific things about each of them\"\n#Also, for me, the sighting object, don't send over the updated_at\noptions = {\n include: {\n bird: {\n only: [:name, :species]\n },\n location: {\n only: [:latitude, :longitude]\n }\n },\n except: [:updated_at],\n }\n @sighting.to_json(options)\n #This looks way cleaner, and does exactly what it did before\n #GO BACK TO CONTROLLER\n\nend",
"def to_ext_json(options = {})\n success = options.delete(:success)\n if errors.empty?#if success || (success.nil? && valid?)\n { :success => true,\n :data => if options.delete(:in_array)\n [ExtJsonSerializer.new(self,options).serialize]\n else\n ExtJsonSerializer.new(self,options).serialize\n end\n }.to_json(options)\n else\n error_hash = {}\n # attributes.each do |field, value|\n # if errors = self.errors.on(field)\n # error_hash[ExtJson::ext_name(self,field,options[:format]||@ext_format)] =\n # \"#{errors.is_a?(Array) ? errors.first : errors}\"\n # end\n # end\n errors.each do |attr,msg|\n error_hash[ExtJson::ext_name(self,attr,options[:format]||@ext_format)] = msg\n logger.debug \"ERROR: #{attr}: #{msg}\"\n end\n json={ :success => false, :errors => error_hash }.to_json(options)\n logger.debug \"JSON:#{json}\"\n return json\n end\n end",
"def emit_serializers!( file, model )\n end",
"def object_serialization_options\n {:except => [:site_id, :email_address, :type], :methods => :variant}\n end",
"def as_json(options={})\n # translating this schema to match the FB one as much as possible\n super.tap do |json|\n json[\"ad_creation_time\"] = json.delete(\"created_at\")\n json[\"text\"] = json.delete(\"message\") # TODO: remove HTML tags\n json[\"funding_entity\"] = json[\"paid_for_by\"]\n # what if page_id doesn't exist?!\n# json[\"page_id\"] \n json[\"start_date\"] = json.delete(\"created_at\")\n json = json.merge(json)\n end\n end",
"def serialize; end",
"def serialize; end",
"def serialize(method = :to_json)\n super\n end",
"def with_serializer(object, serializer); end",
"def serialize(object) end",
"def as_json(options=nil)\n instance_values.except \"model\", \"adapter\"\n end",
"def serialize\n \n end",
"def to_serialized_json\n options = {\n include: {\n bird: {\n only: %i[name species]\n },\n location: {\n only: %i[latitude longitude]\n }\n },\n except: [:updated_at]\n }\n @sighting.to_json(options)\nend",
"def get_field_deserializers()\n return {\n \"extensionAttribute1\" => lambda {|n| @extension_attribute1 = n.get_string_value() },\n \"extensionAttribute10\" => lambda {|n| @extension_attribute10 = n.get_string_value() },\n \"extensionAttribute11\" => lambda {|n| @extension_attribute11 = n.get_string_value() },\n \"extensionAttribute12\" => lambda {|n| @extension_attribute12 = n.get_string_value() },\n \"extensionAttribute13\" => lambda {|n| @extension_attribute13 = n.get_string_value() },\n \"extensionAttribute14\" => lambda {|n| @extension_attribute14 = n.get_string_value() },\n \"extensionAttribute15\" => lambda {|n| @extension_attribute15 = n.get_string_value() },\n \"extensionAttribute2\" => lambda {|n| @extension_attribute2 = n.get_string_value() },\n \"extensionAttribute3\" => lambda {|n| @extension_attribute3 = n.get_string_value() },\n \"extensionAttribute4\" => lambda {|n| @extension_attribute4 = n.get_string_value() },\n \"extensionAttribute5\" => lambda {|n| @extension_attribute5 = n.get_string_value() },\n \"extensionAttribute6\" => lambda {|n| @extension_attribute6 = n.get_string_value() },\n \"extensionAttribute7\" => lambda {|n| @extension_attribute7 = n.get_string_value() },\n \"extensionAttribute8\" => lambda {|n| @extension_attribute8 = n.get_string_value() },\n \"extensionAttribute9\" => lambda {|n| @extension_attribute9 = n.get_string_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n }\n end",
"def get_field_deserializers()\n return super.merge({\n \"audiences\" => lambda {|n| @audiences = n.get_collection_of_primitive_values(String) },\n \"description\" => lambda {|n| @description = n.get_string_value() },\n \"issuer\" => lambda {|n| @issuer = n.get_string_value() },\n \"name\" => lambda {|n| @name = n.get_string_value() },\n \"subject\" => lambda {|n| @subject = n.get_string_value() },\n })\n end",
"def serialize(model)\n end",
"def to_json\n raise StandardError, \"Not implemented!\"\n end",
"def serialize!\n end",
"def as_json(options={})\n #options[:include] = []\n options[:except] = EXCLUDED_JSON_ATTRIBUTES\n\n super(options)\n end",
"def as_json(options={})\n #options[:include] = []\n options[:except] = EXCLUDED_JSON_ATTRIBUTES\n\n super(options)\n end",
"def as_json(options={})\n #options[:include] = []\n options[:except] = EXCLUDED_JSON_ATTRIBUTES\n\n super(options)\n end",
"def as_json(options={})\n #options[:include] = []\n options[:except] = EXCLUDED_JSON_ATTRIBUTES\n\n super(options)\n end",
"def objectify_episode (episode)\n {\n :id => episode.id,\n :name => episode.name,\n :timestep => episode.timestep,\n :states => objectify_json(episode.states),\n :diff_states => objectify_json(episode.diff_states),\n :commands => objectify_json(episode.commands),\n :simulator_logs => objectify_json(episode.simulator_logs),\n :created_at => episode.created_at,\n :updated_at => episode.updated_at,\n }\n end",
"def apply_json_trait(value); end",
"def to_json\n attrs.to_json\nend",
"def as_json(options = {}) # rubocop:disable Metrics/MethodLength, Metrics/AbcSize\n serialize_unknown_attributes = if options.key?(:serialize_unknown_attributes)\n options[:serialize_unknown_attributes]\n else\n StoreModel.config.serialize_unknown_attributes\n end\n\n serialize_enums_using_as_json = if options.key?(:serialize_enums_using_as_json)\n options[:serialize_enums_using_as_json]\n else\n StoreModel.config.serialize_enums_using_as_json\n end\n\n result = @attributes.keys.each_with_object({}) do |key, values|\n values[key] = serialized_attribute(key)\n end.with_indifferent_access\n\n result.merge!(unknown_attributes) if serialize_unknown_attributes\n result.as_json(options).tap do |json|\n serialize_enums!(json) if serialize_enums_using_as_json\n end\n end",
"def get_field_deserializers()\n return super.merge({\n \"amazonAccountId\" => lambda {|n| @amazon_account_id = n.get_string_value() },\n \"amazonResourceId\" => lambda {|n| @amazon_resource_id = n.get_string_value() },\n \"resourceName\" => lambda {|n| @resource_name = n.get_string_value() },\n \"resourceType\" => lambda {|n| @resource_type = n.get_string_value() },\n })\n end",
"def test_render_using_implicit_serializer\n get :render_using_implicit_serializer\n\n assert_equal 'application/json', @response.content_type\n assert_equal '{\"name\":\"Name 1\",\"description\":\"Description 1\"}', @response.body\n end",
"def to_serialized_json\n=begin\n @sighting.to_json(:include => {\n :bird => {:only => [:name, :species]},\n :location => {:only => [:latitude, :longitude]}\n }, :except => [:updated_at])\n end\n=end\n\n # In the to_serialized_json method, we are passing multiple options into\n # to_json when it is called. These options are just key/value pairs in a hash,\n # though, and we can choose to break this line up to get a better grasp of\n # what is actually going on. Rewriting the method without changing any\n # functionality, we could write:\n options = {\n include: {\n bird: {\n only: [:name, :species]\n },\n location: {\n only: [:latitude, :longitude]\n }\n },\n except: [:updated_at],\n }\n @sighting.to_json(options)\n end",
"def collection_serialization_options\n {:except => [:site_id, :email_address, :type], :methods => :variant}\n end",
"def get_field_deserializers()\n return super.merge({\n \"applicationName\" => lambda {|n| @application_name = n.get_string_value() },\n \"displayName\" => lambda {|n| @display_name = n.get_string_value() },\n \"externalId\" => lambda {|n| @external_id = n.get_string_value() },\n \"webUrl\" => lambda {|n| @web_url = n.get_string_value() },\n })\n end",
"def as_json(_opts={})\n raise NotImplementedError\n end",
"def to_json\n\n end",
"def as_json(*args)\n super(:methods => [:image, :full_name, :presence], :except => [:created_at, :email])\n end",
"def get_field_deserializers()\n return super.merge({\n \"appId\" => lambda {|n| @app_id = n.get_string_value() },\n \"displayName\" => lambda {|n| @display_name = n.get_string_value() },\n \"objectId\" => lambda {|n| @object_id_escaped = n.get_string_value() },\n \"publisher\" => lambda {|n| @publisher = n.get_string_value() },\n })\n end",
"def get_field_deserializers()\n return {\n \"itemId\" => lambda {|n| @item_id = n.get_string_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"title\" => lambda {|n| @title = n.get_string_value() },\n \"versionId\" => lambda {|n| @version_id = n.get_string_value() },\n }\n end",
"def shouldConvert()\n\t\tfalse\n\tend",
"def init_jaxb_json_hash(_o)\n super _o\n if !_o['emailId'].nil?\n _oa = _o['emailId']\n if(_oa.is_a? Hash)\n @emailId = EnunciateHelpers::LAMB_CLASS_AWARE.call(_oa) if _oa['@class']\n @emailId = Fixnum.from_json(_oa) unless _oa['@class']\n elsif (_oa.is_a? Array)\n #an array(of hashes hopefully) or scalar\n @emailId = Array.new\n _oa.each { | _item | \n if ((_item.nil? || _item['@class'].nil?)rescue true)\n @emailId.push Fixnum.from_json(_item)\n else\n @emailId.push EnunciateHelpers::LAMB_CLASS_AWARE.call(_item)\n end\n }\n else\n @emailId = _oa\n end\n end\n if !_o['type'].nil?\n _oa = _o['type']\n if(_oa.is_a? Hash)\n @type = EnunciateHelpers::LAMB_CLASS_AWARE.call(_oa) if _oa['@class']\n @type = String.from_json(_oa) unless _oa['@class']\n elsif (_oa.is_a? Array)\n #an array(of hashes hopefully) or scalar\n @type = Array.new\n _oa.each { | _item | \n if ((_item.nil? || _item['@class'].nil?)rescue true)\n @type.push String.from_json(_item)\n else\n @type.push EnunciateHelpers::LAMB_CLASS_AWARE.call(_item)\n end\n }\n else\n @type = _oa\n end\n end\n if !_o['value'].nil?\n _oa = _o['value']\n if(_oa.is_a? Hash)\n @value = EnunciateHelpers::LAMB_CLASS_AWARE.call(_oa) if _oa['@class']\n @value = String.from_json(_oa) unless _oa['@class']\n elsif (_oa.is_a? Array)\n #an array(of hashes hopefully) or scalar\n @value = Array.new\n _oa.each { | _item | \n if ((_item.nil? || _item['@class'].nil?)rescue true)\n @value.push String.from_json(_item)\n else\n @value.push EnunciateHelpers::LAMB_CLASS_AWARE.call(_item)\n end\n }\n else\n @value = _oa\n end\n end\n if !_o['primary'].nil?\n _oa = _o['primary']\n if(_oa.is_a? Hash)\n @primary = EnunciateHelpers::LAMB_CLASS_AWARE.call(_oa) if _oa['@class']\n @primary = Boolean.from_json(_oa) unless _oa['@class']\n elsif (_oa.is_a? Array)\n #an array(of hashes hopefully) or scalar\n @primary = Array.new\n _oa.each { | _item | \n if ((_item.nil? || _item['@class'].nil?)rescue true)\n @primary.push Boolean.from_json(_item)\n else\n @primary.push EnunciateHelpers::LAMB_CLASS_AWARE.call(_item)\n end\n }\n else\n @primary = _oa\n end\n end\n end",
"def object_serialization_options\n {:except => [:variant_id, :type, :position], :methods => [:classification, :options]}\n end",
"def get_field_deserializers()\n return super.merge({\n \"assignments\" => lambda {|n| @assignments = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::ManagedEBookAssignment.create_from_discriminator_value(pn) }) },\n \"createdDateTime\" => lambda {|n| @created_date_time = n.get_date_time_value() },\n \"description\" => lambda {|n| @description = n.get_string_value() },\n \"deviceStates\" => lambda {|n| @device_states = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::DeviceInstallState.create_from_discriminator_value(pn) }) },\n \"displayName\" => lambda {|n| @display_name = n.get_string_value() },\n \"informationUrl\" => lambda {|n| @information_url = n.get_string_value() },\n \"installSummary\" => lambda {|n| @install_summary = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::EBookInstallSummary.create_from_discriminator_value(pn) }) },\n \"largeCover\" => lambda {|n| @large_cover = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::MimeContent.create_from_discriminator_value(pn) }) },\n \"lastModifiedDateTime\" => lambda {|n| @last_modified_date_time = n.get_date_time_value() },\n \"privacyInformationUrl\" => lambda {|n| @privacy_information_url = n.get_string_value() },\n \"publishedDateTime\" => lambda {|n| @published_date_time = n.get_date_time_value() },\n \"publisher\" => lambda {|n| @publisher = n.get_string_value() },\n \"userStateSummary\" => lambda {|n| @user_state_summary = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::UserInstallStateSummary.create_from_discriminator_value(pn) }) },\n })\n end",
"def get_field_deserializers()\n return super.merge({\n \"activationUrl\" => lambda {|n| @activation_url = n.get_string_value() },\n \"activitySourceHost\" => lambda {|n| @activity_source_host = n.get_string_value() },\n \"appActivityId\" => lambda {|n| @app_activity_id = n.get_string_value() },\n \"appDisplayName\" => lambda {|n| @app_display_name = n.get_string_value() },\n \"contentInfo\" => lambda {|n| @content_info = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::Json.create_from_discriminator_value(pn) }) },\n \"contentUrl\" => lambda {|n| @content_url = n.get_string_value() },\n \"createdDateTime\" => lambda {|n| @created_date_time = n.get_date_time_value() },\n \"expirationDateTime\" => lambda {|n| @expiration_date_time = n.get_date_time_value() },\n \"fallbackUrl\" => lambda {|n| @fallback_url = n.get_string_value() },\n \"historyItems\" => lambda {|n| @history_items = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::ActivityHistoryItem.create_from_discriminator_value(pn) }) },\n \"lastModifiedDateTime\" => lambda {|n| @last_modified_date_time = n.get_date_time_value() },\n \"status\" => lambda {|n| @status = n.get_enum_value(MicrosoftGraph::Models::Status) },\n \"userTimezone\" => lambda {|n| @user_timezone = n.get_string_value() },\n \"visualElements\" => lambda {|n| @visual_elements = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::VisualInfo.create_from_discriminator_value(pn) }) },\n })\n end",
"def as_json(options = {})\r\n\t\tsuper\r\n\t\t {type: type,\r\n\t\t \t Title: Title,\r\n\t\t \t Authors: authors,\r\n\t\t \t With: with,\r\n\t\t \t Details: details,\r\n\t\t \t Year: year\r\n\t\t \t }\r\n\tend",
"def serialize(object, data); end",
"def __convert_to_json(o=nil, options={})\n o = o.is_a?(String) ? o : serializer.dump(o, options)\n end",
"def get_field_deserializers()\n return super.merge({\n \"description\" => lambda {|n| @description = n.get_string_value() },\n \"owner\" => lambda {|n| @owner = n.get_string_value() },\n \"properties\" => lambda {|n| @properties = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::ExtensionSchemaProperty.create_from_discriminator_value(pn) }) },\n \"status\" => lambda {|n| @status = n.get_string_value() },\n \"targetTypes\" => lambda {|n| @target_types = n.get_collection_of_primitive_values(String) },\n })\n end",
"def to_obj; end",
"def event_type_to_json(event_type)\n et = event_type.to_json(\n only: [:id, :name, :description, :recipients, :program, :created_at, :updated_at, :goal, \n :duration, :faq, :elevator_pitch, :learnings, :takeaways, :subtitle, :csd_eligible, :is_kleer_certification, \n :external_site_url, :deleted, :noindex, :lang, :cover, :side_image, :brochure, :new_version, :extra_script], \n methods: %i[slug canonical_slug], include: [:categories, \n next_events: {only: [\n :id, :date, :place, :city, :country_id, :list_price, :eb_price, :eb_end_date, :registration_link, \n :is_sold_out, :duration, :start_time, :end_time, :time_zone_name, :currency_iso_code, :address, :finish_date], methods: :trainers} ])\n et = \"#{et[0..-2]},\\\"testimonies\\\":#{event_type.testimonies.where(selected: true).first(10).to_json(\n only: [:fname, :lname, :testimony, :profile_url, :photo_url]\n )}}\"\n end",
"def to_json\n\t\t\t{name: @name, ar_model: @ar_model.to_json, api_model: @api_model.to_json}\n\t\tend",
"def get_field_deserializers()\n return super.merge({\n \"additionalTags\" => lambda {|n| @additional_tags = n.get_collection_of_primitive_values(String) },\n \"contentWebUrl\" => lambda {|n| @content_web_url = n.get_string_value() },\n \"contributors\" => lambda {|n| @contributors = n.get_collection_of_primitive_values(String) },\n \"createdDateTime\" => lambda {|n| @created_date_time = n.get_date_time_value() },\n \"description\" => lambda {|n| @description = n.get_string_value() },\n \"duration\" => lambda {|n| @duration = n.get_duration_value() },\n \"externalId\" => lambda {|n| @external_id = n.get_string_value() },\n \"format\" => lambda {|n| @format = n.get_string_value() },\n \"isActive\" => lambda {|n| @is_active = n.get_boolean_value() },\n \"isPremium\" => lambda {|n| @is_premium = n.get_boolean_value() },\n \"isSearchable\" => lambda {|n| @is_searchable = n.get_boolean_value() },\n \"languageTag\" => lambda {|n| @language_tag = n.get_string_value() },\n \"lastModifiedDateTime\" => lambda {|n| @last_modified_date_time = n.get_date_time_value() },\n \"numberOfPages\" => lambda {|n| @number_of_pages = n.get_number_value() },\n \"skillTags\" => lambda {|n| @skill_tags = n.get_collection_of_primitive_values(String) },\n \"sourceName\" => lambda {|n| @source_name = n.get_string_value() },\n \"thumbnailWebUrl\" => lambda {|n| @thumbnail_web_url = n.get_string_value() },\n \"title\" => lambda {|n| @title = n.get_string_value() },\n })\n end",
"def as_json\n record\n end",
"def get_field_deserializers()\n return super.merge({\n \"audioDeviceName\" => lambda {|n| @audio_device_name = n.get_string_value() },\n \"bookingType\" => lambda {|n| @booking_type = n.get_enum_value(MicrosoftGraph::Models::BookingType) },\n \"building\" => lambda {|n| @building = n.get_string_value() },\n \"capacity\" => lambda {|n| @capacity = n.get_number_value() },\n \"displayDeviceName\" => lambda {|n| @display_device_name = n.get_string_value() },\n \"emailAddress\" => lambda {|n| @email_address = n.get_string_value() },\n \"floorLabel\" => lambda {|n| @floor_label = n.get_string_value() },\n \"floorNumber\" => lambda {|n| @floor_number = n.get_number_value() },\n \"isWheelChairAccessible\" => lambda {|n| @is_wheel_chair_accessible = n.get_boolean_value() },\n \"label\" => lambda {|n| @label = n.get_string_value() },\n \"nickname\" => lambda {|n| @nickname = n.get_string_value() },\n \"tags\" => lambda {|n| @tags = n.get_collection_of_primitive_values(String) },\n \"videoDeviceName\" => lambda {|n| @video_device_name = n.get_string_value() },\n })\n end",
"def serialize\n raise NotImplementedError\n end",
"def serialize\n raise NotImplementedError\n end",
"def as_json(_options = {})\n super include: %i[sample_type object_type]\n end",
"def encode_amf serializer\n ::Rails.logger.debug \"[HawkAMF] using default encode_amf method -----------\"\n self.to_amf.encode_amf serializer\n end",
"def persistanse_data\n @attributes.to_json\n end",
"def to_json(*args)\n raise \"File_upload-objects should not be converted to json.\"\n end",
"def to_json(*args)\n raise \"File_upload-objects should not be converted to json.\"\n end",
"def instance_to_json\n\t\t# byebug\n\t\t{\n\t\tid: self.id,\n\t\tname: self.name,\n\t\theight: self.height,\n\t\tlast_watered: self.last_watered,\n\t\tlast_watered_amount: self.last_watered_amount,\n\t\tgrow_zone: self.grow_zone,\n\t\tnotes: self.notes,\n\t\tplanted_date: self.planted_date,\n\t\tfarm: self.farm,\t\n\t\tsensor: self.sensor\n\t\t# farm: { \n\t\t# \tfarm: self.farm.name,\n\t\t# \tfarm: self.farm.id,\n\t\t# },\n\t\t}\n\tend",
"def as_json(options={})\n super(options.merge({:except => [:errors, :validation_context]}))\n end",
"def tojson\n\t\tend",
"def deserialize(data, method = :from_json)\n super\n end",
"def get_field_deserializers()\n return super.merge({\n \"allowedOnlineMeetingProviders\" => lambda {|n| @allowed_online_meeting_providers = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::OnlineMeetingProviderType.create_from_discriminator_value(pn) }) },\n \"calendarPermissions\" => lambda {|n| @calendar_permissions = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::CalendarPermission.create_from_discriminator_value(pn) }) },\n \"calendarView\" => lambda {|n| @calendar_view = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::Event.create_from_discriminator_value(pn) }) },\n \"canEdit\" => lambda {|n| @can_edit = n.get_boolean_value() },\n \"canShare\" => lambda {|n| @can_share = n.get_boolean_value() },\n \"canViewPrivateItems\" => lambda {|n| @can_view_private_items = n.get_boolean_value() },\n \"changeKey\" => lambda {|n| @change_key = n.get_string_value() },\n \"color\" => lambda {|n| @color = n.get_enum_value(MicrosoftGraph::Models::CalendarColor) },\n \"defaultOnlineMeetingProvider\" => lambda {|n| @default_online_meeting_provider = n.get_enum_value(MicrosoftGraph::Models::OnlineMeetingProviderType) },\n \"events\" => lambda {|n| @events = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::Event.create_from_discriminator_value(pn) }) },\n \"hexColor\" => lambda {|n| @hex_color = n.get_string_value() },\n \"isDefaultCalendar\" => lambda {|n| @is_default_calendar = n.get_boolean_value() },\n \"isRemovable\" => lambda {|n| @is_removable = n.get_boolean_value() },\n \"isTallyingResponses\" => lambda {|n| @is_tallying_responses = n.get_boolean_value() },\n \"multiValueExtendedProperties\" => lambda {|n| @multi_value_extended_properties = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::MultiValueLegacyExtendedProperty.create_from_discriminator_value(pn) }) },\n \"name\" => lambda {|n| @name = n.get_string_value() },\n \"owner\" => lambda {|n| @owner = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::EmailAddress.create_from_discriminator_value(pn) }) },\n \"singleValueExtendedProperties\" => lambda {|n| @single_value_extended_properties = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::SingleValueLegacyExtendedProperty.create_from_discriminator_value(pn) }) },\n })\n end",
"def get_field_deserializers()\n return super.merge({\n \"appDisplayName\" => lambda {|n| @app_display_name = n.get_string_value() },\n \"dataType\" => lambda {|n| @data_type = n.get_string_value() },\n \"isSyncedFromOnPremises\" => lambda {|n| @is_synced_from_on_premises = n.get_boolean_value() },\n \"name\" => lambda {|n| @name = n.get_string_value() },\n \"targetObjects\" => lambda {|n| @target_objects = n.get_collection_of_primitive_values(String) },\n })\n end",
"def object_data\n raise NotImplementedError, 'Subclass of EVSSClaimBaseSerializer must implement object_data method'\n end",
"def serializer=(_arg0); end",
"def to_json(*attrs); super self.class.params; end",
"def to_json(*attrs); super self.class.params; end",
"def to_json(*attrs); super self.class.params; end",
"def object_to_json(obj)\n JSON(obj)\nend",
"def get_field_deserializers()\n return super.merge({\n \"attachments\" => lambda {|n| @attachments = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::Attachment.create_from_discriminator_value(pn) }) },\n \"bccRecipients\" => lambda {|n| @bcc_recipients = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::Recipient.create_from_discriminator_value(pn) }) },\n \"body\" => lambda {|n| @body = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::ItemBody.create_from_discriminator_value(pn) }) },\n \"bodyPreview\" => lambda {|n| @body_preview = n.get_string_value() },\n \"ccRecipients\" => lambda {|n| @cc_recipients = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::Recipient.create_from_discriminator_value(pn) }) },\n \"conversationId\" => lambda {|n| @conversation_id = n.get_string_value() },\n \"conversationIndex\" => lambda {|n| @conversation_index = n.get_object_value(lambda {|pn| Base64url.create_from_discriminator_value(pn) }) },\n \"extensions\" => lambda {|n| @extensions = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::Extension.create_from_discriminator_value(pn) }) },\n \"flag\" => lambda {|n| @flag = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::FollowupFlag.create_from_discriminator_value(pn) }) },\n \"from\" => lambda {|n| @from = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::Recipient.create_from_discriminator_value(pn) }) },\n \"hasAttachments\" => lambda {|n| @has_attachments = n.get_boolean_value() },\n \"importance\" => lambda {|n| @importance = n.get_enum_value(MicrosoftGraph::Models::Importance) },\n \"inferenceClassification\" => lambda {|n| @inference_classification = n.get_enum_value(MicrosoftGraph::Models::InferenceClassificationType) },\n \"internetMessageHeaders\" => lambda {|n| @internet_message_headers = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::InternetMessageHeader.create_from_discriminator_value(pn) }) },\n \"internetMessageId\" => lambda {|n| @internet_message_id = n.get_string_value() },\n \"isDeliveryReceiptRequested\" => lambda {|n| @is_delivery_receipt_requested = n.get_boolean_value() },\n \"isDraft\" => lambda {|n| @is_draft = n.get_boolean_value() },\n \"isRead\" => lambda {|n| @is_read = n.get_boolean_value() },\n \"isReadReceiptRequested\" => lambda {|n| @is_read_receipt_requested = n.get_boolean_value() },\n \"multiValueExtendedProperties\" => lambda {|n| @multi_value_extended_properties = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::MultiValueLegacyExtendedProperty.create_from_discriminator_value(pn) }) },\n \"parentFolderId\" => lambda {|n| @parent_folder_id = n.get_string_value() },\n \"receivedDateTime\" => lambda {|n| @received_date_time = n.get_date_time_value() },\n \"replyTo\" => lambda {|n| @reply_to = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::Recipient.create_from_discriminator_value(pn) }) },\n \"sender\" => lambda {|n| @sender = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::Recipient.create_from_discriminator_value(pn) }) },\n \"sentDateTime\" => lambda {|n| @sent_date_time = n.get_date_time_value() },\n \"singleValueExtendedProperties\" => lambda {|n| @single_value_extended_properties = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::SingleValueLegacyExtendedProperty.create_from_discriminator_value(pn) }) },\n \"subject\" => lambda {|n| @subject = n.get_string_value() },\n \"toRecipients\" => lambda {|n| @to_recipients = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::Recipient.create_from_discriminator_value(pn) }) },\n \"uniqueBody\" => lambda {|n| @unique_body = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::ItemBody.create_from_discriminator_value(pn) }) },\n \"webLink\" => lambda {|n| @web_link = n.get_string_value() },\n })\n end",
"def serialize\n end",
"def test_serialization\n # TODO: test serialization methods\n end",
"def as_json(options={})\n super.merge(\n {\n :fta_vehicle_type_id => self.fta_vehicle_type.present? ? self.fta_vehicle_type.to_s : nil,\n :seating_capacity => self.seating_capacity,\n :standing_capacity => self.standing_capacity,\n :wheelchair_capacity => self.wheelchair_capacity,\n :vehicle_length => self.vehicle_length,\n :vehicle_features => self.vehicle_features\n })\n end",
"def get_field_deserializers()\n return super.merge({\n \"content\" => lambda {|n| @content = n.get_object_value(lambda {|pn| Base64url.create_from_discriminator_value(pn) }) },\n \"expirationDateTime\" => lambda {|n| @expiration_date_time = n.get_date_time_value() },\n \"nextExpectedRanges\" => lambda {|n| @next_expected_ranges = n.get_collection_of_primitive_values(String) },\n })\n end",
"def parse_json_custom(object, options)\n # p \"SerializableResource, parse_json_custom, object, options\" + object.to_s + \" \" + options.to_s\n # ActiveModelSerializers::SerializableResource.new(object).as_json\n # Able to access at serializer level as @instance_options\n ActiveModelSerializers::SerializableResource.new(object, options).as_json\n end",
"def get_field_deserializers()\n return super.merge({\n \"createdDateTime\" => lambda {|n| @created_date_time = n.get_date_time_value() },\n \"deviceId\" => lambda {|n| @device_id = n.get_string_value() },\n \"key\" => lambda {|n| @key = n.get_string_value() },\n \"volumeType\" => lambda {|n| @volume_type = n.get_enum_value(MicrosoftGraph::Models::VolumeType) },\n })\n end",
"def encode\n raise Errors::SerializerNotConfigured if serializer_missing?\n\n serializer.encode(self)\n end",
"def as_json(options={})\n super.merge({\n :fta_vehicle_type_id => self.fta_vehicle_type.present? ? self.fta_vehicle_type.to_s : nil\n })\n end",
"def shouldConvert\n false\n end",
"def convert_to_json(result)\n opts = roda_class.opts\n serializer = opts[:json_result_serializer]\n\n if opts[:json_result_include_request]\n serializer.call(result, self)\n else\n serializer.call(result)\n end\n end",
"def get_field_deserializers()\n return super.merge({\n \"attachmentSessions\" => lambda {|n| @attachment_sessions = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::AttachmentSession.create_from_discriminator_value(pn) }) },\n \"attachments\" => lambda {|n| @attachments = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::AttachmentBase.create_from_discriminator_value(pn) }) },\n \"body\" => lambda {|n| @body = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::ItemBody.create_from_discriminator_value(pn) }) },\n \"bodyLastModifiedDateTime\" => lambda {|n| @body_last_modified_date_time = n.get_date_time_value() },\n \"categories\" => lambda {|n| @categories = n.get_collection_of_primitive_values(String) },\n \"checklistItems\" => lambda {|n| @checklist_items = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::ChecklistItem.create_from_discriminator_value(pn) }) },\n \"completedDateTime\" => lambda {|n| @completed_date_time = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::DateTimeTimeZone.create_from_discriminator_value(pn) }) },\n \"createdDateTime\" => lambda {|n| @created_date_time = n.get_date_time_value() },\n \"dueDateTime\" => lambda {|n| @due_date_time = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::DateTimeTimeZone.create_from_discriminator_value(pn) }) },\n \"extensions\" => lambda {|n| @extensions = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::Extension.create_from_discriminator_value(pn) }) },\n \"hasAttachments\" => lambda {|n| @has_attachments = n.get_boolean_value() },\n \"importance\" => lambda {|n| @importance = n.get_enum_value(MicrosoftGraph::Models::Importance) },\n \"isReminderOn\" => lambda {|n| @is_reminder_on = n.get_boolean_value() },\n \"lastModifiedDateTime\" => lambda {|n| @last_modified_date_time = n.get_date_time_value() },\n \"linkedResources\" => lambda {|n| @linked_resources = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::LinkedResource.create_from_discriminator_value(pn) }) },\n \"recurrence\" => lambda {|n| @recurrence = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::PatternedRecurrence.create_from_discriminator_value(pn) }) },\n \"reminderDateTime\" => lambda {|n| @reminder_date_time = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::DateTimeTimeZone.create_from_discriminator_value(pn) }) },\n \"startDateTime\" => lambda {|n| @start_date_time = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::DateTimeTimeZone.create_from_discriminator_value(pn) }) },\n \"status\" => lambda {|n| @status = n.get_enum_value(MicrosoftGraph::Models::TaskStatus) },\n \"title\" => lambda {|n| @title = n.get_string_value() },\n })\n end",
"def as_json(options={})\n super.merge(\n {\n :title_number => self.title_number,\n :title_owner_organization_id => self.title_owner.present? ? self.title_owner.to_s : nil,\n :expected_useful_miles => self.expected_useful_miles,\n :rebuild_year => self.rebuild_year,\n :vehicle_storage_method_type_id => self.vehicle_storage_method_type.present? ? self.vehicle_storage_method_type.to_s : nil,\n :fuel_type_id => self.fuel_type.present? ? self.fuel_type.to_s : nil\n })\n end",
"def as_json(options={})\n options[:include] = {\n :organisation => {},\n :locations => { \n methods: :geometry,\n include: :accessibilities\n },\n :taxonomies => { methods: :slug },\n :meta => {},\n :contacts => {},\n :local_offer => {},\n :send_needs => {},\n :suitabilities => {},\n :cost_options => {},\n :regular_schedules => {},\n :links => {}\n }\n super\n end",
"def to_json_raw_object()\n #This is a stub, used for indexing\n end",
"def to_ext_json(options = {})\n if given_class = options.delete(:class)\n element_class = (given_class.is_a?(Class) ? given_class : given_class.to_s.classify.constantize)\n else\n element_class = first.class\n end\n element_count = options.delete(:count) || self.length\n fields= options.delete(:fields) || element_class.column_names\n\n# { :results => element_count, element_class.table_name.to_s => self }.to_json(options)\n\n# if element_class.pluralize_table_names\n# { :results => element_count, element_class.to_s.underscore.pluralize => self }.to_json(options)\n# else\n# { :results => element_count, element_class.to_s.underscore => self }.to_json(options)\n# end\n\n if !fields # send complete records - never more, use always the else, see fields=\n { :results => element_count.to_s, element_class.to_s.underscore => self }.to_json(options)\n else # send just the data that whas asked for\n if !fields.include?('id')\n fields << 'id'\n end\n data=[]\n self.each do |record|\n clean_record={}\n fields.each do |f|\n clean_record[f.to_sym]=record.send(f).to_s\n end\n data << clean_record\n end\n { :results => element_count.to_s, element_class.to_s.underscore => data }.to_json(options)\n end\n\n end",
"def as_json(options={})\r\n\t\tsuper({ :only => [:alias, :name, :description] })\r\n\tend",
"def to_json(options={})\n options[:except] ||= [:created_at, :updated_at]\n super(options)\n end",
"def before_save\n deserialized_values.each{|k,v| @values[k] = serialize_value(k, v)}\n super\n end",
"def get_field_deserializers()\n return super.merge({\n \"license\" => lambda {|n| @license = n.get_string_value() },\n \"licenseType\" => lambda {|n| @license_type = n.get_enum_value(MicrosoftGraph::Models::EditionUpgradeLicenseType) },\n \"productKey\" => lambda {|n| @product_key = n.get_string_value() },\n \"targetEdition\" => lambda {|n| @target_edition = n.get_enum_value(MicrosoftGraph::Models::Windows10EditionType) },\n })\n end",
"def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_collection_of_primitive_values(\"aliases\", @aliases)\n writer.write_collection_of_object_values(\"countriesOrRegionsOfOrigin\", @countries_or_regions_of_origin)\n writer.write_object_value(\"description\", @description)\n writer.write_date_time_value(\"firstActiveDateTime\", @first_active_date_time)\n writer.write_collection_of_object_values(\"indicators\", @indicators)\n writer.write_enum_value(\"kind\", @kind)\n writer.write_object_value(\"summary\", @summary)\n writer.write_collection_of_primitive_values(\"targets\", @targets)\n writer.write_string_value(\"title\", @title)\n writer.write_object_value(\"tradecraft\", @tradecraft)\n end",
"def get_field_deserializers()\n return super.merge({\n \"content\" => lambda {|n| @content = n.get_object_value(lambda {|pn| Base64url.create_from_discriminator_value(pn) }) },\n \"expirationDateTime\" => lambda {|n| @expiration_date_time = n.get_date_time_value() },\n \"issuer\" => lambda {|n| @issuer = n.get_string_value() },\n \"issuerName\" => lambda {|n| @issuer_name = n.get_string_value() },\n \"status\" => lambda {|n| @status = n.get_enum_value(MicrosoftGraph::Models::CertificateStatus) },\n \"subject\" => lambda {|n| @subject = n.get_string_value() },\n \"subjectName\" => lambda {|n| @subject_name = n.get_string_value() },\n \"uploadDateTime\" => lambda {|n| @upload_date_time = n.get_date_time_value() },\n })\n end",
"def votecannotbecast\t\t\n\t\trespond_to do |format|\n\t\t\tformat.js {}\n\t\tend\n\tend",
"def get_json\n return to_json()\nend",
"def get_field_deserializers()\n return super.merge({\n \"committedContentVersion\" => lambda {|n| @committed_content_version = n.get_string_value() },\n \"contentVersions\" => lambda {|n| @content_versions = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::MobileAppContent.create_from_discriminator_value(pn) }) },\n \"fileName\" => lambda {|n| @file_name = n.get_string_value() },\n \"size\" => lambda {|n| @size = n.get_object_value(lambda {|pn| Int64.create_from_discriminator_value(pn) }) },\n })\n end",
"def _before_validation\n serialize_deserialized_values\n super\n end",
"def serialize(_object, data); end"
] |
[
"0.6028282",
"0.6010551",
"0.58420783",
"0.57404816",
"0.56961584",
"0.56824327",
"0.56650573",
"0.5637409",
"0.55957013",
"0.55818194",
"0.55818194",
"0.5560551",
"0.55250984",
"0.5514573",
"0.55105966",
"0.5488464",
"0.5474449",
"0.5472394",
"0.54710424",
"0.54426444",
"0.54258144",
"0.5402462",
"0.5396083",
"0.5395488",
"0.5395488",
"0.5395488",
"0.5392599",
"0.53286874",
"0.53049296",
"0.5301243",
"0.5285815",
"0.5283034",
"0.5282555",
"0.52589506",
"0.5246076",
"0.5237059",
"0.52262",
"0.5222014",
"0.5215945",
"0.5201273",
"0.51978266",
"0.5187601",
"0.5186937",
"0.51797557",
"0.5177629",
"0.5172655",
"0.516979",
"0.5153752",
"0.513466",
"0.51342106",
"0.5126081",
"0.51245487",
"0.5123841",
"0.51155365",
"0.51095134",
"0.51093745",
"0.51093745",
"0.510536",
"0.5101678",
"0.5094974",
"0.50937164",
"0.50937164",
"0.5090867",
"0.5076411",
"0.5072387",
"0.50723076",
"0.50707847",
"0.5068875",
"0.5065736",
"0.5064589",
"0.505642",
"0.505642",
"0.505642",
"0.50541747",
"0.5053265",
"0.50506234",
"0.5049583",
"0.5039705",
"0.5036933",
"0.5033217",
"0.50302887",
"0.502954",
"0.50262606",
"0.5025293",
"0.5024601",
"0.5023104",
"0.5018703",
"0.50183237",
"0.5014557",
"0.5012569",
"0.5010154",
"0.5008737",
"0.5006243",
"0.50031775",
"0.50027716",
"0.50022095",
"0.5001984",
"0.50014687",
"0.5000238",
"0.49984545",
"0.49966455"
] |
0.0
|
-1
|
cast an eav value to it's desired class
|
def cast_eav_value value, attribute # :nodoc:
attributes = self.class_eav_attributes.stringify_keys
return value unless attributes.keys.include?(attribute)
return value if attributes[attribute] == String # no need for casting
begin
# for core types [eg: Integer '12']
eval("#{attributes[attribute]} '#{value}'")
rescue
begin
# for BigDecimal [eg: BigDecimal.new("123.45")]
eval("#{attributes[attribute]}.new('#{value}')")
rescue
begin
# for date/time classes [eg: Date.parse("2011-03-20")]
eval("#{attributes[attribute]}.parse('#{value}')")
rescue
value
end
end
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def cast_value(value)\n case value\n when String then decode_and_initialize(value)\n when Hash then extract_model_klass(value).new(value)\n when nil then value\n else\n raise_cast_error(value) unless value.class.ancestors.include?(StoreModel::Model)\n\n value\n end\n rescue ActiveModel::UnknownAttributeError => e\n handle_unknown_attribute(value, e)\n end",
"def typecast(value)\n value\n end",
"def typecast(value)\n value\n end",
"def cast(value)\n value\n end",
"def typecast(value)\n Typecast[value.class.name].send(typecast_method, value)\n end",
"def cast_value(value)\n value\n end",
"def value_from( value )\n #----------------------\n #raise MongoODM::Errors::TypeCastMissing.new(value, @type) unless @type.respond_to?(:type_cast)\n @type.from( value )\n end",
"def typecast_to_class(value)\n value.to_s.constantize\n rescue NameError\n nil\n end",
"def cast_value(value) # :doc:\n value\n end",
"def cast_value(value) # :api: public\n value\n end",
"def typecast_value(type, value)\n if value.is_a?(ActiveAttr::MultiAttr)\n typecast_multiattr(type, value)\n elsif typecaster = TYPECASTERS[type]\n typecaster.new.call(value)\n end\n end",
"def cast_value(value)\n case value_type\n when 'integer' then value.to_i\n when 'float' then value.to_f\n when 'string' then value.to_s\n else raise_invalid_type\n end\n end",
"def cast_attribute(value, type_name)\n case type_name\n when :integer then value.to_i\n when :float then value.to_f\n when :boolean then !!value\n else value\n end\n end",
"def typecast(value)\n if value.kind_of?(Range) then Range.new(typecast(value.first), typecast(value.last))\n elsif value.kind_of?(Array) then value.map{|v| typecast(v)}\n elsif primitive == BigDecimal then super(value).to_f\n elsif primitive == DateTime then Time.parse(super(value).to_s).to_i\n elsif primitive == Date then Time.parse(super(value).to_s).to_i\n elsif primitive == Time then super(value).to_i\n else\n super(value) # Good luck\n end\n end",
"def typecast(value)\n return value if type === value || (value.nil? && type != TrueClass)\n\n if type == TrueClass then %w[ true 1 t ].include?(value.to_s.downcase)\n elsif type == String then value.to_s\n elsif type == Float then value.to_f\n elsif type == Fixnum then value.to_i\n elsif type == BigDecimal then BigDecimal(value.to_s)\n elsif type == DateTime then DateTime.parse(value.to_s)\n elsif type == Date then Date.parse(value.to_s)\n elsif type == Class then find_const(value)\n end\n end",
"def cast_value\n value.mongoize\n end",
"def typecast_attribute(type, value)\n raise ArgumentError, \"a Class must be given\" unless type\n return value if value.nil?\n typecast_value(type, value)\n end",
"def value_coercion(value); end",
"def type_cast(value, type)\n return nil if value.nil?\n case type\n when :string then value\n when :text then value\n when :money then string_to_money(value)\n when :integer then value.to_i rescue value ? 1 : 0\n when :float then value.to_f\n when :datetime then string_to_time(value)\n when :timestamp then string_to_time(value)\n when :time then string_to_dummy_time(value)\n when :date then string_to_date(value)\n when :boolean then value_to_boolean(value)\n else value\n end\n end",
"def cast(value, type)\n case type\n when :string\n value\n when :integer\n value.to_i\n when :float\n value.to_f\n when :percent\n value.to_f\n when :currency\n BigDecimal(value)\n when :time\n value.to_i\n when :date\n parse_date(value)\n end\n end",
"def deserialize(value)\n cast(value)\n end",
"def cast(sval)\n case sid\n when 'integer' then sval.to_i\n when 'string', 'text' then sval\n when 'boolean' then BoolTrueReps.member?(sval.to_s)\n when 'float' then sval.to_f\n when 'date' then sval && Date.parse(sval)\n else raise \"Don't know how to handle MetaPropertyType with sid '#{sid}'.\"\n end\n end",
"def cast_value(num_class)\n num_class.context.Num(@value)\n end",
"def cast(v, **opt)\n c = self_class\n v.is_a?(c) ? v : create(v, **opt)\n end",
"def cast(v, **opt)\n c = self_class\n v.is_a?(c) ? v : create(v, **opt)\n end",
"def type_cast(value) # :api: public\n cast_value(value) unless value.nil?\n end",
"def convert(value) value end",
"def cast_as_value(as_type,as_property)\n if(as_type == :date)\n return \"XMLUtils.dateToXML(#{as_property})\"\n elsif(as_type == :datetime)\n return \"TolDateUtils.toTimeParam(#{as_property})\"\n else\n return as_property\n end\n end",
"def convert_attribute_value obj\n case obj\n when OpenCensus::Trace::TruncatableString\n TraceProtos::AttributeValue.new \\\n string_value: convert_truncatable_string(obj)\n when Integer\n TraceProtos::AttributeValue.new int_value: obj\n when true, false\n TraceProtos::AttributeValue.new bool_value: obj\n end\n end",
"def untypecasted_value\n read_attribute(:value)\n end",
"def cast(value)\n cast_value(value) unless value.nil?\n end",
"def typecast(value)\n return type.typecast(value, self) if type.respond_to?(:typecast)\n return value if value.kind_of?(primitive) || value.nil?\n begin\n # TODO: optimize this using a Hash lookup table\n if primitive == Integer\n # only typecast a String that looks like a number\n value.to_s =~ /\\A(-?(?:0+|[1-9]\\d*)(?:\\.\\d+)?)\\z/ ? $1.to_i : value\n elsif primitive == String then value.to_s\n elsif primitive == TrueClass then %w[ true 1 t ].include?(value.to_s.downcase)\n elsif primitive == BigDecimal then BigDecimal(value.to_s)\n elsif primitive == Float then value.to_f\n elsif primitive == DateTime then typecast_to_datetime(value)\n elsif primitive == Time then typecast_to_time(value)\n elsif primitive == Date then typecast_to_date(value)\n elsif primitive == Class then self.class.find_const(value)\n else\n value\n end\n rescue\n value\n end\n end",
"def typecast_one(val, tc)\n if tc[:use]\n self.__send__(tc[:use], val, tc)\n else\n typecast(tc[:as], val, tc) \n end\n end",
"def typecasted_value\n typecaster.present? ? typecaster.typecast(untypecasted_value) : untypecasted_value\n end",
"def type_cast(value, record = nil, dest_type = nil) # rubocop:disable Metrics/CyclomaticComplexity\n value = @default if value.nil?\n return nil if value.nil?\n return coder.load(value) if encoded?\n\n klass = self.class\n\n case dest_type || type\n when :string, :text then value.to_s\n when :ascii then value.force_encoding('ascii')\n when :integer, :long then klass.value_to_integer(value)\n when :float then value.to_f\n when :decimal then klass.value_to_decimal(value)\n when :datetime, :timestamp then klass.string_to_time(value)\n when :time then klass.string_to_dummy_time(value)\n when :date then klass.value_to_date(value)\n when :binary then klass.binary_to_string(value)\n when :boolean then klass.value_to_boolean(value)\n when :uuid, :timeuuid\n uuid = klass.value_to_uuid(value)\n uuid.is_a?(::Cql::Uuid) ? uuid.to_s : uuid\n when :list, :set\n wrap_collection(Array(value).map { |v| type_cast(v, record, @options[:holds]) }.reject(&:blank?), record)\n when :map\n wrap_collection(value.each { |k, v| value[k] = type_cast(v, record, @options[:holds]) }.stringify_keys, record)\n else value\n end\n end",
"def convert(attribute, v)\n clazz = attribute.clazz\n # either as it is already the correct (||nested_array) type\n if v == nil || v.is_a?(clazz) || (attribute.is_a?(Arrest::NestedCollection) && v.is_a?(Array))\n converted_v = v\n elsif attribute.is_a?(Arrest::NestedAttribute) && v.is_a?(Hash) # a nested attribute needs a parent and a hash\n converted_v = attribute.from_hash(self, v)\n elsif clazz.respond_to?(:convert) # or its clazz implements a convert method\n converted_v = clazz.convert(v)\n elsif CONVERTER[clazz] # or a converter has been registered in arrest\n converted_v = CONVERTER[clazz].convert(v)\n else # otherwise raise\n raise ArgumentError, \"Setting of attribute with type >#{clazz}< with value type >#{v.class}< failed.\"\n end\n converted_v\n end",
"def type_cast(value)\n if root.equal?(self)\n raise NotImplementedError, \"#type_cast should be implemented in a subclass.\"\n else\n root.type_cast(value)\n end\n end",
"def cast_value(v)\r\n return nil if v.nil?\r\n if @type == :date\r\n self.style = STYLE_DATE if self.style == 0\r\n v\r\n elsif (@type == :time && v.is_a?(Time)) || (@type == :time && v.respond_to?(:to_time))\r\n self.style = STYLE_DATE if self.style == 0\r\n # one simple little fix. I DO NOT WANT TIME IN LOCAL TIME!\r\n unless v.is_a?(Time)\r\n v = v.respond_to?(:to_time) ? v.to_time : v\r\n end\r\n v\r\n elsif @type == :float\r\n v.to_f\r\n elsif @type == :integer\r\n v.to_i\r\n elsif @type == :boolean\r\n v ? 1 : 0\r\n elsif @type == :iso_8601\r\n #consumer is responsible for ensuring the iso_8601 format when specifying this type\r\n v\r\n else\r\n @type = :string\r\n # TODO find a better way to do this as it accounts for 30% of\r\n # processing time in benchmarking...\r\n Axlsx::trust_input ? v.to_s : ::CGI.escapeHTML(v.to_s)\r\n end\r\n end",
"def cast_value(val)\n raise ArgumentError.new(\"Your value is not a String! (it's a #{val.class})\") if val.class != String && val.class != TrueClass && val.class != FalseClass\n \n if (Float val rescue false)\n Float val\n elsif (Integer val rescue false)\n Integer val\n elsif val =~ /^true$/i || val == true\n true\n elsif val =~ /^false$/i || val == false\n false\n else\n val\n end\n end",
"def from_amee_model(rvd)\n rvd.each do |avalue|\n vt=case avalue.valuetype\n when \"CCEB59CACE1B\"\n 'TEXT'\n when \"45433E48B39F\"\n 'DECIMAL'\n end\n value=ReturnValue.new(avalue.type,avalue.type,vt,avalue.unit,avalue.perunit) # Type used twice until AMEE \n # gem supports RVD names\n @values.push value\n end\n validate\n end",
"def convert_value(value)\n case value\n when VividMash, AttrArray\n value\n when Hash\n VividMash.new(value, __root__, __node__, __precedence__)\n when Array\n AttrArray.new(value, __root__, __node__, __precedence__)\n else\n value\n end\n end",
"def convert_object(value)\n case value\n when RDFSource\n value\n when RDF::Literal\n if value.simple?\n value.object\n elsif value.has_datatype?\n RDF::Literal.datatyped_class(value.datatype.to_s) ? value.object : value\n else\n value\n end\n when RDF::Resource\n cast? ? make_node(value) : value\n else\n value\n end\n end",
"def typecast_to_primitive(value)\n DataMapper::Ext::Module.find_const(model, value.to_s)\n rescue NameError\n value\n end",
"def type_cast(value)\r\n @column_definition.type_cast(value)\r\n end",
"def coerce(value)\n value\n end",
"def value\n @casted_value ||= type_cast_value(@value)\n end",
"def type_cast(value, type = self.type)\n case type\n when :counter\n type_cast(value, :integer).to_i\n when :integer\n Kernel::Integer(value) rescue nil if value\n when :float\n Kernel::Float(value) rescue nil if value\n when :timestamp\n value = type_cast(value, :integer)\n Time.at(value) if value\n else\n value\n end\n end",
"def value\n typecast.present? ? typecasted_value : super\n end",
"def cast\n defined_attributes.each do |name, attr|\n value = public_send(name)\n next if value.nil?\n\n begin\n casted = attr.cast!(value)\n public_send(\"#{name}=\", casted)\n rescue ActiveEntity::CastError\n end\n end\n nil\n end",
"def type_cast(value)\n case type\n when 'N' # number\n unpack_number(value)\n when 'I' # integer\n unpack_unsigned_long(value)\n when 'F' # float\n unpack_float(value)\n when 'D' # date\n decode_date(value)\n when 'T' # datetime\n decode_datetime(value)\n when 'L' # logical\n boolean(value)\n else\n value.to_s.strip\n end\n end",
"def cast_types; end",
"def cast(val, type)\n val = Convert(val)\n kind = val.type.kind\n type = LLVM::Script::Validate(type, :type)\n if kind == :integer && type.kind == :integer\n @builder.int_cast(val, type)\n elsif LLVM::Script::Decimal(kind) && LLVM::Script::Decimal(type.kind)\n @builder.fp_cast(val, type)\n elsif kind == :pointer && type.kind == :pointer\n @builder.pointer_cast(val, type)\n else\n raise ArgumentError, \"Value and type passed to cast are not both of Integer, Float, or Pointer.\"\n end\n end",
"def cast_value(value)\n return value if value.blank?\n return value if form_options.is_a? Proc\n return field_options[:cast].call(value) if field_options[:cast].is_a? Proc\n case form_options[:as]\n when :bs_datetimepicker\n if value.is_a? String\n DateTime.parse(value)\n elsif value.is_a? Date\n value.to_time\n else\n value\n end\n when :bs_datepicker\n if value.is_a? String\n DateTime.parse(value).to_date\n elsif value.is_a? DateTime\n value.to_date\n else\n value\n end\n else\n value\n end\n\n end",
"def typecast\n @typecast ||= Settler.typecast_for(key)\n end",
"def type_cast(value, type)\n case value\n when Array\n value.collect { |v| type_cast(v, type) }\n else\n # Let's leverage ActiveRecord's type casting, so that casting is consistent\n # with the other models.\n column_for_type_cast = ::ActiveRecord::ConnectionAdapters::Column.new(\"\", nil)\n column_for_type_cast.instance_variable_set(:@type, type)\n value = column_for_type_cast.type_cast(value)\n Time.zone && value.is_a?(Time) ? value.in_time_zone : value\n end\n end",
"def type_cast_for_schema(value)\n cast(value).value.inspect\n end",
"def convert_to(value, type, path = nil)\n path = Path.new(path) unless path.kind_of?(Path)\n case type.object_id\n when Integer.object_id\n raise Error.new(Error::WrongType, path) unless value.respond_to?(:to_i)\n value.to_i\n when Float.object_id\n raise Error.new(Error::WrongType, path) unless value.respond_to?(:to_f)\n value.to_f\n when Array.object_id\n # FIXME: Should allow more flexible kinds of lists (with spaces).\n value.to_s.split\n when String.object_id\n value.to_s\n else\n raise Error.new(Error::WrongType, path) unless type.respond_to?(:from_str)\n type.from_str(value)\n end\n end",
"def cast_xml_value(as_type,value)\n if(as_type == :date)\n return \"XMLUtils.xmlListToDate(#{value});\"\n elsif(as_type == :datetime)\n return \"DateUtil.parseW3CDTF(#{value}.toString());\"\n elsif(as_type == :boolean)\n return \"XMLUtils.xmlListToBoolean(#{value});\" \n elsif(as_type == :integer or as_type == :float)\n return \"Number(#{value});\"\n end\n cast_value = \"#{value};\"\n end",
"def type_cast(value)\n nil\n end",
"def get_value(object)\n case value_type\n when 'integer' then object.value_integer\n when 'float' then object.value_float\n when 'string' then object.value_string\n else raise_invalid_type\n end\n end",
"def convert(value, type)\n begin\n case type\n when 'json' then JSON.parse(value)\n when 'base64' then JSON.parse(Base64.decode64(value))\n when 'integer' then Integer(value)\n when 'number' then Float(value)\n else\n value.to_s\n end\n rescue ArgumentError\n value.to_s\n end\n end",
"def type_cast_for_solr(value, dest_type = nil)\n return nil if value.nil?\n return coder.dump(value) if encoded?\n\n case (dest_type || type)\n when :boolean then value ? 'true' : 'false'\n when :date, :time, :datetime, :timestamp then value.to_time.utc.strftime(Format::SOLR_TIME_FORMAT)\n when :list, :set then list_to_solr_value(value)\n when :map then map_to_solr_value(value)\n when :uuid, :timeuuid then value.to_s\n else value\n end\n end",
"def convert(value)\n case value\n when java.util.List then value.to_a\n when java.util.Set then value.to_set\n when java.util.Map then value.to_hash\n else value\n end\n end",
"def coerce(value)\n @base_class.new(value)\n end",
"def typecaster(val, type)\n case type.to_sym\n when :string then val.to_s\n when :integer then val.to_i\n else\n raise \"Typecaster: i don't know this type: #{type}.\"\n end\n end",
"def serialize_value(v)\n case v\n when TZOffset, Geo::Coord, Reality::Link, Reality::Measure, Money::Currency\n v.inspect\n when Array\n v.map(&method(:serialize_value))\n when String, Numeric, Date, Time\n v\n else\n fail ArgumentError, \"Not a basic value in the entity: #{v.inspect}\"\n end\n end",
"def convert_value(value)\n value\n end",
"def convert_to_object_value(dynamo_value); dynamo_value; end",
"def update_value_type\n write_attribute :value_type, EavEntry.get_value_type(@value)\n end",
"def find_and_cast_into_type(klass, data)\n return if data.nil?\n\n case klass.to_s\n when 'Boolean'\n return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass)\n when 'Float'\n return data if data.instance_of?(Float)\n when 'Integer'\n return data if data.instance_of?(Integer)\n when 'Time'\n return Time.parse(data)\n when 'Date'\n return Date.parse(data)\n when 'String'\n return data if data.instance_of?(String)\n when 'Object' # \"type: object\"\n return data if data.instance_of?(Hash)\n when /\\AArray<(?<sub_type>.+)>\\z/ # \"type: array\"\n if data.instance_of?(Array)\n sub_type = Regexp.last_match[:sub_type]\n return data.map { |item| find_and_cast_into_type(sub_type, item) }\n end\n when /\\AHash<String, (?<sub_type>.+)>\\z/ # \"type: object\" with \"additionalProperties: { ... }\"\n if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) }\n sub_type = Regexp.last_match[:sub_type]\n return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type, v) }\n end\n else # model\n const = EgoiRubyClient.const_get(klass)\n if const\n if const.respond_to?(:openapi_one_of) # nested oneOf model\n model = const.build(data)\n return model if model\n else\n # raise if data contains keys that are not known to the model\n raise unless (data.keys - const.acceptable_attributes).empty?\n model = const.build_from_hash(data)\n return model if model && model.valid?\n end\n end\n end\n\n raise # if no match by now, raise\n rescue\n raise SchemaMismatchError, \"#{data} doesn't match the #{klass} type\"\n end",
"def typecast_attribute_for_read(attr_name, value)\n self\n .find_typecaster(attr_name)\n .from_api(value)\n end",
"def value\n to_type(@value)\n end",
"def convert_value(val)\n case basic_type\n when nil\n val\n when /^str/i\n (val.nil? or val.empty?) ? nil : val\n when /^bool/i\n if val.is_a?(TrueClass) or val.is_a?(FalseClass)\n val\n elsif val.is_a?(String)\n !!(['1', 't', 'T'].include?(val))\n elsif val.is_a?(Numeric)\n !!val.nonzero?\n else\n val\n end\n when /^int/i\n val.to_i\n else\n val\n end\n end",
"def _typecast(obj)\n if t = @typecaster\n t.call(obj)\n else\n obj\n end\n end",
"def cast(property, value)\n return nil if value.nil?\n type = property.type\n if value.instance_of?(type) || type == Object\n value\n elsif CASTABLE_TYPES.include?(type)\n send('typecast_to_'+type.to_s.downcase, value)\n else\n type.new(value)\n end\n end",
"def as(value)\n @value = value\n end",
"def coerce_value(key, value)\n return value unless value\n klass = self.class.attributes[key][:class]\n \n if value.is_a?(String) and !value.empty?\n # In-built types\n if klass.kind_of?(Videojuicer::Resource::Types::Base)\n return klass.new(value).dump\n end\n \n # Dates\n if klass.respond_to?(:parse)\n return klass.parse(value) rescue raise \"Invalid date: #{value.inspect}\"\n end\n elsif value.is_a? Hash and value.any?\n if klass == DateTime\n if value.is_a?(Hash)\n year = value[:year]\n month = value[:month]\n day = value[:day]\n hour = value[:hour] or \"00\"\n minute = value[:minute] or \"00\"\n value = klass.parse(\"#{year}-#{month}-#{day}T#{hour}:#{minute}:00+00:00\")\n else\n raise ArgumentError, \"Please supply a DateTime, Hash keyed w/ [:day, :month, :year, :hour, :minute] or a String that can be coerced into a date\"\n end\n end\n end\n return value\n end",
"def value_transform value, type\n return nil if value.nil? || value.to_s.size == 0\n case type\n when :integer then value.to_i\n when :autoincrement then value.to_i\n when :string then value.to_s\n when :float then value.to_f\n when :bool then value.to_s\n when :symbol then value.to_s\n when :marshal then Marshal.dump(value)\n when :array then Yajl::Encoder.encode(value)\n when :hash then Yajl::Encoder.encode(value)\n when :time then Time.parse(value.to_s).strftime(\"%Y.%m.%d %H:%M:%S\")\n when :date then Date.parse(value.to_s).strftime(\"%Y-%m-%d\")\n else value\n end\n end",
"def type_conversion(value_data, type) \n case type\n when 'boolean'\n return to_boolean(value_data) \n when 'int'\n val = Integer(value_data)\n if (val < -2147483648) || (val > 2147483647)\n raise \"Integer out of range: #{val}\" \n end\n return val\n when 'long'\n val = Integer(value_data)\n if (val < -9223372036854775808) || (val > 9223372036854775807)\n raise \"Long out of range: #{val}\" \n end\n return val\n when 'double'\n return Float(value_data)\n when 'string'\n return value_data\n else\n raise \"Unsupported type: #{type}\" \n end \n end",
"def find_and_cast_into_type(klass, data)\n return if data.nil?\n\n case klass.to_s\n when 'Boolean'\n return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass)\n when 'Float'\n return data if data.instance_of?(Float)\n when 'Integer'\n return data if data.instance_of?(Integer)\n when 'Time'\n return Time.parse(data)\n when 'Date'\n return Date.parse(data)\n when 'String'\n return data if data.instance_of?(String)\n when 'Object' # \"type: object\"\n return data if data.instance_of?(Hash)\n when /\\AArray<(?<sub_type>.+)>\\z/ # \"type: array\"\n if data.instance_of?(Array)\n sub_type = Regexp.last_match[:sub_type]\n return data.map { |item| find_and_cast_into_type(sub_type, item) }\n end\n when /\\AHash<String, (?<sub_type>.+)>\\z/ # \"type: object\" with \"additionalProperties: { ... }\"\n if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) }\n sub_type = Regexp.last_match[:sub_type]\n return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type, v) }\n end\n else # model\n const = Fastly.const_get(klass)\n if const\n if const.respond_to?(:fastly_one_of) # nested oneOf model\n model = const.build(data)\n return model if model\n else\n # raise if data contains keys that are not known to the model\n raise unless (data.keys - const.acceptable_attributes).empty?\n model = const.build_from_hash(data)\n return model if model && model.valid?\n end\n end\n end\n\n raise # if no match by now, raise\n rescue\n raise SchemaMismatchError, \"#{data} doesn't match the #{klass} type\"\n end",
"def coerce(value)\n coercer.call(value)\n end",
"def convert(el)\n #Kernel.p el ; exit\n @type, @value, @attr, @children, @options =\n el.type, el.value, el.attr, el.children, el.options\n send(type)\n end",
"def raw_cast(value)\n # We can strip value here but we do not want to squish it unless for number\n value = value.to_s.strip\n return nil if value.empty?\n\n case data_type\n when 'number'\n BigDecimal(remove_decimal_mark(value.squish))\n when 'date'\n # date_format likely will be '%m/%d/%Y', but if we got '19/8/2014',\n # then `strptime` will raise invalid date error\n # Sometimes we can get '27/11 /1981' also :(\n begin\n Date.strptime(value, @resultset.date_format)\n rescue StandardError\n # We could be getting back these date:\n # '17.12.95', '19/05/99', '27/11 /1981'\n # '1959-07-03' will be beyond us, so consider returning exact value\n value = value.gsub(/-|\\./, '/')\n split = value.split('/').map(&:strip)\n split[2] = \"19#{split[2]}\" if split[2].size == 2\n value = split.join('/')\n\n Date.strptime(\n Date.parse(value)\n .strftime(@resultset.date_format), @resultset.date_format\n )\n end\n when 'time'\n DateTime.strptime(\"1/1/-4712 #{value}\", @resultset.timestamp_format)\n when 'timestamp'\n DateTime.strptime(value, @resultset.timestamp_format)\n when 'container'\n # container may return value that include URI scheme already\n return URI.parse(value) if value.start_with?('http')\n URI.parse(\"#{@resultset.server.url}#{value}\")\n else\n value\n end\n rescue StandardError => e\n warn \"Could not coerce #{name}: #{value} due to #{e.message.force_encoding(\"UTF-8\")}\"\n value\n end",
"def trycast(obj)\n\t\tif obj\n\t\t\treturn is_integer?(obj) ? obj.to_i : is_float?(obj) ? obj.to_f : nil\n\t\tend\n\t\treturn obj\n\tend",
"def cast_value(value, opts = {})\n case value\n when Array\n value.map { |v| cast_value(v, opts) }\n when String\n cast_uri = RDF::URI.new(value)\n cast_uri.valid? ? cast_uri : RDF::Literal.new(value, opts)\n when Time\n # Cast DateTimes with 00:00:00 or Date stored as Times in Mongoid to xsd:date\n # FIXME: this should NOT be applied for fields that are typed as Time\n value.midnight == value ? RDF::Literal.new(value.to_date) : RDF::Literal.new(value.to_datetime)\n else\n RDF::Literal.new(value, opts)\n end\n end",
"def convert(object); end",
"def convert_from_ruby(val)\n @from_ruby.call(val)\n end",
"def convert_value(value)\n value.class == Hash ? self.class.new(value) : value\n end",
"def assign_value\n if assigned_attr = AttrName.find_by_id(self.attr_name_id)\n case assigned_attr.value_type\n when \"STRING\"\n self.string_val = self.raw_value\n when \"FLOAT\" #has a special case to remove the dollar symbol in front of it\n #remove_dollar_sign\n self.float_val = self.raw_value.to_f\n when \"DATETIME\"\n self.datetime_val = self.raw_value.to_datetime\n when \"BOOLEAN\"\n if self.raw_value == 'true'\n self.bool_val = true\n else\n self.bool_val = false\n end\n when \"INTEGER\"\n if assigned_attr.treat_as_price\n logger.debug \"Treating this as a price\"\n self.price_val_cents = Money.parse(self.raw_value).cents\n else\n self.int_val = self.raw_value.to_i\n end\n else\n self.string_val = self.raw_value\n end\n end\n end",
"def from_database_type(obj)\n case obj\n when String, Float, Integer, NilClass, TrueClass, FalseClass\n obj\n when java.sql.Date, java.sql.Time, java.sql.Timestamp\n Time.at(obj.time/1000)\n when java.sql.Blob\n String.from_java_bytes(obj.get_bytes(1,obj.length))\n when java.sql.Clob\n obj.get_sub_string(1, obj.length)\n when java.math.BigDecimal\n BigDecimal.new(obj.to_s)\n else\n raise \"Can't find correct type to convert #{obj.inspect} into\"\n end\n end",
"def type_cast_for_cql3(value, dest_type = nil)\n return nil if value.nil?\n return coder.dump(value) if encoded?\n\n case (dest_type || type)\n when :uuid then value.is_a?(::Cql::Uuid) ? value : self.class.value_to_uuid(value)\n when :time, :datetime, :timestamp then value.to_time.utc\n when :date then value.to_time.utc\n when :set then Set.new(list_to_cql3_value(value))\n when :list then list_to_cql3_value(value)\n when :map then map_to_cql3_value(value)\n else value\n end\n end",
"def typecast(value)\n case value\n when %r{\\Atrue\\z}i then true\n when %r{\\Afalse\\z}i then false\n when %r{\\A\\s*\\z}i then nil\n else\n begin\n begin\n Integer(value)\n rescue StandardError\n Float(value)\n end\n rescue StandardError\n unescape_value(value)\n end\n end\n end",
"def ast_class=(value); end",
"def coerce(value, field_name)\n type = self.class.attributes[field_name]\n case type\n when :boolean\n case\n when (value.kind_of? TrueClass or value.kind_of? FalseClass); then value\n when value == \"true\"; then true\n when (value || '').match(/no|false/); then false # For Overview\n else; value\n end\n when :number\n case\n when value.kind_of?(Numeric); then value\n when value =~ /\\A[+-]?\\d+\\Z/; then value.to_i\n when value =~ /\\A[+-]?\\d+\\.\\d+\\Z/; then value.to_f\n else; value\n end\n when :string\n value.to_s unless value.nil?\n else\n raise ArgumentError, \"#{type} isn't supported as a configuration key type.\"\n end\n end",
"def casted_value\n case qtype.name\n when 'date' then date_value\n when 'time' then time_value\n when 'datetime' then datetime_value\n when 'integer' then value.blank? ? nil : value.to_i\n when 'decimal' then value.blank? ? nil : value.to_f\n else value.blank? ? nil : value\n end\n end",
"def convert_value_to_class_name\n if operator\n class_name = operator.class_name_by_class_model_name_human[@value]\n\n if class_name\n @value = class_name\n end\n end\n end",
"def transform(value, instance); end",
"def cast_value(v)\n return v if v.nil? || v.is_a?(RichText)\n\n case type\n when :date\n self.style = STYLE_DATE if style.zero?\n if !v.is_a?(Date) && v.respond_to?(:to_date)\n v.to_date\n else\n v\n end\n when :time\n self.style = STYLE_DATE if style.zero?\n if !v.is_a?(Time) && v.respond_to?(:to_time)\n v.to_time\n else\n v\n end\n when :float\n v.to_f\n when :integer\n v.to_i\n when :boolean\n v ? 1 : 0\n when :iso_8601\n # consumer is responsible for ensuring the iso_8601 format when specifying this type\n v\n else\n v.to_s\n end\n end",
"def coerce(value)\n Coercion[value.class].public_send(coercion_method, value)\n end",
"def convert\n self.class.convert(object)\n end"
] |
[
"0.7295181",
"0.7224626",
"0.720881",
"0.7150351",
"0.7137998",
"0.6998941",
"0.6989034",
"0.69835377",
"0.6951463",
"0.68612784",
"0.6808247",
"0.675752",
"0.6708058",
"0.6697641",
"0.6695794",
"0.6665635",
"0.6645443",
"0.6633784",
"0.65911055",
"0.65722615",
"0.6547955",
"0.6544264",
"0.6495583",
"0.6491759",
"0.6491759",
"0.64614767",
"0.6460151",
"0.64317334",
"0.6430561",
"0.6429047",
"0.6427709",
"0.6394571",
"0.63906884",
"0.63821405",
"0.6371997",
"0.6370212",
"0.6359227",
"0.6346854",
"0.6337343",
"0.6325209",
"0.6310748",
"0.63054734",
"0.62722677",
"0.6269651",
"0.62611014",
"0.6255966",
"0.6237633",
"0.6218374",
"0.6203774",
"0.6192991",
"0.61478597",
"0.6147738",
"0.6141267",
"0.6086389",
"0.60709953",
"0.6070912",
"0.60564625",
"0.6054277",
"0.60519385",
"0.60222983",
"0.60213935",
"0.598991",
"0.59781814",
"0.5976882",
"0.59687775",
"0.59684664",
"0.5963033",
"0.594911",
"0.5947271",
"0.5933211",
"0.5929703",
"0.59282106",
"0.59240776",
"0.59197205",
"0.5915128",
"0.5879026",
"0.58784443",
"0.58748704",
"0.5868762",
"0.58587986",
"0.5856247",
"0.5851979",
"0.585084",
"0.584976",
"0.5840726",
"0.58367467",
"0.583531",
"0.5821208",
"0.57995147",
"0.57994944",
"0.5796533",
"0.57961947",
"0.57915753",
"0.5776351",
"0.5774187",
"0.57718897",
"0.5767137",
"0.57663566",
"0.5758601",
"0.57505906"
] |
0.8019697
|
0
|
Validate that the URIs I'm trying to connect belongs to the resource owner
|
def validate_owner(record, attribute, uris)
klass = Device
ids = find_ids(uris)
real = klass.in(id: ids).where(resource_owner_id: record.resource_owner_id)
expected = klass.in(id: ids)
not_owned_ids = expected.map(&:id) - real.map(&:id)
record.errors.add(attribute, "not owned with IDs #{not_owned_ids.join(',')}") if not real.count == expected.count
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def validate\n unless self.uri.blank?\n self.uri = \"http://#{self.uri}\" unless URI.parse(self.uri).absolute? \n end\n rescue\n errors.add(:uri, \"malformed uri -- please check it\")\n end",
"def valid_uri?\n !self.contentable.blank? || !self.uri_path.blank?\n end",
"def is_resource_owner?(resource)\n current_user && current_user.id == resource.user_id\n end",
"def validate_uri( uri, dir, doc )\n # do not retry external uris that have already been validated\n return if @valid_uris.include? uri.to_s\n\n return validate_relative_uri(uri, dir, doc) if uri.relative?\n return validate_external_uri(uri, dir, doc) if uri.respond_to? :open\n\n # otherwise, post a warning that the URI could not be validated\n @log.warn \"could not validate URI '#{uri.to_s}'\"\n end",
"def validate_owner!\n authenticate_owner!\n # redirect_to '/' unless current_owner.id.to_s == params[:id]\n if current_owner.id.to_s != params[:id] || params[:id] == nil\n redirect_to '/'\n end\n end",
"def test_ar_validation\n source = Source.new(\"http://www.newstuff.org/my_first\")\n assert(!Source.exists?(source.uri))\n source.primary_source = false\n errors = \"\"\n assert(source.valid?, source.errors.each_full() { |msg| errors += \":\" + msg })\n \n # Now check if the uri validation works\n source.uri = \"foobar\"\n assert(!source.valid?)\n source.uri = \"foo:bar\"\n assert(source.valid?)\n end",
"def verify_connection!(uri); end",
"def owner?(resource:)\n current_user.present? && resource&.user_id == current_user.id\n end",
"def validate_external_uri( uri, dir, doc )\n return unless @validate_externals\n\n if @invalid_uris.include? uri.to_s\n @log.error \"could not open URI '#{uri.to_s}'\"\n return\n end\n\n begin\n uri.open {|_| nil}\n @valid_uris << uri.to_s\n rescue Exception\n @log.error \"could not open URI '#{uri.to_s}'\"\n @invalid_uris << uri.to_s\n end \n end",
"def check_ownership_requestor_user(requestor,user)\n if requestor.nickname != user.nickname\n raise Error, \"Requestor #{requestor.nickname} and user requested #{user.nickname} do not match\"\n end\n end",
"def valid_principals; end",
"def same_resource_owner?(access_token)\n if Doorkeeper.configuration.polymorphic_resource_owner?\n resource_owner == access_token.resource_owner\n else\n resource_owner_id == access_token.resource_owner_id\n end\n end",
"def assure_uri(resource)\n resource.retrieve! unless resource['uri']\n raise IncompleteResource, \"#{resource.class}: #{resource['name']} not found\" unless resource['uri']\n end",
"def owner?\n resource.user_id == current_user.id\n end",
"def check_mixed_resources\n end",
"def verify_uri_acessibility uri\n res = Net::HTTP.get_response URI(uri)\n res.is_a? Net::HTTPSuccess\nend",
"def validate_reuse_preconditions\n return unless self.class.resources.key?(reuse_as)\n\n attributes = unique_identifiers.each_with_object({ proposed: {}, existing: {} }) do |id, attrs|\n proposed = public_send(id)\n existing = self.class.resources[reuse_as][:resource].public_send(id)\n\n next if proposed == existing\n\n attrs[:proposed][id] = proposed\n attrs[:existing][id] = existing\n end\n\n unless attributes[:proposed].empty? && attributes[:existing].empty?\n raise ResourceReuseError, \"Reusable resources must use the same unique identifier(s). \" \\\n \"The #{self.class.name} to be reused as :#{reuse_as} has the identifier(s) #{attributes[:proposed]} \" \\\n \"but it should have #{attributes[:existing]}\"\n end\n end",
"def check_resource_ownership\n if admin_user.is_not_root?\n\n condition_typus_users = @item.respond_to?(Typus.relationship) && !@item.send(Typus.relationship).include?(admin_user)\n condition_typus_user_id = @item.respond_to?(Typus.user_foreign_key) && !admin_user.owns?(@item)\n\n not_allowed if (condition_typus_users || condition_typus_user_id)\n end\n end",
"def verify_client_belongs_to_user\n return if @resource_for_web_app.is_admin?\n not_found(\"client does not belong to user\") if @resource_for_web_app.id.to_s != params[:id]\n end",
"def validate\n needs :http_url unless http_url\n end",
"def check_owner\n return if params[:id].blank? or @login_user.nil?\n\n begin\n owner_id = Location.find(params[:id]).user_id\n rescue\n owner_id = -1\n end\n if !@login_user.admin?(User::AUTH_LOCATION) and owner_id != @login_user.id\n Log.add_check(request, '[check_owner]'+request.to_s)\n\n flash[:notice] = t('msg.need_to_be_owner')\n redirect_to(:controller => 'desktop', :action => 'show')\n end\n end",
"def check_correct_owners\n if current_admin.nil?\n if @referral.referral_email != current_user.email && @referral.user != current_user\n redirect_to(new_user_session_path, notice: \"You cannot view this referral. Please login to the correct account.\")\n end\n else\n if @referral.job.admin != current_admin && @referral.admin_id != current_admin.id\n redirect_to(new_user_session_path, notice: \"You cannot view this referral. Please login to the correct account.\")\n end\n end\n end",
"def validate_uri(uri)\n return validate({:uri => uri})\n end",
"def owner_of(resource)\n id == resource.user_id ? true : false\n end",
"def valid?\n (uri.host =~ LINK_REGEX || uri.host =~ LINK_IP_REGEX) ? true : false\n end",
"def original_is_valid?\n valid_host? && valid_length? && valid_scheme?\n end",
"def ensure_ontology_url_format\n if self.ontology_urls.blank?\n errors.add(:ontology_urls, \"cannot be empty if SearchFacet is ontology-based\")\n else\n self.ontology_urls.each do |ontology_url|\n # check that entry is a Hash with :name and :url field\n unless ontology_url.is_a?(Hash) && ontology_url.with_indifferent_access.keys.sort == %w(browser_url name url)\n errors.add(:ontology_urls, \"contains a misformed entry: #{ontology_url}. Must be a Hash with a :name, :url, and :browser_url field\")\n end\n santized_url = ontology_url.with_indifferent_access\n unless url_valid?(santized_url[:url])\n errors.add(:ontology_urls, \"contains an invalid URL: #{santized_url[:url]}\")\n end\n end\n end\n end",
"def raise_on_external(uri, testcase)\n unless ((uri.host == testcase.request.http_host) || uri.host.blank?)\n raise ExternalResource, \"Called out to external resource: OpenID consumer wants to have #{uri}\"\n end\n end",
"def ensure_ontology_url_format\n if self.ontology_urls.blank?\n errors.add(:ontology_urls, \"cannot be empty if SearchFacet is ontology-based\")\n else\n self.ontology_urls.each do |ontology_url|\n # check that entry is a Hash with :name and :url field\n unless ontology_url.is_a?(Hash) && ontology_url.with_indifferent_access.keys.sort == %w(name url)\n errors.add(:ontology_urls, \"contains a misformed entry: #{ontology_url}. Must be a Hash with a :name and :url field\")\n end\n santized_url = ontology_url.with_indifferent_access\n unless url_valid?(santized_url[:url])\n errors.add(:ontology_urls, \"contains an invalid URL: #{santized_url[:url]}\")\n end\n end\n end\n end",
"def check_owner_and_address\n check_owner\n check_address\n check_access\n end",
"def invalid_uri?(uri)\n uri.grep(/^(#{PROTOCOLS.join('|')}):\\/\\/\\w/).empty?\n end",
"def ensure_not_referenced_by_any_dog_owner\n\n\t\t# Check for a link to an owner\n\t\t@record = DogOwner.find_by(dog_id: id)\n\t\tif @record\n\t\t\terrors.add(:base, 'Dog owner present')\n\t\t\treturn false\n\t\telse\n\t\t\treturn true\n\t\tend\n\tend",
"def owns?(resource)\n\t\t[:owner, :user].each do |m|\n\t\t\tif resource.respond_to? m\n\t\t\t\treturn resource.send(m) == self\n\t\t\tend\n\t\tend\n\tend",
"def validate_reuse\n QA::Runtime::Logger.debug([\"Validating a #{self.class.name} that was reused as #{reuse_as}\", identifier].compact.join(' '))\n\n fresh_resource = reference_resource\n diff = reuse_validation_diff(fresh_resource)\n\n if diff.present?\n raise ResourceReuseError, <<~ERROR\n The reused #{self.class.name} resource does not have the attributes expected.\n The following change was found: #{diff}\"\n The resource's web_url is #{web_url}.\n It was used in these tests: #{self.class.resources[reuse_as][:tests].to_a.join(', ')}\n ERROR\n end\n\n ensure\n fresh_resource.remove_via_api!\n end",
"def unsafe_redirectable?(uri1, uri2)\n a, b = uri1.scheme.downcase, uri2.scheme.downcase\n\n a == b || (a == \"http\" && b == \"https\") || (a == \"https\" && b == \"http\")\n end",
"def validate_uri(uri)\n return validate({:doc => uri})\n end",
"def validateOwner(dest_cell, owner)\n piece = @cells[dest_cell[0]][dest_cell[1]].getPiece()\n if piece != nil\n return piece.isOwner(owner)\n end\n return false\n end",
"def validate_full_url\n if self.full_url.nil?\n return\n end\n\n if((self.full_url =~ URI::regexp(\"http\")) == nil && (self.full_url =~ URI::regexp(\"https\")) == nil)\n self.errors.add(:full_url, \"Full url is not a valid url\")\n end\n end",
"def good_resource?(url)\n if rx_url\n !(url.to_s !~ rx_url)\n else\n true\n end\n end",
"def resource_owner?\r\n race = current_user.races.find_by(id: params[:id])\r\n if race.nil?\r\n error_message = ErrorMessage.new('403', 'Användaren är inte resursens ägare.',\r\n \"Kan bara utföras av den som skapade resursen.\")\r\n render json: error_message, status: :forbidden\r\n end\r\n end",
"def valid_principals=(_arg0); end",
"def validate_uri(uri)\n unless uri.is_a?(String)\n return false\n end\n\n unless uri.slice(SSH_REGEXP).nil?\n return true\n end\n\n unless uri.slice(GIT_REGEXP).nil?\n return true\n end\n\n false\n end",
"def check_resource_semantics!; end",
"def url_must_be_valid\n url.blank? ||\n (url_is_remote? and url_has_suffix? and url_matches?) ||\n errors.add(:url, :invalid)\n end",
"def verify_ownership\n @photo = Photo.find_by(id: params[:id] || params[:photo][:id])\n\n unless owner?(@photo)\n flash[:alert] = I18n.t(\"photos.ownership.error\")\n redirect_to gallery_path\n end\n end",
"def validate_target_bosh_host\n URI.parse(target_bosh_host)\n true\n rescue\n false\n end",
"def validate_owner\n unless @article.owner == current_user\n redirect_to root_path, notice: 'You do not have edit access to the article!'\n end\n end",
"def sanity_check\n if resource_exists?(\"nodes/#{node_name}\")\n ui.confirm(\"Node #{node_name} exists, overwrite it\")\n rest.delete(\"nodes/#{node_name}\")\n end\n if resource_exists?(\"clients/#{node_name}\")\n ui.confirm(\"Client #{node_name} exists, overwrite it\")\n rest.delete(\"clients/#{node_name}\")\n end\n end",
"def validate_ownership\n buyer_items.each { |item| item.validate_owner seller }\n seller_items.each { |item| item.validate_owner buyer }\n end",
"def object_owner_for_resource?(object)\n object.user == current_user\n end",
"def validate_http_referer(ref)\n # This expects 'ref' to be a valid (or at least mostly valid) url. It may through an exception if it isn't\n ref_uri = Addressable::URI.heuristic_parse(ref, :scheme => 'http')\n address_uri = address_as_uri\n \n schemes_match?(ref_uri.scheme, address_uri.scheme) && hosts_match?(ref_uri.host, address_uri.host) && paths_match?(ref_uri.path, address_uri.path)\n# schemes_match?(ref_uri.scheme) && hosts_match?(ref_uri.host) && paths_match?(ref_uri.path)\n end",
"def request_username_matches_visualization_owner\n # Support both for username at `/u/username` and subdomain, prioritizing first\n username = [CartoDB.username_from_request(request), CartoDB.subdomain_from_request(request)].compact.first\n # URL must always contain username, either at subdomain or at path.\n # Domainless url documentation: http://cartodb.readthedocs.org/en/latest/configuration.html#domainless-urls\n return false unless username.present?\n\n # Either user is owner or is current and has permission\n # R permission check is based on current_viewer because current_user assumes you're viewing your subdomain\n username == @visualization.user.username ||\n (current_user && username == current_user.username && @visualization.has_read_permission?(current_viewer))\n end",
"def owns?(resource)\n resource.account_id == id\n end",
"def verify_url!\n fail InvalidUrlException unless uri.to_s =~ URI::regexp\n fail UnsupportedFileException if !valid_readers_format? && !valid_file_format?\n end",
"def valid_recipient_url?\r\n begin\r\n response_object = REXML::XPath.first(document, \"/p:Response\", { \"p\" => PROTOCOL })\r\n recipient = response_object.attribute('Recipient').value\r\n raise SA1005Exception unless recipient == settings.assertion_consumer_service_url\r\n rescue RuntimeError => exp\r\n Rails.logger.error \"#{exp.class} - #{exp.message}\"\r\n return false\r\n else\r\n return true\r\n end\r\n end",
"def validate_uri(uri)\n unless uri.is_a?(String)\n return false\n end\n\n unless uri.slice(GIT_REGEXP).nil?\n return true\n end\n\n unless uri.slice(SCP_REGEXP).nil?\n return true\n end\n\n false\n end",
"def uri_eligible?(uri)\n eligible = uri =~ /#{Regexp.escape(@config[:base_url])}/\n debug \"Islandora uri eligible: #{uri}\" if eligible\n eligible\n end",
"def validate\n validate_resources_defined\n validates_unique(:resource_id, :message => \"ARK must point to a unique Resource\")\n validates_unique(:archival_object_id, :message => \"ARK must point to a unique Archival Object\")\n super\n end",
"def valid_for_oauth2(resource, attributes)\n true\n end",
"def valid_request_origin?; end",
"def check_owner\n return if params[:id].blank? or @login_user.nil?\n\n begin\n owner_id = Workflow.find(params[:id]).user_id\n rescue\n owner_id = -1\n end\n if !@login_user.admin?(User::AUTH_WORKFLOW) and owner_id != @login_user.id\n Log.add_check(request, '[check_owner]'+request.to_s)\n\n flash[:notice] = t('msg.need_to_be_owner')\n redirect_to(:controller => 'desktop', :action => 'show')\n end\n end",
"def check_uri_build\n\n end",
"def valid_remote_identifier?(value)\n RemoteRecord.valid?(value) && RemoteRecord.retrieve(value).success?\n rescue URI::InvalidURIError\n false\n end",
"def valid?(uri)\n uri ||= default_uri\n\n uri.host = @default_host if uri.host.nil?\n\n real_domain = domain =~ /^\\./ ? domain[1..-1] : domain\n !!((!secure? || (secure? && uri.scheme == 'https')) &&\n uri.host =~ Regexp.new(\"#{'^' if @exact_domain_match}#{Regexp.escape(real_domain)}$\", Regexp::IGNORECASE))\n end",
"def valid?\n RDF::URI::IRI.match?(to_s) || false\n end",
"def check_owner(params)\n params.delete(:owner_id) if params[:owner_id] && params[:owner_id].empty?\n params\n end",
"def validateOwner(dest_cell,owner)\n temp = cells[dest_cell[0]][dest_cell[1]].getPiece()\n temp.isOwner(player)\n end",
"def validate_uri(url)\n return validate({:url => url})\n end",
"def requested_by?(resource)\n user = resource.respond_to?(:owner) ? resource.owner : resource\n case\n when current_resource_owner.nil?\n false\n when !user.is_a?(current_resource_owner.class)\n false\n when current_resource_owner.id == user.id\n true\n else\n false\n end\n end",
"def check_collector_uri!\n raise ArgumentError, 'collector URI must be initialized' if @collector_uri.nil?\n end",
"def validate_owner_private(user)\n pmr_owner = pmr.owner\n # A blank owner is a bad dog.\n if pmr_owner.signon.blank?\n return [ \"wag-wag\", \"Owner should not be blank\", true ]\n end\n return [ \"normal\", \"PMR Owner assumed valid\", true]\n end",
"def owner_url\n nil\n end",
"def valid_remote_identifier?(value)\n RemoteRecord.valid?(value) && RemoteRecord.retrieve(value).success?\n rescue URI::InvalidURIError\n false\n end",
"def check_for_invalid_external_references(record, logical_urls)\n if record.respond_to?(:to_array)\n record.each {|e| check_for_invalid_external_references(e, logical_urls)}\n elsif record.respond_to?(:each)\n record.each do |k, v|\n if k == 'ref' && !logical_urls.has_key?(v)\n URIResolver.ensure_reference_is_valid(v, RequestContext.get(:repo_id))\n elsif k != '_resolved'\n check_for_invalid_external_references(v, logical_urls)\n end\n end\n end\n end",
"def test_is_uri\n assert(N::URI.is_uri?(\"http://foobar.org/\"))\n assert(N::URI.is_uri?(\"http://foobar.org/\"))\n assert(N::URI.is_uri?(\"baa:boo\"))\n assert(!N::URI.is_uri?(\"foo\"))\n end",
"def external?\n crate.canonical_id.host != canonical_id.host\n end",
"def validates_presence_of_urls\n if provider_media_id.blank?\n !( source_url.blank? || thumbnail_url.blank? || content_url.blank? )\n else\n true\n end\n end",
"def validate_social_media_url(spec)\n validate_url(spec.social_media_url, 'CocoaPods') if spec.social_media_url\n end",
"def owned?\n !owner.nil?\n end",
"def valid?\n Wgit::Url.valid?(self)\n end",
"def verify_address_owners\n if complete?\n errors.add(:bill_address, 'Billing address should not have a user') if bill_address.try(:user_id)\n errors.add(:ship_address, 'Shipping address should not have a user') if ship_address.try(:user_id)\n else\n if bill_address && bill_address.valid? && !bill_address.user_id.nil? && bill_address.user_id != user_id\n errors.add(\n :bill_address,\n \"Billing address user #{bill_address.user_id.inspect} does not match order #{user_id.inspect}\"\n )\n end\n\n if ship_address && ship_address.valid? && !ship_address.user_id.nil? && ship_address.user_id != user_id\n errors.add(\n :ship_address,\n \"Shipping address user #{ship_address.user_id.inspect} does not match order #{user_id.inspect}\"\n )\n end\n end\n end",
"def authenticate_resource_owner(client, request)\n config.resource_owner_class.oauth_authenticate(client, request.username, request.password)\n end",
"def valid?\n acyclic? and connected?\n end",
"def normalize_url\n return if self.url.blank?\n normalized = self.url.normalize\n if normalized.blank?\n self.errors.add(:url, \"is invalid\")\n return false\n elsif normalized.match(\"archiveofourown.org/users\")\n self.errors.add(:url, \"cannot be ao3 user\")\n return false\n elsif normalized.match(\"(.*)/collections/(.*)/works/(.*)\")\n normalized = $1 + \"/works/\" + $3\n elsif normalized.match(\"archiveofourown.org/collections\")\n self.errors.add(:url, \"cannot be an ao3 collection\")\n return false\n end\n self.url = normalized\n end",
"def validate_uri(uri)\n response = RestClient.get BASE_URI, :params => { :doc => uri, :out => 'json' }\n @json = JSON.parse(response.body)\n @errors = retrieve_errors\n end",
"def validate_uri(uri)\n validate_text(Net::HTTP.get(URI.parse(uri)))\n end",
"def valid?\n value.present? && uri.present?\n end",
"def git_url_must_be_valid\n matched = false\n\n [/^https?:\\/\\/.+\\.git$/i, /^git@.+:.+\\.git$/i].each do |valid_form|\n if valid_form.match git_url\n matched = true\n break\n end\n end\n\n unless matched\n errors.add(:git_url, 'must be of form http[s]://host/path/to/repository.git OR git@host:path/to/repository.git')\n end\n end",
"def query_user_for_uri\n input_uri = nil\n puts \"\\n* First, we need a valid uri.\"\n input_uri = valid_uri\n return input_uri\nend",
"def proper_url? \n\t\tif !(self.long_url.start_with?('http://') || self.long_url.start_with?('https://'))\n\t\t\terrors.add(:long_url, \"is in invalid format.\")\n\t\tend \n\tend",
"def has_connection_with?(uri)\n get_connected_uri.include?(uri)\n end",
"def check_owner\n\n return if params[:id].blank? \\\n or (params[:id] == TreeElement::ROOT_ID.to_s) \\\n or @login_user.nil?\n\n begin\n owner_id = MailFolder.find(params[:id]).user_id\n rescue\n owner_id = -1\n end\n if !@login_user.admin?(User::AUTH_MAIL) and owner_id != @login_user.id\n Log.add_check(request, '[check_owner]'+request.to_s)\n\n flash[:notice] = t('msg.need_to_be_owner')\n redirect_to(:controller => 'desktop', :action => 'show')\n end\n end",
"def validate(resource, &block); end",
"def owns?(object); object.owners.include?(self) end",
"def inner_check(action, resource)\n false\n end",
"def test_valid\n u = uri(\"amqp://u:p@h:1/x\")\n assert_equal URI::AMQP, u.class\n assert_equal ['amqp', 'u:p', 'h', 1, '/x'], u.select(*PARTS)\n\n u = uri(\"amqps://u:p@h:1/x\")\n assert_equal URI::AMQPS, u.class\n assert_equal ['amqps', 'u:p', 'h', 1, '/x'], u.select(*PARTS)\n\n # Schemeless string -> amqp\n assert_equal [\"amqp\", nil, \"h\", 1, \"/x\"], uri_parts(\"//h:1/x\")\n assert_equal [\"amqp\", nil, \"\", 5672, \"/x\"], uri_parts(\"/x\")\n assert_equal [\"amqp\", nil, \"[::1]\", 5672, \"\"], uri_parts(\"//[::1]\")\n\n # Schemeless URI gets amqp: scheme\n assert_equal [\"amqp\", nil, nil, 5672, \"/x\"], uri_parts(URI(\"/x\"))\n\n # Pass-through\n u = uri('')\n assert_same u, uri(u)\n end",
"def check_ownership \t\n \taccess_denied(:redirect => @check_ownership_of) unless current_user_owns?(@check_ownership_of)\n end",
"def valid_url?\n # Not sure if we should make a change in the user initial data, we could just return as invalid.\n my_target_url = target_url.match(/http/) ? target_url : target_url.prepend(\"http://\")\n\n response = HTTParty.get(my_target_url) rescue nil\n\n return if response&.code == 200\n\n errors.add(:short_url)\n end",
"def valid_endpoint?(target)\n endpoints.include? target\n end",
"def owner?\n return if current_user == @event.creator\n\n redirect_back(fallback_location: root_path, alert: 'Unauthorized request!')\n end"
] |
[
"0.6278455",
"0.6152992",
"0.5973217",
"0.5937367",
"0.5909034",
"0.58995324",
"0.589311",
"0.58857423",
"0.58768547",
"0.5851981",
"0.57891494",
"0.5778032",
"0.5773554",
"0.57326454",
"0.5732363",
"0.572513",
"0.57185817",
"0.57079214",
"0.5681624",
"0.56678855",
"0.56642413",
"0.56620306",
"0.56383574",
"0.563758",
"0.56325966",
"0.5629461",
"0.5623825",
"0.56227314",
"0.56191283",
"0.5603664",
"0.559552",
"0.55790645",
"0.5571709",
"0.5563218",
"0.55514926",
"0.5539088",
"0.5538393",
"0.5530899",
"0.5501121",
"0.5500779",
"0.55004007",
"0.5499557",
"0.54980487",
"0.5490532",
"0.54852355",
"0.54739547",
"0.54692507",
"0.5459136",
"0.5458856",
"0.5458531",
"0.54547596",
"0.5451259",
"0.54500884",
"0.54434836",
"0.54310024",
"0.5430959",
"0.54306686",
"0.5419456",
"0.54168063",
"0.5392869",
"0.538877",
"0.53874755",
"0.53868484",
"0.5377154",
"0.5361947",
"0.5357813",
"0.53546315",
"0.53525394",
"0.5340887",
"0.53258795",
"0.5319507",
"0.5316758",
"0.5316051",
"0.53129315",
"0.53092766",
"0.53042257",
"0.5292513",
"0.52902436",
"0.5287184",
"0.52782923",
"0.5277933",
"0.52735054",
"0.52696794",
"0.52564394",
"0.5246182",
"0.5244463",
"0.52441365",
"0.5234815",
"0.522964",
"0.52247494",
"0.52106583",
"0.5206184",
"0.51980096",
"0.51937795",
"0.51870173",
"0.51845366",
"0.51829576",
"0.5181232",
"0.5173979",
"0.517184"
] |
0.68442744
|
0
|
process does all the heavy lifting adds any uncoded values discovered to the (global) uncoded_values_hash returns a hash with stats on coding
|
def process(uncoded_values_hash)
@uncoded = uncoded_values_hash
uncoded_encounters = find_uncoded_encounters()
uncoded_products = find_uncoded_products()
uncoded_problems = find_uncoded_problems()
uncoded_vital_results = find_uncoded_results("VitalSigns")
uncoded_test_results = find_uncoded_results("Results")
uncoded_alerts = find_uncoded_alerts()
# perfect = uncoded_encounters.size > 0 && uncoded_products.size > 0 && uncoded_problems.size > 0 && uncoded_vital_results.size > 0 && uncoded_test_results.size > 0 && uncoded_alerts.size > 0
# if perfect
# STDERR.puts "***PERFECT***"
# end
# STDERR.puts "e: #{uncoded_encounters.size} prod: #{uncoded_products.size} prob: #{uncoded_problems.size} v: #{uncoded_vital_results.size} t: #{uncoded_test_results.size} a: #{uncoded_alerts.size}"
# end
@summaryfp.puts JSON.pretty_generate(@summary)
@summaryfp.close
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def analysis\n hash = {}\n @array.each do |item|\n chars = item.chars.to_a - @used_chars\n\n chars.each do |char|\n if hash[char] == nil\n hash[char] = 1\n else\n hash[char] += 1\n end\n end\n end\n\n hash.sort_by { |_, v| -v }\n end",
"def encoding prog_h\n puts \"encoding...\"\n hash={}\n prog_h.each{|addr,instr| hash[addr]=encode(instr)}\n return hash\n end",
"def extract_code!\n data = @data\n data.gsub!(/^``` ?([^\\r\\n]+)?\\r?\\n(.+?)\\r?\\n```\\r?$/m) do\n id = Digest::SHA1.hexdigest($2)\n cached = check_cache(:code, id)\n @codemap[id] = cached ?\n { :output => cached } :\n { :lang => $1, :code => $2 }\n id\n end\n data\n end",
"def codon_usage\n rewind\n\n total_usage = {}\n\n each do |e|\n Bio::Sequence::NA.new(e.seq).codon_usage.each do |c, count|\n aa = Bio::Sequence::NA.new(c).translate\n total_usage[aa] ||= {}\n total_usage[aa][c.upcase] ||= 0\n total_usage[aa][c.upcase] += count\n end\n end\n\n rewind\n\n total_usage\n end",
"def med_stats_hash(_assessed_data); end",
"def process_code(data)\n @codemap.each do |id, spec|\n formatted = spec[:output] ||\n begin\n code = spec[:code]\n lang = spec[:lang]\n\n if code.lines.all? { |line| line =~ /\\A\\r?\\n\\Z/ || line =~ /^( |\\t)/ }\n code.gsub!(/^( |\\t)/m, '')\n end\n # formatted =\n # begin\n # lang && OY::Albino.colorize(code, lang)\n # rescue ::Albino::ShellArgumentError, ::Albino::Process::TimeoutExceeded,\n # ::Albino::Process::MaximumOutputExceeded\n # p 23\n # end\n formatted ||= \"<pre><code class='#{lang}'>#{CGI.escapeHTML(code)}</code></pre>\"\n update_cache(:code, id, formatted)\n formatted\n end\n data.gsub!(id, formatted)\n end\n data\n end",
"def decode_metal_value\n\tromanhash = {}\n\tcredithash, codehash = read_input\n\tcredithash.each_pair { |k,v|\n\t\troman_str = get_roman_equiv(k)\n\t\tvalidate_roman(roman_str)\n\t\tromanhash[ roman_str + \" \" + k.split(\" \").last ] = v\n\t\t}\n\treturn romanhash\nend",
"def register_codes\n @register_codes ||= @registers.inject({}) do |memo, (_, r)|\n memo[r.opcode] = r\n memo\n end\n end",
"def hash\n code.hash\n end",
"def hash\n code.hash\n end",
"def generate\n if @log.empty?\n # First try\n two_symbol_code(@code_length)\n else\n # delete last code guess from possible_codes\n @possible_codes.delete_if { |code| code == @log.last[:code] }\n s = possible_codes(@log.last[:code], @log.last[:hits][:black], @log.last[:hits][:white])\n # remove all codes that would not give the same response if the last code guess weren't the mastercode\n @possible_codes.delete_if { |code| !s.include?(code) }\n minmax_algo\n end\n end",
"def process\n @constants.each do |k,v|\n @constants.each do |k2,v2|\n @constants[k2] = Utility.sub_constants(v2, k, v)\n end\n end\n end",
"def swap_code_based_on_value(ga_entry)\n value = ga_entry.values.first\n if value.present?\n case value.scalar\n when \"39\"\n ga_entry.codes = {'SNOMED-CT' => ['80487005']}\n when \"38\"\n ga_entry.codes = {'SNOMED-CT' => ['13798002']}\n when \"37\"\n ga_entry.codes = {'SNOMED-CT' => ['43697006']}\n when \"36\"\n ga_entry.codes = {'SNOMED-CT' => ['931004']}\n end\n end\n end",
"def full_country_report(hash)\n\n hash.each do |key, value|\n new_state = VirusPredictor.new(key, STATE_DATA[key][:population_density], STATE_DATA[key][:population])\n new_state.virus_effects\n end\n\nend",
"def extract_code(data)\n data.gsub!(/^``` ?([^\\r\\n]+)?\\r?\\n(.+?)\\r?\\n```\\r?$/m) do\n id = Digest::SHA1.hexdigest($2)\n cached = check_cache(:code, id)\n @codemap[id] = cached ?\n { :output => cached } :\n { :lang => $1, :code => $2 }\n id\n end\n data\n end",
"def process_code(data)\n return data if data.nil? || data.size.zero? || @codemap.size.zero?\n\n blocks = []\n @codemap.each do |id, spec|\n next if spec[:output] # cached\n\n code = spec[:code]\n if code.lines.all? { |line| line =~ /\\A\\r?\\n\\Z/ || line =~ /^( |\\t)/ }\n code.gsub!(/^( |\\t)/m, '')\n end\n\n blocks << [spec[:lang], code]\n end\n\n highlighted = begin\n blocks.size.zero? ? [] : Gollum::Albino.colorize(blocks)\n rescue ::Albino::ShellArgumentError, ::Albino::TimeoutExceeded,\n ::Albino::MaximumOutputExceeded\n []\n end\n\n @codemap.each do |id, spec|\n body = spec[:output] || begin\n if (body = highlighted.shift.to_s).size > 0\n update_cache(:code, id, body)\n body\n else\n \"<pre><code>#{CGI.escapeHTML(spec[:code])}</code></pre>\"\n end\n end\n data.gsub!(id, body)\n end\n\n data\n end",
"def uncached_ref_data_codes\n { terms_and_conditions: YESNO_COMP_KEY,\n reg_company_contact_address_yes_no: YESNO_COMP_KEY,\n email_data_ind: YESNO_COMP_KEY }\n end",
"def cached_ref_data_codes\n { country: comp_key('COUNTRIES', 'SYS', 'RSTU') }\n end",
"def internal_codes\n @@_country_codes - @@registered_data.keys\n end",
"def hash\n [api_percentage, api_usage, apm_fargate_percentage, apm_fargate_usage, apm_host_percentage, apm_host_usage, apm_usm_percentage, apm_usm_usage, appsec_fargate_percentage, appsec_fargate_usage, appsec_percentage, appsec_usage, browser_percentage, browser_usage, ci_visibility_itr_percentage, ci_visibility_itr_usage, container_excl_agent_percentage, container_excl_agent_usage, container_percentage, container_usage, cspm_containers_percentage, cspm_containers_usage, cspm_hosts_percentage, cspm_hosts_usage, custom_ingested_timeseries_percentage, custom_ingested_timeseries_usage, custom_timeseries_percentage, custom_timeseries_usage, cws_containers_percentage, cws_containers_usage, cws_hosts_percentage, cws_hosts_usage, dbm_hosts_percentage, dbm_hosts_usage, dbm_queries_percentage, dbm_queries_usage, estimated_indexed_logs_percentage, estimated_indexed_logs_usage, estimated_indexed_spans_percentage, estimated_indexed_spans_usage, estimated_ingested_logs_percentage, estimated_ingested_logs_usage, estimated_ingested_spans_percentage, estimated_ingested_spans_usage, estimated_rum_sessions_percentage, estimated_rum_sessions_usage, fargate_percentage, fargate_usage, functions_percentage, functions_usage, infra_host_percentage, infra_host_usage, invocations_percentage, invocations_usage, npm_host_percentage, npm_host_usage, obs_pipeline_bytes_percentage, obs_pipeline_bytes_usage, profiled_container_percentage, profiled_container_usage, profiled_fargate_percentage, profiled_fargate_usage, profiled_host_percentage, profiled_host_usage, sds_scanned_bytes_percentage, sds_scanned_bytes_usage, snmp_percentage, snmp_usage, universal_service_monitoring_percentage, universal_service_monitoring_usage, vuln_management_hosts_percentage, vuln_management_hosts_usage].hash\n end",
"def cached_ref_data_codes\n { taxes: comp_key('PORTALSERVICES', 'SYS', 'RSTU'), party_account_type: comp_key('PARTY_ACT_TYPES', 'SYS', 'RSTU') }\n end",
"def hash\n [bin_commercial, bin_corporate, bin_country_issued, bin_credit, bin_currency, bin_debit, bin_description, bin_eu, card_id, card_status, default, expmonth, expyear, label, label2, last4digits, scheme, token].hash\n end",
"def parse_barcode_stats_file(filename)\n # parse the file\n stats = Hash.new\n IO.foreach(filename) do |line|\n next if line =~ /^Barcode/ || line =~ /^total/\n fields = line.split(\"\\t\")\n if fields.size != 3 || fields[1] !~ /^\\d+$/\n die \"#{filename}: parse error: #{line}\"\n end\n stats[fields[0]] = fields[1]\n STDERR.puts \"#{fields[0]} => #{fields[1]}\" if @debug\n end\n\n # copy the values for the required barcodes (and make sure they\n # are all present)\n @barcodes.each do |bcinfo|\n codepoint = bcinfo[:codepoint]\n die \"missing barcode #{codepoint} in #{filename}\" if\n stats[codepoint].nil?\n bcinfo[:seq_stats][\"Post-Filter Reads\"] = stats[codepoint]\n end\n end",
"def add_to_hash hash = { }\n hash[self.class.value_name] = code\n if respond_to?(:uuid) \n hash[self.class.value_name_uuid] = initialize_uuid!\n end\n hash\n end",
"def initialize\n @values = []\n @pc = 0\n @code = []\n end",
"def uncached_ref_data_codes\n { existing_agreement: YESNO_COMP_KEY,\n declaration: YESNO_COMP_KEY,\n change_declaration: YESNO_COMP_KEY,\n not_banned_waste: YESNO_COMP_KEY,\n naturally_occurring: YESNO_COMP_KEY }\n end",
"def nucleotide_counts\n hash = {}\n @valid_inputs.each do |i|\n hash[i] = @dna.count i\n end\n hash\n end",
"def count_blacks\r\n black_count = Hash.new(0)\r\n code.length.times { |i| black_count[code[i]] += 1 if code[i] == guess[i] } ## DRT\r\n black_sum = 0\r\n black_count.each { |k,v| black_sum += v }\r\n black_sum\r\n end",
"def decode_weak(guess, code)\n guess.compact.each.reduce(0) do |count, code_peg|\n index = code.find_index(code_peg)\n if index\n count += 1\n code[index] = nil\n end\n count\n end\n end",
"def to_h\n { code: code, confidence: confidence }\n end",
"def wrestler_hash_output\n\t\twrestler_hash_output = self.values\n\n\t\twrestler_hash_output[\"name\"] = wrestler_hash_output.delete :name\n\t\twrestler_hash_output[\"set\"] = wrestler_hash_output.delete :set\n\n\t\twrestler_hash_output[\"gc02\"] = wrestler_hash_output.delete :gc02\n\t\twrestler_hash_output[\"gc03\"] = wrestler_hash_output.delete :gc03\n\t\twrestler_hash_output[\"gc04\"] = wrestler_hash_output.delete :gc04\n\t\twrestler_hash_output[\"gc05\"] = wrestler_hash_output.delete :gc05\n\t\twrestler_hash_output[\"gc06\"] = wrestler_hash_output.delete :gc06\n\t\twrestler_hash_output[\"gc07\"] = wrestler_hash_output.delete :gc07\n\t\twrestler_hash_output[\"gc08\"] = wrestler_hash_output.delete :gc08\n\t\twrestler_hash_output[\"gc09\"] = wrestler_hash_output.delete :gc09\n\t\twrestler_hash_output[\"gc10\"] = wrestler_hash_output.delete :gc10\n\t\twrestler_hash_output[\"gc11\"] = wrestler_hash_output.delete :gc11\n\t\twrestler_hash_output[\"gc12\"] = wrestler_hash_output.delete :gc12\n\n\t\twrestler_hash_output[\"dc02\"] = wrestler_hash_output.delete :dc02\n\t\twrestler_hash_output[\"dc03\"] = wrestler_hash_output.delete :dc03\n\t\twrestler_hash_output[\"dc04\"] = wrestler_hash_output.delete :dc04\n\t\twrestler_hash_output[\"dc05\"] = wrestler_hash_output.delete :dc05\n\t\twrestler_hash_output[\"dc06\"] = wrestler_hash_output.delete :dc06\n\t\twrestler_hash_output[\"dc07\"] = wrestler_hash_output.delete :dc07\n\t\twrestler_hash_output[\"dc08\"] = wrestler_hash_output.delete :dc08\n\t\twrestler_hash_output[\"dc09\"] = wrestler_hash_output.delete :dc09\n\t\twrestler_hash_output[\"dc10\"] = wrestler_hash_output.delete :dc10\n\t\twrestler_hash_output[\"dc11\"] = wrestler_hash_output.delete :dc11\n\t\twrestler_hash_output[\"dc12\"] = wrestler_hash_output.delete :dc12\n\n\t\twrestler_hash_output[\"specialty\"] = wrestler_hash_output.delete :specialty\n\n\t\twrestler_hash_output[\"s1\"] = wrestler_hash_output.delete :s1\n\t\twrestler_hash_output[\"s2\"] = wrestler_hash_output.delete :s2\n\t\twrestler_hash_output[\"s3\"] = wrestler_hash_output.delete :s3\n\t\twrestler_hash_output[\"s4\"] = wrestler_hash_output.delete :s4\n\t\twrestler_hash_output[\"s5\"] = wrestler_hash_output.delete :s5\n\t\twrestler_hash_output[\"s6\"] = wrestler_hash_output.delete :s6\n\n\t\twrestler_hash_output[\"subx\"] = wrestler_hash_output[:sub][0]\n\t\twrestler_hash_output[\"suby\"] = wrestler_hash_output[:sub][1]\n\t\twrestler_hash_output[\"tagx\"] = wrestler_hash_output[:sub][0]\n\t\twrestler_hash_output[\"tagy\"] = wrestler_hash_output[:sub][1]\n\n\t\twrestler_hash_output.delete :sub\n\t\twrestler_hash_output.delete :tag\n\n\t\twrestler_hash_output[\"prioritys\"] = wrestler_hash_output.delete :prioritys\n\t\twrestler_hash_output[\"priorityt\"] = wrestler_hash_output.delete :priorityt\n\n\t\twrestler_hash_output[\"oc02\"] = wrestler_hash_output.delete :oc02\n\t\twrestler_hash_output[\"oc03\"] = wrestler_hash_output.delete :oc03\n\t\twrestler_hash_output[\"oc04\"] = wrestler_hash_output.delete :oc04\n\t\twrestler_hash_output[\"oc05\"] = wrestler_hash_output.delete :oc05\n\t\twrestler_hash_output[\"oc06\"] = wrestler_hash_output.delete :oc06\n\t\twrestler_hash_output[\"oc07\"] = wrestler_hash_output.delete :oc07\n\t\twrestler_hash_output[\"oc08\"] = wrestler_hash_output.delete :oc08\n\t\twrestler_hash_output[\"oc09\"] = wrestler_hash_output.delete :oc09\n\t\twrestler_hash_output[\"oc10\"] = wrestler_hash_output.delete :oc10\n\t\twrestler_hash_output[\"oc11\"] = wrestler_hash_output.delete :oc11\n\t\twrestler_hash_output[\"oc12\"] = wrestler_hash_output.delete :oc12\n\n\t\twrestler_hash_output[\"ro02\"] = wrestler_hash_output.delete :ro02\n\t\twrestler_hash_output[\"ro03\"] = wrestler_hash_output.delete :ro03\n\t\twrestler_hash_output[\"ro04\"] = wrestler_hash_output.delete :ro04\n\t\twrestler_hash_output[\"ro05\"] = wrestler_hash_output.delete :ro05\n\t\twrestler_hash_output[\"ro06\"] = wrestler_hash_output.delete :ro06\n\t\twrestler_hash_output[\"ro07\"] = wrestler_hash_output.delete :ro07\n\t\twrestler_hash_output[\"ro08\"] = wrestler_hash_output.delete :ro08\n\t\twrestler_hash_output[\"ro09\"] = wrestler_hash_output.delete :ro09\n\t\twrestler_hash_output[\"ro10\"] = wrestler_hash_output.delete :ro10\n\t\twrestler_hash_output[\"ro11\"] = wrestler_hash_output.delete :ro11\n\t\twrestler_hash_output[\"ro12\"] = wrestler_hash_output.delete :ro12\n\n\t\tf = File.new(\"files/output/#{wrestler_hash_output[\"name\"]}_#{wrestler_hash_output[\"set\"]}_hash.txt\", 'a')\n\n\t\tf.write(\"{\")\n\t\twrestler_hash_output.each { |k,v|\n\t\t\tf.write(\"\\\"#{k}\\\"=>\\\"#{v}\\\", \")\n\t\t}\n\t\tf.write(\"template: nil}\")\n\n\t\tf.write(\"\\n\\n\")\n\tend",
"def codes; end",
"def uncached_ref_data_codes\n { all_versions: YESNO_COMP_KEY,\n outstanding_balance: YESNO_COMP_KEY,\n draft_only: YESNO_COMP_KEY }\n end",
"def serializable_hash \n results.each.inject(empty_bins) do |histogram, result|\n histogram[result] = histogram[result] ? histogram[result] + 1 : 1; histogram\n end\n end",
"def handling_code\n hash[\"HandlingCode\"]\n end",
"def hash\n num = 0\n self.each do |k,v|\n if k.is_a?(Integer) && v.is_a?(Integer)\n num += k * 26 + v\n elsif k.is_a?(Integer) && !v.is_a?(Integer)\n num += k * 26 + ALPHA_NUMBERS[v.to_s.downcase]\n elsif v.is_a?(Integer) && !k.is_a?(Integer)\n num += v * 26 + ALPHA_NUMBERS[k.to_s.downcase]\n elsif !k.nil? && !v.nil?\n num += ALPHA_NUMBERS[k.to_s.downcase] * ALPHA_NUMBERS[v.to_s.downcase]\n end\n end\n num\n end",
"def cleanup\n # @@array.reject!(&:empty?)\n @@possible_codes.reject!(&:empty?)\n # @@possible_codes.sort! do |group1, group2|\n # group1_value = 0\n # group2_value = 0\n # @@array.each do |comp|\n # group1.each_with_index { |num, index| group1_value += 1 if comp[index] == num || comp.include?(num) }\n # group2.each_with_index { |num, index| group2_value += 1 if comp[index] == num || comp.include?(num) }\n # end\n # if group2_value < group1_value\n # group2 <=> group1\n # else\n # group1 <=> group2\n # end\n # end\n end",
"def hash_code\n hash_code = {}\n self.seq.each do |letter|\n hash_code.keys.include?(letter) ? hash_code[letter] += 1 : hash_code[letter] = 1\n end\n hash_code\n end",
"def checkSum\n h = Hash.new\n # get the counts of each character\n (0..@value.length - 1).each do |idx|\n char = @value[idx]\n h[char] = h.fetch(char,0) + 1\n end\n h.delete(\"-\")\n h.sort_by{|k,v| [-v,k]}.to_h.keys.join[0..4]\n end",
"def uncached_ref_data_codes\n { user_is_signed_ta_cs: YESNO_COMP_KEY }\n end",
"def get_all_codes_for_entity(entity, is_crosswalked_codes_needed = nil)\n rcc_log.debug \"Generating codes for the output files such as A36, HREOB, 835 for claim type in Quadax\"\n rcc_log.debug \"Obtaining all the codes for the entity : #{entity} having id : #{entity.id}\"\n @entity = entity\n primary_reason_codes, primary_reason_code_descriptions = [], []\n all_reason_codes, all_reason_code_descriptions = [], []\n hipaa_codes, client_codes = [], []\n group_codes = []\n remark_codes = []\n cas_01_codes, cas_02_codes = [], []\n claim_status_codes, denied_claim_status_codes = [], []\n reporting_activities_1, reporting_activities_2 = [], []\n crosswalked_codes = {}\n if @entity.present? && @payer.present? && @client.present? && @facility.present?\n associated_codes_for_adjustment_elements = adjustment_reason_elements\n associated_codes_for_adjustment_elements.each do |adjustment_reason|\n crosswalked_codes_for_adj_reason = get_crosswalked_codes_for_adjustment_reason(adjustment_reason)\n if crosswalked_codes_for_adj_reason[:all_reason_codes].present?\n crosswalked_codes_for_adj_reason[:all_reason_codes].each do |rc_and_desc|\n if rc_and_desc.present?\n all_reason_codes << rc_and_desc[0] if rc_and_desc[0].present?\n all_reason_code_descriptions << rc_and_desc[1] if rc_and_desc[1].present?\n end\n end\n end\n if crosswalked_codes_for_adj_reason[:reason_code].present?\n primary_reason_codes << crosswalked_codes_for_adj_reason[:reason_code]\n else\n primary_reason_codes << all_reason_codes.first if all_reason_codes.present?\n end\n if crosswalked_codes_for_adj_reason[:reason_code_description].present?\n primary_reason_code_descriptions << crosswalked_codes_for_adj_reason[:reason_code_description]\n else\n primary_reason_code_descriptions << all_reason_code_descriptions.first if all_reason_code_descriptions.present?\n end\n if is_crosswalked_codes_needed.present?\n rcc_log.debug \"Also obtaining the crosswalked codes other than\n primary_reason_codes, primary_reason_code_descriptions,\n all_reason_codes, all_reason_code_descriptions\"\n hipaa_codes << crosswalked_codes_for_adj_reason[:hipaa_code] if crosswalked_codes_for_adj_reason[:hipaa_code].present?\n client_codes << crosswalked_codes_for_adj_reason[:client_code] if crosswalked_codes_for_adj_reason[:client_code].present?\n group_codes << crosswalked_codes_for_adj_reason[:group_code] if crosswalked_codes_for_adj_reason[:group_code].present?\n remark_codes << crosswalked_codes_for_adj_reason[:remark_codes] if crosswalked_codes_for_adj_reason[:remark_codes].present?\n cas_01_codes << crosswalked_codes_for_adj_reason[:cas_01] if crosswalked_codes_for_adj_reason[:cas_01].present?\n cas_02_codes << crosswalked_codes_for_adj_reason[:cas_02] if crosswalked_codes_for_adj_reason[:cas_02].present?\n claim_status_codes << crosswalked_codes_for_adj_reason[:claim_status_code] if crosswalked_codes_for_adj_reason[:claim_status_code].present?\n denied_claim_status_codes << crosswalked_codes_for_adj_reason[:denied_claim_status_code] if crosswalked_codes_for_adj_reason[:denied_claim_status_code].present?\n reporting_activities_1 << crosswalked_codes_for_adj_reason[:reporting_activity1] if crosswalked_codes_for_adj_reason[:reporting_activity1].present?\n reporting_activities_2 << crosswalked_codes_for_adj_reason[:reporting_activity2] if crosswalked_codes_for_adj_reason[:reporting_activity2].present?\n end\n end\n crosswalked_codes[:primary_reason_codes] = primary_reason_codes.compact.uniq\n crosswalked_codes[:primary_reason_code_descriptions] = primary_reason_code_descriptions.compact.uniq\n crosswalked_codes[:all_reason_codes] = all_reason_codes.compact.uniq\n crosswalked_codes[:all_reason_code_descriptions] = all_reason_code_descriptions.compact.uniq\n if is_crosswalked_codes_needed.present?\n crosswalked_codes[:hipaa_codes] = hipaa_codes.compact.uniq\n crosswalked_codes[:client_codes] = client_codes.compact.uniq\n crosswalked_codes[:group_codes] = group_codes.compact.uniq\n crosswalked_codes[:remark_codes] = remark_codes.flatten.compact.uniq\n crosswalked_codes[:cas_01_codes] = cas_01_codes.compact.uniq\n crosswalked_codes[:cas_02_codes] = cas_02_codes.compact.uniq\n crosswalked_codes[:claim_status_codes] = claim_status_codes.compact.uniq\n crosswalked_codes[:denied_claim_status_codes] = denied_claim_status_codes.compact.uniq\n crosswalked_codes[:reporting_activities_1] = reporting_activities_1.compact.uniq\n crosswalked_codes[:reporting_activities_2] = reporting_activities_2.compact.uniq\n end\n if crosswalked_codes.present?\n crosswalked_codes\n else\n rcc_log.debug \"crosswalked codes hash is empty\"\n end\n else\n rcc_log.error \"Client or Facility or Payer or Entity(InsurancePaymentEob or ServicePaymentEob object) is missing.\"\n end\n end",
"def cached_ref_data_codes\n { applicant_type: comp_key('APPLICANT-TYPE', 'SLFT', 'RSTU'),\n application_type: comp_key('APPLICATION', 'SLFT', 'RSTU'),\n supporting_document_list: comp_key(\"DOCUMENTS-#{application_type}\", 'SLFT', 'RSTU'),\n renewal_or_review: comp_key('RENEWALORREVIEW', 'SYS', 'RSTU'),\n why_water_present: comp_key('WHY-WATER', 'SLFT', 'RSTU') }\n end",
"def extract_code\n @original.chars.map do |c|\n @code.push c.to_i if c[/\\d+/]\n end\n end",
"def hash\n [sequence_number, corporate_number, process, correct, update_date, change_date, name, name_image_id, kind, prefecture_name, city_name, street_number, address_image_id, prefecture_code, city_code, post_code, address_outside, address_outside_image_id, close_date, close_cause, successor_corporate_number, change_cause, assignment_date, latest, en_name, en_prefecture_name, en_city_name, en_address_outside, furigana, hihyoji].hash\n end",
"def full_bigram_counts\n {\n'TH' => 116997844,\n'HE' => 100689263,\n'IN' => 87674002,\n'ER' => 77134382,\n'AN' => 69775179,\n'RE' => 60923600,\n'ES' => 57070453,\n'ON' => 56915252,\n'ST' => 54018399,\n'NT' => 50701084,\n'EN' => 48991276,\n'AT' => 48274564,\n'ED' => 46647960,\n'ND' => 46194306,\n'TO' => 46115188,\n'OR' => 45725191,\n'EA' => 43329810,\n'TI' => 42888666,\n'AR' => 42353262,\n'TE' => 42295813,\n'NG' => 38567365,\n'AL' => 38211584,\n'IT' => 37938534,\n'AS' => 37773878,\n'IS' => 37349981,\n'HA' => 35971841,\n'ET' => 32872552,\n'SE' => 31532272,\n'OU' => 31112284,\n'OF' => 30540904,\n'LE' => 30383262,\n'SA' => 30080131,\n'VE' => 29320973,\n'RO' => 29230770,\n'RA' => 28645577,\n'RI' => 27634643,\n'HI' => 27495342,\n'NE' => 27331675,\n'ME' => 27237733,\n'DE' => 27029835,\n'CO' => 26737101,\n'TA' => 26147593,\n'EC' => 25775798,\n'SI' => 25758841,\n'LL' => 24636875,\n'SO' => 23903631,\n'NA' => 23547524,\n'LI' => 23291169,\n'LA' => 23178317,\n'EL' => 23092248,\n'MA' => 21828378,\n'DI' => 21673998,\n'IC' => 21468412,\n'RT' => 21456059,\n'NS' => 21306421,\n'RS' => 21237259,\n'IO' => 21210160,\n'OM' => 21066156,\n'CH' => 20132750,\n'OT' => 20088048,\n'CA' => 19930754,\n'CE' => 19803619,\n'HO' => 19729026,\n'BE' => 19468489,\n'TT' => 19367472,\n'FO' => 18923772,\n'TS' => 18922522,\n'SS' => 18915696,\n'NO' => 18894111,\n'EE' => 18497942,\n'EM' => 18145294,\n'AC' => 17904683,\n'IL' => 17877600,\n'DA' => 17584055,\n'NI' => 17452104,\n'UR' => 17341717,\n'WA' => 16838794,\n'SH' => 16773127,\n'EI' => 16026915,\n'AM' => 15975981,\n'TR' => 15821226,\n'DT' => 15759673,\n'US' => 15699353,\n'LO' => 15596310,\n'PE' => 15573318,\n'UN' => 15237699,\n'NC' => 15214623,\n'WI' => 15213018,\n'UT' => 15137169,\n'AD' => 14877234,\n'EW' => 14776406,\n'OW' => 14610429,\n'GE' => 14425023,\n'EP' => 14024377,\n'AI' => 13974919,\n'LY' => 13742031,\n'OL' => 13726491,\n'FT' => 13696078,\n'OS' => 13596265,\n'EO' => 13524186,\n'EF' => 13252227,\n'PR' => 13191182,\n'WE' => 13185116,\n'DO' => 13120322,\n'MO' => 12950768,\n'ID' => 12896787,\n'IE' => 12505546,\n'MI' => 12168944,\n'PA' => 12068709,\n'FI' => 11993833,\n'PO' => 11917535,\n'CT' => 11888752,\n'WH' => 11852909,\n'IR' => 11681353,\n'AY' => 11523416,\n'GA' => 11239788,\n'SC' => 10800636,\n'KE' => 10650670,\n'EV' => 10574011,\n'SP' => 10570626,\n'IM' => 10544422,\n'OP' => 10459455,\n'DS' => 10429887,\n'LD' => 10245579,\n'UL' => 10173468,\n'OO' => 10168856,\n'SU' => 10031005,\n'IA' => 10002012,\n'GH' => 9880399,\n'PL' => 9812226,\n'EB' => 9738798,\n'IG' => 9530574,\n'VI' => 9380037,\n'IV' => 9129232,\n'WO' => 9106647,\n'YO' => 9088497,\n'RD' => 9025637,\n'TW' => 8910254,\n'BA' => 8867461,\n'AG' => 8809266,\n'RY' => 8788539,\n'AB' => 8775582,\n'LS' => 8675452,\n'SW' => 8673234,\n'AP' => 8553911,\n'FE' => 8529289,\n'TU' => 8477495,\n'CI' => 8446084,\n'FA' => 8357929,\n'HT' => 8351551,\n'FR' => 8339376,\n'AV' => 8288885,\n'EG' => 8286463,\n'GO' => 8188708,\n'BO' => 8172395,\n'BU' => 8113271,\n'TY' => 8008918,\n'MP' => 7835172,\n'OC' => 7646952,\n'OD' => 7610214,\n'EH' => 7559141,\n'YS' => 7539621,\n'EY' => 7528342,\n'RM' => 7377989,\n'OV' => 7350014,\n'GT' => 7347990,\n'YA' => 7239548,\n'CK' => 7205091,\n'GI' => 7103140,\n'RN' => 7064635,\n'GR' => 6989963,\n'RC' => 6974063,\n'BL' => 6941044,\n'LT' => 6817273,\n'YT' => 6714151,\n'OA' => 6554221,\n'YE' => 6499305,\n'OB' => 6212512,\n'DB' => 6106719,\n'FF' => 6085519,\n'SF' => 6073995,\n'RR' => 5896212,\n'DU' => 5861311,\n'KI' => 5814357,\n'UC' => 5742385,\n'IF' => 5740414,\n'AF' => 5702567,\n'DR' => 5701879,\n'CL' => 5683204,\n'EX' => 5649363,\n'SM' => 5580755,\n'PI' => 5559210,\n'SB' => 5553684,\n'CR' => 5514347,\n'TL' => 5403137,\n'OI' => 5336616,\n'RU' => 5330557,\n'UP' => 5306948,\n'BY' => 5232074,\n'TC' => 5196817,\n'NN' => 5180899,\n'AK' => 5137311,\n'SL' => 4965012,\n'NF' => 4950333,\n'UE' => 4927837,\n'DW' => 4906814,\n'AU' => 4884168,\n'PP' => 4873393,\n'UG' => 4832325,\n'RL' => 4803246,\n'RG' => 4645938,\n'BR' => 4621080,\n'CU' => 4604045,\n'UA' => 4589997,\n'DH' => 4585765,\n'RK' => 4491400,\n'YI' => 4461214,\n'LU' => 4402940,\n'UM' => 4389720,\n'BI' => 4356462,\n'NY' => 4343290,\n'NW' => 4215967,\n'QU' => 4169424,\n'OG' => 4163126,\n'SN' => 4157990,\n'MB' => 4121764,\n'VA' => 4111375,\n'DF' => 4033878,\n'DD' => 4001275,\n'MS' => 3922855,\n'GS' => 3920675,\n'AW' => 3918960,\n'NH' => 3915410,\n'PU' => 3858148,\n'HR' => 3843001,\n'SD' => 3842250,\n'TB' => 3815459,\n'PT' => 3812475,\n'NM' => 3796928,\n'DC' => 3782481,\n'GU' => 3768430,\n'TM' => 3759861,\n'MU' => 3755834,\n'NU' => 3732602,\n'MM' => 3730508,\n'NL' => 3692985,\n'EU' => 3674130,\n'WN' => 3649615,\n'NB' => 3602692,\n'RP' => 3588188,\n'DM' => 3544905,\n'SR' => 3513808,\n'UD' => 3499535,\n'UI' => 3481482,\n'RF' => 3436232,\n'OK' => 3397570,\n'YW' => 3379064,\n'TF' => 3368452,\n'IP' => 3348621,\n'RW' => 3348005,\n'RB' => 3346212,\n'OH' => 3254659,\n'KS' => 3227333,\n'DP' => 3145043,\n'FU' => 3138900,\n'YC' => 3128053,\n'TP' => 3070427,\n'MT' => 3055946,\n'DL' => 3050945,\n'NK' => 3043200,\n'CC' => 3026492,\n'UB' => 2990868,\n'RH' => 2968706,\n'NP' => 2968126,\n'JU' => 2924815,\n'FL' => 2890839,\n'DN' => 2840522,\n'KA' => 2833038,\n'PH' => 2825344,\n'HU' => 2771830,\n'JO' => 2721345,\n'LF' => 2702522,\n'YB' => 2696786,\n'RV' => 2692445,\n'OE' => 2616308,\n'IB' => 2598444,\n'IK' => 2585124,\n'YP' => 2581863,\n'GL' => 2576787,\n'LP' => 2543957,\n'YM' => 2516273,\n'LB' => 2463693,\n'HS' => 2462026,\n'DG' => 2442139,\n'GN' => 2426429,\n'EK' => 2411639,\n'NR' => 2393580,\n'PS' => 2377036,\n'TD' => 2346516,\n'LC' => 2328063,\n'SK' => 2321888,\n'YF' => 2305244,\n'YH' => 2291273,\n'VO' => 2253292,\n'AH' => 2225270,\n'DY' => 2218040,\n'LM' => 2216514,\n'SY' => 2214270,\n'NV' => 2194534,\n'YD' => 2122337,\n'FS' => 2047416,\n'SG' => 2043770,\n'YR' => 2021939,\n'YL' => 2013939,\n'WS' => 1988727,\n'MY' => 1949129,\n'OY' => 1932892,\n'KN' => 1903836,\n'IZ' => 1865802,\n'XP' => 1840696,\n'LW' => 1836811,\n'TN' => 1782119,\n'KO' => 1758001,\n'AA' => 1721143,\n'JA' => 1712763,\n'ZE' => 1709871,\n'FC' => 1570791,\n'GW' => 1567991,\n'TG' => 1530045,\n'XT' => 1509969,\n'FH' => 1507604,\n'LR' => 1505092,\n'JE' => 1487348,\n'YN' => 1485655,\n'GG' => 1468286,\n'GF' => 1465290,\n'EQ' => 1461436,\n'HY' => 1446451,\n'KT' => 1443985,\n'HC' => 1441057,\n'BS' => 1409672,\n'HW' => 1403223,\n'HN' => 1383958,\n'CS' => 1381608,\n'HM' => 1353001,\n'NJ' => 1342735,\n'HH' => 1329998,\n'WT' => 1301293,\n'GC' => 1299541,\n'LH' => 1274048,\n'EJ' => 1256993,\n'FM' => 1251312,\n'DV' => 1238565,\n'LV' => 1238287,\n'WR' => 1226755,\n'GP' => 1215204,\n'FP' => 1199845,\n'GB' => 1184377,\n'GM' => 1178511,\n'HL' => 1169468,\n'LK' => 1164186,\n'CY' => 1145316,\n'MC' => 1101727,\n'YG' => 1049082,\n'XI' => 1024736,\n'HB' => 1014004,\n'FW' => 1005903,\n'GY' => 979804,\n'HP' => 978649,\n'MW' => 937621,\n'PM' => 931225,\n'ZA' => 929119,\n'LG' => 926472,\n'IW' => 922059,\n'XA' => 904148,\n'FB' => 888155,\n'SV' => 882083,\n'GD' => 879792,\n'IX' => 879360,\n'AJ' => 870262,\n'KL' => 846309,\n'HF' => 834284,\n'HD' => 828755,\n'AE' => 815963,\n'SQ' => 800346,\n'DJ' => 799366,\n'FY' => 789961,\n'AZ' => 768359,\n'LN' => 752316,\n'AO' => 749566,\n'FD' => 748027,\n'KW' => 719633,\n'MF' => 715087,\n'MH' => 710864,\n'SJ' => 704442,\n'UF' => 701892,\n'TV' => 698150,\n'XC' => 697995,\n'YU' => 695512,\n'BB' => 689158,\n'WW' => 674610,\n'OJ' => 661082,\n'AX' => 660826,\n'MR' => 660619,\n'WL' => 657782,\n'XE' => 653947,\n'KH' => 650095,\n'OX' => 650078,\n'UO' => 649906,\n'ZI' => 644035,\n'FG' => 637758,\n'IH' => 610683,\n'TK' => 610333,\n'II' => 607124,\n'IU' => 576683,\n'TJ' => 559473,\n'MN' => 558397,\n'WY' => 553647,\n'KY' => 553296,\n'KF' => 537342,\n'FN' => 534362,\n'UY' => 531960,\n'PW' => 530411,\n'DK' => 525744,\n'RJ' => 518157,\n'UK' => 514873,\n'KR' => 507020,\n'KU' => 506618,\n'WM' => 505687,\n'KM' => 485617,\n'MD' => 481126,\n'ML' => 478528,\n'EZ' => 465466,\n'KB' => 457860,\n'WC' => 448394,\n'WD' => 432646,\n'HG' => 429607,\n'BT' => 428276,\n'ZO' => 424016,\n'KC' => 420017,\n'PF' => 418168,\n'YV' => 411487,\n'PC' => 400308,\n'PY' => 396147,\n'WB' => 394820,\n'YK' => 391953,\n'CP' => 382923,\n'YJ' => 378679,\n'KP' => 375653,\n'PB' => 369336,\n'CD' => 358435,\n'JI' => 357577,\n'UW' => 352732,\n'UH' => 339341,\n'WF' => 336213,\n'YY' => 332973,\n'WP' => 321746,\n'BC' => 320380,\n'AQ' => 315068,\n'CB' => 298053,\n'IQ' => 291635,\n'CM' => 285942,\n'MG' => 285133,\n'DQ' => 283314,\n'BJ' => 282608,\n'TZ' => 280007,\n'KD' => 277982,\n'PD' => 273162,\n'FJ' => 269865,\n'CF' => 267630,\n'NZ' => 266461,\n'CW' => 257253,\n'FV' => 244685,\n'VY' => 233082,\n'FK' => 228905,\n'OZ' => 228556,\n'ZZ' => 221275,\n'IJ' => 219128,\n'LJ' => 218362,\n'NQ' => 217422,\n'UV' => 212051,\n'XO' => 211173,\n'PG' => 211133,\n'HK' => 210385,\n'KG' => 209266,\n'VS' => 204093,\n'HV' => 197539,\n'BM' => 191807,\n'HJ' => 189906,\n'CN' => 188046,\n'GV' => 186777,\n'CG' => 181590,\n'WU' => 180884,\n'GJ' => 176947,\n'XH' => 166599,\n'GK' => 163830,\n'TQ' => 159111,\n'CQ' => 157546,\n'RQ' => 156933,\n'BH' => 154489,\n'XS' => 154347,\n'UZ' => 153736,\n'WK' => 148964,\n'XU' => 147533,\n'UX' => 144814,\n'BD' => 141752,\n'BW' => 140189,\n'WG' => 139890,\n'MV' => 136314,\n'MJ' => 134263,\n'PN' => 131645,\n'XM' => 127492,\n'OQ' => 122677,\n'BV' => 120081,\n'XW' => 119322,\n'KK' => 118811,\n'BP' => 115161,\n'ZU' => 113538,\n'RZ' => 113432,\n'XF' => 113031,\n'MK' => 111041,\n'ZH' => 107639,\n'BN' => 106125,\n'ZY' => 105871,\n'HQ' => 101241,\n'WJ' => 99435,\n'IY' => 98361,\n'DZ' => 98038,\n'VR' => 96416,\n'ZS' => 94993,\n'XY' => 94329,\n'CV' => 94224,\n'XB' => 94041,\n'XR' => 90046,\n'UJ' => 88168,\n'YQ' => 87953,\n'VD' => 85611,\n'PK' => 83017,\n'VU' => 82830,\n'JR' => 80471,\n'ZL' => 80039,\n'SZ' => 79840,\n'YZ' => 78281,\n'LQ' => 77148,\n'KJ' => 76816,\n'BF' => 75352,\n'NX' => 74844,\n'QA' => 73527,\n'QI' => 73387,\n'KV' => 73184,\n'ZW' => 68865,\n'WV' => 63930,\n'UU' => 63043,\n'VT' => 62912,\n'VP' => 62577,\n'XD' => 60101,\n'GQ' => 59750,\n'XL' => 59585,\n'VC' => 59024,\n'CZ' => 57914,\n'LZ' => 57314,\n'ZT' => 56955,\n'WZ' => 52836,\n'SX' => 50975,\n'ZB' => 50652,\n'VL' => 49032,\n'PV' => 48105,\n'FQ' => 47504,\n'PJ' => 47043,\n'ZM' => 46034,\n'VW' => 45608,\n'CJ' => 41526,\n'ZC' => 41037,\n'BG' => 40516,\n'JS' => 39326,\n'XG' => 39289,\n'RX' => 38654,\n'HZ' => 37066,\n'XX' => 35052,\n'VM' => 35024,\n'XN' => 34734,\n'QW' => 34669,\n'JP' => 34520,\n'VN' => 33082,\n'ZD' => 32906,\n'ZR' => 32685,\n'FZ' => 31186,\n'XV' => 31117,\n'ZP' => 30389,\n'VH' => 30203,\n'VB' => 29192,\n'ZF' => 28658,\n'GZ' => 28514,\n'TX' => 28156,\n'VF' => 28090,\n'DX' => 27413,\n'QB' => 27307,\n'BK' => 26993,\n'ZG' => 26369,\n'VG' => 25585,\n'JC' => 24770,\n'ZK' => 24262,\n'ZN' => 24241,\n'UQ' => 23386,\n'JM' => 22338,\n'VV' => 22329,\n'JD' => 21903,\n'MQ' => 21358,\n'JH' => 20960,\n'QS' => 20847,\n'JT' => 20408,\n'JB' => 19380,\n'FX' => 19313,\n'PQ' => 18607,\n'MZ' => 18271,\n'YX' => 16945,\n'QT' => 16914,\n'WQ' => 16245,\n'JJ' => 16085,\n'JW' => 16083,\n'LX' => 15467,\n'GX' => 14778,\n'JN' => 14452,\n'ZV' => 14339,\n'MX' => 14250,\n'JK' => 13967,\n'KQ' => 13905,\n'XK' => 13651,\n'JF' => 12640,\n'QM' => 12315,\n'QH' => 12273,\n'JL' => 12149,\n'JG' => 12023,\n'VK' => 11469,\n'VJ' => 11432,\n'KZ' => 11192,\n'QC' => 10667,\n'XJ' => 10629,\n'PZ' => 9697,\n'QL' => 9603,\n'QO' => 9394,\n'JV' => 8925,\n'QF' => 8778,\n'QD' => 8678,\n'BZ' => 8132,\n'HX' => 7526,\n'ZJ' => 7167,\n'PX' => 6814,\n'QP' => 6062,\n'QE' => 6020,\n'QR' => 5975,\n'ZQ' => 5773,\n'JY' => 5723,\n'BQ' => 5513,\n'XQ' => 5416,\n'CX' => 5300,\n'KX' => 5083,\n'WX' => 4678,\n'QY' => 4557,\n'QV' => 4212,\n'QN' => 3808,\n'VX' => 3192,\n'BX' => 3021,\n'JZ' => 2859,\n'VZ' => 2633,\n'QG' => 2567,\n'QQ' => 2499,\n'ZX' => 2463,\n'XZ' => 2082,\n'QK' => 2023,\n'VQ' => 1488,\n'QJ' => 1342,\n'QX' => 765,\n'JX' => 747,\n'JQ' => 722,\n'QZ' => 280\n}\n end",
"def inject_total(unique_values, &block)\n unique_values.inject(0) do |total, num|\n n_in_code = count_hits(num, secret_code)\n n_in_guess = count_hits(num, guess)\n total += block.call(n_in_code, n_in_guess)\n end\nend",
"def create_hash_of_codes_from_prices(user_id)\n codes_and_prices = {}\n mapping_usd_to_fares(user_id).each do |i|\n key = process_search(user_id).key(i)\n codes_and_prices[key] = i\n end\n codes_and_prices\nend",
"def process_value(code,text)\n\n\n # depending on the report code, process the values\n # this is done by reading parameter names and their values\n # and respong on it as needed \n\n case code \n\n # Report parameter value\n when 'R21'\n ard_par_id = -1\n ard_par_val = 0\n\n text.split(' ').each do |param|\n\n par_code = param[0..0].to_s\n par_value = param[1..-1].to_i\n\n case par_code\n when 'P'\n ard_par_id = par_value\n when 'V'\n ard_par_val = par_value\n end\n end\n\n if ard_par_id >= 0\n param = get_param_by_id(ard_par_id)\n if param != nil\n param['value_ar'] = ard_par_val\n end\n end\n\n # Report parameter value and save to database\n when 'R23'\n ard_par_id = -1\n ard_par_val = 0\n\n text.split(' ').each do |param|\n\n par_code = param[0..0].to_s\n par_value = param[1..-1].to_i\n\n case par_code\n when 'P'\n ard_par_id = par_value\n when 'V'\n ard_par_val = par_value\n end\n end\n\n if ard_par_id >= 0\n param = get_param_by_id(ard_par_id)\n if param != nil\n save_param_value(ard_par_id, :by_id, :from_db, ard_par_val)\n end\n end\n\n # Report pin values\n when 'R41'\n pin_id = -1\n pin_val = 0\n\n text.split(' ').each do |param|\n\n par_code = param[0..0].to_s\n par_value = param[1..-1].to_i\n\n case par_code\n when 'P'\n pin_id = par_value\n when 'V'\n pin_val = par_value\n end\n end\n\n if pin_id >= 0\n save_pin_value(pin_id, pin_val)\n end\n\n # Report end stops\n when 'R81'\n text.split(' ').each do |param|\n\n par_code = param[0..1].to_s\n par_value = param[2..-1].to_s\n end_stop_active = (par_value == \"1\")\n\n case par_code\n when 'XA'\n @axis_x_end_stop_a = end_stop_active\n $status.info_end_stop_x_a = end_stop_active\n when 'XB'\n @axis_x_end_stop_b = end_stop_active\n $status.info_end_stop_x_b = end_stop_active\n when 'YA'\n @axis_y_end_stop_a = end_stop_active\n $status.info_end_stop_y_a = end_stop_active\n when 'YB'\n @axis_y_end_stop_b = end_stop_active\n $status.info_end_stop_y_b = end_stop_active\n when 'ZA'\n @axis_z_end_stop_a = end_stop_active\n $status.info_end_stop_z_a = end_stop_active\n when 'ZB'\n @axis_z_end_stop_b = end_stop_active\n $status.info_end_stop_z_b = end_stop_active\n end\n end\n\n # Report position\n when 'R82' \n text.split(' ').each do |param|\n\n par_code = param[0..0].to_s\n par_value = param[1..-1].to_i\n\n case par_code\n when 'X'\n @axis_x_pos = par_value\n @axis_x_pos_conv = par_value / @axis_x_steps_per_unit\n $status.info_current_x = @axis_x_pos_conv\n when 'Y'\n @axis_y_pos = par_value\n @axis_y_pos_conv = par_value / @axis_y_steps_per_unit\n $status.info_current_y = @axis_y_pos_conv\n when 'Z'\n @axis_z_pos = par_value\n @axis_z_pos_conv = par_value / @axis_z_steps_per_unit\n $status.info_current_z = @axis_z_pos_conv\n end \n end\n\n # Report software version\n when 'R83'\n @device_version = text\n\n # Send a comment\n when 'R99'\n puts \">#{text}<\"\n\n end\n end",
"def verification_code\n raise ArgumentError, 'Hash is not set' if @hash.nil?\n\n binary = @hash.unpack1('B*').split //\n [*binary.first(6), *binary.last(7)].join.to_i(2)\n end",
"def collect_hashes(data, basis)\n language_list = data[basis]\n language_list\nend",
"def uncached_ref_data_codes\n { ads_due_ind: YESNO_COMP_KEY }\n end",
"def run_report(hash)\n hash.each do |key, value|\n key = VirusPredictor.new(key, hash[key][:population_density], hash[key][:population])\n key.virus_effects\n end\nend",
"def hash\n [code, scope].hash\n end",
"def process_file(file_name)\r\n\tputs \"Processing File.... \"\r\n\r\n\tbegin\r\n\t\tcounter = Hash.new\r\n\t\tfile = File.open(file_name)\r\n\t\tuntil file.eof?\r\n\t\t\tfile.each_line do |line|\r\n\t\t\t\t# do something for each line\r\n\t\t\t\ttitle = cleanup_title(line)\r\n\t\t\t\tunless(title == \"\")\r\n\t\t\t\t\tbigram = title.split().each_cons(2).to_a\r\n\t\t\t\t\tbigram = bigram.map{ |n| n.join(' ')}\r\n\t\t\t\t\tbigram = bigram.each_with_object(Hash.new(0)){|word, obj| obj[word] += 1}\r\n\t\t\t\t\tif bigram.any?\r\n\t\t\t\t\t\tcounter.merge!(bigram) { |k, old, new| old + new}\r\n\t\t\t\t\tend\r\n\t\t\t\tend\r\n\t\t\tend\r\n\t\tend\r\n\t\tfile.close\r\n\r\n\t\t$bigramsArray = counter.sort_by { |k, v| -v }\r\n\t\tcreate_hash()\r\n\t\t#$bigrams = $bigrams.to_h\r\n\r\n\t\t#$bigramsHash = Hash.new\r\n\t\t#$bigramsHash = $bigrams.to_h\r\n \t#$bigrams.each { |k, v| puts \"#{v} => #{k}\"}\r\n\r\n\r\n\t\tputs \"Finished. Bigram model built.\\n\"\r\n\trescue\r\n\t\tSTDERR.puts \"Could not open file\"\r\n\t\texit 4\r\n\tend\r\n\r\nend",
"def build_pcrs_hash\n pcrs = distribute_pcrs operations.running, 4\n pcrs.each do |pcr|\n lengths = pcr[:ops_by_bin].values.flatten.collect { |op| op.output(FRAGMENT).sample.properties[\"Length\"] }\n extension_time = (lengths.max)/1000.0*SEC_PER_KB\n # adding more extension time for longer size PCR.\n if lengths.max < 2000\n extension_time += 30\n elsif lengths.max < 3000\n extension_time += 60\n else\n extension_time += 90\n end\n extension_time = 3 * 60 if extension_time < 3 * 60\n pcr[:mm], pcr[:ss] = (extension_time.to_i).divmod(60)\n pcr[:mm] = \"0#{pcr[:mm]}\" if pcr[:mm].between?(0, 9)\n pcr[:ss] = \"0#{pcr[:ss]}\" if pcr[:ss].between?(0, 9)\n\n # set up stripwells (one for each temperature bin)\n pcr[:ops_by_bin].each do |bin, ops|\n ops.make\n pcr[:stripwells] += ops.output_collections[FRAGMENT]\n end\n end\n pcrs\n end",
"def generate_kpi_from_key_counter(all_fomula,s1_ip,time_counter_hash,source_file,logger)\n\ncell_size=3\n\ntime_counter_hash.each do |start_time,one_time_counter|\n\n counter_hash=one_time_counter\n #logger.debug \"kpi calculation for start time=#{start_time}\"\n all_cell_hash=Hash.new\n\n all_fomula.each do |fomula|\n #puts fomula.name\n #logger.debug \"start calculate fomula #{fomula.name}\"\n\n fomula_hash=Hash.new\n\n #获取原始公式并替换处理\n new_fomula=fomula.fomula_exp1.gsub(/sum|avg|\\[|\\]/,\"\")\n #获取一个公示里面所有的counter,并存放在数组中\n counter_array=fomula.fomula_exp1.scan(/M\\d+C\\d+/)\n\n counter_array.each do |counter|\n fomula_hash[counter]=counter_hash[counter]\n end\n\n #logger.debug \"fomula hash=#{fomula_hash}\"\n\n# we need convert fomulu to map to the array we calculated above\n cell_fomula_array=[]\n\n 0.upto(cell_size-1).each do |i|\n\n new_fomula_2=String.new(new_fomula)\n formated_fomula=\"\"\n counter_array.uniq.each do |counter|\n\n if fomula.formularid==\"LTE_5218c\" || fomula.formularid==\"LTE_5023d\" || fomula.formularid==\"LTE_5017a\" || fomula.formularid==\"LTE_5017a\" || fomula.formularid==\"LTE_5035a\" || fomula.formularid==\"LTE_5082a\" \\\n || fomula.formularid==\"LTE_5114a\" || fomula.formularid==\"LTE_5035a\" ||fomula.formularid==\"LTE_5048b\" || fomula.formularid==\"LTE_5082a\" || fomula.formularid==\"LTE_5114a\" || fomula.formularid==\"LTE_5043a\" \\\n || fomula.formularid==\"LTE_5058b\" || fomula.formularid==\"LTE_5119c\" ||fomula.formularid==\"LTE_5025d\"\n formated_fomula= new_fomula_2.gsub!(\"#{counter}\",\"fomula_hash\\[\\\"#{counter}\\\"\\]\\[#{i}\\].to_f\")\n\n else\n formated_fomula= new_fomula_2.gsub!(\"#{counter}\",\"fomula_hash\\[\\\"#{counter}\\\"\\]\\[#{i}\\]\")\n end\n \n end #end of each counter sacn\n #save converted fomulr\n cell_fomula_array << formated_fomula\n\n #logger.debug \"formated_fomula=#{formated_fomula}\"\n end\n\n#logger.debug cell_fomula_array\n\n #对于每一个cell的公式\n cell_fomula_array.each_index do |index|\n all_cell_hash[\"#{start_time}_cell#{index}\"] ||={}\n # logger.debug \"calculation formuala=#{cell_fomula_array[index]}\"\n\n merged_hash=all_cell_hash[\"#{start_time}_cell#{index}\"]\n\n merged_hash[\"start_time\"]=start_time\n merged_hash[\"source_file\"]=source_file\n merged_hash[\"s1_ip\"]=s1_ip\n merged_hash[\"kpi_hash\"]||={} #KPI is empty\n merged_hash[\"scopelevel\"]=\"cell-#{index+1}\"\n\n begin\n #logger.debug cell_fomula_array\n kpi_result=eval(cell_fomula_array[index].to_s)\n logger.debug \"kpi_result=#{kpi_result}\"\n if kpi_result.kind_of?(Float)\n kpi_result=kpi_result.round(2).to_s+\"%\"\n end\n\n\n # logger.debug \"kpi result=#{kpi_result}\"\n merged_hash[\"kpi_hash\"]=merged_hash[\"kpi_hash\"].merge({fomula.name.to_s=>kpi_result})\n \n rescue Exception => ex\n # puts ex\n logger.debug ex.class\n\n \t#logger.debug \"merged_hash=#{merged_hash}\"\n \t#merged_hash[\"kpi_hash\"]||=Hash.new #KPI is empty\n \t#\traise unless merged_hash[\"kpi_hash\"].kind_of?(Hash)\n merged_hash[\"kpi_hash\"]=merged_hash[\"kpi_hash\"].merge({fomula.name.to_s=>\"#{ex.class}\"})\n end #end of rescue\n\n \n \n all_cell_hash[\"#{start_time}_cell#{index}\"]=merged_hash\n # puts merged_hash\n end # end of 3 cell calculation \n #logger.debug all_cell_hash\n\t\n end #end of all fomula\n\nall_cell_hash.each do |key,value|\n #logger.debug \"start_time =#{key},value hash size=#{value[\"kpi_hash\"].size}\"\n value[\"kpi_hash\"]=value[\"kpi_hash\"].to_s\n kpi=Kpi.where(:s1_ip=>s1_ip,:start_time=>value[\"start_time\"],:scopelevel=>value[\"scopelevel\"]).first\n \n if kpi.nil?\n Kpi.create(value) \n # else\n # kpi.update_attributes(value) \n end\n\nend\n\nend \n\n\n\nend",
"def uncached_ref_data_codes\n { full_repayment_of_ads: YESNO_COMP_KEY,\n authenticated_declaration1: YESNO_COMP_KEY,\n authenticated_declaration2: YESNO_COMP_KEY }\n end",
"def build_crosswalked_codes_for_a_reason_code(crosswalk_record)\n crosswalked_codes = {}\n crosswalked_codes[:reason_code] = reason_code\n crosswalked_codes[:unique_code] = unique_code\n crosswalked_codes[:footnote_code] = footnote_code(reason_code_object)\n crosswalked_codes[:reason_code_description] = normalized_reason_code_description(crosswalk_record)\n crosswalked_codes[:remark_codes] = normalized_remark_codes(crosswalk_record)\n crosswalked_codes[:default_group_code] = default_group_code\n if crosswalk_record.present?\n crosswalked_codes[:hipaa_code] = hipaa_code(crosswalk_record)\n crosswalked_codes[:hipaa_code_active_indicator] = hipaa_code_active_indicator(crosswalk_record)\n crosswalked_codes[:crosswalk_record_active_indicator] = crosswalk_record.crosswalk_active_indicator\n if @is_partner_bac\n crosswalked_codes[:denied_hipaa_code] = denied_hipaa_code(crosswalk_record)\n crosswalked_codes[:denied_hipaa_code_active_indicator] = denied_hipaa_code_active_indicator\n crosswalked_codes[:client_code] = client_code(crosswalk_record)\n crosswalked_codes[:denied_client_code] = denied_client_code(crosswalk_record)\n crosswalked_codes[:claim_status_code] = crosswalk_record.claim_status_code\n crosswalked_codes[:denied_claim_status_code] = crosswalk_record.denied_claim_status_code\n crosswalked_codes[:reporting_activity1] = crosswalk_record.reporting_activity1\n crosswalked_codes[:reporting_activity2] = crosswalk_record.reporting_activity2\n end\n end\n crosswalked_codes\n end",
"def get_hash\n\t\treturn { cond_type: COND_NUM_ATTENDING, \n\t\t\tcond_met: @cond_met, num_users: @num_users }\n\tend",
"def unique_visit\n parsed_result.each do |result|\n visit_hash[result.first] = result.last.uniq.count\n end\n visit_hash.sort_by{|k,v| v}.reverse.to_h\n end",
"def report\r\n\r\n STATE_DATA.each do |key, value|\r\n\r\n initialize(key, value[:population_density], value[:population]) \r\n virus_effects\r\n end\r\n \r\n end",
"def read_input\n\tcodehash = {}\n\tcredithash = {}\n\tFile.open('InputFile.txt') do |fp|\n\t\tfp.each do |line|\n\t\t\tresult = line.scan(/([\\S*\\s*]*)(Silver|Gold|Iron|glob|prok|pish|tegj)\\s*is\\s*(\\d+|\\S)/)\n\t\t\tkey, value = line.chomp.split(\" is \")\n\t\t\t\n\t\t\tif [\"Silver\",\"Gold\",\"Iron\"].include? result[0][1]\n\t\t\t\tcredithash[key] = value\n\t\t\telse\n\t\t\t\tcodehash[key] = value\n\t\t\tend\n\t end\n\tend\n\treturn credithash, codehash\nend",
"def code_reset\n @code_table = {}\n (0 .. 255).each do |i|\n @code_table[i.chr] = i\n end\n\n @at_max_code = 0\n @code_size = INIT_CODE_SIZE\n @next_code = @block_mode ? BL_INIT_CODE : NR_INIT_CODE\n @next_increase = 2**@code_size\n end",
"def code= (_code)\r\n @code = _code\r\n #@code_count = Hash.new(0)\r\n count_code\r\n #puts \"Referee.code setter called\"\r\n end",
"def aggregate_stats(valid_token_result)\n r = {}\n valid_token_result.map do |type|\n type.values.last.values.first\n end.each do |t|\n r.merge!(t) { |k,old,new| old + new }\n end\n\n # recompute percentages\n r[:unique_percent_valid] = r[:unique_valid].to_f / r[:unique_tested]\n r[:unique_coverage] = r[:unique_tested].to_f / r[:unique_candidates]\n r[:total_percent_valid] = r[:total_valid].to_f / r[:total_tested]\n r[:total_coverage] = r[:total_tested].to_f / r[:total_candidates]\n r\nend",
"def build_codes_for_adjustment_reason_having_no_reason_codes\n codes = {}\n codes[:default_group_code] = default_group_code\n codes[:group_code] = group_code\n codes[:default_code] = default_code\n codes[:cas_01] = get_cas01_code(codes)\n codes[:cas_02] = get_cas02_code(codes)\n codes[:secondary_cas_01] = get_secondary_cas01_code(codes)\n codes[:secondary_cas_02] = get_secondary_cas02_code(codes)\n codes\n end",
"def decode(input=nil, codes=nil, output=nil)\n\tcodes.default = false # set value that is returned if value is not found in hash\n\ttext = input.read # converts file to String - won't work otherwise for me\n\tc = text[0]\n\ti = 1 # counter for string\n\twhile(i < text.length)\n\t\tuntil(codes[c] != false or i > 100)\n\t\t\tc += text[i]\n\t\t\ti += 1\n\t\tend\n\t\tif(codes[c] != false)\n\t\t\toutput.write(codes[c])\n\t\t\tc = \"\"\n\t\tend\n\t\t# at this point, a match has been found\n\t\t#puts codes[c] == false\n\tend\nend",
"def calculate_values_hashes\n @values_hashes || recalculate_values_hashes\n end",
"def density_map(search_results)\n \n # {\"entries\":[{\"region_id\":\"PK\",\"map_div\":\"density_canvas\",\"locations\":[{\"map_label\":\"PK-IS\",\"map_number\":39},{\"map_label\":\"PK-BA\",\"map_number\":95}],\"column_label\":\"Region\",\"numeric_label\":\"Number of Entries\"},{\"region_id\":\"AF\",\"map_div\":\"density_canvas2\",\"locations\":[{\"map_label\":\"AF-KAB\",\"map_number\":39},{\"map_label\":\"AF-HEL\",\"map_number\":30},{\"map_label\":\"AF-KAN\",\"map_number\":30}],\"column_label\":\"Region\",\"numeric_label\":\"Number of Entries\"}]}\n \n @maps = {:maps => []}\n results = []\n result_hash = {}\n \n # go through the search results\n search_results.each do |result|\n \n unless result.district.province_id.nil?\n \n # get the iso code of the result's province\n province = Province.find(result.district.province_id)\n\n unless province.iso_code.nil?\n \n short_iso = province.iso_code.split(\"-\")[0]\n \n if result_hash[short_iso].nil? # has the country been added to the hash yet?\n \n results << DensityResult.new(short_iso, province.country.name)\n \n result_hash[short_iso] = {:country_name => province.country.name,\n :locations => {}}\n result_hash[short_iso][:locations][province.iso_code] = 1\n else\n \n if result_hash[short_iso][:locations][province.iso_code].nil? # is the province already in the province hash?\n result_hash[short_iso][:locations][province.iso_code] = 1\n else\n result_hash[short_iso][:locations][province.iso_code] += 1\n end\n \n end # end result_hash[short_iso].nil?\n end # end unless\n end # end unless\n end # end search_results.each do |result|\n \n result_hash.each do |country_iso, detail_hash|\n \n new_map = {:region_id => country_iso,\n :map_div => \"map_div_#{country_iso.downcase}\",\n :column_label => \"Region\",\n :number_label => \"NGOs\",\n :locations => []\n }\n \n detail_hash[:locations].each do |province_iso, count|\n new_map[:locations] << {:map_label => province_iso, :map_number => count}\n end\n \n @maps[:maps] << new_map\n \n end\n \n # now that we ahve our results_hash, we need to get the json\n my_file = File.open(\"#{RAILS_ROOT}/public/data/vis.json\", File::WRONLY|File::TRUNC|File::CREAT)\n my_file.puts @maps.to_json.to_s\n my_file.close\n \n return results\n \n end",
"def hash\n values.hash ^ known_data.hash\n end",
"def process_valueset\n puts \"Processing #{@valueset_model.url}\"\n include_set = Set.new\n @valueset_model.compose.include.each do |include|\n # Cumulative of each include\n include_set.merge(get_code_sets(include))\n end\n @valueset_model.compose.exclude.each do |exclude|\n # Remove excluded codes\n include_set.subtract(get_code_sets(exclude))\n end\n @valueset = include_set\n end",
"def calc_miss_data(misses)\n miss_data={}\n misses.each_pair do |key, key_data|\n key_result={}\n miss_data[key]=key_result\n if @default_backend\n default_data={}\n @default_backend.available_locales.each do |available_locale|\n default_value = @default_backend.lookup available_locale, key\n default_data[available_locale]= default_value if default_value\n end\n key_result[:default]=default_data unless default_data.empty?\n end\n count_data={}\n key_result[:count]=count_data\n key_data.each_pair do |locale, count|\n count_data[locale.to_sym]=count\n end\n end\n miss_data\n end",
"def parse_barcode_seq_stats(stats_filename)\n @barcodes.each {|bcinfo| bcinfo[:seq_stats] = Hash.new}\n STDERR.puts \"Reading barcode stats file #{stats_filename}\" if @verbose\n parse_barcode_stats_file(stats_filename)\n @barcodes.each do |bcinfo|\n bcinfo[:seq_stats][\"Total Reads\"] =\n bcinfo[:seq_stats][\"Post-Filter Reads\"].to_i +\n bcinfo[:seq_stats][\"Failed Reads\"].to_i\n end\n end",
"def map(hash); end",
"def __finalize__\n\t\t@__hash__.each { |k,v|\n\t\t\t@__hash__[k] = v.call if v.respond_to?(:call)\n\t\t}\n\tend",
"def build_vendors_hash(vendors_raw)\r\n\thash_map = Hash.new\r\n\r\n\tvendors_raw.each do |vendor|\r\n\t\tif(vendor['attributes']['bitsight_guid'] != nil)\r\n\t \thash_map[vendor['attributes']['bitsight_guid']] = vendor\r\n\t\tend\r\n\tend\r\n\thash_map\r\nend",
"def dump_bigram_info_from_hash()\n\n cumulative_bigram_count = 0\n\n $bigram_count.keys.sort.each do |bigram|\n local_lead_word = bigram.split(/\\s/)[0] #shouldn't need to extract this each time\n cumulative_bigram_count += $bigram_count[bigram]\n cumulative_proportion = cumulative_bigram_count.to_f / $lead_word_count[local_lead_word].to_f\n puts sprintf(\"%s\\t%f\", bigram, cumulative_proportion )\n end\n\nend",
"def build_codes_for_adjustment_reason_having_crosswalk_disabled\n codes = {}\n codes[:all_reason_codes] = get_all_reason_codes_and_descriptions\n if not @code_norc_found\n codes[:reason_codes_and_descriptions] = reason_codes_and_descriptions\n codes[:reason_code] = normalized_reason_code\n codes[:reason_code_description] = normalized_reason_code_description\n codes[:default_group_code] = default_group_code\n codes[:group_code] = group_code\n codes[:remark_codes] = normalized_remark_codes\n codes[:default_code] = default_code\n codes[:primary_reason_code_id] = primary_reason_code_id\n codes[:secondary_codes] = get_all_secondary_codes(nil, codes)\n codes[:cas_01] = get_cas01_code(codes)\n codes[:cas_02] = get_cas02_code(codes)\n codes[:secondary_cas_01] = get_secondary_cas01_code(codes)\n codes[:secondary_cas_02] = get_secondary_cas02_code(codes)\n end\n codes\n end",
"def hash\n @symbols.hash + 37*positive?.hash\n end",
"def uncached_ref_data_codes\n { user_is_current: YESNO_COMP_KEY }\n end",
"def lookuptable\n res = Hash.new\n (0..255).each do |c|\n res[c] = unscramble(c)\n end\n res\n end",
"def hash\n [api_percentage, api_usage, apm_fargate_percentage, apm_fargate_usage, apm_host_percentage, apm_host_usage, appsec_fargate_percentage, appsec_fargate_usage, appsec_percentage, appsec_usage, browser_percentage, browser_usage, container_percentage, container_usage, cspm_container_percentage, cspm_container_usage, cspm_host_percentage, cspm_host_usage, custom_timeseries_percentage, custom_timeseries_usage, cws_container_percentage, cws_container_usage, cws_host_percentage, cws_host_usage, dbm_hosts_percentage, dbm_hosts_usage, dbm_queries_percentage, dbm_queries_usage, estimated_indexed_logs_percentage, estimated_indexed_logs_usage, estimated_indexed_spans_percentage, estimated_indexed_spans_usage, estimated_ingested_logs_percentage, estimated_ingested_logs_usage, estimated_ingested_spans_percentage, estimated_ingested_spans_usage, estimated_rum_sessions_percentage, estimated_rum_sessions_usage, infra_host_percentage, infra_host_usage, lambda_functions_percentage, lambda_functions_usage, lambda_invocations_percentage, lambda_invocations_usage, npm_host_percentage, npm_host_usage, profiled_container_percentage, profiled_container_usage, profiled_hosts_percentage, profiled_hosts_usage, snmp_percentage, snmp_usage].hash\n end",
"def cached_ref_data_codes\n { lau_code: comp_key('LAU', 'SYS', 'RSTU'), title_code: comp_key('PROPERTYTITLEPREFIX', 'SYS', 'RSTU'),\n parent_title_code: comp_key('PROPERTYTITLEPREFIX', 'SYS', 'RSTU') }\n end",
"def update_code\n elements = [flexeme_type.tag.to_s]\n elements << gender.tag.to_s if gender\n elements += suffixes\n self.code = (Digest::SHA2.new << elements.join(\":\")).hexdigest[0...6]\n end",
"def output_hash; end",
"def preprocess_concept_hash(concept_hash)\n end",
"def stanza_stats(file_info_hash: fih)\n stanza1_stats = Hash.new\n stanza2_stats = Hash.new\n stanza3_stats = Hash.new\n\n # @file_info[0..5].each { |f|\n # @file_info.each { |f|\n @fih.each { |f|\n # you can call extract_keywords here instead of duplicating this code.\n # actually ..not true, since this is an aggregator\n fn = f[:name]\n # p \"stanza_stats: fn=#{fn}\"\n\n # stanzas = extract_name_info_from_fn :fn => fn\n stanzas = extract_stanzas :fn => fn\n\n # p \"#{fn}: s1=#{stanzas[0]}, s2=#{stanzas[1]}, s3=#{stanzas[2]}\"\n\n k1 = stanzas[0]\n k2 = stanzas[1] if stanzas[1]\n k3 = stanzas[2] if stanzas[2]\n # p \"k0=#{k0}\"\n # p \"k2=#{k2}\"\n if !(stanza1_stats[k1])\n stanza1_stats[k1] = 0\n end\n\n if !(stanza2_stats[k2])\n stanza2_stats[k2] = 0\n end\n\n if !(stanza3_stats[k3])\n stanza3_stats[k3] = 0\n end\n\n stanza1_stats[k1] = stanza1_stats[k1] + 1\n stanza2_stats[k2] = stanza2_stats[k2] + 1 if k2\n stanza3_stats[k3] = stanza3_stats[k3] + 1 if k3\n # stanza2_stats[stanzas[1]]++\n # stanza3_stats[stanzas[2]]++\n=begin\n=end\n\n }\n\n # p \"stanza_stats: stanza1_stats=\"\n # pp stanza1_stats\n\n # return_hash = {:stanza1_stats => stanza1_stats, :stanza1_stats => stanza2_stats, :stanza3_stats => stanza3_stats}\n # stanza1_stats\n return_hash = Hash.new\n return_hash[:s1] = stanza1_stats\n return_hash[:s2] = stanza2_stats\n return_hash[:s3] = stanza3_stats\n\n return_hash\n\n end",
"def clean_up_map map\n {\n id: map[0].to_i,\n release: map[1],\n unknown1: map[2],\n component: map[3],\n version: map[4],\n path1: map[5],\n path2: map[6],\n unknown2: map[7],\n mode: map[8],\n type: map[9].to_sym,\n unknown3: map[10]\n }\n end",
"def hash\n [apm_scanned_bytes, events_scanned_bytes, hour, logs_scanned_bytes, org_name, public_id, rum_scanned_bytes, total_scanned_bytes].hash\n end",
"def decode_to_hash(dir, f_c_weight, hash)\n file = File.open(dir, \"r\")\n\n hash = Hash.new(0) if hash == {}\n\n file.each do |line|\n follower = line[/^(.*?)\\t/, 1].to_i\n followees = line[/\\[(.*?)\\]/, 1].split(/[:,\\,]/)\n\n hash[follower] = Hash.new(0) if hash[follower] == 0\n\n # follower_hash = Hash.new(0) if\n # puts followees\n followees.each_slice(2) do |a|\n # puts a\n # puts a[0]\n # puts a[1]\n # puts \"follower: #{follower}\"\n # puts \"f_c_weight[follower] #{f_c_weight[follower]}\"\n\n hash[follower][a[0].to_i] += a[1].to_f * f_c_weight[follower]\n end\n # hash[follower] = follower_hash\n end\n file.close\n hash\n end",
"def hash\n [_403, _404, _500, _504, start_timestamp, end_timestamp, start_datetime, end_datetime, total_requests, cache_hits, cache_hit_rate, total_request_time, avg_origin_response_time, response_time_ms, _100_x, _20_x, _30_x, _40_x, _50_x, _50th, _95th, _99th].hash\n end",
"def populateHash()\n File.open(\"codes.txt\").each do |line|\n pair = line.to_s.split(' ')\n @zipCodeHash.merge!( pair[0].to_i => pair[1].to_i )\n end\nend",
"def hash\n code = 17\n code = 37 * code\n self.instance_variables.each do |v|\n code += self.instance_variable_get(v).hash\n end\n code\n end",
"def decode_strong(guess, code)\n guess.each_with_index.reduce(0) do |count, (code_peg, index)|\n if code_peg && code[index] == code_peg\n count += 1\n code[index] = nil\n guess[index] = nil\n end\n count\n end\n end",
"def calculate_frequencies(target_file)\n\tn_char=0.0\n\n\n\ttext=File.read(target_file)\n\n\t#creo l'hash delle lettere\n\thsh=Hash.new\n\tcode=97\n\twhile code<=122 do\n\t\thsh[code]=Occurrences.new(0,0.000)\n\t\tcode+=1\n\tend\n\t#conto le occorrenze delle lettere\n\ttext.each_byte {|c|\n\t\tif c>=97 and c<=122;\n\t\t\thsh[c].number+=1\n\t\t\tn_char+=1\n\t\tend\n\t}\n\t#creo le frequenze\n\thsh.each {|k, v|\n\t\tv[1]=v[0]/n_char\n\t\t#puts\"number:#{v[0]} - percentage:#{v[1]}\"\n\t}\n\t#print dei valori creati\n\t#i=0\n\t#hsh.each {|k, v| puts \"elemento #{i} ---> #{k} is #{v}\",\n\t#\ti+=1\n\t#}\n\treturn hsh;\nend",
"def hash\n code = 17\n code = 37*code + @x.hash\n code = 37*code + @y.hash\n # Add lines like this for each significant instance variable\n code # Return the resulting code\n end",
"def card_stats\n stats = {\n colors: {\n W: 0,\n U: 0,\n B: 0,\n R: 0,\n G: 0,\n C: 0,\n M: 0,\n total: 0\n },\n types: {\n creature: { count: 0, subtypes: {} },\n enchantment: { count: 0, subtypes: {} },\n instant: { count: 0, subtypes: {} },\n land: { count: 0, subtypes: {} },\n sorcery: { count: 0, subtypes: {} },\n planeswalker: { count: 0, subtypes: {} },\n artifact: { count: 0, subtypes: {} },\n },\n cmc: {\n 1 => 0,\n 2 => 0,\n 3 => 0,\n 4 => 0,\n 5 => 0,\n 6 => 0,\n },\n counts: {\n creature: 0,\n nonCreature: 0,\n land: 0,\n nonLand: 0,\n },\n rarity: {\n common: 0,\n uncommon: 0,\n rare: 0,\n mythic: 0,\n special: 0,\n bonus: 0\n },\n cards: 0,\n }\n\n cards = self.cards\n # Iterates over every card and updates stats object\n cards.each do |card|\n multiplier = card.deck_quantity(id).quantity\n\n # Increment total cards\n stats[:cards] += multiplier\n\n\n # Card types, they have been stringified so we must parse them\n card_types = card.card_types\n types = stats[:types]\n\n\n # Counts the card types\n card_types.each do |type|\n lower_type = type.downcase().to_sym\n \n if types[lower_type]\n types[lower_type][:count] += multiplier\n end\n \n \n # Counts the card subTypes\n card.subtypes&.each do |subtype|\n lower_subtype = subtype.downcase().to_sym\n\n if types[lower_type] && types[lower_type][:subtypes] && types[lower_type][:subtypes][lower_subtype]\n types[lower_type][:subtypes][lower_subtype] += multiplier\n elsif types[lower_type] && types[lower_type][:subtypes]\n types[lower_type][:subtypes][lower_subtype] = multiplier\n end\n end\n end\n\n\n # Counts multicolored cards and individual colors\n if card.color_identity.length > 1\n stats[:colors][:M] += multiplier\n end\n\n \n\n # Artifacts do not have colors, so we increment colorless\n if (card.color_identity.length === 0) \n stats[:colors][:C] += multiplier\n stats[:colors][:total] += multiplier\n end\n \n \n \n # Otherwise we update the color identity\n card.color_identity.each { |color|\n stats[:colors][color.to_sym] += multiplier\n stats[:colors][:total] += multiplier\n }\n\n\n # if the card is a land we just need to up the land count. Otherwise we set a few more counts\n if (card.card_type.include?('Basic Land')) \n stats[:counts][:land] += multiplier\n else\n stats[:counts][:nonLand] += multiplier\n\n \n # Updates counts for creatures and nonCreatures\n if card_types.include?('Creature')\n stats[:counts][:creature] += multiplier\n else\n stats[:counts][:nonCreature] += multiplier\n end\n\n # Gets converted mana cost counts\n card_cmc = card.converted_mana_cost\n \n # Increments 1 mana for 1 or 0 cmc\n if (card_cmc <= 1) \n stats[:cmc][1] += multiplier\n \n # Increments 6 mana for 6 or more cmc\n elsif (card_cmc >= 6) \n stats[:cmc][6] += multiplier\n \n # Otherwise we increment what's in-between as long as it's not a land\n else\n stats[:cmc][card_cmc.to_i] += multiplier\n end\n \n # counts card rarity, doesn't include basic lands\n stats[:rarity][card.rarity.to_sym] += multiplier\n end\n\n\n end\n\n stats\n end",
"def build_code(tree, ch_arr, invert)\n\tcode_table = Hash.new\n\tif(invert == 0)\n\t\tch_arr.each { |key, value|\n\t\t\tcode = encode(tree, key)\n\t\t\tcode_table[key] = code\n\t\t}\n\telsif(invert==1)\n\t\tch_arr.each { |key, value|\n\t\t\tcode = encode(tree, key)\n\t\t\tcode_table[code] = key\n\t\t}\n\tend\n\treturn code_table\nend",
"def _reduce_263(val, _values, result); end",
"def _reduce_263(val, _values, result); end"
] |
[
"0.55653584",
"0.5561838",
"0.5543264",
"0.5535405",
"0.54895025",
"0.5467511",
"0.53762823",
"0.53375405",
"0.53164434",
"0.5315674",
"0.5291511",
"0.5252317",
"0.52290654",
"0.52205414",
"0.5196489",
"0.5189786",
"0.51835316",
"0.5161801",
"0.5158579",
"0.5117099",
"0.5111543",
"0.51068366",
"0.51051664",
"0.5088932",
"0.50766265",
"0.50681907",
"0.50547695",
"0.50320864",
"0.5019677",
"0.50114506",
"0.50111914",
"0.5004812",
"0.50031334",
"0.4990038",
"0.49893424",
"0.49712119",
"0.4970175",
"0.4963856",
"0.49597874",
"0.4959561",
"0.49575198",
"0.49451146",
"0.49299482",
"0.4929659",
"0.49275512",
"0.4925356",
"0.4907586",
"0.49037",
"0.48927784",
"0.48849198",
"0.48825344",
"0.4880504",
"0.48786962",
"0.48752683",
"0.48687148",
"0.48598865",
"0.48465446",
"0.48438808",
"0.48377633",
"0.4827977",
"0.48269817",
"0.48226112",
"0.4818892",
"0.48186755",
"0.48166463",
"0.48100945",
"0.48071575",
"0.4806545",
"0.48034838",
"0.48030293",
"0.47981545",
"0.47967017",
"0.4783959",
"0.4781016",
"0.47806108",
"0.47797975",
"0.477964",
"0.4772259",
"0.47715765",
"0.47715455",
"0.47677258",
"0.47676268",
"0.4765011",
"0.4761397",
"0.47605598",
"0.47598028",
"0.47583798",
"0.4755908",
"0.47507906",
"0.4749858",
"0.4742065",
"0.47404608",
"0.47387373",
"0.47334814",
"0.47294632",
"0.47211638",
"0.47197983",
"0.47197244",
"0.47179362",
"0.47179362"
] |
0.7689453
|
0
|
normalize_coding_system attempts to simplify analysis of the XML doc by normalizing the names of the coding systems Input is a single "Code" node in the tree, and the side effect is to edit the CodingSystem subnode.
|
def normalize_coding_system(code)
lookup = {
"lnc" => "LOINC",
"loinc" => "LOINC",
"cpt" => "CPT",
"cpt-4" => "CPT",
"snomedct" => "SNOMEDCT",
"snomed-ct" => "SNOMEDCT",
"rxnorm" => "Rxnorm",
"icd9-cm" => "ICD9",
"icd9" => "ICD9"
}
codingsystem = lookup[code.xpath('./CodingSystem')[0].content.downcase]
if(codingsystem)
code.xpath('./CodingSystem')[0].content = codingsystem
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def normalize_coding_system(code)\n lookup = {\n \"lnc\" => \"LOINC\",\n \"loinc\" => \"LOINC\",\n \"cpt\" => \"CPT\",\n \"cpt-4\" => \"CPT\",\n \"snomedct\" => \"SNOMED-CT\",\n \"snomed-ct\" => \"SNOMED-CT\",\n \"rxnorm\" => \"RxNorm\",\n \"icd9-cm\" => \"ICD-9-CM\",\n \"icd9\" => \"ICD-9-CM\",\n \"icd10-cm\" => \"ICD-9-CM\",\n \"icd10\" => \"ICD-9-CM\",\n \"cvx\" => \"CVX\",\n \"hcpcs\" => \"HCPCS\"\n\n }\n codingsystem = lookup[code.xpath('./ccr:CodingSystem')[0].content.downcase]\n if(codingsystem)\n code.xpath('./ccr:CodingSystem')[0].content = codingsystem\n end\n end",
"def normalize_coding_system(code)\n lookup = {\n \"lnc\" => \"LOINC\",\n \"loinc\" => \"LOINC\",\n \"cpt\" => \"CPT\",\n \"cpt-4\" => \"CPT\",\n \"snomedct\" => \"SNOMEDCT\",\n \"snomed-ct\" => \"SNOMEDCT\",\n \"rxnorm\" => \"RxNorm\",\n \"icd9-cm\" => \"ICD-9-CM\",\n \"icd9\" => \"ICD-9-CM\"\n }\n codingsystem = lookup[code.at_xpath('./ccr:CodingSystem').content.downcase]\n if(codingsystem)\n code.at_xpath('./ccr:CodingSystem').content = codingsystem\n end\n end",
"def normalize(code); end",
"def unnormalize(code)\n code = code.gsub(/<text:line-break\\/>/, \"\\n\")\n code = code.gsub(/<text:tab\\/>/, \"\\t\")\n code = code.gsub(/<text:s(\\/|(\\s[^>]*))>/, \" \")\n return REXML::Text.unnormalize(code)\n end",
"def process_codes(node, entry)\n codes = node.xpath(\"./ccr:Description/ccr:Code\")\n desctext = node.at_xpath(\"./ccr:Description/ccr:Text\").content\n entry.description = desctext\n if codes.size > 0 \n found_code = true\n codes.each do |code|\n normalize_coding_system(code)\n codetext = code.at_xpath(\"./ccr:CodingSystem\").content\n entry.add_code(code.at_xpath(\"./ccr:Value\").content, codetext)\n end\n end\n end",
"def process_product_codes(node, entry)\n codes = node.xpath(\"./ccr:Code\")\n if codes.size > 0\n found_code = true\n codes.each do |code|\n normalize_coding_system(code)\n codetext = code.at_xpath(\"./ccr:CodingSystem\").content\n entry.add_code(code.at_xpath(\"./ccr:Value\").content, codetext)\n end\n end\n end",
"def normalize!\n data = read\n html = Nokogiri::XML.parse(data)\n html.encoding = 'utf-8'\n\n # Process the @DOM\n standardize_dom(html)\n remove_scripts(html)\n change_hrefs(html)\n\n write(html.to_s)\n end",
"def process_product_codes(node, entry)\n codes = node.xpath(\"./ccr:Code\")\n if codes.size > 0\n found_code = true\n codes.each do |code|\n normalize_coding_system(code)\n codetext = code.at_xpath(\"./ccr:CodingSystem\").content\n entry.add_code(code.at_xpath(\"./ccr:Value\").content, codetext)\n end\n end\n end",
"def unnormalize(code)\n code = code.gsub(/<text:line-break\\/>/, \"\\n\")\n code = code.gsub(/<text:tab\\/>/, \"\\t\")\n return REXML::Text.unnormalize(code)\n end",
"def populate_codesystem_oid(entry)\n if entry.nil? || entry.is_a?(String) || entry.is_a?(BSON::ObjectId) ||\n entry.is_a?(Time) || entry.is_a?(Date) || entry.is_a?(Boolean) || entry.is_a?(Integer) || entry.is_a?(Float)\n elsif entry.is_a?(Array)\n entry.each { |elem| populate_codesystem_oid(elem) }\n elsif entry.is_a?(Hash)\n if entry['codeSystem'] || entry[:codeSystem]\n name_oid_hash = JSON.parse(File.read(File.join(File.dirname(__FILE__), 'name_oid_map.json')))\n if name_oid_hash[entry['codeSystem']].nil? && name_oid_hash[entry[:codeSystem]].nil?\n puts 'ERROR: Could Not Resolve OID For Code System ' + entry['codeSystem']\n else\n entry['system'] = name_oid_hash[entry['codeSystem']] || name_oid_hash[entry[:codeSystem]]\n # cqm codes mirror cql codes and do not include the human-readable codeSystem name\n entry.delete('codeSystem')\n end\n end\n if entry['descriptor'] || entry[:descriptor]\n entry['display'] = entry['descriptor'] || entry[:descriptor]\n entry.delete('descriptor')\n end\n entry.keys.each { |key| populate_codesystem_oid(entry[key]) }\n elsif entry.is_a?(QDM::DataElement) || entry.is_a?(QDM::Attribute)\n entry.attribute_names.each { |key| populate_codesystem_oid(entry[key]) }\n else\n puts 'WARNING: Unable To Search For Codes In ' + entry.to_s\n end\n end",
"def process_product_codes(node, entry)\n codes = node.xpath(\"./ccr:Code\")\n if codes.size > 0\n found_code = true\n codes.each do |code|\n normalize_coding_system(code)\n codetext = code.at_xpath(\"./ccr:CodingSystem\").content\n entry.add_code(code.at_xpath(\"./ccr:Value\").content, codetext)\n end\n end\n end",
"def pre_normalize(text); end",
"def remove_system_internals(text_to_process)\n code_location = File.dirname(self.code.path).gsub(\"\\\\\", '/') + '/'\n text_to_process.gsub!(\"\\\\\", '/')\n text_to_process.gsub(code_location, '')\n end",
"def normalize_mods\n if !@namespace_aware\n @mods_ng_xml.remove_namespaces!\n # xsi:schemaLocation attribute will cause problems in JRuby\n if @mods_ng_xml.root && @mods_ng_xml.root.attributes.keys.include?('schemaLocation')\n @mods_ng_xml.root.attributes['schemaLocation'].remove\n end\n # doing weird re-reading of xml for jruby, which gets confused by its own cache\n # using pedantic is helpful for debugging\n# @mods_ng_xml = Nokogiri::XML(@mods_ng_xml.to_s, nil, @mods_ng_xml.encoding, Nokogiri::XML::ParseOptions::PEDANTIC)\n @mods_ng_xml = Nokogiri::XML(@mods_ng_xml.to_s, nil, @mods_ng_xml.encoding)\n end\n @mods_ng_xml\n end",
"def normalize(name); end",
"def extract_codes(parent_element, entry)\n codes = parent_element.xpath(\"./ccr:Description/ccr:Code\")\n entry.description = \"\"\n if (parent_element.at_xpath(\"./ccr:Description/ccr:Text\") )\n entry.description = parent_element.at_xpath(\"./ccr:Description/ccr:Text\").content\n end\n if codes.size > 0 \n found_code = true\n codes.each do |code|\n normalize_coding_system(code)\n entry.add_code(code.at_xpath(\"./ccr:Value\").content, code.at_xpath(\"./ccr:CodingSystem\").content)\n end\n end\n end",
"def load_code_system(system)\n # TODO: Generalize this\n cs = FHIR::Json.from_json(File.read(CODE_SYS[system]))\n cs_set = Set.new\n load_codes = lambda do |concept|\n concept.each do |concept_code|\n cs_set.add(system: system, code: concept_code.code)\n load_codes.call(concept_code.concept) unless concept_code.concept.empty?\n end\n end\n load_codes.call(cs.concept)\n cs_set\n end",
"def cleanup! xml\n ns = { 'pre' => 'info:lc/xmlns/premis-v2' }\n \n conflicts = xml.find(\"//pre:*[starts-with(@xmlID, 'agent-')]\", ns).to_a + \n xml.find(\"//pre:*[starts-with(@xmlID, 'object-')]\", ns).to_a +\n xml.find(\"//pre:*[starts-with(@xmlID, 'event-')]\", ns).to_a +\n xml.find(\"//pre:*[starts-with(@xmlID, 'bitstream-')]\", ns).to_a +\n xml.find(\"//pre:*[starts-with(@xmlID, 'representation-')]\", ns).to_a +\n xml.find(\"//pre:*[@xmlID='DPMD1']\", ns).to_a +\n xml.find(\"//pre:*[@xmlID='PREMIS_AMD']\", ns).to_a\n \n unless conflicts.empty?\n \n # prepend all IDs with 'premis_'\n xml.find(\"//pre:*[@xmlID]\", ns).each do |c| \n c['xmlID'] = \"premis_#{c['xmlID']}\"\n end\n \n # modify corresponding IDRefs\n ['RelEventXmlID', 'RelObjectXmlID', 'LinkObjectXmlID', 'LinkEventXmlID',\n 'LinkAgentXmlID', 'LinkPermissionStatementXmlID'].each do |a|\n \n xml.find(\"//pre:*[@#{a}]\", ns).each do |node|\n new_idref = node[a].split.map { |s| \"premis_#{s}\" }\n node[a] = new_idref * ' '\n end\n\n end\n \n end\n \n xml\n end",
"def normalize(node)\n return normalize_str(node) if node.is_a?(String)\n\n html = node.dup\n\n remove_trackers! html\n remove_blacklisted_images! html\n remove_style_attrs! html\n wrap_stray_text! html\n move_stray_images! html\n\n blocks(html).each do |blk|\n if block?(blk)\n add_class blk, 'short' if blk.content.size < 50\n add_class blk, 'image' if image_paragraph?(blk)\n handle_duplicate_brs! blk\n fix_pseudo_headings! blk\n end\n end\n\n blocks(html).each do |blk|\n blk.remove if blank?(blk) # Not recursive\n end\n\n html\n end",
"def normalize\n return if @children.nil?\n old = nil\n children = @children.to_a.dup\n children.each do |child|\n if !old.nil? && old.nodeType == TEXT_NODE &&\n child.nodeType == TEXT_NODE\n old.appendData(child.nodeValue)\n self.removeChild(child)\n else\n if child.nodeType == ELEMENT_NODE\n child.normalize\n end\n old = child\n end\n end\n end",
"def normalize(input, doctype = T.unsafe(nil), entity_filter = T.unsafe(nil)); end",
"def normalize!\n begin\n create_base_directories!\n\n # Ensure all files are properly formatted\n standardize!\n\n # normalize the files\n toc.normalize!\n guide.normalize!\n manifest.normalize!\n \n clean_empty_dirs!\n\n report\n\n rescue => ex\n log \"failed to normalize\\n #{ex.to_s}\"\n raise ex\n end\n end",
"def normalize\n input.upcase\n end",
"def normalize!\n new_contents = []\n @contents.each{|c|\n if c.is_a? String\n next if c == \"\"\n if new_contents[-1].is_a? String\n new_contents[-1] += c\n next\n end\n else\n c.normalize!\n end\n new_contents.push c\n }\n @contents = new_contents\n end",
"def normalize_classification\n return nil unless parent_id?\n\n @classification_normalizer ||=\n DarwinCore::ClassificationNormalizer.new(self)\n @classification_normalizer.normalize\n end",
"def convert!\n # Fonts and headings\n semanticize_font_styles!\n semanticize_headings!\n\n # Tables\n remove_paragraphs_from_tables!\n semanticize_table_headers!\n\n # list items\n remove_paragraphs_from_list_items!\n remove_unicode_bullets_from_list_items!\n remove_whitespace_from_list_items!\n remove_numbering_from_list_items!\n end",
"def normalize\n end",
"def normalize2(text, analyzer = nil)\n\t\tEntry.normalize(text, normalizer2, analyzer)\n\tend",
"def normalize; end",
"def normalize(string); end",
"def normalize\n \tif !self.phone.nil?\n\t \tself.phone = self.phone.gsub(/[^a-z0-9]/i, '')\n\t \tif self.phone.length == 8\n\t \t\tarea_code = \"\"\n\t \t\tfirst = self.phone[0]\n\t \t\tif first == \"6\"\n\t \t\t\tarea_code = \"619\"\n\t \t\telsif first == \"8\"\n\t \t\t\tarea_code = \"858\"\n\t \t\tend\n\t \t\tself.phone = area_code + self.phone[1..-1]\n\t \t elsif self.phone.length == 10\n\t \t\t # do nothing for now\n\t \t else\n\t \t\t # do nothing for now\n\t \t end\n\t end\n end",
"def normalize!\n doc = xmldoc\n nodes doc.xpath(ITEMS_XPATH) do |node|\n content_node = node.xpath(ITEM_FILE_XPATH).first\n src = content_node.attributes['src'].to_s\n\n src = URI(src)\n item = get_item(src.to_s)\n\n filepath = URI(item.normalized_hashed_path(:relative_to => self))\n if src.fragment\n filepath.fragment = src.fragment\n end\n\n content_node['src'] = filepath.to_s\n end\n\n\n root = read_xml\n\n # Replace the node, bit messy\n node = root.xpath(ROOT_XPATH).first\n doc_partial = Nokogiri::XML(doc.to_s)\n node.replace(doc_partial.root)\n\n # Write it back\n data = root.to_s\n write(data)\n end",
"def normalize(incoming_str)\n if normalizer\n return normalizer.call(incoming_str)\n end\n\n str = incoming_str\n str = str.downcase\n str = str.gsub(/[^a-z0-9]/, \" \")\n # squish whitespace\n str = str.gsub(/\\s+/, \" \").strip\n str\n end",
"def normalize national_number, options = {}\n clean! national_number\n normalized = @codes.reduce national_number do |number, code|\n result = code.normalize number, options\n break result if result\n number\n end\n normalized\n end",
"def to_global_systemTs!\n # Force a name if not.\n self.force_name!\n # puts \"to_global_systemTs! for #{self.name}\"\n # For each local systemT\n self.scope.each_systemT.to_a.each do |systemT|\n # puts \"Processing system: #{systemT}\"\n # Rename it for globalization.\n former = systemT.name\n self.extend_name!(systemT)\n # Apply the renaming to all the inner objects.\n self.scope.replace_names_subs!(former,systemT.name)\n # Remove it.\n self.scope.delete_systemT!(systemT)\n end\n end",
"def normalize_whitespace(input); end",
"def get_all_systems(code = @code)\n return [] unless code.is_a?(Array)\n return code.reduce([]) {|ar,sub| ar + get_all_systems(sub) } +\n (code.select { |sub| is_system?(sub) }).map! do |sub|\n get_system(sub)\n end\n end",
"def normalize_locale\n return unless @locale\n alias_for = config.data.resolve_alias(locale)\n @locale = Locale.parse(alias_for) if alias_for and alias_for != locale\n \n normalized = {\n territory: territory.known? ? territory.code : nil,\n # todo: script etc\n }\n\n normalized.delete_if { |key, value| @locale[key] == value }\n reset_locale(@locale.with(**normalized)) if normalized.any?\n end",
"def tree_canonize\n @tree = tree_canonize2(@tree, \"*DOCUMENT\")\n end",
"def normalize\n return self unless @text\n return self if @normalized # TODO eliminate duplicate normalization\n\n @text = normalize_comment @text\n\n @normalized = true\n\n self\n end",
"def normalise!(tree)\n tree.each.with_index do |node, i|\n if node.is_a?(Array)\n if node.first == :loop && tree[i+1]\n key = tree[i+1][0]\n if key == :block\n tree[i+1][0] = :lblock\n elsif key == :query # wrap queries like `c.each(&:destroy)` \n tree[i+1] = [:lblock, tree[i+1]]\n end\n end\n tree[i] = normalise!(node)\n end\n end\n tree\n end",
"def normalize\n\t\t@grammar_string.each_index do |i|\n\t\t\ttemp = @grammar_string[i]\n\t\t\tif temp.empty?\n\t\t\t\t@grammar_string[i] = nil\n\t\t\telsif temp[0] == \"#\"\n\t\t\t\t#continue \n\t\t\t\tnext\n\t\t\telsif temp[0] == \"|\"\n\t\t\t\tlast = i\n\t\t\t\tbegin\n\t\t\t\t\tlast -= 1\n\t\t\t\tend while @grammar_string[last].nil?\n\n\t\t\t\t@grammar_string[last] += \" #{temp}\"\n\t\t\t\t@grammar_string[i] = nil\n\t\t\tend\n\t\tend\n\n\t\t@grammar_string.compact!\n\tend",
"def normalize_data(input)\n year = input[:year].to_i\n return input unless validate_year(input, year)\n input[:year] = year\n\n make = validate_make(input[:make])\n input[:make] = make\n\n model_array = input[:model].split\n model = model_array[0].downcase.capitalize\n input[:model] = model\n input[:trim] = model_array[1].upcase if model_array.size > 1\n\n trim = input[:trim].upcase\n trim == \"BLANK\" || trim == '' ? input[:trim] = nil : input[:trim] = trim\n input\n end",
"def preprocess(input)\n\t\tperform_substitutions(input)\n\tend",
"def sourcecode_cleanup(docxml)\n docxml.xpath(\"//sourcecode\").each do |s|\n s.children = s.children.to_xml.gsub(%r{<br/>\\n}, \"\\n\")\n .gsub(%r{\\s+(<t[ >])}, \"\\\\1\").gsub(%r{</t>\\s+}, \"</t>\")\n sourcecode_remove_markup(s)\n s.children = \"<![CDATA[#{HTMLEntities.new.decode(s\n .children.to_xml.sub(/\\A\\n+/, ''))}]]>\"\n end\n end",
"def transform(tree); end",
"def preprocess(input)\n perform_substitutions(input)\n end",
"def normalization_program\n puts normalize(prompt_and_get_input_from_user)\nend",
"def normalize!\n # Read the css\n data = read\n\n sass = css_to_sass(data)\n\n # Resolve the images in the sass to there new location\n new_sass = \"\"\n\n remove_on_condition = nil\n directive_indent = -1\n sass.each_line do |line|\n line.chomp!\n\n # Get the indent size\n indent = line.sub(/^(\\s+).*$/, \"\\\\1\").size\n\n # Remove if the last indent was a directive\n if remove_on_condition\n if indent > directive_indent\n next\n end\n end\n\n # If its a css directive remove it!\n if line =~ /^\\s+@/\n directive_indent = indent\n remove_on_condition = true\n next\n end\n\n remove_on_condition = false\n\n # Grab all the url('path') definitions\n if line =~ /url\\(.*\\)/\n # Split it up into its parts\n line.gsub!(/(url\\([\"']?)(.+?)([\"']?\\))/) do |m|\n # Array for the new rule\n new_rule = [$1, nil, $3]\n src = $2\n\n # Check its not an external url\n if src !~ /^http[s]?:\\/\\// && src && src != ''\n # Delete any anchors (just incase)\n src = src.sub(/^(.*)\\#$/, \"$1\")\n\n # Build the filename\n src_item = get_item(src)\n new_rule[1] = src_item.normalized_hashed_path(:relative_to => self)\n\n # override the original string\n m.replace new_rule.join\n end\n end\n end\n new_sass += \"%s\\n\" % line\n end\n\n sass = new_sass\n\n sass = convert_fonts(sass)\n\n # Parse SASS\n engine = Sass::Engine.new(sass)\n\n # Render CSS and add it to the string\n css = engine.render\n\n write(css)\n end",
"def pre_sanitize(html)\n html = Nokogiri::HTML.fragment(html)\n HTML_TRANSFORMS.each do |orig, new|\n html.xpath(\".//#{orig}\").each { |node| node.name = new }\n end\n html.to_html\n end",
"def normalize\n data = latest_data\n norm = File.join(data, \"normalized\")\n FileUtils.mkdir_p(norm)\n\n if File.exists?(File.join(norm, \"_normalized_\"))\n log(\"Normalized data is already present for #{data}\")\n return true\n end\n\n unless inetdata_parsers_available?\n log(\"The inetdata-parsers tools are not in the execution path, aborting normalization\")\n return false\n end\n\n %W{ nets asns orgs pocs }.each do |ftype|\n cmd = \"nice inetdata-arin-xml2json #{data}/#{ftype}.xml > #{norm}/#{ftype}.json\"\n log(\"Running #{cmd}\\n\")\n system(cmd)\n end\n\n File.open(File.join(norm, \"_normalized_\"), \"wb\") {|fd|}\n end",
"def normalizer; end",
"def assign_check(code = @code)\n system_check = false # Flag telling if the internal of a system\n # is reached.\n hdr_names = [] # The existing HDLRuby names, they cannot be\n # used as Ruby variables.\n code.each do |subcode|\n if system_check then\n # Internal of a system, do a specific check.\n assign_check_in_system(subcode,hdr_names.clone)\n system_check = false\n elsif subcode.is_a?(Array) then\n if (self.is_hdr_declare?(code,hdr_names)) then\n # New HDLRuby name, add them to the hdr names.\n hdr_names.concat(self.get_hdr_declares(code))\n end\n if self.is_system?(subcode) then\n # The current subcode is a system, the next one will\n # be its internal.\n system_check = true\n else\n # Go on cheking recursively.\n self.assign_check(subcode)\n end\n end\n end\n end",
"def clone_code_to_domain(codes)\n codes.each do |code|\n subcodes = code.codes\n hash = code.attributes\n hash[:id] = nil\n hash[:domain_id] = self.id\n new_code = CommonCode.create!(hash)\n\n subcodes.each do |subcode|\n sub_hash = subcode.attributes\n sub_hash[:id] = nil\n sub_hash[:domain_id] = self.id\n sub_hash[:parent_id] = new_code.id\n CommonCode.create!(sub_hash)\n end\n end\n end",
"def normalize!\n end",
"def normalize_path(path)\n normalized = Rex::Text.to_ascii(path).downcase\n normalized.gsub!(/[\\x00]*/, '') #delete padding\n normalized.gsub!(/\\\\x([0-9a-f]{2})/i, '') # delete hex chars\n\n normalized\n end",
"def normalize\n @epub.log \"Normalizing guide...\"\n doc = xmldoc\n\n # TODO: Handle this better\n if doc.size < 1\n return\n end\n\n normalize_paths\n to_s\n end",
"def normalize!\n self.replace self.normalize\n end",
"def sanitize_id_format_raw_xml(original_input)\n return nil if original_input.nil? || original_input.raw_content.blank?\n format_sanitizer = Stix::Stix111::SanitizerValidFormat.new(Setting.XML_PARSING_LIBRARY.to_s.to_sym)\n format_sanitizer.sanitize_xml(original_input.raw_content)\n @warnings = format_sanitizer.warnings\n if format_sanitizer.valid?\n original_input.raw_content = format_sanitizer.xml\n else\n @errors = format_sanitizer.errors\n nil\n end\n end",
"def preprocess(node)\n if node.text?\n if node.parent&.fragment? && node.blank?\n node.remove\n elsif (prev_node = node.previous)&.text?\n prev_node.content += node.content\n node.remove\n end\n elsif node.comment?\n if node.previous&.text? && node.next&.text? && node.next.content.match?(NEWLINE_BEGIN)\n content = node.previous.content.sub!(NEWLINE_END_OPTIONAL, '')\n content.empty? ? node.previous.remove : node.previous.content = content\n end\n\n node.remove\n end\n\n node.children.each do |child|\n preprocess(child)\n end\n\n if node.fragment?\n children = node.children\n root, root2 = children[0..1]\n\n if (child = children.find(&:text?))\n raise(MalformedTemplateError.new('text nodes are not allowed at root level', @name, child))\n elsif !root\n raise(MalformedTemplateError.new('a root node is required', @name))\n elsif root2\n raise(MalformedTemplateError.new(\"root node already defined on line #{root.line}\", @name, root2))\n end\n end\n end",
"def normalize(value)\n @process.call(value)\n end",
"def normalize!; end",
"def normalize_input\n self.name = name.downcase\n end",
"def process_stacks!\n stacks_by_name = contents.stacks.to_hash_by_key(:name)\n scanned = scan_unit_configs(stacks_by_name)\n stacks_by_name.each do |_, stack|\n stack_units = stack.fetch(:units, []).each_with_object({}) do |unit_config, all|\n merge_or_replace(all, unit_config, scanned)\n end\n $logger.warn \"No units defined for '%s' stack\" % stack.name if stack_units.empty?\n stack.units = stack_units\n end\n end",
"def standardized_sms_phone_number\n PhoneParser.normalize(sms_phone_number)\n end",
"def normalize1(text, analyzer = nil)\n\t\tEntry.normalize(text, normalizer1, analyzer)\n\tend",
"def normalize(slug_text)\n s = slug_text.clone\n s.gsub!(/[\\?‘’'“”\",.;:]/, '')\n s.gsub!(/\\W+/, ' ')\n s.strip!\n s.downcase!\n s.gsub!(/\\s+/, '-')\n s.gsub(/-\\Z/, '')\n end",
"def unicode_normalize!(form = :nfc)\n require 'unicode_normalize/normalize.rb' unless defined? UnicodeNormalize\n # String.send(:define_method, :unicode_normalize!, ->(form = :nfc) { replace(unicode_normalize(form)) } )\n replace(unicode_normalize(form))\n end",
"def normalize! page\n mediawiki = text page\n html = text_wikimedia_html page\n norm_mediawiki = normalize_text mediawiki, html, page\n if mediawiki != norm_mediawiki\n write! page, norm_mediawiki\n else\n pp %Q{normalize! page #{page} already normalized}\n end\n norm_mediawiki\n end",
"def normalize!\n normalize\n save\n end",
"def normalize!\n normalize\n save\n end",
"def normalize_for_source\n nil\n end",
"def update_filters_for_canonical_change\n if self.canonical_changed?\n if self.canonical?\n self.add_filter_taggings\n elsif self.merger && self.merger.canonical?\n self.filter_taggings.update_all([\"filter_id = ?\", self.merger_id])\n else\n self.remove_filter_taggings\n end\n end \n end",
"def normalize\n self.clean_extra_spaces.split.map{|w| w.size>2 ? w.capitalize : w.downcase}.join(' ')\n end",
"def normalize(namespace)\n namespace.to_s.sub(/^[\\/:\\s]*/, '').sub(/[\\/:\\s]*$/, '').gsub(/[\\/\\\\:]+/, '::')\n end",
"def code_system_lookup(params = {}, format = @default_format)\n klass = if @fhir_version == :dstu2\n FHIR::DSTU2::ValueSet\n else\n self.versioned_resource_class(:CodeSystem)\n end\n options = { resource: klass, operation: { name: :code_system_lookup } }\n options.deep_merge!(params)\n terminology_operation(options, format)\n end",
"def ol_cn_normalize(str)\n if /^[a-zA-Z]{2,3} \\d+([qQ]?)$/.match? str # the normalizer thinks \"CD 104\" is valid LC\n accession_number(str)\n else\n Lcsort.normalize(str.gsub(/x([A-Z])/, '\\1')) || accession_number(str)\n end\n end",
"def transform_tree(tree, scope_stack)\n if Symbol === tree[0]\n case tree[0]\n when :assign, :massign\n lhs, rhs = tree[1..2]\n begin\n add_variables_from_node(lhs, scope_stack)\n rescue SyntaxError => err\n wrap_node_with_error(tree)\n else\n transform_tree(rhs, scope_stack)\n end\n when :for\n vars, iterated, body = tree[1..3]\n add_variables_from_node(vars, scope_stack)\n transform_tree(iterated, scope_stack)\n transform_tree(body, scope_stack)\n when :var_ref\n # When we reach a :var_ref, we should know everything we need to know\n # in order to tell if it should be transformed into a :vcall.\n if tree[1][0] == :@ident && !scope_stack.has_variable?(tree[1][1])\n tree[0] = :vcall\n end\n when :class\n name, superclass, body = tree[1..3]\n if name[1][0] == :class_name_error || scope_stack.in_method?\n wrap_node_with_error(tree)\n else\n transform_tree(superclass, scope_stack) if superclass # superclass node\n scope_stack.with_closed_scope do\n transform_tree(body, scope_stack)\n end\n end\n when :module\n name, body = tree[1..2]\n if name[1][0] == :class_name_error || scope_stack.in_method?\n wrap_node_with_error(tree)\n else\n scope_stack.with_closed_scope do\n transform_tree(body, scope_stack) # body\n end\n end\n when :sclass\n singleton, body = tree[1..2]\n transform_tree(singleton, scope_stack)\n scope_stack.with_closed_scope do\n transform_tree(body, scope_stack)\n end\n when :def\n scope_stack.with_closed_scope(true) do\n param_node = tree[2]\n body = tree[3]\n transform_params_then_body(tree, param_node, body, scope_stack)\n end\n when :defs\n transform_tree(tree[1], scope_stack) # singleton could be a method call!\n scope_stack.with_closed_scope(true) do\n param_node = tree[4]\n body = tree[5]\n transform_params_then_body(tree, param_node, body, scope_stack)\n end\n when :lambda\n param_node, body = tree[1..2]\n scope_stack.with_open_scope do\n transform_params_then_body(tree, param_node, body, scope_stack)\n end\n when :rescue\n list, name, body = tree[1..3]\n transform_tree(list, scope_stack) if list\n # Don't forget the rescue argument!\n if name\n add_variables_from_node(name, scope_stack)\n end\n transform_tree(body, scope_stack)\n when :method_add_block\n call, block = tree[1..2]\n # first transform the call\n transform_tree(call, scope_stack)\n # then transform the block\n param_node, body = block[1..2]\n scope_stack.with_open_scope do\n begin\n if param_node\n transform_params(param_node[1], scope_stack)\n if param_node[2]\n add_variable_list(param_node[2], scope_stack, false)\n end\n end\n rescue SyntaxError\n wrap_node_with_error(tree)\n else\n transform_tree(body, scope_stack)\n end\n end\n when :binary\n # must check for named groups in a literal match. wowzerz.\n lhs, op, rhs = tree[1..3]\n if op == :=~\n if lhs[0] == :regexp_literal\n add_locals_from_regexp(lhs, scope_stack)\n transform_tree(rhs, scope_stack)\n elsif lhs[0] == :paren && !lhs[1].empty? && lhs[1] != [[:void_stmt]] && lhs[1].last[0] == :regexp_literal\n lhs[1][0..-2].each { |node| transform_tree(node, scope_stack) }\n add_locals_from_regexp(lhs[1].last, scope_stack)\n transform_tree(rhs, scope_stack)\n else\n transform_in_order(tree, scope_stack)\n end\n else\n transform_in_order(tree, scope_stack)\n end\n when :if_mod, :unless_mod, :while_mod, :until_mod, :rescue_mod\n # The AST is the reverse of the parse order for these nodes.\n transform_tree(tree[2], scope_stack)\n transform_tree(tree[1], scope_stack)\n when :alias_error, :assign_error # error already top-level! wrap it again.\n wrap_node_with_error(tree)\n else\n transform_in_order(tree, scope_stack)\n end\n else\n transform_in_order(tree, scope_stack)\n end\n end",
"def normalize_xmlliteral(contents, options = {})\n options[:namespaces] ||= {}\n\n begin\n # Only normalize if Nokogiri is included\n require 'nokogiri' unless defined?(Nokogiri)\n rescue LoadError => e\n contents.to_s # No normalization\n end\n \n if contents.is_a?(String)\n ns_hash = {}\n options[:namespaces].each_pair do |prefix, uri|\n attr = prefix.to_s.empty? ? \"xmlns\" : \"xmlns:#{prefix}\"\n ns_hash[attr] = uri.to_s\n end\n ns_strs = []\n ns_hash.each_pair {|a, u| ns_strs << \"#{a}=\\\"#{u}\\\"\"}\n\n # Add inherited namespaces to created root element so that they're inherited to sub-elements\n contents = Nokogiri::XML::Document.parse(\"<foo #{ns_strs.join(\" \")}>#{contents}</foo>\").root.children\n end\n\n # Add already mapped namespaces and language\n contents.map do |c|\n if c.is_a?(Nokogiri::XML::Element)\n c = Nokogiri::XML.parse(c.dup.to_xml(:save_with => Nokogiri::XML::Node::SaveOptions::NO_EMPTY_TAGS)).root\n # Gather namespaces from self and decendant nodes\n c.traverse do |n|\n ns = n.namespace\n next unless ns\n prefix = ns.prefix ? \"xmlns:#{ns.prefix}\" : \"xmlns\"\n c[prefix] = ns.href.to_s unless c.namespaces[prefix]\n end\n \n # Add lanuage\n if options[:language] && c[\"lang\"].to_s.empty?\n c[\"xml:lang\"] = options[:language]\n end\n end\n c.to_xml(:save_with => Nokogiri::XML::Node::SaveOptions::NO_EMPTY_TAGS)\n end.join(\"\")\n end",
"def format_code(localeCode = BaseRec::LOCALE_EN, hierarchy_codes = nil, tree_code_format = nil, subject_code = nil, grade_band_code = nil)\n hierarchy_codes = tree_type.hierarchy_codes.split(\",\") if !hierarchy_codes\n tree_code_format = tree_type.tree_code_format if !tree_code_format\n subject_code = subject.get_abbr(localeCode).downcase if !subject_code\n grade_band_code = grade_band.code if !grade_band_code\n if tree_code_format != \"\"\n format_str = tree_code_format\n else\n format_str = \"subject,#{hierarchy_codes}\"\n end\n format_arr = []\n hierarchic_arr = code.split('.').map {|c| c == \"\" ? \"00\" : c }\n format_str.split(\",\").each do |c|\n if c == \"subject\"\n format_arr << subject_code\n elsif c == \"grade\"\n format_arr << grade_band_code\n else\n c_index = hierarchy_codes.index(c)\n format_arr << hierarchic_arr[c_index] if hierarchic_arr[c_index]\n end\n end\n\n return format_arr.join(\".\")\n end",
"def process_code(text)\n begin\n results = text.clone\n # processing code function\n text.scan(/\\${i2x.code\\((.*?)\\)}/).each { |k|\n k.each { |m|\n puts \"\\n\\tProcessing: #{m}\"\n results[\"${i2x.code(#{m})}\"] = eval(m.to_s).to_s\n }\n } if text.include? 'i2x.code'\n rescue Exception => e\n Services::Slog.exception e\n end\n results\n end",
"def normalized\n @original.downcase\n end",
"def standardize\n strip_and_squeeze.\n ampersands_into_text.\n into_ampersand_if_second_to_last.\n remove_indian_languages.\n remove_screening_details.\n replace_non_film_prefix.\n remove_newlines.\n remove_dates.\n title_case\n to_s\n end",
"def normalize(domain); end",
"def norm\n [outcode, incode].compact.join(\" \")\n end",
"def codes=(codes)\n raise TypeError, 'codes must respond to :to_a' unless !codes.nil? && codes.respond_to?(:to_a)\n raise TypeError, 'codes children must all respond to :to_s' unless codes.all? { |code| !code.nil? && code.respond_to?(:to_s) }\n codes.collect! { |code| code.to_s }\n raise CodeParseError, 'codes children' unless codes.all? { |code| code =~ CODE_REGEXP }\n @code ||= codes.first\n \n @codes = codes\n end",
"def normalize\n self.dup.normalize!()\n end",
"def normalize(str) return str end",
"def normalized_words\n self.split(/\\s+/).map { |word|\n Iconv.iconv('ascii//translit//ignore', 'utf-8', word).first.downcase.gsub(/\\W/,'')\n }.\n delete_if(&:empty?).\n map { |word|\n \"**#{word}\"\n }\n end",
"def normalize\n\t\t\tself.dup.normalize!\n\t\tend",
"def filter_code_set(system, filter = nil, _version = nil)\n filter_clause = lambda do |filter|\n where = +''\n if filter.op == 'in'\n col = filter.property\n vals = filter.value.split(',')\n where << \"( #{col} = '#{vals[0]}'\"\n # Remove the first element after we've used it\n vals.shift\n vals.each do |val|\n where << \" OR #{col} = '#{val}' \"\n end\n where << ')'\n elsif filter.op == '='\n col = filter.property\n where << \"#{col} = '#{filter.value}'\"\n else\n puts \"Cannot handle filter operation: #{filter.op}\"\n end\n where\n end\n\n filtered_set = Set.new\n if CODE_SYS.include? system\n puts \" loading #{system} codes...\"\n return load_code_system(system)\n end\n raise \"Can't handle #{filter&.op} on #{system}\" unless ['=', 'in', 'is-a', nil].include? filter&.op\n raise UnknownCodeSystemException, system if SAB[system].nil?\n\n if filter.nil?\n @db.execute(\"SELECT code FROM mrconso WHERE SAB = '#{SAB[system]}'\") do |row|\n filtered_set.add(system: system, code: row[0])\n end\n elsif ['=', 'in', nil].include? filter&.op\n if FILTER_PROP[filter.property]\n @db.execute(\"SELECT code FROM mrsat WHERE ATN = '#{filter_prop_or_self(filter.property)}' AND ATV = '#{filter_prop_or_self(filter.value)}'\") do |row|\n filtered_set.add(system: system, code: row[0])\n end\n else\n @db.execute(\"SELECT code FROM mrconso WHERE SAB = '#{SAB[system]}' AND #{filter_clause.call(filter)}\") do |row|\n filtered_set.add(system: system, code: row[0])\n end\n end\n elsif filter&.op == 'is-a'\n filtered_set = filter_is_a(system, filter)\n end\n filtered_set\n end",
"def canonicalize\n # This is the opportunity to use exclusive canonicalization library\n self\n end",
"def post_process_kramdown_tree!(kramdown_tree)\n # override this to post process elements in the kramdown tree\n # NOTE: It's important to call the methods below for correct results.\n # You have two options:\n # 1. call super if you override this method\n # 2. copy the methods below into your own method if you need different sequence\n recursively_process_temp_em_class!(kramdown_tree, 'tmpNoBold')\n recursively_process_temp_em_class!(kramdown_tree, 'tmpNoItalics')\n recursively_merge_adjacent_elements!(kramdown_tree)\n recursively_clean_up_nested_ems!(kramdown_tree) # has to be called after process_temp_em_class\n recursively_push_out_whitespace!(kramdown_tree)\n # needs to run after whitespace has been pushed out so that we won't\n # have a leading \\t inside an :em that is the first child in a para.\n # After whitespace is pushed out, the \\t will be a direct :text child\n # of :p and first char will be easy to detect.\n recursively_sanitize_whitespace_during_import!(kramdown_tree)\n # merge again since we may have new identical siblings after all the\n # other processing.\n recursively_merge_adjacent_elements!(kramdown_tree)\n recursively_clean_up_tree!(kramdown_tree)\n # Run this again since we may have new locations with leading or trailing whitespace\n recursively_sanitize_whitespace_during_import!(kramdown_tree)\n # merge again since we may have new identical siblings after cleaning up the tree\n # e.g. an italic span with whitespace only between two text nodes was removed.\n recursively_merge_adjacent_elements!(kramdown_tree)\n end",
"def normalize\n self.strip_accents.upcase.gsub(/[']+/, '').gsub(/[^A-Z0-9\\s]+/, ' ').gsub(/\\s+/, ' ').strip.to_s\n end",
"def normalize_paths\n new_sass = \"\"\n sass.each_line do |line|\n line = SassLine.new(@epub, self, line)\n line.normalize_paths if line.has_path?\n new_sass += \"#{line.to_s}\\n\"\n end\n\n self.sass = new_sass\n end",
"def normalize(text) #:nodoc:\n normalized_text = text.to_s.downcase\n normalized_text = Numerizer.numerize(normalized_text)\n normalized_text.gsub!(/['\"\\.]/, '')\n normalized_text.gsub!(/([\\/\\-\\,\\@])/) { ' ' + $1 + ' ' }\n normalized_text.gsub!(/\\btoday\\b/, 'this day')\n normalized_text.gsub!(/\\btomm?orr?ow\\b/, 'next day')\n normalized_text.gsub!(/\\byesterday\\b/, 'last day')\n normalized_text.gsub!(/\\bnoon\\b/, '12:00')\n normalized_text.gsub!(/\\bmidnight\\b/, '24:00')\n normalized_text.gsub!(/\\bbefore now\\b/, 'past')\n normalized_text.gsub!(/\\bnow\\b/, 'this second')\n normalized_text.gsub!(/\\b(ago|before)\\b/, 'past')\n normalized_text.gsub!(/\\bthis past\\b/, 'last')\n normalized_text.gsub!(/\\bthis last\\b/, 'last')\n normalized_text.gsub!(/\\b(?:in|during) the (morning)\\b/, '\\1')\n normalized_text.gsub!(/\\b(?:in the|during the|at) (afternoon|evening|night)\\b/, '\\1')\n normalized_text.gsub!(/\\btonight\\b/, 'this night')\n normalized_text.gsub!(/(?=\\w)([ap]m|oclock)\\b/, ' \\1')\n normalized_text.gsub!(/\\b(hence|after|from)\\b/, 'future')\n normalized_text = numericize_ordinals(normalized_text)\n end",
"def normalize(str) return str.upcase end",
"def normalize_token(token)\n\n if token[:type] == :EmptyTag\n # When a solidus (/) is encountered within a tag name what happens\n # depends on whether the current tag name matches that of a void\n # element. If it matches a void element atheists did the wrong\n # thing and if it doesn't it's wrong for everyone.\n\n unless VOID_ELEMENTS.include?(token[:name])\n parse_error(\"incorrectly-placed-solidus\")\n end\n\n token[:type] = :StartTag\n end\n\n if token[:type] == :StartTag\n token[:name] = token[:name].downcase\n\n # We need to remove the duplicate attributes and convert attributes\n # to a dict so that [[\"x\", \"y\"], [\"x\", \"z\"]] becomes {\"x\": \"y\"}\n\n unless token[:data].empty?\n data = token[:data].reverse.map {|attr, value| [attr.downcase, value] }\n token[:data] = Hash[*data.flatten]\n end\n\n elsif token[:type] == :EndTag\n parse_error(\"attributes-in-end-tag\") unless token[:data].empty?\n token[:name] = token[:name].downcase\n end\n\n token\n end",
"def normalized_scheme\n scheme.strip.downcase if scheme\n end",
"def normalize(name)\n name.to_s.gsub('-', '_')\n end"
] |
[
"0.8122562",
"0.8055236",
"0.57877356",
"0.56129503",
"0.55055535",
"0.526807",
"0.5252389",
"0.52132136",
"0.5210268",
"0.52040267",
"0.51133806",
"0.5072879",
"0.5031887",
"0.4955023",
"0.490896",
"0.48868224",
"0.48181015",
"0.4808359",
"0.4806806",
"0.47753274",
"0.47626838",
"0.47611958",
"0.47441864",
"0.4728592",
"0.47007078",
"0.46913838",
"0.46824583",
"0.46762753",
"0.466851",
"0.46624443",
"0.46604994",
"0.45902494",
"0.4575507",
"0.45736122",
"0.4567617",
"0.45649105",
"0.455784",
"0.45315984",
"0.45220625",
"0.45186573",
"0.45126954",
"0.45059618",
"0.44938993",
"0.44914874",
"0.447713",
"0.446753",
"0.4454626",
"0.443085",
"0.44294396",
"0.44278622",
"0.44251284",
"0.44195324",
"0.44177917",
"0.44130486",
"0.4411865",
"0.43992534",
"0.43808514",
"0.43782878",
"0.43780017",
"0.43720278",
"0.43708384",
"0.43686265",
"0.4366637",
"0.43656445",
"0.43606836",
"0.4340351",
"0.43329358",
"0.43245965",
"0.432116",
"0.43132153",
"0.43132153",
"0.4311316",
"0.43084982",
"0.43080938",
"0.42989936",
"0.42977643",
"0.42866167",
"0.42798713",
"0.42680958",
"0.42656332",
"0.42602685",
"0.42514944",
"0.42499274",
"0.42460948",
"0.42421448",
"0.4240629",
"0.42395675",
"0.4238876",
"0.42375273",
"0.42347336",
"0.4233713",
"0.42275912",
"0.4221467",
"0.42046437",
"0.42010814",
"0.42001086",
"0.41962326",
"0.41943112",
"0.4193866",
"0.41812482"
] |
0.8026242
|
2
|
Get Ship The user is prompted about the type of ship they want to pilot The user then names their ship and is given a rundown of it
|
def get_ship(ship_class_arg = nil, ship_name_arg=nil)
unless ship_class_arg && ship_name_arg
printf "FIRST MATE: Captain #{self.name}, what kind of ship is this?\n"
while self.ship == nil
printf "-- Please choose a class of ship from the following options.\n"
puts "| " + Ship.subclasses.join(' | ') + " |"
ship_class = gets.chomp
#Ruby will throw a NameError if we try to call const_get on a bad string
begin
#We still need to check that the name is indeed a type of ship
if Ship.subclasses.include? Object.const_get(ship_class)
self.ship = Object.const_get(ship_class).new
self.ship.captain = self
else
puts "-- Sorry, that class of ship was not found."
end
rescue NameError
puts "-- Sorry, that class of ship was not found."
end
end
#Get the name of the ship
self.ship.get_name
self.ship.report_status
else
self.ship = Object.const_get(ship_class_arg).new
self.ship.captain = self
self.ship.name = ship_name_arg
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def get_input_to_place(ship)\n\t\tputs \"\"\n\t\tputs \"Place your #{ship.name} (length: #{ship.length})...\"\n\t\tx, y = get_coordinate\n\t\tdirection = get_direction\n\t\treturn [{x: x, y: y}, direction]\n\tend",
"def get_ship_by_ship_id(ship_id_user)\n return UserShip.find_by(:ship_id => ship_id_user).ship\n end",
"def user_placement_selection(ship)\n \"Enter the squares for the #{ship.name} (#{ship.length} spaces):\\n> \"\n end",
"def show\n @ship = Ship.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @ship }\n end\n end",
"def ship; end",
"def set_ship\n @ship = Ship.find(params[:id])\n end",
"def set_ship\n @ship = Ship.find(params[:id])\n end",
"def find_ship(x, y, ships)\n\t\t_has_ship = false\n\t\tships.each do |ship|\n\t\t\t_has_ship = ship.is_at(x, y)\n\n\t\t\tif (_has_ship) \n\t\t\t\treturn ship\n\t\t\tend\n\t\tend\n\n\t\tnil\t\t\n\tend",
"def show\n @ship = Ship.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @ship }\n end\n end",
"def show\n puts @fleet.id\n @ship_hash = @fleet.get_ships\n end",
"def set_ship(ship)\n loop do\n print \"Introduce the initial coordinate of your #{ship.name} ship - x, y: \".blue\n coordinate = $stdin.gets.chomp.split(\",\").map(&:to_i)\n break if valid_coord?(find_cell(coordinate), ship)\n end\n end",
"def show\n @ship = Ship.find(params[:id])\n\n respond_to do |format|\n format.html { render layout: 'dialog'} # show.html.erb\n format.json { render json: @ship }\n end\n end",
"def refuel_ship()\n self.class.select(\"REFUEL_SHIP(#{self.id})\").where(:id => self.id).first\n end",
"def show\n @job_ship = JobShip.find(params[:id])\n end",
"def show\n @ship = Ship.find(params[:id])\n \n @ordereditems = ShipItem.find(:all, :conditions => {:ship_id => \"#{@ship.id}\"}, :joins => :item, :order => \"slot\")\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @ship }\n end\n end",
"def show\n @ship_methods = ShipMethods.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @ship_methods }\n end\n end",
"def request_shipping(ship_timestamp, dropoff_type, service_type, packaging_type, shipper_contact, shipper_address, \n recipient_contact, recipient_address, payor_country_code, package_line_items, options={})\n options = @options.update(options)\n shipping_request = build_shipping_request(ship_timestamp, dropoff_type, service_type, packaging_type, shipper_contact, shipper_address, \n recipient_contact, recipient_address, payor_country_code, package_line_items, options)\n log(:request_shipping, shipping_request)\n response = commit(save_request(shipping_request), (options[:test] || false))\n log(:request_shipping, response)\n response = response.gsub(/\\sxmlns(:|=)[^>]*/, '').gsub(/<(\\/)?[^<]*?\\:(.*?)>/, '<\\1\\2>')\n parse_shipping_response(response, options)\n end",
"def retrieval\n shipping_manifest = shipping_manifest = {\"whale bone corsets\" => 5,\"porcelain vases\" => 2,\"oil paintings\" => 3}\n return shipping_manifest[\"oil paintings\"]\nend",
"def new\n \n @ship = Ship.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @ship }\n end\n end",
"def show\n @ship_class = ShipClass.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @ship_class }\n end\n end",
"def set_fleet_ship\n @fleet_ship = FleetShip.find(params[:id])\n end",
"def ship_list\n \"The Cruiser is three units long and the Submarine is two units long.\"\n end",
"def shipper\n @shipper ||= SimpleShipping::Party.new(\n :address => shipper_address,\n :contact => shipper_contact,\n :account_number => options[:account_number]\n )\n end",
"def set_shipfleet\n @shipfleet = Shipfleet.find(params[:id])\n end",
"def ship\n load_info\n @shipment = Shipment.includes({:order_items => :variant}).find(params[:id])\n\n respond_to do |format|\n if @shipment.ship!\n format.html { redirect_to(admin_fulfillment_shipment_path(@shipment, :order_id => @shipment.order.number), :notice => 'Shipment was successfully updated.') }\n else\n format.html { redirect_to(admin_fulfillment_shipment_path(@shipment, :order_id => @shipment.order.number), :error => 'Shipment could not be shipped!!!') }\n end\n end\n end",
"def ship\n load_info\n @shipment = Shipment.includes({:order_items => :variant}).find(params[:id])\n\n respond_to do |format|\n if @shipment.ship!\n format.html { redirect_to(admin_fulfillment_shipment_path(@shipment, :order_id => @shipment.order.number), :notice => 'Shipment was successfully updated.') }\n else\n format.html { redirect_to(admin_fulfillment_shipment_path(@shipment, :order_id => @shipment.order.number), :error => 'Shipment could not be shipped!!!') }\n end\n end\n end",
"def update\n respond_to do |format|\n if @ship.update(ship_params)\n format.html { redirect_to @ship, notice: 'Ship was successfully updated.' }\n format.json { render :show, status: :ok, location: @ship }\n else\n format.html { render :edit }\n format.json { render json: @ship.errors, status: :unprocessable_entity }\n end\n end\n end",
"def set_player_ship\n @player_ship = PlayerShip.find(params[:id])\n end",
"def ship_name(group)\n\t\tgroup.ship.name \n\tend",
"def show\n @spaceship = Spaceship.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @spaceship }\n end\n end",
"def load_spaceship\n @Spaceship = Spaceship.find(params[:id])\n end",
"def set_shiping\n @shiping = Shiping.find(params[:id])\n end",
"def airline\n @shipping ||= Shipping.includes(reviews: :user).find_by(slug: params[:slug])\n end",
"def get_ship_coords_automatically\n @fleet.each do |ship|\n # fetch coords for this ship automatically, given fleet and board\n # no return needed, as ship is an object which is updated by ShipCoords\n ShipCoords.new(ship:ship, fleet:@fleet, board:@board)\n @board.save_ship_to_board(ship)\n ship_count = 0\n if @autogenerated == true && ship_count == 4\n $message << \"Here is how your ships are placed. [Enter] to continue. \" unless\n $testing == true # see comment in settings.rb\n @board.show_board_and_get_input unless $testing == true\n end\n ship_count += 1\n end # of this ship\n end",
"def set_ship_weapon\n @ship_weapon = ShipWeapon.find(params[:id])\n end",
"def shipment\n @shipment ||= shipments.first\n end",
"def retrieval\n shipping_manifest = {\"whale bone corsets\" => 5, \"porcelain vases\" => 2, \"oil paintings\" => 3}\n shipping_manifest[\"oil paintings\"]\nend",
"def ship_params\n params.require(:ship).permit(:name, :ships_id, :stations_id, :level, :activeShip)\n end",
"def set_ship_fitting\n @ship_fitting = ShipFitting.find(params[:id])\n end",
"def get_user_by_ship_id(ship_id_user)\n return UserShip.find_by(:ship_id => ship_id_user).user\n end",
"def create\n @ship = Ship.new(params[:ship])\n respond_to do |format|\n if @ship.save\n format.html { redirect_to @ship, notice: 'Ship was successfully created.' }\n format.json { render json: @ship, status: :created, location: @ship }\n else\n format.html { render action: \"new\" }\n format.json { render json: @ship.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n @ship = Ship.new\n \n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @ship }\n end\n end",
"def new\n @ship = Ship.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @ship }\n end\n end",
"def ship\n raise NotAllowed unless submitted?\n raise NotAllowed if shipped?\n\n apply(Orders::OrderShipped.strict(data: {\n order_uuid: @uuid,\n order_number: @number\n }))\n end",
"def show\n @ship = Ship.find(params[:id])\n @weapon = WeaponCard.find_by_ship_id(params[:id])\n @weapon_card = WeaponCard.new\n weapon_names = Weapon.all\n @weapon_names = {}\n weapon_names.each do |name|\n @weapon_names[name.name] = name.id\n end\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @ship }\n format.js\n end\n end",
"def shipping\n @data[:shipping]\n end",
"def ship\n count = 0\n if things_to_ship = params[:to_be_shipped]\n count = do_shipping(things_to_ship)\n if count > 0\n count_text = pluralize(count, \"order\")\n flash.now[:notice] = \"#{count_text} marked as shipped\"\n end\n end\n @pending_orders = Order.pending_shipping\n end",
"def create\n \n @ship = current_user.create_ship(ship_params)\n \n\n respond_to do |format|\n if @ship!=nil\n current_user.activeShip = @ship.id\n if @ship.save\n format.html { redirect_to @ship, notice: 'Ship was successfully created.' }\n format.json { render :show, status: :created, location: @ship }\n else\n format.html { render :new }\n format.json { render json: @ship.errors, status: :unprocessable_entity }\n end\n else\n format.html { redirect_to ships_path, notice: 'Kauf nicht erfolgreich!' }\n \n end\n end\n end",
"def cli_planet_details (solar_system)\n print\"Enter a planet name: \"\n planet_name = gets.chomp # ask them for the name of the planet they wish to learn about\n planet = solar_system.find_planet_by_name(planet_name)\n if planet.nil?\n puts \"This planet isn't in our system, if you want to add you it, chooe the option 3 below!\"\n else\n puts planet.summary\n end\nend",
"def initialize(name, ship_type, pilot_limit)\n @name = name\n @ship_type = ship_type\n @pilot_limit = pilot_limit\n @pilot_list = []\n end",
"def retrieval\n shipping_manifest = { \"whale bone corsets\" => 5, \"porcelain vases\" => 2, \"oil paintings\" => 3 }\n\n shipping_manifest[\"oil paintings\"]\nend",
"def shipment\n @shipment ||= shipments.last\n end",
"def shipment\n @shipment ||= shipments.last\n end",
"def show\n @clientship = current_user.clientships.find(params[:id]) \n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @clientship }\n end\n end",
"def place_ships\n place_carrier\n place_battleship\n place_destroyer\n place_submarines\n place_patrol_boats\n end",
"def docked_ship(ship_id)\n @docked_ships[ship_id]\n end",
"def update\n @ship = Ship.find(params[:id])\n\n respond_to do |format|\n if @ship.update_attributes(params[:ship])\n format.html { redirect_to @ship, notice: 'Ship was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @ship.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @ship = Ship.new(params[:ship])\n\n respond_to do |format|\n if @ship.save\n flash[:notice] = 'Ship was successfully created.'\n format.html { redirect_to(@ship) }\n format.xml { render :xml => @ship, :status => :created, :location => @ship }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @ship.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def ship\n if @reservation.update(ship_params) && @reservation.ship\n redirect_to reservations_path, notice: \"Reservation shipped.\"\n else\n render :mark_shipped, alert: @reservation.errors\n end\n end",
"def search_for_shipment(shipment)\n reset.click\n name.set shipment\n apply.click\n end",
"def update\n @ship = Ship.find(params[:id])\n\n respond_to do |format|\n if @ship.update_attributes(params[:ship])\n format.html { redirect_to @ship, notice: 'Ship was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @ship.errors, status: :unprocessable_entity }\n end\n end\n end",
"def show\n @payable = Payable.find(params[:payable_id])\n @payable_shipment = @payable.payable_shipments.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @payable_shipment }\n end\n end",
"def ship(shipper, recipient, package, options = {})\n options = @options.update(options)\n package = package\n \n ship_request = build_ship_request(shipper, recipient, package, options)\n \n xml = commit(save_request(ship_request), (options[:test] || false))\n response = remove_version_prefix(xml)\n \n begin\n return parse_ship_response(shipper, recipient, package, response, options), ship_request\n rescue\n xml = REXML::Document.new(response)\n message = response_message(xml)\n raise message\n end\n end",
"def generate_individual_ships\n # for each ship type, create it and then assign it to its accessor\n %w|carrier battleship submarine warship destroyer|.each do |type|\n ship = Ship.new(type)\n case type\n when \"carrier\"\n then @carrier = ship\n when \"battleship\"\n then @battleship = ship\n when \"submarine\"\n then @submarine = ship\n when \"warship\"\n then @warship = ship\n when \"destroyer\"\n then @destroyer = ship\n end\n @fleet << ship # for fleet-building\n end\n end",
"def ships_where_type_matches\n list = CONNECTION.execute(\"SELECT * FROM ship_names WHERE ship_types_id = #{@id};\")\n array_list = []\n \n list.each do |type|\n array_list << ShipName.new(type)\n end\n \n array_list\n end",
"def get_method_transport\n puts \"Will you be using a:\"\n puts \"1. Plane\\n2. Train\\n3. Bus\"\n user_input = gets.chomp.to_i\n\n if user_input == 1\n return \"plane\"\n elsif user_input == 2\n return \"train\"\n elsif user_input == 3\n return \"bus\"\n else\n puts \"invalid input\"\n return get_method_transport()\n end\nend",
"def select_ship_positions(player, ship_size)\n valid_selection = false\n while valid_selection == false\n puts \"---- #{player.name} ---- please choose positions for the #{ship_size}x1 ship: \\n\"\n puts \"must be separated by a space like: a0 a1 a3 \\n\"\n prompt = '> '\n positions = Readline.readline(prompt, true)\n positions_simbolized = positions.split(' ').map(&:to_sym)\n\n valid_selection = $current_game.create_ship(player.board, positions_simbolized, ship_size)\n message = valid_selection == true ? \"👍 Good Choice \\n\" : \"👎 wrong positions , please try again \\n\"\n puts message\n end\n end",
"def get_fleet_by_ship(ship_id_defender)\n fleet = FightingFleet.create(user: get_user_by_ship_id(ship_id_defender))\n fleet.ship_groups.each do |group|\n instance = Ship.find_by(:id => ship_id_defender).get_unit_instance(group.unit)\n group.number = instance.amount\n group.save\n end\n fleet.save\n return fleet\n end",
"def add_ship(a_ship)\n\tres = [a_ship]\n\tif(ships.size < 0)\n\t\tships = ships + res\n else\n\t\tset_ships(res)\n\tend\n end",
"def demande_de_grille #definir une methode demande de grille\n puts \"choisir 5 nombres de 1 à 45\"\n grid = gets\n return grid\nend",
"def retrieval\n shipping_manifest = {\n \"whale bone corsets\" => 5,\n \"porcelain vases\" => 2,\n \"oil paintings\" => 3\n }\n shipping_manifest[\"oil paintings\"]\n\nend",
"def get_orientation(ship, grid)\n print \"Enter 1 for horizontal or 2 for vertical placement: \"\n case gets.chomp\n when \"1\"\n :horizontal\n when \"2\"\n :vertical\n else\n get_orientation(ship, grid)\n end\n end",
"def shipping\n adjustments.find { |a| a.type == \"shipping-method\" }\n end",
"def get_sqr\n ask(\"SQR name: \")\n end",
"def new\n @ship = Ship.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @ship }\n end\n end",
"def place_ship(ship, grid)\n print \"\\n\\nPlace your #{ship.name}:\\n\"\n show_grid(grid, true)\n print_ship(ship)\n print \"\\n\"\n ship.orientation = get_orientation(ship, grid)\n get_and_set_coordinates(ship, grid)\n end",
"def get_restaurant\n puts \"which restaurant?\"\n restaurant = gets.chomp\n end",
"def set_shipper\n @shipper = Shipper.find(params[:id])\n end",
"def get_zip\n\tprint \"What is you location? (zip code): \"\n\tzipcode = gets.chomp\nend",
"def location\n puts \"Please enter location to see profit:\"\n franchise_location = gets.chomp\n franchise = Franchise.find_by location: franchise_location\n if franchise == nil\n puts \"There aren't any franchises in this location.\"\n menu\n end\n puts \"This location's profit is $#{franchise.profit}.\"\n menu\n end",
"def add_ship(ship)\n size = ship.size - 1\n\n case ship.orientation\n when \"Right\"\n if ship.start_position.row > @max_row || ship.start_position.row < 1 || ship.start_position.column + size > @max_column || ship.start_position.column < 1\n return false\n end\n\n for i in ship.start_position.column - 1..ship.start_position.column - 1 + size\n if @board[ship.start_position.row - 1][i] =~ /^B/\n return false\n end\n end\n\n return put_ship_on_board(ship)\n when \"Left\"\n if ship.start_position.row > @max_row || ship.start_position.row < 1 || ship.start_position.column > @max_column || ship.start_position.column - size < 1\n return false\n end\n\n for i in (ship.start_position.column - 1).downto(ship.start_position.column - 1 - size)\n if @board[ship.start_position.row - 1][i] =~ /^B/\n return false\n end\n end\n\n return put_ship_on_board(ship)\n when \"Up\"\n if ship.start_position.row > @max_row || ship.start_position.row - size < 1 || ship.start_position.column > @max_column || ship.start_position.column < 1\n return false\n end\n\n for i in (ship.start_position.row - 1).downto(ship.start_position.row - 1 - size)\n if @board[i][ship.start_position.column - 1] =~ /^B/\n return false\n end\n end\n\n return put_ship_on_board(ship)\n when \"Down\"\n if ship.start_position.row + size > @max_row || ship.start_position.row < 1 || ship.start_position.column > @max_column || ship.start_position.column < 1\n return false\n end\n\n for i in ship.start_position.row - 1..ship.start_position.row - 1 + size\n puts i\n if @board[i][ship.start_position.column - 1] =~ /^B/\n return false\n end\n end\n\n return put_ship_on_board(ship)\n else\n puts \"Invalid ship orientation\"\n return false\n end\n end",
"def query_ships_at_a_port port_name\n Ship.joins(:ports).where(\"ports.name\" => port_name)\n end",
"def fleet_ship_params\n params.require(:fleet_ship).permit(:ship_id, :fleet_id)\n end",
"def create\n @ship = Ship.new(params[:ship])\n @ship.game_id = @game.id\n @ship.health = @ship.ship_type.length\n @ship.vertical = true\n @ship.player_id = @player.id\n\n respond_to do |format|\n if @ship.save\n format.html { redirect_to [@game, @ship], notice: 'Ship was successfully created.' }\n format.json { render json: @ship, status: :created, location: @ship }\n else\n format.html { render action: \"new\" }\n format.json { render json: @ship.errors, status: :unprocessable_entity }\n end\n end\n end",
"def get_input \n puts \"to save this game, input 's,filename'\"\n puts \"to load a game, input 'l,filename'\"\n puts \"input a coordinate to access. prefix with r for reveal or f for flag\"\n puts \"example 'f,1,2' places a flag at 1,2\"\n input = gets.chomp\n \n args = input.split(',')\n end",
"def retrieval\n shipping_manifest['oil paintings']\nend",
"def show\n @flower_ships = FlowerShip.where(flower_order_id: @flower_order.id)\n end",
"def find_restaurant_loc\n puts \"Enter Restaurant: \" \n rest_name = gets.chomp\n x = Restaurant.find_by(name: rest_name)\n pp x.location\nend",
"def update\n @ship = Ship.find(params[:id])\n\n respond_to do |format|\n if @ship.update_attributes(params[:ship])\n flash[:notice] = 'Ship was successfully updated.'\n format.html { redirect_to(@ship) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @ship.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @ship = Ship.find(params[:id])\n\n respond_to do |format|\n if @ship.update_attributes(params[:ship])\n flash[:notice] = 'Ship was successfully updated.'\n format.html { redirect_to(@ship) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @ship.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def show\n @shipping = scope.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @shipping }\n end\n end",
"def shipping_method\n object.shipping_method.try(:name)\n end",
"def new\n @ship_methods = ShipMethods.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @ship_methods }\n end\n end",
"def user_planet_pick(solar_system)\n puts \"Which planet are you interested in learning about?\"\n your_planet = gets.chomp.capitalize\n puts \"Great, you want to learn about #{your_planet}.\"\n puts \"Here are planet details about #{solar_system.find_planet_by_name(your_planet).summary}\"\nend",
"def last_shipment\n barn = Barn.find(params[:id])\n @shipment = barn.shipments.last rescue nil\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @shipment}\n end\n end",
"def set_shipping\n @shipping = Shipping.find(params[:id])\n end",
"def show\n @shipping_line = ShippingLine.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @shipping_line }\n end\n end",
"def get_ships_number\n\t\tsystem 'clear'\n\t\tmessage = \"Enter the number of your ships (10 max): \".green\n\t\tmessage_error = \"You are allowed to enter only numbers between 1 and 10.\\nPlease, try again.\".red\n\t\tmessage_alert = message_error + \"\\n\" + message\n\t\tbegin\n\t\t\tprint message\n\t\t\t@ships_number = gets.chomp\n\t\t\traise ExitError if @ships_number == 'q'\n\t\t\t@ships_number = Integer(@ships_number)\n\t\t\traise Exception unless @ships_number.between?(1, 10)\n\t\trescue ExitError => e\n\t\t\texit_the_game\n\t\trescue Exception => e\n\t\t\tmessage = message_alert\n\t\t\tretry\n\t\tend\n\t\tputs \"\\rThe number of your ships will be #{@ships_number}\".cyan\n\tend",
"def request_input(turn)\r\n if turn === true\r\n puts \"Player 1\"\r\n puts \"=\" * 8\r\n puts \"Put in your first coordinate:\"\r\n first_coor = gets.chomp.to_i\r\n puts \"Put in your second coordinate:\"\r\n second_coor = gets.chomp.to_i\r\n end\r\n return [first_coor, second_coor]\r\nend",
"def get_shipment(shipment_id)\n operation('GetShipment')\n .add('ShipmentId' => shipment_id)\n\n run\n end"
] |
[
"0.68076473",
"0.6481056",
"0.624608",
"0.61633563",
"0.6144363",
"0.60923386",
"0.60923386",
"0.60432434",
"0.58957744",
"0.5857203",
"0.58281213",
"0.5805428",
"0.57868016",
"0.57836396",
"0.5740101",
"0.5732825",
"0.57216907",
"0.5715721",
"0.56909066",
"0.5690762",
"0.5654975",
"0.5653786",
"0.5653237",
"0.5629808",
"0.5608091",
"0.5608091",
"0.55918986",
"0.55843896",
"0.55740047",
"0.55643255",
"0.5550428",
"0.55458564",
"0.5540306",
"0.553687",
"0.55357444",
"0.5530526",
"0.5529914",
"0.5513698",
"0.55075437",
"0.54798347",
"0.54769784",
"0.54592746",
"0.5456508",
"0.5454742",
"0.54464287",
"0.54435974",
"0.5436819",
"0.5435842",
"0.53971714",
"0.53967506",
"0.5384045",
"0.537748",
"0.537748",
"0.5376197",
"0.53718066",
"0.5360368",
"0.5360365",
"0.5346418",
"0.5345494",
"0.5342863",
"0.534223",
"0.5341629",
"0.5341383",
"0.53314346",
"0.5306346",
"0.5299454",
"0.52938944",
"0.52802664",
"0.5276624",
"0.5275283",
"0.52739525",
"0.5271366",
"0.5269466",
"0.5267754",
"0.52636486",
"0.52465534",
"0.524338",
"0.5241955",
"0.5240977",
"0.52379084",
"0.5229722",
"0.52285355",
"0.5217182",
"0.5213763",
"0.5209",
"0.52086765",
"0.52083975",
"0.5205108",
"0.520135",
"0.520135",
"0.5201132",
"0.5200279",
"0.519681",
"0.5185162",
"0.5178266",
"0.51705503",
"0.51622003",
"0.51588213",
"0.5158316",
"0.5152142"
] |
0.7224335
|
0
|
GET /vicarages GET /vicarages.json
|
def index
@vicarages = Vicarage.all
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def vitals\n raise UserNotAuthenticated unless access_token\n\n get('records/vitals')\n end",
"def index\n @cages = current_user.cages\n\n respond_to do |format|\n format.json { render json: @cages }\n end\n end",
"def index\n @vacancies = Vacancy.all_vacancies# current_user.vacancies #\n render json: @vacancies\n end",
"def index\n @admin_villages = Admin::Village.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @admin_villages }\n end\n end",
"def index\n @vampires = Vampire.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @vampires }\n end\n end",
"def index\n @vacations = User.find(params[:user_id]).vacations \n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @vacations }\n end\n end",
"def index\n @ivas = Iva.all\n\n render json: @ivas\n end",
"def index\n @vacancies = Vacancy.all\n end",
"def index\n @vacancies = Vacancy.all\n end",
"def index\n @content_for_title = I18n.t('.vacancies.index.page_title')\n @vacancies = @current_user.vacancies.paginate(:page => params[:page], :per_page => 8, order: \"created_at DESC\")\n @vacancies_max = @current_user.orders.sum(:quantity_remained, joins: :pricelist, conditions: {status: 1, pricelists: {entry_type: 3}}) + Job::VACANCIES_FREE\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @vacancies }\n end\n end",
"def index\n @verticals = Vertical.all()\n render json: @verticals\n end",
"def index\n order = sortable_column_order, \"gage_number desc\"\n @gages = Gage.paginate page: params[:page], order: order, per_page: 50\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @gages }\n end\n end",
"def index\n @cartridges = Cartridge.all\n\n respond_to do |format|\n format.html\n format.json { render json: @cartridges }\n end\n end",
"def index\n @api_v1_post_votes = PostVote.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @api_v1_post_votes }\n end\n end",
"def index\n @vices = Vice.all\n end",
"def set_vicarage\n @vicarage = Vicarage.find(params[:id])\n end",
"def index\n @auditvs = Auditv.all.page(params[:page]).per(10)\n end",
"def show\n @vegetable = Vegetable.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @vegetable }\n end\n end",
"def index\n @curriculum_vitaes = findable_curriculum_vitaes.all\n respond_to do |format|\n format.html {}\n format.json { render json: @curriculum_vitaes }\n end\n end",
"def index\n @virtual_presents = VirtualPresent.order(id: :desc).page(params[:page]).per(params[:per])\n @virtual_present = VirtualPresent.new(price: 0)\n # render json: @virtual_presents\n end",
"def index_by_age_sorted_by_price\n @age = Age.find(params[:age_id])\n @gifts = @age.gifts\n render json: @gifts, include: :ages, status: :ok\n end",
"def index\n @api_versions = ApiVersion.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @api_versions }\n end\n end",
"def index\n @vdms = Vdm.all\n\n render json: @vdms\n end",
"def index\n @vegetables = Vegetable.all\n end",
"def index_by_age\n @age = Age.find(params[:age_id])\n @gifts = @age.gifts\n render json: @gifts, include: :ages, status: :ok\n end",
"def index\n @verticals = Vertical.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @verticals }\n end\n end",
"def index\n @vechicles = Vechicle.all\n end",
"def index\n @civilizations = Civilization.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @civilizations }\n end\n end",
"def index\n @api_versions = ApiVersion.sorted\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @api_versions }\n end\n end",
"def index\n @vol_values = @volatility.vol_values.asc(:timestamp).page params[:page]\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @volatility.vol_values.asc(:timestamp) }\n end\n end",
"def index\n @universes = Universe.all.page(params[:page]).per(25)\n respond_to do |format|\n format.html\n format.json { render json: @universes }\n end\n end",
"def index\n allow :get\n expires_in 60.seconds\n\n nodes = @kavlan.nodes_vlan(params[:vlan_id])\n result = {\n 'total' => nodes.length,\n 'offset' => 0,\n 'items' => nodes.map { |n| { 'uid' => n, 'vlan' => params[:vlan_id] } },\n 'links' => links_for_collection\n }\n\n result['items'].each do |item|\n item['links'] = links_for_item(item)\n end\n\n render_result(result)\n end",
"def index\n @pledges = if current_admin?\n User.find(params[:user_id]).pledges\n else\n current_user.pledges\n end\n respond_to do |format|\n format.html\n format.json { render json: @pledges }\n end\n end",
"def index\n @instances = Instance.all\n render json: @instances\n end",
"def index\n @votes = @proposal.votes\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @votes }\n end\n end",
"def index\n @vets = Vet.all\n end",
"def index\n @budgets = Budget.find_owned_by current_user\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @budgets }\n end\n end",
"def index\n @admin_vacancies = Vacancy.all\n end",
"def index\n @fundamental_alliance_leader_votes = Fundamental::AllianceLeaderVote.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @fundamental_alliance_leader_votes }\n end\n end",
"def list_active_aos_versions(args = {}) \n get(\"/aosversions.json/\", args)\nend",
"def index_by_user\n @gifts = @current_user.gifts\n render json: @gifts, include: :ages, status: :ok\n end",
"def index\n @vacancies = current_user.employer_info.vacancies.all\n end",
"def show\n @gage = Gage.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @gage }\n end\n end",
"def show\n render json: @vat\n end",
"def index\n @vacancies = Vacancy.includes(:skills).paginate(:page => params[:page], :per_page => 5)\n end",
"def index\n session[:admin] = true\n @badges = Badge.order('approved_at desc,id')\n @fri_count = Badge.select { |b| b.friday? }.size\n @sat_count = Badge.select { |b| b.saturday? }.size\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @badges }\n end\n end",
"def index\n @instances = Instance.all\n render :json => @instances\n end",
"def index\n @pledges = Pledge.where('user_id = ?', current_user.id)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @pledges }\n end\n end",
"def index\n\t\tvendas = Venda.all\n\t\trender json: vendas, status: :ok\n\tend",
"def index\n @vlans = Vlan.paginate(page: params[:page],\n per_page: IPAMSConstants::RECORD_COUNT_PER_PAGE)\n authorize @vlans\n #policy_scope(@vlans)\n end",
"def index\n @releases = @environment.releases.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @releases }\n end\n end",
"def index\n @title = \"Возрастные группы\"\n @age_groups = AgeGroup.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @age_groups }\n end\n end",
"def index\n @garrages = Garrage.all\n end",
"def index\n @venders = Vender.all\n end",
"def index\n @instances = Instance.page params[:page]\n authorize! :read, @instances\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @instances }\n end\n end",
"def index\n @ppages = Ppage.all\n end",
"def index\n @votes = Vote.all\n\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @votes }\n end\n end",
"def employee_vacations\n #vacaciones de este año\n vacations = Employee.find(params[:id]).get_vacation_days\n\n respond_to do |format|\n format.json { render json: vacations }\n end\n end",
"def show\n @vacancies = get_vacancies if params[:vacancies]\n end",
"def index\n\tif params[:perfil]\n\t\tp = Perfil.find(params[:perfil])\n\t\t@vagas = p.vagas.order(\"created_at DESC\").page(params[:page]).per(8)\n\telse\t\n\t \tif params[:perfil_id] && params[:empresa_id]\n\t\t\t@vagas = Vaga.vagas(params[:perfil_id], params[:empresa_id]).order(\"created_at DESC\").page(params[:page]).per(8)\n\t\telse\n\t\t\t@vagas = Vaga.order(\"created_at DESC\").page(params[:page]).per(8)\n\t\tend\n\tend\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @vagas }\n end\n end",
"def index\n @votes = Vote.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @votes }\n end\n end",
"def index\n @votes = Vote.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @votes }\n end\n end",
"def index\n @votes = Vote.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @votes }\n end\n end",
"def index\n @votes = Vote.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @votes }\n end\n end",
"def index\n @votes = Vote.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @votes }\n end\n end",
"def index\n @member_villages = MemberVillage.all\n end",
"def list_all_aos_versions(args = {}) \n get(\"/aosversions.json/all\", args)\nend",
"def index\n @vacation_requests = VacationRequest.all\n end",
"def index\n @vehicles = Vehicle.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @vehicles }\n end\n end",
"def index\n @loves = Love.all\n render json: @loves\n end",
"def index\n @application_vacancies = ApplicationVacancy.all\n end",
"def show\n render json: @iprange \n end",
"def index\n render json: Visitor.paginate(:page => params[:page], :per_page => 300)\n end",
"def index\n @loadbalancers = getmydata(\"Loadbalancer\")\n pagination\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @loadbalancers }\n end\n end",
"def index\n @file_versions = FileVersion.all\n\n render json: @file_versions\n end",
"def index\n @ventas_presupuestos = Ventas::Presupuesto.paginate(:page => params[:page], :per_page => 5)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @ventas_presupuestos }\n end\n end",
"def index\n @vitimas = Vitima.all\n end",
"def index\n results = []\n if params[:bbox]\n results = VAFacility.query(bbox: params[:bbox], type: params[:type], services: params[:services])\n end\n resource = Common::Collection.new(::VAFacility, data: results)\n resource = resource.paginate(pagination_params)\n render json: resource.data,\n serializer: CollectionSerializer,\n each_serializer: VAFacilitySerializer,\n meta: resource.metadata\n end",
"def index\n @vehicule_persos = VehiculePerso.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @vehicule_persos }\n end\n end",
"def index\n @vils = Vil.all\n end",
"def votes(options = {})\n get('/votes', options)\n end",
"def index\n @votacions = Votacion.all\n end",
"def index\n @src_gsts = SrcGst.where(hotel_src_id: current_user.hotel_src_id).page(params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @src_gsts }\n end\n end",
"def index\n @vhours = Vhour.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @vhours }\n end\n end",
"def index\n @invoices = Invoice.all.order(invoice_date: :desc).order(created_at: :desc).paginate(:page => params[:page], per_page: 10)\n\n render json: {invoices: @invoices, total_pages: @invoices.total_pages, current_page: @invoices.current_page}\n end",
"def index\n @vitricongviecs = Vitricongviec.all\n end",
"def index\n @admin_pricing_foams = Admin::Pricing::Foam.all.paginate(page: params[:page])\n\n respond_to do |format|\n format.html\n format.json { render json: @admin_pricing_foams.map { |i| { value: i.id, text: i.to_s } }, status: :ok }\n end\n end",
"def index\n\n @ipranges = Iprange.all\n\n render json: @ipranges\n\n end",
"def vips\n request :get, '/vips'\n end",
"def list_all_aos_version_boxes(args = {}) \n get(\"/aosversions.json/aosversionbox\", args)\nend",
"def index\n @visits = VisitSearch.new.visits current_physician, params[:page]\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @visits }\n end\n end",
"def index\n @pagamentos = Pagamento.page(params[:page]).per(NUMERO_POR_PAGINA)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @pagamentos }\n end\n end",
"def index\n @archivs = Archiv.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @archivs }\n end\n end",
"def index\n @viagens = Viagem.all\n end",
"def index\n @capacites = Capacite.paginate(page: params[:page], per_page: 25)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @capacites }\n end\n end",
"def index\n @admin_pricing_fabrics = Admin::Pricing::Fabric.all.paginate(page: params[:page])\n\n respond_to do |format|\n format.html\n format.json { render json: @admin_pricing_fabrics.map { |i| { value: i.id, text: i.to_s } }, status: :ok }\n end\n end",
"def index\n @vips = Vip.all\n end",
"def index\r\n @pet_vaccinations = PetVaccination.all\r\n end",
"def show\n render json: @iva\n end",
"def index\n @vitaminas = Vitamina.all\n end"
] |
[
"0.66836536",
"0.66616005",
"0.66490215",
"0.66050225",
"0.6453333",
"0.6431618",
"0.6334092",
"0.6291732",
"0.6291732",
"0.6287622",
"0.6238363",
"0.6232576",
"0.62299657",
"0.6198003",
"0.6190004",
"0.6184687",
"0.6144711",
"0.6120845",
"0.6109469",
"0.6091756",
"0.608947",
"0.6081746",
"0.60749745",
"0.6049083",
"0.6045481",
"0.60396415",
"0.6034704",
"0.6027929",
"0.6023995",
"0.6005729",
"0.6000218",
"0.59950155",
"0.59879446",
"0.59780943",
"0.59650236",
"0.5956765",
"0.5955719",
"0.59550357",
"0.5954389",
"0.59467185",
"0.5941854",
"0.59277993",
"0.5926939",
"0.5926851",
"0.59213954",
"0.5917755",
"0.5913715",
"0.5907664",
"0.5906762",
"0.5906305",
"0.589363",
"0.58931047",
"0.5888922",
"0.58848804",
"0.5879149",
"0.58748853",
"0.5856311",
"0.5855112",
"0.5854098",
"0.5847001",
"0.58460075",
"0.58460075",
"0.58460075",
"0.58460075",
"0.58460075",
"0.58441496",
"0.5829232",
"0.58274955",
"0.5811545",
"0.5805242",
"0.58042276",
"0.5802949",
"0.5799131",
"0.57983756",
"0.5795951",
"0.5792879",
"0.57921654",
"0.57888794",
"0.578675",
"0.578647",
"0.5783023",
"0.57808083",
"0.5779487",
"0.57785153",
"0.5775646",
"0.5764203",
"0.57559085",
"0.57500285",
"0.57484084",
"0.57413405",
"0.5734968",
"0.5725691",
"0.5724471",
"0.57240504",
"0.57230926",
"0.5722297",
"0.57222015",
"0.57221663",
"0.5720156",
"0.57172716"
] |
0.7630078
|
0
|
GET /vicarages/1 GET /vicarages/1.json
|
def show
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def index\n @vicarages = Vicarage.all\n end",
"def vitals\n raise UserNotAuthenticated unless access_token\n\n get('records/vitals')\n end",
"def set_vicarage\n @vicarage = Vicarage.find(params[:id])\n end",
"def index\n @cages = current_user.cages\n\n respond_to do |format|\n format.json { render json: @cages }\n end\n end",
"def index\n @admin_villages = Admin::Village.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @admin_villages }\n end\n end",
"def index\n @vacancies = Vacancy.all_vacancies# current_user.vacancies #\n render json: @vacancies\n end",
"def index\n @vampires = Vampire.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @vampires }\n end\n end",
"def index\n @vacations = User.find(params[:user_id]).vacations \n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @vacations }\n end\n end",
"def show\n @vegetable = Vegetable.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @vegetable }\n end\n end",
"def index\n @ivas = Iva.all\n\n render json: @ivas\n end",
"def index\n @api_v1_post_votes = PostVote.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @api_v1_post_votes }\n end\n end",
"def index\n @vacancies = Vacancy.all\n end",
"def index\n @vacancies = Vacancy.all\n end",
"def show\n render json: @vat\n end",
"def show\n @gage = Gage.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @gage }\n end\n end",
"def index\n @vices = Vice.all\n end",
"def index\n @cartridges = Cartridge.all\n\n respond_to do |format|\n format.html\n format.json { render json: @cartridges }\n end\n end",
"def index\n @virtual_presents = VirtualPresent.order(id: :desc).page(params[:page]).per(params[:per])\n @virtual_present = VirtualPresent.new(price: 0)\n # render json: @virtual_presents\n end",
"def show\n @vet = Vet.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @vet }\n end\n end",
"def show\n @voprosy = Voprosy.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @voprosy }\n end\n end",
"def index_by_age\n @age = Age.find(params[:age_id])\n @gifts = @age.gifts\n render json: @gifts, include: :ages, status: :ok\n end",
"def show\n @voc = Voc.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @voc }\n end\n end",
"def index\n @verticals = Vertical.all()\n render json: @verticals\n end",
"def index\n @curriculum_vitaes = findable_curriculum_vitaes.all\n respond_to do |format|\n format.html {}\n format.json { render json: @curriculum_vitaes }\n end\n end",
"def index\n @api_versions = ApiVersion.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @api_versions }\n end\n end",
"def show\n @vano = Vano.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @vano }\n end\n end",
"def index\n @civilizations = Civilization.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @civilizations }\n end\n end",
"def show\n @api_v1_post_vote = PostVote.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @api_v1_post_vote }\n end\n end",
"def show\n @vacation = Vacation.find(params[:id])\n @vacation.define_status\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @vacation }\n end\n end",
"def show\n @status_ativ = StatusAtiv.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @status_ativ }\n end\n end",
"def show\n @vampire = Vampire.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @vampire }\n end\n end",
"def index\n @vdms = Vdm.all\n\n render json: @vdms\n end",
"def index\n @verticals = Vertical.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @verticals }\n end\n end",
"def index\n @content_for_title = I18n.t('.vacancies.index.page_title')\n @vacancies = @current_user.vacancies.paginate(:page => params[:page], :per_page => 8, order: \"created_at DESC\")\n @vacancies_max = @current_user.orders.sum(:quantity_remained, joins: :pricelist, conditions: {status: 1, pricelists: {entry_type: 3}}) + Job::VACANCIES_FREE\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @vacancies }\n end\n end",
"def index\n @votes = @proposal.votes\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @votes }\n end\n end",
"def show\n survivor = Suvivor.find(params[:id])\n render json: {status: 'SUCCESS', message:'Survivor founded', data:survivor},status: :ok\n end",
"def employee_vacations\n #vacaciones de este año\n vacations = Employee.find(params[:id]).get_vacation_days\n\n respond_to do |format|\n format.json { render json: vacations }\n end\n end",
"def index\n order = sortable_column_order, \"gage_number desc\"\n @gages = Gage.paginate page: params[:page], order: order, per_page: 50\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @gages }\n end\n end",
"def show\n @virus = Virus.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @virus }\n end\n end",
"def index\n @instances = Instance.all\n render json: @instances\n end",
"def index\n @vets = Vet.all\n end",
"def show\n render json: @iprange \n end",
"def show\n @village = Village.find(params[:id])\n @collections = @village.collections\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @village }\n end\n end",
"def index\n @budgets = Budget.find_owned_by current_user\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @budgets }\n end\n end",
"def index\n @auditvs = Auditv.all.page(params[:page]).per(10)\n end",
"def index\n @votes = Vote.all\n\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @votes }\n end\n end",
"def show\n @vertical = Vertical.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @vertical }\n end\n end",
"def index_by_age_sorted_by_price\n @age = Age.find(params[:age_id])\n @gifts = @age.gifts\n render json: @gifts, include: :ages, status: :ok\n end",
"def index\n @vol_values = @volatility.vol_values.asc(:timestamp).page params[:page]\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @volatility.vol_values.asc(:timestamp) }\n end\n end",
"def index\n @api_versions = ApiVersion.sorted\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @api_versions }\n end\n end",
"def index\n @vhours = Vhour.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @vhours }\n end\n end",
"def index\n @votes = Vote.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @votes }\n end\n end",
"def index\n @votes = Vote.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @votes }\n end\n end",
"def index\n @votes = Vote.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @votes }\n end\n end",
"def index\n @votes = Vote.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @votes }\n end\n end",
"def index\n @votes = Vote.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @votes }\n end\n end",
"def show\n @target_age = TargetAge.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @target_age }\n end\n end",
"def index\n @instances = Instance.all\n render :json => @instances\n end",
"def show\n @vacancies = get_vacancies if params[:vacancies]\n end",
"def index\n @vechicles = Vechicle.all\n end",
"def show\n vaga = Vaga.find(params[:id])\n render json: {status: 'SUCCESS', message:'Loaded vaga', data:vaga},status: :ok\n end",
"def show\n @vaccin = Vaccin.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @vaccin }\n end\n end",
"def index\n @universes = Universe.all.page(params[:page]).per(25)\n respond_to do |format|\n format.html\n format.json { render json: @universes }\n end\n end",
"def index\n @venders = Vender.all\n end",
"def show\n @baggage = Baggage.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @baggage }\n end\n end",
"def show\n @observacao_vocacionada = ObservacaoVocacionada.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @observacao_vocacionada }\n end\n end",
"def show\n @grm_vetappt = GrmVetappt.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @grm_vetappt }\n end\n end",
"def show\n @gauge = Gauge.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @gauge }\n end\n end",
"def index\n\t\tvendas = Venda.all\n\t\trender json: vendas, status: :ok\n\tend",
"def show\n @vocalium = Vocalium.find(params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @vocalium }\n end\n end",
"def show\n load_budget\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @budget }\n end\n end",
"def index\n @vehicule_persos = VehiculePerso.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @vehicule_persos }\n end\n end",
"def show\n @api_version = ApiVersion.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @api_version }\n end\n end",
"def list_active_aos_versions(args = {}) \n get(\"/aosversions.json/\", args)\nend",
"def index\n @fundamental_alliance_leader_votes = Fundamental::AllianceLeaderVote.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @fundamental_alliance_leader_votes }\n end\n end",
"def show\n @vnic = Vnic.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @vnic }\n end\n end",
"def index\n @vegetables = Vegetable.all\n end",
"def index\n @visits = VisitSearch.new.visits current_physician, params[:page]\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @visits }\n end\n end",
"def show\n render json: @iva\n end",
"def show\n @veiculo = Veiculo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @veiculo }\n end\n end",
"def index\n @vehicles = Vehicle.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @vehicles }\n end\n end",
"def index\n @visions = Vision.order(\"created_at DESC\").limit(1).where(:user == current_user)\n end",
"def show\n @civil_status = CivilStatus.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @civil_status }\n end\n end",
"def index\n @pledges = Pledge.where('user_id = ?', current_user.id)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @pledges }\n end\n end",
"def show\n @livro = Livro.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @livro }\n end\n end",
"def index\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @supervisions }\n end\n end",
"def index\n @title = \"Возрастные группы\"\n @age_groups = AgeGroup.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @age_groups }\n end\n end",
"def index_by_user\n @gifts = @current_user.gifts\n render json: @gifts, include: :ages, status: :ok\n end",
"def index\n @loves = Love.all\n render json: @loves\n end",
"def show\n @vitamin = Vitamin.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @vitamin }\n end\n end",
"def index\n @instances = Instance.page params[:page]\n authorize! :read, @instances\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @instances }\n end\n end",
"def show\n @vouchers = Mess.find(params[:id]).vouchers\n end",
"def index\n @vils = Vil.all\n end",
"def show\n @vrabat = Vrabat.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @vrabat }\n end\n end",
"def index\n @pledges = if current_admin?\n User.find(params[:user_id]).pledges\n else\n current_user.pledges\n end\n respond_to do |format|\n format.html\n format.json { render json: @pledges }\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 show\n @vaccine = Vaccine.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @vaccine }\n end\n end",
"def index\n @viagens = Viagem.all\n end",
"def index\n\tif params[:perfil]\n\t\tp = Perfil.find(params[:perfil])\n\t\t@vagas = p.vagas.order(\"created_at DESC\").page(params[:page]).per(8)\n\telse\t\n\t \tif params[:perfil_id] && params[:empresa_id]\n\t\t\t@vagas = Vaga.vagas(params[:perfil_id], params[:empresa_id]).order(\"created_at DESC\").page(params[:page]).per(8)\n\t\telse\n\t\t\t@vagas = Vaga.order(\"created_at DESC\").page(params[:page]).per(8)\n\t\tend\n\tend\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @vagas }\n end\n end",
"def show\n @advert = Advert.find(params[:id])\n @vcounter = ViewsCounter.counter('Advert', params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @advert }\n end\n end",
"def show\n\n respond_to do |format|\n format.json { render json: @cage }\n end\n end"
] |
[
"0.753827",
"0.6628052",
"0.66049147",
"0.6587223",
"0.65848595",
"0.6577855",
"0.6530069",
"0.65048856",
"0.6491649",
"0.6326059",
"0.62982863",
"0.6288869",
"0.6288869",
"0.62678385",
"0.6250612",
"0.6235334",
"0.6211283",
"0.6204159",
"0.6195074",
"0.6171884",
"0.61647594",
"0.6155927",
"0.613482",
"0.6125855",
"0.61189944",
"0.6118243",
"0.6108963",
"0.6101887",
"0.6077625",
"0.6072116",
"0.60658634",
"0.60569793",
"0.60523826",
"0.6029514",
"0.6020862",
"0.60099214",
"0.6009506",
"0.6008508",
"0.6006957",
"0.59954315",
"0.59951633",
"0.59832305",
"0.59801203",
"0.59797484",
"0.59793633",
"0.59738255",
"0.5968209",
"0.59610724",
"0.59583503",
"0.59549636",
"0.5948217",
"0.5943856",
"0.5943856",
"0.5943856",
"0.5943856",
"0.5943856",
"0.5938238",
"0.5937108",
"0.59353614",
"0.59321713",
"0.59311116",
"0.5928228",
"0.59281456",
"0.59252137",
"0.5917446",
"0.5911473",
"0.5910467",
"0.5909408",
"0.5898524",
"0.58975863",
"0.5897128",
"0.5896603",
"0.5892981",
"0.5891115",
"0.5885702",
"0.5882677",
"0.58810884",
"0.5881044",
"0.58810097",
"0.586376",
"0.58616066",
"0.586104",
"0.5860521",
"0.5859162",
"0.5858692",
"0.5851129",
"0.5849513",
"0.5849109",
"0.5847919",
"0.58445024",
"0.5843184",
"0.58416116",
"0.5841415",
"0.58330375",
"0.5824792",
"0.58157665",
"0.58126765",
"0.58097774",
"0.5797807",
"0.57961047",
"0.5796007"
] |
0.0
|
-1
|
POST /vicarages POST /vicarages.json
|
def create
@vicarage = Vicarage.new(vicarage_params)
respond_to do |format|
if @vicarage.save
format.html { redirect_to @vicarage, success: 'La Vicaría fue <strong>registrada</strong> exitosamente.' }
format.json { render :show, status: :created, location: @vicarage }
else
format.html { render :new }
format.json { render json: @vicarage.errors, status: :unprocessable_entity }
end
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def index\n @vicarages = Vicarage.all\n end",
"def vicarage_params\n params.require(:vicarage).permit(:Name, :managers_id)\n end",
"def create\n @vestimentum = Vestimentum.new(vestimentum_params)\n\n respond_to do |format|\n if @vestimentum.save\n format.html { redirect_to @vestimentum, notice: 'Vestimentum was successfully created.' }\n format.json { render :show, status: :created, location: @vestimentum }\n else\n format.html { render :new }\n format.json { render json: @vestimentum.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @vacancy = Vacancy.new(vacancy_params)\n\n respond_to do |format|\n if @vacancy.save\n format.html { redirect_to vacancy_path(@vacancy), notice: 'Вакансия создана.' }\n format.json { render :show, status: :created, location: @vacancy }\n else\n format.html { render :new }\n format.json { render json: @vacancy.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @vacancy = Vacancy.new(vacancy_params)\n\n respond_to do |format|\n if @vacancy.save\n update_skills\n format.html { redirect_to @vacancy, notice: 'Vacancy was successfully created.' }\n format.json { render :show, status: :created, location: @vacancy }\n else\n format.html { render :new }\n format.json { render json: @vacancy.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @cage = current_user.cages.new(params[:cage])\n\n respond_to do |format|\n if @cage.save\n format.json { render json: @cage, status: :created, location: @cage }\n else\n format.json { render json: @cage.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @vacation = Vacation.new(params[:vacation])\n respond_to do |format|\n if @vacation.save\n @vacations = Vacation.order(\"`vacations`.created_at DESC\").search(\n {:resource_vteam_allocation_vteam_id_eq =>params[:vteam_id],\n :resource_vteam_allocation_active_eq =>true})\n .group(:resource_vteam_allocation_id)\n .paginate(:per_page => Vacation.per_page,:page=>params[:page])\n @vacation_type = VacationType.all\n format.html\n format.js\n format.xml { render :xml => @vacation, :status => :created, :location => @vacation }\n else\n # format.html { render :action => \"new\" }\n format.xml { render :xml => @vacation.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def set_vicarage\n @vicarage = Vicarage.find(params[:id])\n end",
"def create\n @vacancy = Vacancy.new(vacancy_params)\n\n respond_to do |format|\n if @vacancy.save\n format.html { redirect_to @vacancy, notice: 'Vacante creada correctamente.' }\n format.json { render :show, status: :created, location: @vacancy }\n else\n format.html { render :new }\n format.json { render json: @vacancy.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @user_vacancy = UserVacancy.new(user_vacancy_params)\n\n respond_to do |format|\n if @user_vacancy.save\n format.html { redirect_to @user_vacancy, notice: 'Aplicación exitosa' }\n format.json { render :show, status: :created, location: @user_vacancy }\n else\n format.html { render :new }\n format.json { render json: @user_vacancy.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @ventaganancium = Ventaganancium.new(ventaganancium_params)\n\n respond_to do |format|\n if @ventaganancium.save\n format.html { redirect_to @ventaganancium, notice: 'Ventaganancium was successfully created.' }\n format.json { render :show, status: :created, location: @ventaganancium }\n else\n format.html { render :new }\n format.json { render json: @ventaganancium.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @vacancy = Vacancy.new(vacancy_params)\n\n respond_to do |format|\n if @vacancy.save\n format.html { redirect_to @vacancy, notice: \"Vacancy was successfully created.\" }\n format.json { render :show, status: :created, location: @vacancy }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @vacancy.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @vegetable = Vegetable.new(vegetable_params)\n\n respond_to do |format|\n if @vegetable.save\n format.html { redirect_to @vegetable, notice: 'Vegetable was successfully created.' }\n format.json { render :show, status: :created, location: @vegetable }\n else\n format.html { render :new }\n format.json { render json: @vegetable.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @vegetal = Vegetal.new(vegetal_params)\n\n respond_to do |format|\n if @vegetal.save\n format.html { redirect_to @vegetal, notice: 'Vegetal was successfully created.' }\n format.json { render :show, status: :created, location: @vegetal }\n else\n format.html { render :new }\n format.json { render json: @vegetal.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @gage = Gage.new(params[:gage])\n\n respond_to do |format|\n if @gage.save\n format.html { redirect_to @gage, notice: 'Gage was successfully created.' }\n format.json { render json: @gage, status: :created, location: @gage }\n else\n format.html { render action: \"new\" }\n format.json { render json: @gage.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n # Crear nuevo voto\n @voto = Voto.new(params[:voto])\n\n # Asociarlo con el usuario\n @voto.usuario_id = current_usuario.id\n\n # Asociarlo con la Pregunta o Respuesta\n votable_type = params[:voto][:votable_type]\n votable_id = params[:voto][:votable_id]\n if votable_type=='Pregunta'\n @voto.votable = Pregunta.find(votable_id)\n else\n @voto.votable = Respuesta.find(votable_id)\n end\n\n respond_to do |format|\n if @voto.save\n resp = {\n :votos_total => @voto.votable.votos_total,\n :votos_menos => @voto.votable.votos_menos,\n :votos_mas => @voto.votable.votos_mas\n }\n format.json { render json: resp, status: :created, location: @voto }\n else\n format.json { render json: @voto.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @vice = Vice.new(vice_params)\n\n respond_to do |format|\n if @vice.save\n format.html { redirect_to @vice, notice: 'Vice was successfully created.' }\n format.json { render :show, status: :created, location: @vice }\n else\n format.html { render :new }\n format.json { render json: @vice.errors, status: :unprocessable_entity }\n end\n end\n end",
"def index\n @virtual_presents = VirtualPresent.order(id: :desc).page(params[:page]).per(params[:per])\n @virtual_present = VirtualPresent.new(price: 0)\n # render json: @virtual_presents\n end",
"def create\n @vegetable = Vegetable.new(params[:vegetable].merge (params[:date]))\n @vegetable.start = @vegetable.start_sowing_month\n @vegetable.finish = @vegetable.end_planting_out_month\n respond_to do |format|\n if @vegetable.save\n format.html { redirect_to vegetables_path, notice: 'Vegetable was successfully created.' }\n format.json { render json: @vegetable, status: :created, location: @vegetable }\n else\n format.html { render action: \"new\" }\n format.json { render json: @vegetable.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n vaga = Vaga.new(vaga_params)\n if vaga.save\n render json: {status: 'SUCCESSO', message:'Vaga adicionada com sucesso!', data:vaga},status: :ok\n else\n render json: {status: 'ERRO', message:'Houve um erro ao adicionar a vaga.', data:vaga.errors},status: :unprocessable_entity\n end\n end",
"def create\n # @type [Vacancy] @vacancy\n @vacancy = current_user.employer_info.vacancies.build(vacancy_params)\n\n respond_to do |format|\n if @vacancy.save\n format.html { redirect_to @vacancy, notice: 'Vacancy was successfully created.' }\n format.json { render :show, status: :created, location: @vacancy }\n else\n format.html { render :new }\n format.json { render json: @vacancy.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n \n\n if Pricing.varient_split_add params\n #audit(@pricing, current_user)\n render json: @pricing, status: :created\n else\n render json: @pricing.errors, status: :unprocessable_entity\n end\n end",
"def index\n @api_v1_post_votes = PostVote.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @api_v1_post_votes }\n end\n end",
"def new\n @vegetable = Vegetable.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @vegetable }\n end\n end",
"def create\r\n\t\t\t\tsurvivor = Survivor.new(survivor_create_params)\r\n\t\t\t\tsurvivor.abducted = false\r\n\t\t\t\tsurvivor.abduction_reports = 0\r\n\t\t\t\tif survivor.save\r\n\t\t\t\t\trender json: {status: 'SUCCESS', message:'Survivor Registrado', data:survivor},status: :ok\r\n\t\t\t\telse\r\n\t\t\t\t\trender json: {status: 'ERROR', message:'Survivor não registrado com sucesso', data:survivor.erros},status: :unprocessable_entity\r\n\t\t\t\tend\r\n\t\t\tend",
"def create\n @iva = Iva.new(iva_params)\n\n if @iva.save\n render json: @iva, status: :created, location: @iva\n else\n render json: @iva.errors, status: :unprocessable_entity\n end\n end",
"def create\n @vechicle = Vechicle.new(vechicle_params)\n\n respond_to do |format|\n if @vechicle.save\n format.html { redirect_to @vechicle, notice: 'Vechicle was successfully created.' }\n format.json { render :show, status: :created, location: @vechicle }\n else\n format.html { render :new }\n format.json { render json: @vechicle.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n @api_v1_post_vote = PostVote.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @api_v1_post_vote }\n end\n end",
"def create\n @votaciones_hist = VotacionesHist.new(votaciones_hist_params)\n\n respond_to do |format|\n if @votaciones_hist.save\n format.html { redirect_to @votaciones_hist, notice: 'Votaciones hist was successfully created.' }\n format.json { render :show, status: :created, location: @votaciones_hist }\n else\n format.html { render :new }\n format.json { render json: @votaciones_hist.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n announcer = current_user.announcer\n @vacancy = Vacancy.new(vacancy_params)\n\n respond_to do |format|\n if @vacancy.save\n format.html { redirect_to edit_announcer_path(announcer), notice: 'Vaga cadastrada com sucesso.' }\n format.json { render :show, status: :created, location: @vacancy }\n else\n format.html { render :new }\n format.json { render json: @vacancy.errors, status: :unprocessable_entity }\n end\n end\n authorize! current_user, @vacancy\n end",
"def create\n @vitamina = Vitamina.new(vitamina_params)\n\n respond_to do |format|\n if @vitamina.save\n format.html { redirect_to @vitamina, notice: 'Vitamina was successfully created.' }\n format.json { render :show, status: :created, location: @vitamina }\n else\n format.html { render :new }\n format.json { render json: @vitamina.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @budget_approver = BudgetApprover.new(budget_approver_params)\n respond_to do |format|\n if @budget_approver.save\n format.html { redirect_to @budget_approver, notice: 'Budget approver page was successfully created.' }\n format.json { render :show, status: :created, location: @budget_approver }\n else\n format.html { render :new }\n format.json { render json: @budget_approver.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n #@item_venda = ItemVenda.new(item_venda_params)\n @venda = Venda.order(\"created_at\").last\n @item_venda = @venda.item_vendas.create(item_venda_params)\n @venda.valor_total += @item_venda.produto.preco_venda * @item_venda.quantidade\n @item_venda.venda_id = @venda.id\n @venda.save\n respond_to do |format|\n if @item_venda.save\n format.html {redirect_to new_item_venda_path}\n #format.html { redirect_to @item_venda, notice: 'Item venda was successfully created.' }\n format.json { render :show, status: :created, location: @item_venda }\n else\n format.html { render :new }\n format.json { render json: @item_venda.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @target_age = TargetAge.new(params[:target_age])\n\n respond_to do |format|\n if @target_age.save\n format.html { redirect_to @target_age, notice: 'Target age was successfully created.' }\n format.json { render json: @target_age, status: :created, location: @target_age }\n else\n format.html { render action: \"new\" }\n format.json { render json: @target_age.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n @vacation = Vacation.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @vacation }\n end\n end",
"def create\n @vet = Vet.new(params[:vet])\n\n respond_to do |format|\n if @vet.save\n format.html { redirect_to @vet, notice: 'Vet was successfully created.' }\n format.json { render json: @vet, status: :created, location: @vet }\n else\n format.html { render action: \"new\" }\n format.json { render json: @vet.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @viagem = Viagem.new(viagem_params)\n\n respond_to do |format|\n if @viagem.save\n format.html { redirect_to @viagem, notice: 'Viagem was successfully created.' }\n format.json { render :show, status: :created, location: @viagem }\n else\n format.html { render :new }\n format.json { render json: @viagem.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @vano = Vano.new(params[:vano])\n\n respond_to do |format|\n if @vano.save\n format.html { redirect_to @vano, notice: 'Vano was successfully created.' }\n format.json { render json: @vano, status: :created, location: @vano }\n else\n format.html { render action: \"new\" }\n format.json { render json: @vano.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @vet = Vet.new(vet_params)\n\n respond_to do |format|\n if @vet.save\n format.html { redirect_to @vet, notice: 'Vet was successfully created.' }\n format.json { render :show, status: :created, location: @vet }\n else\n format.html { render :new }\n format.json { render json: @vet.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @valores_de_pago = ValoresDePago.new(valores_de_pago_params)\n\n respond_to do |format|\n if @valores_de_pago.save\n format.html { redirect_to @valores_de_pago, notice: 'Valores de pago was successfully created.' }\n format.json { render :show, status: :created, location: @valores_de_pago }\n else\n format.html { render :new }\n format.json { render json: @valores_de_pago.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @pagina = Pagina.new(pagina_params)\n\n respond_to do |format|\n if @pagina.save\n format.html { redirect_to @pagina, notice: 'Pagina was successfully created.' }\n format.json { render :show, status: :created, location: @pagina }\n else\n format.html { render :new }\n format.json { render json: @pagina.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @status_ativ = StatusAtiv.new(params[:status_ativ])\n\n respond_to do |format|\n if @status_ativ.save\n format.html { redirect_to @status_ativ, notice: 'Status ativ was successfully created.' }\n format.json { render json: @status_ativ, status: :created, location: @status_ativ }\n else\n format.html { render action: \"new\" }\n format.json { render json: @status_ativ.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @age_tracker = AgeTracker.new(age_tracker_params)\n\n respond_to do |format|\n if @age_tracker.save\n format.html { redirect_to @age_tracker, notice: 'Age tracker was successfully created.' }\n format.json { render :show, status: :created, location: @age_tracker }\n else\n format.html { render :new }\n format.json { render json: @age_tracker.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @vampire = Vampire.new(params[:vampire])\n\n respond_to do |format|\n if @vampire.save\n format.html { redirect_to @vampire, notice: 'Vampire was successfully created.' }\n format.json { render json: @vampire, status: :created, location: @vampire }\n else\n format.html { render action: \"new\" }\n format.json { render json: @vampire.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n @vacation = Vacation.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @vacation }\n end\n end",
"def index\n @admin_villages = Admin::Village.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @admin_villages }\n end\n end",
"def create\n @curriculum_vitae = findable_curriculum_vitaes.new(curriculum_vitae_params)\n\n respond_to do |format|\n if @curriculum_vitae.save\n format.html { redirect_to @curriculum_vitae, notice: I18n.t('controllers.curriculum_vitaes.create.success') }\n format.json { render :show, status: :created, location: @curriculum_vitae }\n else\n format.html { render :new }\n format.json { render json: @curriculum_vitae.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @vano = Vano.new(vano_params)\n\n respond_to do |format|\n if @vano.save\n format.html { redirect_to @vano, notice: 'Vano was successfully created.' }\n format.json { render :show, status: :created, location: @vano }\n else\n format.html { render :new }\n format.json { render json: @vano.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @garrage = Garrage.new(garrage_params)\n @garrage.user_id = current_user.id\n\n respond_to do |format|\n if @garrage.save\n format.html { redirect_to garrage_stuffs_path(@garrage), notice: 'Garrage was successfully created.' }\n format.json { render :show, status: :created, location: @garrage }\n else\n format.html { render :new }\n format.json { render json: @garrage.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @company_vacancy = CompanyVacancy.new(company_vacancy_params)\n\n respond_to do |format|\n if @company_vacancy.save\n format.html { redirect_to @company_vacancy, notice: 'Company vacancy was successfully created.' }\n format.json { render :show, status: :created, location: @company_vacancy }\n else\n format.html { render :new }\n format.json { render json: @company_vacancy.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @voprosy = Voprosy.new(params[:voprosy])\n\n respond_to do |format|\n if @voprosy.save\n format.html { redirect_to @voprosy, notice: 'Voprosy was successfully created.' }\n format.json { render json: @voprosy, status: :created, location: @voprosy }\n else\n format.html { render action: \"new\" }\n format.json { render json: @voprosy.errors, status: :unprocessable_entity }\n end\n end\n end",
"def index\n @vacancies = Vacancy.all_vacancies# current_user.vacancies #\n render json: @vacancies\n end",
"def vagancy_params\n params.require(:vagancie).permit\n end",
"def create\n @vehicle = Vehicle.new(vehicle_params)\n if @vehicle.save\n render json: { status: 'Vehicle created successfully', vehicle: @vehicle }, status: :created\n else\n render json: { errors: @vehicle.errors.full_messages }, status: :bad_request\n end\n end",
"def create\n @parking_garage = ParkingGarage.new(parking_garage_params)\n\n respond_to do |format|\n if @parking_garage.save\n format.html { redirect_to @parking_garage, notice: 'Parking garage was successfully created.' }\n format.json { render :show, status: :created, location: @parking_garage }\n else\n format.html { render :new }\n format.json { render json: @parking_garage.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n @vacation = Vacation.new\n 5.times { @vacation.highlights.build }\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @vacation }\n end\n end",
"def create\n @bike = Bike.new(bike_params)\n @bike.compare_vehicles = params[:bike][:compare_vehicles]\n\n if @bike.save\n audit(@bike, current_user)\n render json: @bike, status: :created #serializer: Web::V1::BikeSerializer\n else\n render json: @bike.errors, status: :unprocessable_entity\n end\n end",
"def create\n @admin_vacancy = Vacancy.new(admin_vacancy_params)\n\n respond_to do |format|\n if @admin_vacancy.save\n format.html { redirect_to @admin_vacancy, notice: 'Vacancy was successfully created.' }\n format.json { render :show, status: :created, location: @admin_vacancy }\n else\n format.html { render :new }\n format.json { render json: @admin_vacancy.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @vik = Vik.new(vik_params)\n\n respond_to do |format|\n if @vik.save\n format.html { redirect_to @vik, notice: 'Vik was successfully created.' }\n format.json { render :show, status: :created, location: @vik }\n else\n format.html { render :new }\n format.json { render json: @vik.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @vitima = Vitima.new(vitima_params)\n\n respond_to do |format|\n if @vitima.save\n format.html { redirect_to @vitima, notice: 'Vitima was successfully created.' }\n format.json { render :show, status: :created, location: @vitima }\n else\n format.html { render :new }\n format.json { render json: @vitima.errors, status: :unprocessable_entity }\n end\n end\n end",
"def index\n @vampires = Vampire.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @vampires }\n end\n end",
"def create\n @veterinario = Veterinario.new(veterinario_params)\n\n respond_to do |format|\n if @veterinario.save\n format.html { redirect_to @veterinario, notice: \"Veterinario was successfully created.\" }\n format.json { render :show, status: :created, location: @veterinario }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @veterinario.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @situacao_reserva = SituacaoReserva.new(situacao_reserva_params)\n @situacao_reservas = SituacaoReserva.all.paginate(page: params[:page], per_page: 5)\n @action = { title: \"Nova\", button: \"Salvar\"}\n\n respond_to do |format|\n if @situacao_reserva.save\n format.html { redirect_to action: \"new\", notice: 'Situação reserva criada com sucesso..' }\n format.json { render :show, status: :created, location: @situacao_reserva }\n else\n format.html { render :new }\n format.json { render json: @situacao_reserva.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @auditv = Auditv.new(auditv_params)\n @vidres = Vidre.where(:auditv_id=>params[:id])\n @vidres.build\n\n respond_to do |format|\n if @auditv.save\n format.html { redirect_to @auditv, notice: 'Auditoria Vidres/BPH/BPM/FD realitzada.' }\n format.json { render :show, status: :created, location: @auditv }\n else\n format.html { render :new }\n format.json { render json: @auditv.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @tenure = Tenure.new(tenure_params)\n\n if @tenure.save\n audit(@tenure, current_user)\n render json: @tenure, status: :created\n else\n render json: @tenure.errors, status: :unprocessable_entity\n end\n end",
"def create\n @vacancy_request_status = VacancyRequestStatus.new(vacancy_request_status_params)\n\n respond_to do |format|\n if @vacancy_request_status.save\n format.html { redirect_to @vacancy_request_status, notice: 'Vacancy request status was successfully created.' }\n format.json { render :show, status: :created, location: @vacancy_request_status }\n else\n format.html { render :new }\n format.json { render json: @vacancy_request_status.errors, status: :unprocessable_entity }\n end\n end\n end",
"def ventaganancium_params\n params.require(:ventaganancium).permit(:fechaventa, :cantidad, :valorunidad, :total, :donacion, :comprador, :detalleparametros_id, :redenciones_id)\n end",
"def create\n @vip_privilege = VipPrivilege.new(vip_privilege_params)\n\n respond_to do |format|\n if @vip_privilege.save\n format.html { redirect_to @vip_privilege, notice: 'Vip privilege was successfully created.' }\n format.json { render action: 'show', status: :created, location: @vip_privilege }\n else\n format.html { render action: 'new' }\n format.json { render json: @vip_privilege.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n venture = Venture.new(venture_params)\n\n if venture.save \n render json: {venture: venture}, status: :created\n else\n render json: {status: 'Error', message: 'Venture not saved', data: venture.errors}, status: :unprocessable_entity\n end\n end",
"def create\n @involvement = Involvement.new(involvement_params)\n\n respond_to do |format|\n if @involvement.save\n format.html { redirect_to @involvement, notice: 'Involvement was successfully created.' }\n format.json { render :show, status: :created, location: @involvement }\n else\n format.html { render :new }\n format.json { render json: @involvement.errors, status: :unprocessable_entity }\n end\n end\n end",
"def vig_params\n params.require(:vig).permit(:name, :date, :test_ids=>[])\n end",
"def index\n @vacations = User.find(params[:user_id]).vacations \n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @vacations }\n end\n end",
"def create\n @vote = @votable.votes.new(vote_params)\n\n respond_to do |format|\n if @vote.save\n format.html { redirect_to build_path_vote(@vote), notice: 'Vote was successfully created.' }\n format.json { render action: 'show', status: :created, location: @vote }\n else\n format.html { render action: 'new' }\n format.json { render json: @vote.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @baggage = Baggage.new(params[:baggage])\n\n respond_to do |format|\n if @baggage.save\n format.html { redirect_to @baggage, notice: 'Baggage was successfully created.' }\n format.json { render json: @baggage, status: :created, location: @baggage }\n else\n format.html { render action: \"new\" }\n format.json { render json: @baggage.errors, status: :unprocessable_entity }\n end\n end\n end",
"def vaccinator_params\n params.require(:vaccinator).permit(:vac_name1, :vac_name2, :vac_idnum, :vac_photo, :vac_title, :vendor_name, :vac_email)\n end",
"def create\n @personnage = Personnage.new(params[:personnage])\n\n respond_to do |format|\n if @personnage.save\n format.html { redirect_to @personnage, notice: 'Personnage was successfully created.' }\n format.json { render json: @personnage, status: :created, location: @personnage }\n else\n format.html { render action: \"new\" }\n format.json { render json: @personnage.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @aviary = Aviary.new(aviary_params)\n\n respond_to do |format|\n if @aviary.save\n format.html { redirect_to @aviary, notice: 'Aviary was successfully created.' }\n format.json { render :show, status: :created, location: @aviary }\n else\n format.html { render :new }\n format.json { render json: @aviary.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @veterinario = Veterinario.new(veterinario_params)\n\n respond_to do |format|\n if @veterinario.save\n format.html { redirect_to @veterinario, notice: 'Veterinario was successfully created.' }\n format.json { render :show, status: :created, location: @veterinario }\n else\n format.html { render :new }\n format.json { render json: @veterinario.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n votes = params[:vote]\n voter = params[:voter_id]\n\n if votes\n votes.each do |k,v|\n @vote = Vote.new({:voter_id => voter,\n :position_id => v,\n :candidate_id => k })\n @vote.save\n end\n end\n\n\n redirect_to '/vote'\n\n #respond_to do |format|\n #if @vote.save\n #format.html { redirect_to @vote, notice: 'Vote was successfully created.' }\n #format.json { render json: @vote, status: :created, location: @vote }\n #else\n #format.html { render action: \"new\" }\n #format.json { render json: @vote.errors, status: :unprocessable_entity }\n #end\n #end\n end",
"def create\n @vertical = Vertical.new(params[:vertical])\n\n respond_to do |format|\n if @vertical.save\n format.html { redirect_to @vertical, notice: 'Vertical was successfully created.' }\n format.json { render json: @vertical, status: :created, location: @vertical }\n else\n format.html { render action: \"new\" }\n format.json { render json: @vertical.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @vacante_aplicada = VacanteAplicada.new(vacante_aplicada_params)\n\n respond_to do |format|\n if @vacante_aplicada.save\n format.html { redirect_to root_path, notice: 'Se ha aplicado aplicado correctamente a la vacante' }\n format.json { render :show, status: :created, location: @vacante_aplicada }\n else\n format.html { render :new }\n format.json { render json: @vacante_aplicada.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @vacation = Vacation.new(params[:vacation])\n @vacation.user_id = current_user.id\n respond_to do |format|\n if @vacation.save\n format.html { redirect_to @vacation, notice: 'Vacation was successfully created.' }\n format.json { render json: @vacation, status: :created, location: @vacation }\n else\n format.html { render action: \"new\" }\n format.json { render json: @vacation.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create \n num_days = (Date.parse(params['rent_info']['end_date']).mjd - Date.parse(params['rent_info']['start_date']).mjd) \n total = num_days * params['rent_info']['price_per_day']\n # byebug\n if User.find(params['rent_info']['owner_id'])\n user = User.find(params['rent_info']['owner_id'])\n user.money_made += total \n user.save\n end\n\n renter_post = RenterPost.create(\n renter_id: params['rent_info']['renter_id'],\n post_id: params['rent_info'][\"post_id\"],\n start_date: params['rent_info'][\"start_date\"],\n end_date: params['rent_info'][\"end_date\"],\n status: params['rent_info'][\"status\"]\n )\n if renter_post \n render json: renter_post\n else\n render json: {error: \"Could not create Renter Post\"}\n end\n end",
"def create\n @voting = Voting.new(voting_params)\n\n respond_to do |format|\n if @voting.save\n flash[:success] = 'Voting was successfully created.'\n format.html { redirect_to votings_path }\n format.json { render :show, status: :created, location: @voting }\n else\n format.html { render :new }\n format.json { render json: @voting.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @postvote = Postvote.new(params[:postvote])\n\n respond_to do |format|\n if @postvote.save\n format.html { redirect_to @postvote, notice: 'Postvote was successfully created.' }\n format.json { render json: @postvote, status: :created, location: @postvote }\n else\n format.html { render action: \"new\" }\n format.json { render json: @postvote.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n @vint = Vint.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @vint }\n end\n end",
"def create\n @voc = Voc.new(params[:voc])\n @voc.user_id = current_user.id\n\n respond_to do |format|\n if @voc.save\n format.html { redirect_to @voc, notice: 'Voc was successfully created.' }\n format.json { render json: @voc, status: :created, location: @voc }\n else\n format.html { render action: \"new\" }\n format.json { render json: @voc.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @votable_item = VotableItem.new(votable_item_params)\n\n respond_to do |format|\n if @votable_item.save\n format.html { redirect_to @votable_item, notice: 'Votable item was successfully created.' }\n format.json { render :show, status: :created, location: @votable_item }\n else\n format.html { render :new }\n format.json { render json: @votable_item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def vig_params\n params.require(:vig).permit(:name, :date, :test_ids=>[])\n end",
"def create\n @pago = Pago.new(params[:pago])\n\n respond_to do |format|\n if @pago.save\n format.html { render :text => @pago.attributes.merge( :saldo => @pago.saldo ).to_json }\n format.xml { render :xml => @pago, :status => :created, :location => @pago }\n else\n format.html { render :action => \"new\", :status => :unprocessable_entity }\n format.xml { render :xml => @pago.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def vitals\n raise UserNotAuthenticated unless access_token\n\n get('records/vitals')\n end",
"def create\n @vacation = Vacation.new(params[:vacation])\n @vacation.define_status\n @vacation.user=current_user\n respond_to do |format|\n if @vacation.save\n current_user.updatetotaldays\n Notifier.create_vacation(@vacation).deliver\n format.html { redirect_to @vacation, notice: 'Vacation was successfully created.' }\n format.json { render json: @vacation, status: :created, location: @vacation }\n else\n format.html { render action: \"new\" }\n format.json { render json: @vacation.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n sheeps = params[:sheeps]\n return if params_are_empty(sheeps)\n \n @activity = Activity.new date: convert_date_to_i(params[:date]), comment: params[:comment], a_type: params[:type_of_a], total_costs:params[:total_costs], location: 'farma'\n sheeps.each do |p|\n @vacination = Vacination.new sheep_id:p[:sheep_id], reason: params[:reason], vaccin_name: params[:vaccin_name]\n @activity.vacinations.push(@vacination)\n end\n \n respond_to do |format|\n if @activity.save\n desrtoy_activity(params[:activity_id])\n format.html { redirect_to '/vacinations/'+ @activity.id.to_s, notice: 'Vacination was successfully created.' }\n format.json { render action: 'show', status: :created, location: @vacination }\n else\n format.html { render action: 'new' }\n format.json { render json: @vacination.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n @status_ativ = StatusAtiv.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @status_ativ }\n end\n end",
"def create\n if(Post.find(params[:post_vote][:post_id]).user_id != params[:post_vote][:user_id]) # only vote if it's not the same user who wrote the post!\n @api_v1_post_vote=PostVote.find_by_post_id_and_user_id(params[:post_vote][:post_id], params[:post_vote][:user_id])\n if @api_v1_post_vote.nil?\n @api_v1_post_vote = PostVote.new(params[:post_vote])\n else\n @api_v1_post_vote.vote = params[:post_vote][:vote]\n end\n\n respond_to do |format|\n if @api_v1_post_vote.save\n #format.html { redirect_to @api_v1_post_vote, notice: 'Post vote was successfully created.' }\n format.json { render json: @api_v1_post_vote, status: :created }\n else\n # format.html { render action: \"new\" }\n format.json { render json: @api_v1_post_vote.errors.messages.values, status: 400 }\n end\n end\n else\n render json: \"Can't vote for yourself.\", status: 400\n end\n end",
"def create\n @vehicle = get_vehicle_from_params\n\n respond_to do |format|\n if @vehicle.save!\n @vehicle.accounts << current_user.account\n format.html { redirect_to root_path, notice: 'Vehicle was successfully created.' }\n format.json { render @vehicle.id}#json: @vehicle, status: :created, location: @vehicle }\n else\n format.html { render action: \"new\" }\n format.json { render json: @vehicle.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @vaccinator = Vaccinator.new(vaccinator_params)\n @vaccinator.user_id = current_user.id\n respond_to do |format|\n if @vaccinator.save\n format.html { redirect_to @vaccinator, notice: 'Vaccinator was successfully created.' }\n format.json { render :show, status: :created, location: @vaccinator }\n else\n format.html { render :new }\n format.json { render json: @vaccinator.errors, status: :unprocessable_entity }\n end\n end\n end",
"def vaccination_params\n params.require(:vaccination).permit(:vaccine_id, :visit_id, :dosage)\n end",
"def create\n @village = Village.new(village_params)\n\n respond_to do |format|\n if @village.save\n format.html { redirect_to @village, notice: 'Village was successfully created.' }\n format.json { render :show, status: :created, location: @village }\n else\n format.html { render :new }\n format.json { render json: @village.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @pagamento = @venda.pagamentos.build(pagamento_params)\n\n respond_to do |format|\n if @pagamento.save\n format.html { redirect_to cliente_venda_path(@cliente, @venda), notice: 'O pagamento foi registrada!' }\n format.json { render :show, status: :created, location: @pagamento }\n else\n format.html { render :new }\n format.json { render json: @pagamento.errors, status: :unprocessable_entity }\n end\n end\n end"
] |
[
"0.6139481",
"0.5851167",
"0.58339053",
"0.57551336",
"0.57540375",
"0.5737517",
"0.5734332",
"0.5733984",
"0.5679506",
"0.566419",
"0.56398666",
"0.5639556",
"0.5611052",
"0.56105006",
"0.5599188",
"0.5586084",
"0.5573076",
"0.55480474",
"0.55351573",
"0.5515732",
"0.551317",
"0.5510207",
"0.54937524",
"0.54932797",
"0.5492918",
"0.5479363",
"0.54729617",
"0.5466286",
"0.54614806",
"0.54613656",
"0.5440791",
"0.54218316",
"0.5420074",
"0.54153997",
"0.54080826",
"0.54059243",
"0.5395102",
"0.5390251",
"0.5383993",
"0.5382593",
"0.5380622",
"0.5380513",
"0.5379878",
"0.5379315",
"0.5377403",
"0.5368536",
"0.5366953",
"0.53659487",
"0.536271",
"0.53579235",
"0.53576225",
"0.5354606",
"0.5351398",
"0.53508925",
"0.5350046",
"0.53424424",
"0.5339285",
"0.53333586",
"0.5332687",
"0.5329788",
"0.53140897",
"0.53131014",
"0.5311354",
"0.53051615",
"0.53038746",
"0.5303375",
"0.5301208",
"0.530054",
"0.5299238",
"0.5291821",
"0.52817225",
"0.5279558",
"0.52791697",
"0.5278706",
"0.5278653",
"0.5275953",
"0.5274198",
"0.5269336",
"0.5264984",
"0.5264647",
"0.5262932",
"0.52604914",
"0.52595395",
"0.5258507",
"0.5253421",
"0.5250226",
"0.52481747",
"0.5247394",
"0.52461535",
"0.5245728",
"0.5245547",
"0.52436525",
"0.52419204",
"0.5238876",
"0.52339965",
"0.5231643",
"0.5230265",
"0.52298784",
"0.5228916",
"0.5225669"
] |
0.6324902
|
0
|
PATCH/PUT /vicarages/1 PATCH/PUT /vicarages/1.json
|
def update
respond_to do |format|
if @vicarage.update(vicarage_params)
format.html { redirect_to @vicarage, success: 'La Vicaría fue <strong>modificada</strong> exitosamente.' }
format.json { render :show, status: :ok, location: @vicarage }
else
format.html { render :edit }
format.json { render json: @vicarage.errors, status: :unprocessable_entity }
end
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"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 @api_v1_post_vote = PostVote.find(params[:id])\n\n respond_to do |format|\n if @api_v1_post_vote.update_attributes(params[:api_v1_post_vote])\n format.html { redirect_to @api_v1_post_vote, notice: 'Post vote was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @api_v1_post_vote.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @vip.update(vip_params)\n format.html { redirect_to @vip, notice: 'Vip was successfully updated.' }\n format.json { render :show, status: :ok, location: @vip }\n else\n format.html { render :edit }\n format.json { render json: @vip.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @vacancy = Vacancy.find(params[:id])\n\n respond_to do |format|\n if @vacancy.update_attributes(params[:vacancy])\n format.html { redirect_to @vacancy, notice: 'Vacancy was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @vacancy.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @vacancy.update(vacancy_params)\n update_skills\n format.html { redirect_to @vacancy, notice: 'Vacancy was successfully updated.' }\n format.json { render :show, status: :ok, location: @vacancy }\n else\n format.html { render :edit }\n format.json { render json: @vacancy.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @vegetable.update(vegetable_params)\n format.html { redirect_to @vegetable, notice: 'Vegetable was successfully updated.' }\n format.json { render :show, status: :ok, location: @vegetable }\n else\n format.html { render :edit }\n format.json { render json: @vegetable.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @vacancy.update(vacancy_params)\n format.html { redirect_to @vacancy, notice: 'Вакансия обновлена.' }\n format.json { render :show, status: :ok, location: @vacancy }\n else\n format.html { render :edit }\n format.json { render json: @vacancy.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n if @vat.update(vat_params)\n head :no_content\n else\n render json: @vat.errors, status: :unprocessable_entity\n end\n end",
"def UpdateView params = {}\n \n APICall(path: 'views.json',method: 'PUT',payload: params.to_json)\n \n end",
"def update\n respond_to do |format|\n if @vacancy.update(vacancy_params)\n format.html { redirect_to @vacancy, notice: 'Vacancy was successfully updated.' }\n format.json { render :show, status: :ok, location: @vacancy }\n else\n format.html { render :edit }\n format.json { render json: @vacancy.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @vacancy.update(vacancy_params)\n format.html { redirect_to @vacancy, notice: 'Vacancy was successfully updated.' }\n format.json { render :show, status: :ok, location: @vacancy }\n else\n format.html { render :edit }\n format.json { render json: @vacancy.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @vacancy.update(vacancy_params)\n format.html { redirect_to @vacancy, notice: \"Vacancy was successfully updated.\" }\n format.json { render :show, status: :ok, location: @vacancy }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @vacancy.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @vacancy.update(vacancy_params)\n format.html { redirect_to @vacancy, notice: 'Vacante actualizada correctamente.' }\n format.json { render :show, status: :ok, location: @vacancy }\n else\n format.html { render :edit }\n format.json { render json: @vacancy.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @voprosy = Voprosy.find(params[:id])\n\n respond_to do |format|\n if @voprosy.update_attributes(params[:voprosy])\n format.html { redirect_to @voprosy, notice: 'Voprosy was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @voprosy.errors, status: :unprocessable_entity }\n end\n end\n end",
"def set_vicarage\n @vicarage = Vicarage.find(params[:id])\n end",
"def update\n @veiculo = Veiculo.find(params[:id])\n\n respond_to do |format|\n if @veiculo.update_attributes(params[:veiculo])\n format.html { redirect_to @veiculo, :notice => 'Veiculo was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @veiculo.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @vegetal.update(vegetal_params)\n format.html { redirect_to @vegetal, notice: 'Vegetal was successfully updated.' }\n format.json { render :show, status: :ok, location: @vegetal }\n else\n format.html { render :edit }\n format.json { render json: @vegetal.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n budgets = update_budgets(params[:budgets])\n\n render json: budgets, status: :ok\n end",
"def update\n \n respond_to do |format|\n if @cage.update_attributes(params[:cage])\n format.json { head :no_content }\n else\n format.json { render json: @cage.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @vechicle.update(vechicle_params)\n format.html { redirect_to @vechicle, notice: 'Vechicle was successfully updated.' }\n format.json { render :show, status: :ok, location: @vechicle }\n else\n format.html { render :edit }\n format.json { render json: @vechicle.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @vice.update(vice_params)\n format.html { redirect_to @vice, notice: 'Vice was successfully updated.' }\n format.json { render :show, status: :ok, location: @vice }\n else\n format.html { render :edit }\n format.json { render json: @vice.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @vacancy.update(vacancy_params)\n format.html { redirect_to @vacancy, notice: 'Vaga atualizada com sucesso.' }\n format.json { render :show, status: :ok, location: @vacancy }\n else\n format.html { render :edit }\n format.json { render json: @vacancy.errors, status: :unprocessable_entity }\n end\n end\n authorize! current_user, @vacancy\n end",
"def update\n @vegetable = Vegetable.find(params[:id])\n\n respond_to do |format|\n if @vegetable.update_attributes(params[:vegetable])\n format.html { redirect_to(@vegetable, :notice => 'Vegetable was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @vegetable.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @vet = Vet.find(params[:id])\n\n respond_to do |format|\n if @vet.update_attributes(params[:vet])\n format.html { redirect_to @vet, notice: 'Vet was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @vet.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @voc = Voc.find(params[:id])\n @voc.user_id = current_user.id\n respond_to do |format|\n if @voc.update_attributes(params[:voc])\n format.html { redirect_to @voc, notice: 'Voc was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @voc.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @gage = Gage.find(params[:id])\n\n respond_to do |format|\n if @gage.update_attributes(params[:gage])\n format.html { redirect_to @gage, notice: 'Gage was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @gage.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n \n begin\n DetailValue.transaction do\n # Increment the instance version\n increment_instance_version\n @resource = update_value(params[:detail_id], \n params[:id], \n {\n 'lock_version' => params[:value][:lock_version],\n 'value' => params[:value][:value] \n })\n \n end\n render :response => :PUT\n rescue Exception => e\n @error = process_exception(e)\n render :response => :error\n end\n end",
"def update\n authorize! :manage, @vspec\n\n respond_to do |format|\n if @vspec.update(vspec_params)\n format.html { redirect_to [@vspec.metric, @vspec], notice: 'Vspec was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @vspec.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @vacation = Vacation.find(params[:id])\n\n respond_to do |format|\n if @vacation.update_attributes(params[:vacation])\n format.html { redirect_to @vacation, notice: 'Vacation was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @vacation.errors, status: :unprocessable_entity }\n end\n end\n end",
"def api_patch(path, data = {})\n api_request(:patch, path, :data => data)\n end",
"def update\n @vano = Vano.find(params[:id])\n\n respond_to do |format|\n if @vano.update_attributes(params[:vano])\n format.html { redirect_to @vano, notice: 'Vano was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @vano.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n\t\trespond_to do |format|\n\t\t\tif @vehicle.update(vehicle_params)\n\t\t\t\tcreate_audit __method__, 'vehicle', @vehicle.id\n\t\t\t\tformat.html { redirect_to @vehicle, notice: 'Vehicle was successfully updated.' }\n\t\t\t\tformat.json { head :no_content }\n\t\t\telse\n\t\t\t\tformat.html { render action: 'edit' }\n\t\t\t\tformat.json { render json: @vehicle.errors, status: :unprocessable_entity }\n\t\t\tend\n\t\tend\n\tend",
"def update\n respond_to do |format|\n if @vacina.update(vacina_params)\n format.html { redirect_to @vacina, notice: \"Vacina was successfully updated.\" }\n format.json { render :show, status: :ok, location: @vacina }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @vacina.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @company_vacancy.update(company_vacancy_params)\n format.html { redirect_to @company_vacancy, notice: 'Company vacancy was successfully updated.' }\n format.json { render :show, status: :ok, location: @company_vacancy }\n else\n format.html { render :edit }\n format.json { render json: @company_vacancy.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @vint = Vint.find(params[:id])\n\n respond_to do |format|\n if @vint.update_attributes(params[:vint])\n format.html { redirect_to @vint, notice: 'Vint was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @vint.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @vacina.update(vacina_params)\n format.html { redirect_to @vacina, notice: 'Vacina editada com sucesso.' }\n format.json { render :show, status: :ok, location: @vacina }\n else\n format.html { render :edit }\n format.json { render json: @vacina.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n render json: Company.update(params[\"id\"], params[\"company\"])\n end",
"def update\n respond_to do |format|\n if @user_vacancy.update(user_vacancy_params)\n format.html { redirect_to @user_vacancy, notice: 'Aplicación actualizada correctamente' }\n format.json { render :show, status: :ok, location: @user_vacancy }\n else\n format.html { render :edit }\n format.json { render json: @user_vacancy.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @vampire = Vampire.find(params[:id])\n\n respond_to do |format|\n if @vampire.update_attributes(params[:vampire])\n format.html { redirect_to @vampire, notice: 'Vampire was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @vampire.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update!(params)\n res = @client.put(path, nil, params, \"Content-Type\" => \"application/json\")\n @attributes = res.json if res.status == 201\n res\n end",
"def update\n respond_to do |format|\n if @budget_approver.update(budget_approver_params)\n format.html { redirect_to @budget_approver, notice: 'Budget approver page was successfully updated.' }\n format.json { render :show, status: :ok, location: @budget_approver }\n else\n format.html { render :edit }\n format.json { render json: @budget_approver.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @cvi = Cvi.find(params[:id])\n @people = Person.all\n\n respond_to do |format|\n if @cvi.update_attributes(params[:cvi])\n format.html { redirect_to @cvi, notice: 'Cvi was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @cvi.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @livro = Livro.find(params[:id])\n\n respond_to do |format|\n if @livro.update_attributes(params[:livro])\n format.html { redirect_to @livro, :notice => 'Livro was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @livro.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @vano.update(vano_params)\n format.html { redirect_to @vano, notice: 'Vano was successfully updated.' }\n format.json { render :show, status: :ok, location: @vano }\n else\n format.html { render :edit }\n format.json { render json: @vano.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @vacation = Vacation.find(params[:id])\n\n respond_to do |format|\n if @vacation.update_attributes(params[:vacation])\n # format.html { redirect_to(vteam_vacations_path(@vacation.resource_vteam_allocation.vteam,@vacation), :notice => 'Vacation was successfully updated.') }\n\n format.html #{ redirect_to(@vacation, :notice => 'Vacation was successfully updated.') }\n @vacations = Vacation.order(\"created_at DESC\").search(\n :resource_vteam_allocation_vteam_id_eq =>params[:vteam_id] ).\n paginate(:per_page => Vacation.per_page,:page=>params[:page])\n format.js\n\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @vacation.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @api_v1_resource.update(api_v1_resource_params)\n format.html { redirect_to @api_v1_resource, notice: 'Resource was successfully updated.' }\n format.json { render :show, status: :ok, location: @api_v1_resource }\n else\n format.html { render :edit }\n format.json { render json: @api_v1_resource.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update_tenant_circle(args = {}) \n put(\"/tenantcircles.json/#{args[:circleId]}\", args)\nend",
"def update\n respond_to do |format|\n if @admin_vacancy.update(admin_vacancy_params)\n format.html { redirect_to @admin_vacancy, notice: 'Vacancy was successfully updated.' }\n format.json { render :show, status: :ok, location: @admin_vacancy }\n else\n format.html { render :edit }\n format.json { render json: @admin_vacancy.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update_rest\n @instrument_version = InstrumentVersion.find(params[:id])\n\n respond_to do |format|\n if @instrument_version.update_attributes(params[:instrument_version])\n flash[:notice] = 'InstrumentVersion was successfully updated.'\n format.html { redirect_to(@instrument_version) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @instrument_version.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @personnage = Personnage.find(params[:id])\n\n respond_to do |format|\n if @personnage.update_attributes(params[:personnage])\n format.html { redirect_to @personnage, notice: 'Personnage was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @personnage.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @vegetable = Vegetable.find(params[:id])\n @vegetable.start = @vegetable.start_sowing_month\n @vegetable.finish = @vegetable.end_planting_out_month\n\n respond_to do |format|\n if @vegetable.update_attributes(params[:vegetable].merge (params[:date]))\n format.html { redirect_to @vegetable, notice: 'Vegetable was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @vegetable.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @voucher = Voucher.find(params[:id])\n\n respond_to do |format|\n if @voucher.update_attributes(params[:voucher])\n format.html { redirect_to @voucher, notice: 'Voucher was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @voucher.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @iva = Iva.find(params[:id])\n\n if @iva.update(iva_params)\n head :no_content\n else\n render json: @iva.errors, status: :unprocessable_entity\n end\n end",
"def update\n @asset.update(price: params[:asset][:price])\n json_response(@asset,:created)\n end",
"def update\n respond_to do |format|\n if @vehicle.update(vehicle_params)\n format.html { redirect_to @vehicle, notice: 'Vehicle was successfully updated.' }\n format.json { render :show, status: :ok, location: @vehicle }\n put_request\n else\n format.html { render :edit }\n format.json { render json: @vehicle.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @vacuna.update(vacuna_params)\n format.html { redirect_to @vacuna, notice: 'Vacuna was successfully updated.' }\n format.json { render :show, status: :ok, location: @vacuna }\n else\n format.html { render :edit }\n format.json { render json: @vacuna.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @vibe.update(vibe_params)\n format.html { redirect_to @vibe, notice: 'Vibe was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @vibe.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n if @person.seat\n render json: {errors: 'Cannot update a seated person'}, status: 422\n else\n @person.update person_params\n render json: @person\n end\n end",
"def update\n @vote = @votable.votes.find(params[:id])\n\n respond_to do |format|\n if @vote.update(vote_params)\n format.html { redirect_to build_path_vote(@vote), notice: 'Vote was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @vote.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @person = Person.find(params[:id]) \n respond_to do |format|\n if @person.update(person_params)\n format.json { render json: @person, status: :ok }\n else\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n if request.content_type == \"application/json\"\n # .update is like a \"update people set ...\" in sql\n if @person.update(person_params)\n render json: @person\n else\n render json: @person.errors, status: :not_found\n end\n else\n render status: :bad_request\n end\n end",
"def update\n @persona = Persona.find(params[:id])\n \n respond_to do |format|\n if @persona.update_attributes(params[:persona])\n format.json { head :ok }\n else\n format.json { render :json => @persona.errors,\n :status => :unprocessable_entity }\n end\n end\n end",
"def update\n put :update\n end",
"def update\n respond_to do |format|\n if @vet.update(vet_params)\n format.html { redirect_to @vet, notice: 'Vet was successfully updated.' }\n format.json { render :show, status: :ok, location: @vet }\n else\n format.html { render :edit }\n format.json { render json: @vet.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @vitamina.update(vitamina_params)\n format.html { redirect_to @vitamina, notice: 'Vitamina was successfully updated.' }\n format.json { render :show, status: :ok, location: @vitamina }\n else\n format.html { render :edit }\n format.json { render json: @vitamina.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @vocacionada = Vocacionada.find(params[:id])\n\n respond_to do |format|\n if @vocacionada.update_attributes(params[:vocacionada])\n format.html { redirect_to vocacionadas_url}\n flash[:notice] = \"Registro alterado com sucesso!\"\n else\n format.html { render action: \"edit\" }\n format.json { render json: @vocacionada.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @status_ativ = StatusAtiv.find(params[:id])\n\n respond_to do |format|\n if @status_ativ.update_attributes(params[:status_ativ])\n format.html { redirect_to @status_ativ, notice: 'Status ativ was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @status_ativ.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @vitabus.update(vitabus_params)\n format.html { redirect_to @vitabus, notice: 'Vitabu was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @vitabus.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @people.update(people_params)\n format.html { redirect_to root_path(@people), notice: 'VIP ' + @people.name.to_s + ' foi atualizado com sucesso!' }\n format.json { render :show, status: :ok, location: @people }\n else\n format.html { render :edit }\n format.json { render json: @people.errors, status: :unprocessable_entity }\n end\n end\n end",
"def patch(path, data)\n request 'PATCH', path, body: data.to_json\n end",
"def update\n respond_to do |format|\n if @particular_vacancy_request.update(particular_vacancy_request_params)\n format.html { redirect_to @particular_vacancy_request, notice: 'Particular vacancy request was successfully updated.' }\n format.json { render :show, status: :ok, location: @particular_vacancy_request }\n else\n format.html { render :edit }\n format.json { render json: @particular_vacancy_request.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @incentive = Incentive.find(params[:id])\n\n respond_to do |format|\n if @incentive.update_attributes(params[:incentive])\n format.html { redirect_to(@incentive, :notice => 'Incentive was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @incentive.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @vehicle.update(vehicle_params)\n format.html { redirect_to vehicles_url, notice: 'Vehicle was successfully updated.' }\n format.json { render :show, status: :ok, location: @vehcile }\n else\n format.html { render :edit }\n format.json { render json: @vehicle.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @curriculum_vitae.update(curriculum_vitae_params)\n format.html { redirect_to @curriculum_vitae, notice: I18n.t('controllers.curriculum_vitaes.update.success') }\n format.json { render :show, status: :ok, location: @curriculum_vitae }\n else\n format.html { render :edit }\n format.json { render json: @curriculum_vitae.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @viagem.update(viagem_params)\n format.html { redirect_to @viagem, notice: 'Viagem was successfully updated.' }\n format.json { render :show, status: :ok, location: @viagem }\n else\n format.html { render :edit }\n format.json { render json: @viagem.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @vacancy_request_status.update(vacancy_request_status_params)\n format.html { redirect_to @vacancy_request_status, notice: 'Vacancy request status was successfully updated.' }\n format.json { render :show, status: :ok, location: @vacancy_request_status }\n else\n format.html { render :edit }\n format.json { render json: @vacancy_request_status.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n #if @auditv.update(audit_params)\n if @auditv.update(cabecera_params)\n format.html { redirect_to @auditv, notice: 'Auditoria Vidres/BPH/BPM/FD actualitzada.' }\n format.json { render :show, status: :ok, location: @auditv }\n else\n format.html { render :edit }\n format.json { render json: @auditv.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @vrabat = Vrabat.find(params[:id])\n\n respond_to do |format|\n if @vrabat.update_attributes(params[:vrabat])\n format.html { redirect_to @vrabat, notice: 'Vrabat was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @vrabat.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @volunteer = Volunteer.find(params[:id])\n\n respond_to do |format|\n if @volunteer.update_attributes(params[:volunteer])\n format.html { redirect_to @volunteer, notice: 'Volunteer was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @volunteer.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @voucher.update(voucher_params)\n format.html { redirect_to @voucher, notice: 'Voucher was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @voucher.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @voter = Voter.find(params[:id])\n\n respond_to do |format|\n if @voter.update_attributes(params[:voter])\n format.html { redirect_to @voter, notice: 'Voter was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @voter.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @vinyl.update(vinyl_params)\n format.html { redirect_to @vinyl, notice: 'Vinyl was successfully updated.' }\n format.json { render :show, status: :ok, location: @vinyl }\n else\n format.html { render :edit }\n format.json { render json: @vinyl.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @giang_vien = GiangVien.find(params[:id])\n\n respond_to do |format|\n if @giang_vien.update_attributes(params[:giang_vien]) \n format.json { head :no_content }\n else \n format.json { render json: @giang_vien.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @age_tracker.update(age_tracker_params)\n format.html { redirect_to @age_tracker, notice: 'Age tracker was successfully updated.' }\n format.json { render :show, status: :ok, location: @age_tracker }\n else\n format.html { render :edit }\n format.json { render json: @age_tracker.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @custom_vital.update(custom_vital_params)\n format.html { redirect_to @custom_vital, notice: 'Custom vital was successfully updated.' }\n format.json { render :show, status: :ok, location: @custom_vital }\n else\n format.html { render :edit }\n format.json { render json: @custom_vital.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 respond_to do |format|\n if @personnage.update(personnage_params)\n format.html { redirect_to @personnage, notice: \"Personnage was successfully updated.\" }\n format.json { render :show, status: :ok, location: @personnage }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @personnage.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @votaciones_hist.update(votaciones_hist_params)\n format.html { redirect_to @votaciones_hist, notice: 'Votaciones hist was successfully updated.' }\n format.json { render :show, status: :ok, location: @votaciones_hist }\n else\n format.html { render :edit }\n format.json { render json: @votaciones_hist.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @api_v1_progress.update(api_v1_progress_params)\n format.html { redirect_to @api_v1_progress, notice: 'Progress was successfully updated.' }\n format.json { render :show, status: :ok, location: @api_v1_progress }\n else\n format.html { render :edit }\n format.json { render json: @api_v1_progress.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @vodka = Vodka.find(params[:id])\n\n respond_to do |format|\n if @vodka.update_attributes(params[:vodka])\n format.html { redirect_to @vodka, notice: 'Vodka was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @vodka.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update_aos_version(args = {}) \n id = args['id']\n temp_path = \"/aosversions.json/{aosVersionId}\"\n path = temp_path\nargs.keys.each do |key|\n if (key == \"aosversionId\")\n args.delete(key)\n path = temp_path.gsub(\"{#{key}}\", id)\n end\nend\n puts \" PATH : #{path}\"\n put(path, args)\nend",
"def update\n @observacao_vocacionada = ObservacaoVocacionada.find(params[:id])\n\n respond_to do |format|\n if @observacao_vocacionada.update_attributes(params[:observacao_vocacionada])\n format.html { redirect_to @observacao_vocacionada}\n flash[:notice] = \"Registro alterado com sucesso!\"\n else\n format.html { render action: \"edit\" }\n format.json { render json: @observacao_vocacionada.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @grm_vetappt = GrmVetappt.find(params[:id])\n\n respond_to do |format|\n if @grm_vetappt.update_attributes(params[:grm_vetappt])\n format.html { redirect_to @grm_vetappt, notice: 'Vet appointment was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @grm_vetappt.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @garrage.update(garrage_params)\n format.html { redirect_to @garrage, notice: 'Garrage was successfully updated.' }\n format.json { render :show, status: :ok, location: @garrage }\n else\n format.html { render :edit }\n format.json { render json: @garrage.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @vcat.update(vcat_params)\n format.html { redirect_to @vcat, notice: 'Vcat was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @vcat.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @my_visa.update(my_visa_params)\n format.html { redirect_to @my_visa, notice: 'My visa was successfully updated.' }\n format.json { render :show, status: :ok, location: @my_visa }\n else\n format.html { render :edit }\n format.json { render json: @my_visa.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @voucher.update(voucher_params)\n format.html { redirect_to action: 'show', notice: 'Voucher was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @voucher.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @virtual_present = VirtualPresent.find(params[:id])\n\n respond_to do |format|\n if @virtual_present.update(virtual_present_update_params)\n format.js\n format.html { head :no_content }\n format.json { render json: {} }\n else\n format.js\n format.json { render json: @virtual_present.errors, status: :unprocessable_entity }\n format.html { render json: @virtual_present.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @veterinario.update(veterinario_params)\n format.html { redirect_to @veterinario, notice: \"Veterinario was successfully updated.\" }\n format.json { render :show, status: :ok, location: @veterinario }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @veterinario.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @badge = Badge.find(params[:id])\n\n respond_to do |format|\n if @badge.update_attributes(params[:badge])\n format.html { redirect_to @badge, notice: 'Badge was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @badge.errors, status: :unprocessable_entity }\n end\n end\n end"
] |
[
"0.62974554",
"0.62444955",
"0.6187228",
"0.618165",
"0.6171038",
"0.61633855",
"0.6161867",
"0.6106517",
"0.6105012",
"0.609331",
"0.609331",
"0.60928583",
"0.60643804",
"0.6047581",
"0.60459626",
"0.6043728",
"0.60352486",
"0.6026001",
"0.60226023",
"0.6021671",
"0.6006367",
"0.6001931",
"0.59992194",
"0.5987762",
"0.5980562",
"0.59739023",
"0.59553164",
"0.59476197",
"0.5938335",
"0.59357744",
"0.5928113",
"0.5922728",
"0.5912563",
"0.5910599",
"0.5905748",
"0.5899978",
"0.58957326",
"0.5894973",
"0.5884215",
"0.5883345",
"0.58821315",
"0.58483183",
"0.5845057",
"0.58445776",
"0.58436066",
"0.5841471",
"0.58285284",
"0.58236444",
"0.57957095",
"0.57947755",
"0.5784975",
"0.5780428",
"0.577956",
"0.57673484",
"0.5767243",
"0.5765427",
"0.5764102",
"0.5762597",
"0.5760549",
"0.57585526",
"0.57538223",
"0.5751044",
"0.5747112",
"0.57451326",
"0.5739318",
"0.5737441",
"0.572684",
"0.57198876",
"0.57158124",
"0.571576",
"0.571575",
"0.5712634",
"0.5709778",
"0.5708501",
"0.5707811",
"0.5705349",
"0.570286",
"0.5702124",
"0.5694529",
"0.5692781",
"0.5687922",
"0.56860906",
"0.56838924",
"0.5680101",
"0.5679313",
"0.56782895",
"0.56751096",
"0.5674402",
"0.5673276",
"0.56718177",
"0.567047",
"0.566977",
"0.5663133",
"0.56630623",
"0.56607884",
"0.565995",
"0.5658053",
"0.5655812",
"0.56544757",
"0.565387"
] |
0.6584362
|
0
|
DELETE /vicarages/1 DELETE /vicarages/1.json
|
def destroy
@vicarage.destroy
respond_to do |format|
format.html { redirect_to vicarages_url, success: 'La Vicaría fue <strong>eliminada</strong> exitosamente.' }
format.json { head :no_content }
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def delete_aos_version(args = {}) \n delete(\"/aosversions.json/#{args[:aosVersionId]}\", args)\nend",
"def destroy\n @vacancy = Vacancy.find(params[:id])\n @vacancy.destroy\n\n respond_to do |format|\n format.html { redirect_to vacancies_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @vacancy.destroy\n respond_to do |format|\n format.html { redirect_to vacancies_url, notice: 'Вакансия удалена.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @status_ativ = StatusAtiv.find(params[:id])\n @status_ativ.destroy\n\n respond_to do |format|\n format.html { redirect_to status_ativs_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @voc = Voc.find(params[:id])\n @voc.destroy\n\n respond_to do |format|\n format.html { redirect_to vocs_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @vampire = Vampire.find(params[:id])\n @vampire.destroy\n\n respond_to do |format|\n format.html { redirect_to vampires_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @cage.destroy\n\n respond_to do |format|\n format.json { head :no_content }\n end\n end",
"def destroy\n @vacancy.destroy\n respond_to do |format|\n format.html { redirect_to vacancies_url, notice: 'Vacante eliminada correctamente.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @vint = Vint.find(params[:id])\n @vint.destroy\n\n respond_to do |format|\n format.html { redirect_to vints_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @vitabus.destroy\n respond_to do |format|\n format.html { redirect_to vitabus_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @auditv.destroy\n respond_to do |format|\n format.html { redirect_to auditvs_url, notice: 'Auditv was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @gage = Gage.find(params[:id])\n @gage.destroy\n\n respond_to do |format|\n format.html { redirect_to gages_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @vacancy.destroy\n respond_to do |format|\n format.html { redirect_to :back, notice: 'Vacancy was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @vechicle.destroy\n respond_to do |format|\n format.html { redirect_to vechicles_url, notice: 'Vechicle was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @api_v1_post_vote = PostVote.find(params[:id])\n @api_v1_post_vote.destroy\n\n respond_to do |format|\n format.html { redirect_to api_v1_post_votes_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @vacancy.destroy\n respond_to do |format|\n format.html { redirect_to vacancies_url, notice: 'Vacancy was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @vacancy.destroy\n respond_to do |format|\n format.html { redirect_to vacancies_url, notice: 'Vacancy was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @vacancy.destroy\n respond_to do |format|\n format.html { redirect_to vacancies_url, notice: \"Vacancy was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"def destroy\n @vice.destroy\n respond_to do |format|\n format.html { redirect_to vices_url, notice: 'Vice was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @visit = Visit.find(params[:id])\n @visit.destroy\n\n respond_to do |format|\n format.json { head :no_content }\n end\n end",
"def destroy\n @voucher = Voucher.find(params[:id])\n @voucher.destroy\n\n respond_to do |format|\n format.html { redirect_to vouchers_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @admin_village = Admin::Village.find(params[:id])\n @admin_village.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_villages_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @village = Village.find(params[:id])\n @village.destroy\n\n respond_to do |format|\n format.html { redirect_to villages_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @vachana = Vachana.find(params[:id])\n @vachana.destroy\n\n respond_to do |format|\n format.html { redirect_to vachanas_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @vachana = Vachana.find(params[:id])\n @vachana.destroy\n\n respond_to do |format|\n format.html { redirect_to vachanas_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @vegetable = Vegetable.find(params[:id])\n @vegetable.destroy\n\n respond_to do |format|\n format.html { redirect_to vegetables_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @veiculo = Veiculo.find(params[:id])\n @veiculo.destroy\n\n respond_to do |format|\n format.html { redirect_to veiculos_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @virus = Virus.find(params[:id])\n @virus.destroy\n\n respond_to do |format|\n format.html { redirect_to viri_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @observacao_vocacionada = ObservacaoVocacionada.find(params[:id])\n @observacao_vocacionada.destroy\n\n respond_to do |format|\n format.html { redirect_to observacao_vocacionadas_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @my_visa.destroy\n respond_to do |format|\n format.html { redirect_to my_visas_url, notice: 'My visa was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @vacation = Vacation.find(params[:id])\n @vacation.destroy\n\n respond_to do |format|\n format.html { redirect_to vacations_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @gauge = Gauge.find(params[:id])\n @gauge.destroy\n\n respond_to do |format|\n format.html { redirect_to gauges_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @user_vacancy.destroy\n respond_to do |format|\n format.html { redirect_to user_vacancies_url, notice: 'Aplicación eliminada correctamente' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @vodka = Vodka.find(params[:id])\n @vodka.destroy\n\n respond_to do |format|\n format.html { redirect_to vodkas_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @voucher.destroy\n respond_to do |format|\n format.html { redirect_to vouchers_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @voucher.destroy\n respond_to do |format|\n format.html { redirect_to vouchers_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @vano = Vano.find(params[:id])\n @vano.destroy\n\n respond_to do |format|\n format.html { redirect_to vanos_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @kv = Kv.find(params[:id])\n @kv.destroy\n\n respond_to do |format|\n format.html { redirect_to kvs_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @personnage = Personnage.find(params[:id])\n @personnage.destroy\n\n respond_to do |format|\n format.html { redirect_to personnages_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @venta = Venta.find(params[:id])\n @venta.destroy\n\n respond_to do |format|\n format.html { redirect_to ventas_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @voprosy = Voprosy.find(params[:id])\n @voprosy.destroy\n\n respond_to do |format|\n format.html { redirect_to voprosies_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @vip.destroy\n respond_to do |format|\n format.html { redirect_to vips_url, notice: 'Vip was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def delete\n unless possui_acesso?()\n return\n end\n @aviso = Aviso.find(params[:id])\n @aviso.destroy\n\n respond_to do |format|\n format.html { redirect_to avisos_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @ventaganancium.destroy\n respond_to do |format|\n format.html { redirect_to ventaganancia_url, notice: 'Ventaganancium was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @vocalium = Vocalium.find(params[:id])\n @vocalium.destroy\n\n respond_to do |format|\n format.html { redirect_to vocalia_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @vegetal.destroy\n respond_to do |format|\n format.html { redirect_to vegetals_url, notice: 'Vegetal was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @vet = Vet.find(params[:id])\n @vet.destroy\n\n respond_to do |format|\n format.html { redirect_to vets_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @vibe.destroy\n respond_to do |format|\n format.html { redirect_to vibes_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @viagem.destroy\n respond_to do |format|\n format.html { redirect_to viagens_url, notice: 'Viagem was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @vegetable = Vegetable.find(params[:id])\n @vegetable.destroy\n\n respond_to do |format|\n format.html { redirect_to(vegetables_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @votacion.destroy\n respond_to do |format|\n format.html { redirect_to votacions_url, notice: 'Votacion was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @giang_vien = GiangVien.find(params[:id])\n @giang_vien.destroy\n\n respond_to do |format| \n format.json { head :no_content }\n end\n end",
"def destroy\n @vik.destroy\n respond_to do |format|\n format.html { redirect_to viks_url, notice: 'Vik was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def delete\n client.delete(\"/#{id}\")\n end",
"def destroy\n @asignatura.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end",
"def destroy\n @vod.destroy\n respond_to do |format|\n format.html { redirect_to vods_url, notice: 'Vod was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @votaciones_hist.destroy\n respond_to do |format|\n format.html { redirect_to votaciones_hists_url, notice: 'Votaciones hist was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @vehicule_perso = VehiculePerso.find(params[:id])\n @vehicule_perso.destroy\n\n respond_to do |format|\n format.html { redirect_to vehicule_persos_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @vehcile.destroy\n respond_to do |format|\n format.html { redirect_to vehicles_url, notice: 'Vehicle was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @target_age = TargetAge.find(params[:id])\n @target_age.destroy\n\n respond_to do |format|\n format.html { redirect_to target_ages_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @baggage = Baggage.find(params[:id])\n @baggage.destroy\n\n respond_to do |format|\n format.html { redirect_to baggages_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @vegetable.destroy\n respond_to do |format|\n format.html { redirect_to vegetables_url, notice: 'Vegetable was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @sondage.destroy\n respond_to do |format|\n format.html { redirect_to sondages_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @vaccine = Vaccine.find(params[:id])\n @vaccine.destroy\n\n respond_to do |format|\n format.html { redirect_to vaccines_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @vrabat = Vrabat.find(params[:id])\n @vrabat.destroy\n\n respond_to do |format|\n format.html { redirect_to vrabats_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n\n\n\n @vote = Vote.find(params[:id])\n\n @vote.destroy\n\n respond_to do |format|\n format.html { redirect_to votes_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @historial = Historial.find(params[:id])\n @historial.destroy\n\n respond_to do |format|\n format.html { redirect_to historials_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @vip_privilege.destroy\n respond_to do |format|\n format.html { redirect_to vip_privileges_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @visitante.destroy\n respond_to do |format|\n format.html { redirect_to visitantes_url, notice: 'Visitante was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @village.destroy\n respond_to do |format|\n format.html { redirect_to villages_url, notice: 'Village was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @tipo_vehiculo = TipoVehiculo.find(params[:id])\n @tipo_vehiculo.destroy\n\n respond_to do |format|\n format.html { redirect_to tipo_vehiculos_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @vehicle = Vehicle.find(params[:id])\n @vehicle.destroy\n\n respond_to do |format|\n format.html { redirect_to root_path }\n format.json { head :no_content }\n end\n end",
"def destroy\n @persona = Persona.find(params[:id])\n @persona.destroy\n\n respond_to do |format|\n format.json { head :ok }\n end\n \n end",
"def destroy\n @capacidad = Capacidad.find(params[:id])\n @capacidad.destroy\n\n respond_to do |format|\n format.html { redirect_to capacidades_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @vacina.destroy\n respond_to do |format|\n format.html { redirect_to vacinas_url, notice: \"Vacina was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"def destroy\n @capa = Capa.find(params[:id])\n @capa.destroy\n\n respond_to do |format|\n format.html { redirect_to capas_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @budget = Budget.find(params[:id])\n @budget.destroy\n\n respond_to do |format|\n format.html { redirect_to budgets_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @avert = Avert.find(params[:id])\n @avert.destroy\n\n respond_to do |format|\n format.html { redirect_to averts_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @ventum.destroy\n respond_to do |format|\n format.html { redirect_to venta_url, notice: 'Se ha eliminado la venta exitosamente.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @medical.destroy\n respond_to do |format|\n format.html { redirect_to vigs_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @vestimentum.destroy\n respond_to do |format|\n format.html { redirect_to vestimenta_url, notice: 'Vestimentum was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @vano.destroy\n respond_to do |format|\n format.html { redirect_to vanos_url, notice: 'Vano was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @investigated.destroy\n respond_to do |format| \n format.json { head :no_content }\n end\n end",
"def destroy\n @budget = Budget.find(params[:id])\n @budget.destroy\n respond_to do |format|\n format.html { redirect_to budgets_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @serv_adicionale = ServAdicionale.find(params[:id])\n @serv_adicionale.destroy\n\n respond_to do |format|\n format.html { redirect_to serv_adicionales_url }\n format.json { head :no_content }\n end\n end",
"def DeleteView id\n \n APICall(path: \"views/#{id}.json\",method: 'DELETE')\n \n end",
"def destroy\n @incentive = Incentive.find(params[:id])\n @incentive.destroy\n\n respond_to do |format|\n format.html { redirect_to(incentives_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @vicariato = Vicariato.find(params[:id])\n @vicariato.destroy\n\n respond_to do |format|\n format.html { redirect_to(vicariatos_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @badge = Badge.find(params[:id])\n @badge.destroy\n\n respond_to do |format|\n format.html { redirect_to badges_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @qowa_vacation = Vacation.find(params[:id])\n @qowa_vacation.destroy\n\n respond_to do |format|\n format.html { redirect_to qowa_vacations_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @visto.destroy\n respond_to do |format|\n format.html { redirect_to vistos_url, notice: 'Visto was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @servicio = Servicio.find(params[:id])\n @servicio.destroy\n\n respond_to do |format|\n format.html { redirect_to servicios_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n animal = Animal.find(params[:id])\n animal.destroy\n head 204\n end",
"def destroy\n @vacation = Vacation.find(params[:id])\n @vacation.destroy\n\n respond_to do |format|\n format.html { redirect_to(vacations_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @dosage = Dosage.find(params[:id])\n @dosage.destroy\n\n respond_to do |format|\n format.html { redirect_to(dosages_url) }\n format.xml { head :ok }\n end\n end",
"def delete_tenant_circle(args = {}) \n delete(\"/tenantcircles.json/#{args[:circleId]}\", args)\nend",
"def destroy\n @budget_approver.destroy\n respond_to do |format|\n format.html { redirect_to budget_approvers_url, notice: 'Budget approver page was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n #@clinica.destroy\n @clinica.update(:status => 0)\n respond_to do |format|\n format.html { redirect_to clinicas_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @vitamin = Vitamin.find(params[:id])\n @vitamin.destroy\n\n respond_to do |format|\n format.html { redirect_to vitamins_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @api_v1_expense.destroy\n respond_to do |format|\n format.html { redirect_to api_v1_expenses_url, notice: 'Expense was successfully destroyed.' }\n format.json { head :no_content }\n end\n end"
] |
[
"0.7114967",
"0.7102818",
"0.705227",
"0.69948196",
"0.69650114",
"0.69585997",
"0.6944309",
"0.69412225",
"0.6922085",
"0.69157434",
"0.69112563",
"0.6898171",
"0.6897058",
"0.6892828",
"0.6892304",
"0.6879796",
"0.6879796",
"0.6879539",
"0.68690777",
"0.6853215",
"0.6847646",
"0.6842885",
"0.6841674",
"0.6840483",
"0.6840483",
"0.68286705",
"0.68268067",
"0.68110746",
"0.68089426",
"0.68050516",
"0.68023336",
"0.67907417",
"0.6789179",
"0.6767503",
"0.67657065",
"0.67657065",
"0.6765008",
"0.67629576",
"0.6762703",
"0.6757436",
"0.6752919",
"0.67516243",
"0.67410904",
"0.6739899",
"0.67364836",
"0.6731712",
"0.6726114",
"0.6719573",
"0.67134905",
"0.6704013",
"0.6703587",
"0.6702947",
"0.6701687",
"0.669935",
"0.66982186",
"0.6694938",
"0.66916394",
"0.6689005",
"0.6685751",
"0.66856295",
"0.6680896",
"0.6679517",
"0.6678081",
"0.66778344",
"0.6675322",
"0.66748685",
"0.66744965",
"0.6673466",
"0.66714823",
"0.66671795",
"0.66636515",
"0.66612303",
"0.6660789",
"0.6647779",
"0.66440666",
"0.66439426",
"0.6643707",
"0.66415155",
"0.6641362",
"0.6638331",
"0.6633556",
"0.6630529",
"0.66286695",
"0.66261894",
"0.6625886",
"0.66252816",
"0.6625176",
"0.66248745",
"0.66239077",
"0.6622649",
"0.6621738",
"0.66202223",
"0.6619186",
"0.6617619",
"0.6615234",
"0.661237",
"0.66094136",
"0.6608321",
"0.660758",
"0.66065764"
] |
0.7098011
|
2
|
Use callbacks to share common setup or constraints between actions.
|
def set_vicarage
@vicarage = Vicarage.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_handler\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 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 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 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 before_action \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 setup_signals; end",
"def init_actions\n @select_action = SelectAction.new\n @endpoint_mouse_action = EndpointMouseAction.new\n @move_action = MoveAction.new\n 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 after_set_callback; end",
"def initialize(*args)\n super\n @action = :set\nend",
"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 around_hooks; 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 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 default_action; end",
"def setup(&blk)\n @setup_block = blk\n end",
"def my_actions(options)\n @setup = false\n get_template_part(\"custom_used\",\"action_users\",true)\n end",
"def callback_phase\n super\n end",
"def advice\n end",
"def _handle_action_missing(*args); end",
"def call\n setup_context\n super\n end",
"def duas1(action)\n action.call\n action.call\nend",
"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.6163754",
"0.6045816",
"0.5944853",
"0.59169096",
"0.58892167",
"0.58342934",
"0.5776148",
"0.57057375",
"0.57057375",
"0.56534296",
"0.56209534",
"0.54244673",
"0.54101455",
"0.54101455",
"0.54101455",
"0.53951085",
"0.5378493",
"0.53563684",
"0.53399915",
"0.5338049",
"0.53307265",
"0.5312121",
"0.5298173",
"0.5296388",
"0.52952695",
"0.5258086",
"0.52430934",
"0.5237911",
"0.5237911",
"0.5237911",
"0.5237911",
"0.5237911",
"0.52335346",
"0.5232943",
"0.5226392",
"0.52221715",
"0.5217978",
"0.52136153",
"0.52076435",
"0.52067244",
"0.5175402",
"0.5174649",
"0.5173085",
"0.5165201",
"0.5162052",
"0.5157932",
"0.5152905",
"0.5152353",
"0.5150909",
"0.514719",
"0.5138596",
"0.51333916",
"0.51139015",
"0.5113431",
"0.5113431",
"0.5109581",
"0.51066816",
"0.5091428",
"0.5089407",
"0.5082971",
"0.50822043",
"0.50668514",
"0.5055155",
"0.50525695",
"0.50499475",
"0.50499475",
"0.5034445",
"0.50249445",
"0.5022226",
"0.50167644",
"0.5014211",
"0.4999924",
"0.49996212",
"0.49978727",
"0.4989682",
"0.4989682",
"0.49851838",
"0.49817684",
"0.4979687",
"0.49787104",
"0.49688423",
"0.49664098",
"0.49564412",
"0.49561828",
"0.49547398",
"0.4953481",
"0.4952925",
"0.4946049",
"0.494379",
"0.49319315",
"0.49313048",
"0.49269778",
"0.49263066",
"0.49257493",
"0.4924526",
"0.49212465",
"0.49173486",
"0.4915802",
"0.49151486",
"0.49150333",
"0.49147308"
] |
0.0
|
-1
|
Never trust parameters from the scary internet, only allow the white list through.
|
def vicarage_params
params.require(:vicarage).permit(:Name, :managers_id)
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def strong_params\n params.require(:user).permit(param_whitelist)\n end",
"def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end",
"def allow_params_authentication!; end",
"def allowed_params\n ALLOWED_PARAMS\n end",
"def default_param_whitelist\n [\"mode\"]\n end",
"def param_whitelist\n [:role, :title]\n end",
"def expected_permitted_parameter_names; end",
"def safe_params\n params.except(:host, :port, :protocol).permit!\n end",
"def strong_params\n params.require(:team_member).permit(param_whitelist)\n end",
"def permitir_parametros\n \t\tparams.permit!\n \tend",
"def strong_params\n params.require(:community).permit(param_whitelist)\n end",
"def permitted_strong_parameters\n :all #or an array of parameters, example: [:name, :email]\n end",
"def strong_params\n params.require(:education).permit(param_whitelist)\n end",
"def restricted_params\n #params.require(self.controller_name.classify.underscore.to_sym).permit([])\n raise(\"No strong params set, override restricted_params method in your controller. E.g. params.require(:model).permit(:attribute1, :attribute2)\")\n end",
"def allowed_params\n params.require(:user).permit(:username, :email, :password, :password_confirmation)\n end",
"def param_whitelist\n [:rating, :review]\n end",
"def param_whitelist\n whitelist = [\n :username, :name,\n :parent_id,\n :headline, :description, :video,\n :policy, :signup_mode, :category,\n :website, :facebook, :twitter, :linkedin,\n :founded_at,\n privacy: [\n :events,\n :resources\n ],\n permission: [\n :profile,\n :members,\n :children,\n :statistics,\n :posts,\n :listings,\n :resources,\n :events\n ],\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:parent_id)\n unless current_user.role_in(@community) === 'owner'\n whitelist.delete(:privacy)\n whitelist.delete(:permission)\n end\n end\n \n whitelist\n end",
"def param_whitelist\n if @user.present? && current_user != @user\n return [:followed]\n end\n \n whitelist = [\n :username, :email, :password,\n :first_name, :last_name,\n :birthday, :gender,\n :headline, :biography, :ask_about, :focus,\n :website, :facebook, :linkedin, :twitter, :github,\n roles: [],\n skills: [],\n interests: [],\n privacy: { contact: [] },\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:email)\n whitelist.delete(:password)\n end\n \n whitelist\n end",
"def user_params \n \tparams.require(:user).permit(:name, :email, :password, :password_confirmation)# preventing CSTR\n end",
"def user_params\n params.permit(:name, :phoneNumber, :address, :postalCode, :local, :link, :counter, :latitude, :longitude) \n end",
"def valid_params_request?; end",
"def strong_params\n params.require(:experience).permit(param_whitelist)\n end",
"def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end",
"def whitelist_url_params\n params.require(:whitelist_url).permit(:domain)\n end",
"def allowed_params\n params.require(:allowed).permit(:email)\n end",
"def permitted_params\n []\n end",
"def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end",
"def safe_params\n params.permit(:id, :name, :origin, :emails => []); #emails is an array\n end",
"def query_param\n\t\tparams.permit(:first_name, :last_name, :phone)\n\tend",
"def strong_params\n params.require(:success_metric).permit(param_whitelist)\n end",
"def devise_filter\r\n logger.debug(\"In devise_filter =>PARAMS: #{params.inspect}\")\r\n\r\n # White list for sign_up\r\n devise_parameter_sanitizer.for(:sign_up) { |u| u.permit(user_whitelist) }\r\n\r\n # White list for account update\r\n devise_parameter_sanitizer.for(:account_update) { |u| u.permit(user_whitelist, :current_password) }\r\n\r\n # White list for Invitation creation\r\n devise_parameter_sanitizer.for(:invite) { |u| u.permit(:account_type, :email, :invitation_token)}\r\n\r\n # White list for accept invitation\r\n devise_parameter_sanitizer.for(:accept_invitation) { |u| u.permit(user_whitelist, :invitation_token)}\r\n\r\n end",
"def whitelisted_user_params\n params.require(:user).\n permit( :first_name, :last_name, :email,:password,:password_confirmation,:birthday,:gender)\n end",
"def user_params\n ActionController::Parameters.permit_all_parameters = true\n params.require(:user) #.permit(:name, :surname, :phone, :password, :email, :time_zone)\n end",
"def strong_params\n params.require(:metric_change).permit(param_whitelist)\n end",
"def safe_params\n params.require(:user).permit(:name)\n end",
"def get_params\n\t\treturn ActionController::Parameters.new(self.attributes).permit(\"account_id\", \"title\", \"category\", \"introduction\", \"tags\", \"segment_type\", \"visible\", \"status\", \"main_image\")\n\tend",
"def grant_params\n @whitelisted = params.require(:grant).permit(:name, :description, :agency_id, :acronym)\n end",
"def check_params; true; end",
"def param_whitelist\n whitelist = [\n :description,\n :progress,\n :kpi_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:kpi_id)\n end\n \n whitelist\n end",
"def quote_params\n params.permit!\n end",
"def valid_params?; end",
"def paramunold_params\n params.require(:paramunold).permit!\n end",
"def user_params\n\t\tparams.permit(:nickname, :avatar, :description, :password, :gender, :birthday, :email, :phone, :qq_id, :wechat_id)\n\tend",
"def filtered_parameters; end",
"def user_params\n params.permit(\n \t:id,\n \t:email, \n \t:first_name, \n \t:last_name, \n \t:password, \n \t:confirm_token, \n \t:phone_number,\n \t:facebook_link,\n \t:car_model,\n \t:license_plate)\n end",
"def filtering_params\n params.permit(:email, :name)\n end",
"def check_params\n true\n end",
"def wx_public_params\n params.require(:wx_public).permit(:nickname, :manager, :alias)\n end",
"def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end",
"def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end",
"def listing_params\n\t\tparams.permit(:address, :transit_info, :rules, :other_info, :lat, :lng)\n\tend",
"def social_account_params\n\t\t\tparams.require(:social_account).permit!\n\t\tend",
"def safe_params\n resurce_name = self.class.resource_name\n params_method_name = \"#{resurce_name}_params\".to_sym\n if params[resurce_name]\n if respond_to?(params_method_name) || private_methods.include?(params_method_name)\n send(params_method_name)\n else\n raise ActiveModel::ForbiddenAttributesError, \"Please, define the '#{params_method_name}' method in #{self.class.name}\"\n end\n end\n end",
"def url_params\n params.require(:url).permit(:short_url, :original_url, :clicks, :ip_addresses)\n end",
"def user_params\n params.require(:user).permit(:uri, :username, :password, :realname, :email, :publicvisible)\n end",
"def model_params\n\t\tparams.require(:manager).permit(\n\t :user_name,\n :password,\n :email,\n \t\t\t)\n\tend",
"def article_params_whitelist\n params.require(:article).permit(:title, :description, category_ids: [])\n end",
"def college_whitelist_params\n params.require(:college_whitelist).permit(:status)\n end",
"def filtering_params\n params.permit(:email)\n end",
"def active_code_params\n params[:active_code].permit\n end",
"def valid_params(params)\n params.permit(:user_id, :photo_id, :originX, :originY, :width, :height)\n end",
"def 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 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 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 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 unwanted_params\n params.require(:unwanted).permit(:title, :description, :image)\n end",
"def maintenance_request_params\n params[:maintenance_request].permit! #allow all parameters for now\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 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.6978086",
"0.6780264",
"0.6742658",
"0.6738813",
"0.67338693",
"0.65908474",
"0.6501793",
"0.6495506",
"0.64796513",
"0.64755446",
"0.6454826",
"0.6437561",
"0.6377127",
"0.63722163",
"0.6364058",
"0.63178706",
"0.62979764",
"0.62968165",
"0.62913024",
"0.6289789",
"0.6289145",
"0.62875307",
"0.6280997",
"0.62420976",
"0.62388235",
"0.6216686",
"0.62122375",
"0.6208949",
"0.619173",
"0.6176307",
"0.6173907",
"0.6170346",
"0.616111",
"0.6150513",
"0.6150023",
"0.61446756",
"0.6120429",
"0.6112975",
"0.6104845",
"0.6102966",
"0.6087884",
"0.6079323",
"0.60699135",
"0.60602236",
"0.60191786",
"0.60170597",
"0.60100305",
"0.6009527",
"0.60052776",
"0.60052776",
"0.600042",
"0.5999317",
"0.59933805",
"0.5991528",
"0.5991221",
"0.5990094",
"0.5979497",
"0.5966058",
"0.5958738",
"0.59579456",
"0.5957759",
"0.5956938",
"0.5951788",
"0.59511644",
"0.59423065",
"0.59373474",
"0.59361076",
"0.59361076",
"0.59331447",
"0.5928005",
"0.5924882",
"0.5924011",
"0.59169155",
"0.5908037",
"0.5907541",
"0.59061426",
"0.59056246",
"0.5897408",
"0.58960444",
"0.58951247",
"0.5893136",
"0.5892312",
"0.5890385",
"0.58853275",
"0.58801144",
"0.58784765",
"0.5872648",
"0.58682626",
"0.5867028",
"0.58661693",
"0.586578",
"0.58643955",
"0.5863193",
"0.58609086",
"0.5859997",
"0.5858935",
"0.5858632",
"0.5853379",
"0.5852741",
"0.584806",
"0.5847703"
] |
0.0
|
-1
|
Creates or updates a resource.
|
def save
update({})
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def create_resource object\n object.save\n end",
"def create_resource(object)\n object.save\n end",
"def update_resource(resource, attributes)\n resource.attributes = attributes\n resource.save\n resource\n end",
"def save_resource\n resource.save\n end",
"def add(name, resource, attributes = {})\n resources[name] = resource\n resource.update_attributes(attributes) if attributes.any?\n resource\n end",
"def update_resource object, attributes\n object.update attributes\n end",
"def create_resource(new_resource, attributes)\n new_resource.attributes = attributes\n new_resource.save\n new_resource\n end",
"def ar_save_resource\n @resource.save\n end",
"def create(resource)\n resource.client = self\n resource.create\n end",
"def create\n validate_save_and_respond(change_set_class.new(resource_class.new), :new)\n end",
"def perform_create\n resource.save!\n end",
"def save!\n resource.save!\n end",
"def create\n resource = model_class.new(permitted_resource_params)\n ensure_current_store(resource)\n\n if resource.save\n render_serialized_payload(201) { serialize_resource(resource) }\n else\n render_error_payload(resource.errors)\n end\n end",
"def put\n if(resource.collection?)\n Forbidden\n elsif(!resource.parent_exists? || !resource.parent_collection?)\n Conflict\n else\n resource.lock_check if resource.supports_locking?\n status = resource.put(request, response)\n response['Location'] = \"#{scheme}://#{host}:#{port}#{url_format(resource)}\" if status == Created\n response.body = response['Location']\n status\n end\n end",
"def create\n @resource = Resource.new(params[:resource])\n \n respond_to do |format|\n if @resource.save\n format.html { redirect_to @resource, notice: 'Resource was successfully created.' }\n format.json { render json: @resource, status: :created, location: @resource }\n else\n format.html { render action: \"new\" }\n format.json { render json: @resource.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n params[:id] = resource.id if resource.save\n respond_with resource\n end",
"def update_resource(resource_desc, resource_type, authorizer, new_attributes)\n resource = find_resource(resource_desc, resource_type, authorizer)\n authorizer.can_modify_resource?(resource, resource_type)\n resource.update(new_attributes)\n resource\n end",
"def update\n create\n end",
"def create_resource\n class_name.new(get_secure_params).tap do |model|\n model.save\n set_resource_ivar model\n end\n end",
"def save(params: {}, headers: {})\n new_resource = if id\n self.class.patch(id, @data, params: params, headers: headers)\n else\n self.class.create(@data, params: params, headers: headers)\n end\n\n @data = new_resource.to_h\n\n self\n end",
"def update_resource(resource, params)\n check_id_uniformity(params)\n resource.assign_attributes(json_api_attributes(params))\n authorize resource, :update?\n resource.save!\n resource\n end",
"def update_resource(object, attributes)\n object.update(*attributes)\n end",
"def create\n might_update_resource do\n provider.create\n end\n end",
"def create\n might_update_resource do\n provider.create\n end\n end",
"def create\n might_update_resource do\n provider.create\n end\n end",
"def create\n might_update_resource do\n provider.create\n end\n end",
"def create(attributes = {})\n build(attributes).tap { |resource| resource.save }\n end",
"def create\n @resource = Resource.new(resource_params)\n @resource.active = true\n\n respond_to do |format|\n if @resource.save\n format.html { redirect_to @resource, notice: 'Resource was successfully created.' }\n format.json { render :show, status: :created, location: @resource }\n else\n format.html { render :new }\n format.json { render json: @resource.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create(*args)\n raise NotImplementedError, 'Implement a method to create the resource.'\n end",
"def manage_resource(resource)\n unless resource.is_a?(OMF::SFA::Model::Resource)\n raise \"Resource '#{resource}' needs to be of type 'Resource', but is '#{resource.class}'\"\n end\n\n resource.account_id = _get_nil_account.id\n resource.save\n resource\n end",
"def update\n create\n end",
"def create_or_update\n ret_val = false\n load_resource_with_properties\n bandwidth = @item.data.delete('bandwidth')\n temp = Marshal.load(Marshal.dump(@item.data))\n if @item.exists?\n create_if_exists(temp)\n else\n Chef::Log.info \"Creating #{resource_name} '#{name}'\"\n @context.converge_by \"Create #{resource_name} '#{name}'\" do\n @item.create\n end\n ret_val = true\n end\n update_connection_template(bandwidth: bandwidth) if bandwidth\n save_res_info\n ret_val\n end",
"def create\n existing_resource = Resource.find_by_url(params[:resource][:url])\n if existing_resource\n flash[:notice] = \"That resource has already been added, but please give it a review!\"\n redirect_to resource_path(existing_resource) and return\n end\n @resource = Resource.new(params[:resource])\n @resource.contributor = current_user\n\n respond_to do |format|\n if @resource.save\n format.html { redirect_to(@resource, :notice => 'Resource was successfully created.') }\n format.xml { render :xml => @resource, :status => :created, :location => @resource }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @resource.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n model = model_class.new\n action = action_class.new(model, current_user)\n\n respond_with(action.create(resource_attributes))\n end",
"def create\n @resource = Resource.new(params[:resource])\n\n respond_to do |format|\n if @resource.save\n format.html { redirect_to @resource, notice: 'Resource was successfully created.' }\n format.json { render json: @resource, status: :created, location: @resource }\n else\n format.html { render action: \"new\" }\n format.json { render json: @resource.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @resource = Resource.new(resource_params)\n\n respond_to do |format|\n if @resource.save\n format.html { redirect_to @resource, notice: 'Resource was successfully created.' }\n format.json { render :show, status: :created, location: @resource }\n else\n format.html { render :new }\n format.json { render json: @resource.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create(data)\n @create_resource_mixin.create(data)\n end",
"def put(resource, body = \"\", headers = {})\n prepare_request(:put, resource, body, headers)\n end",
"def create\n self.resource = resource_class.new(params_for_create.to_hash.merge({created_by: current_user}))\n\n respond_to do |format|\n if resource.save\n format.html { redirect_to resource, notice: \"#{resource_class_name} was successfully created.\" }\n format.json { render :show, status: :created, location: resource }\n else\n format.html { render :new }\n format.json { render json: resource.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @resource = Resource.new(params[:resource])\n @resource.status = User.find_by_id(session[:user_id]) ? \"reviewed\" : \"draft\"\n\n respond_to do |format|\n if @resource.save\n if User.find_by_id(session[:user_id])\n flash[:notice] = 'Resource was successfully created.'\n else\n notify_resource_added(@resource, request)\n flash[:notice] = 'Thank you for adding the resource. It will appear in the resource list after we have reviewed it.'\n end\n format.html { redirect_to(@resource) }\n format.xml { render :xml => @resource, :status => :created, :location => @resource }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @resource.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update_a_resource(resource_descr, type_to_create, authorizer)\n debug \"update_a_resource: resource_descr: #{resource_descr}, type_to_create: #{type_to_create}\"\n raise 'Method not implemented because the Central Manager just need to pass the same requisition to the other' \\\n ' brokers and create the concatenated results'\n end",
"def create(repository, resource)\n raise NotImplementedError\n end",
"def update(resource, attributes = {})\n resource.client = self\n resource.update(attributes)\n end",
"def create\n @resource = Resource.new(params[:resource])\n\n if @resource.save\n flash[:notice] = 'Resource was successfully created.'\n redirect_to @resource\n else\n render :action => \"new\"\n end\n end",
"def create\n created_resource = create_resource(new_resource, resource_params)\n if created_resource.errors.blank?\n render json: serialize(created_resource),\n status: :created\n else\n render json: serialize_invalid_attributes(created_resource.errors),\n status: :unprocessable_entity\n end\n end",
"def create\n create_or_update\n end",
"def create\n create_or_update\n end",
"def create\n add_breadcrumb I18n.t('integral.navigation.create')\n @resource = resource_klass.new(resource_params)\n\n yield if block_given?\n\n if @resource.save\n respond_successfully(notification_message('creation_success'), edit_backend_resource_url(@resource))\n else\n respond_failure(notification_message('creation_failure'), :new)\n end\n end",
"def create\n self.resource = new_resource\n\n respond_to do |format|\n if resource.save\n flash[:notice] = \"#{resource_name.humanize} was successfully created.\"\n format.html { redirect_to resource_url }\n format.xml do\n header_attrs = {:location => resource_url}\n header_attrs.merge!(:key => resource.key) if resource.respond_to?(:key)\n head :created, header_attrs\n end\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => resource.errors.to_xml, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n update\n end",
"def set_resource\n @resource = Resource.find(params[:id])\n end",
"def set_resource\n @resource = Resource.find(params[:id])\n end",
"def set_resource\n @resource = Resource.find(params[:id])\n end",
"def set_resource\n @resource = Resource.find(params[:id])\n end",
"def set_resource\n @resource = Resource.find(params[:id])\n end",
"def set_resource\n @resource = Resource.find(params[:id])\n end",
"def set_resource\n @resource = Resource.find(params[:id])\n end",
"def set_resource\n @resource = Resource.find(params[:id])\n end",
"def set_resource\n @resource = Resource.find(params[:id])\n end",
"def set_resource\n @resource = Resource.find(params[:id])\n end",
"def set_resource\n @resource = Resource.find(params[:id])\n end",
"def set_resource\n @resource = Resource.find(params[:id])\n end",
"def update(resource, id, format=@default_format)\n options = { resource: resource.class, id: id, format: format }\n reply = put resource_url(options), resource, fhir_headers(options)\n reply.resource = parse_reply(resource.class, format, reply)\n reply.resource_class = resource.class\n reply\n end",
"def action_create\n if @current_resource.exist? && !access_controls.requires_changes?\n Chef::Log.debug \"#{r.path} already exists - nothing to do\"\n\n elsif @current_resource.exist? && access_controls.requires_changes?\n converge_by(access_controls.describe_changes) do\n access_controls.set_all\n end\n r.updated_by_last_action(true)\n\n else\n converge_by \"Download #{r.path}\" do\n backup unless ::File.symlink?(r.path)\n do_download\n end\n do_acl_changes\n load_resource_attributes_from_file(r)\n r.updated_by_last_action(true)\n load_new_resource_state\n r.exist = true\n end\n end",
"def set_resource\n @resource = Resource.find(params[:id])\n end",
"def set_resource\n @resource = Resource.find(params[:id])\n end",
"def set_resource\n @resource = Resource.find(params[:id])\n end",
"def set_resource\n @resource = Resource.find(params[:id])\n end",
"def set_resource\n @resource = Resource.find(params[:id])\n end",
"def set_resource\n @resource = Resource.find(params[:id])\n end",
"def create\n @resource = Resource.new(params[:resource])\n\n respond_to do |format|\n if @resource.save\n flash[:success] = 'Resource was successfully created.'\n format.html { redirect_to admin_resource_path(@resource.id) }\n format.json { render json: @resource, status: :created, location: @resource }\n else\n format.html { render action: \"new\" }\n format.json { render json: @resource.errors.full_messages.join(''), status: :unprocessable_entity }\n end\n end\n end",
"def update(resource,identifier,json)\n raise 'Not Yet Implemented'\n end",
"def update\n create_or_update\n end",
"def create\n add_breadcrumb I18n.t('integral.navigation.create'), \"new_backend_#{controller_name.singularize}_path\".to_sym\n @resource = resource_klass.new(resource_params)\n\n yield if block_given?\n\n if @resource.save\n respond_successfully(notification_message('creation_success'), send(\"edit_backend_#{controller_name.singularize}_path\", @resource.id))\n else\n respond_failure(notification_message('creation_failure'), :new)\n end\n end",
"def save\n self.attributes =\n if persisted?\n PROXY.patch(\"#{resources_name}/#{id}\", attributes)\n else\n @persisted = true\n PROXY.post(resources_name, attributes)\n end\n end",
"def create(resource,identifier,json)\n raise 'Not Yet Implemented'\n end",
"def put(name,&block)\n build_resource(name, :put, &block)\n end",
"def update!(**args)\n @id = args[:id] if args.key?(:id)\n @resource_name = args[:resource_name] if args.key?(:resource_name)\n end",
"def create\n if @current_user\n @resource = Resource.create(resource_params)\n render json: @resource, status: 200\n else\n render json: {}, status: 401\n end \n end",
"def create\n authorize! :create, resource\n current_model_service.create resource, params\n yield if block_given? # after_create\n respond_with resource, location: helpers.show_path(resource)\n end",
"def create\n # Can't create a resource that is not dirty and doesn't have serial keys\n return false if new_record? && !dirty? && !model.key.any? { |p| p.serial? }\n # set defaults for new resource\n properties.each do |property|\n next if attribute_loaded?(property.name)\n property.set(self, property.default_for(self))\n end\n\n return false unless repository.create([ self ]) == 1\n\n @repository = repository\n @new_record = false\n\n repository.identity_map(model).set(key, self)\n\n true\n end",
"def update\n create\n end",
"def update\n create\n end",
"def create\n update\n end",
"def create\n @resource = current_admin.resources.new(resource_params)\n\n respond_to do |format|\n if @resource.save\n format.html { redirect_to @resource, notice: 'Resource was successfully created.' }\n format.json { render action: 'show', status: :created, location: @resource }\n else\n format.html { render action: 'new' }\n format.json { render json: @resource.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create(resource, format=@default_format)\n options = { resource: resource.class, format: format }\n reply = post resource_url(options), resource, fhir_headers(options)\n if [200,201].include? reply.code\n type = reply.response[:headers][:content_type]\n if !type.nil?\n if type.include?('xml') && !reply.body.empty?\n reply.resource = resource.class.from_xml(reply.body)\n elsif type.include?('json') && !reply.body.empty?\n reply.resource = resource.class.from_fhir_json(reply.body)\n else\n reply.resource = resource # just send back the submitted resource\n end\n else\n reply.resource = resource # don't know the content type, so return the resource provided\n end\n else\n reply.resource = resource # just send back the submitted resource\n end\n reply.resource_class = resource.class\n reply\n end",
"def create\n @resource = current_user.resources.build(resource_params)\n\n respond_to do |format|\n if @resource.save\n format.html { redirect_to @resource, notice: 'Resource was successfully created.' }\n format.json { render :show, status: :created, location: @resource }\n else\n format.html { render :new }\n format.json { render json: @resource.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create(resource, options = {}, format = nil)\n base_create(resource, options, format)\n end",
"def update!(**args)\n @resource_id = args[:resource_id] if args.key?(:resource_id)\n end",
"def save\n create_or_update\n end",
"def save\n create_or_update\n end",
"def save\n create_or_update\n end",
"def set_resource\n @resource = Resource.find(params[:id])\n end",
"def create\n @api_v1_resource = Api::V1::Resource.new(api_v1_resource_params)\n\n respond_to do |format|\n if @api_v1_resource.save\n format.html { redirect_to @api_v1_resource, notice: 'Resource was successfully created.' }\n format.json { render :show, status: :created, location: @api_v1_resource }\n else\n format.html { render :new }\n format.json { render json: @api_v1_resource.errors, status: :unprocessable_entity }\n end\n end\n end",
"def save\n # Only save\n if @__mutated__ && !@__mutated__.empty?\n data = Hash[@__mutated__.map { |k| [k, @data[k]] }]\n\n res = put resource_name, id, {resource_name_singular => data}\n\n return res if res.error\n\n res_data = res.__send__(resource_name_singular)\n @data.merge!(res_data)\n @__mutated__.clear\n end\n\n self\n end",
"def create\n @asset = Resource.new(resource_params)\n \n if @asset.save\n redirect_to admin_resource_path(@asset), notice: 'Resource was successfully created.'\n else\n render action: 'new'\n end\n end",
"def save!\n if !self.save\n raise Her::Errors::ResourceInvalid, self\n end\n self\n end",
"def create(params={})\n raise '`create` method is not supported for this resource.'\n end",
"def create(params={})\n raise '`create` method is not supported for this resource.'\n end",
"def create(params={})\n raise '`create` method is not supported for this resource.'\n end",
"def create(params={})\n raise '`create` method is not supported for this resource.'\n end"
] |
[
"0.7610451",
"0.73622066",
"0.72340345",
"0.71839917",
"0.7148188",
"0.69271713",
"0.6923017",
"0.6867716",
"0.68367285",
"0.6762359",
"0.6752489",
"0.6667134",
"0.66656023",
"0.66349393",
"0.6631788",
"0.659067",
"0.6585874",
"0.65452224",
"0.6541691",
"0.65357554",
"0.6531658",
"0.6513351",
"0.6511071",
"0.6511071",
"0.6511071",
"0.6511071",
"0.6510151",
"0.64984596",
"0.64780146",
"0.64645326",
"0.64590913",
"0.6440345",
"0.6425319",
"0.64184994",
"0.64180607",
"0.63956785",
"0.6390872",
"0.6389918",
"0.6384516",
"0.63802207",
"0.6366982",
"0.6364173",
"0.63614804",
"0.6358824",
"0.6358251",
"0.63476354",
"0.63476354",
"0.6339662",
"0.6331902",
"0.6326868",
"0.631458",
"0.631458",
"0.631458",
"0.631458",
"0.631458",
"0.631458",
"0.631458",
"0.631458",
"0.631458",
"0.631458",
"0.631458",
"0.631458",
"0.6310711",
"0.63069904",
"0.6300786",
"0.6300786",
"0.6300786",
"0.6300786",
"0.6300786",
"0.6300786",
"0.62998295",
"0.6293599",
"0.6289369",
"0.62852687",
"0.6283198",
"0.6281778",
"0.62658995",
"0.6264807",
"0.62616134",
"0.62575233",
"0.62569416",
"0.6255727",
"0.6255727",
"0.6255158",
"0.6249482",
"0.6245228",
"0.6245187",
"0.62446666",
"0.6218852",
"0.6216452",
"0.6216452",
"0.6216452",
"0.62145865",
"0.62013507",
"0.6188005",
"0.6180176",
"0.6176291",
"0.61682796",
"0.61682796",
"0.61682796",
"0.61682796"
] |
0.0
|
-1
|
Returns true for resources that behave like an array
|
def array?
false
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def array?\n false\n end",
"def returns_array?\n true\n end",
"def returns_array?\n true\n end",
"def returns_array?\n false\n end",
"def returns_array?\n false\n end",
"def returns_array?\n false\n end",
"def array?(item)\n item.is_a?(Array)\n end",
"def array?\n GtaScm::Types::ARRAY_TYPES.include?(self.arg_type_id)\n end",
"def healthy?() raw && raw.is_a?(Array) end",
"def array_like?(obj)\n obj.respond_to?(:to_ary)\n end",
"def array_collection?\n @array_collection == true\n end",
"def can_convert?\n array.is_a?(Array)\n end",
"def single_item_arrays?\n @options[:single_item_arrays]\n end",
"def array?\n value&.is_a?(Array)\n end",
"def collection_resource?\n @resource_arity.to_s == 'collection'\n end",
"def list?(obj)\n obj.instance_of?(Array)\n end",
"def access_to_resources?(record)\n @normalized_resources.include?(record.resource)\n end",
"def healthy?\n items && items.is_a?(Array)\n end",
"def nested?\n self.resource_tuple.length > 1\n end",
"def array_node?(node)\n node.attributes['type'] == 'collection'\n end",
"def array_type?\n type = self.sexp_type\n @@array_types.include? type\n end",
"def has_resource(name)\n return @resources.has_key?(name) # Exists key in Hash\n # return @resources.include?(name) # Exists value into Array\n end",
"def cached?\n io_index.kind_of?(Array)\n end",
"def is_resource_like\n return (self.is_resource || self.is_collection_object)\n end",
"def list_context?\n klass.kind_of?(Array)\n end",
"def isArray _args\n \"isArray _args;\" \n end",
"def can_deconvert?\n array.is_a?(Array)\n end",
"def any_narray?\n @attributes.any?(&:narray?)\n end",
"def is_a?(type)\n # ActionView requires this for nested attributes to work\n return true if Array == type\n super\n end",
"def multi_segment?\n @data.is_a?(Array)\n end",
"def is_a?(klass)\n klass == Array || super(klass)\n end",
"def is_a?(klass)\n klass == Array || super(klass)\n end",
"def boolean_nested_array(array)\n array.each do |slot|\n return true if slot.kind_of?(Array)\n end\n return false\nend",
"def resource?\n true\n end",
"def attr_is_array(attribute)\n # Getter for objects\n define_method attribute.to_s do\n value = read_attribute(attribute).from_yaml\n if value.nil? or value.blank?\n []\n else\n value\n end\n \tend\n end",
"def has_resources?\n return resources.count > 0\n end",
"def is_array_str?\n (@url.match(/^\\[/)) ? true : false\n end",
"def isArray(obj)\n if (Array.isArray)\n return Array.isArray(obj)\n else\n return Object.prototype.toString.call(obj) === '[object Array]'\n end\n end",
"def is_integer_array? array\n\t\treturn array.all? {|a| a.is_a? Integer}\n\tend",
"def resource_pattern?\n true\n end",
"def assign_singular?\n !returns_array?\n end",
"def homogeneous?\n asset_type_ids.length == 1\n end",
"def active?\n\t\t\t\t!@resources.empty?\n\t\t\tend",
"def respond_to?(method)\n super || @array.respond_to?(method)\n end",
"def error?\n return if @resource.is_a?(Array)\n @resource.key?(\"error\")\n end",
"def available_sp_resources?(sp_resources)\n return sp_resources_all.include?(sp_resources)\n end",
"def expand_resources?\n params['expand'] == 'resources'\n end",
"def singular_resource?\n @resource_arity.to_s == 'singular'\n end",
"def is_dyn_arr?(node,atable)\n #build path\n path = []\n path_string = \"\"\n while node.parent\n path.push(node.name) \n node = node.parent\n end\n path_string << node.name\n path.reverse_each {|p| path_string << \".\" + p}\n atable[\"ARRAY_SIZE\"].each do |p,v|\n if p =~ /#{path_string}/\n return true\n end\n end\n return false\n end",
"def isArrayType(obj)\n return((obj.kind_of? FFI::Struct::InlineArray) or (obj.kind_of? ::Array))\n end",
"def batchable?\n spec[batch_key].size > 1\n end",
"def valid?\n if value.is_a?(Array)\n (value - self.class.list).none?\n else\n self.class.list.include?(value)\n end\n end",
"def active_record_array_collection?\n @active_record_array_collection == true\n end",
"def match_all?\n self.class.array_matching == :all\n end",
"def array?(of: ANY)\n v = wrap(of)\n ->(o) { o.is_a? Array and o.map { |e| v.call(e) }.all? }\n end",
"def is_resource\n return self.resource_type == Resource::RESOURCE;\n end",
"def is_collection\n return self.resource_type == Resource::LEARNING_COLLECTION;\n end",
"def contains_constructable_data?(resource_identifier)\n [:attributes, :relationships].any? { |k| resource_identifier.key?(k) }\n end",
"def is_collection_object\n return self.resource_type == Resource::COLLECTION_OBJECT;\n end",
"def nontrivial_resource_pattern?\n false\n end",
"def nontrivial_resource_pattern?\n false\n end",
"def resource_pattern?\n false\n end",
"def category_of_resources?\n product_type == :category_of_resources\n end",
"def array_element?(yaml_content, start, finish)\n starts_with?('-'.ord, yaml_content, start, finish)\n end",
"def test3(array)\n\tputs \"Test3: Should return an array of arrays -> \"\n\tabg_maker(array).any? {|x| x.class != Array} ? false : true\nend",
"def array_term?(data, term)\n data.first&.send(:[], term)&.is_a?(Array)\n end",
"def schema_is_valid_array?(schema, trace)\n schema_valid_trace(\"schema_is_valid_array?\", schema, trace)\n ((schema.length == 1) ?\n schema_is_valid_internal?(schema[0], trace) :\n schema_valid_error(schema, \"Schema array not of length 1\", trace))\n end",
"def is_array?(array)\n !array.kind_of?(Array) ? (raise Error, Constants::ERRORS[:invalid_array]) : false\n end",
"def has_nested_array?(array)\n array.each do |element|\n return true if element.is_a?(Array)\n end\n false\nend",
"def valid_contents?(arr)\n arr.each { |e| return false unless (1..@size_pow).include?(e) }\n true\n end",
"def valid_abs_resource_hosts?(abs_resource_hosts)\n is_valid = false\n\n if abs_resource_hosts.nil?\n puts \"A valid hosts array is required; nil was specified\"\n puts\n else\n\n begin\n hosts = JSON.parse(abs_resource_hosts)\n host = hosts[0]\n hostname = host[\"hostname\"]\n if !hostname.nil? && !hostname.empty?\n is_valid = true\n else\n puts \"The specified resource host array is not valid: #{abs_resource_hosts}\"\n puts\n end\n rescue\n # TODO: raise?\n puts \"JSON::ParserError encountered parsing the hosts array: #{abs_resource_hosts}\"\n end\n\n end\n\n is_valid\n end",
"def resource?\n product_type == :resource\n end",
"def all_of_type?\n type != Resource::ALL && id == Resource::ALL\n end",
"def isArrayElement(arraySize)\n return arraySize != nil && arraySize != \"\"\nend",
"def array?(value, options = nil)\n return true if value.nil? and not required(options) \n return false unless value.is_a?(Array)\n return int?(value.size, options)\n end",
"def is_array_type?(type)\n return type =~ /^\\w+\\[\\w+\\]$/ ? true : false\n end",
"def check_resource! resource \n resources.include?(resource.to_s) ? resource_parsed(resource) : raise(\"resource should be in [tags, posts, bundles]\") \n end",
"def collection?\n @object.is_a?(Enumerable) && !@object.is_a?(Struct)\n end",
"def resource_partial?\n resource? && !resource_full?\n end",
"def has_included_resources?\n !self.included_resources.empty?\n end",
"def supports_bulk?\n false\n end",
"def contained_by?(resource, container, catalog)\n container_of = catalog.container_of(resource)\n case container_of\n when nil\n false\n when container\n true\n else\n contained_by?(container_of, container, catalog)\n end\nend",
"def array_of(array, klass)\n array.any? { |i| i.class == klass }\n end",
"def all?\n type == Resource::ALL && id == Resource::ALL\n end",
"def resource?\n !reference?\n end",
"def access_to_under_resources?(record)\n resource = record.resource\n @normalized_dirs.include?(resource) or\n @resources.any? {|target| resource.start_with?(target) }\n end",
"def test1(array)\n\tputs \"Test1: Should take an array as argument -> \"\n\tarray.class == Array ? true : false\nend",
"def test1(array)\n\tputs \"Test1: Should take an array as argument -> \"\n\tarray.class == Array ? true : false\nend",
"def array_filters_enabled?\n $array_filters_enabled ||= scanned_client_server!.features.array_filters_enabled?\nend",
"def include_array?(array)\n array.any? { |member| array?(member) }\n end",
"def valid?(source)\n return true if source.nil?\n\n case source\n when Array, Collection then valid_collection?(source)\n when Resource then valid_resource?(source)\n else\n raise ArgumentError, \"+source+ should be an Array or Resource, but was a #{source.class.name}\"\n end\n end",
"def use_multiple?(results)\n if(results.class.to_s == 'Array' && results[0].class.superclass.to_s == 'ActiveRecord::Base')\n return true\n end\n false\n end",
"def check_resource_semantics!; end",
"def multi_arged?\n false\n end",
"def collection?\n @resource.collection?\n end",
"def many?\n [Referenced::HasMany, Embedded::EmbedsMany].any? { |a| self.is_a?(a) }\n end",
"def value?\n value && !value.is_a?(Array)\n end",
"def stack_resource_type?(type)\n stack_resource_types.include?(type)\n end",
"def resources_permitted? kind, identifiers, privilege\n options = {\n privilege: privilege,\n identifiers: identifiers\n }\n resp = RestClient::Resource.new(Conjur::Authz::API.host, credentials)[\"#{Conjur.account}/resources/#{kind}?check=true\"].post(options)\n if resp.code == 204\n [true, []]\n else\n [false, JSON.parse(resp.body)]\n end\n end",
"def accept_multiple_sets?\n return true\n end"
] |
[
"0.7287177",
"0.7043768",
"0.69712514",
"0.6965632",
"0.6965632",
"0.6913455",
"0.6846586",
"0.68010783",
"0.67592716",
"0.6724545",
"0.65788335",
"0.6558414",
"0.6540023",
"0.653822",
"0.6529569",
"0.65236795",
"0.643524",
"0.6390467",
"0.63739914",
"0.6365299",
"0.6315364",
"0.62875706",
"0.62391394",
"0.62311196",
"0.61562437",
"0.61508834",
"0.61305267",
"0.60998267",
"0.6079534",
"0.6076205",
"0.60536516",
"0.6036798",
"0.5996254",
"0.5988589",
"0.5977706",
"0.59535426",
"0.59448713",
"0.59044594",
"0.59037524",
"0.5899451",
"0.5891746",
"0.588915",
"0.5869992",
"0.5869769",
"0.58610237",
"0.585056",
"0.58462596",
"0.5828309",
"0.58166325",
"0.58072716",
"0.58003247",
"0.5784097",
"0.57805586",
"0.5767976",
"0.5764863",
"0.5755791",
"0.57519335",
"0.57346755",
"0.5729167",
"0.5727321",
"0.5727321",
"0.5723367",
"0.57029104",
"0.56987566",
"0.56925666",
"0.5669866",
"0.56681854",
"0.56517285",
"0.5632681",
"0.5630788",
"0.5606844",
"0.5583781",
"0.5579715",
"0.55777943",
"0.5576371",
"0.5574674",
"0.5568538",
"0.5565116",
"0.55545056",
"0.55502975",
"0.5548163",
"0.55472463",
"0.5542887",
"0.55261385",
"0.5515074",
"0.5513425",
"0.55047995",
"0.55047995",
"0.5504745",
"0.55002064",
"0.5493635",
"0.5492053",
"0.549049",
"0.54891515",
"0.5486425",
"0.5484993",
"0.5461546",
"0.5459168",
"0.54573345",
"0.54415005"
] |
0.7255584
|
1
|
By default, fields come flattened in the current locale. This is different for syncs
|
def nested_locale_fields?
# rubocop:disable Style/DoubleNegation
!!@nested_locale_fields
# rubocop:enable Style/DoubleNegation
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def fields_for_query\n self.class.fields_coercions.keys.each_with_object({}) do |field_name, results|\n results[field_name] = @fields.each_with_object({}) do |(locale, fields), field_results|\n field_results[locale] = get_value_from(fields, field_name)\n end\n end\n end",
"def fields_for_query\n self.class.fields_coercions.keys.each_with_object({}) do |field_name, results|\n results[field_name] = @fields.each_with_object({}) do |(locale, fields), field_results|\n field_results[locale] = get_value_from(fields, field_name)\n end\n end\n end",
"def get_field_deserializers()\n return super.merge({\n \"isDefault\" => lambda {|n| @is_default = n.get_boolean_value() },\n \"lastModifiedDateTime\" => lambda {|n| @last_modified_date_time = n.get_date_time_value() },\n \"locale\" => lambda {|n| @locale = n.get_string_value() },\n \"messageTemplate\" => lambda {|n| @message_template = n.get_string_value() },\n \"subject\" => lambda {|n| @subject = n.get_string_value() },\n })\n end",
"def nested_locale_fields?\n false\n end",
"def normalize_flat_keys(locale, key, scope, separator); end",
"def normalize_flat_keys(locale, key, scope, separator); end",
"def get_field_deserializers()\n return super.merge({\n })\n end",
"def get_field_deserializers()\n return super.merge({\n })\n end",
"def get_field_deserializers()\n return super.merge({\n })\n end",
"def enriched_fields(entity)\n original_fields = entity.fields\n additional_fields = additional_fields_for(entity)\n original_fields.merge(additional_fields)\n end",
"def get_field_deserializers()\n return super.merge({\n \"appDisplayName\" => lambda {|n| @app_display_name = n.get_string_value() },\n \"dataType\" => lambda {|n| @data_type = n.get_string_value() },\n \"isSyncedFromOnPremises\" => lambda {|n| @is_synced_from_on_premises = n.get_boolean_value() },\n \"name\" => lambda {|n| @name = n.get_string_value() },\n \"targetObjects\" => lambda {|n| @target_objects = n.get_collection_of_primitive_values(String) },\n })\n end",
"def get_field_deserializers()\n return super.merge({\n \"applicationName\" => lambda {|n| @application_name = n.get_string_value() },\n \"displayName\" => lambda {|n| @display_name = n.get_string_value() },\n \"externalId\" => lambda {|n| @external_id = n.get_string_value() },\n \"webUrl\" => lambda {|n| @web_url = n.get_string_value() },\n })\n end",
"def integrate_locale_attributes \n self.class.locale_class_name.constantize.column_names.each{|key|\n attrs = self.attributes.keys\n if !attrs.include?(key) && !self.respond_to?(key)&&\n self.class.to_s.underscore+\"_id\" != key &&\n # except these keys\n ![\"id\",\"created_at\",\"updated_at\"].include?(key)\n self.class.class_eval <<-EOF\n \n def #{key}\n if locales.loaded?\n l = correct_locale\n l && l.#{key}\n else\n (current_locale || locales.first).#{key}\n end\n end\n EOF\n \n end\n }\n end",
"def get_field_deserializers() \n return super.merge({\n \"categories\" => lambda {|o, n| o.categories = n.get_collection_of_primitive_values(String) },\n \"changeKey\" => lambda {|o, n| o.change_key = n.get_string_value() },\n \"createdDateTime\" => lambda {|o, n| o.created_date_time = n.get_date_value() },\n \"lastModifiedDateTime\" => lambda {|o, n| o.last_modified_date_time = n.get_date_value() },\n })\n end",
"def default_fields_for_forms\n [\n { name: :get_verbose_conflicting_row, width: 50,\n label: I18n.t('admin_import.conflicting_row')\n },\n { name: :import_text, flex: 1, label: I18n.t('admin_import.import_text') },\n\n { name: :name, width: 180, label: I18n.t('activerecord.attributes.team.name') },\n { name: :badge_number, width: 100, label: I18n.t('activerecord.attributes.team.zip') },\n\n { name: :data_import_city__name, width: 200,\n label: I18n.t('activerecord.models.data_import_city')\n },\n { name: :city__get_full_name, width: 200, label: I18n.t('activerecord.models.city')\n }\n ]\n end",
"def get_field_deserializers()\n return super.merge({\n \"appId\" => lambda {|n| @app_id = n.get_string_value() },\n \"displayName\" => lambda {|n| @display_name = n.get_string_value() },\n \"objectId\" => lambda {|n| @object_id_escaped = n.get_string_value() },\n \"publisher\" => lambda {|n| @publisher = n.get_string_value() },\n })\n end",
"def get_field_deserializers()\n return super.merge({\n \"allowedDomainGuidsForSyncApp\" => lambda {|n| @allowed_domain_guids_for_sync_app = n.get_collection_of_primitive_values(UUIDTools::UUID) },\n \"availableManagedPathsForSiteCreation\" => lambda {|n| @available_managed_paths_for_site_creation = n.get_collection_of_primitive_values(String) },\n \"deletedUserPersonalSiteRetentionPeriodInDays\" => lambda {|n| @deleted_user_personal_site_retention_period_in_days = n.get_number_value() },\n \"excludedFileExtensionsForSyncApp\" => lambda {|n| @excluded_file_extensions_for_sync_app = n.get_collection_of_primitive_values(String) },\n \"idleSessionSignOut\" => lambda {|n| @idle_session_sign_out = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::IdleSessionSignOut.create_from_discriminator_value(pn) }) },\n \"imageTaggingOption\" => lambda {|n| @image_tagging_option = n.get_enum_value(MicrosoftGraph::Models::ImageTaggingChoice) },\n \"isCommentingOnSitePagesEnabled\" => lambda {|n| @is_commenting_on_site_pages_enabled = n.get_boolean_value() },\n \"isFileActivityNotificationEnabled\" => lambda {|n| @is_file_activity_notification_enabled = n.get_boolean_value() },\n \"isLegacyAuthProtocolsEnabled\" => lambda {|n| @is_legacy_auth_protocols_enabled = n.get_boolean_value() },\n \"isLoopEnabled\" => lambda {|n| @is_loop_enabled = n.get_boolean_value() },\n \"isMacSyncAppEnabled\" => lambda {|n| @is_mac_sync_app_enabled = n.get_boolean_value() },\n \"isRequireAcceptingUserToMatchInvitedUserEnabled\" => lambda {|n| @is_require_accepting_user_to_match_invited_user_enabled = n.get_boolean_value() },\n \"isResharingByExternalUsersEnabled\" => lambda {|n| @is_resharing_by_external_users_enabled = n.get_boolean_value() },\n \"isSharePointMobileNotificationEnabled\" => lambda {|n| @is_share_point_mobile_notification_enabled = n.get_boolean_value() },\n \"isSharePointNewsfeedEnabled\" => lambda {|n| @is_share_point_newsfeed_enabled = n.get_boolean_value() },\n \"isSiteCreationEnabled\" => lambda {|n| @is_site_creation_enabled = n.get_boolean_value() },\n \"isSiteCreationUIEnabled\" => lambda {|n| @is_site_creation_u_i_enabled = n.get_boolean_value() },\n \"isSitePagesCreationEnabled\" => lambda {|n| @is_site_pages_creation_enabled = n.get_boolean_value() },\n \"isSitesStorageLimitAutomatic\" => lambda {|n| @is_sites_storage_limit_automatic = n.get_boolean_value() },\n \"isSyncButtonHiddenOnPersonalSite\" => lambda {|n| @is_sync_button_hidden_on_personal_site = n.get_boolean_value() },\n \"isUnmanagedSyncAppForTenantRestricted\" => lambda {|n| @is_unmanaged_sync_app_for_tenant_restricted = n.get_boolean_value() },\n \"personalSiteDefaultStorageLimitInMB\" => lambda {|n| @personal_site_default_storage_limit_in_m_b = n.get_object_value(lambda {|pn| Int64.create_from_discriminator_value(pn) }) },\n \"sharingAllowedDomainList\" => lambda {|n| @sharing_allowed_domain_list = n.get_collection_of_primitive_values(String) },\n \"sharingBlockedDomainList\" => lambda {|n| @sharing_blocked_domain_list = n.get_collection_of_primitive_values(String) },\n \"sharingCapability\" => lambda {|n| @sharing_capability = n.get_enum_value(MicrosoftGraph::Models::SharingCapabilities) },\n \"sharingDomainRestrictionMode\" => lambda {|n| @sharing_domain_restriction_mode = n.get_enum_value(MicrosoftGraph::Models::SharingDomainRestrictionMode) },\n \"siteCreationDefaultManagedPath\" => lambda {|n| @site_creation_default_managed_path = n.get_string_value() },\n \"siteCreationDefaultStorageLimitInMB\" => lambda {|n| @site_creation_default_storage_limit_in_m_b = n.get_number_value() },\n \"tenantDefaultTimezone\" => lambda {|n| @tenant_default_timezone = n.get_string_value() },\n })\n end",
"def get_field_deserializers()\n return super.merge({\n \"audiences\" => lambda {|n| @audiences = n.get_collection_of_primitive_values(String) },\n \"description\" => lambda {|n| @description = n.get_string_value() },\n \"issuer\" => lambda {|n| @issuer = n.get_string_value() },\n \"name\" => lambda {|n| @name = n.get_string_value() },\n \"subject\" => lambda {|n| @subject = n.get_string_value() },\n })\n end",
"def default_fields_for_forms\n [\n { name: :get_verbose_conflicting_row, width: 50,\n label: I18n.t('admin_import.conflicting_row')\n },\n { name: :import_text, flex: 1, label: I18n.t('admin_import.import_text') },\n\n { name: :data_import_meeting_program__get_short_name, width: 210,\n label: I18n.t('activerecord.models.data_import_meeting_program')\n },\n { name: :meeting_program__get_short_name, width: 110,\n label: I18n.t('activerecord.models.meeting_program')\n },\n { name: :data_import_team__name, width: 110, label: I18n.t('activerecord.models.data_import_team') },\n { name: :team__name, width: 110, label: I18n.t('activerecord.models.team') },\n\n { name: :rank, width: 30,\n label: I18n.t('activerecord.attributes.meeting_relay_result.rank')\n },\n { name: :is_play_off, width: 50, default_value: true, unchecked_value: 'false',\n label: I18n.t('activerecord.attributes.meeting_relay_result.is_play_off')\n },\n { name: :is_out_of_race, width: 50, default_value: false, unchecked_value: 'false',\n label: I18n.t('activerecord.attributes.meeting_relay_result.is_out_of_race')\n },\n { name: :is_disqualified, width: 50, default_value: false, unchecked_value: 'false',\n label: I18n.t('activerecord.attributes.meeting_relay_result.is_disqualified')\n },\n { name: :disqualification_code_type__i18n_short, width: 50,\n label: I18n.t('activerecord.models.result_type')\n },\n { name: :standard_points, width: 50,\n label: I18n.t('activerecord.attributes.meeting_relay_result.standard_points')\n },\n { name: :meeting_points, width: 50,\n label: I18n.t('activerecord.attributes.meeting_relay_result.meeting_points')\n },\n { name: :minutes, width: 30, label: I18n.t('activerecord.attributes.meeting_relay_result.minutes') },\n { name: :seconds, width: 30, label: I18n.t('activerecord.attributes.meeting_relay_result.seconds') },\n { name: :hundreds, width: 30, label: I18n.t('activerecord.attributes.meeting_relay_result.hundreds') }\n ]\n end",
"def default_fields_for_forms\n [\n { name: :get_verbose_conflicting_row, width: 50,\n label: I18n.t('admin_import.conflicting_row')\n },\n { name: :import_text, flex: 1, label: I18n.t('admin_import.import_text') },\n\n { name: :name, width: 160, label: I18n.t('activerecord.attributes.city.name') },\n { name: :zip, width: 80, label: I18n.t('activerecord.attributes.city.zip') },\n { name: :area, width: 100, label: I18n.t('activerecord.attributes.city.area') },\n { name: :country, width: 100, label: I18n.t('activerecord.attributes.city.country') },\n { name: :country_code, width: 40, label: I18n.t('activerecord.attributes.city.country_code') }\n ]\n end",
"def get_field_deserializers()\n return super.merge({\n \"completedDateTime\" => lambda {|n| @completed_date_time = n.get_date_time_value() },\n \"customLogFolders\" => lambda {|n| @custom_log_folders = n.get_collection_of_primitive_values(String) },\n \"errorMessage\" => lambda {|n| @error_message = n.get_string_value() },\n \"status\" => lambda {|n| @status = n.get_enum_value(MicrosoftGraph::Models::AppLogUploadState) },\n })\n end",
"def get_field_deserializers()\n return super.merge({\n \"connectorServerName\" => lambda {|n| @connector_server_name = n.get_string_value() },\n \"exchangeAlias\" => lambda {|n| @exchange_alias = n.get_string_value() },\n \"exchangeConnectorType\" => lambda {|n| @exchange_connector_type = n.get_enum_value(MicrosoftGraph::Models::DeviceManagementExchangeConnectorType) },\n \"exchangeOrganization\" => lambda {|n| @exchange_organization = n.get_string_value() },\n \"lastSyncDateTime\" => lambda {|n| @last_sync_date_time = n.get_date_time_value() },\n \"primarySmtpAddress\" => lambda {|n| @primary_smtp_address = n.get_string_value() },\n \"serverName\" => lambda {|n| @server_name = n.get_string_value() },\n \"status\" => lambda {|n| @status = n.get_enum_value(MicrosoftGraph::Models::DeviceManagementExchangeConnectorStatus) },\n \"version\" => lambda {|n| @version = n.get_string_value() },\n })\n end",
"def localize_default_attributes\n _title, _slug = self.title, self.slug\n\n self.site.each_locale(false) do |locale, _|\n self.title, self.slug = _title, _slug\n end\n end",
"def get_field_deserializers()\n return super.merge({\n \"schedule\" => lambda {|n| @schedule = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::SynchronizationSchedule.create_from_discriminator_value(pn) }) },\n \"schema\" => lambda {|n| @schema = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::SynchronizationSchema.create_from_discriminator_value(pn) }) },\n \"status\" => lambda {|n| @status = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::SynchronizationStatus.create_from_discriminator_value(pn) }) },\n \"synchronizationJobSettings\" => lambda {|n| @synchronization_job_settings = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::KeyValuePair.create_from_discriminator_value(pn) }) },\n \"templateId\" => lambda {|n| @template_id = n.get_string_value() },\n })\n end",
"def get_field_deserializers()\n return super.merge({\n \"description\" => lambda {|n| @description = n.get_string_value() },\n \"displayName\" => lambda {|n| @display_name = n.get_string_value() },\n \"members\" => lambda {|n| @members = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::DirectoryObject.create_from_discriminator_value(pn) }) },\n \"roleTemplateId\" => lambda {|n| @role_template_id = n.get_string_value() },\n \"scopedMembers\" => lambda {|n| @scoped_members = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::ScopedRoleMembership.create_from_discriminator_value(pn) }) },\n })\n end",
"def get_field_deserializers()\n return super.merge({\n \"description\" => lambda {|n| @description = n.get_string_value() },\n \"displayName\" => lambda {|n| @display_name = n.get_string_value() },\n \"isAvailable\" => lambda {|n| @is_available = n.get_boolean_value() },\n })\n end",
"def get_field_deserializers()\n return super.merge({\n \"createdBy\" => lambda {|n| @created_by = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::AppIdentity.create_from_discriminator_value(pn) }) },\n \"displayName\" => lambda {|n| @display_name = n.get_string_value() },\n \"tasks\" => lambda {|n| @tasks = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::PrintTask.create_from_discriminator_value(pn) }) },\n })\n end",
"def fill_i18n_fields(table, locale)\n table_name = quote_table_name(table)\n\n # set content_id = id\n update(\"UPDATE #{table_name} SET #{quote_column_name('content_id')} = #{quote_column_name('id')}\")\n fix_sequence_consistency([table_name])\n\n # fill the locale field for existing records\n locale ||= Locale.default\n update(\"UPDATE #{table_name} SET #{quote_column_name('locale')} = #{quote(locale)}\")\n end",
"def get_field_deserializers()\n return super.merge({\n \"contractType\" => lambda {|n| @contract_type = n.get_string_value() },\n \"customerId\" => lambda {|n| @customer_id = n.get_guid_value() },\n \"defaultDomainName\" => lambda {|n| @default_domain_name = n.get_string_value() },\n \"displayName\" => lambda {|n| @display_name = n.get_string_value() },\n })\n end",
"def get_field_deserializers()\n return super.merge({\n \"committedContentVersion\" => lambda {|n| @committed_content_version = n.get_string_value() },\n \"contentVersions\" => lambda {|n| @content_versions = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::MobileAppContent.create_from_discriminator_value(pn) }) },\n \"fileName\" => lambda {|n| @file_name = n.get_string_value() },\n \"size\" => lambda {|n| @size = n.get_object_value(lambda {|pn| Int64.create_from_discriminator_value(pn) }) },\n })\n end",
"def get_field_deserializers()\n return super.merge({\n \"displayName\" => lambda {|n| @display_name = n.get_string_value() },\n \"templateId\" => lambda {|n| @template_id = n.get_string_value() },\n \"values\" => lambda {|n| @values = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::SettingValue.create_from_discriminator_value(pn) }) },\n })\n end",
"def get_field_deserializers()\n return {\n \"displayName\" => lambda {|n| @display_name = n.get_string_value() },\n \"locale\" => lambda {|n| @locale = n.get_string_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n }\n end",
"def get_field_deserializers()\n return super.merge({\n \"check32BitOn64System\" => lambda {|n| @check32_bit_on64_system = n.get_boolean_value() },\n \"comparisonValue\" => lambda {|n| @comparison_value = n.get_string_value() },\n \"fileOrFolderName\" => lambda {|n| @file_or_folder_name = n.get_string_value() },\n \"operationType\" => lambda {|n| @operation_type = n.get_enum_value(MicrosoftGraph::Models::Win32LobAppFileSystemOperationType) },\n \"operator\" => lambda {|n| @operator = n.get_enum_value(MicrosoftGraph::Models::Win32LobAppRuleOperator) },\n \"path\" => lambda {|n| @path = n.get_string_value() },\n })\n end",
"def export\n keys = {}\n reset\n db_localizations = {}\n Lit::Localization.find_each do |l|\n db_localizations[l.full_key] = l.get_value\n end\n db_localizations.sort.each do |(l_key, value)|\n current = keys\n yaml_keys = l_key.split('.')\n\n 0.upto(yaml_keys.size - 2) do |i|\n key = yaml_keys[i]\n # Overwrite en.key with en.sub.key\n unless current[key].class == Hash\n current[key] = {}\n end\n current = current[key]\n end\n current[yaml_keys.last] = value\n end\n keys.to_yaml\n end",
"def get_field_deserializers()\n return super.merge({\n \"ccRecipients\" => lambda {|n| @cc_recipients = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::Recipient.create_from_discriminator_value(pn) }) },\n \"hasAttachments\" => lambda {|n| @has_attachments = n.get_boolean_value() },\n \"isLocked\" => lambda {|n| @is_locked = n.get_boolean_value() },\n \"lastDeliveredDateTime\" => lambda {|n| @last_delivered_date_time = n.get_date_time_value() },\n \"posts\" => lambda {|n| @posts = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::Post.create_from_discriminator_value(pn) }) },\n \"preview\" => lambda {|n| @preview = n.get_string_value() },\n \"toRecipients\" => lambda {|n| @to_recipients = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::Recipient.create_from_discriminator_value(pn) }) },\n \"topic\" => lambda {|n| @topic = n.get_string_value() },\n \"uniqueSenders\" => lambda {|n| @unique_senders = n.get_collection_of_primitive_values(String) },\n })\n end",
"def all_fields\n return @all_fields if defined? @all_fields\n\n @all_fields ||= fields.includes(field_set: [:catalog]).each_with_object([]) do |field, all|\n all << field\n next unless field.is_a?(Field::ChoiceSet)\n\n field.choices.includes(:category).each do |choice|\n category = choice.category\n next unless category&.not_deleted?\n\n additional_fields = category.fields.includes(field_set: [:catalog]).map do |f|\n f.category_choice = choice\n f.category_choice_set = field.choice_set\n f\n end\n all.concat(additional_fields)\n end\n end\n end",
"def get_field_deserializers()\n return super.merge({\n \"contentData\" => lambda {|n| @content_data = n.get_string_value() },\n \"destinationRoutingReason\" => lambda {|n| @destination_routing_reason = n.get_enum_value(MicrosoftGraph::Models::MailDestinationRoutingReason) },\n \"recipientEmail\" => lambda {|n| @recipient_email = n.get_string_value() },\n })\n end",
"def get_field_deserializers()\n return super.merge({\n \"recipients\" => lambda {|n| @recipients = n.get_collection_of_primitive_values(String) },\n })\n end",
"def get_field_deserializers()\n return super.merge({\n \"displayName\" => lambda {|n| @display_name = n.get_string_value() },\n \"isCourseActivitySyncEnabled\" => lambda {|n| @is_course_activity_sync_enabled = n.get_boolean_value() },\n \"learningContents\" => lambda {|n| @learning_contents = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::LearningContent.create_from_discriminator_value(pn) }) },\n \"learningCourseActivities\" => lambda {|n| @learning_course_activities = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::LearningCourseActivity.create_from_discriminator_value(pn) }) },\n \"loginWebUrl\" => lambda {|n| @login_web_url = n.get_string_value() },\n \"longLogoWebUrlForDarkTheme\" => lambda {|n| @long_logo_web_url_for_dark_theme = n.get_string_value() },\n \"longLogoWebUrlForLightTheme\" => lambda {|n| @long_logo_web_url_for_light_theme = n.get_string_value() },\n \"squareLogoWebUrlForDarkTheme\" => lambda {|n| @square_logo_web_url_for_dark_theme = n.get_string_value() },\n \"squareLogoWebUrlForLightTheme\" => lambda {|n| @square_logo_web_url_for_light_theme = n.get_string_value() },\n })\n end",
"def get_field_deserializers()\n return super.merge({\n \"appliesTo\" => lambda {|n| @applies_to = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::DirectoryObject.create_from_discriminator_value(pn) }) },\n \"isEnabled\" => lambda {|n| @is_enabled = n.get_boolean_value() },\n \"restrictions\" => lambda {|n| @restrictions = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::AppManagementConfiguration.create_from_discriminator_value(pn) }) },\n })\n end",
"def flatten_translations(locale, data, escape, subtree); end",
"def get_field_deserializers()\n return super.merge({\n \"associatedTeams\" => lambda {|n| @associated_teams = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::AssociatedTeamInfo.create_from_discriminator_value(pn) }) },\n \"installedApps\" => lambda {|n| @installed_apps = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::UserScopeTeamsAppInstallation.create_from_discriminator_value(pn) }) },\n })\n end",
"def all_fields\n fields.values\n end",
"def get_field_deserializers()\n return super.merge({\n \"assignedUserPrincipalName\" => lambda {|n| @assigned_user_principal_name = n.get_string_value() },\n \"groupTag\" => lambda {|n| @group_tag = n.get_string_value() },\n \"hardwareIdentifier\" => lambda {|n| @hardware_identifier = n.get_object_value(lambda {|pn| Base64url.create_from_discriminator_value(pn) }) },\n \"importId\" => lambda {|n| @import_id = n.get_string_value() },\n \"productKey\" => lambda {|n| @product_key = n.get_string_value() },\n \"serialNumber\" => lambda {|n| @serial_number = n.get_string_value() },\n \"state\" => lambda {|n| @state = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::ImportedWindowsAutopilotDeviceIdentityState.create_from_discriminator_value(pn) }) },\n })\n end",
"def get_field_deserializers()\n return {\n \"hubSiteUrls\" => lambda {|n| @hub_site_urls = n.get_collection_of_primitive_values(String) },\n \"propagateToExistingLists\" => lambda {|n| @propagate_to_existing_lists = n.get_boolean_value() },\n }\n end",
"def get_field_deserializers()\n return super.merge({\n \"orderHint\" => lambda {|n| @order_hint = n.get_string_value() },\n })\n end",
"def fields\n fields = orig_fields\n\n fields.instance_exec(self) do |content_type|\n fields.define_singleton_method(:add) do |field|\n content_type.update(fields: content_type.merged_fields(field))\n end\n\n fields.define_singleton_method(:create) do |params|\n field = Contentful::Management::Field.new\n Field.property_coercions.each do |key, _value|\n snakify_key = Support.snakify(key)\n param = params[snakify_key.to_sym]\n field.send(\"#{snakify_key}=\", param) if param\n end\n content_type.update(fields: content_type.merged_fields(field))\n end\n\n fields.define_singleton_method(:destroy) do |id|\n fields = content_type.fields.reject { |field| field.id == id }\n content_type.update(fields: fields)\n end\n end\n\n fields\n end",
"def default_fields_for_forms\n [\n { name: :get_verbose_conflicting_row, width: 50,\n label: I18n.t('admin_import.conflicting_row')\n },\n { name: :import_text, flex: 1, label: I18n.t('admin_import.import_text') },\n\n { name: :event_order, width: 50,\n label: I18n.t('activerecord.attributes.meeting_program.event_order')\n },\n { name: :begin_time, width: 80, xtype: 'datecolumn', format: 'H:i',\n label: I18n.t('activerecord.attributes.meeting_program.begin_time')\n },\n { name: :notes, label: I18n.t(:notes) },\n\n { name: :data_import_meeting_session__get_full_name, width: 160,\n label: I18n.t('activerecord.models.data_import_meeting_session')\n },\n { name: :meeting_session__get_full_name, width: 110,\n label: I18n.t('activerecord.models.meeting_session')\n },\n { name: :event_type__i18n_short, width: 110,\n label: I18n.t('activerecord.models.event_type')\n },\n { name: :category_type__short_name, width: 60,\n label: I18n.t('activerecord.models.category_type')\n },\n # Base timings:\n { name: :minutes, width: 30, label: I18n.t('activerecord.attributes.meeting_program.minutes') },\n { name: :seconds, width: 30, label: I18n.t('activerecord.attributes.meeting_program.seconds') },\n { name: :hundreds, width: 30, label: I18n.t('activerecord.attributes.meeting_program.hundreds') },\n { name: :time_standard__get_timing, width: 110,\n label: I18n.t('activerecord.models.time_standard')\n },\n { name: :heat_type__i18n_description, width: 80,\n label: I18n.t('activerecord.models.heat_type')\n }\n ]\n end",
"def get_field_deserializers()\n return super.merge({\n \"administrativeUnits\" => lambda {|n| @administrative_units = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::AdministrativeUnit.create_from_discriminator_value(pn) }) },\n \"attributeSets\" => lambda {|n| @attribute_sets = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::AttributeSet.create_from_discriminator_value(pn) }) },\n \"customSecurityAttributeDefinitions\" => lambda {|n| @custom_security_attribute_definitions = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::CustomSecurityAttributeDefinition.create_from_discriminator_value(pn) }) },\n \"deletedItems\" => lambda {|n| @deleted_items = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::DirectoryObject.create_from_discriminator_value(pn) }) },\n \"federationConfigurations\" => lambda {|n| @federation_configurations = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::IdentityProviderBase.create_from_discriminator_value(pn) }) },\n \"onPremisesSynchronization\" => lambda {|n| @on_premises_synchronization = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::OnPremisesDirectorySynchronization.create_from_discriminator_value(pn) }) },\n })\n end",
"def all_fields\n @fields.values\n end",
"def get_field_deserializers()\n return super.merge({\n \"chatType\" => lambda {|n| @chat_type = n.get_enum_value(MicrosoftGraph::Models::ChatType) },\n \"createdDateTime\" => lambda {|n| @created_date_time = n.get_date_time_value() },\n \"installedApps\" => lambda {|n| @installed_apps = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::TeamsAppInstallation.create_from_discriminator_value(pn) }) },\n \"lastMessagePreview\" => lambda {|n| @last_message_preview = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::ChatMessageInfo.create_from_discriminator_value(pn) }) },\n \"lastUpdatedDateTime\" => lambda {|n| @last_updated_date_time = n.get_date_time_value() },\n \"members\" => lambda {|n| @members = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::ConversationMember.create_from_discriminator_value(pn) }) },\n \"messages\" => lambda {|n| @messages = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::ChatMessage.create_from_discriminator_value(pn) }) },\n \"onlineMeetingInfo\" => lambda {|n| @online_meeting_info = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::TeamworkOnlineMeetingInfo.create_from_discriminator_value(pn) }) },\n \"permissionGrants\" => lambda {|n| @permission_grants = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::ResourceSpecificPermissionGrant.create_from_discriminator_value(pn) }) },\n \"pinnedMessages\" => lambda {|n| @pinned_messages = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::PinnedChatMessageInfo.create_from_discriminator_value(pn) }) },\n \"tabs\" => lambda {|n| @tabs = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::TeamsTab.create_from_discriminator_value(pn) }) },\n \"tenantId\" => lambda {|n| @tenant_id = n.get_string_value() },\n \"topic\" => lambda {|n| @topic = n.get_string_value() },\n \"viewpoint\" => lambda {|n| @viewpoint = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::ChatViewpoint.create_from_discriminator_value(pn) }) },\n \"webUrl\" => lambda {|n| @web_url = n.get_string_value() },\n })\n end",
"def get_field_deserializers()\n return {\n \"displayName\" => lambda {|n| @display_name = n.get_string_value() },\n \"entityType\" => lambda {|n| @entity_type = n.get_string_value() },\n \"mailNickname\" => lambda {|n| @mail_nickname = n.get_string_value() },\n \"onBehalfOfUserId\" => lambda {|n| @on_behalf_of_user_id = n.get_guid_value() },\n }\n end",
"def get_field_deserializers()\n return super.merge({\n \"applicationId\" => lambda {|n| @application_id = n.get_string_value() },\n \"changeType\" => lambda {|n| @change_type = n.get_string_value() },\n \"clientState\" => lambda {|n| @client_state = n.get_string_value() },\n \"creatorId\" => lambda {|n| @creator_id = n.get_string_value() },\n \"encryptionCertificate\" => lambda {|n| @encryption_certificate = n.get_string_value() },\n \"encryptionCertificateId\" => lambda {|n| @encryption_certificate_id = n.get_string_value() },\n \"expirationDateTime\" => lambda {|n| @expiration_date_time = n.get_date_time_value() },\n \"includeResourceData\" => lambda {|n| @include_resource_data = n.get_boolean_value() },\n \"latestSupportedTlsVersion\" => lambda {|n| @latest_supported_tls_version = n.get_string_value() },\n \"lifecycleNotificationUrl\" => lambda {|n| @lifecycle_notification_url = n.get_string_value() },\n \"notificationQueryOptions\" => lambda {|n| @notification_query_options = n.get_string_value() },\n \"notificationUrl\" => lambda {|n| @notification_url = n.get_string_value() },\n \"notificationUrlAppId\" => lambda {|n| @notification_url_app_id = n.get_string_value() },\n \"resource\" => lambda {|n| @resource = n.get_string_value() },\n })\n end",
"def from_values\n d_attrs = development.reload.fields\n self.fields.map{ |field|\n name = field.fetch('name').to_s\n edit_from = field.fetch('from').to_s\n devel_from = d_attrs.fetch( name )\n [ devel_from, edit_from ]\n }\n end",
"def get_field_deserializers()\n return super.merge({\n \"endDateTime\" => lambda {|n| @end_date_time = n.get_date_time_value() },\n \"joinWebUrl\" => lambda {|n| @join_web_url = n.get_string_value() },\n \"lastModifiedDateTime\" => lambda {|n| @last_modified_date_time = n.get_date_time_value() },\n \"modalities\" => lambda {|n| @modalities = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::CallRecordsModality.create_from_discriminator_value(pn) }) },\n \"organizer\" => lambda {|n| @organizer = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::IdentitySet.create_from_discriminator_value(pn) }) },\n \"participants\" => lambda {|n| @participants = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::IdentitySet.create_from_discriminator_value(pn) }) },\n \"sessions\" => lambda {|n| @sessions = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::CallRecordsSession.create_from_discriminator_value(pn) }) },\n \"startDateTime\" => lambda {|n| @start_date_time = n.get_date_time_value() },\n \"type\" => lambda {|n| @type = n.get_enum_value(MicrosoftGraph::Models::CallRecordsCallType) },\n \"version\" => lambda {|n| @version = n.get_object_value(lambda {|pn| Int64.create_from_discriminator_value(pn) }) },\n })\n end",
"def get_field_deserializers()\n return super.merge({\n \"applicableArchitectures\" => lambda {|n| @applicable_architectures = n.get_enum_value(MicrosoftGraph::Models::WindowsArchitecture) },\n \"applicableDeviceTypes\" => lambda {|n| @applicable_device_types = n.get_enum_value(MicrosoftGraph::Models::WindowsDeviceType) },\n \"committedContainedApps\" => lambda {|n| @committed_contained_apps = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::MobileContainedApp.create_from_discriminator_value(pn) }) },\n \"identityName\" => lambda {|n| @identity_name = n.get_string_value() },\n \"identityPublisherHash\" => lambda {|n| @identity_publisher_hash = n.get_string_value() },\n \"identityResourceIdentifier\" => lambda {|n| @identity_resource_identifier = n.get_string_value() },\n \"identityVersion\" => lambda {|n| @identity_version = n.get_string_value() },\n \"isBundle\" => lambda {|n| @is_bundle = n.get_boolean_value() },\n \"minimumSupportedOperatingSystem\" => lambda {|n| @minimum_supported_operating_system = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::WindowsMinimumOperatingSystem.create_from_discriminator_value(pn) }) },\n })\n end",
"def get_field_deserializers()\n return super.merge({\n \"clusterBy\" => lambda {|n| @cluster_by = n.get_string_value() },\n \"clusterByValue\" => lambda {|n| @cluster_by_value = n.get_string_value() },\n \"emailCount\" => lambda {|n| @email_count = n.get_object_value(lambda {|pn| Int64.create_from_discriminator_value(pn) }) },\n \"networkMessageIds\" => lambda {|n| @network_message_ids = n.get_collection_of_primitive_values(String) },\n \"query\" => lambda {|n| @query = n.get_string_value() },\n \"urn\" => lambda {|n| @urn = n.get_string_value() },\n })\n end",
"def get_field_deserializers()\n return super.merge({\n \"appCrashCount\" => lambda {|n| @app_crash_count = n.get_number_value() },\n \"appDisplayName\" => lambda {|n| @app_display_name = n.get_string_value() },\n \"appName\" => lambda {|n| @app_name = n.get_string_value() },\n \"appPublisher\" => lambda {|n| @app_publisher = n.get_string_value() },\n \"appVersion\" => lambda {|n| @app_version = n.get_string_value() },\n \"deviceDisplayName\" => lambda {|n| @device_display_name = n.get_string_value() },\n \"deviceId\" => lambda {|n| @device_id = n.get_string_value() },\n \"processedDateTime\" => lambda {|n| @processed_date_time = n.get_date_time_value() },\n })\n end",
"def flattened_fields\n metadata_string = String.from_java_bytes @reader.getMetadata\n description_text = self.class.description_from_metadata_xml(metadata_string)\n begin\n metadata = JSON(description_text)\n flattened_fields = metadata.key?('jpdfer_flattened_fields') ? metadata['jpdfer_flattened_fields'] : {}\n rescue JSON::ParserError\n flattened_fields = {}\n end\n flattened_fields.each_with_object({}) do |(name, value), fields|\n fields[name.to_sym] = value\n end\n end",
"def get_field_deserializers()\n return super.merge({\n \"deletedTeams\" => lambda {|n| @deleted_teams = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::DeletedTeam.create_from_discriminator_value(pn) }) },\n \"teamsAppSettings\" => lambda {|n| @teams_app_settings = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::TeamsAppSettings.create_from_discriminator_value(pn) }) },\n \"workforceIntegrations\" => lambda {|n| @workforce_integrations = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::WorkforceIntegration.create_from_discriminator_value(pn) }) },\n })\n end",
"def get_field_deserializers()\n return super.merge({\n \"displayName\" => lambda {|n| @display_name = n.get_string_value() },\n \"file\" => lambda {|n| @file = n.get_object_value(lambda {|pn| Base64url.create_from_discriminator_value(pn) }) },\n \"fileHash\" => lambda {|n| @file_hash = n.get_string_value() },\n \"version\" => lambda {|n| @version = n.get_string_value() },\n })\n end",
"def get_field_deserializers()\n return super.merge({\n \"acceptedDateTime\" => lambda {|n| @accepted_date_time = n.get_date_time_value() },\n \"acceptedVersion\" => lambda {|n| @accepted_version = n.get_number_value() },\n \"termsAndConditions\" => lambda {|n| @terms_and_conditions = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::TermsAndConditions.create_from_discriminator_value(pn) }) },\n \"userDisplayName\" => lambda {|n| @user_display_name = n.get_string_value() },\n \"userPrincipalName\" => lambda {|n| @user_principal_name = n.get_string_value() },\n })\n end",
"def default_fields_for_forms\n [\n { :name => :le_title__get_full_name, :field_label => I18n.t(:le_title, {:scope=>[:activerecord, :models]}),\n # [20121121] For the combo-boxes to have a working query after the 4th char is entered in the edit widget,\n # a lambda statement must be used. Using a pre-computed scope from the Model class prevents Netzke\n # (as of this version) to append the correct WHERE clause to the scope itself (with an inline lambda, instead, it works).\n :scope => lambda { |rel| rel.order(\"name ASC\") }\n },\n { :name => :name, :field_label => I18n.t(:name) },\n { :name => :surname, :field_label => I18n.t(:surname) },\n { :name => :le_contact_type__get_full_name, :field_label => I18n.t(:le_contact_type, {:scope=>[:activerecord, :models]}),\n # [20121121] See note above for the sorted combo boxes.\n :scope => lambda { |rel| rel.order(\"name ASC\") }\n },\n { :name => :is_suspended, :field_label => I18n.t(:is_suspended),\n :default_value => false, :unchecked_value => 'false',\n :field_style => 'min-height: 13px; padding-left: 13px;'\n },\n { :name => :address, :field_label => I18n.t(:address) },\n { :name => :le_city__get_full_name, :field_label => I18n.t(:le_city, {:scope=>[:activerecord, :models]}),\n # [20121121] See note above for the sorted combo boxes.\n :scope => lambda { |rel| rel.order(\"name ASC, area ASC\") }\n },\n { :name => :tax_code, :field_label => I18n.t(:tax_code) },\n { :name => :vat_registration, :field_label => I18n.t(:vat_registration) },\n { :name => :date_birth, :field_label => I18n.t(:date_birth) },\n { :name => :phone_home, :field_label => I18n.t(:phone_home) },\n { :name => :phone_work, :field_label => I18n.t(:phone_work) },\n { :name => :phone_cell, :field_label => I18n.t(:phone_cell) },\n { :name => :phone_fax, :field_label => I18n.t(:phone_fax) },\n { :name => :e_mail, :field_label => I18n.t(:e_mail) },\n\n { :name => :date_last_met, :field_label => I18n.t(:date_last_met) },\n { :name => :notes, :field_label => I18n.t(:notes), :width => 200 },\n { :name => :personal_notes, :field_label => I18n.t(:personal_notes), :width => 200 },\n { :name => :family_notes, :field_label => I18n.t(:family_notes), :width => 200 }\n ]\n end",
"def get_field_deserializers()\n return super.merge({\n \"contentData\" => lambda {|n| @content_data = n.get_string_value() },\n \"fileName\" => lambda {|n| @file_name = n.get_string_value() },\n })\n end",
"def get_field_deserializers()\n return super.merge({\n \"deviceCount\" => lambda {|n| @device_count = n.get_number_value() },\n \"displayName\" => lambda {|n| @display_name = n.get_string_value() },\n \"managedDevices\" => lambda {|n| @managed_devices = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::ManagedDevice.create_from_discriminator_value(pn) }) },\n \"platform\" => lambda {|n| @platform = n.get_enum_value(MicrosoftGraph::Models::DetectedAppPlatformType) },\n \"publisher\" => lambda {|n| @publisher = n.get_string_value() },\n \"sizeInByte\" => lambda {|n| @size_in_byte = n.get_object_value(lambda {|pn| Int64.create_from_discriminator_value(pn) }) },\n \"version\" => lambda {|n| @version = n.get_string_value() },\n })\n end",
"def normalize_fields!\n # TODO: normalize Array of Symbol, String or DM::Property\n\n # TODO: loop over fields, and if the resource doesn't match\n # self.resource, append the property's resource to @links\n # eg:\n #if property.resource != self.resource\n # @links << discover_path_for_property(property)\n #end\n end",
"def default_fields\n @enrollment.default_fields_with_name if @enrollment\n end",
"def display_all_fields\n @@all_fields\n end",
"def get_field_deserializers()\n return super.merge({\n \"bundles\" => lambda {|n| @bundles = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::DriveItem.create_from_discriminator_value(pn) }) },\n \"driveType\" => lambda {|n| @drive_type = n.get_string_value() },\n \"following\" => lambda {|n| @following = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::DriveItem.create_from_discriminator_value(pn) }) },\n \"items\" => lambda {|n| @items = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::DriveItem.create_from_discriminator_value(pn) }) },\n \"list\" => lambda {|n| @list = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::List.create_from_discriminator_value(pn) }) },\n \"owner\" => lambda {|n| @owner = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::IdentitySet.create_from_discriminator_value(pn) }) },\n \"quota\" => lambda {|n| @quota = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::Quota.create_from_discriminator_value(pn) }) },\n \"root\" => lambda {|n| @root = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::DriveItem.create_from_discriminator_value(pn) }) },\n \"sharePointIds\" => lambda {|n| @share_point_ids = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::SharepointIds.create_from_discriminator_value(pn) }) },\n \"special\" => lambda {|n| @special = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::DriveItem.create_from_discriminator_value(pn) }) },\n \"system\" => lambda {|n| @system = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::SystemFacet.create_from_discriminator_value(pn) }) },\n })\n end",
"def get_field_deserializers()\n return super.merge({\n \"allowedOnlineMeetingProviders\" => lambda {|n| @allowed_online_meeting_providers = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::OnlineMeetingProviderType.create_from_discriminator_value(pn) }) },\n \"calendarPermissions\" => lambda {|n| @calendar_permissions = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::CalendarPermission.create_from_discriminator_value(pn) }) },\n \"calendarView\" => lambda {|n| @calendar_view = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::Event.create_from_discriminator_value(pn) }) },\n \"canEdit\" => lambda {|n| @can_edit = n.get_boolean_value() },\n \"canShare\" => lambda {|n| @can_share = n.get_boolean_value() },\n \"canViewPrivateItems\" => lambda {|n| @can_view_private_items = n.get_boolean_value() },\n \"changeKey\" => lambda {|n| @change_key = n.get_string_value() },\n \"color\" => lambda {|n| @color = n.get_enum_value(MicrosoftGraph::Models::CalendarColor) },\n \"defaultOnlineMeetingProvider\" => lambda {|n| @default_online_meeting_provider = n.get_enum_value(MicrosoftGraph::Models::OnlineMeetingProviderType) },\n \"events\" => lambda {|n| @events = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::Event.create_from_discriminator_value(pn) }) },\n \"hexColor\" => lambda {|n| @hex_color = n.get_string_value() },\n \"isDefaultCalendar\" => lambda {|n| @is_default_calendar = n.get_boolean_value() },\n \"isRemovable\" => lambda {|n| @is_removable = n.get_boolean_value() },\n \"isTallyingResponses\" => lambda {|n| @is_tallying_responses = n.get_boolean_value() },\n \"multiValueExtendedProperties\" => lambda {|n| @multi_value_extended_properties = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::MultiValueLegacyExtendedProperty.create_from_discriminator_value(pn) }) },\n \"name\" => lambda {|n| @name = n.get_string_value() },\n \"owner\" => lambda {|n| @owner = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::EmailAddress.create_from_discriminator_value(pn) }) },\n \"singleValueExtendedProperties\" => lambda {|n| @single_value_extended_properties = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::SingleValueLegacyExtendedProperty.create_from_discriminator_value(pn) }) },\n })\n end",
"def get_field_deserializers()\n return super.merge({\n \"assignedDateTime\" => lambda {|n| @assigned_date_time = n.get_date_time_value() },\n \"assignerUserId\" => lambda {|n| @assigner_user_id = n.get_string_value() },\n \"assignmentType\" => lambda {|n| @assignment_type = n.get_enum_value(MicrosoftGraph::Models::AssignmentType) },\n \"dueDateTime\" => lambda {|n| @due_date_time = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::DateTimeTimeZone.create_from_discriminator_value(pn) }) },\n \"notes\" => lambda {|n| @notes = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::ItemBody.create_from_discriminator_value(pn) }) },\n })\n end",
"def get_field_deserializers()\n return super.merge({\n \"appCrashCount\" => lambda {|n| @app_crash_count = n.get_number_value() },\n \"appDisplayName\" => lambda {|n| @app_display_name = n.get_string_value() },\n \"appName\" => lambda {|n| @app_name = n.get_string_value() },\n \"appPublisher\" => lambda {|n| @app_publisher = n.get_string_value() },\n \"appVersion\" => lambda {|n| @app_version = n.get_string_value() },\n \"deviceCountWithCrashes\" => lambda {|n| @device_count_with_crashes = n.get_number_value() },\n \"isLatestUsedVersion\" => lambda {|n| @is_latest_used_version = n.get_boolean_value() },\n \"isMostUsedVersion\" => lambda {|n| @is_most_used_version = n.get_boolean_value() },\n })\n end",
"def get_field_deserializers()\n return super.merge({\n \"attachmentSessions\" => lambda {|n| @attachment_sessions = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::AttachmentSession.create_from_discriminator_value(pn) }) },\n \"attachments\" => lambda {|n| @attachments = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::AttachmentBase.create_from_discriminator_value(pn) }) },\n \"body\" => lambda {|n| @body = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::ItemBody.create_from_discriminator_value(pn) }) },\n \"bodyLastModifiedDateTime\" => lambda {|n| @body_last_modified_date_time = n.get_date_time_value() },\n \"categories\" => lambda {|n| @categories = n.get_collection_of_primitive_values(String) },\n \"checklistItems\" => lambda {|n| @checklist_items = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::ChecklistItem.create_from_discriminator_value(pn) }) },\n \"completedDateTime\" => lambda {|n| @completed_date_time = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::DateTimeTimeZone.create_from_discriminator_value(pn) }) },\n \"createdDateTime\" => lambda {|n| @created_date_time = n.get_date_time_value() },\n \"dueDateTime\" => lambda {|n| @due_date_time = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::DateTimeTimeZone.create_from_discriminator_value(pn) }) },\n \"extensions\" => lambda {|n| @extensions = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::Extension.create_from_discriminator_value(pn) }) },\n \"hasAttachments\" => lambda {|n| @has_attachments = n.get_boolean_value() },\n \"importance\" => lambda {|n| @importance = n.get_enum_value(MicrosoftGraph::Models::Importance) },\n \"isReminderOn\" => lambda {|n| @is_reminder_on = n.get_boolean_value() },\n \"lastModifiedDateTime\" => lambda {|n| @last_modified_date_time = n.get_date_time_value() },\n \"linkedResources\" => lambda {|n| @linked_resources = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::LinkedResource.create_from_discriminator_value(pn) }) },\n \"recurrence\" => lambda {|n| @recurrence = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::PatternedRecurrence.create_from_discriminator_value(pn) }) },\n \"reminderDateTime\" => lambda {|n| @reminder_date_time = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::DateTimeTimeZone.create_from_discriminator_value(pn) }) },\n \"startDateTime\" => lambda {|n| @start_date_time = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::DateTimeTimeZone.create_from_discriminator_value(pn) }) },\n \"status\" => lambda {|n| @status = n.get_enum_value(MicrosoftGraph::Models::TaskStatus) },\n \"title\" => lambda {|n| @title = n.get_string_value() },\n })\n end",
"def get_field_deserializers()\n return super.merge({\n \"connectors\" => lambda {|n| @connectors = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::PrintConnector.create_from_discriminator_value(pn) }) },\n \"hasPhysicalDevice\" => lambda {|n| @has_physical_device = n.get_boolean_value() },\n \"isShared\" => lambda {|n| @is_shared = n.get_boolean_value() },\n \"lastSeenDateTime\" => lambda {|n| @last_seen_date_time = n.get_date_time_value() },\n \"registeredDateTime\" => lambda {|n| @registered_date_time = n.get_date_time_value() },\n \"shares\" => lambda {|n| @shares = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::PrinterShare.create_from_discriminator_value(pn) }) },\n \"taskTriggers\" => lambda {|n| @task_triggers = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::PrintTaskTrigger.create_from_discriminator_value(pn) }) },\n })\n end",
"def normalized_key(name, serializer)\n # serializer && serializer.localized? ? \"#{name}.#{::I18n.locale}\" : name\n serializer&.localized? ? \"#{name}.#{::Mongoid::Fields::I18n.locale}\" : name\n end",
"def reflect_fields\n send_and_receive('admin/luke', params: { fl: '*', 'json.nl' => 'map' })['fields']\n end",
"def get_field_deserializers()\n return super.merge({\n \"email\" => lambda {|n| @email = n.get_string_value() },\n })\n end",
"def get_field_deserializers()\n return super.merge({\n \"acceptances\" => lambda {|n| @acceptances = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::AgreementAcceptance.create_from_discriminator_value(pn) }) },\n \"displayName\" => lambda {|n| @display_name = n.get_string_value() },\n \"file\" => lambda {|n| @file = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::AgreementFile.create_from_discriminator_value(pn) }) },\n \"files\" => lambda {|n| @files = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::AgreementFileLocalization.create_from_discriminator_value(pn) }) },\n \"isPerDeviceAcceptanceRequired\" => lambda {|n| @is_per_device_acceptance_required = n.get_boolean_value() },\n \"isViewingBeforeAcceptanceRequired\" => lambda {|n| @is_viewing_before_acceptance_required = n.get_boolean_value() },\n \"termsExpiration\" => lambda {|n| @terms_expiration = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::TermsExpiration.create_from_discriminator_value(pn) }) },\n \"userReacceptRequiredFrequency\" => lambda {|n| @user_reaccept_required_frequency = n.get_duration_value() },\n })\n end",
"def standard_document_fields\n if object.standard_document\n doc_fields = object.standard_document.standard_document_fields + object.document_fields\n ActiveModel::ArraySerializer.new(doc_fields,\n each_serializer: BaseDocumentFieldSerializer,\n scope: { current_user: current_user, document_id: object.id, skip_secure_value: true },\n root: false)\n else\n []\n end\n end",
"def get_field_deserializers()\n return super.merge({\n \"createdDateTime\" => lambda {|n| @created_date_time = n.get_date_time_value() },\n \"isUsable\" => lambda {|n| @is_usable = n.get_boolean_value() },\n \"isUsableOnce\" => lambda {|n| @is_usable_once = n.get_boolean_value() },\n \"lifetimeInMinutes\" => lambda {|n| @lifetime_in_minutes = n.get_number_value() },\n \"methodUsabilityReason\" => lambda {|n| @method_usability_reason = n.get_string_value() },\n \"startDateTime\" => lambda {|n| @start_date_time = n.get_date_time_value() },\n \"temporaryAccessPass\" => lambda {|n| @temporary_access_pass = n.get_string_value() },\n })\n end",
"def get_field_deserializers()\n return super.merge({\n \"appDefinitions\" => lambda {|n| @app_definitions = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::TeamsAppDefinition.create_from_discriminator_value(pn) }) },\n \"displayName\" => lambda {|n| @display_name = n.get_string_value() },\n \"distributionMethod\" => lambda {|n| @distribution_method = n.get_enum_value(MicrosoftGraph::Models::TeamsAppDistributionMethod) },\n \"externalId\" => lambda {|n| @external_id = n.get_string_value() },\n })\n end",
"def get_field_deserializers()\n return super.merge({\n \"coreBootTimeInMs\" => lambda {|n| @core_boot_time_in_ms = n.get_number_value() },\n \"coreLoginTimeInMs\" => lambda {|n| @core_login_time_in_ms = n.get_number_value() },\n \"deviceId\" => lambda {|n| @device_id = n.get_string_value() },\n \"featureUpdateBootTimeInMs\" => lambda {|n| @feature_update_boot_time_in_ms = n.get_number_value() },\n \"groupPolicyBootTimeInMs\" => lambda {|n| @group_policy_boot_time_in_ms = n.get_number_value() },\n \"groupPolicyLoginTimeInMs\" => lambda {|n| @group_policy_login_time_in_ms = n.get_number_value() },\n \"isFeatureUpdate\" => lambda {|n| @is_feature_update = n.get_boolean_value() },\n \"isFirstLogin\" => lambda {|n| @is_first_login = n.get_boolean_value() },\n \"operatingSystemVersion\" => lambda {|n| @operating_system_version = n.get_string_value() },\n \"responsiveDesktopTimeInMs\" => lambda {|n| @responsive_desktop_time_in_ms = n.get_number_value() },\n \"restartCategory\" => lambda {|n| @restart_category = n.get_enum_value(MicrosoftGraph::Models::UserExperienceAnalyticsOperatingSystemRestartCategory) },\n \"restartFaultBucket\" => lambda {|n| @restart_fault_bucket = n.get_string_value() },\n \"restartStopCode\" => lambda {|n| @restart_stop_code = n.get_string_value() },\n \"startTime\" => lambda {|n| @start_time = n.get_date_time_value() },\n \"totalBootTimeInMs\" => lambda {|n| @total_boot_time_in_ms = n.get_number_value() },\n \"totalLoginTimeInMs\" => lambda {|n| @total_login_time_in_ms = n.get_number_value() },\n })\n end",
"def get_field_deserializers()\n return super.merge({\n \"isDefault\" => lambda {|n| @is_default = n.get_boolean_value() },\n \"links\" => lambda {|n| @links = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::SectionLinks.create_from_discriminator_value(pn) }) },\n \"pages\" => lambda {|n| @pages = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::OnenotePage.create_from_discriminator_value(pn) }) },\n \"pagesUrl\" => lambda {|n| @pages_url = n.get_string_value() },\n \"parentNotebook\" => lambda {|n| @parent_notebook = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::Notebook.create_from_discriminator_value(pn) }) },\n \"parentSectionGroup\" => lambda {|n| @parent_section_group = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::SectionGroup.create_from_discriminator_value(pn) }) },\n })\n end",
"def get_field_deserializers()\n return super.merge({\n \"createdDateTimeUtc\" => lambda {|n| @created_date_time_utc = n.get_date_time_value() },\n \"deviceIdentities\" => lambda {|n| @device_identities = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::ImportedWindowsAutopilotDeviceIdentity.create_from_discriminator_value(pn) }) },\n \"status\" => lambda {|n| @status = n.get_enum_value(MicrosoftGraph::Models::ImportedWindowsAutopilotDeviceIdentityUploadStatus) },\n })\n end",
"def get_field_deserializers()\n return super.merge({\n \"devicesCount\" => lambda {|n| @devices_count = n.get_number_value() },\n \"lastReportedDateTime\" => lambda {|n| @last_reported_date_time = n.get_date_time_value() },\n \"status\" => lambda {|n| @status = n.get_enum_value(MicrosoftGraph::Models::ComplianceStatus) },\n \"userDisplayName\" => lambda {|n| @user_display_name = n.get_string_value() },\n \"userPrincipalName\" => lambda {|n| @user_principal_name = n.get_string_value() },\n })\n end",
"def available_locales\n translation_model.all(:fields => [:locale_tag], :unique => true).map { |t| t.locale }\n end",
"def get_field_deserializers()\n return super.merge({\n \"description\" => lambda {|n| @description = n.get_string_value() },\n \"displayName\" => lambda {|n| @display_name = n.get_string_value() },\n \"isBuiltIn\" => lambda {|n| @is_built_in = n.get_boolean_value() },\n \"roleAssignments\" => lambda {|n| @role_assignments = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::RoleAssignment.create_from_discriminator_value(pn) }) },\n \"rolePermissions\" => lambda {|n| @role_permissions = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::RolePermission.create_from_discriminator_value(pn) }) },\n })\n end",
"def format_locale\n self.locale = self.locale.gsub('_', '-').split(',').first.split('-').first if self.locale.present?\n end",
"def locale_defaults\n if by_subdomain?\n defaults.merge(subdomain: locale.to_s)\n else\n defaults.merge(locale: locale.to_s)\n end\n end",
"def get_field_deserializers()\n return super.merge({\n \"createdDateTime\" => lambda {|n| @created_date_time = n.get_date_time_value() },\n \"deviceId\" => lambda {|n| @device_id = n.get_string_value() },\n \"key\" => lambda {|n| @key = n.get_string_value() },\n \"volumeType\" => lambda {|n| @volume_type = n.get_enum_value(MicrosoftGraph::Models::VolumeType) },\n })\n end",
"def get_field_deserializers()\n return super.merge({\n \"loginName\" => lambda {|n| @login_name = n.get_string_value() },\n })\n end",
"def get_field_deserializers()\n return super.merge({\n \"androidEnrollmentAssignments\" => lambda {|n| @android_enrollment_assignments = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::ComplianceManagementPartnerAssignment.create_from_discriminator_value(pn) }) },\n \"androidOnboarded\" => lambda {|n| @android_onboarded = n.get_boolean_value() },\n \"displayName\" => lambda {|n| @display_name = n.get_string_value() },\n \"iosEnrollmentAssignments\" => lambda {|n| @ios_enrollment_assignments = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::ComplianceManagementPartnerAssignment.create_from_discriminator_value(pn) }) },\n \"iosOnboarded\" => lambda {|n| @ios_onboarded = n.get_boolean_value() },\n \"lastHeartbeatDateTime\" => lambda {|n| @last_heartbeat_date_time = n.get_date_time_value() },\n \"macOsEnrollmentAssignments\" => lambda {|n| @mac_os_enrollment_assignments = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::ComplianceManagementPartnerAssignment.create_from_discriminator_value(pn) }) },\n \"macOsOnboarded\" => lambda {|n| @mac_os_onboarded = n.get_boolean_value() },\n \"partnerState\" => lambda {|n| @partner_state = n.get_enum_value(MicrosoftGraph::Models::DeviceManagementPartnerTenantState) },\n })\n end",
"def get_field_deserializers()\n return super.merge({\n \"comment\" => lambda {|n| @comment = n.get_string_value() },\n \"createdBy\" => lambda {|n| @created_by = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::IdentitySet.create_from_discriminator_value(pn) }) },\n \"createdDateTime\" => lambda {|n| @created_date_time = n.get_date_time_value() },\n \"items\" => lambda {|n| @items = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::DocumentSetVersionItem.create_from_discriminator_value(pn) }) },\n \"shouldCaptureMinorVersion\" => lambda {|n| @should_capture_minor_version = n.get_boolean_value() },\n })\n end",
"def load_all_entries\n results = self.all :order=>\"locale, key\"\n data = {}\n\n results.each do |result|\n #create an empty hash for each locale initially\n data[result.locale] ||= {}\n\n # create the deep nested scopes from the dotted key\n scopes = result.key.split(\".\").map{|k| k.to_sym}\n key = scopes.pop\n scope = scopes.inject(data[result.locale]) do |scope, s|\n # a new scope is empty initially\n # if its a simple string override it with a empty hash\n scope[s] = {} unless scope[s] and scope[s].is_a?(Hash)\n scope[s]\n end\n\n # if we have a pluralization form and the translation key already exists add the specific pluralization form\n if scope[key] && scope[key].is_a?(Hash) && !result.pluralization_index.blank?\n scope[key][result.pluralization_index] = result.text\n\n # if we have a pluralization index add the initial hash\n elsif !result.pluralization_index.blank?\n scope[key] = { result.pluralization_index.to_sym => result.text.to_s }\n\n # else we just add the simple text\n else\n scope[key] = result.text\n end\n\n end\n return data\n end",
"def get_field_deserializers()\n return super.merge({\n \"accountBlockModification\" => lambda {|n| @account_block_modification = n.get_boolean_value() },\n \"activationLockAllowWhenSupervised\" => lambda {|n| @activation_lock_allow_when_supervised = n.get_boolean_value() },\n \"airDropBlocked\" => lambda {|n| @air_drop_blocked = n.get_boolean_value() },\n \"airDropForceUnmanagedDropTarget\" => lambda {|n| @air_drop_force_unmanaged_drop_target = n.get_boolean_value() },\n \"airPlayForcePairingPasswordForOutgoingRequests\" => lambda {|n| @air_play_force_pairing_password_for_outgoing_requests = n.get_boolean_value() },\n \"appStoreBlockAutomaticDownloads\" => lambda {|n| @app_store_block_automatic_downloads = n.get_boolean_value() },\n \"appStoreBlockInAppPurchases\" => lambda {|n| @app_store_block_in_app_purchases = n.get_boolean_value() },\n \"appStoreBlockUIAppInstallation\" => lambda {|n| @app_store_block_u_i_app_installation = n.get_boolean_value() },\n \"appStoreBlocked\" => lambda {|n| @app_store_blocked = n.get_boolean_value() },\n \"appStoreRequirePassword\" => lambda {|n| @app_store_require_password = n.get_boolean_value() },\n \"appleNewsBlocked\" => lambda {|n| @apple_news_blocked = n.get_boolean_value() },\n \"appleWatchBlockPairing\" => lambda {|n| @apple_watch_block_pairing = n.get_boolean_value() },\n \"appleWatchForceWristDetection\" => lambda {|n| @apple_watch_force_wrist_detection = n.get_boolean_value() },\n \"appsSingleAppModeList\" => lambda {|n| @apps_single_app_mode_list = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::AppListItem.create_from_discriminator_value(pn) }) },\n \"appsVisibilityList\" => lambda {|n| @apps_visibility_list = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::AppListItem.create_from_discriminator_value(pn) }) },\n \"appsVisibilityListType\" => lambda {|n| @apps_visibility_list_type = n.get_enum_value(MicrosoftGraph::Models::AppListType) },\n \"bluetoothBlockModification\" => lambda {|n| @bluetooth_block_modification = n.get_boolean_value() },\n \"cameraBlocked\" => lambda {|n| @camera_blocked = n.get_boolean_value() },\n \"cellularBlockDataRoaming\" => lambda {|n| @cellular_block_data_roaming = n.get_boolean_value() },\n \"cellularBlockGlobalBackgroundFetchWhileRoaming\" => lambda {|n| @cellular_block_global_background_fetch_while_roaming = n.get_boolean_value() },\n \"cellularBlockPerAppDataModification\" => lambda {|n| @cellular_block_per_app_data_modification = n.get_boolean_value() },\n \"cellularBlockPersonalHotspot\" => lambda {|n| @cellular_block_personal_hotspot = n.get_boolean_value() },\n \"cellularBlockVoiceRoaming\" => lambda {|n| @cellular_block_voice_roaming = n.get_boolean_value() },\n \"certificatesBlockUntrustedTlsCertificates\" => lambda {|n| @certificates_block_untrusted_tls_certificates = n.get_boolean_value() },\n \"classroomAppBlockRemoteScreenObservation\" => lambda {|n| @classroom_app_block_remote_screen_observation = n.get_boolean_value() },\n \"classroomAppForceUnpromptedScreenObservation\" => lambda {|n| @classroom_app_force_unprompted_screen_observation = n.get_boolean_value() },\n \"compliantAppListType\" => lambda {|n| @compliant_app_list_type = n.get_enum_value(MicrosoftGraph::Models::AppListType) },\n \"compliantAppsList\" => lambda {|n| @compliant_apps_list = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::AppListItem.create_from_discriminator_value(pn) }) },\n \"configurationProfileBlockChanges\" => lambda {|n| @configuration_profile_block_changes = n.get_boolean_value() },\n \"definitionLookupBlocked\" => lambda {|n| @definition_lookup_blocked = n.get_boolean_value() },\n \"deviceBlockEnableRestrictions\" => lambda {|n| @device_block_enable_restrictions = n.get_boolean_value() },\n \"deviceBlockEraseContentAndSettings\" => lambda {|n| @device_block_erase_content_and_settings = n.get_boolean_value() },\n \"deviceBlockNameModification\" => lambda {|n| @device_block_name_modification = n.get_boolean_value() },\n \"diagnosticDataBlockSubmission\" => lambda {|n| @diagnostic_data_block_submission = n.get_boolean_value() },\n \"diagnosticDataBlockSubmissionModification\" => lambda {|n| @diagnostic_data_block_submission_modification = n.get_boolean_value() },\n \"documentsBlockManagedDocumentsInUnmanagedApps\" => lambda {|n| @documents_block_managed_documents_in_unmanaged_apps = n.get_boolean_value() },\n \"documentsBlockUnmanagedDocumentsInManagedApps\" => lambda {|n| @documents_block_unmanaged_documents_in_managed_apps = n.get_boolean_value() },\n \"emailInDomainSuffixes\" => lambda {|n| @email_in_domain_suffixes = n.get_collection_of_primitive_values(String) },\n \"enterpriseAppBlockTrust\" => lambda {|n| @enterprise_app_block_trust = n.get_boolean_value() },\n \"enterpriseAppBlockTrustModification\" => lambda {|n| @enterprise_app_block_trust_modification = n.get_boolean_value() },\n \"faceTimeBlocked\" => lambda {|n| @face_time_blocked = n.get_boolean_value() },\n \"findMyFriendsBlocked\" => lambda {|n| @find_my_friends_blocked = n.get_boolean_value() },\n \"gameCenterBlocked\" => lambda {|n| @game_center_blocked = n.get_boolean_value() },\n \"gamingBlockGameCenterFriends\" => lambda {|n| @gaming_block_game_center_friends = n.get_boolean_value() },\n \"gamingBlockMultiplayer\" => lambda {|n| @gaming_block_multiplayer = n.get_boolean_value() },\n \"hostPairingBlocked\" => lambda {|n| @host_pairing_blocked = n.get_boolean_value() },\n \"iBooksStoreBlockErotica\" => lambda {|n| @i_books_store_block_erotica = n.get_boolean_value() },\n \"iBooksStoreBlocked\" => lambda {|n| @i_books_store_blocked = n.get_boolean_value() },\n \"iCloudBlockActivityContinuation\" => lambda {|n| @i_cloud_block_activity_continuation = n.get_boolean_value() },\n \"iCloudBlockBackup\" => lambda {|n| @i_cloud_block_backup = n.get_boolean_value() },\n \"iCloudBlockDocumentSync\" => lambda {|n| @i_cloud_block_document_sync = n.get_boolean_value() },\n \"iCloudBlockManagedAppsSync\" => lambda {|n| @i_cloud_block_managed_apps_sync = n.get_boolean_value() },\n \"iCloudBlockPhotoLibrary\" => lambda {|n| @i_cloud_block_photo_library = n.get_boolean_value() },\n \"iCloudBlockPhotoStreamSync\" => lambda {|n| @i_cloud_block_photo_stream_sync = n.get_boolean_value() },\n \"iCloudBlockSharedPhotoStream\" => lambda {|n| @i_cloud_block_shared_photo_stream = n.get_boolean_value() },\n \"iCloudRequireEncryptedBackup\" => lambda {|n| @i_cloud_require_encrypted_backup = n.get_boolean_value() },\n \"iTunesBlockExplicitContent\" => lambda {|n| @i_tunes_block_explicit_content = n.get_boolean_value() },\n \"iTunesBlockMusicService\" => lambda {|n| @i_tunes_block_music_service = n.get_boolean_value() },\n \"iTunesBlockRadio\" => lambda {|n| @i_tunes_block_radio = n.get_boolean_value() },\n \"keyboardBlockAutoCorrect\" => lambda {|n| @keyboard_block_auto_correct = n.get_boolean_value() },\n \"keyboardBlockDictation\" => lambda {|n| @keyboard_block_dictation = n.get_boolean_value() },\n \"keyboardBlockPredictive\" => lambda {|n| @keyboard_block_predictive = n.get_boolean_value() },\n \"keyboardBlockShortcuts\" => lambda {|n| @keyboard_block_shortcuts = n.get_boolean_value() },\n \"keyboardBlockSpellCheck\" => lambda {|n| @keyboard_block_spell_check = n.get_boolean_value() },\n \"kioskModeAllowAssistiveSpeak\" => lambda {|n| @kiosk_mode_allow_assistive_speak = n.get_boolean_value() },\n \"kioskModeAllowAssistiveTouchSettings\" => lambda {|n| @kiosk_mode_allow_assistive_touch_settings = n.get_boolean_value() },\n \"kioskModeAllowAutoLock\" => lambda {|n| @kiosk_mode_allow_auto_lock = n.get_boolean_value() },\n \"kioskModeAllowColorInversionSettings\" => lambda {|n| @kiosk_mode_allow_color_inversion_settings = n.get_boolean_value() },\n \"kioskModeAllowRingerSwitch\" => lambda {|n| @kiosk_mode_allow_ringer_switch = n.get_boolean_value() },\n \"kioskModeAllowScreenRotation\" => lambda {|n| @kiosk_mode_allow_screen_rotation = n.get_boolean_value() },\n \"kioskModeAllowSleepButton\" => lambda {|n| @kiosk_mode_allow_sleep_button = n.get_boolean_value() },\n \"kioskModeAllowTouchscreen\" => lambda {|n| @kiosk_mode_allow_touchscreen = n.get_boolean_value() },\n \"kioskModeAllowVoiceOverSettings\" => lambda {|n| @kiosk_mode_allow_voice_over_settings = n.get_boolean_value() },\n \"kioskModeAllowVolumeButtons\" => lambda {|n| @kiosk_mode_allow_volume_buttons = n.get_boolean_value() },\n \"kioskModeAllowZoomSettings\" => lambda {|n| @kiosk_mode_allow_zoom_settings = n.get_boolean_value() },\n \"kioskModeAppStoreUrl\" => lambda {|n| @kiosk_mode_app_store_url = n.get_string_value() },\n \"kioskModeBuiltInAppId\" => lambda {|n| @kiosk_mode_built_in_app_id = n.get_string_value() },\n \"kioskModeManagedAppId\" => lambda {|n| @kiosk_mode_managed_app_id = n.get_string_value() },\n \"kioskModeRequireAssistiveTouch\" => lambda {|n| @kiosk_mode_require_assistive_touch = n.get_boolean_value() },\n \"kioskModeRequireColorInversion\" => lambda {|n| @kiosk_mode_require_color_inversion = n.get_boolean_value() },\n \"kioskModeRequireMonoAudio\" => lambda {|n| @kiosk_mode_require_mono_audio = n.get_boolean_value() },\n \"kioskModeRequireVoiceOver\" => lambda {|n| @kiosk_mode_require_voice_over = n.get_boolean_value() },\n \"kioskModeRequireZoom\" => lambda {|n| @kiosk_mode_require_zoom = n.get_boolean_value() },\n \"lockScreenBlockControlCenter\" => lambda {|n| @lock_screen_block_control_center = n.get_boolean_value() },\n \"lockScreenBlockNotificationView\" => lambda {|n| @lock_screen_block_notification_view = n.get_boolean_value() },\n \"lockScreenBlockPassbook\" => lambda {|n| @lock_screen_block_passbook = n.get_boolean_value() },\n \"lockScreenBlockTodayView\" => lambda {|n| @lock_screen_block_today_view = n.get_boolean_value() },\n \"mediaContentRatingApps\" => lambda {|n| @media_content_rating_apps = n.get_enum_value(MicrosoftGraph::Models::RatingAppsType) },\n \"mediaContentRatingAustralia\" => lambda {|n| @media_content_rating_australia = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::MediaContentRatingAustralia.create_from_discriminator_value(pn) }) },\n \"mediaContentRatingCanada\" => lambda {|n| @media_content_rating_canada = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::MediaContentRatingCanada.create_from_discriminator_value(pn) }) },\n \"mediaContentRatingFrance\" => lambda {|n| @media_content_rating_france = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::MediaContentRatingFrance.create_from_discriminator_value(pn) }) },\n \"mediaContentRatingGermany\" => lambda {|n| @media_content_rating_germany = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::MediaContentRatingGermany.create_from_discriminator_value(pn) }) },\n \"mediaContentRatingIreland\" => lambda {|n| @media_content_rating_ireland = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::MediaContentRatingIreland.create_from_discriminator_value(pn) }) },\n \"mediaContentRatingJapan\" => lambda {|n| @media_content_rating_japan = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::MediaContentRatingJapan.create_from_discriminator_value(pn) }) },\n \"mediaContentRatingNewZealand\" => lambda {|n| @media_content_rating_new_zealand = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::MediaContentRatingNewZealand.create_from_discriminator_value(pn) }) },\n \"mediaContentRatingUnitedKingdom\" => lambda {|n| @media_content_rating_united_kingdom = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::MediaContentRatingUnitedKingdom.create_from_discriminator_value(pn) }) },\n \"mediaContentRatingUnitedStates\" => lambda {|n| @media_content_rating_united_states = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::MediaContentRatingUnitedStates.create_from_discriminator_value(pn) }) },\n \"messagesBlocked\" => lambda {|n| @messages_blocked = n.get_boolean_value() },\n \"networkUsageRules\" => lambda {|n| @network_usage_rules = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::IosNetworkUsageRule.create_from_discriminator_value(pn) }) },\n \"notificationsBlockSettingsModification\" => lambda {|n| @notifications_block_settings_modification = n.get_boolean_value() },\n \"passcodeBlockFingerprintModification\" => lambda {|n| @passcode_block_fingerprint_modification = n.get_boolean_value() },\n \"passcodeBlockFingerprintUnlock\" => lambda {|n| @passcode_block_fingerprint_unlock = n.get_boolean_value() },\n \"passcodeBlockModification\" => lambda {|n| @passcode_block_modification = n.get_boolean_value() },\n \"passcodeBlockSimple\" => lambda {|n| @passcode_block_simple = n.get_boolean_value() },\n \"passcodeExpirationDays\" => lambda {|n| @passcode_expiration_days = n.get_number_value() },\n \"passcodeMinimumCharacterSetCount\" => lambda {|n| @passcode_minimum_character_set_count = n.get_number_value() },\n \"passcodeMinimumLength\" => lambda {|n| @passcode_minimum_length = n.get_number_value() },\n \"passcodeMinutesOfInactivityBeforeLock\" => lambda {|n| @passcode_minutes_of_inactivity_before_lock = n.get_number_value() },\n \"passcodeMinutesOfInactivityBeforeScreenTimeout\" => lambda {|n| @passcode_minutes_of_inactivity_before_screen_timeout = n.get_number_value() },\n \"passcodePreviousPasscodeBlockCount\" => lambda {|n| @passcode_previous_passcode_block_count = n.get_number_value() },\n \"passcodeRequired\" => lambda {|n| @passcode_required = n.get_boolean_value() },\n \"passcodeRequiredType\" => lambda {|n| @passcode_required_type = n.get_enum_value(MicrosoftGraph::Models::RequiredPasswordType) },\n \"passcodeSignInFailureCountBeforeWipe\" => lambda {|n| @passcode_sign_in_failure_count_before_wipe = n.get_number_value() },\n \"podcastsBlocked\" => lambda {|n| @podcasts_blocked = n.get_boolean_value() },\n \"safariBlockAutofill\" => lambda {|n| @safari_block_autofill = n.get_boolean_value() },\n \"safariBlockJavaScript\" => lambda {|n| @safari_block_java_script = n.get_boolean_value() },\n \"safariBlockPopups\" => lambda {|n| @safari_block_popups = n.get_boolean_value() },\n \"safariBlocked\" => lambda {|n| @safari_blocked = n.get_boolean_value() },\n \"safariCookieSettings\" => lambda {|n| @safari_cookie_settings = n.get_enum_value(MicrosoftGraph::Models::WebBrowserCookieSettings) },\n \"safariManagedDomains\" => lambda {|n| @safari_managed_domains = n.get_collection_of_primitive_values(String) },\n \"safariPasswordAutoFillDomains\" => lambda {|n| @safari_password_auto_fill_domains = n.get_collection_of_primitive_values(String) },\n \"safariRequireFraudWarning\" => lambda {|n| @safari_require_fraud_warning = n.get_boolean_value() },\n \"screenCaptureBlocked\" => lambda {|n| @screen_capture_blocked = n.get_boolean_value() },\n \"siriBlockUserGeneratedContent\" => lambda {|n| @siri_block_user_generated_content = n.get_boolean_value() },\n \"siriBlocked\" => lambda {|n| @siri_blocked = n.get_boolean_value() },\n \"siriBlockedWhenLocked\" => lambda {|n| @siri_blocked_when_locked = n.get_boolean_value() },\n \"siriRequireProfanityFilter\" => lambda {|n| @siri_require_profanity_filter = n.get_boolean_value() },\n \"spotlightBlockInternetResults\" => lambda {|n| @spotlight_block_internet_results = n.get_boolean_value() },\n \"voiceDialingBlocked\" => lambda {|n| @voice_dialing_blocked = n.get_boolean_value() },\n \"wallpaperBlockModification\" => lambda {|n| @wallpaper_block_modification = n.get_boolean_value() },\n \"wiFiConnectOnlyToConfiguredNetworks\" => lambda {|n| @wi_fi_connect_only_to_configured_networks = n.get_boolean_value() },\n })\n end",
"def get_field_deserializers()\n return super.merge({\n \"attachments\" => lambda {|n| @attachments = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::Attachment.create_from_discriminator_value(pn) }) },\n \"bccRecipients\" => lambda {|n| @bcc_recipients = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::Recipient.create_from_discriminator_value(pn) }) },\n \"body\" => lambda {|n| @body = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::ItemBody.create_from_discriminator_value(pn) }) },\n \"bodyPreview\" => lambda {|n| @body_preview = n.get_string_value() },\n \"ccRecipients\" => lambda {|n| @cc_recipients = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::Recipient.create_from_discriminator_value(pn) }) },\n \"conversationId\" => lambda {|n| @conversation_id = n.get_string_value() },\n \"conversationIndex\" => lambda {|n| @conversation_index = n.get_object_value(lambda {|pn| Base64url.create_from_discriminator_value(pn) }) },\n \"extensions\" => lambda {|n| @extensions = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::Extension.create_from_discriminator_value(pn) }) },\n \"flag\" => lambda {|n| @flag = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::FollowupFlag.create_from_discriminator_value(pn) }) },\n \"from\" => lambda {|n| @from = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::Recipient.create_from_discriminator_value(pn) }) },\n \"hasAttachments\" => lambda {|n| @has_attachments = n.get_boolean_value() },\n \"importance\" => lambda {|n| @importance = n.get_enum_value(MicrosoftGraph::Models::Importance) },\n \"inferenceClassification\" => lambda {|n| @inference_classification = n.get_enum_value(MicrosoftGraph::Models::InferenceClassificationType) },\n \"internetMessageHeaders\" => lambda {|n| @internet_message_headers = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::InternetMessageHeader.create_from_discriminator_value(pn) }) },\n \"internetMessageId\" => lambda {|n| @internet_message_id = n.get_string_value() },\n \"isDeliveryReceiptRequested\" => lambda {|n| @is_delivery_receipt_requested = n.get_boolean_value() },\n \"isDraft\" => lambda {|n| @is_draft = n.get_boolean_value() },\n \"isRead\" => lambda {|n| @is_read = n.get_boolean_value() },\n \"isReadReceiptRequested\" => lambda {|n| @is_read_receipt_requested = n.get_boolean_value() },\n \"multiValueExtendedProperties\" => lambda {|n| @multi_value_extended_properties = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::MultiValueLegacyExtendedProperty.create_from_discriminator_value(pn) }) },\n \"parentFolderId\" => lambda {|n| @parent_folder_id = n.get_string_value() },\n \"receivedDateTime\" => lambda {|n| @received_date_time = n.get_date_time_value() },\n \"replyTo\" => lambda {|n| @reply_to = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::Recipient.create_from_discriminator_value(pn) }) },\n \"sender\" => lambda {|n| @sender = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::Recipient.create_from_discriminator_value(pn) }) },\n \"sentDateTime\" => lambda {|n| @sent_date_time = n.get_date_time_value() },\n \"singleValueExtendedProperties\" => lambda {|n| @single_value_extended_properties = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::SingleValueLegacyExtendedProperty.create_from_discriminator_value(pn) }) },\n \"subject\" => lambda {|n| @subject = n.get_string_value() },\n \"toRecipients\" => lambda {|n| @to_recipients = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::Recipient.create_from_discriminator_value(pn) }) },\n \"uniqueBody\" => lambda {|n| @unique_body = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::ItemBody.create_from_discriminator_value(pn) }) },\n \"webLink\" => lambda {|n| @web_link = n.get_string_value() },\n })\n end",
"def get_field_deserializers()\n return super.merge({\n \"destinationRoutingReason\" => lambda {|n| @destination_routing_reason = n.get_enum_value(MicrosoftGraph::Models::MailDestinationRoutingReason) },\n \"messageUri\" => lambda {|n| @message_uri = n.get_string_value() },\n \"recipientEmail\" => lambda {|n| @recipient_email = n.get_string_value() },\n })\n end",
"def get_field_deserializers()\n return super.merge({\n \"clientId\" => lambda {|n| @client_id = n.get_string_value() },\n \"consentType\" => lambda {|n| @consent_type = n.get_string_value() },\n \"principalId\" => lambda {|n| @principal_id = n.get_string_value() },\n \"resourceId\" => lambda {|n| @resource_id = n.get_string_value() },\n \"scope\" => lambda {|n| @scope = n.get_string_value() },\n })\n end",
"def get_field_deserializers()\n return super.merge({\n \"lowerAddress\" => lambda {|n| @lower_address = n.get_string_value() },\n \"upperAddress\" => lambda {|n| @upper_address = n.get_string_value() },\n })\n end",
"def get_field_deserializers()\n return super.merge({\n \"assignedTo\" => lambda {|n| @assigned_to = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::Identity.create_from_discriminator_value(pn) }) },\n \"closedDateTime\" => lambda {|n| @closed_date_time = n.get_date_time_value() },\n \"createdBy\" => lambda {|n| @created_by = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::IdentitySet.create_from_discriminator_value(pn) }) },\n \"createdDateTime\" => lambda {|n| @created_date_time = n.get_date_time_value() },\n \"dataSubject\" => lambda {|n| @data_subject = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::DataSubject.create_from_discriminator_value(pn) }) },\n \"dataSubjectType\" => lambda {|n| @data_subject_type = n.get_enum_value(MicrosoftGraph::Models::DataSubjectType) },\n \"description\" => lambda {|n| @description = n.get_string_value() },\n \"displayName\" => lambda {|n| @display_name = n.get_string_value() },\n \"history\" => lambda {|n| @history = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::SubjectRightsRequestHistory.create_from_discriminator_value(pn) }) },\n \"insight\" => lambda {|n| @insight = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::SubjectRightsRequestDetail.create_from_discriminator_value(pn) }) },\n \"internalDueDateTime\" => lambda {|n| @internal_due_date_time = n.get_date_time_value() },\n \"lastModifiedBy\" => lambda {|n| @last_modified_by = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::IdentitySet.create_from_discriminator_value(pn) }) },\n \"lastModifiedDateTime\" => lambda {|n| @last_modified_date_time = n.get_date_time_value() },\n \"notes\" => lambda {|n| @notes = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::AuthoredNote.create_from_discriminator_value(pn) }) },\n \"regulations\" => lambda {|n| @regulations = n.get_collection_of_primitive_values(String) },\n \"stages\" => lambda {|n| @stages = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::SubjectRightsRequestStageDetail.create_from_discriminator_value(pn) }) },\n \"status\" => lambda {|n| @status = n.get_enum_value(MicrosoftGraph::Models::SubjectRightsRequestStatus) },\n \"team\" => lambda {|n| @team = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::Team.create_from_discriminator_value(pn) }) },\n \"type\" => lambda {|n| @type = n.get_enum_value(MicrosoftGraph::Models::SubjectRightsRequestType) },\n })\n end"
] |
[
"0.6206649",
"0.6206649",
"0.610423",
"0.5944875",
"0.59296626",
"0.59296626",
"0.57988274",
"0.57988274",
"0.57988274",
"0.57168967",
"0.5714177",
"0.5679722",
"0.5661977",
"0.56419057",
"0.56054455",
"0.5594809",
"0.5578505",
"0.55685985",
"0.5568057",
"0.55503464",
"0.55461055",
"0.5540352",
"0.5529691",
"0.55181247",
"0.5482187",
"0.5475211",
"0.5457598",
"0.5455359",
"0.5449769",
"0.5431561",
"0.542464",
"0.5424334",
"0.5405814",
"0.54038846",
"0.5403289",
"0.538409",
"0.53826004",
"0.53722984",
"0.53547186",
"0.53355926",
"0.53231245",
"0.5322557",
"0.53221923",
"0.53120255",
"0.5308931",
"0.52989495",
"0.5297507",
"0.52846706",
"0.5280591",
"0.52797556",
"0.52775913",
"0.526564",
"0.52639246",
"0.52626866",
"0.5262158",
"0.5262103",
"0.5260629",
"0.5250275",
"0.5244843",
"0.5243767",
"0.5243659",
"0.5240508",
"0.5237264",
"0.5230219",
"0.522128",
"0.5219954",
"0.5215225",
"0.52098995",
"0.5209517",
"0.52056336",
"0.5204725",
"0.52017736",
"0.52003646",
"0.51998687",
"0.5198034",
"0.51973355",
"0.51915365",
"0.5189996",
"0.5172768",
"0.5165196",
"0.51641804",
"0.51600146",
"0.5158387",
"0.5156848",
"0.51560503",
"0.51559955",
"0.5153692",
"0.51517785",
"0.51464826",
"0.5145378",
"0.5144449",
"0.5140216",
"0.5139731",
"0.5138483",
"0.5138156",
"0.51376694",
"0.5136974",
"0.51261795",
"0.51213336",
"0.5117484"
] |
0.53607416
|
38
|
Resources that don't include SystemProperties return nil for sys
|
def sys
nil
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def expected_local_properties\n {\n 'enabled' => 'true',\n 'async-replication' => 'true',\n 'availability-enabled' => 'true',\n 'directory-deployed' => 'true',\n 'context-root' => '/myapp',\n 'location' => \"file:#{self.location_as_dir}/\",\n 'property.defaultAppName' => 'myapp',\n 'property.archiveType' => 'war',\n 'property.appLocation' => \"file:#{self.location_as_dir}/\",\n 'property.java-web-start-enabled' => 'false',\n 'deployment-order' => '100'\n }\n end",
"def raw_system_properties(addr, user, password)\n http_get(\n addr,\n '/system/console/status-System%20Properties.txt',\n user,\n password\n ).body\n end",
"def intersys_properties\n properties = Intersys::Object.common_get_or_set('@properties', {})\n properties[class_name] ||= intersys_reflector.properties.to_a\n end",
"def resource_properties\n properties = instance_variable_defined?(:@new_resource) ? new_resource.class.properties(false).keys : self.class.properties(false).keys\n Chef::Log.debug(\"resource_properties: Got properties from resource: #{properties.join(', ')}\")\n properties.reject! { |p| GLOBAL_CONFIG_PROPERTIES_SKIP.include?(p) }\n\n skip_properties = if !action_class? && respond_to?(:resource_config_properties_skip)\n resource_config_properties_skip\n elsif action_class? && new_resource.respond_to?(:resource_config_properties_skip)\n new_resource.resource_config_properties_skip\n end\n\n if skip_properties\n Chef::Log.debug(\"resource_properties: Resourced defined skip properties: #{skip_properties.join(', ')}\")\n properties.reject! { |p| resource_config_properties_skip.include?(p) }\n end\n\n Chef::Log.info(\"resource_properties: Filtered properties: #{properties.join(', ')}\")\n properties\n end",
"def query\n self.class.instances.each do |pkg|\n return pkg.properties if pkg.name == @resource[:name]\n end\n return nil\n end",
"def overriding_system_value\n clone(:override=>:system)\n end",
"def customized_properties\n current_resource.info['properties'].select do |_k, v|\n v['is_set'] == true\n end\n end",
"def apply_system_defaults\n if @region.nil? && @zone.nil?\n @region, @zone = Rudy::DEFAULT_REGION, Rudy::DEFAULT_ZONE\n elsif @region.nil?\n @region = @zone.to_s.gsub(/[a-z]$/, '').to_sym\n elsif @zone.nil?\n @zone = \"#{@region}b\".to_sym\n end\n \n @environment ||= Rudy::DEFAULT_ENVIRONMENT\n @role ||= Rudy::DEFAULT_ROLE\n @localhost ||= Rudy.sysinfo.hostname || 'localhost'\n @auto = false if @auto.nil?\n end",
"def cr_dmi_system\n return {} if @node.automatic_attrs[\"dmi\"].nil? || @node.automatic_attrs[\"dmi\"][\"system\"].nil?\n\n @node.automatic_attrs[\"dmi\"][\"system\"]\n end",
"def load_properties\n unless Properties.exist?(@propertiesFile)\n\tProperties.copy(@defaultPropertiesFile, @propertiesFile)\n @properties = Properties.new(\"Core configuration file\", \n \"1.0\", \n @bus[\"/system/properties\"], \n @propertiesFile)\n @properties[\"version/major\"] = FreeBASE::VERSION_MAJOR\n @properties[\"version/minor\"] = FreeBASE::VERSION_MINOR\n @properties[\"version/release\"] = FreeBASE::VERSION_RELEASE\n else\n @properties = Properties.new(\"Core configuration file\", \n \"1.0\", \n @bus[\"/system/properties\"], \n @propertiesFile)\n end\n end",
"def load_current_resource\n @my_home = new_resource.home ||\n \"#{node['user']['home_root']}/#{new_resource.username}\"\n @my_shell = new_resource.shell || node['user']['default_shell']\n @manage_home = bool(new_resource.manage_home, node['user']['manage_home'])\n @create_group = bool(new_resource.create_group, node['user']['create_group'])\n @ssh_keygen = bool(new_resource.ssh_keygen, node['user']['ssh_keygen'])\nend",
"def subsystem\n \"unknown\"\n end",
"def load_current_resource\n # quick & dirty os detection\n @sysctl_args = case node[:os]\n when 'GNU/Linux', 'Linux', 'linux'\n '-n -e'\n else\n '-n'\n end\n\n # clean up value whitespace when its a string\n @new_resource.value.strip! if @new_resource.value.class == String\n\n # find current value\n _status, @current_value, _error_message = output_of_command(\n \"#{@sysctl} #{@sysctl_args} #{@new_resource.name}\", ignore_failure: true)\n\n Chef::Log.info \"#{new_resource.name} -> #{@current_value} := #{new_resource.value}\"\nend",
"def system_information\n super\n end",
"def system_information\n super\n end",
"def system_info\n si = SysInfo.new\n si.to_hash\n rescue \n {}\n end",
"def platform\n System::get_property('platform')\n end",
"def test_config_system_properties_file(module_set)\n FilePath.new(classes_directory_for_eclipse(module_set['common'].subtree('tests.base')), \"test-system-properties.properties\")\n end",
"def zfs_properties(name)\n properties || parse_zfs_properties(zfs_get_properties(name))\nend",
"def system_version\n @system_version ||= File.read(Rails.root.join(\"VERSION\")).strip\n end",
"def resource_properties\n props = {}\n props['Path'] = @resource.path\n\n build_path = @resource.destination_path\n build_path = 'Not built' if ignored?\n props['Build Path'] = build_path if @resource.path != build_path\n props['URL'] = content_tag(:a, @resource.url, href: @resource.url) unless ignored?\n props['Source File'] = @resource.file_descriptor ? @resource.file_descriptor[:full_path].to_s.sub(/^#{Regexp.escape(ENV['MM_ROOT'] + '/')}/, '') : 'Dynamic'\n\n data = @resource.data\n props['Data'] = data.to_hash(symbolize_keys: true).inspect unless data.empty?\n\n options = @resource.options\n props['Options'] = options.inspect unless options.empty?\n\n locals = @resource.locals.keys\n props['Locals'] = locals.join(', ') unless locals.empty?\n\n props\n end",
"def os_windows_other\n\t\t\t\t\tnot_os_windows_2k12.not_os_windows_8.not_os_windows_7.not_os_windows_2k8.not_os_windows_vista.not_os_windows_2k3.not_os_windows_xp.not_os_windows_2k.not_os_windows_nt\n\t\t\t\tend",
"def default_X__PROPERTY_BOOL__X\n config_get_default('X__RESOURCE_NAME__X', 'X__PROPERTY_BOOL__X')\n end",
"def default_value_for(prop)\n case prop\n when :install_path\n \"/opt/#{package_name}\"\n when :omnibus_project\n package_name\n when :downloads_product_page_url\n \"#{Mixlib::Install::Dist::DOWNLOADS_PAGE}/#{product_key}\"\n when :github_repo\n \"#{Mixlib::Install::Dist::GITHUB_ORG}/#{product_key}\"\n when :api_url\n ENV.fetch(\"PACKAGE_ROUTER_ENDPOINT\", Mixlib::Install::Dist::PRODUCT_ENDPOINT)\n else\n nil\n end\n end",
"def available_properties\n @properties ||= list.properties\n end",
"def load_current_resource\n @osx_pkg = Chef::Resource::OsxPkgPackage.new(new_resource.name)\n Chef::Log.debug(\"Checking for package #{new_resource.name}\")\n @osx_pkg.installed(installed?)\nend",
"def get_os_value\n Facter.value( @fact ) unless @fact.nil?\n end",
"def ignore_default_keys()\n # default OAR at resource creation:\n # available_upto: '2147483647'\n # besteffort: 'YES'\n # core: ~\n # cpu: ~\n # cpuset: 0\n # deploy: 'NO'\n # desktop_computing: 'NO'\n # drain: 'NO'\n # expiry_date: 0\n # finaud_decision: 'YES'\n # host: ~\n # last_available_upto: 0\n # last_job_date: 0\n # network_address: server\n # next_finaud_decision: 'NO'\n # next_state: UnChanged\n # resource_id: 9\n # scheduler_priority: 0\n # state: Suspected\n # state_num: 3\n # suspended_jobs: 'NO'\n # type: default\n ignore_default_keys = [\n \"slash_16\",\n \"slash_17\",\n \"slash_18\",\n \"slash_19\",\n \"slash_20\",\n \"slash_21\",\n \"slash_22\",\n \"available_upto\",\n \"chunks\",\n \"comment\", # TODO\n \"core\", # This property was created by 'oar_resources_add'\n \"cpu\", # This property was created by 'oar_resources_add'\n \"host\", # This property was created by 'oar_resources_add'\n \"gpudevice\", # New property taken into account by the new generator\n \"gpu\", # New property taken into account by the new generator\n \"cpuset\",\n \"desktop_computing\",\n \"drain\",\n \"expiry_date\",\n \"finaud_decision\",\n \"grub\",\n \"jobs\", # This property exists when a job is running\n \"last_available_upto\",\n \"last_job_date\",\n \"network_address\", # TODO\n \"next_finaud_decision\",\n \"next_state\",\n \"rconsole\", # TODO\n \"resource_id\",\n \"scheduler_priority\",\n \"state\",\n \"state_num\",\n \"subnet_address\",\n \"subnet_prefix\",\n \"suspended_jobs\",\n \"thread\",\n \"type\", # TODO\n \"vlan\",\n \"pdu\",\n \"id\", # id from API (= resource_id from oarnodes)\n \"api_timestamp\", # from API\n \"links\", # from API\n ]\n return ignore_default_keys\nend",
"def load_current_resource\n # Chef 12 @current_resource = Chef::Resource::IbmCloudUtilsSelinux.new(@new_resource.name)\n @current_resource = Chef::Resource.resource_for_node(:ibm_cloud_utils_selinux, node).new(@new_resource.name)\n cmnd = shell_out('getenforce')\n @current_resource.status(cmnd.stdout.chomp.downcase)\nend",
"def default_X__PROPERTY_INT__X\n config_get_default('X__RESOURCE_NAME__X', 'X__PROPERTY_INT__X')\n end",
"def library_properties?\n lib_props = library_properties_path\n lib_props.exist? && lib_props.file?\n end",
"def resource_attributes\n %w(\n auth_users\n comment\n dont_compress\n exclude\n exclude_from\n fake_super\n gid\n hosts_allow\n hosts_deny\n include\n include_from\n incoming_chmod\n list\n lock_file\n log_file\n log_format\n max_connections\n munge_symlinks\n numeric_ids\n outgoing_chmod\n path\n postxfer_exec\n prexfer_exec\n read_only\n refuse_options\n secrets_file\n strict_modes\n timeout\n transfer_logging\n uid\n use_chroot\n write_only\n )\nend",
"def query\n command = resource_or_provider_command\n self.class.validate_command(command)\n\n self.class.instances(command).each do |pkg|\n return pkg.properties if @resource[:name].casecmp(pkg.name).zero?\n end\n return nil\n end",
"def system_class\n virt = node.virtualization\n if virt[:role]\n if virt[:role] == \"guest\" && virt[:system] == \"xen\"\n return \"xen-guest\"\n elsif virt[:role] == \"host\" && virt[:system] == \"xen\"\n return \"xen-host\"\n else\n return \"unknown-vm\"\n end\n else\n return \"hardware\"\n end\nend",
"def package_settings\n properties[:package_settings]\n end",
"def package_settings\n properties[:package_settings]\n end",
"def resource_version\n version_file = ::File.join(install_dir, '.ts3-version')\n if ::File.exist?(version_file)\n result = ::File.read(version_file)\n else\n result = '0'\n end\n result\nend",
"def system?\n not @system.nil?\n end",
"def resource_properties\n {\n 'Path' => @resource.path,\n 'Output Path' => File.join(@resource.app.build_dir, @resource.destination_path),\n 'Url' => content_tag(:a, @resource.url, :href => @resource.url),\n #'Metadata' => @resource.metadata,\n 'Source' => @resource.source_file\n }\n end",
"def my_os\n Application.my_os\n end",
"def sensitive_properties\n properties.values.empty? ? [] : properties.values.select(&:sensitive?)\n end",
"def clear_system_defaults\n @region = nil if @region == Rudy::DEFAULT_REGION\n @zone = nil if @zone == Rudy::DEFAULT_ZONE\n @environment = nil if @environment == Rudy::DEFAULT_ENVIRONMENT\n @role = nil if @role == Rudy::DEFAULT_ROLE\n @localhost = nil if @localhost == (Rudy.sysinfo.hostname || 'localhost')\n @auto = nil if @auto == false\n end",
"def catalog_resources\n # This method exists to supply a common interface to the puppet catalog\n # for different versions of puppet.\n @catalog.resources.map do |r|\n if r.is_a?(String)\n # puppet 0.25 and older\n resource(r)\n elsif r.is_a?(Puppet::Resource)\n # puppet 2.6 and newer\n r\n else\n raise \"Unknown resource object #{r.class}\"\n end\n end\n end",
"def resource_text\n nil\n end",
"def initialize_whiny_nils\n require(\"active_support/whiny_nil\") if configuration.whiny_nils\n end",
"def resource_level\n CONTEXT_LEVELS.each do |k,v|\n if v[:inst] != institution_id.nil? &&\n v[:req_temp] != requirements_template_id.nil? &&\n v[:req] != requirement_id.nil? &&\n v[:res] != resource_id.nil?\n return v[:name]\n end\n end\n return \" \"\n end",
"def set_system_information(opts)\n opts = check_params(opts,[:system_info])\n super(opts)\n end",
"def system_recipe\n raise NoSystemRecipe.new unless @system_recipe\n @system_recipe\n end",
"def resource_variables\n { :name => new_resource.service_name,\n :command => new_resource.start_command,\n :priority => new_resource.priority,\n :numprocs => 1,\n :numprocs_start => 0,\n :priority => 999,\n :autostart => true,\n :autorestart => 'unexpected',\n :startsecs => 1,\n :startretries => 3,\n :exitcodes => '0,2',\n :stopsignal => 'TERM',\n :stopwaitsecs => 10,\n :user => nil,\n :redirect_stderr => false,\n :stdout_logfile => 'AUTO',\n :stdout_logfile_maxbytes => '50MB',\n :stdout_logfile_backups => 10,\n :stdout_capture_maxbytes => 0,\n :stdout_events_enabled => 0,\n :stderr_logfile => 'AUTO',\n :stderr_logfile_maxbytes => '50MB',\n :stderr_logfile_backups => 10,\n :stderr_capture_maxbytes => 0,\n :stderr_events_enabled => false,\n :environment => nil,\n :directory => nil,\n :umask => nil,\n :serverurl => 'AUTO'\n }.merge(new_resource.variables || {})\nend",
"def default_properties\n begin\n SETTINGS[self.class.to_s.downcase]['default_properties']\n rescue\n []\n end\n end",
"def used_properties\n @properties.values.find_all &:used?\n end",
"def required_properties\n {\n \"cc\" => {\n \"internal_service_hostname\" => \"cc.service.cf.internal\"\n },\n \"loggregator\" => {\n \"etcd\" => {\n \"machines\" => []\n },\n \"uaa\" => {\n \"client_secret\" => \"secret\"\n }\n },\n \"system_domain\" => \"bosh-lite.com\",\n }\n end",
"def optimize_console_settings(resources)\n output_minimum_system_requirements_error_and_exit unless meets_minimum_system_requirements?(resources)\n\n percent_mb_console = 75\n minimum_mb_console = fit_to_memory(resources['ram'], 512, 768, 1024)\n maximum_mb_console = 4096\n minimum_mb_os = reserved_memory_os\n # minimum_mb_g1gc = 2048\n\n settings = {}\n totals = {}\n\n available_mb_for_console = resources['ram'] - minimum_mb_os\n if available_mb_for_console < minimum_mb_console\n Puppet.debug(\"Error: available_mb_for_console: #{available_mb_for_console} < minimum_mb_console: #{minimum_mb_console}\")\n output_minimum_system_requirements_error_and_exit\n end\n\n mb_console = clamp_percent_of_resource(resources['ram'], percent_mb_console, minimum_mb_console, maximum_mb_console)\n java_args_for_console = { 'Xms' => \"#{mb_console}m\", 'Xmx' => \"#{mb_console}m\" }\n # java_args_for_console['XX:+UseG1GC'] = '' if (jruby_9k_enabled? == false) && (mb_console >= minimum_mb_g1gc)\n settings['puppet_enterprise::profile::console::java_args'] = java_args_for_console\n\n ram_used = mb_console\n totals['RAM'] = { 'total' => resources['ram'], 'used' => ram_used }\n\n [settings, totals]\n end",
"def system_keys\n @_system_keys ||= {}\n end",
"def add_standard_properties\n add_standard_property('run.start_date_time', DateTime.now.strftime(DateTimeFormat::SORTABLE_TIMESTAMP))\n add_standard_property('run.platform', ruby_platform)\n end",
"def oar_system_keys()\n [\n 'deploy',\n 'besteffort'\n ]\nend",
"def global_defaults(bosh_properties)\n props = Hash.new do |props, property|\n props[property] = Hash.new do |prop_hash, default|\n prop_hash[default] = []\n end\n end\n\n bosh_properties.each do |release, jobs|\n jobs.each do |job, property_hash|\n property_hash.each do |property, default|\n props[property][default] << [release, job]\n end\n end\n end\n\n props\nend",
"def properties\n if @property_hash.empty?\n @property_hash = status || {}\n if @property_hash.empty?\n @property_hash[:ensure] = :absent\n else\n @resource.class.validproperties.each do |name|\n @property_hash[name] ||= :absent\n end\n end\n\n end\n @property_hash.dup\n end",
"def load_current_resource\n raise Chef::Exceptions::Override, \"You must override load_current_resource in #{self}\"\n end",
"def inherit_system_specific_attributes\n self.systems_enabled.reject {|e| e == current_system}.each do |sys|\n self.send(\"start_date_#{sys}=\", read_attribute(\"start_date_#{current_system}\")) if read_attribute(\"start_date_#{sys}\").blank?\n self.send(\"end_date_#{sys}=\", read_attribute(\"end_date_#{current_system}\")) if read_attribute(\"end_date_#{sys}\").blank?\n self.send(\"distribution_life_cycle_#{sys}=\", read_attribute(\"distribution_life_cycle_#{current_system}\")) if read_attribute(\"distribution_life_cycle_#{sys}\").blank?\n self.send(\"distribution_life_cycle_ends_#{sys}=\", read_attribute(\"distribution_life_cycle_ends_#{current_system}\")) if read_attribute(\"distribution_life_cycle_ends_#{sys}\").blank?\n end\n end",
"def base_options\n [valid?(new_resource._?(:secure_storage, '-sSF')),\n valid?(new_resource._?(:master_passwd, '-mPF')),\n new_resource._?(:accept_license, '-acceptLicense'),\n ((new_resource.output == :silent) ? '-s' :\n (new_resource.output == :verbose) ? '-sP' :\n (new_resource.output == :debug) ? '-sVP' : '-sP')]\n end",
"def default_properties_file\n # try the current directory\n file = File.expand_path(DEF_PROP_FILE_NM)\n return file if File.exists?(file)\n # try home\n home = ENV['HOME'] || ENV['USERPROFILE'] || '~'\n file = File.expand_path(DEF_PROP_FILE_NM, home)\n file if File.exists?(file)\n end",
"def set_default_properties\n @properties = {\n :InstanceType => \"t2.micro\",\n :ImageId => \"ami-d05e75b8\"\n }\n end",
"def determine_properties_and_requirements\n base_name = File.basename(path)\n \n if path.include?'branches'\n # check for an 'svn' build\n \n # for platform/build information, assume that this was built on localhost\n requirement :platform => $is_windows ? :windows : :posix\n \n parts = path.split(Regexp.new('[/|\\\\\\\\]'))\n if parts.length < 2\n raise 'Unsupported PHP Build Type(Info Format:('\n elsif parts[parts.length-1] == 'Release' or parts[parts.length-1] == 'Release_TS'\n base_name = parts[parts.length-2]\n \n property :threadsafe => parts[parts.length-1] == 'Release_TS' ? 'ts' : 'nts'\n else\n property :threadsafe => Dir.exists(File.join(path, 'Release_TS')) ? 'ts' : 'nts'\n end\n \n if base_name == 'PHP_5_4'\n property :php_branch => '5_4'\n property :php_version_major => '5'\n elsif base_name == 'PHP_5_3'\n property :php_branch => '5_3'\n property :php_version_major => '5'\n else\n raise 'Unsupported PHP Build Type(Info Format:)'\n end\n \n # LATER get svn revision (include in :version too)\n property :revision => 'r'\n \n property :type => :svn\n if $is_windows\n property :compiler => 'vc9'\n #elsif RbConfig::CONFIG['host_os'] =~ /mingw/\n # property :compiler => 'mingw' # unsupported compiler\n else\n property :compiler => 'gcc'\n end \n \n elsif path.include?'trunk'\n raise 'Running SVN build from trunk is not supported!'\n # LATER support for getting info from trunk build\n else\n begin\n parts = base_name.split('-')\n \n requirement :platform => !parts.select{|i| i =~/(Win32|windows)/ }.empty? ? :windows : :posix\n\n branchinfo = parts.select{|i| i =~ /(?:[0-9]\\.[0-9]+|trunk)/ }.first\n\n property :php_branch => branchinfo.split('.').first(2).join('.')\n property :php_version_major => branchinfo.split('.').first.to_i\n property :threadsafe => parts.select{|i| i == 'nts' }.empty?\n property :revision => (parts.select{|i| i =~ /r[0-9]+/ }).first\n \n property :type => case\n when branchinfo =~ /svn/ then :svn\n when branchinfo =~ /RC/ then :release_candidate\n when property(:revision).nil? then :snap\n when branchinfo =~ /alpha|beta/ then :prerelease\n else :release\n end\n property :compiler => (parts.select{|i| i =~ /vc[0-9]+/i }).first.upcase\n\n rescue\n raise 'Unsupported PHP Build Type(Info Format)'\n end\n end\n \n property :version => [\n branchinfo,\n property(:revision)\n ].compact.join('-')\n \n self\n end",
"def properties\n if @property_hash.empty?\n @property_hash = status || {}\n if @property_hash.empty?\n @property_hash[:ensure] = :absent\n else\n @resource.class.validproperties.each do |name|\n @property_hash[name] ||= :absent\n end\n end\n end\n @property_hash.dup\n end",
"def aws_resources\n nil\n end",
"def resourceVersion\n nil\n end",
"def retrieve\n fail \"Provider #{provider.class.name} is not functional on this host\" if self.provider.is_a?(Puppet::Provider) and ! provider.class.suitable?\n\n result = Puppet::Resource.new(type, title)\n\n # Provide the name, so we know we'll always refer to a real thing\n result[:name] = self[:name] unless self[:name] == title\n\n if ensure_prop = property(:ensure) or (self.class.validattr?(:ensure) and ensure_prop = newattr(:ensure))\n result[:ensure] = ensure_state = ensure_prop.retrieve\n else\n ensure_state = nil\n end\n\n properties.each do |property|\n next if property.name == :ensure\n if ensure_state == :absent\n result[property] = :absent\n else\n result[property] = property.retrieve\n end\n end\n\n result\n end",
"def local_resources\n nil\n end",
"def meets_minimum_system_requirements?(resources)\n return true if @option_no_minimum_system_requirements\n (resources['cpu'] >= 4 && resources['ram'] >= 8192)\n end",
"def with_system_about property, tenant = nil\n validate! property, tenant\n tenant ? system_tenant(property, tenant) : system_landlord(property)\n end",
"def unevaluated_resources\n # The order of these is significant for speed due to short-circuiting\n resources.reject { |resource| resource.evaluated? or resource.virtual? or resource.builtin_type? }\n end",
"def package_resource_class\n Chef::Resource::WindowsPackage\n end",
"def check_platforms\n default_platform_attrs = ProductModel.platforms.stringify_keys\n self.design_platform = default_platform_attrs.merge(booleanize_hashs(design_platform))\n self.customize_platform = default_platform_attrs.merge(booleanize_hashs(customize_platform))\n end",
"def resources_path(val = NULL_ARG)\n @resources_path = val unless val.equal?(NULL_ARG)\n @resources_path\n end",
"def ensure_has_environment_files()\n\n end",
"def puppet_value; nil; end",
"def get_os_attrs(source, attr, source_type)\n begin\n # grab the product name from the template we are current provisioning from\n if source_type == 'prov'\n os_name = source.source.operating_system.product_name rescue nil\n elsif source_type == 'vm'\n os_name = source.operating_system.product_name rescue nil\n else\n raise \"Invalid source_type input\"\n end\n\n log(:info, \"get_os_attrs: Returning Operating System attribute <#{attr}> for Operating System <#{os_name}>\")\n # first we must truncate the product name in a camel case format\n # e.g. Red Hat Enterprise Linux 6 = RedHatEnterpriseLinux6\n truncated_product_name = os_name.split('(').first.delete(' ')\n\n # return the requested attribute\n $evm.instantiate(\"#{OS_CLASS}/#{truncated_product_name}\")[attr]\n rescue => err\n log(:error, \"get_os_attrs: <#{err}>: Unable to return proper attribute <#{attr}> from os_name <#{os_name}>. Returning nil.\")\n return nil\n end\nend",
"def non_service_resources(release_doc)\n release_doc.resources - service_resources(release_doc)\n end",
"def system_path\n @system_path ||= Pathname.new(__FILE__).dirname.dirname.expand_path.to_s\n end",
"def read_os(file_path)\n begin\n raw_data = IO.read(file_path)\n json_data = JSON.parse(raw_data)\n return json_data[\"OS\"]\n\n rescue Exception => e\n puts \"\\nERROR: /qa/ci_os.json file seems to be missing. Please create it from a copy of /qa/ci_os.json.template and make sure to configure your OS in ci_env.json\\n\"\n raise\n end\nend",
"def resource_attributes\n %w(\n auth_users\n comment\n dont_compress\n exclude\n exclude_from\n fake_super\n gid\n hosts_allow\n hosts_deny\n include\n include_from\n list\n lock_file\n log_file\n log_format\n max_connections\n munge_symlinks\n numeric_ids\n path\n read_only\n refuse_options\n secrets_file\n strict_modes\n timeout\n transfer_logging\n uid\n use_chroot\n write_only\n )\n end",
"def query\n self.class.instances.each do |package|\n return package.properties if @resource[:name][/\\A\\S*/].downcase == package.name.downcase\n end\n\n return nil\n end",
"def query\n self.class.instances.each do |package|\n return package.properties if @resource[:name][/\\A\\S*/].downcase == package.name.downcase\n end\n\n return nil\n end",
"def get_sysinfo\n\t\tsystem_data = {}\n\t\tetc_files = cmd_exec(\"ls /etc\").split()\n\n\t\tkernel_version = cmd_exec(\"uname -a\")\n\t\tsystem_data[:kernel] = kernel_version\n\n\t\t# Debian\n\t\tif etc_files.include?(\"debian_version\")\n\t\t\tif kernel_version =~ /Ubuntu/\n\t\t\t\tversion = read_file(\"/etc/issue\").gsub(/\\n|\\\\n|\\\\l/,'')\n\t\t\t\tsystem_data[:distro] = \"ubuntu\"\n\t\t\t\tsystem_data[:version] = version\n\t\t\telse\n\t\t\t\tversion = read_file(\"/etc/issue\").gsub(/\\n|\\\\n|\\\\l/,'')\n\t\t\t\tsystem_data[:distro] = \"debian\"\n\t\t\t\tsystem_data[:version] = version\n\t\t\tend\n\n\t\t# Amazon\n\t\telsif etc_files.include?(\"system-release\")\n\t\t\tversion = read_file(\"/etc/system-release\").gsub(/\\n|\\\\n|\\\\l/,'')\n\t\t\tsystem_data[:distro] = \"amazon\"\n\t\t\tsystem_data[:version] = version\n\n\t\t# Fedora\n\t\telsif etc_files.include?(\"fedora-release\")\n\t\t\tversion = read_file(\"/etc/fedora-release\").gsub(/\\n|\\\\n|\\\\l/,'')\n\t\t\tsystem_data[:distro] = \"fedora\"\n\t\t\tsystem_data[:version] = version\n\n\t\t# Oracle Linux\n\t\telsif etc_files.include?(\"enterprise-release\")\n\t\t\tversion = read_file(\"/etc/enterprise-release\").gsub(/\\n|\\\\n|\\\\l/,'')\n\t\t\tsystem_data[:distro] = \"oracle\"\n\t\t\tsystem_data[:version] = version\n\n\t\t# RedHat\n\t\telsif etc_files.include?(\"redhat-release\")\n\t\t\tversion = read_file(\"/etc/redhat-release\").gsub(/\\n|\\\\n|\\\\l/,'')\n\t\t\tsystem_data[:distro] = \"redhat\"\n\t\t\tsystem_data[:version] = version\n\n\t\t# Arch\n\t\telsif etc_files.include?(\"arch-release\")\n\t\t\tversion = read_file(\"/etc/arch-release\").gsub(/\\n|\\\\n|\\\\l/,'')\n\t\t\tsystem_data[:distro] = \"arch\"\n\t\t\tsystem_data[:version] = version\n\n\t\t# Slackware\n\t\telsif etc_files.include?(\"slackware-version\")\n\t\t\tversion = read_file(\"/etc/slackware-version\").gsub(/\\n|\\\\n|\\\\l/,'')\n\t\t\tsystem_data[:distro] = \"slackware\"\n\t\t\tsystem_data[:version] = version\n\n\t\t# Mandrake\n\t\telsif etc_files.include?(\"mandrake-release\")\n\t\t\tversion = read_file(\"/etc/mandrake-release\").gsub(/\\n|\\\\n|\\\\l/,'')\n\t\t\tsystem_data[:distro] = \"mandrake\"\n\t\t\tsystem_data[:version] = version\n\n\t\t#SuSE\n\t\telsif etc_files.include?(\"SuSE-release\")\n\t\t\tversion = read_file(\"/etc/SuSE-release\").gsub(/\\n|\\\\n|\\\\l/,'')\n\t\t\tsystem_data[:distro] = \"suse\"\n\t\t\tsystem_data[:version] = version\n\n\t\t# Gentoo\n\t\telsif etc_files.include?(\"gentoo-release\")\n\t\t\tversion = read_file(\"/etc/gentoo-release\").gsub(/\\n|\\\\n|\\\\l/,'')\n\t\t\tsystem_data[:distro] = \"gentoo\"\n\t\t\tsystem_data[:version] = version\n\t\telse\n\n\t\t\t# Others\n\t\t\tversion = read_file(\"/etc/issue\").gsub(/\\n|\\\\n|\\\\l/,'')\n\t\t\tsystem_data[:distro] = \"linux\"\n\t\t\tsystem_data[:version] = version\n\t\tend\n\t\treturn system_data\n\tend",
"def retrieve\n provider.properties[:ensure]\n end",
"def set_sys_config\n @sys_config = SysConfig.config\n end",
"def is_configurable?\n (self.status == 4 or self.status == 6 or self.status == 9) and !self.try(:asset).try(:name).eql?('readme.doc')\n end",
"def load_current_resource\n # CHEF 12 @current_resource = Chef::Resource::WasManagesdk.new(@new_resource.name)\n @current_resource = Chef::Resource.resource_for_node(:was_managesdk, node).new(@new_resource.name)\n #A common step is to load the current_resource instance variables with what is established in the new_resource.\n #What is passed into new_resouce via our recipes, is not automatically passed to our current_resource.\n #Get current state\n @current_resource.sdkNewProfileDefault = check_sdk?('getNewProfileDefault')\n @current_resource.sdkCommandDefault = check_sdk?('getCommandDefault')\nend",
"def system\n return @system\n end",
"def os\n @values.fetch('os') { \n @values['os'] = nil\n }\n end",
"def apply_environment_defaults\n @format = env(:format, @format) if @format.nil?\n @autopath = env(:autopath, @autopath) if @autopath.nil?\n @files = env(:files, @files) if @files.empty?\n @match = env(:match, @match) if @match.empty?\n @tags = env(:tags, @tags) if @tags.empty?\n @units = env(:units, @units) if @units.empty?\n @requires = env(:requires, @requires) if @requires.empty?\n @loadpath = env(:loadpath, @loadpath) if @loadpath.empty?\n end",
"def load_platform(v)\n Chef::Log.debug \"[dropwizard_pleaserun] loading platform #{v}\"\n platform_lib = \"pleaserun/platform/#{v}\"\n require platform_lib\n const = PleaseRun::Platform.constants.find { |c| c.to_s.casecmp(v).zero? }\n if const.nil?\n raise PlatformLoadError, \"Could not find platform named '#{v}' after loading library \" \\\n \"'#{platform_lib}'. This is probably a bug.\"\n end\n return PleaseRun::Platform.const_get(const)\nrescue LoadError => e\n raise PlatformLoadError, \"Failed to find or load platform '#{v}'. This could be a typo or \" \\\n \" a bug. If it helps, the error is: #{e}\"\nend",
"def set_system_setting\n @system_setting = System.settings\n end",
"def default_properties\n @properties ||= @options[:properties] || {}\n end",
"def myOs\n if OS.windows?\n \"Windows\"\n elsif OS.linux?\n \"Linux\"\n elsif OS.mac?\n \"Osx\"\n else\n \"Não consegui indentificar!\"\n end\nend",
"def puppet_cli_options\n Puppet::Settings::REQUIRED_APP_SETTINGS.map do |setting|\n \"--%s %s\" % [setting, @tmpdir]\n end\n end",
"def read_os(file_path)\n begin\n raw_data = IO.read(file_path)\n json_data = JSON.parse(raw_data)\n return json_data[\"OS\"]\n rescue Exception => e\n puts \"\\nERROR: /qa/ci_os.json file seems to be missing. Please create it from a copy of /qa/ci_os.json.template and make sure to configure your OS in ci_os.json\\n\"\n raise\n end\nend",
"def get_os\n if RbConfig::CONFIG['host_os'] =~ /mswin|mingw|cygwin/\n return :Windows\n elsif RbConfig::CONFIG['host_os'] =~ /darwin/\n return :Mac\n elsif RbConfig::CONFIG['host_os'] =~ /linux/\n return :Linux\n elsif RbConfig::CONFIG['host_os'] =~ /bsd/\n return :BSD\n else\n return :unknown_os\n end\nend",
"def test_paths_with_dependent_scl\n prefix = '/some/prefix'\n scl_name = 'ruby_x'\n\n ENV['X_SCLS'] = \"#{@scl} #{scl_name}\" # enabled scls\n ENV['GEM_PATH'] = \"#{prefix}/#{scl_name}/root/usr/share/gems\"\n\n default_locations = { :system => \"/opt/cpanel/#{@scl}/root/usr\",\n :local => \"/opt/cpanel/#{@scl}/root/usr/local\",\n :\"#{scl_name}_system\" => \"#{prefix}/#{scl_name}/root/usr\",\n :\"#{scl_name}_local\" => \"#{prefix}/#{scl_name}/root/usr/local\" }\n\n assert_equal default_locations, Gem.default_locations\n\n default_dirs = { :system => { :bin_dir => \"/opt/cpanel/#{@scl}/root/usr/#{@bin_dir}\",\n :gem_dir => \"/opt/cpanel/#{@scl}/root/usr/share/gems\",\n :ext_dir => \"/opt/cpanel/#{@scl}/root/usr/lib64/gems\" },\n :local => { :bin_dir => \"/opt/cpanel/#{@scl}/root/usr/local/#{@bin_dir}\",\n :gem_dir => \"/opt/cpanel/#{@scl}/root/usr/local/share/gems\",\n :ext_dir => \"/opt/cpanel/#{@scl}/root/usr/local/lib64/gems\" },\n :\"#{scl_name}_system\" => { :bin_dir => \"#{prefix}/#{scl_name}/root/usr/#{@bin_dir}\",\n :gem_dir => \"#{prefix}/#{scl_name}/root/usr/share/gems\",\n :ext_dir => \"#{prefix}/#{scl_name}/root/usr/lib64/gems\" },\n :\"#{scl_name}_local\" => { :bin_dir => \"#{prefix}/#{scl_name}/root/usr/local/#{@bin_dir}\",\n :gem_dir => \"#{prefix}/#{scl_name}/root/usr/local/share/gems\",\n :ext_dir => \"#{prefix}/#{scl_name}/root/usr/local/lib64/gems\" } }\n assert_equal default_dirs, Gem.default_dirs\n end"
] |
[
"0.58703196",
"0.575957",
"0.5530705",
"0.545154",
"0.5379882",
"0.5362566",
"0.53424984",
"0.5329514",
"0.5315813",
"0.5294226",
"0.52655923",
"0.52228814",
"0.5217513",
"0.5209448",
"0.5209448",
"0.51672536",
"0.51565117",
"0.5144707",
"0.51439273",
"0.51333153",
"0.51273936",
"0.5116693",
"0.5109509",
"0.5101903",
"0.50985944",
"0.5098119",
"0.5081742",
"0.5066327",
"0.50581366",
"0.50494224",
"0.5033266",
"0.5031097",
"0.50295526",
"0.5028828",
"0.50283056",
"0.50283056",
"0.5025095",
"0.5024773",
"0.5017594",
"0.5002673",
"0.50020224",
"0.49843606",
"0.49755162",
"0.49698326",
"0.49611798",
"0.49515098",
"0.4946667",
"0.4924167",
"0.49233538",
"0.491696",
"0.49160695",
"0.49157733",
"0.48928562",
"0.48896715",
"0.4888813",
"0.48880893",
"0.48867208",
"0.48854795",
"0.4883776",
"0.48790503",
"0.48765242",
"0.48749214",
"0.48743054",
"0.4867518",
"0.48607746",
"0.48589984",
"0.48568508",
"0.4845512",
"0.48440048",
"0.484139",
"0.48407647",
"0.48330674",
"0.4827711",
"0.4819781",
"0.4815463",
"0.4813656",
"0.48130322",
"0.48105654",
"0.48074922",
"0.48049536",
"0.48009512",
"0.4798967",
"0.47988853",
"0.47988853",
"0.47941118",
"0.47931615",
"0.47811976",
"0.47803727",
"0.4779962",
"0.47702843",
"0.4769075",
"0.47576195",
"0.47477207",
"0.4746028",
"0.47434297",
"0.4742761",
"0.47394446",
"0.47388914",
"0.4737919",
"0.47356722"
] |
0.5421696
|
4
|
Resources that don't include Fields or AssetFields return nil for fields
|
def fields
nil
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def get_field_deserializers()\n return super.merge({\n \"resourceId\" => lambda {|n| @resource_id = n.get_string_value() },\n \"resourceName\" => lambda {|n| @resource_name = n.get_string_value() },\n \"resourceType\" => lambda {|n| @resource_type = n.get_string_value() },\n })\n end",
"def show\n @resource = Resource.find(params[:id])\n @resource_type = ResourceType.find(@resource.resource_type_id)\n @values = ResourceValue.where(resource_id: params[:id])\n @field_types=[]\n @values.each do |value|\n @field_types << value.Field\n end\n \n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @resource }\n end\n end",
"def non_relationship_fields\n self.fields.select { |field| !field.is_relationship? }\n end",
"def get_field_deserializers()\n return super.merge({\n \"lastModifiedDateTime\" => lambda {|n| @last_modified_date_time = n.get_date_time_value() },\n \"resource\" => lambda {|n| @resource = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::Entity.create_from_discriminator_value(pn) }) },\n \"resourceReference\" => lambda {|n| @resource_reference = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::ResourceReference.create_from_discriminator_value(pn) }) },\n \"resourceVisualization\" => lambda {|n| @resource_visualization = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::ResourceVisualization.create_from_discriminator_value(pn) }) },\n \"weight\" => lambda {|n| @weight = n.get_object_value(lambda {|pn| Double.create_from_discriminator_value(pn) }) },\n })\n end",
"def show\n @resource_type = @resource.resource_type\n @values = ResourceValue.where(\"resource_id = ?\", params[:id])\n @field_types = []\n @values.each do |value|\n if value.field.resource_type_reference_id\n @field_types << Resource.find(value.resource_reference_id).resource_type\n else\n @field_types << value.field.field_type\n end\n end \n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @resource }\n end\n end",
"def list_resource\n resource_class.all_but_other\n end",
"def get_field_deserializers()\n return {\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"resourceId\" => lambda {|n| @resource_id = n.get_string_value() },\n \"uri\" => lambda {|n| @uri = n.get_string_value() },\n }\n end",
"def show\n @resource_fields = Field.where(\"resource_type_id = ?\", params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @resource_type }\n end\n end",
"def get_field_deserializers()\n return {\n \"allowedResourceActions\" => lambda {|n| @allowed_resource_actions = n.get_collection_of_primitive_values(String) },\n \"condition\" => lambda {|n| @condition = n.get_string_value() },\n \"excludedResourceActions\" => lambda {|n| @excluded_resource_actions = n.get_collection_of_primitive_values(String) },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n }\n end",
"def get_field_deserializers()\n return super.merge({\n \"amazonAccountId\" => lambda {|n| @amazon_account_id = n.get_string_value() },\n \"amazonResourceId\" => lambda {|n| @amazon_resource_id = n.get_string_value() },\n \"resourceName\" => lambda {|n| @resource_name = n.get_string_value() },\n \"resourceType\" => lambda {|n| @resource_type = n.get_string_value() },\n })\n end",
"def fields\n missing_method :fields\n end",
"def fields?; @fields; end",
"def active_fields_for_resource(resource)\n if resource_class == Event\n @campaign_fields ||= {}\n @campaign_fields[resource.campaign_id] ||= campaign_from_cache(resource.campaign_id).form_fields.where(\n id: custom_fields_to_export.keys\n ).pluck(:id)\n @campaign_fields[resource.campaign_id]\n else\n @activity_type_fields ||= {}\n @activity_type_fields[resource.activity_type_id] ||= FormField.for_activities.where(\n fieldable_id: resource.activity_type_id,\n id: custom_fields_to_export.keys\n ).pluck(:id)\n @activity_type_fields[resource.activity_type_id]\n end\n end",
"def get_field_deserializers()\n return super.merge({\n \"distributeForStudentWork\" => lambda {|n| @distribute_for_student_work = n.get_boolean_value() },\n \"resource\" => lambda {|n| @resource = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::EducationResource.create_from_discriminator_value(pn) }) },\n })\n end",
"def imported_field_value(field)\n resource.try(field) || resource.try(:primary_imported_metadata)&.[](field) || parent_resource&.try(field) || parent_resource&.try(:primary_imported_metadata)&.[](field)\n end",
"def get_field_deserializers()\n return super.merge({\n \"name\" => lambda {|n| @name = n.get_string_value() },\n \"resourceActions\" => lambda {|n| @resource_actions = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::UnifiedRbacResourceAction.create_from_discriminator_value(pn) }) },\n })\n end",
"def fields\n @fields ||= begin\n default_fields\n end\n end",
"def get_field_deserializers()\n return super.merge({\n \"additionalTags\" => lambda {|n| @additional_tags = n.get_collection_of_primitive_values(String) },\n \"contentWebUrl\" => lambda {|n| @content_web_url = n.get_string_value() },\n \"contributors\" => lambda {|n| @contributors = n.get_collection_of_primitive_values(String) },\n \"createdDateTime\" => lambda {|n| @created_date_time = n.get_date_time_value() },\n \"description\" => lambda {|n| @description = n.get_string_value() },\n \"duration\" => lambda {|n| @duration = n.get_duration_value() },\n \"externalId\" => lambda {|n| @external_id = n.get_string_value() },\n \"format\" => lambda {|n| @format = n.get_string_value() },\n \"isActive\" => lambda {|n| @is_active = n.get_boolean_value() },\n \"isPremium\" => lambda {|n| @is_premium = n.get_boolean_value() },\n \"isSearchable\" => lambda {|n| @is_searchable = n.get_boolean_value() },\n \"languageTag\" => lambda {|n| @language_tag = n.get_string_value() },\n \"lastModifiedDateTime\" => lambda {|n| @last_modified_date_time = n.get_date_time_value() },\n \"numberOfPages\" => lambda {|n| @number_of_pages = n.get_number_value() },\n \"skillTags\" => lambda {|n| @skill_tags = n.get_collection_of_primitive_values(String) },\n \"sourceName\" => lambda {|n| @source_name = n.get_string_value() },\n \"thumbnailWebUrl\" => lambda {|n| @thumbnail_web_url = n.get_string_value() },\n \"title\" => lambda {|n| @title = n.get_string_value() },\n })\n end",
"def get_field_deserializers()\n return {\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"resourceActions\" => lambda {|n| @resource_actions = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::ResourceAction.create_from_discriminator_value(pn) }) },\n }\n end",
"def get_field_deserializers()\n return {\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"resource\" => lambda {|n| @resource = n.get_string_value() },\n \"resourceType\" => lambda {|n| @resource_type = n.get_enum_value(MicrosoftGraph::Models::SecurityResourceType) },\n }\n end",
"def readable_attributes resource = nil\n accessible_attributes(resource).delete_if { |attribute| attribute =~ /(_attributes)|(_id)|(_ids)$/ }\n end",
"def resource_text\n nil\n end",
"def get_field_deserializers()\n return super.merge({\n \"location\" => lambda {|n| @location = n.get_string_value() },\n \"locationType\" => lambda {|n| @location_type = n.get_enum_value(MicrosoftGraph::Models::SecurityGoogleCloudLocationType) },\n \"projectId\" => lambda {|n| @project_id = n.get_string_value() },\n \"projectNumber\" => lambda {|n| @project_number = n.get_object_value(lambda {|pn| Int64.create_from_discriminator_value(pn) }) },\n \"resourceName\" => lambda {|n| @resource_name = n.get_string_value() },\n \"resourceType\" => lambda {|n| @resource_type = n.get_string_value() },\n })\n end",
"def flexi_fields_except_fk\n _field_names = self.associations.values.flatten.map { |_v| :\"#{_v.to_s.singularize}_id\" }\n if none_flexi_fields.present?\n none_flexi_fields.each do |field|\n ['file_name', 'content_type', 'file_size', 'updated_at'].each do |_suffix|\n _field_names << :\"#{field.name.to_s}_#{_suffix}\"\n end\n end\n end\n self.flexi_fields.select { |_f| !_field_names.include?(_f.name.to_sym) }\n end",
"def controlled_resources\n @controlled_resources ||= if params[:media_name]\n super.where(type: singular_linked_media_type)\n else\n super\n end\n end",
"def null_controlled_fields!(attrs)\n ::ScoobySnacks::METADATA_SCHEMA.controlled_field_names.each do |field_name|\n # do not null fields that are not being changed\n next unless attrs.keys.include?(\"#{field_name}_attributes\")\n\n object.public_send(\"#{field_name}=\", [])\n end\n end",
"def flex_attributes; nil end",
"def normalize_fields!\n # TODO: normalize Array of Symbol, String or DM::Property\n\n # TODO: loop over fields, and if the resource doesn't match\n # self.resource, append the property's resource to @links\n # eg:\n #if property.resource != self.resource\n # @links << discover_path_for_property(property)\n #end\n end",
"def get_field_deserializers()\n return {\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"resourceAccess\" => lambda {|n| @resource_access = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::ResourceAccess.create_from_discriminator_value(pn) }) },\n \"resourceAppId\" => lambda {|n| @resource_app_id = n.get_string_value() },\n }\n end",
"def required_fields\n required_fields = []\n ignore_fields = [:id, :date_entered, :date_modified]\n self.fields.each_value do |field|\n next if ignore_fields.include? field[\"name\"].to_sym\n required_fields << field[\"name\"].to_sym if field[\"required\"] == 1\n end \n required_fields\n end",
"def required_fields\n required_fields = []\n ignore_fields = [:id, :date_entered, :date_modified]\n self.fields.each_value do |field|\n next if ignore_fields.include? field[\"name\"].to_sym\n required_fields << field[\"name\"].to_sym if field[\"required\"] == 1\n end \n required_fields\n end",
"def get_field_deserializers()\n return super.merge({\n \"displayName\" => lambda {|n| @display_name = n.get_string_value() },\n \"file\" => lambda {|n| @file = n.get_object_value(lambda {|pn| Base64url.create_from_discriminator_value(pn) }) },\n \"fileHash\" => lambda {|n| @file_hash = n.get_string_value() },\n \"version\" => lambda {|n| @version = n.get_string_value() },\n })\n end",
"def fields\n @_fields ||= {}\n end",
"def check_fields\n columns= resource.model.column_names - AutoRest::AR_MAGIC_COLUMNS\n\n default_columns= columns.select { |attr| attr !~ /.*_count$/ }.map do |elem|\n [elem.intern, elem.titleize]\n end\n\n # For storing columns, I use an array and not a hash --i.e.: (:column => 'Title') -- \n # to ensure the order of the columns. I convert the params from linear array to \n # grouped array to alivianate user's data entry:\n # [[:col0, \"name0\"], [:col1, \"name1\"]] becomes [:col0, \"name0\", :col1, \"name1\"]\n \n # *TODO* This should be cleaned a little, because right now is a bit difficult\n # to remember the way the attributes for each view work.\n\n [:for_index, :for_new, :for_edit, :for_show].each do |key|\n arr= fields.send(key)\n exc= exclude_fields.send(key)\n\n if !arr # User has not supplied columns.\n arr= default_columns\n else\n # enum_for creates an enum from array, therefore protecting the original array contents.\n # each slice returns an array of specified elements: [1,2,3,4] => 1..4 => [[1,2],[3,4]]\n arr= arr.enum_for(:each_slice, 2).to_a\n end\n \n # Remove excluded fields.\n arr= arr.reject { |e| exc.map{|elem|elem.to_s}.include?(e[0].to_s) } if exc\n fields.send(\"#{key}=\", arr)\n end\n end",
"def local_resources\n nil\n end",
"def required_fields\n []\n end",
"def fields; end",
"def fields; end",
"def fields; end",
"def all_fields\n found_fields = Array.new\n self.fields.each do |field|\n found_fields << field\n found_fields = found_fields + field.all_fields if field.type == 'ObjectField'\n end\n found_fields\n end",
"def check_exclude_fields\n=begin\n [:for_index, :for_new, :for_edit, :for_show].each do |key|\n exc= exclude_fields.send(key)\n next if exc # Leave user options if given.\n \n # By default, the foreign key of the parents are assigned on nested resources,\n # so i remove the from the default columns of new\n exclude_fields.send(\"#{key}=\", parent_ids) if key == :for_new && !parent_ids.empty?\n end\n=end\n # Because a single resource can have multiple resource parents,\n # this check is going to be done on \"runtime\" (ie remove the field for the \n # current parent, not all parents' fields)\n end",
"def get_field_deserializers()\n return {\n \"includeContent\" => lambda {|n| @include_content = n.get_enum_value(MicrosoftGraph::Models::SearchContent) },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n }\n end",
"def get_field_deserializers()\n return super.merge({\n \"capability\" => lambda {|n| @capability = n.get_string_value() },\n \"providerId\" => lambda {|n| @provider_id = n.get_string_value() },\n \"providerName\" => lambda {|n| @provider_name = n.get_string_value() },\n \"providerResourceId\" => lambda {|n| @provider_resource_id = n.get_string_value() },\n \"uri\" => lambda {|n| @uri = n.get_string_value() },\n })\n end",
"def get_field_deserializers()\n return super.merge({\n \"description\" => lambda {|n| @description = n.get_string_value() },\n \"owner\" => lambda {|n| @owner = n.get_string_value() },\n \"properties\" => lambda {|n| @properties = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::ExtensionSchemaProperty.create_from_discriminator_value(pn) }) },\n \"status\" => lambda {|n| @status = n.get_string_value() },\n \"targetTypes\" => lambda {|n| @target_types = n.get_collection_of_primitive_values(String) },\n })\n end",
"def initialize_fields\n publisher.build if publisher.empty?\n contributor.build if contributor.empty?\n creator.build if creator.empty?\n identifier.build if identifier.empty?\n description.build if description.empty?\n super\n end",
"def get_field_deserializers()\n return {\n \"countriesBlockedForMinors\" => lambda {|n| @countries_blocked_for_minors = n.get_collection_of_primitive_values(String) },\n \"legalAgeGroupRule\" => lambda {|n| @legal_age_group_rule = n.get_string_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n }\n end",
"def resource_fields(fields_option)\n return nil unless fields_option\n if fields_option == ''\n raise Thor::MalformattedArgumentError.new(\"Option 'fields' cannot be empty.\")\n end\n fields_option.split(',').map { |option| option.to_sym }\n end",
"def contents_fields\n []\n end",
"def get_field_deserializers()\n return super.merge({\n \"description\" => lambda {|n| @description = n.get_string_value() },\n \"displayName\" => lambda {|n| @display_name = n.get_string_value() },\n \"isAvailable\" => lambda {|n| @is_available = n.get_boolean_value() },\n })\n end",
"def fields\n @fields ||= {}\n end",
"def fields\n @fields ||= {}\n end",
"def fields\n @fields ||= {}\n end",
"def fields\n @fields ||= {}\n end",
"def fields\n @fields ||= {}\n end",
"def attributes\n @json_attributes.reject{|k,v| !schema.fields.include?(k)}\n end",
"def get_field_deserializers()\n return {\n \"contentSource\" => lambda {|n| @content_source = n.get_string_value() },\n \"hitId\" => lambda {|n| @hit_id = n.get_string_value() },\n \"isCollapsed\" => lambda {|n| @is_collapsed = n.get_boolean_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"rank\" => lambda {|n| @rank = n.get_number_value() },\n \"resource\" => lambda {|n| @resource = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::Entity.create_from_discriminator_value(pn) }) },\n \"resultTemplateId\" => lambda {|n| @result_template_id = n.get_string_value() },\n \"summary\" => lambda {|n| @summary = n.get_string_value() },\n }\n end",
"def get_field_deserializers()\n return super.merge({\n \"description\" => lambda {|n| @description = n.get_string_value() },\n \"details\" => lambda {|n| @details = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::ConditionalAccessPolicyDetail.create_from_discriminator_value(pn) }) },\n \"name\" => lambda {|n| @name = n.get_string_value() },\n \"scenarios\" => lambda {|n| @scenarios = n.get_enum_value(MicrosoftGraph::Models::TemplateScenarios) },\n })\n end",
"def get_field_deserializers()\n return super.merge({\n })\n end",
"def get_field_deserializers()\n return super.merge({\n })\n end",
"def get_field_deserializers()\n return super.merge({\n })\n end",
"def simple_fields\n fields.select(&:filterable?)\n end",
"def get_field_deserializers()\n return super.merge({\n \"description\" => lambda {|n| @description = n.get_string_value() },\n \"displayName\" => lambda {|n| @display_name = n.get_string_value() },\n \"resourceScopes\" => lambda {|n| @resource_scopes = n.get_collection_of_primitive_values(String) },\n \"roleDefinition\" => lambda {|n| @role_definition = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::RoleDefinition.create_from_discriminator_value(pn) }) },\n })\n end",
"def get_field_deserializers()\n return super.merge({\n \"createdDateTime\" => lambda {|n| @created_date_time = n.get_date_time_value() },\n \"role\" => lambda {|n| @role = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::AccessPackageResourceRole.create_from_discriminator_value(pn) }) },\n \"scope\" => lambda {|n| @scope = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::AccessPackageResourceScope.create_from_discriminator_value(pn) }) },\n })\n end",
"def get_field_deserializers()\n return {\n \"attribution\" => lambda {|n| @attribution = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::ImageInfo.create_from_discriminator_value(pn) }) },\n \"backgroundColor\" => lambda {|n| @background_color = n.get_string_value() },\n \"content\" => lambda {|n| @content = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::Json.create_from_discriminator_value(pn) }) },\n \"description\" => lambda {|n| @description = n.get_string_value() },\n \"displayText\" => lambda {|n| @display_text = n.get_string_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n }\n end",
"def get_fields(template); end",
"def resource_url; nil end",
"def get_field_deserializers()\n return super.merge({\n \"body\" => lambda {|n| @body = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::SecurityFormattedContent.create_from_discriminator_value(pn) }) },\n \"createdDateTime\" => lambda {|n| @created_date_time = n.get_date_time_value() },\n \"imageUrl\" => lambda {|n| @image_url = n.get_string_value() },\n \"indicators\" => lambda {|n| @indicators = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::SecurityArticleIndicator.create_from_discriminator_value(pn) }) },\n \"isFeatured\" => lambda {|n| @is_featured = n.get_boolean_value() },\n \"lastUpdatedDateTime\" => lambda {|n| @last_updated_date_time = n.get_date_time_value() },\n \"summary\" => lambda {|n| @summary = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::SecurityFormattedContent.create_from_discriminator_value(pn) }) },\n \"tags\" => lambda {|n| @tags = n.get_collection_of_primitive_values(String) },\n \"title\" => lambda {|n| @title = n.get_string_value() },\n })\n end",
"def resource\n return Object unless resource_type\n return resource_type.constantize unless resource_id\n return _resource\n end",
"def get_field_deserializers()\n return super.merge({\n \"displayName\" => lambda {|n| @display_name = n.get_string_value() },\n \"isCourseActivitySyncEnabled\" => lambda {|n| @is_course_activity_sync_enabled = n.get_boolean_value() },\n \"learningContents\" => lambda {|n| @learning_contents = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::LearningContent.create_from_discriminator_value(pn) }) },\n \"learningCourseActivities\" => lambda {|n| @learning_course_activities = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::LearningCourseActivity.create_from_discriminator_value(pn) }) },\n \"loginWebUrl\" => lambda {|n| @login_web_url = n.get_string_value() },\n \"longLogoWebUrlForDarkTheme\" => lambda {|n| @long_logo_web_url_for_dark_theme = n.get_string_value() },\n \"longLogoWebUrlForLightTheme\" => lambda {|n| @long_logo_web_url_for_light_theme = n.get_string_value() },\n \"squareLogoWebUrlForDarkTheme\" => lambda {|n| @square_logo_web_url_for_dark_theme = n.get_string_value() },\n \"squareLogoWebUrlForLightTheme\" => lambda {|n| @square_logo_web_url_for_light_theme = n.get_string_value() },\n })\n end",
"def get_field_deserializers()\n return {\n \"excludeLocations\" => lambda {|n| @exclude_locations = n.get_collection_of_primitive_values(String) },\n \"includeLocations\" => lambda {|n| @include_locations = n.get_collection_of_primitive_values(String) },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n }\n end",
"def get_field_deserializers()\n return super.merge({\n \"applicationName\" => lambda {|n| @application_name = n.get_string_value() },\n \"displayName\" => lambda {|n| @display_name = n.get_string_value() },\n \"externalId\" => lambda {|n| @external_id = n.get_string_value() },\n \"webUrl\" => lambda {|n| @web_url = n.get_string_value() },\n })\n end",
"def get_field_deserializers()\n return super.merge({\n \"audiences\" => lambda {|n| @audiences = n.get_collection_of_primitive_values(String) },\n \"description\" => lambda {|n| @description = n.get_string_value() },\n \"issuer\" => lambda {|n| @issuer = n.get_string_value() },\n \"name\" => lambda {|n| @name = n.get_string_value() },\n \"subject\" => lambda {|n| @subject = n.get_string_value() },\n })\n end",
"def resources\n @resources ||= @response[@resource_field].to_a\n end",
"def get_field_deserializers()\n return {\n \"denied\" => lambda {|n| @denied = n.get_boolean_value() },\n \"description\" => lambda {|n| @description = n.get_string_value() },\n \"displayName\" => lambda {|n| @display_name = n.get_string_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"productName\" => lambda {|n| @product_name = n.get_string_value() },\n \"publisherName\" => lambda {|n| @publisher_name = n.get_string_value() },\n }\n end",
"def initialize(resource_types=nil, resource_type_field_name=nil)\n self.resource_types = resource_types\n self.resource_type_field_name = resource_type_field_name\n end",
"def resource_params\n {}\n end",
"def fields\n @fields ||= FieldList.new\n end",
"def resource_params\n {}\n end",
"def fields\n @fields ||= []\n end",
"def non_service_resources(release_doc)\n release_doc.resources - service_resources(release_doc)\n end",
"def get_field_deserializers()\n return {\n \"isRequired\" => lambda {|n| @is_required = n.get_boolean_value() },\n \"locations\" => lambda {|n| @locations = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::LocationConstraintItem.create_from_discriminator_value(pn) }) },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"suggestLocation\" => lambda {|n| @suggest_location = n.get_boolean_value() },\n }\n end",
"def get_field_deserializers()\n return super.merge({\n \"acceptances\" => lambda {|n| @acceptances = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::AgreementAcceptance.create_from_discriminator_value(pn) }) },\n \"displayName\" => lambda {|n| @display_name = n.get_string_value() },\n \"file\" => lambda {|n| @file = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::AgreementFile.create_from_discriminator_value(pn) }) },\n \"files\" => lambda {|n| @files = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::AgreementFileLocalization.create_from_discriminator_value(pn) }) },\n \"isPerDeviceAcceptanceRequired\" => lambda {|n| @is_per_device_acceptance_required = n.get_boolean_value() },\n \"isViewingBeforeAcceptanceRequired\" => lambda {|n| @is_viewing_before_acceptance_required = n.get_boolean_value() },\n \"termsExpiration\" => lambda {|n| @terms_expiration = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::TermsExpiration.create_from_discriminator_value(pn) }) },\n \"userReacceptRequiredFrequency\" => lambda {|n| @user_reaccept_required_frequency = n.get_duration_value() },\n })\n end",
"def fields\n return @fields if defined?(@fields)\n\n @fields = array_of_items_for(Fields, :fields)\n end",
"def aws_resources\n nil\n end",
"def get_field_deserializers()\n return super.merge({\n \"conditions\" => lambda {|n| @conditions = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::ConditionalAccessConditionSet.create_from_discriminator_value(pn) }) },\n \"createdDateTime\" => lambda {|n| @created_date_time = n.get_date_time_value() },\n \"description\" => lambda {|n| @description = n.get_string_value() },\n \"displayName\" => lambda {|n| @display_name = n.get_string_value() },\n \"grantControls\" => lambda {|n| @grant_controls = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::ConditionalAccessGrantControls.create_from_discriminator_value(pn) }) },\n \"modifiedDateTime\" => lambda {|n| @modified_date_time = n.get_date_time_value() },\n \"sessionControls\" => lambda {|n| @session_controls = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::ConditionalAccessSessionControls.create_from_discriminator_value(pn) }) },\n \"state\" => lambda {|n| @state = n.get_enum_value(MicrosoftGraph::Models::ConditionalAccessPolicyState) },\n })\n end",
"def non_relationship_custom_fields\n custom_fields_recipe['rules'].find_all do |rule|\n !%w[belongs_to has_many many_to_many].include?(rule['type'])\n end\n end",
"def get_field_deserializers()\n return {\n \"displayName\" => lambda {|n| @display_name = n.get_string_value() },\n \"locale\" => lambda {|n| @locale = n.get_string_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n }\n end",
"def optional_attributes\n fail NotImplementedError 'Please define #optional_attributes as a list of the '\\\n 'attributes on this resource that may not be present and thus should return nil' \\\n 'instead of raising a NoMethodError.'\n end",
"def get_field_deserializers()\n return super.merge({\n \"description\" => lambda {|n| @description = n.get_string_value() },\n \"displayName\" => lambda {|n| @display_name = n.get_string_value() },\n \"isBuiltIn\" => lambda {|n| @is_built_in = n.get_boolean_value() },\n \"roleAssignments\" => lambda {|n| @role_assignments = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::RoleAssignment.create_from_discriminator_value(pn) }) },\n \"rolePermissions\" => lambda {|n| @role_permissions = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::RolePermission.create_from_discriminator_value(pn) }) },\n })\n end",
"def liquid_filters\n [\n DesignResourceFilter,\n AttributeFilter\n ]\n end",
"def get_field_deserializers()\n return {\n \"bodyContains\" => lambda {|n| @body_contains = n.get_collection_of_primitive_values(String) },\n \"bodyOrSubjectContains\" => lambda {|n| @body_or_subject_contains = n.get_collection_of_primitive_values(String) },\n \"categories\" => lambda {|n| @categories = n.get_collection_of_primitive_values(String) },\n \"fromAddresses\" => lambda {|n| @from_addresses = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::Recipient.create_from_discriminator_value(pn) }) },\n \"hasAttachments\" => lambda {|n| @has_attachments = n.get_boolean_value() },\n \"headerContains\" => lambda {|n| @header_contains = n.get_collection_of_primitive_values(String) },\n \"importance\" => lambda {|n| @importance = n.get_enum_value(MicrosoftGraph::Models::Importance) },\n \"isApprovalRequest\" => lambda {|n| @is_approval_request = n.get_boolean_value() },\n \"isAutomaticForward\" => lambda {|n| @is_automatic_forward = n.get_boolean_value() },\n \"isAutomaticReply\" => lambda {|n| @is_automatic_reply = n.get_boolean_value() },\n \"isEncrypted\" => lambda {|n| @is_encrypted = n.get_boolean_value() },\n \"isMeetingRequest\" => lambda {|n| @is_meeting_request = n.get_boolean_value() },\n \"isMeetingResponse\" => lambda {|n| @is_meeting_response = n.get_boolean_value() },\n \"isNonDeliveryReport\" => lambda {|n| @is_non_delivery_report = n.get_boolean_value() },\n \"isPermissionControlled\" => lambda {|n| @is_permission_controlled = n.get_boolean_value() },\n \"isReadReceipt\" => lambda {|n| @is_read_receipt = n.get_boolean_value() },\n \"isSigned\" => lambda {|n| @is_signed = n.get_boolean_value() },\n \"isVoicemail\" => lambda {|n| @is_voicemail = n.get_boolean_value() },\n \"messageActionFlag\" => lambda {|n| @message_action_flag = n.get_enum_value(MicrosoftGraph::Models::MessageActionFlag) },\n \"notSentToMe\" => lambda {|n| @not_sent_to_me = n.get_boolean_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"recipientContains\" => lambda {|n| @recipient_contains = n.get_collection_of_primitive_values(String) },\n \"senderContains\" => lambda {|n| @sender_contains = n.get_collection_of_primitive_values(String) },\n \"sensitivity\" => lambda {|n| @sensitivity = n.get_enum_value(MicrosoftGraph::Models::Sensitivity) },\n \"sentCcMe\" => lambda {|n| @sent_cc_me = n.get_boolean_value() },\n \"sentOnlyToMe\" => lambda {|n| @sent_only_to_me = n.get_boolean_value() },\n \"sentToAddresses\" => lambda {|n| @sent_to_addresses = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::Recipient.create_from_discriminator_value(pn) }) },\n \"sentToMe\" => lambda {|n| @sent_to_me = n.get_boolean_value() },\n \"sentToOrCcMe\" => lambda {|n| @sent_to_or_cc_me = n.get_boolean_value() },\n \"subjectContains\" => lambda {|n| @subject_contains = n.get_collection_of_primitive_values(String) },\n \"withinSizeRange\" => lambda {|n| @within_size_range = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::SizeRange.create_from_discriminator_value(pn) }) },\n }\n end",
"def filter_fields\n\t \n\t \tremove_attribute(:version)\n\t \tremove_attribute(:op_success)\n\t \tattributes\n\n\t \t\n\t end",
"def filter_fields\n\t \n\t \tremove_attribute(:version)\n\t \tremove_attribute(:op_success)\n\t \tattributes\n\n\t \t\n\t end",
"def fields\n []\n end",
"def get_field_deserializers()\n return super.merge({\n \"group\" => lambda {|n| @group = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::Group.create_from_discriminator_value(pn) }) },\n \"includedSources\" => lambda {|n| @included_sources = n.get_enum_value(MicrosoftGraph::Models::SecuritySourceType) },\n })\n end",
"def get_field_deserializers()\n return {\n \"description\" => lambda {|n| @description = n.get_string_value() },\n \"displayName\" => lambda {|n| @display_name = n.get_string_value() },\n \"id\" => lambda {|n| @id = n.get_guid_value() },\n \"isEnabled\" => lambda {|n| @is_enabled = n.get_boolean_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"value\" => lambda {|n| @value = n.get_string_value() },\n }\n end",
"def fields\n @fields ||= []\n end",
"def fields\n @fields ||= form.fields\n end",
"def get_field_deserializers()\n return super.merge({\n \"committedContentVersion\" => lambda {|n| @committed_content_version = n.get_string_value() },\n \"contentVersions\" => lambda {|n| @content_versions = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::MobileAppContent.create_from_discriminator_value(pn) }) },\n \"fileName\" => lambda {|n| @file_name = n.get_string_value() },\n \"size\" => lambda {|n| @size = n.get_object_value(lambda {|pn| Int64.create_from_discriminator_value(pn) }) },\n })\n end",
"def fields\n raise NoMethodError, \"Descendants of MSFL::Datasets::Base are required to implement the #fields method\"\n end"
] |
[
"0.63337797",
"0.5906204",
"0.58706826",
"0.58599544",
"0.584018",
"0.5734528",
"0.5726361",
"0.5713535",
"0.5702535",
"0.5652184",
"0.5614438",
"0.5600042",
"0.5597079",
"0.55841076",
"0.55790764",
"0.5576986",
"0.5568455",
"0.5553374",
"0.5512703",
"0.5495264",
"0.5472933",
"0.5469381",
"0.5444674",
"0.54395574",
"0.54339826",
"0.5432585",
"0.54142016",
"0.54103315",
"0.5410068",
"0.54079723",
"0.54079723",
"0.5405899",
"0.53973913",
"0.53932893",
"0.5392986",
"0.53847045",
"0.53667957",
"0.53667957",
"0.53667957",
"0.53645855",
"0.53563565",
"0.5351353",
"0.53435373",
"0.53347814",
"0.5315691",
"0.5315679",
"0.5311681",
"0.53008103",
"0.52994186",
"0.52966505",
"0.52966505",
"0.52966505",
"0.52966505",
"0.52966505",
"0.52910244",
"0.5290236",
"0.5285382",
"0.5283737",
"0.5283737",
"0.5283737",
"0.52783364",
"0.5277584",
"0.5268852",
"0.5264125",
"0.52621305",
"0.524695",
"0.52416956",
"0.5238388",
"0.5232354",
"0.5227659",
"0.52273893",
"0.52273226",
"0.52271855",
"0.5224459",
"0.522175",
"0.52134115",
"0.5208258",
"0.5207901",
"0.5206699",
"0.5204124",
"0.5201038",
"0.51995677",
"0.51989764",
"0.51938236",
"0.5189547",
"0.51891804",
"0.51876557",
"0.5184496",
"0.5179954",
"0.5179359",
"0.5175779",
"0.5174703",
"0.5174703",
"0.5168786",
"0.5167544",
"0.51613015",
"0.5148944",
"0.5143687",
"0.5143152",
"0.51399076"
] |
0.64128834
|
0
|
Shared instance of the API client
|
def client
Contentful::Management::Client.shared_instance
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def client\r\n @client ||= APIController.new config\r\n end",
"def api_client\n self.class.api_client\n end",
"def client\n @client ||= Client.new(configuration)\n end",
"def instance\n @instance ||= Artsy::Client::Instance.new(options)\n end",
"def api_client\n @api_client ||= ::Lokalise.client LokaliseRails.api_token, {enable_compression: true}.merge(LokaliseRails.timeouts)\n end",
"def client\n @client ||= Client.new(config[:credentials], config[:end_point])\n end",
"def client\n @client ||= Client.new\n end",
"def api\n # Don't cache instance for now because of a ruby marshaling bug present\n # in MRI 1.9.3 (Bug #7627) that causes instance variables to be\n # marshaled even when explicitly specifying #marshal_dump.\n Octokit::Client.new(:login => login, :access_token => token)\n end",
"def api\n # Should return an instance of the API instantiated \n # with the credentials passed into the initialized.\n # Raise an error to warn it isn't implemented.\n raise NotImplementedError.new \n end",
"def client\n # @client ||= MyService::Client.new(SinaToken.consumer.key, SinaToken.consumer.secret, token, secret)\n end",
"def client\n @client ||= self.class.client\n end",
"def get_client\n config.client.new(self)\n end",
"def client\n return @client if @client\n @client = DropboxApi::Client.new(api_token)\n\n rescue => err\n raise Error.wrap(err, \"Authorization Failed\")\n end",
"def client\n self.class.client\n end",
"def client\n self.class.client\n end",
"def client\n @client ||= Client.current\n end",
"def client\n @client ||= Twitter::REST::Client.new(client_params)\n end",
"def api_client\n env[:api_client]\n end",
"def api\n @http ||= Http.new(config)\n end",
"def client\n puts \"creating client\"\n @client ||= Vineyard::Client.new(options) #unless defined?(@client) && @client.hash == options.hash\n @client\n end",
"def api\n @api ||= Octokit::Client.new(:login => login, :oauth_token => token)\n end",
"def client\n @client ||= Contentful::Client.new(\n access_token: options.access_token,\n space: options.space,\n dynamic_entries: :auto,\n api_url: options.api_url\n )\n end",
"def client\n @client ||= platform_klass::Client.new(@options)\n end",
"def client\n @client ||= OAuth2::Client.new(@apikey, @apisecret, :site => @graph_api_url)\n end",
"def client\n @client\n end",
"def client\n @client\n end",
"def client\n @client\n end",
"def start_client\n @client = Client.new(@configure.apis)\n @client.run\n end",
"def connection\n @connection ||= RestClient::Resource.new(api_uri.to_s)\n end",
"def client\n @_client ||= Twitter::REST::Client.new do |config|\n config.consumer_key = CONSUMER_KEY\n config.consumer_secret = CONSUMER_SECRET\n config.access_token = ACCESS_TOKEN\n config.access_token_secret = ACCESS_TOKEN_SECRET\n end\n end",
"def client\n @admin ||= User.find_by(is_admin: true)\n @auth_record ||= @admin.auth_record\n @client ||= CiscoAmpApi::V1::Client.new(@auth_record.api_client, @auth_record.api_key )\n end",
"def client\n @@client\n end",
"def client\n @client ||= Faraday.new(api_host) do |faraday|\n faraday.headers[\"Authorization\"] = \"Bearer #{access_token}\"\n faraday.response :logger if Rails.env.test?\n faraday.adapter Faraday.default_adapter\n end\n end",
"def init_client; end",
"def client\n @client ||= ::Twilio::REST::Client.new(@account_sid, @auth_token)\n end",
"def client\n self.class.client\n end",
"def client\n\t\treturn @client\n\tend",
"def client\n if !@client || @client.hash != options.hash\n @client = Croudia::Client.new\n end\n @client\n end",
"def api_client\n @client ||= (begin\n client = Google::APIClient.new\n\n client.authorization.client_id = settings.credentials.client_id\n client.authorization.client_secret = settings.credentials.client_secret\n client.authorization.redirect_uri = settings.credentials.redirect_uris.first\n client.authorization.scope = SCOPES\n client\n end)\n end",
"def api_client\n @api_client ||= WildFly::ApiClient.new\n end",
"def initialize(*args)\n @client ||= Betaface::REST::Client.new(*args) \n end",
"def client\n @client = Gluby::Client.instance unless @client\n @client\n end",
"def setup_api_client\n # see http://rubydoc.info/github/heroku/databasedotcom/master/Databasedotcom/Client:initialize\n # add :debugging => true to constructor hash to log API request/responses\n #u = current_user\n #debugger\n @client = Databasedotcom::Client.new({})\n @client.version = API_VERSION\n @client.authenticate :token => @current_user.access_token,\n :refresh_token => @current_user.refresh_token,\n :instance_url => @current_user.instance_url\n @client.materialize(\"Account\")\n end",
"def client\n @client ||= Twitter::REST::Client.new do |config|\n config.consumer_key = ENV['TWITTER_API_KEY']\n config.consumer_secret = ENV['TWITTER_API_SECRET']\n config.access_token = session['token']\n config.access_token_secret = session['secret']\n end\n end",
"def client\n @client ||= ::Flickr.new({:key => @appid, :secret => @secret, :token => @token.token})\n end",
"def client\n @client ||= Github::ApiProxy.new(@options[:access_token])\n end",
"def initialize(api_key)\n @client = Juicer::Client.new(api_key)\n end",
"def set_client\n @client = ApiClient.find(params[:code])\n end",
"def get_client\n @client\n end",
"def initialize(api_key)\n @client = HTTPClient.new(\n default_header: {\n 'X-Auth-Token' => api_key,\n 'Content-Type' => 'application/json'\n }\n )\n end",
"def api_client\n @api_client ||= Koala::Facebook::API.new(app_access_token)\n end",
"def initialize(api)\n @api = api\n end",
"def connection\n @connection ||= if authenticated?\n RestClient::Resource.new(api_uri.to_s, @username, @password)\n else\n RestClient::Resource.new(api_uri.to_s)\n end\n end",
"def set_api_client\n Github.api_client = self\n end",
"def client\n @client\n end",
"def client\n @client\n end",
"def clients\n @clients ||= Harvest::API::Clients.new(credentials)\n end",
"def client\n @client ||= Curl::Easy.new\n end",
"def client\n @client ||= Twitter::Client.new(client_config)\n end",
"def setup_client\n @client = Viddler::Client.new(@api_key)\n @client.authenticate!(@username, @password)\n end",
"def api_object\n unless $api\n $api = FyberAPI.new(\n 'b07a12df7d52e6c118e5d47d3f9e60135b109a1f',\n {\n appid: 157,\n format: 'json',\n device_id: '2b6f0cc904d137be2e1730235f5664094b83',\n locale: 'de',\n ip: '109.235.143.113'\n }\n )\n end\n $api\n end",
"def client; end",
"def client; end",
"def client\n @client ||= Utils::Box::Client.new\n end",
"def client\n set_connection unless @client\n @client\n end",
"def twitter_client\n #Dotenv.load\n @client = Twitter::REST::Client.new do |config|\n config.consumer_key = ENV[ 'twitter_api_public']\n config.consumer_secret = ENV[ 'twitter_api_secret' ]\n config.access_token = self.token\n config.access_token_secret = self.secret\n end\n end",
"def special_client\n @special_client ||= Twitter::REST::Client.new do |c|\n c.consumer_key = configure[:consumer_key]\n c.consumer_secret = configure[:consumer_secret]\n c.access_token = configure[:access_token]\n c.access_token_secret = configure[:access_token_secret]\n end\n end",
"def initialize(api_key, resource_url)\n @rest_client = RestClient.new(resource_url, api_key)\n end",
"def initialize api_key, api_secret\n @api_key = api_key\n @api_secret = api_secret\n end",
"def client\n @client ||= ::OAuth2::Client.new(\n @consumer_token,\n @consumer_secret,\n :site => 'https://api-ssl.bitly.com',\n :token_url => '/oauth/access_token'\n )\n end",
"def api_client\n @api_client ||= GooglePlaces::Client.new(GOOGLE_API_KEY)\n end",
"def client\n @client = Faceberry::Client.new(options) unless defined?(@client) && @client.cache_key == options.hash\n @client\n end",
"def client\r\n @client ||= Twitter::REST::Client.new do |config|\r\n config.consumer_key = \"6Qp2jNoS9qOVZMpVNjpBNw\"\r\n config.consumer_secret = \"fm7Xplz3ndNsLgMrBRwHaT6oiaBE78wYO8K013dN8\"\r\n config.access_token = \"1256486036-PoyKFmiz3VtVchgbip875A57HZ5AA3cMxbgWfOk\"\r\n config.access_token_secret = \"N4MehECNc3x658xZb674Ev8TnD5doh5v8sFGYdL0t5J94\"\r\n end\r\nend",
"def client\n return @client if @client\n\n unless session = cached_session\n Logger.info \"Creating a new Baidu session!\"\n session = create_session!\n end\n\n @client = Baidu::PCS::Client.new(session, dir_name)\n rescue => err\n raise Error.wrap(err, 'Authorization Failed.')\n end",
"def client\n Twitter::REST::Client.new(consumer_key: Settings.consumer.key,\n consumer_secret: Settings.consumer.secret,\n access_token: oauth_token,\n access_token_secret: oauth_token_secret)\n end",
"def initialize(config)\n @config = config\n @api_client = ApiClient.new(config)\n @access_token = nil\n end",
"def initialize(config)\n @config = config\n @api_client = ApiClient.new(config)\n @access_token = nil\n end",
"def app_client\n @app_client ||= Octokit::Client.new :client_id => CLIENT_ID, :client_secret => CLIENT_SECRET\nend",
"def client\n @client ||= Twilio::REST::Client.new(ENV[\"TWILIO_SID\"], ENV[\"TWILIO_AUTH\"])\n end",
"def client\n ENV[\"CHEF_API_CLIENT\"] || config[\"CHEF_API_CLIENT\"]\n end",
"def initialize\n @api_user = \"\"\n @api_key = \"\"\n end",
"def client(group, version)\n # Return the client immediately if it has been created before:\n key = group + '/' + version\n client = @clients[key]\n return client if client\n\n # Determine the API path:\n if group == CORE_GROUP\n path = '/api'\n else\n path = '/apis/' + group\n end\n\n # Create the client and save it:\n url = URI::Generic.build(\n scheme: 'https',\n host: @host,\n port: @port,\n path: path\n )\n client = Kubeclient::Client.new(\n url.to_s,\n version,\n @opts\n )\n @clients[key] = client\n\n # Return the client:\n client\n end",
"def client\n @client ||= begin\n require 'packagecloud'\n creds = Packagecloud::Credentials.new('socrata-platform', token)\n Packagecloud::Client.new(creds)\n end\n end",
"def client\n @parent.instance_variable_get(:@client)\n end",
"def api\n @api ||= PrismicService.init_api\n end",
"def setApiClient(client)\n\t\t\t@api_client = client\n\t\tend",
"def octokit_client\n # Check if we already have the octokit client stored in an instance variable else fetch it using\n # the user's access token to authenticate.\n @client ||= Octokit::Client.new :access_token => token\n @client\n end",
"def client\n @client || Client.connection\n end",
"def srch_client\n\t\t\t\t@@client ||= Srchio::Client.new(:searcher_id => srch_config[:searcher_id])\n\t\t\tend",
"def client\n @client ||= OAuth2::Client.new( get_config('SMARTCAR_CLIENT_ID'),\n get_config('SMARTCAR_SECRET'),\n :site => OAUTH_PATH\n )\n end",
"def initialize(api_key = nil, shared_secret = nil, options = nil)\n @api_key = api_key || @@default_api_key\n @shared_secret = shared_secret || @@default_shared_secret\n @options = options || @@default_options\n @rest_endpoint = @options[:rest_endpoint] || REST_ENDPOINT\n @auth_endpoint = @options[:auth_endpoint] || AUTH_ENDPOINT\n end",
"def client\n @client ||= Curl::Easy.new\n end",
"def api\n @api ||= KynetxAmApi::DirectApi.new({:access_token => @access_token, :access_secret => @access_secret})\n return @api\n end",
"def api\n # Only instantiate the API if needed. validate_update doesn't require it, so we shouldn't\n # make an unnecessary request to get the app_access_token.\n @api ||= API.new(app_access_token)\n end",
"def initialize\n self.http_client = HTTPClient.new(:base_url => Rdioid::BASE_URL, :force_basic_auth => true)\n\n http_client.set_auth(Rdioid::OAUTH_TOKEN_ENDPOINT, Rdioid.config.client_id, Rdioid.config.client_secret)\n end",
"def getclient\n return @client\n end",
"def client\n end",
"def initialize(key, client=nil)\n @api_key = key\n @client = client\n end",
"def client\n @client ||= Slack::RealTime::Client.new(token: SLACK_API_TOKEN)\n end",
"def client\n @client ||= client_for_host(brine_root_url || 'http://localhost:8080',\n logging: ENV['BRINE_LOG_HTTP'])\n end"
] |
[
"0.8125511",
"0.8014103",
"0.7446526",
"0.74139553",
"0.73478997",
"0.73442525",
"0.7337053",
"0.7319985",
"0.7284285",
"0.72401106",
"0.72299707",
"0.7155619",
"0.714666",
"0.71432656",
"0.71432656",
"0.7126933",
"0.711525",
"0.70991236",
"0.7073043",
"0.7070854",
"0.7061037",
"0.70444655",
"0.7019566",
"0.7011611",
"0.6990094",
"0.6990094",
"0.6990094",
"0.69872236",
"0.69681495",
"0.6962313",
"0.6955592",
"0.694586",
"0.6938886",
"0.6937155",
"0.69241446",
"0.6899108",
"0.6876682",
"0.6870104",
"0.6858926",
"0.6858302",
"0.6837487",
"0.6833368",
"0.68193305",
"0.6817359",
"0.6816377",
"0.6797016",
"0.6794945",
"0.6790304",
"0.67521346",
"0.67417896",
"0.67349327",
"0.6727403",
"0.6725649",
"0.67225397",
"0.67030245",
"0.67030245",
"0.67028475",
"0.6700692",
"0.6675084",
"0.66734344",
"0.66582745",
"0.66579545",
"0.66579545",
"0.66481924",
"0.6646263",
"0.6645215",
"0.66171914",
"0.6584697",
"0.65797025",
"0.65712637",
"0.6568386",
"0.6549435",
"0.6536828",
"0.6530717",
"0.6524725",
"0.6521103",
"0.6521103",
"0.6520143",
"0.651925",
"0.65116274",
"0.65078515",
"0.65067095",
"0.6506051",
"0.65019345",
"0.6496983",
"0.6489475",
"0.6485631",
"0.64838547",
"0.6481366",
"0.6478075",
"0.6475998",
"0.64698154",
"0.64689606",
"0.6466623",
"0.64658624",
"0.6460913",
"0.64556795",
"0.6455515",
"0.64554554",
"0.6445443"
] |
0.65489644
|
72
|
Returns the Environment ID
|
def environment_id
nil
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def environment_id\n id\n end",
"def get_environment_id(client, name)\n\n self.info(\"Getting environment id from name '#{name}'\")\n \n message = { \"username\" => @resource[:connection]['username'], \"password\" => @resource[:connection]['password'], \"mainType\" => \"Environment\", \"format\" => \"CSV\", \"begin\" => 0, \"count\" => 1, \n \"properties\" => { :string => \"system_id\" }, \"conditions\" => { :string => \"system_name eq '#{name}'\" } }\n \n response = client.call(:export, message: message)\n \n token = response.body[:export_response][:export_result][:token]\n self.debug(\"Got token: #{token}\")\n\n while true\n response = client.call(:get_status, message: { \"token\" => token })\n if response.body[:get_status_response][:get_status_result][:status].to_i != 0\n break\n end\n sleep 1\n end\n \n self.debug(\"Get Status SOAP response: \" + response.to_s)\n \n data = response.body[:get_status_response][:get_status_result][:data]\n \n if data.nil? or data.lines.count < 2\n self.info(\"Environment not found: #{name}. Skip environment import.\")\n return -1\n end\n\n env_id = data.split(\"\\n\")[1].split(\",\")[-1]\n return env_id.to_i\n end",
"def engine_environment_id\n\n @eei ||= new_fei(\n :workflow_definition_url => 'ee',\n :workflow_definition_name => 'ee',\n :workflow_instance_id => '0',\n :expression_name => EN_ENVIRONMENT)\n end",
"def get_environment ()\n service_data = query_for_services()\n return service_data[\"environment\"]\n end",
"def ip_address_id(env)\n ip_address_record(env)[:id]\n end",
"def current_session_id(env)\n env[ENV_SESSION_OPTIONS_KEY][:id]\n end",
"def application_id\n get_key('ALGOLIA_APPLICATION_ID', 'application_id')\n end",
"def org_id\n query('select id from Organization').first['Id']\n end",
"def find(id)\n unless environment = ridley.environment.find(id)\n abort EnvironmentNotFound.new(id)\n end\n\n environment\n end",
"def engine_id\n\n @dict.fexp.context.engine_id\n end",
"def environment(project, id)\n get(\"/projects/#{url_encode project}/environments/#{id}\")\n end",
"def req_id(env)\n env.request.context[:request_id].to_s\n end",
"def environment(id)\n Environment.new(self, id)\n end",
"def extract_request_id(env)\n SecureRandom.uuid\n end",
"def environment_version\n metadata[:environment_version]\n end",
"def compartment_id\n @compartment_id ||= config[:compartment_id] || Chef::Config[:knife][:compartment_id] || oci_config.tenancy\n end",
"def env_var_to_hold_api_client_primary_key\n @env_var_to_hold_api_client_primary_key.to_s\n end",
"def kernel_id\n data[:kernel_id]\n end",
"def environment_name\n return @environment_name if @environment_name.is_a? String\n if ENV['EY_ENVIRONMENT_NAME']\n @environment_name = ENV['EY_ENVIRONMENT_NAME']\n elsif engine_yard_cloud_api.possible_to_detect_environment_from_git_config?\n @environment_name = engine_yard_cloud_api.environment_name\n end\n raise RuntimeError, \"[engineyard-metadata gem] You need to run this from the application repo, set EY.metadata.environment_name= or set ENV['EY_ENVIRONMENT_NAME']\" unless @environment_name.to_s.strip.length > 0\n @environment_name\n end",
"def set_environment\n @environment = @suite.environments.find(params[:id])\n end",
"def get_id()\n return @id\n end",
"def get_identifier\n identifier = get_project_name\n fail(\n ActiveRecord::RecordNotFound,\n \"Project identifier not specified\"\n ) if identifier.nil?\n identifier.to_s\n end",
"def access_key_id\n ENV[\"#{partition&.upcase}_ACCESS_KEY_ID\"] || credentials[\"#{partition}_access_key_id\"]\n end",
"def db_system_id\n data[:db_system_id]\n end",
"def db_system_id\n data[:db_system_id]\n end",
"def application_id\n return @application_id\n end",
"def env_key; end",
"def name\n c.environment\n end",
"def project_id(project_key)\n project_info(project_key)['id']\n end",
"def id\n # FIXME: make this number configurable and document the probabilities of clashes\n @id ||= @env[Action::REQUEST_ID] = SecureRandom.hex(Action::DEFAULT_ID_LENGTH)\n end",
"def variables_scope_id\n current_variables_scope.guid\n end",
"def automation_id\n @attributes[:automation_id]\n end",
"def target_environment\n return unless application = applications.first\n application.split(\"-\").first\n end",
"def app_id\n self.class.send :class_variable_get, :@@app_id\n end",
"def uuid\n @keystore[:id]\n end",
"def environment\n @environment\n end",
"def id\n ChefPlatformSpec.id_from(chef_server, name)\n end",
"def client_id\n ENV['AZURE_CLIENT_ID']\n end",
"def app_identifier\n return @app_identifier\n end",
"def key_id\n metadata[\"keyid\"]\n end",
"def error_id\n Apartment::Tenant.current.to_s + \"/\" + id.to_s\n end",
"def app_id\n @app.id\n end",
"def environment\n @environment || DEFAULT_ENVIRONMENT\n end",
"def get_environment\n if @environment.empty?\n \":\"\n else\n env = @environment.map { |key, value| %(#{key}=\"#{value}\") }\n \"export #{env.join(' ')}\"\n end\n end",
"def window_id\n return (env = to_i!(ENV['WINDOWID'])) if env\n \n curr_pid = Process.pid\n until curr_pid.to_i < 2\n file = environ_file(curr_pid)\n if file and (xid = to_i!(file.read.scan(/(?<=WINDOWID=)\\d+/)[0]))\n return xid\n else\n curr_pid = ppid_of(curr_pid)\n end\n end\n \n end",
"def get_job_id\n # check if the job ID has already been set (the job name will not change\n # during execution, so it is safe to assume that the job ID won't change)\n if not defined? @job_id or @job_id == '' or @job_id == nil\n result = veeamconfig('job', 'list').lines\n if result.length > 1\n result.each_with_index do |line, index|\n # skip the first line of output, since it is just the table setup\n next if index == 0\n\n # split line into array by space\n bits = line.split(' ')\n # pull out the repository name\n job_name = bits[0]\n\n # parse and return the job ID\n @job_id = bits[1].tr('{}', '') if job_name == @resource[:job_name]\n return @job_id\n end\n\n # return false if the job doesn't exist\n false\n else\n # return false if there are no jobs that exist\n false\n end\n else\n # return the job ID if it's already set\n @job_id\n end\n end",
"def app_id\n return @app_id\n end",
"def app_id\n return @app_id\n end",
"def app_id\n return @app_id\n end",
"def automation_id\n return @automation_id\n end",
"def key_id\n GlobalConstant::Aws::Kms.get_key_id_for(@purpose)\n end",
"def key_id\n GlobalConstant::Aws::Kms.get_key_id_for(@purpose)\n end",
"def run_id\n job_group.execution_variables['run_id']\n end",
"def stage_id\n return @stage_id\n end",
"def process_id\n\n\t\t::Pantheios::Core.process_id\n\tend",
"def product_id\n read('product_id')\n end",
"def env_name(key); end",
"def set_project_environment\n @project_environment = ProjectEnvironment.find(params[:id])\n end",
"def get_deployment_id\n # nil means that no deployment_id was found\n deployment_id = nil\n ignore_error do\n deployment_id = variables_file_text.match(\n /variable\\s\\\"deployment_id\\\"\\s+\\{(.|\\w)*?}/m\n )[0].split('\"')[3]\n end\n # return whatever we did or did not find\n deployment_id\n end",
"def deploy_id\n self['DEPLOY_ID']\n end",
"def org_id\n @org_id ||= query_org_id # lazy query org_id when not set by login response\n end",
"def engine_id\n\n conf['engine_id'] || 'engine'\n end",
"def container_id\n @container_info[\"Id\"]\n end",
"def get_id()\n return @id\n end",
"def extract_trace_id env\n trace_context = env[\"HTTP_X_CLOUD_TRACE_CONTEXT\"].to_s\n return nil if trace_context.empty?\n trace_context.sub(%r{/.*}, \"\")\n end",
"def app_scope_id\n return @app_scope_id\n end",
"def env\n Thread.current[ENVIRONMENT] or raise(\"no env in scope\")\n end",
"def get_environments_layout\n @environment.present? ? \"environment\" : \"application\"\n end",
"def get_env(key)\n\n end",
"def id\n config[:id] || Origen.target.name\n end",
"def id\n config[:id] || Origen.target.name\n end",
"def application_id\n @application_id || YodleeApi.application_id\n end",
"def get_id()\n @id\n end",
"def get_id()\n @id\n end",
"def id\n return unless object.id.present?\n\n model_name = object.type || ::CommitStatus.name\n id = object.id\n Gitlab::GlobalId.build(model_name: model_name, id: id)\n end",
"def allocation_id\n data[:allocation_id]\n end",
"def instance_id\n return ec2_meta_data('instance-id')\n end",
"def server_id\n @host.id\n end",
"def id\n get_screen_config['id']\n end",
"def id\n @id ||= scgi.session_id\n end",
"def organization_id\n self.organization.id if self.organization && self.organization.is_a?(Organization)\n end",
"def ccdb_app_id()\n KNIFE::get_app_id(@current_name)\n end",
"def get_job_id(error = true)\n job_id = get_env_var('SLURM_JOB_ID', error_ = false)\n job_id = get_env_var('SLURM_JOBID', error_ = error) unless job_id\n job_id.to_i\nend",
"def set_enviroment\n @enviroment = Enviroment.find(params[:id])\n end",
"def set_enviroment\n @enviroment = Enviroment.find(params[:id])\n end",
"def aws_access_key_id\n aws_ssm_parameter_store && aws_ssm_parameter_store[:access_key_id]\n end",
"def project_id\n service.project\n end",
"def project_id\n service.project\n end",
"def project_id\n service.project\n end",
"def id\n @__metadata__.key || @id\n end",
"def id\n object.external_id\n end",
"def context_id\n params[\"#{ params[:constraint][:context_type].singularize }_id\"]\n end",
"def process_id\n return @process_id\n end",
"def app_item_id\n read('app_item_id')\n end",
"def environment\n @environment ||= nil\n end",
"def external_id\n return @external_id\n end",
"def external_id\n return @external_id\n end",
"def external_id\n return @external_id\n end",
"def external_id\n return @external_id\n end",
"def appid\n if (@appid.nil? or @appid.empty?)\n fatal(\"Error: appid: App ID was not set. Aborting.\")\n end\n @appid\n end"
] |
[
"0.88774675",
"0.7477829",
"0.70253795",
"0.6537735",
"0.65218514",
"0.6492551",
"0.6437663",
"0.63625264",
"0.6329534",
"0.6322968",
"0.62675273",
"0.6249405",
"0.6212033",
"0.6166963",
"0.61639905",
"0.6163196",
"0.6132946",
"0.60559934",
"0.60352176",
"0.60234153",
"0.5925335",
"0.58848256",
"0.58658695",
"0.58640945",
"0.58640945",
"0.58634925",
"0.5854087",
"0.5841748",
"0.5827614",
"0.5816346",
"0.58136344",
"0.57976955",
"0.5789354",
"0.5783886",
"0.5779946",
"0.57796687",
"0.57506114",
"0.5737929",
"0.5726148",
"0.5703964",
"0.57007164",
"0.5684887",
"0.5678963",
"0.56763047",
"0.56706136",
"0.56693995",
"0.5658419",
"0.5658419",
"0.5658419",
"0.5651059",
"0.5645484",
"0.5645484",
"0.5637351",
"0.5625277",
"0.5613019",
"0.56068265",
"0.56012255",
"0.56002295",
"0.5596106",
"0.55940557",
"0.55912554",
"0.5583473",
"0.5583006",
"0.5580885",
"0.55783635",
"0.5577935",
"0.5577226",
"0.55691236",
"0.5558707",
"0.5557796",
"0.5557796",
"0.55420166",
"0.5534713",
"0.5534713",
"0.55321854",
"0.55281216",
"0.5520183",
"0.551653",
"0.55152917",
"0.5515068",
"0.5514554",
"0.5508966",
"0.55071646",
"0.5505278",
"0.5505278",
"0.5504072",
"0.5503914",
"0.5503914",
"0.5503914",
"0.5500485",
"0.5486452",
"0.5484442",
"0.54827243",
"0.5476109",
"0.5474697",
"0.5473769",
"0.5473769",
"0.5473769",
"0.5473769",
"0.5473184"
] |
0.78839684
|
1
|
Get default_locale from client
|
def default_locale
client.default_locale
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def default_locale\n FastGettext.available_locales.first\n end",
"def default_locale\n @default_locale ||= self.languages.get_default.code.to_sym\n end",
"def default_locale\n return nil unless localized?\n u_lc = I18n.locale.to_sym\n available_locales.include?(u_lc) ? u_lc : available_locales[0]\n end",
"def default_locale\n evaluate_localization_option!(:default_locale)\n end",
"def default_locale; end",
"def default_locale\n self.found_locale ||= find_locale\n end",
"def default_locale\n AppConfig.default_locale\n end",
"def default_locale\n (self.locales.first || Locomotive::Mounter.locale).to_sym\n end",
"def current_locale\n Thread.current[:\"localite:locale\"] || base\n end",
"def get_locale(host)\r\n host.gsub(I18n.config.host_locale_regex, '\\1') || I18n.default_locale\r\n end",
"def get_locale\n I18n.locale = session[:i18n] || I18n.default_locale || :en\n end",
"def system\n locale_from_env || default_locale\n end",
"def find_best_locale\n browser_locale =\n http_accept_language.preferred_language_from(\n Rails.application.config.automatic_locales\n )\n return browser_locale if browser_locale.present?\n\n I18n.default_locale\n end",
"def locale\n defined?(I18n) ? I18n.locale : default_locale\n end",
"def find_locale\n locale = locales.all.detect(&:default)\n return locale.code if locale\n\n default_locale\n end",
"def locale\n @locale || YodleeApi.locale\n end",
"def get_locale(locale = nil)\n locale || @_deco_locale || (h.cama_get_i18n_frontend rescue nil) || I18n.locale\n end",
"def default_locale=(locale); end",
"def locale\n @locale || { :country => \"US\", :language => \"en\", :variant => nil }\n end",
"def locale\n current_site.locale || I18n.default_locale.to_s\n end",
"def default_language\n @default_language || :en\n end",
"def current_locale\n I18n.locale.to_sym || I18n.default_locale.to_sym || I18n.available_locales.first.to_sym\n end",
"def get_locale\n if !self.language.nil?\n return self.language.abbreviation\n else\n return nil\n end\n end",
"def header_locale\n options = request.env.fetch('HTTP_ACCEPT_LANGUAGE', '').split(',')\n # clear out preference values; assume they'll be in order\n options.map! { |v| v.split(';')[0] }\n options.each do |v|\n return locale_matches[v] if locale_matches.keys.include?(v)\n end\n I18n.default_locale\n end",
"def get_locale\n if !self.language.nil?\n return self.language.abbreviation\n elsif !self.org.nil?\n return self.org.get_locale\n else\n return nil\n end\n end",
"def extract_locale_from_request\r\n # locale defined in parameters\r\n return params[:locale] if params[:locale]\r\n # get locale from subdomains\r\n parsed_locale = request.subdomains.first\r\n return parsed_locale if I18n.available_locales.map(&:to_s).include?(parsed_locale)\r\n # get locale from http header\r\n return request.env['HTTP_ACCEPT_LANGUAGE'].scan(/^[a-z]{2}/).first if request.env['HTTP_ACCEPT_LANGUAGE']\r\n # get default locale\r\n return I18n.default_locale\r\n end",
"def locale\n I18n.locale.to_s\n end",
"def locale\n I18n.locale.to_s\n end",
"def extract_locale_from_request\r\n # locale defined in parameters\r\n return params[:locale] if params[:locale]\r\n # get locale from subdomains\r\n parsed_locale = request.subdomains.first\r\n return parsed_locale if I18n.available_locales.map(&:to_s).include?(parsed_locale)\r\n # get locale from http header\r\n return request.env['HTTP_ACCEPT_LANGUAGE'].scan(/^[a-z]{2}/).first if request.env['HTTP_ACCEPT_LANGUAGE']\r\n # get default locale\r\n return I18n.default_locale\r\n end",
"def locale\n self.padma.try :locale\n end",
"def options_locale\n current_user.try(:locale) ||\n session[:locale] ||\n http_accept_language.compatible_language_from(I18n.available_locales) ||\n I18n.default_locale\n end",
"def get_locale_from_http_header\n return DEFAULT_LANGUAGE if request.env['HTTP_ACCEPT_LANGUAGE'].nil?\n locale = request.env['HTTP_ACCEPT_LANGUAGE'].scan(/^[a-z]{2}/).first\n return locale if I18N_ALL_LANGUAGES.include?( locale)\n return DEFAULT_LANGUAGE\n end",
"def locale(force = true)\n @locale || negotiate_locale(force)\n end",
"def locale_backend; end",
"def locale\n favored_locale\n end",
"def locale\n sys && sys[:locale] ? sys[:locale] : default_locale\n end",
"def locale\n sys && sys[:locale] ? sys[:locale] : default_locale\n end",
"def read_locale\n raise \"Override me\"\n end",
"def locale\n @grpc.locale\n end",
"def locale\n @grpc.locale\n end",
"def locale\n lang = params.fetch(:language, I18n.default_locale).to_sym\n I18n.available_locales.include?(lang) ? lang : I18n.default_locale\n end",
"def locale\n if !language.nil?\n language.abbreviation\n elsif !org.nil?\n org.locale\n end\n end",
"def locale\n if self.language\n LANGUAGE_CODE[self.language]\n end\n end",
"def locale\n return @locale\n end",
"def locale\n return @locale\n end",
"def default_language\n languages.find_by(default: true)\n end",
"def lang locale\n if translations.find_by(locale: locale).try(:automated?)\n \"#{locale}-x-mtfrom-de\"\n else\n locale.to_s\n end\n end",
"def getLocaleCode\n # first default locale to default locale\n @locale_code = Rails.application.config.i18n.default_locale\n # next set locale to the locale in user record\n @locale_code = current_user.try(:locale) || @locale_code\n # next set locale to the locale passed as the locale param\n if (params.present? &&\n params['locale'].present? &&\n BaseRec::VALID_LOCALES.include?(params['locale'].to_s)\n )\n @locale_code = params['locale']\n end\n # set the locale in I18n\n I18n.locale = @locale_code\n Rails.logger.debug \"@locale_code: #{@locale_code.inspect}\"\n end",
"def user_locale(user = current_user)\n locale = if user && user.language != 'default'\n user.language\n else\n http_accept_language.language_region_compatible_from(I18n.available_locales)\n end\n\n begin\n I18n.locale = locale.tr('-', '_') unless locale.nil?\n rescue\n # Default to English if there are any issues in language\n logger.error(\"Support: User locale is not supported (#{locale}\")\n I18n.locale = \"en\"\n end\n end",
"def default_locale?\n I18n.default_locale == I18n.locale\n end",
"def locale\r\n read_attribute(:locale).to_sym\r\n end",
"def default_lang\n GamePlay::Load::DEFAULT_GAME_LANGUAGE\n end",
"def locale\n return nil if errors\n\n locale = YAML.safe_load(@text).keys.first\n locale.to_sym\n end",
"def get_locale_from_session\n if (session && session[:language])\n lang = session[:language]\n else\n lang = default_language\n end\n lang\n end",
"def get_locale_from_session\n if (session && session[:language])\n logger.debug \"*** Language from Session '#{session[:language]}'\"\n lang = session[:language]\n else\n lang = default_language\n end\n lang\n end",
"def get(locale = Localization.default_locale)\n @locales[locale.to_s]\n end",
"def locale_from_env\n locale = nil\n # At least one environment valiables should be set on *nix system.\n [ENV[\"LC_ALL\"], ENV[\"LC_MESSAGES\"], ENV[\"LANG\"]].each do |loc|\n\tif loc != nil and loc.size > 0\n\t locale = Locale::Object.new(loc)\n\t locale.charset ||= get_charset(locale)\n\t break\n\tend\n end\n locale\n end",
"def extract_locale_from_accept_language_header\n browser_locale = request.env['HTTP_ACCEPT_LANGUAGE'].try(:scan, /^[a-z]{2}/).try(:first).try(:to_sym)\n if I18n.available_locales.include? browser_locale\n browser_locale\n else\n I18n.default_locale\n end\n end",
"def locale_to_translate_into\n multilanguage_site = settings.multilanguage_site\n default_language = settings.default_language\n if multilanguage_site and session[:locale] != default_language\n session[:locale]\n else\n nil\n end\n end",
"def po_locale\n @po_locale\n end",
"def default_locale?\n I18n.default_locale == I18n.locale\n end",
"def locale_defaults\n if by_subdomain?\n defaults.merge(subdomain: locale.to_s)\n else\n defaults.merge(locale: locale.to_s)\n end\n end",
"def locale(locale)\n if default?\n locale.to_s\n else\n \"#{self.name}_#{locale.to_s}\"\n end\n end",
"def with_default_locale(&block)\n ::Mongoid::Fields::I18n.with_locale(self.default_locale) do\n yield\n end\n end",
"def set_default_locale\n if !cookies[:locale] && (default_locale = current_conference.config(:default_locale))\n cookies[:locale] = default_locale\n end\n end",
"def set_locale\n available = TRANSLATIONS.map(&:code)\n if cookies[:locale] && available.include?(cookies[:locale])\n selected = cookies[:locale]\n end\n I18n.locale = selected ||\n http_accept_language.preferred_language_from(available) ||\n I18n.default_locale\n end",
"def locale; end",
"def locale; end",
"def locale; end",
"def locale; end",
"def locale; end",
"def locale; end",
"def locale; end",
"def extract_locale_from_session\n session[:locale] || nil\n end",
"def locale\n @values.fetch('ai.device.locale') { \n @values['ai.device.locale'] = nil\n }\n end",
"def get_locales(defaults=[])\n if self.available_locales.present?\n self.available_locales\n else\n defaults\n end\n end",
"def extract_locale_from_accept_language_header\n # One source of client supplied information would be an Accept-Language HTTP header.\n # People may set this in their browser\n if (request.env['HTTP_ACCEPT_LANGUAGE'] != nil)\n request.env['HTTP_ACCEPT_LANGUAGE'].scan(/^[a-z]{2}/).first\n #request.env['HTTP_ACCEPT_LANGUAGE']\n end\n end",
"def set_default_main_locale\n self.main_locale = self.content_type.mounting_point.default_locale\n end",
"def setup_default_locale\n locale = config.dig(\"locale\").split(\"- \").last\n\n application nil do\n <<~CONFS\n # Default i18n locale\n config.i18n.default_locale = :#{locale}\n\n CONFS\n end\n\n template \"templates/default_locale.tt\", \"config/locales/#{locale}.yml\" if locale != \"en\"\n end",
"def verify_locale(locale)\n (site_locales.include? locale.to_s) ? locale : preferred_default_locale\n end",
"def detect_locale_from(source)\n case source\n when :params\n params[:locale]\n when :session\n logger.debug \"Session: #{session.inspect}\"\n session[:locale]\n when :cookie\n cookies[:locale]\n when :domain\n parse_host_and_port_for_locale[0]\n when :header\n request.env['HTTP_ACCEPT_LANGUAGE']\n when :default\n default_locale\n else\n raise \"unknown source\"\n end\n end",
"def set_default_language\n I18n.locale = :ja\n end",
"def default_language?\n return true unless params[:locale]\n\n params[:locale].to_s == I18n.default_locale.to_s\n end",
"def current_locale(reload = false)\n return @locale if @locale && !reload\n @locale = locales.find(:id => 'current')\n end",
"def locale\n (self.country.blank? or self.country.indonesia?) ? :id : :en\n end",
"def set_locale\n I18n.locale = if cookies[:locale].present? and I18n.available_locales.include?(cookies[:locale])\n cookies[:locale]\n elsif user_signed_in?\n current_user.preferred_language\n else\n env.http_accept_language.compatible_language_from(I18n.available_locales)\n end\n end",
"def locale_from_http_header\n language = request.env['HTTP_ACCEPT_LANGUAGE']\n unless language.blank?\n http_locale = language.scan(/^[a-z]{2}-[A-Z]{2}/)\n unless http_locale.blank?\n http_locale = http_locale.first\n else\n http_locale = language.scan(/^[a-z]{2}/).first\n end\n end\n end",
"def extract_locale_from_accept_language_header\n browser_locale = request.env['HTTP_ACCEPT_LANGUAGE'].scan(/^[a-z]{2}/).first.to_sym\n return nil unless I18n.available_locales.include? browser_locale\n browser_locale\n end",
"def set_locale\n # Either through a param, that has highest priority\n locale = if params[:locale]\n params[:locale].to_s\n # Then let's check the browser if there was no param\n elsif accept_language = request.env['HTTP_ACCEPT_LANGUAGE']\n # TODO: Facebook would like to have the country when using authentication there. We should save the browser country somewhere.\n accept_language.scan(/^[a-z]{2}/).first.to_s\n end\n I18n.locale = locale if locale.present? and I18n.available_locales.include?(locale.to_sym)\n end",
"def verify_locale(locale)\n site_locales.include?(locale.to_s) ? locale : preferred_default_locale\n end",
"def display_language\n default = I18n.locale.try {|l| l.to_s.gsub(/\\-.*$/, '')} || \"en\"\n\n this_doc = self.language_obj.try(:iso_639_1)\n\n return nil if this_doc == default\n\n self.language_str\n end",
"def apply_locale; end",
"def preferred_language\n mother_tongues.first || self.last_login_language || Language[I18n.default_locale]\n end",
"def set_locale\n end",
"def extract_locale_from_accept_language_header\n locale = \"en_US\"\n locale = request.env['HTTP_ACCEPT_LANGUAGE'].scan(/^[a-z]{2}/).first \\\n if not request.env['HTTP_ACCEPT_LANGUAGE'].nil?\n return locale\n end",
"def set_locale\n I18n.locale = Rails.configuration.oyambre.languages.first\n end",
"def set_locale\r\n I18n.locale = extract_locale_from_request\r\n end",
"def locale=(locale)\n @@default_locale = locale\n end",
"def available_locales; end",
"def available_locales; end"
] |
[
"0.83433855",
"0.8173862",
"0.8166773",
"0.8095743",
"0.7869589",
"0.78432095",
"0.77822816",
"0.7604532",
"0.74338615",
"0.7410458",
"0.7392186",
"0.7349439",
"0.73442006",
"0.73125035",
"0.71855545",
"0.71363467",
"0.7124969",
"0.70983094",
"0.70591426",
"0.7023105",
"0.7009623",
"0.7006554",
"0.7006298",
"0.6968229",
"0.6957965",
"0.69527465",
"0.6935187",
"0.6935187",
"0.68948096",
"0.6882883",
"0.6882778",
"0.6879835",
"0.6871267",
"0.6860111",
"0.6847077",
"0.683199",
"0.683199",
"0.68179566",
"0.6796588",
"0.6796588",
"0.6790882",
"0.67531145",
"0.6742238",
"0.67167133",
"0.67167133",
"0.67114794",
"0.6708151",
"0.6651934",
"0.6645099",
"0.6636604",
"0.6627872",
"0.66234905",
"0.6619364",
"0.6599884",
"0.6599625",
"0.65715307",
"0.6567899",
"0.6561586",
"0.6527202",
"0.6523603",
"0.6501076",
"0.6481984",
"0.64808476",
"0.6463507",
"0.6429682",
"0.6428827",
"0.6415452",
"0.6415452",
"0.6415452",
"0.6415452",
"0.6415452",
"0.6415452",
"0.6415452",
"0.6405292",
"0.63935876",
"0.63883495",
"0.6378821",
"0.637508",
"0.6335264",
"0.6330081",
"0.6325752",
"0.63237226",
"0.630557",
"0.6296867",
"0.62958324",
"0.6284445",
"0.62832266",
"0.62731415",
"0.62628365",
"0.6258433",
"0.6246786",
"0.6240321",
"0.623738",
"0.62358344",
"0.62223554",
"0.6222313",
"0.62087303",
"0.61986893",
"0.6196845",
"0.6196845"
] |
0.8771306
|
0
|
Gets a collection of resources.
|
def all(client, space_id, environment_id = nil, parameters = {}, organization_id = nil)
ResourceRequester.new(client, self).all(
{ space_id: space_id, environment_id: environment_id, organization_id: organization_id }, parameters
)
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def collection\n resource_class.all\n end",
"def resources\n return @resources\n end",
"def resources\n return @resources\n end",
"def resources\n return @resources\n end",
"def resources\n nodeset = query_root_node(\"gdacs:resources/gdacs:resource\", @@NAMESPACES)\n @items = []\n if !nodeset.nil?\n nodeset.each do |item|\n item_obj = SemanticCrawler::Gdacs::Resource.new(item)\n @items << item_obj\n end\n end\n @items\n end",
"def resources\n self.collection.find({}, :sort => [:_id, :asc]).map do |hash|\n self.normalize hash\n end\n end",
"def resources\n @resources ||= []\n end",
"def resources\n @resources\n end",
"def resources\n @resources.values\n end",
"def resources\n typed_set(entities, Occi::Core::Resource)\n end",
"def resources\n @resources = {\n :lumber => Lumber.new,\n :clay => Clay.new,\n :iron => Iron.new,\n :crop => Crop.new\n } if @resources.nil?\n return @resources\n end",
"def resource_list\n self.resources\n end",
"def resources(*args)\n run_context.resource_collection.find(*args)\n end",
"def get_resources()\n data, _status_code, _headers = get_resources_with_http_info()\n return data\n end",
"def resources options={}\n @resources ||= find_resources options\n end",
"def resources\n @resources ||= Resources.new\n if block_given?\n yield(@resources)\n end\n @resources\n end",
"def resources\n @resources ||= @response[@resource_field].to_a\n end",
"def resources\n collection = Miasma::Models::Orchestration::Stack::Resources.new(self)\n collection.define_singleton_method(:perform_population) do\n valid = stack.sparkleish_template.fetch(:resources, {}).keys\n stack.custom[:resources].find_all { |r| valid.include?(r[:name]) }.map do |attrs|\n Miasma::Models::Orchestration::Stack::Resource.new(stack, attrs).valid_state\n end\n end\n collection\n end",
"def get_resources\n init_folder unless @init # have I been initialized?\n return @resources \n end",
"def resources\n @resources ||= {}\n end",
"def get_resources(opts = {})\n data, _status_code, _headers = get_resources_with_http_info(opts)\n data\n end",
"def collection(options={})\n response = client.get(api_path, options)\n\n if response.success?\n collection = []\n\n response.body.each do |json|\n collection << new(json)\n end\n\n collection\n else\n []\n end\n end",
"def all_resources(set = Set.new)\n set << self\n self.each_resource { |r| r.all_resources(set) }\n set\n end",
"def all\n PaginatedResource.new(self)\n end",
"def all\n PaginatedResource.new(self)\n end",
"def all\n PaginatedResource.new(self)\n end",
"def all\n PaginatedResource.new(self)\n end",
"def all\n PaginatedResource.new(self)\n end",
"def all\n PaginatedResource.new(self)\n end",
"def all\n PaginatedResource.new(self)\n end",
"def all\n PaginatedResource.new(self)\n end",
"def all\n PaginatedResource.new(self)\n end",
"def all\n PaginatedResource.new(self)\n end",
"def get_all_resources(klasses = nil)\n replies = get_all_replies(klasses)\n return nil unless replies\n resources = []\n replies.each do |reply|\n resources.push(reply.resource.entry.collect{ |singleEntry| singleEntry.resource })\n end\n resources.compact!\n resources.flatten(1)\n end",
"def resource_collection\n @resource_collection ||= @run_context.resource_collection\n end",
"def resources(opts={})\n Tripod::ResourceCollection.new(\n self.resource_class._resources_from_sparql(self.as_query(opts)),\n # pass in the criteria that was used to generate this collection, as well as whether the user specified return graph\n :return_graph => (opts.has_key?(:return_graph) ? opts[:return_graph] : true),\n :criteria => self\n )\n end",
"def resources\n @resources ||= process_data(decoded_body[resources_key])\n end",
"def all_resources\n @run_context && @run_context.resource_collection.all_resources\n end",
"def resources\n @data.keys\n end",
"def resources\n Loader.resources.keys\n end",
"def resources\n @resources ||= Marshal.load(Marshal.dump(@@resources))\n end",
"def list_resources\n resources = []\n addr = create_address(:sliceID => @@sliceID, :domain => @@domain)\n resource_prefix = \"#{addr.generate_address}/\"\n nodes = list_nodes(@@domain)\n nodes.each{|node|\n next if !node.include?(resource_prefix)\n node.slice!(resource_prefix)\n resources << node if !node.empty?\n }\n resources\n end",
"def get_resources\n routes_doc = get_routes_doc\n resources_names = routes_doc.get_resources_names - resources_black_list\n\n resources_names.map do |resource|\n puts \"Generating #{resource} documentation...\" if trace?\n ResourceDoc.new( resource, routes_doc.get_actions_route_info( resource ) )\n end\n end",
"def find_resources(type)\n resource_collection.all_resources.select do |resource|\n resource_name(resource) == type.to_sym\n end\n end",
"def all\n setup_request \"#{@@resource_url}s\"\n end",
"def list(abs_url = nil)\n @ro_resource_mixin.list(abs_url)\n end",
"def all_resources(set = Set.new)\n set << self\n set\n end",
"def resources\n instance_variable_get(\"@#{resources_name}\")\n end",
"def lists\n Resources::Lists.new(self)\n end",
"def resource_collection\n client.run_status.run_context.resource_collection\n end",
"def decorated_collection\n @collection.map do |element|\n Resource.new(element, @controller)\n end\n end",
"def index\n @resources = Resource.all\n end",
"def get_resources(url, resource_class, params={})\n get(url, params).map do |result|\n resource_class.from_hash(result, client: self)\n end\n end",
"def index\n @resources = Resource.all\n end",
"def index\n @resources = Resource.all\n end",
"def index\n @resources = Resource.all\n end",
"def list_resources(opts = {})\n data, _status_code, _headers = list_resources_with_http_info(opts)\n data\n end",
"def list(options = {})\n url = build_url\n url << \"&$top=#{options[:top]}\" if options[:top]\n url << \"&$filter=#{options[:filter]}\" if options[:filter]\n\n response = rest_get(url)\n Azure::Armrest::ArmrestCollection.create_from_response(response, Azure::Armrest::ResourceGroup)\n end",
"def all\n api_get(path)\n end",
"def list_all(options = {})\n url = build_url(nil, options)\n response = rest_get(url)\n\n if options[:all]\n get_all_results(response)\n else\n Azure::Armrest::ArmrestCollection.create_from_response(response, Azure::Armrest::Resource)\n end\n end",
"def all(params = {})\n query = params.map { |key, value| \"#{CGI.escape(key.to_s)}=#{CGI.escape(value.to_s)}\" }.join(\"&\")\n query = \"?\" + query unless query.empty?\n code, data = @session.get(collection_path + '.json' + query)\n data.collect { |data|\n key = @resource.name.to_s.split('::').last.downcase\n @resource.new(data[key].merge(:session => @session, :prefix => @prefix))\n }\n end",
"def resources\n body && [*body]\n end",
"def resources\n instance_variable_get(\"@#{mapping.plural}\")\n end",
"def subresources\n if any?\n { collection_rel => self }\n else\n {}\n end\n end",
"def resources()\n end",
"def collection\n return @client.api_helper.collection(\"items\")\n end",
"def index\n @api_v1_resources = Api::V1::Resource.all\n end",
"def resources\n @resources ||= if options[:resources]\n options[:resources]\n elsif options[:search]\n if options[:search].is_a?(String)\n options[:search] = Rack::Utils.parse_nested_query(options[:search])\n end\n\n model.ransack(options[:search]).result\n else\n model.all\n end\n end",
"def collections\n with_caching({}, 'collections') do\n sibling_nodes_for('collection').map {|n| Collection.new(n, authentication_options) }\n end\n end",
"def enclosing_collection_resources\n @enclosing_collection_resources ||= []\n end",
"def resources(resource_uri = nil)\n load unless loaded?\n if resource_uri.nil?\n @resources.values\n else\n @resources[resource_uri]\n end\n end",
"def resources(oneview_type = nil, oneview_name = nil)\n oneview_type = @options[:oneview_type] if oneview_type.nil?\n oneview_name = @options[:oneview_name] if oneview_name.nil?\n raise 'Oneview resource type must be specified.' if oneview_type.nil?\n\n # Determine the endpoint that needs to be called\n endpoint = format('/rest/%s', oneview_type)\n\n # Find the resources\n response = oneview_client.rest_get(endpoint)\n resources = oneview_client.response_handler(response)\n\n return resources if oneview_name.nil?\n\n # Filter the resources by the name if it has been specified\n resources['members'].select { |r| r['name'] == oneview_name }\n end",
"def resources\n Typus::Configuration.roles.keys.map do |key|\n Typus::Configuration.roles[key].keys\n end.flatten.sort.uniq.delete_if { |x| models.include?(x) }\n end",
"def find_all_resources options\n policy_scope(resource_class)\n end",
"def resources\n @resources ||= begin\n resources = request_path.strip.\n split('/').\n compact.\n map(&:strip).\n each_with_index.\n select { |_, index| index % 2 == 1 }.\n map { |a, _| a.to_sym }\n\n *rest, tail = *resources\n if RAILS_METHODS.index(tail)\n rest\n else\n resources\n end\n end\n end",
"def all(options = {})\n response = get(options)\n xml = Nokogiri::XML(response).css(\"#{defaults[:collection_name]}\")\n \n collection = xml.inject([]) do |result, item|\n result << new(item)\n result\n end\n collection\n end",
"def available_collections\n api = API.new\n params = {:limit => 9999, :preserve_original => true}\n response = api.send_and_receive('collections', {:params => params})\n response.map {|n| [n['title'], n['identifier']]}\n end",
"def get_all(klass = nil, search_params = {})\n replies = get_all_bundles(klass, search_params)\n return nil unless replies\n resources = []\n\t\treplies.each do |reply|\n resources.push(reply.entry.collect{ |singleEntry| singleEntry.resource })\n end\n resources.compact!\n resources.flatten(1)\n\tend",
"def make_collection\n @resource.make_collection\n end",
"def getCollections\n Community.getCollections(dso)\n end",
"def read_collections\n site.collections.each_value do |collection|\n next if collection.data?\n\n collection.read\n end\n end",
"def resources\n @resources ||=\n query_service.custom_queries.find_by_property(property: :source_metadata_identifier, value: [], lazy: true).select do |resource|\n id = resource.source_metadata_identifier.first\n next if /99.*3506421/.match?(id)\n next if transform_id(id).length > 18\n RemoteRecord.catalog?(id)\n end.to_a\n end",
"def all\n describe(resource_uri)\n end",
"def list(resource_group, options = {})\n url = build_url(resource_group, options)\n response = rest_get(url)\n\n if options[:all]\n get_all_results(response)\n else\n Azure::Armrest::ArmrestCollection.create_from_response(response, Azure::Armrest::Resource)\n end\n end",
"def resources\n @task[:resources]\n end",
"def resourcegroups\n result = @http.get('/resourcegroups')\n result[1]\n end",
"def get_resource_types\n get_types(Occi::Core::Resource.kind)\n end",
"def all(client, opts = {})\n request = Request.new(client, :get, RESOURCE_COLLECTION, params: opts)\n Cursor.new(self, request, init_with: [client])\n end",
"def index\n self.resources = resource_class.all.paginate(per_page: 15, page: (params[:page] || 1).to_i)\n end",
"def all_clients\n resp = get CLIENT_API_PATH\n result = process_response(resp)\n return [] if result.empty? # In case response is {}\n result.each.map { |c| Resources::Client.new(c) }\n end",
"def linked_resources\n return @linked_resources\n end",
"def base_collection\n @base_collection ||= resource_model.all\n end",
"def get_nested_resource_objects\n end",
"def show_resources\r\n @resources_pages = Paginator.new self, \r\n Resource.count, \r\n Resource.get(\"resources_paginator_count\").to_i, \r\n params[:page] \r\n @resources = Resource.find :all, :order => 'name',\r\n :limit => @resources_pages.items_per_page,\r\n :offset => @resources_pages.current.offset \r\n end",
"def resources\n ([self] + parent_groups).reverse.inject({}) do |memo, group|\n begin\n memo.merge(group.poise_spec_helpers[:resources] || {})\n rescue NoMethodError\n memo\n end\n end\n end",
"def resources\n @resources ||= @internal_struct[:resources] || {}\n end",
"def resource_collection\n run_context && run_context.resource_collection\n end",
"def find_resources(with_current_resource=true)\n ary = nil\n case depth\n when 0\n ary = []\n when 1\n ary = resource.children\n else\n ary = resource.descendants\n end\n with_current_resource ? [resource] + ary : ary\n end",
"def all(page = 1, per_page = 10)\n params = {\n page: page,\n per_page: per_page\n }\n list = JSON.parse(connection.get(\"/collections/\", params).body)\n list.map { |data| Unsplash::Collection.new(data) }\n end",
"def collections\n Collection.find(:all, :find_through => [N::DCT.hasPart, self])\n end",
"def resource_all(stack)\n result = request(\n :method => :get,\n :path => \"/stacks/#{stack.name}/#{stack.id}/resources\",\n :expects => 200\n )\n result.fetch(:body, :resources, []).map do |resource|\n Stack::Resource.new(\n stack,\n :id => resource[:physical_resource_id],\n :name => resource[:resource_name],\n :type => resource[:resource_type],\n :logical_id => resource[:logical_resource_id],\n :state => resource[:resource_status].downcase.to_sym,\n :status => resource[:resource_status],\n :status_reason => resource[:resource_status_reason],\n :updated => Time.parse(resource[:updated_time])\n ).valid_state\n end\n end"
] |
[
"0.78397506",
"0.76850986",
"0.76850986",
"0.76850986",
"0.76769733",
"0.76571435",
"0.7531514",
"0.7418125",
"0.7414193",
"0.7375839",
"0.71700495",
"0.7143491",
"0.71262515",
"0.7115362",
"0.70980287",
"0.70672417",
"0.7055526",
"0.69822836",
"0.6971924",
"0.6957113",
"0.69287044",
"0.6897533",
"0.6892666",
"0.6847824",
"0.6847824",
"0.6847824",
"0.6847824",
"0.6847824",
"0.6847824",
"0.6847824",
"0.6847824",
"0.6847824",
"0.6847824",
"0.681547",
"0.67708075",
"0.6750394",
"0.6748912",
"0.6740037",
"0.67168343",
"0.6688625",
"0.6672264",
"0.6663262",
"0.66423106",
"0.6635613",
"0.6618597",
"0.6615535",
"0.6606456",
"0.65981466",
"0.6589404",
"0.65804636",
"0.6559828",
"0.6547511",
"0.6544444",
"0.6524774",
"0.6524774",
"0.6524774",
"0.6506913",
"0.6501226",
"0.64644986",
"0.6451339",
"0.64463675",
"0.6431727",
"0.64158654",
"0.640833",
"0.63895077",
"0.63846856",
"0.6375597",
"0.63731253",
"0.6371888",
"0.6369252",
"0.6363289",
"0.6359359",
"0.6346188",
"0.632544",
"0.6317758",
"0.6316235",
"0.6309974",
"0.6304769",
"0.63034374",
"0.6289106",
"0.62824196",
"0.6281638",
"0.6266247",
"0.6256027",
"0.6232661",
"0.6228344",
"0.6227302",
"0.622037",
"0.6218752",
"0.6212282",
"0.61945295",
"0.61939514",
"0.6185363",
"0.6184619",
"0.6177467",
"0.61773306",
"0.6154773",
"0.6147116",
"0.6132335",
"0.6111799",
"0.61007226"
] |
0.0
|
-1
|
Gets a specific resource.
|
def find(client, space_id, environment_id = nil, resource_id = nil, organization_id = nil)
ResourceRequester.new(client, self).find(space_id: space_id, environment_id: environment_id,
resource_id: resource_id, organization_id: organization_id)
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def get_resource\n execute(resource_path, method: :get)\n end",
"def find_resource\n get params[:resource_path]\n end",
"def resource\n klass, param = resource_class\n klass&.find(params[param.to_sym])\n end",
"def get(resource, id)\n Api.new.get(resource, id)\n end",
"def get_resource(id, type)\n\t\t@client.method(type).call.get(id)\n\tend",
"def resource\n resource_model.find(params[:id])\n end",
"def get_resource\n instance_variable_get(\"@#{resource_name}\")\n end",
"def get_resource\n instance_variable_get(\"@#{resource_name}\")\n end",
"def get_resource\n instance_variable_get(\"@#{resource_name}\")\n end",
"def get_resource\n instance_variable_get(\"@#{resource_name}\")\n end",
"def get_resource\n instance_variable_get(\"@#{resource_name}\")\n end",
"def get_resource_to_use\n return @resources.first\n end",
"def get_resource(id)\n raise 'To be implemented in child classes'\n end",
"def find_resource\n @resource = resource_class.find(params[:id])\n end",
"def read_resource(resource)\n resource\n end",
"def read_resource(resource)\n resource\n end",
"def get_resource\n\t\t\t\tinstance_variable_get(\"@#{resource_name}\")\n\t\t\tend",
"def get_resource resource_uuid\n return resource_uuid if resource_uuid.is_a?(Resource)\n \n tmp = @resources.find{|res|res.uuid == resource_uuid}\n \n raise \"unknown resource with uuid #{resource_uuid}\" unless tmp\n \n tmp\n end",
"def get_resource\n instance_variable_get(\"@#{resource_name}\")\n end",
"def get(resource, **params)\n\n execute(Net::HTTP::Get, 'GET', resource, **params)\n\n end",
"def get_resource(url, resource_class, params={})\n resource_class.from_hash(get(url, params), client: self)\n end",
"def get(resource)\n puts construct_url(@mode, resource)\n @agent.get construct_url(@mode, resource)\n end",
"def get(resource, options = nil)\n params = options\n url = \"/#{resource}\"\n get_response(url, params)\n end",
"def ar_retrieve_resource(opts = {})\n @resource_relation ||= ar_model\n @resource_relation = ar_model.includes(ar_model.interfaces[:rest].eager_loading_hints(:view => ar_view)) if ar_model\n\n run_callbacks :ar_retrieve_resource do\n tid = opts[:id] || params[:id]\n opts.delete(:id)\n\n @resource = @resource_relation.find(tid)\n end\n\n #ar_authorize_action if !opts[:skip_authorization]\n\n @resource\n rescue ActiveRecord::RecordNotFound => e\n raise Exception::NotFound.new(e.message,\n :retry_possible => false)\n end",
"def resource(path, params={})\n r = Resource.process_detailed(self, *do_get(path, params))\n\n # note that process_detailed will make a best-effort to return an already\n # detailed resource or array of detailed resources but there may still be\n # legacy cases where #show is still needed. calling #show on an already\n # detailed resource is a no-op.\n r.respond_to?(:show) ? r.show : r\n end",
"def read(id)\n perform(:get, \"#{@resource_type}/#{id}\")\n end",
"def get_resource(name)\n resource = Resource.new\n resource.name = name\n resource.get_resource\n yield resource.resource if block_given?\n resource\n end",
"def get_resource\n instance_variable_get(\"@#{resource_name}\")\n end",
"def get_resource\n instance_variable_get(\"@#{resource_name}\")\n end",
"def get_resource\n instance_variable_get(\"@#{resource_name}\")\n end",
"def get_resource\n instance_variable_get(\"@#{resource_name}\")\n end",
"def show\n @resource = Resource.find(params[:id])\n end",
"def resource_get class_name, resource_name\n\t\t\tpath = \"#{class_to_basefile(class_name)}.#{resource_name}\"\n\t\t\tdata, readed = nil, false\n\t\t\tif File.exist? path\n\t\t\t\tdata = File.read path\n\t\t\t\treaded = true\n\t\t\telse\n\t\t\t\tpath = \"#{class_to_basefile(class_name)}.res/#{resource_name}\"\n\t\t\t\tif File.exist? path\n\t\t\t\t\tdata = File.read path\n\t\t\t\t\treaded = true\n\t\t\t\tend\n\t\t\tend\n\t\t\traise Resource::NotExist unless readed\t\t\t\t\t\n\t\t\treturn data\n\t\tend",
"def resource\n instance_variable_get(\"@#{resource_name}\")\n end",
"def find_resource\n set_resource_ivar class_name.find(params[:id])\n end",
"def get(resource)\n url = \"#{@base_url}/#{resource}\"\n\n @logger.debug(\"GET request Url: #{url}\")\n @logger.debug(\"-- Headers: #{base_headers}\")\n\n HTTParty.get(url, headers: base_headers)\n end",
"def get(name)\n path = \"/projects/#{project.name}/resources/#{name}\"\n resp = client.get(path)\n build_resource(resp)\n end",
"def get(resource_type, resource_value)\n # Check if resource if available from treasury\n if available?(resource_type, resource_value)\n # Resource is taken from treasury\n get_resource(resource_type).consume(resource_value)\n\n # Return asked resource\n Resource.new(resource_type, resource_value)\n else\n nil\n end\n end",
"def show\n @resource = find_resource\n end",
"def resource\n get_resource_ivar || set_resource_ivar(end_of_association_chain.send(method_for_find, params[:id]))\n end",
"def resource\n @resource\n end",
"def resource\n @resource\n end",
"def get(url, resource_name, options = {})\n build_response(resource_name) do\n connection.get do |req|\n req.url url\n req.params = options\n end\n end\n end",
"def get(name,&block)\n build_resource(name, :get, &block)\n end",
"def read(resource_type, id)\n unless RESOURCES.include?(resource_type)\n raise Common::Exceptions::InvalidFieldValue.new('resource_type', resource_type)\n end\n\n perform(:get, \"#{resource_type}/#{id}\", nil)\n end",
"def get(resource_path, headers: {}, prefix: API_PREFIX)\n request(method: :get, resource_path: resource_path, headers: headers, prefix: prefix)\n end",
"def resource\n instance_variable_get(resource_name) || params[:id] && set_resource(controller_model.find(params[:id]))\n end",
"def resource\n return @resource\n end",
"def resource\n return @resource\n end",
"def resource\n return @resource\n end",
"def resource\n return @resource\n end",
"def resource\n return @resource\n end",
"def resource\n return @resource\n end",
"def get(resource, other_query = nil)\n raise NotImplementedError, \"#{self.class}#get not implemented\"\n end",
"def resource\n instance_variable_get(:\"@#{resource_name}\")\n end",
"def resource\n instance_variable_get(:\"@#{resource_name}\")\n end",
"def get(id)\n Basuco::Resource.get(id)\n end",
"def get(resource, headers = {})\n prepare_request(:get, resource, nil, headers)\n end",
"def get!(resource_type, name)\n result = get(resource_type, name)\n if !result\n raise \"#{identifier(resource_type, name)} not found!\"\n end\n result\n end",
"def resource\n @resource ||= resource_set.createResource(uri)\n end",
"def fetch(resource,identifier,params={})\n uri = '/api/' + resource.to_s + '/' + identifier\n http_get(uri,params)\n end",
"def show\n @resource = Resource.find(params[:id]) || not_found\n\n respond_to do |format|\n format.html{}\n end\n\n end",
"def resource\n @resource ||= begin\n resource_query\n .new(relation: resource_scope)\n .find_for_show(find_by_conditions: find_by_conditions)\n end\n end",
"def get(resource, key)\n @cache[resource][key]\n end",
"def get\n conn = @client.authorized_connection(url: @client.object_api_url)\n res = conn.get do |req|\n req.url resource_uri\n resource_params.each { |key, value|\n req.params[key] = value\n }\n end\n if res.success?\n data = JSON.parse(res.body)\n self.class.new(data, @client)\n else\n nil\n end\n end",
"def get_resource(ty, nm)\n o = self.send \"#{ty}s\".to_sym\n o.detect {|r| r.name == nm }\n end",
"def resource\n @resource\n end",
"def get_resource(resource_path)\n \n return self if path == resource_path\n\n @children.each do |c|\n resource = c.get_resource(resource_path)\n return resource if resource\n end if @children\n\n return nil\n end",
"def find_resource(resource_id)\n query_service.find_by(id: Valkyrie::ID.new(resource_id))\n end",
"def resource_by_id(resource_id)\n @resources.each do |r|\n return r if r.resource_id == resource_id\n end\n nil\n end",
"def get_resource\n params.each do |name, value|\n if name.end_with?('_id')\n c = name.chomp('_id').classify.constantize rescue NameError\n if c.method_defined?(:collaborations)\n @resource = c.friendly.find(value)\n end\n end\n end\n end",
"def resource\n self.class.resource\n end",
"def get_resource(resource_path, fetch_resource_config = true)\n path = resource_path.is_a?(CanonicalPath) ? resource_path : CanonicalPath.parse(resource_path)\n feed_id = path.feed_id\n res_path = path.resource_ids.join('/')\n\n res = http_get(\"/feeds/#{feed_id}/resources/#{res_path}\")\n if fetch_resource_config\n p = get_config_data_for_resource(resource_path)\n res['properties'] ||= {}\n res['properties'].merge p['value'] unless p['value'].nil?\n end\n Resource.new(res)\n end",
"def [](resource_id, options = {})\n response = client.get(\"#{base_uri}/#{resource_id}\", options)\n if response.success?\n object_class.new(response.body, client)\n else\n raise Kippt::APIError.new(\"Resource could not be loaded: #{response.body[\"message\"]}\")\n end\n end",
"def get(request, response)\n @resource.get(request, response)\n end",
"def resource(id)\n CODES.select{|hash| hash.has_key?(id.to_s)}[0]\n end",
"def resource(title)\n @catalog.resource(title) || @aliases[title]\n end",
"def get(path, request_options = {}, resource_options = {})\n response(:get, resource(resource_options)[path], request_options)\n end",
"def get_report_resource( type, id, resource )\n \n LOGGER.info \"get resource '\"+resource+\"' for report '\"+id.to_s+\"' of type '\"+type.to_s+\"'\"\n return @persistance.get_report_resource(type, id, resource)\n end",
"def resource\n return @resource unless @resource.nil?\n\n @user_type = 'public'\n res = id.resources.submitted&.by_version_desc&.first\n return res if res.nil? # no submitted resources\n\n @resource = if admin?(resource: res)\n @user_type = 'privileged'\n id.resources.submitted.by_version_desc.first\n else # everyone else only gets to see published or embargoed metadata latest version\n id.latest_resource_with_public_metadata\n end\n end",
"def retrieve_resource(kind, id)\n resource = case kind\n when \"vdc\" then OZones::Vdc.get(id)\n when \"zone\" then OZones::Zones.get(id)\n else\n return OZones::Error.new(\n \"Error: #{kind} resource not supported\")\n end\n\n if resource\n return resource\n else\n return OZones::Error.new(\n \"Error: Resource #{kind} with id #{id} not found\")\n end\n end",
"def show\n @resource = Resource.find(params[:id])\n render json: @resource, status: 200\n end",
"def getResource(index) \n XMLDB::Base::Resource.getInstance(@obj.getResource(index))\n end",
"def find_resource(id)\n query_service.find_by(id: Valkyrie::ID.new(id.to_s))\n end",
"def get(api_version, resource, query_parameters = nil, headers = nil)\n make_rest_call(:get, uri_builder(api_version, resource,\n query_parameters), headers)\n end",
"def method_missing(id, *args, &block)\n # Figure out what kind of resource we're trying to get.\n klass = Scrumy::Models.const_get(id.to_s.capitalize.singularize)\n # Special case for handling id=:current - this really only applies to Sprint resources\n # but if other resources specified the `current` sub-resources then it should still work.\n if klass.current_url and args.first==:current\n @url = format(klass.current_url, :current)\n else\n # TODO\n # Figure out a better way of determining if the resource is singular or plural\n \n # The only argument that resources ever take is an ID, so pass the first arg as the ID.\n @url = format((id.to_s =~ /s$/ ? klass.list_url : klass.show_url), args.first)\n end\n\n # Here we request the resource using the singular of the resource name as the root\n # to extract from the returned JSON hash.\n response = get(@url, id.to_s.singularize)\n \n # Responses are of two types, either arrays of hashes or a single hash\n if response.kind_of? Array\n # If it's array collect a new array by constructing objects based on the resource\n # name capitalized and singularized.\n response.collect do |obj| \n klass.new(obj, self)\n end\n else\n # Otherwise create a single new object of the correct type.\n klass.new(response, self)\n end\n end",
"def get_resource(identity)\n @subject.get(identity, TEST_ZONE)\n end",
"def show\n @resource = @lode.resource\n end",
"def get resource=nil\n\n time = Time.now\n if @data.empty? || time > @last_update + @ttl\n ur = \"#{uri}#{resource || @resource}\"\n begin\n @data = JSON.parse Net::HTTP.get URI ur\n @last_update = time\n rescue => e \n print \"Cannot retrieve data: #{e.message} (URI: #{ur}) \"\n end\n end\n @data\n end",
"def get_resource(resource_type)\n\n Occi::Log.debug(\"Instantiating #{resource_type} ...\")\n\n if @model.get_by_id resource_type\n # we got a resource type identifier\n Occi::Core::Resource.new resource_type\n elsif @model.kinds.select { |kind| kind.term == resource_type }.any?\n # we got a resource type name\n Occi::Core::Resource.new @model.kinds.select {\n |kind| kind.term == resource_type\n }.first.type_identifier\n else\n raise \"Unknown resource type! [#{resource_type}]\"\n end\n\n end",
"def get(resource_url, params)\n headers = {'Authorization' => authorization('GET', resource_url, params)}\n url = resource_url + '?' + URI.encode_www_form(params)\n res = URI.open(url, headers)\n Response.new(res)\n end",
"def get_api_resource ( url )\n\n if @cache.exists( url )\n return @cache.get( url )\n end\n\n uri = URI( url )\n request = Net::HTTP::Get.new( uri )\n request['X-TBA-App-Id'] = \"#{@organization}:#{@app_identifier}:#{@version}\"\n\n resource = Net::HTTP.start( uri.hostname, uri.port,\n :use_ssl => uri.scheme == 'https' ) { |http|\n http.request( request )\n }\n\n case resource\n when Net::HTTPSuccess, Net::HTTPRedirection\n data = JSON.parse( resource.body )\n @cache.set( url, data )\n return data\n else\n resource.value\n end\n end",
"def resource\n @resource ||= Resource.new(uri, graph: graph)\n end",
"def load_resource\n query = eager_load(resource_class)\n if resource_class.respond_to? :friendly_id\n query.friendly.find params[:id]\n else\n query.find params[:id]\n end\n end",
"def find_resource(param)\n Chapter.find_by!(slug: param)\n end",
"def get(header = {})\n url = \"#{ApiClient.config.path}#{self.class.resource_path}/#{id}\"\n response = ApiClient::Dispatcher.get(url, header)\n attributes = ApiClient::Parser.response(response, url)\n update_attributes(attributes)\n end",
"def load_resource(path, args=nil)\n service.get(path, args)\n end",
"def get(resource, path, params = {})\n if config['security_token'].blank?\n raise 'Security token is not set'\n end\n MicroservicesEngine::Connection.get(resource, path, params, config['security_token'])\n end",
"def find_resource\n if !params[:format].nil? && params[:format] == \"json\"\n begin\n p \"i came in\"\n p params[:id]\n Product.find_by_id(params[:id])\n rescue Exception => e\n error = error_response_method($e2)\n render :json => error\n end\n else\n Product.find_by_permalink!(params[:id])\n end\n end",
"def resource\n\n end",
"def resource\n return Object unless resource_type\n return resource_type.constantize unless resource_id\n return _resource\n end"
] |
[
"0.8621642",
"0.8021446",
"0.7726461",
"0.7589102",
"0.7496325",
"0.7455254",
"0.7437639",
"0.7437639",
"0.74322623",
"0.74322623",
"0.74322623",
"0.74223286",
"0.7352895",
"0.7344348",
"0.73429024",
"0.73429024",
"0.73119676",
"0.7305421",
"0.7294014",
"0.7272717",
"0.7236494",
"0.7228329",
"0.71770304",
"0.71272725",
"0.71249956",
"0.7119642",
"0.7114894",
"0.7103418",
"0.7103418",
"0.7103418",
"0.7103418",
"0.7093235",
"0.70286345",
"0.70135546",
"0.69172895",
"0.68802774",
"0.68788904",
"0.68787724",
"0.68584",
"0.6851147",
"0.68399304",
"0.68399304",
"0.682966",
"0.682155",
"0.6814762",
"0.68048495",
"0.67919326",
"0.6765077",
"0.6765077",
"0.6765077",
"0.6765077",
"0.6765077",
"0.6765077",
"0.67605907",
"0.67579156",
"0.67579156",
"0.67530847",
"0.673702",
"0.672488",
"0.67232877",
"0.6717195",
"0.6704356",
"0.6686302",
"0.66808146",
"0.6679562",
"0.66768366",
"0.6669893",
"0.66634005",
"0.6661211",
"0.6645442",
"0.662079",
"0.6613405",
"0.6591138",
"0.6572114",
"0.65643024",
"0.65398043",
"0.653674",
"0.65218914",
"0.65070176",
"0.6428476",
"0.642723",
"0.6419096",
"0.6417143",
"0.6402383",
"0.6400033",
"0.6394455",
"0.6387535",
"0.6373157",
"0.63554657",
"0.6352095",
"0.6347901",
"0.6343522",
"0.6337545",
"0.63324636",
"0.6331901",
"0.63252664",
"0.6319958",
"0.63097656",
"0.63052773",
"0.63026136",
"0.6301171"
] |
0.0
|
-1
|
By default, fields come flattened in the current locale. This is different for sync
|
def nested_locale_fields?
false
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def fields_for_query\n self.class.fields_coercions.keys.each_with_object({}) do |field_name, results|\n results[field_name] = @fields.each_with_object({}) do |(locale, fields), field_results|\n field_results[locale] = get_value_from(fields, field_name)\n end\n end\n end",
"def fields_for_query\n self.class.fields_coercions.keys.each_with_object({}) do |field_name, results|\n results[field_name] = @fields.each_with_object({}) do |(locale, fields), field_results|\n field_results[locale] = get_value_from(fields, field_name)\n end\n end\n end",
"def get_field_deserializers()\n return super.merge({\n \"isDefault\" => lambda {|n| @is_default = n.get_boolean_value() },\n \"lastModifiedDateTime\" => lambda {|n| @last_modified_date_time = n.get_date_time_value() },\n \"locale\" => lambda {|n| @locale = n.get_string_value() },\n \"messageTemplate\" => lambda {|n| @message_template = n.get_string_value() },\n \"subject\" => lambda {|n| @subject = n.get_string_value() },\n })\n end",
"def normalize_flat_keys(locale, key, scope, separator); end",
"def normalize_flat_keys(locale, key, scope, separator); end",
"def get_field_deserializers()\n return super.merge({\n })\n end",
"def get_field_deserializers()\n return super.merge({\n })\n end",
"def get_field_deserializers()\n return super.merge({\n })\n end",
"def integrate_locale_attributes \n self.class.locale_class_name.constantize.column_names.each{|key|\n attrs = self.attributes.keys\n if !attrs.include?(key) && !self.respond_to?(key)&&\n self.class.to_s.underscore+\"_id\" != key &&\n # except these keys\n ![\"id\",\"created_at\",\"updated_at\"].include?(key)\n self.class.class_eval <<-EOF\n \n def #{key}\n if locales.loaded?\n l = correct_locale\n l && l.#{key}\n else\n (current_locale || locales.first).#{key}\n end\n end\n EOF\n \n end\n }\n end",
"def get_field_deserializers()\n return super.merge({\n \"appDisplayName\" => lambda {|n| @app_display_name = n.get_string_value() },\n \"dataType\" => lambda {|n| @data_type = n.get_string_value() },\n \"isSyncedFromOnPremises\" => lambda {|n| @is_synced_from_on_premises = n.get_boolean_value() },\n \"name\" => lambda {|n| @name = n.get_string_value() },\n \"targetObjects\" => lambda {|n| @target_objects = n.get_collection_of_primitive_values(String) },\n })\n end",
"def get_field_deserializers()\n return super.merge({\n \"applicationName\" => lambda {|n| @application_name = n.get_string_value() },\n \"displayName\" => lambda {|n| @display_name = n.get_string_value() },\n \"externalId\" => lambda {|n| @external_id = n.get_string_value() },\n \"webUrl\" => lambda {|n| @web_url = n.get_string_value() },\n })\n end",
"def enriched_fields(entity)\n original_fields = entity.fields\n additional_fields = additional_fields_for(entity)\n original_fields.merge(additional_fields)\n end",
"def get_field_deserializers() \n return super.merge({\n \"categories\" => lambda {|o, n| o.categories = n.get_collection_of_primitive_values(String) },\n \"changeKey\" => lambda {|o, n| o.change_key = n.get_string_value() },\n \"createdDateTime\" => lambda {|o, n| o.created_date_time = n.get_date_value() },\n \"lastModifiedDateTime\" => lambda {|o, n| o.last_modified_date_time = n.get_date_value() },\n })\n end",
"def get_field_deserializers()\n return super.merge({\n \"audiences\" => lambda {|n| @audiences = n.get_collection_of_primitive_values(String) },\n \"description\" => lambda {|n| @description = n.get_string_value() },\n \"issuer\" => lambda {|n| @issuer = n.get_string_value() },\n \"name\" => lambda {|n| @name = n.get_string_value() },\n \"subject\" => lambda {|n| @subject = n.get_string_value() },\n })\n end",
"def get_field_deserializers()\n return super.merge({\n \"appId\" => lambda {|n| @app_id = n.get_string_value() },\n \"displayName\" => lambda {|n| @display_name = n.get_string_value() },\n \"objectId\" => lambda {|n| @object_id_escaped = n.get_string_value() },\n \"publisher\" => lambda {|n| @publisher = n.get_string_value() },\n })\n end",
"def localize_default_attributes\n _title, _slug = self.title, self.slug\n\n self.site.each_locale(false) do |locale, _|\n self.title, self.slug = _title, _slug\n end\n end",
"def get_field_deserializers()\n return super.merge({\n \"description\" => lambda {|n| @description = n.get_string_value() },\n \"displayName\" => lambda {|n| @display_name = n.get_string_value() },\n \"members\" => lambda {|n| @members = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::DirectoryObject.create_from_discriminator_value(pn) }) },\n \"roleTemplateId\" => lambda {|n| @role_template_id = n.get_string_value() },\n \"scopedMembers\" => lambda {|n| @scoped_members = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::ScopedRoleMembership.create_from_discriminator_value(pn) }) },\n })\n end",
"def get_field_deserializers()\n return super.merge({\n \"allowedDomainGuidsForSyncApp\" => lambda {|n| @allowed_domain_guids_for_sync_app = n.get_collection_of_primitive_values(UUIDTools::UUID) },\n \"availableManagedPathsForSiteCreation\" => lambda {|n| @available_managed_paths_for_site_creation = n.get_collection_of_primitive_values(String) },\n \"deletedUserPersonalSiteRetentionPeriodInDays\" => lambda {|n| @deleted_user_personal_site_retention_period_in_days = n.get_number_value() },\n \"excludedFileExtensionsForSyncApp\" => lambda {|n| @excluded_file_extensions_for_sync_app = n.get_collection_of_primitive_values(String) },\n \"idleSessionSignOut\" => lambda {|n| @idle_session_sign_out = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::IdleSessionSignOut.create_from_discriminator_value(pn) }) },\n \"imageTaggingOption\" => lambda {|n| @image_tagging_option = n.get_enum_value(MicrosoftGraph::Models::ImageTaggingChoice) },\n \"isCommentingOnSitePagesEnabled\" => lambda {|n| @is_commenting_on_site_pages_enabled = n.get_boolean_value() },\n \"isFileActivityNotificationEnabled\" => lambda {|n| @is_file_activity_notification_enabled = n.get_boolean_value() },\n \"isLegacyAuthProtocolsEnabled\" => lambda {|n| @is_legacy_auth_protocols_enabled = n.get_boolean_value() },\n \"isLoopEnabled\" => lambda {|n| @is_loop_enabled = n.get_boolean_value() },\n \"isMacSyncAppEnabled\" => lambda {|n| @is_mac_sync_app_enabled = n.get_boolean_value() },\n \"isRequireAcceptingUserToMatchInvitedUserEnabled\" => lambda {|n| @is_require_accepting_user_to_match_invited_user_enabled = n.get_boolean_value() },\n \"isResharingByExternalUsersEnabled\" => lambda {|n| @is_resharing_by_external_users_enabled = n.get_boolean_value() },\n \"isSharePointMobileNotificationEnabled\" => lambda {|n| @is_share_point_mobile_notification_enabled = n.get_boolean_value() },\n \"isSharePointNewsfeedEnabled\" => lambda {|n| @is_share_point_newsfeed_enabled = n.get_boolean_value() },\n \"isSiteCreationEnabled\" => lambda {|n| @is_site_creation_enabled = n.get_boolean_value() },\n \"isSiteCreationUIEnabled\" => lambda {|n| @is_site_creation_u_i_enabled = n.get_boolean_value() },\n \"isSitePagesCreationEnabled\" => lambda {|n| @is_site_pages_creation_enabled = n.get_boolean_value() },\n \"isSitesStorageLimitAutomatic\" => lambda {|n| @is_sites_storage_limit_automatic = n.get_boolean_value() },\n \"isSyncButtonHiddenOnPersonalSite\" => lambda {|n| @is_sync_button_hidden_on_personal_site = n.get_boolean_value() },\n \"isUnmanagedSyncAppForTenantRestricted\" => lambda {|n| @is_unmanaged_sync_app_for_tenant_restricted = n.get_boolean_value() },\n \"personalSiteDefaultStorageLimitInMB\" => lambda {|n| @personal_site_default_storage_limit_in_m_b = n.get_object_value(lambda {|pn| Int64.create_from_discriminator_value(pn) }) },\n \"sharingAllowedDomainList\" => lambda {|n| @sharing_allowed_domain_list = n.get_collection_of_primitive_values(String) },\n \"sharingBlockedDomainList\" => lambda {|n| @sharing_blocked_domain_list = n.get_collection_of_primitive_values(String) },\n \"sharingCapability\" => lambda {|n| @sharing_capability = n.get_enum_value(MicrosoftGraph::Models::SharingCapabilities) },\n \"sharingDomainRestrictionMode\" => lambda {|n| @sharing_domain_restriction_mode = n.get_enum_value(MicrosoftGraph::Models::SharingDomainRestrictionMode) },\n \"siteCreationDefaultManagedPath\" => lambda {|n| @site_creation_default_managed_path = n.get_string_value() },\n \"siteCreationDefaultStorageLimitInMB\" => lambda {|n| @site_creation_default_storage_limit_in_m_b = n.get_number_value() },\n \"tenantDefaultTimezone\" => lambda {|n| @tenant_default_timezone = n.get_string_value() },\n })\n end",
"def get_field_deserializers()\n return super.merge({\n \"completedDateTime\" => lambda {|n| @completed_date_time = n.get_date_time_value() },\n \"customLogFolders\" => lambda {|n| @custom_log_folders = n.get_collection_of_primitive_values(String) },\n \"errorMessage\" => lambda {|n| @error_message = n.get_string_value() },\n \"status\" => lambda {|n| @status = n.get_enum_value(MicrosoftGraph::Models::AppLogUploadState) },\n })\n end",
"def export\n keys = {}\n reset\n db_localizations = {}\n Lit::Localization.find_each do |l|\n db_localizations[l.full_key] = l.get_value\n end\n db_localizations.sort.each do |(l_key, value)|\n current = keys\n yaml_keys = l_key.split('.')\n\n 0.upto(yaml_keys.size - 2) do |i|\n key = yaml_keys[i]\n # Overwrite en.key with en.sub.key\n unless current[key].class == Hash\n current[key] = {}\n end\n current = current[key]\n end\n current[yaml_keys.last] = value\n end\n keys.to_yaml\n end",
"def fill_i18n_fields(table, locale)\n table_name = quote_table_name(table)\n\n # set content_id = id\n update(\"UPDATE #{table_name} SET #{quote_column_name('content_id')} = #{quote_column_name('id')}\")\n fix_sequence_consistency([table_name])\n\n # fill the locale field for existing records\n locale ||= Locale.default\n update(\"UPDATE #{table_name} SET #{quote_column_name('locale')} = #{quote(locale)}\")\n end",
"def get_field_deserializers()\n return super.merge({\n \"description\" => lambda {|n| @description = n.get_string_value() },\n \"displayName\" => lambda {|n| @display_name = n.get_string_value() },\n \"isAvailable\" => lambda {|n| @is_available = n.get_boolean_value() },\n })\n end",
"def get_field_deserializers()\n return super.merge({\n \"connectorServerName\" => lambda {|n| @connector_server_name = n.get_string_value() },\n \"exchangeAlias\" => lambda {|n| @exchange_alias = n.get_string_value() },\n \"exchangeConnectorType\" => lambda {|n| @exchange_connector_type = n.get_enum_value(MicrosoftGraph::Models::DeviceManagementExchangeConnectorType) },\n \"exchangeOrganization\" => lambda {|n| @exchange_organization = n.get_string_value() },\n \"lastSyncDateTime\" => lambda {|n| @last_sync_date_time = n.get_date_time_value() },\n \"primarySmtpAddress\" => lambda {|n| @primary_smtp_address = n.get_string_value() },\n \"serverName\" => lambda {|n| @server_name = n.get_string_value() },\n \"status\" => lambda {|n| @status = n.get_enum_value(MicrosoftGraph::Models::DeviceManagementExchangeConnectorStatus) },\n \"version\" => lambda {|n| @version = n.get_string_value() },\n })\n end",
"def default_fields_for_forms\n [\n { name: :get_verbose_conflicting_row, width: 50,\n label: I18n.t('admin_import.conflicting_row')\n },\n { name: :import_text, flex: 1, label: I18n.t('admin_import.import_text') },\n\n { name: :name, width: 180, label: I18n.t('activerecord.attributes.team.name') },\n { name: :badge_number, width: 100, label: I18n.t('activerecord.attributes.team.zip') },\n\n { name: :data_import_city__name, width: 200,\n label: I18n.t('activerecord.models.data_import_city')\n },\n { name: :city__get_full_name, width: 200, label: I18n.t('activerecord.models.city')\n }\n ]\n end",
"def default_fields_for_forms\n [\n { name: :get_verbose_conflicting_row, width: 50,\n label: I18n.t('admin_import.conflicting_row')\n },\n { name: :import_text, flex: 1, label: I18n.t('admin_import.import_text') },\n\n { name: :name, width: 160, label: I18n.t('activerecord.attributes.city.name') },\n { name: :zip, width: 80, label: I18n.t('activerecord.attributes.city.zip') },\n { name: :area, width: 100, label: I18n.t('activerecord.attributes.city.area') },\n { name: :country, width: 100, label: I18n.t('activerecord.attributes.city.country') },\n { name: :country_code, width: 40, label: I18n.t('activerecord.attributes.city.country_code') }\n ]\n end",
"def get_field_deserializers()\n return super.merge({\n \"committedContentVersion\" => lambda {|n| @committed_content_version = n.get_string_value() },\n \"contentVersions\" => lambda {|n| @content_versions = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::MobileAppContent.create_from_discriminator_value(pn) }) },\n \"fileName\" => lambda {|n| @file_name = n.get_string_value() },\n \"size\" => lambda {|n| @size = n.get_object_value(lambda {|pn| Int64.create_from_discriminator_value(pn) }) },\n })\n end",
"def get_field_deserializers()\n return super.merge({\n \"createdBy\" => lambda {|n| @created_by = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::AppIdentity.create_from_discriminator_value(pn) }) },\n \"displayName\" => lambda {|n| @display_name = n.get_string_value() },\n \"tasks\" => lambda {|n| @tasks = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::PrintTask.create_from_discriminator_value(pn) }) },\n })\n end",
"def get_field_deserializers()\n return super.merge({\n \"ccRecipients\" => lambda {|n| @cc_recipients = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::Recipient.create_from_discriminator_value(pn) }) },\n \"hasAttachments\" => lambda {|n| @has_attachments = n.get_boolean_value() },\n \"isLocked\" => lambda {|n| @is_locked = n.get_boolean_value() },\n \"lastDeliveredDateTime\" => lambda {|n| @last_delivered_date_time = n.get_date_time_value() },\n \"posts\" => lambda {|n| @posts = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::Post.create_from_discriminator_value(pn) }) },\n \"preview\" => lambda {|n| @preview = n.get_string_value() },\n \"toRecipients\" => lambda {|n| @to_recipients = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::Recipient.create_from_discriminator_value(pn) }) },\n \"topic\" => lambda {|n| @topic = n.get_string_value() },\n \"uniqueSenders\" => lambda {|n| @unique_senders = n.get_collection_of_primitive_values(String) },\n })\n end",
"def get_field_deserializers()\n return {\n \"displayName\" => lambda {|n| @display_name = n.get_string_value() },\n \"locale\" => lambda {|n| @locale = n.get_string_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n }\n end",
"def get_field_deserializers()\n return super.merge({\n \"contractType\" => lambda {|n| @contract_type = n.get_string_value() },\n \"customerId\" => lambda {|n| @customer_id = n.get_guid_value() },\n \"defaultDomainName\" => lambda {|n| @default_domain_name = n.get_string_value() },\n \"displayName\" => lambda {|n| @display_name = n.get_string_value() },\n })\n end",
"def default_fields_for_forms\n [\n { name: :get_verbose_conflicting_row, width: 50,\n label: I18n.t('admin_import.conflicting_row')\n },\n { name: :import_text, flex: 1, label: I18n.t('admin_import.import_text') },\n\n { name: :data_import_meeting_program__get_short_name, width: 210,\n label: I18n.t('activerecord.models.data_import_meeting_program')\n },\n { name: :meeting_program__get_short_name, width: 110,\n label: I18n.t('activerecord.models.meeting_program')\n },\n { name: :data_import_team__name, width: 110, label: I18n.t('activerecord.models.data_import_team') },\n { name: :team__name, width: 110, label: I18n.t('activerecord.models.team') },\n\n { name: :rank, width: 30,\n label: I18n.t('activerecord.attributes.meeting_relay_result.rank')\n },\n { name: :is_play_off, width: 50, default_value: true, unchecked_value: 'false',\n label: I18n.t('activerecord.attributes.meeting_relay_result.is_play_off')\n },\n { name: :is_out_of_race, width: 50, default_value: false, unchecked_value: 'false',\n label: I18n.t('activerecord.attributes.meeting_relay_result.is_out_of_race')\n },\n { name: :is_disqualified, width: 50, default_value: false, unchecked_value: 'false',\n label: I18n.t('activerecord.attributes.meeting_relay_result.is_disqualified')\n },\n { name: :disqualification_code_type__i18n_short, width: 50,\n label: I18n.t('activerecord.models.result_type')\n },\n { name: :standard_points, width: 50,\n label: I18n.t('activerecord.attributes.meeting_relay_result.standard_points')\n },\n { name: :meeting_points, width: 50,\n label: I18n.t('activerecord.attributes.meeting_relay_result.meeting_points')\n },\n { name: :minutes, width: 30, label: I18n.t('activerecord.attributes.meeting_relay_result.minutes') },\n { name: :seconds, width: 30, label: I18n.t('activerecord.attributes.meeting_relay_result.seconds') },\n { name: :hundreds, width: 30, label: I18n.t('activerecord.attributes.meeting_relay_result.hundreds') }\n ]\n end",
"def get_field_deserializers()\n return super.merge({\n \"schedule\" => lambda {|n| @schedule = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::SynchronizationSchedule.create_from_discriminator_value(pn) }) },\n \"schema\" => lambda {|n| @schema = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::SynchronizationSchema.create_from_discriminator_value(pn) }) },\n \"status\" => lambda {|n| @status = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::SynchronizationStatus.create_from_discriminator_value(pn) }) },\n \"synchronizationJobSettings\" => lambda {|n| @synchronization_job_settings = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::KeyValuePair.create_from_discriminator_value(pn) }) },\n \"templateId\" => lambda {|n| @template_id = n.get_string_value() },\n })\n end",
"def get_field_deserializers()\n return super.merge({\n \"displayName\" => lambda {|n| @display_name = n.get_string_value() },\n \"templateId\" => lambda {|n| @template_id = n.get_string_value() },\n \"values\" => lambda {|n| @values = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::SettingValue.create_from_discriminator_value(pn) }) },\n })\n end",
"def get_field_deserializers()\n return super.merge({\n \"recipients\" => lambda {|n| @recipients = n.get_collection_of_primitive_values(String) },\n })\n end",
"def get_field_deserializers()\n return super.merge({\n \"displayName\" => lambda {|n| @display_name = n.get_string_value() },\n \"isCourseActivitySyncEnabled\" => lambda {|n| @is_course_activity_sync_enabled = n.get_boolean_value() },\n \"learningContents\" => lambda {|n| @learning_contents = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::LearningContent.create_from_discriminator_value(pn) }) },\n \"learningCourseActivities\" => lambda {|n| @learning_course_activities = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::LearningCourseActivity.create_from_discriminator_value(pn) }) },\n \"loginWebUrl\" => lambda {|n| @login_web_url = n.get_string_value() },\n \"longLogoWebUrlForDarkTheme\" => lambda {|n| @long_logo_web_url_for_dark_theme = n.get_string_value() },\n \"longLogoWebUrlForLightTheme\" => lambda {|n| @long_logo_web_url_for_light_theme = n.get_string_value() },\n \"squareLogoWebUrlForDarkTheme\" => lambda {|n| @square_logo_web_url_for_dark_theme = n.get_string_value() },\n \"squareLogoWebUrlForLightTheme\" => lambda {|n| @square_logo_web_url_for_light_theme = n.get_string_value() },\n })\n end",
"def flatten_translations(locale, data, escape, subtree); end",
"def get_field_deserializers()\n return super.merge({\n \"check32BitOn64System\" => lambda {|n| @check32_bit_on64_system = n.get_boolean_value() },\n \"comparisonValue\" => lambda {|n| @comparison_value = n.get_string_value() },\n \"fileOrFolderName\" => lambda {|n| @file_or_folder_name = n.get_string_value() },\n \"operationType\" => lambda {|n| @operation_type = n.get_enum_value(MicrosoftGraph::Models::Win32LobAppFileSystemOperationType) },\n \"operator\" => lambda {|n| @operator = n.get_enum_value(MicrosoftGraph::Models::Win32LobAppRuleOperator) },\n \"path\" => lambda {|n| @path = n.get_string_value() },\n })\n end",
"def get_field_deserializers()\n return super.merge({\n \"contentData\" => lambda {|n| @content_data = n.get_string_value() },\n \"destinationRoutingReason\" => lambda {|n| @destination_routing_reason = n.get_enum_value(MicrosoftGraph::Models::MailDestinationRoutingReason) },\n \"recipientEmail\" => lambda {|n| @recipient_email = n.get_string_value() },\n })\n end",
"def nested_locale_fields?\n # rubocop:disable Style/DoubleNegation\n !!@nested_locale_fields\n # rubocop:enable Style/DoubleNegation\n end",
"def all_fields\n return @all_fields if defined? @all_fields\n\n @all_fields ||= fields.includes(field_set: [:catalog]).each_with_object([]) do |field, all|\n all << field\n next unless field.is_a?(Field::ChoiceSet)\n\n field.choices.includes(:category).each do |choice|\n category = choice.category\n next unless category&.not_deleted?\n\n additional_fields = category.fields.includes(field_set: [:catalog]).map do |f|\n f.category_choice = choice\n f.category_choice_set = field.choice_set\n f\n end\n all.concat(additional_fields)\n end\n end\n end",
"def get_field_deserializers()\n return super.merge({\n \"appliesTo\" => lambda {|n| @applies_to = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::DirectoryObject.create_from_discriminator_value(pn) }) },\n \"isEnabled\" => lambda {|n| @is_enabled = n.get_boolean_value() },\n \"restrictions\" => lambda {|n| @restrictions = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::AppManagementConfiguration.create_from_discriminator_value(pn) }) },\n })\n end",
"def get_field_deserializers()\n return super.merge({\n \"orderHint\" => lambda {|n| @order_hint = n.get_string_value() },\n })\n end",
"def get_field_deserializers()\n return super.merge({\n \"administrativeUnits\" => lambda {|n| @administrative_units = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::AdministrativeUnit.create_from_discriminator_value(pn) }) },\n \"attributeSets\" => lambda {|n| @attribute_sets = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::AttributeSet.create_from_discriminator_value(pn) }) },\n \"customSecurityAttributeDefinitions\" => lambda {|n| @custom_security_attribute_definitions = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::CustomSecurityAttributeDefinition.create_from_discriminator_value(pn) }) },\n \"deletedItems\" => lambda {|n| @deleted_items = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::DirectoryObject.create_from_discriminator_value(pn) }) },\n \"federationConfigurations\" => lambda {|n| @federation_configurations = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::IdentityProviderBase.create_from_discriminator_value(pn) }) },\n \"onPremisesSynchronization\" => lambda {|n| @on_premises_synchronization = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::OnPremisesDirectorySynchronization.create_from_discriminator_value(pn) }) },\n })\n end",
"def get_field_deserializers()\n return super.merge({\n \"clusterBy\" => lambda {|n| @cluster_by = n.get_string_value() },\n \"clusterByValue\" => lambda {|n| @cluster_by_value = n.get_string_value() },\n \"emailCount\" => lambda {|n| @email_count = n.get_object_value(lambda {|pn| Int64.create_from_discriminator_value(pn) }) },\n \"networkMessageIds\" => lambda {|n| @network_message_ids = n.get_collection_of_primitive_values(String) },\n \"query\" => lambda {|n| @query = n.get_string_value() },\n \"urn\" => lambda {|n| @urn = n.get_string_value() },\n })\n end",
"def get_field_deserializers()\n return super.merge({\n \"chatType\" => lambda {|n| @chat_type = n.get_enum_value(MicrosoftGraph::Models::ChatType) },\n \"createdDateTime\" => lambda {|n| @created_date_time = n.get_date_time_value() },\n \"installedApps\" => lambda {|n| @installed_apps = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::TeamsAppInstallation.create_from_discriminator_value(pn) }) },\n \"lastMessagePreview\" => lambda {|n| @last_message_preview = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::ChatMessageInfo.create_from_discriminator_value(pn) }) },\n \"lastUpdatedDateTime\" => lambda {|n| @last_updated_date_time = n.get_date_time_value() },\n \"members\" => lambda {|n| @members = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::ConversationMember.create_from_discriminator_value(pn) }) },\n \"messages\" => lambda {|n| @messages = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::ChatMessage.create_from_discriminator_value(pn) }) },\n \"onlineMeetingInfo\" => lambda {|n| @online_meeting_info = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::TeamworkOnlineMeetingInfo.create_from_discriminator_value(pn) }) },\n \"permissionGrants\" => lambda {|n| @permission_grants = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::ResourceSpecificPermissionGrant.create_from_discriminator_value(pn) }) },\n \"pinnedMessages\" => lambda {|n| @pinned_messages = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::PinnedChatMessageInfo.create_from_discriminator_value(pn) }) },\n \"tabs\" => lambda {|n| @tabs = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::TeamsTab.create_from_discriminator_value(pn) }) },\n \"tenantId\" => lambda {|n| @tenant_id = n.get_string_value() },\n \"topic\" => lambda {|n| @topic = n.get_string_value() },\n \"viewpoint\" => lambda {|n| @viewpoint = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::ChatViewpoint.create_from_discriminator_value(pn) }) },\n \"webUrl\" => lambda {|n| @web_url = n.get_string_value() },\n })\n end",
"def get_field_deserializers()\n return super.merge({\n \"associatedTeams\" => lambda {|n| @associated_teams = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::AssociatedTeamInfo.create_from_discriminator_value(pn) }) },\n \"installedApps\" => lambda {|n| @installed_apps = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::UserScopeTeamsAppInstallation.create_from_discriminator_value(pn) }) },\n })\n end",
"def get_field_deserializers()\n return super.merge({\n \"assignedUserPrincipalName\" => lambda {|n| @assigned_user_principal_name = n.get_string_value() },\n \"groupTag\" => lambda {|n| @group_tag = n.get_string_value() },\n \"hardwareIdentifier\" => lambda {|n| @hardware_identifier = n.get_object_value(lambda {|pn| Base64url.create_from_discriminator_value(pn) }) },\n \"importId\" => lambda {|n| @import_id = n.get_string_value() },\n \"productKey\" => lambda {|n| @product_key = n.get_string_value() },\n \"serialNumber\" => lambda {|n| @serial_number = n.get_string_value() },\n \"state\" => lambda {|n| @state = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::ImportedWindowsAutopilotDeviceIdentityState.create_from_discriminator_value(pn) }) },\n })\n end",
"def get_field_deserializers()\n return super.merge({\n \"endDateTime\" => lambda {|n| @end_date_time = n.get_date_time_value() },\n \"joinWebUrl\" => lambda {|n| @join_web_url = n.get_string_value() },\n \"lastModifiedDateTime\" => lambda {|n| @last_modified_date_time = n.get_date_time_value() },\n \"modalities\" => lambda {|n| @modalities = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::CallRecordsModality.create_from_discriminator_value(pn) }) },\n \"organizer\" => lambda {|n| @organizer = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::IdentitySet.create_from_discriminator_value(pn) }) },\n \"participants\" => lambda {|n| @participants = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::IdentitySet.create_from_discriminator_value(pn) }) },\n \"sessions\" => lambda {|n| @sessions = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::CallRecordsSession.create_from_discriminator_value(pn) }) },\n \"startDateTime\" => lambda {|n| @start_date_time = n.get_date_time_value() },\n \"type\" => lambda {|n| @type = n.get_enum_value(MicrosoftGraph::Models::CallRecordsCallType) },\n \"version\" => lambda {|n| @version = n.get_object_value(lambda {|pn| Int64.create_from_discriminator_value(pn) }) },\n })\n end",
"def get_field_deserializers()\n return {\n \"hubSiteUrls\" => lambda {|n| @hub_site_urls = n.get_collection_of_primitive_values(String) },\n \"propagateToExistingLists\" => lambda {|n| @propagate_to_existing_lists = n.get_boolean_value() },\n }\n end",
"def get_field_deserializers()\n return super.merge({\n \"applicableArchitectures\" => lambda {|n| @applicable_architectures = n.get_enum_value(MicrosoftGraph::Models::WindowsArchitecture) },\n \"applicableDeviceTypes\" => lambda {|n| @applicable_device_types = n.get_enum_value(MicrosoftGraph::Models::WindowsDeviceType) },\n \"committedContainedApps\" => lambda {|n| @committed_contained_apps = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::MobileContainedApp.create_from_discriminator_value(pn) }) },\n \"identityName\" => lambda {|n| @identity_name = n.get_string_value() },\n \"identityPublisherHash\" => lambda {|n| @identity_publisher_hash = n.get_string_value() },\n \"identityResourceIdentifier\" => lambda {|n| @identity_resource_identifier = n.get_string_value() },\n \"identityVersion\" => lambda {|n| @identity_version = n.get_string_value() },\n \"isBundle\" => lambda {|n| @is_bundle = n.get_boolean_value() },\n \"minimumSupportedOperatingSystem\" => lambda {|n| @minimum_supported_operating_system = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::WindowsMinimumOperatingSystem.create_from_discriminator_value(pn) }) },\n })\n end",
"def get_field_deserializers()\n return super.merge({\n \"appCrashCount\" => lambda {|n| @app_crash_count = n.get_number_value() },\n \"appDisplayName\" => lambda {|n| @app_display_name = n.get_string_value() },\n \"appName\" => lambda {|n| @app_name = n.get_string_value() },\n \"appPublisher\" => lambda {|n| @app_publisher = n.get_string_value() },\n \"appVersion\" => lambda {|n| @app_version = n.get_string_value() },\n \"deviceDisplayName\" => lambda {|n| @device_display_name = n.get_string_value() },\n \"deviceId\" => lambda {|n| @device_id = n.get_string_value() },\n \"processedDateTime\" => lambda {|n| @processed_date_time = n.get_date_time_value() },\n })\n end",
"def get_field_deserializers()\n return super.merge({\n \"acceptedDateTime\" => lambda {|n| @accepted_date_time = n.get_date_time_value() },\n \"acceptedVersion\" => lambda {|n| @accepted_version = n.get_number_value() },\n \"termsAndConditions\" => lambda {|n| @terms_and_conditions = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::TermsAndConditions.create_from_discriminator_value(pn) }) },\n \"userDisplayName\" => lambda {|n| @user_display_name = n.get_string_value() },\n \"userPrincipalName\" => lambda {|n| @user_principal_name = n.get_string_value() },\n })\n end",
"def flattened_fields\n metadata_string = String.from_java_bytes @reader.getMetadata\n description_text = self.class.description_from_metadata_xml(metadata_string)\n begin\n metadata = JSON(description_text)\n flattened_fields = metadata.key?('jpdfer_flattened_fields') ? metadata['jpdfer_flattened_fields'] : {}\n rescue JSON::ParserError\n flattened_fields = {}\n end\n flattened_fields.each_with_object({}) do |(name, value), fields|\n fields[name.to_sym] = value\n end\n end",
"def all_fields\n fields.values\n end",
"def get_field_deserializers()\n return super.merge({\n \"displayName\" => lambda {|n| @display_name = n.get_string_value() },\n \"file\" => lambda {|n| @file = n.get_object_value(lambda {|pn| Base64url.create_from_discriminator_value(pn) }) },\n \"fileHash\" => lambda {|n| @file_hash = n.get_string_value() },\n \"version\" => lambda {|n| @version = n.get_string_value() },\n })\n end",
"def get_field_deserializers()\n return super.merge({\n \"contentData\" => lambda {|n| @content_data = n.get_string_value() },\n \"fileName\" => lambda {|n| @file_name = n.get_string_value() },\n })\n end",
"def get_field_deserializers()\n return super.merge({\n \"deviceCount\" => lambda {|n| @device_count = n.get_number_value() },\n \"displayName\" => lambda {|n| @display_name = n.get_string_value() },\n \"managedDevices\" => lambda {|n| @managed_devices = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::ManagedDevice.create_from_discriminator_value(pn) }) },\n \"platform\" => lambda {|n| @platform = n.get_enum_value(MicrosoftGraph::Models::DetectedAppPlatformType) },\n \"publisher\" => lambda {|n| @publisher = n.get_string_value() },\n \"sizeInByte\" => lambda {|n| @size_in_byte = n.get_object_value(lambda {|pn| Int64.create_from_discriminator_value(pn) }) },\n \"version\" => lambda {|n| @version = n.get_string_value() },\n })\n end",
"def format_locale\n self.locale = self.locale.gsub('_', '-').split(',').first.split('-').first if self.locale.present?\n end",
"def get_field_deserializers()\n return super.merge({\n \"applicationId\" => lambda {|n| @application_id = n.get_string_value() },\n \"changeType\" => lambda {|n| @change_type = n.get_string_value() },\n \"clientState\" => lambda {|n| @client_state = n.get_string_value() },\n \"creatorId\" => lambda {|n| @creator_id = n.get_string_value() },\n \"encryptionCertificate\" => lambda {|n| @encryption_certificate = n.get_string_value() },\n \"encryptionCertificateId\" => lambda {|n| @encryption_certificate_id = n.get_string_value() },\n \"expirationDateTime\" => lambda {|n| @expiration_date_time = n.get_date_time_value() },\n \"includeResourceData\" => lambda {|n| @include_resource_data = n.get_boolean_value() },\n \"latestSupportedTlsVersion\" => lambda {|n| @latest_supported_tls_version = n.get_string_value() },\n \"lifecycleNotificationUrl\" => lambda {|n| @lifecycle_notification_url = n.get_string_value() },\n \"notificationQueryOptions\" => lambda {|n| @notification_query_options = n.get_string_value() },\n \"notificationUrl\" => lambda {|n| @notification_url = n.get_string_value() },\n \"notificationUrlAppId\" => lambda {|n| @notification_url_app_id = n.get_string_value() },\n \"resource\" => lambda {|n| @resource = n.get_string_value() },\n })\n end",
"def apply_locale; end",
"def get_field_deserializers()\n return {\n \"displayName\" => lambda {|n| @display_name = n.get_string_value() },\n \"entityType\" => lambda {|n| @entity_type = n.get_string_value() },\n \"mailNickname\" => lambda {|n| @mail_nickname = n.get_string_value() },\n \"onBehalfOfUserId\" => lambda {|n| @on_behalf_of_user_id = n.get_guid_value() },\n }\n end",
"def get_field_deserializers()\n return super.merge({\n \"deletedTeams\" => lambda {|n| @deleted_teams = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::DeletedTeam.create_from_discriminator_value(pn) }) },\n \"teamsAppSettings\" => lambda {|n| @teams_app_settings = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::TeamsAppSettings.create_from_discriminator_value(pn) }) },\n \"workforceIntegrations\" => lambda {|n| @workforce_integrations = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::WorkforceIntegration.create_from_discriminator_value(pn) }) },\n })\n end",
"def all_fields\n @fields.values\n end",
"def get_field_deserializers()\n return super.merge({\n \"appCrashCount\" => lambda {|n| @app_crash_count = n.get_number_value() },\n \"appDisplayName\" => lambda {|n| @app_display_name = n.get_string_value() },\n \"appName\" => lambda {|n| @app_name = n.get_string_value() },\n \"appPublisher\" => lambda {|n| @app_publisher = n.get_string_value() },\n \"appVersion\" => lambda {|n| @app_version = n.get_string_value() },\n \"deviceCountWithCrashes\" => lambda {|n| @device_count_with_crashes = n.get_number_value() },\n \"isLatestUsedVersion\" => lambda {|n| @is_latest_used_version = n.get_boolean_value() },\n \"isMostUsedVersion\" => lambda {|n| @is_most_used_version = n.get_boolean_value() },\n })\n end",
"def from_values\n d_attrs = development.reload.fields\n self.fields.map{ |field|\n name = field.fetch('name').to_s\n edit_from = field.fetch('from').to_s\n devel_from = d_attrs.fetch( name )\n [ devel_from, edit_from ]\n }\n end",
"def get_field_deserializers()\n return super.merge({\n \"attachmentSessions\" => lambda {|n| @attachment_sessions = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::AttachmentSession.create_from_discriminator_value(pn) }) },\n \"attachments\" => lambda {|n| @attachments = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::AttachmentBase.create_from_discriminator_value(pn) }) },\n \"body\" => lambda {|n| @body = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::ItemBody.create_from_discriminator_value(pn) }) },\n \"bodyLastModifiedDateTime\" => lambda {|n| @body_last_modified_date_time = n.get_date_time_value() },\n \"categories\" => lambda {|n| @categories = n.get_collection_of_primitive_values(String) },\n \"checklistItems\" => lambda {|n| @checklist_items = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::ChecklistItem.create_from_discriminator_value(pn) }) },\n \"completedDateTime\" => lambda {|n| @completed_date_time = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::DateTimeTimeZone.create_from_discriminator_value(pn) }) },\n \"createdDateTime\" => lambda {|n| @created_date_time = n.get_date_time_value() },\n \"dueDateTime\" => lambda {|n| @due_date_time = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::DateTimeTimeZone.create_from_discriminator_value(pn) }) },\n \"extensions\" => lambda {|n| @extensions = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::Extension.create_from_discriminator_value(pn) }) },\n \"hasAttachments\" => lambda {|n| @has_attachments = n.get_boolean_value() },\n \"importance\" => lambda {|n| @importance = n.get_enum_value(MicrosoftGraph::Models::Importance) },\n \"isReminderOn\" => lambda {|n| @is_reminder_on = n.get_boolean_value() },\n \"lastModifiedDateTime\" => lambda {|n| @last_modified_date_time = n.get_date_time_value() },\n \"linkedResources\" => lambda {|n| @linked_resources = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::LinkedResource.create_from_discriminator_value(pn) }) },\n \"recurrence\" => lambda {|n| @recurrence = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::PatternedRecurrence.create_from_discriminator_value(pn) }) },\n \"reminderDateTime\" => lambda {|n| @reminder_date_time = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::DateTimeTimeZone.create_from_discriminator_value(pn) }) },\n \"startDateTime\" => lambda {|n| @start_date_time = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::DateTimeTimeZone.create_from_discriminator_value(pn) }) },\n \"status\" => lambda {|n| @status = n.get_enum_value(MicrosoftGraph::Models::TaskStatus) },\n \"title\" => lambda {|n| @title = n.get_string_value() },\n })\n end",
"def clone\r\n obj = super\r\n return obj unless respond_to?(:translated_attribute_names)\r\n obj.instance_variable_set(:@globalize, nil )\r\n each_locale_and_translated_attribute do |locale, name|\r\n obj.globalize.write(locale, name, globalize.fetch(locale, name) )\r\n end\r\n return obj\r\n end",
"def get_field_deserializers()\n return super.merge({\n \"allowedOnlineMeetingProviders\" => lambda {|n| @allowed_online_meeting_providers = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::OnlineMeetingProviderType.create_from_discriminator_value(pn) }) },\n \"calendarPermissions\" => lambda {|n| @calendar_permissions = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::CalendarPermission.create_from_discriminator_value(pn) }) },\n \"calendarView\" => lambda {|n| @calendar_view = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::Event.create_from_discriminator_value(pn) }) },\n \"canEdit\" => lambda {|n| @can_edit = n.get_boolean_value() },\n \"canShare\" => lambda {|n| @can_share = n.get_boolean_value() },\n \"canViewPrivateItems\" => lambda {|n| @can_view_private_items = n.get_boolean_value() },\n \"changeKey\" => lambda {|n| @change_key = n.get_string_value() },\n \"color\" => lambda {|n| @color = n.get_enum_value(MicrosoftGraph::Models::CalendarColor) },\n \"defaultOnlineMeetingProvider\" => lambda {|n| @default_online_meeting_provider = n.get_enum_value(MicrosoftGraph::Models::OnlineMeetingProviderType) },\n \"events\" => lambda {|n| @events = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::Event.create_from_discriminator_value(pn) }) },\n \"hexColor\" => lambda {|n| @hex_color = n.get_string_value() },\n \"isDefaultCalendar\" => lambda {|n| @is_default_calendar = n.get_boolean_value() },\n \"isRemovable\" => lambda {|n| @is_removable = n.get_boolean_value() },\n \"isTallyingResponses\" => lambda {|n| @is_tallying_responses = n.get_boolean_value() },\n \"multiValueExtendedProperties\" => lambda {|n| @multi_value_extended_properties = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::MultiValueLegacyExtendedProperty.create_from_discriminator_value(pn) }) },\n \"name\" => lambda {|n| @name = n.get_string_value() },\n \"owner\" => lambda {|n| @owner = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::EmailAddress.create_from_discriminator_value(pn) }) },\n \"singleValueExtendedProperties\" => lambda {|n| @single_value_extended_properties = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::SingleValueLegacyExtendedProperty.create_from_discriminator_value(pn) }) },\n })\n end",
"def get_field_deserializers()\n return super.merge({\n \"email\" => lambda {|n| @email = n.get_string_value() },\n })\n end",
"def normalized_key(name, serializer)\n # serializer && serializer.localized? ? \"#{name}.#{::I18n.locale}\" : name\n serializer&.localized? ? \"#{name}.#{::Mongoid::Fields::I18n.locale}\" : name\n end",
"def fields\n fields = orig_fields\n\n fields.instance_exec(self) do |content_type|\n fields.define_singleton_method(:add) do |field|\n content_type.update(fields: content_type.merged_fields(field))\n end\n\n fields.define_singleton_method(:create) do |params|\n field = Contentful::Management::Field.new\n Field.property_coercions.each do |key, _value|\n snakify_key = Support.snakify(key)\n param = params[snakify_key.to_sym]\n field.send(\"#{snakify_key}=\", param) if param\n end\n content_type.update(fields: content_type.merged_fields(field))\n end\n\n fields.define_singleton_method(:destroy) do |id|\n fields = content_type.fields.reject { |field| field.id == id }\n content_type.update(fields: fields)\n end\n end\n\n fields\n end",
"def load_all_entries\n results = self.all :order=>\"locale, key\"\n data = {}\n\n results.each do |result|\n #create an empty hash for each locale initially\n data[result.locale] ||= {}\n\n # create the deep nested scopes from the dotted key\n scopes = result.key.split(\".\").map{|k| k.to_sym}\n key = scopes.pop\n scope = scopes.inject(data[result.locale]) do |scope, s|\n # a new scope is empty initially\n # if its a simple string override it with a empty hash\n scope[s] = {} unless scope[s] and scope[s].is_a?(Hash)\n scope[s]\n end\n\n # if we have a pluralization form and the translation key already exists add the specific pluralization form\n if scope[key] && scope[key].is_a?(Hash) && !result.pluralization_index.blank?\n scope[key][result.pluralization_index] = result.text\n\n # if we have a pluralization index add the initial hash\n elsif !result.pluralization_index.blank?\n scope[key] = { result.pluralization_index.to_sym => result.text.to_s }\n\n # else we just add the simple text\n else\n scope[key] = result.text\n end\n\n end\n return data\n end",
"def get_field_deserializers()\n return super.merge({\n \"description\" => lambda {|n| @description = n.get_string_value() },\n \"displayName\" => lambda {|n| @display_name = n.get_string_value() },\n \"isBuiltIn\" => lambda {|n| @is_built_in = n.get_boolean_value() },\n \"roleAssignments\" => lambda {|n| @role_assignments = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::RoleAssignment.create_from_discriminator_value(pn) }) },\n \"rolePermissions\" => lambda {|n| @role_permissions = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::RolePermission.create_from_discriminator_value(pn) }) },\n })\n end",
"def get_field_deserializers()\n return super.merge({\n \"isDefault\" => lambda {|n| @is_default = n.get_boolean_value() },\n \"links\" => lambda {|n| @links = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::SectionLinks.create_from_discriminator_value(pn) }) },\n \"pages\" => lambda {|n| @pages = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::OnenotePage.create_from_discriminator_value(pn) }) },\n \"pagesUrl\" => lambda {|n| @pages_url = n.get_string_value() },\n \"parentNotebook\" => lambda {|n| @parent_notebook = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::Notebook.create_from_discriminator_value(pn) }) },\n \"parentSectionGroup\" => lambda {|n| @parent_section_group = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::SectionGroup.create_from_discriminator_value(pn) }) },\n })\n end",
"def get_field_deserializers()\n return super.merge({\n \"acceptances\" => lambda {|n| @acceptances = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::AgreementAcceptance.create_from_discriminator_value(pn) }) },\n \"displayName\" => lambda {|n| @display_name = n.get_string_value() },\n \"file\" => lambda {|n| @file = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::AgreementFile.create_from_discriminator_value(pn) }) },\n \"files\" => lambda {|n| @files = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::AgreementFileLocalization.create_from_discriminator_value(pn) }) },\n \"isPerDeviceAcceptanceRequired\" => lambda {|n| @is_per_device_acceptance_required = n.get_boolean_value() },\n \"isViewingBeforeAcceptanceRequired\" => lambda {|n| @is_viewing_before_acceptance_required = n.get_boolean_value() },\n \"termsExpiration\" => lambda {|n| @terms_expiration = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::TermsExpiration.create_from_discriminator_value(pn) }) },\n \"userReacceptRequiredFrequency\" => lambda {|n| @user_reaccept_required_frequency = n.get_duration_value() },\n })\n end",
"def get_field_deserializers()\n return super.merge({\n \"devicesCount\" => lambda {|n| @devices_count = n.get_number_value() },\n \"lastReportedDateTime\" => lambda {|n| @last_reported_date_time = n.get_date_time_value() },\n \"status\" => lambda {|n| @status = n.get_enum_value(MicrosoftGraph::Models::ComplianceStatus) },\n \"userDisplayName\" => lambda {|n| @user_display_name = n.get_string_value() },\n \"userPrincipalName\" => lambda {|n| @user_principal_name = n.get_string_value() },\n })\n end",
"def get_field_deserializers()\n return super.merge({\n \"connectors\" => lambda {|n| @connectors = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::PrintConnector.create_from_discriminator_value(pn) }) },\n \"hasPhysicalDevice\" => lambda {|n| @has_physical_device = n.get_boolean_value() },\n \"isShared\" => lambda {|n| @is_shared = n.get_boolean_value() },\n \"lastSeenDateTime\" => lambda {|n| @last_seen_date_time = n.get_date_time_value() },\n \"registeredDateTime\" => lambda {|n| @registered_date_time = n.get_date_time_value() },\n \"shares\" => lambda {|n| @shares = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::PrinterShare.create_from_discriminator_value(pn) }) },\n \"taskTriggers\" => lambda {|n| @task_triggers = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::PrintTaskTrigger.create_from_discriminator_value(pn) }) },\n })\n end",
"def get_field_deserializers()\n return super.merge({\n \"assignedDateTime\" => lambda {|n| @assigned_date_time = n.get_date_time_value() },\n \"assignerUserId\" => lambda {|n| @assigner_user_id = n.get_string_value() },\n \"assignmentType\" => lambda {|n| @assignment_type = n.get_enum_value(MicrosoftGraph::Models::AssignmentType) },\n \"dueDateTime\" => lambda {|n| @due_date_time = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::DateTimeTimeZone.create_from_discriminator_value(pn) }) },\n \"notes\" => lambda {|n| @notes = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::ItemBody.create_from_discriminator_value(pn) }) },\n })\n end",
"def get_field_deserializers()\n return super.merge({\n \"coreBootTimeInMs\" => lambda {|n| @core_boot_time_in_ms = n.get_number_value() },\n \"coreLoginTimeInMs\" => lambda {|n| @core_login_time_in_ms = n.get_number_value() },\n \"deviceId\" => lambda {|n| @device_id = n.get_string_value() },\n \"featureUpdateBootTimeInMs\" => lambda {|n| @feature_update_boot_time_in_ms = n.get_number_value() },\n \"groupPolicyBootTimeInMs\" => lambda {|n| @group_policy_boot_time_in_ms = n.get_number_value() },\n \"groupPolicyLoginTimeInMs\" => lambda {|n| @group_policy_login_time_in_ms = n.get_number_value() },\n \"isFeatureUpdate\" => lambda {|n| @is_feature_update = n.get_boolean_value() },\n \"isFirstLogin\" => lambda {|n| @is_first_login = n.get_boolean_value() },\n \"operatingSystemVersion\" => lambda {|n| @operating_system_version = n.get_string_value() },\n \"responsiveDesktopTimeInMs\" => lambda {|n| @responsive_desktop_time_in_ms = n.get_number_value() },\n \"restartCategory\" => lambda {|n| @restart_category = n.get_enum_value(MicrosoftGraph::Models::UserExperienceAnalyticsOperatingSystemRestartCategory) },\n \"restartFaultBucket\" => lambda {|n| @restart_fault_bucket = n.get_string_value() },\n \"restartStopCode\" => lambda {|n| @restart_stop_code = n.get_string_value() },\n \"startTime\" => lambda {|n| @start_time = n.get_date_time_value() },\n \"totalBootTimeInMs\" => lambda {|n| @total_boot_time_in_ms = n.get_number_value() },\n \"totalLoginTimeInMs\" => lambda {|n| @total_login_time_in_ms = n.get_number_value() },\n })\n end",
"def get_field_deserializers()\n return super.merge({\n \"bundles\" => lambda {|n| @bundles = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::DriveItem.create_from_discriminator_value(pn) }) },\n \"driveType\" => lambda {|n| @drive_type = n.get_string_value() },\n \"following\" => lambda {|n| @following = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::DriveItem.create_from_discriminator_value(pn) }) },\n \"items\" => lambda {|n| @items = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::DriveItem.create_from_discriminator_value(pn) }) },\n \"list\" => lambda {|n| @list = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::List.create_from_discriminator_value(pn) }) },\n \"owner\" => lambda {|n| @owner = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::IdentitySet.create_from_discriminator_value(pn) }) },\n \"quota\" => lambda {|n| @quota = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::Quota.create_from_discriminator_value(pn) }) },\n \"root\" => lambda {|n| @root = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::DriveItem.create_from_discriminator_value(pn) }) },\n \"sharePointIds\" => lambda {|n| @share_point_ids = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::SharepointIds.create_from_discriminator_value(pn) }) },\n \"special\" => lambda {|n| @special = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::DriveItem.create_from_discriminator_value(pn) }) },\n \"system\" => lambda {|n| @system = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::SystemFacet.create_from_discriminator_value(pn) }) },\n })\n end",
"def get_field_deserializers()\n return super.merge({\n \"appDefinitions\" => lambda {|n| @app_definitions = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::TeamsAppDefinition.create_from_discriminator_value(pn) }) },\n \"displayName\" => lambda {|n| @display_name = n.get_string_value() },\n \"distributionMethod\" => lambda {|n| @distribution_method = n.get_enum_value(MicrosoftGraph::Models::TeamsAppDistributionMethod) },\n \"externalId\" => lambda {|n| @external_id = n.get_string_value() },\n })\n end",
"def get_field_deserializers()\n return super.merge({\n \"createdDateTime\" => lambda {|n| @created_date_time = n.get_date_time_value() },\n \"isUsable\" => lambda {|n| @is_usable = n.get_boolean_value() },\n \"isUsableOnce\" => lambda {|n| @is_usable_once = n.get_boolean_value() },\n \"lifetimeInMinutes\" => lambda {|n| @lifetime_in_minutes = n.get_number_value() },\n \"methodUsabilityReason\" => lambda {|n| @method_usability_reason = n.get_string_value() },\n \"startDateTime\" => lambda {|n| @start_date_time = n.get_date_time_value() },\n \"temporaryAccessPass\" => lambda {|n| @temporary_access_pass = n.get_string_value() },\n })\n end",
"def available_locales\n translation_model.all(:fields => [:locale_tag], :unique => true).map { |t| t.locale }\n end",
"def get_field_deserializers()\n return super.merge({\n \"attachments\" => lambda {|n| @attachments = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::Attachment.create_from_discriminator_value(pn) }) },\n \"bccRecipients\" => lambda {|n| @bcc_recipients = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::Recipient.create_from_discriminator_value(pn) }) },\n \"body\" => lambda {|n| @body = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::ItemBody.create_from_discriminator_value(pn) }) },\n \"bodyPreview\" => lambda {|n| @body_preview = n.get_string_value() },\n \"ccRecipients\" => lambda {|n| @cc_recipients = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::Recipient.create_from_discriminator_value(pn) }) },\n \"conversationId\" => lambda {|n| @conversation_id = n.get_string_value() },\n \"conversationIndex\" => lambda {|n| @conversation_index = n.get_object_value(lambda {|pn| Base64url.create_from_discriminator_value(pn) }) },\n \"extensions\" => lambda {|n| @extensions = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::Extension.create_from_discriminator_value(pn) }) },\n \"flag\" => lambda {|n| @flag = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::FollowupFlag.create_from_discriminator_value(pn) }) },\n \"from\" => lambda {|n| @from = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::Recipient.create_from_discriminator_value(pn) }) },\n \"hasAttachments\" => lambda {|n| @has_attachments = n.get_boolean_value() },\n \"importance\" => lambda {|n| @importance = n.get_enum_value(MicrosoftGraph::Models::Importance) },\n \"inferenceClassification\" => lambda {|n| @inference_classification = n.get_enum_value(MicrosoftGraph::Models::InferenceClassificationType) },\n \"internetMessageHeaders\" => lambda {|n| @internet_message_headers = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::InternetMessageHeader.create_from_discriminator_value(pn) }) },\n \"internetMessageId\" => lambda {|n| @internet_message_id = n.get_string_value() },\n \"isDeliveryReceiptRequested\" => lambda {|n| @is_delivery_receipt_requested = n.get_boolean_value() },\n \"isDraft\" => lambda {|n| @is_draft = n.get_boolean_value() },\n \"isRead\" => lambda {|n| @is_read = n.get_boolean_value() },\n \"isReadReceiptRequested\" => lambda {|n| @is_read_receipt_requested = n.get_boolean_value() },\n \"multiValueExtendedProperties\" => lambda {|n| @multi_value_extended_properties = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::MultiValueLegacyExtendedProperty.create_from_discriminator_value(pn) }) },\n \"parentFolderId\" => lambda {|n| @parent_folder_id = n.get_string_value() },\n \"receivedDateTime\" => lambda {|n| @received_date_time = n.get_date_time_value() },\n \"replyTo\" => lambda {|n| @reply_to = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::Recipient.create_from_discriminator_value(pn) }) },\n \"sender\" => lambda {|n| @sender = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::Recipient.create_from_discriminator_value(pn) }) },\n \"sentDateTime\" => lambda {|n| @sent_date_time = n.get_date_time_value() },\n \"singleValueExtendedProperties\" => lambda {|n| @single_value_extended_properties = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::SingleValueLegacyExtendedProperty.create_from_discriminator_value(pn) }) },\n \"subject\" => lambda {|n| @subject = n.get_string_value() },\n \"toRecipients\" => lambda {|n| @to_recipients = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::Recipient.create_from_discriminator_value(pn) }) },\n \"uniqueBody\" => lambda {|n| @unique_body = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::ItemBody.create_from_discriminator_value(pn) }) },\n \"webLink\" => lambda {|n| @web_link = n.get_string_value() },\n })\n end",
"def get_field_deserializers()\n return super.merge({\n \"loginName\" => lambda {|n| @login_name = n.get_string_value() },\n })\n end",
"def get_field_deserializers()\n return super.merge({\n \"androidEnrollmentAssignments\" => lambda {|n| @android_enrollment_assignments = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::ComplianceManagementPartnerAssignment.create_from_discriminator_value(pn) }) },\n \"androidOnboarded\" => lambda {|n| @android_onboarded = n.get_boolean_value() },\n \"displayName\" => lambda {|n| @display_name = n.get_string_value() },\n \"iosEnrollmentAssignments\" => lambda {|n| @ios_enrollment_assignments = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::ComplianceManagementPartnerAssignment.create_from_discriminator_value(pn) }) },\n \"iosOnboarded\" => lambda {|n| @ios_onboarded = n.get_boolean_value() },\n \"lastHeartbeatDateTime\" => lambda {|n| @last_heartbeat_date_time = n.get_date_time_value() },\n \"macOsEnrollmentAssignments\" => lambda {|n| @mac_os_enrollment_assignments = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::ComplianceManagementPartnerAssignment.create_from_discriminator_value(pn) }) },\n \"macOsOnboarded\" => lambda {|n| @mac_os_onboarded = n.get_boolean_value() },\n \"partnerState\" => lambda {|n| @partner_state = n.get_enum_value(MicrosoftGraph::Models::DeviceManagementPartnerTenantState) },\n })\n end",
"def get_field_deserializers()\n return super.merge({\n \"additionalTags\" => lambda {|n| @additional_tags = n.get_collection_of_primitive_values(String) },\n \"contentWebUrl\" => lambda {|n| @content_web_url = n.get_string_value() },\n \"contributors\" => lambda {|n| @contributors = n.get_collection_of_primitive_values(String) },\n \"createdDateTime\" => lambda {|n| @created_date_time = n.get_date_time_value() },\n \"description\" => lambda {|n| @description = n.get_string_value() },\n \"duration\" => lambda {|n| @duration = n.get_duration_value() },\n \"externalId\" => lambda {|n| @external_id = n.get_string_value() },\n \"format\" => lambda {|n| @format = n.get_string_value() },\n \"isActive\" => lambda {|n| @is_active = n.get_boolean_value() },\n \"isPremium\" => lambda {|n| @is_premium = n.get_boolean_value() },\n \"isSearchable\" => lambda {|n| @is_searchable = n.get_boolean_value() },\n \"languageTag\" => lambda {|n| @language_tag = n.get_string_value() },\n \"lastModifiedDateTime\" => lambda {|n| @last_modified_date_time = n.get_date_time_value() },\n \"numberOfPages\" => lambda {|n| @number_of_pages = n.get_number_value() },\n \"skillTags\" => lambda {|n| @skill_tags = n.get_collection_of_primitive_values(String) },\n \"sourceName\" => lambda {|n| @source_name = n.get_string_value() },\n \"thumbnailWebUrl\" => lambda {|n| @thumbnail_web_url = n.get_string_value() },\n \"title\" => lambda {|n| @title = n.get_string_value() },\n })\n end",
"def get_field_deserializers()\n return super.merge({\n \"createdDateTime\" => lambda {|n| @created_date_time = n.get_date_time_value() },\n \"deviceId\" => lambda {|n| @device_id = n.get_string_value() },\n \"key\" => lambda {|n| @key = n.get_string_value() },\n \"volumeType\" => lambda {|n| @volume_type = n.get_enum_value(MicrosoftGraph::Models::VolumeType) },\n })\n end",
"def get_field_deserializers()\n return super.merge({\n \"comment\" => lambda {|n| @comment = n.get_string_value() },\n \"createdBy\" => lambda {|n| @created_by = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::IdentitySet.create_from_discriminator_value(pn) }) },\n \"createdDateTime\" => lambda {|n| @created_date_time = n.get_date_time_value() },\n \"items\" => lambda {|n| @items = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::DocumentSetVersionItem.create_from_discriminator_value(pn) }) },\n \"shouldCaptureMinorVersion\" => lambda {|n| @should_capture_minor_version = n.get_boolean_value() },\n })\n end",
"def locale_defaults\n if by_subdomain?\n defaults.merge(subdomain: locale.to_s)\n else\n defaults.merge(locale: locale.to_s)\n end\n end",
"def get_field_deserializers()\n return super.merge({\n \"createdDateTimeUtc\" => lambda {|n| @created_date_time_utc = n.get_date_time_value() },\n \"deviceIdentities\" => lambda {|n| @device_identities = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::ImportedWindowsAutopilotDeviceIdentity.create_from_discriminator_value(pn) }) },\n \"status\" => lambda {|n| @status = n.get_enum_value(MicrosoftGraph::Models::ImportedWindowsAutopilotDeviceIdentityUploadStatus) },\n })\n end",
"def attributes\r\n unless @stop_merging_translated_attributes || @attributes.frozen?\r\n @attributes.merge! translated_attributes\r\n end\r\n super\r\n end",
"def reflect_fields\n send_and_receive('admin/luke', params: { fl: '*', 'json.nl' => 'map' })['fields']\n end",
"def get_field_deserializers()\n return super.merge({\n \"lowerAddress\" => lambda {|n| @lower_address = n.get_string_value() },\n \"upperAddress\" => lambda {|n| @upper_address = n.get_string_value() },\n })\n end",
"def get_field_deserializers()\n return super.merge({\n \"parentNotebook\" => lambda {|n| @parent_notebook = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::Notebook.create_from_discriminator_value(pn) }) },\n \"parentSectionGroup\" => lambda {|n| @parent_section_group = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::SectionGroup.create_from_discriminator_value(pn) }) },\n \"sectionGroups\" => lambda {|n| @section_groups = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::SectionGroup.create_from_discriminator_value(pn) }) },\n \"sectionGroupsUrl\" => lambda {|n| @section_groups_url = n.get_string_value() },\n \"sections\" => lambda {|n| @sections = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::OnenoteSection.create_from_discriminator_value(pn) }) },\n \"sectionsUrl\" => lambda {|n| @sections_url = n.get_string_value() },\n })\n end",
"def get_field_deserializers()\n return super.merge({\n \"assignedTo\" => lambda {|n| @assigned_to = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::Identity.create_from_discriminator_value(pn) }) },\n \"closedDateTime\" => lambda {|n| @closed_date_time = n.get_date_time_value() },\n \"createdBy\" => lambda {|n| @created_by = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::IdentitySet.create_from_discriminator_value(pn) }) },\n \"createdDateTime\" => lambda {|n| @created_date_time = n.get_date_time_value() },\n \"dataSubject\" => lambda {|n| @data_subject = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::DataSubject.create_from_discriminator_value(pn) }) },\n \"dataSubjectType\" => lambda {|n| @data_subject_type = n.get_enum_value(MicrosoftGraph::Models::DataSubjectType) },\n \"description\" => lambda {|n| @description = n.get_string_value() },\n \"displayName\" => lambda {|n| @display_name = n.get_string_value() },\n \"history\" => lambda {|n| @history = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::SubjectRightsRequestHistory.create_from_discriminator_value(pn) }) },\n \"insight\" => lambda {|n| @insight = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::SubjectRightsRequestDetail.create_from_discriminator_value(pn) }) },\n \"internalDueDateTime\" => lambda {|n| @internal_due_date_time = n.get_date_time_value() },\n \"lastModifiedBy\" => lambda {|n| @last_modified_by = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::IdentitySet.create_from_discriminator_value(pn) }) },\n \"lastModifiedDateTime\" => lambda {|n| @last_modified_date_time = n.get_date_time_value() },\n \"notes\" => lambda {|n| @notes = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::AuthoredNote.create_from_discriminator_value(pn) }) },\n \"regulations\" => lambda {|n| @regulations = n.get_collection_of_primitive_values(String) },\n \"stages\" => lambda {|n| @stages = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::SubjectRightsRequestStageDetail.create_from_discriminator_value(pn) }) },\n \"status\" => lambda {|n| @status = n.get_enum_value(MicrosoftGraph::Models::SubjectRightsRequestStatus) },\n \"team\" => lambda {|n| @team = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::Team.create_from_discriminator_value(pn) }) },\n \"type\" => lambda {|n| @type = n.get_enum_value(MicrosoftGraph::Models::SubjectRightsRequestType) },\n })\n end",
"def display_all_fields\n @@all_fields\n end",
"def get_field_deserializers()\n return super.merge({\n \"clientId\" => lambda {|n| @client_id = n.get_string_value() },\n \"consentType\" => lambda {|n| @consent_type = n.get_string_value() },\n \"principalId\" => lambda {|n| @principal_id = n.get_string_value() },\n \"resourceId\" => lambda {|n| @resource_id = n.get_string_value() },\n \"scope\" => lambda {|n| @scope = n.get_string_value() },\n })\n end",
"def default_fields_for_forms\n [\n { name: :get_verbose_conflicting_row, width: 50,\n label: I18n.t('admin_import.conflicting_row')\n },\n { name: :import_text, flex: 1, label: I18n.t('admin_import.import_text') },\n\n { name: :event_order, width: 50,\n label: I18n.t('activerecord.attributes.meeting_program.event_order')\n },\n { name: :begin_time, width: 80, xtype: 'datecolumn', format: 'H:i',\n label: I18n.t('activerecord.attributes.meeting_program.begin_time')\n },\n { name: :notes, label: I18n.t(:notes) },\n\n { name: :data_import_meeting_session__get_full_name, width: 160,\n label: I18n.t('activerecord.models.data_import_meeting_session')\n },\n { name: :meeting_session__get_full_name, width: 110,\n label: I18n.t('activerecord.models.meeting_session')\n },\n { name: :event_type__i18n_short, width: 110,\n label: I18n.t('activerecord.models.event_type')\n },\n { name: :category_type__short_name, width: 60,\n label: I18n.t('activerecord.models.category_type')\n },\n # Base timings:\n { name: :minutes, width: 30, label: I18n.t('activerecord.attributes.meeting_program.minutes') },\n { name: :seconds, width: 30, label: I18n.t('activerecord.attributes.meeting_program.seconds') },\n { name: :hundreds, width: 30, label: I18n.t('activerecord.attributes.meeting_program.hundreds') },\n { name: :time_standard__get_timing, width: 110,\n label: I18n.t('activerecord.models.time_standard')\n },\n { name: :heat_type__i18n_description, width: 80,\n label: I18n.t('activerecord.models.heat_type')\n }\n ]\n end",
"def get_field_deserializers()\n return super.merge({\n \"destinationRoutingReason\" => lambda {|n| @destination_routing_reason = n.get_enum_value(MicrosoftGraph::Models::MailDestinationRoutingReason) },\n \"messageUri\" => lambda {|n| @message_uri = n.get_string_value() },\n \"recipientEmail\" => lambda {|n| @recipient_email = n.get_string_value() },\n })\n end"
] |
[
"0.6290221",
"0.6290221",
"0.6155563",
"0.6048918",
"0.6048918",
"0.59363073",
"0.59363073",
"0.59363073",
"0.5773722",
"0.5760829",
"0.57599807",
"0.5757715",
"0.5743455",
"0.56845134",
"0.56750476",
"0.56325203",
"0.56025636",
"0.5602253",
"0.55998",
"0.559405",
"0.5555716",
"0.55454886",
"0.55421627",
"0.55337876",
"0.55182296",
"0.5513218",
"0.5502561",
"0.55001765",
"0.549995",
"0.5496887",
"0.5485866",
"0.5480859",
"0.5475954",
"0.546352",
"0.5458493",
"0.5456109",
"0.54511774",
"0.5444279",
"0.5438588",
"0.54371434",
"0.5403081",
"0.5401174",
"0.53966326",
"0.5379943",
"0.5377642",
"0.53734714",
"0.53696275",
"0.5354263",
"0.53534865",
"0.53329206",
"0.5329644",
"0.53268623",
"0.53248",
"0.53233",
"0.5314356",
"0.5311647",
"0.53098094",
"0.53097147",
"0.5308819",
"0.5304572",
"0.5302353",
"0.5295725",
"0.52954525",
"0.5286443",
"0.5283156",
"0.528123",
"0.52803236",
"0.52783763",
"0.5276785",
"0.52738976",
"0.527361",
"0.5265686",
"0.52607024",
"0.5260312",
"0.5257253",
"0.5256305",
"0.5252109",
"0.52507955",
"0.5250075",
"0.5246745",
"0.52423817",
"0.5241523",
"0.5240113",
"0.5235874",
"0.5231201",
"0.5230318",
"0.5229668",
"0.5229154",
"0.5222805",
"0.5221054",
"0.52192014",
"0.52183586",
"0.52141833",
"0.52106655",
"0.5209919",
"0.52090853",
"0.52083653",
"0.52046555",
"0.52041733",
"0.52035594"
] |
0.6006492
|
5
|
Defines which properties of a resource your class expects Define them in :camelCase, they will be available as snake_cased methods You can pass in a second "type" argument: If it is a class, it will be initialized for the property Symbols are looked up in the COERCION constant for a lambda that defines a type conversion to apply Note: This second argument is not meant for contentful subresources, but for structured objects (like locales in a space) Subresources are handled by the resource builder
|
def property(name, property_class = nil)
property_coercions[name.to_sym] = property_class
accessor_name = Contentful::Management::Support.snakify(name)
define_method accessor_name do
properties[name.to_sym]
end
define_method "#{accessor_name}=" do |value|
properties[name.to_sym] = value
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def mk_resource_methods\n [resource_type.validproperties, resource_type.parameters].flatten.each do |attr|\n attr = symbolize(attr)\n\n # Generate attr_reader\n define_method(attr) do\n if @property_hash[attr]\n @property_hash[attr]\n elsif defined? @resource\n @resource.should(attr)\n end\n end\n\n # Generate attr_writer\n define_method(\"#{attr}=\") do |val|\n @property_hash[attr] = val\n self.class.needs_flush = true\n end\n end\n end",
"def create_property_method\n @resource.class.properties.each do |type|\n name = type.name\n self.class.send(:define_method, name) do\n get_value(name)\n end\n self.class.send(:define_method, \"#{name}=\") do |value|\n set_value(name,resource[name])\n end\n end\n end",
"def type(type = nil)\n @type = type if type\n @type || name.split('::').last.gsub(/Resource$/, '').underscore\n end",
"def name(_prefix = false)\n 'Resource Types'\n end",
"def resource(name, type=nil, &block)\n resource = GenericResource.new\n resource.type = type\n resource.evaluate &block\n add_resource name, resource\n end",
"def resource type, labels = {}\n Resource.new.tap do |r|\n r.type = type\n r.labels = labels\n end\n end",
"def transform_Resource(o, scope)\n Types::TypeFactory.resource(o.type, o.title)\n end",
"def to_resource_declaration(type)\n if type.respond_to?(:type_name) && type.respond_to?(:title)\n title = type.title\n type_name = type.type_name\n elsif type_result = /(\\w+)\\['?(\\w+)'?\\]/.match(type.to_s)\n # not all types have a type_name and title so we\n # output to a string and parse the results\n title = type_result[2]\n type_name = type_result[1]\n else\n return type\n end\n res = scope.catalog.resource(type_name, title)\n return res.to_ral if res\n # don't return anything or returns nil if item is not in the catalog\n end",
"def initialize(client, path, resource_type)\n @client = client\n @path = path\n\n if INCONSISTENT_RESOURCE_TYPES.has_key?(get_singular(resource_type))\n resource_type = INCONSISTENT_RESOURCE_TYPES[get_singular(resource_type)] + 's'\n end\n @resource_type = resource_type\n # Add create methods for the relevant root RightApi::Resources\n self.define_instance_method('create') do |*args|\n client.send(:do_post, path, *args)\n end\n\n # Add in index methods for the relevant root RightApi::Resources\n self.define_instance_method('index') do |*args|\n # Session uses .index like a .show (so need to treat it as a special case)\n if resource_type == 'session'\n ResourceDetail.new(client, *client.send(:do_get, path, *args))\n else\n RightApi::Resource.process(client, *client.send(:do_get, path, *args))\n end\n end\n\n # Adding in special cases\n Helper::RESOURCE_SPECIAL_ACTIONS[resource_type].each do |meth, action|\n # Insert_in_path will NOT modify path\n action_path = insert_in_path(path, meth)\n self.define_instance_method(meth) do |*args|\n client.send(action, action_path, *args)\n end\n end if Helper::RESOURCE_SPECIAL_ACTIONS[resource_type]\n end",
"def initialize(name, type: nil, resource: nil, polymorphic: false, primary_key: :id, foreign_key: nil, parent: nil)\n @name = name\n @resource_class = (resource || Class.new(Resource))\n @sideloads = {}\n @polymorphic = !!polymorphic\n @polymorphic_groups = {} if polymorphic?\n @parent = parent\n @primary_key = primary_key\n @foreign_key = foreign_key\n @type = type\n\n extend @resource_class.config[:adapter].sideloading_module\n end",
"def get_resource_class\n \tresource_name.classify.constantize\n end",
"def type_as_class(resource_name)\n\t resource_name.singularize.capitalize.constantize\n\tend",
"def resource_model\n Object.const_get options[:resource].classify\n end",
"def create_resource(type, title, parameters = {})\n parameters = parameters.merge(:name => title)\n resource = Puppet::Type.type(type.to_sym).new(parameters)\n catalog.add_resource(resource)\n resource\n end",
"def initialize_resources_class_accessors! #:nodoc:\n\n\n # First priority is the namespaced model, e.g. User::Group\n self.resource_class ||= begin\n namespaced_class = self.name.sub(/Controller/, '').singularize\n namespaced_class.constantize\n rescue NameError\n nil\n end\n\n\n\n # Second priority is the top namespace model, e.g. EngineName::Article for EngineName::Admin::ArticlesController\n self.resource_class ||= begin\n namespaced_classes = self.name.sub(/Controller/, '').split('::')\n namespaced_class = [namespaced_classes.first, namespaced_classes.last].join('::').singularize\n namespaced_class.constantize\n rescue NameError\n nil\n end\n\n\n\n # Third priority the camelcased c, i.e. UserGroup\n self.resource_class ||= begin\n camelcased_class = self.name.sub(/Controller/, '').gsub('::', '').singularize\n camelcased_class.constantize\n rescue NameError\n nil\n end\n\n\n\n # Otherwise use the Group class, or fail\n self.resource_class ||= begin\n class_name = self.controller_name.classify\n class_name.constantize\n rescue NameError => e\n raise unless e.message.include?(class_name)\n nil\n end\n\n\n\n self.resource_instance_name = self.controller_name.singularize.to_sym #test_name\n\n self.collection_name = self.controller_name.to_sym\n\n\n\t\tself.resource_name = resource_class.to_s\n\n end",
"def resource_param\n \"#{params[:resource]}\".classify\n end",
"def resource_type_params\n params.require(:resource_type).permit(:name)\n end",
"def property_to_rest_mapping\n {\n :name => :aclname,\n :interface => :Interface,\n }\n end",
"def classize_resource(type)\n return type unless type.is_a?(Symbol) || type.is_a?(String)\n\n klass = nil\n begin\n klass = qualified_const_get(type.to_s)\n rescue NameError\n raise NameError, \"Could not find relation class #{type} (referenced as #{type} by #{self})\"\n end\n klass\n end",
"def resource_singular() self.class.read_inheritable_attribute(:resource_singular) end",
"def resource_class\n\n ActiveSupport::Dependencies.constantize(resource_class_name)\n\n end",
"def resource_type\n /(\\/api\\/(?<type>\\w+)\\/?)/ =~ full_url\n type.capitalize\n end",
"def resource(name, &block)\n # It creates a new class based on the resource name scoped tot he Scrumy module\n klass = Scrumy::Models.const_set(name.to_s.classify, Class.new(Scrumy::Models::Model))\n # Then executes the block on the class. The class provides several class\n # methods for making instances behave correctly.\n klass.class_exec &block\nend",
"def generic_resource( unit )\n resources unit, concerns: [:search_suggestion, :uniqueness_validation, :retrieve_resource]\n end",
"def get_resource(resource_type)\n\n Occi::Log.debug(\"Instantiating #{resource_type} ...\")\n\n if @model.get_by_id resource_type\n # we got a resource type identifier\n Occi::Core::Resource.new resource_type\n elsif @model.kinds.select { |kind| kind.term == resource_type }.any?\n # we got a resource type name\n Occi::Core::Resource.new @model.kinds.select {\n |kind| kind.term == resource_type\n }.first.type_identifier\n else\n raise \"Unknown resource type! [#{resource_type}]\"\n end\n\n end",
"def create\n @property_hash[:ensure] = :present\n self.class.resource_type.validproperties.each do |property|\n if val = resource.should(property)\n @property_hash[property] = val\n end\n end\n end",
"def form_rest_api_args(classname, property, name)\n arguments = {}\n property.path.scan(/{([^}]*)}/).each do |name, etc|\n if is_static_method(property) or validate_class_name(name) !~ /^#{classname}/i\n arguments[validate_property_name(name)] = \"String\"\n end\n end\n if property.request and property.request != classname\n arguments[validate_property_name(property.request)] = property.request\n end\n if property.type == 'GET' or property.type == 'HEAD' or property.type == 'DELETE'\n arguments[\"queryParameters\"] = \"Map<String, String>\"\n end\n arguments\n end",
"def create(res_type, config_props = {}, &block)\n # new_res = nil\n #res_name = res_name.to_sym\n #config_props[:name] ||= res_name\n config_props[:type] ||= res_type\n debug \"Create resource of type '#{res_type}'\"\n create_message_and_publish(:create, config_props, block)\n self\n end",
"def resource_name\n resource_class.slice(0,1).downcase + resource_class.slice(1,resource_class.length)\n end",
"def classize_resource(type)\n klass = nil\n begin \n klass = qualified_const_get(type.to_s)\n rescue NameError\n raise NameError, \"Could not find relation class #{type} (referenced as #{type} by #{self})\"\n klass.is_a?(Class) && klass.ancestors.include?(Spira::Resource)\n end\n unless klass.is_a?(Class) && klass.ancestors.include?(Spira::Resource)\n raise TypeError, \"#{type} is not a Spira Resource (referenced as #{type} by #{self})\"\n end\n klass\n end",
"def resource_class\n\t\t\t\t@resource_class ||= resource_name.classify.constantize\n\t\t\tend",
"def resource_class\n # TODO does this need to have draft?\n @resource_class ||= resource_name.classify.constantize\n end",
"def resource_type\n\t\t\t\t\t\traise \"Not implemented.\"\n\t\t\t\t\tend",
"def resource\n return Object unless resource_type\n return resource_type.constantize unless resource_id\n return _resource\n end",
"def get_resource_type(type, resource_path)\n changed_path = resource_path.split('/').last\n if type.eql?('singular')\n changed_path.singularize.to_sym\n else\n changed_path.to_sym\n end\n end",
"def resource_class\n @resource_class ||= resource_name.classify.constantize\n end",
"def resource_class\n @resource_class ||= resource_name.classify.constantize\n end",
"def resource_class\n @resource_class ||= resource_name.classify.constantize\n end",
"def generate_format_hash(classname, property, resourcePath)\n map = {}\n resourcePath.scan(/\\{([^}]*)\\}/) { |name, etc|\n if (name.match(/^#{classname}.*/i) and !is_static_method(property))\n map[name] = 'this.getId()'\n else\n map[name] = validate_property_name(name)\n end\n }\n map\n end",
"def map_resource_type(resource_types, node)\n if resource_types.empty?\n if node.is_a?(IFile)\n return {\n 'string' => 'File',\n 'icon' => 'file'\n }\n else\n return {\n 'string' => 'Unknown',\n 'icon' => 'cog'\n }\n end\n end\n\n types = {\n '{http://calendarserver.org/ns/}calendar-proxy-write' => {\n 'string' => 'Proxy-Write',\n 'icon' => 'people'\n },\n '{http://calendarserver.org/ns/}calendar-proxy-read' => {\n 'string' => 'Proxy-Read',\n 'icon' => 'people'\n },\n '{urn:ietf:params:xml:ns:caldav}schedule-outbox' => {\n 'string' => 'Outbox',\n 'icon' => 'inbox'\n },\n '{urn:ietf:params:xml:ns:caldav}schedule-inbox' => {\n 'string' => 'Inbox',\n 'icon' => 'inbox'\n },\n '{urn:ietf:params:xml:ns:caldav}calendar' => {\n 'string' => 'Calendar',\n 'icon' => 'calendar'\n },\n '{http://calendarserver.org/ns/}shared-owner' => {\n 'string' => 'Shared',\n 'icon' => 'calendar'\n },\n '{http://calendarserver.org/ns/}subscribed' => {\n 'string' => 'Subscription',\n 'icon' => 'calendar'\n },\n '{urn:ietf:params:xml:ns:carddav}directory' => {\n 'string' => 'Directory',\n 'icon' => 'globe'\n },\n '{urn:ietf:params:xml:ns:carddav}addressbook' => {\n 'string' => 'Address book',\n 'icon' => 'book'\n },\n '{DAV:}principal' => {\n 'string' => 'Principal',\n 'icon' => 'person'\n },\n '{DAV:}collection' => {\n 'string' => 'Collection',\n 'icon' => 'folder'\n }\n }\n\n info = {\n 'string' => [],\n 'icon' => 'cog'\n }\n\n resource_types.each do |resource_type|\n if types.key?(resource_type)\n info['string'] << types[resource_type]['string']\n else\n info['string'] << resource_type\n end\n end\n\n types.each do |key, resource_info|\n if resource_types.include?(key)\n info['icon'] = resource_info['icon']\n break\n end\n end\n\n info['string'] = info['string'].join(', ')\n\n info\n end",
"def create\n debug \"Call: create on cs_resource '#{@resource[:name]}'\"\n @property_hash = {\n :name => @resource[:name],\n :ensure => :present,\n :primitive_class => @resource[:primitive_class],\n :provided_by => @resource[:provided_by],\n :primitive_type => @resource[:primitive_type],\n :complex_type => @resource[:complex_type],\n }\n @property_hash[:parameters] = @resource[:parameters] if @resource[:parameters]\n @property_hash[:operations] = @resource[:operations] if @resource[:operations]\n @property_hash[:metadata] = @resource[:metadata] if @resource[:metadata]\n @property_hash[:ms_metadata] = @resource[:ms_metadata] if @resource[:ms_metadata]\n @property_hash[:cib] = @resource[:cib] if @resource[:cib]\n end",
"def resource_class\n @resource_class ||= resource_name.classify.constantize\n end",
"def build_resource(type, name, created_at=nil, &resource_attrs_block)\n created_at ||= caller[0]\n\n # Checks the new platform => short_name => resource mapping initially\n # then fall back to the older approach (Chef::Resource.const_get) for\n # backward compatibility\n resource_class = resource_class_for(type)\n\n raise ArgumentError, \"You must supply a name when declaring a #{type} resource\" if name.nil?\n\n resource = resource_class.new(name, run_context)\n resource.source_line = created_at\n resource.declared_type = type\n # If we have a resource like this one, we want to steal its state\n # This behavior is very counter-intuitive and should be removed.\n # See CHEF-3694, https://tickets.opscode.com/browse/CHEF-3694\n # Moved to this location to resolve CHEF-5052, https://tickets.opscode.com/browse/CHEF-5052\n resource.load_prior_resource(type, name)\n resource.cookbook_name = cookbook_name\n resource.recipe_name = recipe_name\n # Determine whether this resource is being created in the context of an enclosing Provider\n resource.enclosing_provider = self.is_a?(Chef::Provider) ? self : nil\n\n # XXX: This is very crufty, but it's required for resource definitions\n # to work properly :(\n resource.params = @params\n\n # Evaluate resource attribute DSL\n resource.instance_eval(&resource_attrs_block) if block_given?\n\n # Run optional resource hook\n resource.after_created\n\n resource\n end",
"def decorate_resource( rsrc )\n rsrc.label = self.channum\n rsrc.title = self.name\n end",
"def resource_class\n case class_name\n when false then\n name.to_sym\n when String then\n class_name.constantize\n else\n raise ArgumentError, \"unexpected class_name: #{class_name}\"\n end\n end",
"def initialize args = {}\n self.resource = args[:resource] || ''\n end",
"def path_reader(*types)\n types.each do |type|\n m = :\"#{type}_path\"\n define_method(m) { Lesson.public_send m, self.name }\n end\n end",
"def inherited(resource)\r\n resource.class_eval do\r\n self.versions ||= {}\r\n self.helper_object = Object.new\r\n\r\n begin\r\n plural = name.demodulize.tableize\r\n self.path = lambda { |format|\r\n begin\r\n new.polymorphic_path [:resources, plural], :format => format\r\n rescue => e\r\n nil\r\n end\r\n }\r\n self.query_template = DEFAULT_COLLECTION_QUERY_TEMPLATE.dup\r\n self.model = name.sub(/^Restful\\b/, '').constantize\r\n finder :find, :all, :first, :last\r\n helper ApplicationHelper\r\n rescue ArgumentError, NameError => e\r\n nil\r\n end\r\n\r\n Restful::Resource.classes << self\r\n end\r\n end",
"def parse_resource_args resource, attributes=nil\n instance = instantize resource\n klass = resource.classify.constantize\n attributes = attributes.to_hash_from_story if attributes\n [klass, instance, attributes]\nend",
"def resource_class\n return params.dig(:invitation, :type).constantize if params.dig(:invitation, :type).present?\n\n super\n end",
"def display_resource(ticket_type)\n \"#{ticket_type.name}\"\n end",
"def spira_resource\n cls_name = spira_class_name\n if !self.class.const_defined?(cls_name)\n cls = ::Class.new(OpenMedia::Schema::Base)\n cls.type(self.uri)\n self.properties.each do |p|\n next if p.range==self.uri \n ptype = nil\n if p.range\n if Spira.types[p.range]\n ptype = p.range\n else\n pclass = class_for_uri(p.range)\n if pclass.is_a?(OpenMedia::Schema::RDFS::Datatype)\n ptype = pclass.uri\n elsif pclass.is_a?(::Class) && pclass.name =~ /OpenMedia::Schema/\n ptype = pclass.name.to_sym\n else\n ptype = pclass.spira_resource.name.to_sym\n end \n end\n end\n pname = p.identifier == 'type' ? p.label.downcase.gsub(/[^a-z0-9]/,'_').gsub(/^\\-|\\-$/,'').squeeze('_') : p.identifier.to_sym\n cls.property(pname, :predicate=>p.uri, :type=>ptype) \n end\n self.class.const_set(cls_name, cls)\n end\n self.class.const_get(cls_name)\n end",
"def expect_resource name, value\n expect_type name, value, \"Resource\", lambda{ test_resource value }\n end",
"def resource_class\n case @options[:class]\n when false\n name.to_sym\n when nil\n namespaced_name.to_s.camelize.constantize\n when String\n @options[:class].constantize\n else\n @options[:class]\n end\n end",
"def resource_klass\n resource_klass_name.constantize\n end",
"def resource_type_params\n params.require(:resource_type).permit(:id, :resource_type_general, :resource_type, :resource_id)\n end",
"def resource_klass_name\n resource_name.classify\n end",
"def capitalizeresource(resource)\n res = \"\"\n\n if resource[0] =~ /class/i\n res << \"Class[\"\n res << resource[1].split(/::/).map{|r| r.capitalize}.join(\"::\")\n res << \"]\"\n else\n res << resource[0].capitalize\n res << \"[\" << resource[1] << \"]\"\n end\n\n res\nend",
"def resource_type=(value)\n @resource_type = value\n end",
"def resource_type=(value)\n @resource_type = value\n end",
"def resource_type=(value)\n @resource_type = value\n end",
"def resource_type=(value)\n @resource_type = value\n end",
"def resource_type\n document_type\n end",
"def resource_type\n document_type\n end",
"def set_naming_convention\n repository(:default).adapter.\n resource_naming_convention = lambda do |value|\n underscore(class_basename(value))\n end\n end",
"def name\n type.to_s.capitalize\n end",
"def map_to_orcid_type( resource_type )\n\n case resource_type\n when 'Article'\n return 'journal-article'\n when 'Book'\n return 'book'\n when 'Conference Paper'\n return 'conference-paper'\n when 'Part of Book'\n return 'book-chapter'\n when 'Report'\n return 'report'\n when 'Journal'\n return 'journal-issue'\n when 'Poster'\n return 'conference-poster'\n else\n return 'other'\n end\n\n end",
"def resource_plural() self.class.read_inheritable_attribute(:resource_plural) end",
"def resources(type, path)\n Resources.new(self, path, type)\n end",
"def resource_class\n resource_finder.is_a?(Class) ? resource_finder : resource_finder.name.classify.constantize\n end",
"def api_get_resources(url, page, resource_type, o = {})\n json = api_get_json(url, page, o)\n json.is_a?(Hash) ? resource_type.new(json) : json.map { |r| resource_type.new(r) }\n end",
"def get_from_catalogue(type, name, parameter)\n catalogue.resource(type, name).send(:parameters)[parameter.to_sym]\nend",
"def resource_class\n @resource_class ||= resource_name.classify.constantize\n end",
"def resource_class\n @resource_class ||= resource_name.classify.constantize\n end",
"def resource_class\n @resource_class ||= resource_name.classify.constantize\n end",
"def initialize_resources_class_accessors! #:nodoc:\n # First priority is the namespaced model, e.g. User::Group\n self.resource_class ||= begin\n namespaced_class = self.name.sub(/Controller$/, '').singularize\n namespaced_class.constantize\n rescue NameError\n nil\n end\n\n # Second priority is the top namespace model, e.g. EngineName::Article for EngineName::Admin::ArticlesController\n self.resource_class ||= begin\n namespaced_classes = self.name.sub(/Controller$/, '').split('::')\n namespaced_class = [namespaced_classes.first, namespaced_classes.last].join('::').singularize\n namespaced_class.constantize\n rescue NameError\n nil\n end\n\n # Third priority the camelcased c, i.e. UserGroup\n self.resource_class ||= begin\n camelcased_class = self.name.sub(/Controller$/, '').gsub('::', '').singularize\n camelcased_class.constantize\n rescue NameError\n nil\n end\n\n # Otherwise use the Group class, or fail\n self.resource_class ||= begin\n class_name = self.controller_name.classify\n class_name.constantize\n rescue NameError => e\n raise unless e.message.include?(class_name)\n nil\n end\n\n self.parents_symbols = self.parents_symbols.try(:dup) || []\n\n # Initialize resources configuration hash\n self.resources_configuration = self.resources_configuration.try(:dup) || {}\n self.resources_configuration.each do |key, value|\n next unless value.is_a?(Hash) || value.is_a?(Array)\n self.resources_configuration[key] = value.dup\n end\n\n config = (self.resources_configuration[:self] ||= {})\n config[:collection_name] = self.controller_name.to_sym\n config[:instance_name] = self.controller_name.singularize.to_sym\n\n config[:route_collection_name] = config[:collection_name]\n config[:route_instance_name] = config[:instance_name]\n\n # Deal with namespaced controllers\n namespaces = self.controller_path.split('/')[0..-2]\n\n # Remove namespace if its a mountable engine\n namespaces.delete_if do |namespace|\n begin\n \"#{namespace}/engine\".camelize.constantize.isolated?\n rescue StandardError, LoadError\n false\n end\n end\n\n config[:route_prefix] = namespaces.join('_').to_sym unless namespaces.empty?\n\n # Deal with default request parameters in namespaced controllers, e.g.\n # Forum::Thread#create will properly pick up the request parameter\n # which will be forum_thread, and not thread\n # Additionally make this work orthogonally with instance_name\n config[:request_name] = self.resource_class.to_s.underscore.gsub('/', '_')\n\n # Initialize polymorphic, singleton, scopes and belongs_to parameters\n polymorphic = self.resources_configuration[:polymorphic] || { symbols: [], optional: false }\n polymorphic[:symbols] = polymorphic[:symbols].dup\n self.resources_configuration[:polymorphic] = polymorphic\n end",
"def pre_process_exposed_object(resource, type, singular)\n end",
"def initialize\n @type = self.class.to_s.demodulize.downcase\n end",
"def subclass_resource_equivalents\n @subclass_resource_names ||= [resource_name.to_sym]\n end",
"def resource( rsrcobj, options={} )\n\t\t\tself.log.debug \"Adding REST resource for %p\" % [ rsrcobj ]\n\t\t\toptions = self.service_options.merge( options )\n\t\t\tself.log.warn \"Options = %p\" % [ options ]\n\n\t\t\t# Add a parameter for the primary key\n\t\t\tpkey = rsrcobj.primary_key\n\t\t\tpkey_schema = rsrcobj.db_schema[ pkey.to_sym ] or\n\t\t\t\traise ArgumentError,\n\t\t\t\t\t\"cannot generate services for %p: resource has no schema\" % [ rsrcobj ]\n\t\t\tself.param( pkey, pkey_schema[:type] ) unless\n\t\t\t\tself.paramvalidator.param_names.include?( pkey.to_s )\n\n\t\t\t# Figure out what the resource name is, and make the route from it\n\t\t\tname = options[:name] || rsrcobj.implicit_table_name\n\t\t\troute = [ options[:prefix], name ].compact.join( '/' )\n\t\t\tself.log.warn \"Route is: %p\" % [[ options[:prefix], name ]]\n\n\t\t\t# Make and install handler methods\n\t\t\tself.log.debug \" adding readers\"\n\t\t\tself.add_options_handler( route, rsrcobj, options )\n\t\t\tself.add_read_handler( route, rsrcobj, options )\n\t\t\tself.add_collection_read_handler( route, rsrcobj, options )\n\n\t\t\t# Add handler methods for the mutator parts of the API unless\n\t\t\t# the resource is read-only\n\t\t\tif options[:readonly]\n\t\t\t\tself.log.debug \" skipping mutators (read-only set)\"\n\t\t\telse\n\t\t\t\tself.add_collection_create_handler( route, rsrcobj, options )\n\t\t\t\tself.add_update_handler( route, rsrcobj, options )\n\t\t\t\tself.add_collection_replace_handler( route, rsrcobj, options )\n\t\t\t\tself.add_replace_handler( route, rsrcobj, options )\n\t\t\t\tself.add_collection_deletion_handler( route, rsrcobj, options )\n\t\t\t\tself.add_delete_handler( route, rsrcobj, options )\n\t\t\tend\n\n\t\t\t# Add any composite resources based on the +rsrcobj+'s associations\n\t\t\tself.add_composite_resource_handlers( route, rsrcobj, options ) if options[:composite]\n\t\tend",
"def resource_klass\n @resource_klass ||= resource_name.classify.constantize\n end",
"def resource_class\n resource_specification.klass\n end",
"def method_missing(name, *args, &block)\n if args.empty? and resources and resources.has_resource?(name)\n resources[name]\n else\n super(name, *args, &block)\n end\n end",
"def property_type(**options)\n Property.derive(**options)\n end",
"def getResourceType() \n @obj.getResourceType() \n end",
"def jsonapi_model_type\n\t\t\t\t\tjsonapi_model_class_name.underscore.pluralize.to_sym\n\t\t\t\tend",
"def method_missing(meth, *args, &block)\n @_resource.send(:method_missing, meth, *args, &block)\n end",
"def type(resource_type)\n Cocina::Models::FileSetType.properties[resource_type.to_sym]\n end",
"def create(res_type, config_props = {}, core_props = {}, &block)\n config_props[:type] ||= res_type\n debug \"Create resource of type '#{res_type}'\"\n create_message_and_publish(:create, config_props, core_props, block)\n self\n end",
"def resource_params\n # TODO DANGER!\n params.require(@resource_class.name.underscore.to_sym).permit!\n end",
"def resource_type\n case\n when controller_name.starts_with?('search')\n params[:record_type]\n when is_variable_controller?\n 'variables'\n when is_services_controller?\n 'services'\n when is_tools_controller?\n 'tools'\n else\n # default\n 'collections'\n end\n end",
"def to_resource\n name.underscore.pluralize\n end",
"def resource_class\n @resource_class ||= self.controller_name.singularize.classify.constantize\n end",
"def attribute attr, options = {}\n type = options[:type]\n begin\n type ||= Conjur::PolicyParser::Types.const_get(attr.to_s.capitalize) \n rescue NameError\n end\n type = nil if type == String\n kind = options[:kind] \n kind ||= type.short_name.downcase.to_sym if type\n \n raise \"Attribute :kind must be defined, explicitly or inferred from :type\" unless kind\n \n if options[:singular]\n define_field attr, kind, type, options[:dsl_accessor]\n else\n define_plural_field attr, kind, type, options[:dsl_accessor]\n end\n end",
"def resource_model\n resource = \"#{resource_param}\".constantize\n end",
"def method_missing(sym, *args, &block)\n if (not sym.to_s =~ /\\?$/) and (args.length == 0)\n camel_case = Util.to_camel_case(sym.to_s)\n return self[camel_case] if sc_path_defined?(camel_case) \n end\n super\n end",
"def initialize(client, resource_type, method, params)\n @client = client\n @resource_type = resource_type.to_sym\n @method = method.to_sym\n @params = params\n perform\n end",
"def declare_resource(type, name, created_at=nil, &resource_attrs_block)\n created_at ||= caller[0]\n\n resource = build_resource(type, name, created_at, &resource_attrs_block)\n\n run_context.resource_collection.insert(resource, resource_type: type, instance_name: name)\n resource\n end",
"def resource_type\n \"b\"\n end",
"def jsonapi_type\n controller_name.dasherize\n end",
"def resourceType\n 'DomainResource'\n end"
] |
[
"0.6480117",
"0.6390359",
"0.61742175",
"0.5983105",
"0.58316755",
"0.58135504",
"0.5789066",
"0.57500446",
"0.5738464",
"0.57084864",
"0.5703486",
"0.56794393",
"0.56597924",
"0.5652623",
"0.56136465",
"0.55804104",
"0.5569616",
"0.55457276",
"0.549106",
"0.5489655",
"0.5483889",
"0.54679936",
"0.5463432",
"0.54587525",
"0.54513663",
"0.54457015",
"0.5427088",
"0.5423335",
"0.54222244",
"0.5408964",
"0.53984344",
"0.5387938",
"0.53655803",
"0.5353706",
"0.5342991",
"0.534159",
"0.534159",
"0.534159",
"0.53332984",
"0.5310027",
"0.53083783",
"0.53011936",
"0.5282641",
"0.52807164",
"0.5279176",
"0.5270469",
"0.5267706",
"0.52611965",
"0.5254742",
"0.5240501",
"0.523912",
"0.52371156",
"0.5235311",
"0.5233597",
"0.5232764",
"0.52324307",
"0.52296215",
"0.52292204",
"0.52291894",
"0.52291894",
"0.52291894",
"0.52291894",
"0.5224528",
"0.5224528",
"0.52231264",
"0.5217976",
"0.52164954",
"0.5216226",
"0.5209082",
"0.5202328",
"0.5197435",
"0.51924133",
"0.5183718",
"0.5183718",
"0.5183718",
"0.51823044",
"0.5180317",
"0.5176965",
"0.5176222",
"0.51703244",
"0.5169876",
"0.5164813",
"0.51623887",
"0.5150491",
"0.514936",
"0.51489836",
"0.514881",
"0.51475316",
"0.5146138",
"0.5140335",
"0.5138619",
"0.51383",
"0.5135114",
"0.5130545",
"0.5125689",
"0.512048",
"0.51200587",
"0.51174074",
"0.51037425",
"0.50962776",
"0.5092483"
] |
0.0
|
-1
|
Ensure inherited classes pick up coercions
|
def update_coercions!
return if @coercions_updated
if superclass.respond_to? :property_coercions
@property_coercions = superclass.property_coercions.dup.merge(@property_coercions || {})
end
if superclass.respond_to? :sys_coercions
@sys_coercions = superclass.sys_coercions.dup.merge(@sys_coercions || {})
end
if superclass.respond_to? :fields_coercions
@fields_coercions = superclass.fields_coercions.dup.merge(@fields_coercions || {})
end
@coercions_updated = true
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def coerce(other); end",
"def convert\n raise \"The convert method must be implemented by subclass!\"\n end",
"def strict_value_coercions; end",
"def inherited(klass); end",
"def inherited(klass); end",
"def inherited(subclass); end",
"def inherited(base); end",
"def inherited(subclass)\n super\n subclass.const_set(:TypecastParams, Class.new(self::TypecastParams))\n end",
"def inherited(_sub)\n raise Error, \"cannot subclass #{self}\" unless self == Object\n end",
"def lenient_value_coercions; end",
"def inherited(klass)\n super\n klass.instance_variable_set(:@transforms, transforms.dup)\n klass.instance_variable_set(:@translations_hash, translations_hash.dup)\n end",
"def inherited(subclass)\n super\n\n subclass.serialization.replace serialization\n subclass.fields.replace fields\n end",
"def call(values)\n super.load_typecast\n end",
"def coercible?\n kind_of?(Coercible)\n end",
"def inherited(base) # :nodoc:\n dup = _validators.dup\n base._validators = dup.each { |k, v| dup[k] = v.dup }\n super\n end",
"def inherited(base)\n dup = _cleaners.dup\n base._cleaners = dup.each { |k, v| dup[k] = v.dup }\n super\n end",
"def super_class; end",
"def super_class; end",
"def superclass() end",
"def merge_inheritance\n relation.itself_only_value = true if other.itself_only_value.present?\n\n if other.cast_records_value.present?\n relation.cast_records_value += other.cast_records_value\n relation.cast_records_value.uniq!\n end\n end",
"def superclass=(object); end",
"def subclass_from_attributes(attrs)\n active_authorizer[:default].deny?(inheritance_column) ? nil : super\n end",
"def inherited(subclass)\n super\n subclass.rules.update self.rules\n end",
"def inherited(subclass)\n super\n subclass.instance_variable_set(:@comparison_attrs, comparison_attrs.dup)\n end",
"def ensure_compatible(other)\n\t\t\tif other.respond_to?(:to_tablespoon)\n\t\t\t\tother.to_tablespoon\n\t\t\telse\n\t\t\t\tsuper\n\t\t\tend\n\t\tend",
"def validate_subclasses\n # Validate instance methods\n if not(self.respond_to?(:scrape_article))\n throw Exception.new(\"subclass fails to implement the required scrape method\")\n end\n\n # Validate class methods\n if not(self.class.respond_to?(:source_name))\n throw Exception.new(\"subclass fails to provide source_name\")\n end\n\n end",
"def subclass_from_attrs(attrs)\n active_authorizer[:default].deny?(inheritance_column) ? nil : super\n end",
"def dispatch\n raise(NotImplemetedError, \"subclass responsability\")\n end",
"def inherited(subclass)\n object_alias = subclass.name.demodulize.chomp('Serializer').underscore\n subclass.object_as(object_alias) unless method_defined?(object_alias)\n super\n end",
"def methods(inherited_too=true)\n ensure_apply_object_class\n target_names = @attr_methods.keys + @attr_aliases.keys\n target_names -= ['objectClass', Inflector.underscore('objectClass')]\n super + target_names.uniq.collect do |x|\n [x, \"#{x}=\", \"#{x}?\", \"#{x}_before_type_cast\"]\n end.flatten\n end",
"def base_class; end",
"def inherit_stuff\n return unless accepted_genus\n\n self.classification ||= accepted_genus.classification\n self.lifeform ||= accepted_genus.lifeform\n end",
"def coerce(object)\n self.class.coerce(object)\n end",
"def convert\n raise NotImplementedError\n end",
"def fix_basic_object_inheritance\n basic = classes_hash['BasicObject']\n return unless basic\n basic.superclass = nil\n end",
"def orig_cls\n\t\treturn self.class.orig_cls\n\tend",
"def becomes(klass)\n became = super\n klass.enumerized_attributes.each do |attr|\n # Rescue when column associated to the enum does not exist.\n begin\n became.send(\"#{attr.name}=\", send(attr.name))\n rescue ActiveModel::MissingAttributeError\n end\n end\n\n became\n end",
"def do_conversion!(*args)\n raise NotImplementedError\n end",
"def inherited(child_class)\n HasFields.add_default_resolve_module(child_class)\n super\n end",
"def coerce(other)\n case other\n when Integer\n begin\n return other, Integer(self)\n rescue\n return Float(other), Float(self)\n end\n when Float\n return other, Float(self)\n else\n super\n end\n end",
"def validate_subclasses\n # Validate instance methods\n if not(self.respond_to?(:scrape))\n throw Exception.new('subclass fails to implement the required scrape method')\n end\n end",
"def inherited(subclass)\n super\n opts = {}\n json_serializer_opts.each{|k, v| opts[k] = (v.is_a?(Array) || v.is_a?(Hash)) ? v.dup : v}\n subclass.instance_variable_set(:@json_serializer_opts, opts)\n end",
"def coerce(value)\n @base_class.new(value)\n end",
"def type\n raise 'derived should implement'\n end",
"def key_coercions; end",
"def ensure_proper_type\n unless self.class.descends_from_active_record?\n write_attribute(self.class.inheritance_column, Inflector.demodulize(self.class.name))\n end\n end",
"def coerce(object)\n self.class.coerce(object)\n end",
"def coerce *args\n (@coercion || DEFAULT_COERCION).call(*args)\n end",
"def key_coercions=(_arg0); end",
"def namespace_inheritance; end",
"def namespace_inheritance; end",
"def child_class\n Objekt\n end",
"def wont_be_kind_of(cls, msg=nil)\n KindAssay.refute!(self, cls, :message=>msg, :backtrace=>caller)\n end",
"def be_careful(object, klass, coersion, default)\n object.send(coersion) if object.respond_to?(coersion) # Attempt coercion\n object.is_a?(klass) ? object : default # Return coerced value or default.\n end",
"def inherited(subclass)\n subclass.instance_variable_set(:@opts, opts.dup)\n subclass.opts.each do |key, value|\n if value.is_a?(Enumerable) && !value.frozen?\n subclass.opts[key] = value.dup\n end\n end\n subclass.instance_variable_set(:@storages, storages.dup)\n\n file_class = Class.new(self::UploadedFile)\n file_class.shrine_class = subclass\n subclass.const_set(:UploadedFile, file_class)\n\n attachment_class = Class.new(self::Attachment)\n attachment_class.shrine_class = subclass\n subclass.const_set(:Attachment, attachment_class)\n\n attacher_class = Class.new(self::Attacher)\n attacher_class.shrine_class = subclass\n subclass.const_set(:Attacher, attacher_class)\n end",
"def inherited_meths(opts = T.unsafe(nil)); end",
"def coerce(other)\n if Complex.generic?(other)\n return Complex.new!(other), self\n else\n super\n end\n end",
"def adopt_dependencies\n super if defined? super\n end",
"def inherited(subclass)\n super\n sm = serialization_map.dup\n subclass.instance_eval{@serialization_map = sm}\n end",
"def inherited_constants; end",
"def subclass_validations ; true ; end",
"def type; super; end",
"def valid?\n raise Error::MethodShouldBeOverridenByExtendingClassError\n end",
"def inherit!(deps)\n return unless deps\n\n self.class.nodes.each do |key, factory|\n next unless factory.inheritable?\n\n new_entry = overwrite_entry(deps, key, self[key])\n\n entries[key] = new_entry if new_entry&.specified?\n end\n end",
"def initialize(base, target, association)\n enum = HasMany::Enumerable.new(target, base, association)\n super(base, enum, association) do\n raise_mixed if klass.embedded? && !klass.cyclic?\n end\n end",
"def inherited( subclass )\n\t\t\tsuper\n\n\t\t\tverbs_copy = Strelka::DataUtilities.deep_copy( self.resource_verbs )\n\t\t\tsubclass.instance_variable_set( :@resource_verbs, verbs_copy )\n\n\t\t\topts_copy = Strelka::DataUtilities.deep_copy( self.service_options )\n\t\t\tsubclass.instance_variable_set( :@service_options, opts_copy )\n\t\tend",
"def kind_of?(other)\n super || __getobj__.kind_of?(other)\n end",
"def inherited(subclass)\n super\n subclass.acts_as_cacheable_cache = acts_as_cacheable_cache\n subclass.acts_as_cacheable_time_to_live = acts_as_cacheable_time_to_live\n subclass.acts_as_cacheable_logger = acts_as_cacheable_logger\n end",
"def reify\n model.new(object.select{|k,v| k != inheritance_column})\n end",
"def coerce(value)\n if all? { |enum| enum.respond_to?(:as) }\n by(:as, value)\n else\n super(value)\n end\n end",
"def without_typecast\n dup.without_typecast!\n end",
"def becomes!(klass)\n became = becomes(klass)\n sti_type = nil\n if !klass.descends_from_active_record?\n sti_type = klass.sti_name\n end\n became.public_send(\"#{klass.inheritance_column}=\", sti_type)\n became\n end",
"def validate_subclasses\n # Validate instance methods\n unless self.respond_to?(:create_tags)\n throw Exception.new('subclass fails to implement the required \\\n create_tags method')\n end\n end",
"def overrides; end",
"def inherited(subclass)\n super\n ivs = subclass.instance_variables\n inherited_instance_variables.each do |iv, dup|\n next if ivs.include?(iv)\n if (sup_class_value = instance_variable_get(iv)) && dup\n sup_class_value = case dup\n when :dup\n sup_class_value.dup\n when :hash_dup\n h = {}\n sup_class_value.each{|k,v| h[k] = v.dup}\n h\n when Proc\n dup.call(sup_class_value)\n else\n raise Error, \"bad inherited instance variable type: #{dup.inspect}\"\n end\n end\n subclass.instance_variable_set(iv, sup_class_value)\n end\n\n unless ivs.include?(\"@dataset\")\n if @dataset && self != Model\n subclass.set_dataset(@dataset.clone, :inherited=>true)\n elsif (n = subclass.name) && !n.to_s.empty?\n db\n subclass.set_dataset(subclass.implicit_table_name)\n end\n end\n end",
"def inherited(subclass)\n super\n ivs = subclass.instance_variables.map(&:to_s)\n inherited_instance_variables.each do |iv, dup|\n next if ivs.include?(iv.to_s)\n if (sup_class_value = instance_variable_get(iv)) && dup\n sup_class_value = case dup\n when :dup\n sup_class_value.dup\n when :hash_dup\n h = {}\n sup_class_value.each{|k,v| h[k] = v.dup}\n h\n when Proc\n dup.call(sup_class_value)\n else\n raise Error, \"bad inherited instance variable type: #{dup.inspect}\"\n end\n end\n subclass.instance_variable_set(iv, sup_class_value)\n end\n\n unless ivs.include?(\"@dataset\")\n if @dataset && self != Model\n subclass.set_dataset(@dataset.clone, :inherited=>true)\n elsif (n = subclass.name) && !n.to_s.empty?\n db\n subclass.set_dataset(subclass.implicit_table_name)\n end\n end\n end",
"def resolve\n @super_class = @snapshot.id2class @super_id\n # all classes but java.lang.Object\n @super_class.add_subclass self if @super_class \n @snapshot.java_lang_class.add_instance self\n end",
"def inherited(child)\n super\n child.attribute_names = self.attribute_names ? self.attribute_names.dup : [:id]\n child.reverse_solr_name_cache = self.reverse_solr_name_cache ? self.reverse_solr_name_cache.dup : {}\n child.attribute_cache = self.attribute_cache ? self.attribute_cache.dup : {}\n child.facets = self.facets ? self.facets.dup : []\n child.solr_calc_attributes = self.solr_calc_attributes.present? ? self.solr_calc_attributes.dup : {}\n # child.derived_af_class\n\n # If there's no class between +LockedLdpObject+ and this child that's\n # already had +visibility+ and +owner+ defined, define them.\n child.class_eval do\n unless attribute_names.include?(:visibility)\n has_attribute :visibility, ::VOCABULARY[:jupiter_core].visibility, solrize_for: [:exact_match, :facet]\n end\n unless attribute_names.include?(:owner)\n has_attribute :owner, ::VOCABULARY[:jupiter_core].owner, solrize_for: [:exact_match]\n end\n unless attribute_names.include?(:record_created_at)\n has_attribute :record_created_at, ::VOCABULARY[:jupiter_core].record_created_at, type: :date,\n solrize_for: [:sort]\n end\n end\n end",
"def superclass\n\t\t\t\treturn Object\n\t\t\tend",
"def transform\n raise 'Implement this method in subclass'\n end",
"def inherited(subclass)\n subclass.instance_variable_set(:@__ignore_identities__, @__ignore_identities__.clone)\n subclass.instance_variable_set(:@fields, @fields.clone)\n end",
"def extend_inherited_method\n ActiveRecord::Base.class_eval do\n class << self\n def inherited_with_valle_validators(subclass)\n inherited_without_valle_validators(subclass)\n if (Valle.can_process_model?(subclass.model_name) &&\n self == ActiveRecord::Base &&\n subclass != ActiveRecord::SchemaMigration)\n Valle::Hooks.extend_ar_validations_valid_method(subclass)\n end\n end\n\n alias_method_chain :inherited, :valle_validators\n end\n end\n end",
"def validate_options!(_options)\n raise(NotImplemetedError, \"subclass responsability\")\n end",
"def can_convert?\n klass.is_a?(Class)\n end",
"def load!(options = {})\n raise_mixed if klass.embedded?\n super(options)\n end",
"def validate(vmode=nil)\n # Holding pattern. All models should use super, in principal\n end",
"def implementation\n fail 'Subclasses must implement implementation()!'\n end",
"def original_attributes_before_type_cast\n ensure_original_attributes_stored\n clone_attributes :read_original_attribute_before_type_cast\n end",
"def errors\n raise 'Method should implemented in inherit class'\n end",
"def nested_classes\n super\n end",
"def ordered_subclasses\n [Question, Idea, Problem, Praise]\n end",
"def direct_superclass\n @superclass\n end",
"def direct_superclass\n @superclass\n end",
"def check_class_inherits(class_map, class_lut)\n\t# Check that the superclass isnt a constant\n\tfor ast_class in class_map.classes\n\t\tif ast_class.superclass == \"Int\" ||\n\t\t\tast_class.superclass == \"String\" ||\n\t\t\tast_class.superclass == \"Bool\"\n\t\t\tline_number = ast_class.superclass_line\n\t\t\tmessage = \"class #{ast_class.name} inherits from #{ast_class.superclass}\"\n\t\t\ttype_error(line_number, message)\n\t\tend\n\tend\n\n\t# Check that each super class has a valid type\n\tfor ast_class in class_map.classes\n\t\tif ast_class.superclass != nil\n\t\t\tif not class_lut.include? ast_class.superclass\n\t\t\t\tline_number = ast_class.superclass_line\n\t\t\t\tmessage = \"class #{ast_class.name} inherits from unknown class #{ast_class.superclass}\"\n\t\t\t\ttype_error(line_number, message)\t\t\t\n\t\t\tend\n\t\tend\n\tend\nend",
"def check_class_inherits(class_map, class_lut)\n\t# Check that the superclass isnt a constant\n\tfor ast_class in class_map.classes\n\t\tif ast_class.superclass == \"Int\" ||\n\t\t\tast_class.superclass == \"String\" ||\n\t\t\tast_class.superclass == \"Bool\"\n\t\t\tline_number = ast_class.superclass_line\n\t\t\tmessage = \"class #{ast_class.name} inherits from #{ast_class.superclass}\"\n\t\t\ttype_error(line_number, message)\n\t\tend\n\tend\n\n\t# Check that each super class has a valid type\n\tfor ast_class in class_map.classes\n\t\tif ast_class.superclass != nil\n\t\t\tif not class_lut.include? ast_class.superclass\n\t\t\t\tline_number = ast_class.superclass_line\n\t\t\t\tmessage = \"class #{ast_class.name} inherits from unknown class #{ast_class.superclass}\"\n\t\t\t\ttype_error(line_number, message)\t\t\t\n\t\t\tend\n\t\tend\n\tend\nend",
"def cast_types; end",
"def _subclasses\n @_subclasses ||= []\n end",
"def inherited( subclass )\n\t\t\tsuper\n\t\t\tsubclass.instance_variable_set( :@paramvalidator, self.paramvalidator.dup )\n\t\t\tself.log.debug \"Adding param validator: %p\" % [ self.paramvalidator ]\n\t\tend",
"def run_validations!\n super\n include_typecasting_errors\n errors.empty?\n end",
"def inherited(klass)\n super\n klass.send :include, ::Henshin::Safety\n klass.instance_variable_set(:@unsafe_methods, @unsafe_methods)\n end"
] |
[
"0.65102464",
"0.644977",
"0.6322858",
"0.6184876",
"0.6184876",
"0.6145347",
"0.6097982",
"0.59096855",
"0.5883548",
"0.5812501",
"0.5751588",
"0.5737549",
"0.5687527",
"0.56507003",
"0.56200624",
"0.5611901",
"0.56023496",
"0.56023496",
"0.55925745",
"0.5589005",
"0.5573787",
"0.5573296",
"0.556873",
"0.55485135",
"0.55484074",
"0.5524385",
"0.5502141",
"0.5498321",
"0.5487957",
"0.54499775",
"0.54429",
"0.5433369",
"0.54227036",
"0.54142475",
"0.54073834",
"0.5384033",
"0.53829473",
"0.53808403",
"0.53755087",
"0.533326",
"0.5328368",
"0.53251034",
"0.5309523",
"0.5303466",
"0.52913356",
"0.5272629",
"0.52708775",
"0.5268965",
"0.52644837",
"0.52434987",
"0.52434987",
"0.52379435",
"0.52377623",
"0.52297676",
"0.5223193",
"0.5219266",
"0.5207716",
"0.5207219",
"0.5200929",
"0.52008665",
"0.518065",
"0.51783645",
"0.516521",
"0.513518",
"0.5134244",
"0.5128252",
"0.5123181",
"0.5112289",
"0.51075876",
"0.51071674",
"0.5104564",
"0.5101573",
"0.509963",
"0.5096169",
"0.5095623",
"0.50917506",
"0.50721604",
"0.5070637",
"0.5053895",
"0.5048226",
"0.5046046",
"0.50441927",
"0.5039727",
"0.5037744",
"0.5033831",
"0.5033393",
"0.5029072",
"0.50120723",
"0.5004491",
"0.50042963",
"0.49837762",
"0.49730197",
"0.49730197",
"0.4969882",
"0.4969882",
"0.49612477",
"0.49585032",
"0.49568963",
"0.49555445",
"0.49539396"
] |
0.6694255
|
0
|
Determine stack state based on last operation information
|
def determine_state(operation)
prefix = case operation[:operationType]
when 'insert'
'create'
when 'update'
'update'
when 'delete'
'delete'
end
suffix = case operation[:status]
when 'RUNNING', 'PENDING'
'in_progress'
when 'DONE'
'complete'
end
if(operation[:error])
suffix = 'failed'
end
if(prefix.nil? || suffix.nil?)
:unknown
else
"#{prefix}_#{suffix}".to_sym
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def restore\r\n @status = @stack.shift if @stack.size > 0\r\n end",
"def __stack\n @stack\n end",
"def peek_current_state\n peek_state.last || @current_state\n end",
"def stack_status\n data[:stack_status]\n end",
"def stack\n @stack\n end",
"def poplaststat()\n top = @stack.pop()\n if top and top[0] == :break or top[0] == :return then\n return top\n else\n raise \"poplaststat: not found!\"\n end\nend",
"def clone_state\n if @stack.empty?\n {}\n else\n Marshal.load Marshal.dump(@stack.last)\n end\n end",
"def clone_state\n if @stack.empty?\n {}\n else\n Marshal.load Marshal.dump(@stack.last)\n end\n end",
"def stack; end",
"def stack; end",
"def scan_token(token)\n prev_state = @stack.last\n case token\n when :on_symbeg, :on_symbols_beg, :on_qsymbols_beg\n @stack << true\n when :on_ident, :on_op, :on_const, :on_ivar, :on_cvar, :on_gvar, :on_kw\n if @stack.last # Pop only when it's Symbol\n @stack.pop\n return prev_state\n end\n when :on_tstring_beg\n @stack << false\n when :on_embexpr_beg\n @stack << false\n return prev_state\n when :on_tstring_end # :on_tstring_end may close Symbol\n @stack.pop\n return prev_state\n when :on_embexpr_end\n @stack.pop\n end\n @stack.last\n end",
"def stack_status\n @stack.stack_status\n end",
"def state\n @state.last\n end",
"def state\n @state.last\n end",
"def instr_BUILD(instruction_stack)\n\t\targ = @stack.pop\n\t\t@stack.last[\"__state\"] = arg\n\tend",
"def top()\n @stack[-1]\n end",
"def getStateStackDepth()\n\t\t\treturn @_state_stack.size\n\t\tend",
"def return_stack\n return @state[:fiber][:return_stack]\n end",
"def fresh_state\n if state == :unknown\n current_state\n else\n state\n end\n end",
"def top()\n @stack[-1]\n end",
"def top\n @stack[-1]\n end",
"def cond_stack; end",
"def cond_stack; end",
"def cond_stack; end",
"def getPreviousState()\n\t\t\treturn @_previous_state\n\t\tend",
"def current\n @stack.last\n end",
"def current\n return @stack[-1]\n end",
"def last\n stack.last\n end",
"def top()\n @stack.last\n end",
"def top()\n @stack[-1]\n end",
"def backtrack\n @state = @backtrack_states.pop\n if @verbose\n puts \"log: backtrack to last valid state\"\n end\n end",
"def top()\n is_empty ? \"Stack is empty.\" : @stack[-1]\n end",
"def get_method_for_next_state\n if end_of_layer_stack?\n # check next superclass\n top_of_composition_stack!\n advance_current_class!\n get_method_for_this_state\n else\n if end_of_runtime_layer_superclass_hierarchy?\n advance_runtime_layer!\n get_method_for_this_state\n else\n advance_current_layer!\n get_method_for_this_state\n end\n end\n end",
"def top()\n @stack.last\n end",
"def top()\n @stack.last\n end",
"def peek\n self.stack_var[-1]\n end",
"def stack_top\n\n Lib.lua_gettop(@pointer)\n end",
"def top()\n return self.stack[self.stack.length - 1]\n end",
"def __stack\n @stack ||= []\n end",
"def callstack\n @callstack.dup\n end",
"def top\n @stack.last\n end",
"def last_popped_stack_elem\n @stack[@sp]\n end",
"def top()\n @stack[0]\n end",
"def retrieve_from_stack\n # Pils::log \"We retrieve the next object from the stack. %i\" % @stack.size\n return nil if @stack.nil? || @stack.empty?\n new_state, *state_rest = @stack\n @stack = state_rest\n @syntax = new_state[0]\n @semantics = new_state[1]\n @syntax_position = new_state[2]\n @token_position = new_state[3]\n sync\n # Pils::log \" becomes %i\" % @stack.size\n # @stack.each do |n|\n # Pils::log \" -- %2i %2i %s\" % [n[2], n[3], n[0].display]\n # end\n end",
"def final_state\n aasm.states.last.name\n end",
"def state_op\n case @scanner\n when RPAREN\n while not LPAREN === @opstack[-1]\n raise \"Mismatched parens\" if @opstack.empty?\n @outarr << OpValMap[@opstack.pop]\n end\n @opstack.pop\n :state_op\n when OP\n op = @scanner.matched\n while is_lower(@opstack[-1], op)\n @outarr << OpValMap[@opstack.pop]\n end\n @opstack << op\n :state_int\n else\n # I would handle this with an EOS token, but unfortunately\n # StringScanner is broken w.r.t. @scanner.scan(/$/)\n :state_end if @scanner.eos?\n end\n end",
"def last()\n @VAR_STACK.last()\n end",
"def stack_current_size()\n if(@stack == nil)\n return 0\n end\n return @stack.length\n end",
"def status\n last_operation = operations.last\n last_operation ? last_operation.status : 'out'\n end",
"def peek\n @stack.last\n end",
"def state\n @current_state\n end",
"def take_from_stack\n stack.pop\n end",
"def state()\n info[:state]\n end",
"def stackEval(cmdStack, resStack, memState)\n # cmdStack => the command stack implemented using a list\n # resStack => the results stack implemented using a list\n # memState => the memory state implemented using a block. Will contain a map for variable names and their integers\n\n # create a map to convert vals in resStack to actual operators\n # stack will be an array where elements are added to front and removed from front\n i = 0\n while true do\n if cmdStack.length == 0\n break\n end\n if cmdStack[0].is_a?(GCConst)\n #puts \"const\"\n #puts cmdStack[0].value\n # add constants from control stack to results stack\n resStack.unshift(cmdStack[0].value) # puts the value from cmdStack[i] into the start of resStack\n cmdStack = cmdStack.drop(1) # remove top value (index 0) from command stack\n i += 1\n elsif cmdStack[0].is_a?(GCTrue)\n # add booleans from control stack to results stack\n resStack.unshift(cmdStack[0].value) # puts the value from cmdStack[i] into the start of resStack\n cmdStack = cmdStack.drop(1)\n i += 1 \n elsif cmdStack[0].is_a?(GCFalse)\n # add booleans from control stack to results stack\n resStack.unshift(cmdStack[0].value) # puts the value from cmdStack[i] into the start of resStack\n cmdStack = cmdStack.drop(1)\n i += 1\n elsif cmdStack[0].is_a?(GCOp)\n #puts \"op\"\n a = cmdStack[0]\n cmdStack = cmdStack.drop(1) \n cmdStack.unshift(a.op) #add operator to the stack\n cmdStack.unshift(a.e2) # add second expr to cmdStack\n cmdStack.unshift(a.e1) # add first expr to cmdStack\n i += 1\n\n # binary operators on cmd stack\n elsif cmdStack[0] == :plus\n b = resStack[0] # get first value from resStack. This will be the second expr in the operator statement\n resStack = resStack.drop(1)\n a = resStack[0] # get next value from resStack. This will be the first expr in the operator statement\n resStack = resStack.drop(1)\n resStack.unshift(a + b) #apply operator and put it back on resStack\n cmdStack = cmdStack.drop(1)\n i += 1\n elsif cmdStack[0] == :minus\n b = resStack[0]\n resStack = resStack.drop(1)\n a = resStack[0]\n resStack = resStack.drop(1)\n resStack.unshift(a - b)\n cmdStack = cmdStack.drop(1)\n i += 1\n elsif cmdStack[0] == :times\n b = resStack[0]\n resStack = resStack.drop(1)\n a = resStack[0]\n resStack = resStack.drop(1)\n resStack.unshift(a * b)\n cmdStack = cmdStack.drop(1)\n i += 1\n elsif cmdStack[0] == :div\n b = resStack[0]\n resStack = resStack.drop(1)\n a = resStack[0]\n resStack = resStack.drop(1)\n resStack.unshift(a / b)\n cmdStack = cmdStack.drop(1)\n i += 1\n\n # variable\n elsif cmdStack[0].is_a?(GCVar)\n # apply memoryState function to variable and add to resultStack\n\n x = memState.call(cmdStack[0].value)\n #puts \"var\"\n #puts x\n resStack.unshift(memState.call(cmdStack[0].value))\n # remove GCVar from commandstack\n cmdStack = cmdStack.drop(1)\n i += 1\n\n # Test compare\n elsif cmdStack[0].is_a?(GCComp)\n #puts \"comp\"\n a = cmdStack[0]\n cmdStack = cmdStack.drop(1)\n cmdStack.unshift(a.op) #add operator to the stack\n cmdStack.unshift(a.e2) # add second expr to cmdStack\n cmdStack.unshift(a.e1) # add first expr to cmdStack\n i += 1 \n\n # less\n elsif cmdStack[0] == :less\n #puts \"less\"\n a = resStack[1]\n b = resStack[0]\n resStack = resStack.drop(2)\n resStack.unshift(a < b)\n cmdStack = cmdStack.drop(1)\n\n # greater\n elsif cmdStack[0] == :greater\n a = resStack[1]\n b = resStack[0]\n #puts \"greater\"\n resStack = resStack.drop(2)\n resStack.unshift(a > b)\n cmdStack = cmdStack.drop(1)\n\n # eq\n elsif cmdStack[0] == :eq\n a = resStack[0]\n b = resStack[1]\n resStack = resStack.drop(2)\n resStack.unshift(a == b)\n cmdStack = cmdStack.drop(1)\n\n elsif cmdStack[0].is_a?(GCAnd)\n #puts \"and gc\"\n a = cmdStack[0]\n cmdStack = cmdStack.drop(1)\n cmdStack.unshift(\"and\")\n cmdStack.unshift(a.t2)\n cmdStack.unshift(a.t1)\n\n elsif cmdStack[0] == \"and\"\n a = resStack[0]\n b = resStack[1]\n #puts a&b\n resStack = resStack.drop(2)\n cmdStack = cmdStack.drop(1)\n resStack.unshift(a & b)\n\n elsif cmdStack[0].is_a?(GCOr)\n a = cmdStack[0]\n cmdStack = cmdStack.drop(1)\n cmdStack.unshift(\"or\")\n cmdStack.unshift(a.t2)\n cmdStack.unshift(a.t1)\n\n elsif cmdStack[0] == \"or\"\n a = resStack[0]\n b = resStack[1]\n resStack = resStack.drop(2)\n cmdStack.drop(1)\n resStack.unshift(a | b)\n\n\n\n # skip\n elsif cmdStack[0].is_a?(GCSkip)\n # no changes to result stack or memState\n cmdStack = cmdStack.drop(1)\n break\n i += 1\n\n # variable assignment\n elsif cmdStack[0].is_a?(GCAssign)\n # add to memState the new variable substitution \n #puts \"assign\"\n a = cmdStack[0]\n cmdStack = cmdStack.drop(1) # remove GCAssign from cmdstack\n cmdStack.unshift(a.s) # add symbol to be assigned\n cmdStack.unshift(\"assign\") # add assign statement\n cmdStack.unshift(a.e) # add expression to be evaluated\n i += 1\n \n #assignment operator\n # command stack [\"assign\",symbol,...]\n # res stack [const,...]\n elsif cmdStack[0] == \"assign\"\n memState = updateState(memState, cmdStack[1], resStack[0])\n cmdStack = cmdStack.drop(2) # remove assign and symbol\n resStack = resStack.drop(1) # remove constant \n i += 1\n\n # compose\n elsif cmdStack[0].is_a?(GCCompose)\n #puts \"compose\"\n a = cmdStack[0]\n cmdStack = cmdStack.drop(1) # remove GCCompose from command stack\n cmdStack.unshift(a.st2) # add 2nd statement to be evaluated\n cmdStack.unshift(a.st1) # add first statement to be evaluated\n i += 1\n\n # if statement breakdown\n elsif cmdStack[0].is_a?(GCIf)\n p = cmdStack[0] # top element from stack. Should be of type GCIf\n cmdStack = cmdStack.drop(1) #remove GCIf from cmdStack\n l = p.pairlist # get list from GCIf\n if l.length == 0\n cmdStack.unshift(GCSkip.new())\n else\n randval = rand(l.length) # get random value \n pair = l[randval]\n l.delete_at(randval) # remove statement from index randval\n \n # re-add broken down GCIf to command stakc\n cmdStack.unshift(GCIf.new(l)) # add remaining statements\n cmdStack.unshift(pair[1]) # add statement \n cmdStack.unshift(\"if\") # add if\n cmdStack.unshift(pair[0]) # add boolean guard\n i += 1\n end\n elsif cmdStack[0] == \"if\"\n b = resStack[0] # get the boolean that would have been evaluated from result stack\n if b == true \n s1 = cmdStack[1] # get the statement to be executed\n cmdStack = cmdStack.drop(3) # remove the if, s1 and remaining GCIf block \n resStack = resStack.drop(1) # remove that boolean check\n cmdStack.unshift(s1) #place the s1 value back on command stack\n else \n cmdStack = cmdStack.drop(2) # remove \"if\" and s1. The top element on stack should now be the remaining GCIf statements \n resStack = resStack.drop(1) # remove the boolean \n end\n\n # while loop\n # logic: get random statement from list and place it at top of command stack\n # check if the guard is true. If so then do that statement and repeat\n # if false, can either find another statement or do nothing\n # in this implementation, I will do nothing in the false case\n elsif cmdStack[0].is_a?(GCDo)\n #puts \"do\"\n w = cmdStack[0] # get Do statement off command stack\n #cmdStack = cmdStack.drop(1) # remove statement\n #cmdStack.unshift(GCDo.new(w.pairlist)) \n if w.pairlist.length == 0 # if no pairs, do nothing\n cmdStack.unshift(GCSkip.new())\n else\n randval = rand(w.pairlist.length) # get random value\n pair = w.pairlist[randval] # get random pair\n cmdStack = cmdStack.drop(1) # remove GCDo\n cmdStack.unshift(pair[1]) # add statement\n cmdStack.unshift(pair[0]) # add boolean check\n cmdStack.unshift(\"while\")\n cmdStack.unshift(pair[0]) # condition\n i += 1\n # command stack should look like [guard, \"while\", guard, statement, ...]\n end\n elsif cmdStack[0] == \"while\"\n # command stack will be in form [\"while\", guard, statement, ...]\n # resStack will be in form [true/false, ...]\n b = resStack[0] # check evaluated condition\n g = cmdStack[1] # guard\n s = cmdStack[2] # statement \n if b == true\n cmdStack.unshift(g) # place guard to front of stack\n cmdStack.unshift(s) # place statement to front of stack to be evaluated\n resStack = resStack.drop(1) # remove previously evaluated condition\n # new command stack will be in form [statement, guard, \"while\", guard, statement]\n else\n #puts \"while guard was false\"\n cmdStack.drop(3) #remove while, guard and statement from command stack\n cmdStack.unshift(GCSkip.new()) #end loop\n resStack = resStack.drop(1) # remove previously computed bool\n i += 1\n end\n else \n puts \"Invalid input\"\n break\n end\n end\n return memState \n\n end",
"def stack\n @values.fetch('stack') { \n @values['stack'] = nil\n }\n end",
"def current\n @stack.last\n end",
"def popState()\n\t\t\tif @_state_stack.empty? then\n\t\t\t\tif @_debug_flag then\n\t\t\t\t\t@_debug_stream.puts \"POPPING ON EMPTY STATE STACK.\\n\"\n\t\t\t\tend\n\t\t\t\traise \"empty state stack.\\n\"\n\t\t\telse\n\t\t\t\t@_state = @_state_stack.pop\n\t\t\t\tif @_debug_flag then\n\t\t\t\t\t@_debug_stream.puts \"POP TO STATE : %s\\n\" % @_state.getName\n\t\t\t\tend\n\t\t\tend\n\t\tend",
"def state\n info[:state]\n end",
"def states\n peek_state\n if !@state_queue.empty?\n @current_state = @state_queue.last\n @state_queue,old = [],@state_queue\n old\n else\n []\n end\n end",
"def top()\n @stack.empty? ? nil : @stack.last\n end",
"def evaluate_special_state(state)\n \n if state[:special_tok] == 'pop' || state[:special_tok] == 'push'\n raise EvalError.new(\"pop and push cannot be indirect.\") if indirect?\n raise EvalError.new(\"pop and push do not accept offsets.\") if state[:accum]\n if (state[:special_tok] == 'pop' && @position != 1) || (state[:special_tok] == 'push' && @position != 0)\n raise EvalError.new(\"pop or push used in wrong position.\")\n end\n state[:mode] = VALUES['push']\n return state\n end\n \n case state[:special_tok]\n when 'sp'\n if state[:accum] && indirect?\n state[:mode] = VALUES['pick']\n state[:offset] = state[:accum]\n elsif indirect?\n state[:mode] = VALUES['peek']\n else\n state[:mode] = VALUES['sp']\n end\n when 'pc'\n raise EvalError.new(\"Only direct addressing with no offset is supported for pc.\") if (indirect? || state[:accum])\n state[:mode] = VALUES['pc']\n when 'ex'\n raise EvalError.new(\"Only direct addressing with no offset is supported for ex.\") if (indirect? || state[:accum])\n state[:mode] = VALUES['ex']\n end\n \n state\n end",
"def stack\n return (@stack&.stack || [])\n end",
"def get_state() [ indent_depth, folding_depth ] end",
"def load_stack\n $LOAD_STACK\n end",
"def peek\n @stack[0]\n end",
"def peek_stack\n @array_list[@array_list.length.to_i - 1]\n end",
"def C_GetOperationState\n @pk.C_GetOperationState(@sess)\n end",
"def apply( stack )\n\t\traise Pushdown::TransitionError, \"can't pop from an empty stack\" if stack.empty?\n\t\traise Pushdown::TransitionError, \"can't pop the only state on the stack\" if stack.length == 1\n\n\t\tself.log.debug \"popping a state\"\n\t\t@popped_state = stack.pop\n\t\t@popped_state.on_stop\n\t\tstack.last.on_resume\n\n\t\treturn stack\n\tend",
"def cur\n\t\t@stack[-1]\n\tend",
"def current\n return nil if @stack.empty?\n @stack.top[1] == 1 ? @stack.top[0].value1 : @stack.top[0].value2\n end",
"def parsed_stack\n @values.fetch('parsedStack') { \n @values['parsedStack'] = []\n }\n end",
"def pop_state\n @state.pop\n end",
"def to_stack; end",
"def top()\n is_empty ? \"Stack is empty.\" : @head.value\n end",
"def value\n \t@calc_stack[-1]\n end",
"def current_transaction_stack\n @current_transaction_stack ||= []\n end",
"def state(return_current = true)\n peek_state\n if @state_queue.empty?\n @current_state\n elsif return_current\n @current_state = @state_queue.last\n @state_queue.clear\n else\n @current_state = @state_queue.shift\n end\n @current_state\n end",
"def pop_state\t\n\t\t\t@state_buffer = Proc.new do\n\t\t\t\t@objs2 = []\n\t\t\t\t@current_state = @states.pop\n\t\t\tend\n\t\tend",
"def workingHypothesis()\n\t\treturn @stack.last\n\tend",
"def has_next_state?\n return @operation != :nop\n end",
"def stack_top\n if @sp.zero?\n nil\n else\n @stack[@sp - 1]\n end\n end",
"def state2\n if current_tk.tag == :OPERATOR then\n if @op.size == 0 then\n @op.push current_tk.value\n elsif priority(current_tk.value) >= priority(@op.last)\n @op.push current_tk.value\n elsif priority(current_tk.value) < priority(@op.last)\n make_op\n @op.push current_tk.value\n end\n else\n @error = true\n end\n return :state0_1\n end",
"def execState\n findNextState\n current_state = @state_list[@state][@transition]\n\n @transition = eval \"#{@state}\"\n @history.push @state\n\n @finished = @state == :finish\n end",
"def tb_state; @tb_state; end",
"def print_state(machine)\n puts \"[#{machine[:stack]}, #{machine[:register]}]\"\nend",
"def state\n @state\n end",
"def current_frame\n @callstack.top\n end",
"def evaluate call_stack_bindings\n case action\n when :CAPTURE\n evaluate_snapshot_point call_stack_bindings\n when :LOG\n evaluate_logpoint call_stack_bindings[0]\n end\n end",
"def stack_top\n self # okay maybe I'll implement this\n end",
"def current_state\n begin\n self.state = ContainerControl::Commands::State.run!(self).state\n rescue ContainerControl::Error\n self.state = :error\n end\n end",
"def get_stack_select\n stacks = Deployinator.get_stacks\n output = Array.new\n stacks.each do |s|\n current = stack == s\n output << { \"stack\" => s, \"current\" => current }\n end\n output\n end",
"def current_state\n\t # Started and not finished\n\t if running? \n\t\tif respond_to?(\"state_machine\")\n # state_machine.status # => String\n # state_machine.status_name # => Symbol\n\t\t return state_machine.status_name\n\t\telse\n\t\t return :running\n\t\tend\n\t end\n\t\n\t # True, when task has never been started\n\t if pending? \n\t\treturn :pending \n elsif failed_to_start? \n\t\treturn :failed_to_start\n elsif starting?\n\t return :starting\n\t # True, when terminal event is pending\n elsif finishing? \n\t return :finishing\n\t # Terminated with success or failure\n elsif success? \n\t return :succeeded\n elsif failed? \n\t return :failed \n\t end\n\tend",
"def last_operation_path\n last_operation['path']\n end",
"def stackPrecedence(operator)\n @operaters[operator][:stack_prec]\n end",
"def peek()\n @stack.peek\n end",
"def status\n @command_history.last\n end",
"def state\n data[:state]\n end",
"def apply( stack )\n\t\traise Pushdown::TransitionError, \"can't switch on an empty stack\" if stack.empty?\n\n\t\tstate = self.state_class.new( self.data )\n\n\t\tself.log.debug \"switching current state with a new state: %p\" % [ state ]\n\t\told_state = stack.pop\n\t\told_state.on_stop if old_state\n\n\t\tstack.push( state )\n\t\tstate.on_start\n\n\t\treturn stack\n\tend",
"def restore()\n state = @stack.pop()\n @angle = state[0]\n @pos = state[1]\n @down = state[2] \n end",
"def known_states; end"
] |
[
"0.6681733",
"0.6413173",
"0.6393771",
"0.6384595",
"0.6365936",
"0.6310897",
"0.6307616",
"0.6307616",
"0.6288879",
"0.6288879",
"0.6230169",
"0.6177825",
"0.6147348",
"0.6147348",
"0.6145721",
"0.61402655",
"0.61260456",
"0.610707",
"0.6079533",
"0.6071195",
"0.6063665",
"0.6062319",
"0.6062319",
"0.6062319",
"0.6048709",
"0.6044862",
"0.603986",
"0.6020204",
"0.60184",
"0.60057",
"0.59828824",
"0.5982538",
"0.5969996",
"0.5969467",
"0.5969467",
"0.5966879",
"0.5963085",
"0.59582263",
"0.59562486",
"0.5944709",
"0.5937872",
"0.5929872",
"0.59022325",
"0.58971536",
"0.5891537",
"0.5891465",
"0.5884495",
"0.58602184",
"0.5856716",
"0.584352",
"0.5837587",
"0.58258206",
"0.58199847",
"0.5810006",
"0.57837313",
"0.5772161",
"0.5762472",
"0.5762089",
"0.5756586",
"0.57490003",
"0.5719142",
"0.57177424",
"0.571332",
"0.57119673",
"0.5691565",
"0.5691021",
"0.5689548",
"0.56894624",
"0.56750846",
"0.56721133",
"0.56700915",
"0.5669689",
"0.56389844",
"0.5611415",
"0.5611326",
"0.56022656",
"0.55994284",
"0.5590292",
"0.5559859",
"0.55514956",
"0.5544343",
"0.55417025",
"0.55389196",
"0.55208415",
"0.55179423",
"0.5517619",
"0.5509235",
"0.549944",
"0.5493498",
"0.5492473",
"0.5492086",
"0.5490073",
"0.5481395",
"0.5479047",
"0.54715353",
"0.54642594",
"0.54581684",
"0.5457296",
"0.54569185",
"0.5442381"
] |
0.5721521
|
60
|
Create stack data hash from information
|
def basic_stack_data_format(info)
info = info.to_smash
Smash.new(
:id => info[:id],
:created => Time.parse(info[:insertTime]),
:updated => Time.parse(info.fetch(:operation, :endTime, info.fetch(:operation, :startTime, info[:insertTime]))),
:description => info[:description],
:name => info[:name],
:state => determine_state(info.fetch(:operation, {})),
:status => determine_state(info.fetch(:operation, {})).to_s.split('_').map(&:capitalize).join(' '),
:custom => info
)
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def to_hash\n stack.inject { |h, layer| Util.deep_merge h, layer }\n end",
"def hash\n [domain, message, stack, type].hash\n end",
"def hash_stacks(arr)\n return Hash[arr.map { |x| [x.stack_name, x] }]\n end",
"def hash\n shasum.hash\n end",
"def hash\n shasum.hash\n end",
"def hash\n shasum.hash\n end",
"def hash\n raw = [name, type, values.join('/')].join(' ')\n Digest::MD5.hexdigest(raw)\n end",
"def create_hash\n require 'digest/md5'\n digest_string = [self.id, self.url, self.referrer, self.created_at].join(\"\")\n self.record_hash = Digest::MD5.hexdigest(digest_string)\n end",
"def stack_push_hash(h)\n\n Lib.lua_createtable(@pointer, 0, h.size)\n # since we already know the size of the table...\n\n h.each do |k, v|\n stack_push(k)\n stack_push(v)\n Lib.lua_settable(@pointer, -3)\n end\n end",
"def hash\n [author_email, author_name, author_time, branch, commit_time, committer_email, committer_name, default_branch, message, repository_url, sha, tag].hash\n end",
"def create_shadowhashdata(label, data)\n plist = NSMutableDictionary.new\n plist[label] = data\n NSPropertyListSerialization.objc_send(\n :dataFromPropertyList, plist,\n :format, NSPropertyListBinaryFormat_v1_0,\n :errorDescription, nil\n )\n end",
"def hash\n [ data, type ].hash\n end",
"def hash\n [_hash, name, owner].hash\n end",
"def hash\n data.hash\n end",
"def hash() end",
"def hash() end",
"def hash() end",
"def hash() end",
"def hash() end",
"def hash() end",
"def hash() end",
"def build_hash data\n digest = OpenSSL::Digest::Digest.new('md5')\n OpenSSL::HMAC.hexdigest(digest, @project_secret, data)\n end",
"def build_struct_tree data\n data.to_hashugar\n end",
"def createSHAHash(data)\n\t\treturn Digest::SHA1.digest(data)\n\tend",
"def build_initial_hash\n new_hash = {}\n\n # Release context\n release_context = Contexts::Release.from_env\n if release_context\n add_to!(new_hash, release_context)\n end\n\n # System context\n hostname = Socket.gethostname\n pid = Process.pid\n system_context = Contexts::System.new(hostname: hostname, pid: pid)\n add_to!(new_hash, system_context)\n\n # Runtime context\n thread_object_id = Thread.current.object_id\n runtime_context = Contexts::Runtime.new(vm_pid: thread_object_id)\n add_to!(new_hash, runtime_context)\n\n new_hash\n end",
"def hash\n ([graph_name] + operands).hash\n end",
"def hash_template\n template = {}\n \n info.each do | key, value |\n template[key] = generate_structure( value )\n end\n \n template\n end",
"def hash\n { hash: @hash, hashType: @hash_type }\n end",
"def get_hash(machines)\n branch = get_branch_id\n hash = Digest::SHA1.hexdigest(machines.sort.join)\n \"#{branch}__#{hash}\"\n end",
"def calculate_hash!\n prefix = PREFIX_NAME_LOOKUP[self.type]\n # add special cases for refs\n self.hash_id = NodeId.sha1(\"#{prefix} #{self.size}\\0#{self.content}\")\n end",
"def hash\n hash_args.hash\n end",
"def generate_info_hash\n @info_hash = Hash[\n *instance_variables.map { |var|\n [var[1..-1].to_sym, instance_variable_get(var)] if var != '@content_data' && var != '@header_data'\n }.compact.flatten\n ]\n end",
"def generate_info_hash\n @info_hash = Hash[\n *instance_variables.map { |var|\n [var[1..-1], instance_variable_get(var)] if var != '@content_data' && var != '@header_data'\n }.compact.flatten\n ]\n end",
"def hash; end",
"def hash; end",
"def hash; end",
"def hash; end",
"def hash; end",
"def hash; end",
"def hash; end",
"def hash; end",
"def hash; end",
"def hash; end",
"def initialize\n @info = Array.new(STACK_SIZE)\n @index = 0\n end",
"def parse_hash_packet(data)\n hashes = []\n\n algo = data.read_string\n size = case algo\n when \"md5\" then 128\n when \"sha256\" then 256\n when \"sha384\" then 284\n when \"sha512\" then 512\n else raise NotImplementedError, \"unsupported algorithm: #{algo}\"\n end\n\n while !data.eof? do\n hashes << data.read(size)\n end\n\n { :algo => algo, :hashes => hashes }\n end",
"def to_h\n {\n data: data,\n nonce: nonce,\n time: time,\n hash: hash,\n index: index,\n prev_hash: prev_hash\n }\n end",
"def to_hash\n @hash ||= hash_from_payload(to_payload)\n {\n 'hash' => @hash, 'ver' => @ver,\n 'vin_sz' => @in.size, 'vout_sz' => @out.size,\n 'lock_time' => @lock_time, 'size' => (@payload ||= to_payload).bytesize,\n 'in' => @in.map.with_index{|i,idx|\n t = { 'prev_out' => { 'hash' => hth(i.prev_out), 'n' => i.prev_out_index } }\n unless (idx == 0) && i.coinbase?\n t['scriptSig'] = Bitcoin::Script.new(i.script_sig).to_string\n t['sequence'] = i.sequence.unpack(\"I\")[0] unless i.sequence == \"\\xff\\xff\\xff\\xff\"\n else # coinbase tx\n t['coinbase'] = i.script_sig.unpack(\"H*\")[0]\n end\n t\n },\n 'out' => @out.map{|o|{\n 'value' => \"%.8f\" % (o.value / 100000000.0),\n 'scriptPubKey' => Bitcoin::Script.new(o.pk_script).to_string\n }}\n }\n end",
"def to_h\n @hash ||= {name:name, depth:depth}\n end",
"def generate_hash\n @groups.flatten.inject([]) {|hash, stone| hash << stone.to_s}.sort.hash\n end",
"def create_hashes\n cloud Mash.new\n cloud[:public_ip] = Hash.new\n cloud[:private_ip] = Hash.new\nend",
"def hash\n [name, args].hash\n end",
"def key_for(data)\n data.hash\n end",
"def stacks(arg)\n ya_ta = tuc(\"x_ya\")\n ra_ta = tuc(\"x_ra\")\n la_ta = tuc(\"x_la\")\n wa_ta = tuc(\"x_wa\")\n\n ra_go = tuc(\"ra_x\")\n la_go = tuc(\"la\")\n sa_go = tuc(\"sa\")\n\n h = Hash.[](\n # subscript YA\n \"ky\"=>tuc(\"ka\")+ya_ta, \"khy\"=>tuc(\"kha\")+ya_ta, \"gy\"=>tuc(\"ga\")+ya_ta,\n \"py\"=>tuc(\"pa\")+ya_ta, \"phy\"=>tuc(\"pha\")+ya_ta, \"by\"=>tuc(\"ba\")+ya_ta, \"my\"=>tuc(\"ma\")+ya_ta,\n # subscript RA\n \"kr\"=>tuc(\"ka\")+ra_ta, \"khr\"=>tuc(\"kha\")+ra_ta, \"gr\"=>tuc(\"ga\")+ra_ta,\n \"tr\"=>tuc(\"ta\")+ra_ta, \"thr\"=>tuc(\"tha\")+ra_ta, \"dr\"=>tuc(\"da\")+ra_ta,\n \"pr\"=>tuc(\"pa\")+ra_ta, \"phr\"=>tuc(\"pha\")+ra_ta, \"br\"=>tuc(\"ba\")+ra_ta, \"mr\"=>tuc(\"ma\")+ra_ta,\n \"shr\"=>tuc(\"sha\")+ra_ta, \"sr\"=>tuc(\"sa\")+ra_ta, \"hr\"=>tuc(\"ha\")+ra_ta,\n # subscript LA\n \"kl\"=>tuc(\"ka\")+la_ta, \"gl\"=>tuc(\"ga\")+la_ta, \"bl\"=>tuc(\"ba\")+la_ta,\n \"zl\"=>tuc(\"za\")+la_ta, \"rl\"=>tuc(\"ra\")+la_ta, \"sl\"=>tuc(\"sa\")+la_ta,\n # subscript WA\n \"kw\"=>tuc(\"ka\")+wa_ta, \"khw\"=>tuc(\"kha\")+wa_ta, \"gw\"=>tuc(\"ga\")+wa_ta, \"grw\"=>tuc(\"ga\")+ra_ta+wa_ta,\n \"cw\"=>tuc(\"ca\")+wa_ta, \"nyw\"=>tuc(\"nya\")+wa_ta, \"tw\"=>tuc(\"ta\")+wa_ta,\n \"dw\"=>tuc(\"da\")+wa_ta, \"tsw\"=>tuc(\"tsa\")+wa_ta, \"tshw\"=>tuc(\"tsha\")+wa_ta,\n \"zhw\"=>tuc(\"zha\")+wa_ta, \"zw\"=>tuc(\"za\")+wa_ta, \"rw\"=>tuc(\"ra\")+wa_ta,\n \"lw\"=>tuc(\"la\")+wa_ta, \"shw\"=>tuc(\"sha\")+wa_ta, \"sw\"=>tuc(\"sa\")+wa_ta, \"hw\"=>tuc(\"ha\")+wa_ta,\n # subscript 'A\n \"t'\"=>tuc(\"ta\")+tuc(\"x_'a\"),\n # superscript RA\n \"rk\"=>ra_go+tuc(\"x_ka\"), \"rg\"=>ra_go+tuc(\"x_ga\"), \"rng\"=>ra_go+tuc(\"x_nga\"), \"rj\"=>ra_go+tuc(\"x_ja\"),\n \"rny\"=>ra_go+tuc(\"x_nya\"), \"rt\"=>ra_go+tuc(\"x_ta\"), \"rd\"=>ra_go+tuc(\"x_da\"), \"rn\"=>ra_go+tuc(\"x_na\"), \"rm\"=>ra_go+tuc(\"x_ma\"),\n \"rb\"=>ra_go+tuc(\"x_ba\"), \"rts\"=>ra_go+tuc(\"x_tsa\"), \"rdz\"=>ra_go+tuc(\"x_dza\"),\n # superscript LA\n \"lk\"=>la_go+tuc(\"x_ka\"), \"lg\"=>la_go+tuc(\"x_ga\"), \"lng\"=>la_go+tuc(\"x_nga\"), \"lc\"=>la_go+tuc(\"x_ca\"),\n \"lj\"=>la_go+tuc(\"x_ja\"), \"lt\"=>la_go+tuc(\"x_ta\"), \"ld\"=>la_go+tuc(\"x_da\"), \"lp\"=>la_go+tuc(\"x_pa\"),\n \"lb\"=>la_go+tuc(\"x_ba\"), \"lh\"=>la_go+tuc(\"x_ha\"),\n # superscript SA\n \"sk\"=>sa_go+tuc(\"x_ka\"), \"sg\"=>sa_go+tuc(\"x_ga\"), \"sng\"=>sa_go+tuc(\"x_nga\"), \"sny\"=>sa_go+tuc(\"x_nya\"),\n \"st\"=>sa_go+tuc(\"x_ta\"), \"sd\"=>sa_go+tuc(\"x_da\"), \"sn\"=>sa_go+tuc(\"x_na\"), \"sp\"=>sa_go+tuc(\"x_pa\"),\n \"sb\"=>sa_go+tuc(\"x_ba\"), \"sm\"=>sa_go+tuc(\"x_ma\"), \"sts\"=>sa_go+tuc(\"x_tsa\"))\n h[arg]\n end",
"def hash\n @hash ||= @trace_id.hash ^ @is_new.hash ^ @span_id.hash ^\n @sampled.hash ^ @capture_stack.hash\n end",
"def hash\n @data.dup.concat([@ts]).hash\n end",
"def hash\n [sequence_number, corporate_number, process, correct, update_date, change_date, name, name_image_id, kind, prefecture_name, city_name, street_number, address_image_id, prefecture_code, city_code, post_code, address_outside, address_outside_image_id, close_date, close_cause, successor_corporate_number, change_cause, assignment_date, latest, en_name, en_prefecture_name, en_city_name, en_address_outside, furigana, hihyoji].hash\n end",
"def hash\n swap\n scatter\n completed_string\n end",
"def hash\n [height, id, is_mobile, name, width].hash\n end",
"def hash\n end",
"def hash\n end",
"def hash\n end",
"def stack_id\n data[:stack_id]\n end",
"def git_checksum_hash(tree, prefix=nil)\n\n tree.contents.each do |obj|\n if obj.class == Grit::Blob\n item = [prefix, obj.name].join\n @currenthash[item] = Digest::MD5.hexdigest(obj.data)\n #puts \"#{item} : \" + @currenthash[item]\n else\n git_checksum_hash(obj, [prefix, obj.name, \"/\"].join)\n end\n end\n\n return @currenthash\n end",
"def hash\n state.hash\n end",
"def hash\n state.hash\n end",
"def hash\n [created_time, last_modified_time, token, user_token, card_product_token, last_four, pan, expiration, expiration_time, cvv_number, chip_cvv_number, barcode, pin_is_set, state, state_reason, fulfillment_status, reissue_pan_from_card_token, fulfillment, bulk_issuance_token, translate_pin_from_card_token, activation_actions, instrument_type, expedite, metadata, contactless_exemption_counter, contactless_exemption_total_amount].hash\n end",
"def site_data_hash; end",
"def child_hash(branch)\n raise ArgumentError unless branch >= 0 &&\n branch < 16\n hashes[branch]\n end",
"def hash\r\n\t\treturn @name.hash() + @type.hash()\r\n\tend",
"def hash\n [first_name, last_name, address_one, address_two, city, state, zip, phone, email, country_code].hash\n end",
"def get_stackdata(node, attribute = nil)\n data = {}\n\n data['environment'] = node['easybib_deploy']['envtype']\n\n if ::EasyBib.is_aws(node)\n data['stackname'] = node['opsworks']['stack']['name']\n elsif node['vagrant']\n data['stackname'] = 'vagrant'\n data['environment'] = 'vagrant'\n else\n data['stackname'] = 'undefined'\n end\n\n unless attribute.nil?\n return data[attribute]\n end\n\n data\n end",
"def hash\n [color, cards, address_placement, custom_envelope, double_sided, extra_service, mail_type, return_envelope, bleed, file_original_url].hash\n end",
"def hash\n [sub, email, error_details, accounts, name, family_name, given_name, created].hash\n end",
"def create_hash(&block); end",
"def create_hash(&block); end",
"def digests_data\n {\n '1' => '7a8a3dad389031160f79817c14bb5f3adf058335',\n '2' => '8d4fc3e19f141135ca59f0ba5d9e8b634f04840e',\n '3' => '88f879b8aa22eb340019449955accdca62886f64',\n '4' => 'dba9f7cc5b15cc2eee74a288e6c04431d2f5e509',\n '5' => 'febf0d5b94e4dd2cd23f3a9cd515641885a50980',\n '6' => '2628bf51107c4c5cd581179df5d1148821f8a7a8',\n '7' => '83f929fdce5dfe931f9ccc6af49e2cfd436740f4',\n '8' => '5f9e781563ab48e7a67ec4500321b1ebe553f3fc',\n '9' => '8b14bf8dfa2bc7d74443cd9c4a0d836f1341becb',\n '10' => '5442273b216f7c843de10acc57c33638f7848f74',\n '11' => '3871068443e406fbff7ad6f91bd395bf9482a259',\n '12' => '9e52c47b63dd968ba2349779a86986eff2f2b860',\n '13' => '658ba6008127dc4e61eb5bbe70ec69be5524b845'\n }\n end",
"def concat(hash_stack)\n @stack.concat hash_stack.stack\n self\n end",
"def hash\n [last_price, last_time, last_size, bid_price, bid_size, ask_price, ask_size, open_price, close_price, high_price, low_price, exchange_volume, market_volume, updated_on, source, listing_venue, sales_conditions, quote_conditions, market_center_code, is_darkpool, security].hash\n end",
"def to_stack; end",
"def to_hash\n memoize(:to_hash) do\n _process_hashed(structures.inject({}) { |acc, elem| Utils.merge(acc, elem) })\n end\n end",
"def hash_from_git(tree)\n ({}).tap do |objs|\n tree.each do |b|\n objs[b.name] = (\n case b\n when Grit::Tree\n hash_from_git(b.contents)\n when Grit::Blob\n b.data\n end\n )\n end\n end\n end",
"def hash\n [name, url].hash\n end",
"def hash\n [id, to, from, carrier, thumbnails, size, expected_delivery_date, date_created, date_modified, deleted, front_template_id, back_template_id, front_template_version_id, back_template_version_id, tracking_events, object, url, description, metadata, mail_type, merge_variables, send_date, use_type].hash\n end",
"def hash\n Digest::SHA256.hexdigest( \"#{nonce}#{time}#{difficulty}#{prev}#{data}\" )\n end",
"def hash(*) end",
"def to_hash() end",
"def to_hash\n hsh = {\n id: id,\n status: status.to_sym,\n connect: running? ? connect.to_h : nil,\n time: info.wallclock_time.to_i / 60 # only update every minute\n }\n Digest::SHA1.hexdigest(hsh.to_json)\n end",
"def hash\n [container_id, image, image_id, last_state, name, ready, restart_count, state].hash\n end",
"def hash()\n #This is a stub, used for indexing\n end",
"def common_stack_params(stack)\n params = Smash.new(\"StackName\" => stack.name)\n if stack.dirty?(:parameters)\n initial_parameters = stack.data[:parameters] || {}\n else\n initial_parameters = {}\n end\n (stack.parameters || {}).each_with_index do |pair, idx|\n params[\"Parameters.member.#{idx + 1}.ParameterKey\"] = pair.first\n if initial_parameters[pair.first] == pair.last\n params[\"Parameters.member.#{idx + 1}.UsePreviousValue\"] = true\n else\n params[\"Parameters.member.#{idx + 1}.ParameterValue\"] = pair.last\n end\n end\n (stack.capabilities || []).each_with_index do |cap, idx|\n params[\"Capabilities.member.#{idx + 1}\"] = cap\n end\n (stack.notification_topics || []).each_with_index do |topic, idx|\n params[\"NotificationARNs.member.#{idx + 1}\"] = topic\n end\n (stack.tags || {}).each_with_index do |tag, idx|\n params[\"Tags.member.#{idx + 1}.Key\"] = tag.first\n params[\"Tags.member.#{idx + 1}.Value\"] = tag.last\n end\n if stack.template_url\n params[\"TemplateURL\"] = stack.template_url\n elsif !stack.dirty?(:template) && stack.persisted?\n params[\"UsePreviousTemplate\"] = true\n else\n params[\"TemplateBody\"] = MultiJson.dump(stack.template)\n end\n params\n end",
"def hash\n [id, alternate_id, type, first_name, surname, date_of_brith, date_of_birth, shipping_address, mailing_address, home_phone, mobile_phone, email_address, mailing_address_active, accounts, classifications, member_photo, gender, receive_email, receive_sms, password].hash\n end",
"def clone_state\n if @stack.empty?\n {}\n else\n Marshal.load Marshal.dump(@stack.last)\n end\n end",
"def clone_state\n if @stack.empty?\n {}\n else\n Marshal.load Marshal.dump(@stack.last)\n end\n end",
"def hash\n [code, scope].hash\n end",
"def hash\n [oct, pc].hash\n end",
"def pack(data, user, pw)\n slot = nil\n \n @store.transaction {\n @store['count'] += 1\n slot = @store['count'].to_s\n @store[slot] = {\n data: data,\n user: user,\n pwhash: pw,\n created: Time.now.utc.to_i\n }\n }\n\n slot\n end",
"def hash_hash(h)\n require 'digest/md5'\n Digest::MD5.hexdigest(Marshal::dump(h.sort))\n end",
"def hash\n [bin_commercial, bin_corporate, bin_country_issued, bin_credit, bin_currency, bin_debit, bin_description, bin_eu, card_id, card_status, default, expmonth, expyear, label, label2, last4digits, scheme, token].hash\n end",
"def hash_from_payload(payload)\n Digest::SHA256.digest(Digest::SHA256.digest( payload )).reverse.unpack(\"H*\")[0]\n end",
"def hash\n @node.sort.push(@edge).hash\n end"
] |
[
"0.67521703",
"0.64674425",
"0.6383291",
"0.6177991",
"0.6177991",
"0.6177991",
"0.6048297",
"0.60006744",
"0.59786034",
"0.5933204",
"0.5914581",
"0.5839315",
"0.57952595",
"0.5750576",
"0.57385886",
"0.57385886",
"0.57385886",
"0.57385886",
"0.57385886",
"0.57385886",
"0.57385886",
"0.57278514",
"0.57207984",
"0.56968576",
"0.5660377",
"0.56531495",
"0.5646434",
"0.56416875",
"0.5629885",
"0.56212646",
"0.56016845",
"0.56013614",
"0.56008476",
"0.5599641",
"0.5599641",
"0.5599641",
"0.5599641",
"0.5599641",
"0.5599641",
"0.5599641",
"0.5599641",
"0.5599641",
"0.5599641",
"0.55962205",
"0.5585529",
"0.55643475",
"0.5560019",
"0.5549444",
"0.55389565",
"0.55248666",
"0.5510101",
"0.5509211",
"0.5508684",
"0.55048656",
"0.55017966",
"0.549689",
"0.5482552",
"0.5481566",
"0.546661",
"0.546661",
"0.546661",
"0.54617065",
"0.54584473",
"0.54543483",
"0.54543483",
"0.54540783",
"0.543905",
"0.5434252",
"0.54329556",
"0.54201645",
"0.54161143",
"0.5411705",
"0.5403772",
"0.5396651",
"0.5396651",
"0.539525",
"0.53870964",
"0.53861034",
"0.538322",
"0.53821695",
"0.5365456",
"0.5361644",
"0.5357603",
"0.5353684",
"0.5348868",
"0.53436196",
"0.53425676",
"0.53424066",
"0.53392833",
"0.53382665",
"0.5336242",
"0.53319985",
"0.53319985",
"0.532826",
"0.53277624",
"0.5327039",
"0.53262264",
"0.5325339",
"0.5319124",
"0.53179115"
] |
0.6073098
|
6
|
Fetch the stack template
|
def stack_template_load(stack)
if(stack.persisted?)
result = request(
:endpoint => stack.custom.fetch(:manifest, stack.custom.get(:update, :manifest))
)
cache_template = stack.template = template_data_format(result[:body])
stack.custom = stack.custom.merge(result[:body])
if(stack.custom['expandedConfig'])
stack.custom['expandedConfig'] = YAML.load(stack.custom['expandedConfig']).to_smash
end
if(stack.custom['layout'])
stack.custom['layout'] = YAML.load(stack.custom['layout']).to_smash
end
stack.valid_state
cache_template
else
Smash.new
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def get_template(template); end",
"def get_template\n @template\n end",
"def fetch_template\n template_body = fetch_template_from_local_cache\n template_body ||= fetch_template_from_redis\n template_body ||= fetch_remote_template_and_store\n template_body ||= store_template_to_local_cache( self.default_template,\n self.local_cache_negative_ttl )\n\n return template_body \n end",
"def stack_template_extractor(x_stacks, &block)\n x_stacks.each do |stack, resource, s_name|\n unless(stack.nested_stacks.empty?)\n stack_template_extractor(stack.nested_stacks(:with_resource, :with_name), &block)\n end\n resource.properties.set!(:stack, stack.compile.dump!)\n block.call(s_name, stack, resource)\n end\n end",
"def _template\n @template\n end",
"def template\n @template.content\n end",
"def template\n return @template\n end",
"def template\n raise \"Template was not loaded: #{@template}\" if !@loadOK\n @template\n end",
"def extract_templates(&block)\n stack_template_extractor(nested_stacks(:with_resource, :with_name), &block)\n end",
"def template\n @template\n end",
"def template\n @template || nil\n end",
"def cfn_template\n @_cfn_template ||= \\\n begin\n if stack_type\n send(\"cfn_template_#{stack_type}\")\n else\n cfn_template_guess || fail_task('cannot find template')\n end\n end\n end",
"def find_template(state)\n view.find_template expanded_view_templates_for(state)\n end",
"def t\n @template\n end",
"def get_template\n if self.template\n return self.template\n end\n Template.find_by(default: true)\n end",
"def template\n @__template\n end",
"def perform_template_load\n memoize(:template) do\n self.data[:template] = api.stack_template_load(self)\n true\n end\n end",
"def fetch_template_from_url\n layout_url = lookup_template_url\n return nil if layout_url == nil\n\n Rails.logger.info \"Fetching remote template from #{layout_url.inspect}\"\n\n response = Curl.get( layout_url ) do |curl| \n curl.timeout = self.http_timeout\n end\n response_body = response.body_str\n\n Rails.logger.info \"Got remote template response code #{response.response_code} with body #{response_body.inspect}\"\n\n return nil if response.response_code == 404\n \n response_body = postprocess_template( response_body ) if respond_to?( :postprocess_template, true )\n\n return response_body\n \n rescue SocketError, Curl::Err::TimeoutError, Errno::ECONNREFUSED, TemplateRejectedError => e\n Rails.logger.error e.message\n return nil\n end",
"def get_template(name)\n response = request('Action' => 'GetTemplate', 'StackName' => name)\n rid = response.xpath('//aws:GetTemplateResponse/aws:ResponseMetadata/aws:RequestId', NS).text\n template_body = response.xpath('//aws:GetTemplateResponse/aws:GetTemplateResult/aws:TemplateBody', NS).text\n return {:request_id => rid, :body => JSON.parse(template_body)}\n end",
"def pack_template\n selfclass.pack_template\n end",
"def get_template\r\n template.nil? ? self.template_body : template.body\r\n end",
"def template_body\n @template_body ||= stack.to_cf\n end",
"def template_body\n @template_body ||= stack.to_cf\n end",
"def template\n @template ||= self.class.template\n end",
"def fetch_template(template_name = nil)\n # Due to security reason, it cannot use templates outside until it will be fixed\n # if GitlabHook::Project::config['template']\n # return GitlabHook::Project::config['template']\n # end\n\n if template_name.nil?\n template_name = @default_template_name\n else\n validate_template_name template_name\n end\n\n File.read(\n File.expand_path(\n configatron.app.path.templates + '/slack/message/' +\n template_name + '.erb')\n )\n end",
"def get_template(template)\n xapi.VM.get_by_name_label(template).first\n end",
"def get_template(template)\n xapi.VM.get_by_name_label(template).first\n end",
"def show_template\n self.template\n end",
"def show_template\n self.template\n end",
"def template\n @template ||= File.read(template_full_path)\n end",
"def details\n response = get \"/templates/#{template_id}.json\", {}\n Hashie::Mash.new(response)\n end",
"def fetch_remote_template_and_store\n template_body = fetch_template_from_url\n\n if template_body\n store_template_to_local_cache( template_body )\n store_template_to_redis( template_body )\n end\n\n return template_body\n end",
"def template\n @part.content\n end",
"def fetch_template_from_redis\n result = self.redis_connector.get( redis_key )\n store_template_to_local_cache( result ) if result\n\n return result\n end",
"def h\n @template\n end",
"def template(name)\n @conn.templates.get(name)\n end",
"def the_template(content=nil)\n if node = content || @content || Content.get(params[:id])\n node.template\n else\n \"<strong>Error:</strong> No template information could be found\" unless ENV['RACK_ENV'] == 'production'\n end\n end",
"def details\n response = CreateSend.get \"/templates/#{template_id}.json\", {}\n Hashie::Mash.new(response)\n end",
"def inner_template\n @inner_template ||= nil\n return @inner_template\n end",
"def get_template(item)\n return InstanceManager.get_template(item)\n end",
"def template\n @_renderer.current_template\n end",
"def template\n Liquid::Template.parse(template_content(template_name))\n end",
"def fetch_template(endpoint)\n url = URI.parse(endpoint)\n region = url.host.split('.').first.split('-', 2).last\n if(region == 's3')\n region = 'us-east-1'\n end\n bucket, path = url.path.sub('/', '').split('/', 2)\n MultiJson.load(\n storage_api(region).buckets.get(\n bucket.sub('/', '')\n ).files.get(path).body.read\n )\n end",
"def template\n if object.respond_to?(:template)\n object.template\n else\n @template\n end\n end",
"def h\n @template\n end",
"def template\n load_context\n evaluate_template_path(@path) # modifies @cfn\n @cfn\n end",
"def get_template(template_name)\n self.api_get(:template, {:template => template_name})\n end",
"def raw\n @template\n end",
"def details\n data = Storm::Base::SODServer.remote_call '/Storm/Template/details',\n :id => @id\n self.from_hash data\n end",
"def get_template(path)\n if @mode == :production\n @manifest.serve(path)\n else\n @manifest.parse(path) if !@manifest.provides?(path) \n @manifest.serve(path)\n end\n end",
"def template_content(name)\n templates.select { |t| t[:name] = name || 'index' }.first[:template]\n end",
"def dmptemplate\n #self.project.try(:dmptemplate) || Dmptemplate.new\n self.template\n end",
"def stack_fetch(pos=-1)\n\n type, tname = stack_type_at(pos)\n\n case type\n\n when TNIL then nil\n\n when TSTRING then\n len = FFI::MemoryPointer.new(:size_t)\n ptr = Lib.lua_tolstring(@pointer, pos, len)\n ptr.read_string(len.read_long)\n\n when TBOOLEAN then (Lib.lua_toboolean(@pointer, pos) == 1)\n when TNUMBER then Lib.lua_tonumber(@pointer, pos)\n\n when TTABLE then Table.new(@pointer)\n # warning : this pops up the item from the stack !\n\n when TFUNCTION then Function.new(@pointer)\n when TTHREAD then Coroutine.new(@pointer)\n\n else tname\n end\n end",
"def select_template\n templatelist = []\n templatelist\n end",
"def get_template(name)\n if File.exists?(\"#{repository.path}/#{name}.mustache\")\n IO.read(\"#{repository.path}/#{name}.mustache\")\n else\n IO.read(File.join(File.dirname(__FILE__), \"templates/#{name}.mustache\"))\n end\n end",
"def template\n @template ||= Ec2.template({:name =>@name, :key_name => @key_name, :image_id => @image_id, :instance_type => @instance_type, :security_groups => @security_groups})\n end",
"def parent_template\n transport[wsdl].get(:get_parent_template, { template_names: self.name})\n end",
"def nested_stacks_google(recurse = true)\n my_template = sparkleish_template\n if my_template[:resources][name]\n my_template = my_template.get(:resources, name, :properties, :stack)\n end\n n_stacks = my_template[:resources].map do |s_name, content|\n if content[:type] == \"sparkleformation.stack\"\n n_stack = self.class.new(api)\n n_stack.extend PretendStack\n n_layout = custom.fetch(:layout, {}).fetch(:resources, []).detect { |r| r[:name] == name }\n n_layout = (n_layout || custom.fetch(:layout, {})).fetch(:resources, []).detect { |r| r[:name] == s_name } || Smash.new\n n_stack.load_data(\n :name => s_name,\n :id => s_name,\n :template => content.get(:properties, :stack),\n :outputs => n_layout.fetch(\"outputs\", []).map { |o_val| Smash.new(:key => o_val[:name], :value => o_val[\"finalValue\"]) },\n :custom => {\n :resources => resources.all.map(&:attributes),\n :layout => n_layout,\n },\n ).valid_state\n n_stack.data[:logical_id] = s_name\n n_stack.data[:parent_stack] = self\n n_stack\n end\n end.compact\n if recurse\n (n_stacks + n_stacks.map(&:nested_stacks)).flatten.compact\n else\n n_stacks\n end\n end",
"def template\n Kernel.const_get(template_name.upcase << '_TEMPLATE')\n end",
"def template; end",
"def template; end",
"def template; end",
"def template; end",
"def template; end",
"def template; end",
"def template; end",
"def fetch_template_from_local_cache\n @@cache ||= {}\n \n return nil unless @@cache[@template_name]\n\n expiration = @@cache[@template_name][:expiration].to_i\n\n if expiration <= Time.now.to_i\n Rails.logger.debug( \"Local cache entry is too old, removing!\" )\n @@cache.delete( @template_name )\n return nil\n end\n\n Rails.logger.debug( \"Local cache still valid, expiring in #{expiration.inspect}\" )\n\n return @@cache[@template_name][:template]\n end",
"def get_template(filename)\n File.read(filename)\nend",
"def get_item_template\n get_type_template(@source.types)\n end",
"def get_template(data)\n return data if data.is_a?(String)\n\n data.fetch('conf', nil)\nend",
"def get_template_file\n @config['template']\n end",
"def retrieve_placeholders\n @template = LoadTemplate.new(directory: @dir, template: 'Bond Style')\n @template.process \n @template = @template.result\n end",
"def template_name; end",
"def template_name; end",
"def getTemplate (pathTemplate, binding)\r\n fileTemplate = File.new( pathTemplate )\r\n filehtml = fileTemplate.read\r\n erb = ERB.new filehtml\r\n return erb.result(binding)\r\n end",
"def lookup_template(name)\n @templates.fetch(name.to_s) { |k| @parent ? @parent.lookup_template(k) : nil }\n end",
"def templates\n @conn.templates\n end",
"def find_template\n \n template_name = \"render-activity\"\n template_name << \"-#{display}\" unless display.nil?\n\n # Search in theme path\n activity_template_path = Themes::ThemeManager.instance.selected_theme.resource_path(\"#{template_name}.erb\",'template','activity') \n \n # Search in the project\n if not activity_template_path\n path = context.get_path(template_name) \n activity_template_path = path if not path.nil? and File.exist?(path)\n end\n \n return activity_template_path\n \n end",
"def templates; end",
"def template\n possible_templates.find {|t| File.exists? \"#{t}.html\"}\n end",
"def load_full_container_template(use_disk_cache = false)\n container_class.template(true)\n end",
"def stack_profile\n \"#{@directory}/#{@profile}.stack.html\"\n end",
"def load_subtemplate( path )\n\t\t\tif self.include_stack.include?( path )\n\t\t\t\tstack_desc = ( self.include_stack + [path] ).join( ' --> ' )\n\t\t\t\tmsg = \"Recursive load of %p detected: from %s\" % [ path, stack_desc ]\n\n\t\t\t\tself.log.error( msg )\n\t\t\t\traise Inversion::StackError, msg\n\t\t\tend\n\n\t\t\t# self.log.debug \"Include stack is: %p\" % [ self.include_stack ]\n\n\t\t\tsubstate = self.dup\n\t\t\tsubstate.clear_nodes\n\t\t\tsubstate.include_stack.push( path )\n\n\t\t\treturn Inversion::Template.load( path, substate, self.options )\n\t\tend",
"def template\n templater.template\n end",
"def template\n\t\t\t@signature[:templates][@action_name]\n\t\tend",
"def find_template(name)\n \n # Search in theme path\n template_path = Themes::ThemeManager.instance.selected_theme.resource_path(\"#{name}.erb\",'template','ui') \n \n # Search in the project\n if not template_path\n path = app.get_path(name) #File.expand_path(File.join(File.dirname(__FILE__), '..', 'views', \"#{name}-fieldset-render.erb\")) \n template_path = path if File.exist?(path)\n end\n \n template_path\n \n end",
"def determine_template(options); end",
"def project_template_level\n return nil if self.try(:project_template_level_name).nil?\n Level.find_by_key(project_template_level_name)\n end",
"def find_template(path, locals)\n path_count = @lookup_context.view_paths.size\n @lookup_context.view_paths.unshift Frails.components_path\n old_paths = @lookup_context.view_paths.pop(path_count)\n\n prefixes = path.include?('/') ? [] : @lookup_context.prefixes\n result = @lookup_context.find_template(path, prefixes, false, locals, @details)\n\n @lookup_context.view_paths.unshift(*old_paths)\n @lookup_context.view_paths.pop\n\n result\n end",
"def get_template\n # Filters the name of the current theme.\n apply_filters('template', get_option('template'))\n end",
"def load_template(template)\n IO.read(template).chomp\n end",
"def cache_collect\n\t\tRepository.repo.get_from_cache(@template)\n\tend",
"def template_get(id)\n check_id_or_raise id\n\n response = http_request :get, \"#{@base_url}/templates/#{id}.xml\", 200,\n { :params => { :provider_key => @provider_key } }\n\n doc = Nokogiri::XML(response.body)\n draft_node = doc.xpath('//draft')[0]\n published_node = doc.xpath('//published')[0]\n draft = draft_node ? draft_node.text : nil\n published = published_node ? published_node.text : nil\n if draft && !draft.empty?\n draft\n else\n published\n end\n end",
"def fetch_template_id\n finance_transaction_receipt_record.fee_receipt_template_id\n end",
"def interrogate_stack(stack_name, client)\n def get_next_page(client, stack_name, current_items, next_token)\n puts(\"DEBUG: getting stack #{stack_name}\")\n result = client.list_stack_resources({:stack_name=>stack_name,:next_token=>next_token})\n updated_items = current_items.merge(result.stack_resource_summaries.map {|entry| [entry.logical_resource_id, entry.physical_resource_id]}.to_h)\n if result.next_token\n get_next_page(client, stack_name, updated_items, next_token)\n else\n updated_items\n end\n end\n\n get_next_page(client, stack_name, {}, nil)\nend",
"def template\n @template.join(\"\\n\")\n end",
"def template\n @template.join(\"\\n\")\n end",
"def mustache_in_stack\n @stack.detect { |frame| frame.is_a?(Mustache) }\n end",
"def running_template\n @running_template\n end",
"def template(name); end"
] |
[
"0.7101934",
"0.70465076",
"0.68973947",
"0.6755051",
"0.6571939",
"0.655169",
"0.65463096",
"0.6540473",
"0.6535762",
"0.65352464",
"0.64819604",
"0.6416082",
"0.64151996",
"0.6405743",
"0.6394707",
"0.63887113",
"0.63826925",
"0.63473773",
"0.6345992",
"0.63356036",
"0.6303592",
"0.630357",
"0.630357",
"0.6282948",
"0.6275066",
"0.62368345",
"0.62368345",
"0.62295836",
"0.62295836",
"0.61386526",
"0.60689884",
"0.6067054",
"0.60637033",
"0.60627484",
"0.604947",
"0.6041019",
"0.603708",
"0.5999187",
"0.5997179",
"0.5996591",
"0.5968001",
"0.59629023",
"0.5928627",
"0.5903584",
"0.59028226",
"0.58831567",
"0.5867659",
"0.5841529",
"0.58323765",
"0.58301264",
"0.5818619",
"0.5792984",
"0.579028",
"0.5785928",
"0.57854277",
"0.57717127",
"0.576381",
"0.5760618",
"0.57349694",
"0.573061",
"0.573061",
"0.573061",
"0.573061",
"0.573061",
"0.573061",
"0.573061",
"0.57120985",
"0.5711791",
"0.5699575",
"0.56811506",
"0.56730807",
"0.5640247",
"0.56328666",
"0.56328666",
"0.56291705",
"0.56136703",
"0.56089485",
"0.56058043",
"0.55990386",
"0.55974835",
"0.5583137",
"0.55723953",
"0.5554466",
"0.5549967",
"0.5545588",
"0.5542357",
"0.5534597",
"0.55312437",
"0.5523154",
"0.55217826",
"0.55150485",
"0.5513819",
"0.55119044",
"0.5511391",
"0.550128",
"0.54905725",
"0.54905725",
"0.5480488",
"0.54801995",
"0.54697555"
] |
0.73864704
|
0
|
Pack template data for shipping to API
|
def template_data_unformat(data)
Hash.new.tap do |result|
if(v = data.to_smash.get(:config, :content))
result[:config] = {
:content => yamlize(v)
}
end
if(data[:imports])
result[:imports] = data[:imports].map do |item|
Smash.new(
:name => item['name'],
:content => yamlize(item['content'])
)
end
end
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def pack_template\n selfclass.pack_template\n end",
"def pack(generate = false)\n self.class.template.pack(self, generate)\n end",
"def pack\n end",
"def pack_template\n if self.to_s =~ /^.*<(.*):0x.*/\n clsname = $1\n else\n clsname = self.to_s\n end\n \n Util.pack_template_from( @struct_internal_format, clsname )\n end",
"def pack_box\n\t\t# @packages = ActiveShipping::Package.new((WEIGHT * 16), DIMENSIONS, UNITS)\n\t\t@packages = ActiveShipping::Package.new((WEIGHT * 16), DIMENSIONS, UNITS)\n\tend",
"def pack(data, user, pw)\n slot = nil\n \n @store.transaction {\n @store['count'] += 1\n slot = @store['count'].to_s\n @store[slot] = {\n data: data,\n user: user,\n pwhash: pw,\n created: Time.now.utc.to_i\n }\n }\n\n slot\n end",
"def serializable_data\n template = self.class.find(self.id,:include=>[:param_values,:page_layout=>:full_set_nodes])\n hash ={:template=>template, :param_values=>template.param_values, :page_layouts=>template.page_layout.full_set_nodes,\n :template_files=>template.template_files,:template_releases=>template.template_releases\n } \n hash \n end",
"def build_carton_template\n \n #target market and erp calculated fg_code\n begin\n carton_template = nil\n if self.carton_setup.carton_template != nil\n carton_template = self.carton_setup.carton_template\n else\n carton_template = CartonTemplate.new\n end\n \n if !self.carton_setup.carton_setup_update_timestamp\n self.carton_setup.update_time\n end\n \n carton_template.last_update_date_time = self.carton_setup.carton_setup_update_timestamp.last_update_timestamp\n \n carton_template.sell_by_code = self.retailer_sell_by_code\n carton_template.iso_week_code = self.carton_setup.production_schedule.iso_week_code\n carton_template.commodity_code = self.carton_setup.retail_item_setup.item_pack_product.commodity_code\n carton_template.carton_mark_code = self.carton_setup.trade_unit_setup.mark_code\n target_market = TargetMarket.find_by_target_market_name(self.target_market)\n carton_template.target_market_code = target_market.target_market_name + \"_\" + target_market.target_market_description\n @marketing_variety_description = MarketingVariety.find_by_marketing_variety_code_and_commodity_code(self.carton_setup.marketing_variety_code,@rmt_setup.commodity_code).marketing_variety_description.to_s\n carton_template.variety_short_long = self.carton_setup.marketing_variety_code + \"_\" + @marketing_variety_description\n \n carton_template.inspection_type_code = self.carton_setup.pallet_setup.inspection_type_code\n carton_template.carton_label_code = self.carton_setup.trade_unit_setup.standard_label_code\n carton_template.order_number = self.carton_setup.order_number\n actual_count_code = actual_count_code = self.carton_setup.retail_item_setup.item_pack_product.actual_count.to_s\n if !(self.carton_setup.retail_item_setup.item_pack_product.size_ref == \"NOS\"||self.carton_setup.retail_item_setup.item_pack_product.size_ref == nil)\n actual_count_code = self.carton_setup.retail_item_setup.item_pack_product.size_ref\n end\n carton_template.actual_size_count_code = actual_count_code\n carton_template.grade_code = self.carton_setup.grade_code\n #question\n carton_template.old_pack_code = self.carton_setup.trade_unit_setup.old_pack_code.to_s\n carton_template.treatment_code = self.carton_setup.retail_item_setup.item_pack_product.treatment_code\n carton_template.treatment_type_code = self.carton_setup.retail_item_setup.item_pack_product.treatment_type_code\n carton_template.class_code = self.carton_setup.retail_item_setup.item_pack_product.product_class_code\n carton_template.pc_code = \"PC\" + @rmt_setup.rmt_product.ripe_point.pc_code.pc_code + \"_\" + @rmt_setup.rmt_product.ripe_point.pc_code.pc_name\n carton_template.pc_code_num = @rmt_setup.rmt_product.ripe_point.pc_code.pc_code \n carton_template.track_indicator_code = @rmt_setup.output_track_indicator_code\n carton_template.cold_store_code = @rmt_setup.cold_store_code\n input_variety = RmtVariety.find_by_rmt_variety_code_and_commodity_code(@rmt_setup.variety_code,@rmt_setup.commodity_code) \n \n carton_template.erp_cultivar = input_variety.rmt_variety_code + \"_\" + input_variety.rmt_variety_description.to_s\n \n inventory = InventoryCode.find_by_inventory_code(self.inventory_code)\n carton_template.inventory_code = self.inventory_code + \"_\" + inventory.inventory_name\n carton_template.spray_program_code = @rmt_setup.treatment_code\n \n carton_template.quantity = 1\n #------------------------------------------------------------------\n #Calculation:\n #iso_week of current day(must be 2 chars: i.e '1' = '01' + weekday(1-7) + numeric value of pc_code + rightmost char of isoweek(i.e. '1' if '01' or '5' if '15')\n #-------------------------------------------------------------------\n carton_template.pick_reference = nil #can only be calculated at mw exec time\n\n carton_template.remarks = self.remarks\n carton_template.organization_code = self.carton_setup.org\n #------------------------------------------------------------------\n #Calculation:\n #iso_week of current day \n #NB can only be calculated at mw exec time\n #-------------------------------------------------------------------\n #carton_template.iso_week_code = self.carton_setup.production_schedule.iso_week_code\n season = Season.find_by_season_code(self.carton_setup.production_schedule.season_code)\n carton_template.season_code = season.season\n carton_template.fg_product_code = self.fg_product_code\n @brand_code = Mark.find_by_mark_code(self.carton_setup.trade_unit_setup.mark_code).brand_code\n carton_template.fg_code_old = self.carton_setup.commodity_code + \" \" + self.carton_setup.marketing_variety_code + \" \" + @brand_code + \" \" + self.carton_setup.trade_unit_setup.old_pack_code.to_s + \" \" + carton_template.actual_size_count_code\n carton_template.carton_setup = self.carton_setup\n \n \n @extended_fg_record = ExtendedFg.find_by_extended_fg_code(self.extended_fg_code)\n raise \"No extended fg record exists with code: \" + self.extended_fg_code.to_s + \" for carton setup: \" + self.carton_setup.carton_setup_code if !@extended_fg_record\n carton_template.carton_fruit_nett_mass = @extended_fg_record.tu_nett_mass\n carton_template.extended_fg_code = @extended_fg_record.extended_fg_code\n carton_template.fg_mark_code = self.fg_mark_code\n carton_template.items_per_unit = self.carton_setup.retail_unit_setup.items_per_unit\n carton_template.units_per_carton = self.carton_setup.retail_unit_setup.units_per_carton\n \n carton_template.save\n @carton_template = carton_template \n rescue\n raise \"Method 'build_carton_template' failed. Exception reported: <br>: \" + $!\n end\n end",
"def template_data_format(data)\n data = data.to_smash\n Smash.new.tap do |result|\n result[:config] = data.fetch(:config, Smash.new)\n result[:imports] = data.fetch(:imports, []).map do |item|\n begin\n Smash.new(\n :name => item[:name],\n :content => YAML.load(item[:content])\n )\n rescue\n item\n end\n end\n if(result.get(:config, :content))\n result[:config][:content] = YAML.load(result[:config][:content]) || Smash.new\n else\n result[:config][:content] = Smash.new\n end\n end\n end",
"def load\n template_data = response_data['template']\n\n @data = response_data['data']\n @template = Template.new(\n template_data['src'], template_data['type'], template_data['key']\n )\n\n super\n end",
"def virtual_guest_template\n template = {\n \"startCpus\" => @cores.to_i,\n \"maxMemory\" => @memory.to_i * 1024, # we let the user specify memory in GB, but the API expects maxMemory in MB.\n \"hostname\" => @hostname,\n \"domain\" => @domain,\n\n # Note : for the values below, we want to use the constants \"true\" and \"false\" not nil\n # the nil value (while false to Ruby) will not translate to XML properly\n \"localDiskFlag\" => !!@use_local_disk,\n \"hourlyBillingFlag\" => !!@hourly\n }\n\n template['dedicatedAccountHostOnlyFlag'] = true if @dedicated_host_only\n template['privateNetworkOnlyFlag'] = true if @private_network_only\n\n template['datacenter'] = {\"name\" => @datacenter.name} if @datacenter\n template['userData'] = [{'value' => @user_metadata}] if @user_metadata\n template['networkComponents'] = [{'maxSpeed'=> @max_port_speed}] if @max_port_speed\n template['postInstallScriptUri'] = @provision_script_URI.to_s if @provision_script_URI\n template['postInstallScriptUri'] = @provision_script_uri.to_s if @provision_script_uri\n template['primaryNetworkComponent'] = { \"networkVlan\" => { \"id\" => @public_vlan_id.to_i } } if @public_vlan_id\n template['primaryBackendNetworkComponent'] = { \"networkVlan\" => {\"id\" => @private_vlan_id.to_i } } if @private_vlan_id\n template['sshKeys'] = @ssh_key_ids.collect { |ssh_key_id| {'id'=> ssh_key_id.to_i } } if @ssh_key_ids\n template['supplementalCreateObjectOptions'] = @supplementalCreateObjectOptions if @supplementalCreateObjectOptions\n\n if @image_template\n template['blockDeviceTemplateGroup'] = {\"globalIdentifier\" => @image_template.global_id}\n elsif @os_reference_code\n template['operatingSystemReferenceCode'] = @os_reference_code\n end\n\n if @disks && !@disks.empty?\n template['blockDevices'] = []\n\n # According to the documentation for +createObject+,\n # device number 1 is reserved for the SWAP disk of the computing instance.\n # So we assign device 0 and then assign the rest starting at index 2.\n @disks.each_with_index do |disk, index|\n device_id = (index >= 1) ? index + 1 : index\n template['blockDevices'].push({\"device\" => \"#{device_id}\", \"diskImage\" => {\"capacity\" => disk}})\n end\n end\n\n template\n end",
"def package_data\n\t\t\t@hashPack = { \n\t\t \t\"company_growth\" => self.instance_variable_get(:@companyGrowth),\n\t\t \"forward_dividend\" => self.instance_variable_get(:@forwardDividendRate),\n\t\t \"trailing_dividend\" => self.instance_variable_get(:@trailingDividendRate),\n\t\t \"tax_rate\" => self.instance_variable_get(:@taxRate),\n\t\t \"trade_name\" => self.instance_variable_get(:@stockProfile).proper_name,\n\t\t \"stock_ticker\" => self.instance_variable_get(:@stock_ticker),\n\t\t \"free_cash_flow\" => self.instance_variable_get(:@freeCashFlow),\n\t\t \"number_shares\" => self.instance_variable_get(:@numShares),\n\t\t \"current_pe_ratio\" => self.instance_variable_get(:@current_pe_ratio),\n\t\t \"current_pe_comp\" => self.instance_variable_get(:@current_pe_comp),\n\t\t \"beta\" => self.instance_variable_get(:@threeYearBeta),\n\t\t \"industry\" => self.instance_variable_get(:@stockProfile).industry,\n\t\t \"sic_code\" => self.instance_variable_get(:@stockProfile).sic_code,\n\t\t \"exchange\" => self.instance_variable_get(:@stockProfile).exchange,\n\t\t \"market_cap\" => self.instance_variable_get(:@marketCap),\n\t\t \"net_assets\" => self.instance_variable_get(:@netAssets),\n\t\t \"total_debt\" => self.instance_variable_get(:@totalDebt),\n\t\t \"stock_price\" => get_show_quote, \n\t\t \t\"stockbot_price\" => self.instance_variable_get(:@computed_share_value),\n\t\t \"pe_value\" => self.instance_variable_get(:@PE_Comparable_Valuation),\n\t\t \"nav_value\" => self.instance_variable_get(:@NAV_Valuation),\n\t\t \"capm_value\" => self.instance_variable_get(:@CAPM_Valuation),\n\t\t \"wacc_value\" => self.instance_variable_get(:@WACC_Valuation),\n\t\t \"dividend_value\" => self.instance_variable_get(:@Dividend_Valuation),\n\t\t \"sentiment_value\" => self.instance_variable_get(:@Sentiment_Valuation)\n\t\t\t}\n \tend",
"def populate_template( template_id, imported_template )\n puts \"Populating new tempalte id: #{template_id}...\"\n\n uri = URI(@config['endpoint']+\"/#{template_id}/versions\")\n\n # Retrieve templates\n http = Net::HTTP.new( uri.host,uri.port )\n http.use_ssl = true\n request = Net::HTTP::Post.new( uri.request_uri, initheader = {'Content-Type:' => 'application/json'} )\n request.basic_auth(@secondary_username, @secondary_password)\n\n\n # If versions exist, transfer each to new template\n imported_template['versions'].each do |version|\n version.delete(\"id\")\n version.delete(\"user_id\")\n version.delete(\"template_id\")\n version.delete(\"updated_at\")\n\n puts \" Adding template version #{version['name']}...\"\n payload = version.to_json\n request.body = payload\n response = http.request( request )\n response_message = JSON.parse( response.body )\n end\n end",
"def template(&block)\n mod = representable_attrs.collection_representers[:object_template] = Module.new do\n include Roar::Representer::JSON\n include Roar::Representer::JSON::CollectionJSON::DataMethods\n \n extend PropertyWithRenderNil\n\n module_exec(&block)\n\n #self.representation_wrap = :template\n def from_hash(hash, *args) # overridden in :template representer.\n super(hash[\"template\"])\n end\n end\n\n representable_attrs.collection_representers[:template] = Module.new do\n include Roar::Representer::JSON\n include mod\n\n #self.representation_wrap = false\n\n # DISCUSS: currently we skip real deserialization here and just store the :data hash.\n def from_hash(hash, *args)\n replace(hash[\"data\"])\n end\n end\n end",
"def inject_data(template)\n template['$INJECT_DATA'] = model.to_json\n template\n end",
"def stack_template_load(stack)\n if(stack.persisted?)\n result = request(\n :endpoint => stack.custom.fetch(:manifest, stack.custom.get(:update, :manifest))\n )\n cache_template = stack.template = template_data_format(result[:body])\n stack.custom = stack.custom.merge(result[:body])\n if(stack.custom['expandedConfig'])\n stack.custom['expandedConfig'] = YAML.load(stack.custom['expandedConfig']).to_smash\n end\n if(stack.custom['layout'])\n stack.custom['layout'] = YAML.load(stack.custom['layout']).to_smash\n end\n stack.valid_state\n cache_template\n else\n Smash.new\n end\n end",
"def build_templates_and_labels\n \n #--------------------------------------------------------------\n #Fetch data needed for build operations\n #--------------------------------------------------------------\n self.production_schedule_code = self.carton_setup.production_schedule_code\n self.org = self.carton_setup.org\n self.color_percentage = self.carton_setup.color_percentage\n self.grade_code = self.carton_setup.grade_code\n self.std_count = self.carton_setup.standard_size_count_value\n self.sequence_number = self.carton_setup.sequence_number\n self.order_number = self.carton_setup.order_number\n \n \n @rmt_setup = RmtSetup.find_by_production_schedule_name(self.production_schedule_code)\n self.transaction do\n build_carton_template\n build_carton_label \n build_pallet_template\n build_pallet_label\n \n self.carton_setup.update\n end\n \n end",
"def template_map\n \n end",
"def publish_templates\n # Use soure account ID to discover deployment\n @api.account_id = @options[:src]\n @old_deployment = @api.deployments(:id => @options[:deployment], :view => \"inputs_2_0\").show\n servers = @old_deployment.show.servers.index\n puts \"Discovered deployment: #{@old_deployment.name} ...\\n\\n\"\n\n # find href of current servers servertemplate and set it as the key in the server_templates hash\n servers.each do |server|\n puts \"Discovered server: #{server.name} ...\"\n\n if server.next_instance.show.server_template.show.revision == 0\n $stderr.puts \"ERROR: Cannot publish a HEAD version of a ServerTemplate. Please commit first.\"\n exit 1\n end\n @server_templates[server.next_instance.show.server_template.show.href] =\n {\"name\" => server.next_instance.show.server_template.show.name}\n end\n puts \"\\nDiscovered unique ServerTemplates:\\n\\n\"\n @server_templates.keys.each do |st|\n puts \"#{@server_templates[st]['name']}\"\n end\n\n # Publish each unique ServerTemplate\n puts \"\\n\"\n @server_templates.keys.each do |server_template|\n st = @api.resource(server_template)\n\n puts \"Publishing: \\\"#{st.name}\\\" to group: #{@options[:group]} ...\"\n response = st.publish(\n \"account_group_hrefs\" => [ \"/api/account_groups/#{@options[:group]}\" ],\n \"descriptions[long]\" => st.description,\n \"descriptions[short]\" => st.description[0..255],\n \"descriptions[notes]\" => \"Auto imported from account #{@options[:src]}\"\n )\n # Add publication URL to hash\n @server_templates[server_template]['publication_url'] = response.show.href\n end\nend",
"def generate\n Zip::File.open(@template_path) do |template_zip|\n buffer = Zip::OutputStream.write_buffer do |out|\n template_zip.each do |entry|\n out.put_next_entry entry.name\n if @replaceable_files[entry.name]\n source = entry.get_input_stream.read.sub(/(<w:body>)(.*?)(<w:sectPr)/, \"\\\\1#{@replaceable_files[entry.name]}\\\\3\")\n out.write(source)\n else\n out.write(template_zip.read(entry.name))\n end\n end\n end\n buffer.string\n end\n end",
"def template_params\n params.fetch(:template, {}).permit([:title, :data])\n end",
"def wrap_data(data)\n @wrapper_template.merge(upstream_data: Marshal.load(Marshal.dump(data)),\n last_update_ts: Time.now.utc.to_i)\n end",
"def build_customs_info package\n customs_items = []\n line_items = package.contents.collect(&:line_item)\n value = line_items.sum do |item|\n item.variant.price * item.quantity\n end\n if Spree::Config.harmonized_tariff_number # Only shipping one product\n customs_items << EasyPost::CustomsItem.create(\n description: Spree::Config.item_customs_description,\n quantity: line_items.collect(&:quantity).inject(:+).to_i,\n value: value,\n weight: line_items.collect(&:variant).collect(&:weight).inject(:+).to_i,\n hs_tariff_number: Spree::Config.harmonized_tariff_number,\n origin_country: package.stock_location.country.iso)\n else\n # TODO: Group by tariff number and perform the above steps with each group.\n end\n\n customs_info = EasyPost::CustomsInfo.create(\n eel_pfc: package.order.ship_address.country.iso == 'CA' ? 'NOEEI 30.36' : 'NOEEI 30.37(a)',\n customs_certify: true,\n customs_signer: Spree::Config.customs_signer,\n contents_type: 'merchandise',\n customs_items: customs_items\n )\n end",
"def generate_pack_data(format, cgi, item_entry, item, download_allowed)\n pack_data = \"\"\n pack_metadata = generate_item_metadata(format, cgi, item_entry)\n \n case format.downcase\n when \"html\"\n pack_data += cgi.li(\"class\" => \"pack\"){\n cgi.div(\"class\" => \"pack_item\") do\n cgi.div(\"class\" => \"item_data\") do\n \"<b>Pack: </b>\" + cgi.a(location_string(item_entry.contributable_type, item.id)){item.title} + \n (download_allowed ? (\" [ #{cgi.a(location_string(item_entry.contributable_type, item.id) + '/download'){'click here to download this pack separately'}} ]\") : \"\") + \"<br/>\" +\n uploader_string(item.contributor_type, item.contributor_id, true) + \"<br/>\"\n end +\n pack_metadata\n end\n }\n \n when \"text\"\n pack_data += \"- Pack: #{item.title}\"\n pack_data += \"\\n Location: \" + location_string(item_entry.contributable_type, item.id)\n if download_allowed\n pack_data += \"\\n Download link: \" + location_string(item_entry.contributable_type, item.id) + \"/download ( --download of nested packs is not supported, however using this link it can be downloaded separately-- )\"\n end\n pack_data += \"\\n \" + uploader_string(item.contributor_type, item.contributor_id, false) + \"\\n\"\n pack_data += pack_metadata\n \n else\n return \"ERROR\"\n end\n \n return pack_data\n end",
"def convert_template!\n tag! \"template\" do\n convert_s! \"name?\"\n if @version >= 119\n convert_id!\n end\n\n convert_array! \"subtemplates\" do\n convert_subtemplate!\n end\n\n convert_array! \"children\" do\n convert_uientry_gen2!\n end\n\n out_ofs! \"end of template?\"\n end\n end",
"def generate_from_templates\r\n %w{package.json _config.yml}.each do |file|\r\n template file\r\n end\r\n end",
"def create_template\n self.template = \"template 14231\"\n end",
"def default_data_for_template(name)\n data = {}\n data[:name] = name\n data[:version] = '0.0.1'\n data[:summary] = \"A short description of #{name}.\"\n data[:homepage] = \"http://EXAMPLE/#{name}\"\n data[:author_name] = `git config --get user.name`.strip\n data[:author_email] = `git config --get user.email`.strip\n data[:source_url] = \"http://EXAMPLE/#{name}.git\"\n data[:ref_type] = ':tag'\n data[:ref] = '0.0.1'\n data\n end",
"def default_data_for_template(name)\n data = {}\n data[:name] = name\n data[:version] = '0.0.1'\n data[:summary] = \"A short description of #{name}.\"\n data[:homepage] = \"http://EXAMPLE/#{name}\"\n data[:author_name] = `git config --get user.name`.strip\n data[:author_email] = `git config --get user.email`.strip\n data[:source_url] = \"http://EXAMPLE/#{name}.git\"\n data[:ref_type] = ':tag'\n data[:ref] = '0.0.1'\n data\n end",
"def __prepare_body(data)\n data[:customer][:confirm_password] = data[:customer][:password]\n data[:customer][:confirm_email] = data[:customer][:email]\n\n timezone = data[:customer][:timezone]\n if timezone.empty?\n data[:customer][:timezone] = 'UTC'\n end\n\n data\n end",
"def serializable_data\n template = self.class.includes(:param_values,:page_layout_root).find(self.id)\n # template.page_layout.self_and_descendants would cause error\n # https://github.com/rails/rails/issues/5303\n # serializable_data.to_yaml, it only get error in rake task.\n # serializable_data.to_json, key is string when load\n hash ={'template'=>template, 'param_values'=>template.param_values, 'page_layouts'=>template.page_layout_root.self_and_descendants.all,\n 'template_files'=>template.template_files,'template_releases'=>template.template_releases\n }\n hash\n end",
"def update_template(key, value)\n t = { key => value }\n raw = read_attribute(\"template\") \n d = raw.nil? ? {} : JSON.parse(raw) \n merged = d.deep_merge(t)\n self.template = JSON.generate(merged)\n self.save!\n end",
"def prepare_publish\n workload = []\n\n source_category = \"stage\"\n destination_category = \"pool\"\n\n Component.dataset(source_category).each do |entry|\n source = Component.new(entry[:component], entry[:suitename], source_category)\n source.files.each do |fullname|\n package = Package.new(fullname, entry[:suitename], entry[:component])\n destination = Architecture.new(package.architecture, entry[:component], entry[:suitename], destination_category)\n\n workload << {\n :source_fullname => fullname,\n :destination_fullname => File.join(destination.directory, package.newbasename),\n :component => entry[:component],\n :suitename => entry[:suitename],\n :architecture => package.architecture\n }\n end\n end\n \n workload\n end",
"def setup_template_variables(rid)\n @rid = rid\n @request_data = JSON.parse @rid.request_data\n @response_data = JSON.parse @rid.response_data\n end",
"def import_templates\n # Use destination account ID\n @api.account_id = @options[:dst]\n\n puts \"\\n\"\n # Import each ServerTemplate and store the new location\n @server_templates.keys.each do |server_template|\n # Grab ID number from /api/server_templates/:id\n id = @server_templates[server_template]['publication_url'].split('/').last\n response = @api.publications(:id => id).import\n\n puts \"Importing: \\\"#{response.show.name}\\\" to account: #{@options[:dst]}\"\n\n @server_templates[server_template]['new_st_url'] = response.show.href\n end\nend",
"def save_template(template_name, template_fields)\n data = template_fields\n data[:template] = template_name\n self.api_post(:template, data)\n end",
"def create\n @datatemplate = @template.datatemplates.new(datatemplate_params)\n respond_to do |format|\n if @template.save\n format.html { redirect_to :back, notice: 'Data template was successfully added.' }\n else\n format.html { redirect_to :back, notice: 'Data was ocurrer an error.' }\n end\n end\n end",
"def send_template(template_name, _, message)\n if test?\n base_deliveries.push([template_name, message])\n else\n message[:content][:template_id] = template_name\n client.transmission.send_payload(message)\n end\n end",
"def create_shipment\n to_address = create_address(name: @order.recipient_full_name,\n street1: @order.ship_address.address1,\n street2: @order.ship_address.address2,\n city: @order.ship_address.city,\n state: @order.ship_address.state.try(:name) || '',\n zip: @order.ship_address.zipcode,\n country: @order.ship_address.country.try(:iso) || '',\n phone: @order.ship_address.phone,\n email: @order.email)\n\n from_address = if @carrier == 'auspost'\n create_address(name: Settings['shipping_address']['company_name'],\n street1: Settings['shipping_address']['auspost']['street1'],\n city: Settings['shipping_address']['auspost']['city'],\n state: Settings['shipping_address']['auspost']['state'],\n zip: Settings['shipping_address']['auspost']['zipcode'],\n country: Settings['shipping_address']['auspost']['country'],\n phone: Settings['shipping_address']['auspost']['phone'],\n email: Settings['shipping_address']['email'])\n else\n create_address(name: Settings['shipping_address']['company_name'],\n street1: Settings['shipping_address']['street1'],\n city: Settings['shipping_address']['city'],\n state: Settings['shipping_address']['state'],\n zip: Settings['shipping_address']['zipcode'],\n country: Settings['shipping_address']['country'],\n phone: Settings['shipping_address']['phone'],\n email: Settings['shipping_address']['email'])\n end\n\n parcel = EasyPost::Parcel.create(\n length: Settings['parcel']['length'],\n width: Settings['parcel']['width'],\n height: Settings['parcel']['height'],\n weight: Settings['parcel']['weight']\n )\n\n customs_info = EasyPost::CustomsInfo.create(\n contents_type: Settings['parcel']['easypost']['contents_type'],\n contents_explanation: Settings['parcel']['description'],\n eel_pfc: Settings['parcel']['easypost']['eel_pfc'],\n non_delivery_option: Settings['parcel']['easypost']['non_delivery'],\n restriction_type: Settings['parcel']['easypost'][' restriction_type'],\n customs_items: [{\n description: Settings['parcel']['description'],\n quantity: @order.item_count.to_i,\n value: Settings['parcel']['easypost']['value'],\n weight: Settings['parcel']['weight'],\n origin_country: Settings['shipping_address']['country'],\n hs_tariff_number: Settings['parcel']['hs_tariff_number'],\n currency: Settings['parcel']['currency']\n }]\n )\n\n @shipment = EasyPost::Shipment.create(\n to_address: to_address,\n from_address: from_address,\n parcel: parcel,\n customs_info: customs_info,\n carrier_accounts: [@ship_carrier],\n options: { print_custom_1: @order.item_skus_with_quantity, print_custom_2: @order.number, label_format: 'PNG', currency: 'SGD' }\n )\n @shipment.try(:id).present? && @shipment.try(:messages).present? ? return_shipment_errors : buy_shipment\n end",
"def pigeon_template\n pigeon_template = {}\n collect_pigeon_names(original_data).collect do |names|\n pigeon_template[names] = {}\n collect_attribute_labels(original_data).collect do |labels|\n pigeon_template[names][labels] = find_what_you_want(names, labels)\n end\n end \n pigeon_template \nend",
"def prepare_liquid_template(template)\n end",
"def template\n templater.template\n end",
"def templates\n response = get \"storage/template\"\n data = JSON.parse response.body\n data\n end",
"def templates\n\n add_breadcrumb \"Download Template\"\n\n @message = \"Creating inventory template. This process might take a while.\"\n\n end",
"def fill_form(template, destination, data = T.unsafe(nil), fill_options = T.unsafe(nil)); end",
"def process checkup\n begin\n checkup[:templates].each do |template|\n I2X::Config.log.info(self.class.name) {\"Delivering to #{template} template.\"}\n checkup[:payload].each do |payload|\n I2X::Config.log.debug(self.class.name) {\"Processing #{payload}.\"}\n response = RestClient.post \"#{I2X::Config.host}postman/deliver/#{template}.js\", payload\n case response.code\n when 200\n\n else\n I2X::Config.log.warn(self.class.name) {\"unable to deliver \\\"#{payload}\\\" to \\\"#{template}\\\"\"}\n end\n end\n end\n rescue Exception => e\n I2X::Config.log.error(self.class.name) {\"Processing error: #{e}\"}\n end\n \n end",
"def get_full_data(data)\n case @client.api_version\n when \"1.2\"\n # in this version returned id=>{...}\n result = @client.api_request(:method => \"template.get\", :params => {:filter => data, :output => \"extend\"})\n result.empty? ? [] : result.values \n else\n @client.api_request(:method => \"template.get\", :params => {:filter => data, :output => \"extend\"})\n end\n end",
"def create_order()\n\t{\n\t\t\"destination\" => {\n\t\t\t\"name\" => \"hp.jpeng\"\n\t\t},\n\t\t\"orderData\" => {\n\t\t\t\"sourceOrderId\" => [*('A'..'Z')].sample(8).join,\n\t\t\t\"items\" => [{\n\t\t\t\t\"sourceItemId\" => [*('A'..'Z')].sample(8).join,\n\t\t\t\t\"sku\" => \"Flat\",\n\t\t\t\t\"quantity\" => 1,\n\t\t\t\t\"components\" => [{\n\t\t\t\t\t\"code\" => \"Content\",\n\t\t\t\t\t\"path\" => \"https://Server/Path/business_cards.pdf\",\n\t\t\t\t\t\"fetch\" => \"true\",\n\t\t\t\t\t# \"route\" => [{\n\t\t\t\t\t# \t\t\"name\" => \"Print\",\n\t\t\t\t\t# \t\t\"eventTypeId\" => \"\"\t\t#eventTypeId found within Site Flow -> Events\n\t\t\t\t\t# \t}, {\n\t\t\t\t\t# \t\t\"name\" => \"Cut\",\n\t\t\t\t\t# \t\t\"eventTypeId\" => \"\"\n\t\t\t\t\t# \t}, {\n\t\t\t\t\t# \t\t\"name\" => \"Laminate\",\n\t\t\t\t\t# \t\t\"eventTypeId\" => \"\"\n\t\t\t\t\t# \t}, {\n\t\t\t\t\t# \t\t\"name\" => \"Finish\",\n\t\t\t\t\t# \t\t\"eventTypeId\" => \"\"\n\t\t\t\t\t# }]\n\t\t\t\t}],\n\t\t\t}],\n\t\t\t\"shipments\" => [{\n\t\t\t\t\"shipTo\" => {\n\t\t\t\t\t\"name\" => \"John Doe\",\n\t\t\t\t\t\"address1\" => \"5th Avenue\",\n\t\t\t\t\t\"town\" => \"New York\",\n\t\t\t\t\t\"postcode\" => \"12345\",\n\t\t\t\t\t\"state\" => \"New York\",\n\t\t\t\t\t\"isoCountry\" => \"US\",\n\t\t\t\t\t\"email\" => \"johnd@acme.com\",\n\t\t\t\t\t\"phone\" => \"01234567890\"\n\t\t\t\t},\n\t\t\t\t\"carrier\" => {\n\t\t\t\t\t\"code\" => \"customer\",\n\t\t\t\t\t\"service\" => \"shipping\"\n\t\t\t\t}\n\t\t\t}]\n\t\t}\n\t}.to_json()\nend",
"def to_message_with_templates\n {\n attachment:{\n type: self.option_types,\n payload: {\n template_type: \"generic\",\n elements: self.get_templates\n }\n }\n }\n end",
"def data\n templates = @templates.deep_clone\n\n templates.each_pair do |name, value|\n if value['bindings']\n value['bindings'].each_pair do |number, binding|\n value['bindings'][number] = binding.map { |code| eval(code) }\n end\n end\n end\n\n templates\n end",
"def global_template_data\n {'site' => @site, '__design_id' => @design.id, '__site_id' => @site['id']}\n end",
"def set_template\n end",
"def data_struct_template\n @data_struct_template ||= self.class.data_struct_template\n @data_struct_template\n end",
"def create_template\n\n add_breadcrumb \"Download Template\"\n\n # Figure out which approach was used to access this method\n file_content_type = nil\n # From the form. This is managed via a TemplateProxy class\n if params[:template_proxy].present?\n # Inflate the proxy\n template_proxy = TemplateProxy.new(params[:template_proxy])\n Rails.logger.debug template_proxy.inspect\n\n # See if an org was set, use the default otherwise\n if template_proxy.organization_id.blank?\n org = nil\n else\n o = Organization.find(template_proxy.organization_id)\n org = Organization.get_typed_organization(o)\n end\n\n # The form defines the FileContentType which identifies the builder to use\n file_content_type = FileContentType.find(template_proxy.file_content_type_id)\n # asset_types are an array of asset types\n\n elsif params[:targets].present?\n # The request came from the audit results page. We have a list of asset\n # object keys\n file_content_type = FileContentType.find(params[:file_content_type_id])\n assets = Rails.application.config.asset_base_class_name.constantize.operational.where(:object_key => params[:targets].split(','))\n org = nil\n end\n\n is_component = params[:is_component]\n fta_asset_class_id = params[:fta_asset_class_id]\n\n # Find out which builder is used to construct the template and create an instance\n builder = file_content_type.builder_name.constantize.new(:organization => org, :asset_class_name => template_proxy.try(:asset_class_name), :asset_seed_class_id => template_proxy.try(:asset_seed_class_id), :organization_list => @organization_list, :is_component => is_component, :fta_asset_class_id => fta_asset_class_id)\n\n # Generate the spreadsheet. This returns a StringIO that has been rewound\n if params[:targets].present?\n builder.assets = assets\n end\n stream = builder.build\n\n # Save the template to a temporary file and render a success/download view\n file = Tempfile.new ['template', '.tmp'], \"#{Rails.root}/tmp\"\n ObjectSpace.undefine_finalizer(file)\n #You can uncomment this line when debugging locally to prevent Tempfile from disappearing before download.\n @filepath = file.path\n @filename = \"#{org.present? ? org.short_name.downcase : 'MultiOrg'}_#{file_content_type.class_name.underscore}_#{Date.today}.xlsx\"\n begin\n file << stream.string\n rescue => ex\n Rails.logger.warn ex\n ensure\n file.close\n end\n # Ensure you're cleaning up appropriately...something wonky happened with\n # Tempfiles not disappearing during testing\n respond_to do |format|\n format.js\n format.html\n end\n\n end",
"def render_data_map_into(archive)\n full_data_map.each do |remote_path, item|\n if item.is_a? String # case 1: data item is a String\n @log.debug \"Rendering ERB data (#{item[0..16]}...) into archive\"\n data = render_erb_text(item)\n input = StringIO.open(data, 'r')\n size = data.bytes.count\n elsif item.is_a?(File) # case 2: data item is an ERB file\n if item.path.upcase.sub(/\\A.*\\./,'') == 'ERB'\n @log.debug \"Rendering ERB file #{item.path} into archive\"\n data = render_erb_text(item.read)\n input = StringIO.open(data, 'r')\n size = data.bytes.count\n else # case 3: data item is a regular File\n @log.debug \"Copying data from #{item.inspect} into archive\"\n input = item\n size = File.stat(item).size\n end\n else # case 4: Error\n raise ArgumentError.new(\"cannot process item: #{item}\")\n end\n if Bootscript.windows?(@vars)\n archive.put_next_entry remote_path\n archive.write input.read\n else\n opts = {mode: 0600, size: size, mtime: Time.now}\n archive.add_file_simple(remote_path, opts) do |output|\n while data = input.read(512) ; output.write data end\n end\n end\n end\n end",
"def apply_template(data)\n self.class.template.apply(data)\n end",
"def send_templated_push_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: MessagingApi.send_templated_push ...\"\n end\n # resource path\n local_var_path = \"/messaging/templated-push\"\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(opts[:'template_push_resource'])\n auth_names = ['oauth2_client_credentials_grant', 'oauth2_password_grant']\n data, status_code, headers = @api_client.call_api(:POST, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: MessagingApi#send_templated_push\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def create\n \n @user = current_user\n if params[:order_id]\n order = Order.find(params[:order_id])\n order.line_items.each do |item|\n product = Product.find(item.product_id)\n #@template = @user.templates.build(:product => product)\n @template = @user.add_product(product.id)\n if !@template.save\n format.html { render :action => \"new\" }\n format.xml { render :xml => @template.errors, :status => :unprocessable_entity }\n end\n end\n elsif params[:product_id]\n product = Product.find(params[:product_id])\n @template = @user.templates.build(:product => product)\n #@user.add_product(product.id)#Template.new(params[:template])\n if !@template.save\n format.html { render :action => \"new\" }\n format.xml { render :xml => @template.errors, :status => :unprocessable_entity }\n end\n end\n respond_to do |format|\n #if @template.save\n format.html { redirect_to(:back, :notice => 'Шаблоны добавлены') }#redirect_to(@template\n format.xml { render :xml => @template, :status => :created, :location => @template }\n #else\n # format.html { render :action => \"new\" }\n # format.xml { render :xml => @template.errors, :status => :unprocessable_entity }\n #end\n end\n end",
"def generate(page_setup = {})\n Zip::File.open(@template_path) do |template_zip|\n buffer = Zip::OutputStream.write_buffer do |out|\n template_zip.each do |entry|\n out.put_next_entry entry.name\n if @replaceable_files[entry.name] && entry.name == Document.doc_xml_file\n source = entry.get_input_stream.read\n # the source has only 1 sectPr and we change the doc dimensions based on the page setup\n source = replace_dimensions(source, page_setup)\n # Change only the body of document. TODO: Improve this...\n source = source.sub(/(<w:body>)((.|\\n)*?)(<w:sectPr)/, \"\\\\1#{@replaceable_files[entry.name]}\\\\4\")\n out.write(source)\n elsif @replaceable_files[entry.name] && entry.name == Document.header_xml_file\n source = entry.get_input_stream.read\n # Change only the body of document. TODO: Improve this...\n\n Rails.logger.info(\"header before:#{source}\")\n source = source.sub(/<w:tbl>.*<\\/w:tbl>/, \"#{@replaceable_files[entry.name]}\")\n Rails.logger.info(\"header after:#{source}\")\n\n out.write(source)\n # elsif @replaceable_files[entry.name] && entry.name == Document.footer_xml_file\n # source = entry.get_input_stream.read\n # Change only the body of document. TODO: Improve this...\n # Rails.logger.info(\"footer before:#{source}\")\n # source = source.sub(/<w:tbl>.*<\\/w:tbl>/, \"#{@replaceable_files[entry.name]}\")\n # Rails.logger.info(\"footer after:#{source}\")\n # out.write(source)\n\n elsif @replaceable_files[entry.name]\n out.write(@replaceable_files[entry.name])\n Rails.logger.info(\"footer: #{entry.get_input_stream.read}\") if entry.name == Document.footer_xml_file\n elsif entry.name == Document.content_types_xml_file\n raw_file = entry.get_input_stream.read\n content_types = @image_files.empty? ? raw_file : inject_image_content_types(raw_file)\n\n out.write(content_types)\n else\n out.write(template_zip.read(entry.name))\n end\n end\n unless @image_files.empty?\n #stream the image files into the media folder using open-uri\n @image_files.each do |hash|\n out.put_next_entry(\"word/media/#{hash[:filename]}\")\n URI.open(hash[:url], 'rb') do |f|\n out.write(f.read)\n end\n end\n end\n # add the header rels as its not already in the template docx\n out.put_next_entry(Document.header_relations_xml_file)\n out.write(@replaceable_files[Document.header_relations_xml_file])\n # add the footer rels as its not already in the template docx\n out.put_next_entry(Document.footer_relations_xml_file)\n out.write(@replaceable_files[Document.footer_relations_xml_file])\n\n # test creating for the blank header and footer to see if it fixes the error on open\n #\n # out.put_next_entry('word/_rels/header2.xml.rels')\n # out.write(@replaceable_files[Document.header_relations_xml_file])\n # add the footer rels as its not already in the template docx\n # out.put_next_entry('word/_rels/footer2.xml.rels')\n # out.write(@replaceable_files[Document.footer_relations_xml_file])\n\n end\n buffer.string\n end\n end",
"def install_template(file_parts, dest, subs = {})\n content = String.new\n file_parts.each do |file_part|\n full_path = File.join(File.dirname(__FILE__), file_part)\n begin\n content += File.open(full_path).read\n rescue\n end\n end\n subs.keys.each do |k|\n content.gsub!(/#{k}/, subs[k])\n end\n File.open(dest, 'w') {|file| file.write(content)}\n end",
"def template_body\n @template_body ||= stack.to_cf\n end",
"def template_body\n @template_body ||= stack.to_cf\n end",
"def build_image(template)\n tpl_file = template[:template]\n tpl_vars_file = \"#{File.dirname(tpl_file)}/vars.json\"\n sh %{ packer build -var-file=#{tpl_vars_file} -var 'image_version=#{template[:vars]['image_version']}' -var 'image_output_directory=#{File.expand_path(Packer::OUTPUT_DIR)}' #{tpl_file}}\nend",
"def template_export\n @template = Template.find(params[:id])\n\n authorize @template\n # now with prefetching (if guidance is added, prefetch annottaions/guidance)\n @template = Template.includes(\n :org,\n phases: {\n sections: {\n questions: %i[\n question_options\n question_format\n annotations\n ]\n }\n }\n ).find(@template.id)\n\n @formatting = Settings::Template::DEFAULT_SETTINGS[:formatting]\n\n begin\n safe_title = @template.title.gsub(/[^a-zA-Z\\d\\s]/, '').tr(' ', '_')\n file_name = \"#{safe_title}_v#{@template.version}\"\n respond_to do |format|\n format.docx do\n render docx: 'template_exports/template_export', filename: \"#{file_name}.docx\"\n end\n\n format.pdf do\n # rubocop:disable Layout/LineLength\n render pdf: file_name,\n template: 'template_exports/template_export',\n margin: @formatting[:margin],\n footer: {\n center: format(_('Template created using the %{application_name} service. Last modified %{date}'), application_name: ApplicationService.application_name, date: l(@template.updated_at.localtime.to_date, formats: :short)),\n font_size: 8,\n spacing: (@formatting[:margin][:bottom] / 2) - 4,\n right: '[page] of [topage]',\n encoding: 'utf8'\n }\n # rubocop:enable Layout/LineLength\n end\n end\n rescue ActiveRecord::RecordInvalid\n # What scenario is this triggered in? it's common to our export pages\n redirect_to public_templates_path,\n alert: _('Unable to download the DMP Template at this time.')\n end\n end",
"def load_template(uri, method, type = :ServerProfileTemplate)\n return unless uri\n template = load_resource(type, uri: uri)\n template_data = template.send(method, @data['name']).data\n resource['data'] = template_data.merge(@data)\nend",
"def template_params\n params.require(:template).permit(:identifier, :title, :help, :publisher, :variables, :payload, :memory, :count, :last_execute_at, :created_at, :updated_at, :method, :content,:uri, :cache, :checked, :headers, :delimiter, :host, :port, :database, :username, :password, :query, :selectors, :server, :to, :cc, :bcc, :subject, :message)\n end",
"def purchase_template(template_id)\n return false unless can_purchase_templates?\n\n # Copy data from Template\n template = GspTemplate.find(template_id)\n OrganizationTemplate.create :agency => template.agency, :description => template.description,\n :display_name => template.display_name, :frequency => template.frequency,\n :full_name => template.full_name, :objectives => template.objectives,\n :regulatory_review_name => template.regulatory_review_name,\n :purchased_by => self, :organization => self.organization,\n :tasks => template.tasks\n end",
"def default_data_for_template(name)\n {\n :name => name,\n :version => '0.0.1',\n :summary => \"A short description of #{name}.\",\n :homepage => \"http://EXAMPLE/#{name}\",\n :author_name => Executable.capture_command('git', %w(config --get user.name), :capture => :out).first.strip,\n :author_email => Executable.capture_command('git', %w(config --get user.email), :capture => :out).first.strip,\n :source_url => \"http://EXAMPLE/#{name}.git\",\n :ref_type => ':tag',\n :ref => '#{spec.version}',\n }\n end",
"def sync(source_template)\n [ :template_name, :template_type, :template_outfile, :template_rebuild_me, :template_text,\n :template_linked_file, :template_linked_file_mtime, :template_linked_file_size,\n :template_created_on, :template_modified_on, :template_created_by, :template_modified_by,\n :template_build_dynamic ].each do |attribute|\n self[attribute] = source_template[attribute]\n end\n \n # Linked files must be placed in the filesystem appropriately.\n unless self.linked_file.blank?\n blog_root_regex = Regexp.new('(/var/domain/.*/(beta|www))')\n source_blog_root = blog_root_regex.match(source_template.blog.blog_site_path)[1]\n target_blog_root = blog_root_regex.match(self.blog.blog_site_path)[1]\n self[:template_linked_file].gsub!(source_blog_root, target_blog_root)\n end\n \n # Copy templatemaps ONLY if this template has been previously saved.\n unless self.new_record?\n # Delete existing templatemaps.\n self.templatemaps.destroy_all\n \n # Copy templatemaps.\n source_template.templatemaps.each do |source_templatemap|\n self.templatemaps << MovableType::AR::Templatemap.create(self, source_templatemap)\n end\n end\n end",
"def packed()\n body = @action.chr + \n @priv_lvl.chr + \n @authen_type.chr + \n @service.chr + \n @user_len.chr + \n @port_len.chr + \n @rem_addr_len.chr + \n @data_len.chr\n\n body << @user if (@user)\n body << @port if (@port)\n body << @rem_addr if (@rem_addr)\n body << @data if (@data)\n return(body)\n end",
"def template; end",
"def template; end",
"def template; end",
"def template; end",
"def template; end",
"def template; end",
"def template; end",
"def show\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @template_package }\n end\n end",
"def prepare_store\n order = SwaggerClient::Order.new(\"id\" => 10002,\n\t\t \"petId\" => 10002,\n\t\t \"quantity\" => 789,\n\t\t \"shipDate\" => \"2015-04-06T23:42:01.678Z\",\n\t\t \"status\" => \"placed\",\n\t\t \"complete\" => false)\n SwaggerClient::StoreApi.place_order(:body => order)\nend",
"def store_resource_template\n add_pod_disruption_budget\n counter = Hash.new(-1)\n self.resource_template = raw_template.map do |resource|\n index = (counter[resource.fetch(:kind)] += 1)\n TemplateFiller.new(self, resource, index: index).to_hash\n end\n end",
"def get_template_entries\n \n if @template\n Zip::File.open(@template)\n else\n Zip::File.open_buffer(@io.force_encoding(\"ASCII-8BIT\"))\n end\n end",
"def template_params\n params.permit(\n :certificate_serial,\n :identity,\n { template_contents_attributes: [:id, :template_id, :locale, :title, :content] }\n )\n end",
"def template_params\n params.require(:template).permit(:name, :path, elements: [:key, :type, :content])\n end",
"def create_item_template_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: StoreApi.create_item_template ...\"\n end\n # resource path\n local_var_path = \"/store/items/templates\"\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(opts[:'item_template_resource'])\n auth_names = ['oauth2_client_credentials_grant', 'oauth2_password_grant']\n data, status_code, headers = @api_client.call_api(:POST, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'StoreItemTemplateResource')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: StoreApi#create_item_template\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def template_datum_params\n params.require(:template_datum).permit(:data, :template_sublayout_id)\n end",
"def template\n @template ||= Ec2.template({:name =>@name, :key_name => @key_name, :image_id => @image_id, :instance_type => @instance_type, :security_groups => @security_groups})\n end",
"def template_params\n params.require(:template).permit(:name, :description, :template_type, :accounting_plan, :accounting_plan_id)\n end",
"def service_template_params\n params.require(:service_template).permit(:name, :icon, :group_id, :user_id, :raw_config, :desc, :readme)\n end",
"def postprocess(root)\n @root = root\n value = @template.render!(template_data, strict_variables: true)\n @path.open(\"wb\") { |f| f.write(value) }\n end",
"def create_backend_machines_from_template(number_of_machines, first_ip, template)\n ret = []\n (0..number_of_machines-1).each do |i|\n ret.push({\n \"hostname\" => template[\"hostname\"] + \"#{i+1}\",\n \"ip\" => template[\"ip\"] + \"#{i+first_ip}\",\n \"box\" => template[\"box\"],\n \"memory\" => template[\"memory\"],\n \"cpus\" => template[\"cpus\"],\n \"ports\" => template[\"ports\"],\n \"ansible_groups\" => template[\"ansible_groups\"]\n })\n end\n return ret\nend",
"def perform_template_load\n memoize(:template) do\n self.data[:template] = api.stack_template_load(self)\n true\n end\n end",
"def fetch_remote_template_and_store\n template_body = fetch_template_from_url\n\n if template_body\n store_template_to_local_cache( template_body )\n store_template_to_redis( template_body )\n end\n\n return template_body\n end",
"def backup_template( template )\n filename = \"./templates/#{template['id']}.json\"\n file = File.new(filename, \"w\")\n puts \"Backing up #{filename} ...\"\n file.write( template )\n file.close\n end",
"def templates; end",
"def place_order!()\n order_template = virtual_guest_template\n order_template = yield order_template if block_given?\n\n virtual_server_hash = @softlayer_client[:Virtual_Guest].createObject(order_template)\n SoftLayer::VirtualServer.server_with_id(virtual_server_hash['id'], :client => @softlayer_client) if virtual_server_hash\n end",
"def hash_template\n template = {}\n \n info.each do | key, value |\n template[key] = generate_structure( value )\n end\n \n template\n end",
"def template\n return @email unless @email.nil?\n \n #if self[:email].blank?\n #@template = Liquid::Template.parse(email)\n #self[:email] = Marshal.dump(@template)\n # save\n #else\n @email = Marshal.load(self[:email])\n #end\n \n #@email\n end",
"def __partial(source, data)\n Undies::Template.new(source, data, @_undies_output)\n end",
"def build\n {'ShipTimestamp' => ship_timestamp,\n 'DropoffType' => DROPOFF_TYPES[@opts[:dropoff_type]],\n 'ServiceType' => SERVICE_TYPES[@opts[:service_type]],\n 'PackagingType' => PACKAGING_TYPES[@model.package.packaging_type],\n 'Shipper' => PartyBuilder.build(@model.shipper),\n 'Recipient' => PartyBuilder.build(@model.recipient),\n 'ShippingChargesPayment' => shipping_charges_payment,\n 'LabelSpecification' => label_specification,\n 'RateRequestTypes' => RATE_REQUEST_TYPE,\n 'PackageCount' => PACKAGE_COUNT,\n 'RequestedPackageLineItems' => PackageBuilder.build(@model.package),\n :order! => ['ShipTimestamp' , 'DropoffType' , 'ServiceType' , 'PackagingType',\n 'Shipper' , 'Recipient' , 'ShippingChargesPayment', 'LabelSpecification',\n 'RateRequestTypes', 'PackageCount' , 'RequestedPackageLineItems']\n }\n end",
"def initialize_templater\n @stategies = []\n @template_options = {}\n end"
] |
[
"0.700584",
"0.66302973",
"0.6198071",
"0.60476583",
"0.58784616",
"0.58773434",
"0.5842849",
"0.5734649",
"0.569787",
"0.56565857",
"0.5563788",
"0.55553824",
"0.55528766",
"0.554485",
"0.5512602",
"0.55092084",
"0.54714894",
"0.54681224",
"0.5465646",
"0.5441295",
"0.54244745",
"0.5411451",
"0.54077584",
"0.53947675",
"0.53869176",
"0.5384439",
"0.5357233",
"0.5352564",
"0.5352564",
"0.533731",
"0.53309846",
"0.5329163",
"0.5324184",
"0.5321408",
"0.53111446",
"0.53108037",
"0.53081846",
"0.53054625",
"0.5304242",
"0.5299457",
"0.5286773",
"0.52735597",
"0.5267644",
"0.5266375",
"0.524494",
"0.52352554",
"0.523107",
"0.5229902",
"0.52290696",
"0.5218738",
"0.5217742",
"0.52152276",
"0.5200655",
"0.51919055",
"0.51916367",
"0.51857024",
"0.5184792",
"0.5182576",
"0.5181981",
"0.5178473",
"0.51737815",
"0.51737815",
"0.516833",
"0.51591796",
"0.5158736",
"0.51571256",
"0.51559776",
"0.5150045",
"0.51480603",
"0.51395714",
"0.5138307",
"0.5138307",
"0.5138307",
"0.5138307",
"0.5138307",
"0.5138307",
"0.5138307",
"0.5124313",
"0.51231503",
"0.5112283",
"0.5111396",
"0.5092485",
"0.50902295",
"0.5077513",
"0.50709206",
"0.5070546",
"0.50701123",
"0.50665677",
"0.506188",
"0.50598437",
"0.50578743",
"0.50528026",
"0.5049661",
"0.5042595",
"0.50410163",
"0.50368494",
"0.5031703",
"0.50247914",
"0.5016663",
"0.501438"
] |
0.57666487
|
7
|
Convert value to YAML if not string
|
def yamlize(value)
unless(value.is_a?(String))
if(value.is_a?(Hash) && value.respond_to?(:to_hash))
value = value.to_hash
end
value.to_yaml(:header => true)
else
value
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def encode(value)\n value.to_yaml\n end",
"def encode(value)\n value.to_yaml\n end",
"def convert_value\n # Do nothing if value has not changed\n return true unless value_changed?\n # Cast the value and return success\n return parse_string_value(@uncast_value) if @uncast_value.is_a? String\n # Convert the value to yaml otherwise\n v = @uncast_value.to_yaml unless @uncast_value.nil?\n self[:value] = v\n end",
"def yaml_dump(val)\n yml = \"\\n\" + YAML.dump(val)\n yml.gsub(/ +\\n/, \"\\n\")\n end",
"def to_yaml_type \n YAML_TYPE\n end",
"def yaml\n config = fetch(@variable, {})\n stringified = if config.respond_to?(:deep_stringify_keys)\n config.deep_stringify_keys\n else\n # TODO: remove when dropping rails 3 support\n # two level stringify for rails 3 compatibility\n config.stringify_keys.each_value(&:stringify_keys!)\n end\n stringified.to_yaml\n end",
"def from_yaml\n results = YAML.load(self)\n \n # Replace bad values\n if results == false or results == nil\n \"\"\n else\n results\n end\n end",
"def to_yaml() end",
"def decode(value)\n YAML.load(value)\n end",
"def decode(value)\n YAML.load(value)\n end",
"def value\n YAML.load(self[:value]) if self[:value].present?\n end",
"def to_yaml_s\n _value = @value\n @value = highline_question_type.call @value\n x = super\n @value = _value\n x\n end",
"def to_yaml\n as_yaml.to_yaml\n end",
"def to_yaml_s\n fail '@key is empty' if \"#{@key}\".empty?\n\n x = \"=== #{@key} ===\\n\"\n x += \"#{(description || 'FIXME: NO DESCRIPTION GIVEN')}\\n\"\n\n # comment every line that describes the item:\n x = x.each_line.map{ |y| \"# #{y}\" }.join\n\n # add yaml (but stripped of frontmatter and first indent)\n # TODO: should we be using SafeYAML? http://danieltao.com/safe_yaml/\n x += { @key => @value }.to_yaml.gsub(/^---\\s*\\n/m, '').gsub(/^ /, '' )\n x += \"\\n\"\n\n if @skip_yaml\n x.gsub( /^/, '### ' )\n else\n x\n end\n end",
"def yaml_content() = JSON.parse(content.to_json).to_yaml",
"def to_yaml_s(include_auto_warning = false)\n @value = highline_question_type.call @value\n super(include_auto_warning)\n end",
"def value\n YAML::load(self[:value])\n end",
"def value\n YAML::load(self[:value])\n end",
"def value\n YAML::load(self[:value])\n end",
"def to_yaml\n to_parsed.to_yaml\n end",
"def nice_yaml(string)\n YAML.dump(string).gsub(/\\A---\\n/, '')\n end",
"def value=(new_value)\n self[:value] = new_value.to_yaml\n end",
"def value=(new_value)\n self[:value] = new_value.to_yaml\n end",
"def to_yaml\n # write yaml\n end",
"def to_yaml(opts = {})\n return super if defined?(YAML::ENGINE) && !YAML::ENGINE.syck?\n\n YAML.quick_emit(nil, opts) do |out|\n string = to_s\n out.scalar(YAML_TAG, YAML_MAPPING[string] || string, :plain)\n end\n end",
"def paml(x)\n\n puts(YAML.dump(x))\nend",
"def to_yaml(opts = {})\n return super unless defined?(YAML::ENGINE) && YAML::ENGINE.syck?\n\n YAML.quick_emit(nil, opts) do |out|\n string = to_s\n out.scalar(YAML_TAG, YAML_MAPPING[string] || string, :plain)\n end\n end",
"def to_yaml_object\n nil\n end",
"def to_yaml_object\n nil\n end",
"def to_yaml\n YAML.dump(to_h)\n rescue => err\n raise ParseError.new(err), err\n end",
"def to_yaml_s(include_auto_warning = false)\n super(false)\n end",
"def to_yaml\n to_h.to_yaml\n end",
"def to_tmux(value)\n if [:default, :none].include?(value)\n return value.to_s\n end\n end",
"def prepare_value(value)\n return value if value.nil? || value.is_a?(String)\n\n value.to_s\n end",
"def to_yaml\n to_h.to_yaml\n end",
"def value=(new_value)\n self[:value] = new_value.to_yaml\n end",
"def value=(new_value)\n self[:value] = new_value.to_yaml\n end",
"def to_yaml\n to_hash.to_yaml\n end",
"def to_yaml\n to_hash.to_yaml\n end",
"def to_yaml\n to_hash.to_yaml\n end",
"def should_to_s(value)\n value.inspect\n end",
"def should_to_s(value)\n value.inspect\n end",
"def should_to_s(value)\n value.inspect\n end",
"def should_to_s(value)\n value.inspect\n end",
"def should_to_s(value)\n value.inspect\n end",
"def should_to_s(value)\n value.inspect\n end",
"def value\r\n \tbase_value = read_attribute('value')\r\n \t#\r\n \tif ! base_value.nil?\r\n \treturn YAML::load(base_value)\r\n end\r\n return nil\r\n\tend",
"def try_to_s(value, key_name)\n raise Siba::CheckError, \"'#{key_name}' option should be string\" if [Array, Hash].any?{|a| value.is_a?(a)}\n value = value.to_s.strip\n raise Siba::CheckError, \"'#{key_name}' option should not be empty\" if value.empty?\n value\n end",
"def string_to_yaml(str)\n return YAML::load(str)\n end",
"def to_yaml(file=nil)\n hsh = to_hash\n string = hsh.to_yaml\n if file\n File.open(file, 'w') {|v| v.print string }\n end\n string\n end",
"def dump_value(value)\n case value\n when Array\n # dump recursively\n value.map { |v| dump_value v }\n when String\n replace_interpolations value\n else\n nil\n end\n end",
"def typecast_value_string(value)\n case value\n when Hash, Array\n raise Sequel::InvalidValue, \"invalid value for String: #{value.inspect}\"\n else\n value.to_s\n end\n end",
"def clean_value(yaml_content, start, finish)\n value = yaml_content.substring(start, finish)\n\n begin\n YAML.load(value)\n nil\n rescue Psych::SyntaxError => e\n if error_type = error_type_for(e)\n fix(error_type, yaml_content, start, finish, value)\n else\n raise e\n end\n end\n end",
"def to_yaml(opts_={})\n data_ = marshal_dump\n ::YAML.quick_emit(nil, opts_) do |out_|\n out_.map(taguri, to_yaml_style) do |map_|\n map_.add('format', data_[0])\n if data_[1].kind_of?(::String)\n map_.add('value', data_[1])\n map_.add('parse_params', data_[2]) if data_[2]\n else\n map_.add('fields', data_[1])\n map_.add('unparse_params', data_[2]) if data_[2]\n end\n end\n end\n end",
"def value\n if self[:value_type].present?\n case self[:value_type].to_sym\n when :string, :text\n self[:value].to_s\n when :password\n self[:value].to_s\n when :decimal\n BigDecimal.new(self[:value].to_s).round(2, BigDecimal::ROUND_HALF_UP)\n when :integer\n self[:value].to_i\n when :boolean\n (self[:value].to_s =~ /^[t|1]/i) != nil\n else\n self[:value].is_a?(String) ? YAML.load(self[:value]) : self[:value]\n end\n else\n self[:value]\n end\n end",
"def to_yaml\n return @data.to_yaml\n end",
"def dump_value(value)\n case value\n when Array\n # dump recursively\n value.map { |v| dump_value v }\n when String\n replace_interpolations value unless value.empty?\n end\n end",
"def convert(value)\n if value.nil?\n translate(:nil, config.default_value_label_scope)\n elsif value == ''\n translate(:blank, config.default_value_label_scope)\n elsif value == true\n translate(:true, config.default_value_label_scope)\n elsif value == false\n translate(:false, config.default_value_label_scope)\n else\n value.to_s\n end\n end",
"def capfile_cast(val)\n casted_val = Webistrano::Deployer.type_cast(val).class\n\n if casted_val == String\n val.inspect\n elsif casted_val == Symbol\n val.to_s\n elsif casted_val == Array\n val.to_s\n elsif casted_val == Hash\n val.to_s\n elsif (casted_val == TrueClass ) || (casted_val == FalseClass)\n val\n elsif casted_val == NilClass\n 'nil'\n end\n end",
"def to_yaml\n to_hash.to_yaml\n end",
"def auto_convert_value(value)\n return nil if value.nil?\n\n if data_type == Array\n return value.split(',') if value.kind_of?(String)\n elsif data_type == Integer\n return value.to_i if value.to_i.to_s == value.to_s\n elsif data_type == Float\n return value.to_f if value.to_f.to_s == value.to_s\n elsif allow_shell_conversion\n return value.shelljoin if value.kind_of?(Array)\n return value.map { |k, v| \"#{k.to_s.shellescape}=#{v.shellescape}\" }.join(' ') if value.kind_of?(Hash)\n elsif data_type == Hash && value.kind_of?(String)\n begin\n parsed = JSON.parse(value)\n return parsed if parsed.kind_of?(Hash)\n rescue JSON::ParserError\n end\n elsif data_type != String\n # Special treatment if the user specified true, false or YES, NO\n # There is no boolean type, so we just do it here\n if %w(YES yes true TRUE).include?(value)\n return true\n elsif %w(NO no false FALSE).include?(value)\n return false\n end\n end\n # rubocop:enable Metrics/PerceivedComplexity\n\n return value # fallback to not doing anything\n end",
"def to_yaml\n require 'yaml'\n self.config.to_hash.to_yaml\n end",
"def yaml(hash)\n method = hash.respond_to?(:ya2yaml) ? :ya2yaml : :to_yaml\n string = hash.deep_stringify_keys.send(method)\n# string.gsub(\"!ruby/symbol \", \":\").sub(\"---\",\"\").split(\"\\n\").map(&:rstrip).join(\"\\n\").strip\nend",
"def to_yaml\n self.to_h.to_yaml\n end",
"def to_yaml\n self.to_h.to_yaml\n end",
"def to_string_or_binary(value)\n encoding = value.encoding\n if encoding == Encoding::ASCII_8BIT\n Puppet::Pops::Types::PBinaryType::Binary.from_binary_string(value).to_s\n else\n # Transform to UTF-8 (do not assume UTF-8 is correct) with source invalid byte\n # sequences and UTF-8 undefined characters replaced by the default unicode uFFFD character\n # (black diamond with question mark).\n value.encode(Encoding::UTF_8, encoding, :invalid => :replace, :undef => :replace)\n end\n end",
"def to_yaml\n kitchen_config.to_yaml.gsub(/---[ \\n]/, '')\n end",
"def yaxml2yaml yaxml, options\r\n data = YAXML::yaxml2yaml(yaxml)\r\n\r\n if ENCODINGS.include?(options[:source_encoding])\r\n data = data.encode(options[:target_encoding], options[:source_encoding], :replace => '?')\r\n else\r\n data = data.encode(\"UTF-8\")\r\n end\r\n\r\n data\r\n end",
"def deserialize_value\n if @value.nil?\n @value = read_attribute :value\n end\n\n case value_type\n when SUPPORTED_TYPES[:Object] # or Hash, Array, etc.\n @value = YAML::load @value\n when SUPPORTED_TYPES[:Symbol]\n @value = @value.to_sym\n when SUPPORTED_TYPES[:Integer] # or Fixnum, Bignum\n @value = @value.to_i\n when SUPPORTED_TYPES[:Float]\n @value = @value.to_f\n when SUPPORTED_TYPES[:Complex]\n @value = Complex @value\n when SUPPORTED_TYPES[:Rational]\n @value = Rational @value\n when SUPPORTED_TYPES[:Boolean]\n @value = (@value == \"true\")\n else\n @value\n end\n end",
"def to_yaml()\n @var_set.values.to_yaml\n end",
"def format_value_to_string(value)\n value.dump\n end",
"def unescape(s)\n YAML.load(%Q(---\\n\"#{s}\"\\n))\nend",
"def convert_value(value)\n value.to_s\n end",
"def to_yaml\n dump(:x)\n end",
"def bare_yaml\n return \"\" unless present?\n yaml = to_yaml\n\n # Detect single-line libyaml 0.2.1 scalar and remove trailing newline\n return yaml.sub(/\\A--- ([^\\n]+)\\n\\Z/m, '\\1') if yaml.single_line_ending_in_newline?\n\n yaml.sub(/\\A---[ \\n]/, \"\") # Handle header for multi-line yaml snippets\n .sub(/(\\n\\.\\.\\.\\n)?\\Z/m, \"\") # Handle libyaml 0.1.7 end of stream marker\n end",
"def to_yaml_s(include_auto_warning = false)\n raise InternalError.new( \"@key is empty for #{self.class}\" ) if \"#{@key}\".empty?\n\n x = \"=== #{@key} ===\\n\"\n x += \"#{(description || 'FIXME: NO DESCRIPTION GIVEN')}\\n\"\n if include_auto_warning && @skip_query && @silent\n x += auto_warning\n end\n\n # comment every line that describes the item:\n x = x.each_line.map{ |y| y.strip.empty? ? \"#\\n\" : \"# #{y}\" }.join\n\n # add yaml tag directive for just the <key,value> pair\n x += pair_to_yaml_tag(@key, @value)\n x += \"\\n\"\n\n if @skip_yaml\n nil\n else\n x\n end\n end",
"def yaml\n @config.to_yaml\n end",
"def to_yaml\n result = { }\n @result.each{ |nam, infi|\n value = infi.value\n value = value.shift if value.kind_of?(Array) and value.size == 1\n result[nam] = value\n }\n result[:metadata] = metadata\n result = tlog.textfilter.apply(nil, :yaml, result.dup)\n result.to_yaml\n end",
"def to_yaml_type\n \"!hobix.com,2004/weblog\"\n end",
"def serialize(value)\n begin\n [::Marshal.dump(value)].pack('m')\n rescue\n if options[:display_warnings] === true\n Ramaze::Log::warn(\"Failed to serialize #{value.inspect}\")\n end\n\n return nil\n end\n end",
"def serialize(value)\n begin\n [::Marshal.dump(value)].pack('m')\n rescue\n if options[:display_warnings] === true\n Ramaze::Log::warn(\"Failed to serialize #{value.inspect}\")\n end\n\n return nil\n end\n end",
"def y(obj)\n puts obj.to_yaml\nend",
"def y(obj)\n puts obj.to_yaml\nend",
"def convert_spec(yaml_spec)\n YAML.load(reduce_spec(yaml_spec)) or\n\traise \"Didn't get a valid YAML document\"\n end",
"def to_yaml(opts={})\n YAML.quick_emit(nil, opts) do |out|\n out.scalar(taguri, to_h, :plain)\n end\n end",
"def to_yaml(arg = {})\n \"subfield: #{name} #{object_id}\".to_yaml(arg)\n end",
"def stringify(value)\n case value\n when Array\n value.map { |element| stringify(element) }\n when Hash\n value.each_with_object({}) do |(k, v), o|\n o[stringify(k)] = stringify(v)\n end\n when EvaluableString\n value.value\n else\n value\n end\n end",
"def typecast_value_string(value)\n value.to_s\n end",
"def preprocess_value(value)\n if value.is_a?(Array)\n # Recurse!\n return value.map { |item| preprocess_value(item) }\n elsif value.is_a?(String)\n # Some 'Strings' in YAML are actually intended to be regexps\n if value[0] == '/' && value[-1] == '/'\n # '/foo/' => %r{foo}\n return Regexp.new(value[1..-2])\n elsif value[0] == '/' && value[-2..-1] == '/i'\n # '/foo/i' => %r{foo}i\n return Regexp.new(value[1..-3], Regexp::IGNORECASE)\n end\n end\n value\n end",
"def to_yaml\n self.to_h.deep_stringify_keys.compact.to_yaml\n end",
"def unserialize_value(value)\n value\n end",
"def format_value(category, field, value)\n if YAML_FIELDS.key?(category) && YAML_FIELDS[category].include?(field)\n return {} if value.nil?\n return YAML.load(value)\n elsif INT_FIELDS.key?(category) && INT_FIELDS[category].include?(field)\n return {} if value.nil?\n return value.to_i\n elsif NUM_FIELDS.key?(category) && NUM_FIELDS[category].include?(field)\n return {} if value.nil?\n return value.to_f\n end\n\n value\n end",
"def yaml( *args )\n ::Logging::Layouts::Parseable.yaml(*args)\n end",
"def string_to_dump(value)\n parsed_value = Liquid::Template.parse(value)\n Base64.strict_encode64(Marshal.dump(parsed_value))\nend",
"def user_values\n value_of(:user_values, method(:nice_yaml))\n end",
"def clean_yaml(yaml_input)\n yaml_output = yaml_input\n\n # Had some issues with different versions of ruby giving different results\n yaml_output.gsub!(%r(!ruby/sym(bol)? ), ':')\n\n # Also, some versions appear to dump out trailing whitespace\n yaml_output.gsub!(/\\s+$/, '')\n\n return yaml_output\n end",
"def yaml\n @yaml ||= has_yaml? ? YAML.load(@content) : {}\n end",
"def to_yaml(options = {})\n to_a(options).to_yaml\n end",
"def xml_format_value(value)\n case value\n when Hash\n xml_format(value)\n when Array\n value.map{|v| xml_format_value(v)}\n else\n value.strip!\n if(value == 'true')\n true\n elsif(value == 'false')\n false\n elsif(value.to_i.to_s == value)\n value.to_i\n elsif(value.to_f.to_s == value)\n value.to_f\n else\n value\n end\n end\n end",
"def to_yaml\n require \"yaml\"\n @configuration.to_yaml\n end"
] |
[
"0.7177733",
"0.7177733",
"0.6996034",
"0.68543994",
"0.66615325",
"0.64646274",
"0.6410558",
"0.64088476",
"0.6400503",
"0.6400503",
"0.62958807",
"0.6258902",
"0.6179016",
"0.6161546",
"0.6064578",
"0.6059684",
"0.6043071",
"0.6043071",
"0.60403097",
"0.60242605",
"0.6000488",
"0.5995161",
"0.5995161",
"0.5981698",
"0.5971856",
"0.59331197",
"0.593091",
"0.5888043",
"0.5888043",
"0.58800894",
"0.5852043",
"0.58237",
"0.5818912",
"0.58048403",
"0.58001256",
"0.57967573",
"0.57967573",
"0.5757948",
"0.5756671",
"0.5756671",
"0.5717373",
"0.5717373",
"0.5717373",
"0.5717373",
"0.5717373",
"0.5717373",
"0.5710944",
"0.56725675",
"0.5669697",
"0.56603575",
"0.56571174",
"0.56550056",
"0.5633829",
"0.56289864",
"0.56232345",
"0.56228006",
"0.5612188",
"0.56098604",
"0.56008416",
"0.5580428",
"0.55532444",
"0.55085665",
"0.546952",
"0.54689",
"0.54689",
"0.5460862",
"0.5458005",
"0.5432524",
"0.5428409",
"0.54234654",
"0.5417171",
"0.5414416",
"0.5404716",
"0.54021424",
"0.54011744",
"0.53945655",
"0.5373693",
"0.5355646",
"0.53480095",
"0.5346341",
"0.5346341",
"0.5329461",
"0.5329461",
"0.53097117",
"0.53058624",
"0.5303195",
"0.5289898",
"0.52859426",
"0.52728176",
"0.52665645",
"0.52658874",
"0.5258051",
"0.52577883",
"0.5256547",
"0.5256489",
"0.5247743",
"0.5243043",
"0.5236792",
"0.5235216",
"0.52196765"
] |
0.72765696
|
0
|
Unpack received template data for local model instance
|
def template_data_format(data)
data = data.to_smash
Smash.new.tap do |result|
result[:config] = data.fetch(:config, Smash.new)
result[:imports] = data.fetch(:imports, []).map do |item|
begin
Smash.new(
:name => item[:name],
:content => YAML.load(item[:content])
)
rescue
item
end
end
if(result.get(:config, :content))
result[:config][:content] = YAML.load(result[:config][:content]) || Smash.new
else
result[:config][:content] = Smash.new
end
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def template_data_unformat(data)\n Hash.new.tap do |result|\n if(v = data.to_smash.get(:config, :content))\n result[:config] = {\n :content => yamlize(v)\n }\n end\n if(data[:imports])\n result[:imports] = data[:imports].map do |item|\n Smash.new(\n :name => item['name'],\n :content => yamlize(item['content'])\n )\n end\n end\n end\n end",
"def data\n templates = @templates.deep_clone\n\n templates.each_pair do |name, value|\n if value['bindings']\n value['bindings'].each_pair do |number, binding|\n value['bindings'][number] = binding.map { |code| eval(code) }\n end\n end\n end\n\n templates\n end",
"def process_template(tmpl, vars)\n require \"erb\"\n\n ERB\n .new(tmpl, trim_mode: \"%\")\n .public_send(vars.is_a?(Binding) ? :result : :result_with_hash, vars)\n end",
"def load\n template_data = response_data['template']\n\n @data = response_data['data']\n @template = Template.new(\n template_data['src'], template_data['type'], template_data['key']\n )\n\n super\n end",
"def load_template!\n feed = self\n eval(File.read(@file))\n end",
"def initialize_template(record)\n\n end",
"def unpack(data); end",
"def get_template(template); end",
"def get_template(data)\n return data if data.is_a?(String)\n\n data.fetch('conf', nil)\nend",
"def fetch_template\n template_body = fetch_template_from_local_cache\n template_body ||= fetch_template_from_redis\n template_body ||= fetch_remote_template_and_store\n template_body ||= store_template_to_local_cache( self.default_template,\n self.local_cache_negative_ttl )\n\n return template_body \n end",
"def load_template(template)\n IO.read(template).chomp\n end",
"def data_struct_template\n @data_struct_template ||= self.class.data_struct_template\n @data_struct_template\n end",
"def inject_data(template)\n template['$INJECT_DATA'] = model.to_json\n template\n end",
"def stack_template_load(stack)\n if(stack.persisted?)\n result = request(\n :endpoint => stack.custom.fetch(:manifest, stack.custom.get(:update, :manifest))\n )\n cache_template = stack.template = template_data_format(result[:body])\n stack.custom = stack.custom.merge(result[:body])\n if(stack.custom['expandedConfig'])\n stack.custom['expandedConfig'] = YAML.load(stack.custom['expandedConfig']).to_smash\n end\n if(stack.custom['layout'])\n stack.custom['layout'] = YAML.load(stack.custom['layout']).to_smash\n end\n stack.valid_state\n cache_template\n else\n Smash.new\n end\n end",
"def setup_template_variables(rid)\n @rid = rid\n @request_data = JSON.parse @rid.request_data\n @response_data = JSON.parse @rid.response_data\n end",
"def template(&block)\n mod = representable_attrs.collection_representers[:object_template] = Module.new do\n include Roar::Representer::JSON\n include Roar::Representer::JSON::CollectionJSON::DataMethods\n \n extend PropertyWithRenderNil\n\n module_exec(&block)\n\n #self.representation_wrap = :template\n def from_hash(hash, *args) # overridden in :template representer.\n super(hash[\"template\"])\n end\n end\n\n representable_attrs.collection_representers[:template] = Module.new do\n include Roar::Representer::JSON\n include mod\n\n #self.representation_wrap = false\n\n # DISCUSS: currently we skip real deserialization here and just store the :data hash.\n def from_hash(hash, *args)\n replace(hash[\"data\"])\n end\n end\n end",
"def pack_template\n selfclass.pack_template\n end",
"def template_field_params\n # be sure that unless you have column name/alias weirdness, references to parent/child objects should be \":template\" not \":template_id\"\n ActiveModelSerializers::Deserialization.jsonapi_parse(params, only: [:template, :field, :order_num, :update_by, :insert_by, :update_time, :insert_time])\n end",
"def get_fields(template); end",
"def from_template(template_file, **template_values)\n namespace = OpenStruct.new(template_values)\n template = ERB.new(File.read(template_file))\n new_contents = template.result(namespace.instance_eval { binding })\n\n @unwritten_contents = new_contents\n end",
"def fetch_remote_template_and_store\n template_body = fetch_template_from_url\n\n if template_body\n store_template_to_local_cache( template_body )\n store_template_to_redis( template_body )\n end\n\n return template_body\n end",
"def initialize _template = Template.new('')\n @items = []\n @template = _template\n @format = @template.format\n @environments = @template.environments\n end",
"def unpack\n Variable.new @container.container\n end",
"def template_attributes\n return if params[:template_id].blank?\n RecordTemplate.find(params[:template_id]).record_content\n end",
"def template\n return @email unless @email.nil?\n \n #if self[:email].blank?\n #@template = Liquid::Template.parse(email)\n #self[:email] = Marshal.dump(@template)\n # save\n #else\n @email = Marshal.load(self[:email])\n #end\n \n #@email\n end",
"def loadTemplate\n\t\t@template = File.read(@templateFile)\n\tend",
"def loadTemplate\n\t\t@template = File.read(@templateFile)\n\tend",
"def details\n data = Storm::Base::SODServer.remote_call '/Storm/Template/details',\n :id => @id\n self.from_hash data\n end",
"def apply_template(data)\n self.class.template.apply(data)\n end",
"def deal_template_1(_param=nil, _template='')\n\t\tsip_header = _param['sip_header']\n\t\tvalue = _param['value']\n\t\tvalue_class = _param['value_class']\n\t\tvalue_process = ValueProcess.new(value);\n\t\tvalue_res = value_process.transValue\n\t\tif _template[/\\{\\?#{sip_header}\\?.*?\\}/]!=nil\n\t\t\t_template[/\\{\\?#{sip_header}\\?.*?\\}/] = value_res\n\t\tend\n\t\t# p _template\n\t\t_template\n\tend",
"def populate_template( template_id, imported_template )\n puts \"Populating new tempalte id: #{template_id}...\"\n\n uri = URI(@config['endpoint']+\"/#{template_id}/versions\")\n\n # Retrieve templates\n http = Net::HTTP.new( uri.host,uri.port )\n http.use_ssl = true\n request = Net::HTTP::Post.new( uri.request_uri, initheader = {'Content-Type:' => 'application/json'} )\n request.basic_auth(@secondary_username, @secondary_password)\n\n\n # If versions exist, transfer each to new template\n imported_template['versions'].each do |version|\n version.delete(\"id\")\n version.delete(\"user_id\")\n version.delete(\"template_id\")\n version.delete(\"updated_at\")\n\n puts \" Adding template version #{version['name']}...\"\n payload = version.to_json\n request.body = payload\n response = http.request( request )\n response_message = JSON.parse( response.body )\n end\n end",
"def process_template name, src, type, called_from = nil, file_name = nil\n case type\n when :erb\n result = ErbTemplateProcessor.new(@tracker, name, called_from, file_name).process src\n when :haml\n result = HamlTemplateProcessor.new(@tracker, name, called_from, file_name).process src\n when :erubis\n result = ErubisTemplateProcessor.new(@tracker, name, called_from, file_name).process src\n when :slim\n result = SlimTemplateProcessor.new(@tracker, name, called_from, file_name).process src\n else\n abort \"Unknown template type: #{type} (#{name})\"\n end\n\n # Each template which is rendered is stored separately\n # with a new name.\n if called_from\n name = (\"#{name}.#{called_from}\").to_sym\n end\n\n @tracker.templates[name].src = result\n @tracker.templates[name].type = type\n end",
"def _parse(template_file)\n\t\tif(!@contents)\n\t\t\t@contents = SifterTemplate.new(self, template_file)\n\t\telse\n\t\t\t@contents.template_file = template_file\n\t\tend\n\n\t\treturn @contents._parse()\n\tend",
"def extract_params(template, path)\n template.extract(path, BlogTemplateProcessor)\n end",
"def fill_template\n @log.debug(\"Reading erb template from file: '#{@template}'.\")\n erb = ERB.new(File.read(@template), nil, '-')\n erb.filename = @template\n erb.result(binding)\n end",
"def convert_template!\n tag! \"template\" do\n convert_s! \"name?\"\n if @version >= 119\n convert_id!\n end\n\n convert_array! \"subtemplates\" do\n convert_subtemplate!\n end\n\n convert_array! \"children\" do\n convert_uientry_gen2!\n end\n\n out_ofs! \"end of template?\"\n end\n end",
"def unpack format\n @b.unpack format\n end",
"def fetch(uid, *args)\n temp_object = ExtendedTempObject.new(datastore.retrieve(uid), self)\n temp_object.transform(*args)\n end",
"def __partial(source, data)\n Undies::Template.new(source, data, @_undies_output)\n end",
"def serializable_data\n template = self.class.find(self.id,:include=>[:param_values,:page_layout=>:full_set_nodes])\n hash ={:template=>template, :param_values=>template.param_values, :page_layouts=>template.page_layout.full_set_nodes,\n :template_files=>template.template_files,:template_releases=>template.template_releases\n } \n hash \n end",
"def unpack(message)\n payload = super\n if(self.is_a?(Jackal::Cfn::Resource))\n begin\n if(payload['Message'])\n payload = MultiJson.load(payload['Message']).to_smash\n payload = transform_parameters(payload)\n payload[:origin_type] = message[:message].get('Body', 'Type')\n payload[:origin_subject] = message[:message].get('Body', 'Subject')\n payload[:request_type] = snakecase(payload[:request_type])\n payload\n else\n payload.to_smash.fetch('Attributes', 'Body', payload.to_smash.fetch('Body', payload.to_smash))\n end\n rescue MultiJson::ParseError\n # Not our expected format so return empty payload\n Smash.new\n end\n else\n payload.to_smash.fetch('Attributes', 'Body', payload.to_smash.fetch('Body', payload.to_smash))\n end\n end",
"def templates=(_arg0); end",
"def template\n @mail_template = MailTasks::Template.find_or_new( params[:id] )\n\n # For GET\n (render && return) if request.get?\n \n # For Preview\n if params[:commit].downcase == \"preview\"\n @mail_template.attributes = params[:mail_template]\n render :text => @mail_template.content_for_preview( mail_layout_options )\n return\n end\n \n # For Create / Update\n @mail_template.attributes = params[:mail_template]\n @mail_template.variables = params[:variables]\n if @mail_template.save\n flash[:notice] = \"Template \\\"#{@mail_template.name}\\\" has been saved successfully!\"\n redirect_to :back\n else\n flash.now[:notice] = @mail_template.errors.full_messages.join(\"<br />\")\n render\n end\n end",
"def initialize (template); @template = template; end",
"def new_template_model\n type = attr_json_registration.type\n if type.is_a?(AttrJson::Type::Array)\n type = type.base_type\n end\n\n if type.is_a?(AttrJson::Type::Model)\n type.cast({})\n else\n nil\n end\n end",
"def data_struct # :yields: arguments\n ud_args = {}\n yield ud_args\n if data_struct_template.nil?\n OpenStruct.new(ud_args)\n else\n args_list = data_struct_template.members.map { |a| ud_args[a] }\n data_struct_template.new(*args_list)\n end\n end",
"def unpacked_data(response_body)\n if @accept_type.upcase == 'JSON'\n data = JSON.parse(@response.body)['data']\n elsif @accept_type.upcase == 'XML'\n data = Hash.from_xml(@response.body)['response']['data']['template']\n end\n return data.is_a?(Array) ? data : [data]\nend",
"def render(template_name, template_vars = {})\n template_file = File.join(File.dirname(__FILE__), 'fixtures', 'requests', \"#{template_name}.xml\")\n raise TrufinaException.new(\"Unable to find fixture file: #{template_file}\") unless File.exists?(template_file)\n \n template_binding_object = OpenStruct.new(template_vars)\n\n template = ERB.new(File.read(template_file))\n template.result(template_binding_object.get_binding)\nend",
"def build_from_template(template, data = {}, layout = true)\n cont = File.read(template_file(template)).miga_variables(data)\n return cont unless layout\n\n build_from_template(\n 'layout.html',\n data.merge(content: cont, project_name: cli.load_project.name),\n false\n )\n end",
"def unpack\n if ! @unpacked && @sec_buffer && @struct\n dataBufferSize, dType, dataBuffer, tokenBufferSize, tType, tokenBuffer = @sec_buffer.unpack(\"LLPLLP\")\n dataBufferSize, dType, dataBuffer, tokenBufferSize, tType, tokenBuffer = @sec_buffer.unpack(\"LLP#{dataBufferSize}LLP#{tokenBufferSize}\")\n @buffer = dataBuffer\n @struct = nil\n @sec_buffer = nil\n @unpacked = true\n end\n end",
"def render_template_with_locals(abs_name, locals = {})\r\n template = File.read(File.join( abs_name) )\r\n ERB.new(template, nil, \"-\").result(OpenStruct.new(locals).send(:binding))\r\nend",
"def update!(**args)\n @data_object = args[:data_object] if args.key?(:data_object)\n @ignore_data_object = args[:ignore_data_object] if args.key?(:ignore_data_object)\n @src = args[:src] if args.key?(:src)\n @templatetype = args[:templatetype] if args.key?(:templatetype)\n end",
"def template_params\n params.fetch(:template, {}).permit([:title, :data])\n end",
"def from data\n obj = new\n obj.decode data\n obj\n end",
"def fill_form(template, destination, data = T.unsafe(nil), fill_options = T.unsafe(nil)); end",
"def pack_template\n if self.to_s =~ /^.*<(.*):0x.*/\n clsname = $1\n else\n clsname = self.to_s\n end\n \n Util.pack_template_from( @struct_internal_format, clsname )\n end",
"def provider_template(template, options)\n require 'erb'\n require 'ostruct'\n ERB.new(File.read(template)).result(\n OpenStruct.new(options).instance_eval {binding}\n )\n end",
"def perform_template_load\n memoize(:template) do\n self.data[:template] = api.stack_template_load(self)\n true\n end\n end",
"def retrieve_placeholders\n @template = LoadTemplate.new(directory: @dir, template: 'Bond Style')\n @template.process \n @template = @template.result\n end",
"def extract_model_data!(prm, compact: true, **opt)\n opt[:log] = false unless opt.key?(:log)\n fields = prm.delete(model_key)\n if (fields &&= json_parse(fields, **opt))\n model_data_params.each_pair do |hash_key, url_param|\n value = fields.delete(hash_key)\n prm[url_param] = json_parse(value, **opt) if value\n end\n prm.merge!(fields)\n end\n compact ? reject_blanks!(prm) : prm\n end",
"def raw\n @template\n end",
"def process_data(model, data)\n data.deep_symbolize_keys!\n @compiled_data << model.new(data) unless data.empty?\n end",
"def inflate(data); end",
"def replaceVariables\n\t\t@template = @template.gsub! \"###namespace###\", @namespace\n\t\t@template = @template.gsub! \"###model-name###\", @modelName\n\t\t@template = @template.gsub! \"###properties###\", @properties\n\tend",
"def unpack_byteslice(template, bytes_count)\n @content.byteslice(@cursor, bytes_count).unpack(template).first\n end",
"def parse(source)\n template = Template.new\n template.parse(source)\n template\n end",
"def initialize(template, attributes={})\n @template = case template\n when ERB\n # matching w/wo the coding effectively checks @src\n # across ruby versions (encoding appears in 1.9)\n if template.instance_variable_get(:@src) !~ /^(#coding:US-ASCII\\n)?_erbout =/\n raise ArgumentError, \"Templater does not work with ERB templates where eoutvar != '_erbout'\"\n end\n template\n when String then ERB.new(template, nil, \"<>\")\n else raise ArgumentError, \"cannot convert #{template.class} into an ERB template\"\n end\n \n src = @template.instance_variable_get(:@src)\n @template.instance_variable_set(:@src, \"self.\" + src) \n\n super(attributes)\n end",
"def fill_old(params={})\n params.each do |key,value|\n instance_variable_set(\"@#{key}\".to_sym,value)\n end\n self.body = (template).result binding\n self.body\n end",
"def read(template, bytes_count = nil)\n return if @cursor > @content.bytesize\n result = unpack_byteslice(template, bytes_count)\n @cursor += bytes_count\n result\n end",
"def deal_template_2(_template='')\n\t\ttemplate = _template\n\t\twhile template[/\\{\\?.*?\\?([\\n\\r]*.*?)\\}/] != nil\n\t\t\ttemplate[/\\{\\?.*?\\?([\\n\\r]*.*?)\\}/]= $1\n\t\tend\n\t\ttemplate\n\tend",
"def template\n @template ||= File.read(template_full_path)\n end",
"def template\n @part.content\n end",
"def load_template(uri, method, type = :ServerProfileTemplate)\n return unless uri\n template = load_resource(type, uri: uri)\n template_data = template.send(method, @data['name']).data\n resource['data'] = template_data.merge(@data)\nend",
"def read_template_file\n raise 'This is a generic store. Please use a subclass.'\n end",
"def _run_tpl(ctx, obj, sym, args={}, &block)\n Tanuki::Loader.run_template(ctx.templates, obj, sym, args, &block)\n end",
"def variables\r\n if self.template.nil?\r\n template_variables = Template.detect_variables( self.get_template )\r\n else\r\n template_variables = self.template.variables\r\n end\r\n original_variables = self.attributes[\"variables\"] || {}\r\n original_variables.each do |key, value|\r\n template_variables[key] = value if template_variables.keys.include?( key )\r\n end\r\n return template_variables\r\n end",
"def prepare_data(params)\n build_ingest_form\n build_uploader(params[:upload], params[:upload_cache])\n build_asset(params[:id], params[:template_id])\n assign_form_attributes(params)\n find_unmapped_rdf\n end",
"def template\n raise \"Template was not loaded: #{@template}\" if !@loadOK\n @template\n end",
"def interpret\n url_params = self.params\n return unless url_params\n \n # parts is now a string instead of an array so we will split\n # it ourselves.\n if parts = url_params[:parts]\n parts = parts.split('/') if parts\n end\n \n # The render template will always be stored\n # in the renders_with option in the params.\n template = url_params[:renders_with]\n \n # We will also see if there is a channel \n # with the same name as the template.\n self.channel = ((only_public) ? Channel.all_public.find_by_slug(template) : Channel.find_by_slug(template)) if template\n \n return unless parts && parts.size > 0\n \n # first part after the template can either be\n # an article (which will take precedence over a category),\n # a category (which will take precedence over a date),\n # or a year\n first_part = parts.shift\n \n self.article = (only_public) ? Article.published.find_by_slug(first_part) : Article.find_by_slug(first_part)\n \n # If we have an article then we we will remove the article\n # slug part and save the rest of the parts in extra_parts\n self.extra_parts = parts if self.article\n return if self.article\n \n # The first part could also be a category if it wasn't\n # an article.\n self.category = Category.find_by_slug(first_part)\n # If we have a category then unless the \n # next part is a date then we are done.\n self.extra_parts = parts if self.category\n \n \n end",
"def locals\n from_context = Sinatra::IndifferentHash[\n issue_id: context.issue_id,\n issue_author: context.issue_author,\n repo: context.repo,\n sender: context.sender,\n bot_name: bot_name ]\n from_body = get_data_from_issue(params[:data_from_issue])\n\n from_body.merge from_context\n end",
"def parse_template(path)\n render(File.read(path))\n end",
"def process_template(template)\n @dlogger.debug \"Processing template #{template} for file #{@file}\"\n # The '-' arg allows folks to use <% -%> or <%- -%> to instruct ERB to\n # not insert a newline for that line, which helps avoid a bunch of blank\n # lines in the processed file where there was code in the template.\n erb = ERB.new(IO.read(template), nil, '-')\n # The binding arg ties the template's namespace to this point in the\n # code, thus ensuring that all of the variables above (@file, etc.)\n # are visible to the template code.\n begin\n erb.result(binding)\n rescue Exception => e\n # Help the user figure out where the exception occurred, otherwise they\n # just get told it happened here, which isn't very helpful.\n raise Etch.wrap_exception(e, \"Exception while processing template #{template} for file #{@file}:\\n\" + e.message)\n ensure\n restore_globals\n end\n end",
"def load_template_innerds(name)\n body = @loader.load_compiled(name)\n body.split(\"\\n\")[1..-2].join(\"\\n\")\n end",
"def update_template(key, value)\n t = { key => value }\n raw = read_attribute(\"template\") \n d = raw.nil? ? {} : JSON.parse(raw) \n merged = d.deep_merge(t)\n self.template = JSON.generate(merged)\n self.save!\n end",
"def prepare\n model.tap do |p|\n p.name = name\n p.identifier = set_identifiers\n p.meta = set_meta\n end\n end",
"def prepare\n model.tap do |p|\n p.name = name\n p.identifier = set_identifiers\n p.meta = set_meta\n end\n end",
"def extract_template_vars\n return self.command.scan(/{{([a-z0-9\\-_]+?)}}/i).flatten\n end",
"def prepare_liquid_template(template)\n end",
"def inflate_model(row_data)\n created_at = row_data[:created_at]\n user = Models::User.load(map_from_row!(row_data))\n user.persisted!\n user\n end",
"def update!(**args)\n @deidentify_template = args[:deidentify_template] if args.key?(:deidentify_template)\n @inspect_template = args[:inspect_template] if args.key?(:inspect_template)\n end",
"def update!(**args)\n @deidentify_template = args[:deidentify_template] if args.key?(:deidentify_template)\n @inspect_template = args[:inspect_template] if args.key?(:inspect_template)\n end",
"def _template\n @template\n end",
"def sync(source_template)\n [ :template_name, :template_type, :template_outfile, :template_rebuild_me, :template_text,\n :template_linked_file, :template_linked_file_mtime, :template_linked_file_size,\n :template_created_on, :template_modified_on, :template_created_by, :template_modified_by,\n :template_build_dynamic ].each do |attribute|\n self[attribute] = source_template[attribute]\n end\n \n # Linked files must be placed in the filesystem appropriately.\n unless self.linked_file.blank?\n blog_root_regex = Regexp.new('(/var/domain/.*/(beta|www))')\n source_blog_root = blog_root_regex.match(source_template.blog.blog_site_path)[1]\n target_blog_root = blog_root_regex.match(self.blog.blog_site_path)[1]\n self[:template_linked_file].gsub!(source_blog_root, target_blog_root)\n end\n \n # Copy templatemaps ONLY if this template has been previously saved.\n unless self.new_record?\n # Delete existing templatemaps.\n self.templatemaps.destroy_all\n \n # Copy templatemaps.\n source_template.templatemaps.each do |source_templatemap|\n self.templatemaps << MovableType::AR::Templatemap.create(self, source_templatemap)\n end\n end\n end",
"def from_template(template, &block)\n if template.is_a?(Array)\n template.map { |tpl| from_template(tpl, &block) }\n else\n new_attrs = template.slice(*🌊[:columns])\n template.slice(*🌊[:associations]).each do |association, association_template|\n new_attrs[association] = reflect_on_association(association).klass.from_template(association_template)\n end\n new(new_attrs, &block)\n end\n end",
"def load_data(data)\n data.symbolize_keys!\n\n @id = data[:id] || nil\n @name = data[:name]\n @color = data[:color]\n @indent = data[:indent]\n @item_order = data[:item_order]\n end",
"def unpack_body(body)\n # fixed fields\n self.status = body.slice!(0)\n self.flags = body.slice!(0)\n self.server_msg_len = body.slice!(0..1)\n self.data_len = body.slice!(0..1) \n \n # variable-length fields\n self.server_msg = body.slice!(0..(@server_msg_len - 1)) if (@server_msg_len != 0)\n self.data = body.slice!(0..(@data_len - 1)) if (@data_len != 0)\n return(nil)\n end",
"def prepare(data, remote_attrs)\n @data = @parent\n .try(:source).try(:data)\n .try(:merge, data) || data\n\n @remote_attrs = remote_attrs.with_indifferent_access\n\n @remote_id = @synchronizer.extract_remote_id(@remote_attrs)\n @local_attrs = @synchronizer.map_attributes(@remote_attrs)\n @unique_id = @synchronizer.uid(@local_attrs)\n @associations = @synchronizer.associations_for(@local_attrs)\n\n @parent_associations = filter_associations(PARENT_ASSOCIATION_KEYS)\n @child_associations = filter_associations(CHILD_ASSOCIATION_KEYS)\n\n @import_record = find_import\n\n remove_association_keys_from_local_attrs\n end",
"def process\n demarshal\n end",
"def unpack!\n @container = @container.container\n end",
"def unpack!\n @container = @container.container\n end"
] |
[
"0.5973272",
"0.58152825",
"0.5778815",
"0.5770314",
"0.5763712",
"0.55779016",
"0.5568618",
"0.5549425",
"0.54952604",
"0.54679984",
"0.54392934",
"0.5435606",
"0.5424163",
"0.54198754",
"0.5418419",
"0.54007417",
"0.5376892",
"0.53504",
"0.5336779",
"0.5322911",
"0.532271",
"0.5286961",
"0.5271786",
"0.5269958",
"0.526169",
"0.52594465",
"0.52594465",
"0.5253406",
"0.5235573",
"0.52299684",
"0.52239704",
"0.51960087",
"0.51887715",
"0.5182754",
"0.5182023",
"0.51780176",
"0.5154861",
"0.51506335",
"0.51224947",
"0.51100975",
"0.5108246",
"0.5107642",
"0.5103756",
"0.5094258",
"0.5070128",
"0.5058177",
"0.50547194",
"0.5053759",
"0.5049605",
"0.5040384",
"0.50370276",
"0.50350714",
"0.5002869",
"0.49944276",
"0.49865606",
"0.49812213",
"0.49798647",
"0.49717146",
"0.4971336",
"0.49676785",
"0.49639863",
"0.49630827",
"0.494131",
"0.4938424",
"0.49378777",
"0.49374244",
"0.4936871",
"0.4934665",
"0.49316385",
"0.49184293",
"0.49181274",
"0.49176347",
"0.4914367",
"0.49005786",
"0.49003685",
"0.4896098",
"0.48941514",
"0.48827666",
"0.4879392",
"0.48700544",
"0.48680976",
"0.48672524",
"0.48546925",
"0.48505718",
"0.48448426",
"0.48448426",
"0.48438185",
"0.48435503",
"0.48380655",
"0.48172033",
"0.48172033",
"0.48129454",
"0.48092598",
"0.48080897",
"0.48057124",
"0.480109",
"0.47970033",
"0.47967988",
"0.4792615",
"0.4792615"
] |
0.52890575
|
21
|
Reload the stack data
|
def stack_reload(stack)
if(stack.persisted?)
result = request(
:path => "global/deployments/#{stack.name}"
)
deploy = result[:body]
stack.load_data(basic_stack_data_format(deploy)).valid_state
stack_template_load(stack)
set_outputs_if_available(stack)
end
stack
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def stack_reload(stack)\n if(stack.persisted?)\n result = request(\n :method => :get,\n :path => \"/stacks/#{stack.name}/#{stack.id}\",\n :expects => 200\n )\n stk = result.get(:body, :stack)\n stack.load_data(\n :id => stk[:id],\n :capabilities => stk[:capabilities],\n :created => Time.parse(stk[:creation_time]),\n :description => stk[:description],\n :disable_rollback => stk[:disable_rollback].to_s.downcase == 'true',\n :notification_topics => stk[:notification_topics],\n :name => stk[:stack_name],\n :state => stk[:stack_status].downcase.to_sym,\n :status => stk[:stack_status],\n :status_reason => stk[:stack_status_reason],\n :template_description => stk[:template_description],\n :timeout_in_minutes => stk[:timeout_mins].to_s.empty? ? nil : stk[:timeout_mins].to_i,\n :updated => stk[:updated_time].to_s.empty? ? nil : Time.parse(stk[:updated_time]),\n :parameters => stk.fetch(:parameters, Smash.new),\n :outputs => stk.fetch(:outputs, []).map{ |output|\n Smash.new(\n :key => output[:output_key],\n :value => output[:output_value],\n :description => output[:description]\n )\n }\n ).valid_state\n end\n stack\n end",
"def stack_reload(stack)\n logger.debug(\"reloading stack `#{stack.id}`\")\n if stack.persisted?\n ustack = Stack.new(self)\n ustack.id = stack.id\n load_stack_data(ustack)\n if ustack.data[:name]\n stack.load_data(ustack.attributes).valid_state\n else\n stack.status = \"DELETE_COMPLETE\"\n stack.state = :delete_complete\n stack.valid_state\n end\n end\n stack\n end",
"def perform_reload\n api.stack_reload(self)\n end",
"def stack_reload(stack)\n raise NotImplementedError\n end",
"def reload\n old_data = @data.dup\n self.load\n @data = old_data.merge! @data\n end",
"def reload\n self.data = self.class.load_data\n self\n end",
"def reload!\n @data = reload.raw\n self\n end",
"def reload!\n fetch_data!\n end",
"def reload\n end",
"def reinitialize(name)\r\n @data_stack = @data_stack.clone\r\n @name = name\r\n @data = @data.full_clone\r\n end",
"def perform_reload\n api.stack_plan_reload(self)\n end",
"def reload\n @new_info = {}\n read_data\n # run_callbacks_for(:after_load)\n self\n end",
"def reload\n end",
"def reload\n end",
"def reload\n end",
"def reload\n end",
"def reload\n end",
"def reload\n end",
"def reload\n end",
"def reload\n read\n @previous = nil\n self\n end",
"def reload_data\n reset_collection_data\n reload_collection_data\n end",
"def reload\n restart\n end",
"def reload\n @reloaded = true\n restart\n end",
"def reload\n end",
"def reload\n end",
"def reload_data!\n data.merge!(load_data)\n # TODO: after load hooks only run once, not every time reload_data! is called\n run_hook!(:after_load_data)\n # Chainable\n self\n end",
"def restore\r\n @status = @stack.shift if @stack.size > 0\r\n end",
"def refresh\n @data = read_data\n end",
"def reload\n reset\n fetch\n end",
"def reload\n reset\n fetch\n end",
"def refresh\n load if changed?\n end",
"def reload\n raise 'not implemented'\n end",
"def interpreter_reset\r\n @data_stack = Array.new\r\n @ctrl_stack = Array.new\r\n @start_time = Time.now\r\n end",
"def load_stack\n @load_stack\n end",
"def reload\n refresh\n end",
"def reload\n refresh\n end",
"def reload_items\n @item_data = nil\n end",
"def event_reload(event)\n event.stack.events.reload\n event.stack.events.get(event.id)\n end",
"def event_reload(event)\n event.stack.events.reload\n event.stack.events.get(event.id)\n end",
"def reload\n self\n end",
"def reload!\n end",
"def reload\n self.raw_data = self.class.find(app_id: app_id, build_id: id).raw_data\n end",
"def reload!\n begin\n #TODO not implemented 2007/04/09 by shino\n raise \"not yet implemented!\"\n end\n end",
"def reload!\n begin\n #TODO not implemented 2007/04/09 by shino\n raise \"not yet implemented!\"\n end\n end",
"def reload!\n begin\n #TODO not implemented 2007/04/09 by shino\n raise \"not yet implemented!\"\n end\n end",
"def reload!\n begin\n #TODO not implemented 2007/04/09 by shino\n raise \"not yet implemented!\"\n end\n end",
"def load_onto_stack\n\n raise RuntimeError.new(\n \"#{self.class} got freed, cannot re-access it directly\"\n ) unless @ref\n\n stack_load_ref(@ref)\n end",
"def reload;end",
"def reload()\n\t\t\tinit(@user.callAPI('push/get', { 'id' => @id }))\n\t\tend",
"def reload_data\n self.class.new reinit_endpoint.do_get\n end",
"def resource_reload(resource)\n resource.stack.resources.reload\n resource.stack.resources.get(resource.id)\n end",
"def reset\n clear\n load_from(REGISTRY_PATH)\n end",
"def reload_data\n puts \"Refreshing data now...\".cyan\n sleep(2)\n CovidTracking::Summary.reset\n CovidTracking::CountrySummary.reset\n self.data_loader.reset\n program_run\n end",
"def refresh!\n load if changed?\n end",
"def reload\n Config.object.inject_shortcuts self\n @trees.each(&:reload)\n end",
"def reset!\n Cnfs.data_store.reset\n reload!\n SegmentRoot.load\n true\n end",
"def reset\n @data = nil\n end",
"def reload\n restart_and_ping\n end",
"def reload\n reset\n to_a\n self\n end",
"def reload!\n load force: true\n end",
"def reload(*)\n super.tap do\n clear_changes_information\n end\n end",
"def reload\n if @self\n @self.reload rescue nil\n @self = nil\n end\n end",
"def reload(*)\n super.tap do\n @mutations_before_last_save = nil\n @mutations_from_database = nil\n end\n end",
"def reload\n\t\tself.request( :reload )\n\tend",
"def reload\n self.class._load(@buf)\n end",
"def reload(*)\n super.tap do\n clear_changes_information\n end\n end",
"def reload!; end",
"def reload!; end",
"def reload!; end",
"def reload!; end",
"def reset!\n @path_stack = []\n @stack = []\n @stacks = Hash.new { |hsh, k| hsh[k] = Stack.new }\n @text = nil\n end",
"def clear\n\t\t@stack.clear\n\tend",
"def reload; @data = File.read @path end",
"def load_stack_data(stack = nil)\n d_params = Smash.new(\"Action\" => \"DescribeStacks\")\n l_params = Smash.new(\"Action\" => \"ListStacks\")\n # TODO: Need to update to allow passing in list of desired\n # states for lookup or to remove state filtering. This\n # used to work with earlier versions with sfn but something\n # has changed breaking the integration.\n STACK_STATES.each_with_index do |state, idx|\n l_params[\"StackStatusFilter.member.#{idx + 1}\"] = state.to_s.upcase\n end\n if stack\n logger.debug(\"loading stack information for `#{stack.id}`\")\n d_params[\"StackName\"] = stack.id\n descriptions = all_result_pages(nil, :body,\n \"DescribeStacksResponse\", \"DescribeStacksResult\",\n \"Stacks\", \"member\") do |options|\n request(\n :method => :post,\n :path => \"/\",\n :form => options.merge(d_params),\n )\n end\n else\n logger.debug(\"loading stack listing information\")\n lists = all_result_pages(nil, :body,\n \"ListStacksResponse\", \"ListStacksResult\",\n \"StackSummaries\", \"member\") do |options|\n request(\n :method => :post,\n :path => \"/\",\n :form => options.merge(l_params),\n )\n end\n descriptions = []\n end\n (lists || descriptions).map do |stk|\n if lists\n desc = descriptions.detect do |d_stk|\n d_stk[\"StackId\"] == stk[\"StackId\"]\n end || Smash.new\n stk.merge!(desc)\n end\n if stack\n next if stack.id != stk[\"StackId\"] && stk[\"StackId\"].split(\"/\")[1] != stack.id\n end\n state = stk[\"StackStatus\"].downcase.to_sym\n unless Miasma::Models::Orchestration::VALID_RESOURCE_STATES.include?(state)\n parts = state.to_s.split(\"_\")\n state = [parts.first, *parts.slice(-2, parts.size)].join(\"_\").to_sym\n unless Miasma::Models::Orchestration::VALID_RESOURCE_STATES.include?(parts)\n state = :unknown\n end\n end\n new_stack = stack || Stack.new(self)\n new_stack.load_data(\n :id => stk[\"StackId\"],\n :name => stk[\"StackName\"],\n :capabilities => [stk.get(\"Capabilities\", \"member\")].flatten(1).compact,\n :description => stk[\"Description\"],\n :created => stk[\"CreationTime\"],\n :updated => stk[\"LastUpdatedTime\"],\n :notification_topics => [stk.get(\"NotificationARNs\", \"member\")].flatten(1).compact,\n :timeout_in_minutes => stk[\"TimeoutInMinutes\"] ? stk[\"TimeoutInMinutes\"].to_i : nil,\n :status => stk[\"StackStatus\"],\n :status_reason => stk[\"StackStatusReason\"],\n :state => state,\n :template_description => stk[\"TemplateDescription\"],\n :disable_rollback => !!stk[\"DisableRollback\"],\n :outputs => [stk.get(\"Outputs\", \"member\")].flatten(1).compact.map { |o|\n Smash.new(\n :key => o[\"OutputKey\"],\n :value => o[\"OutputValue\"],\n :description => o[\"Description\"],\n )\n },\n :tags => Smash[\n [stk.fetch(\"Tags\", \"member\", [])].flatten(1).map { |param|\n [param[\"Key\"], param[\"Value\"]]\n }\n ],\n :parameters => Smash[\n [stk.fetch(\"Parameters\", \"member\", [])].flatten(1).map { |param|\n [param[\"ParameterKey\"], param[\"ParameterValue\"]]\n }\n ],\n :custom => Smash.new(\n :stack_policy => stk[\"StackPolicyBody\"],\n :stack_policy_url => stk[\"StackPolicyURL\"],\n ),\n ).valid_state\n logger.debug(\"loaded stack information `#{new_stack.inspect}`\")\n new_stack\n end\n end",
"def restore\n end",
"def reload!\n # Reload the configuration\n load_config!\n\n # Clear the VMs because this can now be diferent due to configuration\n @vms = nil\n end",
"def reload!\n @configuration = nil\n load\n self\n end",
"def reload\n begin_reset_model\n clear\n\n @items_to_models = Hash.new\n @models_to_items = Hash.new\n @names_to_item = Hash.new\n @items_metadata = Hash[self => Metadata.new([], [], Set.new)]\n @resolver_from_model = Hash.new\n\n seen = Set.new\n sorted_roots = @root_models.\n sort_by(&:priority).reverse\n\n sorted_roots.each do |root_model|\n models = discover_model_hierarchy(root_model.model, root_model.categories, root_model.resolver, seen)\n models.each do |m|\n @resolver_from_model[m] = root_model.resolver\n end\n end\n\n rowCount.times do |row|\n compute_and_store_metadata(item(row))\n end\n self.horizontal_header_labels = [\"\"]\n ensure\n end_reset_model\n end",
"def refresh_state\n logger.info \"Refreshing current state\" do\n @run_context.refresh_state\n end\n end",
"def restore\n RESTORE\n end",
"def reload!\n @manifests = {}\n @strings_hash = {}\n end",
"def restore_graphics_state\n @stack.pop\n end",
"def reload!\n @ssh_keys = load_keys\n @config = load_config\n end",
"def reload!\n if saved?\n response = GoodData.get(uri)\n @json = response\n end\n self\n end",
"def reload!\n new_instance = instance(_id)\n update_instance_variables!(\n :public_addresses => new_instance.public_addresses,\n :private_addresses => new_instance.private_addresses,\n :state => new_instance.state\n )\n end",
"def refresh_data\n raise NotImplementedError\n end",
"def reload!\n reload_name!\n reload_topic!\n reload_aliases!\n true\n end",
"def reload\n @instance = nil\n self.instance\n end",
"def clear\n @stack.clear\n end",
"def reload\n clear_memoizations!\n remove = data.keys.find_all do |k|\n ![:id, :name].include?(k.to_sym)\n end\n remove.each do |k|\n data.delete(k)\n end\n super\n end",
"def restore; end",
"def reset_data\n ExpressTranslate.reset\n puts \"Reset successful!\"\n end",
"def reload\n @view = nil\n end",
"def reset\n until (@stacksize <= 1)\n pop # retrieve graphics states until we get to the default state\n end\n push # push the retrieved pristine default state back onto the stack\n end",
"def stack\n @values.fetch('stack') { \n @values['stack'] = nil\n }\n end",
"def reload _args\n \"reload _args;\" \n end",
"def reload_data\n if can_reload_data?\n self.state = :reloading\n reload_set = subjects.class.new\n data_loader.async.reload_data(reload_set)\n end\n end",
"def reset_session_stack\n\n # remove existing reference in persistence\n if persistence_id\n cease!\n end\n \n \tself.persistence_id = nil\n\n @session_stack.clear\n\n push_session_frame\n\n end",
"def reload\n @raw_devices = nil\n @devices = nil\n end",
"def reset\n ::Fiveruns::Dash.sync { @data = blank_data }\n end"
] |
[
"0.7895699",
"0.782925",
"0.7727556",
"0.76066",
"0.72927064",
"0.716917",
"0.6816599",
"0.670095",
"0.6670017",
"0.6572085",
"0.6552504",
"0.65264034",
"0.6504444",
"0.6504444",
"0.6504444",
"0.6504444",
"0.6504444",
"0.6504444",
"0.6504444",
"0.6478038",
"0.6468303",
"0.64106286",
"0.6401688",
"0.6394391",
"0.6394391",
"0.6380052",
"0.63781345",
"0.63633513",
"0.6351489",
"0.6351489",
"0.63011223",
"0.6265261",
"0.6263772",
"0.62447214",
"0.6238469",
"0.6238469",
"0.6218392",
"0.6193429",
"0.6193429",
"0.61840856",
"0.6177237",
"0.61317027",
"0.6120115",
"0.6120115",
"0.6120115",
"0.6120115",
"0.609916",
"0.6071292",
"0.60607105",
"0.60541713",
"0.6038496",
"0.60286325",
"0.60182357",
"0.6013528",
"0.60101146",
"0.60007954",
"0.598597",
"0.5969055",
"0.59458315",
"0.59439135",
"0.5939335",
"0.59115624",
"0.59080744",
"0.59052294",
"0.59023666",
"0.5874089",
"0.58701015",
"0.58701015",
"0.58701015",
"0.58701015",
"0.58534586",
"0.5853166",
"0.585115",
"0.58400923",
"0.58309394",
"0.5818668",
"0.58015925",
"0.5798175",
"0.5795801",
"0.57688105",
"0.5764928",
"0.5738964",
"0.57384",
"0.57178134",
"0.5717378",
"0.5715264",
"0.5712338",
"0.5707118",
"0.57033813",
"0.57029647",
"0.5701932",
"0.5700673",
"0.5698183",
"0.5697248",
"0.56954324",
"0.5684985",
"0.5682112",
"0.5681877",
"0.5677183",
"0.5665049"
] |
0.73778516
|
4
|
Set outputs into stack instance
|
def set_outputs_if_available(stack)
outputs = extract_outputs(stack.custom.fetch(:layout, {}))
unless(outputs.empty?)
stack.outputs = outputs
stack.valid_state
true
else
false
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def outputs\n @stack.outputs\n end",
"def _stack_output(stack_name, output_name)\n __t_stringish(stack_name)\n __t_stringish(output_name)\n _ref(stack_name)._set(output_name)\n end",
"def initialize\n @in_stack = []\n @out_stack = []\n end",
"def outputs\n @outputs || []\n end",
"def output\n stack << evaluate(stack.pop)\n\n stack.last\n end",
"def initialize(outputs:)\n @outputs = outputs.to_h\n end",
"def adopt(other)\n other.stack = @stack\n other.output = @output\n other.variables = @variables\n end",
"def stack_outputs(stack, attempt = 1)\n response = @client.describe_stacks(stack_name: stack)\n raise \"#{stack.upcase} stack does not exist!\" if response.stacks.empty?\n\n @outputs[stack] ||= {}\n if @outputs[stack].empty?\n response.stacks.first.outputs.each do |output|\n @outputs[stack][output.output_key] = output.output_value\n end\n end\n\n @outputs[stack]\n rescue Aws::CloudFormation::Errors::Throttling => error\n raise 'Unable to get stack outputs' if attempt > 5\n\n delay = attempt * 15\n puts \"#{error.message} - Retrying in #{delay}\"\n sleep delay\n attempt += 1\n stack_outputs(stack, attempt)\n end",
"def output=(output)\n @_output = output\n end",
"def map_outputs!(&ruby_block)\n @outputs.map! do |output|\n output = ruby_block.call(output)\n output.parent = self unless output.parent\n output\n end\n end",
"def update_outputs!\n\t\t\t\tif @node.inherit_outputs?\n\t\t\t\t\t@outputs = Files::State.new(self.children_outputs)\n\t\t\t\telse\n\t\t\t\t\t# After the task has finished, we update the output states:\n\t\t\t\t\t@outputs.update!\n\t\t\t\tend\n\t\t\tend",
"def out= out\n @out = out\n end",
"def out= out\n @out = out\n end",
"def initialize\n @stacks = []\n end",
"def add_output(&block)\n @outputs << block\n end",
"def add_stacks\n variable_stack.add_stack\n value_stack.add_stack\n end",
"def outputs()\n nil\n end",
"def setup options\n @out = get_output(options)\n end",
"def extract_outputs(stack_hash)\n outputs = []\n if(stack_hash[:outputs])\n outputs += stack_hash[:outputs].map do |output|\n Smash.new(:key => output[:name], :value => output[:finalValue])\n end\n end\n stack_hash.fetch(:resources, []).each do |resource|\n outputs += extract_outputs(resource)\n end\n outputs\n end",
"def update!(**args)\n @outputs = args[:outputs] if args.key?(:outputs)\n end",
"def setio(input, output)\n @@input = input\n @@output = output\n end",
"def stack_output(stack, output)\n outputs = stack_outputs(stack)\n message = \"#{stack.upcase} stack does not have a(n) '#{output}' output!\"\n raise message unless outputs.key?(output)\n\n outputs[output]\n end",
"def setup(output_target, modifiers)\n @output_target = output_target\n end",
"def outputs\n data[:outputs]\n end",
"def set_default_outputs\n @output_options = OUTPUTS\n end",
"def output(*instance_variable_names)\n instance_variable_names.each do |name|\n outputs[name.to_sym] = \"@#{name}\"\n end\n end",
"def get_outputs()\n return @outputs\n end",
"def output\n @output.clone\n end",
"def initialize\n @stack = []\n end",
"def initialize\n @stack = []\n end",
"def output(resource_name)\n resource = read_resource(resource_name)\n\n stack = cf_client.describe_stacks(\n stack_name: resource['name']\n ).stacks.first\n\n stack.outputs.each { |out| display_stack_output(out) }\n end",
"def outlinks\n return @outputs\n end",
"def output\n @output ||= Set.new\n end",
"def outputs\n ports_with_capabilities(:output)\n end",
"def stack(*args); end",
"def update_inputs_and_outputs\n\t\t\t\t@inputs = Files::State.new(@node.inputs)\n\t\t\t\t\n\t\t\t\tunless @node.inherit_outputs?\n\t\t\t\t\t@outputs = Files::State.new(@node.outputs)\n\t\t\t\tend\n\t\t\tend",
"def runner_output(*keys)\n # Registers each signal as run port\n keys.each do |key|\n # Ensure the key is a symbol.\n key = key.to_sym\n # Register it with the corresponding signal.\n name = HDLRuby.uniq_name # The name of the signal is uniq.\n @runner_outputs[name] = send(key)\n end\n end",
"def outputs()\n @actor.outputs()\n end",
"def add(output)\n @outputs.push(output)\n output.parent = self\n end",
"def initialize_writer_state\n # set current pipeline to :alpha (pipeline 0)\n @r = :alpha\n\n # set current pipe stack to [@r]\n @rr = [@r]\n # (Pipeline stack is needed due to tha fact, that blocks are allowed\n # inside a Pyper method. At method write time, every time a block is\n # open, block pipeline symbol is pushed onto this stack.)\n\n # where are we? flag (whether in :main or :block) set to :main\n @w = :main\n\n # argument counter (for args dispensing to the individual methods)\n @arg_count = 0\n\n # signal to pass the supplied block to the next method\n @take_block = false\n\n # arity flag for next block to be written, default is 1\n @block_arity = 1\n end",
"def output(*args)\n self::Output.new(*args)\n end",
"def stack; end",
"def stack; end",
"def set_output\n @output = Output.find(params[:id])\n end",
"def set_output\n @output = Output.find(params[:id])\n end",
"def set_output\n @output = Output.find(params[:id])\n end",
"def set_output\n @output = Output.find(params[:id])\n end",
"def set_output\n @output = Output.find(params[:id])\n end",
"def for(stack)\n @stacks = @stacks.dup.push(stack).freeze\n self\n end",
"def __output(*args, **opt, &block)\n __output_impl(*args, **opt, &block)\nend",
"def _erbout=(input)\n @_erbout = input\n end",
"def full_output\n @output_targets.map do |t|\n @instructions[t] || 0\n end\n end",
"def initialize\n @undoStack = Array.[]\n @redoStack = Array.[]\n end",
"def reset_output_map; @output_map = nil; end",
"def initialize(*output)\n @output = output\n end",
"def push_all\n # HDLRuby::High.cur_system.hprint(\"push_all\\n\")\n @stack_ptr <= @stack_ptr + 1\n end",
"def execute_IRET\n\t\t@ip.direct_value = pop_stack_word\n\t\t@cs.direct_value = pop_stack_word\n\t\t@flags.direct_value = pop_stack_word\n\tend",
"def load_variables\n instance.driver.stack_outputs do |outputs:|\n @pulumi_outputs.replace(outputs)\n end\n\n instance.driver.stack_inputs do |inputs:|\n @pulumi_inputs.replace(inputs)\n end\n end",
"def render outputs\n\n # Work through each brick in the current brick orientation\n @bricks[@rotation].each do |brick|\n\n outputs.primitives << {\n x: @board_origin_x + ( ( @grid_col + brick[1] ) * 32 ),\n y: @board_origin_y + ( ( @grid_row + brick[0] ) * 32 ),\n w: 32,\n h: 32,\n path: \"sprites/brick_#{@type.to_s}.png\"\n }.sprite\n\n end\n\n end",
"def get_stack_outputs(name)\n list = client.describe_stacks stack_name: name\n raise StandardError, \"stack: '#{name}' does not exist\" if list.stacks.empty?\n\n outputs = {}\n list.stacks.first.outputs.each do |x|\n outputs[x.output_key] = x.output_value\n end\n\n outputs\n end",
"def initialize()\n @stack=[]\n @value=0\n end",
"def setup_output\r\n\t\t@output = File.open(File.join(\"log\", \"#{@server}_#{@db}_#{snow}.output\"), \"w\")\t\tif @run_cmds\r\n\t\t@output_cmds = File.open(File.join(\"log\", \"#{@server}_#{@db}_#{snow}.cmd\"), \"w\")\t\tif @log_cmds\t\r\n\tend",
"def add_output(name, handler)\n @outputs[name] = handler\n end",
"def process_outputs(args)\n @input = @generator = @window = @fill_value = nil # Cover our tracks.\n\n if (name = args[:out_file])\n IO.write(name, @output, mode: \"wb\")\n elsif (out_str = args[:out_str])\n out_str << @output\n end\n\n (_, @output = @output, nil)[0] # Return output and erase it.\n end",
"def outputs\n [Graph::OperationOutput.from_index(self.value_handle, 0)]\n end",
"def output\n output = super\n output_loopback(output)\n output_stubs(output)\n output\n end",
"def outputs\n inputs.map(&:output).compact\n end",
"def get_outputs\n outputs = []\n last_layer_nodes = layer_n_nodes(num_layers - 1)\n loop_over_nodes(num_layers - 1) do |i|\n outputs << last_layer_nodes[i].output\n end\n outputs\n end",
"def each_transform_output(&block)\n transform_outputs.each(&block)\n supercall(nil, :each_transform_output, &block)\n end",
"def interpreter_reset\r\n @data_stack = Array.new\r\n @ctrl_stack = Array.new\r\n @start_time = Time.now\r\n end",
"def output\n @output ||= Output.new\n end",
"def stack\n @stack\n end",
"def outputs data\n data.each do |data|\n #puts \"DATA: #{data.inspect}\"\n #puts \" data mapping: #{data.map}\"\n #puts \"-----\"\n data.output\n end\nend",
"def output\n @output.call\n end",
"def output\n @output.call\n end",
"def forward\n recursive_set(*@out) { |n| n.out }\n end",
"def initialize(label, settings)\n super(label, settings)\n @output = []\n end",
"def output(i)\n out = Tensorflow::Output.new\n out.operation = self\n out.index = i\n out\n end",
"def apply_shallow_nesting(*args, &block)\n parameters = compile.parameters\n output_map = {}\n nested_stacks(:with_resource, :with_name).each do |_stack, stack_resource, stack_name|\n remap_nested_parameters(compile, parameters, stack_name, stack_resource, output_map)\n end\n extract_templates(&block)\n if args.include?(:bubble_outputs)\n output_map.each do |o_name, o_val|\n compile.outputs._set(o_name).value compile._stack_output(*o_val)\n end\n end\n compile\n end",
"def output\n b = block.output\n self<< b\n b\n end",
"def call\n @stack = Frame.stack\n yield\n end",
"def output(screen_lines)\n @screen = screen_lines\n end",
"def initialize(output)\n @output = output\n end",
"def output\n send(\"output_#{@type}\")\n end",
"def update_system(outputs)\n Log.info 'Platform stack has created. CloudConductor will register host to zabbix/DNS.'\n @system.ip_address = outputs['FrontendAddress']\n @system.monitoring_host = @system.domain\n @system.template_parameters = outputs.except('FrontendAddress').to_json\n @system.save!\n end",
"def initialize(output)\n @output = output\n end",
"def each_transform_output\n return enum_for(:each_transform_output) if !block_given?\n if !(tr = model.transformer)\n return\n end\n\n model.each_transform_output do |port, from, to|\n from = selected_frames[from]\n to = selected_frames[to]\n yield(port.bind(self), from, to)\n end\n end",
"def store_outputs(operations, location: nil, type: nil)\n store_io(operations, role: 'output', location: location, type: type)\n end",
"def reset_for_next_command\n # self.args, self.switches, self.options = [], [], {}\n self.output, self.capture = false, false\n end",
"def put\n\t\t\tputs STACK.last \n\t\tend",
"def stack=(value)\n if value == @defaults['stack']\n @values.delete 'stack' if @values.key? 'stack'\n else\n @values['stack'] = value\n end\n end",
"def before_validate\n self.previous_output :alias => 'PREVOUT' unless self.previous_output\n self.outputs<< output(0) if self.outputs.empty?\n super\n end",
"def reset\n\t\t\t@out_pos = -1\n\t\t\t@in_pos = -1\n\t\t\t@input_buffer = []\n\t\t\t@output_buffer = []\n\t\tend",
"def process_stacks!\n stacks_by_name = contents.stacks.to_hash_by_key(:name)\n scanned = scan_unit_configs(stacks_by_name)\n stacks_by_name.each do |_, stack|\n stack_units = stack.fetch(:units, []).each_with_object({}) do |unit_config, all|\n merge_or_replace(all, unit_config, scanned)\n end\n $logger.warn \"No units defined for '%s' stack\" % stack.name if stack_units.empty?\n stack.units = stack_units\n end\n end",
"def setup\r\n # create a new assignment\r\n @response = responses(:response0)\r\n @response1 = @response.id\r\n @responsemaps = response_maps(:response_maps0)\r\n end",
"def reset\n\t\t@out_pos = -1\n\t\t@in_pos = -1\n\t\t@input_buffer = []\n\t\t@output_buffer = []\n\tend",
"def stack(me, children)\n children = children.map{|c| c.is_a?(::Layers::LayerBase) ? c.to_node([]) : c}\n me.to_node(children)\n end",
"def ostack_bootstrap (commands)\n self.ostack_connect\n commands = (commands.is_a?(Array)) ? commands : [ commands ]\n output = Array.new\n\n commands.each do |command|\n output << self.run(command)\n end\n\n return output\n end",
"def push_stack\n bb = {:black => get_black,:white => get_white}\n @stack.push(Marshal.load(Marshal.dump(bb)))\n @stack.shift if @stack.size > @options[:stack_limit]\n end",
"def add_output(type, *args)\n class_name = type.to_s.capitalize\n klass = Drone::Interfaces.const_get(class_name)\n @output_modules << klass.new(*args)\n end"
] |
[
"0.6914096",
"0.6784802",
"0.6387974",
"0.5888659",
"0.58617836",
"0.58280265",
"0.5801298",
"0.5799265",
"0.57409495",
"0.5721926",
"0.56699175",
"0.56632257",
"0.56632257",
"0.5657702",
"0.5631712",
"0.55783576",
"0.5575174",
"0.55239403",
"0.5501004",
"0.54891175",
"0.54624444",
"0.5453277",
"0.54380083",
"0.54308283",
"0.54211646",
"0.54150254",
"0.5408489",
"0.53888905",
"0.53354114",
"0.53354114",
"0.5330772",
"0.53293425",
"0.53215986",
"0.53101695",
"0.5297357",
"0.5296652",
"0.528481",
"0.52734464",
"0.5227288",
"0.52138346",
"0.51973546",
"0.5194931",
"0.5194931",
"0.5178897",
"0.5178897",
"0.5178897",
"0.5178897",
"0.5178897",
"0.5176689",
"0.5174203",
"0.5167994",
"0.51670027",
"0.5162588",
"0.5148344",
"0.51464826",
"0.5143206",
"0.51391417",
"0.5074468",
"0.50731665",
"0.5063808",
"0.50567156",
"0.5056593",
"0.5051683",
"0.5048459",
"0.5045073",
"0.5044767",
"0.5032811",
"0.50278914",
"0.5008211",
"0.50078464",
"0.49963757",
"0.4992745",
"0.49810645",
"0.49754488",
"0.49754488",
"0.49723616",
"0.49673554",
"0.4965845",
"0.49609852",
"0.4958759",
"0.4957266",
"0.4951381",
"0.49475747",
"0.49387962",
"0.49337357",
"0.4930273",
"0.4926005",
"0.49215886",
"0.49165872",
"0.49067703",
"0.4898715",
"0.48985946",
"0.48973078",
"0.48964912",
"0.4887118",
"0.48790103",
"0.48777407",
"0.48705092",
"0.48679402",
"0.48660573"
] |
0.6232666
|
3
|
Extract outputs from stack hash
|
def extract_outputs(stack_hash)
outputs = []
if(stack_hash[:outputs])
outputs += stack_hash[:outputs].map do |output|
Smash.new(:key => output[:name], :value => output[:finalValue])
end
end
stack_hash.fetch(:resources, []).each do |resource|
outputs += extract_outputs(resource)
end
outputs
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def get_stack_outputs(name)\n list = client.describe_stacks stack_name: name\n raise StandardError, \"stack: '#{name}' does not exist\" if list.stacks.empty?\n\n outputs = {}\n list.stacks.first.outputs.each do |x|\n outputs[x.output_key] = x.output_value\n end\n\n outputs\n end",
"def outputs\n @stack.outputs\n end",
"def extract_hash\n result = []\n if @structures.length.positive?\n @structures.each do |s|\n value = s.extract_hash\n result << value unless value.nil?\n end\n else\n result = {}\n end\n case result.length\n when 0\n return nil\n when 1\n return result[0]\n end\n result\n end",
"def stack_output(stack, output)\n outputs = stack_outputs(stack)\n message = \"#{stack.upcase} stack does not have a(n) '#{output}' output!\"\n raise message unless outputs.key?(output)\n\n outputs[output]\n end",
"def dump(hsh_p={})\n cred = Histamine::Labeling.identify(hsh_p)\n pp(cred)\n buckets = @buckets.select { |o|\n match = File.fnmatch(cred[:identity], o.identity)\n match\n }\n results = buckets.map { |o| o.dump }.join(\"\\n\") + \"\\n\"\n return results\n end",
"def stack_outputs(stack, attempt = 1)\n response = @client.describe_stacks(stack_name: stack)\n raise \"#{stack.upcase} stack does not exist!\" if response.stacks.empty?\n\n @outputs[stack] ||= {}\n if @outputs[stack].empty?\n response.stacks.first.outputs.each do |output|\n @outputs[stack][output.output_key] = output.output_value\n end\n end\n\n @outputs[stack]\n rescue Aws::CloudFormation::Errors::Throttling => error\n raise 'Unable to get stack outputs' if attempt > 5\n\n delay = attempt * 15\n puts \"#{error.message} - Retrying in #{delay}\"\n sleep delay\n attempt += 1\n stack_outputs(stack, attempt)\n end",
"def output_hash; end",
"def gethash(session)\n\tprint_status(\"Dumping password hashes...\")\n\tbegin\n\t\thash = ''\n\t\tsession.core.use(\"priv\")\n\t\thashes = session.priv.sam_hashes\n\t\thash << \"****************************\\n\"\n\t\thash << \" Dumped Password Hashes\\n\"\n\t\thash << \"****************************\\n\\n\"\n\t\thashes.each do |h|\n\t\t\thash << h.to_s+\"\\n\"\n\t\tend\n\t\thash << \"\\n\\n\\n\"\n\t\tprint_status(\"Hashes Dumped\")\n\trescue ::Exception => e\n\t\tprint_status(\"\\tError dumping hashes: #{e.class} #{e}\")\n\t\tprint_status(\"\\tPayload may be running with insuficient privileges!\")\n\tend\n\thash\n\nend",
"def hash\n shasum.hash\n end",
"def hash\n shasum.hash\n end",
"def hash\n shasum.hash\n end",
"def get_PtrnHash(ptn, hsh)\n puts ptn\n puts hsh\n while true\n puts \"======\"\n line=gets.chop!\n ret = {}\n if line =~ /#{ptn}/ \n hsh.each { |k, v|\n# puts \" #{k} -> #{v} : '#{$~[hsh[k]]}'\"\n ret[k] = $~[v]\n }\n p ret\n return ret\n end\n end\nend",
"def process_log_output(output)\n in_message = false\n hsh_array = []\n hsh = nil\n\n output.each_line do |line|\n line = line.chomp\n\n if line[0].nil?\n in_message = !in_message\n next\n end\n\n if in_message\n hsh[\"message\"] << \"#{line[4..]}\\n\"\n next\n end\n\n key, *value = line.split\n key = key.sub(\":\", \"\").downcase\n value = value.join(\" \")\n\n case key\n when \"commit\"\n hsh_array << hsh if hsh\n hsh = {\"sha\" => value, \"message\" => +\"\", \"parent\" => []}\n when \"parent\"\n hsh[\"parent\"] << value\n when \"author\"\n tmp = value.split(\"<\")\n hsh[\"author\"] = tmp[0].strip\n hsh[\"email\"] = tmp[1].sub(\">\", \"\").strip\n when \"date\"\n hsh[\"date\"] = DateTime.parse(value)\n else\n hsh[key] = value\n end\n end\n hsh_array << hsh if hsh\n hsh_array\n end",
"def to_stack; end",
"def hash(sexp, level)\n \"$hash(#{sexp.map { |p| process p, :expression }.join ', '})\"\n end",
"def gather(key)\n stack.map{|s| s[key] }.flatten.compact.uniq\n end",
"def parsed_stack\n @values.fetch('parsedStack') { \n @values['parsedStack'] = []\n }\n end",
"def get_stack_select\n stacks = Deployinator.get_stacks\n output = Array.new\n stacks.each do |s|\n current = stack == s\n output << { \"stack\" => s, \"current\" => current }\n end\n output\n end",
"def to_hash\n stack.inject { |h, layer| Util.deep_merge h, layer }\n end",
"def grab_keys(hsh)\n keys = []\n hsh.each_pair do |key,value|\n keys << key\n end\n keys\nend",
"def extract_values_from_response(hsh)\n hsh.each do |key, value|\n raise \"response without key #{value}\" unless response.key?(value)\n\n send(key, response[value]) if response[value]\n end\n end",
"def to_stdout\n\t\t\tresult_string = String.new\n\t\t\thashes = Array.new\n\n\t\t\t@results.sort_by {|k| k[:scanner] }.each do |result|\n\t\t\t\tunless hashes.include? result[:hash].downcase\n\t\t\t\t\tresult_string << \"#{result[:hash]}:\\n\"\n\t\t\t\t\thashes << result[:hash].downcase\n\t\t\t\tend\n\t\t\t\tresult_string << \"#{result[:scanner]}: \".rjust(25) + \"#{result[:result]}\\n\"\n\t\t\tend if @results != nil\n\n\t\t\tresult_string\n\t\tend",
"def concat(hash_stack)\n @stack.concat hash_stack.stack\n self\n end",
"def extract_fingerprints_from_cmd(cmd)\n so = Mixlib::ShellOut.new(cmd, env: { 'LANG' => 'en_US' })\n so.run_command\n so.stdout.split(/\\n/).map do |t|\n if z = t.match(/^ +Key fingerprint = ([0-9A-F ]+)/)\n z[1].split.join\n end\n end.compact\nend",
"def outputs\n data[:outputs]\n end",
"def state(digest)\n # Translate hexadecimal MAC to integer equivalent if needed (i.e., SHA1_MAC.hex_digest -> SHA1_MAC.digest).\n digest = digest.to_i(16) unless digest.is_a?(Integer)\n\n # Reverse the final step in SHA-1 to retrieve the internal state for cloning state, ultimately allowing us to suffix a payload.\n # I.e., this gives us our five 32-bit SHA-1 registers.\n a = (digest >> 128) & 0xffffffff\n b = (digest >> 96) & 0xffffffff\n c = (digest >> 64) & 0xffffffff\n d = (digest >> 32) & 0xffffffff\n e = digest & 0xffffffff\n\n [a, b, c, d, e]\nend",
"def knife_output_as_hash(sub_cmd)\n sub_cmd = [sub_cmd, '-F json'].join(' ')\n output_lines = execute(knife_cmd(sub_cmd)).split(/\\n/)\n output_lines = output_lines.reject { |line| KNIFE_JSON_OUTPUT_IGNORE.include? line }\n json = JSON.parse output_lines.join(' ')\nrescue StandardError => e\n puts \"ERROR: #{e}\"\n exit 1\nend",
"def unspent_transaction_outputs_of(public_key_hash)\n unspent_outputs = []\n unspent_transactions_of(public_key_hash).each do |tx|\n tx.v_out.each do |out|\n unspent_outputs.push(out) if out.locked_with?(public_key_hash)\n end\n end\n unspent_outputs\n end",
"def hgetall(hash)\n redis_token.hgetall(hash)\n end",
"def output\n stack << evaluate(stack.pop)\n\n stack.last\n end",
"def processHits(hits, buffer)\n result = []\n puts \"Hits = #{hits}\"\n ptr = buffer.unpack(\"I*\")\n # Hit records are variable length. First element is the record length,\n # then the z-indexes, finally the name stack.\n p = 0\n for i in 0...hits\n name_count = ptr[p]\n z1 = ptr[p + 1].to_f / 0xffffffff\n z2 = ptr[p + 2].to_f / 0xffffffff\n names = ptr[p + 3, name_count]\n p += 3 + name_count;\n\n #puts \" number of names for hit = #{name_count}\"\n #puts \" z1 is #{z1}\"\n #puts \" z2 is #{z2}\"\n #puts \"Names = \" + names.inspect\n \n result << names\n end\n result\n end",
"def sha\n result_hash['sha']\n end",
"def hash\n hash_args.hash\n end",
"def stash_list\n\n check_vcs\n\n cmd = []\n cmd << \"cd\"\n cmd << @wsPath\n cmd << \"&&\"\n cmd << @vcs.exe_path\n cmd << \"stash list\"\n\n cmdln = cmd.join(\" \")\n log_debug \"Stash list : #{cmdln}\"\n res = os_exec(cmdln) do |st, res|\n if st.success?\n list = { }\n res.each_line do |l|\n ll = l.split(\": \")\n\n # first element is the stash id\n # 2nd element is the info on branch\n branch = ll[1].split(\" \")[-1]\n\n\n list[ll[0].strip] = [branch, ll[1..-1].join(\": \")] \n end\n\n [true, list]\n else\n [false, res]\n end\n end\n\n end",
"def _stack_output(stack_name, output_name)\n __t_stringish(stack_name)\n __t_stringish(output_name)\n _ref(stack_name)._set(output_name)\n end",
"def process_operand_output\n { key => operand_output }\n end",
"def pull_out(parent_hash)\n return parent_hash[\"results\"]\n rescue\n return []\n end",
"def hash\n @hash.hash\n end",
"def from_hash(hsh)\n fail 'Hash must have at least 2 items' if hsh.size < 2\n [from_hash_x(hsh), from_hash_y(hsh)]\n end",
"def hash\n [host_list, total_matching, total_returned].hash\n end",
"def read_stack_cache_traces(analysis_task_elem)\n analysis_task_elem.each_element(\"value_analysis/messages/message/textline\") { |e|\n if e.text =~ /trace.*\\(context\\w*(.*)\\).*\\(\"user_(n_(?:fill|spill))\"\\).=.(\\d+)/\n yield $1,$2,$3\n end\n }\n end",
"def dump(hash, time = Time.now.to_i)\n data = []\n raise \"Hash was not received\" unless hash.is_a? Hash\n walk_the_forrest(hash) do |target, value|\n data << \"#{target} #{value} #{time}\"\n end\n data\n end",
"def return_hash \n\tkt = KeywordTagger.new\n\thash = kt.get_hash_regex_tags(\"public/conversion.txt\") \nend",
"def get_hash_data\r\n return CallInitiate.decode_call_params(get_variable(\"CallInitiate_hashdata\"))\r\n\tend",
"def lookup_remote(md5_hash)\n unhash_data = Scrubyt::Extractor.define do\n fetch \"http://gdataonline.com/qkhash.php?mode=txt&hash=#{md5_hash}\"\n unhash \"//table/tr[2]/td[2]/b\"\n end\n \n doc = Nokogiri::HTML.parse(unhash_data.to_xml)\n doc.xpath('//root/unhash').text.strip rescue nil\n end",
"def hash_stacks(arr)\n return Hash[arr.map { |x| [x.stack_name, x] }]\n end",
"def extract_functions\n output = ObjdumpReader.objdump_output(\n [\n \"-M\", \"intel\", \"-D\", \n \"--section=.text\", \"--section=.plt\", \"--section=.init\", \n \"--demangle\", @elf_path\n ]\n )\n lines = output.split(\"\\n\").map { |l| ObjdumpLine.new( l ) }\n\n @functions = Set.new\n last_label = nil\n last_instrs = nil\n\n lines.each do |l|\n if l.type == :label\n unless last_label.nil?\n f = Function.new(\n last_label.name,\n last_label.address,\n l.address,\n ObjdumpReader.lines_to_instrs( last_instrs )\n )\n @functions << f\n end\n last_label = l\n last_instrs = []\n elsif l.type == :instruction\n unless last_instrs.nil?\n last_instrs << l\n end\n end\n end\n end",
"def split_hash(digest)\n hash_format = Argon2::HashFormat.new(digest)\n # Undo the 2^m_cost operation when encoding the hash to get the original\n # m_cost input back.\n input_m_cost = Math.log2(hash_format.m_cost).to_i\n\n {\n variant: hash_format.variant,\n version: hash_format.version,\n t_cost: hash_format.t_cost,\n m_cost: input_m_cost,\n p_cost: hash_format.p_cost,\n salt: hash_format.salt,\n checksum: hash_format.checksum\n }\n end",
"def hashes\n return @hashes\n end",
"def render_hash(hsh)\n str = \"\"\n indiff_hsh = hsh.with_indifferent_access\n indiff_hsh.keys.sort.each do |key|\n str << \"#{key}: \"\n value = indiff_hsh[key]\n PP::pp(value, str)\n end\n str\n end",
"def evalsha(*args); end",
"def evalsha(*args); end",
"def hashes(log)\n return log.split(\"\\n\").map{|line| parser(line) }\n end",
"def get_terraform_output\n {\n 'chef_server_ip' => `terraform output chef-server-ip`.chomp,\n 'chef_server_dns' => `terraform output chef-server-private-dns`.chomp,\n 'test_db_ip' => `terraform output test-db-ip`.chomp,\n 'test_db_dns' => `terraform output test-db-private-dns`.chomp,\n 'test_app_ip' => `terraform output test-app-ip`.chomp,\n 'test_app_dns' => `terraform output test-app-private-dns`.chomp\n }\nend",
"def stacks(arg)\n ya_ta = tuc(\"x_ya\")\n ra_ta = tuc(\"x_ra\")\n la_ta = tuc(\"x_la\")\n wa_ta = tuc(\"x_wa\")\n\n ra_go = tuc(\"ra_x\")\n la_go = tuc(\"la\")\n sa_go = tuc(\"sa\")\n\n h = Hash.[](\n # subscript YA\n \"ky\"=>tuc(\"ka\")+ya_ta, \"khy\"=>tuc(\"kha\")+ya_ta, \"gy\"=>tuc(\"ga\")+ya_ta,\n \"py\"=>tuc(\"pa\")+ya_ta, \"phy\"=>tuc(\"pha\")+ya_ta, \"by\"=>tuc(\"ba\")+ya_ta, \"my\"=>tuc(\"ma\")+ya_ta,\n # subscript RA\n \"kr\"=>tuc(\"ka\")+ra_ta, \"khr\"=>tuc(\"kha\")+ra_ta, \"gr\"=>tuc(\"ga\")+ra_ta,\n \"tr\"=>tuc(\"ta\")+ra_ta, \"thr\"=>tuc(\"tha\")+ra_ta, \"dr\"=>tuc(\"da\")+ra_ta,\n \"pr\"=>tuc(\"pa\")+ra_ta, \"phr\"=>tuc(\"pha\")+ra_ta, \"br\"=>tuc(\"ba\")+ra_ta, \"mr\"=>tuc(\"ma\")+ra_ta,\n \"shr\"=>tuc(\"sha\")+ra_ta, \"sr\"=>tuc(\"sa\")+ra_ta, \"hr\"=>tuc(\"ha\")+ra_ta,\n # subscript LA\n \"kl\"=>tuc(\"ka\")+la_ta, \"gl\"=>tuc(\"ga\")+la_ta, \"bl\"=>tuc(\"ba\")+la_ta,\n \"zl\"=>tuc(\"za\")+la_ta, \"rl\"=>tuc(\"ra\")+la_ta, \"sl\"=>tuc(\"sa\")+la_ta,\n # subscript WA\n \"kw\"=>tuc(\"ka\")+wa_ta, \"khw\"=>tuc(\"kha\")+wa_ta, \"gw\"=>tuc(\"ga\")+wa_ta, \"grw\"=>tuc(\"ga\")+ra_ta+wa_ta,\n \"cw\"=>tuc(\"ca\")+wa_ta, \"nyw\"=>tuc(\"nya\")+wa_ta, \"tw\"=>tuc(\"ta\")+wa_ta,\n \"dw\"=>tuc(\"da\")+wa_ta, \"tsw\"=>tuc(\"tsa\")+wa_ta, \"tshw\"=>tuc(\"tsha\")+wa_ta,\n \"zhw\"=>tuc(\"zha\")+wa_ta, \"zw\"=>tuc(\"za\")+wa_ta, \"rw\"=>tuc(\"ra\")+wa_ta,\n \"lw\"=>tuc(\"la\")+wa_ta, \"shw\"=>tuc(\"sha\")+wa_ta, \"sw\"=>tuc(\"sa\")+wa_ta, \"hw\"=>tuc(\"ha\")+wa_ta,\n # subscript 'A\n \"t'\"=>tuc(\"ta\")+tuc(\"x_'a\"),\n # superscript RA\n \"rk\"=>ra_go+tuc(\"x_ka\"), \"rg\"=>ra_go+tuc(\"x_ga\"), \"rng\"=>ra_go+tuc(\"x_nga\"), \"rj\"=>ra_go+tuc(\"x_ja\"),\n \"rny\"=>ra_go+tuc(\"x_nya\"), \"rt\"=>ra_go+tuc(\"x_ta\"), \"rd\"=>ra_go+tuc(\"x_da\"), \"rn\"=>ra_go+tuc(\"x_na\"), \"rm\"=>ra_go+tuc(\"x_ma\"),\n \"rb\"=>ra_go+tuc(\"x_ba\"), \"rts\"=>ra_go+tuc(\"x_tsa\"), \"rdz\"=>ra_go+tuc(\"x_dza\"),\n # superscript LA\n \"lk\"=>la_go+tuc(\"x_ka\"), \"lg\"=>la_go+tuc(\"x_ga\"), \"lng\"=>la_go+tuc(\"x_nga\"), \"lc\"=>la_go+tuc(\"x_ca\"),\n \"lj\"=>la_go+tuc(\"x_ja\"), \"lt\"=>la_go+tuc(\"x_ta\"), \"ld\"=>la_go+tuc(\"x_da\"), \"lp\"=>la_go+tuc(\"x_pa\"),\n \"lb\"=>la_go+tuc(\"x_ba\"), \"lh\"=>la_go+tuc(\"x_ha\"),\n # superscript SA\n \"sk\"=>sa_go+tuc(\"x_ka\"), \"sg\"=>sa_go+tuc(\"x_ga\"), \"sng\"=>sa_go+tuc(\"x_nga\"), \"sny\"=>sa_go+tuc(\"x_nya\"),\n \"st\"=>sa_go+tuc(\"x_ta\"), \"sd\"=>sa_go+tuc(\"x_da\"), \"sn\"=>sa_go+tuc(\"x_na\"), \"sp\"=>sa_go+tuc(\"x_pa\"),\n \"sb\"=>sa_go+tuc(\"x_ba\"), \"sm\"=>sa_go+tuc(\"x_ma\"), \"sts\"=>sa_go+tuc(\"x_tsa\"))\n h[arg]\n end",
"def stack_template_extractor(x_stacks, &block)\n x_stacks.each do |stack, resource, s_name|\n unless(stack.nested_stacks.empty?)\n stack_template_extractor(stack.nested_stacks(:with_resource, :with_name), &block)\n end\n resource.properties.set!(:stack, stack.compile.dump!)\n block.call(s_name, stack, resource)\n end\n end",
"def collect_on_hash(hash)\n @args.collect{|arg| hash[arg]}\n end",
"def outlinks\n return @outputs\n end",
"def previous_output\n @prev_out.reverse.unpack(\"H*\")[0]\n end",
"def hash\n state.hash\n end",
"def hash\n state.hash\n end",
"def hash\n @hash\n end",
"def return_stack\n return @state[:fiber][:return_stack]\n end",
"def hashes_for(*args)\n return matches_for(*args).map { |match| match.hash }\n end",
"def evaluate call_stack_bindings\n case action\n when :CAPTURE\n evaluate_snapshot_point call_stack_bindings\n when :LOG\n evaluate_logpoint call_stack_bindings[0]\n end\n end",
"def hash_values\n [@modulus, @remainder]\n end",
"def key_set()\n return @outputs.keys()\n end",
"def send_hash(event)\n msg = remove_command(event.content)\n flags = parse_flags(msg)\n\n # Parse highscoreable\n h = parse_highscoreable(flags[:h], mappack: true)\n raise OutteError.new \"Map no found.\" if h.nil?\n map_data = h.map.dump_level(hash: true)\n raise OutteError.new \"Map data for #{h.format_name} is null.\" if map_data.nil?\n\n # Parse player, if provided\n if flags[:p]\n player = parse_player('for ' + flags[:p], '', false, true)\n raise OutteError.new \"Player #{flags[:p]} not found.\" if !player\n score = h.leaderboard.find{ |s| s['name'] == player.name }\n raise OutteError.new \"No score by #{player.name} in #{h.name}.\" if !score\n eq = MappackScore.find(score['id']).compare_hashes rescue nil\n event << \"The hashes are #{eq ? 'equal' : 'different'}.\"\n return\n end\n\n # Parse score ID, if provided\n if flags[:id]\n score = MappackScore.find(flags[:id]) rescue nil \n raise OutteError.new \"Mappack score with ID #{flags[:id]} not found.\" if !score\n eq = score.compare_hashes\n event << \"The hashes are #{eq ? 'equal' : 'different'}.\"\n return\n end\n\n # Compare hashes for all scores, or only for the map data\n if flags.key?(:all)\n eq = h.scores.map{ |s| s.compare_hashes }.count(false) == 0\n else\n eq = h.compare_hashes\n end\n\n event << \"The hashes are #{eq ? 'equal' : 'different'}.\"\nrescue => e\n lex(e, \"Error comparing hashes.\", event: event)\nend",
"def encoding prog_h\n puts \"encoding...\"\n hash={}\n prog_h.each{|addr,instr| hash[addr]=encode(instr)}\n return hash\n end",
"def return_result(stack_bottom)\n\n count = stack_top - stack_bottom\n\n return nil if count == 0\n return stack_pop if count == 1\n\n (1..count).collect { |pos| stack_pop }.reverse\n end",
"def raw_output_values(context)\n context.output_hash.values_at(*@fields)\n end",
"def output(resource_name)\n resource = read_resource(resource_name)\n\n stack = cf_client.describe_stacks(\n stack_name: resource['name']\n ).stacks.first\n\n stack.outputs.each { |out| display_stack_output(out) }\n end",
"def output\n if @output_collection.empty?\n output = @output_hash\n else\n output = @output_collection\n output << @output_hash unless @output_hash.empty?\n output.flatten!\n end\n output\n end",
"def get_output(stacks, blocks, put_shulkers=false)\n s = \"\"\n put_stacks, put_blocks = stacks.nonzero?, blocks.nonzero?\n\n if put_shulkers\n s += pluralize boxes = (stacks / 27).floor, \"shulker\"\n\n # Strip the necessary # of stacks off the count.\n stacks -= boxes * 27\n put_stacks = stacks.nonzero?\n\n s += \", \" if put_stacks or put_blocks\n end\n\n if put_stacks\n s += pluralize stacks, \"stack\"\n s += \", \" if put_blocks\n end\n\n s += pluralize blocks, \"block\" if put_blocks\n\n s\nend",
"def initialize\n @in_stack = []\n @out_stack = []\n end",
"def parse_result(out)\n out = out.gsub(/=> ([0-9]+)L(,|\\s*\\})/,'=> \\1\\2')\n .gsub(/=> undefined(,|\\s*\\})/,'=> \"__undefined__\"\\1')\n .gsub(/\\[(\\s*\\([^\\(\\)\\[\\]]*\\)(,\\s*\\([^\\(\\)\\[\\]]*\\))*\\s*)\\]/m) do\n array_group = $1\n result = array_group.gsub(/\\(([^\\(\\)]*)\\)/) { key_group = $1 }\n '{' + result + '}'\n end\n failure = out.gsub(/.*(\"failure-description\" => \".*[^\\\\]\",).*/m,'\\1')\n oneline_failure = failure.gsub(/[\\r\\n]/,'')\n out = out.gsub(failure, oneline_failure)\n out = out.gsub('=>',':')\n hash = MultiJson.decode(out)\n if hash['outcome'] == 'failed'\n raise \"JBoss-CLI failure: '#{hash['failure-description']}'\"\n end\n to_strongly_typed_hash hash['result']\n end",
"def stack\n @stack\n end",
"def process_hash(exp)\n kv_list = exp\n raise if kv_list.length % 2 != 0 \n\n args = \n without_result do\n want_expression do\n kv_list.map {|i| process(i)}.join(\",\")\n end\n end\n\n str = @model.lookup_constant('::Hash') + \".\"\n if kv_list.empty?\n # empty Hash\n @model.add_method_call(m = @model.encode_method(\"new\"))\n str << \"#{m}()\" \n else\n @model.add_method_call(m = @model.encode_method(\"new_from_key_value_list\"))\n str << \"#{m}(#{@model.encode_nil},#{args})\" \n end\n\n exp.clear\n\n return str\n end",
"def get_result(key)\n return @outputs[key]\n end",
"def get_values_for_verification\n \t@intermediate_nodes = self.get_intermediate_nodes\n @array = []\n\n @intermediate_nodes.each do |node|\n @array << node.sha.to_s\n if node.is_right_child\n @array << \"rchild\"\n else\n @array << \"lchild\"\n end\n end\n\n \t@array << Node.get_root_node.sha.to_s\n @array << \"root\"\n\n \treturn @array\n #return @intermediate_nodes\n end",
"def evalsha(*args)\n _eval(:evalsha, args)\n end",
"def find_hash_tags\n self.scan(/#[\\w-]+/).flatten.uniq\n end",
"def extract_result(response, action_name, &block)\n method = get_service_registry.get_method_signature(action_name)\n action = method[:output][:name].to_sym\n result = response.to_hash\n result = result[action] if result.include?(action)\n result = normalize_output(result, method)\n run_user_block(response, result, &block) if block_given?\n return result\n end",
"def h_surrounding_hexes( h )\n h.surrounding_hexes.map{ |sh| hget( sh ) }\n end",
"def get_nethash\n blocks = self.blocks_get_nethash\n if blocks[\"success\"]\n return blocks[\"nethash\"]\n else\n return nil\n end\n end",
"def stack; end",
"def stack; end",
"def extract_shellout\n @stdout = original.stdout\n @stderr = original.stderr\n end",
"def split_stack\n new_pages = {}\n @pages.each do |page|\n page.list.each do |cmd|\n if cmd.code == 108 && cmd.parameters[0] =~ TH::Stacked_Events::Stack_Regex\n stack_ids = $1.split\n stack_ids.each do |id|\n new_pages[id] ||= []\n new_pages[id] << page\n end\n next\n end\n end\n end\n return new_pages\n end",
"def stackEval(cmdStack, resStack, memState)\n # cmdStack => the command stack implemented using a list\n # resStack => the results stack implemented using a list\n # memState => the memory state implemented using a block. Will contain a map for variable names and their integers\n\n # create a map to convert vals in resStack to actual operators\n # stack will be an array where elements are added to front and removed from front\n i = 0\n while true do\n if cmdStack.length == 0\n break\n end\n if cmdStack[0].is_a?(GCConst)\n #puts \"const\"\n #puts cmdStack[0].value\n # add constants from control stack to results stack\n resStack.unshift(cmdStack[0].value) # puts the value from cmdStack[i] into the start of resStack\n cmdStack = cmdStack.drop(1) # remove top value (index 0) from command stack\n i += 1\n elsif cmdStack[0].is_a?(GCTrue)\n # add booleans from control stack to results stack\n resStack.unshift(cmdStack[0].value) # puts the value from cmdStack[i] into the start of resStack\n cmdStack = cmdStack.drop(1)\n i += 1 \n elsif cmdStack[0].is_a?(GCFalse)\n # add booleans from control stack to results stack\n resStack.unshift(cmdStack[0].value) # puts the value from cmdStack[i] into the start of resStack\n cmdStack = cmdStack.drop(1)\n i += 1\n elsif cmdStack[0].is_a?(GCOp)\n #puts \"op\"\n a = cmdStack[0]\n cmdStack = cmdStack.drop(1) \n cmdStack.unshift(a.op) #add operator to the stack\n cmdStack.unshift(a.e2) # add second expr to cmdStack\n cmdStack.unshift(a.e1) # add first expr to cmdStack\n i += 1\n\n # binary operators on cmd stack\n elsif cmdStack[0] == :plus\n b = resStack[0] # get first value from resStack. This will be the second expr in the operator statement\n resStack = resStack.drop(1)\n a = resStack[0] # get next value from resStack. This will be the first expr in the operator statement\n resStack = resStack.drop(1)\n resStack.unshift(a + b) #apply operator and put it back on resStack\n cmdStack = cmdStack.drop(1)\n i += 1\n elsif cmdStack[0] == :minus\n b = resStack[0]\n resStack = resStack.drop(1)\n a = resStack[0]\n resStack = resStack.drop(1)\n resStack.unshift(a - b)\n cmdStack = cmdStack.drop(1)\n i += 1\n elsif cmdStack[0] == :times\n b = resStack[0]\n resStack = resStack.drop(1)\n a = resStack[0]\n resStack = resStack.drop(1)\n resStack.unshift(a * b)\n cmdStack = cmdStack.drop(1)\n i += 1\n elsif cmdStack[0] == :div\n b = resStack[0]\n resStack = resStack.drop(1)\n a = resStack[0]\n resStack = resStack.drop(1)\n resStack.unshift(a / b)\n cmdStack = cmdStack.drop(1)\n i += 1\n\n # variable\n elsif cmdStack[0].is_a?(GCVar)\n # apply memoryState function to variable and add to resultStack\n\n x = memState.call(cmdStack[0].value)\n #puts \"var\"\n #puts x\n resStack.unshift(memState.call(cmdStack[0].value))\n # remove GCVar from commandstack\n cmdStack = cmdStack.drop(1)\n i += 1\n\n # Test compare\n elsif cmdStack[0].is_a?(GCComp)\n #puts \"comp\"\n a = cmdStack[0]\n cmdStack = cmdStack.drop(1)\n cmdStack.unshift(a.op) #add operator to the stack\n cmdStack.unshift(a.e2) # add second expr to cmdStack\n cmdStack.unshift(a.e1) # add first expr to cmdStack\n i += 1 \n\n # less\n elsif cmdStack[0] == :less\n #puts \"less\"\n a = resStack[1]\n b = resStack[0]\n resStack = resStack.drop(2)\n resStack.unshift(a < b)\n cmdStack = cmdStack.drop(1)\n\n # greater\n elsif cmdStack[0] == :greater\n a = resStack[1]\n b = resStack[0]\n #puts \"greater\"\n resStack = resStack.drop(2)\n resStack.unshift(a > b)\n cmdStack = cmdStack.drop(1)\n\n # eq\n elsif cmdStack[0] == :eq\n a = resStack[0]\n b = resStack[1]\n resStack = resStack.drop(2)\n resStack.unshift(a == b)\n cmdStack = cmdStack.drop(1)\n\n elsif cmdStack[0].is_a?(GCAnd)\n #puts \"and gc\"\n a = cmdStack[0]\n cmdStack = cmdStack.drop(1)\n cmdStack.unshift(\"and\")\n cmdStack.unshift(a.t2)\n cmdStack.unshift(a.t1)\n\n elsif cmdStack[0] == \"and\"\n a = resStack[0]\n b = resStack[1]\n #puts a&b\n resStack = resStack.drop(2)\n cmdStack = cmdStack.drop(1)\n resStack.unshift(a & b)\n\n elsif cmdStack[0].is_a?(GCOr)\n a = cmdStack[0]\n cmdStack = cmdStack.drop(1)\n cmdStack.unshift(\"or\")\n cmdStack.unshift(a.t2)\n cmdStack.unshift(a.t1)\n\n elsif cmdStack[0] == \"or\"\n a = resStack[0]\n b = resStack[1]\n resStack = resStack.drop(2)\n cmdStack.drop(1)\n resStack.unshift(a | b)\n\n\n\n # skip\n elsif cmdStack[0].is_a?(GCSkip)\n # no changes to result stack or memState\n cmdStack = cmdStack.drop(1)\n break\n i += 1\n\n # variable assignment\n elsif cmdStack[0].is_a?(GCAssign)\n # add to memState the new variable substitution \n #puts \"assign\"\n a = cmdStack[0]\n cmdStack = cmdStack.drop(1) # remove GCAssign from cmdstack\n cmdStack.unshift(a.s) # add symbol to be assigned\n cmdStack.unshift(\"assign\") # add assign statement\n cmdStack.unshift(a.e) # add expression to be evaluated\n i += 1\n \n #assignment operator\n # command stack [\"assign\",symbol,...]\n # res stack [const,...]\n elsif cmdStack[0] == \"assign\"\n memState = updateState(memState, cmdStack[1], resStack[0])\n cmdStack = cmdStack.drop(2) # remove assign and symbol\n resStack = resStack.drop(1) # remove constant \n i += 1\n\n # compose\n elsif cmdStack[0].is_a?(GCCompose)\n #puts \"compose\"\n a = cmdStack[0]\n cmdStack = cmdStack.drop(1) # remove GCCompose from command stack\n cmdStack.unshift(a.st2) # add 2nd statement to be evaluated\n cmdStack.unshift(a.st1) # add first statement to be evaluated\n i += 1\n\n # if statement breakdown\n elsif cmdStack[0].is_a?(GCIf)\n p = cmdStack[0] # top element from stack. Should be of type GCIf\n cmdStack = cmdStack.drop(1) #remove GCIf from cmdStack\n l = p.pairlist # get list from GCIf\n if l.length == 0\n cmdStack.unshift(GCSkip.new())\n else\n randval = rand(l.length) # get random value \n pair = l[randval]\n l.delete_at(randval) # remove statement from index randval\n \n # re-add broken down GCIf to command stakc\n cmdStack.unshift(GCIf.new(l)) # add remaining statements\n cmdStack.unshift(pair[1]) # add statement \n cmdStack.unshift(\"if\") # add if\n cmdStack.unshift(pair[0]) # add boolean guard\n i += 1\n end\n elsif cmdStack[0] == \"if\"\n b = resStack[0] # get the boolean that would have been evaluated from result stack\n if b == true \n s1 = cmdStack[1] # get the statement to be executed\n cmdStack = cmdStack.drop(3) # remove the if, s1 and remaining GCIf block \n resStack = resStack.drop(1) # remove that boolean check\n cmdStack.unshift(s1) #place the s1 value back on command stack\n else \n cmdStack = cmdStack.drop(2) # remove \"if\" and s1. The top element on stack should now be the remaining GCIf statements \n resStack = resStack.drop(1) # remove the boolean \n end\n\n # while loop\n # logic: get random statement from list and place it at top of command stack\n # check if the guard is true. If so then do that statement and repeat\n # if false, can either find another statement or do nothing\n # in this implementation, I will do nothing in the false case\n elsif cmdStack[0].is_a?(GCDo)\n #puts \"do\"\n w = cmdStack[0] # get Do statement off command stack\n #cmdStack = cmdStack.drop(1) # remove statement\n #cmdStack.unshift(GCDo.new(w.pairlist)) \n if w.pairlist.length == 0 # if no pairs, do nothing\n cmdStack.unshift(GCSkip.new())\n else\n randval = rand(w.pairlist.length) # get random value\n pair = w.pairlist[randval] # get random pair\n cmdStack = cmdStack.drop(1) # remove GCDo\n cmdStack.unshift(pair[1]) # add statement\n cmdStack.unshift(pair[0]) # add boolean check\n cmdStack.unshift(\"while\")\n cmdStack.unshift(pair[0]) # condition\n i += 1\n # command stack should look like [guard, \"while\", guard, statement, ...]\n end\n elsif cmdStack[0] == \"while\"\n # command stack will be in form [\"while\", guard, statement, ...]\n # resStack will be in form [true/false, ...]\n b = resStack[0] # check evaluated condition\n g = cmdStack[1] # guard\n s = cmdStack[2] # statement \n if b == true\n cmdStack.unshift(g) # place guard to front of stack\n cmdStack.unshift(s) # place statement to front of stack to be evaluated\n resStack = resStack.drop(1) # remove previously evaluated condition\n # new command stack will be in form [statement, guard, \"while\", guard, statement]\n else\n #puts \"while guard was false\"\n cmdStack.drop(3) #remove while, guard and statement from command stack\n cmdStack.unshift(GCSkip.new()) #end loop\n resStack = resStack.drop(1) # remove previously computed bool\n i += 1\n end\n else \n puts \"Invalid input\"\n break\n end\n end\n return memState \n\n end",
"def hashed_input\n\t\tmd5_hex = Digest::MD5.hexdigest(@term)\n\t\tmd5_hex.scan(/../).map { |s| s.to_i(16) }\n\tend",
"def find_returned_hashes(node, returning:)\n if node.is_a?(Array)\n *possible_returns, last_expression = *node\n return possible_returns.map { |c| find_returned_hashes(c, returning: false) }.flatten +\n # Check the last expression of a method body\n find_returned_hashes(last_expression, returning: returning)\n end\n\n case node.type\n when :hash\n if returning\n [node]\n else\n # This is some random hash literal\n []\n end\n when :begin\n # Check the last expression of a method body\n find_returned_hashes(node.children, returning: true)\n when :resbody\n _condition, _assign, body = *node\n find_returned_hashes(body, returning: returning)\n when :kwbegin\n find_returned_hashes(node.children, returning: returning)\n when :rescue\n try_body, rescue_body, _ensure_body = *node\n find_returned_hashes(try_body, returning: returning) + find_returned_hashes(rescue_body, returning: returning)\n when :block\n # Check methods with blocks for possible returns\n method_call, _args, *body = *node\n if method_call.type == :send\n find_returned_hashes(body, returning: returning)\n end\n when :if\n # Check each branch of a conditional\n _condition, *branches = *node\n branches.compact.map { |b| find_returned_hashes(b, returning: returning) }.flatten\n when :return\n find_returned_hashes(node.children.first, returning: true)\n else\n []\n end\n rescue\n p \"--- UnderscorizeMutationHashTransform crashed on node: ---\"\n p node\n raise\n end",
"def stack\n return (@stack&.stack || [])\n end",
"def hash\n self.state.hash\n end",
"def parse_deploy_output(stdout, stderr)\n stdout.scan(MARKER_REGEXP).zip(stderr.scan(MARKER_REGEXP)).map do |((stdout_node, stdout_service, stdout_mode, stdout_logs), (stderr_node, stderr_service, stderr_mode, stderr_logs))|\n # Some consistency checking\n log_warn \"Mismatch in deployment logs between stdout and stderr: stdout deployed node #{stdout_node}, stderr deployed node #{stderr_node}\" unless stdout_node == stderr_node\n log_warn \"Mismatch in deployment logs between stdout and stderr: stdout deployed service #{stdout_service}, stderr deployed service #{stderr_service}\" unless stdout_service == stderr_service\n log_warn \"Mismatch in deployment logs between stdout and stderr: stdout deployed mode is #{stdout_mode}, stderr deployed mode is #{stderr_mode}\" unless stdout_mode == stderr_mode\n platform = @platforms_handler.known_platforms.find { |search_platform| search_platform.deployable_services.include?(stdout_service) }\n raise \"No platform is able to deploy the service #{stdout_service}\" if platform.nil?\n\n {\n node: stdout_node,\n service: stdout_service,\n check: stdout_mode == 'Check',\n tasks: platform.parse_deploy_output(stdout_logs, stderr_logs || '')\n }\n end\n end",
"def stacks_sub(arg)\n ya_ta = tuc(\"x_ya\")\n ra_ta = tuc(\"x_ra\")\n la_ta = tuc(\"x_la\")\n wa_ta = tuc(\"x_wa\")\n\n h = Hash.[](\n # subscript ya\n \"ky\"=>ya_ta, \"khy\"=>ya_ta, \"gy\"=>ya_ta,\n \"py\"=>ya_ta, \"phy\"=>ya_ta, \"by\"=>ya_ta, \"my\"=>ya_ta,\n # subscript ra\n \"kr\"=>ra_ta, \"khr\"=>ra_ta, \"gr\"=>ra_ta,\n \"tr\"=>ra_ta, \"thr\"=>ra_ta, \"dr\"=>ra_ta,\n \"pr\"=>ra_ta, \"phr\"=>ra_ta, \"br\"=>ra_ta, \"mr\"=>ra_ta,\n \"shr\"=>ra_ta, \"sr\"=>ra_ta, \"hr\"=>ra_ta,\n # subscript la\n \"kl\"=>la_ta, \"gl\"=>la_ta, \"bl\"=>la_ta,\n \"zl\"=>la_ta, \"rl\"=>la_ta, \"sl\"=>la_ta,\n # subscript wa\n \"kw\"=>wa_ta, \"khw\"=>wa_ta, \"gw\"=>wa_ta, \"grw\"=>ra_ta+wa_ta,\n \"cw\"=>wa_ta, \"nyw\"=>wa_ta, \"tw\"=>wa_ta,\n \"dw\"=>wa_ta, \"tsw\"=>wa_ta, \"tshw\"=>wa_ta,\n \"zhw\"=>wa_ta, \"zw\"=>wa_ta, \"rw\"=>wa_ta,\n \"lw\"=>wa_ta, \"shw\"=>wa_ta, \"sw\"=>wa_ta, \"hw\"=>wa_ta,\n # subscript 'a\n \"t'\"=>tuc(\"x_'a\"), \"h'\"=>tuc(\"x_'a\"), \"a'\"=>tuc(\"x_'a\"))\n h[arg]\n end",
"def find(hash)\n ret = []\n scrape_all(hash).select{|x| x[:status] == :success}.each do |match|\n _ret = match[:result]\n _ret.merge!({:tracker => match[:tracker]})\n ret << _ret\n end\n ret\n end",
"def diff_and_cache(state)\n change_stacks = (@seed.keys + state.keys).uniq.map do |stack_id|\n stack = @connection.stacks.get(stack_id)\n if(@seed.fetch(stack_id, :stack_status) != state.fetch(stack_id, :stack_status))\n if(stack)\n stack_status = stack.stack_status\n stack_name = stack.stack_name\n else\n stack_status = 'DELETE_COMPLETE'\n stack_name = @seed.fetch(stack_id, state.fetch(stack_id, {}))[:stack_name]\n end\n # @todo provide expected stack resource type\n Smash.new(\n :stack_id => stack_id,\n :stack_name => stack_name,\n :event_id => Celluloid.uuid,\n :logical_resource_id => stack_name,\n :physical_resource_id => stack_id,\n :timestamp => Time.now.iso8601,\n :resource_type => 'AWS::CloudFormation::Stack',\n :resource_status => stack_status\n )\n end\n end.compact\n new_events = state.map do |stack_id, info|\n info[:events] - @seed.fetch(stack_id, {}).fetch(:events, [])\n end.flatten(1)\n @seed = state\n change_stacks + new_events\n end",
"def load_output_cache(txs)\n query = ''\n tx_seen = {}\n txs.each{|tx|\n if query.bytesize > (1024*512)\n # Postgres' max stack depth is 2MB by default.\n # Matt's b39 would otherwise crash us here.\n load_output_cache_from_query(query)\n query = ''\n end\n # Fetch immediate outputs for this tx.\n query += (query.empty? ? '' : ' OR ') + \"(hsh = '#{tx.hash}')\"\n tx_seen[tx.hash] = true\n tx.in.each{|txin|\n # Fetch all spent prev outs too.\n next if txin.coinbase?\n next if tx_seen[txin.previous_output]\n if query.bytesize > (1024*512)\n load_output_cache_from_query(query)\n query = ' '\n else\n query += ' OR '\n end\n query += \"(hsh = '#{txin.previous_output}' AND position = #{txin.prev_out_index})\"\n }\n }\n load_output_cache_from_query(query) if !query.empty?\n end",
"def hash\n code.hash\n end"
] |
[
"0.6308744",
"0.627303",
"0.6010338",
"0.59049094",
"0.5800646",
"0.5702913",
"0.5597827",
"0.55602944",
"0.5459044",
"0.5459044",
"0.5459044",
"0.54110825",
"0.5343382",
"0.5333893",
"0.5331919",
"0.5319655",
"0.53183067",
"0.5294882",
"0.5281151",
"0.52662575",
"0.5262031",
"0.52108675",
"0.51987803",
"0.5191252",
"0.51839805",
"0.51811475",
"0.51745445",
"0.51737607",
"0.5173197",
"0.51526207",
"0.514363",
"0.51414275",
"0.514107",
"0.51401037",
"0.5125344",
"0.5124061",
"0.51142776",
"0.5094094",
"0.5082468",
"0.5071931",
"0.50709647",
"0.5069156",
"0.5058718",
"0.5054771",
"0.5049335",
"0.5043093",
"0.5041851",
"0.5039144",
"0.50253475",
"0.5013174",
"0.5008168",
"0.5008168",
"0.5003",
"0.49925655",
"0.49813995",
"0.4965283",
"0.49589562",
"0.49552545",
"0.49500343",
"0.4945217",
"0.4945217",
"0.4944856",
"0.49389297",
"0.493605",
"0.49358767",
"0.49287096",
"0.4925188",
"0.4923296",
"0.4917668",
"0.4909017",
"0.49090075",
"0.49078465",
"0.4904519",
"0.49014083",
"0.48950517",
"0.48862168",
"0.48808646",
"0.4880863",
"0.48778814",
"0.48774874",
"0.48715615",
"0.48682782",
"0.48620397",
"0.48615634",
"0.4854618",
"0.48535666",
"0.48535666",
"0.48532033",
"0.48499888",
"0.4845082",
"0.48296258",
"0.4827991",
"0.48271182",
"0.48200944",
"0.481275",
"0.481158",
"0.48090285",
"0.4807584",
"0.48055428",
"0.47952396"
] |
0.81391597
|
0
|
Fetch all stack resources
|
def resource_all(stack)
request(
:path => "global/deployments/#{stack.name}/resources"
).fetch('body', 'resources', []).map do |resource|
Stack::Resource.new(stack,
:id => resource[:id],
:type => resource[:type],
:name => resource[:name],
:logical_id => resource[:name],
:created => Time.parse(resource[:insertTime]),
:updated => resource[:updateTime] ? Time.parse(resource[:updateTime]) : nil,
:state => :create_complete,
:status => 'OK',
:status_reason => resource.fetch(:warnings, []).map{|w| w[:message]}.join(' ')
).valid_state
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def resource_all(stack)\n result = request(\n :method => :get,\n :path => \"/stacks/#{stack.name}/#{stack.id}/resources\",\n :expects => 200\n )\n result.fetch(:body, :resources, []).map do |resource|\n Stack::Resource.new(\n stack,\n :id => resource[:physical_resource_id],\n :name => resource[:resource_name],\n :type => resource[:resource_type],\n :logical_id => resource[:logical_resource_id],\n :state => resource[:resource_status].downcase.to_sym,\n :status => resource[:resource_status],\n :status_reason => resource[:resource_status_reason],\n :updated => Time.parse(resource[:updated_time])\n ).valid_state\n end\n end",
"def resource_all(stack)\n all_result_pages(nil, :body,\n \"ListStackResourcesResponse\", \"ListStackResourcesResult\",\n \"StackResourceSummaries\", \"member\") do |options|\n request(\n :method => :post,\n :path => \"/\",\n :form => options.merge(\n Smash.new(\n \"Action\" => \"ListStackResources\",\n \"StackName\" => stack.id,\n )\n ),\n )\n end.map do |res|\n Stack::Resource.new(\n stack,\n :id => res[\"PhysicalResourceId\"],\n :name => res[\"LogicalResourceId\"],\n :logical_id => res[\"LogicalResourceId\"],\n :type => res[\"ResourceType\"],\n :state => res[\"ResourceStatus\"].downcase.to_sym,\n :status => res[\"ResourceStatus\"],\n :updated => res[\"LastUpdatedTimestamp\"],\n ).valid_state\n end\n end",
"def resource_all(stack)\n raise NotImplementedError\n end",
"def resources\n collection = Miasma::Models::Orchestration::Stack::Resources.new(self)\n collection.define_singleton_method(:perform_population) do\n valid = stack.sparkleish_template.fetch(:resources, {}).keys\n stack.custom[:resources].find_all { |r| valid.include?(r[:name]) }.map do |attrs|\n Miasma::Models::Orchestration::Stack::Resource.new(stack, attrs).valid_state\n end\n end\n collection\n end",
"def all\n setup_request \"#{@@resource_url}s\"\n end",
"def resources\n nodeset = query_root_node(\"gdacs:resources/gdacs:resource\", @@NAMESPACES)\n @items = []\n if !nodeset.nil?\n nodeset.each do |item|\n item_obj = SemanticCrawler::Gdacs::Resource.new(item)\n @items << item_obj\n end\n end\n @items\n end",
"def fetch_all\n klass_name = Starwars.const_get(name.split('::').last).const_get('RESOURCE_NAME')\n object = Starwars.const_get(\"#{klass_name.capitalize}\").new(url: \"#{Starwars::Base::BASE_URL}/#{klass_name}/\")\n Starwars::Request.new(resource: object, uri: object.url, params: {}).perform_request\n end",
"def all_resources\n @run_context && @run_context.resource_collection.all_resources\n end",
"def resources\n @resources ||= []\n end",
"def all\n describe(resource_uri)\n end",
"def get_all_resources(klasses = nil)\n replies = get_all_replies(klasses)\n return nil unless replies\n resources = []\n replies.each do |reply|\n resources.push(reply.resource.entry.collect{ |singleEntry| singleEntry.resource })\n end\n resources.compact!\n resources.flatten(1)\n end",
"def resources\n return @resources\n end",
"def resources\n return @resources\n end",
"def resources\n return @resources\n end",
"def resources\n @resources.values\n end",
"def resource_list\n self.resources\n end",
"def get_all_datasets_and_resources(base_url)\n return handle_request(URI.encode(base_url + '/current_package_list_with_ressources'))\n end",
"def get_resources\n init_folder unless @init # have I been initialized?\n return @resources \n end",
"def all_resources(set = Set.new)\n set << self\n self.each_resource { |r| r.all_resources(set) }\n set\n end",
"def resources\n @resources ||= Resources.new\n if block_given?\n yield(@resources)\n end\n @resources\n end",
"def resources\n @resources\n end",
"def list\n puts local_resources.map { |name, resource| name }.join(\" \")\n end",
"def all\n api_get(path)\n end",
"def resources\n typed_set(entities, Occi::Core::Resource)\n end",
"def promise_all\n _class_fetch_states[:all] = 'i'\n _promise_get(\"#{resource_base_uri}.json?timestamp=#{`Date.now() + Math.random()`}\").then do |response|\n collection = _convert_array_to_collection(response.json[self.to_s.underscore.pluralize])\n _class_fetch_states[:all] = 'f'\n _notify_class_observers\n warn_message = \"#{self.to_s}.all has been called. This may potentially load a lot of data and cause memory and performance problems.\"\n `console.warn(warn_message)`\n collection\n end.fail do |response|\n error_message = \"#{self.to_s}.all failed to fetch records!\"\n `console.error(error_message)`\n response\n end\n end",
"def find_all\n Regulate::Git::Interface.find_all.collect do |resource_data|\n self.new_from_git( resource_data )\n end\n end",
"def get_nested_resource_objects\n end",
"def list_resources\n resources = []\n addr = create_address(:sliceID => @@sliceID, :domain => @@domain)\n resource_prefix = \"#{addr.generate_address}/\"\n nodes = list_nodes(@@domain)\n nodes.each{|node|\n next if !node.include?(resource_prefix)\n node.slice!(resource_prefix)\n resources << node if !node.empty?\n }\n resources\n end",
"def resources\n @resources ||= {}\n end",
"def ar_retrieve_resources\n run_callbacks :ar_retrieve_resources do\n if params[:_search]\n # Fulltext search\n\n @resources = ar_model.search(params[:_search])\n @resources_count = @resources.count\n else\n intf = ar_model.interfaces[:rest]\n\n @resources_relation ||= ar_model.all\n\n # Authorization\n if intf.authorization_required?\n @resources_relation = @resources_relation.with_capability(aaa_context)\n end\n\n @authorized_resources_relation = @resources_relation\n\n # Filters\n @resources_relation = apply_scopes_to_relation(@resources_relation)\n @resources_relation = apply_json_filter_to_relation(@resources_relation)\n @resources_relation = apply_simple_filter_to_relation(@resources_relation)\n\n # Display filters\n @resources_relation = apply_sorting_to_relation(@resources_relation)\n @paginated_resources_relation = apply_pagination_to_relation(@resources_relation)\n\n @resources = @paginated_resources_relation\n @resources_count = @resources_relation.count\n end\n end\n\n @resources\n rescue ActiveRecord::RecordNotFound => e\n raise Exception::NotFound.new(e.message,\n :retry_possible => false)\n end",
"def find_resources(with_current_resource=true)\n ary = nil\n case depth\n when 0\n ary = []\n when 1\n ary = resource.children\n else\n ary = resource.descendants\n end\n with_current_resource ? [resource] + ary : ary\n end",
"def get_all(klass = nil, search_params = {})\n replies = get_all_bundles(klass, search_params)\n return nil unless replies\n resources = []\n\t\treplies.each do |reply|\n resources.push(reply.entry.collect{ |singleEntry| singleEntry.resource })\n end\n resources.compact!\n resources.flatten(1)\n\tend",
"def index\n @stacks = Stack.all\n end",
"def find_resources(&block)\n found = Varnisher::Urls.new\n\n self.class.resources.each do |resource|\n found += find_resource(resource, &block)\n end\n\n Varnisher.log.debug ''\n Varnisher.log.info \"#{found.length} total resources found.\\n\"\n\n found\n end",
"def resources\n Loader.resources.keys\n end",
"def index\n @resources = Resource.all\n end",
"def index\n @resources = Resource.all\n end",
"def index\n @resources = Resource.all\n end",
"def index\n @resources = Resource.all\n end",
"def resources options={}\n @resources ||= find_resources options\n end",
"def all_resources(set = Set.new)\n set << self\n set\n end",
"def describe_stack_resources(options = {})\n query = {'Action' => 'DescribeStackResources'}.merge(options)\n response = request(query)\n rid = response.xpath('//aws:DescribeStackResourcesResponse/aws:ResponseMetadata/aws:RequestId', NS).text\n resources = StackResource.create_from_response(response)\n return {:request_id => rid, :stack_resources => resources}\n end",
"def stacks\n response = OpenStack::Heat::Connection.heat_conn.req('GET', '/stacks')\n stacks_hash = JSON.parse(response.body)[\"stacks\"]\n stacks_hash.inject([]){|res, current| res << OpenStack::Heat::Stack.new(current); res}\n end",
"def resources\n @data.keys\n end",
"def find_all_resources options\n policy_scope(resource_class)\n end",
"def resources\n @resources ||= Marshal.load(Marshal.dump(@@resources))\n end",
"def resources\n @resources ||=\n query_service.custom_queries.find_by_property(property: :source_metadata_identifier, value: [], lazy: true).select do |resource|\n id = resource.source_metadata_identifier.first\n next if /99.*3506421/.match?(id)\n next if transform_id(id).length > 18\n RemoteRecord.catalog?(id)\n end.to_a\n end",
"def query_resources\n powershell_exec(\"get-dscresource\").result\n end",
"def resources\n @resources ||= @response[@resource_field].to_a\n end",
"def stack_plan_all(stack)\n logger.debug(\"loading all plans for stack `#{stack.id}`\")\n all_result_pages(nil, :body,\n \"ListChangeSetsResponse\", \"ListChangeSetsResult\",\n \"Summaries\", \"member\") do |options|\n request(\n :method => :post,\n :path => \"/\",\n :form => options.merge(\n Smash.new(\n \"Action\" => \"ListChangeSets\",\n \"StackName\" => stack.id || stack.name,\n )\n ),\n )\n end.map do |res|\n stack = Stack.new(self,\n id: res[\"StackId\"],\n name: res[\"StackName\"])\n stack.custom = {:plan_name => res[\"ChangeSetName\"],\n :plan_id => res[\"ChangeSetId\"]}\n stack.plan\n end\n end",
"def list(abs_url = nil)\n @ro_resource_mixin.list(abs_url)\n end",
"def resources\n self.collection.find({}, :sort => [:_id, :asc]).map do |hash|\n self.normalize hash\n end\n end",
"def scrape_resources(opts = {})\n BBLib::HashStruct.new.tap do |hash|\n resources.each do |resource|\n hash[resource.name] = resource.retrieve(opts)\n end\n end\n end",
"def resources\n @resources = {\n :lumber => Lumber.new,\n :clay => Clay.new,\n :iron => Iron.new,\n :crop => Crop.new\n } if @resources.nil?\n return @resources\n end",
"def linked_resources\n return @linked_resources\n end",
"def index\n @resource_groups = ResourceGroup.all\n end",
"def show_resources\r\n @resources_pages = Paginator.new self, \r\n Resource.count, \r\n Resource.get(\"resources_paginator_count\").to_i, \r\n params[:page] \r\n @resources = Resource.find :all, :order => 'name',\r\n :limit => @resources_pages.items_per_page,\r\n :offset => @resources_pages.current.offset \r\n end",
"def resources(*args)\n run_context.resource_collection.find(*args)\n end",
"def get_resource_cards(all=false)\n presenter = ResourcesPresenter.new(@cms_site, all)\n _resources = presenter.resources\n\n _resources[:url] = get_cms_url(_resources[:url])\n _resources[:cards].map! do |c|\n page = c[:page]\n file = cms_fragment_render(:file, page)\n link = cms_fragment_render(:link, page)\n url = file.present? || link.present? ? nil : get_cms_url(page.full_path)\n\n c.merge(\n date: DateTime.parse(cms_fragment_render(:published_date, page)).strftime('%d %B %y'),\n url: url,\n summary: cms_fragment_render(:summary, page),\n fileUrl: file,\n linkUrl: link,\n linktTile: cms_fragment_render(:link_title, page)\n )\n end\n\n @items = _resources\n end",
"def loaded_resources\n @_loaded_resources ||= []\n end",
"def fetch\n @routes = []\n source_extractors.keys.each do |source|\n extract_routes(source, data_for_source(source))\n end\n end",
"def resource_scope\n resource_class.all\n end",
"def load_stack_data(stack = nil)\n d_params = Smash.new(\"Action\" => \"DescribeStacks\")\n l_params = Smash.new(\"Action\" => \"ListStacks\")\n # TODO: Need to update to allow passing in list of desired\n # states for lookup or to remove state filtering. This\n # used to work with earlier versions with sfn but something\n # has changed breaking the integration.\n STACK_STATES.each_with_index do |state, idx|\n l_params[\"StackStatusFilter.member.#{idx + 1}\"] = state.to_s.upcase\n end\n if stack\n logger.debug(\"loading stack information for `#{stack.id}`\")\n d_params[\"StackName\"] = stack.id\n descriptions = all_result_pages(nil, :body,\n \"DescribeStacksResponse\", \"DescribeStacksResult\",\n \"Stacks\", \"member\") do |options|\n request(\n :method => :post,\n :path => \"/\",\n :form => options.merge(d_params),\n )\n end\n else\n logger.debug(\"loading stack listing information\")\n lists = all_result_pages(nil, :body,\n \"ListStacksResponse\", \"ListStacksResult\",\n \"StackSummaries\", \"member\") do |options|\n request(\n :method => :post,\n :path => \"/\",\n :form => options.merge(l_params),\n )\n end\n descriptions = []\n end\n (lists || descriptions).map do |stk|\n if lists\n desc = descriptions.detect do |d_stk|\n d_stk[\"StackId\"] == stk[\"StackId\"]\n end || Smash.new\n stk.merge!(desc)\n end\n if stack\n next if stack.id != stk[\"StackId\"] && stk[\"StackId\"].split(\"/\")[1] != stack.id\n end\n state = stk[\"StackStatus\"].downcase.to_sym\n unless Miasma::Models::Orchestration::VALID_RESOURCE_STATES.include?(state)\n parts = state.to_s.split(\"_\")\n state = [parts.first, *parts.slice(-2, parts.size)].join(\"_\").to_sym\n unless Miasma::Models::Orchestration::VALID_RESOURCE_STATES.include?(parts)\n state = :unknown\n end\n end\n new_stack = stack || Stack.new(self)\n new_stack.load_data(\n :id => stk[\"StackId\"],\n :name => stk[\"StackName\"],\n :capabilities => [stk.get(\"Capabilities\", \"member\")].flatten(1).compact,\n :description => stk[\"Description\"],\n :created => stk[\"CreationTime\"],\n :updated => stk[\"LastUpdatedTime\"],\n :notification_topics => [stk.get(\"NotificationARNs\", \"member\")].flatten(1).compact,\n :timeout_in_minutes => stk[\"TimeoutInMinutes\"] ? stk[\"TimeoutInMinutes\"].to_i : nil,\n :status => stk[\"StackStatus\"],\n :status_reason => stk[\"StackStatusReason\"],\n :state => state,\n :template_description => stk[\"TemplateDescription\"],\n :disable_rollback => !!stk[\"DisableRollback\"],\n :outputs => [stk.get(\"Outputs\", \"member\")].flatten(1).compact.map { |o|\n Smash.new(\n :key => o[\"OutputKey\"],\n :value => o[\"OutputValue\"],\n :description => o[\"Description\"],\n )\n },\n :tags => Smash[\n [stk.fetch(\"Tags\", \"member\", [])].flatten(1).map { |param|\n [param[\"Key\"], param[\"Value\"]]\n }\n ],\n :parameters => Smash[\n [stk.fetch(\"Parameters\", \"member\", [])].flatten(1).map { |param|\n [param[\"ParameterKey\"], param[\"ParameterValue\"]]\n }\n ],\n :custom => Smash.new(\n :stack_policy => stk[\"StackPolicyBody\"],\n :stack_policy_url => stk[\"StackPolicyURL\"],\n ),\n ).valid_state\n logger.debug(\"loaded stack information `#{new_stack.inspect}`\")\n new_stack\n end\n end",
"def fetch_events\n Smash[\n @connection.stacks.reload.map do |stack|\n [stack.id,\n Smash.new(\n :events => stack.events.map(&:attributes),\n :status => stack.stack_status,\n :stack_name => stack.stack_name\n )\n ]\n end\n ]\n end",
"def fetch_all\n fetch_many0(nil, Array)\n end",
"def all\n PaginatedResource.new(self)\n end",
"def all\n PaginatedResource.new(self)\n end",
"def all\n PaginatedResource.new(self)\n end",
"def all\n PaginatedResource.new(self)\n end",
"def all\n PaginatedResource.new(self)\n end",
"def all\n PaginatedResource.new(self)\n end",
"def all\n PaginatedResource.new(self)\n end",
"def all\n PaginatedResource.new(self)\n end",
"def all\n PaginatedResource.new(self)\n end",
"def all\n PaginatedResource.new(self)\n end",
"def index\n @resources = Resource.eager_load(:resource_type).all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @resources }\n end\n end",
"def all\n @cache ||= Request.get('/data')\n\n end",
"def index\n # @cloud_resources = CloudResource.all\n root = CloudResource.find_root\n root = params[:id] || root.id\n @cloud_resource = CloudResource.find root.to_i\n @cloud_resources = @cloud_resource.children(params[:page] || 1).order(\"name DESC\")\n end",
"def resources\n instance_variable_get(\"@#{resources_name}\")\n end",
"def get_resources()\n data, _status_code, _headers = get_resources_with_http_info()\n return data\n end",
"def index\n @resources = resource_class.send(:all)\n render json: @resources\n end",
"def resources\n @resources ||= process_data(decoded_body[resources_key])\n end",
"def prefetch gems\n end",
"def collection\n resource_class.all\n end",
"def enclosing_resources\n @enclosing_resources ||= []\n end",
"def index\n @chef_resources = ChefResource.all\n end",
"def index\n @resources = @project.resources.all\n end",
"def resources()\n end",
"def all\n @pool\n end",
"def fetch_all_archives\n fetch_archives\n rescue\n []\n end",
"def getresources(resourcesspec)\n components = resourcesspec.split(Split_Regex)\n parent = components.shift()\n childspec = components.join(':')\n prefix = @mgr.stack_family\n if prefix\n parent = prefix + parent unless parent.start_with?(prefix)\n end\n if @resources[parent]\n resources = @resources[parent]\n else\n stack = @resource.stack(parent)\n resources = {}\n @resources[parent] = resources\n tries = 0\n while true\n begin\n if stack.exists?()\n stack.resource_summaries().each() do |r|\n resources[r.data.logical_resource_id] = \"#{r.data.physical_resource_id}=#{r.data.resource_type}\"\n end\n end\n break\n rescue => e\n if /rate exceed/i =~ e.message\n tries += 1\n if tries >= 4\n raise e\n end\n sleep 2 * tries\n else\n raise e\n end # if rate exceeded\n end # begin / rescue\n end # while true\n end\n if childspec == \"\"\n return resources\n end\n children = resources.keys()\n components = childspec.split(Split_Regex)\n parentspec = components.shift()\n childspec = components.join(':')\n stackresource = nil\n if children.include?(\"#{parentspec}\")\n stackresource = parentspec\n elsif children.include?(\"#{parentspec}Stack\")\n stackresource = \"#{parentspec}Stack\"\n elsif children.include?(\"#{parentspec}Template\")\n stackresource = \"#{parentspec}Template\"\n end\n return {} unless stackresource\n # Example stack resource:\n # arn:aws:cloudformation:us-east-1:123456789012:stack/vpc-NetworkAclsStack-1S9R8KNR0ZGPM/1ac14690-cdce-11e6-9688-50fae97e0835\n value, type = resources[stackresource].split('=')\n raise \"Wrong type for #{stackresource} in #{resourcespec}, required: AWS::CloudFormation::Stack, actual: #{type}\" unless type == \"AWS::CloudFormation::Stack\"\n parent = value.split('/')[1]\n if childspec == \"\"\n return getresources(parent)\n else\n return getresources(\"#{parent}:#{childspec}\")\n end\n end",
"def resources\n ([self] + parent_groups).reverse.inject({}) do |memo, group|\n begin\n memo.merge(group.poise_spec_helpers[:resources] || {})\n rescue NoMethodError\n memo\n end\n end\n end",
"def index\n @api_v1_resources = Api::V1::Resource.all\n end",
"def resourcegroups\n result = @http.get('/resourcegroups')\n result[1]\n end",
"def index\n @stack_accounts = StackAccount.all\n end",
"def fetch_all!\n fetch_all(true)\n end",
"def resources\n @resources ||= @internal_struct[:resources] || {}\n end",
"def all\n storage.map(&:repository)\n end",
"def wait_all\n @resources.each do |name,object|\n object.wait if object.respond_to? :wait\n end\n end",
"def sp_resources_all\n sp_resource_all = Array.new\n mini_maps.each do |map|\n sp_resource_all << map.sp_resources_all unless map.sp_resources_all.blank?\n end\n return sp_resource_all.uniq\n end"
] |
[
"0.795353",
"0.78062457",
"0.75701094",
"0.71294576",
"0.6813014",
"0.65862066",
"0.6554737",
"0.6542657",
"0.64352626",
"0.6412328",
"0.639027",
"0.6345106",
"0.6345106",
"0.6345106",
"0.6318146",
"0.6285333",
"0.62513447",
"0.6229829",
"0.6191969",
"0.6177501",
"0.6159829",
"0.6130727",
"0.61133885",
"0.6107493",
"0.61050445",
"0.60688156",
"0.6061672",
"0.6046779",
"0.60461926",
"0.6018221",
"0.5998303",
"0.59933096",
"0.5945433",
"0.5898508",
"0.58738",
"0.58634996",
"0.58634996",
"0.58634996",
"0.5859129",
"0.5859005",
"0.58588475",
"0.58570063",
"0.58416814",
"0.5829809",
"0.5829047",
"0.58235604",
"0.5823434",
"0.5813816",
"0.58124655",
"0.5810618",
"0.58016616",
"0.5791813",
"0.57828975",
"0.5779999",
"0.5771414",
"0.57662207",
"0.5749837",
"0.57460594",
"0.5745591",
"0.57285625",
"0.5726445",
"0.5724482",
"0.5722147",
"0.5716659",
"0.5709162",
"0.5700594",
"0.5700594",
"0.5700594",
"0.5700594",
"0.5700594",
"0.5700594",
"0.5700594",
"0.5700594",
"0.5700594",
"0.5700594",
"0.57002485",
"0.5698252",
"0.5697095",
"0.5689262",
"0.5683214",
"0.5672558",
"0.566874",
"0.56644833",
"0.5662861",
"0.5652144",
"0.56411314",
"0.56062096",
"0.56005466",
"0.55871373",
"0.55713725",
"0.55637825",
"0.55605614",
"0.5550236",
"0.55421287",
"0.5539052",
"0.5535569",
"0.55324084",
"0.5527726",
"0.5526255",
"0.552592"
] |
0.7636058
|
2
|
Returns a resized image for display.
|
def display_image
image.variant(resize_to_limit: [500, 500])
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def create_resized_image\n create_image do |xfrm|\n if size\n MiniMagick::Tool::Convert.new do |cmd|\n cmd << xfrm.path # input\n cmd.flatten\n cmd.resize(size)\n cmd << xfrm.path # output\n end\n end\n end\n end",
"def display_image\n image.variant(resize_to_limit: [500,500])\n end",
"def create_resized_image\n create_image do |xfrm|\n if size\n xfrm.flatten\n xfrm.resize(size)\n end\n end\n end",
"def resize\n @image.resize \"#{@placement[:a]}x#{OUTER}\\!\"\n end",
"def display_image \r\n self.image.variant(resize_to_limit: [1000, 1000]) \r\n end",
"def display_image\n image.variant resize_to_limit: Settings.validation.post.img_resize\n end",
"def resize_pic(filename,resizewidth,out_path)\n nw = resizewidth\n n = File.basename(filename)\n i = QuickMagick::Image.read(filename).first\n w = i.width.to_f # Retrieves width in pixels\n h = i.height.to_f # Retrieves height in pixels\n pr = w/h\n nh = nw/pr \n i.resize \"#{nw}x#{nh}!\"\n i.save \"#{out_path}/#{n}\"\nend",
"def small(input) # Method that returns the image\n self.images[input].variant(resize: \"300x300\").processed # Resizing the image and return it\n end",
"def resize\n image = ManagedImage.from_path(params[:image])\n width = params[:width].to_i\n height = params[:height].to_i\n render json: image.resize(width, height)\n end",
"def resize\n\t\t@image = Qt::Image.new @parent.width/2, @parent.width/2, 7\n\t\t@image.fill Qt::Color.new \"#ffffff\"\n\tend",
"def thumbnail(size); end",
"def resize(size='512x512')\n if self.url.present?\n image = MiniMagick::Image.open(self.url)\n image.resize(size)\n image\n end\n end",
"def create_medium\n return create_resized_pic(MEDIUM_HEIGHT, MEDIUM_WIDTH, SIZE_MEDIUM)\n end",
"def resize_to_fit\n image = ManagedImage.from_path(params[:image])\n width = params[:width].to_i\n height = params[:height].to_i\n render json: image.resize_to_fit(width, height)\n end",
"def my_resize(width, height)\n manipulate! do |img|\n img.resize \"#{width}x#{height}!\"\n img\n end\n end",
"def small_image_url\n self.small_image.convert('-resize 50%').url\n end",
"def resize_image(img_path)\n img = MiniMagick::Image.open(img_path)\n print_status(\"Original #{img_path} dimension = #{img.height}x#{img.width}\")\n new_width = img.width - (img.width * REIZEPERT).to_i\n new_height = img.height - (img.height * REIZEPERT).to_i\n img = img.resize(\"#{new_width}x#{new_height}\")\n print_status(\"Resized #{img_path} dimension = #{img.height}x#{img.width}\")\n img.write(img_path)\nend",
"def image_as_medium_thumbnail\n image.variant(resize_to_fill: [350, 350]).processed\n end",
"def create_thumbnail\n return create_resized_pic(THUMBNAIL_HEIGHT, THUMBNAIL_WIDTH, SIZE_THUMBNAIL)\n end",
"def generate_thumbnail path, img\n img = img.resize_to_fit 200,200\n img.write path\n end",
"def generate_image(url)\n # Capture the screenshot\n kit = IMGKit.new(url, quality: 90, width: 1280, height: 720)\n\n # Resize the screengrab using rmagick\n Image.from_blob(kit.to_img(:jpg)).first.\n resize_to_fill!(params['width'].to_i, params['height'].to_i).to_blob\nend",
"def set_original\n if keep_original\n if size_o.blank?\n image = MiniMagick::Image.open(name)\n self.size_o = \"#{image.width}x#{image.height}\"\n end\n else\n self.size_o = ''\n end\nend",
"def resizeImage(imageName)\n image = MiniMagick::Image.open(imageName)\n height = image.height\n width = image.width\n\n if height > width\n ratio = 128.0 / height\n reHeight = (height * ratio).floor\n reWidth = (width * ratio).floor\n else\n ratio = 128.0 / width\n reHeight = (height * ratio).floor\n reWidth = (width * ratio).floor\n end\n\n image.resize(\"#{reHeight} x #{reWidth}\")\n image.write(\"resize.jpg\")\n end",
"def requested_image_resolution\n return resized_image_resolution unless resized_image_resolution.nil?\n original_image_resolution\n end",
"def show\n respond_to do |format|\n format.jpeg { send_data @recipe_image.resize }\n end\n end",
"def show\n maybe_update_aspect_ratio @image\n end",
"def resize(width, height); end",
"def resize_image(img, size)\n size = size.first if size.is_a?(Array) && size.length == 1\n if size.is_a?(Fixnum) || (size.is_a?(Array) && size.first.is_a?(Fixnum))\n if size.is_a?(Fixnum)\n # Borrowed from image science's #thumbnail method and adapted \n # for this.\n scale = size.to_f / (img.width > img.height ? img.width.to_f : img.height.to_f)\n img.resize!((img.width * scale).round(1), (img.height * scale).round(1), false)\n else\n img.resize!(size.first, size.last, false) \n end\n else\n w, h = [img.width, img.height] / size.to_s\n img.resize!(w, h, false)\n end\n temp_paths.unshift random_tempfile_filename\n self.size = img.export(self.temp_path)\n end",
"def resize_image(image, options = {})\n processor = ::RedArtisan::CoreImage::Processor.new(image)\n size = options[:size]\n size = size.first if size.is_a?(Array) && size.length == 1\n if size.is_a?(Fixnum) || (size.is_a?(Array) && size.first.is_a?(Fixnum))\n if size.is_a?(Fixnum)\n processor.fit(size)\n else\n processor.resize(size[0], size[1])\n end\n else\n new_size = get_image_size(image) / size.to_s\n processor.resize(new_size[0], new_size[1])\n end\n \n destination = options[:to] || @file\n AttachmentFu::Pixels::Image.new destination do |img|\n processor.render do |result|\n img.width, img.height = get_image_size(result)\n result.save destination, OSX::NSJPEGFileType\n end\n end\n end",
"def resize_and_optimize(width, height)\n manipulate! do |img|\n img.format(\"jpg\") do |c|\n c.quality \"70\"\n c.resize \"#{width}x#{height}\"\n end\n\n img\n end\n end",
"def resize_image(file_name,resize_file_name=\"test\",resized_width=0,resized_height=0,render_file_as=\"png\")\n image = Image.import(file_name)\n resize_image = image.resize(resized_width, resized_height,true)\n\n file=File.new(resize_file_name,\"wb\")\n if render_file_as == \"png\"\n file.write resize_image.png\n elsif\t render_file_as == \"jpeg\"\n file.write resize_image.jpeg\n elsif\t render_file_as == \"gd\"\n file.write resize_image.gd\n elsif\t render_file_as == \"gd2\"\n file.write resize_image.gd2\n else\n puts \"Provide proper image\"\n end\n file.close\n end",
"def old_resize_image(img, size)\n size = size.first if size.is_a?(Array) && size.length == 1 && !size.first.is_a?(Fixnum)\n if size.is_a?(Fixnum) || (size.is_a?(Array) && size.first.is_a?(Fixnum))\n size = [size, size] if size.is_a?(Fixnum)\n img.thumbnail!(*size)\n elsif size.is_a?(String) && size =~ /^c.*$/ # Image cropping - example geometry string: c75x75\n dimensions = size[1..size.size].split(\"x\")\n img.crop_resized!(dimensions[0].to_i, dimensions[1].to_i)\n else\n img.change_geometry(size.to_s) { |cols, rows, image| image.resize!(cols<1 ? 1 : cols, rows<1 ? 1 : rows) }\n end\n self.width = img.columns if respond_to?(:width)\n self.height = img.rows if respond_to?(:height)\n img.strip! unless attachment_options[:keep_profile]\n quality = img.format.to_s[/JPEG/] && get_jpeg_quality\n out_file = write_to_temp_file(img.to_blob { self.quality = quality if quality })\n temp_paths.unshift out_file\n self.size = File.size(self.temp_path)\n end",
"def resize\n if size.max > 1024\n res = %x( #{magick_bin_name(\"convert\")} -auto-orient -resize 1024x768 #{Shellwords.shellescape path} #{Shellwords.shellescape path})\n Rails.logger.info res\n end\n unless has_thumbnail?\n unless File.exists? path.gsub(/(.+)\\/.+/, '\\1/thumbs')\n Dir.mkdir path.gsub(/(.+)\\/.+/, '\\1/thumbs')\n end\n ## that's a bit broken on windows - why?\n res = %x( #{magick_bin_name(\"convert\")} -verbose -auto-orient -strip -thumbnail 300x160 #{Shellwords.shellescape path} #{Shellwords.shellescape path.gsub(/(.+)\\/(.+)/, '\\1/thumbs/\\2')})\n Rails.logger.info res\n end\n end",
"def resizeImage(file, size)\n img_orig = Magick::Image.read(\"public/#{file}\").first\n \n width = img_orig.columns\n height = img_orig.rows\n \n if(width > size || height > size)\n if(width > height)\n height = size * height / width\n width = size\n else\n width = size * height / width\n height = size\n end\n \n img = img_orig.resize_to_fit(width, height)\n \n img.write(\"public/#{file}\")\n end\n end",
"def resize_image(image_string, dest)\n image = Gg::ImageProcessing.new(image_string)\n i_name = dest.split('/').last\n image.blob_generate(project.image_for(i_name, 'show'))\n image.blob_generate(project.image_for(i_name, 'show_image_desk'), 'desktop')\n image.blob_generate(project.image_for(i_name, 'show_image_mob'), 'mobile')\n end",
"def thumbnail input\n return self.images[input].variant(resize: '300x300').processed\n end",
"def extract_thumb(input, output, width, height)\n Image::Editing::ResizeToFill.new(input, output, width, height).run\n end",
"def process_small_image\n small_image.encode!(:png).convert!('-resize 50x50 -gravity center -background none -extent 50x50')\n end",
"def resize_image uri, options = { }\n\n\t# parse id, mime type from image uri\n\tformat = uri.split('/').last.match(/\\.(.+)$/)[1]\n\tid = uri.split('/').last.sub(/\\..+$/, '').slugify\n\n\t# resize image and save to /tmp\n\timage = Image.read(uri)[0]\n\t\n\t# calculate width/height based on percentage of \n\t# difference of width from absolute value of 150\n\tif options[:width]\n\t\twidth = options[:width]\n\t\tscale = (image.page.width - width) / image.page.width.to_f\n\t\theight = image.page.height - (image.page.height * scale)\n\n\t\timage = image.thumbnail(width, height)\n\t\timage.write(\n\t\t\tpath = \"/tmp/#{id}-constrainedw.#{format}\"\n\t\t)\t\t\n\n\telsif options[:height]\n\t\theight = options[:height]\n\t\tscale = (image.page.height - height) / image.page.height.to_f\n\t\twidth = image.page.width - (image.page.width * scale)\n\n\t\timage = image.thumbnail(width, height)\n\t\timage.write(\n\t\t\tpath = \"/tmp/#{id}-thumbh.#{format}\"\n\t\t)\n\n\telse\n\t\twidth = 150\n\t\tscale = (image.page.width - width) / image.page.width.to_f\n\t\theight = image.page.height - (image.page.height * scale)\n\n\t\timage = image.thumbnail(width, height)\n\t\timage.write(\n\t\t\tpath = \"/tmp/#{id}-thumb.#{format}\"\n\t\t)\n\n\tend\n\n path\nend",
"def getImg(width=64, height=64)\n if self.image\n self.image+\"?width=#{width}&height=#{height}\"\n else\n \"no_image.png\"\n end\n end",
"def strict_resize image, w, h\n image.resize \"#{ w }x#{ h }!\"\n image\n end",
"def large_image\n self.image.large\n end",
"def resize_to_fill\n image = ManagedImage.from_path(params[:image])\n width = params[:width].to_i\n height = params[:height].to_i\n render json: image.resize_to_fill(width, height)\n end",
"def size\n \"#{width}x#{height}\"\n end",
"def size\n \"#{width}x#{height}\"\n end",
"def resize_image\n image = params[:fleet][:image]\n return if image.nil?\n\n begin\n image = MiniMagick::Image.new(image.tempfile.path)\n image.resize '175x260>'\n rescue MiniMagick::Error\n # errors here will be caught in model validation\n end\n end",
"def create_thumbnail\n image = Image.from_blob(self.photo_image).first\n thumbnail = image.resize_to_fill(320,240, gravity=CenterGravity)\n thumbnail.to_blob\n end",
"def resize_to(width, height); end",
"def resize_image(img, size)\n size = size.first if size.is_a?(Array) && size.length == 1 && !size.first.is_a?(Fixnum)\n if size.is_a?(Fixnum) || (size.is_a?(Array) && size.first.is_a?(Fixnum))\n size = [size, size] if size.is_a?(Fixnum)\n img.thumbnail!(*size)\n elsif size.is_a?(String) && size =~ /^c.*$/ # Image cropping - example geometry string: c75x75\n dimensions = size[1..size.size].split(\"x\")\n img.crop_resized!(dimensions[0].to_i, dimensions[1].to_i)\n elsif size.is_a?(String) && size =~ /^b.*$/ # Resize w/border - example geometry string: b75x75\n dimensions = size[1..size.size].split(\"x\")\n img.change_geometry(dimensions.join(\"x\")) do |cols, rows, image|\n image.resize!(cols<1 ? 1 : cols, rows<1 ? 1 : rows )\n end\n img.background_color = \"black\"\n x_offset = (img.columns - dimensions[0].to_i) / 2\n y_offset = (img.rows - dimensions[1].to_i) / 2\n img = img.extent(dimensions[0].to_i, dimensions[1].to_i, x_offset, y_offset)\n else\n img.change_geometry(size.to_s) { |cols, rows, image| image.resize!(cols<1 ? 1 : cols, rows<1 ? 1 : rows) }\n end\n img.strip! unless attachment_options[:keep_profile]\n temp_paths.unshift write_to_temp_file(img.to_blob)\n end",
"def to_image(width, height)\n image = Image.new_blank(width, height)\n self.render(image)\n return image\n end",
"def create_thumbnail\n ImageGeneratingService.new(self, 'Thumbnail.png', 'image/png').generate_resized(120)\n end",
"def resize_image(img, size)\n size = size.first if size.is_a?(Array) && size.length == 1 && !size.first.is_a?(Fixnum)\n if size.is_a?(Fixnum) || (size.is_a?(Array) && size.first.is_a?(Fixnum))\n size = [size, size] if size.is_a?(Fixnum)\n img.thumbnail!(*size)\n elsif size.is_a?(String) && size =~ /^c.*$/ # Image cropping - example geometry string: c75x75\n dimensions = size[1..size.size].split(\"x\")\n img.crop_resized!(dimensions[0].to_i, dimensions[1].to_i)\n elsif size.is_a?(String) && size =~ /^b.*$/ # Resize w/border - example geometry string: b75x75\n dimensions = size[1..size.size].split(\"x\")\n img.change_geometry(dimensions.join(\"x\")) do |cols, rows, image| \n image.resize!(cols<1 ? 1 : cols, rows<1 ? 1 : rows ) \n end\n img.background_color = \"black\"\n x_offset = (img.columns - dimensions[0].to_i) / 2\n y_offset = (img.rows - dimensions[1].to_i) / 2\n img = img.extent(dimensions[0].to_i, dimensions[1].to_i, x_offset, y_offset)\n else\n img.change_geometry(size.to_s) { |cols, rows, image| image.resize!(cols<1 ? 1 : cols, rows<1 ? 1 : rows) }\n end\n img.strip! unless attachment_options[:keep_profile]\n temp_paths.unshift write_to_temp_file(img.to_blob)\n end",
"def large\n if image.on_storage?\n variant(1200)\n else\n relevant_assets_cache.select { |item| item.width <= 1200 }.sort_by(&:width).last.url\n end\n end",
"def resize(raw_geometry='320x240', quality: nil)\n \n geometry = calc_resize(raw_geometry\n )\n read() do |preview|\n \n preview.change_geometry!(geometry) do |cols, rows, img|\n img.resize!(cols, rows)\n end\n \n write preview, quality\n end\n \n end",
"def scale_image(preferred_width, preferred_height)\n # Retrieve the current height and width\n image_data = ActiveStorage::Analyzer::ImageAnalyzer.new(image).metadata\n new_width = image_data[:width]\n new_height = image_data[:height]\n\n # Adjust the width\n if new_width > preferred_width\n new_width = preferred_width\n new_height = (new_height * new_width) / image_data[:width]\n end\n\n # Adjust the height\n if new_height > preferred_height\n old_height = new_height\n new_height = preferred_height\n new_width = (new_width * new_height) / old_height\n end\n\n # Return the resized image\n image.variant(resize_to_limit: [new_width, new_height])\n end",
"def resize(path)\n gravity = @options.key?(:gravity) ? @options[:gravity] : 'Center'\n\n img = MiniMagick::Image.open(@file)\n cols, rows = img[:dimensions]\n\n img.combine_options do |cmd|\n if @width != cols || @height != rows\n scale_x = @width/cols.to_f\n scale_y = @height/rows.to_f\n\n if scale_x >= scale_y\n cols = (scale_x * (cols + 0.5)).round\n rows = (scale_x * (rows + 0.5)).round\n cmd.resize \"#{cols}\"\n else\n cols = (scale_y * (cols + 0.5)).round\n rows = (scale_y * (rows + 0.5)).round\n cmd.resize \"x#{rows}\"\n end\n end\n\n cmd.quality @options[:quality] if @options.key?(:quality)\n cmd.gravity gravity\n cmd.background 'rgba(255,255,255,0.0)'\n cmd.extent \"#{@width}x#{@height}\" if cols != @width || rows != @height\n end\n\n img.write(path)\n end",
"def resize_image(params)\n # The path of the image\n path = \"public/images/#{params[1]}/#{@tempo.id}_#{params[1]}.#{params[0]}\"\n # Read the image\n img = Magick::Image.read(\"public/images/original/#{@original_image_name}\").first\n # Resize and Crop the image\n target = Magick::Image.new(params[2], params[3])\n thumb = img.resize_to_fill!(params[2], params[3])\n target.composite(thumb, Magick::CenterGravity, Magick::CopyCompositeOp).write(path)\n # Insert the width and height into an object\n @tempo.width, @tempo.height = \"#{params[2]}\", \"#{params[3]}\"\n # Add the link and tags to its DB\n add_linkID_tagsID(path,params[1])\n # Delete the image after uploading it to the storage\n File.delete(path)\n end",
"def image_size(style = default_style)\n return nil if instance_read(:meta).nil? || instance_read(:meta).empty?\n \"#{width(style)}x#{height(style)}\"\n end",
"def resize!\n end",
"def resize(width, height)\n end",
"def sized(width, height)\n\t\t\t@sized_thumb = @template\n\t\t\t@sized_thumb.sub! \"{width}\", width.to_s\n\t\t\t@sized_thumb.sub! \"{height}\", height.to_s\n\t\tend",
"def display_image\n image.variant(combine_options: {\n auto_orient: true,\n gravity: \"center\",\n resize: \"250x250^\",\n crop: \"250x250+0+0\"\n })\n end",
"def show\n\n matches = params[:size].match(\"([0-9]+)x([0-9]+).*\") if params[:size]\n\n default_size = 200\n min_size = 16\n max_size = 200\n\n if matches\n\n width = matches[1].to_i\n height = matches[2].to_i\n\n if ((width < min_size) || (width > max_size) || (height < min_size) || (height > max_size))\n width = default_size\n height = default_size\n end\n\n else\n width = 200\n height = 200\n end\n \n send_cached_data(\"public/pictures/show/#{width.to_i}x#{height.to_i}/#{params[:id].to_i}.jpg\",\n :type => 'image/jpeg', :disposition => 'inline') {\n\n img = Magick::Image.from_blob(@picture.data).first\n img = img.change_geometry(\"#{width}x#{height}>\") do |c, r, i| i.resize(c, r) end\n\n img.format = \"jpg\"\n img.to_blob\n }\n\n end",
"def resize!(options)\n options = options.symbolize_keys\n raise ArgumentError, ':size must be included in resize options' unless options[:size]\n\n # load image\n img = rmagick_image.dup\n\n # Find dimensions\n x, y = size_to_xy(options[:size])\n\n # prevent upscaling unless :usample param exists.\n unless options[:upsample]\n x = img.columns if x > img.columns\n y = img.rows if y > img.rows\n end\n\n # Perform image resize\n case\n when options[:crop] && !options[:crop].is_a?(Hash) && img.respond_to?(:crop_resized!)\n # perform resize and crop\n scale_and_crop(img, [x, y], options[:offset])\n when options[:stretch]\n # stretch the image, ignoring aspect ratio\n stretch(img, [x, y]) \n else\n # perform the resize without crop\n scale(img, [x, y]) \n end\n\n if options[:format]\n img.format = options[:format].to_s.upcase\n img.strip!\n end\n\n options[:quality] ? img.to_blob { self.quality = options[:quality].to_i } : img.to_blob\n end",
"def resize_image\n unless logo.nil?\n if logo.height != 100\n self.logo = logo.thumb('x100') # resize height and maintain aspect ratio\n end\n end\n end",
"def scale_to(new_size, background:background)\n new_size = SugarCube::CoreGraphics::Size(new_size)\n\n image_size = self.size\n\n if CGSizeEqualToSize(image_size, new_size)\n return self\n end\n\n new_image = nil\n width = image_size.width\n height = image_size.height\n\n target_width = new_size.width\n target_height = new_size.height\n\n scale_factor = 0.0\n scaled_width = target_width\n scaled_height = target_height\n\n thumbnail_point = CGPoint.new(0.0, 0.0)\n width_factor = target_width / width\n height_factor = target_height / height\n\n if width_factor < height_factor\n scale_factor = width_factor\n else\n scale_factor = height_factor\n end\n\n scaled_width = width * scale_factor\n scaled_height = height * scale_factor\n\n # center the image\n\n if width_factor < height_factor\n thumbnail_point.y = (target_height - scaled_height) * 0.5\n elsif width_factor > height_factor\n thumbnail_point.x = (target_width - scaled_width) * 0.5\n end\n\n # this is actually the interesting part:\n\n UIGraphicsBeginImageContextWithOptions(new_size, false, self.scale)\n\n if background\n background = background.uicolor\n context = UIGraphicsGetCurrentContext()\n background.setFill\n CGContextAddRect(context, [[0, 0], new_size])\n CGContextDrawPath(context, KCGPathFill)\n end\n\n thumbnail_rect = CGRectZero\n thumbnail_rect.origin = thumbnail_point\n thumbnail_rect.size.width = scaled_width\n thumbnail_rect.size.height = scaled_height\n\n self.drawInRect(thumbnail_rect)\n\n new_image = UIGraphicsGetImageFromCurrentImageContext()\n UIGraphicsEndImageContext()\n\n raise \"could not scale image\" unless new_image\n\n return new_image\n end",
"def create_advanced\n image_service = ImageGeneratingService.new(self, 'Advanced.jpg', 'image/jpeg', 69)\n output_path = image_service.generate\n original_size_mb = File.size(output_path).to_f / 2**20\n if original_size_mb > 1.0\n image_service.generate_resized(1200)\n end\n end",
"def resize_image(download_path, resize_path, height, width, crop)\n `convert #{download_path.inspect} -resize \"#{height}x#{width}\" #{resize_path.inspect}`\n end",
"def image_size(path)\n magick = MiniMagick::Image.open path\n \"#{magick.width}x#{magick.height}\"\nend",
"def rmagick_img\n return @rmagick_img unless @rmagick_img.blank?\n if self.class.st_config[:blob].present?\n @rmagick_img ||= Magick::ImageList.new.from_blob(\n self.send(self.class.st_config[:blob])\n ).first\n elsif self.class.st_config[:file].present?\n @rmagick_img ||= Magick::ImageList.new.from_blob(\n File.read(self.send(self.class.st_config[:file]))\n ).first\n else\n raise \"No thumb source defined. You have to define neither :blob or :file\"\n end\n \n if self.class.st_config[:before_resize].present? && self.respond_to?(self.class.st_config[:before_resize].to_sym)\n self.send(self.class.st_config[:before_resize].to_sym)\n end\n @rmagick_img\n \n end",
"def resize_image(request)\n http_request = request.to_http_info(@api_client.config)\n make_request(http_request, :GET, 'File')\n end",
"def resize(path)\n img = MiniMagick::Image.open(@file)\n img.combine_options do |c|\n c.quality @options[:quality] if @options[:quality]\n c.resize \"#{@width}x#{@height}>\"\n end\n\n img.write(path)\n end",
"def thumbnail(width, input, output)\n profile_normalization_args=[\"--eprofile\", srgb_profile_path, \"--delete\"]\n vips_jpg_params=\"[Q=#{@jpeg_q },interlace,optimize_coding,strip]\"\n args = if width\n # The image will be resized to fit within a box\n # which is `width` wide and very, very very tall.\n # See:\n # https://github.com/libvips/libvips/issues/781\n # https://github.com/libvips/ruby-vips/issues/150\n [\n vips_thumbnail_command, input.path,\n *profile_normalization_args,\n \"--size\", \"#{width}x1000000\",\n \"-o\", \"#{output.path}#{vips_jpg_params}\"\n ]\n else\n [ vips_command, \"copy\", input.path,\n *profile_normalization_args,\n \"#{output.path}#{vips_jpg_params}\"\n ]\n end\n @cmd.run(*args)\n end",
"def create_resized_image(request)\n http_request = request.to_http_info(@api_client.config)\n make_request(http_request, :POST, 'File')\n end",
"def resize_image(content, content_type, size)\n filename = \"/tmp/\" + (1 + rand(10000000)).to_s + \".\" + content_type\n filename_resized = \"/tmp/\" + (1 + rand(10000000)).to_s + \"_resized.\" + content_type\n File.open(filename, 'w') do |f|\n f.write( content)\n end\n result = %x[sips --resampleWidth #{size} #{filename} --out #{filename_resized}]\n content_resized = IO.readlines(filename_resized,'r').to_s\n return content_resized\nend",
"def resize new_width, new_height\n win.resize new_width, new_height\n end",
"def to_html\n \"<img src='#{@url}' height='#{@height}' width='#{width}' />\"\n end",
"def do_resize(height = THUMBNAIL_HEIGHT, width = THUMBNAIL_WIDTH)\n #MES- Only do thumbnailing if the Image Magick library can be loaded.\n # This is to make setup easier for other developers- they are not\n # required to have Image Magick.\n # More information on Image Magick is available at \n # http://studio.imagemagick.org/RMagick/doc/usage.html\n if RMAGICK_SUPPORTED\n #MES- Turn the blob into an ImageMagick object\n img = Magick::Image.from_blob(data).first\n if img.nil?\n logger.info \"Failed to resize image #{self.name}- unable to create RMagick wrapper for image\"\n return nil\n end\n \n #MES- Shrink the image\n return img.crop_resized(width, height)\n else\n return nil\n end\n end",
"def get_image(file, max_width, max_height)\n max_width_pixels = max_width * 300\n max_height_pixels = max_height * 300\n magick = MiniMagick::Image.read(file.download)\n magick.auto_orient\n magick.resize(\"#{max_width_pixels}x#{max_height_pixels}\") if magick.height > max_height_pixels || magick.width > max_width_pixels\n temp_path = \"#{Dir.tmpdir}/#{SecureRandom.alphanumeric(50)}\"\n magick.write(temp_path)\n return { path: temp_path, height: magick.height / 300.0, width: magick.width / 300.0 }\n end",
"def img_resize( dat, w, h, options = {} )\n quality = options[:quality]\n format = options[:format]\n\n begin\n img = GD2::Image.load(dat)\n if h == 0\n h = ( w / img.aspect ).to_i\n end\n\n puts \"resizing image… width: #{w}, height: #{h}, quality: #{quality}\" if $debug\n\n # make sure it doesn't upscale image\n res = img.size\n\n if res[0] < w and res[1] < h\n w = res[0]\n h = res[1]\n elsif res[0] < w\n w = res[0]\n h = (w / img.aspect).to_i\n elsif res[1] < h\n h = res[1]\n w = (h / img.aspect).to_i\n end\n\n nimg = img.resize( w, h )\n\n if img_type(dat) == :jpeg and quality\n nimg.jpeg( quality.to_i )\n else\n case img_type(dat)\n when :png\n nimg.png\n when :jpeg\n nimg.jpeg\n when :gif\n nimg.gif\n else\n raise 'img_resize(), unknown output format'\n end\n end\n rescue => errmsg\n puts \"error: resize failed. #{w} #{h} #{quality}\"\n p errmsg\n return nil\n end\nend",
"def resize(geometry)\n load_image.change_geometry(geometry) do |width, height, img|\n img.resize(width, height).to_blob\n end\n end",
"def image_size\n end",
"def create_image\r\n if @max_width\r\n @image = Gosu::Image.from_text($window, @text, @font, @size, @line_spacing, @max_width, @align)\r\n else\r\n @image = Gosu::Image.from_text($window, @text, @font, @size)\r\n end\r\n end",
"def size\n width * height\n end",
"def resize_image(img, size)\n img.delete_profile('*')\n\n # resize_image take size in a number of formats, we just want\n # Strings in the form of \"crop: WxH\"\n if (size.is_a?(String) && size =~ /^crop: (\\d*)x(\\d*)/i) ||\n (size.is_a?(Array) && size.first.is_a?(String) &&\n size.first =~ /^crop: (\\d*)x(\\d*)/i)\n img.crop_resized!($1.to_i, $2.to_i)\n # We need to save the resized image in the same way the\n # orignal does.\n quality = img.format.to_s[/JPEG/] && get_jpeg_quality\n out_file = write_to_temp_file(img.to_blob { self.quality = quality if quality })\n self.temp_paths.unshift out_file\n else\n old_resize_image(img, size) # Otherwise let attachment_fu handle it\n end\n end",
"def scale_to_fit(width, height)\n @image = @image.scale_to_fit(width, height)\n self\n end",
"def original_image_resolution\n @original_image_resolution ||= ScreenResolution.new(width: image_width, height: image_height)\n end",
"def render(options={})\n original_media = self.media.original.first\n # In theory, there should be more code in here to look for a cached image and be smarter\n # about the resizing, but this is a good first pass.\n if options.key?(:width) || options.key?(:height)\n require 'image_utility'\n image = nil\n Graphic.benchmark(\"Image#from_blob\") do\n image = Magick::Image.from_blob(original_media.file_contents).first\n end\n\n # Resize the image to a height and width if they are both being set.\n # Round these numbers up to ensure the image will at least fill\n # the requested space.\n height = options[:height].nil? ? nil : options[:height].to_f.ceil\n width = options[:width].nil? ? nil : options[:width].to_f.ceil\n\n Graphic.benchmark(\"ImageUtility#resize\") do\n image = ImageUtility.resize(image, width, height, true)\n end\n\n file = Media.new(\n :attachable => self,\n :file_data => image.to_blob,\n :file_type => image.mime_type,\n :file_name => original_media.file_name\n )\n\n return file\n else\n return original_media\n end\n end",
"def scale\n @photo = Photo.find(params[:id])\n img = Magick::Image.read('public' + @photo.attachment_url).first\n img = img.scale(1.5)\n img.write('public' + @photo.attachment_url)\n end",
"def scale(width: @image.width, height: @image.height,\n algorithm: 'bilineal') # bilinear, nearest_neighbor\n if algorithm == 'nearest_neighbor'\n Image.new(@image.resample_nearest_neighbor(width, height), path)\n else\n Image.new(@image.resample_bilinear(width, height), path)\n end\n end",
"def dynamic_resize_to_fit(size)\n resize_to_fit *(model.class::IMAGE_CONFIG[size])\n end",
"def resize_and_write_file(filename, filename_output, max_width, max_height = nil)\n pic = Magick::Image.read(filename).first\n img_width, img_height = pic.columns, pic.rows\n ratio = img_width.to_f / max_width.to_f\n\n if max_height.nil?\n max_height = img_height / ratio\n end\n\n pic.change_geometry!(\"#{max_width}x#{max_height}>\") { |cols, rows, img|\n img.resize_to_fit!(cols, rows)\n img.write filename_output\n img.destroy!\n }\n\n nbytes, content = File.size(filename_output), nil\n File.open(filename_output, \"rb\") { |f| content = f.read nbytes }\n content\nend",
"def thumbnail(input = 0)\n return self.uploads[input].variant(resize: '1000x1000').processed\n end",
"def thumbnail(data, options = {})\n source_info = info data\n \n opts = {\n :width => source_info.width,\n :height => source_info.height,\n :preserve_aspect_ratio => true,\n :format => :png\n }.merge(options)\n \n width, height = calculate_aspect_ratio source_info, opts\n \n # Set res so we can assign it within the SmartImage.new block\n res = nil\n \n SmartImage.new(width, height) do |image|\n image.composite data, :width => width,\n :height => height,\n :preserve_aspect_ratio => false\n \n res = image.encode opts[:format]\n end\n \n res\n end",
"def large_image_width\n 850\n end"
] |
[
"0.74281555",
"0.7337605",
"0.7276508",
"0.72498614",
"0.71668667",
"0.6908238",
"0.6732925",
"0.67188084",
"0.66568625",
"0.66387683",
"0.65469444",
"0.6546263",
"0.65405697",
"0.6535587",
"0.6528795",
"0.6500281",
"0.6499397",
"0.6488022",
"0.6481025",
"0.6469561",
"0.64159244",
"0.64140433",
"0.6409584",
"0.64076394",
"0.6401538",
"0.64012605",
"0.63716",
"0.6367713",
"0.63598067",
"0.63586235",
"0.6342108",
"0.6339572",
"0.63337296",
"0.63311124",
"0.6326453",
"0.6312615",
"0.62912357",
"0.62804997",
"0.62709224",
"0.62612903",
"0.6233716",
"0.62147063",
"0.6208953",
"0.6206828",
"0.6206828",
"0.6205417",
"0.62052786",
"0.6199134",
"0.61984545",
"0.6179115",
"0.6172127",
"0.6155899",
"0.6143639",
"0.6142739",
"0.6141279",
"0.6133443",
"0.61264575",
"0.6102807",
"0.6100769",
"0.6083572",
"0.6077635",
"0.60749316",
"0.60707647",
"0.60707587",
"0.60651267",
"0.60438514",
"0.60243464",
"0.6018449",
"0.60043854",
"0.59973645",
"0.5989315",
"0.59889734",
"0.5982552",
"0.59797454",
"0.59737736",
"0.59737647",
"0.59610325",
"0.5947572",
"0.5945407",
"0.59387535",
"0.5922697",
"0.5913449",
"0.59114033",
"0.5889368",
"0.5878626",
"0.587578",
"0.5862244",
"0.5861993",
"0.58575135",
"0.58515143",
"0.5848045",
"0.5840225",
"0.5835227",
"0.58291364",
"0.5827823"
] |
0.7291966
|
7
|
check if the collection accepts a given mime type; watch out for wildcards
|
def accept?(mime_type)
if mime_type =~ @@mime_re
p1, p2 = $1, $2
else
return false # WTF?
end
@accept.each do |pat|
pat = pat.to_s # working around REXML ticket 164
if pat =~ @@mime_re
if ($1 == p1 || $1 == "*") && ($2 == p2 || $2 == "*")
return true
elsif ((pat == Names::AtomMediaType && mime_type == Names::AtomFeedMediaType) ||
(pat == Names::AtomFeedMediaType && mime_type == Names::AtomMediaType))
return true
end
end
end
return false
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def accept? ctype\n unless self.class.force_mime_type\n ctype = Regexp.escape ctype\n ctype = ctype.gsub(\"\\\\*\", \"[^/]*\")\n matcher = %r{#{ctype}}\n end\n\n !!self.class.mime_types.find do |mt|\n if matcher\n mt =~ matcher\n else\n mt == ctype\n end\n end\n end",
"def matches?(request)\n highest_mime = request.accepts.first\n if accept_allstar\n highest_mime ? mime_types.any? { |m| highest_mime == m } : true\n else\n mime_types.any? { |m| highest_mime == m }\n end\n end",
"def accepts_content_type?(content_type)\n accepted_content_types.include? content_type.to_sym\n end",
"def accepts(*types)\n mime_types = types.map{ |type| mime_type(CONTENT_TYPE_ALIASES[type] || type) }\n condition do\n halt 406 unless mime_types.include?(request.media_type)\n content_type(mime_symbol(request.media_type))\n end\n end",
"def is_mime_type? m\n MIME::Type.new m rescue false\n end",
"def is_mime_type? m\n MIME::Type.new m rescue false\n end",
"def invalid_mime_type?\n mime_type =~ /(text|html|x-empty|octet-stream|ERROR|zip|jar)/\n end",
"def accepted_mimes\n case self.type\n when'Recording'\n '.wav,.mp3'\n when 'Document'\n '.pdf'\n when 'Image'\n '.jpeg,.jpg,.gif,.bmp,.png'\n else\n ''\n end\n end",
"def wp_check_filetype(filename, mimes = nil)\n mimes = get_allowed_mime_types if mimes.blank?\n result = {\n ext: false,\n type: false\n }\n mimes.each_pair do |ext_preg, mime_match|\n ext_preg = '!\\.(' + ext_preg + ')$!i'\n ext_matches = ext_preg.match filename # (preg_match(ext_preg, filename, ext_matches))\n if ext_matches\n result[:type] = mime_match\n result[:ext] = ext_matches[1]\n break\n end\n end\n result\n end",
"def acceptable?(media_type)\n !matches(media_type).empty?\n end",
"def valid_types(record)\n Array(record.supported_mime_types)\n rescue NoMethodError\n Array.new\n end",
"def match_mime_type?(value, matcher)\n v1, v2 = value.split('/', 2)\n m1, m2 = matcher.split('/', 2)\n (m1 == '*' || v1 == m1) && (m2.nil? || m2 == '*' || m2 == v2)\n end",
"def qualify_mime_type(thing, types)\n weigh_mime_type(thing, types).first\n end",
"def accepts?(page)\n !@accepts || page.mime.to_s =~ @accepts\n end",
"def supported_format?\n !(@file_set.mime_type & self.class.supported_formats).empty?\n end",
"def json_mime?(mime)\n (mime && mime.downcase.include?('json')) || mime == '*/*'\n end",
"def mime_types\n @mime_types ||=\n request_files.transform_values do |file|\n file.hasMimeType || 'application/octet-stream'\n end\n end",
"def eps?\n self.class.eps_mime_types.include? mime_type\n end",
"def json_mime?(mime)\n (mime == \"*/*\") || !(mime =~ /Application\\/.*json(?!p)(;.*)?/i).nil?\n end",
"def can_upload?\n klass.model_class && mime_types && mime_types.keys.include?(file_mime_type)\n end",
"def accept_file(file, name, kind)\n logger.debug \"FileHelper is accepting file: filename=#{file.filename}, name=#{name}, kind=#{kind}\"\n\n fm = FileMagic.new(FileMagic::MAGIC_MIME)\n mime = fm.file file.tempfile.path\n logger.debug \"#{name} has MIME type: #{mime}\"\n\n valid = true\n\n case kind\n when 'image'\n accept = [\"image/png\", \"image/gif\", \"image/bmp\", \"image/tiff\", \"image/jpeg\", \"image/x-ms-bmp\"]\n when 'code'\n accept = [\"text/x-pascal\", \"text/x-c\", \"text/x-c++\", \"text/plain\", \"text/\"]\n when 'document'\n accept = [ # -- one day\"application/vnd.openxmlformats-officedocument.wordprocessingml.document\",\n # --\"application/msword\",\n \"application/pdf\" ]\n valid = pdf_valid? file.tempfile.path\n else\n logger.error \"Unknown type '#{kind}' provided for '#{name}'\"\n return false\n end\n\n # result is true when...\n mime.start_with?(*accept) && valid\n end",
"def json_mime?(mime)\n (mime == '*/*') || !(mime =~ /Application\\/.*json(?!p)(;.*)?/i).nil?\n end",
"def json_mime?(mime)\n (mime == '*/*') || !(mime =~ /Application\\/.*json(?!p)(;.*)?/i).nil?\n end",
"def json_mime?(mime)\n (mime == '*/*') || !(mime =~ /Application\\/.*json(?!p)(;.*)?/i).nil?\n end",
"def json_mime?(mime)\n (mime == '*/*') || !(mime =~ /Application\\/.*json(?!p)(;.*)?/i).nil?\n end",
"def mime_type(*args, **_arg1, &block); end",
"def match_accept(mimetype)\n if @env[\"HTTP_ACCEPT\"].to_s.split(',').any?{|s| s.strip == mimetype}\n response[\"Content-Type\"] = mimetype\n end\n end",
"def valid_image_format?\n VALID_FILE_MIMETYPES.include? self.filetype\n end",
"def file_valid?(file)\n mime = MIME::Types.type_for(file).first\n !mime.nil? && ACCEPTED_MIMES.include?(mime.content_type)\n end",
"def mime_types(type)\n mime_types = {\n yaml: \"application/x-yaml\",\n json: \"application/json\"\n }\n mime_types[type.to_sym]\n end",
"def mime_types\n safe_const_get(:MIME_TYPES) || []\n end",
"def verify_mime_type\n if is_raw_file?\n self.mime_type = \"image/x-adobe-dng\"\n end\n end",
"def blacklist_mime_type_pattern; end",
"def allowed?(val)\n case ftype\n when 'string', 'url'\n val.is_a?(String)\n when 'number'\n val.is_a?(Integer) || val.is_a?(Float)\n when 'sample'\n allowable_field_types.collect { |aft| aft.sample_type.id }.member? val.sample_type_id\n when 'item'\n allowable_field_types.collect { |aft| aft.object_type.id }.member? val.object_type_id\n end\n end",
"def mime_types(*types)\n types.flatten.each do |t|\n @mime_types << t\n end\n @mime_types\n end",
"def is_image_type?\n file_content_type =~ %r(image)\n end",
"def _mime_type\n if defined? @_mime_type\n @_mime_type\n else\n guesses = ::MIME::Types.type_for(extname.to_s)\n\n # Prefer text mime types over binary\n @_mime_type = guesses.detect { |type| type.ascii? } || guesses.first\n end\n end",
"def validate_content_type( valid )\n raise Atom::HTTPException, \"HTTP response contains no Content-Type!\" if not self.content_type or self.content_type.empty?\n\n media_type = self.content_type.split(\";\").first\n\n unless valid.member? media_type.downcase\n raise Atom::WrongMimetype, \"unexpected response Content-Type: #{media_type.inspect}. should be one of: #{valid.inspect}\"\n end\n end",
"def should_validate_attachment_content_type name, options = {}\n klass = self.name.gsub(/Test$/, '').constantize\n valid = [options[:valid]].flatten\n invalid = [options[:invalid]].flatten\n context \"Class #{klass.name} validating content_types on #{name}\" do\n valid.each do |type|\n context \"being assigned a file with a content_type of #{type}\" do\n setup do\n @file = StringIO.new(\".\")\n class << @file; attr_accessor :content_type; end\n @file.content_type = type\n @attachment = klass.new.send(name)\n @attachment.assign(@file)\n end\n should \"not have a :content_type validation error\" do\n assert ! @attachment.errors[:content_type]\n end\n end\n end\n invalid.each do |type|\n context \"being assigned a file with a content_type of #{type}\" do\n setup do\n @file = StringIO.new(\".\")\n class << @file; attr_accessor :content_type; end\n @file.content_type = type\n @attachment = klass.new.send(name)\n @attachment.assign(@file)\n end\n should \"have a :content_type validation error\" do\n assert @attachment.errors[:content_type]\n end\n end\n end\n end\n end",
"def content_type_whitelist\n MIME_TYPE_WHITELIST\n end",
"def is_audio?\n result = false\n if !mime_type.blank?\n splits = mime_type.split('/')\n if splits[0] == AUDIO\n result = true\n end\n end\n \n result\nend",
"def accepts?(*types)\n request.accepts.compact.each do |priority|\n # Because IE always sends */* in the accepts header and we assume\n # that if you really wanted XML or something else you would say so\n # explicitly, we will assume */* to only ask for :html\n return types.include?(:html) if priority == Mime::ALL\n\n return true if types.include?(priority.to_sym)\n end\n false\n end",
"def mime(attrs, *mimes)\n mimes = mimes.map(&:to_s)\n Array(attrs).each do |attr|\n magic = MimeMagic.by_magic(@object.send(attr))\n unless magic && (mimes & [magic.type, magic.mediatype, magic.subtype]).any?\n error(attr, \"should be of type #{mimes.join(' or ')}\")\n end\n end\n end",
"def mime_type=(_); end",
"def web_image?\n %w(png jpg jpeg gif).each do |sub_type|\n return true if Rack::Mime.match?(mime_type, \"image/#{sub_type}\")\n end\n\n false\n end",
"def mime_types\n config[:mime_types]\n end",
"def renderable?\n\t\t['image/jpeg', 'image/gif', 'image/png'].include? content_type\n\tend",
"def remove_mime_type(key)\n # :all is the key for */*; it can't be removed\n return false if key == :all\n ResponderMixin::TYPES.delete(key)\n end",
"def mime_type; end",
"def mime_type; end",
"def mime_type; end",
"def mime_type; end",
"def mime_type\n Rack::Mime.mime_type(extname)\n end",
"def enforce_content_type(request, config)\n content_type = request.content_type\n\n return if content_type.nil?\n\n return if accepted_mime_type?(content_type, config)\n\n yield\n end",
"def validates_attachment_content_type name, options = {}\n attachment_definitions[name][:validations] << [:content_type, {:content_type => options[:content_type],\n :message => options[:message],\n :if => options[:if],\n :unless => options[:unless]}]\n end",
"def register_mime_types\n types = mime_types.map(&:to_s)\n exts = file_extensions.map(&:to_sym)\n type = types.shift\n ext = exts.shift\n __debug_mime(binding) do\n { type: type, ext: ext, types: types, exts: exts }\n end\n return unless type && ext\n Mime::Type.register(type, ext, types, exts) # TODO: needed?\n Marcel::MimeType.extend(type, extensions: file_extensions.map(&:to_s))\n end",
"def test_mime_types\n assert_kind_of(DataTypes::SimpleText, @test_records[0])\n assert_kind_of(DataTypes::SimpleText, @test_records[1])\n assert_equal(\"text/plain\", @test_records[0].mime_type)\n assert_equal(\"text/plain\", @test_records[1].mime_type)\n end",
"def mime_type=(_arg0); end",
"def mime_type=(_arg0); end",
"def mime_type=(_arg0); end",
"def can_construct?(type)\n type = type.underscore\n base, name = type.split('/')\n each_constructable_item do |item, item_base, item_name|\n # Match glob\n if item_name == '*'\n return true if base == item_base\n # Exact match\n else\n return true if type == item\n end\n end\n\n false\n end",
"def is_pdf?\n mime_type == PDF\nend",
"def mime_type_of(f)\n MIME::Types.of(f).last || default_mime_type\n end",
"def acceptable_content_type?\n content_type.blank? || Mime::HTML == content_type\n end",
"def wp_attachment_is(type, post = nil)\n post = get_post(post)\n return false if post.nil?\n\n return false if (!file = get_attached_file(post.id))\n\n return true if post.post_mime_type.index(type + '/') == 0\n\n check = wp_check_filetype(file)\n return false if check[:ext].blank?\n\n ext = check[:ext]\n\n if 'import' != post.post_mime_type\n return type == ext\n end\n\n case type\n when 'image'\n ['jpg', 'jpeg', 'jpe', 'gif', 'png'].include? ext\n when 'audio'\n wp_get_audio_extensions.include? ext\n when 'video'\n wp_get_video_extensions.include? ext\n else\n type == ext\n end\n end",
"def image?(content_type)\n content_types.include?(content_type)\n end",
"def image?\n document_content_type =~ %r{^(image|(x-)?application)/(bmp|gif|jpeg|jpg|pjpeg|png|x-png)$}\n end",
"def valid?\n # is it a valid pattern (i.e. does not contain funny characters)? @TODO\n # all characters are valid, except for the /, directory limiter., files cannot start with a dot (hidden files)\n # is the file a web-savvy image?\n valid_types = ['image/jpeg', 'image/png', 'image/gif']\n return false unless valid_types.include? @entry.metadata.mime_type\n # does the file have thumbnails?\n return false unless @entry.metadata.thumb_exists\n # is the file not the special, reserved thumb.*? (see thumb_for_dir)\n # @TODO: return false if basename.match /^thumb\\.[A-z]*$/\n return true\n end",
"def mime_type(mt=nil)\n @_mime_type = mt unless mt.nil?\n @_mime_type\n end",
"def verify_requested_format!\n mimes = collect_mimes_from_class_level\n collector = ActionController::MimeResponds::Collector.new(mimes, request.variant)\n\n unless collector.negotiate_format(request)\n raise ActionController::UnknownFormat\n end\n end",
"def mime_type\n @mime_type ||= Rack::Mime.mime_type(\".#{ext}\")\n end",
"def is_image_type?\n photo_content_type =~ %r(image)\n end",
"def spoofed?\n has_extension? and media_type_mismatch?\n end",
"def is_supported_file_type?(filename)\n type = filename.split('.')[1]\n return VALID_EXTENSIONS.include?(type)\nend",
"def match?(request)\n request.content_type =~ %r{^application/json.*}\n end",
"def spreadsheet_or_powerpoint?\n %w( application/mspowerpoint\n application/powerpoint\n application/vnd.ms-powerpoint\n application/x-mspowerpoint\n application/vnd.openxmlformats-officedocument.presentationml.presentation\n application/excel\n application/vnd.ms-excel\n application/x-excel\n application/x-msexcel\n application/vnd.openxmlformats-officedocument.spreadsheetml.sheet ).include? content_type\n end",
"def image?\n attachment_content_type =~ %r{^(image|(x-)?application)/(bmp|gif|jpeg|jpg|pjpeg|png|x-png)$}\n end",
"def get_mime_type(path)\n return false unless path.include? '.'\n filetype = path.split('.').last\n\n return case\n when [\"html\", \"htm\"].include?(filetype)\n \"text/html\"\n when \"txt\" == filetype \n \"text/plain\"\n when \"css\" == filetype\n \"text/css\"\n when \"js\" == filetype\n \"text/javascript\"\n when [\"png\", \"jpg\", \"jpeg\", \"gif\", \"tiff\"].include?(filetype)\n \"image/#{filetype}\"\n when [\"zip\",\"pdf\",\"postscript\",\"x-tar\",\"x-dvi\"].include?(filetype)\n \"application/#{filetype}\"\n else false\n end\n end",
"def supported_format?\n !(@file_set.mime_type & self.class.supported_formats).empty? || preservation_file&.original_filename&.first&.downcase&.include?(\".wav\")\n end",
"def register_mime_types(types)\n cr = Fl::Framework::Attachment::ClassRegistry.registry\n\n types.each do |tk, tv|\n av = (tv.is_a?(Array)) ? tv : [ tv ]\n av.each do |orm|\n cr.register(tk, self, orm)\n end\n end\n end",
"def mime_types\n {image: ['image/png', 'image/jpeg', 'image/jpg', 'image/jp2', 'image/bmp', 'image/gif', 'image/tiff'],\n pdf: ['application/pdf', 'application/x-pdf'],\n audio: ['audio/mpeg', 'audio/mp4', 'audio/x-aiff', 'audio/ogg', 'audio/vorbis', 'audio/vnd.wav'],\n video: ['video/mp4', 'video/quicktime', 'video/x-msvideo', 'video/x-ms-wmv']}\n end",
"def supports_derivatives?\n (attachment_content_type =~ %r{^(image|(x-)?application)/(bmp|jpeg|jpg|pjpeg|png|webp|x-png)$}).present?\n end",
"def web_video?\n %w(mp4 ogg webm).each do |sub_type|\n return true if Rack::Mime.match?(mime_type, \"video/#{sub_type}\")\n end\n\n false\n end",
"def get_allowed_mime_types(user = nil)\n t = wp_get_mime_types\n t.delete(:swf)\n t.delete(:exe)\n # TODO implement:\n # if ( function_exists( 'current_user_can' ) )\n # unfiltered = user ? user_can( user, 'unfiltered_html' ) : current_user_can( 'unfiltered_html' )\n # end\n # if unfiltered.blank?\n # t.delete(:'htm|html')\n # t.delete(:js)\n # end\n\n # Filters list of allowed mime types and file extensions.\n apply_filters('upload_mimes', t, user)\n end",
"def file?\n type == :file\n end",
"def mime_type=(value)\n @mime_type = value\n end",
"def is_type_image?\n image_types.include? self.data_content_type\n end",
"def negotiate_mime(order); end",
"def verify_file_type\n if file_name\n allowed_types = %w(jpeg jpg png gif)\n\n unless allowed_types.include? file_name.split('.')[1]\n errors.add(:file_name, 'File is not an image.')\n end\n end\n end",
"def is_video_type?\n file_content_type =~ %r(video)\n end",
"def mime_type\n raise NotImplementedError.new 'This is only a function body for documentation'\n end",
"def post_processing_required?\n puts \"2.52.52.52.52.52.5 post_processing_required 2.52.52.52.52.52.5\"\n %r{^(image|(x-)?application)/(bmp|gif|jpeg|jpg|pjpeg|png|x-png)$}.match(upload_content_type).present?\n end",
"def acceptable_content_type?\n if content_type == Mime::HTML\n true\n else\n log_not_acceptable_content_type\n false\n end\n end",
"def content_type_needs_cors(path)\n [\".eot\",\".ttf\",\".woff\"].include?(File.extname(path))\n end",
"def is_image?\n if self.mimetype\n self.mimetype =~ %r(image)\n elsif self.file_upload_content_type\n self.file_upload_content_type =~ %r(image)\n end\n end",
"def test_abbrev_mime_type\n fm = FileMagic.mime\n assert_match(/\\Aapplication\\/vnd.ms-/, fm.file(path_to('excel-example.xls')))\n end",
"def check_if_image?\n !(attachment_content_type =~ /^image.*/).nil?\n end",
"def image?\n picture_content_type =~ %r{^(image|(x-)?application)/(bmp|gif|jpeg|jpg|pjpeg|png|x-png)$}\n end",
"def content_type_whitelist\n /image\\//\n end",
"def mime_type(value = nil)\n value ? @mime_type = value : @mime_type\n end"
] |
[
"0.77527916",
"0.7095487",
"0.7025823",
"0.7024764",
"0.6996454",
"0.6996454",
"0.68388236",
"0.67528176",
"0.6731191",
"0.6707233",
"0.66846454",
"0.6659487",
"0.6642042",
"0.66240144",
"0.66003674",
"0.656797",
"0.65612775",
"0.65606403",
"0.6481699",
"0.6474869",
"0.6429128",
"0.64156896",
"0.64156896",
"0.64156896",
"0.64156896",
"0.64020675",
"0.6392498",
"0.6387596",
"0.63485795",
"0.634676",
"0.62762773",
"0.62640744",
"0.62080634",
"0.61906046",
"0.6184458",
"0.61807424",
"0.6176242",
"0.61487025",
"0.61368346",
"0.6121053",
"0.6078003",
"0.60742",
"0.60731506",
"0.60683215",
"0.60395026",
"0.6032494",
"0.6021718",
"0.6018676",
"0.60097355",
"0.60097355",
"0.60097355",
"0.60097355",
"0.6009388",
"0.6008175",
"0.6005457",
"0.6000415",
"0.5985313",
"0.596681",
"0.596681",
"0.596681",
"0.59473896",
"0.5944973",
"0.5939696",
"0.5931176",
"0.59274644",
"0.59241694",
"0.592357",
"0.5922726",
"0.5921218",
"0.59169924",
"0.59140575",
"0.5907896",
"0.58929753",
"0.58908504",
"0.58844936",
"0.5879751",
"0.5871783",
"0.5869781",
"0.5868178",
"0.58536845",
"0.5849948",
"0.5845751",
"0.5845425",
"0.58339715",
"0.58306366",
"0.5830498",
"0.58238906",
"0.5820585",
"0.5819214",
"0.58168834",
"0.5815919",
"0.58154446",
"0.5813332",
"0.5813113",
"0.5809257",
"0.58071756",
"0.5803807",
"0.58034664",
"0.57984954",
"0.5794552"
] |
0.7534508
|
1
|
the name is supposed to suggest multiple instances of "categories"
|
def catses
REXML::XPath.match(@xml, './app:categories', Names::XmlNamespaces)
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def categories\n add_to_query restrict_kind: 'category'\n end",
"def category_candidates(category)\n return @category_cache[category] unless @category_cache[category].nil?\n # from whole name singularized\n candidates = []\n decorated_category = Cyclopedio::Syntax::NameDecorator.new(category, parse_tree_factory: @parse_tree_factory)\n @nouns.singularize_name(category.name, decorated_category.category_head).each do |name_singularized|\n candidates.concat(candidates_for_name(name_singularized,@category_filters))\n end\n candidate_set = create_candidate_set(category.name,candidates)\n return @category_cache[category] = candidate_set if !candidate_set.empty? || @category_exact_match\n # from simplified name\n candidate_set = candidate_set_for_syntax_trees(decorated_category.category_head_trees,@category_filters)\n return @category_cache[category] = candidate_set unless candidate_set.empty?\n # from original whole name\n candidate_set = candidate_set_for_name(category.name, @category_filters)\n @category_cache[category] = candidate_set\n end",
"def categories\n @categories ||= wayfinder.decorated_vocabularies.sort_by(&:label)\n end",
"def categories(str)\n raise NotImplementedError\n end",
"def auto_complete_for_category_name_with_security\n Category.with_user_scope(current_user) do\n auto_complete_for_category_name_without_security\n end\n end",
"def category_names\n @category_names || categories.map(&:name).join(' ')\n end",
"def handle_categories(category_names)\n return if !self.undergrad? || category_names.nil?\n self.categories = [] # eliminates any previous interests so as to avoid duplicates\n category_array = []\n category_array = category_names.split(',').uniq if category_names\n category_array.each do |cat|\n self.categories << Category.find_or_create_by(name: cat.downcase.strip)\n end\n end",
"def categories_list\n self.categories.collect{|c| c.name}\n end",
"def categories\n Hash[self.class.catalogs.map { |fld, klass|\n name = fld.gsub(/_id$/, '_name');\n [fld, {:id => self.send(fld), :name => self.send(name)}] rescue nil\n }.reject {|cat| cat.nil?}]\n end",
"def category_names\n self.categories.map do |category|\n category.name\n end\n end",
"def categorized_list\n %w[artist copyright character meta general]\n end",
"def all_categories\n end",
"def categories\n taxonomies.all :conditions => { :classification => :category }\n end",
"def ffck_categories_detailed()\n ['Pitchoun', 'Poussin 1', 'Poussin 2', 'Benjamin 1', 'Benjamin 2', 'Minime 1', 'Minime 2', 'Cadet 1', 'Cadet 2',\n 'Junior 1', 'Junior 2', 'Senior', 'Veteran 1', 'Veteran 2', 'Veteran 3', 'Veteran +', 'Inconnu']\n end",
"def category_names(categories)\n return t('challenges.no_category') if categories.empty?\n\n categories.map(&:name).join(', ')\n end",
"def category_names=(names)\n names.each do |name|\n unless name == \"\"\n category = Category.find_or_create_by(name: name)\n self.categories << category unless self.categories.include?(category)\n end\n end\n end",
"def get_categories\n cats = []\n params.each do |k,v|\n if k.starts_with? \"category\"\n name = v\n num = cat_number(k) \n cats << [name,num]\n end\n end\n return cats\n end",
"def assign_categories \n if @category_names \n self.categories = @category_names.split(/\\s+/).map do |name|\n Category.find_or_create_by_name(name)\n end\n end\n end",
"def source_result_category_names\n category_names\n end",
"def getCategories()\n\t\tcat = Array.new\n\t\tcat.push(\"heroku\")\n\t\tcat.push(\"go\")\n\t\tcat.push(\"github\")\n\t\tcat.push(\"docker\")\n\t\tcat.push(\"css\")\n\t\tcat.push(\"apache\")\n\t\tcat.push(\"html\")\n\t\tcat.push(\"bootstrap\")\n\t\tcat.push(\"java ee\")\n\t\tcat.push(\"javafx\")\n\t\tcat.push(\"java\")\n\t\tcat.push(\"jquery\")\n\t\tcat.push(\"mips\")\n\t\tcat.push(\"c++\")\n\t\tcat.push(\"laravel\")\n\t\tcat.push(\"linux\")\n\t\tcat.push(\"opengl\")\n\t\tcat.push(\"sml\")\n\t\tcat.push(\"javascript\")\n\t\tcat.push(\"mongo db\")\n\t\tcat.push(\"c\")\n\t\tcat.push(\"yacc\")\n\t\tcat.push(\"circuit\")\n\t\tcat.push(\"php\")\n\t\tcat.push(\"mysql\")\n\t\tcat.push(\"node js\")\n\t\tcat.push(\"photoshop\")\n\t\tcat.push(\"rails\")\n\t\tcat.push(\"postgres\")\n\t\tcat.push(\"ruby\")\n\t\tcat.push(\"redis\")\n\t\tcat.push(\"mac osx\")\n\t\tcat.push(\"sass\")\n\t\tcat.push(\"ubuntu\")\n\t\tcat.push(\"bower\")\n\t\tcat.push(\"wordpress\")\n\t\tcat.push(\"css\")\n\t\tcat.push(\"hosted\")\n\t\tcat.push(\"python\")\n\t\tcat.push(\"maven\")\n\t\tcat.push(\"maven mojo\")\n\t\tcat.push(\"composer\")\n\t\tcat.push(\"mips\")\n\t\tcat.push(\"gulp\")\n\t\tcat.push(\"grunt\")\n\t\tcat.push(\"phpstorm\")\n\t\tcat.push(\"react\")\n\t\tcat.push(\"swift\")\n\t\tcat.push(\"wordpress\")\n\t\tcat.push(\"tomcat\")\n\t\tcat.push(\"redis\")\n\t\tcat.push(\"travis\")\n\t\treturn cat\n\tend",
"def category_names\n categories.map {|category| CategoryCode[category]}\n end",
"def category_conditions\n [\"words.category LIKE ?\", \"%#{category}\"]\n end",
"def getCategories(_, _, _)\n @db.categories\n end",
"def categories=(value)\n @categories = value\n end",
"def _build_category_list\n raw_categories = CatAPI.get_categories\n category_list = raw_categories.map {|category| category['name']}.sort\n # the \"kittens\" category is empty, and never returns photos\n category_list.delete(\"kittens\")\n return category_list.unshift(\"your favorites\")\nend",
"def category_candidates(category)\n return @category_cache[category] unless @category_cache[category].nil?\n candidates = candidates_for_name(singularize_name(category.name, category.head), @category_filters)\n if !candidates.empty?\n candidate_set = create_candidate_set(category.name,candidates)\n else\n candidate_set = candidate_set_for_syntax_trees(category.head_trees,@category_filters)\n end\n if candidate_set.empty?\n candidates = candidates_for_name(category.name, @category_filters)\n candidate_set = create_candidate_set(category.name,candidates) unless candidates.empty?\n end\n @category_cache[category] = candidate_set\n end",
"def core_category_candidates(category)\n candidates = []\n singularize_name_nouns(category.name, category.head).each do |phrase|\n candidates.concat(candidates_for_name(phrase, @category_filters))\n\n end\n candidate_set = create_candidate_set(category.name,candidates.uniq)\n end",
"def name\n description_category\n end",
"def categories\n category\n end",
"def category; end",
"def adv_categories\n return ['AIR', 'BIKING', 'CULTURAL', 'CAMPING', 'MOTOR', 'CLIMBING', 'HIKING', 'SNOW', 'WATER', 'OTHER']\n end",
"def category_with_name(name)\n categorized_items = categories_items\n categorized_items.detect{ |sub_item_array| sub_item_array[0].name == name }\n end",
"def list_categories\n Category.all.each.with_index(1) {|x, i| puts \"#{i}. #{x.name}\"} #Scraper.categories.each.with_index(1) {|category, i| puts \"#{i}. #{category[0]}\"}\n puts \"select the number of the category you would like to browse or type 'exit'\"\n end",
"def categories\n expose Metadata.categories(@oauth_token)\n end",
"def expertise\n subcategories.map(&:name).to_sentence\n end",
"def category\n categories.collect(&:title).join(',')\n end",
"def setup_categories # :nodoc:\n [:event, :time, :salutation, :recurrency, :preposition,\n :article, :day, :verb, :name, :number, :interrogation].each do |category|\n @matches[category] = []\n end\n @matches[:guessing] = false\n end",
"def categories=(value)\n @categories = value\n end",
"def categories=(value)\n @categories = value\n end",
"def categories=(value)\n @categories = value\n end",
"def slugified_categories; end",
"def categories\n category_keys.collect(&:to_s)\n end",
"def extract_categories cats\n cats.inject Hash.new do |hash, tag|\n\n # iterate through groups if the tag belongs to multiple\n tag[\"groups\"].each do |group|\n name = group[\"name\"]\n hash[name] ||= []\n hash[name] << tag[\"name\"]\n end\n hash\n end\n end",
"def chosen_categories\n return chosen_options.collect &:category\n end",
"def categories_shortcut\n (config_params||DEFAULT_CONFIG_PARAMS)[\"Categories Shortcut\"]\n end",
"def abbr_categories(str)\n raise NotImplementedError\n end",
"def categories_for(race)\n case race.name\n when \"Junior Men\", \"Junior Women\"\n [ Category.find_or_create_by(name: race.name) ]\n else\n super race\n end\n end",
"def categories\n []\n end",
"def ffck_categories()\n %w(Pitchoun Poussin Benjamin Minime Cadet Junior Senior Veteran Inconnu)\n end",
"def set_category\n end",
"def category_names=(list)\n list = list.is_a?(Array) ? list : list.split(',').reject(&:blank?).collect { |item| item.try(:strip) }\n delete_unused_categories(list)\n add_new_categories(list)\n end",
"def category_name\n category.name if category\n end",
"def categories=(value)\n\t\t@categories = value\n\tend",
"def categories=(value)\n\t\t@categories = value\n\tend",
"def categories=(value)\n\t\t@categories = value\n\tend",
"def category_name \n\tself.category.name \n end",
"def categories(options = {})\n options = options.merge(:facets => 'category', :facet_num_results => 100, :num_results => 0)\n search('*:*', options).facets['category'].values\n end",
"def format_category_name # WHY IS IT IN HERE?\n self.category.name.downcase.delete(' ')\n end",
"def index\n authorize! :read, Category\n if params[:search] \n @categories = Category.includes(:related_categories, :suggested_categories).where(\"lower(name) LIKE :search\",{search: \"%#{params[:search].downcase}%\"}).order( :name )\n else\n @categories = Category.includes(:related_categories, :suggested_categories).all.order( :name )\n end\n end",
"def categories\n @categories ||= (@doc/\"Category\").collect { |it| Element.new(it) }\n end",
"def list_categories(variable)\n if !variable.categories.empty?\n cat_list = \"\"\n variable.categories.split(',').each{|cat| cat_list << content_tag(:li, cat.capitalize, :class => cat.downcase)}\n content_tag(:ul, cat_list, :class => \"categories\")\n else\n content_tag(:span, \"None\")\n end\n end",
"def categories=(categories)\n end",
"def set_categories\n @categories = {}\n @mechanize.page.search('//*[@id=\"prtcalst\"]//li').each do |cat|\n cat_link = cat.search('a')[0]\n cat_name = cat.search('.//em')[0].inner_text()\n catObj = Category.new()\n catObj.elem = cat_link\n catObj.name = cat_name\n @categories[cat_name] = catObj\n\n puts(\"#{cat_name}\")\n puts(\"-------------------\")\n end\n end",
"def category_name\n parse_cookbook_json do |parsing_errors, json|\n if parsing_errors.any?\n \"\"\n else\n json.fetch(\"category\", \"\").to_s\n end\n end\n end",
"def categories_by_taxonomy\n\n self.categories.inject({}) do |result, category|\n \n if result.has_key?(category.taxonomy.id.to_sym)\n result[category.taxonomy.id.to_sym] << category\n else\n result[category.taxonomy.id.to_sym] = [category]\n end\n \n result \n end \n\n end",
"def category(name)\n @categories.find { |c| c.name == name}\n end",
"def test_add_multiple_categories_by_string\n total_num_categories = Category.count\n\n categories_to_add = \"%s %s %s\" % [@work_cat.name, @religion_cat.name, \"popular\"]\n \n # check the two categories have been added to the quotation\n assert @work_opinion.set_categories_by_string(categories_to_add)\n assert_equal 3, @work_opinion.categories.size\n \n # check the new category has been added\n assert_equal total_num_categories + 1, Category.count\n assert Category.find_by_name(\"popular\")\n end",
"def seed_categories\n ['Shelter', 'Food', 'Health', 'Jobs/Training'].each do |name|\n Category.find_or_create_by(name: name)\n end\nend",
"def categories_as_strings= (new_categories)\n categories.clear\n\n new_categories.split(/\\s*, \\s*/).each do |title|\n cat =Category.where('LOWER(title) = ?', title.downcase).first\n categories << cat if !cat.nil?\n end\n end",
"def category_types\n @category_types.each\n end",
"def category\n @category ||= ''\n end",
"def list_categories \n @categories = [\"Muesums\", \"Music, Comedy, and Nightlife\", \"Shopping\", \"Sports & Recreation\", \"Theater & Performing Arts\", \"Tours & Attractions\"]\n @categories.each.with_index(1) {|index,category| \n puts \"#{category} - #{index}\"\n }\n end",
"def categories\n\t\trender :json => {:status => 1, :categories => {\"1\" => \"Apparel & Accessories\", \"2\" => \"Arts and Crafts\", \"3\" => \"Electronics\", \n\t\t\t\"4\" => \"Home Appliances\", \"5\" => \"Kids & Baby\", \"6\" => \"Movies, Music, Books & Games\", \"7\" => \"Motor Vehicles\", \n\t\t\t\"8\" => \"Office & Education\", \"9\" => \"Parties & Events\", \"10\" => \"Spaces & Venues\", \"11\" => \"Sports & Outdoors\", \"12\" => \"Tools & Gardening\", \"13\" => \"Other\"}}, :status => 200\n\t\treturn\n\tend",
"def by_categories(query)\n # \"OR\" behavior by default\n apply_filter_list \"categories\", query\n\n self\n end",
"def categories\n return [] if @categories.blank?\n @categories.records.map {|c| c.display_name}\n end",
"def set_categories\n @categories = Category.order(:name).pluck(:name, :id)\n end",
"def category_name\n category.name\n end",
"def categories\n notify Category.all(:order => \"name ASC\").collect {|c| c.name_with_id }.join(\"\\n\")\n end",
"def allowed_cat_entries(options)\n rails_logger('allowed_cat_entries', 0)\n @values[\"#{options[:prov_field_name]}_category\".to_sym] = options[:category]\n cat = Classification.lookup_by_name(options[:category].to_s)\n result = cat ? cat.entries.each_with_object({}) { |e, h| h[e.name] = e.description } : {}\n rails_logger('allowed_cat_entries', 1)\n result\n end",
"def set_category\n match_data = /^What is [-]?\\d+\\s*(?<operation>[\\+\\-\\*\\/])\\s*[-]?\\d+\\?$/.match(self.query) || {}\n self.category = CATEGORIES[match_data[:operation]]\n end",
"def categories_as_string= (new_categories)\n categories.clear\n\n new_categories.split(/\\s*,\\s*/).each do |title|\n cat = Category.where('LOWER(title) = ?', title.downcase).first\n categories << cat if cat\n end\n end",
"def compare_catetegory category_name\n condition=\"%#{category_name}%\"\n category=Category.where(\"name like ? \",condition).first\n if category.nil?\n category=Category.create name:category_name\n end\n return category\n end",
"def categories\n raw_categories.to_hashugar\n end",
"def category_name \n self.category ? self.category.name : nil\n end",
"def related_tag_categories\n @related_tag_categories ||= {\n GENERAL => [GENERAL],\n ARTIST => [COPYRIGHT, CHARACTER, GENERAL],\n CHARACTER => [COPYRIGHT, CHARACTER, GENERAL],\n COPYRIGHT => [COPYRIGHT, CHARACTER, GENERAL],\n META => [META, GENERAL]\n }\n end",
"def cats_input\n self.categories.join(\"\\n\")\nend",
"def category\n catName = params[:title]\n @meals = Meal.where(\"category like ?\", catName)\n end",
"def fresh_categories\n # these are the categories that will be displayed by default\n # in the html view\n return {\n \"speakerData\" => {\"label\" => \"Character Direct Speech\", \"data\" => []},\n \"indirectData\" => {\"label\" => \"Character Indirect Diction\", \"data\" => []},\n \"traitData\" => {\"label\" => \"Trait: Character Type\", \"data\" => []}, \n \"genderData\" => {\"label\" => \"Trait: Character Sex\", \"data\" => []},\n \"maritalStateData\" => {\"label\" => \"Trait: Character Marriage Status\", \"data\" => []},\n \"socecStatusData\" => {\"label\" => \"Trait: Character Class Status\", \"data\" => []},\n \"ageData\" => {\"label\" => \"Trait: Character Age\", \"data\" => []},\n \"occupationData\" => {\"label\" => \"Trait: Character Occupation\", \"data\" => []},\n }\nend",
"def get_category_name\n Category.find(:first, :select => ['name'],:conditions=>['has_complexity=?',false]).name rescue ''\n end",
"def categories_as_string= (new_categories)\n categories.clear\n new_categories.split(/\\s*,\\s*/).each do |title|\n cat = Category.where('LOWER(title) = ?', title.downcase).first\n categories << cat if !cat.nil?\n\n end\n end",
"def add_categories(collection)\n\tcategory = \"\"\n\tcollection[\"results\"][\"collection1\"].each do |article|\n\t\tif article[\"category\"] == \"\"\n article[\"category\"] = category\n else\n category = article[\"category\"]\n end\n\tend\nend",
"def categories_for_solution_search(category)\n [Sfcatnode.root] + category.children\n end",
"def search_for_products\r\n @categories = Category.select(:id, :name).all\r\n end",
"def category_for_key(key, description)\n # Keys may contain '/' e.g. 'openshift.io/build.name'.\n name = 'kubernetes:' + Classification.sanitize_name(key.tr(\"/\", \":\"))\n category = Classification.find_by_name(name)\n if category\n category.description = description\n category.save!\n category\n else\n Classification.create_category!(name: name, description: description,\n read_only: true, single_value: true)\n end\nend",
"def categories(*values)\n values.inject(self) { |res, val| res._categories(val) }\n end",
"def categories(*values)\n values.inject(self) { |res, val| res._categories(val) }\n end",
"def set_categories\r\n @categories = Category.where('courses_count > 0').order(:name)\r\n end",
"def multiple_categories\n @categories = Category.all\n end",
"def category_string\n categories.pluck(:name).flatten.compact.uniq.join(', ')\n end",
"def category_names_string(arguments = {})\n seperator = arguments.fetch(:seperator){\", \"}\n\n self.categories.pluck(:name).join(seperator)\n end",
"def set_categories\n new_categories = extract_categories_from_url\n unless new_categories.nil?\n @categories = new_categories\n else\n @categories = Type::DefaultCategories\n end\n end"
] |
[
"0.71038395",
"0.70917416",
"0.6982192",
"0.69171596",
"0.6899555",
"0.6799439",
"0.6772932",
"0.67318565",
"0.6705984",
"0.66909087",
"0.66468537",
"0.6617299",
"0.6603744",
"0.6592889",
"0.65879345",
"0.65614706",
"0.65506774",
"0.6541382",
"0.65393263",
"0.6536403",
"0.65345913",
"0.651191",
"0.65000194",
"0.64848024",
"0.6469057",
"0.6445312",
"0.64414555",
"0.64142406",
"0.64091945",
"0.63890004",
"0.6370236",
"0.6353371",
"0.6341369",
"0.6336999",
"0.6310155",
"0.62829703",
"0.62810314",
"0.62580615",
"0.62580615",
"0.62580615",
"0.6253251",
"0.6252404",
"0.6245562",
"0.6240149",
"0.6238187",
"0.6235608",
"0.6223128",
"0.62083817",
"0.6207887",
"0.62069225",
"0.61876845",
"0.6168699",
"0.61670977",
"0.61670977",
"0.61670977",
"0.6161355",
"0.6158581",
"0.61399436",
"0.61365557",
"0.6131481",
"0.61189055",
"0.6116135",
"0.6106408",
"0.60975444",
"0.609713",
"0.60812336",
"0.60783577",
"0.60776144",
"0.60752",
"0.6074808",
"0.607323",
"0.60682964",
"0.60672367",
"0.6059577",
"0.60447145",
"0.604085",
"0.60329187",
"0.60264385",
"0.60002625",
"0.59982735",
"0.5995745",
"0.5993708",
"0.59927535",
"0.5992641",
"0.5987783",
"0.5983871",
"0.5980387",
"0.5980225",
"0.596204",
"0.59562683",
"0.59551156",
"0.595333",
"0.59511864",
"0.59486943",
"0.5941693",
"0.5941693",
"0.59358245",
"0.59311926",
"0.5930519",
"0.5927602",
"0.5923915"
] |
0.0
|
-1
|
GET /applicants GET /applicants.xml
|
def index
#@applicants = Applicant.paginate(:per_page => 10, :page => params[:page])
respond_to do |format|
format.html # index.html.erb
format.xml { render :xml => @applicants }
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def show\n @applicants = get_applicants if params[:applicants]\n end",
"def index\n @applicants = current_user.applicants rescue nil\n end",
"def index\n @applicants = Applicant.all\n end",
"def index\n @applicants = Applicant.all\n end",
"def index\n #@applicants = ApplicantUser.all.page(page: params[:page] || 1, per_page: 20)\n @applicants = ApplicantUser.all\n end",
"def index\n @applicants = Applicant.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @applicants }\n end\n end",
"def list_tenants_for_circle(args = {}) \n get(\"/tenantcircles.json/tenants\", args)\nend",
"def index\n @tenants = Tenant.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @tenants }\n end\n end",
"def index\n @tenants = current_user.tenants\n end",
"def index\n @tenants = current_account.tenants\n end",
"def index\n @apps = current_user.apps.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @apps }\n end\n end",
"def get_current_tenant \n get(\"/tenants.json/current\")\nend",
"def index\n @event_applicants = EventApplicant.all\n end",
"def base_uri\n \"#{api}/admin/tenants\"\n end",
"def getApplications(ak)\n uri='https://api.newrelic.com/v2/applications.json'\n parseUrl=URI.parse(uri)\n host=parseUrl.host\n path=parseUrl.path\n getRequest(ak,uri,host,path)\nend",
"def tenants\n @tenants\n end",
"def list_tenants_for_circles(args = {}) \n get(\"/tenants.json/circles\", args)\nend",
"def show\n @app = current_user.apps.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @app }\n end\n end",
"def tenant_list\n\t\t\n\t\tget_call = Curl::Easy.http_get(\"#{@ip_address}:#{@port_2}/v2.0/tenants\"\n\t\t) do |curl| curl.headers['x-auth-token'] = @token end\n\t\t\n\t\tputs \"invoking tenant-list...\"\n\t\t\n\t\tparsed_json = JSON.parse(get_call.body_str)\n\t\t\n\t\tputs parsed_json\n\t\treturn parsed_json\n\tend",
"def view_applicants\n start_date = Date.today.beginning_of_year\n start_date -= 365 if Date.today - start_date < 90\n @submissions = Submission.includes([:applicant]).where('submissions.created_at > :start', { :start => start_date }).all\n\n @activity = \"all applicants from #{start_date.to_s} to today for all competitions\"\n if has_read_all?(@sponsor)\n respond_to do |format|\n format.html { render :view_applicants }\n format.xml { render :xml => @applicants }\n end\n else\n redirect_to projects_path\n end\n end",
"def list_users_for_all_tenants(args = {}) \n get(\"/users.json/global\", args)\nend",
"def list_users_for_all_tenants(args = {}) \n get(\"/users.json/global\", args)\nend",
"def list_tenants\n url = self.os_compute_url + '/' + 'tenants'\n res = self.rest_run(url, \"GET\", {}, self.os_token)\n return res[:parsed]\n end",
"def index\n @applicant_references = current_applicant.applicant_references.all\n end",
"def index\n @applicants = Applicant.all.order(:contact)\n end",
"def index\n @app_requests = AppRequest.all\n end",
"def call\n @cc = @client.keystone(\"tenants\", 'GET')\n @cc[\"response\"]\n end",
"def show\n @applicant_status = ApplicantStatus.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @applicant_status }\n end\n end",
"def index\n @tenants = Tenant.get_tenant_list(current_user)\n @tenants = @tenants.paginate(:page => params[:page],:per_page => 10).order('id DESC')\n end",
"def index\n @tenants = Tenant.all\n end",
"def get_accounts()\n http_get(accounts_url)\n end",
"def index\n @accountants = Accountant.all\n end",
"def index\n @requests = Request.authorize_requests_for current_user.id\n respond_to do |format|\n format.html { }\n format.json { render :json => @requests}\n format.xml { render :xml => @requests.to_xml}\n end\n end",
"def list_users_for_tenant(args = {}) \n get(\"/tenants.json/#{args[:tenantId]}/users\", args)\nend",
"def index\n @environments = current_user.environments.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @environments }\n end\n end",
"def index\n @admin_accounts = Admin::Account.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @admin_accounts }\n end\n end",
"def list_backoffice_information_for_arrays_for_tenant(args = {}) \n get(\"/tenants.json/backoffice/arrays/#{args[:tenantId]}\", args)\nend",
"def view_sponsor_applicants\n sponsor = @project.program\n @submissions = Submission.includes([:applicant])\n .joins([:project])\n .where('projects.program_id = :sponsor_id', { :sponsor_id => sponsor.id })\n .order('submissions.created_at').all\n\n @activity = \"all applicants for all compeitions sponsored by #{sponsor.program_name}\"\n if has_read_all?(@sponsor)\n respond_to do |format|\n format.html { render :view_applicants }\n format.xml { render :xml => @applicants }\n end\n else\n redirect_to projects_path\n end\n end",
"def index\n authenticate_admin!\n \n @candies = Candy.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @candies }\n end\n end",
"def accounts\n get('/accounts')['accounts']\n end",
"def index\n @offices = current_user.offices\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @offices }\n end\n end",
"def show\n @tenant = Tenant.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @tenant }\n end\n end",
"def get_merchants\n uri = build_uri_for(@provider)\n p uri\n http = initialize_http(uri)\n\n request = Net::HTTP::Get.new(uri.request_uri)\n JSON( http.request(request).body )\n end",
"def getAccounts\n broker_url = APP_CONFIG['broker_ip'] + ':' + APP_CONFIG['broker_port'].to_s\n http = broker_url + \"/resources/accounts\"\n res = httpGETRequest(http)\n return res\n end",
"def show\n @applicant = Applicant.where('applicant_id = ?', @application.applicant_id)\n end",
"def index\n @tenants = keystone.tenants\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @tenants }\n end\n end",
"def show\n \n # security check\n @job = Job.find(params[:id], :conditions => [\"employer_id = ?\", current_user.employer.id])\n (@job.employer_id == current_user.employer.id).to_console\n if @job.employer_id == current_user.employer.id\n @applicants = Applicant.paginate(:conditions => [\"job_id = ?\", @job.id], :per_page => 10, :page => params[:page])\n \n else\n render :text => \"You do not own that listing\"\n end\n \n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @applicant }\n end\n end",
"def index\n @tenants = Tenant.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @tenants }\n end\n end",
"def index\n @accounts = current_user.accounts\n @help = \"Account List\"\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @accounts }\n end\n end",
"def show\n @applicant = Applicant.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @applicant }\n end\n end",
"def show\n @applicant = Applicant.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @applicant }\n end\n end",
"def show\n @applicant = Applicant.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @applicant }\n end\n end",
"def get_tenant_by_erp_id(args = {}) \n get(\"/tenants.json/erp-id/#{args[:erpId]}\", args)\nend",
"def index\n @campaigns = Campaign.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @orgadmin_campaigns }\n end\n end",
"def index\n @appmen = @current_user.appmen.all\n end",
"def show\n @app_resouces = @app_list.app_resouces.all\n end",
"def index\n \n @advertises = Advertise.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @advertises }\n end\n end",
"def show\n @aplicacion = Aplicacion.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @aplicacion }\n end\n end",
"def index\n @admin = AdminAccount.find_by_id(session[:admin_id])\n @admin_accounts = AdminAccount.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @admin_accounts }\n end\n end",
"def show\n property_feature_id = @property.attributes[\"property_feature_id\"]\n @property_feature = PropertyFeature.find(property_feature_id)\n occupants = Occupant.where(property_id: @property.id)\n @all_applicants = nil\n if session[:user_type] == \"admin\"\n @all_applicants = Applicant.where.not(id: occupants.ids)\n end\n @applicants = []\n if occupants\n occupants.each do |occupant|\n @applicants.append(Applicant.find_by_id(occupant.applicant_id))\n end\n end\n end",
"def index\n @atencions = Atencion.all\n end",
"def index\n @applicant_statuses = ApplicantStatus.search(params[:search], params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @applicant_statuses }\n end\n end",
"def applications_list\n get \"applications\"\n end",
"def index\n @activites = @association.activites\n\n respond_to do |format|\n format.html # index.rhtml\n format.xml { render :xml => @activites.to_xml }\n end\n end",
"def show\n @apparel = Apparel.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @apparel }\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 index\n @acres = Acre.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @acres }\n end\n end",
"def index\n @tenant_fees = current_account.tenant_fees\n end",
"def show\n @customers = @manifest.get_customers()\n @puntos = @manifest.get_puntos()\n @locations = @manifest.get_locations()\n @cargas = @manifest.get_cargas()\n\n \n end",
"def get_client_summary_for_tenant(args = {}) \n get(\"/tenants.json/backoffice/clients/summary/#{args[:tenantId]}\", args)\nend",
"def index\n @deployments = current_user.deployments.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @deployments }\n end\n end",
"def list\n deprecate # 07/26/2012\n doc = xml(get('/apps').to_s)\n doc.elements.to_a(\"//apps/app\").map do |a|\n name = a.elements.to_a(\"name\").first\n owner = a.elements.to_a(\"owner\").first\n [name.text, owner.text]\n end\n end",
"def getMerchants\n\tbegin\n\t\tresponse = RestClient.get('http://api.reimaginebanking.com/merchants?key=e0486a76005721ee6d86b140eaea2a40')\n\trescue\n\t\tputs \"error retrieving response...\"\n\tend\n\n\tmerchants = JSON.parse(response)\n\treturn merchants\nend",
"def get_applist\n return get_response(\"applist\", :json)\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 index\n @agencies = current_user.agencies.all\n end",
"def index\n @sites = current_user.sites\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @sites }\n end\n end",
"def index\n @sites = current_user.sites\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @sites }\n end\n end",
"def index\n @grants =\n if @company\n @company.grants(params[:filter_by], params[:sort_by], params[:desc])\n else\n Grant.kept.order(name: :asc)\n end\n\n headers[\"Total\"] = @grants.count\n headers[\"Per-Page\"] = params[:per_page]\n\n render json: (params[:page] == 'all' ? @grants : paginator(@grants)), has_type: false\n end",
"def index\n @applications = Application.find(:all,:conditions=>['user_id=?',current_user.id])\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @applications }\n end\n end",
"def fetch_databag_tenants\n db_tenants = Array.new\n chef_api_connect.search.query(:foundation, '*:*', start: 0).rows.each do |tenant|\n db_tenants << tenant['raw_data']['id']\n end\n return db_tenants\nend",
"def get_accounts\n response_xml = http_get(\"#{xero_url}/accounts\")\n parse_response(response_xml)\n end",
"def subaccounts()\n get('subAccounts')\n end",
"def index\n @sign_up_for_beta_accesses = SignUpForBetaAccess.all\n \n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @sign_up_for_beta_accesses }\n end\n end",
"def get_grants(id, type)\n xml = invoke('n2:GetGrantsRequest') do |message|\n Builder.get_grants(message, id, type)\n end\n return nil if soap_fault_not_found?\n Parser.get_grants_response(xml, type)\n end",
"def application(applicant_id)\n request(:get, \"applicant_tracking/applications/#{applicant_id}\")\n end",
"def show\r\n @appoint_responsible = AppointResponsible.new\r\n @inherited_accounts = current_user.inherited_accounts\r\n end",
"def index\n @user ||= current_user\n @apps = @user.apps.all\n # @app = @user.apps.find(params[:id]) \n\n end",
"def index\n @admin = AdminAccount.find_by_id(session[:admin_id])\n @user_accounts = UserAccount.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @user_accounts }\n end\n end",
"def show\n @client_app = ClientApp.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @seed }\n end\n end",
"def allergies\n raise UserNotAuthenticated unless access_token\n\n get('records/allergies')\n end",
"def index\n @merchants = Merchant.all\n end",
"def index\n @merchants = Merchant.all\n end",
"def index\n @almacenes = Almacen.all\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @almacenes }\n end\n end",
"def index\n @accounts = Account.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @accounts }\n end\n end",
"def index\n @accounts = Account.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @accounts }\n end\n end",
"def index\n @accounts = Account.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @accounts }\n end\n end",
"def index\n @appList = AppProdu.getAppIdAndNameList current_member.id\n end",
"def index\n @expenses = Expense.all\n # @assets = Asset.all\n @assets = current_user.assets\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @expenses }\n end\n end",
"def index\n @current_item = \"my_account\"\n \n respond_to do |format|\n format.html \n format.xml { render :xml => @accounts.to_xml }\n end\n end"
] |
[
"0.7678585",
"0.7322472",
"0.6842018",
"0.6842018",
"0.658738",
"0.65523094",
"0.617821",
"0.6141633",
"0.6096072",
"0.60434496",
"0.6036075",
"0.6031986",
"0.59656745",
"0.59614336",
"0.5953296",
"0.5905208",
"0.5861879",
"0.58611906",
"0.5843751",
"0.58311975",
"0.5795912",
"0.5795912",
"0.5774971",
"0.5736705",
"0.5662194",
"0.5650356",
"0.56457293",
"0.56451756",
"0.56431067",
"0.5640908",
"0.56264424",
"0.5619482",
"0.56086594",
"0.55933905",
"0.55882245",
"0.5586585",
"0.5583729",
"0.5563607",
"0.55551994",
"0.55540556",
"0.55485594",
"0.55402416",
"0.55355704",
"0.5515926",
"0.5506793",
"0.5506758",
"0.549762",
"0.54752195",
"0.5474627",
"0.54661745",
"0.54661745",
"0.54661745",
"0.5460339",
"0.54534805",
"0.54326767",
"0.5430462",
"0.54234016",
"0.5417076",
"0.54164624",
"0.5403195",
"0.54017323",
"0.53936386",
"0.5386849",
"0.5367762",
"0.53620154",
"0.5357023",
"0.53523797",
"0.5349528",
"0.5347255",
"0.5344812",
"0.5341364",
"0.53397155",
"0.5335239",
"0.53349775",
"0.53281903",
"0.532423",
"0.5323798",
"0.5323798",
"0.5320762",
"0.5319442",
"0.53178436",
"0.53109396",
"0.5310692",
"0.5310235",
"0.53027266",
"0.52975047",
"0.5297401",
"0.52948797",
"0.5294083",
"0.5293431",
"0.5292551",
"0.52848744",
"0.52848744",
"0.5283064",
"0.5281006",
"0.5281006",
"0.5281006",
"0.5277906",
"0.5276617",
"0.5269431"
] |
0.6720587
|
4
|
GET /applicants/1 GET /applicants/1.xml
|
def show
# security check
@job = Job.find(params[:id], :conditions => ["employer_id = ?", current_user.employer.id])
(@job.employer_id == current_user.employer.id).to_console
if @job.employer_id == current_user.employer.id
@applicants = Applicant.paginate(:conditions => ["job_id = ?", @job.id], :per_page => 10, :page => params[:page])
else
render :text => "You do not own that listing"
end
respond_to do |format|
format.html # show.html.erb
format.xml { render :xml => @applicant }
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def show\n @applicants = get_applicants if params[:applicants]\n end",
"def index\n #@applicants = Applicant.paginate(:per_page => 10, :page => params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @applicants }\n end\n end",
"def index\n @applicants = current_user.applicants rescue nil\n end",
"def index\n @applicants = Applicant.all\n end",
"def index\n @applicants = Applicant.all\n end",
"def index\n @applicants = Applicant.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @applicants }\n end\n end",
"def index\n #@applicants = ApplicantUser.all.page(page: params[:page] || 1, per_page: 20)\n @applicants = ApplicantUser.all\n end",
"def show\n @app = current_user.apps.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @app }\n end\n end",
"def index\n @apps = current_user.apps.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @apps }\n end\n end",
"def index\n @tenants = Tenant.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @tenants }\n end\n end",
"def show\n @applicant_status = ApplicantStatus.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @applicant_status }\n end\n end",
"def view_applicants\n start_date = Date.today.beginning_of_year\n start_date -= 365 if Date.today - start_date < 90\n @submissions = Submission.includes([:applicant]).where('submissions.created_at > :start', { :start => start_date }).all\n\n @activity = \"all applicants from #{start_date.to_s} to today for all competitions\"\n if has_read_all?(@sponsor)\n respond_to do |format|\n format.html { render :view_applicants }\n format.xml { render :xml => @applicants }\n end\n else\n redirect_to projects_path\n end\n end",
"def getApplications(ak)\n uri='https://api.newrelic.com/v2/applications.json'\n parseUrl=URI.parse(uri)\n host=parseUrl.host\n path=parseUrl.path\n getRequest(ak,uri,host,path)\nend",
"def show\n @apparel = Apparel.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @apparel }\n end\n end",
"def get_current_tenant \n get(\"/tenants.json/current\")\nend",
"def show\n @tenant = Tenant.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @tenant }\n end\n end",
"def show\n @aplicacion = Aplicacion.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @aplicacion }\n end\n end",
"def index\n @event_applicants = EventApplicant.all\n end",
"def show\n @appsoft = Appsoft.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @appsoft }\n end\n end",
"def show\n @client_app = ClientApp.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @seed }\n end\n end",
"def show\n @userapp = Userapp.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @userapp }\n end\n end",
"def show\n @applicant = Applicant.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @applicant }\n end\n end",
"def show\n @applicant = Applicant.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @applicant }\n end\n end",
"def show\n @applicant = Applicant.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @applicant }\n end\n end",
"def show\n @memberapp = Memberapp.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @memberapp }\n end\n end",
"def list_tenants_for_circle(args = {}) \n get(\"/tenantcircles.json/tenants\", args)\nend",
"def view_sponsor_applicants\n sponsor = @project.program\n @submissions = Submission.includes([:applicant])\n .joins([:project])\n .where('projects.program_id = :sponsor_id', { :sponsor_id => sponsor.id })\n .order('submissions.created_at').all\n\n @activity = \"all applicants for all compeitions sponsored by #{sponsor.program_name}\"\n if has_read_all?(@sponsor)\n respond_to do |format|\n format.html { render :view_applicants }\n format.xml { render :xml => @applicants }\n end\n else\n redirect_to projects_path\n end\n end",
"def show\n submenu_item 'applications-index'\n @app = App.find(params[:id], query)\n @alerts = Alert.all({\n :conditions => [\"source_type = 2 and source_id = ? and severity <> 0\", @app.id]\n })\n @services = @app.services\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @app }\n end\n end",
"def show\n @visaapp = Visaapp.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @visaapp }\n end\n end",
"def index\n @applicant_statuses = ApplicantStatus.search(params[:search], params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @applicant_statuses }\n end\n end",
"def index\n @app_requests = AppRequest.all\n end",
"def index\n @campaigns = Campaign.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @orgadmin_campaigns }\n end\n end",
"def show\n @applicant = Applicant.where('applicant_id = ?', @application.applicant_id)\n end",
"def index\n authenticate_admin!\n \n @candies = Candy.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @candies }\n end\n end",
"def index\n @admin_accounts = Admin::Account.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @admin_accounts }\n end\n end",
"def show\n @capp = Capp.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @capp }\n end\n end",
"def show\n @app_resouces = @app_list.app_resouces.all\n end",
"def index\n @acres = Acre.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @acres }\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 base_uri\n \"#{api}/admin/tenants\"\n end",
"def index\n @current_item = \"my_account\"\n \n respond_to do |format|\n format.html \n format.xml { render :xml => @accounts.to_xml }\n end\n end",
"def index\n @tenants = current_user.tenants\n end",
"def show\n @app_version = @app.app_versions.find(params[:id])\n # @app_version = AppVersion.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @app_version }\n end\n end",
"def index\n @applications = Application.find(:all,:conditions=>['user_id=?',current_user.id])\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @applications }\n end\n end",
"def index\n @offices = current_user.offices\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @offices }\n end\n end",
"def index\n @tenants = current_account.tenants\n end",
"def index\n @applicant_references = current_applicant.applicant_references.all\n end",
"def index\n \n @advertises = Advertise.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @advertises }\n end\n end",
"def index\n @applicants = Applicant.all.order(:contact)\n end",
"def show\n @app_profile = AppProfile.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @app_profile }\n end\n end",
"def show\n @app = Mms::App.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @app }\n end\n end",
"def index\n @environments = current_user.environments.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @environments }\n end\n end",
"def show\n @almacen = Almacen.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @almacen }\n end\n end",
"def index\n @activites = @association.activites\n\n respond_to do |format|\n format.html # index.rhtml\n format.xml { render :xml => @activites.to_xml }\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 index\n @admin = AdminAccount.find_by_id(session[:admin_id])\n @admin_accounts = AdminAccount.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @admin_accounts }\n end\n end",
"def application(applicant_id)\n request(:get, \"applicant_tracking/applications/#{applicant_id}\")\n end",
"def index\n @accountants = Accountant.all\n end",
"def show\n @advertise = Advertise.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @advertise }\n end\n end",
"def show\n @concert = Concert.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @concert }\n end\n end",
"def show\n @administrativo = Administrativo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @administrativo }\n end\n end",
"def show_rest\n @item_usage = ItemUsage.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @item_usage }\n end\n end",
"def show\n @deployment = current_user.deployments.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @deployment }\n end\n end",
"def index\n @user ||= current_user\n @apps = @user.apps.all\n # @app = @user.apps.find(params[:id]) \n\n end",
"def show\n @app = App.find(params[:id])\n\n respond_to do |format|\n format.html # show.haml\n format.xml { render :xml => @app }\n end\n end",
"def show\n @helocapp = Helocapp.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @helocapp }\n end\n end",
"def get_tenant_by_erp_id(args = {}) \n get(\"/tenants.json/erp-id/#{args[:erpId]}\", args)\nend",
"def list_tenants_for_circles(args = {}) \n get(\"/tenants.json/circles\", args)\nend",
"def index\n @certs = Cert.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @certs }\n end\n end",
"def index\n @accessories = Accessory.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @accessories }\n end\n end",
"def index\n @tenants = Tenant.all\n end",
"def show\n @atividade = Atividade.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @atividade }\n end\n end",
"def index\n @almacenes = Almacen.all\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @almacenes }\n end\n end",
"def index\n @accounts = Account.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @accounts }\n end\n end",
"def index\n @accounts = Account.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @accounts }\n end\n end",
"def index\n @accounts = Account.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @accounts }\n end\n end",
"def show\n @analisis = Analisis.find(params[:id])\n\n respond_to do |format|\n format.xml { render :xml => @analisis }\n end\n end",
"def show\n property_feature_id = @property.attributes[\"property_feature_id\"]\n @property_feature = PropertyFeature.find(property_feature_id)\n occupants = Occupant.where(property_id: @property.id)\n @all_applicants = nil\n if session[:user_type] == \"admin\"\n @all_applicants = Applicant.where.not(id: occupants.ids)\n end\n @applicants = []\n if occupants\n occupants.each do |occupant|\n @applicants.append(Applicant.find_by_id(occupant.applicant_id))\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 show\r\n @appoint_responsible = AppointResponsible.new\r\n @inherited_accounts = current_user.inherited_accounts\r\n end",
"def get_client_summary_for_tenant(args = {}) \n get(\"/tenants.json/backoffice/clients/summary/#{args[:tenantId]}\", args)\nend",
"def tenants\n @tenants\n end",
"def index\n @sites = current_user.sites\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @sites }\n end\n end",
"def index\n @sites = current_user.sites\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @sites }\n end\n end",
"def index\n @paciente = Paciente.find(params[:paciente_id])\n @visitas = @paciente.visitas\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @visitas }\n end\n end",
"def index\n @compliances = Compliance.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @compliances }\n end\n end",
"def index\n @tenants = Tenant.get_tenant_list(current_user)\n @tenants = @tenants.paginate(:page => params[:page],:per_page => 10).order('id DESC')\n end",
"def index\n @apprendices = Apprendice.all\n end",
"def index\n @requests = Request.authorize_requests_for current_user.id\n respond_to do |format|\n format.html { }\n format.json { render :json => @requests}\n format.xml { render :xml => @requests.to_xml}\n end\n end",
"def show\n @app_config = AppConfig.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @app_config }\n end\n end",
"def show\n @organisation = Organisation.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @organisation }\n end\n end",
"def index\n @resource_allocations = ResourceAllocation.scoped\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @resource_allocations }\n end\n end",
"def show\n @app = App.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @app }\n format.json { render :json => @app } \n end\n end",
"def show\n @atmdebitcardapp = Atmdebitcardapp.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @atmdebitcardapp }\n end\n end",
"def show\n @customers = @manifest.get_customers()\n @puntos = @manifest.get_puntos()\n @locations = @manifest.get_locations()\n @cargas = @manifest.get_cargas()\n\n \n end",
"def show\n @app = @client.app(params[:id])\n @paas_providers = cached_providers\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @app }\n end\n end",
"def index\n @compliances = Compliance.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @compliances }\n end\n end",
"def show\n @calmapp = Calmapp.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @calmapp }\n end\n end",
"def index\n @admin = AdminAccount.find_by_id(session[:admin_id])\n @user_accounts = UserAccount.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @user_accounts }\n end\n end",
"def index\n @permissions = Permission.find(:all)\n\t\trespond_to do |format|\n\t\t\tformat.html\n\t\t\tformat.xml { render :xml => @permissions }\n\t\tend\n end"
] |
[
"0.7305356",
"0.69398254",
"0.6817581",
"0.6709612",
"0.6709612",
"0.6514056",
"0.6399076",
"0.63195497",
"0.6232536",
"0.62241703",
"0.61885494",
"0.6004993",
"0.599749",
"0.5975479",
"0.59644926",
"0.5893432",
"0.58829457",
"0.58297455",
"0.5786293",
"0.57731545",
"0.57675135",
"0.5721789",
"0.5721789",
"0.5721789",
"0.571987",
"0.5716471",
"0.5715993",
"0.5715707",
"0.5713114",
"0.57077116",
"0.57061744",
"0.5703947",
"0.57004356",
"0.5697326",
"0.5681112",
"0.56714195",
"0.56661147",
"0.56596106",
"0.5645326",
"0.564153",
"0.5637819",
"0.5635832",
"0.5633426",
"0.5633058",
"0.5614451",
"0.56114554",
"0.5610321",
"0.5593958",
"0.5591968",
"0.55897343",
"0.55756855",
"0.55733126",
"0.55583817",
"0.555303",
"0.5544486",
"0.55421877",
"0.55273336",
"0.552165",
"0.55128944",
"0.5506608",
"0.5496326",
"0.54927754",
"0.5490148",
"0.5487045",
"0.54853153",
"0.54811674",
"0.54806894",
"0.54794616",
"0.5478883",
"0.5476109",
"0.5467503",
"0.5465732",
"0.5464196",
"0.5463715",
"0.5463715",
"0.5463715",
"0.54627633",
"0.5452581",
"0.5451661",
"0.5449823",
"0.54494464",
"0.5434418",
"0.54341894",
"0.54341894",
"0.5432057",
"0.5430648",
"0.5430637",
"0.542964",
"0.54284316",
"0.54242975",
"0.5423518",
"0.5421387",
"0.5418401",
"0.54152817",
"0.5414882",
"0.54050046",
"0.54007393",
"0.539539",
"0.5391997",
"0.5384639"
] |
0.56490815
|
38
|
Failing to get your bid is referred to as 'going set'.
|
def got_set
return self.bid != self.tricks
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def bid\n self.bids.last.nil? ? Bid.new : self.bids.last\n end",
"def last_bid\n self.bids.last rescue nil\n end",
"def completed_bid\n completed_response.present? ? completed_response.bid : nil\n end",
"def give_bid(auction, bid)\r\n if Time.now > auction.due_date\r\n raise TradeException, \"Out of time\"\r\n elsif auction.bid.last != nil\r\n if auction.bid.last.owner != self\r\n auction.set_bid(self, bid)\r\n else\r\n auction.update_bid(self,bid)\r\n end\r\n else\r\n auction.set_bid(self,bid)\r\n end\r\n end",
"def broken_bikes\n bikes.select {|bike| bike.broken?}\n end",
"def bid\n return starting_bid unless prev_bid\n if prev_bid.total >= all_dice_count/(2*expected_prob) && prev_bid.total > dice_count_of_bid\n puts comment\n LiarsDice::BS.new\n elsif prev_bid.total < magic_number && magic_number < all_dice_count\n LiarsDice::Bid.new(magic_number, prev_bid.face_value)\n else\n if prev_bid.face_value == 6 && (prev_bid.total+1) < all_dice_count/(2*expected_prob)\n LiarsDice::Bid.new(prev_bid.total+1, most_bid)\n elsif prev_bid.face_value < 6 && (prev_bid.total+1) < all_dice_count/(2*expected_prob)\n LiarsDice::Bid.new(prev_bid.total, prev_bid.face_value+1)\n else\n LiarsDice::BS.new\n end\n end\n end",
"def on_bid(bid)\r\n warn \"Bid \" + bid.to_s\r\n end",
"def set_bid\n @bid = Bid.find(params[:id])\n @inspection = @bid.try(:inspection)\n @bids = @inspection.try(:bids)\n end",
"def set_bid\n @bid = @item.bids.find_by(id: params[:id])\n render json: { errors: { detail: \"Bid not found\" } }, status: :unauthorized and return unless @bid\n end",
"def accepted_bid\n accepted_response.present? ? accepted_response.bid : nil\n end",
"def release_bike\n fail 'No bikes available' if empty?\n new_bikes = @bikes\n @bikes.each_with_index do |value, index|\n if value.working? # broken? == false\n new_bikes = @bikes.pop(index)\n break\n end\n end\n raise 'No working bikes available' if new_bikes == @bikes\n return new_bikes\n end",
"def bid\n @bid ||= if @event.at('bid')\n @event.at('bid').inner_text.to_i\n else\n false\n end\n end",
"def accepted_bid\n Bid.find(accepted_bid_id) if accepted_bid_id\n end",
"def set_bid(player_on_position, bid)\n raise ArgumentError, \"invalid bid #{bid}\" unless ALL_BIDS.include? bid\n # raise ArgumentError, \"impossible bid #{bid}\" unless possible_bids.include? bid\n\n if bid == :pass\n @pass_count += 1\n return\n end\n\n if @won_bid.nil? and [:double, :redouble].include? bid\n raise ArgumentError, \"doubling nothing: #{bid}\"\n end\n\n if bid == :double\n @is_double = true\n @bid_said_by = player_on_position\n elsif bid == :redouble\n @is_double = false\n @is_redouble = true\n @bid_said_by = player_on_position\n else\n @won_bid = bid\n @bid_said_by = player_on_position\n clear_doubling\n end\n\n @pass_count = 0\n end",
"def set_bid(user, new_bid)\r\n if new_bid >= self.current_price + self.increment && new_bid >= self.minimal\r\n unless self.bid.empty?\r\n check_bids(user,new_bid)\r\n else\r\n raise TradeException, \"Not enough money!\" unless user.credits >= new_bid\r\n user.credits -= new_bid\r\n user.credits_in_auction += new_bid\r\n end\r\n tmp_bid = bid.last\r\n self.bid.push Models::Bid.new_bid(user,new_bid)\r\n user.add_activity\"has bid on item #{item.name} from #{item.owner}\"\r\n unless tmp_bid == nil\r\n send_email(tmp_bid) if tmp_bid.value < new_bid\r\n end\r\n else\r\n raise TradeException, \"Too small bid!\"\r\n end\r\n self.invariant\r\n end",
"def check_bids(user, new_bid)\r\n previous_winner = self.bid.last.owner\r\n if user.credits < new_bid\r\n raise TradeException, \"Not enough money!\" unless user.credits >= new_bid\r\n elsif self.bid.last.value == new_bid\r\n raise TradeException, \"That's already the highest bid!\"\r\n elsif self.bid.last.value < new_bid\r\n previous_winner.credits += self.bid.last.value\r\n previous_winner.credits_in_auction -= self.bid.last.value\r\n user.credits -= new_bid\r\n user.credits_in_auction += new_bid\r\n end\r\n end",
"def check_bag(lost_item)\n @items.each do |type,list|\n contains_lost_item = list.any? {|item,empty| item == lost_item}\n return \"No worries, you already packed #{lost_item}.\" if contains_lost_item\n end\n return \"Your bag is missing #{lost_item}!\"\n end",
"def working_bikes\n bikes.reject { |bike| bike.broken? }\n end",
"def functioning_bikes\n bikes.reject {|bike| bike.broken?}\n end",
"def bid\n @auction = Auction.find(params[:auction_id])\n @reward = Reward.find(params[:reward_id])\n @hours_already_bid = @reward.hours_already_bid_by(current_user)\n @hours_entry = HoursEntry.new\n @bid = Bid.new\n end",
"def release_bike\n raise(RuntimeError, \"No bikes available\") unless !empty?\n raise(\"Cannot release a broken bike\") if @bikes.last.broken?\n @bikes.pop\n end",
"def borked?; @borked; end",
"def bid(item, amount)\r\n if can_bid?(item, amount)\r\n previous_winner = item.current_winner\r\n previous_max_bid = item.highest_bid.nil? ? 0 : item.bidders[previous_winner]\r\n\r\n item.bidders[self] = amount\r\n\r\n # reduce money if user is new winner, otherwise nothing happens\r\n current_winner = item.current_winner\r\n current_max_bid = item.bidders[current_winner]\r\n\r\n previous_winner.credits += previous_max_bid unless previous_winner.nil?\r\n current_winner.credits -= current_max_bid\r\n#Do not always send mail for demo purposes\r\n=begin\r\n if !previous_winner.nil? && previous_winner != current_winner\r\n # we got a new winner\r\n\r\n Security::MailDispatcher.send_new_winner_mail(previous_winner.email, item) unless [nil, \"\"].include?(previous_winner.email)\r\n end\r\n=end\r\n else\r\n raise TradeError, \"INVALID_BID\" #Bid is too small or already exists or user doesn't have enough money.\r\n end\r\n end",
"def loser(bid, winner)\n @bid, @winner = bid, winner\n mail to: bid.manager.email, subject: 'You lost your Sealed Bid!'\n end",
"def set_bid\n unless self.top_bid\n bid = Bid.new\n bid.user_id = self.user.id\n bid.highest = self.starting_price\n bid.save\n self.bids << bid\n end\n end",
"def release_bike\n raise 'no bike to be released' if empty?\n raise \"Can't release broken bike\" unless @bikes.last.working?\n @bikes.pop\n end",
"def rejected(bid)\n @bid = bid\n mail :to => bid.bidder.email\n body :bid => bid\n end",
"def tied(bid)\n @bid = bid\n mail to: bid.manager.email, subject: 'Your Sealed Bid was a tie!'\n end",
"def release_bike\n raise \"There are no bikes docked\" unless empty?\n raise \"Remaining #{@available.length} #{@available.length > 1 ? \"bikes are broken\" : \"bike is broken\"}\" unless any_working?\n @available.pop\n end",
"def set_bid\n @bid = Bid.find_by({\n :id => params[:id],\n :auction_id => params[:auction_id]})\n\n render json: nil, status: :not_found if @bid.nil? || @bid.auction.seller.id != @user.id\n end",
"def disclose\n @data['disclose']\n end",
"def disclose\n @data['disclose']\n end",
"def release_bike\n #fail 'No bikes available' if @bikes.empty?\n fail 'No bikes available' if empty?\n #use private helper method empty? Single Responsibility Principle\n #@bikes.pop use private attr_reader\n #Bike.new\n bikes.pop\n end",
"def release_bike()\n empty? ? (fail \"There's no bike docked to release!\") : @bikes.pop()\n end",
"def valid_bid?\n unless Auction.find(Item.find(self.item_id).auction_id).end_date > (DateTime.now.to_time - 7.hours).to_datetime\n errors[:base] = \"It is now past the auction time and no more bids are allowed online.\"\n return false\n end\n # Check if there are any bids for this item yet.\n if !Bid.where(:item_id => self.item_id).empty?\n # Checks if there was an unsuccessful bid that is waiting but it's the first one\n if Bid.where(:item_id => self.item_id).count == 1 && Bid.where(:item_id => self.item_id).first.user_id.nil?\n if self.bid_amount >= Item.find(self.item_id).min_bid\n return true\n else \n errors[:base] = \"Invalid bid amount! Please make sure that your bid is at \n least as high as the starting bid.\"\n return false\n end\n end\n # Check that this bidder is not the one who made the highest bid, first\n if Bid.where(:item_id => self.item_id, :bid_amount => Item.find(self.item_id).min_bid).first.user_id==self.user_id\n \terrors[:base] = \"You are already the highest bidder!\"\n return false\n else\n # Now check that this bid amount is higher than the highest bid amount\n if self.bid_amount < Item.find(self.item_id).min_bid + Item.find(self.item_id).min_increase\n errors[:base] = \"Invalid bid amount! Please make sure that your bid is at \n least as high as the highest bid plus the minimum increase.\"\n return false\n else\n # If the bidder isn't already the highest bidder, the bid amount is not empty,\n # and the bid is more than the highest bid, return true because it's valid\n return true\n end\n end\n # there are no bids for the item, check that the bid is at least as much as the min bid\n else\n if self.bid_amount >= Item.find(self.item_id).min_bid\n return true\n else \n errors[:base] = \"Invalid bid amount! Please make sure that your bid is at \n least as high as the starting bid.\"\n return false\n end\n end\n end",
"def bidding_open?\n return self.auction_end.blank? || self.auction_end.future?\n end",
"def collect_broken_bikes(van)\n\t\tvan.broken_bikes.each {|bike| bikes << van.release(bike)}\n\tend",
"def set_marketplace_bid_no_bid_question\n @marketplace_bid_no_bid_question = ::Marketplace::BidNoBidQuestion.find(params[:id])\n end",
"def set_bid\n @bid = @pet.bids.find_by!(number: params[:id])\n end",
"def current_bid\n if bids.count == 0\n return 0\n else\n bids.order(bid_price: :desc).first.bid_price\n end\n end",
"def garbage\n correct_bin = self.bin_id\n Item.find(self.id).responses.where(bin_id: 1).count\n end",
"def set_bidding\n @bidding = Bidding.find(params[:id])\n end",
"def pending_offers_as_buyer\n self.offers_as_buyer.pending\n end",
"def offload_broken_bike\n released_bike = broken_bikes.pop\n bikes.delete(released_bike)\n released_bike\n end",
"def ask?\n !bid?\n end",
"def ask?\n !bid?\n end",
"def sell_pending\n end",
"def attemp_buying\n\n end",
"def release_bike\n if dock_empty?\n raise 'Sorry, no bike in the dock'\n else\n if @broken_bikes.include?(@arr[-1])\n\n puts @arr.rotate!(-1)\n raise 'Cant release broken bike'\n else\n puts 'Yes, you can get a bike'\n @arr.pop\n end\n end\n end",
"def unappliable_order?\n order.bought? == false\n end",
"def release_bike\n fail 'No bikes available' if working_bikes.empty?\n bikes.delete working_bikes.pop\n end",
"def miss_reason; end",
"def is_lost\r\n\t\tbook.status = 'Lost'\r\n\tend",
"def give_away(dev, freebie)\n # dev_owns.give_away(Dev.find(2), Freebie.find(6))\n # if dev_owns == freebie.dev\n # if self == freebie.dev \n # # updates the freebie's dev_id to be the id of the instance of Dev passed in as an argument\n # freebie.update(dev_id: dev.id)\n # else \n # \"you can't give what you don't have.\"\n # end\n\n # if self.received_one?(freebie.item_name)\n # freebie.dev = dev\n # freebie.save\n # else\n # puts \"Not your freebie!\"\n # end\n\n freebie.update(dev: dev) unless freebie.dev != self\n\n end",
"def set_bid(id)\n @bid = Bid.find(id)\n end",
"def borrower_paid_outside_closing\n purchase_credits.where(:name => 'BorrowerPaidOutsideClosing').first.value rescue nil\n end",
"def bid\n BigDecimal Fyb.public.ticker.perform.parse['bid'], 2\n end",
"def bid\n bid_params = params.permit(:id, :bid_or_pass, :tricks_count, :trump_suit)\n game = Game.find(bid_params[:id])\n if bidder_has_passed?(bid_params)\n PassBid.new(game).call\n elsif bidder_has_made_bid?(bid_params)\n MakeBid.new(game, bid_params[:tricks_count], bid_params[:trump_suit]).call\n end\n\n redirect_to game\n end",
"def release_bike\n raise \"There is no bike\" if empty?\n raise \"This bike is broken and cannot be released\" if !@bikes[-1].working? # checks if the last bike entered is broken.\n # what if a broken bike is docked followed by a working one, does the working one still get released?\n \n @bikes.pop # here you refer to the instance variable @bikes.\n # Since you have the getter method/attr_reader method bikes, use that. Better to use instance methods than variables\n end",
"def collect_broken_bikes_from station\n\t\tstation.bikes.each do |bike|\n\t\t\tload bike if bike.broken?\n\t\t\tstation.release bike if bike.broken?\n\t\tend\n\tend",
"def set_bought_item\n @bought_item = BoughtItem.find(params[:id])\n end",
"def price_is_right(bids, actual_retail_price)\n winning_bid = 0\n bids.each {|current_bids| winning_bid = current_bids if current_bids < actual_retail_price && current_bids > winning_bid}\n winning_bid\nend",
"def set_bid\n @bid = Bid.find(params[:id])\n end",
"def bid\n @auction = Auction.find(params[:auction_id])\n @reward = Reward.find(params[:reward_id])\n @points_already_bid = current_user ? @reward.points_already_raised_by(current_user) : 0\n @donation = Donation.new\n @program = @auction.program\n @karma_page = false\n\n if @program\n @org = @program.organization\n @profile_fields = Profile.profile_fields(current_user, @org)[@org.url] # current_user could be nil\n if @program.auction_type == \"fixed\"\n @opportunities = Profile.fixed_opportunities_for(@org)\n @nonprofit = @org.nonprofits.first\n end\n end\n\n if current_user\n @current_karma = total_karma_for(current_user)\n else\n @current_karma = 0\n end\n\n if current_user && current_user.stripe_cus_id && !@org\n Stripe.api_key = ENV['STRIPE_SECRET_KEY']\n begin\n customer = Stripe::Customer.retrieve(current_user.stripe_cus_id)\n @default_card = customer.sources.retrieve(customer.default_card)\n rescue\n # If a similar Stripe object exists in live mode, but a test mode key was used to make this request.\n @default_card = nil\n end\n end\n end",
"def minimal_allowed_bid\n if self.winner_bid.positive?\n (self.winner_bid * MINIMAL_INCREASE_BID).to_i\n else\n self.minimal_bid\n end\n end",
"def set_bid\n @bid = Bid.find(params[:id])\n end",
"def set_bid\n @bid = Bid.find(params[:id])\n end",
"def set_bid\n @bid = Bid.find(params[:id])\n end",
"def set_bid\n @bid = Bid.find(params[:id])\n end",
"def set_bid\n @bid = Bid.find(params[:id])\n end",
"def set_bid\n @bid = Bid.find(params[:id])\n end",
"def inbid?\n item = Item.find(item_id)\n if(item.expired? == false && inBid_notify == false)\n return true\n else\n return false\n end\n end",
"def fix_bikes\n @bikes.each { |bike| bike.working = true }\n end",
"def set_bid\n @bid = Bid.find(params[:id])\n end",
"def free_storage_valid_thru_date\n sale_date =\n if self.auction_datum.present? && self.auction_datum.auction_date.present?\n self.yard.utc_sale_date_with_time_for_date(self.auction_datum.auction_date)\n elsif self.sale_confirmed_date.present?\n self.sale_confirmed_date\n else\n DateTime.now\n end\n # No bid history at all may be a data issue,\n # but as far as we're concerned here, it's \n # 3 business days.\n if self.bid_histories.empty?\n self.three_business_days_later_inclusive(sale_date)\n # Kiosk winners get 3 days\n elsif self.high_bid_is_kiosk?\n self.three_business_days_later_inclusive(sale_date)\n # Next scenarios depend on bid type existing\n elsif self.bid_histories.first.bid_type.present?\n bid_type_code = self.bid_histories.first.bid_type.code\n # Live Auction winners / prelim-bid winners / \n # counter-bid (offline) / Buy Now winners / Sale Now \n # winners get 7 days (counting sale_date).\n if bid_type_code == BidType::AURORA_LIVE_BID_CODE || \n bid_type_code == BidType::AURORA_PRELIM_BID_CODE || \n bid_type_code == BidType::AURORA_BUY_NOW_CODE || \n bid_type_code == BidType::FIGS_SALE_NOW_CODE ||\n !self.current_buyer_also_high_bidder?\n sale_date + 6.days\n # Unknown code was received, per Karla they get 3\n # days. (todo: important enough to email us so we know?)\n elsif bid_type_code.present?\n logger.info(\"Unknown bid type received, code is: #{bid_type_code}\")\n self.three_business_days_later_inclusive(sale_date)\n # Code not present also gets the three (we should prevent\n # this scenario in the api, but you know, safety first)\n else\n logger.info(\"BidType.code not present on bid type of description: #{self.bid_histories.first.bid_type.description}\")\n self.three_business_days_later_inclusive(sale_date)\n end\n # All other scenarios get 3 business days\n # (so incomplete data scenarios will get 3 days).\n else\n self.three_business_days_later_inclusive(sale_date)\n end\n end",
"def get_current_bid\r\n self.get_current_ranking\r\n if self.bid.empty?\r\n return 0\r\n else\r\n return bid.last.value\r\n end\r\n end",
"def return_bike(station)\n station << @bike\n @bike=nil\n puts \"Person: I returned a bike\"\n #if you have a bike, you have to return it\n end",
"def set_bomb\n @bombed = true\n end",
"def bid\n\t\t\t\t\twhere(:reference_name => \"bid\").select('DISTINCT value')\n\t\t\t\tend",
"def bid\n\t\t# initialize all variables\n\t\t@user = current_user\n\t\t@bids = Bid.find(:all, :conditions => {:item_id => params[:item_id]}, :order => \"price DESC\")\n\t\t@item = Item.find(params[:item_id])\n\t\t@admin = User.find_by_login(\"admin\")\n\t\tprice = params[:bid_price]\n\t\tmoney = @user.money\n\n\t\t# cannot bid when auction is closed\t\t \n\t\tif @item.closed\n\t\t gflash :error => \"This auction is closed.\"\n\t\t# must put in price\n\t\telsif !price\n\t\t\tgflash :error => \"Price cannot be empty\"\n\t\telse\n\t\t\t# if theres bids before this bid\n\t\t\tif (@bids.count > 0)\n\t\t\t\t# get highest of the bids\n\t\t\t\t@highest = @bids.first\n\n\t\t\t\t# if this bid is less than the current highest one, error\n\t\t\t\tif price.to_f <= @highest.price\n\t\t\t\t\tgflash :error => \"Bid price must be greater than the current price of the item!\"\n\t\t\t\telsif (@bids.first.bidder.id == current_user.id)\n\t\t\t\t\t# if highest bidder is already the user trying to bid again\n\t\t\t\t gflash :error => \"Cannot outbid yourself!\"\n\t\t \telsif (money < price.to_f)\n\t\t\t\t\t# if the user cannot afford the bid\n\t\t\t gflash :error => \"You cannot afford to pay this\"\n\t\t\t\telse\n\t\t\t\t\t# new highest bidder, the user\n\t\t\t\t\t@highest_bid = @user.bids.build(:item_id => params[:item_id], :price => params[:bid_price])\n\t\t\t\t\t@highest_bid.save\n\n\t\t\t\t\t# deduct money from the user since he is currently highest bidder\n\t\t\t\t\t@user.money = @user.money - price.to_f\n\t\t\t\t\t@user.save\n\n\t\t\t\t\t# show pop up regarding bid success\n\t\t\t\t\tgflash :success => \"Bid success. You are now the highest bidder!\"\n\n\t\t\t\t\t# automatically replace the html to show the new highest bidder using ajax so\n\t\t\t\t\t# refreshing the page is not necessary, i.e. automatically update highest bidder box\n\t\t\t\t\trender :juggernaut => {:type => :send_to_all} do |page|\n\t\t\t\t\t \tpage.replace_html :highest_bid, :partial => 'items/highest_bid_price', :object => @highest_bid\n\t\t\t\t\t page.visual_effect :highlight, \"highest_bid_div\", :duration => 5\n\t\t\t\t\t page.replace_html \"search_page_#{@item.id}\", :partial => 'items/searched_bid_price', :object => @highest_bid\n\t\t\t\t\t page.visual_effect :highlight, \"search_page_#{@item.id}\", :duration => 5\n\t\t\t\t\tend\n\n\t\t\t\t\t# if someone was outbidded by the current bid\n\t\t\t\t\tif @highest.bidder.id != @highest_bid.bidder.id\n\t\t\t\t\t\t# send message to the previous highest bidder\n\t\t\t\t\t \t@message = @admin.sent_messages.build(:receiver_id => @highest.bidder.id, :description => \"You have been OUTBIDDED by <a href='/profile/#{@highest_bid.bidder.login}'>#{@highest_bid.bidder.login}</a> for <a href='items/show/#{@highest_bid.item.id}'>#{@highest_bid.item.name}</a>\")\n\t\t\t\t\t @message.save\t\n\t\t\t\t\t @hbidder = User.find(@highest.bidder.id)\n\t\t\t\t\t @hbidder.money = @hbidder.money + @highest.price\n\t\t\t\t\t @hbidder.save \n\t\t\t\t\t @unread_messages = Message.find(:all, :conditions => {:receiver_id => @highest.bidder.id, :unread => true})\n\t\t\t\t\t @num_unread = @unread_messages.count\n\t\t\t\t\t render :juggernaut => {:type => :send_to_client, :client_id => @highest.bidder.id} do |page|\n\t\t\t\t\t\t\tpage.insert_html :top, :main_content, :partial => 'base/outbidded_message', :object => @highest_bid\n\t\t\t\t\t\t\tpage.visual_effect :fade, :no_message, :duration => 2\n\t\t\t\t\t\t\tpage.replace :inbox_link, :partial => 'update_inbox_link', :object => @num_unread\n\t\t\t\t\t\t\tpage.insert_html :top, :messages, :partial => 'base/insert_message', :object => @message\n\t\t\t\t\t\t\tpage.visual_effect :highlight, \"message_#{@message.id}\", :duration => 5\n\t\t\t\t\t\tend\n\t\t\t\t\tend\n\t\t \tend\n\t\t\telse # if there are no other bids\n\t\t\t\tif price.to_f <= @item.start_price \n\t\t\t\t\t# if this bid is less than the current highest one, error\n\t\t\t\t\tgflash :error => \"Bid price must be greater than the current price of the item!\"\n\t\t\t\telsif money < price.to_f\n\t\t\t\t\t# if the user cannot afford the bid\t\n\t\t\t\t\tgflash :error => \"Cannot afford to bid with that price!\"\n\t\t\t\telse\n\t\t\t\t\t# since first one to bid, current bid is the highest\n\t\t\t\t\t@highest_bid = @user.bids.build(:item_id => params[:item_id], :price => params[:bid_price])\n\t\t\t\t\t@highest_bid.save\n\n\t\t\t\t\t# deduct money from the user since he is currently highest bidder\n\t\t\t\t\t@user.money = @user.money - price.to_f\n\t\t\t\t\t@user.save\n\n\t\t\t\t\t# show pop up regarding bid success\n\t\t\t\t\tgflash :success => \"Bid success. You are now the highest bidder!\"\n\n\t\t\t\t\t# automatically replace the html to show the new highest bidder using ajax so\n\t\t\t\t\t# refreshing the page is not necessary, i.e. automatically update highest bidder box\n\t\t\t\t\trender :juggernaut => {:type => :send_to_all } do |page|\n\t\t\t\t\t\tpage.replace_html :highest_bid, :partial => 'items/highest_bid_price', :object => @highest_bid\n\t\t\t\t\t\tpage.visual_effect :highlight, \"highest_bid_div\", :duration => 5\n\t\t\t\t\t\tpage.replace_html \"search_page_#{@item.id}\", :partial => 'items/searched_bid_price', :object => @highest_bid\n\t\t\t\t\t\tpage.visual_effect :highlight, \"search_page_#{@item.id}\", :duration => 5\n\t\t\t\t \tend\n\t\t\t\tend # end if price.to_f <= @item.start_price \n\t\t\tend # end if (@bids.count > 0)\n\t\tend # end if @item.closed\n\t\tredirect_to :controller => 'items', :action => 'show', :id => params[:item_id]\n\tend",
"def done_bidding? \n return player_size_and_nil_check(config[:bids])\n end",
"def release_bike\n empty?\n @bike_list.pop\n\n\n end",
"def lose!\n\t\t@bet = 0\n\tend",
"def current_buyer_also_high_bidder?\n # No bid history is sell now, which is essentially 'true'\n # as the buyer didn't cahnge\n return true if self.bid_histories.empty?\n # Let's get our high bidder's id\n high_bidder_id = self.bid_histories.first.member_id\n # Well... are they the same?\n high_bidder_id == self.member_id\n end",
"def max_bid\n bids.first\n end",
"def update_bid(user, new_bid)\r\n available_credits_for_update = (self.bid.last.value + user.credits)\r\n if new_bid > available_credits_for_update\r\n raise TradeException, \"Not enough money!\"\r\n elsif new_bid <= self.bid.last.value\r\n raise TradeException, \"You've already given a higher bid!\"\r\n else\r\n additional_credit_cost = (new_bid - self.bid.last.value)\r\n user.credits -= additional_credit_cost\r\n user.credits_in_auction += additional_credit_cost\r\n self.bid.last.value = new_bid\r\n self.invariant\r\n end\r\n end",
"def return_bikes\n fix_bikes\n @bikes\n end",
"def winner(bid)\n @bid = bid\n mail to: bid.manager.email, subject: 'You won your Sealed Bid!'\n end",
"def misses()\r\n\t\treturn @bad_guesses\r\n\tend",
"def backer?\n bounties.count > 0\n end",
"def borrowed\n self.decrement!(:availability)\n end",
"def fake_error_holdings\n fake_holding = Holding.new\n fake_holding.collection.display_label = \"Error fetching holdings!\"\n return [fake_holding]\n end",
"def take_bet(bet_amt)\n\t\traise PokerError if bet_amt > bankroll \n\t\t\n\t\t@bankroll -= bet_amt\n\t\t@net_winnings -= bet_amt\n\tend",
"def test_get_nonexisting_bookmark\n bm = @bs.get_bookmark(15000)\n assert(bm.errors.count > 0)\n end",
"def can_double_bet\n return 1 unless @bankroll < @bet\n return nil\n end",
"def release_bike\n fail \"no bikes docked\" if empty?(@docked_bikes)\n @docked_bikes.pop\n end",
"def set_bid_item\n @bid_item = BidItem.find(params[:id])\n end",
"def set_bid\n @bid = Bid.find params[:id]\n end",
"def tie_with_bj\n self.chips += self.bet_chips\n self.is_complete = true\n \"#{name} hit Blackjack! Dealer hit Blackjack too. Push for #{name}.\"\n end",
"def guest_buys_from_bar(guest, baritem)\n if guest.money > baritem.price\n date = Date.today.to_s.reverse\n\n guest.add_bar_item_to_guest_visit(date, baritem)\n\n guest_pays_bar(guest, baritem)\n\n end\n end"
] |
[
"0.6487028",
"0.6323811",
"0.6147629",
"0.6105298",
"0.6056604",
"0.6041588",
"0.59762716",
"0.5968541",
"0.5896258",
"0.5883508",
"0.58788943",
"0.5874227",
"0.5859775",
"0.583372",
"0.57465434",
"0.5743956",
"0.57323456",
"0.5723878",
"0.5690312",
"0.56802124",
"0.56180745",
"0.5616552",
"0.5615906",
"0.5605749",
"0.5603973",
"0.5596443",
"0.5591127",
"0.5581959",
"0.5577229",
"0.5572394",
"0.5567339",
"0.5567339",
"0.55530715",
"0.55477506",
"0.554244",
"0.5505683",
"0.5499258",
"0.5494787",
"0.5489408",
"0.5489194",
"0.54736155",
"0.54613113",
"0.5459665",
"0.5448899",
"0.54428303",
"0.54428303",
"0.53991777",
"0.5399094",
"0.5390358",
"0.53828174",
"0.537166",
"0.53646004",
"0.53581274",
"0.53543836",
"0.5340047",
"0.53375393",
"0.5320567",
"0.53159475",
"0.53097045",
"0.5307939",
"0.52884364",
"0.52828306",
"0.52805376",
"0.5278886",
"0.5277105",
"0.5276666",
"0.5276666",
"0.5276666",
"0.5276666",
"0.5276666",
"0.5276666",
"0.52758",
"0.52730453",
"0.52727264",
"0.5267761",
"0.52525425",
"0.524916",
"0.5223089",
"0.5216304",
"0.52153224",
"0.52106994",
"0.520992",
"0.52093166",
"0.5204453",
"0.5180348",
"0.5179244",
"0.5167269",
"0.5163685",
"0.5157295",
"0.5148478",
"0.51342636",
"0.51331794",
"0.51251125",
"0.5124097",
"0.5123571",
"0.51197237",
"0.51190746",
"0.51163536",
"0.51140314",
"0.51130027"
] |
0.67868507
|
0
|
A player gets 1 point for every trick taken. Getting your bid gives you an automatic 10 bonus points.
|
def hand_score
score = self.tricks
if !self.got_set
score += 10
end
return score
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def won_with_points\n self.chips += 2 * self.bet_chips\n self.is_complete = true\n \"#{name}'s point is bigger than dealer! #{name} get extra one bet. Win for #{name}\"\n end",
"def bid\n return starting_bid unless prev_bid\n if prev_bid.total >= all_dice_count/(2*expected_prob) && prev_bid.total > dice_count_of_bid\n puts comment\n LiarsDice::BS.new\n elsif prev_bid.total < magic_number && magic_number < all_dice_count\n LiarsDice::Bid.new(magic_number, prev_bid.face_value)\n else\n if prev_bid.face_value == 6 && (prev_bid.total+1) < all_dice_count/(2*expected_prob)\n LiarsDice::Bid.new(prev_bid.total+1, most_bid)\n elsif prev_bid.face_value < 6 && (prev_bid.total+1) < all_dice_count/(2*expected_prob)\n LiarsDice::Bid.new(prev_bid.total, prev_bid.face_value+1)\n else\n LiarsDice::BS.new\n end\n end\n end",
"def points\n deal_points = tricks_points @tricks\n\n if not deal_points.inside? bid_said_by_team\n deal_points.add_points_to(bid_said_by_team, MatchPoints::VALAT_BONUS) if valat?\n\n if not @mode.is_a? DoubleMode\n @mode.match_points deal_points\n else\n Points.zeros[bid_said_by_team] = doubling_points deal_points, @mode\n end\n elsif deal_points.inside? bid_said_by_team\n deal_points.add_points_to(opposing_team, MatchPoints::VALAT_BONUS) if valat?\n\n Points.zeros[opposing_team] = doubling_points deal_points, @mode\n elsif deal_points.hanging?\n if not @mode.is_a? DoubleMode\n @mode.match_points deal_points\n else\n doubled_points = doubling_points deal_points, @mode\n\n result = Points.zeros\n result[bid_said_by_team] = doubled_points / 2\n resutl[opposing_team] = doubled_points / 2\n\n result\n end\n end\n end",
"def bid\n BigDecimal Fyb.public.ticker.perform.parse['bid'], 2\n end",
"def tie_with_points\n self.chips += self.bet_chips\n self.is_complete = true\n \"#{name}'s point is same as dealer! Push for #{name}.\"\n end",
"def possible_bonus!\n return unless rand <= BONUS_PROBABILITY\n @game.bonuses << Bonus.random_bonus(@pos_x, @pos_y, @game)\n end",
"def get_bid_increments\n result = [\n self.current_asking_price * 0.1,\n self.current_asking_price * 0.2,\n self.current_asking_price * 0.4,\n self.current_asking_price * 0.6\n ]\n return result.map {|num| num.round(2)}\n end",
"def individual_bet(player)\n if $Counting_Mode\n print counting_recommended_bet(player)\n print \"You have $#{player.wallet}. \"\n else\n print \"#{player.name}, you have $#{player.wallet}. \"\n end\n\n bet = get_int_input \"How much would you like to wager? $\"\n\n if bet < @table_minimum\n linebreak\n puts \"You must bet at least the minimum bid of $#{@table_minimum}.\"\n individual_bet(player)\n elsif bet > player.wallet\n linebreak\n puts \"You cannot bet more than you have left in your wallet.\"\n individual_bet(player)\n else\n player.wallet -= bet\n player.current_bet = bet\n end\n end",
"def power_bonus(att_id)\n\t\t\t@cid = att_id\n\t\t\tpb = Rollem.new\n\t\t\t@att_bonus = pb.rollspread(19,23)\n\t#\t\tputs \" #{@gladiator[@cid]} for slot #{@att_bonus} has an attack bonus of #{@stat[@cid][@att_bonus]} a #{@stat_name[@cid][@att_bonus]} \"\t\n\t\t\tputs \" \"\n\t\tend",
"def bet\n if $Counting_Mode\n puts shoe_count\n puts counting_recommendation\n linebreak\n end\n @players.each{ |p|\n individual_bet(p)\n }\n end",
"def record_won_ball!\n @points += 1\n return @points\n end",
"def record_won_ball!\n @points += 1\n return @points\n end",
"def update_points(dealer_cards, player_cards, no_of_games = 0, points = [0, 0])\n player = 0\n dealer = 1\n result = detect_result(dealer_cards, player_cards)\n case result\n when :player_busted\n points[dealer] += 1\n when :dealer_busted\n points[player] += 1\n when :player\n points[player] += 1\n when :dealer\n points[dealer] += 1\n end\n\n points\nend",
"def record_won_ball!\n @points += 1\n end",
"def record_won_ball!\n @points += 1\n end",
"def record_won_ball!\n @points += 1\n end",
"def record_won_ball!\n @points += 1\n end",
"def record_won_ball!\n @points += 1\n end",
"def record_won_ball!\n @points += 1\n end",
"def record_won_ball!\n @points += 1\n end",
"def record_won_ball!\n @points += 1\n end",
"def give_bonus player\n player.add_1_life\n end",
"def addBlinds()\n s_blind_loc = get_next_player(self.dealer) # location of small blind player\n b_blind_loc = get_next_player(s_blind_loc) # location of big blind player\n # get player data for small and big blind locations\n s_blind_player = get_player(s_blind_loc) # actual players to change money\n b_blind_player = get_player(b_blind_loc)\n # put money from small and big blind players into pot\n put_money(self.small_blind, s_blind_player)\n put_money(self.big_blind, b_blind_player)\n self.current_player = get_next_player(b_blind_loc)\n b_blind_player.save\n s_blind_player.save\n self.save\n end",
"def record_won_ball!\n @points +=1\n end",
"def bid\n @auction = Auction.find(params[:auction_id])\n @reward = Reward.find(params[:reward_id])\n @hours_already_bid = @reward.hours_already_bid_by(current_user)\n @hours_entry = HoursEntry.new\n @bid = Bid.new\n end",
"def pay_blinds\n @dealer.pay(@game.small_blind)\n @under_the_gun.pay(@game.big_blind)\n end",
"def points\n made? ? (made_contract_points + overtrick_points + bonus) : undertrick_points\n end",
"def minimal_allowed_bid\n if self.winner_bid.positive?\n (self.winner_bid * MINIMAL_INCREASE_BID).to_i\n else\n self.minimal_bid\n end\n end",
"def tie_with_bj_insurance\n self.chips += 3 * self.bet_chips\n self.is_complete = true\n \"Dealer hit Blackjack. #{name} hit Blackjack too! A push for #{name}.\n #{name} bought an insurance. Pay 2 times of insurance.\"\n end",
"def tie_with_bj\n self.chips += self.bet_chips\n self.is_complete = true\n \"#{name} hit Blackjack! Dealer hit Blackjack too. Push for #{name}.\"\n end",
"def dodge_bonus(target) \n\t\t\t@target = target\n\t\t\t@dgb = @def_dodge.sample\n\t\t\tputs \" \"\n\t#\t\tputs \"dodge_bonus slot #{@dgb} is #{@stat_name[@target][@dgb]} -- rating #{@stat[@target][@dgb]} for #{@gladiator[@target]}\"\n\t\tend",
"def call_bet\r\n call_amount = @table.current_bet\r\n (padding,pronoun) = self.is_a?(User) ? [30,\"You\"] : [33,\"Player ##{player_id+1}\"]\r\n puts \"\\n%#{padding}s\\n\" % \"#{pronoun} called $#{call_amount}.\"\r\n @table.add_player_bet(self, call_amount)\r\n end",
"def gain_points\n @score += 1\n end",
"def won_trick(player)\n update_in(:tricks, player) {|n| n + 1 }\n end",
"def wonky_coins(n)\n\nend",
"def process_picks()\n\tsession[\"round_winner\"] = round_win(session[\"p1_pick\"], session[\"p2_pick\"])\n tally_score(session[\"round_winner\"])\n session[\"game_winner\"] = the_winner(session[\"p1_total_score\"], session[\"p2_total_score\"])\nend",
"def give_point\n if@current_player == @player1\n @p1_score += 1\n else\n @p2_score += 1\n end\nend",
"def set_bets\n\n if player.chips == 0\n puts \"I'm sorry you run out of chips, maybe next time\"\n exit\n end\n\n puts \"#{player.name} you have a total of #{player.chips} chips\"\n puts \"how many would you like to bet\"\n answer = gets.chomp.to_i\n while answer < 0 || answer > player.chips\n set_bets\n end\n player.chips -= answer\n player.bet = answer\n\n end",
"def sell_bonus\n bonus = 0.0\n battle_members.each { |member| bonus += member.sell_bonus }\n bonus\n end",
"def place_bet(player, amount)\n raise Exceptions::NotEnoughChips if player.chips < amount\n @pot += amount\n player.chips -= amount\n end",
"def make_bet\n players.map { |p| p.bet(BET_SIZE) }.sum\n end",
"def bid(item, amount)\r\n if can_bid?(item, amount)\r\n previous_winner = item.current_winner\r\n previous_max_bid = item.highest_bid.nil? ? 0 : item.bidders[previous_winner]\r\n\r\n item.bidders[self] = amount\r\n\r\n # reduce money if user is new winner, otherwise nothing happens\r\n current_winner = item.current_winner\r\n current_max_bid = item.bidders[current_winner]\r\n\r\n previous_winner.credits += previous_max_bid unless previous_winner.nil?\r\n current_winner.credits -= current_max_bid\r\n#Do not always send mail for demo purposes\r\n=begin\r\n if !previous_winner.nil? && previous_winner != current_winner\r\n # we got a new winner\r\n\r\n Security::MailDispatcher.send_new_winner_mail(previous_winner.email, item) unless [nil, \"\"].include?(previous_winner.email)\r\n end\r\n=end\r\n else\r\n raise TradeError, \"INVALID_BID\" #Bid is too small or already exists or user doesn't have enough money.\r\n end\r\n end",
"def counting_recommended_bet(player)\n count = @shoe.count\n if count <= 1\n bet = player.min_bet\n elsif count <= 10\n bet = player.min_bet + player.betting_unit * count\n else\n bet = player.min_bet + player.betting_unit * 10 + (player.betting_unit * (count/3))\n end\n \"#{player.name}, your recommended bet is $#{bet}. \"\n end",
"def play\n 2.times {deal}\n blind_score\n if player_hand.collect{|x| x.value}.inject(:+) == 21\n bjwin\n elsif computer_hand.collect{|x| x.value}.inject(:+) == 21\n bjlose\n else\n action\n end\n end",
"def get_current_bid\r\n self.get_current_ranking\r\n if self.bid.empty?\r\n return 0\r\n else\r\n return bid.last.value\r\n end\r\n end",
"def process_won_bets\n return unless @bet.won?\n # calculate_amount is profit in case of win and in case of refund or loss it will be stake\n # TODO : Need Transaction here\n amount = calculate_amount\n amount = Wallets::Base.new(wallet).credit(amount + @bet.stake)\n wallet.ledgers.create(arguments_of_bets) unless amount.zero?\n end",
"def get_and_record_bet(count)\n \t@bet = 1\n \tif @chip_count < @bet && !ALLOW_NEGATIVE\n \t\traise \"Not enough chips to bet\"\n \telse \n \t\t@chip_count = @chip_count - @bet\n \tend\n \t\n \t@bet\n end",
"def current_bid\n if bids.count == 0\n return 0\n else\n bids.order(bid_price: :desc).first.bid_price\n end\n end",
"def bid\n @auction = Auction.find(params[:auction_id])\n @reward = Reward.find(params[:reward_id])\n @points_already_bid = current_user ? @reward.points_already_raised_by(current_user) : 0\n @donation = Donation.new\n @program = @auction.program\n @karma_page = false\n\n if @program\n @org = @program.organization\n @profile_fields = Profile.profile_fields(current_user, @org)[@org.url] # current_user could be nil\n if @program.auction_type == \"fixed\"\n @opportunities = Profile.fixed_opportunities_for(@org)\n @nonprofit = @org.nonprofits.first\n end\n end\n\n if current_user\n @current_karma = total_karma_for(current_user)\n else\n @current_karma = 0\n end\n\n if current_user && current_user.stripe_cus_id && !@org\n Stripe.api_key = ENV['STRIPE_SECRET_KEY']\n begin\n customer = Stripe::Customer.retrieve(current_user.stripe_cus_id)\n @default_card = customer.sources.retrieve(customer.default_card)\n rescue\n # If a similar Stripe object exists in live mode, but a test mode key was used to make this request.\n @default_card = nil\n end\n end\n end",
"def convert_tricks_to_points\n trick_scores.each do |team, tricks_count|\n points[team] += tricks_count * POINTS_PER_TRICK;\n end\n\n scoreboard.reset_trick_scores\n end",
"def help_HowManyPoints\n puts \" You need to have 1500 or more points to win the game.\"\n pressToContinue\n end",
"def bid\n bid_params = params.permit(:id, :bid_or_pass, :tricks_count, :trump_suit)\n game = Game.find(bid_params[:id])\n if bidder_has_passed?(bid_params)\n PassBid.new(game).call\n elsif bidder_has_made_bid?(bid_params)\n MakeBid.new(game, bid_params[:tricks_count], bid_params[:trump_suit]).call\n end\n\n redirect_to game\n end",
"def add_points(result)\n if result == \"win\"\n @points += 1\n end\n end",
"def get_bets(bet)\n\t\t#loop through ai players\n\t\t#random numbers generated in if statements create\n\t\t#the illusion of free will\n\t\tfor i in 1...@num_players\n\t\t\t#check if player has enough money and has not folded\n\t\t\tif bet <= @players[i].bank and !@players[i].folded then\n\t\t\t\t#if player has a high rank\n\t\t\t\tif @players[i].ranks[0] < 8 or rand(0..1) == 1 then\n\t\t\t\t\t@players[i].set_bet(bet)\n\t\t\t\t#if player has a pair of quite high value\n\t\t\t\telsif (@players[i].ranks[0] == 8 and @players[i].subranks[0] > 9) or rand(0..1) == 1 then\n\t\t\t\t\t@players[i].set_bet(bet)\n\t\t\t\t#bluff\n\t\t\t\telsif rand(0...10) == 1 then\n\t\t\t\t\t@players[i].set_bet(bet)\n\t\t\t\telse\n\t\t\t\t\t@players[i].fold\n\t\t\t\tend\n\t\t\telse\n\t\t\t\t#puts \"fold #{i}\"\n\t\t\t\t@players[i].fold\n\t\t\tend \n\t\tend\n\tend",
"def place_your_bets\n # Check to see if we need to ask for bet sizes\n if @num_rounds == 0 or need_bet_change or @io.change_bet_sizes\n @io.get_players_bet_sizes(@players, @min_bet, @max_bet, @bet_increment)\n end\n\n for player in @players\n player.start_hand\n end\n end",
"def test(points, r1, r2)\n points = points.map do |pair, response|\n [response[:asks][0][\"price\"], response[:bids][0][\"price\"]]\n end.flatten\n\n puts \"UEBU correct\" if r1 == 1000 / points[0] * points[3] * points[5]\n puts \"UBEU correct\" if r2 == 1000 / points[4] / points[2] * points[1]\n end",
"def add_points(points)\n @correct_answers += 1\n @points += points\n end",
"def set_bid(player_on_position, bid)\n raise ArgumentError, \"invalid bid #{bid}\" unless ALL_BIDS.include? bid\n # raise ArgumentError, \"impossible bid #{bid}\" unless possible_bids.include? bid\n\n if bid == :pass\n @pass_count += 1\n return\n end\n\n if @won_bid.nil? and [:double, :redouble].include? bid\n raise ArgumentError, \"doubling nothing: #{bid}\"\n end\n\n if bid == :double\n @is_double = true\n @bid_said_by = player_on_position\n elsif bid == :redouble\n @is_double = false\n @is_redouble = true\n @bid_said_by = player_on_position\n else\n @won_bid = bid\n @bid_said_by = player_on_position\n clear_doubling\n end\n\n @pass_count = 0\n end",
"def get_point\n @right_answers += 1\n end",
"def calculate_player_points\n # Sort the teams by points in descending order. This way, the output will\n # follow the teams' finishing order, which will be easier to read.\n @teams.sort_by(&:points).reverse_each do |team|\n puts \"Awarding #{team.points} points to #{team.name}: \" +\n @players[team.id].map(&:to_s).join(\", \")\n\n @players[team.id].each do |player|\n player.points = team.points\n end\n end\n end",
"def points() \n\t\t(self.wins()*3+self.draws()) \n\tend",
"def record_won_ball!\n @points += 1\n win?\n end",
"def add_multiple_points(player)\n end",
"def gain_point\n @score += 1\n end",
"def win_or_bust(player)\n total = player.calculate_total\n \n if total == 21\n player_wins(player)\n elsif total > 21\n player_busts(player)\n end\nend",
"def send_bonus!(amt)\n mturk_bonus_assignment(self.mturk_assignment_id, self.mturk_worker_id, amt)\n self.update_attributes(:bonus => amt)\n end",
"def masterwork_prob_bonus; 0; end",
"def total_points\n if self.has_paid?\n sum = 0\n self.bets.each { |b| sum+=b.points }\n self.answers.each { |a| sum+=a.points }\n sum\n else\n -1\n end\n end",
"def take_bets\n @players.each do |p|\n @events.handle(:pre_player_bet, p)\n\n p.hand.bet = p.place_bet\n\n @events.handle(:post_player_bet, p, p.hand.bet)\n end\n end",
"def record_won_ball!\n # Check to see if a win-point results in a win-game outcome. \n if @points > 3 && @points >= @opponent.points + 2\n @game_points += 1\n \n record_won_game!\n reset_points\n\n else\n @points +=1 \n end \n end",
"def fives2(dice)\n # this gets the number of fives\n fives = get_by_number(dice)[5]\n points = 0\n if fives == 1\n points = 50\n elsif fives == 2\n points += 100\n end\n points\n end",
"def train\n @badasspoints += 1\n end",
"def next_round\n offer_tip\n guess = @players[APlayer::CODE_BREAKER].get_guess\n @logic.analyze_guess(guess)\n @guess_results.push({:guess => guess, :whites => @logic.whites, :blacks => @logic.blacks, :guesses => guess_no})\n @players[APlayer::CODE_BREAKER].increase_won_times if @logic.guess_correct?\n @players[APlayer::CODE_BREAKER].analyse_last_guess(guess, @logic.whites, @logic.blacks)\n nil\n end",
"def display_points(some_points)\n puts (\"Total Points: #{@player_points}\")\n end",
"def bust\n if player.score > 21 || dealer.score > 21\n puts \"---------------BUST!---------------\"\n show_hand\n play_again\n end\n end",
"def wins_ball(winner)\n # TODO: Think it's gross to pass an integer instead of a player object?\n # Then reimplement this method!\n winner.points += 1\n end",
"def multiplier_score(times)\n puts \"Your bonus score: #{@score*times}\"\n end",
"def help_ExamplePoints\n puts \" Throw Score\"\n puts \"--------- ------------------\"\n puts \"5 1 3 4 1 50 + 2 * 100 = 250\"\n puts \"1 1 1 3 1 1000 + 100 = 1100\"\n puts \"2 4 4 5 4 400 + 50 = 450\"\n pressToContinue\n end",
"def points\n 1\n end",
"def bayesian_rank\n\n #this is an ad hoc value, which basically represents the minimum number of \n #votes we think an Idea should have before it's even considered relevant. \n #eventually this value will come from the admin screen\n @magic_number_of_votes = 0.5\n\n @return_value = ((@magic_number_of_votes*Idea.average_rank_of_all_ideas.to_f)+(self.count_of_users_ranked*self.average_rank.to_f))/(@magic_number_of_votes+self.count_of_users_ranked)\n\n if @return_value == 0\n return 10\n else\n return @return_value.round(2)\n end\n\nend",
"def get_bet\n @bet = @player.make_bet\n end",
"def frame_bonus\n return 0 if last_frame?\n \n case\n when strike?\n if next_frame.last_frame? # last frame, add first two elements\n next_frame.first_two \n elsif next_frame.strike? # next frame is a strike, add 'next-next' element\n next_frame.roll_1 + next_frame.next_frame.roll_1\n else\n next_frame.first_two \n end\n when spare?\n next_frame.roll_1\n else\n 0 # no bonus\n end\n end",
"def point_won_by(player)\n case player\n when player1 then active_set.increment(player: 1)\n when player2 then active_set.increment(player: 2)\n end\n end",
"def rally\n\t\t\tnum = rand(1..20)\n\t\t\trally_case = game_action(num)\n\t\t\tcase rally_case\n\t\t\t\twhen \"oob\" \n\t\t\t\t\tputs \"oo-oo-oo-oo-oo #{$hitter} hit the ball out of bounds oo-oo-oo-oo-oo\"\n\t\t\t\t\t@current_game.wins_ball($def_num)\n\t\t\t\t\tself.game_stats\n\t\t\t\t\n\t\t\t\twhen \"miss\"\n\t\t\t\t\tputs \"mmmmmmm #{$defender} missed the ball! mmmmmmmmmm\"\n\t\t\t\t\t@current_game.wins_ball($hit_num)\n\t\t\t\t\tself.game_stats\n\t\t\t\t\t\n\t\t\t\twhen \"net\"\n\t\t\t\t\tputs \"############ #{$hitter} hit the net. ############\"\n\t\t\t\t\t@current_game.wins_ball($def_num)\n\t\t\t\t\tself.game_stats\n\t\t\t\t\t\n\t\t\t\twhen \"hit\"\n\t\t\t\t\tputs \"^o^o^o^o^o^ #{$defender} returns the ball ^o^o^o^o^o^\"\n\t\t\t\t\tputs \" \"\n\t\t\t\t\thitter($hitter)\n\t\t\t\n\t\t\t\telse\n\t\t\t\t\tputs \"#{rally} Error!!!\"\n\t\t\t\tend\n\t\t\t\t\n\t\t\tend",
"def double_player(player)\n player.bet *= 2\n end",
"def bottle_redeem(num_bottles)\n\tnum_bottles/2\nend",
"def hit\n player.hit!(deck)\n puts \"[#{player.dealt.last}] Total: #{player.score}.\"\n puts \"Dealer: [#{dealer.dealt[1]}]\"\n end",
"def blind_score\n p_score = player_hand.collect{|x| x.value}.inject(:+)\n c_score = computer_hand.collect{|x| x.value}.inject(:+)\n puts \"You have #{player_hand.collect{|x| \"#{x.face}#{x.suit}\"}.join(\" & \")}, for a total of #{p_score}\"\n puts \"The computer has #{computer_hand[1].face}#{computer_hand[1].suit} & [#]\"\n puts \" \"\n end",
"def wins_point(winner)\n \n if winner == @player1\n @player1.record_won_ball!\n @score_counter += 1\n return @player1.points\n else\n @player2.record_won_ball!\n @score_counter += 1\n return @player2.points\n end\n # TODO: Think it's gross to pass an integer instead of a player object?\n # Then reimplement this method!\n end",
"def place_double_bet(amount)\n hand = @hands[@current_hand]\n hand.bet += amount\n @total_money -= amount\n end",
"def win_pts\n self.score += 1\n end",
"def points\n points_by_round = [nil, 3, 5, 8, 13, 21, 34]\n points_by_round[@game.round] + @winner.seed\n end",
"def betting_round()\n puts \"\\n\\n\\n#### THERE WE BEGIN ####\\n\\n\"\n\n # Dealer gets 2 cards, we could do dealing cards in round-robin, but thats just additional work, doesnt really matter, just an extra block of code\n @dealer.push_card(0,get_card)\n @dealer.push_card(0,get_card)\n puts \"*************** DEALER CARDS [#{@dealer.hands[0].get_card(0)}] [__] *********************\" # {@dealer.hands[0].cards[1]}\n\n # get players bets & then give them 2 cards\n # TODO if player bets 0 or less, maybe exit them from the game? code is short, just puts \"PLAYER exiting\" and delete it from the @players array\n @players.each do | player|\n #player.hands[0].cards = [get_card, get_card] # give player 2 cards\n player.push_card(0,get_card)\n player.push_card(0,get_card)\n player.print_hand(0)\n while (player.get_bet(0) <= 0 or player.get_bet(0) > player.amount)\n print \"Player #{player.player_number}, enter bet amount between 1 & #{player.amount} : \"\n player.set_bet(0,gets.to_i) # get a bet from player which he can afford\n end\n #player.amount = player.amount - player.hands[0].bet # reduce player's available amount by bet amount\n player.modify_account(player.get_bet(0),-1)\n player.print_Player # print player\n puts \"\"\n end # end for each player\n puts \"=================================================================\"\n end",
"def award_bonus(winner,loser,dealer)\n if @scores.include?(winner)\n @scores[winner] += @bonus*Scoring::P_BONUS\n share_count = loser.length\n if share_count>1 then share_count += (@mode==3 ? 1 : 0) end\n bonus_paym = (@bonus*Scoring::P_BONUS)/share_count\n loser.each do |l|\n if @scores.include?(l)\n @scores[l] -= bonus_paym\n else\n printf \"Error: \\\"%s\\\" not in current list of players\\n\", l\n end\n end\n @bonus = 0 if not dealer\n @scores[winner] += @riichi*Scoring::P_RIICHI\n @riichi = 0\n return true\n else\n printf \"Error: \\\"%s\\\" not in current list of players\\n\", winner\n return false\n end\n end",
"def find_my_ballots\n round = 1\n self.candidates.each do |cand|\n binding.pry\n puts\" __________________________________________________________________ \"\n puts\"| |\"\n puts\"| Round ##{round} |\"\n puts\"| #{cand.level_of_governments} |\"\n puts\"|__________________________________________________________________|\"\n puts\" __________________________________________________________________ \"\n puts\" \"\n puts\" You Voted For: \"\n puts\" \"\n puts\" #{cand.name} \"\n puts\" \"\n puts\" State: #{cand.state} \"\n puts\" Party: #{cand.party} \"\n puts\" Age: #{cand.age} \"\n puts\" Level of Government: #{cand.level_of_governments} \"\n puts\"__________________________________________________________________\"\n round += 1\n end\n end",
"def gain_a_point\n\n self.score += 1\n\n end",
"def get_tip\n (meal * tip) / 100\n end",
"def adjourn_points_manoend(player)\r\n carte_num = 0\r\n points_info = @points_curr_segno[player.name]\r\n denari_arr = [] # array of denari using index\r\n @log.debug \"Cards taken by #{player.name}: #{@carte_prese[player.name].join(\",\")}\"\r\n @carte_prese[player.name].each do |card|\r\n carte_num += 1\r\n if @deck_information.get_card_segno(card) == :D\r\n ix = @deck_information.get_card_rank(card)\r\n # carta di denari\r\n denari_arr << ix\r\n end\r\n if @deck_information.get_card_logical_symb(card) == :set and \r\n @deck_information.get_card_segno(card) == :D\r\n # 7 bello onore\r\n points_info[:setbel] = 1\r\n end\r\n end\r\n points_info = @points_curr_segno[player.name]\r\n # cards points\r\n if carte_num > 20\r\n points_info[:carte] = 1\r\n elsif carte_num == 20\r\n points_info[:carte] = 0\r\n end\r\n # spade points\r\n if denari_arr.size == 5\r\n points_info[:denari] = 0\r\n elsif denari_arr.size > 5\r\n points_info[:denari] = 1\r\n end\r\n #napula\r\n if @game_opt[:vale_napola]\r\n points_info[:napola] = calc_napula_points(denari_arr)\r\n else\r\n points_info[:napola] = 0\r\n end\r\n #calculate total\r\n tot = 0\r\n points_info.each do |k,v|\r\n next if k == :tot\r\n tot += v\r\n end\r\n points_info[:tot] = tot\r\n end",
"def dealer_hit\n # puts \"Dealer has #{@dealer.total}\"\n @dealer.hit until @dealer.total > 16\n # puts \"Dealer has #{@dealer.total}\"\nend",
"def min_next_bid_amount\n highest_bid_value = self.highest_bid.bid_amount \n if highest_bid_value.present? \n highest_bid_value+highest_bid_value*0.05\n else\n self.cost\n end\n end"
] |
[
"0.6678229",
"0.66671795",
"0.6557542",
"0.6357201",
"0.631796",
"0.6284298",
"0.62798786",
"0.61599845",
"0.6157859",
"0.613869",
"0.61082053",
"0.61082053",
"0.60540015",
"0.6048455",
"0.6048455",
"0.6048455",
"0.6048455",
"0.6048455",
"0.6048455",
"0.6048455",
"0.6048455",
"0.60333425",
"0.6027973",
"0.60116",
"0.6009182",
"0.6003474",
"0.5995637",
"0.5980576",
"0.5968463",
"0.5955338",
"0.59394073",
"0.593757",
"0.59293556",
"0.59249",
"0.5909042",
"0.590165",
"0.58975786",
"0.5893492",
"0.58740604",
"0.5865949",
"0.58627355",
"0.5851243",
"0.58347577",
"0.5823379",
"0.5808547",
"0.5806918",
"0.5803339",
"0.5801565",
"0.5800142",
"0.57977253",
"0.5786937",
"0.5775819",
"0.57758015",
"0.5753401",
"0.57502735",
"0.5745037",
"0.57402843",
"0.57396555",
"0.5732705",
"0.5731976",
"0.57266045",
"0.57265717",
"0.5719287",
"0.57161415",
"0.5700593",
"0.5689968",
"0.5678103",
"0.56683415",
"0.5665109",
"0.565621",
"0.56556666",
"0.56549656",
"0.5653799",
"0.5652507",
"0.56512684",
"0.56408453",
"0.5619845",
"0.5619607",
"0.56156546",
"0.56073534",
"0.56040084",
"0.55988276",
"0.55983984",
"0.55968934",
"0.5584709",
"0.55819833",
"0.5577084",
"0.55736923",
"0.55733895",
"0.55726725",
"0.5570898",
"0.5565884",
"0.5565133",
"0.55574954",
"0.55571306",
"0.554848",
"0.55393595",
"0.55388385",
"0.5534216",
"0.55335194"
] |
0.5595402
|
84
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.