query_id
stringlengths 32
32
| query
stringlengths 7
6.75k
| positive_passages
listlengths 1
1
| negative_passages
listlengths 88
101
|
---|---|---|---|
6e11562152a097972dc6410e3f2ca475 | Returns the value of attribute if_not_exists | [
{
"docid": "d6308b124b17090163a45d82e6c4035f",
"score": "0.7122428",
"text": "def if_not_exists; end",
"title": ""
}
] | [
{
"docid": "d224e140668d24cbfbddbada7c5d0ae6",
"score": "0.6851578",
"text": "def if_not_exists=(_); end",
"title": ""
},
{
"docid": "d376224c20e09a1ce7722e14974b3c0d",
"score": "0.64880866",
"text": "def does_not_exist!\n @exists = false\n false\n end",
"title": ""
},
{
"docid": "e0c0dc14f7b71149c2b5583675459758",
"score": "0.6281284",
"text": "def may_not_be_set(attribute)\n value = model.send(attribute)\n if value.blank?\n \"#{attribute.capitalize} not specified\"\n else\n value\n end\n end",
"title": ""
},
{
"docid": "bccb3693e1dce6dd839a2d9d3e677553",
"score": "0.6266813",
"text": "def set_attribute_unless_exists name, value\n set_attribute name, value unless @attributes.key? name\n nil\n end",
"title": ""
},
{
"docid": "3180f7b1c1d5fce97a670173c2e66172",
"score": "0.6250655",
"text": "def ignore_if_not_exists; end",
"title": ""
},
{
"docid": "0af151b5a188433d4d9d355c04e6c8d8",
"score": "0.6191774",
"text": "def attibute_exists_and_is_not_blank?(attribute)\n respond_to?(attribute) && !instance_variable_get(\"@#{attribute}\").blank?\n end",
"title": ""
},
{
"docid": "701de2ba3179aff2304c63c502299a50",
"score": "0.60793716",
"text": "def has_attribute?(key)\n !! attributes[key]\n end",
"title": ""
},
{
"docid": "fb867fc0fa006c95bf9472737c7e2281",
"score": "0.60430676",
"text": "def is_attribute?\n false\n end",
"title": ""
},
{
"docid": "b29df00539741b18d13f440162a09f45",
"score": "0.5974582",
"text": "def attribute?\n false\n end",
"title": ""
},
{
"docid": "830071ca8ecdce6716d5c7520f02050d",
"score": "0.5950379",
"text": "def attribute_missing?(name)\n return (!self.fields.keys.include?(name))\n end",
"title": ""
},
{
"docid": "a8e37689e9c924ff1443533ba8d82b73",
"score": "0.5950185",
"text": "def not_found?\n @not_found\n end",
"title": ""
},
{
"docid": "a8e37689e9c924ff1443533ba8d82b73",
"score": "0.5950185",
"text": "def not_found?\n @not_found\n end",
"title": ""
},
{
"docid": "ec47e64b39fa7480a55b92655045a81a",
"score": "0.59281087",
"text": "def safe_attr(obj, attr)\n obj.try(attr).presence || \"0\"\n end",
"title": ""
},
{
"docid": "ad0aa4ed97207bc5da87a23f4db3dbfa",
"score": "0.5873431",
"text": "def attribute_value(attribute_name)\r\n assert_exists\r\n @element.get_attribute(attribute_name) || ''\r\n end",
"title": ""
},
{
"docid": "dff14bbea7f5b6a15735f86fb1162f61",
"score": "0.5871535",
"text": "def n_attribute\n return nil\n end",
"title": ""
},
{
"docid": "e99c9dd678e880763c7e15bad59456ff",
"score": "0.5836229",
"text": "def has_attribute?(name)\n !attr(name).nil?\n end",
"title": ""
},
{
"docid": "a45c641409de940a9ac05c381b9c59f8",
"score": "0.58245456",
"text": "def does_attr_value_exist?(attribute, value)\n\n\t\tsearch_result = `camtool search \"attr:#{attribute}:#{value}\"`\n\n\t\t@result_to_JSON = JSON(search_result)\n\n\t\t!@result_to_JSON[\"blobs\"].nil?\n\n\tend",
"title": ""
},
{
"docid": "d7fbb092960c0a2627681860633e9d23",
"score": "0.5815139",
"text": "def attribute_present?(attr_name); end",
"title": ""
},
{
"docid": "6521f1464a9b5c0b0af9a824651d732c",
"score": "0.58120733",
"text": "def is_unique?\n @value = @existing.send(@attribute)\n return bad?(@value)\n end",
"title": ""
},
{
"docid": "42eb86d6d171da438e2fcd12fff8e36c",
"score": "0.58102274",
"text": "def get_attribute_if_set attribute_name\n val = instance_variable_get(\"@#{attribute_name}\".to_sym)\n if val.is_a?(UnsetAttribute)\n raise UnsetAttributeError.new(\"Attribute #{attribute_name} not set\")\n else\n val\n end\n end",
"title": ""
},
{
"docid": "aa305e607616026b9b9522b5a8444676",
"score": "0.5767904",
"text": "def contractor_missing_attr?(attr_name)\n @object.send(attr_name).blank?\n end",
"title": ""
},
{
"docid": "e00d70d30f645afa5e3f5eaaa62c6978",
"score": "0.5765424",
"text": "def non_atomic_attribute_status( attribute )\n\n return non_atomic_attributes[ attribute ]\n\n end",
"title": ""
},
{
"docid": "8ddd82ebcd32ccc061a7e94a94469040",
"score": "0.5742714",
"text": "def check_attribute?(attr_value, attr_name)\n raise Chef::Exceptions::AttributeNotFound, attr_name if attr_value.nil?\n end",
"title": ""
},
{
"docid": "2db57d9e9a9417fe33ebf8c671ada27d",
"score": "0.5704048",
"text": "def not_null\n get_mandatory_attribute :notNull\n end",
"title": ""
},
{
"docid": "1650c78b1ba414bb0f733131a6d317c9",
"score": "0.5698262",
"text": "def current_value_does_not_exist!\n raise Chef::Exceptions::CurrentValueDoesNotExist\n end",
"title": ""
},
{
"docid": "2a99c883ea5994e7236af90775a6e83a",
"score": "0.5675778",
"text": "def property_element_unless(condition, options={}, &proc)\n property_element(options, &proc) unless condition\n end",
"title": ""
},
{
"docid": "e492d440fa89fdddb287f087aba70487",
"score": "0.56724155",
"text": "def if_not_found( &block )\n DataImportEntityBuilder::IfNotFoundScope.new( self, &block ) if result_not_found?\n end",
"title": ""
},
{
"docid": "a310e2e2203e68484328df84df9e504d",
"score": "0.5649344",
"text": "def has_attribute?(attr_name); end",
"title": ""
},
{
"docid": "a310e2e2203e68484328df84df9e504d",
"score": "0.5649344",
"text": "def has_attribute?(attr_name); end",
"title": ""
},
{
"docid": "214c646aa26903ecb46a9467fab85783",
"score": "0.5648994",
"text": "def attribute_present?(name)\n attribute = read_raw_attribute(name)\n !attribute.blank? || attribute == false\n rescue Mongoid::Errors::AttributeNotLoaded\n false\n end",
"title": ""
},
{
"docid": "3699fc206a90d1b5a929950c1e64b51e",
"score": "0.5632048",
"text": "def value\r\n assert_exists\r\n attribute_value('value')\r\n end",
"title": ""
},
{
"docid": "458896794026206b3871a4a57968eb0e",
"score": "0.5610116",
"text": "def attribute_present?(name)\n @_object.respond_to?(name) ||\n (Rabl.configuration.raise_on_missing_attribute &&\n raise(\"Failed to render missing attribute #{name}\"))\n end",
"title": ""
},
{
"docid": "4f76231951711aad4872cedafc3b3e91",
"score": "0.56079865",
"text": "def ppi_not_set?\n self.attributes['ppi'].nil?\n end",
"title": ""
},
{
"docid": "d6bc756af64680943ed661efceb550f3",
"score": "0.5595754",
"text": "def get(attr_name, xn, warn_if_nil=true)\n if (v = @cx[attr_name.to_s]).nil? && warn_if_nil\n @parser.add_warning(xn, \"#{ attr_name } is nil.\")\n end\n v\n end",
"title": ""
},
{
"docid": "3958a02b4e650837414a75448ebd6166",
"score": "0.5591174",
"text": "def not_found?\n @not_found = false unless defined? @not_found\n return @not_found\n end",
"title": ""
},
{
"docid": "21c269d836df266dd11fb8aca604c1e2",
"score": "0.5569994",
"text": "def ignore_if_exists; end",
"title": ""
},
{
"docid": "9d994d20c5985af8c74af0b09b0f9994",
"score": "0.5565019",
"text": "def exists\r\n @attr_expression.exists\r\n end",
"title": ""
},
{
"docid": "6ef8b99af9574cbc54d31d45c691bc42",
"score": "0.55513984",
"text": "def value_when_no_key\n '[deleted]'\n end",
"title": ""
},
{
"docid": "c49f0d19070fcef2a151f12f9c6a9cdc",
"score": "0.5538812",
"text": "def resource_not_exist\n not_found \"Resource doesn't exist.\"\n end",
"title": ""
},
{
"docid": "424f72006ea8d41e2af257a0c9f087ad",
"score": "0.5538175",
"text": "def notf name\n if Thread.current[@rulesetids.last][:working_memory][name][:transient]\n raise BadNotCall.new(\"Cannot call notf on dynamic fact\")\n else\n not(Thread.current[@rulesetids.last][:working_memory][name][:value])\n end\n end",
"title": ""
},
{
"docid": "1c40e5a42699ebb6be9a6fc23e4f80bf",
"score": "0.5537291",
"text": "def when_not_exists(locator, timeout)\n wait_until(timeout) { !element(locator) }\n end",
"title": ""
},
{
"docid": "16e86ca730a02a70d4b1bca1313bfbef",
"score": "0.5530977",
"text": "def attribute_missing?(name)\n !Projector.new(__selected_fields).attribute_or_path_allowed?(name)\n end",
"title": ""
},
{
"docid": "926c028896b367ee6750b88ab984a864",
"score": "0.5530566",
"text": "def attribute(name, raise_if_unfound = false)\n return name if Attribute===name\n a = attributes[name]\n raise \"No such attribute #{name}\" if a.nil? and raise_if_unfound\n a\n end",
"title": ""
},
{
"docid": "f946ea59d5ddf5f1d249dcd5d77f2484",
"score": "0.5525583",
"text": "def not_null\n @items.with_filter(attribute, \"NOT_NULL\")\n end",
"title": ""
},
{
"docid": "76b47e4dc1e0b3379617322653fba1fa",
"score": "0.5523929",
"text": "def exists?; false; end",
"title": ""
},
{
"docid": "9f814992692a7cddbed2d8456d0102ef",
"score": "0.55053717",
"text": "def attribute_present?(attribute)\n value = read_attribute(attribute)\n !value.blank?\n end",
"title": ""
},
{
"docid": "d4e2455f4e775ea225256cd71443296d",
"score": "0.5504526",
"text": "def attribute_present?(attribute)\n value = read_attribute(attribute)\n !value.blank?\n end",
"title": ""
},
{
"docid": "4fedf9b6dc75e4fd9d1a40e0b65124d5",
"score": "0.5500294",
"text": "def empty_value(attribute)\n type = java_type(attribute) || return\n if type.primitive? then\n type.name == 'boolean' ? false : 0\n else\n self.class.empty_value(attribute)\n end\n end",
"title": ""
},
{
"docid": "15de46de2d319ca607384a9ce0412e2a",
"score": "0.5498006",
"text": "def result_not_found?\n @result_id.to_i == 0\n end",
"title": ""
},
{
"docid": "6da0649ef82f5817e44b129720e2924b",
"score": "0.54841346",
"text": "def attr_nonexistent(*attributes)\n attr_hidden(*attributes)\n attr_protected(*attributes)\n end",
"title": ""
},
{
"docid": "6cb9c2bd85f7b4ca8c8399eb0378d8b8",
"score": "0.5474402",
"text": "def hash_attribute?\n false\n end",
"title": ""
},
{
"docid": "f27df3cd36b30d0212df0ae1848dc0b6",
"score": "0.5471474",
"text": "def visitExistenceExpression(ctx)\n ex = \"\" # get existence\n data_criteria = ctx.expression.accept(self)\n if ex == \"not\"\n data_criteria.negation = true\n end\n data_criteria || \" NULL \"\n end",
"title": ""
},
{
"docid": "c434ca0627cbda9b68cd92b7230e7a2f",
"score": "0.546378",
"text": "def arel_not(value)\n named_function(:not, value)\n end",
"title": ""
},
{
"docid": "383c7a23173d356311f12be55e1ec8ed",
"score": "0.5462836",
"text": "def exists?; @has[:_exist]; end",
"title": ""
},
{
"docid": "6148c2b5aba7fd6d27781b100225db90",
"score": "0.5448516",
"text": "def missing?\n !present?\n end",
"title": ""
},
{
"docid": "44f26f899851ae775510ed6749da0b8c",
"score": "0.54475707",
"text": "def attr_unspecified? name\n !((attribute_locked? name) || (@attributes_modified.include? name))\n end",
"title": ""
},
{
"docid": "e865d34917e702b6620a2d156f65f11b",
"score": "0.54471135",
"text": "def is_new?; (@has[:_exist] == false) || false end",
"title": ""
},
{
"docid": "a3a19e794235d51928892262e0b61ac4",
"score": "0.54446673",
"text": "def value_when_no_key\n \"[deleted]\"\n end",
"title": ""
},
{
"docid": "7d21b2a63ef6feecd2f176ab7e60d50c",
"score": "0.5434568",
"text": "def exists_not(field)\n must_not(exists: { field: field })\n end",
"title": ""
},
{
"docid": "1b87dddc5bdbb658bc345fb3ff2392ae",
"score": "0.54138076",
"text": "def column_value(record, column, missing_value)\r\n missing_value\r\n end",
"title": ""
},
{
"docid": "23866cbdddf8ef3c7a918fe353333c4c",
"score": "0.54132986",
"text": "def attribute_present?(name)\n if @_object.respond_to?(name)\n return true\n elsif Rabl.configuration.raise_on_missing_attribute\n raise \"Failed to render missing attribute #{name}\"\n else\n return false\n end\n end",
"title": ""
},
{
"docid": "a5c65e9396bc21d72f99b51b451fb21c",
"score": "0.5405944",
"text": "def not_found\n where(\"slug = ?\", not_found_slug).first()\n end",
"title": ""
},
{
"docid": "8cdc7350115bc92985bdb5bc8d011e5d",
"score": "0.5404149",
"text": "def missing_meta\n data[:missing_meta]\n end",
"title": ""
},
{
"docid": "05a74793e731fac78b04bc4cc8b1d0a4",
"score": "0.5402383",
"text": "def hasAttribute(name)\n !!has_attribute?(name.to_s.downcase)\n end",
"title": ""
},
{
"docid": "02d1147df418fcb1bc06a920b5300919",
"score": "0.5400891",
"text": "def attr!(name)\n @attr_by_name[name] or raise NotFound.new(\"Attribute #{name.inspect} not found\")\n end",
"title": ""
},
{
"docid": "f55c1c17be4b4c2fa43046fe508781bc",
"score": "0.53981465",
"text": "def get_unoccupied\n unoccupied ? unoccupied : 'N/A'\n end",
"title": ""
},
{
"docid": "2a486bdd20cd97a7297278b1c4903d10",
"score": "0.5392149",
"text": "def attribute(attribute)\n nil\n end",
"title": ""
},
{
"docid": "e41086f57f6ccfd9058b6c07754df101",
"score": "0.5384257",
"text": "def attribute?(name)\n attributes.fetch(name, false)\n end",
"title": ""
},
{
"docid": "e110a935c1faced7ce9dc8b925c8082f",
"score": "0.5383575",
"text": "def read_attribute_for_validation(attr_name)\n !(v = super).nil? ? v : self.class.fetch_attribute_default(attr_name)\n end",
"title": ""
},
{
"docid": "75794d0b18c7b34be103e5462b1c9f92",
"score": "0.5370751",
"text": "def negative_failure_message\n \"#{@model.class} validated :#{@attribute} presence.\"\n end",
"title": ""
},
{
"docid": "61a9c99488fd5e4047f12010f133da3f",
"score": "0.535845",
"text": "def wait_for_attribute_to_not_equal(attribute_name, attribute_value)\n wait_until_equality(attribute_value, false) { element.attribute(attribute_name) != attribute_value }\n end",
"title": ""
},
{
"docid": "4a66067ed310acd5b05e7c2cc24935a5",
"score": "0.5353703",
"text": "def wait_for_not_attribute(element, attribute, unwanted_value)\n assert !60.times {\n break if (unwanted_value != get_attribute(element, attribute) rescue false); sleep 1\n }\n end",
"title": ""
},
{
"docid": "875da6fe354bcc0d98e4a670330f4d93",
"score": "0.5346233",
"text": "def property(prop_name); @attributes.fetch(prop_name, nil); end",
"title": ""
},
{
"docid": "52ac6144e7ad2b07ff9c63f2caf6e163",
"score": "0.53442365",
"text": "def ignore_attribute?(key)\n @schema.ignored_attributes.key?(key.to_sym)\n end",
"title": ""
},
{
"docid": "7e684ce41b758f547a0f81fec4db9178",
"score": "0.53367406",
"text": "def unique\n attributes.fetch(:unique)\n end",
"title": ""
},
{
"docid": "a738078da5f63d8fbcb4fba09ac15f2e",
"score": "0.53009415",
"text": "def log_not()\n if self.to_boolean().value\n JSValue::FALSE\n else\n JSValue::TRUE\n end\n end",
"title": ""
},
{
"docid": "4fbe1095939536108a8529668b645042",
"score": "0.5298041",
"text": "def attribute(field_name)\n @attributes.fetch(field_name.to_s, nil)\n end",
"title": ""
},
{
"docid": "9a611adfc7b096e876cf000fae3b179b",
"score": "0.5297129",
"text": "def [](attr)\r\n @attributes ? @attributes[attr] : nil\r\n end",
"title": ""
},
{
"docid": "28d7c09b3d548fc9a232e7a6f9cf4b8a",
"score": "0.52922076",
"text": "def skip_email\n @attributes[:skip_email]\n end",
"title": ""
},
{
"docid": "e072ed4a8a40ffbcd761ef4ae151a4b7",
"score": "0.52919775",
"text": "def attribute\n (2 == @_index) ? @_value : nil\n end",
"title": ""
},
{
"docid": "89703d5e9e0aff5174ab12484aa9ac78",
"score": "0.5291022",
"text": "def not_equal_to value\n @items.with_filter(attribute, \"NE\", value)\n end",
"title": ""
},
{
"docid": "fb369dc74751c1637a303afdf85a8689",
"score": "0.52880013",
"text": "def hasAttribute(key)\n\t\treturn @attributes.hasAttribute(key)\n\tend",
"title": ""
},
{
"docid": "68363c8c5419ec508c635a4745eaf554",
"score": "0.52873933",
"text": "def is_attribute?; end",
"title": ""
},
{
"docid": "035db1e3ec1457d0d9b29534406aa17a",
"score": "0.52830565",
"text": "def optionally_valueless?\n !value? && definition? && attribute_definition.optional?\n end",
"title": ""
},
{
"docid": "8a530a9fc5434e0063352150b8471811",
"score": "0.52819586",
"text": "def has_value?\n ! no_value?\n end",
"title": ""
},
{
"docid": "901839fbf5a364481ce4baf2e02167de",
"score": "0.52718174",
"text": "def has_value?(title)\n !lookup(title).nil?\n end",
"title": ""
},
{
"docid": "063788ed499dc6ace282af84c2744263",
"score": "0.5259863",
"text": "def display_if_not_blank(name, attribute)\n if !attribute.blank?\n return \"<p><b>#{name}:</b> #{attribute}</p>\".html_safe\n else\n return nil\n end\n end",
"title": ""
},
{
"docid": "6eb4c587d20827c06044ef8371d76eaf",
"score": "0.525734",
"text": "def attr_val(xpath)\n attr = @entry.at_xpath(xpath)\n if attr\n attr.value\n else\n nil\n end\n end",
"title": ""
},
{
"docid": "319e8e8b402acfd1af12e2d7a0f98ab6",
"score": "0.5250992",
"text": "def not_found\n end",
"title": ""
},
{
"docid": "fd6db793b955aad675af039c976069da",
"score": "0.52420974",
"text": "def exists?\n if @property_hash[:ensure]\n @property_hash[:ensure] == :present\n else\n uuid != nil\n end\n end",
"title": ""
},
{
"docid": "64aa84ccba691e25d4ee3da13452fa7a",
"score": "0.5241719",
"text": "def attribute?(name)\n value = read_attribute(name)\n !(value.nil? || value == false)\n end",
"title": ""
},
{
"docid": "12946c45324d65f691c97d63ac5f8119",
"score": "0.5239592",
"text": "def has_default_value\n return @payload.path_exists(\"default_value\")\n end",
"title": ""
},
{
"docid": "fc3bd23e0815bcba293d58a65153b5b8",
"score": "0.5237578",
"text": "def [](attr)\n @attributes ? @attributes[attr] : nil\n end",
"title": ""
},
{
"docid": "a952e021847dfea9f3f18355a5d52807",
"score": "0.52319354",
"text": "def version_does_not_exist_description\n if version_does_not_exist?\n if tag\n \"No version with tag #{tag} exists for #{pacticipant_name}\"\n elsif branch\n \"No version of #{pacticipant_name} from branch #{branch} exists\"\n elsif main_branch?\n \"No version of #{pacticipant_name} from the main branch exists\"\n elsif environment_name\n \"No version of #{pacticipant_name} is currently recorded as deployed or released in environment #{environment_name}\"\n elsif pacticipant_version_number\n \"No pacts or verifications have been published for version #{pacticipant_version_number} of #{pacticipant_name}\"\n else\n \"No pacts or verifications have been published for #{pacticipant_name}\"\n end\n else\n \"\"\n end\n end",
"title": ""
},
{
"docid": "2b2e3b051a9b3afb931ddbc80f03edc5",
"score": "0.52267677",
"text": "def attr_val(xpath)\n attr = @attr.at_xpath(xpath)\n if attr\n attr.value\n else\n nil\n end\n end",
"title": ""
},
{
"docid": "66a39de76ed027197fbcc6891afd94f9",
"score": "0.52180123",
"text": "def attribute?(attr)\n attribute(attr).present?\n end",
"title": ""
},
{
"docid": "2acd6d600117e68ee997d524ec2ca95f",
"score": "0.5211224",
"text": "def attr?(name)\n !node.getAttribute(name.to_s).nil?\n end",
"title": ""
},
{
"docid": "c64f6c6dfa3e5b829dad25cc5c172333",
"score": "0.5209266",
"text": "def update_if_dynamic_special_attribute!(_attribute)\n [false, nil]\n end",
"title": ""
},
{
"docid": "f56c5bfa4f13d0d56a5f33fc911957da",
"score": "0.52072346",
"text": "def msg_not_boolean(parent, key, value); end",
"title": ""
}
] |
1097a7e7758f08d32addfc88ea3fdcab | GET /users GET /users.json | [
{
"docid": "d0896dfec2c40ae379331cb07034d25a",
"score": "0.0",
"text": "def index\n @users = User.order(:name)\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @users.where(\"LOWER(name) like ?\", \"%#{params[:q]}%\").map{|user| user.as_json.except(\"password_digest\", \"remember_token\")} }\n end\n end",
"title": ""
}
] | [
{
"docid": "9f7c735ace683c5c2b12c914cc9ad8a8",
"score": "0.84081405",
"text": "def get\n users = User.all.as_json\n render(json: users.as_json, status: :ok)\n end",
"title": ""
},
{
"docid": "543509c6588e2f79a8dbcd1cdcdaf7b9",
"score": "0.836071",
"text": "def users\n try_json get('/user')\n end",
"title": ""
},
{
"docid": "6bbb4bc1303f9011da8bcc971a27aa25",
"score": "0.8050686",
"text": "def users\n get '/users'\n end",
"title": ""
},
{
"docid": "017d848c9897540ea7bc67c9d5139cf4",
"score": "0.7915306",
"text": "def users(opts={})\n get(\"/api/users\", opts)\n end",
"title": ""
},
{
"docid": "3c5e22893d22043de2539eab250264ad",
"score": "0.77417076",
"text": "def index\n uri = \"#{API_BASE_URL}/users.json\"\n rest_resource = RestClient::Resource.new(uri,USERNAME, PASSWORD)\n users = rest_resource.get\n @users = JSON.parse(users, :symbolize_names => true)\n end",
"title": ""
},
{
"docid": "5a2b7963ab17292ecee2f8263f92b100",
"score": "0.77342296",
"text": "def index\n @users = User.resource[@current_user['id']].get\n render json: @users\n end",
"title": ""
},
{
"docid": "93a0fef3e882c742575f7b75e7c85f92",
"score": "0.76708406",
"text": "def index\n uri = \"#{API_BASE_URL}/users.json\" # specifying json format in the URl\n rest_resource = RestClient::Resource.new(uri, USERNAME, PASSWORD)\n users = rest_resource.get\n @users = JSON.parse(users, :symbolize_names => true)\n end",
"title": ""
},
{
"docid": "c30d74a9ad7eba05edcb8605ab93b040",
"score": "0.7632463",
"text": "def get_users\n response = connection.get \"users\"\n parse(response)\n end",
"title": ""
},
{
"docid": "8964e99596f7e7774764500fc019be86",
"score": "0.7617348",
"text": "def index\n\n if request.path_parameters[:format] == 'json'\n query = get_users\n\n end\n\n respond_to do |format|\n format.html\n format.json { render json: query }\n end\n end",
"title": ""
},
{
"docid": "1fa340328c780cc7bc2a4bc7079f2724",
"score": "0.7614113",
"text": "def fetch_user_details\n get('users/list')\n end",
"title": ""
},
{
"docid": "7e8d258f13b5ac8306b7387d394a0f12",
"score": "0.7612176",
"text": "def get_users\n Resources::User.parse(request(:get, \"Users\"))\n end",
"title": ""
},
{
"docid": "47e58634dc6a1375d758c8a6d4d277ed",
"score": "0.76035243",
"text": "def users\n\t render json: { users: User.all }\n\t end",
"title": ""
},
{
"docid": "3e1132849bff254063ef4e8144752d24",
"score": "0.7599184",
"text": "def get_users()\n return @api.do_request(\"GET\", get_base_api_path() + \"/users\")\n end",
"title": ""
},
{
"docid": "3e1132849bff254063ef4e8144752d24",
"score": "0.75990206",
"text": "def get_users()\n return @api.do_request(\"GET\", get_base_api_path() + \"/users\")\n end",
"title": ""
},
{
"docid": "3e1132849bff254063ef4e8144752d24",
"score": "0.75990206",
"text": "def get_users()\n return @api.do_request(\"GET\", get_base_api_path() + \"/users\")\n end",
"title": ""
},
{
"docid": "a95dfe28d6b386aafc5fb53749e84258",
"score": "0.75946826",
"text": "def user\n get(ROBINHOOD_USER_ROUTE, return_as_json: true)\n end",
"title": ""
},
{
"docid": "e05472a5e389b9cb25c42ecfd8b2adf0",
"score": "0.7566673",
"text": "def index\n user = User.all\n render json: user, status: 200\n end",
"title": ""
},
{
"docid": "73f7ae2fa82d59f15d5328c8ae591d97",
"score": "0.7548231",
"text": "def index\n user = User.all\n render json: user\n end",
"title": ""
},
{
"docid": "a2c1496955488bf3bb3f08b5c7ed033c",
"score": "0.75214636",
"text": "def users(id = nil)\n uri = if id\n File.join(base_uri, 'users', id)\n else\n File.join(base_uri, 'users')\n end\n\n http = call_kavlan(uri, :get)\n continue_if!(http, is: [200])\n\n JSON.parse(http.body)\n end",
"title": ""
},
{
"docid": "11a1a1f560b80f96e92570d67b197134",
"score": "0.749885",
"text": "def index\n @users = User.normal\n render json: @users\n end",
"title": ""
},
{
"docid": "728355570654539ecc78d5a6323ca440",
"score": "0.7485816",
"text": "def index\n users = User.all\n render json: users\n end",
"title": ""
},
{
"docid": "be025401ce661e746a5395cf25d40ae3",
"score": "0.74636567",
"text": "def show\n @user = User.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @users }\n end\n end",
"title": ""
},
{
"docid": "8110cf69f978358fb10a03aa41fbeb3c",
"score": "0.74623036",
"text": "def index\n users = User.all\n render json: users, status: :ok\n end",
"title": ""
},
{
"docid": "b209d6e9945c425900c17658a74b7147",
"score": "0.745525",
"text": "def users(query={})\n perform_get(\"/api/1/users\", :query => query)\n end",
"title": ""
},
{
"docid": "cc242a095e722778fca002f25f8b5ec3",
"score": "0.7446153",
"text": "def users(options = {})\n request(:get, 'users', options = {})\n end",
"title": ""
},
{
"docid": "3d5370e43b770779413a93d4918ce2ea",
"score": "0.7443466",
"text": "def index\n raise NotImplementedError\n\n @users = User.all\n json_response(@users)\n end",
"title": ""
},
{
"docid": "0bcd24908b50aabe8262541173f1842b",
"score": "0.7436547",
"text": "def users_data\n response = RestClient.get(BASE_URL + '/users', Authorization: AUTHORIZATION_TOKEN )\n if response.code == 200\n JSON.parse response.body\n else\n []\n end\n end",
"title": ""
},
{
"docid": "70ce8704ae64d0d47b8bcdebc9aef52c",
"score": "0.7430364",
"text": "def index\n @users = User.all\n json_response(@users)\n end",
"title": ""
},
{
"docid": "70ce8704ae64d0d47b8bcdebc9aef52c",
"score": "0.7430364",
"text": "def index\n @users = User.all\n json_response(@users)\n end",
"title": ""
},
{
"docid": "70ce8704ae64d0d47b8bcdebc9aef52c",
"score": "0.7430364",
"text": "def index\n @users = User.all\n json_response(@users)\n end",
"title": ""
},
{
"docid": "70ce8704ae64d0d47b8bcdebc9aef52c",
"score": "0.7430364",
"text": "def index\n @users = User.all\n json_response(@users)\n end",
"title": ""
},
{
"docid": "365a065dfa3efc893dff2ec1751a8370",
"score": "0.74264127",
"text": "def users\n get('/api/v1/users.json').map do |user|\n User.new(self, user)\n end\n end",
"title": ""
},
{
"docid": "1578585c4421e89ab79f3ee95a5a6b50",
"score": "0.74261004",
"text": "def index \n users = User.all\n render json: users\n end",
"title": ""
},
{
"docid": "d12422285c5f2d22f5aa43909fb2b7c3",
"score": "0.7425406",
"text": "def index\n json_response(@users)\n end",
"title": ""
},
{
"docid": "5be1a2b1facfbebe48738361ccbdfec5",
"score": "0.74242425",
"text": "def users_show(options = {})\n @req.get(\"/1.1/users/show.json\", options)\n end",
"title": ""
},
{
"docid": "74a4e7202861ab80f0d8abd15d24e86c",
"score": "0.7423415",
"text": "def index\n @users = User.all\n render json: @users\n end",
"title": ""
},
{
"docid": "74a4e7202861ab80f0d8abd15d24e86c",
"score": "0.7423415",
"text": "def index\n @users = User.all\n render json: @users\n end",
"title": ""
},
{
"docid": "74a4e7202861ab80f0d8abd15d24e86c",
"score": "0.7423415",
"text": "def index\n @users = User.all\n render json: @users\n end",
"title": ""
},
{
"docid": "74a4e7202861ab80f0d8abd15d24e86c",
"score": "0.7423415",
"text": "def index\n @users = User.all\n render json: @users\n end",
"title": ""
},
{
"docid": "253bebf87e7183fd88370ca9b28863be",
"score": "0.74200225",
"text": "def index\n @users = User.all\n render json: @users, status: :ok\n end",
"title": ""
},
{
"docid": "253bebf87e7183fd88370ca9b28863be",
"score": "0.74200225",
"text": "def index\n @users = User.all\n render json: @users, status: :ok\n end",
"title": ""
},
{
"docid": "5b9e2c334bf2ee55a849ac008ab4760c",
"score": "0.7414205",
"text": "def index\n @users = User.all\n render formats: :json\n end",
"title": ""
},
{
"docid": "1d9b1fc3d6eec2bde2962031c0d3b008",
"score": "0.74116546",
"text": "def index\n @users = User.all\n render json: @users\n end",
"title": ""
},
{
"docid": "e78e1e1473ede309a13313dea8093034",
"score": "0.7405091",
"text": "def index \n @users = User.all \n json_response(@users)\n end",
"title": ""
},
{
"docid": "d4a5fb8b42d9ce1d4070b77a97be1120",
"score": "0.74037486",
"text": "def index\n @users = User.all\n\n render json: @users\n end",
"title": ""
},
{
"docid": "b7f893411aa0a30a20a26dadbd483df5",
"score": "0.7401923",
"text": "def show_users(**params)\n get('users', params)\n end",
"title": ""
},
{
"docid": "6c06ae91d84c999b50d1830d37605337",
"score": "0.73978853",
"text": "def index\n users = User.all\n render json: users\n end",
"title": ""
},
{
"docid": "6c06ae91d84c999b50d1830d37605337",
"score": "0.73978853",
"text": "def index\n users = User.all\n render json: users\n end",
"title": ""
},
{
"docid": "8dfb48fd6a80c33f0ac0d9e681640dbd",
"score": "0.73914206",
"text": "def index\n @user_service = UsersService.new\n @users = @user_service.get_users\n respond_with(@users) do |format|\n format.html # index.html.erb\n format.json\n end\n end",
"title": ""
},
{
"docid": "bf0919dd85bfe1e319e9a1c96d755cf5",
"score": "0.73894036",
"text": "def user(query={})\n self.class.get(\"/users/show.json\", :query => query)\n end",
"title": ""
},
{
"docid": "21d0100fa8f28b0e5a2ab7431e570c24",
"score": "0.73881793",
"text": "def index\n users = User.all\n render json: {users: users}\n end",
"title": ""
},
{
"docid": "f01ec3a51043a68e5143b1a379740b30",
"score": "0.7387084",
"text": "def index\n user = User.all\n render json: {\n data: { user: user }\n }, status: :ok\n end",
"title": ""
},
{
"docid": "768f1b79678af1fa17252ed99984255f",
"score": "0.73797745",
"text": "def index\n @users = User.all\n render json: {users: @users}, status: :ok\n end",
"title": ""
},
{
"docid": "71bbf5a5c05ef96c138d150f7486a57b",
"score": "0.7371924",
"text": "def index\n @users = User.all\n render json: @users, status: 200\n end",
"title": ""
},
{
"docid": "65844d565c3ece8e3601af3a0042efcb",
"score": "0.7362046",
"text": "def all_users\n response = get(\"#{@config['url']}/api/2.1/rest/users\", {accept: :json, :cookies => cookies})\n JSON.parse(response, :symbolize_names => true)[:users][:user]\n end",
"title": ""
},
{
"docid": "92c38d204173af55357406763326ad78",
"score": "0.7358582",
"text": "def index\n @users = User.all\n render json: @users\n end",
"title": ""
},
{
"docid": "92c38d204173af55357406763326ad78",
"score": "0.7358582",
"text": "def index\n @users = User.all\n render json: @users\n end",
"title": ""
},
{
"docid": "92c38d204173af55357406763326ad78",
"score": "0.7358582",
"text": "def index\n @users = User.all\n render json: @users\n end",
"title": ""
},
{
"docid": "92c38d204173af55357406763326ad78",
"score": "0.7358582",
"text": "def index\n @users = User.all\n render json: @users\n end",
"title": ""
},
{
"docid": "92c38d204173af55357406763326ad78",
"score": "0.7358582",
"text": "def index\n @users = User.all\n render json: @users\n end",
"title": ""
},
{
"docid": "92c38d204173af55357406763326ad78",
"score": "0.7358582",
"text": "def index\n @users = User.all\n render json: @users\n end",
"title": ""
},
{
"docid": "92c38d204173af55357406763326ad78",
"score": "0.7358582",
"text": "def index\n @users = User.all\n render json: @users\n end",
"title": ""
},
{
"docid": "92c38d204173af55357406763326ad78",
"score": "0.7358582",
"text": "def index\n @users = User.all\n render json: @users\n end",
"title": ""
},
{
"docid": "92c38d204173af55357406763326ad78",
"score": "0.7358582",
"text": "def index\n @users = User.all\n render json: @users\n end",
"title": ""
},
{
"docid": "92c38d204173af55357406763326ad78",
"score": "0.7358582",
"text": "def index\n @users = User.all\n render json: @users\n end",
"title": ""
},
{
"docid": "92c38d204173af55357406763326ad78",
"score": "0.7358582",
"text": "def index\n @users = User.all\n render json: @users\n end",
"title": ""
},
{
"docid": "92c38d204173af55357406763326ad78",
"score": "0.7358582",
"text": "def index\n @users = User.all\n render json: @users\n end",
"title": ""
},
{
"docid": "92c38d204173af55357406763326ad78",
"score": "0.7358582",
"text": "def index\n @users = User.all\n render json: @users\n end",
"title": ""
},
{
"docid": "92c38d204173af55357406763326ad78",
"score": "0.7358582",
"text": "def index\n @users = User.all\n render json: @users\n end",
"title": ""
},
{
"docid": "92c38d204173af55357406763326ad78",
"score": "0.7358582",
"text": "def index\n @users = User.all\n render json: @users\n end",
"title": ""
},
{
"docid": "92c38d204173af55357406763326ad78",
"score": "0.7358582",
"text": "def index\n @users = User.all\n render json: @users\n end",
"title": ""
},
{
"docid": "88b3ae1730160a096115c73635028df2",
"score": "0.73570585",
"text": "def index\n @users = User.all\n render json: @users\n end",
"title": ""
},
{
"docid": "cbdc21cee11cf48ec2414873bcf3b4f8",
"score": "0.7351439",
"text": "def users(options={})\n response = connection.get do |req|\n req.url \"users\", options\n end\n return_error_or_body(response)\n end",
"title": ""
},
{
"docid": "c9be31dad7d323088e84c4adffd9f57a",
"score": "0.7350187",
"text": "def index\n @users = User.all\n\n render json: @users\n end",
"title": ""
},
{
"docid": "c9be31dad7d323088e84c4adffd9f57a",
"score": "0.7350187",
"text": "def index\n @users = User.all\n\n render json: @users\n end",
"title": ""
},
{
"docid": "c9be31dad7d323088e84c4adffd9f57a",
"score": "0.7350187",
"text": "def index\n @users = User.all\n\n render json: @users\n end",
"title": ""
},
{
"docid": "c9be31dad7d323088e84c4adffd9f57a",
"score": "0.7350187",
"text": "def index\n @users = User.all\n\n render json: @users\n end",
"title": ""
},
{
"docid": "c9be31dad7d323088e84c4adffd9f57a",
"score": "0.7350187",
"text": "def index\n @users = User.all\n\n render json: @users\n end",
"title": ""
},
{
"docid": "c9be31dad7d323088e84c4adffd9f57a",
"score": "0.7350187",
"text": "def index\n @users = User.all\n\n render json: @users\n end",
"title": ""
},
{
"docid": "c9be31dad7d323088e84c4adffd9f57a",
"score": "0.7350187",
"text": "def index\n @users = User.all\n\n render json: @users\n end",
"title": ""
},
{
"docid": "c9be31dad7d323088e84c4adffd9f57a",
"score": "0.7350187",
"text": "def index\n @users = User.all\n\n render json: @users\n end",
"title": ""
},
{
"docid": "c9be31dad7d323088e84c4adffd9f57a",
"score": "0.7350187",
"text": "def index\n @users = User.all\n\n render json: @users\n end",
"title": ""
},
{
"docid": "c9be31dad7d323088e84c4adffd9f57a",
"score": "0.7350187",
"text": "def index\n @users = User.all\n\n render json: @users\n end",
"title": ""
},
{
"docid": "8c903d03e45311f48905e2ea9d3bba05",
"score": "0.73497856",
"text": "def users\n oauth_response = access_token.get(\"/api/v1/users.json\")\n JSON.parse(oauth_response.body)\n end",
"title": ""
},
{
"docid": "9910e37b855e76e2f4dc68c02812b65c",
"score": "0.73425883",
"text": "def show\n @users = User.all\n @user = User.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @user }\n end\n end",
"title": ""
},
{
"docid": "7192ec11ec312baac0d2ac4738bad8a3",
"score": "0.73348075",
"text": "def index\n authorize! :read, User\n @users = User.all\n\n render json: @users\n end",
"title": ""
},
{
"docid": "3a927f940b3bb7a38cec50aef43084c9",
"score": "0.7328958",
"text": "def index\n\t\tusers = User.all\n\t\trender json: users\n\tend",
"title": ""
},
{
"docid": "3a927f940b3bb7a38cec50aef43084c9",
"score": "0.7328958",
"text": "def index\n\t\tusers = User.all\n\t\trender json: users\n\tend",
"title": ""
},
{
"docid": "942e9267d60d38cde812d4eeb9779a93",
"score": "0.73261863",
"text": "def index\n users = apply_pagination User.fetch_and_cache\n\n users = users.as_json(only: [:id, :email])\n render json: users\n end",
"title": ""
},
{
"docid": "e584b8a35cf7ebb98d5533c42b2fec65",
"score": "0.7316376",
"text": "def index\n users = User.all\n\n render json: users.to_json, status: 200\n end",
"title": ""
},
{
"docid": "aaf39c0ee28ba6a3ac81c6d021196720",
"score": "0.73126787",
"text": "def index\n @users = User.all\n render json: @users, status: :ok\n end",
"title": ""
},
{
"docid": "aaf39c0ee28ba6a3ac81c6d021196720",
"score": "0.73126787",
"text": "def index\n @users = User.all\n render json: @users, status: :ok\n end",
"title": ""
},
{
"docid": "aaf39c0ee28ba6a3ac81c6d021196720",
"score": "0.73126787",
"text": "def index\n @users = User.all\n render json: @users, status: :ok\n end",
"title": ""
},
{
"docid": "aaf39c0ee28ba6a3ac81c6d021196720",
"score": "0.73126787",
"text": "def index\n @users = User.all\n render json: @users, status: :ok\n end",
"title": ""
},
{
"docid": "91668c1e35aaa65d080deea8c09126be",
"score": "0.7310774",
"text": "def index\n @users = User.all \n render json: @users\n end",
"title": ""
},
{
"docid": "bf1d3f31b565c7345057c88f25e455cb",
"score": "0.73034644",
"text": "def index\n users = User.all\n render json: users.to_json, status: 200\n end",
"title": ""
},
{
"docid": "bf1d3f31b565c7345057c88f25e455cb",
"score": "0.73034644",
"text": "def index\n users = User.all\n render json: users.to_json, status: 200\n end",
"title": ""
},
{
"docid": "2f190ad36d443d1a902316ac406d8b93",
"score": "0.7302701",
"text": "def get_users\n access_token = get_token\n headers = {:Authorization => \"Bearer #{access_token}\", :accept => 'application/vnd.hoopla.user-list+json'}\n response = HTTP.headers(headers).get(\"#{@@host}/users\")\n users = JSON.parse(response.to_s)\n return users\n end",
"title": ""
},
{
"docid": "3013af5d315bfa480d63f6f328ae2095",
"score": "0.730258",
"text": "def viewusers\n @users = User.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @users }\n end\n end",
"title": ""
},
{
"docid": "e207204a11515a5ae49c0482b0b8fe1f",
"score": "0.7302499",
"text": "def user\n render :json => User.find(params[:id]).to_json\n end",
"title": ""
},
{
"docid": "5b1e72e2623a8a681dbd625eec26fbe1",
"score": "0.72958165",
"text": "def index\n @users = User.all\n render json: @users\n end",
"title": ""
}
] |
a5dce20aa10dd510dba5266b51d2e795 | Log in as a particular agent. | [
{
"docid": "8d94ed2b69238bf80ef45ce3493781ad",
"score": "0.7805113",
"text": "def log_in_as(agent)\n session[:agent_id] = agent.id\n end",
"title": ""
}
] | [
{
"docid": "89b151f5e167bbb77cbbf2c335531fb7",
"score": "0.7641982",
"text": "def log_in_as(agent, password: 'password', remember_me: '1')\n post agents_login_path, params: { session: { email: agent.email,\n password: password,\n remember_me: remember_me } }\n end",
"title": ""
},
{
"docid": "de55f3972b9fadf0a98a398399ca9ab2",
"score": "0.7458266",
"text": "def log_in_as(agent, options = {})\n password = options[:password] || 'password'\n remember_me = options[:remember_me] || '1'\n if integration_test?\n post login_path, session: { email: agent.email,\n password: password,\n remember_me: remember_me }\n else\n session[:agent_id] = agent.id\n end\n end",
"title": ""
},
{
"docid": "dd0044ff39a8fad89462779c99280965",
"score": "0.7244636",
"text": "def login(agent)\n logger.info(\"Logging in to #{LOGIN_URL}.\")\n\n login_page = agent.get(LOGIN_URL)\n form = login_page.form('frmFormsLogin')\n\n username, password, answer_agent = *scraper_args unless scraper_args.nil?\n form.Username = username || ask(\"username:\\n\")\n form.password = password || ask(\"password:\\n\") { |q| q.echo = \"•\" }\n\n prompts = agent.page.search(\".LoginPrompt\")\n question = prompts[2].inner_html.strip\n\n if answer_agent.blank?\n if question = prompts[2].inner_html.strip rescue nil\n form.answer = ask( question ) { |q| q.echo = \"•\" }\n end\n else\n answer_agent = HbosAnswerAgent.new(answer_agent)\n form.answer = answer_agent.answer(question)\n end\n\n agent.submit(form)\n end",
"title": ""
},
{
"docid": "dd8c7f74c3433dfb50efc8ff87e97be0",
"score": "0.70818514",
"text": "def login(agent)\n logger.info(\"Logging in to #{LOGIN_URL}.\")\n if (scraper_args)\n username, password = *scraper_args\n end\n raise \"Login failed for BPI Scraper - pass user name and password using -scraper_args \\\"user <space> pass\\\"\" unless (username and password)\n\n # navigate to the login page\n login_page = agent.get(LOGIN_URL)\n\n # find login form - it's called 'signOn' - fill it out and submit it\n form = login_page.form('signOn')\n\n # username and password are taken from the commandline args, set them\n # on USERID and PASSWORD which are the element names that the web page\n # form uses to identify the form fields\n form.USERID = username\n form.PASSWORD = password\n\n # submit the form - same as the user hitting the Login button\n agent.submit(form)\n sleep 3 # wait while the login takes effect\n end",
"title": ""
},
{
"docid": "95215f6fdae2f1db40bc5f9b965a5701",
"score": "0.69142467",
"text": "def login\n cmd.say 'Logging in...'\n request = EM::HttpRequest.new(BASE_URL.merge('/agent_sessions'))\n\n request.post(:body => {\n 'agent_session[email_address]' => @email_address,\n 'agent_session[password]' => @password,\n 'agent_session[remember_me]' => 0\n }).transform do |http|\n\n case http.response_header.status\n when 200\n cmd.say 'Incorrect password'; raise 'login failed'\n when 302\n [http.response_header.cookie].compact.flatten.each do |cookie|\n @cookiejar.set_cookie(request.uri, cookie)\n end\n else\n raise \"HTTP #{http.response_header.status}\"\n end\n self\n\n end.errback do\n cmd.say 'Sorry, could not connect to CoTweet.'\n end\n end",
"title": ""
},
{
"docid": "68e52574fd44120a5fc47d76b697e64d",
"score": "0.68581414",
"text": "def login\n @agent.get(@urls[:login]) do |page|\n page.forms[1].loginID = @options[:username]\n page.forms[1].password = @options[:password]\n page.forms[1].click_button\n end\n end",
"title": ""
},
{
"docid": "18e0ed3d39c2dad452169fee233b11fd",
"score": "0.6816024",
"text": "def login\n if ! @logged_in\n self.go_home\n @log.info \"clicking 'Sign In'\"\n @agent.page.link_with(:text => 'Sign In').click\n @log.info \"received #{@agent.page.body.length} bytes\"\n\n unless f=@agent.page.form_with(:action => /\\/signIn$/)\n @log.error \"unable to find form with signIn action\"\n exit 1\n end\n\n f.e=username\n f.p=password\n\n @log.info \"submitting login form\"\n @agent.submit(f)\n @log.info \"received #{@agent.page.body.length} bytes\"\n\n if @agent.page.link_with(:text => 'Sign In')\n @log.error \"login failed; still have a 'Sign In' link\"\n exit 1\n end\n\n @logged_in = true\n end\n end",
"title": ""
},
{
"docid": "1a12f4a7c25ca1f00cee4bd22a6dcc0a",
"score": "0.67620647",
"text": "def login(agent)\n logger.info(\"Logging in to #{LOGIN_URL}.\")\n if (scraper_args)\n username, password = *scraper_args\n end\n raise \"Login failed for Swedbank Scraper - pass user name and password using -scraper_args \\\"user <space> pass\\\"\" unless (username and password)\n\n # navigate to the login page\n login_page = agent.get(LOGIN_URL)\n # Landing page requires redirect\n login_page = agent.submit(login_page.form('form1'))\n # find login form - it's called 'auth' - fill it out and submit it\n form = login_page.form('auth')\n # username and password are taken from the commandline args, set them\n # on USERID and PASSWORD which are the element names that the web page\n # form uses to identify the form fields\n form[\"auth:kundnummer\"] = username\n form[\"auth:metod_2\"] = \"PIN6\"\n\n # submit the form - same as the user hitting the Login button\n login_page = agent.submit(form, form.buttons.first)\n \n # Step 2 is to enter the password\n form = login_page.form('form')\n\n form[\"form:pinkod\"] = password\n login_page = agent.submit(form, form.buttons.first)\n \n # After login an additional direct is required.\n agent.submit(login_page.form('redirectForm'))\n # sleep 3 # wait while the login takes effect\n end",
"title": ""
},
{
"docid": "c489cb6a58ee7af7561fd06ddbb88e96",
"score": "0.6712105",
"text": "def login\n login_page = @agent.get(@login)\n login_form = login_page.form(name: 'Login')\n login_form.fields[6].value = @username\n login_form.fields[7].value = @password\n\n @agent.submit login_form\n end",
"title": ""
},
{
"docid": "908e8c0d9c9e5d7f5907e0ed19e908f8",
"score": "0.6634906",
"text": "def try_login(agent)\n agent.user_agent_alias = 'Mac Safari'\n page = agent.get(LOGIN_URL)\n form = page.forms[0]\n form.field_with(:name => /mobile/i).value = @username\n form.field_with(:name => /password/i).value = @password\n form.click_button\n end",
"title": ""
},
{
"docid": "aab195165010624e814debdc5780c61d",
"score": "0.6633674",
"text": "def login\n\t\t@agent ||= Mechanize.new\n\t\t@agent = set_proxy(@agent)\n\t\t@agent.get(CRAIGSLIST_LOGIN_URL)\n\t\tform = @agent.page.form(\"login\") || @agent.page.forms[0]\n\t\tform.inputEmailHandle = email\n\t\tform.inputPassword = password\n\t\tform.submit\n\t\t@agent\n\tend",
"title": ""
},
{
"docid": "c7122eebda9521daeeec0195f772b7e8",
"score": "0.6607614",
"text": "def aul_login\n\t @agent.get(@@aul_login_url)\n\t form = @agent.page.forms.first\n\t form.uid = @@aul_user\n\t form.pid = @@aul_pass\n\t @agent.submit(form)\n\tend",
"title": ""
},
{
"docid": "d6a482260452d7123f3e3abc878cc558",
"score": "0.6558086",
"text": "def try_login(agent)\n agent.user_agent_alias = 'Mac Safari'\n page = agent.get(LOGIN_URL)\n form = page.forms[0]\n form.field_with(:name => /mobile/i).value = @username\n form.field_with(:name => /password/i).value = @password\n form.click_button\n end",
"title": ""
},
{
"docid": "3c305c157ce3fa34688595f41320aeeb",
"score": "0.6536011",
"text": "def login(agent)\n logger.info(\"Logging in to #{LOGIN_URL}.\")\n\n self.class.currency args['currency']\n\n # Important to get the session cookie.\n page = agent.get(\"#{LOGIN_URL}/index.jsp\")\n\n # navigate to the login page\n login_page = agent.get(\"#{LOGIN_URL}/appl/index.jsp\")\n\n # find login form - it's called 'form1' - fill it out and submit it\n form = login_page.form('form1')\n\n if args[\"tipo\"].downcase == \"empresa\"\n rb_value = \"C\" # empresa\n else\n rb_value = \"R\" # persona\n end\n\n form.radiobuttons_with(:name => \"tipo_usuario\").each do |rb|\n rb.checked = rb.value == rb_value\n end\n\n if args[\"tipo\"].downcase == \"empresa\"\n form.empresa_aux = args['empresa']\n form.pwd_empresa = args['pwd_empresa']\n form.usuario_aux = args['usuario']\n form.pwd_usuario = args['pwd_usuario']\n\n # Hidden fields are assigned by javascript but we do it here.\n form.empresa = form.empresa_aux.upcase\n form.usuario = form.usuario_aux.downcase\n else\n form.tipo_documento = \"1\" # Cédula de identidad\n form.nro_documento = args['usuario']\n form.password = args['password']\n end\n\n # submit the form - same as the user hitting the Login button\n agent.submit(form)\n sleep 3 # wait while the login takes effect\n end",
"title": ""
},
{
"docid": "36ccb8e726a6d48a029414c0cffb8865",
"score": "0.6499918",
"text": "def login!\n login(true)\n end",
"title": ""
},
{
"docid": "2b7a85089231d18059a619c25b3f3a00",
"score": "0.6308556",
"text": "def login(email, password)\n if !@logged_in\n form = @agent.page.form_with(:method => 'POST')\n form.email = email\n form.pass = password\n @agent.submit(form)\n @logged_in = !@agent.page.uri.to_s.match('home.php').nil?\n \n name = @agent.page.search(\"#footer/div[@class='acw apm']/span\").text.strip\n @username = name.scan(/\\((.*?)\\)/).first\n end\n logged_in?\n end",
"title": ""
},
{
"docid": "a22906000733dfa8ad109dc2a3a284bd",
"score": "0.6294464",
"text": "def login=(value)\n reset_agent\n @login = value\n end",
"title": ""
},
{
"docid": "544a83cfe7e281229f98801022d5ee50",
"score": "0.6258416",
"text": "def log_in\n visit($cas ? CASLogin : Login)do |log_in|\n log_in.username.set @user_name\n log_in.login\n end\n visit Researcher\n end",
"title": ""
},
{
"docid": "b57d72a785a2ad021b5501f8380beb0b",
"score": "0.62445235",
"text": "def current_agent\n if session[:agent_id]\n @current_agent ||= Agent.find_by(id: session[:agent_id])\n elsif cookies.signed[:agent_id]\n agent = Agent.find_by(id: cookies.signed[:agent_id])\n if agent && agent.authenticated?(:remember, cookies[:remember_token])\n log_in agent\n @current_agent = agent\n end\n end\n end",
"title": ""
},
{
"docid": "a38befc895cfd0e0997d6a72ab4d6edc",
"score": "0.6220455",
"text": "def create\n @agent = Agent.new(agent_params)\n\n respond_to do |format|\n if @agent.save\n sign_in @agent,\"agent\"\n format.html { redirect_to @agent}\n format.json { render action: 'show', status: :created, location: @agent }\n else\n format.html { render action: 'new' }\n format.json { render json: @agent.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3d3e147220d061725de4b52bf2969e92",
"score": "0.6220333",
"text": "def current_agent\n if (agent_id = session[:agent_id])\n @current_agent ||= Agent.find_by(id: agent_id)\n elsif (agent_id = cookies.signed[:agent_id])\n agent = Agent.find_by(id: agent_id)\n if agent && agent.authenticated?(:remember, cookies[:remember_token])\n log_in agent\n @current_agent = agent\n end\n end\n end",
"title": ""
},
{
"docid": "ddd30ad7b41a7eabfe67424d7598c2ce",
"score": "0.6159598",
"text": "def login\n open_session do |sess|\n sess.post quo_vadis.login_path(email: 'bob@example.com', password: '123456789abc')\n end\n end",
"title": ""
},
{
"docid": "95daa2077a1334097d004ae8b6a24835",
"score": "0.6145866",
"text": "def login(settings)\n page =@agent.get(\"#{settings['url']}/users/sign_in\")\n\n # Login to my winesite\n login_form = page.form(\"login\")\n login_form.field_with(type: \"email\").value = settings[\"email\"]\n login_form.field_with(type: \"password\").value = settings[\"password\"]\n page = @agent.submit(login_form)\nend",
"title": ""
},
{
"docid": "31badebfa11c5ae070f83b0e4e7a6e26",
"score": "0.6139045",
"text": "def do_login\n @indigo.start_sign_in.click\n end",
"title": ""
},
{
"docid": "dc79f3b632108f2fbbdd825ab4f5d88a",
"score": "0.6102915",
"text": "def login\n @agent = Mechanize.new\n login_page = @agent.get('https://connect.garmin.com/signin')\n form = login_page.form('login')\n form['login:loginUsernameField'] = @username\n form['login:password'] = @password\n page = @agent.submit(form, form.buttons.first)\n page.inspect =~ /Dashboard for/ ? true : false\n end",
"title": ""
},
{
"docid": "1d0df27d77a175e63b1d3dc3aaeb6b6b",
"score": "0.609186",
"text": "def login(username, password)\n @username = username\n \n loginpage = @agent.get('https://github.com/login')\n loginform = loginpage.forms[0]\n \n loginform['login'] = username\n loginform['password'] = password\n loginform['remember_me'] = '1' # make the session 'stick' a little longer, hopefully.\n loginpage = @agent.submit(loginform)\n @logged_in = true\n end",
"title": ""
},
{
"docid": "2803363b5b2bf24bf8077ffc696ffab6",
"score": "0.60816514",
"text": "def call(env)\n login(env)\n end",
"title": ""
},
{
"docid": "cb4b26dc7f3c5819db284ce4022a1515",
"score": "0.60813004",
"text": "def login\n @agent = Mechanize.new\n @agent.ssl_version = 'TLSv1'\n login_page = @agent.get(LOGIN_URL)\n login_form = login_page.forms.first\n login_form['mail_tel'] = CORE['id']\n login_form['password'] = CORE['password']\n page = @agent.submit(login_form)\n page.title\n end",
"title": ""
},
{
"docid": "a9f55d6cee2fd4ebb4521987ce989529",
"score": "0.60782516",
"text": "def login\n Dotenv.load\n userid = ENV['username']\n password = ENV['password']\n login_page = @agent.get 'https://fetlife.com/users/sign_in'\n # log in passing in username and pasword\n form = login_page.forms[0]\n form.field_with(id: 'user_login').value = userid\n form.field_with(id: 'user_password').value = password\n # return the results of loging in\n form.submit\n end",
"title": ""
},
{
"docid": "2b482546bbe00e72cc3a289362d94d43",
"score": "0.6057742",
"text": "def login(username, password)\n\t @agent = Mechanize.new\n\n\t # Open T-Square Log-in\n\t @agent.get(\"https://login.gatech.edu/cas/login?service=https%3A%2F%2Ft-square.gatech.edu%2Fsakai-login-tool%2Fcontainer\")\n\n\t # Submit Form\n\t\tform = @agent.page.forms.first\n\t\tform.username = username\n\t\tform.password = password\n\t\tform.submit\n\tend",
"title": ""
},
{
"docid": "8593be7696ba9eb37930ecca2e39e214",
"score": "0.604462",
"text": "def login_as(role = :author1)\n visit new_user_session_path\n\n fill_in \"Email\", with: users(role).email\n fill_in \"Password\", with: \"password\"\n \n click_on \"Log in\"\n end",
"title": ""
},
{
"docid": "01c252ece7e48891a3fa5d387af56a1a",
"score": "0.6040121",
"text": "def set_agent_session\n @agent_session = AgentSession.find(params[:id])\n end",
"title": ""
},
{
"docid": "1eb95787e6c000f14d11db13d9a67982",
"score": "0.60355353",
"text": "def login\n enterCredentials\n authenticate\n end",
"title": ""
},
{
"docid": "8e041383ae8c5110c531272aaa92480a",
"score": "0.6031512",
"text": "def login\n # Mechanize settings\n agent.keep_alive = false\n agent.idle_timeout = 5\n agent.read_timeout = 5\n agent.user_agent_alias = ['Mac Safari', 'Mac Firefox'].sample\n agent.agent.http.debug_output = $stderr if $debug\n\n # OKCupid login sequence\n @page = agent.get(\"http://www.okcupid.com/\")\n form = page.forms[1]\n form['username'] = @username\n form['password'] = @password\n @page = form.submit\n sleep 1\n\n # Check if logged in\n @page_source = @page.parser.xpath(\"//html\").to_html.to_s\n @login_status = check_session_status\n is_logged_in?\n end",
"title": ""
},
{
"docid": "71f02245ef704313a4b65509a961dafa",
"score": "0.60297865",
"text": "def logged_in_agent\n unless logged_in?\n store_location\n flash[:danger] = \"Please log in.\"\n redirect_to login_url\n end\n end",
"title": ""
},
{
"docid": "1fe5111fd30b406696bd41a4544e0a38",
"score": "0.6009293",
"text": "def agent\n return unless use_agent?\n\n @agent ||= Agent.connect(logger, options[:agent_socket_factory], options[:identity_agent])\n rescue AgentNotAvailable\n @use_agent = false\n nil\n end",
"title": ""
},
{
"docid": "150339c6236b91bb2662b5cab44862ed",
"score": "0.60008",
"text": "def login\n @agent ||= Mechanize.new\n self.logout\n page = @agent.get 'https://www.torontopubliclibrary.ca/youraccount'\n form = page.form_with :name => 'form_signin'\n if form\n form.userId = self.read_attribute('card')\n form.password = self.read_attribute('pin')\n form.submit\n end\n self\n end",
"title": ""
},
{
"docid": "f8b072c11a1c60161af45e87834bff18",
"score": "0.59761006",
"text": "def login_bob\n user = new_bob\n login_user(user, 'Bob1234!')\n end",
"title": ""
},
{
"docid": "b5c4cf5e0cc8f564ea708c07225b1f85",
"score": "0.5970297",
"text": "def set_agent\n @agent = Agent.find(params[:agent_id])\n end",
"title": ""
},
{
"docid": "b4d5d5eca9d749349326c31a96c9f952",
"score": "0.5946161",
"text": "def run_login( *args )\n self.input = self.password\n return self.run( \"login\", args )\n end",
"title": ""
},
{
"docid": "f8b8c359644394c6907fcc3c5e1a06f1",
"score": "0.5935829",
"text": "def session_login\n open_session do |sess|\n sess.post quo_vadis.login_path(email: 'bob@example.com', password: '123456789abc')\n end\n end",
"title": ""
},
{
"docid": "edd388f0fc0d06c7004a987e840c30e5",
"score": "0.5917822",
"text": "def ident; login; end",
"title": ""
},
{
"docid": "b0efe581c1292d84cbf5b43e0d25eb35",
"score": "0.591309",
"text": "def login\n backend = config_backend == 'local' ? '--local' : config_backend\n ::Kitchen::Pulumi::ShellOut.run(\n cmd: \"login #{backend}\",\n logger: logger,\n )\n end",
"title": ""
},
{
"docid": "e508bca372bc34530033170c7f809f8b",
"score": "0.59051573",
"text": "def yourlogincredentials(agent, password)\n @agent=agent\n @password=password\n mail(:to => @agent.email, :subject => \"Login Credentials\")\n end",
"title": ""
},
{
"docid": "6801fc0f2f8e1700cb0084e362365e55",
"score": "0.5897286",
"text": "def login\n client.user()[:login]\n end",
"title": ""
},
{
"docid": "62007d41792fb0c7362f6c158246fef0",
"score": "0.5894809",
"text": "def login\n if TestChamber.user_cookies\n refresh_browser_cookies\n else\n ui_login\n end\n end",
"title": ""
},
{
"docid": "36f6004d588a3344a3c415d7432a3b05",
"score": "0.58944154",
"text": "def login(user)\n login_as user, scope: :user\n end",
"title": ""
},
{
"docid": "36c33d8be949554392273978810a746f",
"score": "0.58942515",
"text": "def log_in\n end",
"title": ""
},
{
"docid": "36c33d8be949554392273978810a746f",
"score": "0.58942515",
"text": "def log_in\n end",
"title": ""
},
{
"docid": "19966ab8ccfc10041c2b031056347094",
"score": "0.58925676",
"text": "def logged_in_agent\n agents_dataset.first(division: login_discipline.division)\n end",
"title": ""
},
{
"docid": "d9da8b55faeab7dfbf2ee207c0b60499",
"score": "0.589221",
"text": "def login_as(username, password = \"test\")\n home_page = HomePage.new(@browser)\n home_page.enter_login(username)\n home_page.enter_password(password)\n home_page.click_login\n end",
"title": ""
},
{
"docid": "d9da8b55faeab7dfbf2ee207c0b60499",
"score": "0.58921164",
"text": "def login_as(username, password = \"test\")\n home_page = HomePage.new(@browser)\n home_page.enter_login(username)\n home_page.enter_password(password)\n home_page.click_login\n end",
"title": ""
},
{
"docid": "d9da8b55faeab7dfbf2ee207c0b60499",
"score": "0.58921164",
"text": "def login_as(username, password = \"test\")\n home_page = HomePage.new(@browser)\n home_page.enter_login(username)\n home_page.enter_password(password)\n home_page.click_login\n end",
"title": ""
},
{
"docid": "ce948fd0583b4965d2b1e310813ec3ea",
"score": "0.5883032",
"text": "def set_agent\n @agent = Agent.find(params[:id])\n end",
"title": ""
},
{
"docid": "ce948fd0583b4965d2b1e310813ec3ea",
"score": "0.5883032",
"text": "def set_agent\n @agent = Agent.find(params[:id])\n end",
"title": ""
},
{
"docid": "ce948fd0583b4965d2b1e310813ec3ea",
"score": "0.5883032",
"text": "def set_agent\n @agent = Agent.find(params[:id])\n end",
"title": ""
},
{
"docid": "ce948fd0583b4965d2b1e310813ec3ea",
"score": "0.5883032",
"text": "def set_agent\n @agent = Agent.find(params[:id])\n end",
"title": ""
},
{
"docid": "ce948fd0583b4965d2b1e310813ec3ea",
"score": "0.5883032",
"text": "def set_agent\n @agent = Agent.find(params[:id])\n end",
"title": ""
},
{
"docid": "ce948fd0583b4965d2b1e310813ec3ea",
"score": "0.5883032",
"text": "def set_agent\n @agent = Agent.find(params[:id])\n end",
"title": ""
},
{
"docid": "ce948fd0583b4965d2b1e310813ec3ea",
"score": "0.5883032",
"text": "def set_agent\n @agent = Agent.find(params[:id])\n end",
"title": ""
},
{
"docid": "ce948fd0583b4965d2b1e310813ec3ea",
"score": "0.5883032",
"text": "def set_agent\n @agent = Agent.find(params[:id])\n end",
"title": ""
},
{
"docid": "ce948fd0583b4965d2b1e310813ec3ea",
"score": "0.5883032",
"text": "def set_agent\n @agent = Agent.find(params[:id])\n end",
"title": ""
},
{
"docid": "ce948fd0583b4965d2b1e310813ec3ea",
"score": "0.5883032",
"text": "def set_agent\n @agent = Agent.find(params[:id])\n end",
"title": ""
},
{
"docid": "ce948fd0583b4965d2b1e310813ec3ea",
"score": "0.5883032",
"text": "def set_agent\n @agent = Agent.find(params[:id])\n end",
"title": ""
},
{
"docid": "ce948fd0583b4965d2b1e310813ec3ea",
"score": "0.5883032",
"text": "def set_agent\n @agent = Agent.find(params[:id])\n end",
"title": ""
},
{
"docid": "ce948fd0583b4965d2b1e310813ec3ea",
"score": "0.5883032",
"text": "def set_agent\n @agent = Agent.find(params[:id])\n end",
"title": ""
},
{
"docid": "ce948fd0583b4965d2b1e310813ec3ea",
"score": "0.5883032",
"text": "def set_agent\n @agent = Agent.find(params[:id])\n end",
"title": ""
},
{
"docid": "ce948fd0583b4965d2b1e310813ec3ea",
"score": "0.5883032",
"text": "def set_agent\n @agent = Agent.find(params[:id])\n end",
"title": ""
},
{
"docid": "fe6eb181ef10de0420ebdf190332a437",
"score": "0.5878827",
"text": "def call(env)\n login(env)\n end",
"title": ""
},
{
"docid": "0c0497a069c70e70a6f0bcad278cf111",
"score": "0.5877523",
"text": "def login(email, password)\n\t\t@agent.get(@login_url) do |page|\n\t\t\tform = page.forms.first # => Mechanize::Form\n\n\t\t\tform.fields.each { |f| puts f.name; puts f.value } if @debug\n\n\t\t\tform['email'] = email\n\t\t\tform['password'] = password\n\t\t\t@page = @agent.submit(form)\n\t\tend\n\t\tself\n\tend",
"title": ""
},
{
"docid": "87334e4fd654f10fa1ec61b053782fa7",
"score": "0.5876285",
"text": "def login\n $logger.info 'Logging in with the default system shell'\n exec('bash --login')\n end",
"title": ""
},
{
"docid": "6fa611b15a936d591f0bb3c7f98c90dc",
"score": "0.58694947",
"text": "def system_log_in_as(user)\n visit(login_path)\n fill_in(\"Username\", with: user.name)\n fill_in(\"Password\", with: \"password\")\n click_on(\"Log in\")\n end",
"title": ""
},
{
"docid": "e4476b17137e71243e73bac6cdcf73da",
"score": "0.58683586",
"text": "def attach(agent)\n @sagent = agent unless @sagent\n ole_set\n authenticate\n end",
"title": ""
},
{
"docid": "4ad9e8223b4c2928704b1babd4a78f85",
"score": "0.5857114",
"text": "def set_agent(agent)\n @agent = agent\n end",
"title": ""
},
{
"docid": "09303a73586934e910e61d042e475676",
"score": "0.58571136",
"text": "def login\n\t\tlogin_user\n\tend",
"title": ""
},
{
"docid": "f00f35491e2e09b6773bbbd3a4fecb81",
"score": "0.5855474",
"text": "def set_user\n @user = Agent.find(params[:id])\n end",
"title": ""
},
{
"docid": "052c5158f8e49fcc9c536f666a6237b8",
"score": "0.58513945",
"text": "def login_to_tetra_capy\n\t\t#session[:current_user_id] = 0\n\n\t\tclick_on 'Admin'\n\t\tfill_in \"username\", :with => 'cmoseley'\n\t\tfill_in \"password\", :with => 'insecured'\n\t\tclick_on 'Sign in'\n\tend",
"title": ""
},
{
"docid": "08de294026d6076e2d13f978278a8759",
"score": "0.58486503",
"text": "def login\n @logger.debug(\"logging into server at : #{login_url}\")\n page = @agent.get(login_url, [], nil, authentication_header)\n form = page.form_with(id: @config.dig('login', 'form_id'))\n\n if form\n @csrf_token = page.at(\"[name='#{csrf_form_field}']\").attr('value')\n form.field_with(name: @config.dig('login', 'username_form_field')).value = @config.dig('login', 'username')\n form.field_with(name: @config.dig('login', 'password_form_field')).value = @config.dig('login', 'password')\n @agent.submit form\n end\n clear_csrf_token\n rescue Mechanize::ResponseCodeError => e\n @logger.fatal(\"Login to server failed.\")\n raise e\n rescue StandardError => e\n @logger.fatal(\"Login to #{login_url} caught an unhandled exception : #{e}\")\n raise e\n end",
"title": ""
},
{
"docid": "0fe5840330c0b1cbc50aac6ef4c0d8b3",
"score": "0.5848591",
"text": "def handle_client_login(env, data)\r\n agent_id = data['agent_id'] or raise \"client_login: missing agent_id\"\r\n subscribers[agent_id] = env\r\n end",
"title": ""
},
{
"docid": "5be126ac05181226722fe04d94f02ccc",
"score": "0.5848049",
"text": "def login\n TrelloStandup::Auth.login\n display \"Authentication successful!\"\n display \"You currently logged in with Trello username : '#{TrelloStandup::Auth.username}'\"\n end",
"title": ""
},
{
"docid": "96f7276b035faeaf8ab5e5b0e3519af8",
"score": "0.5818986",
"text": "def log_in(role = :editor)\n visit new_user_session_path\n fill_in 'Email', with: users(role).email\n fill_in 'Password', with: 'password'\n click_on 'Log in'\n end",
"title": ""
},
{
"docid": "39d95e452910dd9c69fdad7b4834aa1b",
"score": "0.5818125",
"text": "def log_user_in(user)\n login(user)\n end",
"title": ""
},
{
"docid": "4036298f815e5b2122c34d66a78c8f1f",
"score": "0.58127713",
"text": "def set_agent\n @agent = Agent.find(params[:id])\n end",
"title": ""
},
{
"docid": "eaccc565583f50a4de0abfbedef1b1c2",
"score": "0.58007675",
"text": "def log_in\n end",
"title": ""
},
{
"docid": "eaccc565583f50a4de0abfbedef1b1c2",
"score": "0.58007675",
"text": "def log_in\n end",
"title": ""
},
{
"docid": "eaccc565583f50a4de0abfbedef1b1c2",
"score": "0.58007675",
"text": "def log_in\n end",
"title": ""
},
{
"docid": "09a60e5571f9f6070a00387134c579f9",
"score": "0.57985306",
"text": "def login_as(username, password = \"test\")\n home_page = expect_page HomePage\n home_page.enter_username(username)\n home_page.enter_password(password)\n home_page.click_login\n end",
"title": ""
},
{
"docid": "e8238f18257adf0676d189fe55db3640",
"score": "0.5787428",
"text": "def login_as(person)\n visit \"/person_session/new\" unless current_path == \"/person_session/new\"\n wait_for \"#person_session_login\"\n fill_in \"person_session_login\", with: person.login\n fill_in \"person_session_password\", with: \"secret\"\n click_button \"login_button\"\n end",
"title": ""
},
{
"docid": "d5d5ae33aca6143c5f647dc0ea7383fe",
"score": "0.5786603",
"text": "def login_as\n logout\n user = @account.users.reorder(id: :asc).first\n auto_login(user)\n redirect_to root_url, notice: \"You are now logged in as #{user}\"\n end",
"title": ""
},
{
"docid": "711f02eff2e8aebbd6691725238a564c",
"score": "0.5779447",
"text": "def set_agent\n \tbegin\n \t\t@agent = Agent.find(params[:id])\n \trescue Exception => e\n \t\tServices::Slog.exception e\n \t\tflash[:notice] = \"Sorry, <i class=\\\"icon-shuffle\\\"></i> couldn't find the agent identified by <em>#{params[:id]}</em>.\"\n \t\tredirect_to :controller => \"agents\", :action => \"index\"\n \tend\n end",
"title": ""
},
{
"docid": "94b3a1c34c347564973febdf0065512d",
"score": "0.57776535",
"text": "def login(agent, user, password)\n page = agent.get('http://confer.csail.mit.edu/login?redirect_url=/ijcai2016/papers')\n page.form.login_email = user\n page.form.login_password = password\n page = page.form.submit\n abort 'Login failed' unless page.search('div#error').empty?\nend",
"title": ""
},
{
"docid": "7db351184a54f953db289249b3e41ae4",
"score": "0.57750845",
"text": "def initialize(username, password, agent = self.class.mechanizer.new)\n @agent = agent\n @username = username\n @password = password\n @current_account = nil\n end",
"title": ""
},
{
"docid": "73b0bbe337417a1a20edbde455166819",
"score": "0.5772123",
"text": "def log_in; end",
"title": ""
},
{
"docid": "73b0bbe337417a1a20edbde455166819",
"score": "0.5770439",
"text": "def log_in; end",
"title": ""
},
{
"docid": "19187ac5c7a67e3be76b45ea09f8c3fd",
"score": "0.5760867",
"text": "def login_as(user)\n return if user == :visitor\n\n post login_url,\n params: { email: users(user).email, password: \"p@ssw0rd!\" }\n end",
"title": ""
},
{
"docid": "b800e950c1b0b7f3ba7e84e306f696b0",
"score": "0.5760457",
"text": "def login_as(person)\n visit \"/person_session/new\"\n fill_in \"person_session_login\", :with => person.login\n fill_in \"person_session_password\", :with => \"secret\"\n click_button \"login_button\"\n end",
"title": ""
},
{
"docid": "7bbf8aaa726ceefc971511754f834f19",
"score": "0.5745366",
"text": "def do_login\n login_page = LoginPage.new(@browser.window)\n login_page.goto\n\n login_page.user_email = @login_credentials.email # page-object automatically calls the watir-webdriver 'set' method when using =\n login_page.user_password = @login_credentials.password\n login_page.submit_button # page-object sees that it's a button and automatically clicks it\n end",
"title": ""
},
{
"docid": "3304406b32dc0670d2d93575273c4fab",
"score": "0.57386076",
"text": "def login( credential )\n p \"SOMEBODY IS LOGGING IN\"\n self.session do |data| \n data[:account] = ::Entities::Auth::Account.new( Fiber.current[:context][:connection] )\n end\n end",
"title": ""
},
{
"docid": "c6ab3ec588f51cd81ed971cdb20de4d9",
"score": "0.5736624",
"text": "def login\n unless @logged_in\n page = @agent.get 'https://www.fitbit.com/login'\n \n form = page.forms.first\n form.email = @email\n form.password = @pass\n \n page = @agent.submit(form, form.buttons.first)\n \n @userId = page.search(\"//div[@class='accountLinks']\").search(\"a\")[0]['href'].gsub('/user/','')\n # @agent.cookie_jar.jar[\"www.fitbit.com\"]['/']['uid'].value\n # @agent.cookie_jar.jar[\"www.fitbit.com\"]['/']['sid'].value\n\n @logged_in = true\n end\n end",
"title": ""
},
{
"docid": "66a7bdef3b57d659e784297294f4c6c4",
"score": "0.57354236",
"text": "def new_agent\n @agent = User.new(agent_params)\n end",
"title": ""
}
] |
950ae126dc2a45ede205e31de6dafbfd | Builds a List flush to +margin+ | [
{
"docid": "b8572fcdfcf08a9589379803cf208fd3",
"score": "0.74732697",
"text": "def build_list margin\n p :list_start => margin if @debug\n\n list = RDoc::Markup::List.new\n\n until @tokens.empty? do\n type, data, column, = get\n\n case type\n when :BULLET, :LABEL, :LALPHA, :NOTE, :NUMBER, :UALPHA then\n list_type = type\n\n if column < margin then\n unget\n break\n end\n\n if list.type and list.type != list_type then\n unget\n break\n end\n\n list.type = list_type\n\n case type\n when :NOTE, :LABEL then\n _, indent, = get # SPACE\n if :NEWLINE == peek_token.first then\n get\n peek_type, new_indent, peek_column, = peek_token\n indent = new_indent if\n peek_type == :INDENT and peek_column >= column\n unget\n end\n else\n data = nil\n _, indent, = get\n end\n\n list_item = build_list_item(margin + indent, data)\n\n list << list_item if list_item\n else\n unget\n break\n end\n end\n\n p :list_end => margin if @debug\n\n return nil if list.empty?\n\n list\n end",
"title": ""
}
] | [
{
"docid": "f88079b9a6b203dc46c7874d55b4dbb1",
"score": "0.7264258",
"text": "def build_list margin\n p :list_start => margin if @debug\n\n list = RDoc::Markup::List.new\n label = nil\n\n until @tokens.empty? do\n type, data, column, = get\n\n case type\n when *LIST_TOKENS then\n if column < margin || (list.type && list.type != type) then\n unget\n break\n end\n\n list.type = type\n peek_type, _, column, = peek_token\n\n case type\n when :NOTE, :LABEL then\n label = [] unless label\n\n if peek_type == :NEWLINE then\n # description not on the same line as LABEL/NOTE\n # skip the trailing newline & any blank lines below\n while peek_type == :NEWLINE\n get\n peek_type, _, column, = peek_token\n end\n\n # we may be:\n # - at end of stream\n # - at a column < margin:\n # [text]\n # blah blah blah\n # - at the same column, but with a different type of list item\n # [text]\n # * blah blah\n # - at the same column, with the same type of list item\n # [one]\n # [two]\n # In all cases, we have an empty description.\n # In the last case only, we continue.\n if peek_type.nil? || column < margin then\n empty = true\n elsif column == margin then\n case peek_type\n when type\n empty = :continue\n when *LIST_TOKENS\n empty = true\n else\n empty = false\n end\n else\n empty = false\n end\n\n if empty then\n label << data\n next if empty == :continue\n break\n end\n end\n else\n data = nil\n end\n\n if label then\n data = label << data\n label = nil\n end\n\n list_item = RDoc::Markup::ListItem.new data\n parse list_item, column\n list << list_item\n\n else\n unget\n break\n end\n end\n\n p :list_end => margin if @debug\n\n if list.empty? then\n return nil unless label\n return nil unless [:LABEL, :NOTE].include? list.type\n\n list_item = RDoc::Markup::ListItem.new label, RDoc::Markup::BlankLine.new\n list << list_item\n end\n\n list\n end",
"title": ""
},
{
"docid": "f074da81b1063ca3915614d9155d933f",
"score": "0.6973062",
"text": "def pad_list\n pg = [LIST_START]\n\n pg += items\n\n pg << LIST_END\n\n dx = items.each_with_index.to_h\n\n scroll_content(pg, dx) && select_content(pg, dx)\n\n pg.each_slice(4).count\n end",
"title": ""
},
{
"docid": "5da96edcbeb7f0cb18302d3ae83526a8",
"score": "0.6146951",
"text": "def create_list\n @linkedList.append(cols/2, lines/2)\n @linkedList.append(cols/2 - 1, lines/2)\n @linkedList.append(cols/2 - 2, lines/2)\n # @linkedList.print\n end",
"title": ""
},
{
"docid": "c1a80b215e3819b1cc745b323e60804a",
"score": "0.6004018",
"text": "def list_style(item); end",
"title": ""
},
{
"docid": "d3ad3d850cab09a271bf5ce3ed288f59",
"score": "0.5907188",
"text": "def pretty_list(list)\r\n\tputs \"Grocery List\".center(30)\r\n\tlist.each do |item, quantity|\r\n\t\tputs \"#{item} \".ljust(20) + \"#{quantity}\".rjust(10)\r\n\tend\r\nend",
"title": ""
},
{
"docid": "ac740021d6aa2f88256ecb5bba35917b",
"score": "0.5867355",
"text": "def format_list(items); end",
"title": ""
},
{
"docid": "7f6c453b76f40df6ca2c84406ae74c38",
"score": "0.5827932",
"text": "def setItems(list, list_size, numbers)\n if self.createItemList(numbers, list, list_size) <= 0\n return\n end\n\n # Clean up the display.\n (0...@view_size).each do |x|\n Draw.writeBlanks(@win, 1, x, CDK::HORIZONTAL, 0, @box_width - 2);\n end\n\n self.setViewSize(list_size)\n self.setPosition(0)\n @left_char = 0\n end",
"title": ""
},
{
"docid": "efe699529423fcd6d3d68ce16ab1b15e",
"score": "0.5822188",
"text": "def list(padding = 5)\n puts \"\\nTACOS:\"\n puts '-'*(max_length(:text) + max_length(:context) + padding + 3)\n\n items.each_with_index do |item, index|\n if item.context.to_s == @options[:filter] || @options[:filter].nil?\n printf(\"[%s] %-#{max_length(:text)+padding}s%s\\n\",\n index+1, item.text, colorize(item.context.gsub('@',''), :cyan))\n end\n end\n\n puts '-'*(max_length(:text) + max_length(:context) + padding + 3)\n puts \"\"\n end",
"title": ""
},
{
"docid": "d9ead473024cf02ac38472fd127412aa",
"score": "0.5780602",
"text": "def list_with_limit(id, list, options = {}, &block)\n # backwards compatible to when third argument was just a number\n # for limit.\n options = {:limit => options} unless options.kind_of?(Hash)\n options[:limit] ||= 5\n options[:ul_class] ||= \"list-unstyled\"\n return \"\" if list.empty?\n visible_list = (list.length > options[:limit]) ? list.slice(0, options[:limit]-1) : list\n hidden_list = (list.length > options[:limit]) ? list.slice((options[:limit]-1)..list.length-1) : []\n parts =[]\n parts << content_tag(:ul, :class => options[:ul_class]) do\n safe_join(\n visible_list.enum_for(:each_with_index).collect do |item, index|\n yield(item, index)\n end, \" \\n \"\n )\n end\n if (hidden_list.present?)\n parts << expand_contract_section(\"#{hidden_list.length} more\", id) do\n content_tag(:ul, :class=>options[:ul_class]) do\n safe_join(\n hidden_list.enum_for(:each_with_index).collect do |item, index|\n yield(item, index + options[:limit] - 1)\n end, \" \\n \"\n )\n end\n end\n end\n return safe_join(parts, \"\\n\")\n end",
"title": ""
},
{
"docid": "6e25006b12b158995580774af2140b8e",
"score": "0.5739241",
"text": "def wrap_list(list, width)\n list.map do |text|\n wrap_text(text, width)\n end.flatten\n end",
"title": ""
},
{
"docid": "e667e91a4766224a0f6c358e936405c4",
"score": "0.56009376",
"text": "def add_list_definition(style); end",
"title": ""
},
{
"docid": "4876354e68edccc12571669dba81fcd7",
"score": "0.5592616",
"text": "def render\n buffer = []\n _guess_col_widths\n rows = @list.size.to_s.length\n @rows = rows\n _prepare_format\n \n str = \"\"\n if @numbering\n str = \" \"*(rows+1)+@y\n end\n str << @fmstr % @columns\n buffer << str\n #puts \"-\" * str.length\n buffer << separator\n if @list\n if @numbering\n @fmstr = \"%#{rows}d \"+ @y + @fmstr\n end\n #@list.each { |e| puts e.join(@y) }\n count = 0\n @list.each_with_index { |r,i| \n value = convert_value_to_text r, count\n buffer << value\n count += 1\n }\n end\n buffer\n end",
"title": ""
},
{
"docid": "08b997e750981b79478c15727e60964f",
"score": "0.5541733",
"text": "def build_list\n students = input_students\n print_header\n print(students)\n print_footer(students)\nend",
"title": ""
},
{
"docid": "e2f5f1778c91e19d3233a186631c5b18",
"score": "0.5504484",
"text": "def render\n rendered_items = ''\n\n list.list_items.each do |list_item|\n rendered_items += render_item(list_item)\n end\n\n if opts[:wrapper_element]\n content_tag opts[:wrapper_element], rendered_items, html_options, false\n else\n rendered_items\n end\n end",
"title": ""
},
{
"docid": "4b3e37c8be351f20efb48d34079dfc65",
"score": "0.54857427",
"text": "def build_list_item indent, item_type = nil\n p :list_item_start => [indent, item_type] if @debug\n\n list_item = RDoc::Markup::ListItem.new item_type\n\n until @tokens.empty? do\n type, data, column = get\n\n if column < indent and\n not type == :NEWLINE and\n (type != :INDENT or data < indent) then\n unget\n break\n end\n\n case type\n when :INDENT then\n unget\n list_item.push(*parse(indent))\n when :TEXT then\n unget\n list_item << build_paragraph(indent)\n when :HEADER then\n list_item << build_heading(data)\n when :NEWLINE then\n list_item << RDoc::Markup::BlankLine.new\n when *LIST_TOKENS then\n unget\n list_item << build_list(column)\n else\n raise ParseError, \"Unhandled token #{@current_token.inspect}\"\n end\n end\n\n p :list_item_end => [indent, item_type] if @debug\n\n return nil if list_item.empty?\n\n list_item.parts.shift if\n RDoc::Markup::BlankLine === list_item.parts.first and\n list_item.length > 1\n\n list_item\n end",
"title": ""
},
{
"docid": "6e518dd173a41d85b9d5582e19b38bbe",
"score": "0.54697794",
"text": "def make_item_list\n end",
"title": ""
},
{
"docid": "bd36af1b72c8b0c6aa596bc5fd9aca29",
"score": "0.5468899",
"text": "def list_layout( project_list )\n # define results and top\n results = []\n top = 0\n\n # each project list item\n project_list.each do |item|\n if item[ 'display' ][ 0 ] == 'b'\n # item is block\n bcl = block_csv_line( item[ 'name' ], item[ 'uuid' ], 0, top, 0 )\n results << bcl[ :line ]\n top += bcl[ :height ]\n else\n # item is package of blocks\n max_height = 0\n item[ 'blocks' ].each do |bk|\n bcl = block_csv_line( bk[ 'name' ], bk[ 'uuid' ], bk[ 'x' ],\n bk[ 'y'] + top, bk[ 'z' ] )\n results << bcl[ :line ]\n if max_height < bcl[ :height ]\n max_height = bcl[ :height ]\n end\n end\n top += max_height\n end\n end\n return results.join( \"\\n\" )\nend",
"title": ""
},
{
"docid": "1124d08d086211173e1091cdf977c422",
"score": "0.54651374",
"text": "def format_list_item(out, options)\n if options[:list] == :ul\n out << \"#{'*' * (options[:ul] + 1)} \"\n elsif options[:list] == :ol\n number = options[:number]\n options[:number] = number.next\n out << \"#{number}. \"\n end\n end",
"title": ""
},
{
"docid": "15bcf6b02c5b1c8fbb86879effa2e237",
"score": "0.5457361",
"text": "def list_creator(list)\n\tsorted_list = list.sort\n\tsorted_list.each do |item|\n\tputs \"* \" + item\n\tend\nend",
"title": ""
},
{
"docid": "6341bef1e8685ebcfaddd846661f25a4",
"score": "0.5425007",
"text": "def generate_list_skippers\n container = @parser.find(\"##{ID_CONTAINER_SKIPPERS}\").first_result\n html_list = nil\n if container.nil?\n local = @parser.find('body').first_result\n unless local.nil?\n container = @parser.create_element('div')\n container.set_attribute('id', ID_CONTAINER_SKIPPERS)\n local.prepend_element(container)\n end\n end\n unless container.nil?\n html_list = @parser.find(container).find_children('ul').first_result\n if html_list.nil?\n html_list = @parser.create_element('ul')\n container.append_element(html_list)\n end\n end\n @list_skippers_added = true\n\n html_list\n end",
"title": ""
},
{
"docid": "9e00312f27e76fa5c04cb77f0e20c020",
"score": "0.5424739",
"text": "def list_of(items=[], *args, &block)\n renderer = ListRenderer.new(items,self,*args,&block)\n unless block_given? \n renderer.to_html\n end\n end",
"title": ""
},
{
"docid": "bf2197175022a0b66bac7a2206c0afd9",
"score": "0.5424047",
"text": "def build_verbatim margin\n p :verbatim_begin => margin if @debug\n verbatim = RDoc::Markup::Verbatim.new\n\n min_indent = nil\n generate_leading_spaces = true\n line = ''.dup\n\n until @tokens.empty? do\n type, data, column, = get\n\n if type == :NEWLINE then\n line << data\n verbatim << line\n line = ''.dup\n generate_leading_spaces = true\n next\n end\n\n if column <= margin\n unget\n break\n end\n\n if generate_leading_spaces then\n indent = column - margin\n line << ' ' * indent\n min_indent = indent if min_indent.nil? || indent < min_indent\n generate_leading_spaces = false\n end\n\n case type\n when :HEADER then\n line << '=' * data\n _, _, peek_column, = peek_token\n peek_column ||= column + data\n indent = peek_column - column - data\n line << ' ' * indent\n when :RULE then\n width = 2 + data\n line << '-' * width\n _, _, peek_column, = peek_token\n peek_column ||= column + width\n indent = peek_column - column - width\n line << ' ' * indent\n when :BREAK, :TEXT then\n line << data\n else # *LIST_TOKENS\n list_marker = case type\n when :BULLET then data\n when :LABEL then \"[#{data}]\"\n when :NOTE then \"#{data}::\"\n else # :LALPHA, :NUMBER, :UALPHA\n \"#{data}.\"\n end\n line << list_marker\n peek_type, _, peek_column = peek_token\n unless peek_type == :NEWLINE then\n peek_column ||= column + list_marker.length\n indent = peek_column - column - list_marker.length\n line << ' ' * indent\n end\n end\n\n end\n\n verbatim << line << \"\\n\" unless line.empty?\n verbatim.parts.each { |p| p.slice!(0, min_indent) unless p == \"\\n\" } if min_indent > 0\n verbatim.normalize\n\n p :verbatim_end => margin if @debug\n\n verbatim\n end",
"title": ""
},
{
"docid": "a90c8c128e3d91fc4ce9e0a1bc0c1470",
"score": "0.5396234",
"text": "def lister(list)\n\tlist.each do |item|\n\t\tputs \"* #{item}\"\n\tend\nend",
"title": ""
},
{
"docid": "45bee3a6b99cbbef993d49edd7872d5e",
"score": "0.53900474",
"text": "def build_verbatim margin\n p :verbatim_begin => margin if @debug\n verbatim = RDoc::Markup::Verbatim.new\n\n until @tokens.empty? do\n type, data, column, = get\n\n case type\n when :INDENT then\n if margin >= data then\n unget\n break\n end\n\n indent = data - margin\n\n verbatim << ' ' * indent\n when :HEADER then\n verbatim << '=' * data\n\n _, _, peek_column, = peek_token\n peek_column ||= column + data\n verbatim << ' ' * (peek_column - column - data)\n when :RULE then\n width = 2 + data\n verbatim << '-' * width\n\n _, _, peek_column, = peek_token\n peek_column ||= column + data + 2\n verbatim << ' ' * (peek_column - column - width)\n when :TEXT then\n verbatim << data\n when *LIST_TOKENS then\n if column <= margin then\n unget\n break\n end\n\n list_marker = case type\n when :BULLET then '*'\n when :LABEL then \"[#{data}]\"\n when :LALPHA, :NUMBER, :UALPHA then \"#{data}.\"\n when :NOTE then \"#{data}::\"\n end\n\n verbatim << list_marker\n\n _, data, = get\n\n verbatim << ' ' * (data - list_marker.length)\n when :NEWLINE then\n verbatim << data\n break unless [:INDENT, :NEWLINE].include? peek_token[0]\n else\n unget\n break\n end\n end\n\n verbatim.normalize\n\n p :verbatim_end => margin if @debug\n\n verbatim\n end",
"title": ""
},
{
"docid": "db02efc883c6017dc33452daeeed37fc",
"score": "0.5346268",
"text": "def build_toc_list(entries, last_ul_used: false)\n i = 0\n toc_list = ''\n min_h_num = entries.map { |e| e[:h_num] }.min\n\n while i < entries.count\n entry = entries[i]\n if entry[:h_num] == min_h_num\n # If the current entry should not be indented in the list, add the entry to the list\n toc_list << %(<li class=\"toc-entry toc-#{entry[:node_name]}\"><a href=\"##{entry[:id]}#{entry[:uniq]}\">#{entry[:text]}</a>)\n # If the next entry should be indented in the list, generate a sublist\n if i + 1 < entries.count\n next_entry = entries[i + 1]\n if next_entry[:h_num] > min_h_num\n nest_entries = get_nest_entries(entries[i + 1, entries.count], min_h_num)\n toc_list << %(\\n<ul>\\n#{build_toc_list(nest_entries, last_ul_used: true)}</ul>\\n)\n i += nest_entries.count\n end\n end\n # Add the closing tag for the current entry in the list\n toc_list << %(</li>\\n)\n elsif entry[:h_num] > min_h_num\n # If the current entry should be indented in the list, generate a sublist\n nest_entries = get_nest_entries(entries[i, entries.count], min_h_num)\n if last_ul_used\n toc_list << build_toc_list(nest_entries, last_ul_used: true)\n else\n toc_list << %(<ul>\\n#{build_toc_list(nest_entries, last_ul_used: true)}</ul>\\n)\n end\n i += nest_entries.count - 1\n end\n i += 1\n end\n\n toc_list\n end",
"title": ""
},
{
"docid": "c20edb173cccc9f2dc10bc8c12e58f9f",
"score": "0.53446215",
"text": "def pretty_list(list)\n # new_list = \"\"\n # list.each { |item, quantity| new_list << \"You want #{quantity} #{item}\\n\" }\n # return new_list\n list.each { |item, quantity| puts \"You want #{quantity} #{item}\\n\" }\nend",
"title": ""
},
{
"docid": "18a42529927777a010455d59b16be208",
"score": "0.53433794",
"text": "def towerBuilder(n_floors)\n layer = width = n_floors + (n_floors - 1)\n result = []\n\n while layer > 0\n result.unshift((\"*\" * layer).center(width))\n layer -= 2\n end\n result\nend",
"title": ""
},
{
"docid": "42048773d48e2993f0603a92c8efb136",
"score": "0.53332955",
"text": "def render(list=yaml, space_count=0)\n list.each do |nav_item|\n # nav_item is a single element hash\n key, value = nav_item.keys.first, nav_item.values.first\n if value.is_a?(Array)\n self.buffer += \"#{' ' * space_count}#{key}\\n\"\n render value, space_count + 4\n else\n self.buffer += \"#{' ' * space_count}#{key} = #{value}\\n\"\n end\n end\n buffer\n end",
"title": ""
},
{
"docid": "e7b64a7d24805dec2cdabe81b67d54b3",
"score": "0.5325943",
"text": "def create_list\n list = SinglyLinkedList.new\n list.insert_at_start 1\n list.insert_at_start 2\n list.insert_at_start 3\n list.insert_at_end 4\n list.insert_at_start 4\n list.insert_at_end 5\n list\nend",
"title": ""
},
{
"docid": "96312c5733356fb60c7a118ef949f444",
"score": "0.5303541",
"text": "def make_list_possibly_grouped_impl(fnt_list)\n r = \"<table class='method-table table-wrapper'> \\n\"\n fnt_list.each do |name|\n r += '<tr><td class=\"method-name\" align=\"right\"><a href=\"%s\">%s</a></td>' % [name, get_fancy_name(name)]\n r += '<td class=\"method-brief\">%s</td>' % markdownify(get_brief(name)).gsub('<p>','').gsub('</p>', '')\n r += \"</tr>\\n\"\n end\n return r + \"</table>\"\n end",
"title": ""
},
{
"docid": "db644dc121de37ff834d4e85e66fae1b",
"score": "0.5302786",
"text": "def display_list_of_items_packed\n output = []\n output << \"Melinda, here's your packing list!\"\n output << \"Day: #{@attributes[:day_of_week]}, Weather: #{@attributes[:weather]}\"\n output << \"\"\n\n @items.each do |item|\n output << \"- #{item}\"\n end\n output.join(\"\\n\")\n end",
"title": ""
},
{
"docid": "8d9e18aede722a5765c6d435e0aff1cc",
"score": "0.530101",
"text": "def print_list(glist)\n\tputs \"Grocery Shopping list\"\n\tglist.each do |item, count|\n\t\tputs \"#{item}: \".ljust(20) + \" #{count}\".rjust(20)\n\tend\nend",
"title": ""
},
{
"docid": "1adcc50439b65898290d2dcb30a33ac7",
"score": "0.530027",
"text": "def fb_css\n '<style>\n .lists th {\n text-align: left;\n padding: 5px 10px;\n background: #6d84b4;\n }\n\n .lists .spacer {\n background: none;\n border: none;\n padding: 0px;\n margin: 0px;\n width: 10px; \n }\n\n .lists th h4 { float: left; color: white; }\n .lists th a { float: right; font-weight: normal; color: #d9dfea; }\n .lists th a:hover { color: white; }\n\n .lists td {\n margin:0px 10px;\n padding:0px;\n vertical-align:top;\n }\n\n .lists .list {\n background:white none repeat scroll 0%;\n border-color:-moz-use-text-color #BBBBBB;\n border-style:none solid;\n border-width:medium 1px;\n }\n .lists .list .list_item { border-top:1px solid #E5E5E5; padding: 10px; }\n .lists .list .list_item.first { border-top: none; }\n\n .lists .see_all {\n background:white none repeat scroll 0%;\n border-color:-moz-use-text-color #BBBBBB rgb(187, 187, 187);\n border-style:none solid solid;\n border-width:medium 1px 1px;\n text-align:left;\n }\n\n .lists .see_all div { border-top:1px solid #E5E5E5; padding:5px 10px; }\n \n </style>' \n end",
"title": ""
},
{
"docid": "834b807e49811a484b822ff75a05d4bb",
"score": "0.5283121",
"text": "def accept_list_start list\n case list.type\n when :BULLET then\n @list_index << nil\n @list_width << 1\n when :LABEL, :NOTE then\n @list_index << nil\n @list_width << 2\n when :LALPHA then\n @list_index << 'a'\n @list_width << list.items.length.to_s.length\n when :NUMBER then\n @list_index << 1\n @list_width << list.items.length.to_s.length\n when :UALPHA then\n @list_index << 'A'\n @list_width << list.items.length.to_s.length\n else\n raise RDoc::Error, \"invalid list type #{list.type}\"\n end\n\n @list_type << list.type\n end",
"title": ""
},
{
"docid": "ab6ad3dbd0daf33493554fd02087a174",
"score": "0.5282716",
"text": "def list_text\n prepend_list_tag + list + append_list_tag\n end",
"title": ""
},
{
"docid": "7714b09e572836758cab0ab9902f0a7b",
"score": "0.5279954",
"text": "def print_pretty (list_name, list)\n p list_name.upcase.center (100)\n list.each do |x,y|\n p \"#{x.rjust(50)} : #{y.to_s.ljust(50)} \"\n end\nend",
"title": ""
},
{
"docid": "06ad6cfaf68b7b9ced9203d529005c46",
"score": "0.5279485",
"text": "def list_of(things,opts={})\n raise ArgumentError, 'got nil list of things' if things.nil?\n if !opts.delete(:force_list) && things.empty?\n content_tag(:span,'none',opts)\n else\n kind = things.first.table_name rescue 'items'\n add_class_to_html_options(opts, kind)\n add_class_to_html_options(opts, 'records') if things.first.andand.is_a?(ActiveRecord::Base)\n add_class_to_html_options(opts, 'list')\n add_class_to_html_options(opts, 'empty') if things.blank?\n content_tag(\n :ul,\n things.andand.collect do |thing|\n list_item(thing, opts)\n end.andand.join(' '),\n opts\n )\n end\n end",
"title": ""
},
{
"docid": "10421cd609835ac6f2186266d83b89d3",
"score": "0.5278388",
"text": "def print_list\n \t\tputs \"\\n----------------------------\"\n \t\tputs \"#{@date_created.month}/#{@date_created.day}/#{date_created.year}\"\n \t\tputs \"Your Grocery List:\\n\\n\" \t\t\n \t\tif @list.empty?\n \t\t\tputs \"The List Is Empty!\"\n \t\telse\n\n \t@list.each_with_index { |item, index| puts \"#{index+1}. #{item.qty} #{item.name}\" }\n end\n puts \"\\n----------------------------\"\n end",
"title": ""
},
{
"docid": "7233270bac961fa84202814eeacd0a85",
"score": "0.5270881",
"text": "def print_list(list)\r\n puts \"-\"*20\r\n list.each do |item,quantity|\r\n puts \"Item:#{item} quantity:#{quantity}\"\r\n end\r\n puts \"-\"*20\r\n list\r\nend",
"title": ""
},
{
"docid": "1e076958452a777064fc640e9cfee496",
"score": "0.5270544",
"text": "def pretty_list(list)\n\tlist.each do |item, quantity|\n\t\tputs \"There are #{quantity} #{item} on the grocery list.\"\n\tend\nend",
"title": ""
},
{
"docid": "277d504adc12aacb3ef21ec2994d2bdd",
"score": "0.5255655",
"text": "def print_list; end",
"title": ""
},
{
"docid": "0c86b0675c3794df4d08669942e0982b",
"score": "0.525189",
"text": "def make_list(list, points)\n res = \"\"\n pts = points >= 0 ? \"(+ #{points})\" : \"(- #{-points})\" \n if list.length != 0\n list.each { |ch| res << (\" * #{ch} #{pts}\\n\") }\n else\n res << (\"(nothing)\\n\")\n end\n res\n end",
"title": ""
},
{
"docid": "e50b801a0db50acbb8ccab3e9a307205",
"score": "0.5241428",
"text": "def create_list(list)\n print_list(list)\n return list\nend",
"title": ""
},
{
"docid": "a9e19f1e94f9759d82e77851fa364ce0",
"score": "0.52409756",
"text": "def draw_items\n main.newpad items\n @displayed_items = items[current_page * max_items, max_items]\n main.display current_page\n header_l.draw_path_and_page_number path: current_dir.path, current: current_page + 1, total: total_pages\n end",
"title": ""
},
{
"docid": "07f4acba2a3665158fd0d8e45af64f59",
"score": "0.5234083",
"text": "def render_list( items, type: :ul, *args )\n non_empty_content_tag( type, *args ) { render_items( items }\n end",
"title": ""
},
{
"docid": "19a404f3fe86f0dafadb51240317427d",
"score": "0.52106446",
"text": "def build_items\n @pdf.move_down(23 + @push_items_table + @push_down)\n\n items_params = determine_items_structure\n items = build_items_data(items_params)\n headers = build_items_header(items_params)\n data = items.prepend(headers)\n\n options = {\n header: true,\n row_colors: [nil, 'ededed'],\n width: x(540, 2),\n cell_style: {\n borders: []\n }\n }\n\n unless items.empty?\n @pdf.font_size(10) do\n @pdf.table(data, options) do\n row(0).background_color = 'e3e3e3'\n row(0).border_color = 'aaaaaa'\n row(0).borders = [:bottom]\n row(items.size - 1).borders = [:bottom]\n row(items.size - 1).border_color = 'd9d9d9'\n end\n end\n end\n end",
"title": ""
},
{
"docid": "5e6e56e7f55a29a7e8547e46d128b870",
"score": "0.5203353",
"text": "def closed_begin_list(list); end",
"title": ""
},
{
"docid": "62bf77ea616e205edd824f0a2f89c1fe",
"score": "0.52010304",
"text": "def listing(list)\n list.each {|item|puts \"* #{item}\"}\n print \"\\n\"\nend",
"title": ""
},
{
"docid": "d9f99441b75ffd027055265dfa2b0512",
"score": "0.5198225",
"text": "def render_list(cat)\n\tlink_list = []\n\tc = 1\n\tcat.each do |k,v|\n\t\tputs k\n\t\tv.each do |e|\n\t\t\ttitle = e[:title]\n\t\t\tauthor = e[:author]\n\t\t\tduration = e[:duration]\n\t\t\tlink = e[:link]\n\t\t\ttmp = \" [\" + c.to_s + \"] \" + author + \" — \" + title\n\t\t\ttmp += \" \"*(200-tmp.length) # Crappy right alignment for duration\n\t\t\ttmp += duration\n\t\t\tputs tmp\n\t\t\tc+=1\n\t\t\tlink_list << { :title => title, :author => author, :link => link }\n\t\tend\n\tend\n\treturn link_list\nend",
"title": ""
},
{
"docid": "62262f78a11662dc73987abf0dc16ee5",
"score": "0.51947254",
"text": "def createItemList(numbers, list, list_size)\n status = 0\n if list_size > 0\n widest_item = 0\n x = 0\n have = 0\n temp = ''\n if allocListArrays(0, list_size)\n # Create the items in the scrolling list.\n status = 1\n (0...list_size).each do |x|\n number = if numbers then x + 1 else 0 end\n if !self.allocListItem(x, temp, have, number, list[x])\n status = 0\n break\n end\n\n widest_item = [@item_len[x], widest_item].max\n end\n\n if status\n self.updateViewWidth(widest_item);\n\n # Keep the boolean flag 'numbers'\n @numbers = numbers\n end\n end\n else\n status = 1 # null list is ok - for a while\n end\n\n return status\n end",
"title": ""
},
{
"docid": "773720f9eb721348f5c6e4f514301a7d",
"score": "0.5182975",
"text": "def block_docbook_lists( text )\n orig_text = text.dup\n delimiter = \"\"\n text.gsub!( LISTS_RE ) do |match|\n lines = match.split( /\\n/ )\n last_line = -1\n depth = []\n lines.each_with_index do |line, line_id|\n if line =~ LISTS_CONTENT_RE \n tl,continuation,atts,content = $~[1..4]\n if depth.last\n if depth.last.length > tl.length\n (depth.length - 1).downto(0) do |i|\n break if depth[i].length == tl.length\n lines[line_id - 1] << \"</para></listitem>\\n</#{ lD( depth[i] ) }>\\n\"\n depth.pop\n end\n end\n if depth.last.length == tl.length\n lines[line_id - 1] << \"</para></listitem>\"\n end\n end\n unless depth.last == tl\n depth << tl\n atts = docbook_pba( atts )\n atts = shelve( atts ) if atts\n delimiter = lD(tl)\n lines[line_id] = \"<#{ delimiter }#{ atts }>\\n<listitem><para>#{ content.gsub(\"<\",\"<\").gsub(\">\",\">\") }\"\n else\n lines[line_id] = \"<listitem><para>#{ content.gsub(\"<\",\"<\").gsub(\">\",\">\") }\"\n end\n last_line = line_id\n\n else\n last_line = line_id\n end\n if line_id - last_line > 1 or line_id == lines.length - 1\n depth.delete_if do |v|\n lines[last_line] << \"</para></listitem>\\n</#{ lD( v ) }>\"\n end\n end\n end\n lines.join( \"\\n\" )\n end\n text != orig_text\n end",
"title": ""
},
{
"docid": "44fd11c9e02d8d5fea830c0df202affa",
"score": "0.5170781",
"text": "def list_items_in_collection(collection, terminate=false, options={})\n content_tag :ul, class: 'collection-listing' do\n collection.members.inject('') do |output, member|\n output << member_line_item(collection, member, terminate, options)\n end.html_safe\n end\n end",
"title": ""
},
{
"docid": "f70a740f4d9a6cf0c6ec4a1bb7b48981",
"score": "0.51706046",
"text": "def list_groceries(list)\n\tlist.each {|item| puts \"* #{item}\"}\n\tputs \"---------------------------\"\nend",
"title": ""
},
{
"docid": "6f6617be20973b1fe25e5190b7add5f8",
"score": "0.5166504",
"text": "def create_list\n list = SinglyLinkedList.new\n list.insert_at_end 1\n list.insert_at_end 2\n list.insert_at_end 3\n list.insert_at_end 4\n list.insert_at_end 5\n list.insert_at_end 6\n list.insert_at_end 7\n list\nend",
"title": ""
},
{
"docid": "61b4213a8205740d7102b15562f5978d",
"score": "0.516071",
"text": "def dump\n current_size = size\n dumped_items = redis.lrange list_id, 0, current_size - 1\n redis.ltrim list_id, current_size, size - 1 \n dumped_items\n end",
"title": ""
},
{
"docid": "f5f4d206939301403cc763521ee4deca",
"score": "0.5160393",
"text": "def create_list\n @list = Array.new(6) { |i| DexButton.new(@viewport, i) }\n end",
"title": ""
},
{
"docid": "95d176eaa9540729fb6bc7dd7caca448",
"score": "0.51554406",
"text": "def display_list(list)\n\tlist.each do |list_item|\n\t\tputs \"* #{list_item}\"\n\tend\n\nend",
"title": ""
},
{
"docid": "b9f65b7ab8e0ae5591c7d97c844b598d",
"score": "0.5153341",
"text": "def list\n longest = @items.map(&:text).max_by(&:length) || 0\n @items.each_with_index do |todo, index|\n printf \"%s: %-#{longest.size+5}s %s\\n\", index+1, todo.text, todo.context\n end\n end",
"title": ""
},
{
"docid": "96fd163d14da4e3a4068062fcd4d3309",
"score": "0.51425236",
"text": "def print_list\n\t puts \"\"\n\t puts \"\"\n\t\tputs \"#{@list_name}\"\n\t\tprint \"-\" * 40\n\t\t@grocery_list.each {|k, v| puts \"#{k} #{v}\"}\n\t\tputs \"\"\n\t\tget_item\n\tend",
"title": ""
},
{
"docid": "75fa1385539dd1565fbea04f73544824",
"score": "0.5127925",
"text": "def list_dashboards(lista)\n container = \"<div class='box dashboard'>\"\n unless lista.empty?\n container << '<ul>'\n lista.each do |l|\n container << '<li>'\n container << \"<a href='#{l.url}' alt='#{l.name}' title='clique para ir para o atalho : #{l.name}'>\"\n container << image_tag(l.icon,:alt => l.name)\n container << \"<em>#{l.name}</em>\"\n container << \"</a>\"\n container << '</li>'\n end\n container << '</ul>'\n end\n container << '</div>'\n container.html_safe\n end",
"title": ""
},
{
"docid": "f41f94dd6560eb8bfab16b8836507244",
"score": "0.5123249",
"text": "def unordered_list(list_items)\n drapper(\"<ul>#{list.map{ |list_item| \"<li>#{list_item}</li>\" }.join}</ul>\")\n\n\n def button(button_text, class_hash = nil)\n if class_hash\n drapper(\"<button class='#{class_hash[:class]}'>#{button_text}</button>\")\n else\n drapper(\"<button>#{button_text}</button>\")\n end\n end\n end",
"title": ""
},
{
"docid": "c249e875c522385c2ff0c7c71803fa1c",
"score": "0.51212305",
"text": "def print_list(list)\n\tmax_index = list.length;\n\ti=1\n\twhile i<=max_index\n\tprint \"#{i}. #{hash_to_string(list[i-1])}\".center(get_winsize)\n\tprint \"\\n\"\n\ti +=1\n\tend\nend",
"title": ""
},
{
"docid": "d78585199de1a6fa5dc368101bc47b7f",
"score": "0.5120833",
"text": "def printHTML(entriesList, out)\n id = 0\n entriesList.each { |heading,entries|\n out.puts \"<h3>#{heading}</h3>\" if heading\n out.puts \"<ul>\"\n entries.each { |entry|\n out.puts \"<li>\"+entry.toHTML(id)+\"</li>\"\n id += 1\n }\n out.puts \"</ul>\"\n }\nend",
"title": ""
},
{
"docid": "022baa5ba1bdc7188e2e11d62d3f81dc",
"score": "0.51170087",
"text": "def block_docbook_simple_lists( text )\n orig_text = text.dup\n delimiter = \"\"\n text.gsub!( LISTS_RE ) do |match|\n lines = match.split( /\\n/ )\n last_line = -1\n depth = []\n lines.each_with_index do |line, line_id|\n if line =~ /^([_]+)(#{A}#{C}) (.*)$/m\n tl,atts,content = $~[1..4]\n if depth.last\n if depth.last.length > tl.length\n (depth.length - 1).downto(0) do |i|\n break if depth[i].length == tl.length\n lines[line_id - 1] << \"</member>\\n</simplelist>\\n\"\n depth.pop\n end\n end\n if depth.last.length == tl.length\n lines[line_id - 1] << \"</member>\"\n end\n end\n unless depth.last == tl\n depth << tl\n atts = docbook_pba( atts )\n atts = shelve( atts ) if atts\n lines[line_id] = \"<simplelist#{ atts }>\\n<member>#{ content.gsub(\"<\",\"<\").gsub(\">\",\">\") }\"\n else\n lines[line_id] = \"<member>#{ content.gsub(\"<\",\"<\").gsub(\">\",\">\") }\"\n end\n last_line = line_id\n\n else\n last_line = line_id\n end\n if line_id - last_line > 1 or line_id == lines.length - 1\n depth.delete_if do |v|\n lines[last_line] << \"</member>\\n</simplelist>\"\n end\n end\n end\n lines.join( \"\\n\" )\n end\n text != orig_text\n end",
"title": ""
},
{
"docid": "592036b96e16f11db2af63b0970f3765",
"score": "0.51030976",
"text": "def set(list, list_size, filler_char, highlight, box)\n self.setContents(list, list_size)\n self.setFillerChar(filler_char)\n self.setHighlight(highlight)\n self.setBox(box)\n end",
"title": ""
},
{
"docid": "76be50da4c9af8b6adc40456af7bcb45",
"score": "0.5090958",
"text": "def append_to_list(found_list, index_num)\r\n\tputs (\"#{(found_list[index_num][6]+', '+found_list[index_num][7]).truncate(25).ljust(25, \" \")} #{found_list[index_num][1].truncate(40).ljust(40,\" \")} #{found_list[index_num][3].truncate(15).ljust(15,\" \")} #{found_list[index_num][0].to_s.truncate(5).ljust(5,\" \")} #{found_list[index_num][4]}\")\t\r\nend",
"title": ""
},
{
"docid": "5ba47cfa8523d614e41aef7c9d529d02",
"score": "0.50884116",
"text": "def create_list(items)\n\titem_list = {}\n\titem_array = items.split(\" \")\n\tdefault_quantity = 1\n\titem_array.each do |item|\n\t\titem_list[item] = default_quantity\n\tend\n\tpretty_list(item_list) \nend",
"title": ""
},
{
"docid": "9a79bd0853f54ff82c6fcd3a05f01a3e",
"score": "0.50707155",
"text": "def draw\n lines = []\n\n indent = @height - 1\n draw_braches(lines, indent)\n\n lines\n end",
"title": ""
},
{
"docid": "ed3fe353a86d1276316c3e5f669ad8af",
"score": "0.50616837",
"text": "def render_items\n @items.reverse_each_with_index do |item, index|\n # Skip if item is already in\n next if item.parent\n\n next_item = @items[index + 1]\n if next_item\n # If there is a nex item isert before it\n next_id = next_item.data[key]\n el = @items.find { |element| element.data[key] == next_id }\n insert_before item, el\n else\n # Else append at the end\n item >> self\n end\n end\n end",
"title": ""
},
{
"docid": "83a03ff06041d41de25f34a1ffd42986",
"score": "0.50532126",
"text": "def comment_list(list, base_indent='')\n commented_list = \"\"\n ids = list.split(/,/)\n ids.each do |id|\n id.gsub!(/\\s*$/, '')\n id.gsub!(/^\\s*/, '')\n list_id = \"#{id}\"\n list_id += ',' if id != ids.last\n id.gsub!(/\\=.*$/, '') \n id.gsub!(/\\[.*\\]/, '') \n id.gsub!(/\\s*$/, '')\n id.gsub!(/^\\s*/, '') \n id.gsub!(/;/, '') \n id.gsub!(/\\s*\\:\\s*\\d+/,'') \n doc_id = id.split(/\\s/).last\n doc_id.gsub!(/\\*/, '') \n commented_list += \"#{base_indent}\" if id != ids.first \n commented_list += \"#{@indent}\\t#{list_id} /**< <##{doc_id} description#> */\"\n commented_list += \"\\n\" if id != ids.last \n end\n commented_list \n end",
"title": ""
},
{
"docid": "60c86b549f760f7c5f5e866674052fe6",
"score": "0.50478256",
"text": "def createDisplaysList\n for x in 1..@numberOfFloors do\n @floorDisplaysList.append(Display.new(x, DisplayStatus::ON, x))\n # puts \"elevator#{@id} display floor #{@floorDisplaysList[x - 1].id} created\"\n end\n end",
"title": ""
},
{
"docid": "825e699f4d57dcde240373dd58452240",
"score": "0.50462973",
"text": "def build\n \n data = heading(:css_location => \"css/html-cutlist.css\").to_s\n \n data += page_title().to_s\n \n # Get all the parts in an array of part hashes.\n all_parts = @parts.grouped\n\n # # Sort parts.\n # all_parts = all_parts.sort { |a, b|\n # a['material'] <=> b['material']\n # # a['thickness'] <=> b['thickness']\n # # a['width'] <=> b['width']\n # # a['length'] <=> b['length']\n # }\n\n # Create an empty array of materials.\n materials = []\n\n # Put all the materials in the list\n all_parts.each { |p|\n materials.push(p['material']) \n }\n\n # Make sure there is only one of each material.\n materials = materials.uniq\n\n # Create a blank hash to put sorted parts into.\n grouped_parts = {}\n\n # Create a new list of hashes that represent the material and then the parts \n # that are of that material (a blank hash).\n materials.each { |m| \n grouped_parts[m] = {}\n }\n\n # Loop through each part, adding it to the right key in the sorted_list.\n all_parts.each { |p| \n\n # Go through the list of materials.\n materials.each { |m|\n\n if p['material'] == m\n \n # If the \"round_dimensions\" setting is on, round the dimension to \n # three decimal places so we don't have a lot of entries in the \n # grouped_parts list like \"3.750000001\", \"3.750000002\", etc... but \n # instead have one entry like \"3.750\". This way grouping behaves \n # as expected.\n rounded_thickness = @options['round_dimensions'] ? format(\"%0.3f\", p['thickness']).to_f : p['thickness']\n \n # Check to see if there is a key for this thickness and if there is \n # append the part to the array of parts.\n if grouped_parts[m][rounded_thickness]\n grouped_parts[m][rounded_thickness] += [p]\n # If there isn't a key for this thickness, create it now and add the \n # part array.\n else\n grouped_parts[m][rounded_thickness] = [p]\n end\n\n end\n\n }\n\n }\n \n # Sort by materials.\n parts_by_material = grouped_parts.sort { |a,b|\n a[0] <=> b[0]\n }\n\n # List all the parts, grouped.\n parts_by_material.each { |t| # t for thickness.\n\n # Sort thicknesses.\n parts_by_thickness = t[1].sort { |a,b|\n a[0] <=> b[0]\n }\n parts_by_thickness.reverse!\n\n # Go through each thickness key.\n parts_by_thickness.each { |p| # p for parts\n\n # Sort parts by width, then length.\n parts = p[1].sort { |a,b|\n a['width'] <=> b['width']\n # TODO: Get sub-sorting by length.\n # a['length'] <=> b['length']\n }\n parts.reverse!\n \n # Create a parts array to store the parts in.\n parts_array = []\n \n # Go through the parts that are of a specific thickness.\n parts.each { |part| \n \n # Check if part is a sheet good.\n if @options[\"show_sheets\"] && part['is_sheet']\n parts_array.push(part)\n end\n\n # Check if part is solid stock.\n if @options[\"show_solids\"] && part['is_solid']\n parts_array.push(part)\n end\n\n # Check if part is hardware.\n if @options[\"show_hardware\"] && part['is_hardware']\n parts_array.push(part)\n end\n # puts \"#{p['sub_assembly']} -- #{p['part_name']} -- #{p['quantity']} -- #{p['material']} -- Sheet? #{p['is_sheet']} -- Solid? #{p['is_solid']} -- Hardware? #{p['is_hardware']} -- #{p['width']} x #{p['length']} x #{p['thickness']}\"\n \n }\n \n # If there are items in the parts_array, then add the section heading \n # and the array of parts. If there are no parts, show nothing.\n if parts_array.length != 0\n data += section_heading(\"#{p[0].to_fraction(true)} #{t[0]}\")\n data += rows(parts_array)\n end\n \n # TODO: Put section footer here, if needed...\n \n }\n }\n \n data += footer().to_s\n \n # Return the results.\n data\n \n end",
"title": ""
},
{
"docid": "1f6c35420bbbceb470f56c139bb6c600",
"score": "0.50415814",
"text": "def createlist(items)\n new_items = items.split(\" \")\n list = Hash.new\n new_items.each {|item| list[item] = 1}\n prettylist(list)\n # use print_list method\nend",
"title": ""
},
{
"docid": "62f61844ca8d01e78a9ddeec2e92a302",
"score": "0.5038469",
"text": "def unordered_list; end",
"title": ""
},
{
"docid": "d6ddeb5c1f91a9b18a69b79e56ed3d02",
"score": "0.5035869",
"text": "def block_textile_lists( text ) \n text.gsub!( LISTS_RE ) do |match|\n lines = match.split( /\\n/ )\n last_line = -1\n depth = []\n lines.each_with_index do |line, line_id|\n if line =~ LISTS_CONTENT_RE \n tl,atts,content = $~[1..3]\n if depth.last\n if depth.last.length > tl.length\n (depth.length - 1).downto(0) do |i|\n break if depth[i].length == tl.length\n lines[line_id - 1] << \"</li>\\n\\t</#{ lT( depth[i] ) }l>\\n\\t\"\n depth.pop\n end\n end\n if depth.last and depth.last.length == tl.length\n lines[line_id - 1] << '</li>'\n end\n end\n unless depth.last == tl\n depth << tl\n atts = pba( atts )\n atts = shelve( atts ) if atts\n lines[line_id] = \"\\t<#{ lT(tl) }l#{ atts }>\\n\\t<li>#{ content }\"\n else\n lines[line_id] = \"\\t\\t<li>#{ content }\"\n end\n last_line = line_id\n\n else\n last_line = line_id\n end\n if line_id - last_line > 1 or line_id == lines.length - 1\n depth.delete_if do |v|\n lines[last_line] << \"</li>\\n\\t</#{ lT( v ) }l>\"\n end\n end\n end\n lines.join( \"\\n\" )\n end\n end",
"title": ""
},
{
"docid": "55855829bf6f040cea401e16475178a8",
"score": "0.50357634",
"text": "def setContents(list, list_size)\n if !self.createList(list, list_size)\n return\n end\n\n # Set the information in the scrolling list.\n @scroll_field.set(@list, @list_size, false,\n @scroll_field.highlight, @scroll_field.box)\n\n # Clean out the entry field.\n self.setCurrentItem(0)\n @entry_field.clean\n\n # Redraw the widget.\n self.erase\n self.draw(@box)\n end",
"title": ""
},
{
"docid": "b1939e0016e9002639ed9c036fab20d0",
"score": "0.50304043",
"text": "def list\n @list_helper ||= ListWrapper.new(self)\n end",
"title": ""
},
{
"docid": "a78b2a1658f3e9a82c58b3d0e633b3d6",
"score": "0.5023929",
"text": "def pretty_in_print(list)\n puts \"---------------------------------------\"\n puts \"These are the items we are gonna buy\"\n list.each {|item, qty| puts \"#{qty} pieces of #{item}\" }\nend",
"title": ""
},
{
"docid": "fb5efd597ab95af073b681d24b130a4c",
"score": "0.5020426",
"text": "def print_list(grocery_list)\n line_width = 30\n puts\n puts ('Grocery List'.center(line_width))\n puts\n puts (\"ITEMS\".ljust(line_width/2)) + \"QTY\".rjust(line_width/2)\n puts (\"------------------------------\").center(line_width)\n grocery_list.each { |item, quantity| \n puts (item.ljust(line_width/2)) + quantity.to_s.rjust(line_width/2)\n puts (\"------------------------------\") }\nend",
"title": ""
},
{
"docid": "3e9d5d9433611e6ef0c8d6769cff81fe",
"score": "0.5016858",
"text": "def accept_list_item_start list_item\n bullet = case @list_type.last\n when :BULLET then\n '*'\n when :NOTE, :LABEL then\n labels = Array(list_item.label).map do |label|\n attributes(label).strip\n end.join \"\\n\"\n\n labels << \":\\n\" unless labels.empty?\n\n labels\n else\n @list_index.last.to_s + '.'\n end\n\n case @list_type.last\n when :NOTE, :LABEL then\n @indent += 2\n @prefix = bullet + (' ' * @indent)\n else\n @prefix = (' ' * @indent) + bullet.ljust(bullet.length + 1)\n\n width = bullet.gsub(/\\e\\[[\\d;]*m/, '').length + 1\n\n @indent += width\n end\n end",
"title": ""
},
{
"docid": "db1c451ba323bc8a1f1ebc5a3aa747be",
"score": "0.5016672",
"text": "def ordered_list; end",
"title": ""
},
{
"docid": "bb994808b6cb202047348c381931ecae",
"score": "0.50142926",
"text": "def initialize\n super\n flight_results_list.define_list_elements(list_item: \"div[class*='flightRow']\")\n end",
"title": ""
},
{
"docid": "f933fa3a1a3520737a3f9876384bc636",
"score": "0.50133884",
"text": "def make_list(array)\n string = \"\"\n array.each_with_index do |item, index|\n index < array.length-1? c = \", \": c = \"\"\n formatted_item = \"#{index +1}. #{item}#{c}\"\n string = string.concat(formatted_item)\n end\n string\nend",
"title": ""
},
{
"docid": "2f166db11b6cc81b291fc125d739e9d4",
"score": "0.5009214",
"text": "def remove_whitespace_from_list_items!\n @document.tree.search('li span').each { |span| span.inner_html.strip! }\n end",
"title": ""
},
{
"docid": "a0aa97941065137577ceae8aa572789a",
"score": "0.49962986",
"text": "def list(name, entries)\n values = entries[0..11].collect do |item|\n {\"listItem\" => item}\n end\n\n push(name, {\"list\" => values})\n end",
"title": ""
},
{
"docid": "343b03d0d5e9b7baba8d1902111dd133",
"score": "0.49905628",
"text": "def from_list_to_html(list, depth_to_traverse=1000, start_depth=0)\n depth = start_depth\n if list.is_a?(Array) && !list.empty?\n str =''\n str << '<ul>'\n depth += 1\n list.each do |value|\n unless depth > depth_to_traverse\n str << \"<li> #{value} </li> \"\n if value.is_a?(Array) \n str << from_hash_to_html(value, depth_to_traverse, depth)\n end\n end\n end\n str << '</ul> '\n return str\n end\n return ''\n end",
"title": ""
},
{
"docid": "67ff85c9f7c30351b8c0b64ef728780e",
"score": "0.49900475",
"text": "def list_formatter(list)\n\tlist.each do |item, quanity|\n\t\tputs \"we need #{quanity} of #{item}\"\n\tend\nend",
"title": ""
},
{
"docid": "cd812aa7dc898d80c7f07e55fe8d1949",
"score": "0.498825",
"text": "def print_list(list)\r\n puts \"_-\" *25 + \"\\n\\n\"\r\n puts \"Here is your Grocery List: \\n\\n\"\r\n list.each do |item, quantity|\r\n puts \"\\tItem: #{item} \\tAmount: #{quantity}\"\r\n end\r\n puts \"_-\" *25\r\nend",
"title": ""
},
{
"docid": "19dd9676af2247935ddd503299bd5972",
"score": "0.49868318",
"text": "def humanize_file_list( list, indent=FILE_INDENT )\n\tlisttext = list[0..5].join( \"\\n#{indent}\" )\n\tif list.length > 5\n\t\tlisttext << \" (and %d other/s)\" % [ list.length - 5 ]\n\tend\n\t\n\treturn listtext\nend",
"title": ""
},
{
"docid": "ed4c92474604e10f51b3eb5d63f09cc6",
"score": "0.4976296",
"text": "def _non_summary_list(list)\n list_for_display = []\n list.each do |item|\n list_for_display += [item.to_hash]\n end\n\n list_for_display\n end",
"title": ""
},
{
"docid": "8a03310cb986ceda16bfeb524e4164dc",
"score": "0.49750802",
"text": "def compile_dlist(list_tag, lexer)\n first = lexer.peek\n items = []\n loop do\n term_line = lexer.read\n break if term_line.tag == :eof\n unless term_line.lead_space.size == first.lead_space.size && term_line.tag == list_tag\n lexer.unread term_line\n break\n end\n inner = inner_indent(term_line)\n term = term_line.string[inner.size..-1]\n desc = compile_blocks(lexer, nil){|line|\n line.tag == list_tag && line.lead_space.size == term_line.lead_space.size\n }\n items << [term, desc]\n end\n {list_tag => {line: first.lineno, items: items.compact}}\n end",
"title": ""
},
{
"docid": "71cfcd54803e4afa7dc393a58260e746",
"score": "0.4968166",
"text": "def list; end",
"title": ""
},
{
"docid": "71cfcd54803e4afa7dc393a58260e746",
"score": "0.4968166",
"text": "def list; end",
"title": ""
},
{
"docid": "71cfcd54803e4afa7dc393a58260e746",
"score": "0.4968166",
"text": "def list; end",
"title": ""
},
{
"docid": "71cfcd54803e4afa7dc393a58260e746",
"score": "0.4968166",
"text": "def list; end",
"title": ""
},
{
"docid": "71cfcd54803e4afa7dc393a58260e746",
"score": "0.4968166",
"text": "def list; end",
"title": ""
},
{
"docid": "2380f0fc8c2a97b76040debd4d22e58e",
"score": "0.4966803",
"text": "def list\n @element.content.map do |paragraph_element|\n line_item = paragraph_element.content.map do |text_element|\n text_exporter.new(text_element).export\n end.join\n\n \"<li>#{line_item}</li>\"\n end.join\n end",
"title": ""
},
{
"docid": "23e9c440d08e6dd83b6a8fd006cabb18",
"score": "0.49662542",
"text": "def pretty_list(list)\r\n\tlist.each { |item, quantity| puts \"Item: #{item.capitalize} - Amount: #{quantity}\" }\r\nend",
"title": ""
},
{
"docid": "ebc888f37c639de58baf0e8976d36379",
"score": "0.49641767",
"text": "def accept_list_item_end list_item\n width = case @list_type.last\n when :BULLET then\n 2\n when :NOTE, :LABEL then\n if @prefix then\n @res << @prefix.strip\n @prefix = nil\n end\n\n @res << \"\\n\"\n 2\n else\n bullet = @list_index.last.to_s\n @list_index[-1] = @list_index.last.succ\n bullet.length + 2\n end\n\n @indent -= width\n end",
"title": ""
},
{
"docid": "8c96d966b0db941c5d913c67581cd00a",
"score": "0.49583083",
"text": "def closed_end_list(list); end",
"title": ""
}
] |
2ffdeb95bb33df639c66784d88cf0d23 | gain_power, should take an argument of a number and INCREASE the power_level by that number | [
{
"docid": "762f38f47d4141dbb3c9b692827e128c",
"score": "0.75000083",
"text": "def gain_power(num1, num2)\n puts num1 + num2 # <=something is wrong here...\n # how to reference variable power_level?\n end",
"title": ""
}
] | [
{
"docid": "aebca67ada34adba2d24042ff72865f9",
"score": "0.88253075",
"text": "def gain_power(number)\n @@power_level = @@power_level + number\n end",
"title": ""
},
{
"docid": "9434d573cd05212ca3ed67e67f56d5d1",
"score": "0.82448596",
"text": "def gain_power(i)\n power_level + i\n end",
"title": ""
},
{
"docid": "f672dbd6f828399581684c80a27f528c",
"score": "0.74265087",
"text": "def power_increase(input)\n if @choice[:good].include?(input)\n @power += 5\n elsif @choice[:bad].include?(input)\n @power -= 5\n end\n @power\n end",
"title": ""
},
{
"docid": "a63f8bfacc15d1227ac6cac360010296",
"score": "0.7167257",
"text": "def gain_xp(int)\n\t\t@xp += int\n\t\tnew_level = (@xp * 0.01) + 1\n\t\tif new_level.floor > @level\n\t\t\t@level = new_level.floor\n\t\t\tputs \"\\nYou are now level #{@level}\"\n\t\telse\n\t\tend\n\tend",
"title": ""
},
{
"docid": "665ad9decb78f331e85747f7e4a0c6da",
"score": "0.70736223",
"text": "def exp_gain(exps)\n self.update_attribute(:exp,\"#{self.exp + exps}\")\n if self.exp >= self.exp_next\n self.update_attribute(:exp_next,\"#{self.exp_next + (10 * 2**(self.lvl))}\")\n self.update_attribute(:lvl,\"#{self.lvl + 1}\")\n self.update_attribute(:total_points,\"#{self.total_points + 1}\")\n end\n end",
"title": ""
},
{
"docid": "aef3f1f27a6e57e26c9f0601c08d800e",
"score": "0.70238215",
"text": "def increase_power_by(power_update)\n self.power += power_update\n end",
"title": ""
},
{
"docid": "f69303cab9b7e28ec469b5ae930e5289",
"score": "0.68973404",
"text": "def power=power\n set_power(power)\n end",
"title": ""
},
{
"docid": "a6656b589174563c9b44225e1993a3b9",
"score": "0.68103427",
"text": "def powered(base, power)\n if power == 1\n base\n else\n base * powered(base, power - 1)\n end\nend",
"title": ""
},
{
"docid": "cde3b80ee2fd62ec0582dc54816b35e1",
"score": "0.678341",
"text": "def set_power_level power_level\n puts \"Set power to #{power_level}\"\nend",
"title": ""
},
{
"docid": "a3a13b23b4193bdcfeda43cf899f86a4",
"score": "0.6771118",
"text": "def gain_exp(exp, show)\n if double_exp_gain\n change_exp(@exp + exp * 2, show)\n else\n change_exp(@exp + exp, show)\n end\n end",
"title": ""
},
{
"docid": "3b977e4d1ddaa8516c5ba219ff5bd237",
"score": "0.6725132",
"text": "def power(n, power); n**power end",
"title": ""
},
{
"docid": "c33732e63ed951c322c681a4d6718e02",
"score": "0.66392654",
"text": "def increase_level\n @level += 1\n set_production_current_level_rate\n end",
"title": ""
},
{
"docid": "a7cbe15ca6858aff73febb27cb92d415",
"score": "0.6633547",
"text": "def power(base, power)\n\tbase ** power\nend",
"title": ""
},
{
"docid": "41203762c6100a240cb94b93176ad32f",
"score": "0.65843105",
"text": "def power(exponent)\nend",
"title": ""
},
{
"docid": "430debfc6b06f539b19b575a6397bd41",
"score": "0.657443",
"text": "def on_M1_gain_value_changed\n msg_cmd(@wfsock, \"m1_gain\", @m1_gain.value)\n end",
"title": ""
},
{
"docid": "67b4b5a96e4cbbc8ea0653e8a9070ae2",
"score": "0.6564834",
"text": "def set_power(power, effect='smooth', duration=200)\n request({id: 6,method: 'set_power', params: [power,effect,duration]})\n end",
"title": ""
},
{
"docid": "52411b0583955997d4d1600783bc125c",
"score": "0.65468156",
"text": "def on_gain; end",
"title": ""
},
{
"docid": "4bb91e6029b233206b035b79f133450c",
"score": "0.65295196",
"text": "def power(base, exponent)\n # YOUR WORK HERE\nend",
"title": ""
},
{
"docid": "2a53ef0b2883f332931aadd7ce317984",
"score": "0.6516236",
"text": "def set_gain(band, gain)\n index = (BANDS.index(band) * 4) + 3\n set_float(index, gain.clamp(-30.0, 30.0))\n self\n end",
"title": ""
},
{
"docid": "c5ccf9e4b7b7203d497e659309aba97e",
"score": "0.6494385",
"text": "def power(base, power)\n base ** power\n end",
"title": ""
},
{
"docid": "503c1995ccfd4a1db8c44cce0e3d6bb9",
"score": "0.64940554",
"text": "def power(num, power)\n multiply(num, 1)**power\nend",
"title": ""
},
{
"docid": "4a48624c8cf988dfc33f0d7a93f3fe16",
"score": "0.6490344",
"text": "def coin_gain=(value)\n @coin_gain.text = format(COIN_GAIN_FORMAT, value.to_i)\n end",
"title": ""
},
{
"docid": "4a60864889489f3f217892eefb3aef35",
"score": "0.64788294",
"text": "def calculate_xp_to_level(level, coefficient = COEFFICIENT)\n (level ** 2) / coefficient\n end",
"title": ""
},
{
"docid": "e8413dbee8d8e077f24677a2fb5d1bd5",
"score": "0.64586085",
"text": "def track_gain=(value)\n case\n when value.is_a?(Numeric)\n new_gain = track_gain\n new_gain.adjustment = value\n @value[4, 2] = new_gain.to_bin\n when value.is_a?(RGADAdjustment)\n @value[4, 2] = value.to_bin\n else\n raise(ArgumentError,\"track gain doesn't recognize #{value.inspect}\")\n end\n end",
"title": ""
},
{
"docid": "3359fbde1896d222bb5a682af85f2e90",
"score": "0.64552945",
"text": "def gango_pow(base, exp)\n power = 1\n exp.times do\n power *= base\n end\n power\nend",
"title": ""
},
{
"docid": "9e4f5ed1bcd4d2167dfb8a8717400492",
"score": "0.6443402",
"text": "def power_level\n @power_level ||= hundred_digit(((rack_id * y) + grid.serial_number) * rack_id) - 5\n end",
"title": ""
},
{
"docid": "039382957b7132af9c6575dfc82afe1a",
"score": "0.6442486",
"text": "def power(number=1, powerValue=1)\n return number**powerValue, 90\nend",
"title": ""
},
{
"docid": "4abfb07e103230150560aaf94dfa4877",
"score": "0.64200634",
"text": "def gain_exp(exp, show)\n #noinspection RubyArgCount\n earn_exp_wo_bonus((exp * exp_bonus).to_i, show)\n end",
"title": ""
},
{
"docid": "39a35fd734caf172f3cecbf77cabb555",
"score": "0.6409294",
"text": "def on_M1_gain_value_changed\n # msg_cmd(@wfsock, \"m1_gain\", @m1_gain.value)\n end",
"title": ""
},
{
"docid": "39a35fd734caf172f3cecbf77cabb555",
"score": "0.6409294",
"text": "def on_M1_gain_value_changed\n # msg_cmd(@wfsock, \"m1_gain\", @m1_gain.value)\n end",
"title": ""
},
{
"docid": "92c1babb7c7954e442da9cbb2ead7fd0",
"score": "0.6409082",
"text": "def total_power\n\t\t1000 \n\tend",
"title": ""
},
{
"docid": "f409096989adae3eead8da9dd30dce17",
"score": "0.6400794",
"text": "def exp(number,power)\n return 1 if power == 0\n number * exp(number,power-1)\nend",
"title": ""
},
{
"docid": "fa7af4d5b0969037820fc1c65768ddc1",
"score": "0.6377576",
"text": "def power\n write(133)\n end",
"title": ""
},
{
"docid": "cf84f0ad2c892026cc45d53119295cf8",
"score": "0.6372879",
"text": "def power\n @power\n end",
"title": ""
},
{
"docid": "690014153b90776a2aee9561afdbd317",
"score": "0.6342263",
"text": "def set_power(integer)\n raise \"power must be a whole number (Integer)\" unless integer.is_a?(Integer)\n @power = integer\n end",
"title": ""
},
{
"docid": "314767cbf5014c2ff99720fffcaaed7d",
"score": "0.6340401",
"text": "def exponentiate(base, power)\n return 1 if power == 0\n return (exponentiate(base, power - 1)) * base\n\nend",
"title": ""
},
{
"docid": "339f226b47f4c20b29823b7aea2eb091",
"score": "0.6332641",
"text": "def gain_xp(xp_gained)\n @current_xp += xp_gained\n return xp_gained\n end",
"title": ""
},
{
"docid": "391bf8657b4f42786b6282a8f5099ba3",
"score": "0.6326016",
"text": "def shop_power\n if @hero.experience >= 5\n @hero.update(power: @hero.power + 3)\n @hero.update(experience: @hero.experience - 5)\n puts \"Power increased! #{@hero.name} has #{@hero.power} power.\"\n else\n puts \"Sorry, you don't have enough experience to buy this.\"\n end\n sleep(3)\n current_game\n end",
"title": ""
},
{
"docid": "91df30bdbbe626d2d831e1a32d1d6c04",
"score": "0.63215786",
"text": "def set_attack_power(attacker)\n case Damage_Algorithm_Type\n when 0\n atk_pow = attacker.weapon_attack - (battler_defense(attacker) / 2)\n when 1\n atk_pow = attacker.weapon_attack - ((attacker.weapon_attack * battler_defense(attacker)) / 1000)\n when 2, 4\n atk_pow = 20\n when 3\n atk_pow = (10 + attacker.weapon_attack) - (battler_defense(attacker) / 2)\n end\n return atk_pow\n end",
"title": ""
},
{
"docid": "d16a36d2a99a258249b6bd572096ec27",
"score": "0.63206315",
"text": "def set_gain\n @gain = Gain.find(params[:id])\n end",
"title": ""
},
{
"docid": "17c94c337268ab7861405d01afce0a3d",
"score": "0.63190424",
"text": "def gain_xp(amount)\r\n\t\t@xp += amount\r\n\t\tlevel_up if @xp >= @next_level[0] #>> should check if you've earned enough to reach next level\r\n\t\t@xp\r\n\tend",
"title": ""
},
{
"docid": "55483dfcbaf965a8fadf69cb330552b8",
"score": "0.6314646",
"text": "def exponent1(base, power)\n return 1 if power == 0\n smaller_power = power - 1\n b * exponent1(base, smaller_power )\nend",
"title": ""
},
{
"docid": "472f666437a4555422ea8669a55f323f",
"score": "0.6300669",
"text": "def change_level(level, show)\n level = [[level, 99].min, 1].max\n change_exp(@exp_list[level], show)\n end",
"title": ""
},
{
"docid": "2e0a92640d1882e997afbcf597208bf1",
"score": "0.62756044",
"text": "def exponent(base, power)\n return 1 if power == 0\n base * exponent(base, power -1)\nend",
"title": ""
},
{
"docid": "485ea84251861cd8094c1c4386424081",
"score": "0.62630343",
"text": "def pow(base_num, pow_num)\n base_num * base_num * base_num\nend",
"title": ""
},
{
"docid": "559dd8c6fbb1ab64a006f7eecb34cecf",
"score": "0.62302864",
"text": "def exponent1(base, power)\n return 1 if power == 0\n base * exponent1(base, power-1)\nend",
"title": ""
},
{
"docid": "e324c97bf9a6aa204e8054eae56ceb77",
"score": "0.62220657",
"text": "def power(n, power)\n multiply(n, n**(power-1))\nend",
"title": ""
},
{
"docid": "72e7a86eb15d89797727586a1411f87c",
"score": "0.62192893",
"text": "def power=(num)\n return @power = num.ord & 0b00111111\n end",
"title": ""
},
{
"docid": "7f3f1b639bac10aac734e25b4d83e7fa",
"score": "0.62138146",
"text": "def next_level\n power_ups[level]\n end",
"title": ""
},
{
"docid": "a7eb3f5f215b009aa3b113bbbf9e2e89",
"score": "0.6212914",
"text": "def exponent1(base, power)\n # base case\n return 1 if power < 1\n return base if power == 1\n\n base * exponent(base, power - 1)\nend",
"title": ""
},
{
"docid": "08004332f1db30adb6329859a308d550",
"score": "0.6201385",
"text": "def power( value, pow )\n result = 0\n for i in 0..pow\n result *= result\n end\n result\nend",
"title": ""
},
{
"docid": "5cc00e97f0669892d73186ffb14c29df",
"score": "0.6195078",
"text": "def gain_synthesis_exp(exp)\n change_synthesis_exp(@synthesis_exp + exp) unless max_synthesis_level?\n end",
"title": ""
},
{
"docid": "2ef945e5b9187577a637da7e48b8ae80",
"score": "0.6194777",
"text": "def increase_holy_power\n @sim.player.holy_power +=1 unless @sim.player.holy_power == 3\n end",
"title": ""
},
{
"docid": "7a31450f12167011fdaff2855d681280",
"score": "0.61918193",
"text": "def exp(base,power)\n return 1 if power == 0\n base * exp(base,power-1)\nend",
"title": ""
},
{
"docid": "139c1f92820beccd43733eb6c27d1444",
"score": "0.61862904",
"text": "def power_of(num, power)\n num = multiply(num, num)\n num ** power\nend",
"title": ""
},
{
"docid": "393688d4c68a41d03ff93e3ab06029df",
"score": "0.6181803",
"text": "def level=(level)\n # Check up and down limits\n level = [[level, maxlevel].min, 1].max\n # Change EXP\n self.exp = @exp_list[level]\n end",
"title": ""
},
{
"docid": "77be64b2e57b03bfc99aacd9a1f0343d",
"score": "0.61736846",
"text": "def power(base_num, pow_num)\n result=1\n pow_num.times do |i|\n result= result * base_num\n end\n return result\nend",
"title": ""
},
{
"docid": "0a9816e40c4a6dc4bed16711ded450b1",
"score": "0.6172101",
"text": "def exp1(b,power)\r\n return 1 if power==0\r\n\r\n b*exp1(b,power-1)\r\nend",
"title": ""
},
{
"docid": "e51eae78031ea6d7e13b70a278eb4694",
"score": "0.6171009",
"text": "def power(base,exp)\n return base ** exp \nend",
"title": ""
},
{
"docid": "0d26de6e5ba4a9dc87ce9bf29cc41ce4",
"score": "0.6167543",
"text": "def exponent_1(base, power)\n return 1 if power == 0\n base * exponent_1(base, power - 1)\nend",
"title": ""
},
{
"docid": "bd70055a481b98a5bd0a22d987a9b820",
"score": "0.6163098",
"text": "def power number, exponent\n number**exponent\nend",
"title": ""
},
{
"docid": "759214955b81a17ffb0ed7a81dd0a79d",
"score": "0.616146",
"text": "def power=(power)\n power = getValue(power) { |v|\n self.power = v\n }\n\n if (@power == power)\n return\n end\n\n url = \"#{@url}&signal_type=noise&power=#{power}\"\n NodeHandler.service_call(url, \"Can't set power to #{@power}\")\n @power = power\n end",
"title": ""
},
{
"docid": "6a273acae09d21df8a0ed256f6bd0190",
"score": "0.6152125",
"text": "def power(base, pow)\n result = 1\n pow.times do\n result = result * base\n end\n result\nend",
"title": ""
},
{
"docid": "085a2c09f9ebe5c8c72dc68c2cb7e178",
"score": "0.6135757",
"text": "def exponent_v1(b, power)\r\n return 1 if power == 0\r\n \r\n b * exponent_v1(b,power - 1)\r\n\r\nend",
"title": ""
},
{
"docid": "a8e505f760a48ef580cacc229f50953f",
"score": "0.61346895",
"text": "def power(base, exponent)\n val = 1\n exponent.times do \n val = val * base\n end\n val\nend",
"title": ""
},
{
"docid": "f4a1a6235a23f758c635a79d4fbe0ac3",
"score": "0.61178285",
"text": "def calculate_level(param)\n\tcurrent_level = dbGet(param, 'level').to_i\n\trequired_exp_new_level = current_level * LEVEL_FACTOR\n\tif dbGet(param, 'exp').to_i >= required_exp_new_level\n\t\tnew_level = current_level + 1\n\t\tdbSet(param, 'level', new_level)\n\t\tdbSet(param, 'exp', 0)\n\t\trandweapon = rand(5)\n\t\trandarmor = rand(5)\n\t\tdbSet(param, 'weapon', randweapon)\n\t\tdbSet(param, 'armor', randarmor)\n\t\tnew_weapon = WEAPONS[new_level][randweapon]\n\t\tnew_armor = ARMOR[new_level][randarmor]\n\n\t\tchan = @bot.channels.sample\n\t\tchannel = Channel(chan)\n\n\t\tchannel.msg '----------------------------------------------------'\n\t\tchannel.msg \"#{BOLD}-> #{BLUE}#{param}#{CF} reaches level #{ORANGE}#{dbGet(param, 'level')}#{CF}! Equips a new [#{PURPLE}#{new_weapon['name']}#{CF} | DMG: #{PINK}1#{CF}-#{PINK}#{new_weapon['damage']}#{CF} | ELE: #{wrapInElementColor(new_weapon['element'], new_weapon['element'])}] and [#{PURPLE}#{new_armor['name']}#{CF} | ARM: #{BROWN}0#{CF}-#{BROWN}#{new_armor['armor']}#{CF} | ELE: #{wrapInElementColor(new_armor['element'], new_armor['element'])}]\"\n\tend\nend",
"title": ""
},
{
"docid": "61553d38368db9b7c8f77107efd4394b",
"score": "0.6108388",
"text": "def power(base, exp)\n if exp == 0\n 1\n else\n base * power(base, exp-1)\n end\nend",
"title": ""
},
{
"docid": "52af3035d965baf5245497d3b0e30fde",
"score": "0.61069316",
"text": "def exponentiation_1(base, power)\n return 1 if power <= 0\n base * exponentiation_1(base, power - 1)\nend",
"title": ""
},
{
"docid": "52af3035d965baf5245497d3b0e30fde",
"score": "0.61069316",
"text": "def exponentiation_1(base, power)\n return 1 if power <= 0\n base * exponentiation_1(base, power - 1)\nend",
"title": ""
},
{
"docid": "877b9c5478c49be7dbc5232b2de71550",
"score": "0.6103671",
"text": "def exponent(base, power)\n power > 1 && power % 2 == 0 ? exponent(base, power / 2) * exponent(base,power / 2) : power > 1 && power % 2 != 0 ? base * (exponent(base, (power - 1) / 2) * exponent(base, (power -1) / 2)) : base == 2 && power == 0 ? 1 : base\n end",
"title": ""
},
{
"docid": "3cbd203dc94e3d02a634622554314730",
"score": "0.60993725",
"text": "def power(num, power)\n result = 1\n loop do \n break if power == 0\n result = multiply(result, num)\n power = power - 1\n end\n result\nend",
"title": ""
},
{
"docid": "302203a50d592ca7545ce64b0e863cce",
"score": "0.60979605",
"text": "def power base, exponential\n power = 1\n i = 0\n while i < exponential do\n power = power*base\n i += 1\n end\n return power\nend",
"title": ""
},
{
"docid": "be26c41ac30b6c6f66e2f06b112a736c",
"score": "0.60811967",
"text": "def exp1(base,power)\n return 1 if power == 0\n base * exp1(base,power-1)\nend",
"title": ""
},
{
"docid": "3b8d20a43855c1097e449734a2e82bdc",
"score": "0.60787576",
"text": "def power(base,pow)\n\tanswer = 1\n\tfor x in 0...pow do\n\t\tanswer *= base\n\tend\n\treturn answer\nend",
"title": ""
},
{
"docid": "2a3b5165a263de155f0d9abbdb634870",
"score": "0.6078018",
"text": "def placed_merchant_power(v)\n global_trade_power 0.01*v/5.0\n end",
"title": ""
},
{
"docid": "4c8777d8a0622df7325cc0ee2dc2ad96",
"score": "0.6073037",
"text": "def album_gain=(value)\n case\n when value.is_a?(Numeric)\n new_gain = album_gain\n new_gain.adjustment = value\n @value[6, 2] = new_gain.to_bin\n when value.is_a?(RGADAdjustment)\n @value[6, 2] = value.to_bin\n else\n raise(ArgumentError,\"album gain doesn't recognize #{value.inspect}\")\n end\n end",
"title": ""
},
{
"docid": "95a1584bde949db858c4dc24a1dec3f9",
"score": "0.60720444",
"text": "def synthesis_exp_for_level(level)\n 100 * level\n end",
"title": ""
},
{
"docid": "2a8feab87d782437ccffdee3f38d2b69",
"score": "0.60719204",
"text": "def gain_gold(n)\n @gold = [[@gold + n, 0].max, 9999999].min\n end",
"title": ""
},
{
"docid": "2a8feab87d782437ccffdee3f38d2b69",
"score": "0.60719204",
"text": "def gain_gold(n)\n @gold = [[@gold + n, 0].max, 9999999].min\n end",
"title": ""
},
{
"docid": "2a8feab87d782437ccffdee3f38d2b69",
"score": "0.60719204",
"text": "def gain_gold(n)\n @gold = [[@gold + n, 0].max, 9999999].min\n end",
"title": ""
},
{
"docid": "321a04f6ebbaf4c91504eacd688a9731",
"score": "0.6071125",
"text": "def power(base, exponent)\n if exponent == 0\n return 1\n end \n \n i = 0\n pot = 1\n while i < exponent\n p pot\n pot *= base\n i += 1\n end\n return pot \nend",
"title": ""
},
{
"docid": "0735c891a70bb3e2f1e3e7a2d805f47e",
"score": "0.6069607",
"text": "def calculate_level(coefficient = COEFFICIENT)\n level = (Math.sqrt(coefficient * self.total_xp)).to_i\n\n if level <= 0\n self.level = MIN_LEVEL\n return MIN_LEVEL\n end\n if level > MAX_LEVEL\n self.level = MAX_LEVEL\n return MAX_LEVEL if level > MAX_LEVEL\n end\n\n self.level = level\n level\n end",
"title": ""
},
{
"docid": "3135f13257d85a2d3837a95579545edb",
"score": "0.6062289",
"text": "def pow(base, exponent)\n return 1 if exponent == 0\n return base if exponent == 1\n\n base * pow(base, exponent - 1)\nend",
"title": ""
},
{
"docid": "2f49aac62be0a65006848a3a4d19cf9d",
"score": "0.6060715",
"text": "def power(base, exponent)\n result = 0\n if exponent == 0\n result = 1\n elsif exponent == 1\n result = base\n elsif exponent == -1\n result = 1 / base.round(2)\n else (exponent < -1 or exponent > 1)\n n = 3\n result = base * base\n while n <= exponent\n result = result * base\n n += 1\n end\n if exponent < -1\n result = 1 / result.round(2)\n end\n end\n result\nend",
"title": ""
},
{
"docid": "d144c669aa35d4a46c562031c2a4d85b",
"score": "0.60582757",
"text": "def expForLevel(level)\n return (((level - 1)**3) * expModForLevel(level) * 1000).to_i\nend",
"title": ""
},
{
"docid": "e3d9391c4021f7891d5918c52cc3da07",
"score": "0.60522103",
"text": "def pow(base, exponent)\n return 1 if exponent == 0\n base * pow(base, exponent - 1)\nend",
"title": ""
},
{
"docid": "38ceb656f5e6391c3146a9ed77253604",
"score": "0.60479856",
"text": "def power_level(x,y,serial)\n rack_id = x + 10\n pl = rack_id * y\n pl += serial\n pl *= rack_id\n\n pl = (pl / 100) % 10\n\n pl -= 5\nend",
"title": ""
},
{
"docid": "38ceb656f5e6391c3146a9ed77253604",
"score": "0.60479856",
"text": "def power_level(x,y,serial)\n rack_id = x + 10\n pl = rack_id * y\n pl += serial\n pl *= rack_id\n\n pl = (pl / 100) % 10\n\n pl -= 5\nend",
"title": ""
},
{
"docid": "4b957381923e1f1eb0acf41c8bd650c3",
"score": "0.6045029",
"text": "def powerUp\n @powerO = power\n if @type == \"A\"\n @power+=(power*3)\n elsif @type == \"D\"\n @power+=(power*1)\n elsif @type == \"S\" \n @power+=(power*2)\n end\n end",
"title": ""
},
{
"docid": "b62f8d7088933094a2af7ca580d974de",
"score": "0.6039641",
"text": "def pow(base, exponent)\n return 1 if exponent == 0\n base * pow(base, exponent - 1)\nend",
"title": ""
},
{
"docid": "763b4de085184c340e630c8ac975f725",
"score": "0.603843",
"text": "def power(number1,number2)\r\n expo = number1 ** number2 #power i=raise to or exponent\r\nend",
"title": ""
},
{
"docid": "10951f87f3c75d6ae6019591760f3e54",
"score": "0.6031774",
"text": "def power_to_number(num, power)\n result = 1\n power.times { result = multiply(result, num) }\n result\nend",
"title": ""
},
{
"docid": "047b2072489e418ad08670aebc1332aa",
"score": "0.6030409",
"text": "def exponent(base, power)\n return 1 if power == 0\n # if n < 0\n # return (b * (1.0 / exp1(b, n + 1)))\n # end\n smaller_exponent = power - 1\n base_to_the_smaller_exponent = exponent(base, smaller_exponent)\n base * base_to_the_smaller_exponent\nend",
"title": ""
},
{
"docid": "c2d0098f52f064df59a1c9a690e8458b",
"score": "0.60275435",
"text": "def power(base, exp, k=1)\n if exp == 0\n # base case\n 1\n elsif exp == k\n # stop when reached the desired exponent\n base\n else\n # and solve for k+1\n base * power(base, exp, k+1)\n end\nend",
"title": ""
},
{
"docid": "61d04e40f551bd12029b47740b78951c",
"score": "0.6027135",
"text": "def recurison_exp1(base, power)\n return 1 if power == 0\n\n smaller_exponent = power - 1\n result_of_smaller_exponent = recurison_exp1(base, smaller_exponent)\n\n base * result_of_smaller_exponent\n\nend",
"title": ""
},
{
"docid": "caa335229604b67723fb325ab829a255",
"score": "0.60237104",
"text": "def star_power\n # not implemented\n end",
"title": ""
},
{
"docid": "28611e9fec6387798c85e6b23922f47f",
"score": "0.60102046",
"text": "def transmogrifier(val1, val2, toThePower)\n product = val1*val2\n power_up = (product**toThePower)\n\n return power_up\nend",
"title": ""
},
{
"docid": "dde9d96d25e95fd53ae8078c40a6dc66",
"score": "0.60034996",
"text": "def power(base,exponent)\n\tfinal_answer = 1\n\texponent.times do\n\t\tfinal_answer *= base\n\tend\n\tfinal_answer\nend",
"title": ""
},
{
"docid": "dcc1138b7df626f5105ce801eae84cc4",
"score": "0.60005504",
"text": "def qgain(rms=1)\n qrms(rms)/rms\nend",
"title": ""
},
{
"docid": "c9aab452b87b51264db434a9db8b6032",
"score": "0.5990382",
"text": "def exponent(num, power)\n puts num**power\nend",
"title": ""
}
] |
8b799d6c18bbbce64db563e27e727b95 | By default just return a HTTP status code and an empty response | [
{
"docid": "0be64acb42e1b623966c51be8a9d7b9a",
"score": "0.0",
"text": "def default_page_out_of_bounds_response\n head :bad_request\n end",
"title": ""
}
] | [
{
"docid": "cdf8590b9796c16bc11f3cd098a417f0",
"score": "0.79420614",
"text": "def default_status\n 200\n end",
"title": ""
},
{
"docid": "cdf8590b9796c16bc11f3cd098a417f0",
"score": "0.79420614",
"text": "def default_status\n 200\n end",
"title": ""
},
{
"docid": "c4ecad60f58fb65ee0cec3a1145b2978",
"score": "0.78860635",
"text": "def response_code\n 200 # OK\n end",
"title": ""
},
{
"docid": "b8ece2d2f0646208e758c88c7ccb6eed",
"score": "0.76833105",
"text": "def http_status; end",
"title": ""
},
{
"docid": "b8ece2d2f0646208e758c88c7ccb6eed",
"score": "0.76833105",
"text": "def http_status; end",
"title": ""
},
{
"docid": "b8ece2d2f0646208e758c88c7ccb6eed",
"score": "0.76833105",
"text": "def http_status; end",
"title": ""
},
{
"docid": "b8ece2d2f0646208e758c88c7ccb6eed",
"score": "0.76833105",
"text": "def http_status; end",
"title": ""
},
{
"docid": "971b86ce985b9758a08b28d59231a085",
"score": "0.7651792",
"text": "def ok; @status = 200 end",
"title": ""
},
{
"docid": "b9bfd4ba585512b35f4edf6786922961",
"score": "0.7650308",
"text": "def response_status; end",
"title": ""
},
{
"docid": "95f72024ed5e4fefaee3db935398bbf5",
"score": "0.7645077",
"text": "def ok_status_code\n 200\n end",
"title": ""
},
{
"docid": "cc5aca393ea5b44e713f366d9971ad7d",
"score": "0.76039815",
"text": "def status\n 200 # OK\n end",
"title": ""
},
{
"docid": "0de8376e7e223a1b059a135ccb5ff76f",
"score": "0.7567403",
"text": "def index\n check = C100App::Status.new\n status_code = check.success? ? :ok : :internal_server_error\n\n respond_with(check.response, status: status_code)\n end",
"title": ""
},
{
"docid": "2e6041b1ef86b825c12cb85072f7f8ab",
"score": "0.7517463",
"text": "def ok_status_code\n 0\n end",
"title": ""
},
{
"docid": "5c79320e633189b492bb7d9be61d8a29",
"score": "0.74424255",
"text": "def request_empty\n respond_to do |format|\n format.text { head :ok }\n end\n end",
"title": ""
},
{
"docid": "e4ab287b833fd9876c1ad5ddf6cb6f10",
"score": "0.7440851",
"text": "def status_code; end",
"title": ""
},
{
"docid": "e4ab287b833fd9876c1ad5ddf6cb6f10",
"score": "0.7440851",
"text": "def status_code; end",
"title": ""
},
{
"docid": "e4ab287b833fd9876c1ad5ddf6cb6f10",
"score": "0.7440851",
"text": "def status_code; end",
"title": ""
},
{
"docid": "e4ab287b833fd9876c1ad5ddf6cb6f10",
"score": "0.7440851",
"text": "def status_code; end",
"title": ""
},
{
"docid": "e4ab287b833fd9876c1ad5ddf6cb6f10",
"score": "0.7440851",
"text": "def status_code; end",
"title": ""
},
{
"docid": "e4ab287b833fd9876c1ad5ddf6cb6f10",
"score": "0.7440851",
"text": "def status_code; end",
"title": ""
},
{
"docid": "e4ab287b833fd9876c1ad5ddf6cb6f10",
"score": "0.7440851",
"text": "def status_code; end",
"title": ""
},
{
"docid": "e4ab287b833fd9876c1ad5ddf6cb6f10",
"score": "0.7440851",
"text": "def status_code; end",
"title": ""
},
{
"docid": "e4ab287b833fd9876c1ad5ddf6cb6f10",
"score": "0.7440851",
"text": "def status_code; end",
"title": ""
},
{
"docid": "42b6ead9b45cb95adad5c5a939c48413",
"score": "0.7373334",
"text": "def standard_response(body = 'OK')\n {:status => 200, :body => body}\n end",
"title": ""
},
{
"docid": "541baa2d16dff91124ffaed269c6c54f",
"score": "0.7368865",
"text": "def return_no_content\n status 204\n body false\n end",
"title": ""
},
{
"docid": "decc85d9757129e092d15ceb7d12fd9d",
"score": "0.7322421",
"text": "def status(value = nil)\n\t\t\tresponse.status ||= 200\n\t\t\tresponse.headers['X-Cascade'] = 'pass' if value == 404\n\t\t\tvalue ? response.status = value : response.status\n\t\tend",
"title": ""
},
{
"docid": "cfccbb7d497df1c0353e9821aab80c82",
"score": "0.7307371",
"text": "def response_code; end",
"title": ""
},
{
"docid": "bc11c54b45afea008ce17ab75105dee8",
"score": "0.72886163",
"text": "def status\r\n @code = params[:id] || \"500\"\r\n \r\n # default to render status 500 page\r\n # \r\n # lighttpd's bug that can not handle all kinds of status code, like 422\r\n # it will remove the page body ... so we just return status code 404 or 500\r\n render :layout => true, :status => (@code == \"404\") ? \"404\" : \"500\"\r\n end",
"title": ""
},
{
"docid": "023b0dc2b5d2beec5fd7140803822995",
"score": "0.72076744",
"text": "def status code=nil\n @response.status = code if code\n @response.status\n end",
"title": ""
},
{
"docid": "2f00e0ee33d639b1232da32789324b5a",
"score": "0.72030157",
"text": "def status num = nil\n return response.status unless num\n response.status = num.to_i\n end",
"title": ""
},
{
"docid": "f316e8221278d5f94e5d318d60526e58",
"score": "0.719801",
"text": "def status_code\n @status_code || 500\n end",
"title": ""
},
{
"docid": "4e3e1b7c202299d627a258cc5173328e",
"score": "0.7182853",
"text": "def http_status=(_arg0); end",
"title": ""
},
{
"docid": "3066f472b7a4c01ae5c76c622d023127",
"score": "0.71473205",
"text": "def index\n render 'shared/http_status', :locals => { :code => \"200\", :message => HttpStatusHelper::ERROR_CODE[\"message\"][\"200\"] }, :status => 200\n end",
"title": ""
},
{
"docid": "3cfdd5f23c095eeedb51765f091b14b4",
"score": "0.7120261",
"text": "def not_found\n status 404\n body \"not found\\n\"\n end",
"title": ""
},
{
"docid": "3cfdd5f23c095eeedb51765f091b14b4",
"score": "0.7120261",
"text": "def not_found\n status 404\n body \"not found\\n\"\n end",
"title": ""
},
{
"docid": "69960674336af4b1e3988ba1b85c0673",
"score": "0.71049964",
"text": "def do_nothing\n client.noop\n validate_resp_a 200, client.last_response_code.to_i\n end",
"title": ""
},
{
"docid": "996944c055d047cc30e9daa87cf14251",
"score": "0.7096823",
"text": "def status(code)\n response.status = code\n end",
"title": ""
},
{
"docid": "7ea6cec0c53d3fce09e8dd6b29b4432e",
"score": "0.7071867",
"text": "def make_base_response\n {\n status: 200,\n message: '',\n data: []\n }\n end",
"title": ""
},
{
"docid": "b9751edda8e7229698f9b9db8744e3ec",
"score": "0.7068051",
"text": "def response_code\n status_code\n end",
"title": ""
},
{
"docid": "fda6545de7647450d860d9fb98f71507",
"score": "0.7045575",
"text": "def fallback_status_code\n super\n end",
"title": ""
},
{
"docid": "01ca76f55408c18fc9534b1c5585614d",
"score": "0.7043983",
"text": "def status\n self.class.get(\n \"#{@my_base_url}/\", \n :headers => @my_headers)\n # response = self.class.get(\"/\")\n # case response.code\n # when 200\n # return response\n # else\n # raise \"#{response[\"statusMessage\"]} (Status code: #{response[\"statusCode\"]})\"\n # end\n end",
"title": ""
},
{
"docid": "6c8bd9f85fd3cefecce7817defb3c2f8",
"score": "0.7029606",
"text": "def status_code\n http_response.status.to_i\n end",
"title": ""
},
{
"docid": "eeaed8b8b6ccad91801eb7e5c7377dc9",
"score": "0.70287234",
"text": "def default_body\n\t\t\t# response.headers[Rack::CONTENT_TYPE] = 'text/html'\n\t\t\t\"<h1>#{Rack::Utils::HTTP_STATUS_CODES[status]}</h1>\"\n\t\tend",
"title": ""
},
{
"docid": "f43f7646686caaa38329f0d47949d707",
"score": "0.70186645",
"text": "def _200_(env, type, result)\n [\n 200,\n {'Content-Type' => type},\n result\n ]\n end",
"title": ""
},
{
"docid": "52ddf1b68a605cc1bf9378d067f90342",
"score": "0.70105827",
"text": "def render_ok\n render nothing: true, status: 200\n end",
"title": ""
},
{
"docid": "35df2b67591fbeb171be29854d9568e3",
"score": "0.6993199",
"text": "def response_code\n @status\n end",
"title": ""
},
{
"docid": "35df2b67591fbeb171be29854d9568e3",
"score": "0.6993199",
"text": "def response_code\n @status\n end",
"title": ""
},
{
"docid": "a9a25b59c861b399e04f8cec148f33c2",
"score": "0.69898576",
"text": "def http_code\n '000'\n end",
"title": ""
},
{
"docid": "c221158729ce47015d591acb9abc123c",
"score": "0.69628555",
"text": "def healthy_response\n content_type 'text/plain'\n status 200\n 'pong'\n end",
"title": ""
},
{
"docid": "5917c3cb7be5756270aa3ea8e9c181d4",
"score": "0.6956644",
"text": "def have_status_code_ok\n have_no_content(\"The page you were looking for doesn't exist\") && # 404\n have_no_content('The change you wanted was rejected') && # 422\n have_no_content(\"We're sorry, but something went wrong\") # 500\n end",
"title": ""
},
{
"docid": "f3f33c547150c4939b9851a14b19e43c",
"score": "0.69506204",
"text": "def status_not_found\n respond_to do |format|\n format.any { head :not_found }\n end\n end",
"title": ""
},
{
"docid": "f3f33c547150c4939b9851a14b19e43c",
"score": "0.69506204",
"text": "def status_not_found\n respond_to do |format|\n format.any { head :not_found }\n end\n end",
"title": ""
},
{
"docid": "f3f33c547150c4939b9851a14b19e43c",
"score": "0.69506204",
"text": "def status_not_found\n respond_to do |format|\n format.any { head :not_found }\n end\n end",
"title": ""
},
{
"docid": "9a81717da3b83ca6c6b30bed6a6d504e",
"score": "0.69392574",
"text": "def ok?\n if @http_raw_response.kind_of? Net::HTTPNoContent\n #if there is no content expected, use HTTP code\n 204 == @http_status_code\n else\n # otherwise use API status\n @http_raw_response.kind_of? Net::HTTPOK and 0 == @api_status.to_i\n end\n end",
"title": ""
},
{
"docid": "116978691f8822ef50be2e2c185e695f",
"score": "0.6938519",
"text": "def status value = nil\n if value\n response.status = env['crepe.status'] = Rack::Utils.status_code value\n end\n\n response.status\n end",
"title": ""
},
{
"docid": "116978691f8822ef50be2e2c185e695f",
"score": "0.6938519",
"text": "def status value = nil\n if value\n response.status = env['crepe.status'] = Rack::Utils.status_code value\n end\n\n response.status\n end",
"title": ""
},
{
"docid": "b301194feb660ac4561cecfb64ea84a3",
"score": "0.6922306",
"text": "def make_base_response\n {\n status: 200,\n message: '',\n data: []\n }\n end",
"title": ""
},
{
"docid": "0c7221439e7e1ee719fa99bd6c357437",
"score": "0.691943",
"text": "def http_status\n self[:status_code]\n end",
"title": ""
},
{
"docid": "6ecad92a82cdd836eeaae8e0b550e35f",
"score": "0.6919118",
"text": "def ok\n rack_resp(200, 'ok')\n end",
"title": ""
},
{
"docid": "55a7d066e530beb6eb292aef8d8ae8fb",
"score": "0.69102746",
"text": "def http_status\n @response.status\n end",
"title": ""
},
{
"docid": "bd4edd25059e1c9e0cdc221b5fc4177f",
"score": "0.6906763",
"text": "def index\n status = get_health_status( )\n response = make_response( status )\n render json: response, :status => response.is_healthy? ? 200 : 500\n end",
"title": ""
},
{
"docid": "bd4edd25059e1c9e0cdc221b5fc4177f",
"score": "0.6906763",
"text": "def index\n status = get_health_status( )\n response = make_response( status )\n render json: response, :status => response.is_healthy? ? 200 : 500\n end",
"title": ""
},
{
"docid": "227920f8d202f53bf4d5f178350c9f82",
"score": "0.68947715",
"text": "def no_body( status )\n res.status = ::Rack::Utils.status_code( status )\n res.write ::Rack::Utils::HTTP_STATUS_CODES[ res.status ]\n res['Content-Type' ] = 'text/plain'\n end",
"title": ""
},
{
"docid": "571c0c1a265ae5290ce3a407ef1767b2",
"score": "0.6870955",
"text": "def status_code\n @response.status_code\n end",
"title": ""
},
{
"docid": "d841d6963a1ae887b1230103dfa1ee06",
"score": "0.6869658",
"text": "def status_code\n raise \"Override #status_code\"\n end",
"title": ""
},
{
"docid": "e541b0fe66ccf918409715b3be1acd86",
"score": "0.68534714",
"text": "def ok\n respond_with :ok, status: :ok\n end",
"title": ""
},
{
"docid": "27c7b512c88f2c188bcb698232f8315b",
"score": "0.685088",
"text": "def not_found\n response.status = 404\n end",
"title": ""
},
{
"docid": "cec85b06d8a83d85608050b6beb9d46f",
"score": "0.68438953",
"text": "def test_no_http_status_set\n @server.on(\n 'method:GET',\n -> (request, response) { false },\n 1\n )\n\n @server.http_request = Http::Request.new('GET', '/')\n @server.exec\n assert_equal(500, @response.status)\n end",
"title": ""
},
{
"docid": "58f12e5ddb2b05523883d423718dc8ad",
"score": "0.68422973",
"text": "def status_code\n @http_response.status\n end",
"title": ""
},
{
"docid": "e48ac80f02cc5175ad31bf624d6a3152",
"score": "0.6828213",
"text": "def http_code(res)\n begin\n return Integer res.code\n rescue\n return 500\n end\n end",
"title": ""
},
{
"docid": "1fd2ef6fc07ea9e56480132a5013b673",
"score": "0.68018097",
"text": "def ok\n halt Rack::Utils.status_code(:ok)\n end",
"title": ""
},
{
"docid": "e0d26c6843d381a1cfc7517e7b917f4c",
"score": "0.6761211",
"text": "def status\n\t\trender json: {\n\t\t}, status: 201\t\n\tend",
"title": ""
},
{
"docid": "fedc53000c591fc35012c92cd7d4dd5e",
"score": "0.6758057",
"text": "def post\n status 404\n nil\n end",
"title": ""
},
{
"docid": "0ead619e65ec63b3a91dc7ea07cfd863",
"score": "0.6757431",
"text": "def response\n {:nothing => true}\n end",
"title": ""
},
{
"docid": "6cc34a7b715f49dd9df1a16e92e3c98c",
"score": "0.67564327",
"text": "def test_response_to_ruby_empty_response\n body = ''\n code = 200\n assert_equal(@ts.response_to_ruby(body, code),\n Hash['status' => 200])\n end",
"title": ""
},
{
"docid": "8081547f32bb50b3af28b05783f85c71",
"score": "0.6746467",
"text": "def status\n @response.code.to_i\n end",
"title": ""
},
{
"docid": "84b44d679c44a11bc2bdb6c9947c204b",
"score": "0.67446375",
"text": "def response_code\n headers['Status'][0,3].to_i rescue 0\n end",
"title": ""
},
{
"docid": "4de4fb6442be8ae4bd526b8c1530610a",
"score": "0.67411035",
"text": "def status_not_acceptable\n respond_to do |format|\n format.any { head :not_acceptable }\n end\n end",
"title": ""
},
{
"docid": "4de4fb6442be8ae4bd526b8c1530610a",
"score": "0.67411035",
"text": "def status_not_acceptable\n respond_to do |format|\n format.any { head :not_acceptable }\n end\n end",
"title": ""
},
{
"docid": "4de4fb6442be8ae4bd526b8c1530610a",
"score": "0.67411035",
"text": "def status_not_acceptable\n respond_to do |format|\n format.any { head :not_acceptable }\n end\n end",
"title": ""
},
{
"docid": "334934124afd27ae9b27071a9f383273",
"score": "0.67400753",
"text": "def method_missing(env)\n @res.status = 404\n end",
"title": ""
},
{
"docid": "1c5779918f16b979040257542e4976a1",
"score": "0.6739763",
"text": "def status\n if @response\n 'OK'\n else\n nil\n end\n end",
"title": ""
},
{
"docid": "1c5779918f16b979040257542e4976a1",
"score": "0.6739763",
"text": "def status\n if @response\n 'OK'\n else\n nil\n end\n end",
"title": ""
},
{
"docid": "1c5779918f16b979040257542e4976a1",
"score": "0.6739763",
"text": "def status\n if @response\n 'OK'\n else\n nil\n end\n end",
"title": ""
},
{
"docid": "76407d3752e086dafd684fb674ae9cc9",
"score": "0.6730772",
"text": "def status_code\n fail \"Override #status_code\"\n end",
"title": ""
},
{
"docid": "3634e59389e80038ee01bf4402ddeec6",
"score": "0.6717535",
"text": "def response(body, status)\n {\n body: body ? body.to_json + \"\\n\" : '',\n statusCode: status\n }\nend",
"title": ""
},
{
"docid": "1e102ce7e23c2e7990bf432f7ae8bb2e",
"score": "0.6712468",
"text": "def sendJson\n codeAnswer(202) if defined?(@returnValue[:content]) && defined?(@returnValue[:content].size) && @returnValue[:content].size == 0 && !defined?@returnValue[:code]\n defineHttp :ok if @httpCode == nil\n respond_to do |format|\n format.json { render :json => JSON.generate(@returnValue), :status => @httpCode }\n end\n end",
"title": ""
},
{
"docid": "a4a62ec1aa3d3235f8a4111b89d7eeaa",
"score": "0.67110044",
"text": "def status(value=nil)\n response.status = value if value\n response.status\n end",
"title": ""
},
{
"docid": "63dd5ce3bfeb8845ba9df6534c081cc6",
"score": "0.6702008",
"text": "def not_found\n self.status = 404\n self.headers = {}\n self.content = ['Nothing found']\n self\n end",
"title": ""
},
{
"docid": "bcf1a7dd47e090bf4c45725ce7b97038",
"score": "0.6695328",
"text": "def ok?\n @status == 200\n end",
"title": ""
},
{
"docid": "2757858827f8c4f5928547b441eed931",
"score": "0.66809314",
"text": "def index\n render plain: 'ok', status: :ok\n end",
"title": ""
},
{
"docid": "2757858827f8c4f5928547b441eed931",
"score": "0.66809314",
"text": "def index\n render plain: 'ok', status: :ok\n end",
"title": ""
},
{
"docid": "211bd8e70134325da177221634525a6d",
"score": "0.66759807",
"text": "def index\n render \"status/501_not_implemented\", status: :not_implemented\n end",
"title": ""
},
{
"docid": "2c67f167bcd8316010e53a76511730e0",
"score": "0.6670592",
"text": "def resp_text_code; end",
"title": ""
},
{
"docid": "2c67f167bcd8316010e53a76511730e0",
"score": "0.6670592",
"text": "def resp_text_code; end",
"title": ""
},
{
"docid": "1d3320bc444ee5a7c7f46e65eb2f0426",
"score": "0.6665686",
"text": "def answer_ok\n head :no_content\n end",
"title": ""
},
{
"docid": "691ec030f385b5489052daf20805e544",
"score": "0.6653574",
"text": "def is_ok?\n code == 200\n end",
"title": ""
},
{
"docid": "691ec030f385b5489052daf20805e544",
"score": "0.6653574",
"text": "def is_ok?\n code == 200\n end",
"title": ""
},
{
"docid": "691ec030f385b5489052daf20805e544",
"score": "0.6653574",
"text": "def is_ok?\n code == 200\n end",
"title": ""
},
{
"docid": "691ec030f385b5489052daf20805e544",
"score": "0.6653574",
"text": "def is_ok?\n code == 200\n end",
"title": ""
},
{
"docid": "920b5d2c041f6ddb9b069a647824a472",
"score": "0.66499615",
"text": "def status_code=(_arg0); end",
"title": ""
}
] |
45eddeac48fb3afffbf25234bc472c2a | :callseq: def_single_delegator(accessor, method, new_name=method) Defines a method _method_ which delegates to _accessor_ (i.e. it calls the method of the same name in _accessor_). If _new_name_ is provided, it is used as the name for the delegate method. Returns the name of the method defined. | [
{
"docid": "1a5e85120939b69dc89f0d09c123aae3",
"score": "0.7471794",
"text": "def def_single_delegator(accessor, method, ali = method)\n gen = Forwardable._delegator_method(self, accessor, method, ali)\n\n ret = instance_eval(&gen)\n singleton_class.__send__(:ruby2_keywords, ali) if RUBY_VERSION >= '2.7'\n ret\n end",
"title": ""
}
] | [
{
"docid": "2359de536c4932bdedc56bbc4615df82",
"score": "0.66777164",
"text": "def define_delegator(method_name)\n target_name = @target_name\n @scope.send(:define_method, method_name) do |*args|\n send(target_name).public_send(method_name, *args)\n end\n end",
"title": ""
},
{
"docid": "ca9c7cc474a41a0c905f0fda0d8588c4",
"score": "0.6658841",
"text": "def def_single_delegators(accessor, *methods)\n methods.each do |method|\n next if /\\A__(?:send|id)__\\z/ =~ method\n def_single_delegator(accessor, method)\n end\n end",
"title": ""
},
{
"docid": "78b5436731de22522de88110c83c2e24",
"score": "0.63145226",
"text": "def def_delegator(accessor, method, alias_ = method, **kwd)\n kwd, alias_ = alias_, method if alias_.is_a?(Hash) && !kwd.any?\n\n if alias_.is_a?(Hash) || !kwd.any?\n Forwardable.instance_method(:def_delegator).bind(self) \\\n .call(accessor, method, alias_)\n\n elsif !kwd[:type]\n def_modern_delegator(\n accessor, method, alias_, **kwd\n )\n\n else\n raise ArgumentError, \"Alias not supported.\" if alias_ != method\n send(\"def_#{kwd[:type]}_delegator\", accessor, method, **kwd.tap do |obj|\n obj.delete(:type)\n end)\n end\n end",
"title": ""
},
{
"docid": "b712909070e3c5902edb657ac00b99f1",
"score": "0.6288051",
"text": "def def_modern_delegator(accessor, method, alias_ = method, args: \\\n { :before => [], :after => [] }, **kwd)\n\n prefix, suffix, wrap = prepare_delegate(**kwd)\n args = { :before => args } unless args.is_a?(Hash)\n b = [args[:before]].flatten.compact.map(&:to_s).join(\", \")\n a = [args[ :after]].flatten.compact.map(&:to_s).join(\", \")\n b = b + \", \" unless args[:before].nil? || args[:before].empty?\n a = \", \" + a unless args[ :after].nil? || args[ :after].empty?\n alias_ = alias_.to_s.gsub(/\\?$/, \"\") if suffix\n\n class_eval delegate_debug(<<-STR), __FILE__, __LINE__ - 10\n def #{alias_}#{suffix}(*args, &block)\n #{wrap}(#{prefix}#{accessor}.send(\n #{method.inspect}, #{b}*args#{a}, &block\n ))\n\n rescue Exception\n if !Forwardable.debug && $@ && $@.respond_to?(:delete_if)\n $@.delete_if do |source|\n source =~ %r\"#{Regexp.escape(__FILE__)}\"o\n end\n end\n\n raise\n end\n STR\n end",
"title": ""
},
{
"docid": "65345220e7721d2a46bda28ad840acda",
"score": "0.6111103",
"text": "def method_missing(method, *args, &block)\n send(target_method(method), method, *args, &block).tap do\n create_delegation_method!(method)\n end\n end",
"title": ""
},
{
"docid": "212d359b32a977a0c12dc3371863034a",
"score": "0.6102235",
"text": "def method_missing(method, *args, &block)\n send(target_method(method), method, *args, &block).tap do \n create_delegation_method!(method)\n end\n end",
"title": ""
},
{
"docid": "a33f4c301e7cc626c99489c9a3c3d4f2",
"score": "0.5616805",
"text": "def def_delegators(accessor, *methods)\n kwd = methods.shift if methods.first.is_a?(Hash)\n kwd = methods.pop if methods. last.is_a?(Hash)\n kwd = {} unless kwd\n\n methods.each do |method|\n def_delegator accessor, method, **kwd\n end\n end",
"title": ""
},
{
"docid": "52f5313b51bfdd69c545cdf771713787",
"score": "0.54380786",
"text": "def safe_delegation(delegate, delegation, method=delegation)\n define_method method.to_sym do |*args, &block|\n # Forwardable makes an eval so it does not care whether\n # delegate is a method or an instance variable.\n # I chose not to do it (so far), so i have to try both\n # ways to get the delegate, in a violent way. But i like it.\n interface = begin\n send :instance_variable_get, delegate.to_s\n rescue\n send delegate\n end\n\n interface && interface.send(delegation, *args, &block)\n end\n end",
"title": ""
},
{
"docid": "8209c19cdc461a7282d7f8a769d4795d",
"score": "0.53767234",
"text": "def method_missing(method, *args, &block)\n generate_unsafe_delegation(method)\n send(method, *args, &block)\n end",
"title": ""
},
{
"docid": "627d5909d09f6afe7395fb7cd1f1685b",
"score": "0.5272477",
"text": "def def_instance_delegators(accessor, *methods)\n methods.each do |method|\n next if /\\A__(?:send|id)__\\z/ =~ method\n def_instance_delegator(accessor, method)\n end\n end",
"title": ""
},
{
"docid": "b29f2569ac3b0226be870a94d4a54c69",
"score": "0.5247333",
"text": "def def_hash_delegator(hash, method, key: method, **kwd)\n prefix, suffix, wrap = prepare_delegate(**kwd)\n\n if suffix\n method = method.to_s.gsub(\n /\\?$/, \"\"\n )\n end\n\n class_eval delegate_debug(<<-STR), __FILE__, __LINE__ - 9\n def #{method}#{suffix}(*args)\n #{wrap}(\n #{prefix}#{hash}[#{key.inspect}]\n )\n\n rescue Exception\n if !Forwardable.debug && $@ && $@.respond_to?(:delete_if)\n $@.delete_if do |source|\n source =~ %r\"#{Regexp.escape(__FILE__)}\"o\n end\n end\n\n raise\n end\n STR\n end",
"title": ""
},
{
"docid": "44724919a87f622f7c30ee4cf29ce969",
"score": "0.5231332",
"text": "def def_dsl_delegator(*method_names)\n method_names.each do |method_name|\n raise TypeError unless method_name.respond_to?(:to_sym)\n method_name = method_name.to_sym\n \n define_method(method_name) do |*args|\n unless args.empty?\n args = args.first if args.length == 1\n @parent.respond_to?(\"#{method_name}=\") ? @parent.send(\"#{method_name}=\", args) : @parent.instance_variable_set(\"@#{method_name}\", args)\n end\n \n @parent.respond_to?(method_name) ? @parent.send(method_name) : @parent.instance_variable_get(\"@#{method_name}\")\n end\n \n end\n end",
"title": ""
},
{
"docid": "122b540d6fcca69251b6deb6d94059eb",
"score": "0.5229353",
"text": "def rb_delegate(method, to: nil, alias_of: method, **kwd)\n raise ArgumentError, \"to must be provided\" unless to\n def_delegator(\n to, alias_of, method, **kwd\n )\n end",
"title": ""
},
{
"docid": "1cb7ba5c4a9f53c79be1ac9855b6e621",
"score": "0.5169548",
"text": "def create_alias_for_existing_method(method_name)\n begin\n new_alias = new_name(method_name)\n unless @obj.respond_to?(new_alias)\n sclass.class_eval do\n alias_method(new_alias, method_name)\n end\n end\n new_alias\n rescue NameError => ex\n # Alias attempt failed\n nil\n end\n end",
"title": ""
},
{
"docid": "040fd636c76c7c8f86999fea7cd1b077",
"score": "0.5168741",
"text": "def create_alias_for_existing_method(method_name)\n new_alias = new_name(method_name)\n unless @obj.respond_to?(new_alias)\n safe_alias_method(new_alias, method_name)\n end\n new_alias\n end",
"title": ""
},
{
"docid": "60a39c318484106254984017a4b2d663",
"score": "0.51664066",
"text": "def method_missing(method, *args, &block)\n if delegate.respond_to?(method)\n delegate.public_send(method, *args, &block)\n else\n super\n end\n end",
"title": ""
},
{
"docid": "756075078798fe75b38e00a0457af9c2",
"score": "0.51169956",
"text": "def helper(name, &block)\n delegation_obj = subject.__getobj__\n subject.define_singleton_method(name.to_sym) do\n instance_exec(delegation_obj, &block)\n end\n end",
"title": ""
},
{
"docid": "7b9cb18c1d206afc4b96e01618831623",
"score": "0.5067724",
"text": "def delegate_field(method_name, field_name)\r\n self.module_eval(\"def #{method_name}(*obj) @#{field_name}.#{method_name}(*obj) end\")\r\n end",
"title": ""
},
{
"docid": "50e46f0134c3a8075241f4735ce8c11f",
"score": "0.50633657",
"text": "def define_delegation_method( method, object = 'request' )#:nodoc:\n if request && request.respond_to?( method )\n request.send( :method )\n self.class.class_eval \"def #{method}; #{object}.try(:#{method}); end\"\n end\n true\n rescue ArgumentError => e\n false\n end",
"title": ""
},
{
"docid": "f167ee5b572807ea726dc1d3004eb345",
"score": "0.5022447",
"text": "def stow_existing_definition(method_name)\n @methods_proxied << method_name\n new_alias = create_alias_for_existing_method(method_name)\n if new_alias\n my_object = @obj\n @method_definitions[method_name] = Proc.new { |*args|\n block = nil\n if Proc === args.last\n block = args.last\n args = args[0...-1]\n end\n my_object.send(new_alias, *args, &block)\n }\n end\n remove_current_method(method_name) if singleton?(method_name)\n end",
"title": ""
},
{
"docid": "64875541f8c42bdd60f0a7e3f539b0ba",
"score": "0.49755424",
"text": "def delegating_method; end",
"title": ""
},
{
"docid": "61db143e4dbcda82292389a8e00e36a5",
"score": "0.4955108",
"text": "def method_missing(method, *args, &block)\n @delegate.send(method, *args, &block)\n rescue NoMethodError => e\n raise e, e.message.sub(/ for #<.*$/, \" via proxy for #{@delegate}\")\n end",
"title": ""
},
{
"docid": "fe5258e4c603ffac5825cfe113d10ca7",
"score": "0.49546814",
"text": "def method_missing(id,*args,&block)\n return @delegated_to_object.send(id,*args,&block) if delegated_instance_methods.include?(id)\n super\n end",
"title": ""
},
{
"docid": "fe5258e4c603ffac5825cfe113d10ca7",
"score": "0.49546814",
"text": "def method_missing(id,*args,&block)\n return @delegated_to_object.send(id,*args,&block) if delegated_instance_methods.include?(id)\n super\n end",
"title": ""
},
{
"docid": "2492f60b7939187164e672f6685e4118",
"score": "0.49467936",
"text": "def method_missing(method, *args)\n super unless object.respond_to? method\n\n # We want to define it on the singleton class, not the whole Decorator\n # class, otherwise it would grow continually across all decorators.\n define_singleton_method method do\n object.send method, *args\n end\n\n send method, *args\n end",
"title": ""
},
{
"docid": "bd91397939d6bbc529577655c68096ea",
"score": "0.49398032",
"text": "def delegate(*methods)\n options = methods.pop\n unless options.is_a?(Hash) && to = options[:to]\n raise ArgumentError, \"Delegation needs a target. Supply an options hash with a :to key as the last argument (e.g. delegate :hello, :to => :greeter).\"\n end\n\n if options[:prefix] == true && options[:to].to_s =~ /^[^a-z_]/\n raise ArgumentError, \"Can only automatically set the delegation prefix when delegating to a method.\"\n end\n\n prefix = options[:prefix] && \"#{options[:prefix] == true ? to : options[:prefix]}_\"\n\n file, line = caller.first.split(':', 2)\n line = line.to_i\n\n methods.each do |method|\n on_nil =\n if options[:allow_nil]\n 'return'\n else\n %(raise \"#{self}##{prefix}#{method} delegated to #{to}.#{method}, but #{to} is nil: \\#{self.inspect}\")\n end\n\n module_eval(<<-EOS, file, line)\n def #{prefix}#{method}(*args, &block) # def customer_name(*args, &block)\n #{to}.__send__(#{method.inspect}, *args, &block) # client.__send__(:name, *args, &block)\n rescue NoMethodError # rescue NoMethodError\n if #{to}.nil? # if client.nil?\n #{on_nil}\n else # else\n raise # raise\n end # end\n end # end\n EOS\n end\n end",
"title": ""
},
{
"docid": "fd40e880e72647ca6d2d1ab7f5505987",
"score": "0.4930657",
"text": "def delegate_method; end",
"title": ""
},
{
"docid": "8009119f1c89d2a9618a521e5005b750",
"score": "0.49056196",
"text": "def as new_method_name\n @new_method_name = new_method_name\n\n self\n end",
"title": ""
},
{
"docid": "28095ca66397a68ae29ea265c1c003df",
"score": "0.48801303",
"text": "def method_missing name, *args\n raise MomFail.new self, \"DSL Error: inconsistent call to `#{name}'\" unless @targets[@current] && @targets[@current][:delegates].is_a?(Array)\n @targets[@current][:delegates] << (block_given? ? [name, args, Proc.new] : [name, args])\n end",
"title": ""
},
{
"docid": "e9436195a41db37a7cb0d20f64f8207b",
"score": "0.4866565",
"text": "def delegate(*methods)\n options = methods.pop\n unless options.is_a?(Hash) && to = options[:to]\n raise ArgumentError, \"Delegation needs a target. Supply an options hash with a :to key as the last argument (e.g. delegate :hello, :to => :greeter).\"\n end\n\n if options[:prefix] == true && options[:to].to_s =~ /^[^a-z_]/\n raise ArgumentError, \"Can only automatically set the delegation prefix when delegating to a method.\"\n end\n\n prefix = options[:prefix] && \"#{options[:prefix] == true ? to : options[:prefix]}_\" || ''\n\n file, line = caller.first.split(':', 2)\n line = line.to_i\n\n methods.each do |method|\n on_nil =\n if options[:allow_nil]\n 'return'\n else\n %(raise \"#{self}##{prefix}#{method} delegated to #{to}.#{method}, but #{to} is nil: \\#{self.inspect}\")\n end\n\n module_eval(<<-EOS, file, line - 5)\n if instance_methods(false).map(&:to_s).include?(\"#{prefix}#{method}\")\n remove_possible_method(\"#{prefix}#{method}\")\n end\n\n def #{prefix}#{method}(*args, &block) # def customer_name(*args, &block)\n #{to}.__send__(#{method.inspect}, *args, &block) # client.__send__(:name, *args, &block)\n rescue NoMethodError # rescue NoMethodError\n if #{to}.nil? # if client.nil?\n #{on_nil} # return # depends on :allow_nil\n else # else\n raise # raise\n end # end\n end # end\n EOS\n end\n end",
"title": ""
},
{
"docid": "7efa4ac2e4827f98caaa7af8e5b96a12",
"score": "0.48590213",
"text": "def has_one(accessor_name, options)\n plural_accessor_name = \"s_#{accessor_name}\".to_s.pluralize\n class_name = accessor_name.to_s.camelize\n has_many(plural_accessor_name, { class_name: class_name }.merge(options))\n define_method(accessor_name) do\n send(plural_accessor_name).first\n end\n end",
"title": ""
},
{
"docid": "d7a8881fe9930a427d9ec97fdef1c7a3",
"score": "0.48267794",
"text": "def define(names)\n names.each do |name|\n define_delegator(name)\n end\n\n self\n end",
"title": ""
},
{
"docid": "15b90e47c33a58a037a6498feb8eb5ce",
"score": "0.48224708",
"text": "def add_method(instance, method_name)\n\t define_singleton_method(method_name) do |*args|\n\t instance.public_send(method_name, *args)\n\t end\n\t\tend",
"title": ""
},
{
"docid": "8845def7d92fa84ee2e366cd0789836c",
"score": "0.48190698",
"text": "def delegate_method(method, *args, &block)\n return unless @key && _resource.respond_to?(@key)\n\n @delegate ||= _resource.send(@key)\n return unless @delegate&.respond_to?(method.to_s)\n\n @delegate.send(method, *args, &block)\n end",
"title": ""
},
{
"docid": "0cb87638d29bd93296ec75b2cb9f28ec",
"score": "0.48187998",
"text": "def add_method(instance, method_name)\n define_singleton_method(method_name) do |*args|\n instance.public_send(method_name, *args)\n end\n end",
"title": ""
},
{
"docid": "a29db6f436e2ce590e26f5ddf96e5b7e",
"score": "0.4818564",
"text": "def next\n @target.public_send(@method_name)\n end",
"title": ""
},
{
"docid": "6b977298f67b079b7d930e4ac6334cb6",
"score": "0.4814811",
"text": "def existing_method clazz, method_name, meta, &block\n return if redefined? clazz, method_name, &block\n\n old_method = validate_existing_definition clazz, method_name\n validate_method_arity clazz, method_name, old_method, &block\n validate_decoration_meta clazz, method_name, old_method, meta\n\n old_method\n end",
"title": ""
},
{
"docid": "c609fbca0068a93dec939bceb350e030",
"score": "0.47899836",
"text": "def generate_method(method_name, &block)\n define_method(method_name, &block)\n method = instance_method method_name\n remove_method method_name\n method\n end",
"title": ""
},
{
"docid": "cc3d4ab1a610b2ed03d3cb94c528eb2a",
"score": "0.47716525",
"text": "def forward(method, params = nil)\n return unless @delegate.present? && @delegate.respond_to?(method)\n params.nil? ? @delegate.send(method) : @delegate.send(method, params)\n end",
"title": ""
},
{
"docid": "b1fc6aeccd393e2c9d080bd1b53ed81d",
"score": "0.47533607",
"text": "def default_delegation_behavior\n\t\t@delegate_called = true\n\tend",
"title": ""
},
{
"docid": "d78320462548d2a701cb6e8c04996b20",
"score": "0.47388834",
"text": "def add_proxy_method(method) # :nodoc:\n # Redefine to avoid warnings if the method has already been defined\n proxy.redefine_method(method, &proxified_methods[method])\n end",
"title": ""
},
{
"docid": "6b1fef76322bfa4b92edc70ef4524cd6",
"score": "0.47367263",
"text": "def stow_existing_definition(method_name)\n @methods_proxied << method_name\n new_alias = create_alias_for_existing_method(method_name)\n if new_alias\n @method_definitions[method_name] = create_aliased_definition(@obj, new_alias)\n end\n remove_current_method(method_name) if singleton?(method_name)\n end",
"title": ""
},
{
"docid": "9c259d92a3b65de28788ac283b75cc58",
"score": "0.46995428",
"text": "def method(method_name)\n \n @_method = method_name.to_s\n \n end",
"title": ""
},
{
"docid": "e86f23dcc53a2a2f48f9c9bdf3ef167c",
"score": "0.4689314",
"text": "def method_missing method, *args, &block\n if args.size > 1\n raise ArgumentError.new \"wrong number of arguments (#{args.size} for 0..1)\"\n end\n\n args.push({}) if args.size == 0\n\n method = method.to_s.split('_').inject([]){ |b,e| b.push(b.empty? ? e : e.capitalize) }.join\n\n call(method, args[0])\n end",
"title": ""
},
{
"docid": "f2821f7bb6a11e3a959346fd50b7f0cd",
"score": "0.4686198",
"text": "def method_missing(m, *args, &_block)\n set_accessors(m)\n if valid_proxy_method?\n define_proxy_method(m)\n return send(m, args.first)\n end\n\n super\n end",
"title": ""
},
{
"docid": "176b166d2aaa488b6351f1a5acb21e8b",
"score": "0.4680429",
"text": "def add_method method\n return method unless @document_self\n\n # HACK: avoid duplicate 'new' in io.c & struct.c (1.8.7 source code)\n key = method.pretty_name\n known = @methods_hash[key]\n\n if known then\n if @store then # otherwise we are loading\n known.comment = method.comment if known.comment.empty?\n previously = \", previously in #{known.file}\" unless\n method.file == known.file\n @store.rdoc.options.warn \\\n \"Duplicate method #{known.full_name} in #{method.file}#{previously}\"\n end\n else\n @methods_hash[key] = method\n if @current_line_visibility\n method.visibility, @current_line_visibility = @current_line_visibility, nil\n else\n method.visibility = @visibility\n end\n add_to @method_list, method\n resolve_aliases method\n end\n\n method\n end",
"title": ""
},
{
"docid": "28ea0215c1f0e6e3eda4ce68d827929f",
"score": "0.46792695",
"text": "def method_name\n double_injection.method_name\n end",
"title": ""
},
{
"docid": "9f5296f485fa72eac642f430152a7748",
"score": "0.46733212",
"text": "def delegate_to(target)\n if @delegate_target\n return self if target == @delegate_target\n raise ToolDefinitionError,\n \"Cannot delegate tool #{display_name.inspect} to #{target.join(' ')} because it\" \\\n \" already delegates to \\\"#{@delegate_target.join(' ')}\\\".\"\n end\n if includes_arguments?\n raise ToolDefinitionError,\n \"Cannot delegate tool #{display_name.inspect} because\" \\\n \" arguments have already been defined.\"\n end\n if runnable?\n raise ToolDefinitionError,\n \"Cannot delegate tool #{display_name.inspect} because\" \\\n \" the run method has already been defined.\"\n end\n disable_argument_parsing\n self.run_handler = make_delegation_run_handler(target)\n self.completion = DefaultCompletion.new(delegation_target: target)\n @delegate_target = target\n self\n end",
"title": ""
},
{
"docid": "f36a83a3f426d9ddcbaf0bf334fc1fd6",
"score": "0.46716067",
"text": "def alias_method(new_name, current_name)\n # If we're aliasing a method we contain, just reference it directly, no\n # need for the alias wrapper\n if entry = @method_table.lookup(current_name)\n @method_table.store new_name, entry.method, entry.visibility\n else\n mod = direct_superclass()\n while mod\n entry = mod.method_table.lookup(current_name)\n break if entry\n mod = mod.direct_superclass\n end\n\n unless entry\n raise NoMethodError, \"No method '#{current_name}' to alias to '#{new_name}'\"\n end\n\n @method_table.alias new_name, entry.visibility, current_name,\n entry.method, mod\n end\n\n Rubinius::VM.reset_method_cache(new_name)\n end",
"title": ""
},
{
"docid": "c57ec1a0270e4085f54fb34d1b8b33a6",
"score": "0.46682283",
"text": "def data_delegator(key)\n define_method(key.to_sym) { @obj.data[key] }\n end",
"title": ""
},
{
"docid": "66ef867f7a83dacdf626ac0b9a2f5b70",
"score": "0.46576914",
"text": "def aliased_method_name(method_name)\r\n last_letter = method_name.to_s[method_name.to_s.size-1]\r\n if %w(? !).member? last_letter\r\n # remove ? and ! from the middle and put it to the end\r\n (method_name.to_s.chop!+\"_in_#{self.simple_name.to_snake_case}#{last_letter}\").to_sym\r\n else\r\n (method_name.to_s+\"_in_#{self.simple_name.to_snake_case}\").to_sym\r\n end\r\n end",
"title": ""
},
{
"docid": "79d7c4e54c8e1e4d31bb071a25c1aaeb",
"score": "0.4655917",
"text": "def delegate *names, to:\n names.each do |name|\n def_delegator to, name\n end\n end",
"title": ""
},
{
"docid": "08ac6ba03e9d7ac8d02f1d90048f41d2",
"score": "0.4643805",
"text": "def define_proxy_method(method_name)\n if method_name.to_s =~ /=$/\n eval_line = __LINE__ + 1\n target_class_eval %{\n def #{method_name}(*args, &block)\n instance_variable_get('@flexmock_proxy').\n mock.__send__(:#{method_name}, *args, &block)\n end\n }, __FILE__, eval_line\n else\n eval_line = __LINE__ + 1\n target_class_eval %{\n def #{method_name}(*args, &block)\n instance_variable_get('@flexmock_proxy').\n mock.#{method_name}(*args, &block)\n end\n }, __FILE__, eval_line\n _ = true # make rcov recognize the above eval is covered\n end\n end",
"title": ""
},
{
"docid": "05fbaab1ab402e80feade7c43e6dac75",
"score": "0.46343735",
"text": "def method_missing(method, *args, &block)\n self.class.define_proxy method\n send(method, *args, &block)\n end",
"title": ""
},
{
"docid": "da1d50a09b7177a224bfc6f5351b268b",
"score": "0.46309328",
"text": "def singleton_method_alias( newname, original )\n\t\t\tsingleton_class.__send__( :alias_method, newname, original )\n\t\tend",
"title": ""
},
{
"docid": "619aa2e9665421d2e1e7c8ccff752de6",
"score": "0.462554",
"text": "def safe_alias_method(new_alias, method_name)\n target_class_eval do\n begin\n alias_method(new_alias, method_name)\n rescue NameError\n nil\n end\n end\n end",
"title": ""
},
{
"docid": "a5157ce9a43e5487ed1650d7bf5cadbf",
"score": "0.46100956",
"text": "def default_callback_method\n if respond_to?(:ventable_callback_method_name)\n self.ventable_callback_method_name\n else\n target = self\n method = \"handle_\" + target.name.gsub(/::/,'__').underscore.gsub(/_event/, '')\n method.to_sym\n end\n end",
"title": ""
},
{
"docid": "7662b73615ee4ff55c1e8ab5459ae0e3",
"score": "0.46079737",
"text": "def method_missing(method_name, *arguments, &block)\n ardrone.send(method_name, *arguments, &block)\n end",
"title": ""
},
{
"docid": "7662b73615ee4ff55c1e8ab5459ae0e3",
"score": "0.46079737",
"text": "def method_missing(method_name, *arguments, &block)\n ardrone.send(method_name, *arguments, &block)\n end",
"title": ""
},
{
"docid": "f699d28c28b21956f19c1bb6b3d05d6e",
"score": "0.4555464",
"text": "def delegate\n old, @delegate = @delegate, true\n out = yield\n @delegate = old\n out\n end",
"title": ""
},
{
"docid": "e4f51a30208670df7b21ab44d46ef17a",
"score": "0.45534036",
"text": "def singleton_method_added(singleton_method_name)\n\n # Skip any methods that are excluded. See @@wrap_exclusions for more information.\n if @@wrap_exclusions.include?(singleton_method_name.to_sym)\n return\n end\n\n # A method that was once wrapped must now be in the excluded list, as well as it's alias.\n # This is to prevent infinite loop.\n @@wrap_exclusions << singleton_method_name.to_sym\n @@wrap_exclusions << \"old_#{singleton_method_name}\".to_sym\n\n # Because I am in a class method here, I need the special self.class_eval\n # in order to add new class methods. Because the names are part of a variable,\n # I use the HEREDOC so I can call alias_method and redefine the same method.\n #\n # * We create an alias so we can call the original method.\n # * We redefine the method by calling before and after callbacks.\n # * The before callbacks are skipped if they are already called without the after.\n # * The after callbacks are skipped if one of the method called a sibbling.\n # We only do the after callbacks when its the original methods that has finished.\n # * Any arguments and return values are perseved\n # * Methods that supports blocks are not supported.\n self.class_eval <<-RUBY_EVAL, __FILE__, __LINE__ + 1\n class << self\n alias_method :old_#{singleton_method_name}, :#{singleton_method_name}\n end\n def self.#{singleton_method_name}(*args)\n if time_to_call_before_methods?\n before_methods.each do |method|\n send(method)\n end\n end\n entering_wrap_method\n result = old_#{singleton_method_name} *args\n leaving_wrap_method\n if time_to_call_after_methods?\n after_methods.each do |method|\n send(method)\n end\n end\n result\n end\n RUBY_EVAL\n\n end",
"title": ""
},
{
"docid": "35d3461c0fc29e6e586637c516aa25a2",
"score": "0.45513707",
"text": "def add_method_name(current_string)\n adjusted_method_name = if @method_name.present? && (@method_name[0] == '/' || @method_name[0] == '.')\n log_hint(BuilderHints::METHOD_NAME_LEADING)\n \"#{@method_name} \"\n else\n \"/#{@method_name} \"\n end\n add_if_present(@method_name, current_string, adjusted_method_name)\n end",
"title": ""
},
{
"docid": "2ef3da658fa2a4a8db0c4009566a1383",
"score": "0.45448878",
"text": "def define_proxy_method(method_name)\n if method_name.to_s =~ /=$/\n eval_line = __LINE__ + 1\n sclass.class_eval %{\n def #{method_name}(*args, &block)\n @flexmock_proxy.mock.__send__(:#{method_name}, *args, &block) \n end\n }, __FILE__, eval_line\n else\n eval_line = __LINE__ + 1\n sclass.class_eval %{\n def #{method_name}(*args, &block)\n @flexmock_proxy.mock.#{method_name}(*args, &block) \n end\n }, __FILE__, eval_line\n make_rcov_recognize_the_above_eval_is_covered = true\n end\n end",
"title": ""
},
{
"docid": "8fbc6f053e61cc2459a0b7979805eaf2",
"score": "0.452926",
"text": "def method(name=nil) # :nodoc:\n return name ? super : @meth\n end",
"title": ""
},
{
"docid": "83c2b6f2dbac7ad26cfac27dacb526fa",
"score": "0.45269182",
"text": "def define_writer_method(attribute, method_name, visibility)\n define_method(method_name) { |value| attribute.set(self, value) }\n send(visibility, method_name)\n self\n end",
"title": ""
},
{
"docid": "2a08a7ef89ec6672bfec827fea14776c",
"score": "0.45255154",
"text": "def define_new_method!\n advised = self\n\n advised.mod_target.instance_eval do\n define_method advised.new_meth do | *args, &block |\n ar = ActivationRecord.new(advised, self, args, block)\n\n # Proc to invoke the old method with :before and :after advise hooks.\n body = Proc.new do\n self.__send__(advised.before_meth, ar)\n begin\n ar.result = self.__send__(advised.old_meth, *ar.args, &ar.block)\n rescue ::Object => err\n ar.error = err\n ensure\n self.__send__(advised.after_meth, ar)\n end\n ar.result\n end\n\n # Invoke the :around advice with the body Proc.\n self.__send__(advised.around_meth, ar, body)\n\n # Reraise Exception, if occured.\n raise ar.error if ar.error\n\n # Return the message result to caller.\n ar.result\n end # define_method\n end # instance_eval\n\n self\n end",
"title": ""
},
{
"docid": "34da04630fa80fea118fdc5e0e69f236",
"score": "0.452279",
"text": "def and_default_to(default_method, &block)\n raise(ArgumentError, 'Default method is nil!') unless default_method\n raise(ArgumentError, 'Default method has already been specified!') if @default_method\n\n @default_method = default_method\n attempt(block)\n end",
"title": ""
},
{
"docid": "588c8bbc4479e6ad53b6c63d0c63b81f",
"score": "0.45193258",
"text": "def method_missing(name, *args, &block)\n target.send(name, *args, &block)\n end",
"title": ""
},
{
"docid": "62640aea072eac60aae8024e1464bdaf",
"score": "0.45127386",
"text": "def method_missing(method, *args, &block)\n _target.send method, *args, &block\n end",
"title": ""
},
{
"docid": "0c4ab71d9dffb14dc1d58584bc74b637",
"score": "0.45107934",
"text": "def method_missing(method_name, *args, &block)\n # If `delegate_all_to` has been set up for the method name\n # then delegate to it, otherwise pass it up the food chain\n if !delegating_all_to? && delegate_all_responds_to?(method_name)\n delegate_all_to.send(method_name, *args, &block)\n else\n super\n end\n end",
"title": ""
},
{
"docid": "6723469da387eecc6867ac3e10f1ba58",
"score": "0.4507246",
"text": "def method(name = nil)\n name.nil? ? @method : super(name)\n end",
"title": ""
},
{
"docid": "fb971f2350531014322f3259141f9ecf",
"score": "0.45071125",
"text": "def hide_existing_method(method_name)\n stow_existing_definition(method_name)\n define_proxy_method(method_name)\n end",
"title": ""
},
{
"docid": "fb971f2350531014322f3259141f9ecf",
"score": "0.45071125",
"text": "def hide_existing_method(method_name)\n stow_existing_definition(method_name)\n define_proxy_method(method_name)\n end",
"title": ""
},
{
"docid": "dd994504ec998deb7b539854dbc82fc8",
"score": "0.45060697",
"text": "def make_accessor(called, with_object)\n class << self\n self\n end.send(:define_method, called.to_s) do\n with_object\n end\n end",
"title": ""
},
{
"docid": "6a86407ecf0a3ebed901647a487bf385",
"score": "0.45041746",
"text": "def name\n @delegate.name\n end",
"title": ""
},
{
"docid": "26bba6bf1953732226a7ac93913584b4",
"score": "0.45013794",
"text": "def define_singleton_method(symbol, method)\n # TODO\n end",
"title": ""
},
{
"docid": "19be01356d0b181a64efecb87b9a47af",
"score": "0.44974545",
"text": "def delegate_to klass_or_object\n @delegators.each do |data|\n unless data.empty?\n name = data[:name]\n args = data[:params]\n klass_or_object.send(name, *args)\n end\n end\n end",
"title": ""
},
{
"docid": "89369c043da602d2c1048bf50237eab9",
"score": "0.4493652",
"text": "def define_attribute_method(attr_name, _owner: generated_attribute_methods)\n CodeGenerator.batch(_owner, __FILE__, __LINE__) do |owner|\n attribute_method_matchers.each do |matcher|\n method_name = matcher.method_name(attr_name)\n\n unless instance_method_already_implemented?(method_name)\n generate_method = \"define_method_#{matcher.target}\"\n\n if respond_to?(generate_method, true)\n send(generate_method, attr_name.to_s, owner: owner)\n else\n define_proxy_call true, owner, method_name, matcher.target, attr_name.to_s\n end\n end\n end\n attribute_method_matchers_cache.clear\n end\n end",
"title": ""
},
{
"docid": "09161ac52aefe5f55d9d845f15bf3ecf",
"score": "0.4490441",
"text": "def define_reader_method(attribute, method_name, visibility)\n define_method(method_name) { attribute.get(self) }\n send(visibility, method_name)\n self\n end",
"title": ""
},
{
"docid": "7fb4dfbd0640dd319f0496fa620a28c1",
"score": "0.4490108",
"text": "def implement(method_name)\n method = @klass.instance_method(method_name)\n end",
"title": ""
},
{
"docid": "8be73b1fa6dc0a0b1f944eab36ec8429",
"score": "0.44837484",
"text": "def add_reader_tags(klass, new_method, member); end",
"title": ""
},
{
"docid": "935ee83cef69ed955f2a4dbc62dfc9df",
"score": "0.44662884",
"text": "def method_missing(*args, &block)\n m = args.shift # Firt arg is the name of the method \n begin \n # Trace the invocation of the method.\n arglist = args.map {|a| a.inspect }.join(', ')\n @trace << \"Invoking: #{@n}.#{m}(#{arglist}) at #{caller[0]}\\n\"\n # Invoke the method on our delegate object and get the return value. \n r = @o.send m, *args, &block\n # Trace a normal return of the method. \n @trace << \"Returning: #{r.inspect} from #{@n}.#{m} to #{caller[0]}\\n\"\n # Return whaterver value the delegate object returned.\n r\n rescue Exception => e\n # Trace an abnormal return from the method.\n @trace << \"Rasing: #{e.class}:#{e} from #{@n}.#{m}\\n\"\n # And re-raise whaterver exception the delegate object raised.\n raise \n end \n end",
"title": ""
},
{
"docid": "24dd63093e1f85fc07a9c9f2a5604e01",
"score": "0.4457227",
"text": "def method_missing(*a)\n method_name = a[0]\n if block_given?\n __retrying(method_name) { @o.public_send(*a){|*ba| yield(*ba)} }\n else\n __retrying(method_name) { @o.public_send(*a) }\n end\n end",
"title": ""
},
{
"docid": "19b316d5fbe37538fbf6a0e4e7c1a1f4",
"score": "0.444475",
"text": "def method_missing(name, *args, &block)\n target.send(name, *args, &block)\n end",
"title": ""
},
{
"docid": "3335cac9a6f79f238d9b3cb6f7f97e72",
"score": "0.44440266",
"text": "def method_missing(name, *args, &block)\n @target.send(name, *args, &block)\n end",
"title": ""
},
{
"docid": "554f9633d5dac8936b0e9a66f2b7627c",
"score": "0.443593",
"text": "def define_virtual_delegate(method_name, col, options)\n unless (to = options[:to]) && (to_ref = reflection_with_virtual(to.to_s))\n raise ArgumentError, 'Delegation needs an association. Supply an options hash with a :to key as the last argument (e.g. delegate :hello, to: :greeter).'\n end\n\n col = col.to_s\n type = options[:type] || to_ref.klass.type_for_attribute(col)\n type = ActiveRecord::Type.lookup(type) if type.kind_of?(Symbol)\n raise \"unknown attribute #{to}##{col} referenced in #{name}\" unless type\n arel = virtual_delegate_arel(col, to_ref)\n define_virtual_attribute(method_name, type, :uses => (options[:uses] || to), :arel => arel)\n end",
"title": ""
},
{
"docid": "20f4073ee90a39f62580a19cdd633507",
"score": "0.44335994",
"text": "def abstract_singleton_method(*names); end",
"title": ""
},
{
"docid": "43217013fa0468fa603d1c587e072738",
"score": "0.4431652",
"text": "def delegate_methods_to(methods, ivar)\n return if methods.blank?\n def_delegators ivar, *methods\n end",
"title": ""
},
{
"docid": "9109a94b097267852058e53e34a6b31d",
"score": "0.4427558",
"text": "def delegate(obj, method, m_alias = method)\n dynlink(m_alias) do |*args|\n instance = (obj[0] == \"@\") ?\n instance_variable_get(obj) :\n send(obj)\n instance.send(method, *args)\n end\n end",
"title": ""
},
{
"docid": "95f648df05694f8981d99710c925e895",
"score": "0.44238824",
"text": "def method_missing(method, *arguments, &block)\n return if controller.nil?\n if define_delegation_method( method )\n self.send( method )\n else\n controller.__send__(method, *arguments, &block)\n end\n end",
"title": ""
},
{
"docid": "2f119b8381e57930290cd27b233d564e",
"score": "0.44220123",
"text": "def delegate_methods(*symbols); end",
"title": ""
},
{
"docid": "1ba0916ca3d0226a66c467f18fb2f960",
"score": "0.44184268",
"text": "def __delegate__\n @delegate\n end",
"title": ""
},
{
"docid": "4eec5f7ae7f69e5302cbf94d61ae8d47",
"score": "0.4414829",
"text": "def mk_method(proc)\n @klass.send(:define_method, @method_name, proc)\n end",
"title": ""
},
{
"docid": "c73e8bb018db434ed832135a5f800ba2",
"score": "0.44145408",
"text": "def method_missing(sym, *args, &block)\n proxy_target.__send__(sym, *args, &block)\n end",
"title": ""
},
{
"docid": "5b96094af40124a1a1c3217b1c75af01",
"score": "0.4412435",
"text": "def ffi_delegate(method)\n def_delegator(:@ffi_delegate, method)\n end",
"title": ""
},
{
"docid": "5d561c2fce05df923feb579d6fca2f1b",
"score": "0.43965647",
"text": "def method_missing(sym, *args, &block)\n proxy_target.__send__(sym, *args, &block)\n end",
"title": ""
},
{
"docid": "3fe9b2f73c951d907157c4429404650f",
"score": "0.43960354",
"text": "def method(method = nil)\n return @method if method.nil?\n\n @method = method.to_s.capitalize\n end",
"title": ""
},
{
"docid": "3a886c78021fdc0657d919e0acf5b6a9",
"score": "0.4386756",
"text": "def forward(receiver, *methods)\n methods = Array(methods).flatten\n target = self.__send__ :eval, receiver.to_s rescue nil\n\n if target\n single_delegate methods => receiver\n else\n instance_delegate methods => receiver\n end\n end",
"title": ""
},
{
"docid": "be3ada4a78117e5311194a559ac01720",
"score": "0.43861556",
"text": "def decorates(*args)\n args.each do |name|\n __delegates << name\n end\n end",
"title": ""
},
{
"docid": "e82d3ed7d5b5b4ded427ee5e66c1e3be",
"score": "0.43851775",
"text": "def method_missing(method_name, *args, &block)\n if target.respond_to?(method_name)\n target.public_send(method_name, *args, &block)\n else\n super\n end\n end",
"title": ""
}
] |
b558a9de29444c5368d92e34dc30b0e8 | Returns provider class responsible for Spree payment method action implementations. | [
{
"docid": "bba2f9198044ed084a2539d55cfda1ff",
"score": "0.67842466",
"text": "def provider_class\n ::Spree::PAYONE::Provider::Payment::OnlineBankTransfer\n end",
"title": ""
}
] | [
{
"docid": "788a72deb0684a4043e6dae46088667b",
"score": "0.7195949",
"text": "def provider_class\n Spree::PayU::Provider\n end",
"title": ""
},
{
"docid": "4ef01032f216d6a2388f1848f13ead51",
"score": "0.71931016",
"text": "def provider_class\n ::Spree::PAYONE::Provider::Payment::CashOnDelivery\n end",
"title": ""
},
{
"docid": "edc78bfea1e8fcb60095145049515691",
"score": "0.6532728",
"text": "def payment_source_class\n Spree::AffirmCheckout\n end",
"title": ""
},
{
"docid": "2c9c95e99c0fedb525da3fedb08005c8",
"score": "0.65183455",
"text": "def provider\n #assign payment mode\n OffsitePayments.mode = preferred_test_mode == true ? :test : :production\n provider_class\n end",
"title": ""
},
{
"docid": "88032c54e3cf9b0212c7aaa18c707ccd",
"score": "0.6495224",
"text": "def payment_method\n @payment_method ||= Spree::PaymentMethod.find(params[:payment_method_id])\n @payment_method ||= Spree::PaymentMethod.find_by_type(\"Spree::BillingIntegration::SermepaPayment\")\n end",
"title": ""
},
{
"docid": "75f2dd53881a3cb8dc9cc3f5048e02ee",
"score": "0.64740133",
"text": "def payment_method\n @payment_method ||= Spree::PaymentMethod.find(params[:payment_method_id])\n end",
"title": ""
},
{
"docid": "f25ca7ff478f0c9790304670a0e88d5f",
"score": "0.6348415",
"text": "def provider_for_action(action)\n provider(self.class.fused_provider_class) unless provider\n super\n end",
"title": ""
},
{
"docid": "f6e919d7c14e26753f05ff471e4fc799",
"score": "0.63152814",
"text": "def provider_class\n Spree::BillingIntegration::AlipayProvider\n end",
"title": ""
},
{
"docid": "d21413ef1875bc017011a809ff3c140f",
"score": "0.62829983",
"text": "def payment_method\n @payment_method ||= Spree::PaymentMethod.find(params[:payment_method_id]) if params[:payment_method_id]\n @payment_method ||= Spree::PaymentMethod.find_by_type(\"Spree::BillingIntegration::SaferpayPayment\")\n end",
"title": ""
},
{
"docid": "a33607b4974ba51ac980df6ededa2681",
"score": "0.6282075",
"text": "def fused_provider_class\n @fused_provider_class ||= begin\n provider_superclass = begin\n self.superclass.fused_provider_class\n rescue NoMethodError\n Chef::Provider\n end\n actions = fused_actions\n class_name = self.name\n Class.new(provider_superclass) do\n include Poise\n define_singleton_method(:name) { class_name + ' (fused)' }\n actions.each do |action, block|\n define_method(:\"action_#{action}\", &block)\n end\n end\n end\n end",
"title": ""
},
{
"docid": "3ee8689239f678a66d06939ef8bc8759",
"score": "0.6177048",
"text": "def method_type\n \"spree_ideal_lite\"\n end",
"title": ""
},
{
"docid": "c21060e7355ef702f8e8fbd81f1e69df",
"score": "0.6173225",
"text": "def payment_source_class\n CieloRegularPayment\n end",
"title": ""
},
{
"docid": "a48a208e52d1a30759ef59331f33f2df",
"score": "0.61535",
"text": "def retrieve\n provider.send(self.class.name)\n end",
"title": ""
},
{
"docid": "9a1372bccef34f19053b80ead48729ef",
"score": "0.6109109",
"text": "def provider_class\n self.class\n end",
"title": ""
},
{
"docid": "9a1372bccef34f19053b80ead48729ef",
"score": "0.6109109",
"text": "def provider_class\n self.class\n end",
"title": ""
},
{
"docid": "9a1372bccef34f19053b80ead48729ef",
"score": "0.6109109",
"text": "def provider_class\n self.class\n end",
"title": ""
},
{
"docid": "bea00e95213888d4a0ebaa5ac310c4ac",
"score": "0.6099462",
"text": "def payment_method\n @payment_method ||= PAYMENT_METHOD[mapping_for()]\n end",
"title": ""
},
{
"docid": "e76adb3c2e30979cae140e2f1d410e2c",
"score": "0.6078095",
"text": "def payment_method\n raise NotImplementedError.new(\"'#payment_method' must be implemented in specific class\")\n end",
"title": ""
},
{
"docid": "748818efcdad4051396823541a425c8e",
"score": "0.60642225",
"text": "def provider_class\n ActiveMerchant::Billing::Integrations::Redsys\n end",
"title": ""
},
{
"docid": "748818efcdad4051396823541a425c8e",
"score": "0.60642225",
"text": "def provider_class\n ActiveMerchant::Billing::Integrations::Redsys\n end",
"title": ""
},
{
"docid": "f41eb15b867b799ebd2e8d978dd87117",
"score": "0.60578895",
"text": "def provider_class\n ActiveMerchant::Billing::Integrations::Redsys\n end",
"title": ""
},
{
"docid": "b19ec6364f9d920ef08b1f3a224547ca",
"score": "0.6025092",
"text": "def payment_source_class\n ::Spree::PaymentSource::PAYONE::PayoneCashOnDeliveryPaymentSource\n end",
"title": ""
},
{
"docid": "afab9d1ddfd884039d67817161f474b6",
"score": "0.5992429",
"text": "def payment_method\n payment.type rescue nil\n end",
"title": ""
},
{
"docid": "985a6299a3dcccea6e3a7cafd9e80169",
"score": "0.5966159",
"text": "def code_action_provider\n attributes.fetch(:codeActionProvider)\n end",
"title": ""
},
{
"docid": "8e9ba3d6547f63d4d35f92b2fa2ed9e4",
"score": "0.59422964",
"text": "def provider\n @provider ||= \"::Provider::#{provider_name.to_s.camelize}\".constantize.new(self)\n end",
"title": ""
},
{
"docid": "d6958414208542f9240bd7c325fefe52",
"score": "0.5942005",
"text": "def payment_method; end",
"title": ""
},
{
"docid": "ff97d5ade23be5ef302d1f194caecea8",
"score": "0.59405124",
"text": "def my_provider\n self.class.my_provider\n end",
"title": ""
},
{
"docid": "ff97d5ade23be5ef302d1f194caecea8",
"score": "0.59405124",
"text": "def my_provider\n self.class.my_provider\n end",
"title": ""
},
{
"docid": "ff97d5ade23be5ef302d1f194caecea8",
"score": "0.59405124",
"text": "def my_provider\n self.class.my_provider\n end",
"title": ""
},
{
"docid": "d4af60c143461c469e76b158253b1c91",
"score": "0.5938805",
"text": "def provider_class\n ActiveMerchant::Billing::EwayGateway\n end",
"title": ""
},
{
"docid": "5787d2fd380159ae6f80f5fbd4bdc0b9",
"score": "0.5921883",
"text": "def resource_class\n payment_mapping.klass\n end",
"title": ""
},
{
"docid": "5516d7d38e518f57366935230e497014",
"score": "0.59181476",
"text": "def payment_method\n extract_raw_value __callee__\n end",
"title": ""
},
{
"docid": "fadbc1fd3a5640dbc5051c52dafe3788",
"score": "0.5892433",
"text": "def payment_method\n @payment_method ||= PaymentMethod.get(payment_method_id.to_sym)\n end",
"title": ""
},
{
"docid": "1a9d9de6164d68248de1234b148ce698",
"score": "0.5852061",
"text": "def payment_source_class\n ::Spree::PaymentSource::PAYONE::PayoneOnlineBankTransferPaymentSource\n end",
"title": ""
},
{
"docid": "7ee131cc689256aab2452cb25e0412d4",
"score": "0.58419013",
"text": "def provider\n Provider.fetch(@provider_name)\n end",
"title": ""
},
{
"docid": "a163563172f518376f563b87e36f6d9e",
"score": "0.58391404",
"text": "def provider_class\n ActiveMerchant::Billing::StripeGateway\n end",
"title": ""
},
{
"docid": "90260bb19685af09c26f20000ac4746b",
"score": "0.5836132",
"text": "def payment_method\n @_cama_cache_payment_method ||= Plugins::Ecommerce::PaymentMethod.find_by_id(get_meta('payment_method_id', self.payment_method_id))\n end",
"title": ""
},
{
"docid": "bfa50658d86a2e8472a5d707107156c4",
"score": "0.58245087",
"text": "def provider\n @provider\n end",
"title": ""
},
{
"docid": "bfa50658d86a2e8472a5d707107156c4",
"score": "0.58245087",
"text": "def provider\n @provider\n end",
"title": ""
},
{
"docid": "6cf7bf692648b0a05a63e1f22a16bffe",
"score": "0.5790598",
"text": "def provider\n if @provider == 'paypal'\n return TradoPaypalModule::Paypaler\n elsif @provider == 'stripe'\n return TradoStripeModule::Striper\n end\n end",
"title": ""
},
{
"docid": "e0a9f24cbcf1f1db05cf413cd9ae94e6",
"score": "0.5780035",
"text": "def payment_type\n :payment\n end",
"title": ""
},
{
"docid": "e0a9f24cbcf1f1db05cf413cd9ae94e6",
"score": "0.5780035",
"text": "def payment_type\n :payment\n end",
"title": ""
},
{
"docid": "972c2e3a1f2b6c98eb511f51ca054274",
"score": "0.57763743",
"text": "def payment_type\n :payment\n end",
"title": ""
},
{
"docid": "0fa1181837ca7dc08f358516ffa3f4b0",
"score": "0.57688147",
"text": "def method_type\n 'cmcb_payment_source'\n end",
"title": ""
},
{
"docid": "3a32f8dabcbd30b94552d6740c732de6",
"score": "0.57252115",
"text": "def provider\n gateway_options = options\n gateway_options.delete :login if gateway_options.has_key?(:login) and gateway_options[:login].nil?\n ActiveMerchant::Billing::Base.gateway_mode = gateway_options[:server].to_sym\n @provider ||= provider_class.new(gateway_options)\n end",
"title": ""
},
{
"docid": "ba9e1ec71741a88d17c85cdc3bc9c791",
"score": "0.5695516",
"text": "def payment_source_class\n ::Spree::PaymentSource::PAYONE::PayoneDebitPaymentPaymentSource\n end",
"title": ""
},
{
"docid": "73d8329e49569f661247810a291e8234",
"score": "0.5692065",
"text": "def payment_method\n PaymentMethod.find(params[:payment_method_id])\n end",
"title": ""
},
{
"docid": "73d8329e49569f661247810a291e8234",
"score": "0.5692065",
"text": "def payment_method\n PaymentMethod.find(params[:payment_method_id])\n end",
"title": ""
},
{
"docid": "a600c60ccf8dcbcceb23ec46f0489f61",
"score": "0.5689923",
"text": "def payment_method(type)\n payment_method = payment_methods.actives.detect do |payment_method|\n payment_method.get_option('type') == type\n end\n if payment_method.nil?\n raise ArgumentError, \"Payment method #{type} is not found\"\n end\n payment_method\n end",
"title": ""
},
{
"docid": "9f4e2f41506e9da9ee4802f7143a30b5",
"score": "0.5630573",
"text": "def method_type\n 'payone_cashondelivery'\n end",
"title": ""
},
{
"docid": "c30dc6b74ed44ee395349751012ff97f",
"score": "0.5608349",
"text": "def payment_source_class\n ::Spree::PaymentSource::PAYONE::PayoneInvoicePaymentSource\n end",
"title": ""
},
{
"docid": "f0e2616a115c09b17b92912374191108",
"score": "0.5607238",
"text": "def method_type\n 'payone_creditcard'\n end",
"title": ""
},
{
"docid": "361a2ea0c6c8d7f72bb76f5ff833461e",
"score": "0.5576294",
"text": "def gateway_class\n if respond_to? :provider_class\n Spree::Deprecation.warn \\\n \"provider_class is deprecated and will be removed from Solidus 3.0 \" \\\n \"(use gateway_class instead)\"\n public_send :provider_class\n else\n raise ::NotImplementedError, \"You must implement gateway_class method for #{self.class}.\"\n end\n end",
"title": ""
},
{
"docid": "fdef0bae3c77e13d76009d95aa606ca3",
"score": "0.55696344",
"text": "def provider\n @provisioner.provider\n end",
"title": ""
},
{
"docid": "5750d55fc980021c06b1d550246fa06f",
"score": "0.5568948",
"text": "def provider_class\n ActiveMerchant::Billing::Maksut\n end",
"title": ""
},
{
"docid": "08d222f32abe4fb9faf83f5afc29226f",
"score": "0.5550581",
"text": "def blender_provider_class\n @blender_provider_class ||= begin\n provider_superclass = begin\n self.superclass.blender_provider_class\n rescue NoMethodError\n Chef::Provider\n end\n actions = blender_actions\n class_name = self.name\n Class.new(provider_superclass) do\n include Garcon\n define_singleton_method(:name) { class_name + ' (blender)' }\n actions.each do |action, block|\n define_method(:\"action_#{action}\", &block)\n end\n end\n end\n end",
"title": ""
},
{
"docid": "8811dbefd1108e15307e3e230474f26c",
"score": "0.55443996",
"text": "def provider_for_action(action)\n provider(self.class.blender_provider_class) unless provider\n super\n end",
"title": ""
},
{
"docid": "c098c2dc102eaf21226814270c511ee5",
"score": "0.5538632",
"text": "def provider\n @resource.provider\n end",
"title": ""
},
{
"docid": "973039700628c6fbfdc4e4df0d2003d8",
"score": "0.55366915",
"text": "def payment_method\n @values[:payment_method]\n end",
"title": ""
},
{
"docid": "d62e436a7b6f1426e2bd793da6c7d23c",
"score": "0.5527114",
"text": "def payment\n if pay = charge_params.dig('payment_method')\n ::Payment.new( pay.dig('gateway_token'), pay.dig('expires_at') )\n end\n end",
"title": ""
},
{
"docid": "9203f69dc7a31e3e365d354e73653d23",
"score": "0.55085236",
"text": "def payment_source_class\n nil\n end",
"title": ""
},
{
"docid": "f76f5b3cbe6c646cfca81c06abe3c1d0",
"score": "0.5500378",
"text": "def payment_source_class\n CreditCard\n end",
"title": ""
},
{
"docid": "c594a0d7b6ae00511d223b0533636c9c",
"score": "0.54925597",
"text": "def code_action_provider; end",
"title": ""
},
{
"docid": "2748d5c67ef15eb8ee14629a32c4080f",
"score": "0.5475361",
"text": "def as_stripe_payment_method\n @payment_method\n end",
"title": ""
},
{
"docid": "f5767b4fda0b113ac8a56f48c0b03f5d",
"score": "0.54522413",
"text": "def provider\n Struct.new(:code).new(provider_code)\n end",
"title": ""
},
{
"docid": "e11247b1968bb4579e930ebfd549f34c",
"score": "0.54512805",
"text": "def provider_class\n FileRouter::Repository::Registry.contents.fetch(self.provider_id, nil)\n end",
"title": ""
},
{
"docid": "631a100ad4941a89fa9db20246ce17da",
"score": "0.5445088",
"text": "def get_provider\n return @m_provider\n end",
"title": ""
},
{
"docid": "71abb844700948d3f159e032dea5d038",
"score": "0.5425707",
"text": "def method_type\n 'payone_debitpayment'\n end",
"title": ""
},
{
"docid": "5e1a60a37104f37d59da0a4c0a846109",
"score": "0.5420542",
"text": "def model_name\n return 'payment' if params[:action] == 'index'\n if %w(cheque_payment creditcard_payment).include?(params[:payment_type])\n params[:payment_type]\n elsif params[:action] == 'new'\n 'creditcard_payment'\n else\n 'payment'\n end\n end",
"title": ""
},
{
"docid": "96a55cd15760097bcc1a732b189715ad",
"score": "0.54183227",
"text": "def payment_source_class\n raise ::NotImplementedError, \"You must implement payment_source_class method for #{self.class}.\"\n end",
"title": ""
},
{
"docid": "031e97550867be314b4cb9227e7f5fff",
"score": "0.5383266",
"text": "def payment_service\n case kind_sym\n when :dwolla\n DwollaService.new(self)\n when :authorizenet\n AuthorizeNetService.new(self)\n when :braintree\n BraintreeService.new(self)\n when :active_merchant\n ActiveMerchantService.new(self)\n when :paypal\n PaypalService.new(data)\n when :mailchimp\n MailchimpService.new(self)\n else\n raise \"service type: #{kind} - not yet implemented\"\n end\n end",
"title": ""
},
{
"docid": "bd44e355616f20371af445b49f703bd4",
"score": "0.53746456",
"text": "def get_payment_adapter(type)\n payment_adapters.find_by(type: type)\n end",
"title": ""
},
{
"docid": "c5b38d2bb54323bc3c88b36c047dd316",
"score": "0.53704435",
"text": "def getHandlerActionObjectForProvider(provider_name)\n if @providermap.key?(provider_name)\n if @providermap[provider_name].key?('classname')\n return @providermap[provider_name]['classname']\n end\n end\n raise \"No registered provider for #{provider_name}\"\n end",
"title": ""
},
{
"docid": "355144bf3f3b48344ac0d428d5a82d4e",
"score": "0.5354988",
"text": "def provider_class(name)\n name = name.to_s\n @provider_classes[name] or raise \"no such provider for #{self}: #{name}\"\n end",
"title": ""
},
{
"docid": "5c6c0ca1bdfd32a8b1ae571849881cff",
"score": "0.53349483",
"text": "def payment_intent; end",
"title": ""
},
{
"docid": "59fb2f88f729e7c1674175f1f6d3d942",
"score": "0.5331028",
"text": "def ecommerce_custom_payment_methods\n @_ecommerce_custom_payment_methods ||= lambda{\n args = {custom_payment_methods: {}}; hooks_run(\"ecommerce_custom_payment_methods\", args)\n # Sample:\n # def my_callback(args)\n # args[:custom_payment_methods][:pay_u] = {\n # title: 'Pay U',\n # settings_view_path: '/my_plugin/views/payu/settings', # view must be like this: <div class=\"form-group\"> <label>Key</label><br> <%= text_field_tag('options[payu_key]', options[:payu_key], class: 'form-control required') %> </div>\n # payment_form_view_path: '/my_plugin/views/payu/payment_form',\n # # view must include the payment form with your custom routes to process the payment,\n # # sample: https://github.com/owen2345/camaleon-ecommerce/blob/master/app/controllers/plugins/ecommerce/front/checkout_controller.rb#L120\n # # https://github.com/owen2345/camaleon-ecommerce/blob/master/app/views/plugins/ecommerce/partials/checkout/_payments.html.erb#L104\n # }\n # end\n args[:custom_payment_methods]\n }.call\n end",
"title": ""
},
{
"docid": "1831db4dc9713322377a285e0f02ddbd",
"score": "0.53082484",
"text": "def payment_method\n param(:x_method)\n end",
"title": ""
},
{
"docid": "21364284c598001394eb73aec4dfc636",
"score": "0.52905864",
"text": "def gift_card_payment_apply\n $tracer.trace(__method__)\n return ToolTag.new(a.className(create_ats_regex_string(\"ats-applygiftcardbtn\")),__method__)\n end",
"title": ""
},
{
"docid": "c1b722f19136fac1245fb12ceb95654c",
"score": "0.5282772",
"text": "def getHandlerActionObjectForProvider(providerName)\n if @providermap.key?(providerName)\n if @providermap[providerName].key?('classname')\n return @providermap[providerName]['classname']\n end\n end\n fail \"No registered provider for #{providerName}\"\n end",
"title": ""
},
{
"docid": "83551d08b6c59cacb9759f3b38fa9385",
"score": "0.5267215",
"text": "def provider\n @provider ||= Provider.find_by(id: params[:id])\n end",
"title": ""
},
{
"docid": "9552a938e37d34df134bee398d7fbc36",
"score": "0.5261946",
"text": "def find_pay_method(method)\n case method\n when \"Cash\"\n return cash_method\n when \"Credit\" \n return credit_method\n when \"Debit\"\n return debit_method\n else\n return nil\n end\t\n end",
"title": ""
},
{
"docid": "1a2f2850cda275d15eadca4d721ec85e",
"score": "0.52158713",
"text": "def type\n @params['PAYMENTMODE']\n end",
"title": ""
},
{
"docid": "30f3aa6261ee5c8c23b30a05cab8e37a",
"score": "0.52095354",
"text": "def method_type\n 'payone_onlinebanktransfer'\n end",
"title": ""
},
{
"docid": "f90926b02ef5ec0fcbc49c0b6a741e1f",
"score": "0.52083856",
"text": "def type\n params['PAYMENTMODE']\n end",
"title": ""
},
{
"docid": "d8f25343fd16db7159839b0a5c35b0da",
"score": "0.5206829",
"text": "def provider\n \"OpenStack\"\n end",
"title": ""
},
{
"docid": "e213232d192eca21318f2410cbd1806c",
"score": "0.52041495",
"text": "def show\n authorize_action_for @shipping_method, at: current_store\n end",
"title": ""
},
{
"docid": "c704c6393a2d1d18c40a7966ad9c51ef",
"score": "0.5201676",
"text": "def payment?\n ['braintree_payment'].include?(self.action)\n end",
"title": ""
},
{
"docid": "e5e538b9dd6717634b9b29c17cd2d5e5",
"score": "0.5192382",
"text": "def payment_factory\n\t\t\tpayment = Payment.new\n\t\t\treturn payment\n\t\tend",
"title": ""
},
{
"docid": "f214e36bd5344c03627df5d0f3f0cfd4",
"score": "0.51871157",
"text": "def provider\n 'OpenStack'\n end",
"title": ""
},
{
"docid": "96288c70c254b0e3d2f0fc430973ec5c",
"score": "0.5174739",
"text": "def payment_factory\n\t\t\tpayment = Payment.new(self)\n\t\t\treturn payment\n\t\tend",
"title": ""
},
{
"docid": "2b21e961d85d1588f4b2269d3de29cbf",
"score": "0.51725155",
"text": "def provider\n browser.providers[provider_name.to_sym] || browser.first_provider\n end",
"title": ""
},
{
"docid": "3ef300a4ceb2c57fa15c5805dadf2087",
"score": "0.51568514",
"text": "def preferred_payment_method_name\n case self.preferred_payment_method.to_s\n when /debit/ then \"Zahlung per Lastschrift\"\n when /invoice/ then \"Zahlung per Rechnung\"\n when /paypal/ then \"Zahlung per Paypal\"\n end\n end",
"title": ""
},
{
"docid": "3ec9c6bac9b72569dafbcebbcb71310b",
"score": "0.5151154",
"text": "def get_customer_payment_method(options = {})\n requires! options, :customer_number, :method_id\n\n request = build_request(__method__, options)\n commit(__method__, request)\n end",
"title": ""
},
{
"docid": "e17c438fce9d95710b1f4c6c0d8f9afc",
"score": "0.5150595",
"text": "def find_payment_method\n\t\t@payment_method = PaymentMethod.find(params[:id])\n\tend",
"title": ""
},
{
"docid": "949668cc7b7387f96de0cdca9efd3406",
"score": "0.51484525",
"text": "def add_payment_method(token = nil, default: true)\n Pay::Paddle::PaymentMethod.sync(pay_customer: pay_customer)\n end",
"title": ""
},
{
"docid": "d65bc87d2d313cbd64f15e2bdcbce6cd",
"score": "0.51408833",
"text": "def to_provider\n inst = self.provider_class\n\n if inst.nil?\n nil\n else\n Rails.cache.fetch(\"repository.#{self.id}\", expires_in: 5.minutes) do\n inst.new(self.name, self.configiration)\n end\n end\n end",
"title": ""
},
{
"docid": "a2b2213fbb10892b72c6ede353856f9c",
"score": "0.51332814",
"text": "def available_payment_methods\n @available_payment_methods ||= (Spree::PaymentMethod.available(:front_end) + Spree::PaymentMethod.available(:both)).uniq\n end",
"title": ""
},
{
"docid": "8634ec004e32143770f71354579007c7",
"score": "0.51319516",
"text": "def provider_methods\n provider.provider_can_use?(:apicast_v2) ? [] : [:provider_key]\n end",
"title": ""
},
{
"docid": "4de7fed94cf13ea24ff009b786526260",
"score": "0.51255286",
"text": "def payment_type\n :piggy_bank\n end",
"title": ""
},
{
"docid": "64761a796375a9346355e5840ad49f57",
"score": "0.51185834",
"text": "def delivery_klass\n case delivery_method\n when \"noop\"\n Delivery::Noop\n when \"logger\"\n Delivery::Logger\n when \"letter_opener\"\n Delivery::LetterOpener\n else\n Delivery::Postback\n end\n end",
"title": ""
}
] |
281f6a5a0759b8d3a68098dc26379c7c | Launch School 101109 Small Problems Exercises (2nd time through) | [
{
"docid": "699d3ec4784d5f646b043235e21d298b",
"score": "0.0",
"text": "def word_cap(str)\n str.split.map { |element| element.capitalize }.join(' ')\nend",
"title": ""
}
] | [
{
"docid": "1517341070b97466b43a18633f066374",
"score": "0.67007124",
"text": "def exercise_119 (number)\n end",
"title": ""
},
{
"docid": "ba17e15839a624ee4b18b1c7ddad7f07",
"score": "0.6555063",
"text": "def problem_8\nend",
"title": ""
},
{
"docid": "83e9a7757aeca4ca38f69912a19d935d",
"score": "0.6295172",
"text": "def problem_14\nend",
"title": ""
},
{
"docid": "a27b4be0d11cd618060f506d453a50a4",
"score": "0.62038267",
"text": "def first_puzzle a\n # write down your solution to puzzle 1 here\nend",
"title": ""
},
{
"docid": "a1135fbd156684077e8da16973842fea",
"score": "0.6086932",
"text": "def fifth_puzzle\n sample = fourth_puzzle.sort!.each { |x| p x }\n p \"Min is \" + sample[0].to_s\n p \"Max is \" + sample[-1].to_s\nend",
"title": ""
},
{
"docid": "b9960478999684c2b536f76e22f6fc63",
"score": "0.606851",
"text": "def solution4(input)\n end",
"title": ""
},
{
"docid": "403bd7a60c67a00a8dea9f47f1e863b2",
"score": "0.59762466",
"text": "def exercise_1113 (matrix)\n end",
"title": ""
},
{
"docid": "339f7683874149c5449010d85f59b7b4",
"score": "0.59626496",
"text": "def problem_six\n (1.upto(100).reduce(:+)) ** 2 - (1.upto(100).map { |n| n ** 2 }).reduce { |sum, n| sum + n }\n end",
"title": ""
},
{
"docid": "3fc2b24227cbb5f7478364c1e6487863",
"score": "0.5928473",
"text": "def run_tests\n check_solution(1, [6, 29, 18, 2, 72, 19, 18, 10, 37], 18, 2)\n check_solution(2, [6, 29, 18, 2, 72, 19, 18, 10, 37], 9, -1)\nend",
"title": ""
},
{
"docid": "8c2614d0e342e2e8c318dee1dee4dc55",
"score": "0.5913404",
"text": "def solve(ingredients, part_two: false)\n score = 0\n max = 0\n\n (0..100).each do |i|\n (0..100 - i).each do |j|\n (0..100 - i - j).each do |k|\n l = 100 - i - j - k\n capacity = calculate_total(ingredients, \"capacity\", i, j, k, l)\n durability = calculate_total(ingredients, \"durability\", i, j, k, l)\n flavor = calculate_total(ingredients, \"flavor\", i, j, k, l)\n texture = calculate_total(ingredients, \"texture\", i, j, k, l)\n calories = calculate_total(ingredients, \"calories\", i, j, k, l)\n\n next if part_two && calories != 500\n next if capacity <= 0 || durability <= 0 || flavor <= 0 || texture <= 0\n\n score = capacity * durability * flavor * texture\n max = score if score > max\n end\n end\n end\n max\nend",
"title": ""
},
{
"docid": "6e0569e082e3573e5f98af48c5bc5909",
"score": "0.5903669",
"text": "def generate_solution_space\n @problem.add( \"N { assigned(C,WD,TF) : weekday(WD,_), timeframe(TF,_) } N :- course_component(C,_,N,_,_,_).\" )\n end",
"title": ""
},
{
"docid": "a405800bd4e37c5bee8243265e2283ff",
"score": "0.58832103",
"text": "def part2(program)\n special = 19690720\n (0..99).to_a.repeated_permutation(2).each do |noun, verb|\n input = program.dup\n input[1] = noun\n input[2] = verb\n\n output = run(input)\n puts \"noun = #{noun}, verb = #{verb}, output = #{output[0]}\"\n if output[0] == special\n return [noun, verb]\n end\n end\n puts \"fuck\"\n return [-1, -1]\nend",
"title": ""
},
{
"docid": "e8880fe60869bc9668a8d99bd4ae3115",
"score": "0.58572793",
"text": "def solveProblem lst\n big = -1\n numbers = {}\n half = lst.length / 2\n lst.each do |i|\n if numbers.has_key?(i) then\n numbers[i] += 1\n else\n numbers[i] = 1\n end\n if numbers[i] > half then return i end\n end\n return big\nend",
"title": ""
},
{
"docid": "c0f21c28dce7559758e2d94971e953b4",
"score": "0.5851171",
"text": "def help(game)\n\n game = game.game()\n\n #Algorithm for each columns\n (0...game.nCol).each do |i|\n\n cell = nil #reset\n nbTent = 0\n\n whiteZone = FindWhiteZone.find(game, 0, i)\n whiteZone.each do |zone| #Count the number of possible tent\n if (zone.size % 2 == 0)\n nbTent += (zone.size / 2)\n else\n nbTent += (zone.size / 2) + 1\n cell = zone.first #registered answer\n end\n end\n nbTent += Count.count(game, :tent, 0, i)\n\n if nbTent != game.colClues[i]\n break\n end\n\n if !(cell.nil?) #We find an answer\n return HelpAllPossibilitiesGiveItRow.new(cell, game.correction.cols[i], \"tent\")\n end\n\n end\n\n #Algorithm for each row\n (0...game.nRow).each do |i|\n\n cell = nil #reset\n nbTent = 0\n\n whiteZone = FindWhiteZone.find(game, 1, i)\n whiteZone.each do |zone| #Count the number of possible tents\n if (zone.size % 2 == 0)\n nbTent += (zone.size / 2)\n else\n nbTent += (zone.size / 2) + 1\n cell = zone.first #register answer\n end\n end\n nbTent += Count.count(game, :tent, 1, i)\n\n if nbTent == game.rowClues[i]\n\n if !(cell.nil?) #We find an answer\n return HelpAllPossibilitiesGiveItColumn.new(cell, game.correction.rows[i], \"tent\")\n end\n\n end\n end\n\n return HelpNotFound.new()\n\n end",
"title": ""
},
{
"docid": "9c95e1d5c57bb5976e3e16713745455f",
"score": "0.58429146",
"text": "def solution\n line = 0\n puts \"*********************************\"\n puts \"********* SOLUTION **************\"\n puts \"*********************************\"\n @rows.each do |i|\n puts \"[#{i[0]}][#{i[1]}][#{i[2]}] | [#{i[3]}][#{i[4]}][#{i[5]}] | [#{i[6]}][#{i[7]}][#{i[8]}]\"\n line = line+1\n puts \"---------------------------------\" if line%3==0 end\n end",
"title": ""
},
{
"docid": "d701639a02baba4ac07db6318aaba757",
"score": "0.5829835",
"text": "def solve\n perms = (1..9).to_a.permutation.map {|p| p.join}\n prods = []\n\n perms.each do |p|\n (1..2).each do |len|\n a, b, c = p[0, len].to_i, p[len..4].to_i, p[5, 4].to_i\n prods << c if a * b == c\n end\n end\n \n prods.uniq.reduce( :+ )\n end",
"title": ""
},
{
"docid": "4bd0de1c4e956d752ca0aa93e907b1cc",
"score": "0.58210236",
"text": "def solution(number)\n counter = 3\n sol = 0\n while counter < number\n if (counter % 3 == 0) && (counter % 5 == 0)\n sol += counter\n elsif (counter % 3 == 0) || (counter % 5 == 0)\n sol += counter\n end\n counter += 1\n end\n p sol\nend",
"title": ""
},
{
"docid": "7c1bb4b73bfb44616eff2444189ef342",
"score": "0.5819723",
"text": "def problem1(num)\n (1..num-1).select{|a| a%3 ==0 or a%5==0}.reduce(:+)\nend",
"title": ""
},
{
"docid": "2c7792113f3e6a7b897090f47ee25903",
"score": "0.58126324",
"text": "def run_tests\n check_solution(1, (100..200).to_a, 135, 35)\n check_solution(2, [13, 19, 24, 29, 32, 37, 43], 35, -1)\nend",
"title": ""
},
{
"docid": "b42eb4465b169f1981dfe468aa02c55e",
"score": "0.5791704",
"text": "def problem3 n\n 2.step(n,1).each do |x|\n return x-1 if n == 1\n n /= x if x.prime? && (n % x == 0)\n end\nend",
"title": ""
},
{
"docid": "54b5a04b5709efbda06f838626206ec1",
"score": "0.57756037",
"text": "def goodVsEvil(good, evil)\n # good_power, evil_power = 0, 0\n # good.split.each_with_index do |num, i|\n # if i < 3\n # good_power += num.to_i * (i + 1)\n # elsif i < 5\n # good_power += num.to_i * i\n # elsif i == 5\n # good_power += num.to_i * 2 * i\n # end\n # end\n god = good.split.each_with_index.inject(0) do |sum, (num, i)|\n if i < 3\n sum + num.to_i * (i + 1)\n elsif i < 5\n sum + num.to_i * i\n elsif i == 5\n sum + num.to_i * 2 * i\n end\n end\n \n \n evl = evil.split.each_with_index.inject(0) do |sum, (num, i)|\n case i\n when 0\n sum + num.to_i * (i + 1)\n when 1, 2, 3\n sum + num.to_i * 2\n when 4\n sum + num.to_i * (i - 1)\n when 5\n sum + num.to_i * i\n when 6\n sum + num.to_i * (i + 4) \n end\n end\n \n if evl > god\n str = \"Evil eradicates all trace of Good\"\n elsif evl < god\n str = \"Good triumphs over Evil\"\n else\n str = \"No victor on this battle field\"\n end\n \n \"Battle Result: #{str}\"\nend",
"title": ""
},
{
"docid": "d6b4b8272eaf1564d8d5fe46d6892e78",
"score": "0.57500154",
"text": "def checker\n @correct_pos = 0\n @correct_num = 0\n x = 0\n @guess.each do |i|\n if (i == @solution[x])\n @correct_pos += 1\n elsif @solution.include?(i)\n @correct_num += 1\n end\n x += 1\n end\n end",
"title": ""
},
{
"docid": "2c51f61f14d1a19900bf2768b4180aa0",
"score": "0.5742493",
"text": "def solve_two_vs_three_vs_five\n return if @arr[1].nil? || @arr[6].nil?\n\n #p \"1,6: #{@arr[1]},#{@arr[6]}\"\n\n @words.filter{|x| x.length == 5 && @hash[x].nil?}.each{|w|\n if @arr[1].chars.all?{|c| w.chars.include?(c)}\n solved(3, w)\n elsif w.chars.all?{|c2| @arr[6].chars.include?(c2)}\n solved(5, w)\n else\n solved(2, w)\n end\n }\n end",
"title": ""
},
{
"docid": "4d31cdcad5d23523fdec2c5671ca553b",
"score": "0.573847",
"text": "def solve ()\n @num_tested = 0\n @num_solutions = 0\n print \"Enter Answer: \"\n answer = gets.chomp.to_i\n print \"Enter Numbers:\\n\"\n numbers = []\n 6.times{numbers << gets.chomp.to_i}\n puts \"Solving...\"\n pick_two(numbers, answer, \"\")\n [@num_tested, @num_solutions]\nend",
"title": ""
},
{
"docid": "5f7d2dbf25bbeea1846c6259e89ff502",
"score": "0.57344985",
"text": "def run_tests()\n check_solution(1, [1, 3, 5, 4], [5])\n check_solution(2, [4, 2, 3, 6, 10], [4, 10])\n check_solution(3, [4, 2, 11, 6, 10], [4, 11, 10])\nend",
"title": ""
},
{
"docid": "84a726dd26c92a9b6b56424c99fd4348",
"score": "0.5706825",
"text": "def problem(nth = 6,i = 13)\n while nth < 10001\n i += 2\n nth += 1 if i.prime?\n end\n i\n end",
"title": ""
},
{
"docid": "3905471fee3a3b7ba36c5d16a9f7c73e",
"score": "0.57045215",
"text": "def describe_problem(p)\n return p[0].to_s+\"-\"+p[1]\nend",
"title": ""
},
{
"docid": "5daebc432238b53750db26d229451ca5",
"score": "0.56928027",
"text": "def print_solution\n\n\t\t# The first, the number of test case\n\t\tputs \"Test case \\##{@i}\"\n\n\t\t# For every pair to be tested\n\t\t@sub_sequence_idx.each do |s,e|\n\n\t\t\t# the maximum number of coincidences is stored on max\n\t\t\tmax = 0\n\n\t\t\t# the current number of coincidences in a row is stored on coincidences_on_a_row\n\t\t\tcoincidences_on_a_row = 0\n\n\t\t\t# From start of the range\n\t\t\ti = s - 1\n\n\t\t\t# Until the end of it (please note the index of s,e is 1-based)\n\t\t\twhile i < e - 1\n\n\t\t\t\t# if there is a coincidence\n\t\t\t\tif @equals[ i ]\n\n\t\t\t\t\t# we inc the counter\n\t\t\t\t\tcoincidences_on_a_row += 1\n\n\t\t\t\t# if the coincidences stop...\n\t\t\t\telsif coincidences_on_a_row > 0\n\n\t\t\t\t\t# we store the maximum\n\t\t\t\t\tmax = [ coincidences_on_a_row, max ].max\n\n\t\t\t\t\t# and reset the counter\n\t\t\t\t\tcoincidences_on_a_row = 0\n\t\t\t\tend\n\n\t\t\t\t# next number!!\n\t\t\t\ti += 1\n\t\t\tend\n\n\t\t\t# in case of coincidences found at the end of the range, update the max before...\n\t\t\tmax = [ coincidences_on_a_row, max ].max\n\n\t\t\t# ...before print it. Please note that we compute equalities\n\t\t\t# but problem asks us for numbers-equals-in-a-row, so we need to sum 1\n\t\t\tputs max + 1\n\t\tend\n\tend",
"title": ""
},
{
"docid": "1410b2f135e61d4067dc2b272703f344",
"score": "0.56927615",
"text": "def fourth_puzzle\n rng = Random.new\n ret = []\n 10.times { ret.push(rng.rand(55..100)) }\n return ret\nend",
"title": ""
},
{
"docid": "78bf880151361ed64e96ddc834ff7fdf",
"score": "0.5680469",
"text": "def solution_one\n x = 0\n (1..999).each do |i|\n if (i % 5) == 0 || (i % 3) == 0\n x = x + i\n end\n end\n x\nend",
"title": ""
},
{
"docid": "046b8cc4fa7eb06e047e8ed7abf7ab76",
"score": "0.5679447",
"text": "def proof_of_stake\n title(\"Proof of Stake\")\n\n eco_scale = \"https://en.wikipedia.org/wiki/Economies_of_scale\"\n pros1 = \"Energy efficient\"\n pros2 = \"More expensive to attack for attackers\"\n pros3 = \"Not susceptible to ecnomies of scale \\n\\t (for more details about this topic click on this link:\\n\\t #{eco_scale}).\"\n\n pros = [pros1, pros2, pros3]\n\n nothing_at_stake = \"https://medium.com/coinmonks/understanding-proof-of-stake-the-nothing-at-stake-theory-1f0d71bc027\"\n cons = \"nothing-at-stake problem \\n(for more details click on this link:\\n#{nothing_at_stake})\"\n\n\n ppc = {name: \"Peercoin\", website: \"https://peercoin.net/\"}\n pivx = {name: \"Pivx\", website: \"https://pivx.org/\"}\n rdd = {name: \"Reddcoin\", website: \"https://reddcoin.com/\"}\n\n used_by = [ppc, pivx, rdd]\n\n consensus_type = \"Competitive consensus\"\n\n\n explanation = \"\"\"\n The proof of stake was created as an alternative to the proof of work (PoW),\n to tackle inherent issues in the latter. Here instead of using mining, you\n have to have some stake(coins) in the system. So, if you own 10% of the\n stake(coins), then your probability of mining next block will be 10%.\n \"\"\"\n\n further_reading = \"https://en.wikipedia.org/wiki/Proof_of_stake\"\n\n p_o_s = {\n \"pros\" => pros,\n \"cons\" => cons,\n \"used_by\" => used_by,\n \"consensus_type\" => consensus_type,\n \"explanation\" => explanation,\n \"further_reading\" => further_reading\n }\n\n choice = \"0\"\n\n while !choice.include?(\"Q\") && !choice.include?(\"q\")\n choice = consensus_features\n if choice.include?(\"1\")\n puts \"Pros:\"\n p_o_s[\"pros\"].each_with_index { |val, index| puts \"\\t#{index+1}) #{val}\" }\n\n cons = p_o_s[\"cons\"]\n puts \"Cons: #{cons}\"\n elsif choice.include?(\"2\")\n puts \"Used by:\"\n p_o_s[\"used_by\"].each_with_index do\n |valeur, index|\n puts \"#{index+1})\"\n valeur.each do\n |key, value| puts \" #{key}: #{value}\"\n end\n end\n puts \"And others.\"\n elsif choice.include?(\"3\")\n consensus_type = p_o_s[\"consensus_type\"]\n puts \"Type: #{consensus_type}\"\n elsif choice.include?(\"4\")\n explanation = p_o_s[\"explanation\"]\n puts \"Explanation: #{explanation}\"\n elsif choice.include?(\"5\")\n further_reading = p_o_s[\"further_reading\"]\n puts \"Further Reading: #{further_reading}\"\n elsif choice.include?(\"Q\") || choice.include?(\"q\")\n break\n else\n puts \"Error\"\n end\n end\n\nend",
"title": ""
},
{
"docid": "2dbfba172b260f7fa7612e1846955df4",
"score": "0.56537443",
"text": "def phase_three\n puts \"Phase 3 has been started\"\n\n 7.times do\n immune = @borneo.individual_immunity_challenge\n puts \"#{immune} wins the immunity\".blue\n\t\tvoted_off_contestant = @merge_tribe.tribal_council(immune: immune)\n\t\t@jury.add_member voted_off_contestant\n\t\tputs \"#{voted_off_contestant}! is OUT!\".red\n end\nend",
"title": ""
},
{
"docid": "323936c576f02d232ff8b3c7b4a0fbdb",
"score": "0.5652975",
"text": "def solution(number)\nn = 0..number\na = []\nfor i in n\n if i % 3 == 0 || i % 5 == 0\n a = a.push(i)\n end\n end\ns = 0\n# a.pop\na.each {|x| s += x}\ns\nend",
"title": ""
},
{
"docid": "00f44255040584c36323e6dadc5c4e72",
"score": "0.56457925",
"text": "def solution_board\n @maker_row = [\"?\", \"?\", \"?\", \"?\"]\n puts \" \"\n puts \"| \" + \"#{@maker_row[0..3].join(\" | \")}\" + \" | --> The hidden solution!\"\n puts \" \"\n end",
"title": ""
},
{
"docid": "f673b8dd20b55732807513729b0940f4",
"score": "0.5643765",
"text": "def attempt_solution(row, col)\n end",
"title": ""
},
{
"docid": "b4b90361327f8f7199cdfc47009d1faf",
"score": "0.56416523",
"text": "def prime_mutation_determination(roll)\n case roll\n when 1..9\n @@primary_mutations << \"Acid Blood\"\n @@attacks << {:attack_mode => \"Acid blood spray\", :SV => 20, :rate => 1, :range => 2, :damage => \"d12\", :ammo => \"infinite\", :skill_pts => 0, :skill_SV_bonus => 0, :skill_damage_bonus => 0, :ref => \"60\", :notes => \"automatic on melee or point-blank puncturing attack\"}\n\n when 10..20\n @@primary_mutations << \"Acid Spit\"\n @@attacks << {:attack_mode => \"Acid Spit\", :SV => 6, :rate => 1, :range => 6, :damage => \"d6 + 2 per dround for d6 rounds\", :ammo => \"2/day\", :skill_pts => 0, :skill_SV_bonus => 0, :skill_damage_bonus => 0, :ref => \"60\", :notes => \"does same damage to ropes, bars, locks, etc.\"}\n when 21..32\n @@primary_mutations << \"Advanced Mind\"\n @@intelligence += (d(10 + d(10) + d(10)))\n @@character_notes << \"character gains two hazard checks against insanity and mental attacks that require hazard checks\"\n\n when 33..36\n @@primary_mutations << \"Agony Sphere\"\n @@attacks << {:attack_mode => \"Agony Sphere\", :SV => \"auto\", :rate => 1, :range => (@@willpower/2), :damage => \"d6 + +10DV to targets\", :ammo => \"1/day per user rank\", :skill_pts => 0, :skill_SV_bonus => 0, :skill_damage_bonus => 0, :ref => \"60\", :notes => \"requires 3 full rounds of concentration to unleash; can be sustained for 1 rd/willpower point\"}\n\n when 37..44\n @@primary_mutations << \"Amphibian\"\n @@character_notes << \"Can breathe as well in water as air\"\n @@character_notes << \"Suffers d3 dmg per day in arid environments\"\n\n when 45..52\n @@primary_mutations << \"Amplification\"\n @@character_notes << \"Doubles daily/rank-based rate of limited-use mutations\"\n\n when 53..59\n @@primary_mutations << \"Aquatic Adaptation\"\n @@character_notes << \"Webbed hands and feet\"\n @@character_notes << \"Withstands cold 2x vs. humans\"\n @@character_notes << \"Must be fully immersed in water 1hr per day or suffer d3 dmg; d6 in desert areas\"\n\n when 60..71\n @@primary_mutations << \"Arid Adaptation\"\n @@dv -= 3\n @@appearance = [@@appearance - d(8), 1].max\n @@character_notes << \"Needs 1/10th as much water as pure stock human\"\n @@character_notes << \"Specialized organ holds 2 liters drinking water (can yak up in 250 or 500ml portions)\"\n\n when 72..79\n @@primary_mutations << \"Asphyxiation Zone\"\n @@attacks << {:attack_mode => \"Asphyxiation Zone\", :SV => \"auto\", :rate => 1, :range => (@@willpower * 2), :damage => \"d10\", :ammo => \"2/day per user rank\", :skill_pts => 0, :skill_SV_bonus => 0, :skill_damage_bonus => 0, :ref => \"61\", :notes => \"lasts 2 rounds per rank\"}\n\n when 80..89\n @@primary_mutations << \"Aura of Protection\"\n @@character_notes << \"2 uses / rank / day; DV -10 + 10 pt force field dmg soak per round; duration willpower rounds; 2 rounds to activate\"\n\n when 90..102\n @@primary_mutations << \"Ballistic Hide\"\n @@dv -= 4\n @@appearance = [@@appearance - d(4), 1].max\n @@character_notes << \"Additional -20DV vs. blunt/crushing attacks including non-AP bullets\"\n\n when 103..109\n @@primary_mutations << \"Beak\"\n @@appearance = [@@appearance - (d(6) + d(6)), 1].max\n @@attacks << {:attack_mode => \"Beak\", :SV => 10, :rate => 1, :range => 1, :damage => \"d12\", :ammo => \"infinite\", :skill_pts => 0, :skill_SV_bonus => 0, :skill_damage_bonus => 0, :ref => \"61\", :notes => \"\"}\n @@character_notes << \"Character cannot speak clearly\"\n\n when 110..127\n @@primary_mutations << \"Beam Eyes\"\n @@attacks << {:attack_mode => \"Beam Eyes\", :SV => 15, :rate => 1, :range => (@@willpower + @@perception), :damage => \"10 + d6/rank\", :ammo => \"2 / rank / day\", :skill_pts => 0, :skill_SV_bonus => 0, :skill_damage_bonus => 0, :ref => \"61\", :notes => \"\"}\n\n when 128..134\n @@primary_mutations << \"Berserker Rage\"\n @@character_notes << \"Berserker Rage: 2/day/rank usage; duration 1 battle; -5DV, +10SV, +10dmg (melee weapons only); +20 strength; can fight on for d6 rounds after suffering fatal damage\"\n when 135..144\n @@primary_mutations << \"Bladed Limbs\"\n def bladed_limbs_location(roll)\n case roll\n when 1 then result = \"Shoulder\"\n when 2 then result = \"Back\"\n when 3 then result = \"Chest\"\n when 4 then result = \"Side\"\n when 5 then result = \"Hip\"\n when 6 then result = \"Abdomen\"\n end\n end\n\n d(4).times do\n bladed_limbs_location(d(6))\n @@character_notes << \"Sword-like bone blade protruding from #{result}\"\n @@appearance = [@@appearance - 2, 1].max\n @@character_weight += 5\n end\n\n @@attacks << {:attack_mode => \"Bladed limb(s)\", :SV => 5, :rate => \"1 per bladed limb\", :range => 0, :damage => \"d12 + 2\", :ammo => \"infinite\", :skill_pts => 0, :skill_SV_bonus => 0, :skill_damage_bonus => 0, :ref => \"62\", :notes => \"\"}\n\n\n when 145..149\n @@primary_mutations << \"Blurred Movement\"\n @@character_notes << \"Blurred Movement: -20DV; willpower rounds/day; can be used to blur entire body or only parts\"\n\n when 150..179\n @@character_notes << \"Due to body disporportion, no relic shell armor can be worn, but other types can be modified to fit\"\n def body_disproportion_location(roll)\n case roll\n when 1\n @@primary_mutations << \"Body Disproportion: Dominant arm is massive!\"\n @@character_notes << \"Dominant arm has strength of #{(@@strength + @@strength + d(20) + d(20))} which applies to all 1- and 2-handed melee weapons character wields\"\n @@appearance = [@@appearance - d(4), 1].max\n @@move -= 0.5\n @@character_weight += (20 + d(20))\n when 2\n @@primary_mutations << \"Body Disproportion: Character's head is massive!\"\n @@intelligence += (d(20) + 20)\n @@move -= 1\n @@appearance = [@@appearance - (d(4) + d(4)), 1].max\n @@character_notes << \"TWO intelligence-based hazard checks, when called for\"\n @@character_weight += (20 + d(10))\n when 3\n @@primary_mutations << \"Body Disproportion: Upper body incredibly over-muscled!\"\n @@strength += (20 + d(20))\n @@endurance += (20 + d(20))\n @@move -= 1\n @@agility = [@@agility - d(10), 1].max\n @@appearance = [@@appearance - (d(4) + d(4)), 1].max\n @@character_weight += (20 + d(20) + d(20))\n when 4\n @@primary_mutations << \"Body Disproportion: hips and legs are twice normal length!\"\n @@move += @@move\n @@character_height += 100\n @@appearance = [@@appearance - d(4), 1].max\n @@attacks << {:attack_mode => \"Wicked kick\", :SV => 0, :rate => \"1\", :range => 0, :damage => \"2d10\", :ammo => \"infinite\", :skill_pts => 0, :skill_SV_bonus => 0, :skill_damage_bonus => 0, :ref => \"62\", :notes => \"\"}\n @@character_weight += (30 + d(20) + d(20))\n when 5\n @@primary_mutations << \"Body Disproportion: comically giant hands and feet!\"\n @@attacks << {:attack_mode => \"Punch or kick\", :SV => 0, :rate => \"1\", :range => 0, :damage => \"2d12\", :ammo => \"infinite\", :skill_pts => 0, :skill_SV_bonus => 0, :skill_damage_bonus => 0, :ref => \"62\", :notes => \"\"}\n @@character_notes << \"Weapons with triggers, keyboards, or other items requiring normal human hands are unusable without modifying item.\"\n @@appearance = [@@appearance - (d(6) + 1), 1].max\n @@character_weight += (d(6) + d(6) + d(6) + d(6))\n when 6\n @@primary_mutations << \"Body Disproportion: extra long arms!\"\n @@character_notes << \"+5 SV in melee combat\"\n @@character_notes << \"+5 thrown weapon DMG\"\n @@appearance = [@@appearance - (d(4) + 1), 1].max\n when 7\n @@primary_mutations << \"Body Disproportion: greatly elongated torso!\"\n @@character_notes << \"If pregnant, gives birth to a litter of d4 + 1 offspring.\"\n @@endurance += (d(10) + d(10))\n @@appearance = [@@appearance - d(6), 1].max\n @@character_height += (20 + d(20))\n @@character_weight += (10 + d(20))\n def elongated_torso_bonus(roll1, roll2, roll3, roll4) # need to add actual mutation results via primary_mutations_roll(xx)\n case roll1\n when 1..50\n @@primary_mutations << \"Reserve heart\"\n end\n case roll2\n when 1..65\n @@primary_mutations << \"Radiation absorption\"\n end\n case roll3\n when 1..37\n @@primary_mutations << \"Breath holding\"\n end\n case roll4\n when 1..72\n @@primary_mutations << \"Nutriment cache\"\n end\n\n end\n elongated_torso_bonus(d(100),d(100),d(100),d(100))\n when 8\n 2.times do\n elongated_torso_bonus(d(7))\n end\n end\n\n end\n body_disproportion_location(d(8))\n\n when 180..195\n def body_regeneration_rate(roll)\n case roll\n when 1..12\n @@endurance_healing_rate += 4\n when 13..32\n @@endurance_healing_rate += 7\n when 33..40\n @@endurance_healing_rate += 10\n when 41..64\n @@endurance_healing_rate = 15\n when 65..87\n @@endurance_healing_rate = \"1 pt per hour\"\n when 88..93\n @@endurance_healing_rate = \"2 pts per hour\"\n when 94..96\n @@endurance_healing_rate = \"4 pts per hour\"\n when 97..98\n @@endurance_healing_rate = \"6 pts per hour\"\n when 99\n @@endurance_healing_rate = \"10 pts per hour\"\n when 100\n @@endurance_healing_rate = \"1 pt per round\"\n end\n end\n body_regeneration_rate(d(100))\n @@primary_mutations << \"Body Regeneration: #{@@endurance_healing_rate} healing rate bonus\"\n\n when 196..201\n @@primary_mutations << \"Breath Holding: triple base endurance rate + regular breath holding rate (Hub Rules p. 122)\"\n when 202..224\n @@primary_mutations << \"Claws: don’t hinder her from using bows, crossbows, or weapons that use a trigger, but disallow her from using keyboards or doing fne electronics work\"\n @@attacks << {:attack_mode => \"Claw\", :SV => 7, :rate => \"1 per hand\", :range => 0, :damage => \"d12 each\", :ammo => \"infinite\", :skill_pts => 0, :skill_SV_bonus => 0, :skill_damage_bonus => 0, :ref => \"62-63\", :notes => \"\"}\n @@character_notes << \"Thanks to claws, character climbs as though she has 2 points in Climbing skill\"\n when 225..230\n @@primary_mutations << \"Climbing Suckers: like a gecko, character can climb on anything at 1/2 move\"\n @@character_notes << \"When falling, type A agility based hazard check to catch side of building/pit and stop fall\"\n when 231..239\n @@primary_mutations << \"Coma Inducement\"\n @@attacks << {:attack_mode => \"Coma inducement\", :SV => 0, :rate => \"\", :range => @@willpower + @@willpower, :damage => \"coma\", :ammo => \"2/day/rank\", :skill_pts => 0, :skill_SV_bonus => 0, :skill_damage_bonus => 0, :ref => \"63\", :notes => \"victim gets tybe B willpower based hazard check; see p. 63 for details\"}\n when 240..253\n number_of_pincers = 0\n arms_too = \"True\"\n pincer_size = \"Small\"\n def pincer_formation_on_mutant(roll)\n case roll\n when 1..2\n @@primary_mutations << \"Crab Pincers: 1 pincer replacing 1 arm\"\n number_of_pincers += 1\n @@character_weight -= 15\n when 3..6\n @@primary_mutations << \"Crab Pincers: 2 pincers replacing both human arms\"\n number_of_pincers += 2\n @@character_weight -= 30\n when 7\n @@primary_mutations << \"Crab Pincers: 1 pincer growing from shoulder, both human arms intact\"\n number_of_pincers += 1\n when 8..9\n @@primary_mutations << \"Crab Pincers: 2 pincers in addition to human arms\"\n number_of_pincers += 2\n when 10\n number_of_pincers = (2 + d(2))\n def arms_too(roll)\n case roll\n when 79..100\n arms_too = \"False\"\n @@character_weight -= 30\n end\n end\n @@primary_mutations << \"Crab Pincers: #{number_of_pincers} total\"\n arms_too(d(100))\n end\n end\n def pincer_size(roll)\n case roll\n when 1..3\n pincer_size = \"Small\"\n @@character_weight += (number_of_pincers * 15)\n @@attacks << {:attack_mode => \"Pincer\", :SV => 2, :rate => \"#{number_of_pincers}\", :range => 0, :damage => \"d10 + 1\", :ammo => \"infinite\", :skill_pts => 0, :skill_SV_bonus => 0, :skill_damage_bonus => 0, :ref => \"63\", :notes => \"\"}\n when 4..6\n pincer_size = \"Medium\"\n @@movement_rate_base -= (0.25 * number_of_pincers)\n @@character_weight += (number_of_pincers * 20)\n @@attacks << {:attack_mode => \"Pincer\", :SV => 4, :rate => \"#{number_of_pincers}\", :range => 0, :damage => \"d12 + 3\", :ammo => \"infinite\", :skill_pts => 0, :skill_SV_bonus => 0, :skill_damage_bonus => 0, :ref => \"63\", :notes => \"\"}\n when 7..9\n pincer_size = \"Large\"\n @@movement_rate_base -= (0.5 * number_of_pincers)\n @@character_weight += (number_of_pincers * 35)\n @@attacks << {:attack_mode => \"Pincer\", :SV => 7, :rate => \"#{number_of_pincers}\", :range => 0, :damage => \"d20 + 3\", :ammo => \"infinite\", :skill_pts => 0, :skill_SV_bonus => 0, :skill_damage_bonus => 0, :ref => \"63\", :notes => \"\"}\n when 10\n pincer_size = \"Massive\"\n @@movement_rate_base -= (0.75 * number_of_pincers)\n @@character_weight += (number_of_pincers * 50)\n @@attacks << {:attack_mode => \"Pincer\", :SV => 10, :rate => \"#{number_of_pincers}\", :range => 0, :damage => \"d20 + 10\", :ammo => \"infinite\", :skill_pts => 0, :skill_SV_bonus => 0, :skill_damage_bonus => 0, :ref => \"63\", :notes => \"\"}\n end\n end\n\n pincer_formation_on_mutant(d(10))\n pincer_size(d(10))\n @@primary_mutations << \"Pincers: #{number_of_pincers} of #{pincer_size} size\"\n if arms_too == \"False\"\n @@appearance = [@@appearance - (number_of_pincers * d(4) + 2), 1].max\n @@character_notes << \"No human arms - character cannot use triggers, keyboards, or complex items\"\n elsif arms_too == \"True\"\n @@appearance = [@@appearance - (number_of_pincers * d(4)), 1].max\n end\n\n\n when 254..292\n def deviant_skin_structure(roll)\n case roll\n when 1..3\n @@primary_mutations << \"Fire-proof skin\"\n @@character_notes << \"No damage from fire for 10 rounds; 1/2 damage after\"\n @@character_notes << \"1/2 damage from explosions\"\n when 4..5\n @@primary_mutations << \"Reflective skin\"\n @@character_notes << \"1/2 damage from beam weapons when clothed; 70 percent resistance to beam weapons vs. bare skin\"\n @@appearance += d(6)\n when 6..7\n @@primary_mutations << \"Alkaline skin\"\n @@character_notes << \"Character totally immune to acid attacks (which still ruin character's gear)\"\n when 8..10\n @@primary_mutations << \"Weather sensitive skin\"\n @@character_notes << \"Sense weather changes in 20km radius; can sense open bodies of water within 2 km\"\n when 11\n @@primary_mutations << \"Glow in the dark skin\"\n @@character_notes << \"3m radius green glow; visible up to 12km away - character can't turn off glow\"\n when 12\n @@primary_mutations << \"Photosynthetic skin\"\n @@character_notes << \"4 hrs in sunlight = 1 meal; 1 hr in sunlight = 3 pts healing (in addition to normal resting healing)\"\n end\n end\n deviant_skin_structure(d(12))\n\n when 293..298\n @@primary_mutations << \"Devastator Pulse\"\n @@attacks << {:attack_mode => \"Devastator Pulse\", :SV => (@@accuracy + @@willpower), :rate => \"4 rounds to charge, release on 5th\", :range => @@willpower, :damage => \"3d20 / d100 + 40 vs. machines\", :ammo => \"1/rank/day\", :skill_pts => 0, :skill_SV_bonus => 0, :skill_damage_bonus => 0, :ref => \"64\", :notes => \"\"}\n\n when 299..300\n @@primary_mutations << \"Displacement\"\n @@character_notes << \"Displacement: #{@@willpower} rounds per day, DV -30\"\n when 301..305\n @@primary_mutations << \"Doom Sphere\"\n @@attacks << {:attack_mode => \"Doom Sphere\", :SV => \"01-95\", :rate => \"1/10 days\", :range => (@@willpower * 10), :damage => \"3d20 vs organics; 6d20 vs electronics\", :ammo => \"infinite\", :skill_pts => 0, :skill_SV_bonus => 0, :skill_damage_bonus => 0, :ref => \"64\", :notes => \"User must make intelligence type B hazard check or go insane for 1 hour (p. 126)\"}\n when 306..314\n @@primary_mutations << \"Dread Zone\"\n @@attacks << {:attack_mode => \"Dread Zone\", :SV => \"01-95\", :rate => 1, :range => @@intelligence, :damage => \"tybe B hazard check vs. intelligence or +10SV to attack\", :ammo => \"1/rank/day\", :skill_pts => 0, :skill_SV_bonus => 0, :skill_damage_bonus => 0, :ref => \"64\", :notes => \"Duration: rank in rounds; does not affect inorganic beings or creatures with morale = n/a\"}\n when 315..322\n @@primary_mutations << \"Earth Thump\"\n @@attacks << {:attack_mode => \"Earth Thump\", :SV => (@@willpower + 30), :rate => \"3 rounds to generate\", :range => @@willpower, :damage => \"d10/user rank\", :ammo => \"2/day/rank\", :skill_pts => 0, :skill_SV_bonus => 0, :skill_damage_bonus => 0, :ref => \"64\", :notes => \"Targets 1 human-sized enemy per rank of user (assuming multiple targets close together)\"}\n when 323..341\n @@primary_mutations << \"Electrical Charge\"\n @@attacks << {:attack_mode => \"Electrical Charge\", :SV => 20, :rate => \"1\", :range => 0, :damage => \"d20 + HC\", :ammo => \"2/day/rank\", :skill_pts => 0, :skill_SV_bonus => 0, :skill_damage_bonus => 0, :ref => \"64\", :notes => \"Victim makes END-based tybe B hazard check or stunned for d3 rounds\"}\n @@character_notes << \"Four Electrical Charge jolts are suffcient to fully re-charge a standard power cell.\"\n when 342..349\n @@primary_mutations << \"Electrical Pulse\"\n @@attacks << {:attack_mode => \"Electrical Pulse\", :SV => 20, :rate => 1, :range => (@@willpower), :damage => \"d20 / 3d20 vs machines\", :ammo => \"3/day/rank\", :skill_pts => 0, :skill_SV_bonus => 0, :skill_damage_bonus => 0, :ref => \"65\", :notes => \"Can be used to start fires as well\"}\n when 350..355\n @@primary_mutations << \"Electro Magnetic Pulse\"\n @@attacks << {:attack_mode => \"Electro Magnetic Pulse\", :SV => 30, :rate => 1, :range => @@willpower, :damage => \"d10/d100 vs electronics\", :ammo => \"2/day/rank\", :skill_pts => 0, :skill_SV_bonus => 0, :skill_damage_bonus => 0, :ref => \"65\", :notes => \"\"}\n when 356..376\n @@primary_mutations << \"Empathy\"\n @@character_notes << \"Empathy: #{@@willpower} range. Unlimited uses. The subject is allowed a type C, intelligence based hazard check. If failed, mutant knows victim's emotions. Alternately, emotions can be projected.\"\n when 377..388\n @@primary_mutations << \"Energy Blade\"\n def energy_blade_type(roll) # table Hub Rules p. 65\n case roll\n when 1..20\n @@attacks << {:attack_mode => \"Energy Blade: Blue\", :SV => 10, :rate => 1, :range => 1, :damage => \"d12\", :ammo => \"#{@@willpower} rounds\", :skill_pts => 0, :skill_SV_bonus => 0, :skill_damage_bonus => 0, :ref => \"65\", :notes => \"2/day/rank\"}\n when 21..40\n @@attacks << {:attack_mode => \"Energy Blade: Green\", :SV => 10, :rate => 1, :range => 1, :damage => \"d20 stun\", :ammo => \"#{@@willpower} rounds\", :skill_pts => 0, :skill_SV_bonus => 0, :skill_damage_bonus => 0, :ref => \"65\", :notes => \"2/day/rank\"}\n when 41..65\n @@attacks << {:attack_mode => \"Energy Blade: Red\", :SV => 10, :rate => 1, :range => 1, :damage => \"d20\", :ammo => \"#{@@willpower} rounds\", :skill_pts => 0, :skill_SV_bonus => 0, :skill_damage_bonus => 0, :ref => \"65\", :notes => \"2/day/rank\"}\n when 66..85\n @@attacks << {:attack_mode => \"Energy Blade: Orange\", :SV => 10, :rate => 1, :range => 1, :damage => \"2d20 stun\", :ammo => \"#{@@willpower} rounds\", :skill_pts => 0, :skill_SV_bonus => 0, :skill_damage_bonus => 0, :ref => \"65\", :notes => \"2/day/rank\"}\n when 86..97\n @@attacks << {:attack_mode => \"Energy Blade: Purple\", :SV => 10, :rate => 1, :range => 1, :damage => \"2d20\", :ammo => \"#{@@willpower} rounds\", :skill_pts => 0, :skill_SV_bonus => 0, :skill_damage_bonus => 0, :ref => \"65\", :notes => \"2/day/rank\"}\n when 98..99\n @@attacks << {:attack_mode => \"Energy Blade: White\", :SV => 10, :rate => 1, :range => 1, :damage => \"d100 stun\", :ammo => \"#{@@willpower} rounds\", :skill_pts => 0, :skill_SV_bonus => 0, :skill_damage_bonus => 0, :ref => \"65\", :notes => \"2/day/rank\"}\n when 100\n @@attacks << {:attack_mode => \"Energy Blade: Gold\", :SV => 10, :rate => 1, :range => 1, :damage => \"d100\", :ammo => \"#{@@willpower} rounds\", :skill_pts => 0, :skill_SV_bonus => 0, :skill_damage_bonus => 0, :ref => \"65\", :notes => \"2/day/rank\"}\n end\n end\n if @@primary_mutations.include? \"Energy Blade\" # Note: NO duplication -- reroll if this result comes up twice.\n @@primary_mutations_rolls += 1\n else\n energy_blade_type(d(100))\n end\n\n when 389..401\n @@primary_mutations << \"Extreme Size Decrease\"\n @@character_height = (22 + d(20) + d(20)) # NOTE: should be dependent on GENDER, ignored that.\n 3.times @@skills << \"Stealth\"\n 2.times @@skills << \"Climbing\"\n @@character_notes << \"Cannot wield two-handed weapons. Normal one-handed weapons including pistols must be employed with both hands (except knifes and daggers, which are considered swords for this mutant)\"\n @@character_notes << \"Relic armor cannot be worn except scrap relic.\"\n def extreme_size_decrease(height) # Hub Rules p. 65\n case height\n when 22..27\n @@character_weight = (15 + d(10))\n @@agility += 20\n @@movement_rate_base == 4.5\n @@strength = [@@strength - 15, 1].max\n @@endurance = [@@endurance - 10, 1].max\n when 28..35\n @@character_weight = (20 + d(12))\n @@agility += 15\n @@movement_rate_base = 5\n @@strength = [@@strength - 10, 1].max\n @@endurance = [@@endurance - 7, 1].max\n when 36..45\n @@character_weight = (25 + d(20))\n @@agility += 10\n @@movement_rate_base = 5.5\n @@strength = [@@strength - 5, 1].max\n @@endurance = [@@endurance - 5, 1].max\n when 46..65\n @@character_weight = (30 + d(20) + d(20))\n @@agility += 7\n @@movement_rate_base = 6\n @@strength = [@@strength - 3, 1].max\n @@endurance = [@@endurance - 3, 1].max\n end\n end\n\n extreme_size_decrease(@@character_height)\n\n when 402..419\n def fang_size(roll) # Hub rules p. 65\n case roll\n when 1..3\n sizeoffangs = \"Small\"\n fangsv = 2\n fangdmg = \"d6\"\n @@appearance = [@@appearance - 1, 1].max\n when 4..8\n sizeoffangs = \"Medium\"\n fangsv = 4\n fangdmg = \"d10\"\n @@appearance = [@@appearance - (1 + d(2)), 1].max\n when 9..10\n sizeoffangs = \"Huge\"\n fangsv = 6\n fangdmg = \"d20\"\n @@appearance = [@@appearance - (d(3) + 2), 1].max\n @@character_notes << \"Ability to speak clearly greatly reduced\"\n end\n @@attacks << {:attack_mode => \"Fangs\", :SV => fangsv, :rate => 1, :range => 0, :damage => fangdmg, :ammo => \"2/day/rank\", :skill_pts => 0, :skill_SV_bonus => 0, :skill_damage_bonus => 0, :ref => \"65\", :notes => \"This attack can only be employed as a supplemental melee attack if involved in close fighting\"}\n @@primary_mutations << \"Fanged: #{sizeoffangs} size\"\n end\n\n fang_size(d(10))\n\n when 420..427\n @@primary_mutations << \"Flame Breath\"\n @@attacks << {:attack_mode => \"Flame Breath\", :SV => 10, :rate => 1, :range => \"3/rank\", :damage => \"d6/rd for 2d6 rds\", :ammo => \"2/day/rank\", :skill_pts => 0, :skill_SV_bonus => 0, :skill_damage_bonus => 0, :ref => \"66\", :notes => \"Up to 3 man sized targets can be attacked at once if close together\"}\n when 428..438\n def force_field_strength(roll) # Hub rules p. 66\n case roll\n when 1..10\n force_field = d(10)\n when 11..24\n force_field = (d(10) + 3)\n when 25..53\n force_field = (d(10) + 5)\n when 54..78\n force_field = (d(10) + 10)\n when 79..94\n force_field = (d(10) + 12)\n when 95\n force_field = (d(10) + 15)\n when 96\n force_field = (d(10) + 17)\n when 97\n force_field = (d(10) + 20)\n when 98\n force_field = (d(10) + 23)\n when 99\n force_field = (d(10) + 26)\n when 100\n force_field = (d(10) + 30)\n end\n @@primary_mutations << \"Force Field: 2 uses/rank/day; #{willpower} rounds duration; absorbs #{force_field} dmg/round\"\n end\n force_field_strength(d(100))\n\n when 439..445\n @@primary_mutations << \"Foul Flesh\"\n @@character_notes << \"Will not eat mutant: all mammals, all humanoids except moaners, horrlify, all amphibians, fsh, birds except black vultures, reptilius, all reptiles, except alligators and crocodilians.\"\n when 446..453\n def furred_mutation(roll)\n case roll\n when 1..3\n fur_type = \"Fine, cat-like\"\n fur_dv = -3\n fur_cold = \"Double normal human cold resistance\"\n @@appearance = [@@appearance - d(3), 1].max\n when 4..5\n fur_type = \"Wool, sheep-like\"\n fur_dv = -6\n fur_cold = \"Triple normal human cold resistance\"\n @@appearance = [@@appearance - (1 + d(4)), 1].max\n when 6..7\n fur_type = \"Thick, sheep-like wool\"\n fur_dv = -9\n fur_cold = \"Quadruple normal human cold resistance\"\n @@appearance = [@@appearance - (d(6) + 2), 1].max\n when 8..9\n fur_type = \"Badger-like bristles\"\n fur_dv = -11\n fur_cold = \"Double normal human cold resistance\"\n @@appearance = [@@appearance - (d(6) + d(6) + 2), 1].max\n @@character_notes << \"+2 dmg to basic punch attack\" # +2 dmg to punch attack -- HOW to implement??\n when 10\n fur_type = \"Porcupine-like quills\"\n fur_dv = -13\n fur_cold = \"Double normal human cold resistance\"\n @@appearance = [@@appearance - (d(6) + d(6) + 3), 1].max\n @@character_notes << \"+2 dmg to basic punch attack\" # +2 dmg to punch attack -- HOW to implement??\n end\n @@primary_mutations << \"Furred: #{fur_type}, #{fur_cold} cold resistance. #{fur_dv} DV bonus\"\n @@dv += fur_dv\n end\n furred_mutation(d(10))\n when 454..459\n\n def gaseous_discharge(roll) # Hub Rules p. 67\n case roll\n when 1..2\n gas_type = \"Sleep\"\n gas_effect = \"All must make an Endurance-based type A hazard check or pass out for d100 rounds.\"\n when 3..4\n gas_type = \"Blindness\"\n gas_effect = \"All must make an Endurance-based type A hazard check or go blind for d6 days.\"\n when 5\n gas_type = \"Stink\"\n gas_effect = \"All must make an Endurance-based type C hazard check or spend 2 rounds vomiting, becoming +30 to strike, with their own SV being reduced to half, rounded down.\"\n when 6\n gas_type = \"Corrosive\"\n gas_effect = \"All must make an Endurance-based type B hazard check suffer d6 damage/rd from corrosive acids. Those who succeed vs. hazard check take 1 dmg/rd.\"\n when 7\n gas_type = \"Hallucinogenic\"\n gas_effect = \"All must make an Intelligence-based tybe B hazard check or hallucinate, +30SV to strike and -30SV to retaliate. Animals must make a morale check or flee immediately.\"\n when 8\n gas_type = \"Poison\"\n gas_effect = \"All must make an Endurance-based type A hazard check or drop unconscious for 10 rounds. Their breathing ceases on the 11th round and if not resuscitated by artifcial respiration, will die on the 14th round.\"\n end\n @@primary_mutations << \"Gaseous Discharge: #{gas_type}\"\n @@attacks << {:attack_mode => \"Gaseous Discharge: #{gas_type}\", :SV => \"Auto\", :rate => 1, :range => \"10 m radius\", :damage => \"Special\", :ammo => \"2/day\", :skill_pts => 0, :skill_SV_bonus => 0, :skill_damage_bonus => 0, :ref => \"66-67\", :notes => \"#{gas_effect} Gas dissipates in 2 rounds outdoors or lingers 2d10 + 4 rounds in enclosed areas.\"}\n @@character_notes << \"Character immune to #{gas_type}\"\n end\n\n gaseous_discharge(d(8))\n\n when 460..472\n def gaping_maw(roll) #Hub Rules p. 67\n case roll\n when 1..5\n maw_size = \"Large\"\n maw_sv = 4\n maw_damage = \"d12\"\n maw_mv_mod = 0\n maw_added_weight = 15\n @@appearance = [@@appearance - (d(4) + d(4) + 2), 1].max\n when 6..7\n maw_size = \"Huge\"\n maw_sv = 7\n maw_damage = \"d20\"\n maw_mv_mod -= 0.25\n maw_added_weight = 30\n @@appearance = [@@appearance - (d(4) + d(4) + 4), 1].max\n when 8..9\n maw_size = \"Massive\"\n maw_sv = 12\n maw_damage = \"2d20\"\n maw_mv_mod -= 0.5\n maw_added_weight = 70\n @@appearance = [@@appearance - (d(6) + d(6) + 5), 1].max\n when 10\n maw_size = \"Colossal\"\n maw_sv = 20\n maw_damage = \"3d20\"\n maw_mv_mod -= 1\n maw_added_weight = 120\n @@appearance = [@@appearance - (d(6) + d(6) + 8), 1].max\n end\n @@primary_mutations << \"Gaping Maw: #{maw_size} in size\"\n @@attacks << {:attack_mode => \"Gaping Maw\", :SV => maw_sv, :rate => 1, :range => 0, :damage => maw_damage, :ammo => \"infinite\", :skill_pts => 0, :skill_SV_bonus => 0, :skill_damage_bonus => 0, :ref => \"67\", :notes => \"Can be employed as a supplemental melee attack \"}\n @@character_notes << \"Almost totally carnivorous diet. Mutant drools and spits when speaking in a low, gruff voice difficult for strangers to understand.\"\n @@character_weight += maw_added_weight\n @@movement_rate_base -= maw_mv_mod\n end\n\n gaping_maw(d(10))\n\n\n when 473..497\n def heal_touch(willpower)\n case willpower\n when 1..6\n healrate = \"d8\"\n when 7..14\n healrate = \"d12\"\n when 15..34\n healrate = \"d20\"\n when 35..64\n healrate = \"d20 + 10\"\n when 65..84\n healrate = \"d20 + 20\"\n when 85..105\n healrate = \"d20 + 30\"\n when 106..200\n healrate = \"d20 + 40\"\n end\n @@primary_mutations << \"Heal Touch: 2/day/rank, #{healrate} trait points healed. Diseases healed if victim makes Type B willpower based hazard check.\"\n end\n\n heal_touch(@@willpower)\n\n @@primary_mutations << \"Heal Touch\"\n when 498..511\n def heat_pulse(willpower) # Hub Rules p. 67\n case willpower\n when 1..6\n heat_pulse_sv = -5\n heat_pulse_dmg = \"d6\"\n heat_pulse_range = 5\n when 7..14\n heat_pulse_sv = 0\n heat_pulse_dmg = \"d10\"\n heat_pulse_range = 10\n when 15..34\n heat_pulse_sv = 4\n heat_pulse_dmg = \"d20\"\n heat_pulse_range = @@willpower\n when 35..64\n heat_pulse_sv = 6\n heat_pulse_dmg = \"d20 + 10\"\n heat_pulse_range = (@@willpower * 2)\n when 65..84\n heat_pulse_sv = 9\n heat_pulse_dmg = \"d20 + 20\"\n heat_pulse_range = (@@willpower * 3)\n when 85..105\n heat_pulse_sv = 12\n heat_pulse_dmg = \"d20 + 30\"\n heat_pulse_range = (@@willpower * 4)\n when 106..200\n heat_pulse_sv = 15\n heat_pulse_dmg = \"d20 + 40\"\n heat_pulse_range = (@@willpower * 5)\n end\n @@primary_mutations << \"Heat Pulse\"\n @@attacks << {:attack_mode => \"Heat Pulse\", :SV => heat_pulse_sv, :rate => 1, :range => heat_pulse_range, :damage => heat_pulse_dmg, :ammo => \"2/day/rank\", :skill_pts => 0, :skill_SV_bonus => 0, :skill_damage_bonus => 0, :ref => \"67\", :notes => \"\"}\n end\n\n heat_pulse(@@willpower)\n\n\n when 512..556\n\n def heightened_attributes(roll) # Hub Rules p. 68\n case roll\n when 1\n heightened_attributes_type = \"Cat Balance\"\n @@agility += (d(20) + 20)\n @@accuracy += (d(10) + d(10))\n @@perception += (d(20) + d(20))\n @@appearance += d(10)\n 2.times @@skills << \"Stealth\"\n @@character_notes << \"Due to cat balance, character always gets two hazard checks when agility or accuracy are involved.\"\n when 2\n heightened_attributes_type = \"Eagle Eyes\"\n @@accuracy += (d(10) + d(10))\n @@perception += (d(10) + d(10) + d(10))\n @@character_notes << \"Due to eagle eyes, character sees 10x better than typical human, including at night.\"\n when 3..4\n heightened_attributes_type = \"Strength\"\n @@strength += (d(20) + 30)\n @@appearance += (d(10) + d(10))\n @@character_notes << \"Due to heightened strength, character always gets two hazard checks when strength involved.\"\n when 5..6\n heightened_attributes_type = \"Endurance\"\n @@endurance += (d(20) + 30)\n @@character_notes << \"Due to heightened endurance, character always gets two hazard checks when endurance involved (eg, poison).\"\n when 7\n heightened_attributes_type = \"Hand-Eye Coordination\"\n @@accuracy += (d(20) + 20)\n @@character_notes << \"Due to superior hand-eye coordination, character always gets two hazard checks when accuracy involved.\"\n when 8\n heightened_attributes_type = \"Beauty\"\n @@appearance += (d(20) + 30)\n @@agility += d(6)\n @@accuracy += d(6)\n @@strength += d(6)\n @@character_notes << \"Due to heightened beauty, character always gets two hazard checks when appearance involved.\"\n when 9\n heightened_attributes_type = \"Auditory\"\n @@dv -= 5\n @@character_notes << \"+2 initiative when operating alone or more than 10m from companions.\"\n @@character_notes << \"Sonic attacks do double damage, while crying babies, crowded pubs, and other intense noises are painful.\"\n @@character_notes << \"Due to heightened hearing, character receives 4 attempts on hazard checks related to listening/hearing.\"\n when 10\n heightened_attributes_type = \"Olfactory\"\n (d(2) + 1).times @@skills << \"Tracking\"\n @@character_notes << \"Due to heightened sense of smell, character gets no hazard checks vs. stink-based attacks.\"\n @@character_notes << \"Character cannot be fooled by illusions at less than 10m\"\n @@character_notes << \"Bloodhound-like tracking abilities; however, after 12 hours, or rain, sand storms, or crossing water, all result in lost trails.\"\n when 11\n heightened_attributes_type = \"Willpower\"\n @@willpower += (d(20) + 30)\n @@character_notes << \"Due to heightened willpower, character always gets two hazard checks when willpower involved.\"\n when 12\n heightened_attributes_type = \"Intelligence\"\n @@intelligence += (d(20) + 30)\n @@character_notes << \"Due to heightened intelligence, character always gets two hazard checks when intelligence involved.\"\n end\n @@primary_mutations << \"Heightened Attributes: #{heightened_attributes_type}\"\n end\n\n heightened_attributes(d(12))\n\n\n when 557..566\n number_of_horns = d(4)\n @@primary_mutations << \"Horns: #{number_of_horns} on head\"\n @@character_weight += (2 * number_of_horns)\n @@attacks << {:attack_mode => \"Horns\", :SV => (3 * number_of_horns), :rate => 1, :range => 0, :damage => \"#{number_of_horns}d10\", :ammo => \"infinite\", :skill_pts => 0, :skill_SV_bonus => 0, :skill_damage_bonus => 0, :ref => \"68\", :notes => \"This attack can be employed as a supplemental melee attack\"}\n @@character_notes << \"Due to horns, character can't wear relic helmets or shell-class armor unless horns permanently removed.\"\n when 567..571\n @@primary_mutations << \"Image Multiplication: #{@@willpower} duration, 2 uses/day/rank. Up to #{@@willpower/10.floor} images of mutant's self created. Hub Rules p. 68\"\n when 572..578\n def image_projection(intelligence)\n case intelligence\n when 1..9\n image_projection_range = \"1 km\"\n image_projection_duration = \"d4 rounds\"\n when 10..34\n image_projection_range = \"#{@@intelligence/2} km\"\n image_projection_duration = \"2d4 rounds\"\n when 35..54\n image_projection_range = \"#{@@intelligence} km\"\n image_projection_duration = \"10 + d10 rounds\"\n when 55..74\n image_projection_range = \"#{@@intelligence * 2} km\"\n image_projection_duration = \"20 + d20 rounds\"\n when 75..94\n image_projection_range = \"#{@@intelligence * 100} km\"\n image_projection_duration = \"100 + d100 rounds\"\n when 95..200\n image_projection_range = \"anywhere within solar system\"\n image_projection_duration = \"200 + 2d100 rounds\"\n end\n @@primary_mutations << \"Image Projection: #{image_projection_range} range, #{image_projection_duration} duration. 1/rank/day. Illusion can repeat 2 words/round. Creatures with 35+ intelligence can make a type B intelligence based hazard check to recognize projection as an illusion. Hub Rules p. 69\"\n end\n\n image_projection(@@intelligence)\n\n when 579..603\n def immunity_mutation(roll)\n case roll\n when 1..2\n @@primary_mutations << \"Poison immunity: totally immune to all forms of poison. Also, cannot get drunk.\"\n when 3..4\n @@primary_mutations << \"Disease immunity: All forms of infection, disease, sickness, parasites, etc. don't affect character. Immune to parasites as well.\"\n when 5..6\n @@primary_mutations << \"Radiation immunity: unaffected by all forms of radiation.\"\n end\n end\n\n immunity_mutation(d(6))\n\n when 605..613\n @@primary_mutations << \"Increased Cellular Activity\"\n @@endurance_healing_rate = (@@endurance_healing_rate * 3)\n @@character_notes << \"Character suffers no ill effects from aging (only benefits) and will live forever if not killed in combat, disease, poison, or accident.\"\n when 614..617\n @@primary_mutations << \"Light Burst: 10m radius, 2/day/rank\"\n @@attacks << {:attack_mode => \"Light Burst\", :SV => 0, :rate => 1, :range => 0, :damage => 0, :ammo => \"1/day/rank\", :skill_pts => 0, :skill_SV_bonus => 0, :skill_damage_bonus => 0, :ref => \"69\", :notes => \"Type C agility HC or blinded for 2d5 rounds. Blindness: -2 MV, -20 SV, +20 SV to be struck.\"}\n when 618..624\n @@primary_mutations << \"Limb Regeneration: see Hub Rules p. 69 for regeneration rates.\"\n when 625..630\n def mandibles_mutation(roll)\n case roll\n when 1..2\n mandibles_size = \"Small\"\n mandibles_sv = 3\n mandibles_dmg = \"d10\"\n mandibles_weight = 5\n mandibles_appearance = -(d(4) + 3)\n when 3..5\n mandibles_size = \"Medium\"\n mandibles_sv = 5\n mandibles_dmg = \"d12\"\n mandibles_weight = 15\n mandibles_appearance = -(d(6) + 4)\n when 6..7\n mandibles_size = \"Large\"\n mandibles_sv = 8\n mandibles_dmg = \"d20\"\n mandibles_weight = 20\n mandibles_appearance = -(d(8) + 6)\n @@movement_rate_base -= 0.25\n when 8..9\n mandibles_size = \"Huge\"\n mandibles_sv = 11\n mandibles_dmg = \"d20 + 5\"\n mandibles_weight = 30\n mandibles_appearance = -(d(6) + d(6) + 5)\n @@movement_rate_base -= 0.5\n when 10\n mandibles_size = \"Massive\"\n mandibles_sv = 15\n mandibles_dmg = \"d20 + 10\"\n mandibles_weight = 40\n mandibles_appearance = -(d(6) + d(6) + d(6) + 6)\n @@movement_rate_base -= 1\n\n end\n\n @@attacks << {:attack_mode => \"Mandibles\", :SV => mandibles_sv, :rate => 1, :range => 0, :damage => mandibles_dmg, :ammo => \"infinite\", :skill_pts => 0, :skill_SV_bonus => 0, :skill_damage_bonus => 0, :ref => \"69\", :notes => \"Can be employed as a supplemental melee attack\"}\n @@character_weight += mandibles_weight\n @@appearance += mandibles_appearance #due to implementation method no protection here from =< 0...\n @@primary_mutations << \"Mandibles: #{mandibles_size} size\"\n end\n\n mandibles_mutation(d(10))\n\n when 631..641\n @@primary_mutations << \"Mental Mine\"\n when 642..655\n @@primary_mutations << \"Mental Screen\"\n when 656..687\n @@primary_mutations << \"Mind Crush\"\n when 688..693\n @@primary_mutations << \"Mind Waste\"\n when 694..699\n @@primary_mutations << \"Monstrous Morph\"\n when 700..718\n def multi_arm_mutation(roll) # Hub Rules p. 71\n case roll\n when 1..10\n additional_arms = 1\n when 11..85\n additional_arms = 2\n when 86..90\n additional_arms = 3\n when 91..97\n additional_arms = 4\n when 98\n additional_arms = 5\n when 99\n additional_arms = 6\n when 100\n additional_arms = (d(6) +6)\n end\n if additional_arms % 2 == 1\n def odd_arm_side(roll)\n case roll\n when 1\n odd_arm = \"right\"\n when 2\n odd_arm = \"left\"\n end\n end\n odd_arm_side(d(2))\n @@character_notes << \"Odd arm is on the #{odd_arm_side} side.\"\n end\n\n @@primary_mutations << \"Multi-Arm: #{additional_arms} additional arms\"\n end\n\n multi_arm_mutation(d(100))\n\n when 719..728\n def multi_head_mutation(roll)\n case roll\n when 1..70\n additional_heads = 1\n multi_head_appearance = -d(4)\n multi_head_mv = 0\n multi_head_initiative = 1\n when 71..88\n additional_heads = 2\n multi_head_appearance = -(d(4) + 1 )\n multi_head_mv = 0.25\n multi_head_initiative = 1\n when 89..95\n additional_heads = 3\n multi_head_appearance = -(d(6) + 2)\n multi_head_mv = 0.5\n multi_head_initiative = 2\n when 96..97\n additional_heads = 4\n multi_head_appearance = -(d(6) + 4)\n multi_head_mv = 0.75\n multi_head_initiative = 2\n when 98..99\n additional_heads = 5\n multi_head_appearance = -(d(6) + 6)\n multi_head_mv = 1\n multi_head_initiative = 3\n when 100\n additional_heads = 6\n multi_head_appearance = -(d(6) + 8)\n multi_head_mv = 1.25\n multi_head_initiative = 4\n end\n\n @@primary_mutations << \"Multi-Head: #{additional_heads} additional heads.\"\n @@appearance += multi_head_appearance\n @@movement_rate_base -= multi_head_mv\n @@initiative += multi_head_initiative\n @@character_notes << \"Heads tend to sleep at different times, with wakeful heads acting as lookout.\"\n\n while extra_heads > 0 do\n intelligence = attributes_roll(d100)\n wisdom = attributes_roll(d100)\n puts \"Extra head no. #{extra_heads} has INT of #{intelligence} and WIS of #{wisdom}\"\n def extra_head_mutations(roll2)\n case roll2\n when 1..62\n extra_head_mutation = ghost_mutations(d(100))\n @@primary_mutations << extra_head_mutation\n @@character_notes << \"Extra head no. #{extra_heads} has the mental mutation #{extra_head_mutation}\" # HOW to pick just the name of the mental mutation??\n end\n end\n end\n additional_heads -= 1\n end\n multi_head_mutation(d(100))\n\n when 729..738\n @@primary_mutations << \"Night Vision: can see as well at night as a typical human can in daylight (at least starlight must be present).\"\n when 739..745\n @@primary_mutations << \"Peeling Radius\"\n @@attacks << {:attack_mode => \"Peeling Radius\", :SV => 0, :rate => 1, :range => 10, :damage => \"d6/rd\", :ammo => \"2/day/rank\", :skill_pts => 0, :skill_SV_bonus => 0, :skill_damage_bonus => 0, :ref => \"71\", :notes => \"10m radius. Automatic hit. Duration: 3 rds/rank\"}\n when 746..754\n def poison_bite_mutation(roll1, roll2) # Hub Rules p. 71\n case roll1\n when 1..54\n poison_bite_strength = \"A\"\n when 55..84\n poison_bite_strength = \"B\"\n when 85..97\n poison_bite_strength = \"C\"\n when 98..99\n poison_bite_strength = \"D\"\n when 100\n poison_bite_strength = \"E\"\n end\n\n case roll2\n when 1..5\n poison_bite_type = \"Death\"\n when 6\n poison_bite_type = \"Paralysis\"\n when 7\n poison_bite_type = \"Insanity\"\n when 8..10\n poison_bite_type = \"Sleep\"\n end\n\n @@primary_mutations << \"Poison Bite: #{poison_bite_type} venom, strength #{poison_bite_strength}, 4/day. Sufficient to coat 4 arrows/darts or 1 blade per injection's worth of poison.\"\n @@attacks << {:attack_mode => \"Poison Bite\", :SV => 0, :rate => 1, :range => 0, :damage => \"d6 plus poison\", :ammo => \"4/day\", :skill_pts => 0, :skill_SV_bonus => 0, :skill_damage_bonus => 0, :ref => \"71\", :notes => \"#{poison_bite_type} venom, #{poison_bite_strength} strength.\"}\n end\n\n poison_bite_mutation(d(100),d(10))\n\n\n when 755..760\n\n def poison_blood_mutation(roll1, roll2) # Hub Rules p. 71\n case roll1\n when 1..54\n poison_bite_strength = \"A\"\n when 55..84\n poison_bite_strength = \"B\"\n when 85..97\n poison_bite_strength = \"C\"\n when 98..99\n poison_bite_strength = \"D\"\n when 100\n poison_bite_strength = \"E\"\n end\n\n case roll2\n when 1..5\n poison_bite_type = \"Death\"\n when 6\n poison_bite_type = \"Paralysis\"\n when 7\n poison_bite_type = \"Insanity\"\n when 8..10\n poison_bite_type = \"Sleep\"\n end\n\n @@primary_mutations << \"Poison Blood: #{poison_bite_type} venom, #{poison_bite_strength} strength. Any creature biting mutant poisoned.\"\n\n end\n\n poison_blood_mutation(d(100),d(10))\n\n when 761..767\n paralysis_tendrils = d(6)\n @@primary_mutations << \"Paralysis Tendrils: #{paralysis_tendrils} 3m length grow from mutant's chest\"\n @@appearance = [@@appearance - (4 * paralysis_tendrils), 1].max\n @@attacks << {:attack_mode => \"Paralysis Tendrils\", :SV => 10, :rate => 1, :range => 3, :damage => \"d12 stun, 2d20 vs machines\", :ammo => \"3/day/rank\", :skill_pts => 0, :skill_SV_bonus => 0, :skill_damage_bonus => 0, :ref => \"72\", :notes => \"#{paralysis_tendrils} tendrils, each capable of attack 3/day/rank.\"}\n\n\n when 768..773\n @@primary_mutations << \"Radiation Absorption: mutant immune to radioactivity, except for radioactive weapons, which do half damage.\"\n when 774..780\n @@primary_mutations << \"Radiation Detection: automatically senses the presence of radiation within a twenty meter radius, including those rare sources found in special radiation using robots, relic weapons and life forms.\"\n when 781..786\n @@primary_mutations << \"Radioactive Pulse\"\n @@attacks << {:attack_mode => \"Radioactive Pulse\", :SV => 10, :rate => 1, :range => @@willpower, :damage => \"d20 plus radiation\", :ammo => \"1/day/rank\", :skill_pts => 0, :skill_SV_bonus => 0, :skill_damage_bonus => 0, :ref => \"72\", :notes => \"Victim makes type B endurance hazard check or suffer medium exposure; then type A hazard check or suffer strong exposure.\"}\n when 787..794\n @@primary_mutations << \"Reserve Heart: If character deemed to be killed by poison or electricity, or a critical hit which specifcally states a piercing of the heart, she will appear to be quite dead for 2d20+10 rounds. After this comatose period without a pulse or heartbeat, her back up heart will suddenly kick in and induce 2d10 endurance of healing, bringing the character slowly back to life.\"\n when 795..802\n @@primary_mutations << \"Reserve Mind: back-up brain takes over in case of brain damage, unconsciousness, insanity, or lethal damage. Hub Rules p. 72\"\n when 803..809\n @@primary_mutations << \"Scaled Skin\"\n @@dv -= 8\n @@appearance = [@@appearance - d(4), 1].max\n @@character_notes << \"Scaled skin: immune to damage from sunburn, sand storms, insect bites, and topical irritants.\"\n when 810..814\n @@primary_mutations << \"Serpentine Body: +4 mv on land or swimming\"\n @@dv -= 5\n serpent_body_length = d(3) + 1\n @@character_weight += (40 * serpent_body_length)\n @@appearance = [@@appearance - (d(6) + 1), 1].max\n @@movement_rate_base += 4\n @@movement_rate_swimming += 4\n @@character_notes << \"Unable to wear relic shell class armor\"\n @@attacks << {:attack_mode => \"Serpentine Body Strike\", :SV => 0, :rate => 1, :range => serpent_body_length, :damage => \"d20 stun\", :ammo => \"infinite\", :skill_pts => 0, :skill_SV_bonus => 0, :skill_damage_bonus => 0, :ref => \"72\", :notes => \"Constrict for d10 lethal dmg/rd after successful strike.\"}\n\n when 815..839\n def shell_mutation(roll) # Hub Rules p. 73\n case roll\n when 1..4\n shell_rating = \"Light\"\n shell_defense_value = 10\n shell_movement_penalty = 0.5\n shell_appearance_penalty = (d(4) + 1)\n shell_weight = 20\n when 5..7\n shell_rating = \"Medium\"\n shell_defense_value = 20\n shell_movement_penalty = 1\n shell_appearance_penalty = (d(6) + 2)\n shell_weight = 30\n when 8..9\n shell_rating = \"Heavy\"\n shell_defense_value = 30\n shell_movement_penalty = 1.5\n shell_appearance_penalty = (d(6) + 4)\n shell_weight = 40\n when 10\n shell_rating = \"Extra Heavy\"\n shell_defense_value = 40\n shell_movement_penalty = 2\n shell_appearance_penalty = (d(6) + 6)\n shell_weight = 50\n end\n @@primary_mutations << \"#{shell_rating} Shell: #{shell_defense_value} DV, -#{shell_movement_penalty} MV\"\n @@appearance = [@@appearance - shell_appearance_penalty, 1].max\n @@dv -= shell_defense_value\n @@movement_rate_base -= shell_movement_penalty\n @@character_weight += shell_weight\n @@character_notes << \"Due to Shell mutation, punches, kicks, head-butts etc. deal 2d6 dmg instead of typical d6.\"\n @@character_notes << \"Shell mutation: no relic armor OTHER than ballistic, riot, and bomb squad armor can be worn. Combat armor can be modified, d6+1 days.\"\n end\n\n shell_mutation(d(10))\n\n when 840..849\n def size_decrease_mutation(height)\n case height\n when 61..95\n @@agility += (d(8) + d(8))\n @@strength = [@@strength - d(10), 1].max\n @@endurance = [@@endurance - (d(6) + d(6)), 1].max\n 4.times @@skills << \"Stealth\"\n when 66..90\n @@agility += (d(6) + d(6))\n @@strength = [@@strength - d(8), 1].max\n @@endurance = [@@endurance - (d(4) + d(4)), 1].max\n 3.times @@skills << \"Stealth\"\n when 91..110\n @@agility += (d(4) + d(4))\n @@strength = [@@strength - d(6), 1].max\n @@endurance = [@@endurance - d(6), 1].max\n 2.times @@skills << \"Stealth\"\n when 111..130\n @@agility += d(6)\n @@strength = [@@strength - d(4), 1].max\n @@endurance = [@@endurance - d(4), 1].max\n 2.times @@skills << \"Stealth\"\n when 131..140\n @@agility += d(6)\n @@strength = [@@strength - d(3), 1].max\n @@endurance = [@@endurance - 2, 1].max\n @@skills << \"Stealth\"\n when 141..159\n @@agility += d(4)\n @@skills << \"Stealth\"\n when 160..199\n @@agility += d(3)\n @@skills << \"Stealth\"\n end\n end\n\n @@character_height -= d(100)\n size_decrease_mutation(@@character_height)\n @@primary_mutations << \"Size Decrease\"\n when 850..860\n @@primary_mutations << \"Size Increase\"\n @@character_height += (d(100) + d(100) + d(100) + d(100))\n\n def size_increase_mutation(height) # Hub Rules p. 73\n case height\n when 164..184\n @@strength += d(10)\n @@endurance && @@character_weight += (d(10) + 5)\n when 185..199\n @@movement_rate_base += 0.25\n @@strength += (d(10) + 5)\n @@endurance && @@character_weight += (d(10) + 10)\n when 200..250\n @@movement_rate_base += 0.5\n @@strength += (d(10) + 10)\n @@endurance && @@character_weight += (d(20) + 15)\n when 251..299\n @@movement_rate_base += 0.75\n @@strength += (d(20) + 15)\n @@endurance && @@character_weight += (d(20) + 20)\n when 300..350\n @@movement_rate_base += 1\n @@strength += (d(20) + 20)\n @@endurance && @@character_weight += (d(20) + 30)\n when 351..399\n @@movement_rate_base += 1.25\n @@strength += (d(20) + 30)\n @@endurance && @@character_weight += (d(20) + 40)\n when 400..425\n @@movement_rate_base += 1.5\n @@strength += (d(20) + 40)\n @@endurance && @@character_weight += (d(20) + 50)\n when 426..450\n @@movement_rate_base += 1.75\n @@strength += (d(20) + 50)\n @@endurance && @@character_weight += (d(20) + 60)\n when 451..475\n @@movement_rate_base += 2\n @@strength += (d(20) + 60)\n @@endurance && @@character_weight += (d(20) + 75)\n when 476..499\n @@movement_rate_base += 3\n @@strength += (d(20) + 75)\n @@endurance && @@character_weight += (d(20) + 88)\n when 500..525\n @@movement_rate_base += 4\n @@strength += (d(20) + 88)\n @@endurance && @@character_weight += (d(20) + 100)\n when 526..560\n @@movement_rate_base += 5\n @@strength += (d(20) + 100)\n @@endurance && @@character_weight += (d(20) + 130)\n when 561..580\n @@movement_rate_base += 6\n @@strength += (d(20) + 130)\n @@endurance && @@character_weight += (d(20) + 160)\n end\n end\n\n size_increase_mutation(@@character_height)\n\n when 861..869\n def sonic_wave_radius_mutation(willpower) # Hub Rules p. 73\n case willpower\n when 1..9\n attack_radius = 1\n damage = \"d4\"\n deafness_duration = \"1 minute\"\n when 10..23\n attack_radius = 2\n damage = \"d6\"\n deafness_duration = \"5 minutes\"\n when 24..34\n attack_radius = 4\n damage = \"d8\"\n deafness_duration = \"10 minutes\"\n when 35..60\n attack_radius = 5\n damage = \"d10\"\n deafness_duration = \"30 minutes\"\n when 61..70\n attack_radius = 7\n damage = \"d12\"\n deafness_duration = \"1 hour\"\n when 71..80\n attack_radius = 9\n damage = \"d20\"\n deafness_duration = \"2d4 hours\"\n when 81..90\n attack_radius = 15\n damage = \"d20 + 5\"\n deafness_duration = \"3d6 hours\"\n when 91..100\n attack_radius = 20\n damage = \"d20 + 10\"\n deafness_duration = \"d6 days\"\n when 101..110\n attack_radius = 25\n damage = \"d20 + 15\"\n deafness_duration = \"2d4 days\"\n when 111..120\n attack_radius = 30\n damage = \"d20 + 20\"\n deafness_duration = \"3d6 days\"\n when 121..130\n attack_radius = 40\n damage = \"d20 + 30\"\n deafness_duration = \"3d6 + 10 days\"\n when 131..140\n attack_radius = 50\n damage = \"d20 + 40\"\n deafness_duration = \"3d6 + 20 days\"\n when 141..150\n attack_radius = 60\n damage = \"d20 + 50\"\n deafness_duration = \"3d6 + 30 days\"\n end\n\n @@primary_mutations << \"Sonic Wave Radius: 2/day/rank, #{attack_radius} radius, #{damage} damage, #{deafness_duration} deafness.\"\n @@attacks << {:attack_mode => \"Sonic Wave Radius\", :SV => 100, :rate => 1, :range => attack_radius, :damage => damage, :ammo => \"2/day/rank\", :skill_pts => 0, :skill_SV_bonus => 0, :skill_damage_bonus => 0, :ref => \"73\", :notes => \"#{deafness_duration} deafness\"}\n end\n\n sonic_wave_radius_mutation(@@willpower)\n\n\n when 870..876\n @@primary_mutations << \"Spines: #{d(10) + 10} cm length, + d6 dmg to punch/kick\"\n @@dv -= (d(20) + 10)\n @@appearance = [@@appearance - (d(4) + d(4)), 1].max\n @@character_notes << \"Unable to wear relic armor unless spines are sawed off monthly.\"\n when 877..880\n @@primary_mutations << \"Sprint: 2/day/rank, duration 2d10 + rank rounds. -20DV (-20SV with misslie weapons) while sprinting OR double melee attack rate.\"\n when 881..886\n def stalked_eyes_mutation(roll)\n case roll\n when 1..67\n eye_stalks = (d(4) + 1)\n @@primary_mutations << \"Stalked eyes: mutant has #{eye_stalks} #{(d(20) + 10)} cm long instead of typical eyes.\"\n when 68..100\n eye_stalks = (d(3) + 1)\n @@primary_mutations << \"Stalked eyes: mutant has #{eye_stalks} #{(d(20) + 10)} cm long in addition to typical eyes.\"\n end\n\n @@dv -= (eye_stalks * 3)\n @@initiative += 2\n @@appearance = [@@appearance - (eye_stalks * d(6)), 1].max\n end\n\n stalked_eyes_mutation(d(100))\n\n when 887..892\n def stench_spray_location(roll) # Hub Rules p. 74\n case roll\n when 1..2\n location = \"Groin\"\n when 3..4\n location = \"Stomach\"\n when 5..6\n location = \"Chest\"\n when 7\n location = \"Left armpit\"\n when 8\n location = \"Right armpit\"\n when 9\n location = \"Back\"\n when 10\n location = \"Butt\"\n end\n\n stench_spray_app = (6 + d(6))\n @@primary_mutations << \"Stench Spray: #{20 + d(20) + d(20)} cm organ located on character's #{location}\"\n @@attacks << {:attack_mode => \"Stench Spray\", :SV => 10, :rate => 1, :range => (@@strength / 2), :damage => \"Special\", :ammo => \"2/day/rank\", :skill_pts => 0, :skill_SV_bonus => 0, :skill_damage_bonus => 0, :ref => \"74\", :notes => \"Endurance-based type B hazard check or d6 + 1 rds vomiting, +30SV to strike, -30SV to attack others.\"}\n @@character_notes << \"Character's appearance -#{stench_spray_app} penalty after stench organ seen.\"\n\n end\n\n stench_spray_location(d(10))\n\n when 893..901\n @@primary_mutations << \"Strength Burst: 2/rank/day, 4 rds/rank duration, character's strength 4x regular amount. Contributes to strength-based hazard checks, melee damage, etc.\"\n when 902..909\n def stun_ray_launcher(roll)\n case roll\n when 1..17\n stun_location = \"eyes\"\n when 18..59\n stun_location = \"left hand\"\n when 60..101\n stun_location = \"right hand\"\n end\n\n @@primary_mutations << \"Stun Ray fired from #{stun_location}.\"\n @@attacks << {:attack_mode => \"Stun Ray\", :SV => 10, :rate => 1, :range => (@@willpower * 2), :damage => \"2d20 stun, x2 vs machines\", :ammo => \"3/day/rank\", :skill_pts => 0, :skill_SV_bonus => 0, :skill_damage_bonus => 0, :ref => \"74\", :notes => \"Stun damage fades after 1 hour.\"}\n end\n\n stun_ray_launcher(d(101))\n\n when 910..924\n def tail_mutation(roll) # Hub Rules p. 74\n case roll\n when 1..2\n tail_type = \"Club\"\n tail_length = 1.5\n tail_agility_bonus = d(4)\n tail_move = -1\n tail_sv = 6\n tail_attack_dmg = \"d12 + 2 lethal or stun\"\n when 3\n tail_type = \"Crocodile\"\n tail_length = 1.7\n tail_agility_bonus = d(8)\n tail_move = -1\n tail_move_water = 4\n tail_sv = 5\n tail_attack_dmg = \"d12 stun\"\n when 4\n tail_type = \"Dolphin\"\n tail_length = 1.5\n tail_agility_bonus = d(6)\n tail_move = -1\n tail_move_water = 6\n tail_sv = 4\n tail_attack_dmg = \"d12 stun\"\n when 5\n tail_type = \"Eagle\"\n tail_length = 1\n tail_agility_bonus = d(6)\n tail_move = 1\n tail_sv = 0\n tail_attack_dmg = nil\n when 6\n tail_type = \"Fish\"\n tail_length = 1.3\n tail_agility_bonus = d(6)\n tail_move = -1\n tail_move_water = 5\n tail_sv = 4\n tail_attack_dmg = \"d10 stun\"\n when 7\n tail_type = \"Fox\"\n tail_length = 1.25\n tail_agility_bonus = (d(6) + d(6))\n tail_move = 1.5\n tail_sv = 0\n tail_attack_dmg = nil\n when 8\n tail_type = \"Cat\"\n tail_length = 1.5\n tail_agility_bonus = (d(8) + d(8))\n tail_move = 2\n tail_sv = 0\n tail_attack_dmg = nil\n when 9\n tail_type = \"Whip\"\n tail_length = (3 + d(4))\n tail_agility_bonus = d(6)\n tail_move = -0.25\n tail_sv = 4\n tail_attack_dmg = \"d8\"\n @@character_notes << \"Whip tail can be used as #{tail_length} rope.\"\n when 10..13\n tail_type = \"Prehensile (monkey)\"\n tail_length = 3\n tail_agility_bonus = (d(4) + d(4))\n tail_move = 1\n tail_sv = 0\n tail_attack_dmg = nil\n @@character_notes << \"Prehensile tail can wield dagger or knife for additional melee attack.\"\n when 14\n tail_type = \"Newt\"\n tail_length = 1.5\n tail_agility_bonus = d(8)\n tail_move = -1\n tail_move_water = 4\n tail_sv = 3\n tail_attack_dmg = \"d10 stun\"\n when 15\n tail_type = \"Porcupine\"\n tail_length = 0.75\n tail_agility_bonus = 0\n tail_move = -1\n tail_sv = 5\n tail_attack_dmg = \"d12 + 1\"\n when 16..17\n tail_type = \"Rat\"\n tail_length = 1.8\n tail_agility_bonus = d(6)\n tail_move = 0.5\n tail_sv = 0\n tail_attack_dmg = nil\n @@character_notes << \"Rat tail can wield dagger or knife for additional melee attack.\"\n when 18\n tail_type = \"Scorpion\"\n tail_length = 2\n tail_agility_bonus = d(6)\n tail_move = -1\n tail_sv = 8\n tail_attack_dmg = \"d12 + Type A poison\"\n when 19\n tail_type = \"Spiked\"\n tail_length = 1.75\n tail_agility_bonus = d(6)\n tail_move = -1\n tail_sv = 7\n tail_attack_dmg = \"d12 + 3\"\n when 20\n tail_type = \"Bladed\"\n tail_length = 2\n tail_agility_bonus = d(6)\n tail_move = -1\n tail_sv = 7\n tail_attack_dmg = \"d20\"\n end\n\n @@primary_mutations << \"Tailed: #{tail_type} tail of #{tail_length} m length.\"\n @@appearance += tail_agility_bonus\n @@movement_rate_base += tail_move\n @@movement_rate_swimming += tail_move_water\n if tail_attack_dmg != nil\n @@attacks << {:attack_mode => \"#{tail_type} tail strike\", :SV => tail_sv, :rate => 1, :range => tail_length, :damage => \"#{tail_attack_dmg}\", :ammo => \"infinite\", :skill_pts => 0, :skill_SV_bonus => 0, :skill_damage_bonus => 0, :ref => \"74\", :notes => \"\"}\n end\n end\n\n tail_mutation(d(20))\n\n when 925..936\n @@primary_mutations << \"Telekinesis\"\n when 937..961\n @@primary_mutations << \"Telepathy\"\n when 962..967\n def tentacle_mutation(roll)\n case roll\n when 1..28\n number_of_tentacles = (d(4) + d(4) + 2)\n @@primary_mutations << \"Tentacles: Mutant has #{number_of_tentacles} instead of arms.\"\n when 29..100\n number_of_tentacles = (d(4) + d(4))\n @@primary_mutations << \"Tentacles: Mutant has #{number_of_tentacles} in addition to arms.\"\n end\n\n @@appearance = [@@appearance - (number_of_tentacles * 2), 1].max\n 2.times @@skills << \"Climbing\"\n @@character_notes << \"Tentacles add #{number_of_tentacles * 0.5} m to character's climbing & swimming move rates.\"\n @@character_notes << \"Tentacles can wield simple melee weapons but lack the dexterity needed to operate a keyboard, stringed, or triggered weapon.\"\n @@attacks << {:attack_mode => \"Tentacle strike\", :SV => 5, :rate => number_of_tentacles, :range => 0, :damage => \"d8 stun\", :ammo => \"infinite\", :skill_pts => 0, :skill_SV_bonus => 0, :skill_damage_bonus => 0, :ref => \"75\", :notes => \"Tentacles gain unarmed combat modifiers, too.\"}\n end\n\n tentacle_mutation(d(100))\n\n when 968..975\n @@primary_mutations << \"Throwing Quills: fire 1/rd, up to 20/day\"\n @@dv -= 18\n @@character_notes << \"Due to quills, mutant cannot wear relic armor (except specially-designed junk or scrap relic armor)\"\n @@appearance = [@@appearance - (d(4) + d(4)), 1].max\n @@attacks << {:attack_mode => \"Throwing Quill\", :SV => 6, :rate => 1, :range => (@@strength / 2), :damage => \"d10\", :ammo => \"20/day\", :skill_pts => 0, :skill_SV_bonus => 0, :skill_damage_bonus => 0, :ref => \"76\", :notes => \"incl. strength and wpn expert skill modifiers\"}\n\n when 976..982\n def thrust_spike_mutation(roll)\n case roll\n when 1\n poison = \"type A death poison\"\n when 2..10\n poison = \"None\"\n end\n thrust_spike_length = (d(4) + d(4))\n @@primary_mutations << \"Thrust Spike #{thrust_spike_length} long.\"\n @@character_notes << \"After seeing thrust spike mutant's appearance score reduced for witness by d1- + 10.\" #obvious typo here\n if poison == \"None\"\n @@attacks << {:attack_mode => \"Thrust Spike\", :SV => 0, :rate => 1, :range => thrust_spike_length, :damage => \"d20\", :ammo => \"infinite\", :skill_pts => 0, :skill_SV_bonus => 0, :skill_damage_bonus => 0, :ref => \"76\", :notes => \"+30SV, 2d20 + 10 damage on first attack.\"}\n elsif poison != \"None\"\n @@attacks << {:attack_mode => \"Thrust Spike\", :SV => 0, :rate => 1, :range => thrust_spike_length, :damage => \"d20\", :ammo => \"infinite\", :skill_pts => 0, :skill_SV_bonus => 0, :skill_damage_bonus => 0, :ref => \"76\", :notes => \"+30SV, 2d20 + 10 damage on first attack. Also: #{poison}\"}\n end\n end\n\n thrust_spike_mutation(d(10))\n\n\n when 983..986\n @@primary_mutations << \"Tusks\"\n @@attacks << {:attack_mode => \"Tusk bite\", :SV => 6, :rate => 1, :range => 0, :damage => \"2d8 + 2\", :ammo => \"infinite\", :skill_pts => 0, :skill_SV_bonus => 0, :skill_damage_bonus => 0, :ref => \"76\", :notes => \"Additional melee attack/rd.\"}\n @@appearance = [@@appearance - (d(8) + 2), 1].max\n when 987..992\n @@primary_mutations << \"Webbed Hands: character nearly impossible to drown & can hold breath 2x normal. Double swim speed.\"\n @@movement_rate_swimming += @@movement_rate_swimming\n\n when 993..1000\n def wings_mutation(roll1,roll2) # Hub Rules p. 76\n case roll1\n when 1\n wing_type = \"Bird\"\n air_speed += 6\n @@character_notes << \"Bird wings are fragile - this character suffers double damage from fire and burst radius explosives like grenades and bombs.\"\n when 2\n wing_type = \"Insect\"\n air_speed += 3\n @@character_notes << \"Due to insect wings, character has -2 MV in enclosed spaces.\"\n when 3..6\n wing_type = \"Bat\"\n end\n\n case roll2\n when 1\n wing_size = \"Tiny\"\n flight_mode = \"Glide only\"\n air_speed += (d(6) + 10)\n flying_dv = -5\n wing_attack_dmg = nil\n wing_weight = 6\n when 2\n wing_size = \"Small\"\n flight_mode = \"Flies poorly\"\n air_speed += (d(6) + 12)\n flying_dv = -10\n wing_attack_dmg = \"d4 stun\"\n wing_weight = 12\n when 3..4\n wing_size = \"Medium\"\n flight_mode = \"Flies normally\"\n air_speed += (d(6) + 15)\n flying_dv = -14\n wing_attack_dmg = \"d6 stun\"\n wing_weight = 20\n when 5\n wing_size = \"Large\"\n flight_mode = \"Flies normally\"\n air_speed += (d(6) + 20)\n flying_dv = -20\n wing_attack_dmg = \"d8 stun\"\n wing_weight = 30\n when 6\n wing_size = \"Vast\"\n flight_mode = \"Flies excellently\"\n air_speed += (d(10) + 25)\n flying_dv = -25\n wing_attack_dmg = \"d10 stun\"\n wing_weight = 40\n end\n\n @@primary_mutations << \"Wings: #{wing_size} #{wing_type} wings. Mutant #{flight_mode} at #{air_speed} MV and #{flying_dv} DV when airborne.\"\n @@movement_rate_flying += air_speed\n\n if wing_attack_dmg != nil\n @@attacks << {:attack_mode => \"Wing bash\", :SV => 0, :rate => 2, :range => 0, :damage => \"#{wing_attack_dmg}\", :ammo => \"infinite\", :skill_pts => 0, :skill_SV_bonus => 0, :skill_damage_bonus => 0, :ref => \"76\", :notes => \"\"}\n end\n\n @@character_notes << \"Character able to fly at full air speed with full gear, arms, and armor. See Hub Rules p. 76 for more.\"\n @@character_notes << \"Due to wings, standard and relic armor must be modified and fitted to this character.\"\n\n\n end\n\n wings_mutation(d(6),d(6))\n\n end\nend",
"title": ""
},
{
"docid": "d53f62bb775a741b0881458f8853f723",
"score": "0.5634142",
"text": "def problem_four\n max = 0\n\n 100.upto(999).each do |a|\n a.upto(999).each do |b|\n max = a * b if palindrome?(a * b) && (a * b) > max\n end\n end\n\n max\n end",
"title": ""
},
{
"docid": "36a8392d2cad83823286815a5dbce630",
"score": "0.5626819",
"text": "def phase_one\n puts \"Get ready to start Part 1.\".light_grey\n puts \"Each Tribe will participate in an immunity challenge.\".light_grey\n puts \"The losing Tribe will then vote someone off the island.\".light_grey\n 8.times do \n\t#Sets variable for tribe loser of immunity challege\n\tlosing_tribe = @borneo.immunity_challenge \n\tputs \"#{losing_tribe} \".red + \"has lost the challenge and will vote someone off the island.\"\n\t#Losing tribe holds tribal council and votes off member\n\tmember_voted_off = losing_tribe.tribal_council\n\tputs \"Sadly, \" + \"#{member_voted_off} \".green + \"has been voted off the island.\"\n end\nend",
"title": ""
},
{
"docid": "b1c22b4abadba973072c59964838113a",
"score": "0.5624363",
"text": "def pe50v2()\n\ta = sieveOfErathosthenes(3990)\n\tprim,total,count = [], 0, 0\n\ta.each_with_index do |x, index|\n\t\tif x \n\t\t\ttotal += index\n\t\t\tcount += 1 \n\t\t\tprim.push([total,count])\n\t\tend\n\tend\n\t#p prim\n\tmax = 0\n\tthePrime = 0\n\tseq = prim.map {|k| k }.permutation(2).to_a.each {|x| x.flatten!}\n\tseq.each do |a, b, c , d| \n\t\t#printf \"%d %d %d %d\\n\", a, b, c, d\n\t\te = a - c\n\t\tif(Prime.prime?(e)) then\n\t\t\tif(max < b - d) then\n\t\t\t\tmax = b - d\n\t\t\t\tthePrime = e\n\t\t\t\tprintf \"prime %d with max %d\\n\",e,max\n\t\t\tend\n\t\tend\n\tend\n\tprintf \"the prime is %d with a seqence of %d\\n\",thePrime, max\nend",
"title": ""
},
{
"docid": "0ef8887b85827ee7a2d5ab08ff4a058c",
"score": "0.56197125",
"text": "def number_problem()\n\n\tcount = 10\n\twhile count > 0\n\t\tputs \"you have #{count} times you can do this!\"\n\n\t\tputs \"Please enter a number that is a multiple of 3 or 5, 1-100 for a phrase or word back!\"\n\t\tnumber = gets.chomp\n\n\t\tmult_of_three = [\"3\", \"6\", \"9\", \"12\", \"18\", \"21\", \"24\", \"27\", \"33\", \"36\", \"39\", \"42\", \"48\", \"51\", \"54\", \"57\", \"63\", \"66\", \"69\", \"72\", \"78\", \"81\", \"84\", \"87\", \"93\", \"96\", \"99\"]\n\t\tmult_of_five = [\"5\", \"10\", \"20\", \"25\", \"35\", \"40\", \"50\", \"55\", \"65\", \"70\", \"80\", \"85\", \"95\", \"100\"]\n\t\tmult_of_both = [\"15\", \"30\", \"45\", \"60\", \"75\", \"90\"]\n\n\t\tif mult_of_three.include?(number)\n\t\t\tputs \"Bit\"\n\n\t\telsif mult_of_five.include?(number)\n\t\t\tputs \"Maker\"\n\n\t\telsif mult_of_both.include?(number)\n\t\t\tputs \"BitMaker!\"\n\n\t\telse\n\t\t\tputs \"That number is not 1-100, or is not a multiple of 3 and/or 5!\"\n\t\tend\n\n\t\tcount -= 1\n\n\tend\n\n\n\nend",
"title": ""
},
{
"docid": "acd23bde8c0945fc6a953a4bf4a77c75",
"score": "0.56141114",
"text": "def phase_one\n puts \"Phase 1 Starting\".yellow\n counter = 8\n eliminated = []\n while counter > 0\n indexer = 8 - counter\n puts \"Phase one, round #{(indexer+1).to_s}:\".green\n tribe_selected = @borneo.immunity_challenge\n puts \"Tribe selected: #{tribe_selected.to_s}\".green\n puts \"Contestant #{tribe_selected.tribal_council} was eliminated without mercy!\".red\n counter -= 1\n end\n 8 # this is here to pass the test, but not sure it's ver useful beyond that\nend",
"title": ""
},
{
"docid": "64d22b527e181900298ca23c74c78dfc",
"score": "0.5603119",
"text": "def run_tests()\n check_solution(1, [1, 4, 10, 13, 15], true)\n check_solution(2, [1, 4, 10, 10, 13, 15], true)\n check_solution(3, [1, 2, 5, 3, 4 ], false)\nend",
"title": ""
},
{
"docid": "64d22b527e181900298ca23c74c78dfc",
"score": "0.5603119",
"text": "def run_tests()\n check_solution(1, [1, 4, 10, 13, 15], true)\n check_solution(2, [1, 4, 10, 10, 13, 15], true)\n check_solution(3, [1, 2, 5, 3, 4 ], false)\nend",
"title": ""
},
{
"docid": "6cc5579e575075da487a655dbd009cd6",
"score": "0.55941397",
"text": "def problem_seven\n Prime.first(10_001).last\n end",
"title": ""
},
{
"docid": "8076394c5dc5aca52fcfc7a63a421aba",
"score": "0.55808115",
"text": "def last_possible_exam_semester\n study_length * 2 - 2\n end",
"title": ""
},
{
"docid": "ff99887ad7f63e796fd2e45586dda4a3",
"score": "0.55594254",
"text": "def solve\n n = 33\n while true\n begin\n n += 2\n end while n.prime?\n\n s, ds = 2, 6\n while s < n && !(n - s).prime?\n s += ds\n ds += 4\n end\n\n break if s >= n\n end\n \n n\n end",
"title": ""
},
{
"docid": "99d36cf3538859aee969193776312098",
"score": "0.555859",
"text": "def wizards_trial()\n\n\t#Initialize hats and gnomes\n\thats = [\"red\", \"white\"]\n\tgnomes = [\"one\", \"two\", \"three\", \"four\", \"five\", \"six\", \"seven\", \"eight\", \"nine\", \"ten\"]\n\n\t#Line up gnomes and place hats on them\n\thatted_gnomes = {}\n\tgnomes.each do |gnome|\n\t\thatted_gnomes[gnome] = hats.sample\n\tend\n\n\t#Have gnomes guess which color hats they have on\n\tguesses = gnome_guesses(hatted_gnomes)\n\n\t#Judge the gnomes\n\tjudge_the_gnomes(guesses, hatted_gnomes)\n\nend",
"title": ""
},
{
"docid": "f7613aae5d648335b2424bf21c0a08b3",
"score": "0.5541573",
"text": "def solution1(seeds)\n turn_map = {}\n seeds.each_with_index { |n, turn| turn_map[n] = [1, turn + 1, turn + 1] }\n last_number = seeds.last\n\n ((seeds.length+1)..2020).each do |turn|\n last_stats = turn_map[last_number]\n if last_stats[TIMES_SPOKEN] == 1\n zero = turn_map[0] || [0, turn, turn]\n zero[TIMES_SPOKEN] += 1\n zero[FIRST_SPOKEN] = zero[LAST_SPOKEN]\n zero[LAST_SPOKEN] = turn\n \n turn_map[0] = zero\n last_number = 0\n else\n age = last_stats[LAST_SPOKEN] - last_stats[FIRST_SPOKEN]\n\n num = turn_map[age] || [0, turn, turn]\n num[TIMES_SPOKEN] += 1\n num[FIRST_SPOKEN] = num[LAST_SPOKEN]\n num[LAST_SPOKEN] = turn\n \n turn_map[age] = num\n last_number = age\n end\n end\n\n last_number\nend",
"title": ""
},
{
"docid": "0f7235c4506e02cc8db283f180031aff",
"score": "0.55396354",
"text": "def lists_problems(num1, num2)\n\n i1 = num1.to_i\n i2 = num2.to_i\n\n if i1 < i2\n range = (i1..i2)\n else \n range = (i2..i1)\n end\n orig1 = i1\n orig2 = i2\n prob_array = []\n\n range.each do |i|\n i2 = orig2\n until i2 <= orig1 \n second_integer = (i2 -= 1) + 1\n prob_array << \"#{i} * #{second_integer}\"\n end\n i += 1\n end\n prob_array\nend",
"title": ""
},
{
"docid": "bd8711e5d420c72c21df6330d29db5d4",
"score": "0.5538677",
"text": "def solve_zero_vs_six_vs_nine\n return if @arr[1].nil? || @arr[4].nil?\n\n #p \"1,4: #{@arr[1]},#{@arr[4]}\"\n\n @words.filter{|x| x.length == 6 && @hash[x].nil?}.each{|w|\n if @arr[4].chars.all?{|c| w.chars.include?(c)}\n solved(9, w)\n elsif @arr[1].chars.all?{|c2| w.chars.include?(c2)}\n solved(0, w)\n else\n solved(6, w)\n end\n }\n end",
"title": ""
},
{
"docid": "84f5ee5692f9c6851cfaeadc76d28ca9",
"score": "0.5531571",
"text": "def run_tests()\n check_solution(1,\"aaabbc\", \"3a2bc\")\n check_solution(2, \"xxyyyyzz\", \"2x4y2z\")\n check_solution(3, \"qqqqq\", \"5q\")\n check_solution(4, \"mississippi\", \"mi2si2si2pi\")\nend",
"title": ""
},
{
"docid": "84f5ee5692f9c6851cfaeadc76d28ca9",
"score": "0.5531571",
"text": "def run_tests()\n check_solution(1,\"aaabbc\", \"3a2bc\")\n check_solution(2, \"xxyyyyzz\", \"2x4y2z\")\n check_solution(3, \"qqqqq\", \"5q\")\n check_solution(4, \"mississippi\", \"mi2si2si2pi\")\nend",
"title": ""
},
{
"docid": "84f5ee5692f9c6851cfaeadc76d28ca9",
"score": "0.5531571",
"text": "def run_tests()\n check_solution(1,\"aaabbc\", \"3a2bc\")\n check_solution(2, \"xxyyyyzz\", \"2x4y2z\")\n check_solution(3, \"qqqqq\", \"5q\")\n check_solution(4, \"mississippi\", \"mi2si2si2pi\")\nend",
"title": ""
},
{
"docid": "31b17baab1d625ddc147e791086d05a9",
"score": "0.55200005",
"text": "def solution\n (1..40).inject(:*) / (1..20).inject(:*)**2\nend",
"title": ""
},
{
"docid": "1784caef886c6a7ab2a177f23d7909ae",
"score": "0.5517389",
"text": "def solution\n 971 * (-61)\nend",
"title": ""
},
{
"docid": "d25dd58db487089f5e43bed69ada04f3",
"score": "0.5512968",
"text": "def solutions(args)\n book = require_arg(args,'book')\n hw = get_hw_from_file_or_die(require_arg(args,'in_file'))\n sets = hw_to_sets(hw,book)\n stream_labels = assign_starts_of_streams_to_sets(sets,hw)\n out_file = require_arg(args,'out_file')\n class_title = require_arg(args,'class_title')\n sets = require_arg(args,'sets')\n gb_file = require_arg(args,'gb_file')\n sample = (args.has_key?('sample') && args['sample'].to_i==1)\n roster = get_roster_from_opengrade(gb_file) # roster[\"blow_joe\"]={last, first, class, id_string, and id_int}\n solution_in_book = {} # [label]=boolean\n sources_parent_dir = File.expand_path(require_arg(args,'sources_parent_dir'))\n subdir_list = []\n Dir.chdir(sources_parent_dir) do # do block so we chdir back afterward\n subdir_list=Dir[\"*\"].reject{|o| not File.directory?(o)}.sort\n end\n probs = {}\n n_hw_defined=0\n header = true\n students_encountered = {}\n problem_labels_encountered = []\n File.readlines(sets).each { |line|\n if header then\n header = false\n else\n # set,book,ch,num,parts,flags,chunk,student\n unless line=~/(.*),(.*),(.*),(.*),(.*),(.*),(.*),(.*)/ then fatal_error(\"illegal line in #{sets}: #{line}\") end\n hw,ch,num,student = [$1.to_i,$3.to_i,$4,$8] # no to_i on num, could be \"g7\"\n if hw>n_hw_defined then n_hw_defined=hw end\n students_encountered[student] = true\n if probs[student].nil? then probs[student] = {} end\n if probs[student][hw].nil? then probs[student][hw] = [] end\n l = $num_to_label[[ch,num]]\n if l.nil? then fatal_error(\"no label found for ch. #{ch}, problem #{num}\") end\n problem_labels_encountered.push(l)\n probs[student][hw].push(l)\n end\n }\n students_encountered.keys.each { |k|\n unless roster.has_key?(k) then fatal_error(\"student #{k} occurs in #{sets}, but not in #{gb_file}\") end\n }\n roster.keys.each { |k|\n unless students_encountered.has_key?(k) then fatal_error(\"student #{k} occurs in #{gb_file}, but not in #{sets}\") end\n }\n label_to_source_file = {}\n problem_labels_encountered.each { |l|\n p = $label_to_num[l]\n solution_in_book[l] = $has_solution[p]\n subdir_list.each { |d|\n t = sources_parent_dir+\"/\"+d+\"/\"+l+\".tex\"\n if File.exists?(t) then label_to_source_file[l] = t; next end\n }\n if !solution_in_book[l] && label_to_source_file[l].nil? then $stderr.print \"warning: no solution found for #{l} in any subdirectory of #{sources_parent_dir}\\n\" end\n }\n head = <<-\"HEAD\"\n \\\\documentclass{simplesolns}\n \\\\begin{document}\n {\\\\Huge\\\\textbf{Solutions for #{class_title}}}\\\\\\\\\\n\n HEAD\n tail = <<-'TAIL'\n \\end{document}\n TAIL\n toc = ''\n tex = ''\n 1.upto(n_hw_defined) { |hw|\n toc = toc + \"\\\\noindent Homework #{hw} ... \\\\pageref{set#{hw}}\\\\\\\\\\n\"\n first_student = true\n roster.keys.sort.each { |student|\n label_for_toc = ''\n if sample && !first_student then break end\n if first_student then label_for_toc = \"\\\\label{set#{hw}}\" end\n tex = tex + <<-\"TEX\"\n\n \\\\pagebreak\n\n \\\\noindent%\n {\\\\large\\\\textbf{Solutions to Homework #{hw}, #{class_title},\n #{roster[student][\"first\"]} #{roster[student][\"last\"]} }}#{label_for_toc}\\\\\\\\\\n\n TEX\n first_student = false\n probs[student][hw].each { |label|\n p = $label_to_num[label]\n if solution_in_book[label] then\n tex = tex+solution_helper(p,'solution in the back of the book')\n else\n source_file = label_to_source_file[label]\n missing = false\n if source_file.nil?\n missing = true\n else\n s,err = slurp_file_with_detailed_error_reporting(source_file)\n if s.nil? then \n missing=true \n $stderr.print \"warning: error reading file #{source_file}, #{err}\"\n else\n tex = tex+solution_helper(p,s)\n end\n end\n if missing then\n tex = tex+solution_helper(p,'!!!!!!!!!!! missing solution !!!!!!!!!!!!!!')\n end\n end\n }\n }\n }\n File.open(out_file,'w') { |f|\n f.print head+toc + \"\\\\pagebreak\" + tex+tail\n }\nend",
"title": ""
},
{
"docid": "bb5549d01201edb67a9eee012a192a18",
"score": "0.5512857",
"text": "def solver (seed_char, blanks_words_sizes, matrix)\n\t# Set numerical target\n\ttarget = magic_num(seed_char)\t\n\t# Find magic number sum buckets\n\tskynet(target, blanks_words_sizes, blanks_words_sizes.length - 1, 0, [])\n\t# Alphabetical sort input matrix\n\tsorted_seed_char = seed_char.chars.sort.join\t\n\n\t# Find unique sets from skynet solutions\n\t$answer[:trace].each do |arrOarr|\n\t\tarrOarr.sort!\n\tend \n\n\t$answer[:trace].uniq!\t\n\t\n\t# Finds match for complete set of words from skynet solutions\n\t$answer[:trace].each do |answer_arr_el|\t\t\t\t\n\t\tunordered_match(sorted_seed_char, matrix, answer_arr_el, answer_arr_el.length - 1, \"\", [])\n\t\t# Can be ignored\n\t\t$ops += $seed[answer_arr_el[0][0]][:num_groups][answer_arr_el[0][1]].length *\n\t\t\t$seed[answer_arr_el[1][0]][:num_groups][answer_arr_el[1][1]].length *\n\t\t\t$seed[answer_arr_el[1][0]][:num_groups][answer_arr_el[1][1]].length *\n\t\t\t$seed[answer_arr_el[1][0]][:num_groups][answer_arr_el[1][1]].length\t\t\n\tend\n\t\n\treturn $answer[:words]\nend",
"title": ""
},
{
"docid": "2fdd7773d91143c02a91cef0c00a0f73",
"score": "0.5508166",
"text": "def t0_setup\n @my_big_input_array = []\n @my_big_result_array = []\n for num in 1..12\n playing_board(num)\n end\n solution_board\n end",
"title": ""
},
{
"docid": "1d75d94d089cd7650e317bc69dcd31c0",
"score": "0.55041087",
"text": "def problem(a=100,b=100)\n (2..a).inject(0) {|s1,i| s1 += (2..b).inject(0) {|s2,j| @terms.add?(i**j) ? s2 += 1 : s2}}\n end",
"title": ""
},
{
"docid": "0bf109357d034c0f31313ffbe8fcc3b6",
"score": "0.550351",
"text": "def problem1 limit\n (0...limit).map {|n| (n%3==0 || n%5==0) ? n : 0 }.reduce(:+)\nend",
"title": ""
},
{
"docid": "8f966dde70b8821cdfbb5c2879d8e37a",
"score": "0.54967254",
"text": "def seventh_puzzle\n ret = []\n 10.times { ret.push(sixth_puzzle) }\n return ret\nend",
"title": ""
},
{
"docid": "4ce1ef5eb5ce81d38e9468e5b4ed0bd1",
"score": "0.5489796",
"text": "def solve\n max = nil\n\n # Start with the longest possible and work down. \n 9.downto( 1 ) do |i|\n max = Array.new( i ) {|j| 1 + j}.permutation.to_a.map! {|j| j.join.to_i}.select {|j| j.prime? }.max\n break if max\n end\n \n max\n end",
"title": ""
},
{
"docid": "6373b56832efcf42f892f941b350f8eb",
"score": "0.5488398",
"text": "def paperwork(n, m)\n if n>0&&m>0\n n*m\n else\n 0\n end\nend",
"title": ""
},
{
"docid": "2adf65a483888c0f0c22efeec47c530d",
"score": "0.54845285",
"text": "def problem_76\n return 100.partitions - 1\nend",
"title": ""
},
{
"docid": "0aea56851b554b66660c2ff0d192f445",
"score": "0.54832846",
"text": "def problem5(n)\n\tnum = n * 2\n\twhile not divisible?(num, n)\n\t\tnum += n\n\tend\n\tnum\nend",
"title": ""
},
{
"docid": "caea2b7e3ff1baac8f4248571da18851",
"score": "0.5482701",
"text": "def solution(number)\n(0...number).map{|x| x % 3 == 0 || x % 5 == 0 ? x : 0}.inject{|sum, x| sum + x}\nend",
"title": ""
},
{
"docid": "32727fe20b1b3725bd5e8f7420ad96b7",
"score": "0.5476395",
"text": "def start_game(states,capitals,correct,incorrect)\n50.times do\n question = rand(0..50)\n puts \"what is the Capitol of \" + states[question]\n answer = gets.chomp\n if answer == capitals[question]\n \t puts \"You ROCKSTAR!\"\n correct += 1\n puts \"You have #{correct} correct answer(s) so far - and #{incorrect} incorrect answer(s)\"\n check_finish(states,capitals,correct,incorrect)\n else\n \t puts \"Learn our map... you UNPATRIOT!\"\n incorrect +=1\n puts \"You have #{incorrect} incorrect answer(s) so far - and #{correct} correct answer(s)\"\n check_finish(states,capitals,correct,incorrect)\n end\n end\nend",
"title": ""
},
{
"docid": "d70287e43cc1157f459022ef7d696a24",
"score": "0.5475195",
"text": "def sol inp\n k, ins = inp.split(' ',2)\n k = k.to_i\n ps, pr, pi, pu, pw, pd, pl = ins.split.map(&:to_f)\n\n @ps = ps\n @pr = pr\n @pu = pu\n @pw = pw\n @pd = pd\n @pl = pl\n\n #\n # required_wins = 2\n # # winning 1st set\n # first_set = ps*pi + pr*(1-pi)\n # # winning 2nd set\n # first_set * winning_another_set + (1-first_set)*winning_another_set\n #\n # required_wins.times do |i|\n # count = 0\n # while count <= i\n # wins[i] = win_scene(pi,ps,pr, count)\n # count+=1\n # break if count == i\n # lose_scene(pi,ps,pr, pr,count)\n # end\n # end\n\n # winning second set after winning first + winning second set after winning one\n # wins[0]*win_scene(pi,ps,pr) + (1-wins[0])*lose_scene(pi,ps,pr)\n\n def win_scene(pi,round,required_wins,current_wins)\n return 0 if round >= required_wins\n # puts \"w #{' '*round},#{required_wins},#{current_wins})\"\n sunny = (round == 0) ? pi : (pi+(@pu*@pw))\n sunny = 1.0 if sunny > 1\n sunny = 0.0 if sunny < 0\n chance = sunny*@ps + (1-sunny)*@pr\n binding.pry if chance > 1\n\n if required_wins == current_wins+1\n chance\n else\n # return 0 if round > 100\n return 0 if (10**7*chance).to_i < 1\n wins = win_scene(sunny,round+1,required_wins,current_wins+1)\n # lose = lose_scene(sunny,round+1,required_wins,current_wins+1)\n chance * (wins)#+ (1-chance)*lose\n end\n end\n\n def lose_scene(pi,round,required_wins,current_wins)\n return 0 if round >= required_wins\n # puts \"l #{' '*round},#{required_wins},#{current_wins})\"\n sunny = (round == 0) ? pi : (pi-(@pd*@pl))\n sunny = 1.0 if sunny > 1\n sunny = 0.0 if sunny < 0\n chance = sunny*@ps + (1-sunny)*@pr\n binding.pry if chance > 1\n\n if required_wins == current_wins\n chance\n else\n # return 0 if round > 100\n return 0 if (10**7*chance).to_i < 1\n wins = win_scene(sunny,round+1,required_wins,current_wins+1)\n # lose = lose_scene(sunny,round+1,required_wins,current_wins+1)\n chance * (wins) #+ (1-chance)*lose\n end\n end\n\n # a = win_scene(pi,0,1,0)\n b = win_scene(pi,0,k,0)\n c = lose_scene(pi,0,k,0)\n # c = (k > 1) ? lose_scene(pi,1,k,0) : 0\n\n puts b\n puts c\n b +c\n # wtf?\n # 0.4* win_scene(pi,0,k,0)+ (1-0.6)*lose_scene(pi,0,k,0)\n\n# def smth(pi, ps, pr, setcount=0)\n# arr[1] = arr[0]\n# end\n# # set 2+ ?\n# set2 = ((ps+pu)*pw + ps*(1-pw))*pi\n# (1-set1)*((ps-pd)*pl + ps*(1-pl))\n# if k > 1\n# (k-1).times do\n#\n# end\n# end\nend",
"title": ""
},
{
"docid": "73d1aa4ccc53e037d7f9b2c46c5ca501",
"score": "0.5474095",
"text": "def solution(number)\n sum = 0\n Array(1..number-1).each do |i|\n if i % 3 == 0 || i % 5 == 0\n sum += i\n end\n end\n sum\nend",
"title": ""
},
{
"docid": "de48274b3b7a2f885d3d8d6629ae2bc4",
"score": "0.5470897",
"text": "def problem_76a\n num = 100\n solve = lambda do |a,off,max|\n n = 0\n while a[off] < max && (a.length-off) >= 2 \n a[off] += a.pop\n n += 1\n n += solve.call(a.dup,off+1,a[off]) if a.length - off > 1\n end\n n\n end\n puts 1 + solve.call([1] * num, 0,num-1)\nend",
"title": ""
},
{
"docid": "f5632f734a3b11f0f2ab17d8ebc829da",
"score": "0.54647297",
"text": "def types(typenum, arr)\n case typenum\n when 0\n # Generate random numbers\n num1 = rand(0..9999)\n num2 = rand(0..9999)\n # Decide + or -\n which = rand(0..1)\n case which\n when 0\n # Store problem and answer to array\n @problems[arr] = \"#{num1} + #{num2}\"\n @answers[arr] = num1 + num2\n typenum = typenum.to_s + 'a'\n when 1\n # Store problem and answer to array\n @problems[arr] = \"#{num1} - #{num2}\"\n @answers[arr] = num1 - num2\n typenum = typenum.to_s + 'b'\n end\n when 1\n num1 = rand(0..9999)\n num2 = num1.to_s.reverse.to_i\n # Store problem and answer to array\n @problems[arr] = \"#{num1} - #{num2}\"\n @answers[arr] = num1 - num2\n when 2\n num1 = rand(0..999)\n # Store problem and answer to array\n @problems[arr] = \"#{num1} x 11\"\n @answers[arr] = num1 * 11\n when 3\n # Generate random number\n num1 = rand(0..999)\n # Decide 3, 9, 11\n which = rand(0..2)\n case which\n when 0\n num2 = 3\n when 1\n num2 = 9\n when 2\n num2 = 11\n end\n @problems[arr] = \"#{num1} / #{num2}\"\n @answers[arr] = num1 / num2\n when 4\n # Start with a multiple to start the loop.\n num1 = 5\n # Generate a number between 13-34, no multiple of 5.\n num1 = rand(13..34) until num1 % 5 != 0\n @problems[arr] = \"#{num1}^2\"\n @answers[arr] = num1**2\n when 5\n num1 = rand(4..9)\n @problems[arr] = \"#{num1}^3\"\n @answers[arr] = num1**3\n when 6\n @answers[arr] = rand(0..3000)\n @problems[arr] = RomanNumerals.to_roman(@answers[arr])\n when 7\n @problems[arr] = rand(0..3000)\n @answers[arr] = RomanNumerals.to_roman(@problems[arr])\n when 8\n num1 = rand(11..99)\n num2 = rand(1..3) * 25\n @problems[arr] = \"#{num1} x #{num2}\"\n @answers[arr] = num1 * num2\n when 9\n num1 = rand(10..999)\n num2 = rand(12..19)\n @problems[arr] = \"#{num1} x #{num2}\"\n @answers[arr] = num1 * num2\n when 10\n num1 = rand(1..9999)\n num2 = rand(1..9999)\n num3 = rand(1..9999)\n sign1 = ['+', '-'].sample\n sign2 = ['+', '-'].sample\n @problems[arr] = \"#{num1} #{sign1} #{num2} #{sign2} #{num3}\"\n ans1 = if sign1 == '+'\n num1 + num2\n else\n num1 - num2\n end\n answer = if sign2 == '+'\n ans1 + num3\n else\n ans1 - num3\n end\n @answers[arr] = fivepercent(answer)\n end\n @types[arr] = typenum\n end",
"title": ""
},
{
"docid": "07d2efee1cd697e1e4e68bfe2a83c599",
"score": "0.5462388",
"text": "def compute_best_score(team, pilots, pilot_contests)\n combination = []\n total = 0.0\n total_possible = 0\n puts 'compute_score TBD'\nend",
"title": ""
},
{
"docid": "7d667f110c9bf0d444b3818743e6bcd0",
"score": "0.54579884",
"text": "def solve\n t = IO.read( 'resources/0089_roman.txt' ).split.map do |line|\n n = ProjectEuler::Roman.to_i( line )\n line.length - ProjectEuler::Roman.from_i( n ).length\n end\n\n t.inject( :+ )\n end",
"title": ""
},
{
"docid": "504f64eab9f5e8661a031d18ace7bd76",
"score": "0.5457455",
"text": "def problem_77\n primes = Primes.upto(120)\n\n # num is the value we want and\n # off is the index in primes to use next\n hits = 0\n solve = lambda do |num, off|\n return 1 if num == 0\n return 0 if num == 1\n ret = 0\n p = primes[off]\n ret += 1 if num % p == 0 # Add if a multiple\n ret += solve.call(num,off-1) if off > 0 \n n = num / p\n if n > 0 # Do each multiple\n 1.upto(n) do |i|\n left = num - i*p\n ret += solve.call(left,off-1) if off > 0 && left > 1\n end\n end\n ret\n end\n\n #(2..100).each do |num|\n num = 0\n (2..100).each do |num|\n off = primes.index {|i| i > num } - 1\n hits = solve.call(num,off)\n puts \"#{num} => #{hits}\"\n return num if hits >= 5000\n end\nend",
"title": ""
},
{
"docid": "6f8b5f7d0435a13207d4e20c341f3c79",
"score": "0.54540116",
"text": "def the_interview\n (1..100).each{ |n| puts n % 15 == 0 ? \"fizzbuzz\" : n % 3 == 0 ? \"fizz\" : n % 5 == 0 ? \"buzz\" : n }\n (0..99).reverse_each{|n| puts \"I have #{n} bottles.\"}\nend",
"title": ""
},
{
"docid": "4dfd92db8d7b4ec6c2784ac06dc39036",
"score": "0.5448425",
"text": "def solution(number)\n (1..number-1).select{|x| x%3==0 || x%5 ==0 }.reduce(:+)\nend",
"title": ""
},
{
"docid": "2570bf3939fe20cc041c44355fe77f46",
"score": "0.5448124",
"text": "def input_students\n # Exercise 7 - Ask for both name and cohort and check conditions\n def enter_info(instruction)\n # Do a loop until user inputs correct value\n while true do\n puts instruction\n # Exercise 10 - Use another method to get rid of last character\n input = gets.gsub(\"\\n\", \"\")\n # If input contains numbers (strings default to 0)\n if input.to_i != 0\n puts \"Letters only\"\n next\n end\n # Break loop if user has entered a valid value\n break unless input.empty?\n puts \"No value entered\"\n end\n input\n end\n # Create method for enter_age\n def enter_age(age)\n # Do a loop until user inputs correct value\n while true do\n puts \"Please enter age\"\n age = gets.chomp.to_i\n age < 18 || age > 99 ? \"Not valid\" : break\n end\n age\n end\n\n puts \"Enter student information as prompted\"\n # Create and empty array\n students = []\n # Loop through adding students\n while true do\n # Get the first name\n name = enter_info(\"Please enter name\")\n # Exercise 5 - Add more information\n # Get cohort\n cohort = enter_info(\"Please enter month of cohort you are attending\")\n # Get the age\n age = enter_age(\"Please enter age\")\n # Get the country of birth\n country = enter_info(\"Please enter country of birth\")\n # Add the student hash to the array\n students << {name: name, cohort: cohort, age: age, country: country}\n # Exercise 9 - Use singular or plural when appropiate\n puts \"Now we have #{students.count} #{one_or_more?(students)}\"\n # Prompt user if they want to add more students, otherwise break\n puts \"Continue adding students? y/n (anything other than y will default to n)\"\n break if gets.chomp.downcase != \"y\"\n\n end\n students\nend",
"title": ""
},
{
"docid": "bb0dd5a3d638b383b3c0bf0bd6d8d52c",
"score": "0.5444776",
"text": "def marks(my_answers, correct_answers)\n marks = 0\n wrong = []\n my_answers.each_with_index do |x,i|\n if x == correct_answers[i]\n marks += 1\n else\n wrong << i + 1\n end\n end\n puts \"I scored #{marks} out of 20\"\n puts \"I got these questions wrong:\"\n puts wrong.empty? ? \"None!!\" : wrong.join(\",\") \nend",
"title": ""
},
{
"docid": "5354ca81900f821246b539fe8102c4f3",
"score": "0.5431198",
"text": "def solution(number)\n return (0...number).select{ |x| ((x % 3 == 0) || (x % 5 == 0))}.reduce(:+)\nend",
"title": ""
},
{
"docid": "aad9afdcc766a8481cfb09602968ce19",
"score": "0.5431049",
"text": "def solve\n\t\t# Attempt to find a mismatch in start/end\n\t\t# letters in the maps. This signifies first\n\t\t# and last words of the solution\n\t\tdiff_list = []\n\t\t@start_map.each {|k,v|\n\t\t\tr = @end_map[k]\n\t\t\tdiff = r-v\n\t\t\tputs \"#{k} => #{v} | #{r} diff #{diff}\"\n\t\t\t\n\t\t\t# If values in map don't match, remember this\n\t\t\tif diff != 0\n\t\t\t\tdiff_list << diff\n\t\t\tend\n\t\t}\n\n\t\t# Ensure the matchings satisfy the properties of\n\t\t# and solvable puzzle. If there are \n\t\tputs diff_list\n\t\tif diff_list.size == 0\n\t\t\t# This means there are cycles (multiple\n\t\t\t# choices for the first word).\n\t\telsif diff_list.size == 2\n\t\t\t# Ensure there is exactly one starting\n\t\t\t# word and exactly one ending word\n\t\t\treturn [] if !diff_list.include?( 1 )\n\t\t\treturn [] if !diff_list.include?( -1 )\n\t\telse\n\t\t\t# This signifies an unsolvable puzzle\n\t\t\tputs \"Not Solvable\"\n\t\t\treturn []\n\t\tend\n\n\t\t# The characteristics of this word list look\n\t\t# good so far. Let's now try to enumerate the\n\t\t# solution array\n\t\treturn enumerate_solution\n end",
"title": ""
},
{
"docid": "8c0709355606ef895ed7de126d5abf54",
"score": "0.54296297",
"text": "def my_solution\n res = \"\"\n choices.each do |k, v|\n res << \" * #{k}\\n\" if v\n end\n return \"(no correct answer)\" if res.blank?\n res\n end",
"title": ""
},
{
"docid": "4042327b3d64d65bf202b53f5d1e2be6",
"score": "0.5424979",
"text": "def question_and_answer(with_error, zero_or_one, mistery_num)\n message = \"Do you see your number here: (y)(n). To exit the game enter the letter e.\".colorize(:blue)\n if with_error == true\n puts \"\\nIncorrect Answer. \" + message\n else \n puts \"\\n#{message}\"\n end \n answer = gets.chomp.upcase\n case answer\n when \"Y\", \"YES\"\n if zero_or_one % 2 == 0\n mistery_num +=\"0\"\n else\n mistery_num +=\"1\"\n end\n return mistery_num\n when \"N\", \"NO\"\n if zero_or_one % 2 == 0\n mistery_num +=\"1\"\n else\n mistery_num +=\"0\"\n end\n return mistery_num\n when \"E\"\n return \"break\"\n else\n question_and_answer(true, zero_or_one, mistery_num)\n end \nend",
"title": ""
},
{
"docid": "783321380f03acf81fb5b740a2da832f",
"score": "0.5424665",
"text": "def get_puzzle_number\n\tputs \"What puzzle(s) would you like to solve today?\"\n\tputs \"---------------------------------------------\"\n\tputs \"Please enter a number from 1-15\"\n\tinput = gets.chomp\n\ttry_again_check(input)\nend",
"title": ""
},
{
"docid": "3f65357579222bc067960f7a8ba15d6a",
"score": "0.5421518",
"text": "def problem_106\n a = [1,2,3,4]\n a = [1,2,3,4,5,6,7]\n a = [1,2,3,4,5,6,7,8,9,10,11,12] \n \n num = 0\n seen = {}\n # Don't do length of 1, they are ordered\n # Because they are size ordered, and 2 smalls are bigger than a large\n 2.upto(a.length/2) do |n|\n puts \"n = #{n}\"\n a.combination(n) do |set_a|\n b = a - set_a\n break if b.length < n\n b.combination(n) do |set_b|\n key = [set_a,set_b].sort\n next if seen[key]\n seen[key] = true\n index = 0\n state = 0\n 0.upto(set_a.length-1) do |i|\n break unless set_b[i] && set_a[i]\n if set_a[i] < set_b[i]\n state -= 1\n else\n state += 1\n end\n end\n\n# print \"#{set_a.inspect} #{set_b.inspect} #{state}\"\n if state.abs <= (set_a.length - 2) ||\n (state < 0 && set_a.last > set_b.last) ||\n (state > 0 && set_a.first < set_b.first)\n# puts \" good\"\n num += 1\n else\n# puts \"\"\n end\n end\n end\n end\n num\nend",
"title": ""
},
{
"docid": "34861cbd945594b8dfe270a5e22c7471",
"score": "0.5420959",
"text": "def play\n puts \"I have generated a beginner sequence with four elements made up of: (r)ed,\n (g)reen, (b)lue, and (y)ellow. Use (q)uit at any time to end the game.\n What's your guess?\"\n mastermind = Game.new\n mastermind.game_solution\n amount_of_guesses = 0\n guess = gets.chomp\n user_guess = []\n user_guess << guess.chars\n amount_of_guesses += 1\n mastermind.check_for_correct_letters(user_guess)\n mastermind.check_for_correct_indexes(user_guess, mastermind.solution)\n until guess == \"q\"\n if guess == \"c\"\n puts \"The solution is #{mastermind.solution}\"\n break\n elsif guess.length > 4\n puts \"Your guess was too long.\"\n elsif guess.length < 4\n puts \"Your guess was too short.\"\n elsif guess != mastermind.solution\n puts \"You had #{mastermind.correct_letters} correct colors with #{mastermind.correct_indexes}\n in the correct position.\"\n break\n elsif guess == mastermind.solution.to_s\n \"You won! You guessed #{guess}. You had #{mastermind.correct_letters} correct\n colors in #{mastermind.correct_indexes} correct positions.\n You guessed #{amount_of_guesses.to_s} times.\"\n break\n else\n puts \"Goodbye, quitter.\"\n end\n end\nend",
"title": ""
},
{
"docid": "b782b164b3fc4ae481db70294bc20cef",
"score": "0.54205227",
"text": "def choose_problems(competition)\n\t\tusers=competition.users\n\t\tcase competition.target\n\t\twhen 1\n\t\t\tproblems=Problem.all.where(target: 1)\n\t\twhen 2\n\t\t\tproblems=Problem.all.where(target: 2)\n\t\twhen 3\n\t\t\tproblems=Problem.all.where(target: 3)\n\t\telse\n\t\t\tproblems=Problem.all\n\t\tend\t\n\t\tchecked_problems=problems.where(checked: true) #<-- add checked\n\t\tunseen_problems=checked_problems\n\t\tusers.each do |u|\n\t\t\tunseen_problems=unseen_problems.select{ |p| !p.viewers.include?(u)}\n\t\tend \n\t\tproblems_length=0\n\t\tproblem=nil\n\t\twhile problems_length < competition.length do\n\t\t\tmax_length=competition.length-problems_length\n\t\t\tproblem=nil\n\t\t\tproblem=unseen_problems.select{ |p| p.length <= max_length && !competition.problems.include?(p)}.sample #balta6tina\n\t\t\tif problem.present?\n\t\t\t\tproblems_length += problem.length\n\t\t\t\tcompetition.competition_problems.create!(problem_id: problem.id)\n\t\t\telse\n\t\t\t\tproblem=checked_problems.select{ |p| p.length <= max_length && !competition.problems.include?(p)}.sample\n\t\t\t\tproblems_length += problem.length\n\t\t\t\tcompetition.competition_problems.create!(problem_id: problem.id)\n\t\t\tend\n\t\tend\t\n end",
"title": ""
},
{
"docid": "b63d22c33e8d08d73414f973535fa8da",
"score": "0.54166687",
"text": "def solve\n return ((1..40).inject(:*) / ((1..20).inject(:*) ** 2))\nend",
"title": ""
},
{
"docid": "b95476c44a1a5a46f4bd93a113da4d8a",
"score": "0.5416404",
"text": "def problem7\n\tPrime.take(10001).last\nend",
"title": ""
},
{
"docid": "8163a5f2a6b463ae407ca5a33cc8e515",
"score": "0.5406344",
"text": "def paperwork(n, m)\n if n < 0 || m < 0\n return 0\n else\n n*m\n end\nend",
"title": ""
},
{
"docid": "f712d49ec6c615538b2e2aa846391fda",
"score": "0.5401207",
"text": "def challenge; end",
"title": ""
},
{
"docid": "f1a81d402b2e84da8cdc3858abf341bb",
"score": "0.53995764",
"text": "def main()\n rules = { # a/bc/bcd/bcdd/bcda/bcdbc/bcbc/cbc/aa/\n 'abcd' => [''],\n 'a' => ['bc'],\n 'bc' => ['bcd', 'c'],\n 'd' => ['a', 'db'],\n 'db' => ['b'],\n 'cbc' => ['ab'],\n '...' => ['a']\n }\n rows= [\n 'bd',\n ]\n moves = 10\n width = 7\n solver = Solver.new(rules, moves, width)\n game_data = GameState.new(rules, rows[0], width)\n solution = solver.find_solution(game_data)\n\n if !solution.nil?\n solution.each do |move|\n puts(move.to_s)\n end\n else\n puts 'No solution found'\n end\nend",
"title": ""
},
{
"docid": "038a7fca9c25b1c23843fa0d56e5416d",
"score": "0.5399171",
"text": "def knowTheGameTrick\n\tputs \"Do you wanna know the trick of this game?\"\n\tputs \"If YES then type 1 and if NO then type 2.\"\n\tuserAnswer = gets\n\n\tif userAnswer.to_i == 1\n\t\tputs \"This game is designed according to halving technique (can also be called as Binary Search) where you are given only certain chances.\"\n\t\tputs \"Since computer says you whether the guessed number was high or low, you have to always guess the middle number and go on guessing the middle number everytime the range changes.\"\n\telse\n\t\tputs \"I guess, you probably knew the trick of the game. Thanks for playing. Enjoy!\"\n\tend\n\nend",
"title": ""
},
{
"docid": "6cc6e9791438c0f040c32f05373a0b97",
"score": "0.53932506",
"text": "def has_solution(n)\n# Store input in variable N\n$N = n\n\n#Declare and initialize variables to find the maximum number of times 6, 9 and 20 divide into N\n$A_1 = $N/$x\n$A_2 = $N/$y\n$A_3 = $N/$z\n\n#Declare and initialize arrays to store potential combinations, where A is number of 6 packs, B number of 9 packs and C number of 20 packs\n@A = (0..$A_1).to_a\n@B = (0..$A_2).to_a\n@C = (0..$A_3).to_a\n\n#Declare function to calculate different combinations of A, B and C\ndef test(i,j,k)\nreturn @A[i]*$x + @B[j]*$y + @C[k]*$z\nend\n\n#Loop to exhaustively test combinations of A, B and C, with values ranging between 1 and the maximum number of times 6, 9 and 20 divide into N\nfor i in (0..$A_1)\n for j in (0..$A_2)\n for k in (0..$A_3)\n #Use declared function test to check each combination of i,j and k, and if it is equal to N, print out values of i, j and k\n if test(i,j,k) == $N\n return true\n end\n end\n end\nend\n\nend",
"title": ""
},
{
"docid": "3d26846f68b364232236c89b898d4221",
"score": "0.53848267",
"text": "def solution_three(coaches, students)\n remaining_students = 0\n\n coaches.map! do |capacity_per_coach|\n students_per_coach = capacity_per_coach * students * 0.01\n remaining_students += (students_per_coach - students_per_coach.floor)\n students_per_coach.floor\n end\n\n solution_two(coaches, remaining_students.to_i)\n end",
"title": ""
},
{
"docid": "d0abbdf555ddbab82d06ec56468b08a1",
"score": "0.53846365",
"text": "def problem_three\n find_factors(600_851_475_143).max\n end",
"title": ""
},
{
"docid": "29705ec32b7a6650c74d3f1553460b9e",
"score": "0.53788334",
"text": "def temp_test(sudoku_datas)\n sudoku_cells = prepare_sudoku_cells(sudoku_datas)\n # display_sudoku(sudoku_cells, \"Sudoku to solve\")\n # build the potential list of values for each cell\n build_potential_value_list(sudoku_cells)\n update_cells(sudoku_cells) # update the value of each cell\n counter = 0\n # continue to the try to solve\n # if the counter goes beyond a million\n # it's probably a bad sudoku\n \n display_sudoku(sudoku_cells, \"Test\")\n shed_potential_value_list(sudoku_cells)\n \n update_cells(sudoku_cells)\n display_sudoku(sudoku_cells, \"Test\")\n double_whammer(sudoku_cells)\n update_cells(sudoku_cells)\n display_sudoku(sudoku_cells, \"Test\")\n\n update_cells(sudoku_cells)\n display_sudoku(sudoku_cells, \"Test\")\n double_whammer(sudoku_cells)\n update_cells(sudoku_cells)\n display_sudoku(sudoku_cells, \"Test\")\n\n update_cells(sudoku_cells)\n display_sudoku(sudoku_cells, \"Test\")\n double_whammer(sudoku_cells)\n update_cells(sudoku_cells)\n display_sudoku(sudoku_cells, \"Test\")\n\n update_cells(sudoku_cells)\n display_sudoku(sudoku_cells, \"Test\")\n double_whammer(sudoku_cells)\n update_cells(sudoku_cells)\n display_sudoku(sudoku_cells, \"Test\")\n\n update_cells(sudoku_cells)\n display_sudoku(sudoku_cells, \"Test\")\n double_whammer(sudoku_cells)\n update_cells(sudoku_cells)\n display_sudoku(sudoku_cells, \"Test\")\n\n update_cells(sudoku_cells)\n display_sudoku(sudoku_cells, \"Test\")\n double_whammer(sudoku_cells)\n update_cells(sudoku_cells)\n display_sudoku(sudoku_cells, \"Test\")\n\n update_cells(sudoku_cells)\n display_sudoku(sudoku_cells, \"Test\")\n double_whammer(sudoku_cells)\n update_cells(sudoku_cells)\n display_sudoku(sudoku_cells, \"Test\")\n\n update_cells(sudoku_cells)\n display_sudoku(sudoku_cells, \"Test\")\n double_whammer(sudoku_cells)\n update_cells(sudoku_cells)\n display_sudoku(sudoku_cells, \"Test\")\n\n update_cells(sudoku_cells)\n display_sudoku(sudoku_cells, \"Test\")\n double_whammer(sudoku_cells)\n update_cells(sudoku_cells)\n display_sudoku(sudoku_cells, \"Test\")\n\n update_cells(sudoku_cells)\n display_sudoku(sudoku_cells, \"Test\")\n double_whammer(sudoku_cells)\n update_cells(sudoku_cells)\n display_sudoku(sudoku_cells, \"Test\")\n\n update_cells(sudoku_cells)\n display_sudoku(sudoku_cells, \"Test\")\n double_whammer(sudoku_cells)\n update_cells(sudoku_cells)\n display_sudoku(sudoku_cells, \"Test\")\n\n update_cells(sudoku_cells)\n display_sudoku(sudoku_cells, \"Test\")\n double_whammer(sudoku_cells)\n update_cells(sudoku_cells)\n display_sudoku(sudoku_cells, \"Test\")\n \nend",
"title": ""
},
{
"docid": "c21f053d008bcef9c8e8e7a250cbfed8",
"score": "0.53785455",
"text": "def explain_game\n\t\tputs \"In the Secret Number Game, you guess a number between 1 and 10 and, if you pick the right number, you win!\"\n\t\tputs \"Good luck #{@player}!\"\n\tend",
"title": ""
},
{
"docid": "75c8e6dee033837cc51ad6ba85fcb981",
"score": "0.5376779",
"text": "def last_done_exercise_of_greater_difficulty\n i = self.user_sequence.size() - 1\n while(!self.user_sequence[i][2]) do\n i = i - 1\n end\n return self.user_sequence[i][0]\n end",
"title": ""
},
{
"docid": "ac23323bd2605ff0b26f3932107e4987",
"score": "0.537069",
"text": "def master_mind(solution, guess)\n hits = hit(solution, guess)\n pseudo_hits = psuedo_hit(solution, guess)\n \"hits: #{hits}\\n pseudo hits: #{pseudo_hits}\"\nend",
"title": ""
},
{
"docid": "9e612e3f77446cf5ca53617cfc02e609",
"score": "0.536127",
"text": "def test_exercise_1128\n verify_method :exercise_1128,\n :with => [{param: [0, 0, 1, 2, 3, 3], expect: [0, 1, 2, 3]},\n {param: [0, 1, 2, 3], expect: [0, 1, 2, 3]},\n {param: [0, 0], expect: [0]},\n {param: [0], expect: [0]}]\n end",
"title": ""
},
{
"docid": "8138ef113ebaeae48e7bb22aa7f3a2bb",
"score": "0.53607315",
"text": "def puzzle(sudoku, difficulty=5)\n sudoku.map do\n |number|\n rand(difficulty) == 1 ? 0 : number\n end\nend",
"title": ""
}
] |
8caa4bd6a33f826e9e793501b213617d | PACKAGING ============================================================ Load the gemspec using the same limitations as github | [
{
"docid": "a943c95dab1eefe489366cdb56b7f9f6",
"score": "0.65290236",
"text": "def spec\r\n @spec ||=\r\n begin\r\n require 'rubygems/specification'\r\n data = File.read('ruby-batch.gemspec')\r\n spec = nil\r\n Thread.new { spec = eval(\"$SAFE = 3\\n#{data}\") }.join\r\n spec\r\n end\r\nend",
"title": ""
}
] | [
{
"docid": "0b9906f29743ae580ad7150a3179cc01",
"score": "0.7705445",
"text": "def gemspec; end",
"title": ""
},
{
"docid": "0b9906f29743ae580ad7150a3179cc01",
"score": "0.7705445",
"text": "def gemspec; end",
"title": ""
},
{
"docid": "0b9906f29743ae580ad7150a3179cc01",
"score": "0.7705445",
"text": "def gemspec; end",
"title": ""
},
{
"docid": "0b9906f29743ae580ad7150a3179cc01",
"score": "0.7705445",
"text": "def gemspec; end",
"title": ""
},
{
"docid": "0b9906f29743ae580ad7150a3179cc01",
"score": "0.7705445",
"text": "def gemspec; end",
"title": ""
},
{
"docid": "0b9906f29743ae580ad7150a3179cc01",
"score": "0.7705445",
"text": "def gemspec; end",
"title": ""
},
{
"docid": "0b9906f29743ae580ad7150a3179cc01",
"score": "0.7705445",
"text": "def gemspec; end",
"title": ""
},
{
"docid": "0b9906f29743ae580ad7150a3179cc01",
"score": "0.7705445",
"text": "def gemspec; end",
"title": ""
},
{
"docid": "a96b62dee20ebdffc90788b54ebe34fd",
"score": "0.7397231",
"text": "def gemspec?; end",
"title": ""
},
{
"docid": "d55dbd1fc6687351797278178908cc69",
"score": "0.734177",
"text": "def gemspecs; end",
"title": ""
},
{
"docid": "1f188442c15301a14ba6427c6e3ac1da",
"score": "0.72694397",
"text": "def load_gemspec\n\n text = File.read(gemspec_file)\n if text =~ /\\A---/ \n require 'yaml'\n spec = YAML.load(text)\n else\n #spec = eval(text) #, gemspec_file)\n spec = ::Gem::Specification.load(gemspec_file)\n end\n\n data = {}\n data[:name] = spec.name\n data[:version] = spec.version.to_s\n data[:date] = spec.date\n\n data[:paths] = {\n 'load' => spec.require_paths \n }\n\n data[:requirements] = []\n\n spec.runtime_dependencies.each do |dep|\n req = { \n 'name' => dep.name,\n 'version' => dep.requirement.to_s\n }\n data[:requirements] << req\n end\n\n spec.development_dependencies.each do |dep|\n req = { \n 'name' => dep.name,\n 'version' => dep.requirement.to_s,\n 'development' => true\n }\n data[:requirements] << req\n end\n\n update(data)\n end",
"title": ""
},
{
"docid": "7d87ac75414ae20b8edcdb0e1b1b1b3f",
"score": "0.7251272",
"text": "def gemspec(platform = 'ruby')\n Gem::Specification.load(File.expand_path('../../redcloth.gemspec', __FILE__))\nend",
"title": ""
},
{
"docid": "9a6ff0579825eff081dec799bf8cccdf",
"score": "0.71162903",
"text": "def load_gemspec!(gemspec=nil)\n case gemspec\n when ::Gem::Specification\n spec = gemspec\n else\n file = Dir[root + \"{*,}.gemspec\"].first\n return unless file\n text = File.read(file)\n if text =~ /\\A---/\n spec = ::Gem::Specification.from_yaml(text)\n else\n spec = ::Gem::Specification.load(file)\n end\n end\n\n dotruby.import_gemspec(spec)\n end",
"title": ""
},
{
"docid": "1a6fc7a086c243ffe5fb897fa938c469",
"score": "0.7029373",
"text": "def to_gemspec(options={})\n require_rubygems\n\n if metadata.resources\n homepage = metadata.resources.homepage\n else\n homepage = nil\n end\n\n if homepage && md = /(\\w+).rubyforge.org/.match(homepage)\n rubyforge_project = md[1]\n else\n # b/c it has to be something according to Eric Hodel.\n rubyforge_project = metadata.name.to_s\n end\n\n #TODO: may be able to get this from project method\n if news = Dir[root + 'NEWS{,.txt}'].first\n install_message = File.read(news)\n end\n\n ::Gem::Specification.new do |spec|\n spec.name = self.name.to_s\n spec.version = self.version.to_s\n spec.require_paths = self.loadpath.to_a\n\n spec.summary = metadata.summary.to_s\n spec.description = metadata.description.to_s\n spec.authors = metadata.authors.to_a\n spec.email = metadata.email.to_s\n spec.licenses = metadata.licenses.to_a\n\n spec.homepage = metadata.homepage.to_s\n\n # -- platform --\n\n # TODO: how to handle multiple platforms?\n spec.platform = options[:platform] #|| verfile.platform #'ruby' ???\n #if metadata.platform != 'ruby'\n # spec.require_paths.concat(spec.require_paths.collect{ |d| File.join(d, platform) })\n #end\n\n # -- rubyforge project --\n\n spec.rubyforge_project = rubyforge_project\n\n # -- compiled extensions --\n\n spec.extensions = options[:extensions] || self.extensions\n\n # -- dependencies --\n\n case options[:gemfile]\n #when String\n # gemfile = root.glob(options[:gemfile]).first # TODO: Alternate gemfile\n when nil, true\n gemfile = root.glob('Gemfile').first\n else\n gemfile = nil\n end\n\n if gemfile\n require 'bundler'\n spec.add_bundler_dependencies\n else\n metadata.requirements.each do |dep|\n if dep.development?\n spec.add_development_dependency( *[dep.name, dep.constraint].compact )\n else\n next if dep.optional?\n spec.add_runtime_dependency( *[dep.name, dep.constraint].compact )\n end\n end\n end\n\n # TODO: considerations?\n #spec.requirements = options[:requirements] || package.consider\n\n # -- executables --\n\n # TODO: bin/ is a POM convention, is there are reason to do otherwise?\n spec.bindir = options[:bindir] || \"bin\"\n spec.executables = options[:executables] || self.executables\n\n # -- rdocs (argh!) --\n\n readme = root.glob_relative('README{,.*}', File::FNM_CASEFOLD).first\n extra = options[:extra_rdoc_files] || []\n\n rdocfiles = []\n rdocfiles << readme.to_s if readme\n rdocfiles.concat(extra)\n rdocfiles.uniq!\n\n rdoc_options = [] #['--inline-source']\n rdoc_options.concat [\"--title\", \"#{metadata.title} API\"] #if metadata.title\n rdoc_options.concat [\"--main\", readme.to_s] if readme\n\n spec.extra_rdoc_files = rdocfiles\n spec.rdoc_options = rdoc_options\n\n # -- distributed files --\n\n if manifest.exist?\n filelist = manifest.select{ |f| File.file?(f) }\n spec.files = filelist\n else\n spec.files = root.glob_relative(\"**/*\").map{ |f| f.to_s } # metadata.distribute ?\n end\n\n # DEPRECATED: -- test files --\n #spec.test_files = manifest.select do |f|\n # File.basename(f) =~ /test\\// && File.extname(f) == '.rb'\n #end\n\n if install_message\n spec.post_install_message = install_message\n end\n end\n\n end",
"title": ""
},
{
"docid": "74805a6eba1afb0c58341bc782b5d9d1",
"score": "0.7025643",
"text": "def load_gemspec!\n @gemspec = eval(File.read(@gemspec_file))\n end",
"title": ""
},
{
"docid": "f6f2a07de3c3cc9c39628557d70fe1ac",
"score": "0.6987636",
"text": "def gemspec\n @gemspec ||= (\n require 'rubygems'\n ::Gem::Specification.load(gemspec_file)\n )\n end",
"title": ""
},
{
"docid": "97c05cffacfa3d66d7730b6069312db9",
"score": "0.6925607",
"text": "def valid_gemspec?; end",
"title": ""
},
{
"docid": "658eb5b04abcb3f37804a31b289c8f08",
"score": "0.68939096",
"text": "def gemspec_building_block; end",
"title": ""
},
{
"docid": "190ae8507215cbada832f0d6e9657183",
"score": "0.6889449",
"text": "def gemspec_helper; end",
"title": ""
},
{
"docid": "190ae8507215cbada832f0d6e9657183",
"score": "0.6889449",
"text": "def gemspec_helper; end",
"title": ""
},
{
"docid": "190ae8507215cbada832f0d6e9657183",
"score": "0.6889449",
"text": "def gemspec_helper; end",
"title": ""
},
{
"docid": "190ae8507215cbada832f0d6e9657183",
"score": "0.6889449",
"text": "def gemspec_helper; end",
"title": ""
},
{
"docid": "190ae8507215cbada832f0d6e9657183",
"score": "0.6889449",
"text": "def gemspec_helper; end",
"title": ""
},
{
"docid": "190ae8507215cbada832f0d6e9657183",
"score": "0.6889449",
"text": "def gemspec_helper; end",
"title": ""
},
{
"docid": "7a952bd0de49e5415100004fd303fefc",
"score": "0.68061113",
"text": "def gemspec\n @gemspec ||= begin\n raise Error.new(\"Unable to automatically determine gem name from specs in #{base}. Please set the gem name via #{self.class.name}.install_tasks(gem_name: 'name')\") unless gem_name\n g = Bundler.load_gemspec(File.join(base, gem_name+'.gemspec'))\n # This is returning the path it would be in if installed normally,\n # override so we get the local path. Also for reasons that are entirely\n # beyond me, #tap makes Gem::Specification flip out so do it old-school.\n g.full_gem_path = base\n g\n end\n end",
"title": ""
},
{
"docid": "200e13553ce00059bafee5cc53b8a392",
"score": "0.6753215",
"text": "def validate_gemspec; end",
"title": ""
},
{
"docid": "831f489df63507e5585f0ec88d1b7908",
"score": "0.6748303",
"text": "def fetch_spec(spec)\n spec = spec - [nil, 'ruby', '']\n spec_file_name = \"#{spec.join '-'}.gemspec.rz\"\n\n uri = URI.parse(\"#{@remote_uri}#{Gem::MARSHAL_SPEC_DIR}#{spec_file_name}\")\n\n spec_rz = (uri.scheme == \"file\") ? Gem.read_binary(uri.path) : fetch(uri)\n Marshal.load Gem.inflate(spec_rz)\n end",
"title": ""
},
{
"docid": "8cf52fbffffc934a65467ae7a22c3425",
"score": "0.67321193",
"text": "def gemspec(options = {})\n name = options.delete(:name) || '{,*}'\n path = options.delete(:path) || '.'\n development_group = options.delete(:development_group) || :development\n\n spec = find_gemspec name, path\n\n groups = gem_group spec.name, {}\n\n self_dep = Gem::Dependency.new spec.name, spec.version\n\n add_dependencies groups, [self_dep]\n add_dependencies groups, spec.runtime_dependencies\n\n @dependencies[spec.name] = Gem::Requirement.source_set\n\n spec.dependencies.each do |dep|\n @dependencies[dep.name] = dep.requirement\n end\n\n groups << development_group\n\n add_dependencies groups, spec.development_dependencies\n\n @vendor_set.add_vendor_gem spec.name, path\n gem_requires spec.name, options\n end",
"title": ""
},
{
"docid": "6d006aa644bf18a099e61b38fe517555",
"score": "0.6705268",
"text": "def import_gemspec(gemspec=nil)\n gemspec = gemspec || self.gemspec\n\n profile.name = gemspec.name\n profile.version = gemspec.version.to_s\n profile.path = gemspec.require_paths\n #metadata.engines = gemspec.platform\n\n profile.title = gemspec.name.capitalize\n profile.summary = gemspec.summary\n profile.description = gemspec.description\n profile.authors = gemspec.authors\n profile.contact = gemspec.email\n\n profile.resources.homepage = gemspec.homepage\n\n #metadata.extensions = gemspec.extensions\n\n gemspec.dependencies.each do |d|\n next unless d.type == :runtime\n requires << \"#{d.name} #{d.version_requirements}\"\n end\n end",
"title": ""
},
{
"docid": "28a1b4a1cb0d1db1115718b75db463ab",
"score": "0.6703934",
"text": "def gemspec( * )\n\t\traise \"Circular dependency: can't depend on the gemspec to build itself\"\n\tend",
"title": ""
},
{
"docid": "32ac25a306597f6880874a2f088a8bd8",
"score": "0.667407",
"text": "def gem_spec\n require 'rubygems/specification'\n spec_fields = %w(\n name author email has_rdoc rubyforge_project summary\n version description required_ruby_version homepage\n )\n Gem::Specification.new do | spec |\n for field in spec_fields\n value = self.send( field )\n spec.send( \"#{field}=\", value )\n end\n \n spec.files = package.files.to_a + %w( Rakefile Manifest.txt )\n spec.test_files = unit_tests.to_a + functional_tests.to_a\n \n spec.executables.push( *executables )\n spec.requirements.push( *requirements )\n end\n end",
"title": ""
},
{
"docid": "75e0ea04a664868cb799e69401ac1b5b",
"score": "0.6669371",
"text": "def load_minimal_gems\r\n end",
"title": ""
},
{
"docid": "df28a86753d62479fd0637ce7b62b533",
"score": "0.6618799",
"text": "def gemspec=(_arg0); end",
"title": ""
},
{
"docid": "df28a86753d62479fd0637ce7b62b533",
"score": "0.6618799",
"text": "def gemspec=(_arg0); end",
"title": ""
},
{
"docid": "df28a86753d62479fd0637ce7b62b533",
"score": "0.6618799",
"text": "def gemspec=(_arg0); end",
"title": ""
},
{
"docid": "df28a86753d62479fd0637ce7b62b533",
"score": "0.6618799",
"text": "def gemspec=(_arg0); end",
"title": ""
},
{
"docid": "df28a86753d62479fd0637ce7b62b533",
"score": "0.6618799",
"text": "def gemspec=(_arg0); end",
"title": ""
},
{
"docid": "df28a86753d62479fd0637ce7b62b533",
"score": "0.6618799",
"text": "def gemspec=(_arg0); end",
"title": ""
},
{
"docid": "df28a86753d62479fd0637ce7b62b533",
"score": "0.6618799",
"text": "def gemspec=(_arg0); end",
"title": ""
},
{
"docid": "688ef5f53f3f4eb898ace63af006d1d3",
"score": "0.6575319",
"text": "def load_spec name\n cache\n\n gemspec_reference = \"#{@reference}:#{name}.gemspec\"\n\n Dir.chdir repo_cache_dir do\n source = Gem::Util.popen @git, 'show', gemspec_reference\n\n source.force_encoding Encoding::UTF_8 if Object.const_defined? :Encoding\n source.untaint\n\n begin\n spec = eval source, binding, gemspec_reference\n\n return spec if Gem::Specification === spec\n\n warn \"git gem specification for #{@repository} #{gemspec_reference} is not a Gem::Specification (#{spec.class} instead).\"\n rescue SignalException, SystemExit\n raise\n rescue SyntaxError, Exception\n warn \"invalid git gem specification for #{@repository} #{gemspec_reference}\"\n end\n end\n end",
"title": ""
},
{
"docid": "fe1f2b2de5199f0647a0d66e32392628",
"score": "0.65632755",
"text": "def main\n last_good_root = from_file($cache_dir + '/root.txt') ||\n from_file('config/root.txt') ||\n raise(\"Can't find root.txt\")\n\n repository = Gem::TUF::Repository.new(\n root: JSON.parse(last_good_root),\n bucket: FileCachingBucket.new(HttpBucket.new($host))\n )\n\n gem_name = ARGV.shift\n\n specs = repository.target('latest_specs.4.8.gz')\n raise \"could not find latest_specs.4.8.gz\" unless specs\n specs = unmarshal_gz specs\n gem = specs.detect {|x| x[0] == gem_name } || raise(\"Can't find gem #{gem}\")\n\n gem_with_version = \"#{gem[0]}-#{gem[1]}\"\n gem_path = \"gems/#{gem_with_version}.gem\"\n gemspec_path = \"quick/Marshal.4.8/#{gem_with_version}.gemspec.rz\"\n\n repository.target(gemspec_path)\n repository.target(gem_path)\n\n puts \"Downloaded #{gem_path} and #{gemspec_path}\"\nend",
"title": ""
},
{
"docid": "10c6275ad49ecb5fe85f8160e5451b7c",
"score": "0.6525629",
"text": "def gem_spec\n Gem::Specification.new do |s|\n s.name = package_name\n s.version = version\n s.platform = Gem::Platform::RUBY\n s.summary = summary\n s.description = description || summary\n s.author = author_name\n s.email = author_email\n s.homepage = project_url\n s.require_path = lib_dir\n s.files = package_files\n s.test_files = tests\n s.bindir = bin_dir\n s.executables = programs.map{|p| File.basename(p)}\n s.extensions = FileList['ext/**/extconf.rb']\n s.has_rdoc = true\n s.extra_rdoc_files = rdoc_files\n s.rdoc_options.concat(rdoc_options)\n s.test_files = tests\n s.rubyforge_project = rubyforge_project\n dependencies.each { |args| s.add_dependency(*args) }\n @package_configurator.call(s) if @package_configurator\n end\n end",
"title": ""
},
{
"docid": "f1d04dd6a6fbc9bb01c4e238801ac44a",
"score": "0.6462396",
"text": "def platform_gemspec\n gemspecs.fetch(platform) { This.ruby_gemspec }\n end",
"title": ""
},
{
"docid": "dc19152144b72d3874799618e3cce4e8",
"score": "0.6457967",
"text": "def gemspec_file\n project_path( \"#{ name }.gemspec\" )\n end",
"title": ""
},
{
"docid": "44ea66d13329944ce478ed6e8f045813",
"score": "0.6440254",
"text": "def load_gemspec(io)\n Gem::Specification.from_yaml io\n rescue Gem::Exception\n nil\n end",
"title": ""
},
{
"docid": "056af17e5152ae357ae025e78e9b6a8f",
"score": "0.6379828",
"text": "def load_gemspec_fallback (spec_file_location)\n gemspec_add_dep_lines = []\n new_gemspec = nil\n begin\n File.readlines(spec_file_location).each do |line|\n if (line.include?(\"add_dependency\") || line.include?(\"add_runtime_dependency\")) then\n gemspec_add_dep_lines << line\n end\n end\n\n # construct a gemspec file\n if !gemspec_add_dep_lines.empty?\n new_gemspec = \"Gem::Specification.new do |s|\\n s.name = %q{#{spec_file_location}}\\n#{gemspec_add_dep_lines.join(\"\\n\")} \\nend\"\n full_eval_gemspec = eval_gemspec(new_gemspec, spec_file_location)\n return full_eval_gemspec\n end\n rescue Exception => ex\n warn \"Gem string parse fallback failed. #{ex}. Srclib will now skip this gemspec file\"\n end\n\n nil\n end",
"title": ""
},
{
"docid": "fa9109702091fa45f3de51da550eb3e9",
"score": "0.6378862",
"text": "def util_read_spec(filename)\n unless Gem::VERSION >= \"2.0.0\"\n io = File.open(filename, \"rb\")\n Gem::Package.open(io, \"r\") { |x| x.metadata }\n else\n Gem::Package.new(filename).spec\n end\n end",
"title": ""
},
{
"docid": "fa9109702091fa45f3de51da550eb3e9",
"score": "0.6378862",
"text": "def util_read_spec(filename)\n unless Gem::VERSION >= \"2.0.0\"\n io = File.open(filename, \"rb\")\n Gem::Package.open(io, \"r\") { |x| x.metadata }\n else\n Gem::Package.new(filename).spec\n end\n end",
"title": ""
},
{
"docid": "4746ba6c77dd02431b4b6ff960b2bfbb",
"score": "0.6373208",
"text": "def gemspec(path)\n installed_gemspec(path) || local_gemspec(path)\n end",
"title": ""
},
{
"docid": "7a15aea0233e94db57465006fb8820dd",
"score": "0.6366571",
"text": "def require_gems; end",
"title": ""
},
{
"docid": "4627fa085cdc6a1cd78aa04d270f9799",
"score": "0.63600075",
"text": "def with_each_gemspec\n Dir[\"**/*.gemspec\"].each do |file|\n yield(file, Gem::Specification.load(file)) if block_given?\n end\nend",
"title": ""
},
{
"docid": "2cd5b7c1690e4eafb6ca99813f0d89d7",
"score": "0.6350237",
"text": "def write_gemspec; end",
"title": ""
},
{
"docid": "757d531bd1cc5aceb141399ab7da2b38",
"score": "0.62708944",
"text": "def build_gem; end",
"title": ""
},
{
"docid": "53e7703149a3c520ddd238316f37cba1",
"score": "0.6260957",
"text": "def manifest_task\n # Load all the gem's files using \"git ls-files\"\n repository_files = `#{git} ls-files`.split(\"\\n\")\n test_files = Dir[test_pattern] + Dir[spec_pattern]\n\n update_gemspec(:files, repository_files)\n update_gemspec(:test_files, repository_files & test_files)\n end",
"title": ""
},
{
"docid": "099714f8b56cdb88a9b58e45d7bbb5a3",
"score": "0.6251372",
"text": "def load_spec(name, version, platform, source) # :nodoc:\n dep = Gem::Dependency.new name, version\n\n found = @specs.find do |spec|\n dep.matches_spec? spec and spec.platform == platform\n end\n\n tuple = Gem::NameTuple.new found.name, found.version, found.platform\n\n found.source.fetch_spec tuple\n end",
"title": ""
},
{
"docid": "a28b2d8fc11125c5e22392311b72379d",
"score": "0.6248046",
"text": "def load_spec(name, version, platform, source) # :nodoc:\n @specs.fetch name\n end",
"title": ""
},
{
"docid": "e5f23eb5100cee0d08ac34f9bc7071c5",
"score": "0.6241582",
"text": "def spec_name\n \"#{full_name}.gemspec\"\n end",
"title": ""
},
{
"docid": "961c3333ccff38e69ab688ca1935ef93",
"score": "0.6225501",
"text": "def load_gems_in(*spec_dirs); end",
"title": ""
},
{
"docid": "d55c821ceef115efab26764db7cf1dbd",
"score": "0.62184614",
"text": "def gemspec(prop)\n begin\n require 'rubygems'\n @gemspec ||= Gem::Specification.load(\n Dir['**/*.gemspec'].first\n )\n @gemspec.send prop\n rescue\n nil\n end\n end",
"title": ""
},
{
"docid": "d6228d19989d7a018ef408e3fbd23f74",
"score": "0.62069875",
"text": "def validate_gemspec\n Juwelier::Commands::ValidateGemspec.build_for(self).run\n end",
"title": ""
},
{
"docid": "364ad451d36d60b2e355b8b0dfdeb3da",
"score": "0.61948174",
"text": "def spec\n @spec ||=\n begin\n require 'rubygems/specification'\n data = File.read('sinbasp.gemspec')\n spec = nil\n Thread.new { spec = eval(\"$SAFE = 3\\n#{data}\") }.join\n spec\n end\nend",
"title": ""
},
{
"docid": "800ffcacc8a8b2128b293389b53033ff",
"score": "0.61931634",
"text": "def local_gemspec(path)\n glob = File.join(path, '{,*}.gemspec')\n Dir[glob].first\n end",
"title": ""
},
{
"docid": "5eb10ccf7d9b859b4355ac5bd95b6594",
"score": "0.6192341",
"text": "def specs\n checkout\n\n return [] unless install_dir\n\n Dir.chdir install_dir do\n Dir['{,*,*/*}.gemspec'].map do |spec_file|\n directory = File.dirname spec_file\n file = File.basename spec_file\n\n Dir.chdir directory do\n spec = Gem::Specification.load file\n if spec\n spec.base_dir = base_dir\n\n spec.extension_dir =\n File.join base_dir, 'extensions', Gem::Platform.local.to_s,\n Gem.extension_api_version, \"#{name}-#{dir_shortref}\"\n\n spec.full_gem_path = File.dirname spec.loaded_from if spec\n end\n spec\n end\n end.compact\n end\n end",
"title": ""
},
{
"docid": "c8abdb7e12dfbb976801280218efb09a",
"score": "0.61550915",
"text": "def load_gemspec (spec_file_location)\n begin\n spec_file_location = spec_file_location.dup.untaint\n content = File.read spec_file_location\n spec = eval_gemspec(content, spec_file_location)\n rescue Exception => e\n warn \"Invalid gemspec in [#{spec_file_location}]: #{e}. Falling back to file string parse.\"\n spec = load_gemspec_fallback(spec_file_location)\n end\n\n spec\n end",
"title": ""
},
{
"docid": "393182ae91bb707231a028134d4f7996",
"score": "0.61080873",
"text": "def validate_gemspec\n Jeweler::Commands::ValidateGemspec.build_for(self).run\n end",
"title": ""
},
{
"docid": "685046bdb582a114e208aae1cbc42e4e",
"score": "0.60683966",
"text": "def gemspec_building_block=(_arg0); end",
"title": ""
},
{
"docid": "116eb5d1687b5492c829414eae30017b",
"score": "0.6039735",
"text": "def load_plugin_gemspec\n gemspecs = @plugin_name ? [File.join(@base, \"#{@plugin_name}.gemspec\")] : Dir[File.join(@base, \"{,*}.gemspec\")]\n raise \"Unable to find your plugin gemspec in #{@base}\" if gemspecs.size == 0\n raise \"Found multiple plugin gemspec in #{@base} : #{gemspecs.inspect}\" if gemspecs.size > 1\n spec_path = gemspecs.first\n @logger.debug \"Loading #{spec_path}\"\n Gem::Specification.load(spec_path)\n end",
"title": ""
},
{
"docid": "c134e4d4d17100928d2a4c18f584da10",
"score": "0.602636",
"text": "def util_bake_gem(name = \"a\", *extra, &block)\n files = [\"lib/#{name}.rb\"].concat(extra)\n\n spec = if Gem::VERSION >= \"3.0.0\"\n util_spec name, \"1\", nil, files, &block\n else\n new_spec name, \"1\", nil, files, &block\n end\n\n util_build_gem spec\n\n spec.cache_file\n end",
"title": ""
},
{
"docid": "9a27e353e713f2deea91c67b68800d53",
"score": "0.60115397",
"text": "def lockfile_contents\n @lockfile_contents || <<-EOF\nGEM\n remote: http://rubygems.org/\n specs:\n pg (0.11.0)\n rake (0.9.2.2)\n ey_config (0.0.1)\n\nPLATFORMS\n ruby\n\nDEPENDENCIES\n pg\n rake\n ey_config\n EOF\n end",
"title": ""
},
{
"docid": "2fd75d7b8ee3288d7040c1985158f88d",
"score": "0.599049",
"text": "def build_gems; end",
"title": ""
},
{
"docid": "33dbdf9ad472f5afced2f11215f57b71",
"score": "0.5979029",
"text": "def install_gem(gemname)\n if !Gem::Specification::find_all_by_name(gemname).any?\n gemfile(true) do\n source 'https://rubygems.org'\n gem gemname\n end\n end\n require gemname\nend",
"title": ""
},
{
"docid": "9975bacca6b174136ca92148de425a36",
"score": "0.59768564",
"text": "def find_gemspec(name, path) # :nodoc:\n glob = File.join path, \"#{name}.gemspec\"\n\n spec_files = Dir[glob]\n\n case spec_files.length\n when 1 then\n spec_file = spec_files.first\n\n spec = Gem::Specification.load spec_file\n\n return spec if spec\n\n raise ArgumentError, \"invalid gemspec #{spec_file}\"\n when 0 then\n raise ArgumentError, \"no gemspecs found at #{Dir.pwd}\"\n else\n raise ArgumentError,\n \"found multiple gemspecs at #{Dir.pwd}, \" +\n \"use the name: option to specify the one you want\"\n end\n end",
"title": ""
},
{
"docid": "339788a1ce2d8dce68b3537caf522fcf",
"score": "0.5963404",
"text": "def gemspec_path\n Pathname.glob('*.gemspec').first\n end",
"title": ""
},
{
"docid": "e1e2a92f5717e0f707d86eb262e03e95",
"score": "0.5958523",
"text": "def gemspecs\n return [] if directory.empty? || directory == '*'\n @gemspecs ||= Dir[File.join(directory, '**/*.gemspec')].select do |gs|\n config.allow? gs\n end\n end",
"title": ""
},
{
"docid": "f4336372180212a0486e9f5783a1a320",
"score": "0.5946785",
"text": "def as_gemspec\n spec_values = SPEC_KEYS.inject({}) do |keys,spec_key|\n keys[spec_key] = metadata_hash[spec_key] || default_or_inferred_for(spec_key)\n keys\n end\n gemspec_from_values(spec_values)\n end",
"title": ""
},
{
"docid": "cb22cbfbac2c605123352278c5aef476",
"score": "0.59406906",
"text": "def try_local(gem_name)\n if ENV['USE_LOCAL_GEMS']\n gem gem_name, path: \"../#{gem_name}\"\n else\n gem gem_name, github: \"omniscrapper/#{gem_name}\"\n end\nend",
"title": ""
},
{
"docid": "aaf94b9c212e40acb391bdf4ef30dd1f",
"score": "0.594049",
"text": "def gemspec_helper=(_arg0); end",
"title": ""
},
{
"docid": "aaf94b9c212e40acb391bdf4ef30dd1f",
"score": "0.594049",
"text": "def gemspec_helper=(_arg0); end",
"title": ""
},
{
"docid": "aaf94b9c212e40acb391bdf4ef30dd1f",
"score": "0.594049",
"text": "def gemspec_helper=(_arg0); end",
"title": ""
},
{
"docid": "aaf94b9c212e40acb391bdf4ef30dd1f",
"score": "0.594049",
"text": "def gemspec_helper=(_arg0); end",
"title": ""
},
{
"docid": "aaf94b9c212e40acb391bdf4ef30dd1f",
"score": "0.594049",
"text": "def gemspec_helper=(_arg0); end",
"title": ""
},
{
"docid": "aaf94b9c212e40acb391bdf4ef30dd1f",
"score": "0.594049",
"text": "def gemspec_helper=(_arg0); end",
"title": ""
},
{
"docid": "aaf94b9c212e40acb391bdf4ef30dd1f",
"score": "0.594049",
"text": "def gemspec_helper=(_arg0); end",
"title": ""
},
{
"docid": "100728b2f151a02566a17d50f9d75ba1",
"score": "0.5929737",
"text": "def gemfile; end",
"title": ""
},
{
"docid": "100728b2f151a02566a17d50f9d75ba1",
"score": "0.5929737",
"text": "def gemfile; end",
"title": ""
},
{
"docid": "100728b2f151a02566a17d50f9d75ba1",
"score": "0.5929737",
"text": "def gemfile; end",
"title": ""
},
{
"docid": "100728b2f151a02566a17d50f9d75ba1",
"score": "0.5929737",
"text": "def gemfile; end",
"title": ""
},
{
"docid": "100728b2f151a02566a17d50f9d75ba1",
"score": "0.5929737",
"text": "def gemfile; end",
"title": ""
},
{
"docid": "100728b2f151a02566a17d50f9d75ba1",
"score": "0.5929737",
"text": "def gemfile; end",
"title": ""
},
{
"docid": "9ea943f74181cffe56218b097ef6b874",
"score": "0.59245986",
"text": "def gemspec_file_system\n @_gemspec_file_system ||= (\n pkgname = File.basename(location)\n gemsdir = File.dirname(location)\n specdir = File.join(File.dirname(gemsdir), 'specifications')\n Dir[File.join(specdir, \"#{pkgname}.gemspec\")].first\n )\n end",
"title": ""
},
{
"docid": "194e94f64ddf40f169cd201d4c901e83",
"score": "0.5921778",
"text": "def gemspec_file\n gemspec_file_system || gemspec_file_local\n end",
"title": ""
},
{
"docid": "295c40be127f4d7c4f4a6fa76f758fe5",
"score": "0.59202796",
"text": "def add_gem_facts\n unless @path.directory?\n @result.is_gem = false\n return\n end\n \n path = gemspec_path\n \n if path.nil?\n @result.is_gem = false\n return\n end\n \n @result.is_gem = true\n @result.package.types << 'gem'\n \n gem = @result.gem = Result.new\n \n gem.gemspec_path = gemspec_path.to_s\n \n spec = Gem::Specification::load(gemspec_path.to_s)\n gem.name = spec.name\n gem.version = QB::Package::Version.from_gem_version spec.version\n end",
"title": ""
},
{
"docid": "ac991ac8d3d65e4a27dce57bc7aad6f2",
"score": "0.59202504",
"text": "def write_gemspec\n Juwelier::Commands::WriteGemspec.build_for(self).run\n end",
"title": ""
},
{
"docid": "fc8224f47dd4d40852b98320ff66f417",
"score": "0.5918159",
"text": "def spec # :nodoc:\n @spec ||=\n begin\n tuple = Gem::NameTuple.new @name, @version, @platform\n source.fetch_spec tuple\n rescue Gem::RemoteFetcher::FetchError\n raise if @original_platform == @platform\n\n tuple = Gem::NameTuple.new @name, @version, @original_platform\n source.fetch_spec tuple\n end\n end",
"title": ""
},
{
"docid": "97e733e1eac56c4249d8275d7286a7cf",
"score": "0.59147084",
"text": "def load_specification(file_name)\n begin\n spec_code = File.read(file_name).untaint\n gemspec = eval(spec_code)\n if gemspec.is_a?(Gem::Specification)\n gemspec.loaded_from = file_name\n return gemspec\n end\n alert_warning \"File '#{file_name}' does not evaluate to a gem specification\"\n rescue SyntaxError => e\n alert_warning e\n alert_warning spec_code\n rescue Exception => e\n alert_warning(e.inspect.to_s + \"\\n\" + spec_code)\n alert_warning \"Invalid .gemspec format in '#{file_name}'\"\n end\n return nil\n end",
"title": ""
},
{
"docid": "ffb9f935f2376cea312465a61c45d3a4",
"score": "0.5911708",
"text": "def validate_gemspec\n build_command(Jeweler::Commands::ValidateGemspec).run\n end",
"title": ""
},
{
"docid": "913047f81f7fbe5e5fc249c2ea680622",
"score": "0.59084654",
"text": "def private_gem(name)\n gem name, '0.3.0', git: \"https://#{ENV['GITHUB_TOKEN']}:x-oauth-basic@github.com/mharris717/#{name}.git\", branch: :master\nend",
"title": ""
},
{
"docid": "50c09ae9793b8643f935190fb6b11866",
"score": "0.58983755",
"text": "def init_gemspecs\n Gem.source_index.map { |_, spec| spec }.sort { |a,b|\n\t(a.name <=> b.name).nonzero? || (b.version <=> a.version)\n }\n end",
"title": ""
},
{
"docid": "2d89f7a324f6bb3f5902b5ba02db4262",
"score": "0.58952165",
"text": "def spec_file\n @spec_file ||= File.join spec_dir, \"#{full_name}.gemspec\"\n end",
"title": ""
},
{
"docid": "2fd51581fd29b9e554df985f07e8cfff",
"score": "0.5893521",
"text": "def load_gems(an_array_of_strings)\n\n print \"Installing gems as necessary ... \" if $debug\n gemfile do\n source 'https://rubygems.org'\n Array(an_array_of_strings).each do |gem_name|\n print gem_name + ' ' if $debug\n gem gem_name\n end\n end\n\n puts 'done' if $debug\n\nend",
"title": ""
}
] |
af630984682f1a0b5a68e6092af0d102 | Update properties of this object | [
{
"docid": "399e5ae50d247564b5553d8aa92bf763",
"score": "0.0",
"text": "def update!(**args)\n @bounding_poly = args[:bounding_poly] if args.key?(:bounding_poly)\n @language_code = args[:language_code] if args.key?(:language_code)\n @mid = args[:mid] if args.key?(:mid)\n @name = args[:name] if args.key?(:name)\n @score = args[:score] if args.key?(:score)\n end",
"title": ""
}
] | [
{
"docid": "184b1b1ed771473d3eb9f338c0734c38",
"score": "0.73066413",
"text": "def update *args\n opts = args.extract_options!\n fill_properties opts\n self.save\n end",
"title": ""
},
{
"docid": "5076c5a88404ae72986f958710f5687a",
"score": "0.72631145",
"text": "def update(properties)\n @__hash__.update(properties)\n end",
"title": ""
},
{
"docid": "60506d5995c168a570c84bcbafd6d01b",
"score": "0.7164913",
"text": "def update props\n # not an alias because doc\n put props\n end",
"title": ""
},
{
"docid": "ec25850e7b3d73876b69868b5e566a7a",
"score": "0.71243227",
"text": "def update_properties(hash)\n hash.each do |key, value|\n self.send(\"#{key}=\", value)\n end\n end",
"title": ""
},
{
"docid": "22938231f10efd60d4530259d1ab7161",
"score": "0.7061904",
"text": "def update_props(properties)\n fail 'not implemented'\n end",
"title": ""
},
{
"docid": "22938231f10efd60d4530259d1ab7161",
"score": "0.7061904",
"text": "def update_props(properties)\n fail 'not implemented'\n end",
"title": ""
},
{
"docid": "150fa2bdc1fc43d28ac45e2278a1f797",
"score": "0.7012263",
"text": "def update_properties(hash)\n hash.each do |key, value|\n setter_method = \"#{key}=\"\n if self.respond_to?(setter_method)\n self.send(setter_method, value)\n end\n end\n end",
"title": ""
},
{
"docid": "b46342a57789464175130c5171865a4f",
"score": "0.69842774",
"text": "def update_properties(props)\n load_properties(force: true)\n\n deep_merge = proc do |_, old_value, new_value|\n if old_value.is_a?(Hash) && new_value.is_a?(Hash)\n old_value.merge(new_value, &deep_merge)\n else\n new_value\n end\n end\n\n props = properties.merge(props || {}, &deep_merge)\n save_properties(properties.merge(props || {}))\n self\n end",
"title": ""
},
{
"docid": "e72f78e0e269f94de07625d4972f0298",
"score": "0.69181895",
"text": "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"title": ""
},
{
"docid": "e72f78e0e269f94de07625d4972f0298",
"score": "0.69181895",
"text": "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"title": ""
},
{
"docid": "e72f78e0e269f94de07625d4972f0298",
"score": "0.69181895",
"text": "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"title": ""
},
{
"docid": "e72f78e0e269f94de07625d4972f0298",
"score": "0.69181895",
"text": "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"title": ""
},
{
"docid": "e72f78e0e269f94de07625d4972f0298",
"score": "0.69181895",
"text": "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"title": ""
},
{
"docid": "e72f78e0e269f94de07625d4972f0298",
"score": "0.69181895",
"text": "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"title": ""
},
{
"docid": "e72f78e0e269f94de07625d4972f0298",
"score": "0.69181895",
"text": "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"title": ""
},
{
"docid": "e72f78e0e269f94de07625d4972f0298",
"score": "0.69181895",
"text": "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"title": ""
},
{
"docid": "e72f78e0e269f94de07625d4972f0298",
"score": "0.69181895",
"text": "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"title": ""
},
{
"docid": "e72f78e0e269f94de07625d4972f0298",
"score": "0.69181895",
"text": "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"title": ""
},
{
"docid": "e72f78e0e269f94de07625d4972f0298",
"score": "0.69181895",
"text": "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"title": ""
},
{
"docid": "e72f78e0e269f94de07625d4972f0298",
"score": "0.69181895",
"text": "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"title": ""
},
{
"docid": "e72f78e0e269f94de07625d4972f0298",
"score": "0.69181895",
"text": "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"title": ""
},
{
"docid": "e72f78e0e269f94de07625d4972f0298",
"score": "0.69181895",
"text": "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"title": ""
},
{
"docid": "e72f78e0e269f94de07625d4972f0298",
"score": "0.69181895",
"text": "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"title": ""
},
{
"docid": "e72f78e0e269f94de07625d4972f0298",
"score": "0.69181895",
"text": "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"title": ""
},
{
"docid": "4aa62f56c7ec71b9c7d914558501001b",
"score": "0.67206186",
"text": "def update\n update_obj\n end",
"title": ""
},
{
"docid": "10e41ec39ba2af73495ccece21c2d8a3",
"score": "0.6709326",
"text": "def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\n end",
"title": ""
},
{
"docid": "b0508d605628b9b1ec78fe5f0697a746",
"score": "0.67057854",
"text": "def update_properties(hash)\n hash.each_pair do |k, v|\n self.set_property_value(k.to_s, v)\n end\n end",
"title": ""
},
{
"docid": "092b765ad7cf3ce4b6bf4e7d8a2e6af7",
"score": "0.6696149",
"text": "def update(attrs)\n super(attrs)\n end",
"title": ""
},
{
"docid": "092b765ad7cf3ce4b6bf4e7d8a2e6af7",
"score": "0.6696149",
"text": "def update(attrs)\n super(attrs)\n end",
"title": ""
},
{
"docid": "092b765ad7cf3ce4b6bf4e7d8a2e6af7",
"score": "0.6696149",
"text": "def update(attrs)\n super(attrs)\n end",
"title": ""
},
{
"docid": "092b765ad7cf3ce4b6bf4e7d8a2e6af7",
"score": "0.6696149",
"text": "def update(attrs)\n super(attrs)\n end",
"title": ""
},
{
"docid": "092b765ad7cf3ce4b6bf4e7d8a2e6af7",
"score": "0.6696149",
"text": "def update(attrs)\n super(attrs)\n end",
"title": ""
},
{
"docid": "092b765ad7cf3ce4b6bf4e7d8a2e6af7",
"score": "0.6696149",
"text": "def update(attrs)\n super(attrs)\n end",
"title": ""
},
{
"docid": "092b765ad7cf3ce4b6bf4e7d8a2e6af7",
"score": "0.6696149",
"text": "def update(attrs)\n super(attrs)\n end",
"title": ""
},
{
"docid": "d9b090f93fdffad34c5489c4c437c6f3",
"score": "0.6662612",
"text": "def update_properties(properties_element)\n end",
"title": ""
},
{
"docid": "b7ed68c679d7eaccf546a282fab6e985",
"score": "0.66259164",
"text": "def apply\n update_keys\n update_columns\n update_properties\n end",
"title": ""
},
{
"docid": "769b77b7f7f9f82ae847f5968eb201dc",
"score": "0.6571848",
"text": "def update_self obj\n obj.each do |k,v|\n instance_variable_set(\"@#{k}\", v) if v\n end\n end",
"title": ""
},
{
"docid": "769b77b7f7f9f82ae847f5968eb201dc",
"score": "0.6571848",
"text": "def update_self obj\n obj.each do |k,v|\n instance_variable_set(\"@#{k}\", v) if v\n end\n end",
"title": ""
},
{
"docid": "137759bf2b87f1ca55eb78e668747d15",
"score": "0.6539236",
"text": "def update!(**args)\n @property = args[:property] if args.key?(:property)\n end",
"title": ""
},
{
"docid": "137759bf2b87f1ca55eb78e668747d15",
"score": "0.6539236",
"text": "def update!(**args)\n @property = args[:property] if args.key?(:property)\n end",
"title": ""
},
{
"docid": "137759bf2b87f1ca55eb78e668747d15",
"score": "0.6539236",
"text": "def update!(**args)\n @property = args[:property] if args.key?(:property)\n end",
"title": ""
},
{
"docid": "137759bf2b87f1ca55eb78e668747d15",
"score": "0.6539236",
"text": "def update!(**args)\n @property = args[:property] if args.key?(:property)\n end",
"title": ""
},
{
"docid": "137759bf2b87f1ca55eb78e668747d15",
"score": "0.6539236",
"text": "def update!(**args)\n @property = args[:property] if args.key?(:property)\n end",
"title": ""
},
{
"docid": "137759bf2b87f1ca55eb78e668747d15",
"score": "0.6539236",
"text": "def update!(**args)\n @property = args[:property] if args.key?(:property)\n end",
"title": ""
},
{
"docid": "862f7aa179e3e1751693f78772c09a99",
"score": "0.65159345",
"text": "def assign_properties(properties); end",
"title": ""
},
{
"docid": "328c68b6c30673dac05ca930f5da533c",
"score": "0.6458067",
"text": "def update_attributes(attrs)\n self.update(attrs)\n end",
"title": ""
},
{
"docid": "328c68b6c30673dac05ca930f5da533c",
"score": "0.6458067",
"text": "def update_attributes(attrs)\n self.update(attrs)\n end",
"title": ""
},
{
"docid": "d8b3bf9ec121e23dad3af2edca6e6094",
"score": "0.6421526",
"text": "def update(attributes); end",
"title": ""
},
{
"docid": "63cce5e99d8dc677403b00708afc27c9",
"score": "0.641709",
"text": "def update\n @prop.update_attributes(prop_params)\n respond_with @prop, location: backstage_scene_props_path\n end",
"title": ""
},
{
"docid": "3dc790e8b6e9e65eb288c97798a4c7f2",
"score": "0.64154994",
"text": "def set_properties inst\n model.properties.find_all { |p| model.updatable?(p.name) }.each do |p|\n inst.send(\"#{p.name}=\".to_sym, params[p.name.to_s]) if params.has_key?(p.name.to_s)\n end\n inst\n end",
"title": ""
},
{
"docid": "9373755ebb61f1f274f6c8504a5acace",
"score": "0.64146614",
"text": "def reload(props = {})\n reset_changes\n super\n assign_attributes(props)\n self\n end",
"title": ""
},
{
"docid": "fb68247cb1373a6c71a42a2aa69f1dcb",
"score": "0.64143723",
"text": "def update(attrs)\n @attrs = attrs\n self\n end",
"title": ""
},
{
"docid": "fb68247cb1373a6c71a42a2aa69f1dcb",
"score": "0.64143723",
"text": "def update(attrs)\n @attrs = attrs\n self\n end",
"title": ""
},
{
"docid": "23eb6f5fbeae4bf9f56ac93a4126b4b5",
"score": "0.6389745",
"text": "def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end",
"title": ""
},
{
"docid": "71d6a0160cffce28db4d0a25d6dbda13",
"score": "0.6385747",
"text": "def update!(**args)\n @count = args[:count] if args.key?(:count)\n @properties = args[:properties] if args.key?(:properties)\n end",
"title": ""
},
{
"docid": "9b95f8bc66f32e7ebbe7e63224d1ebaf",
"score": "0.6364864",
"text": "def update(attributes)\n attributes.each do |name, value|\n self[name] = value\n end\n end",
"title": ""
},
{
"docid": "575f3d0c94f466263e302883e13868a6",
"score": "0.6330631",
"text": "def _update\n update!\n end",
"title": ""
},
{
"docid": "7c6d5966289f9347f75aa7b24903a328",
"score": "0.6327251",
"text": "def _update!\n self.class.properties.each do |property, predicate|\n if dirty?(property)\n self.class.repository_or_fail.delete([subject, predicate[:predicate], nil])\n if self.class.is_list?(property)\n repo = RDF::Repository.new\n attribute_get(property).each do |value|\n repo << RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(value, self.class.properties[property][:type]))\n end\n self.class.repository_or_fail.insert(*repo)\n else\n self.class.repository_or_fail.insert(RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(attribute_get(property), self.class.properties[property][:type]))) unless attribute_get(property).nil?\n end\n end\n @attributes[:original][property] = attribute_get(property)\n @dirty[property] = nil\n @attributes[:copied][property] = NOT_SET\n end\n self.class.repository_or_fail.insert(RDF::Statement.new(@subject, RDF.type, type)) unless type.nil?\n end",
"title": ""
},
{
"docid": "210886bcfd68fae88847f8b3464d4058",
"score": "0.6325362",
"text": "def update_properties!(scraper)\n log \"Updating assets for #{self.slug}\"\n# only update active properties\n Property.where(source_id: self.id, status: 1).find_each do |prop|\n begin\n scraper.update_property(prop)\n rescue Exception => e\n log \"there was a connection error #{e.message} - #{e.class}\"\n end\n end\n end",
"title": ""
},
{
"docid": "da63345424fc9aecef032928485bd149",
"score": "0.6319025",
"text": "def update\n \n end",
"title": ""
},
{
"docid": "749afa4ff068e21c7d78bbad94c19d6c",
"score": "0.6313444",
"text": "def update!(attributes); end",
"title": ""
},
{
"docid": "e8639be61ed6393bc612a8aef27789d3",
"score": "0.6312355",
"text": "def update!(**args)\n @border = args[:border] if args.key?(:border)\n @fields = args[:fields] if args.key?(:fields)\n @object_id_prop = args[:object_id_prop] if args.key?(:object_id_prop)\n end",
"title": ""
},
{
"docid": "6284f332cbe8c998b16d5e816c5d21ed",
"score": "0.6291622",
"text": "def update!(**args)\n @display_name = args[:display_name] if args.key?(:display_name)\n @parent = args[:parent] if args.key?(:parent)\n @property = args[:property] if args.key?(:property)\n @property_type = args[:property_type] if args.key?(:property_type)\n end",
"title": ""
},
{
"docid": "6284f332cbe8c998b16d5e816c5d21ed",
"score": "0.6291622",
"text": "def update!(**args)\n @display_name = args[:display_name] if args.key?(:display_name)\n @parent = args[:parent] if args.key?(:parent)\n @property = args[:property] if args.key?(:property)\n @property_type = args[:property_type] if args.key?(:property_type)\n end",
"title": ""
},
{
"docid": "5a8e82caac01cee661bc875a5b0cf723",
"score": "0.6283673",
"text": "def refresh\n set_attributes\n end",
"title": ""
},
{
"docid": "9e076ce17f1607b2a6248469b63b9c05",
"score": "0.62797445",
"text": "def training_updated_properties=(value)\n @training_updated_properties = value\n end",
"title": ""
},
{
"docid": "309d8f89c45737b781ca7c15a61b00a5",
"score": "0.6273536",
"text": "def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @size_bytes = args[:size_bytes] if args.key?(:size_bytes)\n end",
"title": ""
},
{
"docid": "309d8f89c45737b781ca7c15a61b00a5",
"score": "0.6273536",
"text": "def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @size_bytes = args[:size_bytes] if args.key?(:size_bytes)\n end",
"title": ""
},
{
"docid": "60d8c4f58de490a0d7cdd918c16a2cce",
"score": "0.6269463",
"text": "def update(attrs)\n @attrs.update(attrs)\n self\n end",
"title": ""
},
{
"docid": "60d8c4f58de490a0d7cdd918c16a2cce",
"score": "0.6269463",
"text": "def update(attrs)\n @attrs.update(attrs)\n self\n end",
"title": ""
},
{
"docid": "60d8c4f58de490a0d7cdd918c16a2cce",
"score": "0.6269463",
"text": "def update(attrs)\n @attrs.update(attrs)\n self\n end",
"title": ""
},
{
"docid": "60d8c4f58de490a0d7cdd918c16a2cce",
"score": "0.6269463",
"text": "def update(attrs)\n @attrs.update(attrs)\n self\n end",
"title": ""
},
{
"docid": "7a41bc9d5a07220fb8626d1fa90d2d79",
"score": "0.62639254",
"text": "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @source = args[:source] if args.key?(:source)\n end",
"title": ""
},
{
"docid": "f88ac8dac0e7b4769636f755e65a14ba",
"score": "0.6261997",
"text": "def update!(**args)\n @fields = args[:fields] if args.key?(:fields)\n @properties = args[:properties] if args.key?(:properties)\n end",
"title": ""
},
{
"docid": "f88ac8dac0e7b4769636f755e65a14ba",
"score": "0.6261997",
"text": "def update!(**args)\n @fields = args[:fields] if args.key?(:fields)\n @properties = args[:properties] if args.key?(:properties)\n end",
"title": ""
},
{
"docid": "f88ac8dac0e7b4769636f755e65a14ba",
"score": "0.6261997",
"text": "def update!(**args)\n @fields = args[:fields] if args.key?(:fields)\n @properties = args[:properties] if args.key?(:properties)\n end",
"title": ""
},
{
"docid": "f88ac8dac0e7b4769636f755e65a14ba",
"score": "0.6261997",
"text": "def update!(**args)\n @fields = args[:fields] if args.key?(:fields)\n @properties = args[:properties] if args.key?(:properties)\n end",
"title": ""
},
{
"docid": "f88ac8dac0e7b4769636f755e65a14ba",
"score": "0.6261997",
"text": "def update!(**args)\n @fields = args[:fields] if args.key?(:fields)\n @properties = args[:properties] if args.key?(:properties)\n end",
"title": ""
},
{
"docid": "f88ac8dac0e7b4769636f755e65a14ba",
"score": "0.6261997",
"text": "def update!(**args)\n @fields = args[:fields] if args.key?(:fields)\n @properties = args[:properties] if args.key?(:properties)\n end",
"title": ""
},
{
"docid": "afd53a32bf51a2ff3c438cbf011b1ee6",
"score": "0.6261246",
"text": "def update!\n saved = false\n retries = RETRIES\n while !saved\n begin\n res = Persistence::Setup.db.save_doc(@properties)\n @properties = Persistence::Setup.db.get(res['id'])\n saved = true\n rescue Exception => ex\n raise ex if ex.http_code != 409\n if(retries > 0)\n @new_properties = Persistence::Setup.db.get(@properties['_id'])\n @properties.each_pair do |k,v|\n if k != \"_rev\" && k != \"_id\"\n @new_properties[k] = v\n end\n end\n @properties = @new_properties\n else\n raise ex\n end\n end\n end\n :ok\n end",
"title": ""
},
{
"docid": "118090da310d688caa13dea348732f3c",
"score": "0.62579167",
"text": "def update(attributes={})\n self.class.update(self, attributes)\n end",
"title": ""
},
{
"docid": "91dc386ff8fa066852510a5d62b13078",
"score": "0.62170374",
"text": "def update(attrs)\n @attrs ||= {}\n @attrs.update(attrs)\n self\n end",
"title": ""
},
{
"docid": "91dc386ff8fa066852510a5d62b13078",
"score": "0.62170374",
"text": "def update(attrs)\n @attrs ||= {}\n @attrs.update(attrs)\n self\n end",
"title": ""
},
{
"docid": "6249943d1eeff63f8f611fcf73254058",
"score": "0.62152076",
"text": "def update\n \n end",
"title": ""
},
{
"docid": "1c12f310aca206a2cefff8c291007668",
"score": "0.6210263",
"text": "def update!(**args)\n @property = args[:property] if args.key?(:property)\n @schema = args[:schema] if args.key?(:schema)\n end",
"title": ""
},
{
"docid": "3dfb66c3e13f181393bb4510e9fcd51f",
"score": "0.62083745",
"text": "def set_update(attrs = {})\n @movement.attributes = attrs.slice(*attributes_for_update)\n set_details\n\n @movement.balance = get_updated_balance\n @movement.gross_total = original_total\n @movement.set_state_by_balance!\n @movement.discounted = ( discount > 0 )\n\n @movement.balance_inventory = balance_inventory\n @movement.delivered = @movement.details.all? {|v| v.balance <= 0}\n\n @errors.new(movement).set_errors\n end",
"title": ""
},
{
"docid": "1c0316f22c6db917fa4719767b5326a9",
"score": "0.6204041",
"text": "def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"title": ""
},
{
"docid": "5d229ea224b1dfa7ac9ce6808ca63fc4",
"score": "0.62017816",
"text": "def update(attributes = {})\n super(attributes)\n retrieve!\n self\n end",
"title": ""
},
{
"docid": "6992c0833b982296b329ec1d8c7289de",
"score": "0.6201711",
"text": "def update(attributes = {})\n self.attributes = attributes\n _update\n end",
"title": ""
},
{
"docid": "2beb42793217599eea1dac4b91640e41",
"score": "0.6196084",
"text": "def update_attributes\n server_update_data.each_pair do |key, value|\n instance_variable_set(\"@#{key}\", value)\n end\n end",
"title": ""
},
{
"docid": "67f76e6622d1021031437ad609613c63",
"score": "0.6192824",
"text": "def update(obj)\n obj.each_pair do |key, value|\n send(\"#{key}=\", value)\n end\n self\n end",
"title": ""
},
{
"docid": "30aa07725af2114280d6e8f916ab079f",
"score": "0.6183338",
"text": "def update!\n\t\t\tconstruct!(self, &@update)\n\t\t\t@update = nil\n\t\t\t\n\t\t\treturn self\n\t\tend",
"title": ""
},
{
"docid": "f1f71f298690a3bd1f5832b15038d8bb",
"score": "0.6174291",
"text": "def updated_properties\n @updated_properties ||= ActiveSupport::HashWithIndifferentAccess.new\n end",
"title": ""
},
{
"docid": "e1f766468b11768b786daa133483b157",
"score": "0.61730784",
"text": "def update\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "ed1b58af16fd466e308ffc9229115e36",
"score": "0.6145399",
"text": "def update_attributes(params)\n raise(RHapi::AttributeError, \"The params must be a hash.\") unless params.is_a?(Hash)\n params.each do |name, value|\n self.properties.send(name.to_s + '=', value)\n end\n save # only call API once rather than repeatedly saving with update_attribute calls\n end",
"title": ""
},
{
"docid": "ed1b58af16fd466e308ffc9229115e36",
"score": "0.6145399",
"text": "def update_attributes(params)\n raise(RHapi::AttributeError, \"The params must be a hash.\") unless params.is_a?(Hash)\n params.each do |name, value|\n self.properties.send(name.to_s + '=', value)\n end\n save # only call API once rather than repeatedly saving with update_attribute calls\n end",
"title": ""
},
{
"docid": "147d62c4df79ff1ca86cbd477112bf7f",
"score": "0.61445665",
"text": "def update\n end",
"title": ""
},
{
"docid": "147d62c4df79ff1ca86cbd477112bf7f",
"score": "0.61445665",
"text": "def update\n end",
"title": ""
},
{
"docid": "147d62c4df79ff1ca86cbd477112bf7f",
"score": "0.61445665",
"text": "def update\n end",
"title": ""
},
{
"docid": "7f11aed7030229ef429116ccba78c00f",
"score": "0.61400205",
"text": "def update_properties\n # t_init = 0, t_mod = 0, t_formula = 0, t_formula_mod = 0, t_post_init = 0\n # t_update_properties = Benchmark.measure do\n # Reset values for everything except formulas\n # t_init = Benchmark.measure do\n character_properties.reject { |p| p.is_a?(CharacterFormula) }.each do |p|\n p.init(self)\n end\n # end\n\n # Apply modifiers to attributes, skills and resistances (formulas later)\n mods = []\n # t_mod = Benchmark.measure do\n mods << race.property_modifiers if race\n mods << birthsign.property_modifiers if birthsign\n mods.flatten!\n mods.reject { |m| m.property.is_a?(Formula) }.each(&method(:apply_modifier))\n # end\n\n # Now start to process formulas\n # t_formula = Benchmark.measure do\n character_properties.select { |p| p.is_a?(CharacterFormula) }.each do |f|\n f.init(self)\n end\n # end\n\n # Apply modifiers to formulas\n # t_formula_mod = Benchmark.measure do\n mods.select { |m| m.property.is_a?(Formula) }.each(&method(:apply_modifier))\n # end\n\n # t_post_init = Benchmark.measure do\n character_properties.each do |prop|\n prop.post_init(self)\n end\n # end\n # end\n\n # logger.warn(\"## Init: #{(t_init.real*1000).to_i}ms\")\n # logger.warn(\"## Mofifiers: #{(t_mod.real*1000).to_i}ms\")\n # logger.warn(\"## Formula: #{(t_formula.real*1000).to_i}ms\")\n # logger.warn(\"## Formula Modifiers: #{(t_formula_mod.real*1000).to_i}ms\")\n # logger.warn(\"## Post Init: #{(t_post_init.real*1000).to_i}ms\")\n # logger.warn(\"### Update Properties: #{(t_update_properties.real*1000).to_i}ms\")\n end",
"title": ""
},
{
"docid": "22a21a1959eeb926dfe475d8878239d7",
"score": "0.6127356",
"text": "def update\n connection.put(singleton_path(prefix_options), encode, self.class.headers).tap do |response|\n load_attributes_from_response(response)\n end\n end",
"title": ""
}
] |
a413ef030d3232205851cf5ad47c8703 | GET /users/1 GET /users/1.xml | [
{
"docid": "616cbe3bdafeb00a545222e8ddef1e20",
"score": "0.0",
"text": "def show\n redirect_to users_path\n \n end",
"title": ""
}
] | [
{
"docid": "156ffeeb9dfbc9b33c5e4e53037c1d05",
"score": "0.72072804",
"text": "def index\n @users = LinkedData::Client::Models::User.all\n respond_to do |format|\n format.html\n format.xml { render xml: @users.to_xml }\n end\n end",
"title": ""
},
{
"docid": "78c91061ae58bb0c2de71a1158e05c68",
"score": "0.7115603",
"text": "def me\n users(request(\"users/authenticate.xml\", :auth => true))\n end",
"title": ""
},
{
"docid": "ae5be2d2c9f478406807979c23bebd38",
"score": "0.7054087",
"text": "def index\n @users = User.all\n render :xml => @users\n end",
"title": ""
},
{
"docid": "1b36c6d085c50d9b823abd98e9d4a7dd",
"score": "0.70479476",
"text": "def list_users\n self.class.get('/users')\n end",
"title": ""
},
{
"docid": "0cf8094a70d9daed6fb89fc738996c5e",
"score": "0.69164896",
"text": "def index\n @users = User.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render xml: @users }\n end\n end",
"title": ""
},
{
"docid": "53cc567308f46aeee87f75b98ddcf93c",
"score": "0.6915887",
"text": "def index\r\n @users = User.find(:all)\r\n \r\n respond_to do |format|\r\n format.html # index.html.erb\r\n format.xml { render :xml => @users.to_xml }\r\n end\r\n end",
"title": ""
},
{
"docid": "be1b7b36f7e8bd441e7507764ce5b199",
"score": "0.69154537",
"text": "def index\n @users = User.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @users }\n end\n end",
"title": ""
},
{
"docid": "ba42a910f5720f3555b6cf9ce1e1799c",
"score": "0.68895864",
"text": "def index\n @title = \"All users\"\n @users = User.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @users.to_xml(:except => [:password_digest, :remember_token])}\n end\n end",
"title": ""
},
{
"docid": "5783ccbdec9e3e5bf27af71ffba277aa",
"score": "0.68641055",
"text": "def index\n @users = User.find(:all)\n\n respond_to do |format|\n format.html # index.rhtml\n format.xml { render :xml => @users.to_xml }\n end\n end",
"title": ""
},
{
"docid": "5783ccbdec9e3e5bf27af71ffba277aa",
"score": "0.6863304",
"text": "def index\n @users = User.find(:all)\n\n respond_to do |format|\n format.html # index.rhtml\n format.xml { render :xml => @users.to_xml }\n end\n end",
"title": ""
},
{
"docid": "fe4cf61cabf34caab43b7d87c5ff5feb",
"score": "0.6853943",
"text": "def show\n @user = User.find(params[:id])\n render :xml => @user\n rescue\n render :nothing => true, :status => :not_found\n end",
"title": ""
},
{
"docid": "d43318a538ae7cf5999787a786d13953",
"score": "0.68511486",
"text": "def index\n @users = User.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @users }\n end\n end",
"title": ""
},
{
"docid": "d43318a538ae7cf5999787a786d13953",
"score": "0.68511486",
"text": "def index\n @users = User.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @users }\n end\n end",
"title": ""
},
{
"docid": "d43318a538ae7cf5999787a786d13953",
"score": "0.68511486",
"text": "def index\n @users = User.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @users }\n end\n end",
"title": ""
},
{
"docid": "0c77eba21f98f72d97d38ab88f9d0886",
"score": "0.6828393",
"text": "def show\n @user = User.find(params[:id])\n usr = prepare_user(@user);\n respond_to do |format|\n format.xml { render :xml => usr.to_xml }\n end\n end",
"title": ""
},
{
"docid": "920d64bb13b67a92bebd8d4774f9d066",
"score": "0.68277204",
"text": "def index\n @users = User.find(:all, :order => 'name ASC')\n respond_to do |format|\n format.html \n format.xml { @users.to_xml }\n end\n end",
"title": ""
},
{
"docid": "8a29471646191d84def95f7af1e081bf",
"score": "0.6827344",
"text": "def users(args = {})\n get(\"/users.json\",args)\n end",
"title": ""
},
{
"docid": "b735c69185e6c2add5d497b9db464c6e",
"score": "0.6806332",
"text": "def index\n users = get_collection(User) || return\n\n respond_to do |format|\n format.xml { render xml: users.to_xml(only: DEFAULT_FIELDS, root: 'users', skip_types: 'true') }\n format.json { render json: users.to_json(only: DEFAULT_FIELDS) }\n end\n end",
"title": ""
},
{
"docid": "ccedebe3856a99795ba57fbe3f941c56",
"score": "0.68010885",
"text": "def show\n @user = User.find(params[:id])\n render :xml => @user.to_xml(:except => [ :password ])\n end",
"title": ""
},
{
"docid": "72934786077b39703966d70605856203",
"score": "0.6786184",
"text": "def index\n @users = User.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @users }\n end\n end",
"title": ""
},
{
"docid": "9a7e2889d6fe5b08f84a888c40f2b06c",
"score": "0.6766243",
"text": "def show\n @users = User.find(params[:id])\n if @users\n respond_to do |format|\n format.json { render :json => @users }\n format.xml { render :xml => @users }\n end\n else\n head :not_found\n end\n end",
"title": ""
},
{
"docid": "3bbddc449f05a98aefeed9c0386ddd1d",
"score": "0.67376035",
"text": "def index\n @users = User.all(:order=>:name)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @users.to_xml(\n :dasherize => false, :only => [:id, :name,\n :created_at, :updated_at]) }\n end\n end",
"title": ""
},
{
"docid": "6e05b3e6f302b5c6c1714e004e32614c",
"score": "0.6732347",
"text": "def index\n @users = User.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @users }\n end\n end",
"title": ""
},
{
"docid": "6e05b3e6f302b5c6c1714e004e32614c",
"score": "0.6732347",
"text": "def index\n @users = User.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @users }\n end\n end",
"title": ""
},
{
"docid": "6e05b3e6f302b5c6c1714e004e32614c",
"score": "0.6732347",
"text": "def index\n @users = User.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @users }\n end\n end",
"title": ""
},
{
"docid": "6e05b3e6f302b5c6c1714e004e32614c",
"score": "0.6732347",
"text": "def index\n @users = User.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @users }\n end\n end",
"title": ""
},
{
"docid": "6e05b3e6f302b5c6c1714e004e32614c",
"score": "0.6732347",
"text": "def index\n @users = User.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @users }\n end\n end",
"title": ""
},
{
"docid": "6e05b3e6f302b5c6c1714e004e32614c",
"score": "0.6732347",
"text": "def index\n @users = User.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @users }\n end\n end",
"title": ""
},
{
"docid": "6e05b3e6f302b5c6c1714e004e32614c",
"score": "0.6732347",
"text": "def index\n @users = User.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @users }\n end\n end",
"title": ""
},
{
"docid": "6e05b3e6f302b5c6c1714e004e32614c",
"score": "0.6732347",
"text": "def index\n @users = User.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @users }\n end\n end",
"title": ""
},
{
"docid": "6e05b3e6f302b5c6c1714e004e32614c",
"score": "0.6732347",
"text": "def index\n @users = User.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @users }\n end\n end",
"title": ""
},
{
"docid": "6e05b3e6f302b5c6c1714e004e32614c",
"score": "0.6732347",
"text": "def index\n @users = User.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @users }\n end\n end",
"title": ""
},
{
"docid": "6e05b3e6f302b5c6c1714e004e32614c",
"score": "0.6732347",
"text": "def index\n @users = User.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @users }\n end\n end",
"title": ""
},
{
"docid": "6e05b3e6f302b5c6c1714e004e32614c",
"score": "0.6732347",
"text": "def index\n @users = User.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @users }\n end\n end",
"title": ""
},
{
"docid": "6e05b3e6f302b5c6c1714e004e32614c",
"score": "0.6732347",
"text": "def index\n @users = User.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @users }\n end\n end",
"title": ""
},
{
"docid": "6e05b3e6f302b5c6c1714e004e32614c",
"score": "0.6732347",
"text": "def index\n @users = User.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @users }\n end\n end",
"title": ""
},
{
"docid": "6e05b3e6f302b5c6c1714e004e32614c",
"score": "0.6732347",
"text": "def index\n @users = User.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @users }\n end\n end",
"title": ""
},
{
"docid": "89d6b14901acf0f170ab8aa8bb5d5697",
"score": "0.67163426",
"text": "def index\n @users = User.all\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @users }\n end\n end",
"title": ""
},
{
"docid": "89d6b14901acf0f170ab8aa8bb5d5697",
"score": "0.67163426",
"text": "def index\n @users = User.all\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @users }\n end\n end",
"title": ""
},
{
"docid": "89d6b14901acf0f170ab8aa8bb5d5697",
"score": "0.67163426",
"text": "def index\n @users = User.all\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @users }\n end\n end",
"title": ""
},
{
"docid": "2656a5226d0b5722012c5a9054082f93",
"score": "0.67148346",
"text": "def index\n @users = User.all()\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @users }\n end\n end",
"title": ""
},
{
"docid": "1f9b9fd1ddf3e8e627d47ba8d0fbcbc3",
"score": "0.6709396",
"text": "def index3\n @users = User.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @users }\n end\n end",
"title": ""
},
{
"docid": "c86ef69224fc9c4c5da8de10d5c31f85",
"score": "0.67085135",
"text": "def list_users(api_object)\r\n puts \"Current Users:\"\r\n doc = Nokogiri::XML.parse api_object.read\r\n names = doc.xpath('users').collect {|e| e.text }\r\n puts names.join(\", \")\r\n puts \"\"\r\nend",
"title": ""
},
{
"docid": "bfd8d2ce2170782aec917ec05008fa2c",
"score": "0.66772795",
"text": "def show\n @user = nil\n id_or_name = params[:id]\n begin\n @user = User.find(id_or_name)\n rescue\n @user = User.find_by_name(id_or_name)\n end\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml {\n xml = Builder::XmlMarkup.new(:indent => 2)\n xml.instruct! directive_tag=:xml, :encoding=> 'utf-8'\n render :xml => xml.user {|u|\n u.id(@user.id)\n u.name(@user.name)\n u.statuses {|ss|\n @user.statuses.each {|stat|\n ss.status {|s|\n s.id(stat.id)\n s.user_id(stat.user_id)\n s.text(stat.text)\n s.geo_tag(stat.geo_tag)\n s.created_at(stat.created_at)\n }\n }\n }\n }\n }\n end\n end",
"title": ""
},
{
"docid": "4152fb6556ae83f7cdd6c362f17ad9bf",
"score": "0.66762924",
"text": "def index\n if params[:single]\n\t url = \"#{API_BASE_URL}/users/#{params[:id]}.json\"\n\t response = RestClient.get(url)\n\t @user = JSON.parse(response.body)\n\telse\n\t url = \"#{API_BASE_URL}/users.json\"\t \n response = RestClient.get(url)\n @users = JSON.parse(response.body)\t\t \n\tend\n end",
"title": ""
},
{
"docid": "de3b087f20ee65746adea1959f862485",
"score": "0.6672341",
"text": "def users\n get('get_users')\n end",
"title": ""
},
{
"docid": "8ffbb4eb100099492ebe99506698d431",
"score": "0.66603494",
"text": "def fetch_one_user_data\n get_url(\"/api/v1/users/#{@filter}\")\n end",
"title": ""
},
{
"docid": "967243467254190995cf8107ff316361",
"score": "0.6649192",
"text": "def show\n @user = V1::User.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @user }\n end\n end",
"title": ""
},
{
"docid": "cf70baf57833860a180f28917fa527e1",
"score": "0.66357434",
"text": "def show \n @user = User.find(params[:id])\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @user }\n end\n end",
"title": ""
},
{
"docid": "f72fbeeccf3bf2498865d7fb0efaef6a",
"score": "0.66293174",
"text": "def index\n\t\t@users = User.all\n\t\t\n\t\trespond_to do |format|\n\t\t\tformat.html # index.html.erb\n\t\t\tformat.xml\t{ render :xml => @users }\n\t\tend\n\tend",
"title": ""
},
{
"docid": "a92eccd715cd842ad4dc15021692e321",
"score": "0.6601205",
"text": "def index\n @user = current_user\n @title = \"Account\"\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @users }\n end\n end",
"title": ""
},
{
"docid": "d9af1b1a3895b9ab3d1c66090f06a0fa",
"score": "0.6573456",
"text": "def users(params = {})\n make_get_request('/account/users', params)\n end",
"title": ""
},
{
"docid": "41410c8202bd5fd2afafdf79c04dd6fe",
"score": "0.65687877",
"text": "def show\n @user = User.find(params[:id])\n\n respond_to do |format|\n format.html # show.rhtml\n format.xml { render :xml => @user.to_xml }\n end\n end",
"title": ""
},
{
"docid": "191a584bbd3e40b60e74d1ac8856ed5b",
"score": "0.656731",
"text": "def users\n \n @users = User.where(:enabled => true)\n @users = @users.where(:role => params[:role].upcase) if params[:role]\n @users = @users.where(:id => params[:id]) if params[:id]\n respond_to do |format|\n format.xml { render :xml => @users.to_xml }\n end\n \n end",
"title": ""
},
{
"docid": "3b28a47e7dc4130bc0bd35eb3138fb13",
"score": "0.65485734",
"text": "def index\n authorize! :read, User\n @users = User.find(:all)\n @users ||= []\n respond_to do |format|\n format.html # index.rhtml\n format.xml { render :xml => @users.to_xml }\n end\n end",
"title": ""
},
{
"docid": "8d53535cc7c8cbbce7b956d39c8f843d",
"score": "0.6534381",
"text": "def show\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render xml: @user }\n end\n end",
"title": ""
},
{
"docid": "f9fe9ad46fe60e99b85e85afe7f50ace",
"score": "0.6532818",
"text": "def GetUsers params = {}\n\n params = params.merge(path: 'users.json')\n APICall(params)\n\n end",
"title": ""
},
{
"docid": "006729598db22af2cc940f07be488ae2",
"score": "0.6529629",
"text": "def query_users(options={}) path = \"/api/v2/users\"\n get(path, options, AvaTax::VERSION) end",
"title": ""
},
{
"docid": "a957b7fb912acc8a66d109ea171b7e31",
"score": "0.65289813",
"text": "def show\n respond_to do |format|\n format.html\n format.xml { render :xml => @user }\n end\n end",
"title": ""
},
{
"docid": "666b082c80fba54058d82df616f150f9",
"score": "0.65169686",
"text": "def index\n @users = User.all\n respond_to do |format|\n format.html\n format.xml { render :xml => @users }\n format.json { render :json => @users }\n end\n end",
"title": ""
},
{
"docid": "73c188f01fd6638a6040015f9b51cd15",
"score": "0.65104544",
"text": "def show\n\t\t@user = User.find(params[:id])\n\t\t\n\t\trespond_to do |format|\n\t\t\tformat.html # show.html.erb\n\t\t\tformat.xml\t{ render :xml => @user }\n\t\tend\n\tend",
"title": ""
},
{
"docid": "46c019d1eff73ec48c177e27d2d21a79",
"score": "0.65037584",
"text": "def show\n @user = User.find(params[:id])\n @title = @user.username\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @user.to_xml(:except => [:password_digest, :remember_token])}\n end\n end",
"title": ""
},
{
"docid": "ae9120a67bab43881060bd8c455830d7",
"score": "0.6501142",
"text": "def show\n @user = User.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @user }\n end\n end",
"title": ""
},
{
"docid": "9e9080cd7dbcce8e1db0339c53090c2d",
"score": "0.6470456",
"text": "def show\n @user = User.find(params[:id]) or raise ActiveRecord::RecordNotFound\n respond_to do |format|\n format.html # show.rhtml\n format.xml { render :xml => @user.to_xml }\n end\n end",
"title": ""
},
{
"docid": "082ca14a95bb5382d132161942891e8d",
"score": "0.6467553",
"text": "def index\n users = get_collection(visible_users) || return\n\n respond_to do |format|\n format.xml { render xml: users.to_xml(only: DEFAULT_FIELDS, root: :users, skip_types: true) }\n format.json { render json: users.to_json(only: DEFAULT_FIELDS) }\n end\n end",
"title": ""
},
{
"docid": "3098015403631778014c24480c985fb8",
"score": "0.64651066",
"text": "def users_get_info_response_xml\n <<-XML\n <?xml version=\"1.0\" encoding=\"UTF-8\"?>\n <users_getInfo_response xmlns=\"\" xmlns:xsi=\"\" xsi:schemaLocation=\"\" list=\"true\">\n\t<user>\n\t <uid>kangtk</uid>\n\t <nickname>康泰克</nickname>\n\t <facebig>http://userface3.51.com/ce/25/kangtk_130.gif?v=20071208033821</facebig>\n\t <sex>1</sex>\n\t <vip>3</vip>\n\t <isconfirm>1</isconfirm>\n\t</user>\n </users_getInfo_response>\n XML\n end",
"title": ""
},
{
"docid": "9675f015b3fa9d6f3225fd6b30d76060",
"score": "0.64639586",
"text": "def show\n @user = User.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @user }\n end\n end",
"title": ""
},
{
"docid": "9675f015b3fa9d6f3225fd6b30d76060",
"score": "0.64639586",
"text": "def show\n @user = User.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @user }\n end\n end",
"title": ""
},
{
"docid": "9675f015b3fa9d6f3225fd6b30d76060",
"score": "0.64639586",
"text": "def show\n @user = User.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @user }\n end\n end",
"title": ""
},
{
"docid": "9675f015b3fa9d6f3225fd6b30d76060",
"score": "0.64639586",
"text": "def show\n @user = User.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @user }\n end\n end",
"title": ""
},
{
"docid": "9675f015b3fa9d6f3225fd6b30d76060",
"score": "0.64639586",
"text": "def show\n @user = User.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @user }\n end\n end",
"title": ""
},
{
"docid": "9675f015b3fa9d6f3225fd6b30d76060",
"score": "0.64639586",
"text": "def show\n @user = User.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @user }\n end\n end",
"title": ""
},
{
"docid": "9675f015b3fa9d6f3225fd6b30d76060",
"score": "0.64639586",
"text": "def show\n @user = User.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @user }\n end\n end",
"title": ""
},
{
"docid": "9675f015b3fa9d6f3225fd6b30d76060",
"score": "0.64639586",
"text": "def show\n @user = User.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @user }\n end\n end",
"title": ""
},
{
"docid": "9675f015b3fa9d6f3225fd6b30d76060",
"score": "0.64639586",
"text": "def show\n @user = User.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @user }\n end\n end",
"title": ""
},
{
"docid": "9675f015b3fa9d6f3225fd6b30d76060",
"score": "0.64639586",
"text": "def show\n @user = User.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @user }\n end\n end",
"title": ""
},
{
"docid": "9675f015b3fa9d6f3225fd6b30d76060",
"score": "0.64639586",
"text": "def show\n @user = User.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @user }\n end\n end",
"title": ""
},
{
"docid": "9675f015b3fa9d6f3225fd6b30d76060",
"score": "0.64639586",
"text": "def show\n @user = User.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @user }\n end\n end",
"title": ""
},
{
"docid": "9675f015b3fa9d6f3225fd6b30d76060",
"score": "0.64639586",
"text": "def show\n @user = User.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @user }\n end\n end",
"title": ""
},
{
"docid": "9675f015b3fa9d6f3225fd6b30d76060",
"score": "0.64639586",
"text": "def show\n @user = User.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @user }\n end\n end",
"title": ""
},
{
"docid": "9675f015b3fa9d6f3225fd6b30d76060",
"score": "0.64639586",
"text": "def show\n @user = User.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @user }\n end\n end",
"title": ""
},
{
"docid": "9675f015b3fa9d6f3225fd6b30d76060",
"score": "0.64639586",
"text": "def show\n @user = User.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @user }\n end\n end",
"title": ""
},
{
"docid": "9675f015b3fa9d6f3225fd6b30d76060",
"score": "0.64639586",
"text": "def show\n @user = User.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @user }\n end\n end",
"title": ""
},
{
"docid": "9675f015b3fa9d6f3225fd6b30d76060",
"score": "0.64639586",
"text": "def show\n @user = User.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @user }\n end\n end",
"title": ""
},
{
"docid": "9675f015b3fa9d6f3225fd6b30d76060",
"score": "0.64639586",
"text": "def show\n @user = User.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @user }\n end\n end",
"title": ""
},
{
"docid": "9675f015b3fa9d6f3225fd6b30d76060",
"score": "0.64639586",
"text": "def show\n @user = User.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @user }\n end\n end",
"title": ""
},
{
"docid": "9675f015b3fa9d6f3225fd6b30d76060",
"score": "0.64639586",
"text": "def show\n @user = User.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @user }\n end\n end",
"title": ""
},
{
"docid": "9675f015b3fa9d6f3225fd6b30d76060",
"score": "0.64639586",
"text": "def show\n @user = User.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @user }\n end\n end",
"title": ""
},
{
"docid": "9675f015b3fa9d6f3225fd6b30d76060",
"score": "0.64639586",
"text": "def show\n @user = User.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @user }\n end\n end",
"title": ""
},
{
"docid": "9675f015b3fa9d6f3225fd6b30d76060",
"score": "0.64639586",
"text": "def show\n @user = User.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @user }\n end\n end",
"title": ""
},
{
"docid": "9675f015b3fa9d6f3225fd6b30d76060",
"score": "0.64639586",
"text": "def show\n @user = User.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @user }\n end\n end",
"title": ""
},
{
"docid": "9675f015b3fa9d6f3225fd6b30d76060",
"score": "0.64639586",
"text": "def show\n @user = User.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @user }\n end\n end",
"title": ""
},
{
"docid": "9675f015b3fa9d6f3225fd6b30d76060",
"score": "0.64639586",
"text": "def show\n @user = User.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @user }\n end\n end",
"title": ""
},
{
"docid": "9675f015b3fa9d6f3225fd6b30d76060",
"score": "0.64639586",
"text": "def show\n @user = User.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @user }\n end\n end",
"title": ""
},
{
"docid": "9675f015b3fa9d6f3225fd6b30d76060",
"score": "0.64639586",
"text": "def show\n @user = User.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @user }\n end\n end",
"title": ""
},
{
"docid": "9675f015b3fa9d6f3225fd6b30d76060",
"score": "0.64639586",
"text": "def show\n @user = User.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @user }\n end\n end",
"title": ""
},
{
"docid": "9675f015b3fa9d6f3225fd6b30d76060",
"score": "0.64639586",
"text": "def show\n @user = User.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @user }\n end\n end",
"title": ""
},
{
"docid": "9675f015b3fa9d6f3225fd6b30d76060",
"score": "0.64639586",
"text": "def show\n @user = User.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @user }\n end\n end",
"title": ""
},
{
"docid": "9675f015b3fa9d6f3225fd6b30d76060",
"score": "0.64639586",
"text": "def show\n @user = User.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @user }\n end\n end",
"title": ""
},
{
"docid": "9675f015b3fa9d6f3225fd6b30d76060",
"score": "0.64639586",
"text": "def show\n @user = User.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @user }\n end\n end",
"title": ""
},
{
"docid": "9675f015b3fa9d6f3225fd6b30d76060",
"score": "0.64639586",
"text": "def show\n @user = User.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @user }\n end\n end",
"title": ""
}
] |
c46c69176be67e185ee37644f1de7aa6 | Generates random name suffix, an academic degree | [
{
"docid": "106b31bd586b6368fd566f6a786d8afa",
"score": "0.0",
"text": "def suffix\n fetch_sample(SUFFIXES)\n end",
"title": ""
}
] | [
{
"docid": "31fcb7e043c7643a612be4ec8698ed20",
"score": "0.74953425",
"text": "def random_name\n letters = ('AA'..'ZZ').to_a.sample()\n digits = ('000'..'999').to_a.sample()\n letters + digits\n end",
"title": ""
},
{
"docid": "9cefba15cf6b0a12b49a98cc9a61242b",
"score": "0.74400204",
"text": "def create_name\n prefix = ('A'...'Z').to_a.shuffle[0..1].join('')\n suffix = (100..1000).to_a.sample\n \"#{prefix}#{suffix}\"\n end",
"title": ""
},
{
"docid": "5f4ed07113653f810aa2deb19de83edd",
"score": "0.7325129",
"text": "def generate_name\n @seed ||= 0\n @seed += 1\n \"_anon_#{@seed}\"\n end",
"title": ""
},
{
"docid": "03375a23da1dee666c5f29a3e0ed36dc",
"score": "0.7287409",
"text": "def random_name\n \"#{random_letters(pick_range(4..12)).capitalize} #{random_letters(pick_range(4..12)).capitalize}\"\n end",
"title": ""
},
{
"docid": "03375a23da1dee666c5f29a3e0ed36dc",
"score": "0.7287409",
"text": "def random_name\n \"#{random_letters(pick_range(4..12)).capitalize} #{random_letters(pick_range(4..12)).capitalize}\"\n end",
"title": ""
},
{
"docid": "82e883dea1acce762b420de112e3a00d",
"score": "0.728387",
"text": "def random_name\n (1..3).map {\"\" << rand(26) + 65}.to_s\n end",
"title": ""
},
{
"docid": "a1189fd056320a5fc588234d0629cab9",
"score": "0.7190096",
"text": "def name(for_sex = :random)\n with_same_sex(for_sex) do\n case rand(0..1)\n when 0 then \"#{last_name} #{first_name} #{patronymic}\"\n else \"#{first_name} #{last_name}\"\n end\n end\n end",
"title": ""
},
{
"docid": "d4ce32597a7ada1d3881dd593617f438",
"score": "0.7175923",
"text": "def name(for_sex = :random)\n with_same_sex(for_sex) do\n case rand(0..9)\n when 0 then \"#{prefix} #{first_name} #{last_name} #{suffix}\"\n when 1..2 then \"#{prefix} #{first_name} #{last_name}\"\n else \"#{first_name} #{last_name}\"\n end\n end\n end",
"title": ""
},
{
"docid": "78ebd119e8c32515f08f7fade76656d9",
"score": "0.7163428",
"text": "def name\n\t\t\tnew_name_letters = (0...2).map { ('a'..'z').to_a[rand(26)] }.join.upcase\n\t\t\tnew_name_numbers = (0...3).map { (0..9).to_a[rand(10)] }.join\n\t\t\tnew_name = [new_name_letters, new_name_numbers].join\n\t\t\t3.times do\n\t\t\t\tputs new_name\n\t\t\tend\n\tend",
"title": ""
},
{
"docid": "f8d2e35a9ee0166105e55da23eabefd4",
"score": "0.71538925",
"text": "def generate\n\t name = ' ' + get_starting_letter\n\t # since the name already has a starting letter the total name length will\n\t # be one more than the selected name_length_distribution selected\t\n\t\tname_length_distribution = [3, 3, 4, 4, 4, 5, 5, 5, 6, 6, 7, 8, 9]\n\t\tdesired_length = name_length_distribution.at(@random_number_generator.rand(0...12))\n\t\t\t\t\n\t\t(desired_length - 1).times do\t\t\t\t\t\t\n\t\t\tname += get_next_letter(name[name.length - 2], name[name.length - 1])\n\t\tend\n\n\t\tname += get_last_letter(name[name.length - 1], name[name.length - 2])\n name.lstrip.capitalize\n\tend",
"title": ""
},
{
"docid": "f2bd2ceeb210b8cecf8afccd8ea5bd4f",
"score": "0.7134367",
"text": "def name_suffix\n Faker::Name.suffix\n end",
"title": ""
},
{
"docid": "f2bd2ceeb210b8cecf8afccd8ea5bd4f",
"score": "0.7134367",
"text": "def name_suffix\n Faker::Name.suffix\n end",
"title": ""
},
{
"docid": "e8bf7e1a102fb69d7e0c6498824eb96f",
"score": "0.7049265",
"text": "def random_suffix\n length = 10\n SecureRandom.random_number(36 ** length).to_s(36).rjust(length, '0')\n end",
"title": ""
},
{
"docid": "2ace6c187e60ee116de06277912e9358",
"score": "0.7014781",
"text": "def slug_name\n\t\t\"#{rand(36**5).to_s(36)}-#{name}\"\n\tend",
"title": ""
},
{
"docid": "f5d0ffc2a883aed6ab43bb6a1056a0e5",
"score": "0.6982057",
"text": "def generate\n name = ' ' + get_starting_letter\n # since the name already has a starting letter the total name length will\n # be one more than the selected name_length_distribution selected\n name_length_distribution = [3, 3, 4, 4, 4, 5, 5, 5, 6, 6, 7, 8, 9]\n desired_length = name_length_distribution.at(@random_number_generator.rand(0...12))\n\n (desired_length - 1).times do\n name += get_next_letter(name[name.length - 2], name[name.length - 1])\n end\n\n name += get_last_letter(name[name.length - 1], name[name.length - 2])\n name.lstrip.capitalize\n end",
"title": ""
},
{
"docid": "44945b650b9b50b6e4ae94ebbd69abfc",
"score": "0.6886757",
"text": "def last_name\n case rand(0..1)\n when 0 then male_last_name\n when 1 then female_last_name\n end\n end",
"title": ""
},
{
"docid": "edbc6602d59f465040935f793eed959f",
"score": "0.68725735",
"text": "def last_name\n @seeds[:last_name][Random.rand(0..97)]\n end",
"title": ""
},
{
"docid": "e66896ef0b1451733c38bae9aaa5f3d5",
"score": "0.6858338",
"text": "def generate_name\n name = (\"A\"..\"Z\").to_a.sample(2).join(\"\") + (100..999).to_a.sample.to_s\n if Robot.stored_values.include?(name)\n self.generate_name\n else\n @@existing_names << name\n name\n end\n end",
"title": ""
},
{
"docid": "7d7b09046ffb6a81d50bdccc6ccf9a14",
"score": "0.68107295",
"text": "def random_name(length = 10, char_set = nil)\n if char_set.eql? nil\n char_set = [('a'..'z'), ('A'..'Z')].map {|i| i.to_a }.flatten\n end\n name = (0...length).map{ char_set[rand(char_set.length)] }.join\n end",
"title": ""
},
{
"docid": "677c7abe59578fc06994703b4c428654",
"score": "0.6806861",
"text": "def generate\n ('a'..'z').to_a.shuffle[0, length].join.capitalize\n end",
"title": ""
},
{
"docid": "861dbf9be1cc89f81797c5eafa266028",
"score": "0.6793219",
"text": "def name_female\n case rand(10)\n when 7 then \"#{prefix_female} #{first_name_female} #{last_name}\"\n when 5 then \"#{prefix_female} #{first_name_female} #{last_name}\"\n when 3 then \"#{first_name_female} #{last_name}\"\n when 0 then \"#{first_name_female} #{last_name}\"\n else \"#{first_name_female} #{last_name}\"\n end\n end",
"title": ""
},
{
"docid": "a8a7abec6a551a767a58264f21ca42c4",
"score": "0.6744381",
"text": "def random_name(number)\n charset = Array('a'..'z')\n Array.new(number) { charset.sample }.join\n end",
"title": ""
},
{
"docid": "2fa545297d28b620af143d61de5e04ee",
"score": "0.67297065",
"text": "def gen_name\n name.to_s.downcase\n end",
"title": ""
},
{
"docid": "d90b9bdd28cc718d3824f6a9ac75d7a7",
"score": "0.6666155",
"text": "def create_name\n colors = @colors\n first = colors.sort_by{rand}.first.split('')[0..2].sort_by{rand}.to_s\n last = colors.sort_by{rand}.last.split('')[0..2].sort_by{rand}.to_s\n return \"--- #{first}.#{@remainder}.#{last} ---\"\n end",
"title": ""
},
{
"docid": "460bb1d566e55c6e156d023bc158892c",
"score": "0.6651967",
"text": "def make_name(key = '')\n ## If you don't dup these, words will get concatenated onto them during the join process\n genitive = self.genitive.dup\n definitive = self.definitive.dup\n\n while true\n # 50% chance that the name will be a single word, 50% chance that it will be two words combined somehow\n name = rand < 0.5 ? get_word(key) : nil\n if name.nil?\n # 60% chance that each word will use the same key as invoked\n w1_key = rand < 0.6 ? key : ''\n w1 = get_word(w1_key).capitalize\n w2_key = rand < 0.6 ? key : ''\n w2 = get_word(w2_key).capitalize\n\n # 50% chance to be joined without the lang's genitive word\n if rand > 0.5\n name = join([w1, w2], self.joiner)\n else\n name = join([w1, genitive, w2], self.joiner)\n end\n end\n\n # 10% to prefix with definitive\n name = join([definitive, name], self.joiner) if rand < 0.1\n\n # Generate another one if this doesn't meet the min- or maxchar reqs\n next if (name.length < self.minchar) || (name.length > self.maxchar)\n\n name.capitalize!\n\n # Check to see if this string has already been generated\n used = false\n self.names.each do |lang_name|\n if (name.include? lang_name) || (lang_name.include? name)\n used = true\n break\n end\n end\n\n # Start over if this name exists already\n next if used\n\n self.names << name\n return name\n end\n end",
"title": ""
},
{
"docid": "3b1acc7d3adb151f860eea31985a55c9",
"score": "0.6650052",
"text": "def generate_name_with_digit (digit)\n char_array = ('a'..'z').to_a + ('0'..'9').to_a + ['_'] # char_array.length is 37\n\n quotient = digit\n queue = []\n while true do\n queue.push quotient % N_CHAR\n quotient = (quotient / N_CHAR).round - 1\n if quotient <= -1\n break\n end\n end\n\n name = ''\n while queue.any? do\n name = name + char_array[queue.pop]\n end\n name\n end",
"title": ""
},
{
"docid": "5633d3249f688e6eeb16962f37b8df6e",
"score": "0.66424006",
"text": "def generate_name\n names = []\n File.open(\"names.txt\").each {|str| names << str.chomp}\n @name = names[rand(names.length)]\n end",
"title": ""
},
{
"docid": "bcfaf567ac1297ae5156a8ba7b0b0919",
"score": "0.66221005",
"text": "def random_name(basename = \"maestro\")\n parts = (basename.nil? or basename.empty? ? \"maestro\" : basename).split(\".\")\n parts[0]=\"#{parts[0]}#{name_split_char}#{(0...5).map{ ('a'..'z').to_a[rand(26)] }.join}\"\n parts.join(\".\")\n end",
"title": ""
},
{
"docid": "5906900553835b583902e5e2afaafc09",
"score": "0.6619946",
"text": "def random_name_generator\n letter_array = (\"A\" .. \"Z\").to_a\n three_letters = letter_array.shuffle.pop(3).join(\"\")\n three_numbers = (1..9).to_a.shuffle.pop(3).join(\"\")\n result = three_letters + three_numbers\n end",
"title": ""
},
{
"docid": "bdd71d33ea96c72333c8a1302f33f04e",
"score": "0.6619906",
"text": "def last_name\n range = [*'a'..'z']\n \"#{Helpers::FakeIt.last_name}#{Array.new(5) { range.sample }.join}\"\n end",
"title": ""
},
{
"docid": "edb896153a17c450407b8dee16ea83cb",
"score": "0.6583518",
"text": "def unique_name(name)\n \"pedant_#{name}_#{pedant_suffix}\"\n end",
"title": ""
},
{
"docid": "828f5f38a8d67a7ce6011cb6620dae42",
"score": "0.6566536",
"text": "def name_male\n case rand(10)\n when 7 then \"#{prefix_male} #{first_name_male} #{last_name}\"\n when 5 then \"#{prefix_male} #{first_name_male} #{last_name}\"\n when 3 then \"#{first_name_male} #{last_name}\"\n when 0 then \"#{first_name_male} #{last_name}\"\n else \"#{first_name_male} #{last_name}\"\n end\n end",
"title": ""
},
{
"docid": "f9215f1a832b6b5e6b27739916836777",
"score": "0.6560469",
"text": "def set_unique_name\n salt = rand 1000000\n salt2 = rand 100\n if self.title.blank?\n self.unique_name = \"#{salt}_#{salt2}\" \n else\n self.unique_name = \"#{self.title.gsub(/[^\\w\\.\\-]/,'_').downcase}_#{salt}\"\n end\n end",
"title": ""
},
{
"docid": "3ff089a800609fb6b8c4364f2382d958",
"score": "0.6556416",
"text": "def mk_intro\n [\"Kære \", \"Hej \", \"Goddag, \"].sample + @name\n end",
"title": ""
},
{
"docid": "2f7301389fab53c52ee06f8fab2d7f0a",
"score": "0.65527153",
"text": "def generate_name\n fname = $fnames.sample\n lname = $lnames.sample\n # If the generated name is not unique, call this\n # function again (and so on until it succeeds)\n unless unique_name?(fname + lname)\n generate_name\n end\n return {\n player_fname: fname,\n player_lname: lname,\n player_nickname: fname + $nickname_suffixes.sample,\n family_id: derive_family(lname)\n }\nend",
"title": ""
},
{
"docid": "cc9b66b16ee3fe648e2e41843f7e1f22",
"score": "0.6537382",
"text": "def mk_name\n \"quarley poller #{rand(1_000_000)} #{Time.now.to_i}\"\n end",
"title": ""
},
{
"docid": "e24cab09e49f1bf7148915437c9221e8",
"score": "0.65124935",
"text": "def random_alias\n 12.times.map { (SecureRandom.random_number(26) + 97).chr }.join\n end",
"title": ""
},
{
"docid": "14ec459d70808b938aa9ed31fd15b7fa",
"score": "0.6510777",
"text": "def random_name\n SecureRandom.hex(20)\n end",
"title": ""
},
{
"docid": "4efb22519db7b2b88b05e40246f11eae",
"score": "0.6504954",
"text": "def Name(name)\n\tname = SecureRandom.alphanumeric\nend",
"title": ""
},
{
"docid": "af2a587d02f650099c8fd854be481494",
"score": "0.6480695",
"text": "def female_name\n case rand(0..8)\n when 0, 5 then \"#{first_name(:female)} #{middle_name(:female)}\"\n else first_name(:female)\n end\n end",
"title": ""
},
{
"docid": "163113b1c12cf93db77aaad756404261",
"score": "0.64684296",
"text": "def name\n \"#{WORDS.sample} #{WORDS.sample} #{rand(1_000_000)} #{Time.now.to_i}\"\n end",
"title": ""
},
{
"docid": "f15922727c421a1d2e1026aa67d794b7",
"score": "0.6449609",
"text": "def generate_slug\n rand(36**@@string_length).to_s(36)\n end",
"title": ""
},
{
"docid": "28356444e4f8db3351bf682ed2daed84",
"score": "0.6436593",
"text": "def create_multi_name\n base_name = String.new(Faker::Games::ElderScrolls.creature)\n if base_name.split.size == 1\n adjective = Spicy::Proton.adjective.capitalize\n new_name = base_name.split.unshift(adjective)\n new_name.join(' ')\n else\n return base_name\n end\n end",
"title": ""
},
{
"docid": "6709443026007e69782322ee438dfbf7",
"score": "0.64294887",
"text": "def generatePlayerName(gender)\n\t\tif gender == \"male\"\n\t\t\t\"#{@playerFirstName.sample}#{@playerSecondNameMale.sample}\"\n\t\telse\n\t\t\t\"#{@playerFirstName.sample}#{@playerSecondNameFemale.sample}\"\n\t\tend\n\tend",
"title": ""
},
{
"docid": "b645b89f8123894a80fd39526efd4694",
"score": "0.64188695",
"text": "def da_first_name_m\n %w(Lucas Magnus Mathias Frederik Oliver Emil Mikkel Victor Tobias Sebastian Mads Nikolaj Rasmus Marcus Christian Noah Jonas Jakob Kasper Oscar Andreas Alexander William Simon Gustav Nicklas Malthe Daniel Benjamin Philip Christoffer Anton Jeppe Anders Lasse Carl Silas Jonathan Marius Elias August Patrick Valdemar Thomas Laurits Bertram Martin David Hjalte Albert ).rand\n end",
"title": ""
},
{
"docid": "cd90ba760be9186cfa970caad8b13552",
"score": "0.6401683",
"text": "def create_random_name\n String.new(Faker::Games::ElderScrolls.creature)\n end",
"title": ""
},
{
"docid": "e6d8f7d8ddae99264f21933cb15c0db2",
"score": "0.63543934",
"text": "def generate_name(subject, memo = [])\n until memo.count >= get_const(subject, :limit)\n memo << rand_from_range(subject)\n end\n memo.join\n end",
"title": ""
},
{
"docid": "339a47d9f15e34848a75c2757f35c7be",
"score": "0.63414425",
"text": "def random_suffix(name, env_var=nil)\n return \"#{name}-#{SecureRandom.hex(2)}\" if env_var.nil?\n \"#{ENV.fetch(env_var, name)}-#{SecureRandom.hex(2)}\"\nend",
"title": ""
},
{
"docid": "a7032ee89e7babb29a5ea0bd33e21e3f",
"score": "0.6335774",
"text": "def set_unique_name\n salt = rand 1000000\n salt2 = rand 100\n if self.title.blank?\n self.unique_name = \"#{salt}_#{salt2}\" \n else\n self.unique_name = \"#{sanitized_title.downcase}_#{salt}\"\n end\n end",
"title": ""
},
{
"docid": "43346655676eea0f1a6a7ccece5e7449",
"score": "0.6327603",
"text": "def choose_name\n File.read('nat2020.csv')\n .split[rand(123..667_364)]\n .split(';')[1].capitalize\n end",
"title": ""
},
{
"docid": "c45b68d82e452a287962de259c661c17",
"score": "0.63253903",
"text": "def get_random_profile_name\n @profiles_data[rand(0...@profiles_data.count)][:name]\n end",
"title": ""
},
{
"docid": "479d8e18c74051ce021c1a031cd3272d",
"score": "0.6324142",
"text": "def prefix_female\n PREFIX_FEMALE.rand\n end",
"title": ""
},
{
"docid": "defb64b429b7c30beb1dc5f739a49347",
"score": "0.6309919",
"text": "def planet_name(planet_seed)\n s = planet_seed.clone\n pairs = 4.times.collect do\n pair = letter_pair(s)\n s = next_fib_triple(s)\n pair\n end \n pairs = pairs.take(3) unless long_name?(planet_seed)\n return pairs.join.capitalize, s \n end",
"title": ""
},
{
"docid": "d24af2591a88f1ee083e819f2b6a5841",
"score": "0.62585217",
"text": "def generate(name); end",
"title": ""
},
{
"docid": "fabf8e833e9c6536d4950c7fcdb9f9a2",
"score": "0.6252575",
"text": "def generate_unique_name\n SecureRandom.uuid\n end",
"title": ""
},
{
"docid": "adc1899da6927b45db4400fc5a1090f8",
"score": "0.6218179",
"text": "def generate_username4 (first_name, last_name, birth_year, privilege=\"0\")\n user_priv = \"\"\n if (privilege == 1)\n user_priv = \"seller\"\n elsif (privilege == 2)\n \tuser_priv = \"manager\"\n elsif (privilege == 2)\n \tuser_priv = \"admin\"\n end\n\n if ((birth_year.to_s.length == 4) && (birth_year<2015) && (birth_year>1900))\n \t(privilege >= 1? user_priv += \"-\" : \"\") + first_name.chomp[0].downcase + last_name.downcase + birth_year.to_s.chomp[-2..-1]\n end\nend",
"title": ""
},
{
"docid": "bdb94e4fdaa3e16ea5fe6f35df2bbaf0",
"score": "0.62085223",
"text": "def random_id\n \"#{('a'..'z').to_a.sample}-#{SecureRandom.alphanumeric(6)}\"\n end",
"title": ""
},
{
"docid": "567af09468bf4fb53a31898007e77b79",
"score": "0.6207585",
"text": "def const_name length=rand_base.random_length, &check\n weight = 3\n rand_base.check_result check do\n rand_base.alpha(1, rand_base::ALPHA_UPCASE) + rand_base.alpha(length-1, rand_base::ALPHA_UPCASE + ['_'] * weight)\n end\n end",
"title": ""
},
{
"docid": "5c0a0d3f344f51375a3669f576248a02",
"score": "0.61942697",
"text": "def createRandomUserName20\n len = 20\n # Random capital letter for first and last name\n nameFirst = (65 + rand(26)).chr\n nameLast = (65 + rand(26)).chr\n # Length of first and last remaining lower case letters\n remainingFirst = rand(len - 2) # First name can be between 1 and full length minus 2 (space and at least 1 char for last name)\n remainingLast = rand(len - 2 - remainingFirst) # Last name between 1 and full length minus 2 (space and at least 1 char for first name\n # Remaining letters\n (remainingFirst).times{nameFirst << (97 + rand(26)).chr}\n (remainingLast).times{nameLast << (97 + rand(26)).chr}\n return nameFirst, nameLast\nend",
"title": ""
},
{
"docid": "0ad9119e4373d6184078f2c7f6a16c9a",
"score": "0.61865205",
"text": "def create_single_name\n base_name = String.new(Faker::Games::ElderScrolls.creature)\n if base_name.split.size >= 1\n base_name.split.last\n else\n return base_name\n end\n end",
"title": ""
},
{
"docid": "b2dc231d80db2e2104bf334c01c209d3",
"score": "0.61859787",
"text": "def generate_username_for_district(district_guid, first_name, last_name, iteration = 0)\n username = first_name.downcase[0] + last_name.downcase[0..4]\n username += iteration.to_s if iteration > 0\n return username if username_unique_for_district?(district_guid, username)\n return generate_username_for_district(district_guid, first_name, last_name, iteration + 1)\n end",
"title": ""
},
{
"docid": "f024ef60be2d5beb43d6aa3866bc95a3",
"score": "0.61843854",
"text": "def createGuid\n chars = (0...2).map{ ('a'..'z').to_a[rand(26)] }.join\n prefix = \"#{Time.new.year}#{chars}-\"\n\n return prefix + SecureRandom.uuid\nend",
"title": ""
},
{
"docid": "2a8a520a43a2ec47209d4f350330c9a3",
"score": "0.6166252",
"text": "def full_name_degree\n if degree\n \"#{name}, #{degree}°\"\n else\n \"#{name}\"\n end\n end",
"title": ""
},
{
"docid": "1719cc3ed9e5659c086586215fbca351",
"score": "0.6164837",
"text": "def randomString\n o = [('a'..'z'),('A'..'Z'),(0..9)].map{|i| i.to_a}.flatten \n string = (1..ROOM_NAME_LENGTH).map{ o[rand(o.length)] }.join\n end",
"title": ""
},
{
"docid": "e081aea121b5ee211ced8f50b319fca9",
"score": "0.6145794",
"text": "def getSomeCoolName\n\t\tnames = File.open(\"NazwyKonferencji\").read.split(\"\\n\")\n\t\tnames[rand(names.size)]\n\tend",
"title": ""
},
{
"docid": "e5a6efd865c1b1c2481db214384ab5d4",
"score": "0.6141963",
"text": "def random_test_name\n @fake_name.name\n end",
"title": ""
},
{
"docid": "ecb6807a3da7499d757ad9b7dcfb4f1e",
"score": "0.61321527",
"text": "def prefix_male\n PREFIX_MALE.rand\n end",
"title": ""
},
{
"docid": "c09b04b838732fdc01db37f2b780b798",
"score": "0.6126173",
"text": "def male_name\n case rand(0..8)\n when 0, 5 then \"#{first_name(:male)} #{middle_name(:male)}\"\n else first_name(:male)\n end\n end",
"title": ""
},
{
"docid": "14253273cc09c0fad39b4964e20cfcfb",
"score": "0.6124295",
"text": "def create\n concept = (0..3).map { ('A'..'Z').to_a[rand(26)] }.join\n puts concept\n return concept\n end",
"title": ""
},
{
"docid": "6dbd869b5a250d799dbc6afecd04b812",
"score": "0.61141515",
"text": "def random_string\n (0...100).map { (\"a\"..\"z\").to_a[rand(26)] }.join\n end",
"title": ""
},
{
"docid": "6dbd869b5a250d799dbc6afecd04b812",
"score": "0.61141515",
"text": "def random_string\n (0...100).map { (\"a\"..\"z\").to_a[rand(26)] }.join\n end",
"title": ""
},
{
"docid": "e8ddaeae5b9b878a88ce1f03e396e0ea",
"score": "0.6089105",
"text": "def create_munged_title\n self.munged_title = \"#{title.parameterize}-#{rand(36**3).to_s(36)}\"\n end",
"title": ""
},
{
"docid": "e8ddaeae5b9b878a88ce1f03e396e0ea",
"score": "0.6089105",
"text": "def create_munged_title\n self.munged_title = \"#{title.parameterize}-#{rand(36**3).to_s(36)}\"\n end",
"title": ""
},
{
"docid": "94ffda67f4a4e5552add0ce8771c65aa",
"score": "0.6083094",
"text": "def first_name\n case rand(0..1)\n when 0 then male_first_name\n when 1 then female_first_name\n end\n end",
"title": ""
},
{
"docid": "72816d626a6752ddbb2746213ef7850b",
"score": "0.60794574",
"text": "def generate_name_if_empty\n if name.nil?\n #Check to make sure that the \"random name\" has not already been \n #taken.\n while true\n rname = App.random_name\n break unless App.exists? name: rname\n end\n self.name = rname\n end\n end",
"title": ""
},
{
"docid": "481930fc1fb6009c47a77f78874ff12e",
"score": "0.6075712",
"text": "def first_name_female\n FIRST_NAMES_FEMALE.rand\n end",
"title": ""
},
{
"docid": "55483befab840f935ea9fc305c89e5a4",
"score": "0.60671085",
"text": "def random_common_name(domain_name)\n cert_serial_number(domain_name).to_s(36)\n end",
"title": ""
},
{
"docid": "55483befab840f935ea9fc305c89e5a4",
"score": "0.60671085",
"text": "def random_common_name(domain_name)\n cert_serial_number(domain_name).to_s(36)\n end",
"title": ""
},
{
"docid": "c1a8bd6a1fa93b4bd3a8904b3b02edb8",
"score": "0.6050758",
"text": "def gen_name\n\t\tlast_id = Bill.last ? Bill.last.id + 1 : 1\n\t\t\"#{last_id}-1-1\"\n\tend",
"title": ""
},
{
"docid": "edcb618f2b93d5f30dbe1e07cb8be22e",
"score": "0.6029109",
"text": "def create_last_name(name)\n name.split[0]\n end",
"title": ""
},
{
"docid": "e2381bc9ab85cce03756c97e44e3d3fb",
"score": "0.6028806",
"text": "def da_first_name_f\n %w(Mathilde Laura Sofie Emma Caroline Freja Ida Sara Julie Anna Cecilie Josefine Maja Clara Katrine Amalie Signe Emilie Lærke Victoria Nanna Marie Alberte Isabella Frida Sofia Maria Mille Frederikke Nicoline Camilla Liva Jasmin Anne Andrea Astrid Thea Rebecca Olivia Lea Louise Johanne Line Alma Tilde Malou Mia Emily Sille Selma ).rand\n end",
"title": ""
},
{
"docid": "2edad52fcc8a460455ba8c1ef005ccd5",
"score": "0.60281515",
"text": "def last_name(for_sex = :random)\n fetch_sample(LAST_NAMES[select_sex(for_sex)])\n end",
"title": ""
},
{
"docid": "2edad52fcc8a460455ba8c1ef005ccd5",
"score": "0.60281515",
"text": "def last_name(for_sex = :random)\n fetch_sample(LAST_NAMES[select_sex(for_sex)])\n end",
"title": ""
},
{
"docid": "41d7b0047d0421e6635e38bc0151bdcf",
"score": "0.6023277",
"text": "def full_name_no_prefix(gender = :any)\n case gender\n when :any\n case rand(0..8)\n when 0, 3, 6, 8 then \"#{female_name} #{paternal_last_names}\"\n else \"#{male_name} #{paternal_last_names}\"\n end\n when :male then \"#{male_name} #{paternal_last_names}\"\n when :female then \"#{female_name} #{paternal_last_names}\"\n else raise ArgumentError, 'Invalid gender, must be one of :any, :male, :female'\n end\n end",
"title": ""
},
{
"docid": "9b5905234093fe3117c28dbb5e5dae36",
"score": "0.60062975",
"text": "def gen_email(name)\n firstname = name.split.first\n lastname = name.split.last\n domains = %w(yahoo.com gmail.com privacy.net webmail.com msn.com\n hotmail.com example.com privacy.net)\n return \"#{(firstname + lastname).downcase}\"\\\n \"#{rand(100)}\\@#{domains[rand(domains.size)]}\"\nend",
"title": ""
},
{
"docid": "de459d4d40fab0f6f6926dc889aa0840",
"score": "0.5996606",
"text": "def random_letter\n (rand(93) + 33).chr\n end",
"title": ""
},
{
"docid": "69d3a0250f45dbc0cd1fe6986d7b308f",
"score": "0.5995032",
"text": "def name\n [@n.to_s + character.to_s, symmetry].reject{|p| p == \"\"}.join(\"_\")\n end",
"title": ""
},
{
"docid": "6a4af9175b1498768b1ae504c91aa20d",
"score": "0.5994808",
"text": "def generate_username3 (fir, las, year)\n\tye = year.to_s\n\tfir[0] + las + ye[-2..-1] unless ye.length != 4\nend",
"title": ""
},
{
"docid": "3cb7f2a3b13cf091092acc4cfab5b19d",
"score": "0.59940654",
"text": "def random_lcc\n \"#{random_letters(1).capitalize}#{random_num_string(pick_range(1..3))}.#{random_letters(pick_range(1..3)).capitalize}#{random_num_string(pick_range(1..3))}\"\n end",
"title": ""
},
{
"docid": "3cb7f2a3b13cf091092acc4cfab5b19d",
"score": "0.59940654",
"text": "def random_lcc\n \"#{random_letters(1).capitalize}#{random_num_string(pick_range(1..3))}.#{random_letters(pick_range(1..3)).capitalize}#{random_num_string(pick_range(1..3))}\"\n end",
"title": ""
},
{
"docid": "7a720d2f902eaefde97a5edade1e9404",
"score": "0.5988954",
"text": "def name\n name_faker.name(locale)\n end",
"title": ""
},
{
"docid": "ad3ad81101b7f14e9b787221ad78a272",
"score": "0.5981988",
"text": "def key_pair_name\n\n # return the key_pair_name if one is already generated\n return @key_pair_name if @key_pair_name\n\n # generate on from a random string of 10 upper and lowercase letters\n o = [('a'..'z'), ('A'..'Z')].map { |i| i.to_a }.flatten\n @key_pair_name = (0..10).map { o[rand(o.length)] }.join\n return @key_pair_name\n\n end",
"title": ""
},
{
"docid": "10e0b2dea0c4483c8efa7629b75fcce9",
"score": "0.5974324",
"text": "def suffix\n fetch('university.suffix')\n end",
"title": ""
},
{
"docid": "373405e1d43cb5bc841b8c5a5f7f9a3b",
"score": "0.5969596",
"text": "def randomize_function_name(matchdata)\n id = [*('A'..'Z')].sample(8).join\n \"#{id}#{matchdata[2]}\"\nend",
"title": ""
},
{
"docid": "c370c366e78fec758f625fed0855b515",
"score": "0.59512377",
"text": "def alias_creator(name)\n name.downcase!\n name_array = name.split(' ')\n name_array.reverse!\n # insert method for changing vowels here\n post_vowels = next_vowel(name_array)\n # insert method for changing consonants here#\n new_name = next_consonant(post_vowels)\n # re-capitalize the first letter of each name\n new_name.map! {|word| word.capitalize}\n # take our array and turn it into a string\n puts \"Your automatically generated alias is:\"\n p new_name * \" \"\nend",
"title": ""
},
{
"docid": "31be6a71562c4130e9097f97320195e8",
"score": "0.5948135",
"text": "def build_suffix(id_length = 16)\n possible_suffix = \"\"\n\n (1 .. id_length).each do |id|\n possible_suffix = possible_suffix.concat @possible_chars.sample\n end\n return possible_suffix\nend",
"title": ""
},
{
"docid": "8773011d6bda514467c232984cd16993",
"score": "0.5947879",
"text": "def name_prefix\n Faker::Name.prefix\n end",
"title": ""
},
{
"docid": "8773011d6bda514467c232984cd16993",
"score": "0.5947879",
"text": "def name_prefix\n Faker::Name.prefix\n end",
"title": ""
},
{
"docid": "b778be574a478e80fb412bb45b14726b",
"score": "0.5947788",
"text": "def first_name_male\n FIRST_NAMES_MALE.rand\n end",
"title": ""
},
{
"docid": "e5e2b0ff4701a65c588a6b658df2c695",
"score": "0.5947104",
"text": "def pseudo_random_uppercase_string(length=6)\n (0...length).map{(65 + rand(25)).chr}.join\n end",
"title": ""
},
{
"docid": "49b8d211092f5534386d51f54987cd78",
"score": "0.594589",
"text": "def generate_name(id)\n return GameData::Item[id].exact_name\n end",
"title": ""
}
] |
a89599796715e9b3a33b4e8286e88d0d | Constructor for the FA | [
{
"docid": "b4f962323791f85a3228ff718cbca83f",
"score": "0.0",
"text": "def initialize\n @start = nil \t\t# start state \n @state = { } \t\t# all states\n @final = { } \t\t# final states\n @transition = { }\t# transitions\n @alphabet = [ ] \t# symbols on transitions\n end",
"title": ""
}
] | [
{
"docid": "ac05a838d851efbfb535e00ea7d0d628",
"score": "0.6864821",
"text": "def initialize a, f\n @a = a\n @f = f\n end",
"title": ""
},
{
"docid": "7a035e7b1fa5cf1ebf9948011d3f4cf5",
"score": "0.646923",
"text": "def initialize(a, b, c, d, e, f)\n\t\t@nombre=a\n\t\t@proteinas=b\n\t\t@carbos=c\n\t\t@lipidos=d\n\t\t@gases=e\n\t\t@terreno=f\n\t\t@kcal= ((b*4) + (c*4) + (d*9)).round(1)\n\tend",
"title": ""
},
{
"docid": "8e504634e58ccb6d699a851dea5cb922",
"score": "0.6271445",
"text": "def initialize(f, c)\n @f = f\n @c = c\n end",
"title": ""
},
{
"docid": "b5c167e6323735f55760e985bb13c7be",
"score": "0.6238813",
"text": "def initialize(s,fv)\r\n\t\t@suit = s\r\n\t\t@face_value = fv\r\n\tend",
"title": ""
},
{
"docid": "b5c167e6323735f55760e985bb13c7be",
"score": "0.6238813",
"text": "def initialize(s,fv)\r\n\t\t@suit = s\r\n\t\t@face_value = fv\r\n\tend",
"title": ""
},
{
"docid": "33307da74c524089df9bdb1dc05c65d4",
"score": "0.6154176",
"text": "def to_fa\n self\n end",
"title": ""
},
{
"docid": "a3eda7f5e819a20681e641f8718defd2",
"score": "0.6122699",
"text": "def initialize(peso,talla,edad,sexo,cintura,cadera,factor=0.0)\n\t\t@peso,@talla=peso,talla\n\t\t@edad,@sexo=edad,sexo\n\t\t@cintura,@cadera=cintura,cadera\n\t\t@factor = factor\n\t\t\n\tend",
"title": ""
},
{
"docid": "5a451c23adf38e062a9a3ff281b092bb",
"score": "0.61226314",
"text": "def initialize\n\t\t\t# Call superconstructor\n\t\t\tsuper 220, 'Heighway Dragon'\n\t\t\n\t\t\t# Define the inital state of the sequence.\n\t\t\t@sequence = 'Fa'\t\n\t\tend",
"title": ""
},
{
"docid": "3c81f614278d25aef81cf342390d2446",
"score": "0.6110895",
"text": "def initialize (a,b,c,d,e,f)\n @nombre,@proteinas,@carbohidratos,@lipidos,@gases,@terreno = a,b,c,d,e,f\n end",
"title": ""
},
{
"docid": "bbd3bf02a6b59c3501833951ee30e5f2",
"score": "0.610368",
"text": "def initialize(faces = 6)\n @faces = faces\n @value = nil\n end",
"title": ""
},
{
"docid": "2ea904e282040f6576e3d6753489b9e0",
"score": "0.6087023",
"text": "def initialize(nombre, grasas, grasas_saturadas, hidratos_carbono, azucares, proteinas, sal)\n @nombre = nombre\n @grasas = grasas\n @grasas_saturadas = grasas_saturadas\n @hidratos_carbono = hidratos_carbono\n @azucares = azucares\n @proteinas = proteinas\n @sal = sal\n\t\t@valor_energetico = get_valor_energetico_Kcal()\n end",
"title": ""
},
{
"docid": "7880fc427cd050c9c1596396edd66ec5",
"score": "0.6040397",
"text": "def initialize(options)\n if options[:f]\n self.fahrenheit = options[:f]\n else\n self.celsius = options[:c]\n end\n end",
"title": ""
},
{
"docid": "a36bb41e5efee2dc6fd699dde2c2eb17",
"score": "0.60063213",
"text": "def initialize data\n @csf = CSF::new(data)\n end",
"title": ""
},
{
"docid": "a5189725177e2cc44faf418afbe04fc3",
"score": "0.59762156",
"text": "def initialize(family_name)\n @ant_type = -1\n @ant_locX = nil\n @ant_locY = nil\n @family_name = family_name\n \n end",
"title": ""
},
{
"docid": "5572e7f7fc99d9748fef224fe3d64c3f",
"score": "0.5955999",
"text": "def initialize(f,c,posx, posy, valor)\n\t\tsuper(f,c)\n\t\t@posx = posx\n\t\t@posy = posy\n\t\t@valor = valor\n\n\tend",
"title": ""
},
{
"docid": "f8d03d2da7f15609f802e154d3ca4db3",
"score": "0.59547615",
"text": "def initialize(s, fv) # Arguments to the method\r\n @suit = s\r\n @face_value = fv \r\n end",
"title": ""
},
{
"docid": "9e6d674672d0647ba0ce30fbed6bc069",
"score": "0.5891591",
"text": "def initialize(f, sub)\n @f, @sub = f, sub\n end",
"title": ""
},
{
"docid": "0f896f3f61cf0e7b7b89dad8fca0b777",
"score": "0.5881748",
"text": "def initialize(ida, ea)\n\t\t@ida = ida\n\t\t@ea = ea\n\tend",
"title": ""
},
{
"docid": "778375cee28bf31bfada20d29483821c",
"score": "0.5837924",
"text": "def initialize (fasta)\n @id = fasta.entry_id\n @length = fasta.length\n @hm_pos = {}\n @ht_pos = {}\n @hemi_pos = {}\n @mean_depth = nil\n @sd_depth = nil\n end",
"title": ""
},
{
"docid": "c33baabc6cb28d35eec0d9a42ff30cdb",
"score": "0.58323455",
"text": "def initialize(f, *args)\n @f, @args = f, args\n end",
"title": ""
},
{
"docid": "7ed1b7ce8db46990f2680f1c0c4c39f1",
"score": "0.58251333",
"text": "def initialize(ma,ex,si)\n @ma=ma; @ex=ex; @si=si\n end",
"title": ""
},
{
"docid": "19e1647873cf64ae9adc685a6c90daf3",
"score": "0.58164287",
"text": "def initialize(args = nil)\n @frames = 0\n @wave = Wave.new\n @amp = Fader.new(0.5,0,MathUtils::GR)\n @freq = Fader.new(220,0,MathUtils::GR)\n init_hash(args)\nend",
"title": ""
},
{
"docid": "fcc28939af37c01ad7485e28ae16d5a3",
"score": "0.57934105",
"text": "def initialize(name, color, mass, dist, fact)\n @name = name\n @color = color\n @mass_kg = mass\n @distance_from_sun_km = dist\n @fun_fact = fact\n end",
"title": ""
},
{
"docid": "19a2ce66ea1676e997aba2c06498dbdb",
"score": "0.5790717",
"text": "def initialize(value)\n @value = value\n @face = :down\n end",
"title": ""
},
{
"docid": "8e5e31293bd2deedf696d6bd78f1df18",
"score": "0.57398987",
"text": "def initialize(nombre, proteinas, carbohidratos, lipidos, gei, terreno, eficiencia)\n\t\tsuper(nombre, proteinas, carbohidratos, lipidos, gei, terreno)\n\t\t@eficiencia = eficiencia\n\tend",
"title": ""
},
{
"docid": "35b3bb4eab59c4083ac930013426a6a9",
"score": "0.57329196",
"text": "def initialize(fpath)\n @path = fpath\n end",
"title": ""
},
{
"docid": "5babe05822081872a7298e0a0776347b",
"score": "0.5714697",
"text": "def initialize( cf = [] )\n @dd = [] # differenze finite\n @x = [] # ascisse di interpolazione\n @omega = [] # coefficienti polinomio omega della interpolazione di Newton\n @coeffs = cf # coefficienti polinomio interpolante o polinomio passato\n end",
"title": ""
},
{
"docid": "0bd7471c919f3511b7357386572fbfe0",
"score": "0.5708431",
"text": "def initialize (name, color, mass_kg, distance_from_sun_km, fun_fact)\n @name = name\n @color = color\n @mass_kg = mass_kg\n @distance_from_sun_km = distance_from_sun_km\n @fun_fact = fun_fact\n end",
"title": ""
},
{
"docid": "0bd7471c919f3511b7357386572fbfe0",
"score": "0.5708431",
"text": "def initialize (name, color, mass_kg, distance_from_sun_km, fun_fact)\n @name = name\n @color = color\n @mass_kg = mass_kg\n @distance_from_sun_km = distance_from_sun_km\n @fun_fact = fun_fact\n end",
"title": ""
},
{
"docid": "b9736036f12aab36e3fbf9ec35ce414e",
"score": "0.56983244",
"text": "def initialize(name, fur)\n @name = name\n @fur = fur\n end",
"title": ""
},
{
"docid": "538db14608c1ef80ef6f0c8856c0d958",
"score": "0.5689514",
"text": "def initialize(ajd=0, of=0, sg=ITALY) @ajd, @of, @sg = ajd, of, sg end",
"title": ""
},
{
"docid": "ee0d9159a544440e4235d91c47b41340",
"score": "0.5680527",
"text": "def initialize( nombre, listaAlimentos, listaGramos ) \n super( @nombre = nombre, @listaAlimentos = listaAlimentos, @listaGramos = listaGramos )\n @vct = vctCalculo \n @porcenProteinas = proteinasCalculo\n @porcenLipidos = lipidosCalculo\n @porcenHidratos = hidratosCalculo\n @emisionesDiarias = emisionesCalculo\n @metrosUsoTerreno = metrosCalculo\n end",
"title": ""
},
{
"docid": "2c73c03a5c4d1f8a53b5568f310fcae0",
"score": "0.5674363",
"text": "def initialize(value)\n @face_value = value\n @face_up = false \n\n end",
"title": ""
},
{
"docid": "706f9ecb3192a29f5d89da2e2f5cb236",
"score": "0.56734955",
"text": "def initialize(factor: 1.0, center: nil, spread: nil)\n @factor = factor\n @center = center\n @spread = spread\n end",
"title": ""
},
{
"docid": "c53badc0ed32025f27ed2c2928148ecd",
"score": "0.5669949",
"text": "def initialize(name, fish)\n@name = name\n@fish = fish\nend",
"title": ""
},
{
"docid": "e1332b5f7e86da0cc2d909826beb1d14",
"score": "0.5667836",
"text": "def initialize(temp)\n @temp = initial_convert_to_f(temp)\n end",
"title": ""
},
{
"docid": "bcf1a0a78bc9027b75afd913a46a22f7",
"score": "0.5648888",
"text": "def initialize(name, color, mass_kg, distance_from_sun_km, fun_fact)\n @name = name\n @color = color\n @mass_kg = mass_kg\n @distance_from_sun_km = distance_from_sun_km\n @fun_fact = fun_fact\n end",
"title": ""
},
{
"docid": "5e329570879e945b4c354359cbd0594c",
"score": "0.5647367",
"text": "def initialize(x, y, i, g, h, f)\n @x = x\n @y = y\n @i = i\n @g = g\n @h = h\n @f = f\n end",
"title": ""
},
{
"docid": "5192bb76b4a55b241dbb6e74b6c75b9d",
"score": "0.56465876",
"text": "def initialize(name, color, mass_kg, distance_from_sun_km, fun_fact)\n @name = name\n @color = color\n @mass_kg = mass_kg\n @distance_from_sun_km = distance_from_sun_km\n @fun_fact = fun_fact\n end",
"title": ""
},
{
"docid": "5192bb76b4a55b241dbb6e74b6c75b9d",
"score": "0.56465876",
"text": "def initialize(name, color, mass_kg, distance_from_sun_km, fun_fact)\n @name = name\n @color = color\n @mass_kg = mass_kg\n @distance_from_sun_km = distance_from_sun_km\n @fun_fact = fun_fact\n end",
"title": ""
},
{
"docid": "5192bb76b4a55b241dbb6e74b6c75b9d",
"score": "0.56465876",
"text": "def initialize(name, color, mass_kg, distance_from_sun_km, fun_fact)\n @name = name\n @color = color\n @mass_kg = mass_kg\n @distance_from_sun_km = distance_from_sun_km\n @fun_fact = fun_fact\n end",
"title": ""
},
{
"docid": "a7a3585bca86ed0a18ab5e3b811604c5",
"score": "0.56432915",
"text": "def initialize (fi, co)\n\t\traise ArgumentError, 'El parametro debe ser entero' unless fi.is_a? Integer\n\t\traise ArgumentError, 'El parametro debe ser entero' unless co.is_a? Integer\n\t\t@fi = fi\n\t\t@co = co\n\tend",
"title": ""
},
{
"docid": "413eb7a7781383c931819b4af16b7ad0",
"score": "0.56313384",
"text": "def initialize\n \n end",
"title": ""
},
{
"docid": "413eb7a7781383c931819b4af16b7ad0",
"score": "0.56313384",
"text": "def initialize\n \n end",
"title": ""
},
{
"docid": "3c3fe2d649f6278169c47e474855e343",
"score": "0.5629209",
"text": "def initialize(gr, gr_st,gr_mi,gr_pi,h_d_c,az,pa,am,f_a,pr,nacl)\n\t\t@grasa = gr\n\t\t@grasas_saturadas = gr_st\n\t\t@grasas_monoinsaturadas = gr_mi\n\t\t@grasas_poliinsaturadas = gr_pi\n\t\t\n\t\t@hidratos_de_carbono = h_d_c\n\t\t@azucares= az\n\t\t@polialcoholes = pa\n\t\t@almidones = am\n\t\t@fibra_alimentaria = f_a\n\t\t@proteinas = pr\n\t\t@sales = nacl\n\tend",
"title": ""
},
{
"docid": "f3913429b54dc3c69934b3aafae47ec1",
"score": "0.5628532",
"text": "def initialize(nome, patas, cauda)\n @nome = nome\n @patas = patas\n @cauda = cauda\n end",
"title": ""
},
{
"docid": "d80622790093879f55c31af19af0db2f",
"score": "0.5628426",
"text": "def new\n @famille = Famille.new\n end",
"title": ""
},
{
"docid": "a6904da6bcf7870d228ca9d64cb1fbdc",
"score": "0.56221926",
"text": "def initialize()\n\t\t\t@inicio = nil\n\t\t\t@final = nil\n\t\tend",
"title": ""
},
{
"docid": "1c2d8d8cd2c3e3cc86f0ba22fe7906ef",
"score": "0.562065",
"text": "def initialize(nombre, listaAlimentos, listaGramos)\r\n super(nombre, listaAlimentos, listaGramos)\r\n @co2 = valorTotalCO2\r\n @terreno = terrenoTotal\r\n\r\n end",
"title": ""
},
{
"docid": "db8a1831185959de55e1cd0bb8639b70",
"score": "0.5614341",
"text": "def fei\n self\n end",
"title": ""
},
{
"docid": "a9b7d7b7d6a6efd3631dc3fcd682a9ec",
"score": "0.56130904",
"text": "def initialize(value)\n @value = value\n @face_down = true\n end",
"title": ""
},
{
"docid": "eefa09b61db11fc0eaaf4df8f6379ffc",
"score": "0.56120086",
"text": "def absoluto\n\t\t@numer = @numer.abs\n\t\t@denomin = @denomin.abs\n\t\tFraccion.new(@numer,@denomin)\n\tend",
"title": ""
},
{
"docid": "ed62deedc633d03743ff0e394e1dda63",
"score": "0.56114537",
"text": "def initialize(font_name, codes_name)\n @font_name = font_name\n @codes_name = codes_name\n end",
"title": ""
},
{
"docid": "5f82fcf0cbac082b3495d8e078970c0e",
"score": "0.559681",
"text": "def initialize(paciente)\n\t\t@paciente = paciente\n\t\t@imc = 0.0\n\t\t@porcentaje_grasa = 0.0\n\t\t@rcc = 0.0\n\t\tcalcular()\n\tend",
"title": ""
},
{
"docid": "8af89dad34d284dde9d81253c6ff2b3e",
"score": "0.5596601",
"text": "def initialize(nombre, dieta, gramos)\n @nombre=nombre\n @dieta=dieta\n @gramos=gramos\n end",
"title": ""
},
{
"docid": "4cb5ba160112719d25b6521c6320f32b",
"score": "0.559651",
"text": "def initialize(args)\n\t\t super(args)\n\t\t \n\t\t \n\t\tend",
"title": ""
},
{
"docid": "b65a6634df5e95203eab723e486cbf0e",
"score": "0.55943024",
"text": "def initialize(nome, codigo_funcionario, disciplina) \n super(nome, codigo_funcionario)\n @disciplina = disciplina\n end",
"title": ""
},
{
"docid": "eae8a2393469f99b75db12d690ead856",
"score": "0.55935556",
"text": "def initialize(raza, color , edad)\n\t\t@raza = raza\n\t\t@color = color\n\t\t@edad = edad\n\tend",
"title": ""
},
{
"docid": "c4a493e510317af5729d14acf1b13d8a",
"score": "0.5574895",
"text": "def initialize(name,peso,talla,tricipital,bicipital,subescapular,suprailiaco,brazo,cintura,cadera,sexo,edad,actividad)\n\t\tsuper(name)\n\t\t@peso , @talla , @tricipital , @bicipital, @subescapular ,@suprailiaco , @brazo , @cintura ,@cadera, @sexo, @edad,@actividad = peso , talla , tricipital , bicipital, subescapular ,suprailiaco , brazo , cintura ,cadera, sexo, edad, actividad\n\tend",
"title": ""
},
{
"docid": "2b620bfb20b390349bc017302f7d2e64",
"score": "0.55724186",
"text": "def initialize(name)\n\t\t@name = name\n\t\t@caffiene_level = 0\n\tend",
"title": ""
},
{
"docid": "c7ce981908540fbd78497ebbaa5c2f53",
"score": "0.5567207",
"text": "def initialize(f)\n @f = f.to_sym\n @direction_index = DIRECTIONS.index(@f)\n end",
"title": ""
},
{
"docid": "748bd7b5149abf972e7b72dfbb61e623",
"score": "0.55642515",
"text": "def initialize\t\n\t\tend",
"title": ""
},
{
"docid": "d2a52a16294d03cf65910e7425dac8d2",
"score": "0.555985",
"text": "def initialize (peso, talla, sexo, edad, cintura, cadera)\n @peso = peso\n @talla = talla\n @sexo = sexo\n @edad = edad\n @cintura = cintura\n @cadera = cadera\n end",
"title": ""
},
{
"docid": "640357b4fb3ed09ccb63f27f37428d51",
"score": "0.5557215",
"text": "def initialize(name, color, mass_kg, distance_from_sum_km, fun_fact)\n @name = name\n @color = color\n @mass_kg = mass_kg\n @distance_from_sum_km = distance_from_sum_km\n @fun_fact = fun_fact\n end",
"title": ""
},
{
"docid": "fa2ba7d50dddc9416b3c4cf5694668c4",
"score": "0.5552198",
"text": "def initialize(f, c)\n\t \t@fil=f.to_i; \t \t\n\t \t@col=c.to_i; \n\tend",
"title": ""
},
{
"docid": "bfec75ba54576a40ea45df45e210371a",
"score": "0.55510694",
"text": "def initialize\n \n end",
"title": ""
},
{
"docid": "cea988a8b15d22aa4d3f9ba649bd83ab",
"score": "0.55482435",
"text": "def initialize(angle)\n @angle = angle\n end",
"title": ""
},
{
"docid": "676eb672ce74883aac0f22d95f0c480c",
"score": "0.55412024",
"text": "def initialize(felica_target)\n @felica_target = felica_target\n end",
"title": ""
},
{
"docid": "3cce2dc23a5bfef5f5094aa6e63d201a",
"score": "0.5540791",
"text": "def initialize cf=nil\n\t\t\t@global_names = Array.new\n\t\t\tif @cf != nil and cf != nil\n\t\t\t # print \"PROBLEM\\n\"\n\t\t\t\traise '@cf is already assigned in Parser!'\n\t\t\tend\n\t\t\t@cf = cf if cf != nil\n\t\t\tif @cf == nil\n\t\t\t\t# ---- Dummy assignment\n\t\t\t\t@cf = Cfp_Stat.new \n\t\t\tend\n\t\tend",
"title": ""
},
{
"docid": "be56f169907611a831714bc7ab3e5c56",
"score": "0.5537513",
"text": "def initialize(attrs = {})\n # Valor Prestacao AFRMM\n @value = attrs[:vPrest]\n # Valor AFRMM\n @afrmm = attrs[:vAFRMM]\n # Numero da Reserva\n @booking = attrs[:nBooking]\n # Numero do Controle\n @number = attrs[:nCtrl]\n # Navio\n @ship = attrs[:xNavio]\n # Numero da Viagem\n @travel_number = attrs[:nViag]\n # Direcao\n @direction = attrs[:direc]\n # Porto de Embarque\n @embarkation = attrs[:prtEmb]\n # Porto de Transbordo\n @transshipment = attrs[:prtTrans]\n # Porto de Destino\n @destiny = attrs[:prtDest]\n # Tipo de Navegacao\n @ship_kind = attrs[:tpNav]\n # Irin do navio\n @irin = attrs[:irin]\n\n # Balsas\n if attrs[:balsa]\n @ferry = to_array(attrs[:balsa])\n end\n end",
"title": ""
},
{
"docid": "3ef9a13336b8db77d87c0167feaae418",
"score": "0.5534807",
"text": "def initialize(fur_color, name, anger_level)\n @fur_color = fur_color\n @name = name\n @anger_level = anger_level\n end",
"title": ""
},
{
"docid": "0b5dbb20c6f82d8600a60a9bfe18aff0",
"score": "0.55333036",
"text": "def initialize amounts = 1, faces = 20\n @amounts = amounts\n @faces = faces\n end",
"title": ""
},
{
"docid": "4d2d93fb621b0bd896c0776d51c17ea1",
"score": "0.5522809",
"text": "def initialize(nombre,edad,sexo,weight,tall,factor)\n\t\tsuper(nombre,edad,sexo)\n\t\t@peso=weight\n\t\t@altura=tall\n\t\t@factor=factor\n\tend",
"title": ""
},
{
"docid": "cbb5de25fec3aad7d43753577ecd951c",
"score": "0.55189675",
"text": "def initialize( name, content )\n @name = name\n @basics = []\n @content = []\n @cal = 0\n content.each do |f| \n @basics += [f]\n @content += [f.name]\n @cal += f.cal\n end\n end",
"title": ""
},
{
"docid": "51eff41d9602633128ee3c4d7b354410",
"score": "0.551514",
"text": "def initialize c\n\t\t@cadena = c\n\tend",
"title": ""
},
{
"docid": "095595cee00689d82344c2ab620245c1",
"score": "0.5511331",
"text": "def initialize(f, opts={})\n @file = f\n @options = opts\n @index = file+\".tbi\"\n return self\n end",
"title": ""
},
{
"docid": "72fb8962e74a9cd11235b9d3836a86b2",
"score": "0.55074835",
"text": "def initialize\nsuper\t\t\t\t\t\t#initializing the parent class Bf\ninit_Dsbfpp\t\t\t\t\t#Initializing Bfpp data structures\nflag\t\t\t\t\t\t#Initializing Bfpp flags\nend",
"title": ""
},
{
"docid": "46ac686a230c10e2f8abafba2cc75a7a",
"score": "0.55053264",
"text": "def initialize size=1, angle=0\n super()\n @size = size\n @angle = angle\n self\n end",
"title": ""
},
{
"docid": "2508b51aaeb738714ea35951e283f7db",
"score": "0.5505167",
"text": "def initialize(filestructur)\n @pfs = filestructur\n end",
"title": ""
},
{
"docid": "15fdf74b1cbac5c0754823d77ce332be",
"score": "0.55040336",
"text": "def initialize()\n\t\t@experiencia = 0\n\t\t@annos = 0\n\t\t@contador = 0\n\tend",
"title": ""
},
{
"docid": "0534c24dc594d89d5ea8fe2c87598529",
"score": "0.5500267",
"text": "def initialize(a, d)\n if Center_Battlers\n x = ((640 / Max_Party) * ((4 - $game_party.actors.size)/2.0 + a.index)).floor\n else\n x = a.index * 160\n end\n text = []\n text.push(['Nível:', d[0], a.level]) if d[0] != a.level\n text.push([$data_system.words.hp[0, 3], d[1], a.maxhp]) if d[1] != a.maxhp\n text.push([$data_system.words.sp[0, 3], d[2], a.maxsp]) if d[2] != a.maxsp\n text.push([$data_system.words.str[0, 3], d[3], a.str]) if d[3] != a.str\n text.push([$data_system.words.dex[0, 3], d[4], a.dex]) if d[4] != a.dex\n text.push([$data_system.words.agi[0, 3], d[5], a.agi]) if d[5] != a.agi\n text.push([$data_system.words.int[0, 3], d[6], a.int]) if d[6] != a.int\n h = text.size * 24 + (Old_Exp_Display ? 56 : 80)\n @limit = 320 - h\n y = 480 - h + (h / 64 + 1) * 64\n super(x, y, 160, h)\n self.z, self.back_opacity = 4500, Base_Opacity\n self.contents = Bitmap.new(self.width - 32, self.height - 32)\n if $fontface != nil\n self.contents.font.name = $fontface\n elsif $defaultfonttype != nil\n self.contents.font.name = $defaultfonttype\n end\n self.contents.font.size, self.contents.font.bold = 20, true\n unless Old_Exp_Display\n self.contents.font.color = normal_color\n self.contents.draw_text(0, 24, 128, 24, \"#{a.exp - d[7]} EXP\", 1)\n end\n self.contents.font.color = system_color\n self.contents.draw_text(0,0, 128, 24, \"#{a.name}\",1)\n text.each_index {|i|\n index = Old_Exp_Display ? i : i + 1\n self.contents.draw_text(0, (index * 24) + 24, 128, 24, text[i][0])\n self.contents.draw_text(80, (index * 24) + 24, 32, 24, '»')\n self.contents.font.color = normal_color\n self.contents.draw_text(0, (index * 24) + 24, 76, 24, text[i][1].to_s, 2)\n if text[i][1] > text[i][2]\n self.contents.font.color = Color.new(255, 64, 0)\n else\n self.contents.font.color = Color.new(0, 255, 64)\n end\n self.contents.draw_text(0, (index * 24) + 24, 128, 24, text[i][2].to_s, 2)}\n end",
"title": ""
},
{
"docid": "0795247c5f51dc342dc8186db385f504",
"score": "0.55002373",
"text": "def initialize(ipa, features = FeatureValueMatrix.new)\n @ipa = ipa\n @features = features\n end",
"title": ""
},
{
"docid": "7dfea38164761bb8dd9663f396a726ac",
"score": "0.5496308",
"text": "def initialize(protein, carb, fat, alcohol=0)\n self.protein = protein\n self.carb = carb\n self.fat = fat\n self.alcohol = alcohol\n end",
"title": ""
},
{
"docid": "c6116a572da53228c0ff0d98bc9a2bfc",
"score": "0.5494049",
"text": "def initialize\n end",
"title": ""
},
{
"docid": "c6116a572da53228c0ff0d98bc9a2bfc",
"score": "0.5494049",
"text": "def initialize\n end",
"title": ""
},
{
"docid": "c6116a572da53228c0ff0d98bc9a2bfc",
"score": "0.5494049",
"text": "def initialize\n end",
"title": ""
},
{
"docid": "c6116a572da53228c0ff0d98bc9a2bfc",
"score": "0.5494049",
"text": "def initialize\n end",
"title": ""
},
{
"docid": "c6116a572da53228c0ff0d98bc9a2bfc",
"score": "0.5494049",
"text": "def initialize\n end",
"title": ""
},
{
"docid": "c6116a572da53228c0ff0d98bc9a2bfc",
"score": "0.5494049",
"text": "def initialize\n end",
"title": ""
},
{
"docid": "c6116a572da53228c0ff0d98bc9a2bfc",
"score": "0.5494049",
"text": "def initialize\n end",
"title": ""
},
{
"docid": "c6116a572da53228c0ff0d98bc9a2bfc",
"score": "0.5494049",
"text": "def initialize\n end",
"title": ""
},
{
"docid": "c6116a572da53228c0ff0d98bc9a2bfc",
"score": "0.5494049",
"text": "def initialize\n end",
"title": ""
},
{
"docid": "05d14661d66e398ca1f1a3051683ae72",
"score": "0.5492187",
"text": "def initialize(ida)\n\t\t@ida = ida\n\tend",
"title": ""
},
{
"docid": "e1be7618a6652b426e38ab49d3e123d3",
"score": "0.5487058",
"text": "def initialize(nombre,proteinas,glucidos,grasas,individuos)\n\t\t@nombre = nombre\n\t\t@proteinas = proteinas\n\t\t@glucidos = glucidos\n\t\t@grasas = grasas\n\t\t@cal\n\t\t@individuos = individuos\n\tend",
"title": ""
},
{
"docid": "96bab63d318d252a49163a5fbc58e45e",
"score": "0.5484935",
"text": "def initialize(name, freq, minVal, maxVal, waveForm = :sin, stepCount = 1024 * 5)\n @name = name\n @stepCount = stepCount\n @stepDur = (1/freq.to_f)/@stepCount\n @prevTime = 0\n @acc = 0\n setWaveForm(waveForm, minVal, maxVal)\n end",
"title": ""
},
{
"docid": "d32889b9369fe54ad531a2ed6e9242fe",
"score": "0.5484612",
"text": "def initialize(name, fact)\n @name = name\n @fact = fact\n @confines = []\n @value = nil\n @timeout = 0\n @weight = nil\n end",
"title": ""
},
{
"docid": "22184715e62765b3f6bdf0be89088392",
"score": "0.548275",
"text": "def initialize(nombre, apellidos, edad, genero, peso, talla, cadera, cintura, imc, porcentgrasa, rcc, peso_t_i, gasto_e_basal, efecto_t_a, gasto_ef, factor_actvf, gasto_e_total)\n\n \n \n \n \n @nombre = nombre\n @apellidos = apellidos\n @edad = edad\n @genero = genero\n @peso = peso\n @talla = talla\n @cadera = cadera\n @cintura = cintura\n @imc = imc\n @porcentgrasa = porcentgrasa\n @rcc = rcc\n @peso_t_i = peso_t_i\n @gasto_e_basal = gasto_e_basal\n @efecto_t_a = efecto_t_a\n @gasto_ef = gasto_ef\n @factor_actvf = factor_actvf\n @gasto_e_total = gasto_e_total\n \n \n \n end",
"title": ""
},
{
"docid": "507574223531dbfaf9770d71fdce417b",
"score": "0.5481659",
"text": "def initialize (nombre, tipo, importe = 0.0, titulo_propiedad=nil, num_casilla_carcel=1, mazo=nil)\n @nombre = nombre\n @tipo = tipo\n @importe = importe\n @mazo = mazo\n @titulo_propiedad = titulo_propiedad\n if num_casilla_carcel != 1\n @@carcel = num_casilla_carcel\n end\n @sorpresa = nil\n end",
"title": ""
},
{
"docid": "18250542a2b1999be90588db1d071d92",
"score": "0.5472516",
"text": "def initialize\n\t\t\n\tend",
"title": ""
},
{
"docid": "50bc564bd09d788449fdc0af17c583b7",
"score": "0.54723895",
"text": "def initialize(f)\n if f.is_a? String\n super({\"filename\"=>f})\n else\n super(f)\n end\n end",
"title": ""
},
{
"docid": "dcd30c96d23972f713cfb64f747303e2",
"score": "0.5466252",
"text": "def initialize(aName, fused)\n @i_name = aName\n @elements = fused\n end",
"title": ""
}
] |
d79482f6259c7c9d1d89bf6891ed00a3 | POST /knowledges POST /knowledges.json | [
{
"docid": "a736bda722fba5dc0f6bbc9dcae5cf46",
"score": "0.0",
"text": "def create\n @knowledge = Knowledge.new(params[:knowledge])\n @identities=Identity.all\n @identities_choose=[]\n @timelines_choose=[]\n @timelines=[]\n @categories_choose=[]\n @categories=[]\n if params[:knowledge].has_key? \"identity_list\"\n params[:knowledge][:identity_list].each do |identity_id|\n if identity_id.present?\n @identities_choose.push(Identity.find(identity_id.to_i)) if Identity.find(identity_id.to_i)\n end\n end\n end\n if params[:knowledge].has_key? \"timeline_list\"\n params[:knowledge][:timeline_list].each do |timeline_id|\n if timeline_id.present?\n @timelines_choose.push(Timeline.find(timeline_id.to_i)) if Timeline.find(timeline_id.to_i)\n end\n end\n end\n if params[:knowledge].has_key? \"category_list\"\n params[:knowledge][:category_list].each do |category_id|\n if category_id.present?\n @categories_choose.push(Category.find(category_id.to_i)) if Category.find(category_id.to_i)\n end\n end\n end\n\n\n\n #####################################\n unless @identities_choose.compact.empty?\n @identities_choose.each do |identity|\n identity = Identity.find_by_name(identity.name)\n @timelines += identity.children.all\n end\n end\n\n\n unless @timelines_choose.compact.empty?\n @timelines_choose.each do |timeline|\n #timeline = Timeline.find_by_name(timeline.name)\n #@categories += timeline.children.all\n Timeline.where(name:timeline.name).each do |t|\n @categories += t.children.all if @identities_choose.include? t.parent\n end\n end\n end\n if params[:knowledge].has_key? :face\n respond_to do |format|\n if @knowledge.update_attributes(params[:knowledge])\n format.html { redirect_to @knowledge, notice: 'knowledge was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"new\" }\n format.json { render json: @knowledge.errors, status: :unprocessable_entity }\n end\n end\n else\n if params[:commit] == 'refresh'\n #unless @timelines.empty?\n # @timelines.each do |timelines|\n # @categories_list += timeline.children.all\n # end\n #end\n #@identities_choose.map!(&:id)\n #@timelines_choose.map!(&:id)\n #@categories_choose.map!(&:id)\n\n render :refresh\n else\n @knowledge.identity_list = @identities_choose.map(&:name) if @identities_choose.present?\n @knowledge.timeline_list = @timelines_choose.map(&:name) if @timelines_choose.present?\n @knowledge.category_list = @categories_choose.map(&:name) if @categories_choose.present?\n\n @knowledge.if_soft_deleted(params[:knowledge][:soft_deleted],current_user) if params[:knowledge][:soft_deleted].present?\n\n\n if @knowledge.save\n flash[:notice] = 'Knowledge was successfully updated.'\n #render js: %[window.location.pathname='#{knowledge_path(@knowledge)}']\n #format.html { redirect_to @knowledge, notice: 'Knowledge was successfully created.' }\n #format.json { render json: @knowledge, status: :created, location: @knowledge }\n #because update the file field not use render js\n render :create\n else\n flash[:notice] = 'Knowledge updated failure.'\n respond_to do |format|\n format.html { render action: \"new\" }\n #format.js { render action: \"new\" }\n format.json { render json: @knowledge.errors, status: :unprocessable_entity }\n end\n end\n end\n end\n end",
"title": ""
}
] | [
{
"docid": "6cffa9126e695912ccf784ae4a2fe952",
"score": "0.60486805",
"text": "def create\n @knowledge = current_user.knowledges.new(params[:knowledge])\n\n respond_to do |format|\n if @knowledge.save\n format.html { redirect_to @knowledge, notice: 'Knowledge was successfully created.' }\n format.json { render json: @knowledge, status: :created, location: @knowledge }\n else\n format.html { render action: \"new\" }\n format.json { render json: @knowledge.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6ba26507691c48e1b2901ca592302685",
"score": "0.5869254",
"text": "def new\n @knowledge = current_user.knowledges.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @knowledge }\n end\n end",
"title": ""
},
{
"docid": "9a923a0e40383a12d8f35e14085acbf1",
"score": "0.56131476",
"text": "def create\n @carrierknowledghe = Carrierknowledghe.new(carrierknowledghe_params)\n\n respond_to do |format|\n if @carrierknowledghe.save\n format.html { redirect_to @carrierknowledghe, notice: 'Carrierknowledghe was successfully created.' }\n format.json { render :show, status: :created, location: @carrierknowledghe }\n else\n format.html { render :new }\n format.json { render json: @carrierknowledghe.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1777312d63fcd97ff16a7f623b9f8da3",
"score": "0.55864567",
"text": "def index\n @knowledges = Knowledge.order(\"created_at desc\")\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @knowledges }\n end\n end",
"title": ""
},
{
"docid": "9f50bb9003d16920f7f26b1091cfb256",
"score": "0.5460759",
"text": "def create\n topic = Topic.new(topic_params)\n if topic.save\n response_data = {\n status: 'success',\n txt: ['質問を投稿しました!'],\n }\n else\n response_data = {\n status: 'error',\n txt: topic.errors.full_messages,\n }\n end\n render json: response_data\n end",
"title": ""
},
{
"docid": "933a02a886102200a7fdee54e2cfc694",
"score": "0.54190147",
"text": "def create\n params[\"balance_enquiry\"][\"karigar_id\"] = params[\"karigar_id\"]\n @balance_enquiry = BalanceEnquiry.new(balance_enquiry_params)\n respond_to do |format|\n if @balance_enquiry.save\n format.html { redirect_to karigar_balance_enquiries_path(@karigar), notice: 'Balance enquiry was successfully created.' }\n format.json { render :show, status: :created, location: @balance_enquiry }\n else\n format.html { render :new }\n format.json { render json: @balance_enquiry.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "56b86c8c242b7ac912ba9def5214203f",
"score": "0.5368599",
"text": "def index\n @knowledges = Knowledge.all\n end",
"title": ""
},
{
"docid": "6a939f6b79ae292bfa41f8b2425828d4",
"score": "0.52017134",
"text": "def create\n #@incident = @quote.incidents.new(incident_params)\n logger.info params[:incident]\n params[:incident].each do |incident|\n @incident = @quote.incidents.new(incident)\n @incident.save\n end\n respond_to do |format|\n format.json { render :json => { :code => \"201\", :description => \"Created incidents\"} }\n end\n end",
"title": ""
},
{
"docid": "a7c46a26c12c45cfc22fef984d8f307a",
"score": "0.5134812",
"text": "def create\n extra = ParamsFormatter.new(params[:enquiry]).generate\n @enquiry = Enquiry.new(enquiry_params.merge(extra))\n respond_to do |format|\n if @enquiry.save\n format.html { redirect_to @enquiry, notice: 'Enquiry was successfully created.' }\n format.json { render :show, status: :created, location: @enquiry }\n else\n format.html { render :new }\n format.json { render json: @enquiry.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0f3639792bcdff513d9e0ad423a0c9cd",
"score": "0.5105741",
"text": "def data_to_api(snack_name, snack_location, snack_optional)\n RestClient.post ENV['NERDERY_API'], { name: snack_name,\n location: snack_location,\n optional: snack_optional\n }.to_json, content_type: :json\n end",
"title": ""
},
{
"docid": "473950e22202511e679d6cc0ae1a4b87",
"score": "0.5099558",
"text": "def create\n # @attention = Attention.new(attention_params)\n # @attention.participants = params[:participants]\n # @attention.responsible = params[:responsible]\n # @attention.nro_involved = params[:participants].count + 1\n\n # respond_to do |format|\n # if @attention.save\n # format.html { redirect_to @attention, notice: 'Attention was successfully created.' }\n # format.json { render :show, status: :created, location: @attention }\n # else\n # format.html { render :index }\n # format.json { render json: @attention.errors, status: :unprocessable_entity }\n # end\n # end\n end",
"title": ""
},
{
"docid": "5fc03d57a379cac712247dd5d68359ad",
"score": "0.50881994",
"text": "def create\n @interest = GtInterest.new(:email => params[:email], :priority_code => params[:priority_code])\n if @interest.save\n @status = 200\n\n # Don't want to email when using this model to test \"subscribe via email\" signups\n unless /subscribe_to_roll:.+/.match(params[:priority_code])\n ShelbyGT_EM.next_tick { GtInterestMailer.interest_autoresponse(@interest.email).deliver }\n end\n else\n render_error(400, \"must have a valid email\")\n end\n end",
"title": ""
},
{
"docid": "7e7240c1aabfd1367dfc1a957d7cad5c",
"score": "0.50741667",
"text": "def create_post topic_id, payload\n\t\t\t\t\tFreshdesk::Api::Client.convert_to_hash( @connection.post POSTS, payload, topic_id, nil, \"create_post\" )\n\t\t\t\tend",
"title": ""
},
{
"docid": "e4a0809bb74bfb824681fd3d167b16c2",
"score": "0.50425446",
"text": "def create\n\n if params[:sheduled_message].has_key? '0'\n params[:sheduled_message].each do |sm|\n # raise sm.last.to_hash.to_yaml\n SheduledMessage.create sm.last.to_hash\n end\n respond_to do |format|\n format.html { redirect_to root_path, notice: 'Messages was successfully queued.' }\n end\n else\n @sheduled_message = SheduledMessage.new(params[:sheduled_message])\n\n respond_to do |format|\n if @sheduled_message.save\n format.html { redirect_to @sheduled_message, notice: 'Sheduled message was successfully created.' }\n format.json { render json: @sheduled_message, status: :created, location: @sheduled_message }\n else\n format.html { render action: \"new\" }\n format.json { render json: @sheduled_message.errors, status: :unprocessable_entity }\n end\n end\n end\n\n \n end",
"title": ""
},
{
"docid": "3208906e2549ccca6c0c0ce49ab7ee8f",
"score": "0.50265867",
"text": "def add_snack\n response = RestClient.post SNACKS_URL, {name: @suggestion.name, location: @suggestion.location}.to_json, content_type: :json\n logger.debug \"web service response code => #{response.code}\"\n if response.code != 200\n flash[:notice] = \"Error: #{response.code} while communicating with services, please try again later.\"\n end\n parsed = JSON.parse(response) \n end",
"title": ""
},
{
"docid": "9f699c2f96e0141230b9759ae372c13f",
"score": "0.50206363",
"text": "def destroy\n @knowledge = current_user.knowledges.find(params[:id])\n @knowledge.destroy\n\n respond_to do |format|\n format.html { redirect_to knowledges_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "914e641692deccf4818bb098d65c3ac0",
"score": "0.5018448",
"text": "def create\n @snack = Snack.new(snack_params)\n\n respond_to do |format|\n if @snack.save\n format.html { redirect_to @snack, notice: 'Snack was successfully created.' }\n format.json { render :show, status: :created, location: @snack }\n else\n format.html { render :new }\n format.json { render json: @snack.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f18a3a7ebaa2f023cd39263ca2c8f7c5",
"score": "0.5002765",
"text": "def create\n\n @enrollment = Enrollment.new(properties_data: enrollment_properties_params)\n #debugger\n #@enrollment = Enrollment.new()\n #render json: request.raw_post(), status: :created\n\n if @enrollment.save\n render json: {:reference_number => @enrollment.reference_number}, status: :created\n else\n render json: @enrollment.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "b1e5ac18442edd266a1667b23c0e1ed2",
"score": "0.49906895",
"text": "def email_kyc_approve(data_to_format)\n {}\n end",
"title": ""
},
{
"docid": "f5d652b47ead762322411e1122265898",
"score": "0.4978807",
"text": "def create\n @enquiry = Enquiry.new(enquiry_params)\n\n respond_to do |format|\n if @enquiry.save\n format.html { redirect_to @enquiry, notice: 'Enquiry was successfully created.' }\n format.json { render :show, status: :created, location: @enquiry }\n else\n format.html { render :new }\n format.json { render json: @enquiry.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d3085582bb8bda3c513461e82b157875",
"score": "0.49780235",
"text": "def create\n student = Student.where(\"full_name ilike ?\", params[:walkathon_pledge][:student_name]).first rescue nil\n @walkathon_pledge =\n Walkathon::Pledge.where(student: student, sponsor_name: params[:walkathon_pledge][:sponsor_name]).first rescue nil if student\n\n # There was an old pledge. Delete it.\n @walkathon_pledge.delete if @walkathon_pledge\n\n @walkathon_pledge = Walkathon::Pledge.new(\n params[:walkathon_pledge][:pledge_type] == 'fixed' ? fixed_params : per_lap_params\n )\n @walkathon_pledge.student = student\n\n lap_record = Walkathon::LapCount.find_by_student_id(student.id) if student\n @walkathon_pledge.lap_count = lap_record.lap_count if lap_record\n\n respond_to do |format|\n if @walkathon_pledge.save\n UserMailer.new_pledge_email(student).deliver\n format.html { redirect_to :thankyou, notice: 'Pledge was successfully created.' }\n format.json { render :show, status: :created, location: @walkathon_pledge }\n else\n format.html { render :new }\n format.json { render json: @walkathon_pledge.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "fbb0ed2d295f43e18bc45cd477845ae8",
"score": "0.4975928",
"text": "def add_bounce\n begin\n RestClient.post $cnf['mailgun']['apikey'] + $cnf['mailgun']['bounnces'],\n :address => 'bkotu6717@gmail.com'\n rescue Exception => e\n puts \"Exception raised add_bounce:\" + e.class.to_s\n puts e.message\n end\n end",
"title": ""
},
{
"docid": "0c3e96bb42dd909b4a25b38b8434f9f1",
"score": "0.49736595",
"text": "def create\n @correspondence = Correspondence.new_from_sendgrid(params)\n @correspondence.save\n render :text => \"Saved\", :status => 200\n end",
"title": ""
},
{
"docid": "309ec60cc7d4f0b454c80ef0d229495f",
"score": "0.4965792",
"text": "def create\n\n @pledge = Pledge.new\n @pledge.pledge_title = params[:pledge]['pledge_title']\n @pledge.pledge_description = params[:pledge]['pledge_description']\n @pledge.user_id = current_user.id\n @pledge.save()\n\n respond_to do |format|\n if @pledge.save\n format.html { redirect_to @pledge, notice: 'Pledge was successfully created.' }\n format.json { render json: @pledge, status: :created, location: @pledge }\n else\n format.html { render action: \"new\" }\n format.json { render json: @pledge.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "590eb1f2f7fd006362beb55399dd7b5e",
"score": "0.49219084",
"text": "def create\n @pledge = Pledge.new(params[:pledge])\n\n respond_to do |format|\n if @pledge.save\n format.html { redirect_to @pledge, notice: 'Pledge was successfully created.' }\n format.json { render json: @pledge, status: :created, location: @pledge }\n else\n format.html { render action: \"new\" }\n format.json { render json: @pledge.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "78cc5318c763aa63f2a48cef1cdbe551",
"score": "0.4921237",
"text": "def create\n @sigurance = Sigurance.new(sigurance_params)\n @sigurance.save!\n\n SiguranceMailer.new_sigurance(@sigurance).deliver_now\n\n respond_to do |format|\n if @sigurance.save\n format.html { redirect_to @sigurance, notice: 'Sigurance was successfully created.' }\n format.json { render :show, status: :created, location: @sigurance }\n else\n format.html { render :new }\n format.json { render json: @sigurance.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "52375b962ec25386d5d397c1e5c0c0f3",
"score": "0.49172804",
"text": "def create\n @enquiry = Enquiry.new(enquiry_params)\n\n respond_to do |format|\n if @enquiry.save\n format.html { redirect_to root_path, notice: 'Message was successfully sent.' }\n format.json { render :show, status: :created, location: @enquiry }\n else\n format.html { render :new }\n format.json { render json: @enquiry.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a8320cab14a981149b5a2faaccf03902",
"score": "0.49109828",
"text": "def post_announcement\n @user = @receiver\n @notification = @user.notifications.find_by(path: \"/announcements/#{@announcement.id}\")\n mail to: @user.email, subject: \"[bootcamp] #{@announcement.user.login_name}さんからお知らせです。\"\n end",
"title": ""
},
{
"docid": "4fba8b8f88ad451fb3713dc65178ed5d",
"score": "0.49039787",
"text": "def create(args) \n help_form = {:tNote => args[:note],\n :xCategory => args[:category],\n :sFirstName => args[:first_name],\n :sLastName => args[:last_name],\n :sUserId => args[:user_id],\n :sEmail => args[:email],\n :sPhone => args[:phone],\n :fUrgent => args[:urgent]}.reject!{|k,v| v == nil}\n \n JSON.parse(api_request('request.create', 'POST', help_form))['xRequest'] rescue []\n end",
"title": ""
},
{
"docid": "4a468718465b84d09ed7199f03caa963",
"score": "0.49013025",
"text": "def create_intervention_ticket\n #Call zendesk API create new client method\n client = ZendeskAPI::Client.new do |config|\n #Get config parameters from application.yml \n #These parameters are ignored by git \n config.url = ENV['ZENDESK_URL']\n config.username = ENV['ZENDESK_USERNAME']\n config.token = ENV['ZENDESK_TOKEN']\n end\n #create the ticket \n ZendeskAPI::Ticket.create!(client,\n #define subject with the current user name \n :subject => \"NEW INTERVENTION created by : \" + @currentusername.to_s ,\n #Requirements : \n # The Requester\n # The Customer (Company Name)\n # Building ID\n # The Battery ID\n # The Column ID if specified\n # Elevator ID if specified\n # The employee to be assigned to the task\n # Description of the request for intervention\n\n :comment => \"The customer ID : #{params[:customer]} \n Building ID : #{params[:building]} \n Battery ID : #{params[:battery]} \n Column ID : #{params[:column]} \n Elevator ID : #{params[:elevator]} \n Affected employee ID : #{params[:employee]} \n Description : #{params[:report]} \",\n #Set the priority \n :priority => \"urgent\",\n #Set the type \n :type => \"question\")\n end",
"title": ""
},
{
"docid": "c4cdbb6f89029767efc891b0b9c3ec02",
"score": "0.48910707",
"text": "def create\n begin\n params[:delivery][:attach_ids]=params[:delivery][:attach_ids].join(\",\")\n rescue => err\n p err\n end\n rm_unneed_attach\n \n @delivery=Delivery.new(params[:delivery])\n respond_to do |format|\n if @delivery.save\n format.html { redirect_to deliveries_url, notice: '送货单 成功创建.' }\n format.json { render json: @delivery, status: :created, location: @note }\n else\n format.html { render action: \"new\" }\n format.json { render json: @delivery.errors, status: :unprocessable_entity }\n end\n end\n\n end",
"title": ""
},
{
"docid": "7091becb1542dc9735f78ef9ef47a33c",
"score": "0.4882591",
"text": "def enquiries_post(enquiry, opts = {})\n data, _status_code, _headers = enquiries_post_with_http_info(enquiry, opts)\n data\n end",
"title": ""
},
{
"docid": "f23ca123e1a9df014bb9512c2f38dcee",
"score": "0.48816112",
"text": "def create\n @announcement = Announcement.find(params[:announcement])\n\n @purchase = Purchase.new(announcement: @announcement, buyer_id: current_buyer.id, description: @announcement.title,seller_id: @announcement.seller.id )\n key = @announcement.seller.access_code\n Stripe.api_key = key\n\n token = params[:stripeToken]\n\n customer = if current_buyer.stripe_id?\n Stripe::Customer.retrieve(current_user.stripe_id)\n else\n Stripe::Customer.create(email: current_buyer.email, source: token)\n end\n\n payment_intent = Stripe::PaymentIntent.create({\n customer:customer,\n payment_method_types: ['card'],\n amount: @announcement.price.to_i * 100,\n currency: 'eur',\n confirm: true, \n }, stripe_account: @announcement.seller.uid)\n\n respond_to do |format|\n if @purchase.save\n #create the notifications\n Order.create(description: \"ordine 2\",seller: @announcement.seller,announcement: @announcement)\n Notification.create(recipient: @announcement.seller, actor: current_buyer, action: \"buy\" ,notifiable: @announcement)\n @user = current_buyer\n format.html { redirect_to buyer_my_purchases_path, notice: 'Transaction was successfully created.' }\n format.json { render :show, status: :created, location: @purchase }\n else\n format.html { render :new }\n format.json { render json: @purchase.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "958a06c26118a256b9119b7523481ee4",
"score": "0.4871085",
"text": "def create\n @inquiry = Inquiry.new(inquiry_params)\n\n respond_to do |format|\n if @inquiry.save\n format.html { redirect_to root_path, notice: 'Inquiry was successfully created.' }\n format.json { render :show, status: :created, location: root_path }\n else\n format.html { render :new }\n format.json { render json: @inquiry.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "54a87b700e3d8e972bd937653960a79a",
"score": "0.48653188",
"text": "def create\n if params[:question][:content].gsub(/[ \\t\\r\\n]/, '').length == 0\n respond_to do |format|\n format.json { render json: nil, status: :unprocessable_entity}\n end\n return\n end\n\n #@question = Question.new(params[:question])\n @question = current_user.questions.new(params[:question])\n @question.closed = false\n\n respond_to do |format|\n if @question.save\n #receiver = User.ne(_id: current_user).to_a.first\n receivers = User.ne(_id: current_user).to_a\n #notification = receiver.question_notifications.create!(:question_url => question_path(@question))\n #notification_data = {:url => notification_path(notification, :type => :q), :type => :q}\n #message = {:channel => '/notifications/users/' + receiver._id, :data => notification_data.to_json.html_safe}\n question_description = @question.content.truncate(20, separator: ' ')\n\n messages = []\n receivers.each do |receiver|\n if receiver.group == current_user.group\n notification = receiver.question_notifications.create!(:question_url => question_path(@question), :question_description => question_description)\n notification_data = {:url => notification_path(notification, :type => :q), :type => :q, :question_description => question_description}\n messages.push({:channel => '/notifications/users/' + receiver._id, :data => notification_data.to_json.html_safe})\n end\n end\n\n faye_uri = URI.parse(\"http://localhost:\" + TestMongoid::Application.config.faye_server_port.to_s + \"/faye\")\n Net::HTTP.post_form(faye_uri, :message => messages.to_json)\n\n #format.html { redirect_to @question, notice: 'Question was successfully created.' }\n format.html { redirect_to root_path, notice: 'Question was successfully created.' }\n format.json { render json: nil, status: :created}\n else\n #format.html { render action: \"new\" }\n format.html { redirect_to root_path, notice: 'Question was not created...' }\n format.json { render json: @question.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5f07952f67d47a5dcaa097468d30ceda",
"score": "0.48644906",
"text": "def index\n @freelancer_knowledges = FreelancerKnowledge.all\n end",
"title": ""
},
{
"docid": "dd399cded685b1d81819c505ed0f464f",
"score": "0.48556787",
"text": "def create\n Rails.logger.info params\n render status: :ok\n # @enquiry = Enquiry.new(enquiry_params)\n\n # respond_to do |format|\n # if @enquiry.save\n # format.html { redirect_to @enquiry, notice: 'Enquiry was successfully created.' }\n # format.json { render json: @enquiry, status: :created }\n # else\n # format.html { render action: 'new' }\n # format.json { render json: @enquiry.errors, status: :unprocessable_entity }\n # end\n # end\n end",
"title": ""
},
{
"docid": "51f21bc3297964a704be79902fd4fe43",
"score": "0.48544887",
"text": "def post_ticket(params)\n ticket = Lighthouse::Ticket.new(:project_id => project_id)\n ticket.title = params[:title]\n ticket.body = params[:body]\n ticket.tags = params[:tags]\n ticket.save\n end",
"title": ""
},
{
"docid": "cf53fcec6443092855126215f98ac4ff",
"score": "0.48505262",
"text": "def create\n @answer = current_user.answers.build(params[:answer])\n if @answer.save\n @post = @answer.post\n Notifier.delay.new_answer(@post.user, @answer)\n if @post.user != current_user\n current_user.update_attributes(cred_count: current_user.cred_count + 10)\n end\n return render status: 200, json: { success: true }\n else\n return render :status => :unprocessable_entity,\n :json => { success: false, :error => \"There was a problem posting your advice.\" }\n end\n end",
"title": ""
},
{
"docid": "bfb24fabb84aaa54c6308483ee11a31c",
"score": "0.48504314",
"text": "def CreateTopic params = {}\n \n APICall(path: 'topics.json',method: 'POST',payload: params.to_json)\n \n end",
"title": ""
},
{
"docid": "ae25b50cf863084fba83c7a5193837ac",
"score": "0.48489466",
"text": "def create\n @badge = Badge.new(params[:badge])\n \n\n respond_to do |format|\n if @badge.save\n format.html { redirect_to @badge, notice: 'Badge was successfully created.' }\n format.json { render json: @badge, status: :created, location: @badge }\n else\n format.html { render action: \"new\" }\n format.json { render json: @badge.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "536e5c2d94ea58bf6372a920b502c162",
"score": "0.48423183",
"text": "def create\n puts \"*********************CREATE*******************\"\n puts \"*************** intervention_params **************\" + intervention_params.to_s\n @intervention = Intervention.new(intervention_params)\n @intervention.intervention_result = \"incomplete\"\n @intervention.intervention_status = \"pending\"\n @currentusername = current_user.full_name\n @intervention.author = @currentuserid\n \n if @intervention.save\n ZendeskAPI::Ticket.create!($client, \n :subject => \"**NEW INTERVENTION** created by : \" + @currentusername.to_s ,\n :comment => \"The customer ID : #{params['intervention'][:customer_id]} \n building ID : #{params['intervention'][:building_id]} \n battery ID : #{params['intervention'][:battery_id]} \n column ID : #{params['intervention'][:column_id]} \n elevator ID : #{params['intervention'][:elevator_id]} \n affected employee ID : #{params['intervention'][:employee_id]} \n description ID : #{params['intervention'][:intervention_report]} \",\n :priority => \"urgent\",\n :type => \"question\")\n\n render 'static_pages/intervention_received'\n else\n flash.now[:error] = \"fail no intervention has been sent\"\n render :index\n end\n end",
"title": ""
},
{
"docid": "8dc2d0f1fcbd81971239858f2cc714bb",
"score": "0.48331082",
"text": "def create\n @tack = Tack.new(tack_params)\n\n if @tack.save\n render json: @tack, status: :created, location: @tack\n else\n render json: @tack.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "be777a45b945e0a931dadbc89619c3b0",
"score": "0.4833014",
"text": "def create_and_invitation_studant(params = {})\n run(:post, \"/invitations\", [201,422], JSON.dump(params))\n end",
"title": ""
},
{
"docid": "e696b0b1ad236b4100d9dfd4544f9d8c",
"score": "0.4830597",
"text": "def create\n @agreement = Agreement.new(agreement_params)\n @agreement.user_id = current_user.id\n\n respond_to do |format|\n if @agreement.save\n format.html { redirect_to @agreement, notice: 'Agreement was successfully created.' }\n format.json { render :show, status: :created, location: @agreement }\n else\n format.html { render :new }\n format.json { render json: @agreement.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b32128f9bfd94f486e26d6b106dfeef5",
"score": "0.48173648",
"text": "def create\n @badge = Badge.new(params[:badge])\n\n respond_to do |format|\n if @badge.save\n format.html { redirect_to @badge, :notice => 'Badge was successfully created.' }\n format.json { render :json => @badge, :status => :created, :location => @badge }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @badge.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "37f2309cb9bc089c4d409b5abe60d506",
"score": "0.4812169",
"text": "def create(params = {})\n wrapped_params = { insurance: params }\n @client.make_request(:post, 'insurances', MODEL_CLASS, wrapped_params)\n end",
"title": ""
},
{
"docid": "bcb195e1dc6984c57d9e8b683e2986bf",
"score": "0.4805698",
"text": "def create\n @agreement = Agreement.new(agreement_params)\n\n respond_to do |format|\n if @agreement.save\n format.html { redirect_to @agreement, notice: 'Certificado criado com sucesso.' }\n format.json { render :show, status: :created, location: @agreement }\n else\n format.html { render :new }\n format.json { render json: @agreement.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3086b09d51517d3b14dde14d24adf8e6",
"score": "0.48021516",
"text": "def post_check(excon, body)\n excon.request(\n method: :post,\n path: '/check',\n headers: { 'Content-Type' => 'application/json' },\n body: body\n )\nend",
"title": ""
},
{
"docid": "587e16e23e2ba85c55035a665d1dcdb0",
"score": "0.479184",
"text": "def create\n # Create Nudge for issueing user\n @nudge = Nudge.new\n @nudge.user_id = params[:user_id]\n @nudge.pet_id = params[:pet_id]\n @nudge.group_id = Pet.find(params[:pet_id]).group.id\n @nudge.response = -1\n @nudge.nudge_token = @nudge.generate_token\n\n respond_to do |format|\n if @nudge.save\n # Create Nudge for group memebers\n Group.find(@nudge.group_id).users.each do |user|\n next if user.id == @nudge.user_id || user.device.nil?\n @nudge_member = Nudge.new\n @nudge_member.user_id = user.id\n @nudge_member.pet_id = params[:pet_id]\n @nudge_member.group_id = Pet.find(params[:pet_id]).group.id\n @nudge_member.response = 0\n @nudge_member.nudge_token = @nudge.nudge_token\n\n if @nudge_member.save\n # Send push notification\n @apn = Houston::Client.development\n device_token = User.find(@nudge_member.user_id).device.device_token\n notification = Houston::Notification.new(device: device_token)\n notification.alert = User.find(@nudge.user_id).first_name + ': Has ' + Pet.find(@nudge.pet_id).name + ' been fed?'\n notification.category = 'fed.category'\n notification.content_available = true\n notification.sound = 'sosumi.aiff'\n notification.custom_data = { nudge_id: @nudge.id, nudge_token: @nudge.nudge_token }\n @apn.push(notification)\n end\n end\n format.json { render :show, status: :created, location: @nudge }\n else\n format.json { render json: @nudge.errors, status: :unprocessable_entity }\n end \n end\n end",
"title": ""
},
{
"docid": "26bc142571d554b0f41e4e28c433fc08",
"score": "0.4789864",
"text": "def incident_create(statuspage_id, incident_name, incident_details, infrastructure_affected, current_status, current_state, notifications = 0, all_infrastructure_affected = \"0\", message_subject = \"Status Notification\")\n data = get_notify(notifications)\n data['statuspage_id'] = statuspage_id\n data['incident_name'] = incident_name\n data['incident_details'] = incident_details\n data['infrastructure_affected'] = infrastructure_affected\n data['current_status'] = current_status\n data['current_state'] = current_state\n data['all_infrastructure_affected'] = all_infrastructure_affected\n data['message_subject'] = message_subject\n\n request :method => :post,\n \t :url => @url + 'incident/create',\n \t :payload => data\n end",
"title": ""
},
{
"docid": "a85ea55fbda1d129b1436a3a3cf05ec9",
"score": "0.47870848",
"text": "def notify(interests, data = {})\n Request.new(\n @eventflit_client,\n :post,\n url(\"/publishes\"),\n {},\n payload(interests, data)\n ).send_sync\n end",
"title": ""
},
{
"docid": "bc9532093df77ad03790304fa6926985",
"score": "0.47860956",
"text": "def create\n @topickey = Topickey.new(params[:topickey])\n\n respond_to do |format|\n if @topickey.save\n format.html { redirect_to @topickey, notice: 'Topickey was successfully created.' }\n format.json { render json: @topickey, status: :created, location: @topickey }\n else\n format.html { render action: \"new\" }\n format.json { render json: @topickey.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "bb7295134d819e63e33430634b0ef2f3",
"score": "0.47843453",
"text": "def create\n params[:mentions].each do |men_params|\n men_params = men_params.permit(:ticker_id, :positive_count, :negative_count, :neutral_count)\n @mention = Mention.new(men_params)\n @mention.save\n end\n respond_to do |format|\n msg = { :status => :ok, :message => \"Success!\", :html => '<b></b>' }\n format.html do\n redirect_to '/'\n end\n format.json { render :json => msg }\n end\n end",
"title": ""
},
{
"docid": "9fb4e893c998b8e74f39741fcbcbb484",
"score": "0.47768554",
"text": "def index\n if(current_user.profile.nil?)\n redirect_to new_profile_path,\n notice: \"You need first to fill your profile ;).\"\n else\n @knowledges = current_user.profile.knowledges.all\n end\n end",
"title": ""
},
{
"docid": "ef81250798f211c0258f73c685eec5c0",
"score": "0.47757646",
"text": "def create\n @no_due = NoDue.new(no_due_params)\n\n respond_to do |format|\n if @no_due.save\n format.html { redirect_to @no_due, notice: 'No due was successfully created.' }\n format.json { render :show, status: :created, location: @no_due }\n else\n format.html { render :new }\n format.json { render json: @no_due.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "89f2cd900e5b06a37cc1fd1fffaed567",
"score": "0.47687823",
"text": "def create\n @award = Award.new(award_params)\n respond_to do |format|\n if @award.save\n a_data = JSON.parse params[:json_string]\n a_data.each do |a|\n @item = get_new_award_item(@award, a) unless a.nil?\n end\n AwardMailer.approval_request(@award)\n if current_user.admin\n format.html { redirect_to patient_path(@award.patient), notice: 'Award was successfully created.' }\n else\n format.html { redirect_to new_patient_path, notice: 'Award was successfully created.' }\n end\n format.json { render :show, status: :created, location: @award }\n else\n format.html { render :new }\n format.json { render json: @award.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c2fa7fe62d84685d2f67e3d7b75b5358",
"score": "0.476558",
"text": "def create\n \t\t@interested = Interested.new(params[:interested])\n\n \t\trespond_to do |format|\n \t\t\tif @interested.save\n \t\t\t\tformat.html{ redirect_to @interested, notice: 'Interested was successfully created.'}\n \t\t\t\tformat.json{ render json: @interested, status: :create, location: @interested }\n \t\t\telse\n \t\t\t\tformat.html { render action: \"new\" }\n \t\t\t\tformat.json { render json: @interested.error, status: :unprocessable_entity }\n \t\t\tend\n \t\tend\n \tend",
"title": ""
},
{
"docid": "454b32a73393f4e81d4a8affdd60cd82",
"score": "0.4764426",
"text": "def create\n @inquiry_reply = InquiryReply.new(inquiry_reply_params)\n @inquiry_reply.user_id = flash[:user_id]\n @inquiry_reply.house_id = flash[:house_id]\n @inquiry_reply.inquiry_id = flash[:inquiry_id]\n @inquiry_reply.company_id = flash[:company_id]\n respond_to do |format|\n if @inquiry_reply.save\n UserMailer.with(user: User.find(@inquiry_reply.user_id), inquiry_reply: @inquiry_reply,\n inquiry: Inquiry.find(@inquiry_reply.inquiry_id), house: House.find(@inquiry_reply.house_id)).inquiry_reply_email.deliver_now\n format.html {redirect_to @inquiry_reply, notice: 'Inquiry reply was successfully created. We have notified the user via email'}\n format.json {render :show, status: :created, location: @inquiry_reply}\n else\n format.html {render :new}\n format.json {render json: @inquiry_reply.errors, status: :unprocessable_entity}\n end\n end\n end",
"title": ""
},
{
"docid": "355bdefe4df77f953916e5ac96f7157b",
"score": "0.47617856",
"text": "def create\n @surgery = Surgery.new(params[:surgery])\n\n respond_to do |format|\n if @surgery.save\n format.html { redirect_to @surgery, notice: 'Surgery was successfully created.' }\n format.json { render json: @surgery, status: :created, location: @surgery }\n else\n format.html { render action: \"new\" }\n format.json { render json: @surgery.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9396150d7a00cccea23c770cbcdfefc6",
"score": "0.47525144",
"text": "def create\n @kennkoukiroku = Kennkoukiroku.new(kennkoukiroku_params)\n\n respond_to do |format|\n if @kennkoukiroku.save\n format.html { redirect_to @kennkoukiroku, notice: \"健康記録を追加しました\" }\n format.json { render :show, status: :created, location: @kennkoukiroku }\n else\n format.html { render :new }\n format.json { render json: @kennkoukiroku.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "197c9a1091d19bc064fa7a416416d5b4",
"score": "0.47513482",
"text": "def create\n discounts = []\n (1..params[:discount_number].to_i).each do |i|\n @discount = Discount.new(params[:discount])\n @discount.generate_token params[:discount_six_length].to_i\n @discount.save\n discounts << @discount\n end\n respond_to do |format|\n format.html { redirect_to discounts_url, notice: I18n.t(:discount_created, n: params[:discount][:name], c: params[:discount_number] ) }\n format.json { render json: discounts, status: :created, location: discounts }\n end\n end",
"title": ""
},
{
"docid": "49798a7d4f852dcd053c2bc4bf89677e",
"score": "0.47504804",
"text": "def create\n @invitation_request = InvitationRequest.new(invitation_request_params)\n\n respond_to do |format|\n if @invitation_request.save\n format.html { redirect_to root_path, notice: 'Invitation received. We will notify you soon!' }\n format.json { render :show, status: :created, location: @invitation_request }\n else\n @interests = Interest.all\n format.html { render :new }\n format.json { render json: @invitation_request.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a87a58901f1113dedea9be9a565050ce",
"score": "0.47386602",
"text": "def create_thanks \n end",
"title": ""
},
{
"docid": "2eb2e50972f4debf21e130448eba0069",
"score": "0.47378138",
"text": "def dispute_notification(id, amount, currency)\n @id, @amount, @currency = id, amount, currency\n \n mail to: \"kaysertranslation@gmail.com\",\n subject: \"Hikarigo dispute created. Attention may be needed\"\n end",
"title": ""
},
{
"docid": "5864841a4c8c8e74762c64ae7788f862",
"score": "0.47362012",
"text": "def acknowledge\n attrs = {\n :acknowledged => true,\n :acknowledged_at => Time.now()\n }\n self.update_attributes(attrs)\n end",
"title": ""
},
{
"docid": "0c8197ad103394a300fb1a2fbaf8fd12",
"score": "0.47332907",
"text": "def create_inquiry(rental, options = {})\n post(\"rentals/#{rental}/inquiries\", inquiries: [options]).pop\n end",
"title": ""
},
{
"docid": "d9afadcc3c6fc6c6e8782718562a8af2",
"score": "0.47311622",
"text": "def create\n @due = Due.new(due_params)\n\n respond_to do |format|\n if @due.save\n format.html { redirect_to @due, notice: 'Due was successfully created.' }\n format.json { render :show, status: :created, location: @due }\n else\n format.html { render :new }\n format.json { render json: @due.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ecfc2d7284f020ecc384627c6cff274a",
"score": "0.47294724",
"text": "def create\n @envelope = Envelope.new(params[:envelope])\n\n respond_to do |format|\n if @envelope.save\n format.html { redirect_to @envelope, notice: 'Envelope was successfully created.' }\n format.json { render json: @envelope, status: :created, location: @envelope }\n else\n format.html { render action: \"new\" }\n format.json { render json: @envelope.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "526bb808b7e97854f97ffdcdf4dd1fa7",
"score": "0.4725139",
"text": "def create\n @hold_request = HoldRequest.new(hold_request_params)\n\n respond_to do |format|\n if @hold_request.save\n format.html { redirect_to @hold_request, notice: 'Hold request was successfully created.' }\n format.json { render :show, status: :created, location: @hold_request }\n else\n format.html { render :new }\n format.json { render json: @hold_request.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "526bb808b7e97854f97ffdcdf4dd1fa7",
"score": "0.4725139",
"text": "def create\n @hold_request = HoldRequest.new(hold_request_params)\n\n respond_to do |format|\n if @hold_request.save\n format.html { redirect_to @hold_request, notice: 'Hold request was successfully created.' }\n format.json { render :show, status: :created, location: @hold_request }\n else\n format.html { render :new }\n format.json { render json: @hold_request.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8c50d73e9f640e10bdd8c8e109ef3f7e",
"score": "0.47223756",
"text": "def send(key)\n HTTParty.post(@add_url, {\n :headers => {\n \"Content-Type\" => \"application/json; charset=UTF8\",\n \"X-Accept\" => \"application/json\"\n },\n :body => {\n #:url => formatted[:url],\n :url => \"https://www.engadget.com/2016/10/09/more-galaxy-note-7-replacement-fires/\",\n #:tags => formatted[:tags],\n :consumer_key => ENV['POCKET_CONSUMER_KEY'],\n :access_token => key\n }.to_json\n })\n end",
"title": ""
},
{
"docid": "98e93d20becf1d801c3cc3997ff70175",
"score": "0.4722294",
"text": "def postmark\n @program_acceptance = ProgramAcceptance.where(message_id: params[:MessageID]).first\n if @program_acceptance\n note = case params[:RecordType]\n when \"Delivery\" then \"Acceptance email delivered to #{params[:Recipient]}.\"\n when \"Bounce\" then \"Acceptance email not delivered to #{params[:Recipient]}.\\n\\n> #{params[:Description]}\"\n when \"SpamComplaint\" then \"Acceptance email to #{params[:Recipient]} flagged as spam.\"\n when \"Open\" then \"Acceptance email opened.\"\n when \"Click\" then \"Link clicked in acceptance email.\"\n end\n @program_acceptance.person.notes.create note_type: \"email-event\", message: note, data: request.request_parameters\n end\n head :ok\n end",
"title": ""
},
{
"docid": "8215c784b1e5d2e04a666e88ce457ef5",
"score": "0.47215813",
"text": "def create\n @indication = DisIndication.new(indication_params)\n\n\n if @indication.save\n flash[:notice] = \"Task was successfully created.\"\n respond_with(@indication)\n else\n flash[:notice] = \"Task was not created.\"\n end\n end",
"title": ""
},
{
"docid": "828d22b96d5d4cbf1a7443263a6d9d03",
"score": "0.4719284",
"text": "def create\n @enquiry = Enquiry.new(params[:enquiry])\n\n respond_to do |format|\n if @enquiry.save\n logger.info {\"Starting email first\"}\n EnquiryMailer.enquiry_received(@enquiry).deliver\n logger.info {\"Starting email second\"}\n EnquiryMailer.enquiry_response(@enquiry).deliver\n format.html { redirect_to thanks_path, notice: 'Thank you for your enquiry.' }\n format.json { render action: 'show', status: :created, location: @enquiry }\n else\n format.html { render action: 'new' }\n format.json { render json: @enquiry.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "622fb8d5f95dbd5f8ca6652206fabcbc",
"score": "0.47182798",
"text": "def CreateTicket params = {}\n\n APICall(path: 'tickets.json',method: 'POST',payload: {ticket: params}.to_json)\n \n end",
"title": ""
},
{
"docid": "f47c18a6d0a1f503cb902f9f1dae21b5",
"score": "0.47181925",
"text": "def create(params)\n post(\"#{domain}/complaints\", params)\n end",
"title": ""
},
{
"docid": "8cfb28754902b09aee0788086dcfde5c",
"score": "0.47086573",
"text": "def create\n @refund_request = RefundRequest.new(params[:refund_request])\n\n respond_to do |format|\n if @refund_request.save\n NoticeMailer.refund_request_email(@refund_request).deliver\n format.html { redirect_to root_path, notice: 'Solicitud de devolución correctamente ingresada.' }\n format.json { render json: @refund_request, status: :created, location: @refund_request }\n else\n format.html { render action: \"new\" }\n format.json { render json: @refund_request.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "93c76912c91c10ae549cd7312e486689",
"score": "0.47082615",
"text": "def create\n @ticket.save\n\n respond_with(@story, @ticket)\n end",
"title": ""
},
{
"docid": "68de693ff51979c68b5a626cb9546946",
"score": "0.4708099",
"text": "def create\n @survey = Survey.find(params[:survey_id])\n emoji = params[:emoji]\n mood = params[:mood]\n @feeling = Feeling.new(mood: mood, emoji: emoji)\n @survey.feelings << @feeling\n\n if @feeling.save\n render :ok, json: @feeling\n else\n @errors = @feelings.error.full_messages\n render json: {message: @errors}, status: :unprocessable_entity\n end\n\n if !@survey\n render json: {message: [\"Survey is Required!\"] }, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "bf3159a30ff4307f4594c6ea2cd1604e",
"score": "0.47047618",
"text": "def create\n @post = Post.new(post_params)\n # current_user.add_badge(1)\n respond_to do |format|\n if @post.save\n format.html { redirect_to @post, notice: 'Postagem criada com sucesso.' }\n format.json { render :show, status: :created, location: @post }\n else\n format.html { render :new }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "801f6f2decf6650767f48387e7cc813f",
"score": "0.4699288",
"text": "def create\n @api_v1_mentorship_interest = Api::V1::MentorshipInterest.new(api_v1_mentorship_interest_params)\n\n respond_to do |format|\n if @api_v1_mentorship_interest.save\n format.html { redirect_to @api_v1_mentorship_interest, notice: 'Mentorship interest was successfully created.' }\n format.json { render :show, status: :created, location: @api_v1_mentorship_interest }\n else\n format.html { render :new }\n format.json { render json: @api_v1_mentorship_interest.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a03f22a6f715b53a500c392add322239",
"score": "0.46959853",
"text": "def create\n # Build a ticket associated with the current user and fill with strong parameters\n @ticket = current_user.help_requests.build(ticket_params)\n # New Hash\n add_info = {}\n # New Nested Array\n add_info[:tagged_users] = []\n # Scan for tagged users in the report:\n @ticket.desc.scan(USER_TAG_REGEX) do |name|\n # Find a tagged user in the database\n user = User.find_by_name(name)\n # Add the tagged user to the hash of tagged users\n add_info[:tagged_users] << user.name unless user == nil\n end\n # Save a JSON representation of the add_info hash to the record\n @ticket.addinfo = JSON.generate(add_info)\n # Save the new record in the database\n @ticket.save\n # Send the user to their homepage\n redirect_to me_path\n end",
"title": ""
},
{
"docid": "2c1542790611e5e48b0331153671f3ae",
"score": "0.46926197",
"text": "def create\n @supaagent = Supaagent.new(supaagent_params)\n\n respond_to do |format|\n if @supaagent.save\n format.html { redirect_to action: \"thank_you\", notice: 'Supaagent was successfully created.' }\n format.json { render :show, status: :created, location: @supaagent }\n else\n format.html { render :new }\n format.json { render json: @supaagent.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3a1d8de2b3bfdf1a45d47a907f835e6c",
"score": "0.46924943",
"text": "def create\n if @user.hearts >= @reward.cost\n @redemption = Redemption.new()\n @redemption.user = @user\n @redemption.cost = @reward.cost\n @redemption.reward = @reward\n\n if @reward.ifttt?\n key = ENV[\"IFTTT_KEY\"]\n\turl = \"https://maker.ifttt.com/trigger/#{@user.account}#{@reward.event}/with/key/#{key}\"\n\tresponse = RestClient.get url\n\n\trespond_to do |format|\n\t if response.code == 200 && @redemption.save\n @user.hearts = @user.hearts - @reward.cost\n @user.save!\n\n format.json { render json: @redemption.as_json(include: {reward: {only: :name}}).merge({hearts: @user.hearts}), status: :created }\n else\n format.json { render json: nil, status: :not_acceptable }\n end\n end\n elsif @reward.cash?\n \trespond_to do |format|\n if @redemption.save\n @user.hearts = @user.hearts - @reward.cost\n\t @user.save!\n\t SmsMailer.sms_email(Admin.all.first).deliver\n\n\t format.json { render json: @redemption.as_json(include: {reward: {only: :name}}).merge({hearts: @user.hearts}), status: :created }\n\t else\n\t format.json { render json: nil, status: :not_acceptable }\n\t end\n\tend\n end\n else\n respond_to do |format|\n format.json { render json: {message: \"Not enough hearts!\"}, status: :not_acceptable }\n end\n end\n end",
"title": ""
},
{
"docid": "ae2379c7d2ff64501632dd534e23b4fe",
"score": "0.46895835",
"text": "def create\n @enquiry = Enquiry.find params[:enquiry_id]\n content = params[:email_content].gsub(\"\\n\", '<br>')\n FoodPartnerMailer.new_order_notice(@enquiry, content).deliver_later\n SupplierCommunication.create! comm_params\n @enquiry.wait_on_supplier\n head :ok\n end",
"title": ""
},
{
"docid": "120e8c68f25f82190b672095faba7bf8",
"score": "0.46870884",
"text": "def create_intervention_ticket\n client = ZendeskAPI::Client.new do |config|\n config.url = ENV['ZENDESK_URL']\n config.username = ENV['ZENDESK_USERNAME']\n config.token = ENV['ZENDESK_TOKEN']\n end\n \n ZendeskAPI::Ticket.create!(client, \n :subject => \"Building: #{@intervention.building_id} requires intervention\", \n :comment => { \n :value => \n \"The Requester: #{Employee.find(@intervention.author_id).first_name+''+Employee.find(@intervention.author_id).last_name }\n The Customer (Company Name): #{@intervention.customer.company_name}\\n\n Building ID: #{@intervention.building_id}\\n\n Battery ID: #{params[:battery]}\\n\n Column ID: #{if (params[:column] == \"None\") then \"\" else params[:column] end} \n Elevators ID: #{if (params[:elevator] == \"None\" ) then \"\" else params[:elevator] end}\n #{if (@intervention.employee_id) then \"The employee to be assigned to the task: #{@intervention.employee.first_name} #{@intervention.employee.last_name}\" end}\n \n Description:#{@intervention.report}\"\n }, \n :requester => { \n \"name\": Employee.find(@intervention.author_id).first_name+''+Employee.find(@intervention.author_id).last_name \n },\n \n :type => \"problem\",\n :priority => \"normal\"\n )\n end",
"title": ""
},
{
"docid": "dc1557c481e92ee1c2f0df93897b1786",
"score": "0.46860605",
"text": "def create\n @message_hashtag = MessageHashtag.new(message_hashtag_params)\n\n respond_to do |format|\n if @message_hashtag.save\n format.html { redirect_to @message_hashtag, notice: 'Message hashtag was successfully created.' }\n format.json { render :show, status: :created, location: @message_hashtag }\n else\n format.html { render :new }\n format.json { render json: @message_hashtag.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "42b68a792f137f107ba7c432e8c865eb",
"score": "0.4685405",
"text": "def create\n @getadvice = Getadvice.new(params[:getadvice])\n\n respond_to do |format|\n if @getadvice.save\n format.html { redirect_to @getadvice, notice: 'Getadvice was successfully created.' }\n format.json { render json: @getadvice, status: :created, location: @getadvice }\n else\n format.html { render action: \"new\" }\n format.json { render json: @getadvice.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "22ffd2319469a6414e79bd27e2ce4fe4",
"score": "0.46818978",
"text": "def post body=nil, headers={}\n @connection.post \"subscriptions.json\", body, headers\n end",
"title": ""
},
{
"docid": "31b101f21311c220ced305d691fe0979",
"score": "0.46801546",
"text": "def send_post_notification(post)\n @post = post\n @post = post\n @poster = post.poster\n if @post.post_needs.size == 0\n @post_needs = []\n else\n @post_needs = @post.post_needs.alphabetical\n end\n recipients = @post.notify_emails\n\n if recipients != \"\"\n mail(:to => recipients, :subject => 'New Request at ' + post.street_1)\n end\n end",
"title": ""
},
{
"docid": "40fc3e100b3c2e1b2093f79ac44da764",
"score": "0.4675837",
"text": "def create\n @qanote = current_user.qanotes.build(qanote_parameters)\n \n respond_to do |format|\n if @qanote.save\n QanoteMailer.newtag(current_user).deliver\n format.html { redirect_to @qanote, notice: 'Qanote was successfully created.' }\n format.json { render action: 'show', status: :created, location: @qanote }\n else\n format.html { render action: 'new' }\n format.json { render json: @qanote.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5a7f8a4c5a6dfd1eb246371ae2d643e1",
"score": "0.46741626",
"text": "def create\n @topic = Topic.create(topic_params)\n current_user.topics.push(@topic)\n \n respond_with @topic\n end",
"title": ""
},
{
"docid": "cbba4c4ce25bfbf13cad5c91d83174f6",
"score": "0.46723333",
"text": "def create\n inc_id = 1\n unless @event.attendees.blank?\n inc_id = @event.attendees.last.attendee_id.gsub(@event.token_for_id, \"\").to_i + 1\n end\n params[:attendee][:attendee_id] = @event.token_for_id + \"%04d\" % inc_id\n params[:attendee][:a_platform] = params[:attendee][:a_platform].join(\";\") unless params[:attendee][:a_platform].nil?\n params[:attendee][:a_market_segment] = params[:attendee][:a_market_segment].join(\";\") unless params[:attendee][:a_market_segment].nil?\n params[:attendee][:confirmation_token] = Array.new(10) {[*'0'..'9', *'a'..'z'].sample}.join\n params[:attendee][:a_sector] = \"N/A\"\n params[:attendee][:e_ext_number] = 0\n params[:attendee][:e_lada] = 0\n params[:attendee][:e_zip_code] = \"N/A\"\n @attendee = Attendee.new(params[:attendee])\n \n respond_to do |format|\n if @attendee.save\n #AttendeeMailer.welcome_email(@attendee).deliver!\n format.html { redirect_to @attendee, notice: t(:successfully_created) }\n format.json { render json: @attendee, status: :created, location: @attendee }\n else\n format.html { render action: \"new\" }\n format.json { render json: @attendee.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "51387569c883aeca05380173534a1120",
"score": "0.466859",
"text": "def create\n name = params[:name]\n seat = params[:seat]\n desc = params[:desc]\n group_name = params[:group]\n group = Group.where(name:group_name).first\n\n new_ticket = group.tickets.new(name:name,seat:seat,description:desc)\n\n if new_ticket.save\n notice = {\"notice\"=>\"new ticket created successfully.\"}\n puts notice.to_json\n redirect_to \"http://hacked.io/almanac/get-help/submitted\"\n else\n alert = {\"alert\"=>\"ticket was not created. check your params.\"}\n puts alert.to_json\n redirect_to \"http://hacked.io/almanac/get-help/not-submitted\"\n end\n end",
"title": ""
},
{
"docid": "b65b945d529b6a04dee107e92bf2274d",
"score": "0.4666047",
"text": "def create\n n = params[:number_of_tickets].to_i\n\n # make sure there are enough tickets\n\n @ticket = Ticket.new(ticket_params)\n\n respond_to do |format|\n if @ticket.save\n @ticket.qrcode = \"http://gnome2home.herokuapp.com/scan/ticket?ticket_id=#{@ticket.id}\"\n @ticket.van.seats_available -= 1\n @ticket.van.save\n @ticket.save\n Recipt.send_recipt(@ticket).deliver\n (n-1).times do\n ticket = Ticket.new(ticket_params)\n ticket.save\n ticket.qrcode = \"http://gnome2home.herokuapp.com/scan/ticket?ticket_id=#{ticket.id}\"\n ticket.van.seats_available -= 1\n ticket.van.save\n ticket.save\n Recipt.send_recipt(ticket).deliver\n end\n\n if n == 1\n format.html { redirect_to @ticket, notice: 'Thank you for riding Gnome2Home. You will receive an email shortly with your QR code and confirmation number' }\n format.json { render :show, status: :created, location: @ticket }\n else\n format.html { redirect_to edit_passenger_registration_path, notice: \"Thanks for buying #{n} tickets. You can view all of you purchased tickets below. You will receive #{n} separate emails, each with a unique QR code ticket. Please keep those emails to check in. \"}\n format.json { render :show, status: :created, location: @ticket }\n end\n\n else\n format.html { render :new }\n format.json { render json: @ticket.errors, status: :unprocessable_entity }\n end\n end\n\n\n end",
"title": ""
},
{
"docid": "249915660f2e563987dadb3a1d008e86",
"score": "0.46653047",
"text": "def create\n @surgery = Surgery.new(surgery_params)\n\n respond_to do |format|\n if @surgery.save\n format.html { redirect_to @surgery, notice: 'Surgery was successfully created.' }\n format.json { render :show, status: :created, location: @surgery }\n else\n format.html { render :new }\n format.json { render json: @surgery.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "163e77e7d678eb9cc457fa0d00b2c376",
"score": "0.46650237",
"text": "def create\n _params = message_params\n if params.has_key? :key and !_params.has_key? :guestbook_id\n key = AccessKey.where(key: params[:key]).first\n if key != nil\n _params[:guestbook_id] = key.guestbook != nil ? key.guestbook.id : Guestbook.get_default.id\n end\n end\n\n # Insurance\n if _params[:guestbook_id] == nil\n _params[:guestbook_id] = Guestbook.get_default.id\n end\n guestbook = Guestbook.find(_params[:guestbook_id])\n\n # Auto approve, if passes filter\n _params[:approved] = guestbook.auto_approve\n if guestbook.filter_profanity && Obscenity.profane?(_params[:content])\n _params[:approved] = false\n end\n\n @message = Message.new(_params)\n\n respond_to do |format|\n if @message.save\n format.html { redirect_back(fallback_location: '/admin/signatures') }\n format.json { render :show, status: :created, location: @message }\n else\n format.html { redirect_to(:back, error: @message.errors.full_messages.first) }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9cb02181f1a402f1004326ce431d8981",
"score": "0.46645364",
"text": "def post(title, target, message, color)\n a_message_note = {\n 'color' => color,\n 'fields' => [\n {\n 'title' => 'Message',\n 'value' => message,\n 'short' => false\n },\n {\n 'title' => 'Archive Name',\n 'value' => target,\n 'short' => true\n },\n {\n 'title' => 'Status',\n 'value' => color,\n 'short' => false\n }\n ]\n }\n\n notify_user = ENV['SLACK_USER'] || 'notifier'\n notifier = Slack::Notifier.new ENV['SLACK_WEBHOOK'], :username => notify_user\n notifier.ping title, 'icon_emoji' => ENV['SLACK_ICON_EMOJI'], 'attachments' => [a_message_note]\nend",
"title": ""
},
{
"docid": "d63a70c006a3f918aa2da14bd01f555a",
"score": "0.46641856",
"text": "def create\n @mispronunciation = Mispronunciation.new(params[:mispronunciation])\n\n respond_to do |format|\n if @mispronunciation.save\n format.html { redirect_to @mispronunciation, :notice => 'Mispronunciation was successfully created.' }\n format.json { render :json => @mispronunciation, :status => :created, :location => @mispronunciation }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @mispronunciation.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "db4af3aa53a07363418cec7e38294864",
"score": "0.46633053",
"text": "def create\n @datum_receipt = DatumReceipt.new(datum_receipt_params)\n\n respond_to do |format|\n if @datum_receipt.save\n format.html { redirect_to @datum_receipt, notice: 'Datum receipt was successfully created.' }\n format.json { render :show, status: :created, location: @datum_receipt }\n else\n format.html { render :new }\n format.json { render json: @datum_receipt.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
f7453789dd4ab943616835addb6499fe | Removes any clients that have not been updated in the last +expire_after_seconds+ seconds that was set in initialize. | [
{
"docid": "34830bc8401788092cd71e63fc05dd71",
"score": "0.76558226",
"text": "def purge_expired_clients\n oldest_allowed_time = Time.now - @expire_after_seconds\n \n @clients.keys.each do |key|\n if @clients[key].expired?(oldest_allowed_time)\n @reactor.log(:info, \"#{self.class}, Purging expired client for client_id [#{key}] after [#{@expire_after_seconds}] seconds without activity.\")\n @clients.delete(key)\n end\n end\n end",
"title": ""
}
] | [
{
"docid": "5bc63be0dbb1556f2dbda1a1d3accdb5",
"score": "0.6053998",
"text": "def clean_expired\n collection.remove({'expires' => {'$lt' => Time.now}})\n end",
"title": ""
},
{
"docid": "021d63e4b4240c70c71af62093a90ba9",
"score": "0.5946069",
"text": "def gc\n now = Time.now.to_i\n\n # remove old nonces\n nonces = Nonce.find(:all)\n nonces.each {|n| n.destroy if now - n.created > (6*60*60)} unless nonces.nil?\n\n # remove expired assocs\n assocs = Association.find(:all)\n assocs.each { |a| a.destroy if a.from_record.expired? } unless assocs.nil?\n end",
"title": ""
},
{
"docid": "b361e1486c23e6fa032ca37825040848",
"score": "0.58698964",
"text": "def del_all_clients\n AuthClient.all.each do |client|\n notify(:on_client_deleted, client)\n client.destroy\n end\n true\n end",
"title": ""
},
{
"docid": "1aa1c84782e202989e084294b7ba4c21",
"score": "0.5809453",
"text": "def delete_expired_cookies\n # delete all expired,\n all_cookies, count = {}, 0\n mfa_session_cookie_value_dup = @mfa_session_cookie_value.dup\n @mfa_session_cookie_value.each do |s_k, s_v|\n parts = s_v.split(':') rescue nil\n\n if parts.length != 5\n mfa_session_cookie_value_dup.delete(s_k)\n next\n end\n\n last_login_time = parts[3].to_i\n\n if (last_login_time + GlobalConstant::AdminSessionSetting.max_mfa_frequency_value.days.to_i) <= Time.now.to_i\n mfa_session_cookie_value_dup.delete(s_k)\n next\n end\n\n all_cookies[last_login_time] ||= []\n all_cookies[last_login_time] << s_k\n count += 1\n end\n\n @mfa_session_cookie_value = mfa_session_cookie_value_dup\n\n # allow max 15 cookies remove last logged in ip\n if count > 15\n all_cookies.each do |_, keys|\n keys.each do |key|\n @mfa_session_cookie_value.delete(key)\n count -= 1\n return if count <= 30\n end\n end\n end\n\n end",
"title": ""
},
{
"docid": "5eb7bdb789eb4cebc2aee132ddb6a5f8",
"score": "0.575997",
"text": "def clear!\n @clients = Hash.new {|hash, key| hash[key] = ClientRecord.new }\n end",
"title": ""
},
{
"docid": "c2e61811d5504e243771b574a11962ae",
"score": "0.57472724",
"text": "def destroy_clients\n Client.destroy_all if Client.first && Client.first.uid != @client_uid\n end",
"title": ""
},
{
"docid": "40195bb70bc46f64c67c5512dd71db5e",
"score": "0.57416433",
"text": "def remove_dead!\n @clients.delete_if { |x| !x.alive? }\n end",
"title": ""
},
{
"docid": "4b0b9e0485d2c2cb7f6dd1f4f095ce67",
"score": "0.57031304",
"text": "def delete\n # Get the list of clients and delete us first\n clients = nil\n redis.multi do\n clients = redis.smembers(redis_key(\"user(clients):#@name\"))\n nonatomic_delete\n end\n\n unless clients.value.empty?\n # Grab client information\n clients = clients.value.zip(redis.hmget(redis_key(\"clients\"), clients.value)).map { |(client_name, client_json)|\n client_json ? Client.new(client_name, client_json) : nil\n }.reject(&:nil?)\n\n # Delete them all\n redis.multi do\n clients.each &:nonatomic_delete\n end\n end\n end",
"title": ""
},
{
"docid": "e839fe61256118a503b266104f01563f",
"score": "0.56919396",
"text": "def garbage_collect_keys(now = Time.now.to_i)\n keys = redis.keys(\"msgid:*:expires\")\n threshold = now + Beetle.config.gc_threshold\n keys.each do |key|\n expires_at = redis.get key\n if expires_at && expires_at.to_i < threshold\n msg_id = msg_id(key)\n redis.del(keys(msg_id))\n end\n end\n end",
"title": ""
},
{
"docid": "79a3a3299ba1a4bff537a0418e477ceb",
"score": "0.5659695",
"text": "def expire_keys\n now_sec, miliseconds = now\n now_ms = now_sec * 1_000 + miliseconds\n\n to_delete = expire_times.take_while do |(time, _key)|\n (time.to_r * 1_000).to_i <= now_ms\n end\n\n to_delete.each do |(_time, key)|\n del(key)\n end\n end",
"title": ""
},
{
"docid": "3c735486a22f5c744b148ae01d1ec4bc",
"score": "0.5647459",
"text": "def cleanup\r\n# puts ''\r\n# puts @sessionInactivityTime\r\n# @sessions.each{|k,v| puts k; puts v['lastUpdate'].class; puts (Time.now - v['lastUpdate']).to_i; puts (Time.now - v['lastUpdate']).to_i > @sessionInactivityTime}\r\n originalKeys = @sessions.keys\r\n @sessions.delete_if { |k,v| (Time.now - v['lastUpdate']).to_i > @sessionInactivityTime}\r\n removedKeys = originalKeys - @sessions.keys\r\n @logger.info(\"Sessions cleaned: #{removedKeys}\") unless removedKeys.empty?\r\n end",
"title": ""
},
{
"docid": "8e6898fe7583b49f08301ac99d78bf97",
"score": "0.5633151",
"text": "def purge_by_seconds(seconds=nil)\n counter = 0\n expired = seconds || (Time.zone.now - 2.days).to_i # as an integer number of seconds since the Epoch.\n @objects_storage_container.delete_if do |k,v|\n if v.last < expired\n counter += 1\n true\n else\n false\n end\n end\n Rails.logger.perf \"#{self.class.name}.#{__method__}() Count=#{counter}\"\n counter\n end",
"title": ""
},
{
"docid": "a4964034e53d9b4ccb90b72644737cd7",
"score": "0.5551005",
"text": "def purge_clients\n @lock.synchronize do\n logger.info(\"Purging current redis clients\")\n disconnect(@master, *@slaves)\n @master = nil\n @slaves = []\n @node_addresses = {}\n end\n end",
"title": ""
},
{
"docid": "85dd97824442af07fc6ff8aa98e24980",
"score": "0.550442",
"text": "def remove_stale_sessions(last_seen_interval)\n return unless active\n\n ::ApplicationRecord.connection_pool.with_connection {\n ::Mdm::Session.where(closed_at: nil).each do |db_session|\n next unless db_session.last_seen.nil? or ((Time.now.utc - db_session.last_seen) > (2 * last_seen_interval))\n db_session.closed_at = db_session.last_seen || Time.now.utc\n db_session.close_reason = \"Orphaned\"\n db_session.save\n end\n }\n end",
"title": ""
},
{
"docid": "ee29540790f2b6ac3b4d6270ba743e4e",
"score": "0.54855615",
"text": "def periodically_destroy_expired_accesses_from_database\n ::Access.cached_destroy_all_expired\n end",
"title": ""
},
{
"docid": "778864ef48f7164ac6e135f7c841dab1",
"score": "0.548019",
"text": "def remove_expired_elements()\n min_timestamp = Time.now - @timeout\n @@mutex.synchronize do\n @@aggregate_maps.delete_if { |key, element| element.creation_timestamp < min_timestamp }\n end\n end",
"title": ""
},
{
"docid": "012a9e203644fa62b59da6381ab3ef89",
"score": "0.54487926",
"text": "def determine_stale_clients\n @logger.info(\"determining stale clients\")\n @redis.smembers(\"clients\") do |clients|\n clients.each do |client_name|\n @redis.get(\"client:#{client_name}\") do |client_json|\n unless client_json.nil?\n client = MultiJson.load(client_json)\n next if client[:keepalives] == false\n check = create_keepalive_check(client)\n time_since_last_keepalive = Time.now.to_i - client[:timestamp]\n check[:output] = \"No keepalive sent from client for \"\n check[:output] << \"#{time_since_last_keepalive} seconds\"\n case\n when time_since_last_keepalive >= check[:thresholds][:critical]\n check[:output] << \" (>=#{check[:thresholds][:critical]})\"\n check[:status] = 2\n when time_since_last_keepalive >= check[:thresholds][:warning]\n check[:output] << \" (>=#{check[:thresholds][:warning]})\"\n check[:status] = 1\n else\n check[:output] = \"Keepalive sent from client \"\n check[:output] << \"#{time_since_last_keepalive} seconds ago\"\n check[:status] = 0\n end\n publish_check_result(client[:name], check)\n end\n end\n end\n end\n end",
"title": ""
},
{
"docid": "0318280b9dec80f02c6265016fdd909d",
"score": "0.543436",
"text": "def clean_retry_items!(days:)\n time_ago_cutoff = (Time.new - 24 * 60 * 60 * days).utc\n @retry_hash.delete_if { |_, v| v[:time] < time_ago_cutoff }\n end",
"title": ""
},
{
"docid": "1fe5ebc569f6b5e5f3e9ae671a0ef7d7",
"score": "0.5425651",
"text": "def cleanup\n @mutex.synchronize do\n now = now()\n @data.delete_if { |_key, info| info[:expires_at] < now }\n true\n end\n end",
"title": ""
},
{
"docid": "3b164d16d623abe65ad5ad421485b283",
"score": "0.5398236",
"text": "def wipe\n @clients.clear\n end",
"title": ""
},
{
"docid": "e5294b2e776630d2dea2b72fb1ea72e3",
"score": "0.5377629",
"text": "def get_users_to_drop(expire_sec)\n @users.keys.find_all do |uid|\n u = @users[uid]\n elapsed =\n (u.poll_end and u.poll_end.to_f > 0) ?\n (Time.now - u.poll_end).to_f : 0\n elapsed > expire_sec\n end\n end",
"title": ""
},
{
"docid": "8035ba42043c031db0baeae14529b850",
"score": "0.5371936",
"text": "def clear_timers\n Ramaze::Log.debug(\"Cleared %s timers for %s\" % [ @@redis.llen(_key), _key ])\n @@redis.del _key\n end",
"title": ""
},
{
"docid": "34b5ce2609d6eadf2ed565e727928b7d",
"score": "0.5362213",
"text": "def cleanup\n Mouse.logger.debug(\"Purging records older than #{Mouse.options.oldest} seconds.\")\n Response.destroy_all ['created_at < ?', (Time.now - Mouse.options.oldest).to_s(:db)]\n end",
"title": ""
},
{
"docid": "924eeada9f78a82b26222b6fc936d96d",
"score": "0.5350204",
"text": "def remove_jwks\n @@cache.remove_by { true }\n end",
"title": ""
},
{
"docid": "8c2e186e8ee289870a33ed174b14328d",
"score": "0.5350122",
"text": "def cleantokenlist\n current_time = Time.now.to_i\n Token.where(:expires_on.lt => current_time).delete\n end",
"title": ""
},
{
"docid": "19d8ff0faf657fd401520fa8cfd549b0",
"score": "0.5328464",
"text": "def periodically_delete_expired_access_tokens_from_database\n AccessToken.cached_delete_all_expired\n end",
"title": ""
},
{
"docid": "f14fa17db19c268f0c0eb493576723f8",
"score": "0.5328263",
"text": "def clean_our_session_cache\n cutoff = 1.hour.ago\n @@our_session_cache ||= {}\n @@our_session_cache.each_pair do |key, val|\n if val[:time] < cutoff\n @@our_session_cache.delete(key)\n end\n end\n end",
"title": ""
},
{
"docid": "a48761c517ec7f37bb757e8aca63c103",
"score": "0.5323264",
"text": "def gc\n now = Time.now.to_i\n @mutex.synchronize {\n @data.each_pair do |key, value|\n if now > @data[key][:expires_at]\n @data.delete key\n end\n end\n }\n end",
"title": ""
},
{
"docid": "ae5f7129d9f5baac2ff1366fdfe6ddde",
"score": "0.5312657",
"text": "def clear_crowd_auth_cache\n controller.session.delete_if {|key, val| [\"crowd.last_user_token\", \"crowd.last_auth\", \"crowd.last_username\"].include?(key.to_s)}\n end",
"title": ""
},
{
"docid": "ae5f7129d9f5baac2ff1366fdfe6ddde",
"score": "0.5312657",
"text": "def clear_crowd_auth_cache\n controller.session.delete_if {|key, val| [\"crowd.last_user_token\", \"crowd.last_auth\", \"crowd.last_username\"].include?(key.to_s)}\n end",
"title": ""
},
{
"docid": "349cfb23fc1ad9429173b9259a7dd244",
"score": "0.5289935",
"text": "def expire\n redis.hset(NODES, @cluster.id, Time.now.to_i)\n redis.hgetall(NODES) do |response|\n now = Time.now\n expired = Hash[*response].select do |node, active|\n offset = @nodes[node] || 0\n (now - offset) - Time.at(active.to_i) > 5\n end.keys\n expired.each {|node| delete_all(node) }\n end\n end",
"title": ""
},
{
"docid": "27fd7199dd2ea14e003f858e5e67def5",
"score": "0.52822936",
"text": "def _clean\n now = Time.now\n @pool.each_pair do |endpoint,sessions|\n sessions.delete_if do |session|\n if\n session.last_used.nil? or\n now - session.last_used > http_idle_timeout\n then\n session.finish\n true\n end\n end\n end\n end",
"title": ""
},
{
"docid": "1392f92970125bd7b9e45b5a861c33f6",
"score": "0.5262929",
"text": "def setup_client_monitor\n @logger.debug(\"monitoring client keepalives\")\n @timers[:leader] << EM::PeriodicTimer.new(30) do\n determine_stale_clients\n end\n end",
"title": ""
},
{
"docid": "909c0c3936b14d4d847357ee27d5c305",
"score": "0.5261484",
"text": "def clear_cache\n CacheManagement::User.new([@user.id]).clear\n CacheManagement::Client.new([@client_id]).clear\n CacheManagement::ClientToken.new([@client_token_id]).clear\n CacheManagement::ClientTokenSecure.new([@client_token_id]).clear\n end",
"title": ""
},
{
"docid": "d308829b08c97158b2c146de6f13f26f",
"score": "0.52588534",
"text": "def clear_client_settings_cache\n ClientSetting.flush_client_settings_cache(self.client_id)\n end",
"title": ""
},
{
"docid": "64425d000c18410ac4c2a2e7132ef3e8",
"score": "0.5234808",
"text": "def remove\n client do |client|\n client.stop\n sleep 0.1 while stopping?\n client.clear\n end\n self\n end",
"title": ""
},
{
"docid": "582ddee07cc0b6c187893f0c02763d39",
"score": "0.5223965",
"text": "def expire_transmission_id_cache\n now = Time.now\n #\n # Only check once every minute.\n #\n return unless (now - @transmission_cache_checked_at) > 60\n\n to_delete = []\n\n @transmission_id_cache.delete_if do |tid, received_at|\n (now - received_at) > @transmission_cache_expire_time\n end\n\n @transmission_cache_checked_at = now\n end",
"title": ""
},
{
"docid": "f3e30a7f46d81b40433e3456201855bd",
"score": "0.5223456",
"text": "def clear\n @client.clear\n end",
"title": ""
},
{
"docid": "adf7867da1221c7024a6cafe0920f766",
"score": "0.5219696",
"text": "def revoke!\n self.update_attribute :revoked_at, Time.now\n AuthRequest.where(client_uuid:uuid).each { |d| d.update_attribute :revoked_at, Time.now }\n AccessGrant.where(client_uuid:uuid).each { |d| d.update_attribute :revoked_at, Time.now }\n AccessToken.where(client_uuid:uuid).each { |d| d.update_attribute :revoked_at, Time.now }\n end",
"title": ""
},
{
"docid": "9ede7d859c5435261ad60fc401aa0567",
"score": "0.51862466",
"text": "def remove_expired_message_ids\n lua_script = %{local message_ids = redis.call(\"ZRANGEBYSCORE\", KEYS[1], '-inf', ARGV[1]); for k,v in pairs(message_ids) do redis.call(\"ZREM\", KEYS[1], v); redis.call(\"ZREM\", KEYS[2], v) end}\n redis.eval lua_script, {keys: [message_id_expirations.key, message_ids_without_expiration_gc.key], argv: [Time.current.to_i]}\n end",
"title": ""
},
{
"docid": "f9b0f02bf24323892d4bcba509db3a64",
"score": "0.51796585",
"text": "def _clean\n now = Aws::Util.monotonic_milliseconds\n @pool.each_pair do |endpoint,sessions|\n sessions.delete_if do |session|\n if session.last_used.nil? or now - session.last_used > http_idle_timeout * 1000\n session.finish\n true\n end\n end\n end\n end",
"title": ""
},
{
"docid": "b8f0f54f2bdb6b142b48532bc95a4320",
"score": "0.5164985",
"text": "def reap_old_sessions\n @timestamps.each do |key,stamp|\n if stamp + @session_ttl < Time.now\n delete(key)\n end \n end\n GC.start\n end",
"title": ""
},
{
"docid": "023f9380f76a20a3822229f6c3423b50",
"score": "0.51472795",
"text": "def flush_expired \n if !@cleanup_last.nil? && !@options[:cleanup_life].nil? && (@cleanup_last+@options[:cleanup_life]) < Time.now\n flush_expired!\n end\n end",
"title": ""
},
{
"docid": "503ec2a8c61ad7d3469dc4f789bc78b0",
"score": "0.5141242",
"text": "def _remove_expired\n now = Time.now.to_i\n _edit_metadata do |metadata|\n files_to_delete = []\n metadata[:files].each_pair do |key,(size, _, expires)|\n next unless expires < now\n _cache_file(key).delete\n metadata[:bytes] -= size\n metadata[:files].delete(key)\n end\n end\n end",
"title": ""
},
{
"docid": "9a6982147327f1d86588fee1b9706bab",
"score": "0.5140106",
"text": "def disconnect_all_clients\n\t\tself.log.info \"Disconnecting %d client/s.\" % [ self.clients.length ]\n\t\tself.clients.values.each do |client|\n\t\t\tself.disconnect_client( client )\n\t\tend\n\tend",
"title": ""
},
{
"docid": "be14f35faa5b7ed699dc0af0c638bd63",
"score": "0.5132268",
"text": "def expire_cookies\n current_driver_adapter.expire_cookies\n end",
"title": ""
},
{
"docid": "be14f35faa5b7ed699dc0af0c638bd63",
"score": "0.5132268",
"text": "def expire_cookies\n current_driver_adapter.expire_cookies\n end",
"title": ""
},
{
"docid": "3c1774806fda0d550663ff438c124564",
"score": "0.51304615",
"text": "def clear_expired_sessions\n unless Rails.cache.read \"clear_expired_sessions\" # check timer\n Rails.cache.write \"clear_expired_sessions\", true, :expires_in => 10.minutes #reset timer\n Rails.logger.info \"CLEARING SESSIONS\"\n Session.where(\"updated_at < ? OR created_at < ?\", 1.hours.ago, 12.hours.ago).destroy_all\n Rails.logger.info \"CLEARING SESSIONS COMPLETE\"\n end\n # if we cleared your session\n #unless request.session_options[:id] && ActiveRecord::SessionStore::Session.find_by_session_id(request.session_options[:id]) \n # reset_session # give them a new session\n #end\n end",
"title": ""
},
{
"docid": "2c95e8511950b853d646501fbf649a2c",
"score": "0.51296043",
"text": "def clear_all_expired\n t = Time.now\n\n @cache.each_pair do |name, entry|\n clear_if_expired(name, entry, t)\n end\n end",
"title": ""
},
{
"docid": "9bf639c70fdbbca20963ed6a318de3ea",
"score": "0.51244044",
"text": "def remove_expired_elements()\r\n expired = []\r\n @start_events.delete_if do |key, element|\r\n if(element.age >= @timeout)\r\n expired << element\r\n next true\r\n end\r\n next false\r\n end\r\n\r\n return expired\r\n end",
"title": ""
},
{
"docid": "d61da60a01006aef165ee7b13dcb9685",
"score": "0.50944966",
"text": "def cache_delete(*keys)\n keys.each do |key|\n @client.delete(key)\n end\n end",
"title": ""
},
{
"docid": "31a5948f983ebc4159428d317e5798a7",
"score": "0.50921357",
"text": "def clean_cache_after_destroy\n @live_keys ||= self.class.live_fields.map { |f| key(f) }\n @internal_redis ||= InternalRedis.new(self.class.name)\n @internal_redis.del @live_keys\n @internal_redis.del id\n end",
"title": ""
},
{
"docid": "422a9126c6cdf0df1395ee4de7ad6445",
"score": "0.5088605",
"text": "def flush_expired\n now = Time.now\n\n expired_files = Dir.glob( File.join( @path, '*' ) ).find_all do |f|\n ( now - File.mtime( f ) ) / ONE_DAY > MAX_AGE\n end\n\n FileUtils.rm expired_files\n end",
"title": ""
},
{
"docid": "8827394f38a2d1da926bc2c87fa1f4d4",
"score": "0.5077",
"text": "def send_logouts_to_all_clients\n @@clients.each do |client|\n client.logout_request\n end\n end",
"title": ""
},
{
"docid": "83e2b7ffa5de88aa7033512c7721fa2b",
"score": "0.5052113",
"text": "def flush_expired \n if gc_last && gc_time && gc_last+gc_time <= Time.now \n flush_expired!\n end\n end",
"title": ""
},
{
"docid": "f31c48e582c0e551231badaa64d6165e",
"score": "0.5051188",
"text": "def clear_stale_cached_records\n cache_paths.each do |cache_path|\n Dir.glob(cache_path.join(\"**/*.#{DependencyRecord::EXTENSION}\")).each do |file|\n next if files.include?(file)\n\n FileUtils.rm(file)\n end\n end\n end",
"title": ""
},
{
"docid": "993b2e83c9d0e67d5ea0a8d7daa2a7a5",
"score": "0.5032524",
"text": "def disconnect_clients\n Clients.disconnect\n end",
"title": ""
},
{
"docid": "1fe935373bc0d7571a73a86589658364",
"score": "0.5028791",
"text": "def clear(affected_api_keys)\n\n super()\n\n affected_api_keys.each do |affected_api_key|\n # delete cache key set by saas which has secret key for given secret key\n Memcache.delete_from_all_instances(\"#{GlobalConstant::Cache.saas_key_prefix}_#{GlobalConstant::Cache.key_prefixes_template_vars[:kit_saas_subenv]}_cs_#{affected_api_key.downcase}\")\n end\n\n nil\n\n end",
"title": ""
},
{
"docid": "876dd62f0876cf8f26da4c7629fe1d25",
"score": "0.50187844",
"text": "def expired\n # service => addr_list\n to_delete = {}\n\n @expires.each do |service, addr_expire_list|\n addr_expire_list.each do |addr, expire|\n if expire < Time.now\n to_delete[service] ||= []\n to_delete[service] << addr\n end\n end\n end\n\n to_delete.each do |service, addr_list|\n addr_list.each do |addr|\n @available[service].delete(addr) if @available[service]\n @expires[service].delete(addr) if @expires[service]\n end\n end\n \n debug{ \"to_delete = #{to_delete.inspect}\" }\n return to_delete\n end",
"title": ""
},
{
"docid": "02a67d884acd11fc4494cf5216d213fc",
"score": "0.5015921",
"text": "def flush_expired!\n Dir[ File.join( store, \"*.cache\" ) ].each do |f| \n if (File.mtime(f)+timeout) <= Time.now\n File.delete(f) \n end\n end\n @gc_last = Time.now\n end",
"title": ""
},
{
"docid": "b174142d6559a6bc9d1985387781993c",
"score": "0.5014343",
"text": "def destroy\n update_attribute :expires_at, Time.now\n messages.delete_all\n end",
"title": ""
},
{
"docid": "807595f2c00e61dd5d667881be6e600f",
"score": "0.5010389",
"text": "def flush_expired!\n # commenting out forking until I'm sure it's necessary\n # and won't cause zombie processes\n #gcpid = Process.fork do\n collection.remove(expires: {'$lt' => Time.now})\n unless @ensure_indexes\n collection.ensure_index([[:tags, 1]])\n collection.ensure_index([[:expires, -1]])\n end\n @cleanup_last = Time.now\n #end\n #Process.detach(gcpid)\n end",
"title": ""
},
{
"docid": "4a1c3b2ee0c21a6c1e0f1a1e968d83ad",
"score": "0.5009135",
"text": "def unregister client\n\t\t\t@clients.delete client\n\t\tend",
"title": ""
},
{
"docid": "2c9794876eb3fe6a401c477f89148744",
"score": "0.49995258",
"text": "def clear_app_caches\n c = self.changed\n if (!self.app_caches_cleared_at.nil? && self.app_caches_cleared_at < 2.minutes.ago) &&\n !c.include?(\"app_caches_cleared_at\")\n self.program_apps.each do |program_app|\n program_app.clear_cache\n end\n self.update_attribute(:app_caches_cleared_at, DateTime.now)\n end\n end",
"title": ""
},
{
"docid": "334ef4cfb80317d731f6684cb02cc917",
"score": "0.49994802",
"text": "def expire_access_tokens\n access_tokens.not_expired.update_all(expired_at: Time.now)\n end",
"title": ""
},
{
"docid": "f1af163beaa538304aa555cb5e693de2",
"score": "0.49942935",
"text": "def remove_expired_cache\n while @cleaning_cache\n sleep(1) # default 5 seconds\n # --- Searching Expired Cache ---\n @hash_storage.each do |key, cache|\n if expired?(key)\n remove_entry(key)\n puts \"Removing #{cache} with key: #{key}\"\n end\n end\n @cleaning_cache = false\n # puts 'Cache Cleaned'\n end\n end",
"title": ""
},
{
"docid": "b50e2ec545645d77dd3d26bcf84a12dc",
"score": "0.4992913",
"text": "def cleanup \n\n @keys.each do |key, val|\n if Time.now.to_i - @keys[key][:keep_alive_stamp] >= @ttl\n delete key\n elsif Time.now.to_i - @keys[key][:assigned_stamp] >= @timeout\n release key\n end\n end\n\n end",
"title": ""
},
{
"docid": "f60cab696c936f3456020a137ad7bf5b",
"score": "0.49904898",
"text": "def revoke!\n self.revoked = Time.now.to_i\n Client.collection.update({ :_id=>id }, { :$set=>{ :revoked=>revoked } })\n AuthRequest.collection.update({ :client_id=>id }, { :$set=>{ :revoked=>revoked } })\n AccessGrant.collection.update({ :client_id=>id }, { :$set=>{ :revoked=>revoked } })\n AccessToken.collection.update({ :client_id=>id }, { :$set=>{ :revoked=>revoked } })\n end",
"title": ""
},
{
"docid": "09b7a938ae0ee8deffcfa45c6975accb",
"score": "0.4987015",
"text": "def destroy_support_clients!\n current_users.each do |user_config|\n begin\n pmp = get_pmp_client(user_config)\n pmp.credentials.list.clients.each do |cred|\n if cred['label'] == SUPPORT_CLIENT_LABEL\n pmp.credentials.destroy(cred['client_id'])\n end\n end\n rescue Faraday::ClientError => e\n # just ignore any errors and continue with logout\n end\n end\n end",
"title": ""
},
{
"docid": "03c1e21e4fd566d2b9710bf39acc8858",
"score": "0.4983188",
"text": "def removeExpiredKeywords max_mins\n unless @queue.first.nil?\n # While the keyword at the head of the queue was added more than max_mins ago\n while @queue.first.time + max_mins * 60 < Time.now or @queue.first.nil?\n # If this is the last instance of this keyword then delete it from the hash\n if @keywords_count[@queue.first.word] == 1\n @keywords_count.delete(@queue.first.word)\n # Remove it from the queue\n @queue.shift\n else\n # Deduct it from the keyword count\n @keywords_count[@queue.first.word] = @keywords_count[@queue.first.word] - 1\n # Remove it from the queue\n @queue.shift\n end\n end\n end\n end",
"title": ""
},
{
"docid": "039a6e6553b09d62219f1e1f42d8e050",
"score": "0.49771884",
"text": "def collect_garbage(keys)\n keys.each do |key|\n activity_counter_key = \"#{key}:counter\"\n # Check if the key is referenced anywhere\n if ::Tekeya.redis.get(activity_counter_key).to_i <= 0\n # Delete the activity and the counter\n ::Tekeya.redis.multi do\n ::Tekeya.redis.del(key)\n ::Tekeya.redis.del(activity_counter_key)\n end\n end\n end\n end",
"title": ""
},
{
"docid": "d780f6ecf87b35695f79039dabae434d",
"score": "0.49741304",
"text": "def cleanup_list\n $redis.zremrangebyscore(redis_key(), 0, 0)\n end",
"title": ""
},
{
"docid": "6a20a44e596382ae96b413cbda0b3be7",
"score": "0.49686846",
"text": "def expire_session_cookies\n get_me_the_cookies.each do |cookie|\n delete_cookie(cookie[:name]) if cookie[:expires].nil?\n end\nend",
"title": ""
},
{
"docid": "2d6e2acca5416f8d9c55929daf3adc2b",
"score": "0.49603513",
"text": "def removeOldRequests\n now = Time.new\n @requestedPieces.length.times do |i|\n if @requestedPieces.set? i\n if now - @pieceRequestTime[i] > @requestTimeout\n @requestedPieces.clear i\n @pieceRequestTime[i] = nil\n end\n end\n end\n end",
"title": ""
},
{
"docid": "a2b4a87ec731c36e53f2d4681f046a3f",
"score": "0.4949979",
"text": "def flush_cache\n KitSaasSharedCacheManagement::ClientWhitelisting.new([client_id]).clear\n end",
"title": ""
},
{
"docid": "43140f4b20f3bb1bfef743c8167aee2a",
"score": "0.4947425",
"text": "def drop_users\n @update_mutex.synchronize do\n uids = @roster.get_users_to_drop(SESSION_TIMEOUT)\n if uids.size > 0\n uids.each do |uid|\n log \"dropping timed-out user #{uid}\"\n u = @roster.get_user uid\n drop_user uid, false\n end\n announce_update\n end\n end\n end",
"title": ""
},
{
"docid": "d387f047fbda97b69efc456179dd7246",
"score": "0.49467728",
"text": "def flush_cache\n CacheManagement::ClientManager.new([manager_id], {client_id: client_id}).clear\n end",
"title": ""
},
{
"docid": "ba80c4cc9776584d11b3fb09fc007118",
"score": "0.49361932",
"text": "def remove_client(opts)\n opts = check_params(opts,[:clients])\n super(opts)\n end",
"title": ""
},
{
"docid": "b0db031ae1cd3bde33940908a74fc896",
"score": "0.49353445",
"text": "def remove_client(client)\n CLIENTS.delete client\n puts 'connection closed'\n end",
"title": ""
},
{
"docid": "6ff02f923c0b57302826f1e535d3df5a",
"score": "0.4924671",
"text": "def clients_without_contract\n all = Client.all\n current_clients = current_clients_list\n not_clients = all - current_clients\n not_clients\n end",
"title": ""
},
{
"docid": "105127d35e73baa85e63aacdb7734768",
"score": "0.49211997",
"text": "def allowed_removed_clients\n %w(credhub_admin_client network-policy)\n end",
"title": ""
},
{
"docid": "50ff2eadf9000810ac8ae3c6df927edf",
"score": "0.4920524",
"text": "def drop_bad_clients\n # bad_clients = @clients.collect { |c| c if c.opt_mcs == 'none' }.compact\n # bad_clients.each do |bc|\n # puts \"\"\n # puts \"coord: #{bc.x}, #{bc.y}\"\n # puts \"cinr: #{bc.cinr}\"\n # puts \"dist: #{bc.dist_from_tower}\"\n # end\n @clients.delete_if { |c| c.opt_mcs == 'none' }\n end",
"title": ""
},
{
"docid": "7691c95c288b1875306524ece2bd5b8f",
"score": "0.49205092",
"text": "def teardown\n Yao::Config::HOOK_RENEW_CLIENT_KEYS.each do |key|\n Yao.configure do\n set key, nil\n end\n end\n end",
"title": ""
},
{
"docid": "7975888d00cecd43b4a942438e981dc9",
"score": "0.4914292",
"text": "def remove_expired_nodes(node_expire_timeout)\n engine = ProjectYaML::Engine.instance\n engine.remove_expired_nodes(node_expire_timeout)\n end",
"title": ""
},
{
"docid": "3af4f57e585246b000d664c3259b772d",
"score": "0.49077535",
"text": "def revoke!\n self.revoked_at = Time.now\n self.save\n client = Client.where(uuid:client_uuid).inc(tokens_revoked: 1)\n end",
"title": ""
},
{
"docid": "6076ed1fcc386d9e9b48ec2feba5d918",
"score": "0.48992425",
"text": "def cache_clear\n @client.flush\n end",
"title": ""
},
{
"docid": "b0ac419f6205e8adcec44b4d0019d2df",
"score": "0.4892146",
"text": "def expire_all\n cache_class.expire_all\n end",
"title": ""
},
{
"docid": "783b2a0ecc537737fbb584e0a7455cbd",
"score": "0.4891281",
"text": "def connected_users\n key = redis_key('accessing_users')\n\n # Since we can only expire top-level keys in Redis and not set/hash\n # elements, we can \"fake\" this expiration by adding the user IDs to\n # a sorted set where their scores are their absolute expiration time;\n # then whenever we query the currently connected users, we remove the\n # ones with scores less than the current time.\n $redis.zremrangebyscore key, 0, Time.now.to_i\n\n # Then whatever remains in the set are the user IDs that haven't yet\n # expired.\n User.where(id: $redis.zrange(key, 0, -1))\n end",
"title": ""
},
{
"docid": "783b2a0ecc537737fbb584e0a7455cbd",
"score": "0.4891281",
"text": "def connected_users\n key = redis_key('accessing_users')\n\n # Since we can only expire top-level keys in Redis and not set/hash\n # elements, we can \"fake\" this expiration by adding the user IDs to\n # a sorted set where their scores are their absolute expiration time;\n # then whenever we query the currently connected users, we remove the\n # ones with scores less than the current time.\n $redis.zremrangebyscore key, 0, Time.now.to_i\n\n # Then whatever remains in the set are the user IDs that haven't yet\n # expired.\n User.where(id: $redis.zrange(key, 0, -1))\n end",
"title": ""
},
{
"docid": "2bed9401effa09094d86dc5e52f21ed6",
"score": "0.4887311",
"text": "def clear_subscribers\n @subscribers = []\n end",
"title": ""
},
{
"docid": "2bed9401effa09094d86dc5e52f21ed6",
"score": "0.4887311",
"text": "def clear_subscribers\n @subscribers = []\n end",
"title": ""
},
{
"docid": "31f3738a880cb746c2dc963cd3f720a6",
"score": "0.48866022",
"text": "def unsynced(seconds)\n with_stale_stash_timestamp(LAST_SYNCED_KEY, seconds)\n end",
"title": ""
},
{
"docid": "967c55ad4c32af7719e1aca3de72da72",
"score": "0.48766395",
"text": "def destroy\n @@client = nil\n self\n end",
"title": ""
},
{
"docid": "4ade730e71005eff31ab194da5e22aa1",
"score": "0.48744327",
"text": "def remove_expired_elements()\n expired = []\n @transactions.delete_if do |key, transaction|\n if(transaction.age >= @timeout)\n #print(\"Deleting expired_elements\")\n transaction.tag(TRANSACTION_TIME_EXPIRED_TAG)\n (expired << transaction.getEvents()).flatten!\n next true\n end\n next false\n end\n return expired\n end",
"title": ""
},
{
"docid": "e9c1d33beca984510c92d16b7b10e028",
"score": "0.48630524",
"text": "def clearExpiredTokens()\n Thread.new do\n while true\n sleep(5 * 60)\n $tokens.reject! {|x, y| y[0] < Time.now}\n end\n end\nend",
"title": ""
},
{
"docid": "e1415fa85c6fdfc787f219a292741885",
"score": "0.48615077",
"text": "def cleanup\n @sessions.each_pair do |session_id, session|\n if session.timed_out?\n @sessions.delete(session_id)\n end\n end\n end",
"title": ""
},
{
"docid": "46005b093074ae2904abe27992e82fd6",
"score": "0.48559907",
"text": "def flush(options = {})\r\n expired_elements = []\r\n\r\n @mutex.synchronize do\r\n increment_age_by(5)\r\n expired_elements = remove_expired_elements()\r\n end\r\n\r\n return create_expired_events_from(expired_elements)\r\n end",
"title": ""
},
{
"docid": "3ebc27d519723b39e0dcef797619501f",
"score": "0.48516303",
"text": "def delete_inactive_stashes!(seconds)\n with_error_handling('Deleting inactive stashes') do\n find_stash_keys_for_stale_timestamp(LAST_ACCESSED_KEY, seconds).inject(0) do |m, k|\n m += redis.del(k)\n end\n end\n end",
"title": ""
},
{
"docid": "991d920151264c51e97528ebcd4f3df3",
"score": "0.4846736",
"text": "def services_list_with_renew\n @services_list = nil\n services_list\n end",
"title": ""
},
{
"docid": "dc744f3414f45ec939e06a7557b6095b",
"score": "0.48461166",
"text": "def reset_cookies\n @rally_http_client.cookie_manager.cookies = []\n end",
"title": ""
}
] |
c657de4b70d266e9a3a784b999ea9e60 | Never trust parameters from the scary internet, only allow the white list through. | [
{
"docid": "a2088fc4ba33b9ba097e031056096619",
"score": "0.0",
"text": "def animal_found_params\n params.require(:animal_found).permit(:image, :specie, :sex, :founddate, :foundplace, :contact, :ps)\n end",
"title": ""
}
] | [
{
"docid": "3663f9efd3f3bbf73f4830949ab0522b",
"score": "0.7495027",
"text": "def whitelisted_params\n super\n end",
"title": ""
},
{
"docid": "13a61145b00345517e33319a34f7d385",
"score": "0.69566035",
"text": "def strong_params\n params.require(:request).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "c72da3a0192ce226285be9c2a583d24a",
"score": "0.69225836",
"text": "def strong_params\n params.require(:post).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "3d346c1d1b79565bee6df41a22a6f28d",
"score": "0.68929327",
"text": "def strong_params\n params.require(:resource).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "aa06a193f057b6be7c0713a5bd30d5fb",
"score": "0.67848456",
"text": "def strong_params\n params.require(:listing).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "f6060519cb0c56a439976f0c978690db",
"score": "0.674347",
"text": "def permitted_params\n params.permit!\n end",
"title": ""
},
{
"docid": "fad8fcf4e70bf3589fbcbd40db4df5e2",
"score": "0.6682223",
"text": "def allowed_params\n # Only this one attribute will be allowed, no hacking\n params.require(:user).permit(:username)\n end",
"title": ""
},
{
"docid": "b453d9a67af21a3c28a62e1848094a41",
"score": "0.6636527",
"text": "def strong_params\n params.require(:kpi).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "2c8e2be272a55477bfc4c0dfc6baa7a7",
"score": "0.66291976",
"text": "def strong_params\n params.require(:community_member).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "1685d76d665d2c26af736aa987ac8b51",
"score": "0.66258276",
"text": "def permitted_params\n params.permit!\n end",
"title": ""
},
{
"docid": "77f5795d1b9e0d0cbd4ea67d02b5ab7f",
"score": "0.65625846",
"text": "def safe_params\n params.except(:host, :port, :protocol).permit!\n end",
"title": ""
},
{
"docid": "cc1542a4be8f3ca5dc359c2eb3fb7d18",
"score": "0.6491194",
"text": "def strong_params\n params.require(:message).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "e291b3969196368dd4f7080a354ebb08",
"score": "0.6477825",
"text": "def permitir_parametros\n \t\tparams.permit!\n \tend",
"title": ""
},
{
"docid": "2d2af8e22689ac0c0408bf4cb340d8c8",
"score": "0.64526874",
"text": "def allowed_params\n params.require(:user).permit(:name, :email)\n end",
"title": ""
},
{
"docid": "236e1766ee20eef4883ed724b83e4176",
"score": "0.64001405",
"text": "def param_whitelist\n [\n :name,\n :tagline, :contact, :summary, :stage,\n :website, :facebook, :twitter, :linkedin, :github,\n :founded_at,\n community_ids: [],\n sectors: [\n :commercial,\n :social,\n :research\n ],\n privacy: [\n contact: [],\n kpis: []\n ],\n permission: [\n listings: [],\n profile: [],\n posts: [],\n kpis: []\n ],\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n end",
"title": ""
},
{
"docid": "b29cf4bc4a27d4b199de5b6034f9f8a0",
"score": "0.63810205",
"text": "def safe_params\n params\n .require( self.class.model_class.name.underscore.to_sym )\n .permit( self.class.params_list )\n end",
"title": ""
},
{
"docid": "bfb292096090145a067e31d8fef10853",
"score": "0.63634825",
"text": "def param_whitelist\n whitelist = [\n :title, :description, :skills,\n :positions, :category, :salary_period,\n :started_at, :finished_at,\n :deadline,\n :salary_min, :salary_max, :hours,\n :equity_min, :equity_max,\n :privacy,\n :owner_id, :owner_type,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n unless action_name === 'create'\n whitelist.delete(:owner_id)\n whitelist.delete(:owner_type)\n end\n \n whitelist\n end",
"title": ""
},
{
"docid": "6bf3ed161b62498559a064aea569250a",
"score": "0.633783",
"text": "def require_params\n return nil\n end",
"title": ""
},
{
"docid": "b4c9587164188c64f14b71403f80ca7c",
"score": "0.6336759",
"text": "def sanitize_params!\n request.sanitize_params!\n end",
"title": ""
},
{
"docid": "b63e6e97815a8745ab85cd8f7dd5b4fb",
"score": "0.6325718",
"text": "def excluded_from_filter_parameters; end",
"title": ""
},
{
"docid": "38bec0546a7e4cbf4c337edbee67d769",
"score": "0.631947",
"text": "def user_params\n # Returns a sanitized hash of the params with nothing extra\n params.permit(:name, :email, :img_url, :password)\n end",
"title": ""
},
{
"docid": "37d1c971f6495de3cdd63a3ef049674e",
"score": "0.63146484",
"text": "def param_whitelist\n whitelist = [\n :name,\n :overview,\n :website, :facebook, :twitter,\n :privacy,\n :avatar_id, :community_id, :category_ids,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n unless action_name === 'create'\n whitelist.delete(:community_id)\n end\n \n whitelist\n end",
"title": ""
},
{
"docid": "5ec018b4a193bf3bf8902c9419279607",
"score": "0.63137317",
"text": "def user_params # contains strong parameters\n params.require(:user).permit(:name, :email, :password,\n :password_confirmation)\n # strong parameters disallows any post information that is not permitted (admin security) when signing_up\n # so not all users will get admin access by hacking params using curl\n end",
"title": ""
},
{
"docid": "91bfe6d464d263aa01e776f24583d1d9",
"score": "0.6306224",
"text": "def permitir_parametros\n params.permit!\n end",
"title": ""
},
{
"docid": "e012d7306b402a37012f98bfd4ffdb10",
"score": "0.6301168",
"text": "def strong_params\n params.require(:team).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "157e773497f78353899720ad034a906a",
"score": "0.63000035",
"text": "def white_list_params\n params.require(:white_list).permit(:ip, :comment)\n end",
"title": ""
},
{
"docid": "8c384af787342792f0efc7911c3b2469",
"score": "0.629581",
"text": "def whitelisted_vegetable_params\n params.require(:vegetable).permit(:name, :color, :rating, :latin_name)\n end",
"title": ""
},
{
"docid": "0f69d0204a0c9a5e4a336cbb3dccbb2c",
"score": "0.62926817",
"text": "def allowed_params\n params.permit(:campaign_id,:marketer_id,:creator_id,:status)\n end",
"title": ""
},
{
"docid": "0f69d0204a0c9a5e4a336cbb3dccbb2c",
"score": "0.62926817",
"text": "def allowed_params\n params.permit(:campaign_id,:marketer_id,:creator_id,:status)\n end",
"title": ""
},
{
"docid": "9b76b3149ac8b2743f041d1af6b768b5",
"score": "0.6280713",
"text": "def filter_params\n params.permit(\n\t\t\t\t:name,\n\t\t\t\t:sitedefault,\n\t\t\t\t:opinions,\n\t\t\t\t:contested,\n\t\t\t\t:uncontested,\n\t\t\t\t:initiators,\n\t\t\t\t:comments,\n\t\t\t\t:following,\n\t\t\t\t:bookmarks,\n\t\t\t\t:lone_wolf,\n\t\t\t\t:level_zero,\n\t\t\t\t:level_nonzero,\n\t\t\t\t:private,\n\t\t\t\t:public_viewing,\n\t\t\t\t:public_comments,\n\t\t\t\t:has_parent,\n\t\t\t\t:has_no_parent,\n\t\t\t\t:today,\n\t\t\t\t:last_week,\n\t\t\t\t:last_month,\n\t\t\t\t:last_year,\n\t\t\t\t:sort_by_created_at,\n\t\t\t\t:sort_by_updated_at,\n\t\t\t\t:sort_by_views,\n\t\t\t\t:sort_by_votes,\n\t\t\t\t:sort_by_scores,\n\t\t\t\t:who_id)\n end",
"title": ""
},
{
"docid": "603f4a45e5efa778afca5372ae8a96dc",
"score": "0.6271388",
"text": "def param_whitelist\n [:role]\n end",
"title": ""
},
{
"docid": "f6399952b4623e5a23ce75ef1bf2af5a",
"score": "0.6266194",
"text": "def allowed_params\n\t\tparams.require(:password).permit(:pass)\n\tend",
"title": ""
},
{
"docid": "37c5d0a9ebc5049d7333af81696608a0",
"score": "0.6256044",
"text": "def safe_params\n\t\tparams.require(:event).permit(:title, :event_date, :begti, :endti, :comments, :has_length, :is_private)\n\tend",
"title": ""
},
{
"docid": "505e334c1850c398069b6fb3948ce481",
"score": "0.62550515",
"text": "def sanitise!\n @params.keep_if {|k,v| whitelisted? k}\n end",
"title": ""
},
{
"docid": "6c4620f5d8fd3fe3641e0474aa7014b2",
"score": "0.62525266",
"text": "def white_listed_parameters\n params\n .require(:movie)\n .permit(:title, :description, :year_released)\n end",
"title": ""
},
{
"docid": "d14bb69d2a7d0f302032a22bb9373a16",
"score": "0.6234781",
"text": "def protect_my_params\n return params.require(:photo).permit(:title, :artist, :url)\n\tend",
"title": ""
},
{
"docid": "5629f00db37bf403d0c58b524d4c3c37",
"score": "0.62278074",
"text": "def filtered_params\n params.require(:user).permit(:name, :email, :password, :password_confirmation)\n end",
"title": ""
},
{
"docid": "d370098b1b3289dbd04bf1c073f2645b",
"score": "0.6226693",
"text": "def allow_params\n params.permit(:id, :email, :password)\n end",
"title": ""
},
{
"docid": "fde8b208c08c509fe9f617229dfa1a68",
"score": "0.6226605",
"text": "def strong_params\n params.require(:thread).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "78cbf68c3936c666f1edf5f65e422b6f",
"score": "0.6226114",
"text": "def whitelisted_user_params\n if params[:user]\n params.require(:user).permit(:email, :username, :password)\n else\n { :email => params[:email],\n :username => params[:username],\n :password => params[:password] }\n end\nend",
"title": ""
},
{
"docid": "d38efafa6be65b2f7da3a6d0c9b7eaf5",
"score": "0.6200643",
"text": "def roaster_params\n # Returns a sanitized hash of the params with nothing extra\n params.permit(:name, :email, :img_url, :password_digest, :address, :website, :phone, :latitude, :longitutde, :description)\n end",
"title": ""
},
{
"docid": "d724124948bde3f2512c5542b9cdea74",
"score": "0.61913997",
"text": "def alpha_provider_params\n params.require(:alpha_provider).permit!\n end",
"title": ""
},
{
"docid": "d18a36785daed9387fd6d0042fafcd03",
"score": "0.61835426",
"text": "def white_listed_parameters\n params\n .require(:company)\n .permit(:company_name, :company_avatar)\n end",
"title": ""
},
{
"docid": "36956168ba2889cff7bf17d9f1db41b8",
"score": "0.6179986",
"text": "def set_param_whitelist(*param_list)\n self.param_whitelist = param_list\n end",
"title": ""
},
{
"docid": "07bc0e43e1cec1a821fb2598d6489bde",
"score": "0.61630195",
"text": "def accept_no_params\n accept_params {}\n end",
"title": ""
},
{
"docid": "fc4b1364974ea591f32a99898cb0078d",
"score": "0.6160931",
"text": "def request_params\n params.permit(:username, :password, :user_id, :status, :accepted_by, :rejected_by)\n end",
"title": ""
},
{
"docid": "13e3cfbfe510f765b5944667d772f453",
"score": "0.6155551",
"text": "def admin_security_params\n params.require(:security).permit(:name, :url, :commonplace_id)\n end",
"title": ""
},
{
"docid": "84bd386d5b2a0d586dca327046a81a63",
"score": "0.61542404",
"text": "def good_params\n permit_params\n end",
"title": ""
},
{
"docid": "b9432eac2fc04860bb585f9af0d932bc",
"score": "0.61356604",
"text": "def wall_params\n params.permit(:public_view, :guest)\n end",
"title": ""
},
{
"docid": "f2342adbf71ecbb79f87f58ff29c51ba",
"score": "0.61342114",
"text": "def housing_request_params\n params[:housing_request].permit! #allow all parameters for now\n end",
"title": ""
},
{
"docid": "8fa507ebc4288c14857ace21acf54c26",
"score": "0.61188847",
"text": "def strong_params\n # to dooo\n end",
"title": ""
},
{
"docid": "9292c51af27231dfd9f6478a027d419e",
"score": "0.61140966",
"text": "def domain_params\n params[:domain].permit!\n end",
"title": ""
},
{
"docid": "fc43ee8cb2466a60d4a69a04461c601a",
"score": "0.611406",
"text": "def check_params; true; end",
"title": ""
},
{
"docid": "fc43ee8cb2466a60d4a69a04461c601a",
"score": "0.611406",
"text": "def check_params; true; end",
"title": ""
},
{
"docid": "a3aee889e493e2b235619affa62f39c3",
"score": "0.61107725",
"text": "def user_params\n params.permit(:full_name, :email, :job, :about, :max_search_distance,\n :website_url, :linkedin_url,\n :behance_url, :github_url, :stackoverflow_url)\n end",
"title": ""
},
{
"docid": "585f461bf01ed1ef8d34fd5295a96dca",
"score": "0.61038506",
"text": "def param_whitelist\n whitelist = [\n :message,\n :privacy,\n :author_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:author_id)\n end\n \n whitelist\n end",
"title": ""
},
{
"docid": "585f461bf01ed1ef8d34fd5295a96dca",
"score": "0.61038506",
"text": "def param_whitelist\n whitelist = [\n :message,\n :privacy,\n :author_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:author_id)\n end\n \n whitelist\n end",
"title": ""
},
{
"docid": "b63ab280629a127ecab767e2f35b8ef0",
"score": "0.6097247",
"text": "def params\n @_params ||= super.tap {|p| p.permit!}.to_unsafe_h\n end",
"title": ""
},
{
"docid": "b63ab280629a127ecab767e2f35b8ef0",
"score": "0.6097247",
"text": "def params\n @_params ||= super.tap {|p| p.permit!}.to_unsafe_h\n end",
"title": ""
},
{
"docid": "677293afd31e8916c0aee52a787b75d8",
"score": "0.60860336",
"text": "def newsletter_params\n params.permit!.except(:action, :controller, :_method, :authenticity_token)\n end",
"title": ""
},
{
"docid": "e50ea3adc222a8db489f0ed3d1dce35b",
"score": "0.60855556",
"text": "def params_without_facebook_data\n params.except(:signed_request).permit!.to_hash\n end",
"title": ""
},
{
"docid": "b7ab5b72771a4a2eaa77904bb0356a48",
"score": "0.608446",
"text": "def search_params\n params.permit!.except(:controller, :action, :format)\n end",
"title": ""
},
{
"docid": "b2841e384487f587427c4b35498c133f",
"score": "0.6076753",
"text": "def allow_params_authentication!\n request.env[\"devise.allow_params_authentication\"] = true\n end",
"title": ""
},
{
"docid": "3f5347ed890eed5ea86b70281803d375",
"score": "0.60742563",
"text": "def user_params\n params.permit!\n end",
"title": ""
},
{
"docid": "0c8779b5d7fc10083824e36bfab170de",
"score": "0.60677326",
"text": "def white_base_params\n params.fetch(:white_base, {}).permit(:name)\n end",
"title": ""
},
{
"docid": "7646659415933bf751273d76b1d11b40",
"score": "0.60666215",
"text": "def whitelisted_observation_params\n return unless params[:observation]\n\n params[:observation].permit(whitelisted_observation_args)\n end",
"title": ""
},
{
"docid": "fa0608a79e8d27c2a070862e616c8c58",
"score": "0.6065763",
"text": "def vampire_params\n # whitelist all of the vampire attributes so that your forms work!\n end",
"title": ""
},
{
"docid": "a3dc8b6db1e6584a8305a96ebb06ad21",
"score": "0.60655254",
"text": "def need_params\n end",
"title": ""
},
{
"docid": "4f8205e45790aaf4521cdc5f872c2752",
"score": "0.6064794",
"text": "def search_params\n params.permit(:looking_for, :utf8, :authenticity_token, :min_age,\n :max_age, :sort_by, likes:[])\n end",
"title": ""
},
{
"docid": "e39a8613efaf5c6ecf8ebd58f1ac0a06",
"score": "0.6062697",
"text": "def permitted_params\n params.permit :utf8, :_method, :authenticity_token, :commit, :id,\n :encrypted_text, :key_size\n end",
"title": ""
},
{
"docid": "c436017f4e8bd819f3d933587dfa070a",
"score": "0.60620916",
"text": "def filtered_parameters; end",
"title": ""
},
{
"docid": "d6886c65f0ba5ebad9a2fe5976b70049",
"score": "0.60562736",
"text": "def allow_params_authentication!\n request.env[\"devise.allow_params_authentication\"] = true\n end",
"title": ""
},
{
"docid": "96ddf2d48ead6ef7a904c961c284d036",
"score": "0.60491294",
"text": "def user_params\n permit = [\n :email, :password, :password_confirmation,\n :image, :name, :nickname, :oauth_token,\n :oauth_expires_at, :provider, :birthday\n ]\n params.permit(permit)\n end",
"title": ""
},
{
"docid": "f78d6fd9154d00691c34980d7656b3fa",
"score": "0.60490465",
"text": "def authorize_params\n super.tap do |params|\n %w[display with_offical_account forcelogin].each do |v|\n if request.params[v]\n params[v.to_sym] = request.params[v]\n end\n end\n end\n end",
"title": ""
},
{
"docid": "f78d6fd9154d00691c34980d7656b3fa",
"score": "0.60490465",
"text": "def authorize_params\n super.tap do |params|\n %w[display with_offical_account forcelogin].each do |v|\n if request.params[v]\n params[v.to_sym] = request.params[v]\n end\n end\n end\n end",
"title": ""
},
{
"docid": "75b7084f97e908d1548a1d23c68a6c4c",
"score": "0.6046521",
"text": "def allowed_params\n params.require(:sea).permit(:name, :temperature, :bio, :mood, :image_url, :favorite_color, :scariest_creature, :has_mermaids)\n end",
"title": ""
},
{
"docid": "080d2fb67f69228501429ad29d14eb29",
"score": "0.6041768",
"text": "def filter_user_params\n params.require(:user).permit(:name, :email, :password, :password_confirmation)\n end",
"title": ""
},
{
"docid": "aa0aeac5c232d2a3c3f4f7e099e7e6ff",
"score": "0.60346854",
"text": "def parameters\n params.permit(permitted_params)\n end",
"title": ""
},
{
"docid": "0bdcbbe05beb40f7a08bdc8e57b7eca8",
"score": "0.6030552",
"text": "def filter_params\n end",
"title": ""
},
{
"docid": "cf73c42e01765dd1c09630007357379c",
"score": "0.6024842",
"text": "def params_striper\n\t \tparams[:user].delete :moonactor_ability\n\t end",
"title": ""
},
{
"docid": "793abf19d555fb6aa75265abdbac23a3",
"score": "0.6021606",
"text": "def user_params\n if admin_user?\n params.require(:user).permit(:email, :password, :password_confirmation, :name, :address_1, :address_2, :apt_number, :city, :state_id, :zip_code, :newsletter, :active, :admin, :receive_customer_inquiry)\n else\n # Don't allow non-admin users to hack the parameters and give themselves admin security; self created records automatically set to active\n params.require(:user).permit(:email, :password, :password_confirmation, :name, :address_1, :address_2, :apt_number, :city, :state_id, :zip_code, :newsletter)\n end\n end",
"title": ""
},
{
"docid": "2e70947f467cb6b1fda5cddcd6dc6304",
"score": "0.6019679",
"text": "def strong_params(wimpy_params)\n ActionController::Parameters.new(wimpy_params).permit!\nend",
"title": ""
},
{
"docid": "2a11104d8397f6fb79f9a57f6d6151c7",
"score": "0.6017253",
"text": "def user_params\n sanitize params.require(:user).permit(:username, :password, :password_confirmation, :display_name, :about_me, :avatar, :current_password, :banned, :ban_message)\n end",
"title": ""
},
{
"docid": "a83bc4d11697ba3c866a5eaae3be7e05",
"score": "0.60145336",
"text": "def user_params\n\t params.permit(\n\t :name,\n\t :email,\n\t :password\n\t \t )\n\t end",
"title": ""
},
{
"docid": "2aa7b93e192af3519f13e9c65843a6ed",
"score": "0.60074294",
"text": "def user_params\n params[:user].permit!\n end",
"title": ""
},
{
"docid": "9c8cd7c9e353c522f2b88f2cf815ef4e",
"score": "0.6006753",
"text": "def case_sensitive_params\n params.require(:case_sensitive).permit(:name)\n end",
"title": ""
},
{
"docid": "45b8b091f448e1e15f62ce90b681e1b4",
"score": "0.6005122",
"text": "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end",
"title": ""
},
{
"docid": "45b8b091f448e1e15f62ce90b681e1b4",
"score": "0.6005122",
"text": "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end",
"title": ""
},
{
"docid": "9736586d5c470252911ec58107dff461",
"score": "0.60048765",
"text": "def params_without_classmate_data\n params.clone.permit!.except(*(CLASSMATE_PARAM_NAMES + DEBUG_PARAMS))\n end",
"title": ""
},
{
"docid": "e7cad604922ed7fad31f22b52ecdbd13",
"score": "0.60009843",
"text": "def member_params\n # byebug\n params.require(:member).permit(\n :first_name, \n :last_name, \n :username, \n :email, \n :password, \n :image, \n :family_size, \n :address)\n\n end",
"title": ""
},
{
"docid": "58ad32a310bf4e3c64929a860569b3db",
"score": "0.6000742",
"text": "def user_params\n\t\tparams.require(:user).permit!\n\tend",
"title": ""
},
{
"docid": "58ad32a310bf4e3c64929a860569b3db",
"score": "0.6000742",
"text": "def user_params\n\t\tparams.require(:user).permit!\n\tend",
"title": ""
},
{
"docid": "f70301232281d001a4e52bd9ba4d20f5",
"score": "0.6000161",
"text": "def room_allowed_params\n end",
"title": ""
},
{
"docid": "2e6de53893e405d0fe83b9d18b696bd5",
"score": "0.599852",
"text": "def user_params\n params.require(:user).permit(:username, :password, :realname, :email, :publicvisible)\n end",
"title": ""
},
{
"docid": "19bd0484ed1e2d35b30d23b301d20f7c",
"score": "0.59984183",
"text": "def unsafe_params\n ActiveSupport::Deprecation.warn(\"Using `unsafe_params` isn't a great plan\", caller(1))\n params.dup.tap(&:permit!)\n end",
"title": ""
},
{
"docid": "19bd0484ed1e2d35b30d23b301d20f7c",
"score": "0.59984183",
"text": "def unsafe_params\n ActiveSupport::Deprecation.warn(\"Using `unsafe_params` isn't a great plan\", caller(1))\n params.dup.tap(&:permit!)\n end",
"title": ""
},
{
"docid": "a50ca4c82eaf086dcbcc9b485ebd4261",
"score": "0.59947807",
"text": "def white_listed_parameters\n params\n .require(:story)\n .permit(:title, :link, :upvotes, :category)\n end",
"title": ""
},
{
"docid": "0f53610616212c35950b45fbcf9f5ad4",
"score": "0.5993962",
"text": "def user_params(params)\n\tparams.permit(:email, :password, :name, :blurb)\n end",
"title": ""
},
{
"docid": "b545ec7bfd51dc43b982b451a715a538",
"score": "0.5992739",
"text": "def user_params\n params_allowed = %i[email password password_confirmation is_admin]\n params.require(:user).permit(params_allowed)\n end",
"title": ""
},
{
"docid": "0b704016f3538045eb52c45442e7f704",
"score": "0.59911275",
"text": "def admin_params\n filtered_params = params.require(:admin).permit(:display_name, :email, :password, :password_confirmation)\n if filtered_params[:password] == \"\"\n filtered_params.delete(:password)\n filtered_params.delete(:password_confirmation)\n end\n filtered_params\n end",
"title": ""
},
{
"docid": "6af3741c8644ee63d155db59be10a774",
"score": "0.59906775",
"text": "def allowed_params\n %i[\n lock_version\n comments\n organization\n job_title\n pronouns\n year_of_birth\n gender\n ethnicity\n opted_in\n invite_status\n acceptance_status\n registered\n registration_type\n can_share\n registration_number\n can_photo\n can_record\n name\n name_sort_by\n name_sort_by_confirmed\n pseudonym\n pseudonym_sort_by\n pseudonym_sort_by_confirmed\n ]\n end",
"title": ""
}
] |
6df3c70fc12cf7d80d2b1a00de5b8ea6 | Permanently remove the data hash associated with the id used in the receiver's creation from permanent storage. | [
{
"docid": "9dd8abe460ceeff4270f8ae81e847f35",
"score": "0.0",
"text": "def remove\n\t\tsuper\n\t\tself.close\n\t\tfile = self.session_file\n\t\tif File.exists?( file )\n\t\t\tFile.delete( file )\n\t\telse\n\t\t\traise Arrow::SessionError,\n\t\t\t\t\"Session file #{file} does not exist in the data store\"\n\t\tend\n\tend",
"title": ""
}
] | [
{
"docid": "012d9c6e0aa81b507714f6c91abbf24d",
"score": "0.68154514",
"text": "def remove_hashcode\n update_attribute(:hashcode, nil)\n end",
"title": ""
},
{
"docid": "b30f1b40efbb7be564a7464d214f7058",
"score": "0.6684911",
"text": "def delete_storage\n Frivol::Helpers.delete_hash self\n end",
"title": ""
},
{
"docid": "b30f1b40efbb7be564a7464d214f7058",
"score": "0.6684911",
"text": "def delete_storage\n Frivol::Helpers.delete_hash self\n end",
"title": ""
},
{
"docid": "09a1ccfb91bbf4ff4920e2c2ffc5e186",
"score": "0.6557199",
"text": "def _delete_reference_to_id(id)\n original_length = @data.length\n\n @data.delete_if do |k, v|\n (k && k.respond_to?(:is_poxreference?) && k.id == id) ||\n (v && v.respond_to?(:is_poxreference?) && v.id == id)\n end\n\n if @data.length != original_length\n @store.cache.cache_write(self)\n end\n end",
"title": ""
},
{
"docid": "32af094e8aa98af3376862e5c4ab66e6",
"score": "0.6476504",
"text": "def delete\n @data = {}\n end",
"title": ""
},
{
"docid": "32af094e8aa98af3376862e5c4ab66e6",
"score": "0.6476504",
"text": "def delete\n @data = {}\n end",
"title": ""
},
{
"docid": "c929b41c82f06cb7a14eb52586a7b285",
"score": "0.64116156",
"text": "def clear_storage\n Frivol::Helpers.clear_hash self\n end",
"title": ""
},
{
"docid": "c929b41c82f06cb7a14eb52586a7b285",
"score": "0.64116156",
"text": "def clear_storage\n Frivol::Helpers.clear_hash self\n end",
"title": ""
},
{
"docid": "26a5cf9f8f1fe54202de49efa3b963a7",
"score": "0.63980615",
"text": "def clear\n value = self.id\n super\n ensure\n store 'id', value\n end",
"title": ""
},
{
"docid": "78386e247ae63817b62ca164df25bfd4",
"score": "0.6357254",
"text": "def delete_device_hash\n node.set['rightscale_volume'][@current_resource.nickname] = nil\n end",
"title": ""
},
{
"docid": "d65f57be0e1569d7490ac7cfee095ddc",
"score": "0.62783",
"text": "def remove( oid )\n\t\treturn self.hashed_path( oid ).unlink\n\tend",
"title": ""
},
{
"docid": "bd12787120e8302694b68e5e6393e135",
"score": "0.6248237",
"text": "def delete\n storage.delete(id)\n end",
"title": ""
},
{
"docid": "f0b839fcc0f1e02419ed23befb6618b3",
"score": "0.62416726",
"text": "def delete(_id)\n store(\"\", nil)\n end",
"title": ""
},
{
"docid": "db89e0ec81ea5f96536921119ef79b6b",
"score": "0.6225078",
"text": "def delete\n storage.delete(id)\n end",
"title": ""
},
{
"docid": "efeac302ae905867e4b610de16ebf6e7",
"score": "0.61865234",
"text": "def clear!\n @custom_id = nil\n end",
"title": ""
},
{
"docid": "fae0dc53f9a09c4bb54adbd62c468b09",
"score": "0.615394",
"text": "def remove(id)\n redis.lrem(@key, 1, id)\n end",
"title": ""
},
{
"docid": "75fd8dfd521cd4b58bd98bf59cf3a61b",
"score": "0.60997784",
"text": "def remove_data\n update_recursive(data: nil, request: nil, session: nil, environment: nil)\n end",
"title": ""
},
{
"docid": "3cadcfa0d5793b352612efeab7e782cc",
"score": "0.60780746",
"text": "def remove_hashcode\n @time_entry = TimeEntry.find(params[:id])\n @time_entry.remove_hashcode\n \n respond_to do |format|\n format.html { redirect_to(@time_entry, :notice => TimeEntry.model_name.human + ' ' + t(:persist_successful)) }\n format.json { render :json => @time_entry, :status => :ok, :location => @time_entry }\n end\n end",
"title": ""
},
{
"docid": "05dc152d11d076cf93abefdf390e46d0",
"score": "0.6078053",
"text": "def remove_to_storage(id)\n\t\traise \"[FATAL] Storage model must be used\"\n\tend",
"title": ""
},
{
"docid": "9a5f5b60c7a85d2da8cad59b4ed3d647",
"score": "0.6056817",
"text": "def uncache identifier\n if match = match_cached_identifier(identifier)\n @global_settings[:cached].delete match[0]\n clone = match[1]\n raise \"I'm scared to delete #{clone}\" unless clone.size > 10 && clone.start_with?(cached_base) # again, paranoia\n FileUtils.rm_rf clone\n save_globals\n end\n end",
"title": ""
},
{
"docid": "c67700686cbc3d418cda574cc9f6a3e5",
"score": "0.60428363",
"text": "def delete_temp_password_digest\n update_attribute(:password_digest, nil)\n end",
"title": ""
},
{
"docid": "8a296ac48da2bb2c9d4d21a5b6cb3278",
"score": "0.6039486",
"text": "def delete\n check_if_read_only\n my_pid = pid\n run_callbacks :destroy do\n @datastreams = nil\n @profile = nil\n @profile_xml = nil\n @pid = nil\n nil\n end\n repository.purge_object(:pid => my_pid) ##This can have a meaningful exception, don't put it in the callback\n end",
"title": ""
},
{
"docid": "eaaaed5dfa5c0db8dfe4bfa32deb2fd4",
"score": "0.60235405",
"text": "def remove_image\n self.image_hash = nil\n self.save\n end",
"title": ""
},
{
"docid": "2ccedcd49c8aec5cfe578a0894a26977",
"score": "0.60215765",
"text": "def clear\n @hash.clear\n end",
"title": ""
},
{
"docid": "3f6f8aaea04d36bc9ac4786bff250da6",
"score": "0.6018373",
"text": "def delete\n @sticky_overlay = false\n @sticky_store = false\n clear_flags\n @data = 0\n @writable = false\n self\n end",
"title": ""
},
{
"docid": "c2a205f7a2ba8ae14943dd6565307bb3",
"score": "0.6017922",
"text": "def removeFromIOHash(hash)\n hash.delete @io\n end",
"title": ""
},
{
"docid": "8929b23c6e7e33044227c67448145573",
"score": "0.59830546",
"text": "def del_hash (key = '')\n if key == ''\n warn(\"You must specify the room tag you wish to remove from the database\")\n else\n warn(\"deleting #{key} from the hermit locations database\")\n @hermithash.delete(key.to_s)\n save_hash\n end\n end",
"title": ""
},
{
"docid": "b8422c59104203a0578c435944881ee4",
"score": "0.5976466",
"text": "def clear(user_id)\n Lacmus.fast_storage.del key(user_id)\n Lacmus.fast_storage.del key(user_id, true)\n end",
"title": ""
},
{
"docid": "6c1d6239b19eeb6e820809aee1276dc9",
"score": "0.59716606",
"text": "def clearHash()\n\t\t\t@csdl = '' unless !@csdl.nil?\n\t\t\t@hash = false\n\t\t\t@total_dpu = false\n\t\t\t@created_at = false\n\t\tend",
"title": ""
},
{
"docid": "6c1d6239b19eeb6e820809aee1276dc9",
"score": "0.59716606",
"text": "def clearHash()\n\t\t\t@csdl = '' unless !@csdl.nil?\n\t\t\t@hash = false\n\t\t\t@total_dpu = false\n\t\t\t@created_at = false\n\t\tend",
"title": ""
},
{
"docid": "b88f9d66e4eadcfbe18f012762c64dee",
"score": "0.59571505",
"text": "def after_delete\n self.class.key[:latest].zrem(id)\n end",
"title": ""
},
{
"docid": "ba0597ade0d79a3ef050edf244d07eec",
"score": "0.5941624",
"text": "def delete!(delete_data = false)\n Client.request(\"torrent-remove\", { :delete_local_data => delete_data }, [self.id])\n end",
"title": ""
},
{
"docid": "ba0597ade0d79a3ef050edf244d07eec",
"score": "0.5941624",
"text": "def delete!(delete_data = false)\n Client.request(\"torrent-remove\", { :delete_local_data => delete_data }, [self.id])\n end",
"title": ""
},
{
"docid": "2f5f0fe2932797ac458d61909df83470",
"score": "0.5935918",
"text": "def delete_site_data(id)\n delete \"site/data/#{id}\"\n end",
"title": ""
},
{
"docid": "0dd0cc35b1e5db1261bf3a77c00c0eb7",
"score": "0.5930991",
"text": "def delete\n $utorrent.action(\"action=remove\", @Hash)\n end",
"title": ""
},
{
"docid": "b4d1461faa9d1d366226480f9f291afe",
"score": "0.5924113",
"text": "def delete\n \t @data = {} \n \tend",
"title": ""
},
{
"docid": "c10a82274b3e6a82661ac0b17aaf17e3",
"score": "0.5921817",
"text": "def clear\n @hash.clear\n self\n end",
"title": ""
},
{
"docid": "c10a82274b3e6a82661ac0b17aaf17e3",
"score": "0.5921817",
"text": "def clear\n @hash.clear\n self\n end",
"title": ""
},
{
"docid": "aebf429f8d61ed9e8ff4e0c8fd138c76",
"score": "0.5913559",
"text": "def delete_id(id)\n redis.lrem(key, 0, id)\n end",
"title": ""
},
{
"docid": "523d727ce11241eff4ace40effe4f855",
"score": "0.5907839",
"text": "def delete key\n self.hash.delete key\n end",
"title": ""
},
{
"docid": "f2a6f55ac54961ebc59b1a4e811ed66d",
"score": "0.59027857",
"text": "def delete\n data.delete( self ); self\n end",
"title": ""
},
{
"docid": "469bec26006a0e3fcd062b749d1b51e2",
"score": "0.58835655",
"text": "def remove_entry(key)\n @hash_storage.delete(key)\n end",
"title": ""
},
{
"docid": "b4bd5e15a8e14933b4dfe79a8f9e86e1",
"score": "0.58679485",
"text": "def remove_id!(_)\n nil\n end",
"title": ""
},
{
"docid": "bd7a3b3a6e98c1678fa0c61d18745d37",
"score": "0.5859092",
"text": "def reset_hash\n warn(\"Resetting hermit database... all hermit location is now kaput\")\n @hermithash = @resethash\n save_hash\n end",
"title": ""
},
{
"docid": "4da8c528a73220b605b35ff76a1e6640",
"score": "0.58543867",
"text": "def destroy\n super\n storage.delete\n end",
"title": ""
},
{
"docid": "4cc4bada88fd6e885e04b317e37cbefd",
"score": "0.58446634",
"text": "def clear\n storage.delete(self.name)\n end",
"title": ""
},
{
"docid": "f366fa4dc8add6c2b39bf8ac7b464373",
"score": "0.5842938",
"text": "def remove_key hash, key\n\t\t@db.hdel hash,key\n\tend",
"title": ""
},
{
"docid": "d29b0736ca0a5730e3040a1863b785da",
"score": "0.5838874",
"text": "def unlink()\n return unless @dirty\n\n # Swallowing exception here is fine. Removing the pid files is a courtesy.\n begin\n File.unlink(@pid_file)\n @dirty = false\n rescue\n end\n self\n end",
"title": ""
},
{
"docid": "31a5948f983ebc4159428d317e5798a7",
"score": "0.5834831",
"text": "def clean_cache_after_destroy\n @live_keys ||= self.class.live_fields.map { |f| key(f) }\n @internal_redis ||= InternalRedis.new(self.class.name)\n @internal_redis.del @live_keys\n @internal_redis.del id\n end",
"title": ""
},
{
"docid": "3a0d4fce63c22105fbefb3ac1a981663",
"score": "0.5822078",
"text": "def remove_installed_hardware_id(value)\n @children['installed-hardware-id'][:value].delete(value)\n end",
"title": ""
},
{
"docid": "f473c0561661144fc7fba1e44a38237a",
"score": "0.58049715",
"text": "def destroy(uid); delete(DESTROY % uid) end",
"title": ""
},
{
"docid": "58a8c6fdc3e5f1df23fe47e32a55b3ae",
"score": "0.5795747",
"text": "def unlink\n return unless @dirty\n\n # Swallowing exception here is fine. Removing the pid files is a courtesy.\n begin\n File.unlink(@pid_file)\n @dirty = false\n rescue\n end\n self\n end",
"title": ""
},
{
"docid": "e3b2705399b4fd10f957533d67d83649",
"score": "0.5789012",
"text": "def unlink\n self.user_id = nil\n self.save\n end",
"title": ""
},
{
"docid": "16190b5d752ed8e59f29c69f12e9af28",
"score": "0.5781546",
"text": "def wipe\n\t\tif self.destroy && !self.id.blank?\n\t\tend\n\tend",
"title": ""
},
{
"docid": "a84dd5cc93799770c094031654f75d86",
"score": "0.5779279",
"text": "def removeSample(hash)\n\t\t\tbegin \n\t\t\t\t# remove entry in @tableName\n\t\t\t\t@db.execute(\"DELETE from #{@tableName} where md5 = ?\", hash)\n\t\t\t\t# remove file\n\t\t\t\tFile.delete(File.join(@binDir, hash))\n\t\t\t\t\n\t\t\trescue => e\n\t\t\t\treturn \"[!!] #{e}\"\n\t\t\tend\n\t\t\treturn \"[] Removed #{hash} from Malare's filesystem.\"\n\t\t\t\n\t\tend",
"title": ""
},
{
"docid": "c623ac4ed0cfcfad5ee2be6cf06de644",
"score": "0.5778533",
"text": "def clear!\n\n @context.storage.purge_type!('history')\n end",
"title": ""
},
{
"docid": "3e4baddee7004f4c2e8d1e128a25dd50",
"score": "0.5770005",
"text": "def delete_from_hash(hash, to_delete)\n hash.delete(to_delete)\n hash\n end",
"title": ""
},
{
"docid": "63b1a77a47cb78a76671000696a48acc",
"score": "0.57659507",
"text": "def remove( _uid )\n # TODO\n end",
"title": ""
},
{
"docid": "71d9c5f79fd7b9a72e1fbb39d964787e",
"score": "0.5757021",
"text": "def purge_encrypted_data\n self.encrypted_store = nil\n self.encryption_key_id = nil\n @_crypto_hash = nil\n save!(validate: false)\n end",
"title": ""
},
{
"docid": "97769494ea6a4b3cebe21d26d504601f",
"score": "0.5726724",
"text": "def delete\n require \"pact_broker/webhooks/triggered_webhook\"\n TriggeredWebhook.where(webhook_id: id).update(webhook_id: nil)\n super\n end",
"title": ""
},
{
"docid": "eef8f0831dfe8224634834c2bd4f24b4",
"score": "0.5714292",
"text": "def destroy(data)\n delete(data)\n end",
"title": ""
},
{
"docid": "c2d2b964f1cc9581a080311618cb8407",
"score": "0.57119757",
"text": "def delete\n @data = {}\n $session[SESSION_DATA_KEY] = nil\n end",
"title": ""
},
{
"docid": "7d0e75f901eb90d2a1160b80226d4108",
"score": "0.57107395",
"text": "def unlink()\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "7d0e75f901eb90d2a1160b80226d4108",
"score": "0.57107395",
"text": "def unlink()\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "622ff0f28a6e2905f1edd9f24cce6190",
"score": "0.5710075",
"text": "def clear\n\t\t@lock.with_write_lock do\n \t\t@store.clear\n \t\t@store[ :_session_id ] = @id.to_s\n\t\tend\n\tend",
"title": ""
},
{
"docid": "f4612c356b9dd3673318a0cf50e06f76",
"score": "0.57045364",
"text": "def wipe_snapshots_data\n redis.del(\n snapshot_counter_key(),\n snapshot_zset_key(),\n snapshot_hash_key(),\n )\n end",
"title": ""
},
{
"docid": "a1b1ee37e9f45657c0a49ace09a5a8f6",
"score": "0.5701932",
"text": "def destroy\n path = \"tmp/\" + id.to_s + \"_\" + user.username + \"_\" + filename\n File.delete(path) if File.exist?(path)\n super\n end",
"title": ""
},
{
"docid": "222dc76c41f2a6e196d8e4db2b072b9c",
"score": "0.5696524",
"text": "def delete\n run_callbacks :destroy do\n Hari.redis.del id\n @destroyed = true\n end\n\n self\n end",
"title": ""
},
{
"docid": "f13ab714a758224b91271e93fbfb8bbc",
"score": "0.5682218",
"text": "def remove( oid )\n\t\toid = normalize_oid( oid )\n\t\t@storage.delete( oid )\n\tend",
"title": ""
},
{
"docid": "fedffc0975b0af788a381d8a6bc1bfeb",
"score": "0.5678985",
"text": "def remove_from_store(message_id)\n ArMessage.find_by_stomp_id(message_id).destroy\n end",
"title": ""
},
{
"docid": "01f72964d825fadd0a844a86cd828cef",
"score": "0.567646",
"text": "def remove_key\n File.unlink key_path\n end",
"title": ""
},
{
"docid": "9b5b05214011d1cc809c6fcec234fc29",
"score": "0.5665751",
"text": "def remove_from_storage\n storage_adapter.erase(self.storage_path)\n end",
"title": ""
},
{
"docid": "edf841d9cbf5929485273d10a9877d02",
"score": "0.56533134",
"text": "def destroy\n self.id = nil if CapsuleCRM::Connection.delete(\"/api/history/#{id}\")\n self\n end",
"title": ""
},
{
"docid": "9d723e80554732cd4f60c8f8cc00cdc6",
"score": "0.56507325",
"text": "def delete\n vault.pairtree.purge! id\n @id = nil\n @vault = nil\n @ppath = nil\n end",
"title": ""
},
{
"docid": "f7286e8af0ca9d80f255cf7dccd52d4b",
"score": "0.5650299",
"text": "def remove_key\n @user = nil\n end",
"title": ""
},
{
"docid": "ec4fd40333c86b16749d4c0ff781e46d",
"score": "0.56269485",
"text": "def destroy!\n Cheetah.run([\"sudo\", \"virsh\", \"undefine\", name, \"--remove-all-storage\"])\n end",
"title": ""
},
{
"docid": "88dd6687462ce5b627f01ac60f077e4f",
"score": "0.56226426",
"text": "def delete key\n @data.delete key\n end",
"title": ""
},
{
"docid": "bbe477c72be017925724d710d9e6d5d8",
"score": "0.5621222",
"text": "def clear_cache\n @id_cache = {}\n end",
"title": ""
},
{
"docid": "15216dec0893329c2d3ca6eb42cef7a8",
"score": "0.56210977",
"text": "def delete\n storage.delete\n end",
"title": ""
},
{
"docid": "ea0234af1fd429a7cda4ce94cc8462e7",
"score": "0.56164336",
"text": "def remove(id)\n\t\t\traise FileStoreException, \"No file ID given for removal\" if id == '' or id.nil?\n\t\t\traise FileStoreException, \"File ID for removal not found in store\" if not @meta_manager.has_id?(id)\n\t\t\t\n\t\t\tfile = @meta_manager.get_data(id)[:path]\n\t\t\t\n\t\t\tbegin\n\t\t\t\t@meta_manager.remove(id)\n\t\t\t\t\n\t\t\t\tdir = SimpleFileStore.get_daily_directory(@deleted_path)\n\t\t\t\tdstPath = File.join(dir, id)\n\t\t\t\t\n\t\t\t\tFileUtils.move(file, dstPath)\n\t\t\t\t\n\t\t\t\tinform ObserverAction.new(:type => ObserverAction::TYPE_STORE_REMOVE, \n :objects => [id], :msg => \"Deleted file from store\") if self.is_a?(ObservedSubject)\n\t\t\trescue Exception => e\n\t\t\t\traise FileStoreException, \"Couldn't move file #{file} to deleted store.\\n#{e.message}\"\n\t\t\tend\n\t\tend",
"title": ""
},
{
"docid": "1211c61f759fdf7318b8fbbdfa4460bc",
"score": "0.56127924",
"text": "def destroy\n \t return unless record_id\n \t run_callbacks :destroy do\n \t self.class.delete(record_id)\n \t @destroyed = true\n \t @mods.clear\n\t end\n\t self.freeze\n \t #self\n\t end",
"title": ""
},
{
"docid": "c45547345d5289c2c9d847ed649b2bfa",
"score": "0.5609747",
"text": "def purge(key)\n @hash.delete(key)\n nil\n end",
"title": ""
},
{
"docid": "dd1f23c80b2becb5754def55af938918",
"score": "0.560632",
"text": "def delete(id:)\n shrine.delete(shrine_id_for(id))\n end",
"title": ""
},
{
"docid": "dd1f23c80b2becb5754def55af938918",
"score": "0.560632",
"text": "def delete(id:)\n shrine.delete(shrine_id_for(id))\n end",
"title": ""
},
{
"docid": "af82a734dd7a77518e45f996390927e4",
"score": "0.56042165",
"text": "def purge(save_block)\n save_block.call(@key, @data)\n @data = EMPTY\n end",
"title": ""
},
{
"docid": "06fbec9f954ab8b21451b00cfb2ae691",
"score": "0.560108",
"text": "def destroy\n if !deleted?\n @deleted = remote_call({ method: 'DELETE', id: @data['id'] })\n end\n end",
"title": ""
},
{
"docid": "42b22d543f3798fab1857e994f75d792",
"score": "0.55948997",
"text": "def after_delete\n redis.call(\"ZREM\", model.key[:latest], id)\n end",
"title": ""
},
{
"docid": "adfe9335846f7af59b935be0f43c4a28",
"score": "0.5589929",
"text": "def delete(o)\n @hash.delete(o)\n self\n end",
"title": ""
},
{
"docid": "adfe9335846f7af59b935be0f43c4a28",
"score": "0.5589929",
"text": "def delete(o)\n @hash.delete(o)\n self\n end",
"title": ""
},
{
"docid": "adfe9335846f7af59b935be0f43c4a28",
"score": "0.5589929",
"text": "def delete(o)\n @hash.delete(o)\n self\n end",
"title": ""
},
{
"docid": "e79545b24fe7de9135c9bef346025ca3",
"score": "0.5565839",
"text": "def purge(key)\n @hash.delete(key)\n nil\n end",
"title": ""
},
{
"docid": "9d225dbd649d88c5de86225832586ed6",
"score": "0.55635774",
"text": "def remove_hashjob(filename)\n DelayedJob.find_by_filename(filename).delete rescue false\n end",
"title": ""
},
{
"docid": "e83ce541fda69011651803077212cfa2",
"score": "0.5557999",
"text": "def clear_notes(sender)\n store['notes_hash'].delete(sender.intern)\n end",
"title": ""
},
{
"docid": "58031da8771cb0c5e73ad8a177dfbf8e",
"score": "0.5557131",
"text": "def hash_delete(name, key)\n connection { |redis| redis.hdel name.to_s, key.to_s }\n end",
"title": ""
},
{
"docid": "14c2a97b2a2a45074e7c03e2700cbd61",
"score": "0.55490345",
"text": "def destroy\n self.class.delete(id, _prefix)\n self\n end",
"title": ""
},
{
"docid": "4e95c7eeea3d5b87483ca2d28ce92966",
"score": "0.5548035",
"text": "def destroy(id)\n data.destroy(type, id)\n deselect([id])\n redirect uri\n end",
"title": ""
},
{
"docid": "5681aa237e2c395f367a6d318abb0dc3",
"score": "0.554741",
"text": "def remove_history(tx_id)\n keys = %w(cpu state events).map { |metric| prefix_key tx_id, metric }\n keys.concat (0..7).collect { |core| prefix_key(tx_id, \"temp_#{core}\") }\n redis.del keys\n end",
"title": ""
},
{
"docid": "d3c006c6ac324b04cb24b38ba9c87292",
"score": "0.55471325",
"text": "def delete\n return if not id\n\n FileUtils.rm_rf(root)\n end",
"title": ""
},
{
"docid": "beabd76b2870e8f6a3b546ec779f103a",
"score": "0.5546951",
"text": "def clean_hash(hash) # :doc:\n delete_attribute_or_child hash, :t\n delete_attribute_or_child hash, :rPr, :rFonts, :attributes, :hint\n end",
"title": ""
},
{
"docid": "101838ef4fa154e238daac93338d9c78",
"score": "0.55460596",
"text": "def delete(id)\n remove(object_key(id))\n end",
"title": ""
},
{
"docid": "e8489e5d8cd13d2e096e5db53168dd33",
"score": "0.5545722",
"text": "def delete_apple_id!(apple_id:)\n apple_ids.delete(apple_id)\n end",
"title": ""
}
] |
8e5f28b68201f44975e53df3cc402ed0 | Adds block content to specified parent UI object (Optional) Only expressions that receive a content block should implement | [
{
"docid": "499c199f640f446fffeeb1e57d55202a",
"score": "0.783177",
"text": "def add_content(parent, &block)\n # No Op by default\n end",
"title": ""
}
] | [
{
"docid": "53a17f3544b3747a07bb1f9de5094a80",
"score": "0.7508222",
"text": "def add_content(parent, expression, &block)\n if block_given? && expression.is_a?(ParentExpression)\n dsl_stack.push(expression.class.dsl)\n parent_stack.push(parent) \n expression.add_content(parent, &block)\n parent_stack.pop\n dsl_stack.pop\n end\n end",
"title": ""
},
{
"docid": "4e4a02898002a72424690bfce9dfe538",
"score": "0.72310156",
"text": "def add_parent(parent)\n parent.add_content(self)\n end",
"title": ""
},
{
"docid": "4981240fe8f11ead40fada4da72eb31f",
"score": "0.72240424",
"text": "def add_content(new_parent, keyword, *args, &block)\n # No Op by default\n end",
"title": ""
},
{
"docid": "8c4dec1d7d159f072ec49ebe92b8e45b",
"score": "0.71253246",
"text": "def add_content(new_parent, expression, keyword, *args, &block)\n if block_given? && expression.is_a?(ParentExpression)\n dsl_stack.push(expression.class.dsl)\n parent_stack.push(new_parent)\n begin\n expression.add_content(new_parent, keyword, *args, &block)\n ensure\n parent_stack.pop\n dsl_stack.pop\n end\n end\n end",
"title": ""
},
{
"docid": "cd517bfb7c14aaf02ed2e0ec9393799c",
"score": "0.6323083",
"text": "def r_block\n if parent.method == 'each' && @method == parent.single_child_method\n # Block stored in 'each', do nothing\n # What happens when this is used as remote target ?\n return expand_with\n end\n\n @markup.done = false\n\n if @context[:block] == self\n # Storing our block template\n #node.dom_prefix = dom_name\n @markup.set_id(node.dom_id(:list => false))\n expand_with\n elsif @context[:saved_template]\n # already in a parent's store operation. Reset scope and simply render inline elements\n # reset scope\n with_context(:node => node.dup, :saved_template => nil) do\n node.saved_dom_id = nil\n node.dom_prefix = dom_name\n @markup.set_id(node.dom_id(:list => false))\n expand_with\n end\n else\n # Since we are using ajax, we will need this object to have an ID set and\n # have its own template_url and such.\n with_context(:node => node.dup, :saved_template => nil) do\n # reset scope. We only keep current id when we are called from\n # r_drop.\n @markup = @markup.dup\n @markup.set_id(nil)\n node.saved_dom_id = nil\n # our own domain\n node.dom_prefix = dom_name\n\n # 1. inline\n # Set id with the current node context (<%= var1.zip %>).\n @markup.set_id(node.dom_id(:list => false))\n\n out expand_with\n # 2. store template\n # will wrap with @markup\n store_block(self, :ajax_action => 'show')\n\n if edit_block = descendant('edit')\n form_block = descendant('form') || self\n\n publish_after_save = form_block.params[:publish] ||\n (edit_block && edit_block.params[:publish])\n\n # 3. store form\n cont = {\n :saved_template => form_url(node.dom_prefix),\n :make_form => self == form_block,\n :publish_after_save => publish_after_save,\n :ajax_action => 'edit',\n }\n\n store_block(form_block, cont)\n end\n end\n end\n end",
"title": ""
},
{
"docid": "0fd1cf9a703e12025d3d6b07446965d6",
"score": "0.6167538",
"text": "def process_complex_block_opener(tk); end",
"title": ""
},
{
"docid": "32adb4c77f3b13d43583536fc261167e",
"score": "0.604859",
"text": "def initialize_block(...)\n parent << self\n super\n end",
"title": ""
},
{
"docid": "93c722f857a7b2ef64cf4c5ab244f582",
"score": "0.60371923",
"text": "def embed_widget(parent_cell, child_cell)\n parent_cell << child_cell\n # Parents watch themselves for record selects and unselects, and send children into appropriate states.\n parent_cell.respond_to_event :recordSelected, :on => child_cell.name, :with => :_parent_selection, :from => parent_cell.name\n parent_cell.respond_to_event :recordUnselected, :on => child_cell.name, :with => :_parent_unselection, :from => parent_cell.name\n # Parents also watch children for record updates, and update themselves if one occurs.\n parent_cell.respond_to_event :recordUpdated, :on => parent_cell.name, :with => :_child_updated, :from => child_cell.name\n # Children watch themselves for recordChosen events, then send parent into update choice state\n child_cell.respond_to_event :recordChosen, :on => child_cell.name, :with => :_child_choice, :from => child_cell.name\n yield child_cell if block_given?\n return child_cell\n end",
"title": ""
},
{
"docid": "e49c67ab0ae6216088a2f5bf80697552",
"score": "0.5990215",
"text": "def around(parent, keyword, args, block, &interpret_and_add_content)\n interpret_and_add_content.call\n end",
"title": ""
},
{
"docid": "e997d167464be890f1d0945e288b7aa6",
"score": "0.5983331",
"text": "def block_node\n parent if block_literal?\n end",
"title": ""
},
{
"docid": "396a8818da01223af9c4759ab3c0ee37",
"score": "0.5879195",
"text": "def jqg_child_widget(parent_cell, resource, opts = {})\n embed_widget(parent_cell, child_cell = jqg_widget(resource, opts))\n yield child_cell if block_given?\n return child_cell\n end",
"title": ""
},
{
"docid": "309f1729cee239f8a7d7423d7447a466",
"score": "0.5862202",
"text": "def block_contents(node, context); end",
"title": ""
},
{
"docid": "8268d3fb4295085086ae8f29717c8e27",
"score": "0.58338016",
"text": "def parse_content parent, content, attributes = nil\n reader = Reader === content ? content : (Reader.new content)\n while reader.has_more_lines?\n block = Parser.next_block reader, parent, (attributes ? attributes.dup : {})\n parent << block if block\n end\n parent\n end",
"title": ""
},
{
"docid": "caa0a5db38b858553954e48855a3eef0",
"score": "0.58288336",
"text": "def content(&block)\n if block_given?\n Glimmer::DSL::Engine.add_content(self, Glimmer::DSL::SWT::CustomShapeExpression.new, self.class.keyword, &block)\n else\n @content\n end\n end",
"title": ""
},
{
"docid": "ed853f8358daee286bfaa3d248b87304",
"score": "0.58202106",
"text": "def new\n @page = Page.find(params[:page_id]) \n @block = @page.blocks.build\n @section = @page.section\n unless params[:parent_id].blank?\n @block.parent = Block.find(params[:parent_id])\n end\n \n if defined? params[:content_controller]\n @content_controller = params[:content_controller]\n else\n @content_controller = nil\n end\n \n unless params[:add_content_id].blank?\n @content = Content.find(params[:add_content_id])\n @block.contents << @content\n end\n\n respond_to do |format|\n format.html # new.html.erb\n format.js\n format.xml { render :xml => @block }\n end\n end",
"title": ""
},
{
"docid": "2672cb56901fb5873db09c01e301ba51",
"score": "0.577324",
"text": "def content\n call_block\n end",
"title": ""
},
{
"docid": "592bccf68366bd69a1204f385b2a4d0a",
"score": "0.57561177",
"text": "def setcontent\n \tnewblock = self.content_blocks.create(content: '<p>Content goes here</p>')\n \tself.block_order = Array.new\n \tself.block_order << newblock.id\n end",
"title": ""
},
{
"docid": "c90f0a960e571494be7ba14aab1a2fbd",
"score": "0.5741763",
"text": "def render_block(block, user)\n content = render_block_content(block, user)\n if content.present?\n handle = content_tag('span', '', :class => 'icon-only icon-sort-handle sort-handle', :title => l(:button_move))\n close = link_to(l(:button_delete),\n {:action => \"remove_block\", :block => block},\n :remote => true, :method => 'post',\n :class => \"icon-only icon-close\", :title => l(:button_delete))\n content = content_tag('div', handle + close, :class => 'contextual') + content\n\n content_tag('div', content, :class => \"mypage-box\", :id => \"block-#{block}\")\n end\n end",
"title": ""
},
{
"docid": "6aa8fe7bd64aab59e2a6eebd8490947b",
"score": "0.5731705",
"text": "def add(child, should_add = true, &block)\n child.instance_eval(&block) if block_given?\n\n raise 'Widget already has a parent' unless child.parent.nil?\n\n gtk_instance.add(child.gtk_instance) if should_add\n child.parent = self\n\n # Ensure a children array exists, and add the new child to it\n @children ||= []\n children << child\n end",
"title": ""
},
{
"docid": "3d7c0e702bf45ac9840493c9afebec84",
"score": "0.5704133",
"text": "def add_block(text_or_opts, at_start = false)\n # avoid wrapping objects in [void][/void]\n bak = @blocks\n @blocks = []\n if text_or_opts.kind_of?(String)\n new_blocks = make(:void, :method => 'void', :text => text_or_opts).blocks\n else\n new_blocks = [make(:void, text_or_opts)]\n end\n if at_start\n bak = new_blocks + bak\n else\n bak += new_blocks\n end\n @blocks = bak\n # Force descendants rebuild\n @all_descendants = nil\n end",
"title": ""
},
{
"docid": "e489fb2800c8f2be060721c874891db6",
"score": "0.56926405",
"text": "def add(child, options = {})\n child.peer.reparent(self)\n \n if child.is_a?(RubyMVC::Views::View) && (a = child.actions)\n child.frame = self\n merge_actions(a)\n end\n end",
"title": ""
},
{
"docid": "e9b284841e4a9142ac705cfab8c9c023",
"score": "0.56850404",
"text": "def add_content\n self.link(:id=>\"navigation_create_and_add_link\").fire_event(\"onmouseover\")\n self.link(:text=>\"Add content\").click\n self.wait_until { self.text.include? \"Collected items\" }\n self.class.class_eval { include AddContentContainer }\n end",
"title": ""
},
{
"docid": "ebf1a2ab9a985c1c99c8a474299d1cfd",
"score": "0.5665398",
"text": "def add_content\n self.button(:id=>\"entity_group_permissions\").click\n self.button(:text=>\"Add content\").click\n self.wait_until { self.text.include? \"Collected items\" }\n self.class.class_eval { include AddContentContainer }\n end",
"title": ""
},
{
"docid": "8b28d5728e76941b2babb7c1df51c237",
"score": "0.56465816",
"text": "def include_part(obj)\n if @markup.tag\n obj.markup = @markup.dup\n end\n @markup.tag = nil\n\n if sub_do\n obj.method = @blocks.first.method\n obj.params = @blocks.first.params\n elsif params[:method]\n obj.method = params[:method]\n end\n super(obj)\n end",
"title": ""
},
{
"docid": "8a2212087bdf8c3faeb0b20410442756",
"score": "0.5640508",
"text": "def post_add_content\n @parent_proxy&.post_initialize_child(self)\n end",
"title": ""
},
{
"docid": "e6cb738f62b2ce347e9e3608540cfbb2",
"score": "0.5614519",
"text": "def with_parent(parent); end",
"title": ""
},
{
"docid": "57ba9c6e755915061c5344c9ea1a4cb4",
"score": "0.5606283",
"text": "def block\n @block || @parent && @parent.block\n end",
"title": ""
},
{
"docid": "c006013dfe63f6f8e2136f36ed64575b",
"score": "0.5597119",
"text": "def process_simple_block_opener(tk); end",
"title": ""
},
{
"docid": "48c9e77986555dfc02c228a71d7c3c6a",
"score": "0.559594",
"text": "def <<(block)\n @blocks << block\n end",
"title": ""
},
{
"docid": "48c9e77986555dfc02c228a71d7c3c6a",
"score": "0.559594",
"text": "def <<(block)\n @blocks << block\n end",
"title": ""
},
{
"docid": "93e84060580637c239aa6edfb0d8156e",
"score": "0.55753624",
"text": "def sub(name = :\"\", &ruby_block)\n # Ensure there is a block.\n ruby_block = proc {} unless block_given?\n self.add_block(self.mode,name,&ruby_block)\n end",
"title": ""
},
{
"docid": "b9d1edca6a1db592be98be94e345da1c",
"score": "0.55710334",
"text": "def initialize(parent, text='')\n @parent = parent\n @text = text\n @blocks = []\n end",
"title": ""
},
{
"docid": "4c51bc229ed59f2f21716ed4cee90df5",
"score": "0.556629",
"text": "def initialize(parent)\n @parent = parent\n @blocks = []\n end",
"title": ""
},
{
"docid": "8cec39aec31cfb284a024ec42727099c",
"score": "0.55529284",
"text": "def parent_layout(layout, &block)\n render capture(&block), :layout => layout\n end",
"title": ""
},
{
"docid": "5a241415b4feecffe7356f088945260e",
"score": "0.5547769",
"text": "def add_to_parent(*_)\n @parent.add_child self\n end",
"title": ""
},
{
"docid": "f4b1d32aac2d6ccf3279395b06abd468",
"score": "0.5512455",
"text": "def render(&block)\n process! unless processed?\n\n concatenated_items = map_items do |item|\n if block_given?\n block.arity.zero? ? item.instance_eval(&block) : block.call(item)\n else\n item.render\n end\n end.join(Hensel.configuration.indentation? ? \"\\n\" : \"\")\n\n content_tag(Hensel.configuration.parent_element, concatenated_items, options)\n end",
"title": ""
},
{
"docid": "1ecb12e6993703b3c5c02de999ae423d",
"score": "0.5510086",
"text": "def add(parent_path, conditions, chunk)\n parsed = parse_text(chunk)\n target = find_block([], @contents, parent_path.split, conditions)\n\n if !target\n warn \"no parent found at #{parent_path.inspect}\"\n else\n parsed.each do |key, list|\n target[key] ||= []\n target[key].concat(list)\n end\n end\n\n self\n end",
"title": ""
},
{
"docid": "a9e94bafca69a56b35c381dd09579059",
"score": "0.55058175",
"text": "def with_parent(parent)\n @parents.push parent\n yield\n ensure\n @parents.pop\n end",
"title": ""
},
{
"docid": "ec9ea4c8a8f7a99e1d134c02f1aa7a4b",
"score": "0.54960674",
"text": "def block(block)\n composition.new_component(:__base__, &block)\n true\n end",
"title": ""
},
{
"docid": "f50fdb6af4b327d53dfd739be06be506",
"score": "0.5492304",
"text": "def add_block block=nil, &proc\n # if proc given instead of block, evaluate it\n if block.nil? && block_given?\n block = yield\n end\n \n # automatic block indexing\n if block.index\n self.current_block = block.index+1\n else\n block.index(current_block)\n self.current_block+=1\n end\n \n # concat to the haml buffer\n haml_concat block.to_xml\n block\n end",
"title": ""
},
{
"docid": "fc99b395c3b2f5489c82809dd41efe45",
"score": "0.5489128",
"text": "def add_parent(parent)\n parent.add_child(self)\n end",
"title": ""
},
{
"docid": "6cf00ea09acb7d82bb872ae6920d7f09",
"score": "0.5465689",
"text": "def add_parent(parent)\n ActsAsDAG::HelperMethods.link(parent, self)\n end",
"title": ""
},
{
"docid": "b1c6a36d0cec97f015b66ffdbc547c76",
"score": "0.5455942",
"text": "def add w,&b\n w.element.append_to container_element\n \n if !sensitive() or !events_enabled()\n w.events_enabled(false)\n end\n \n bool = false\n \n self.class.ancestors.reverse.each do |q|\n bool = true if q == Container\n next unless q.is_a?(Widget::Interface) \n \n next unless bool\n \n w.element.add_class q.class_name+\"-child\"\n end\n\n b.call(w) if b\n\n return self\n end",
"title": ""
},
{
"docid": "0f0d8ee5c639ea5efc3a4db6ac840c7e",
"score": "0.5453474",
"text": "def create_node(parent, type, content)\n iter = if parent\n model.append(parent)\n else\n new_model = Editor.data2model(nil)\n toplevel.view_new_model(new_model)\n new_model.iter_first\n end\n iter.type, iter.content = type, content\n expand_collapse(parent) if parent\n iter\n end",
"title": ""
},
{
"docid": "e00255493063413a42d15fcdbba8a6af",
"score": "0.5444552",
"text": "def content_for(name, content = nil, &block)\n content = capture(&block) if block_given?\n if content\n if @_subset_content_for && @_subset_content_for[cache_level]\n @_subset_content_for[cache_level][name] << content\n\n # также нужно передать этот контент всем родительским кеш-блокам\n (cache_level - 1).downto(0) do |i|\n @_subset_content_for[i][name] << content\n end\n end\n @view_flow.append(name, content)\n nil\n else\n @view_flow.get(name)\n end\n end",
"title": ""
},
{
"docid": "a59cc45e0c34c73d1bd112286aabeaeb",
"score": "0.5444185",
"text": "def inside_inline_layout(template_content, &block)\n binding = block.binding if BINDING_REQUIRED\n\n @template.instance_variable_set('@content_for_layout', capture(&block))\n concat( @template.render( :inline => template_content ), binding )\n end",
"title": ""
},
{
"docid": "3c65897f835422ac8680dae19eb9a54e",
"score": "0.54410493",
"text": "def styleguide_extend_block(section, *parents, &block)\n block_html = capture(&block)\n content = section_modifiers(parents).map{ |m|\n block_html.gsub(\"$modifier_class\", m +\" $modifier_class\").strip\n }.join(\"\\n\")\n @section = styleguide.section(section)\n render 'kss/shared/styleguide_block', :section => @section, :example_html => content\n end",
"title": ""
},
{
"docid": "79effa949c55f5d993d3bdb4312073cc",
"score": "0.54351443",
"text": "def <<(block)\n @blocks << block\n end",
"title": ""
},
{
"docid": "14578ae20ff53e87ef9c68a507468797",
"score": "0.5428874",
"text": "def instr_push_block(block_adr)\n @blocks.push Verneuil::Block.new(\n block_adr, \n self, \n current_scope.child)\n end",
"title": ""
},
{
"docid": "74326064f86f1572c4ccad32785240ea",
"score": "0.54218864",
"text": "def parent=(parent); end",
"title": ""
},
{
"docid": "74326064f86f1572c4ccad32785240ea",
"score": "0.54218864",
"text": "def parent=(parent); end",
"title": ""
},
{
"docid": "74326064f86f1572c4ccad32785240ea",
"score": "0.54218864",
"text": "def parent=(parent); end",
"title": ""
},
{
"docid": "167166ea81c254fab464cf407f82b75c",
"score": "0.5407616",
"text": "def add_content(to_add)\n\t\t@content << to_add\n\tend",
"title": ""
},
{
"docid": "c1b3c3d5bd4ba7141895afaee35e2fda",
"score": "0.54011136",
"text": "def add_block(name=\"\")\n @raw.basic_blocks.append(name)\n end",
"title": ""
},
{
"docid": "e7093f489b24ad4568b1750422c177a6",
"score": "0.53909665",
"text": "def add_block(block)\n @blocks.push(block)\n end",
"title": ""
},
{
"docid": "35ae581f185318c73cf8f8041e8355fc",
"score": "0.5385844",
"text": "def block\n super\n end",
"title": ""
},
{
"docid": "da4a2f6d959d34a156ef30e8851c53d6",
"score": "0.5352344",
"text": "def <<(lo)\n lo.parent = self\n super(lo)\n end",
"title": ""
},
{
"docid": "22c72e944aa81dd6e8e9d902e590a219",
"score": "0.5346773",
"text": "def outer_content_for(name, content = nil, &block)\n outer_view.instance_eval do\n #require 'ruby-debug'; debugger \n #puts \"self.object_id=#{self.object_id.inspect}\"\n s = content_for(name, content, &block)\n #puts \"s=#{s.inspect}\"\n end\n nil\n end",
"title": ""
},
{
"docid": "8e8f4a54504bab0d51be081144f34ae4",
"score": "0.53456485",
"text": "def inline_template_block(content)\n Proc.new{content}\n end",
"title": ""
},
{
"docid": "bd8c58f7a13066a3f5e92741ca455ba6",
"score": "0.5345566",
"text": "def wrap_in(parent_xn)\n add_next_sibling(parent_xn)\n parent_xn.add_child(self)\n self\n end",
"title": ""
},
{
"docid": "797e54175c2b4be0c90278a72565d736",
"score": "0.5342385",
"text": "def with_content_of(content_block, &block)\n content = capture(&content_block)\n concat(block_given? ? yield(content) : content, content_block.binding)\n end",
"title": ""
},
{
"docid": "8a0e13d0ebe3dd93a694587cc38ca826",
"score": "0.5340738",
"text": "def add_block\r\n block = params[:block]\r\n render(:nothing => true) and return unless block && (BLOCKS.keys.include? block)\r\n @user = self.logged_in_user\r\n # remove if already present in a group\r\n %w(top left right).each {|f| (session[:page_layout][f] ||= []).delete block }\r\n # add it on top\r\n session[:page_layout]['top'].unshift block\r\n render :partial => \"block\", :locals => {:user => @user, :block_name => block}\r\n end",
"title": ""
},
{
"docid": "a96a5e06f9228df45204ad27c5b30030",
"score": "0.5333732",
"text": "def content_outline record\n blocks = record.content_blocks if record.parsed_content.present?\n return unless blocks\n\n content_tag :ul do\n # Loop through each block in the record, and generate a short piece of text describing that block.\n for block in blocks\n case block['type']\n when 'splash', 'header', 'textbox' # Bold title\n field = block['type'] == 'header' ? 'text' : 'title'\n title = block['data'][field]\n type = translate(block['type'], scope: %i[admin content blocks])\n word_count = block['data']['text'] ? block['data']['text'].split.size : 0\n word_count = translate('admin.content.words', count: word_count)\n\n title = \"#{block['data']['level']&.upcase || 'H2'} - #{title}\" if block['type'] == 'header'\n\n concat content_tag :li, tag.strong(title)\n concat content_tag :li, tag.i(\"#{type}: #{word_count}\") if block['type'] == 'textbox' && !block['data']['asVideo']\n\n when 'form' # Content\n concat content_tag :li, \"#{block['type'].titleize}: #{block['data']['title']}\"\n\n when 'video', 'structured' # Items list\n items = block['data']['items']&.map { |item| item['title'] }&.join(', ')\n\n case block['type']\n when 'structured'\n type = translate(block['data']['format'], scope: %i[admin content tunes format])\n else\n type = translate(block['type'], scope: %i[admin content blocks])\n end\n\n concat content_tag :li, \"#{type.titleize}: #{items}\"\n\n when 'paragraph', 'quote' # Word count\n type = translate(block['type'], scope: %i[admin content blocks])\n word_count = translate('admin.content.words', count: block['data']['text'].split.size)\n concat content_tag :li, tag.i(\"#{type}: #{word_count}\")\n\n when 'list', 'catalog', 'image' # Items count\n item_count = translate('admin.content.items', count: block['data']['items'].split.size)\n\n case block['type']\n when 'catalog'\n type = translate(block['data']['type'], scope: %i[admin content tunes type])\n else\n type = translate(block['type'], scope: %i[admin content blocks])\n end\n\n concat content_tag :li, tag.i(\"#{type}: #{item_count}\")\n\n when 'action' # Short text link\n type = translate(block['type'], scope: %i[admin content blocks])\n concat content_tag :li, tag.em(type) + tag.span(\": [#{block['data']['text']}] → \") + tag.small(block['data']['url'])\n\n when 'whitespace' # Whitespace\n separators = {\n large: '==',\n medium: '—',\n small: '--',\n }\n\n concat content_tag :li, separators[block['data']['size'].to_sym] * 3\n\n else\n concat block.inspect\n end\n end\n end\n end",
"title": ""
},
{
"docid": "923c783583789775e499b170f85d8614",
"score": "0.5329293",
"text": "def ui_button_pane(&block)\n body = capture(&block)\n concat(\"<div class='ui-dialog-buttonpane ui-widget-content ui-helper-clearfix'>\")\n body\n concat(\"</div>\")\n end",
"title": ""
},
{
"docid": "43b7e59f926a36e86f55331753cd9423",
"score": "0.530177",
"text": "def add_child(widget)\n child = super\n\n pack_children\n\n child\n end",
"title": ""
},
{
"docid": "eafd6064994804bc776fb0ae35f89ff5",
"score": "0.5296239",
"text": "def render parent\n txt = \"<strong>Download em #{@format}</strong>\"\n\n output = Asciidoctor::ListItem::new parent, \"\"\n anchor = Asciidoctor::Inline::new output, :anchor, txt, INLINE_OPTS\n anchor.target = @url\n\n output << anchor\n end",
"title": ""
},
{
"docid": "ae8feb2b558179e1a4ed5a1e1fea12d9",
"score": "0.52723515",
"text": "def parent(locator)\r\n define_method(:parent_container) do\r\n locator\r\n end\r\n end",
"title": ""
},
{
"docid": "0a2b222028eef5d23f9d67761a768450",
"score": "0.52668744",
"text": "def content! &block # :yields: content\n # If our block returns a value, this will become this resource's new\n # content\n new_content = yield _content\n self.content = new_content if new_content\n self\n end",
"title": ""
},
{
"docid": "27d05a540d43d0d4c25fb1bf7ce2554f",
"score": "0.5264527",
"text": "def becomes(superclass)\n object = super\n object.content = render_content if object.respond_to?(:content=)\n object\n end",
"title": ""
},
{
"docid": "aee1b4e65ce201d522fc5a432c9afcd2",
"score": "0.52550495",
"text": "def contents(&block); end",
"title": ""
},
{
"docid": "9e17aa03d47b8c5bab7ca7a1d2f57620",
"score": "0.52490515",
"text": "def yui_block(options = {}, &block)\n yield_variable = options[:yield] || nil\n if !block_given? and yield_variable.eql?(nil)\n raise \"yui_block: Must have a block or a yield variable!!!\"\n end\n \n block_content = if yield_variable\n instance_variable_get \"@content_for_#{yield_variable}\"\n elsif block_given?\n capture(&block)\n else\n \"\"\n end\n content = content_tag(\"div\", block_content, :class => \"yui-b\")\n if options[:primary]\n content = content_tag(\"div\", content, :id => \"yui-main\")\n end\n concat(content, block.binding)\n end",
"title": ""
},
{
"docid": "4f8c5224a5a687d814188e83aa154e37",
"score": "0.52305907",
"text": "def attach_to parent\n parent.add self if parent\n end",
"title": ""
},
{
"docid": "4fb15e548df90c98e6cb01076e8a5fe0",
"score": "0.5230168",
"text": "def g(&block)\n group = Group.new(&block)\n @content << group\n group\n end",
"title": ""
},
{
"docid": "9f34a3c8a7177b6906cdb836ca512a4f",
"score": "0.52295405",
"text": "def inside_layout(parent_layout)\n view_flow.set :layout, capture { yield }\n render template: \"layouts/#{parent_layout}\"\n end",
"title": ""
},
{
"docid": "9f34a3c8a7177b6906cdb836ca512a4f",
"score": "0.52295405",
"text": "def inside_layout(parent_layout)\n view_flow.set :layout, capture { yield }\n render template: \"layouts/#{parent_layout}\"\n end",
"title": ""
},
{
"docid": "b1b6a3d9b943ec096c2c18e9c9809158",
"score": "0.5226053",
"text": "def content # :yields: content\n return _content unless block_given?\n # If our block returns a value, this will become this resource's new\n # content\n yield _content\n self\n end",
"title": ""
},
{
"docid": "7e0b442b52667834bb0603a9be448c12",
"score": "0.5223916",
"text": "def add_inner(signal)\n # puts \"add inner=#{signal.name} in block=#{self}\"\n # Check and add the signal.\n unless signal.is_a?(SignalI)\n raise AnyError,\n \"Invalid class for a signal instance: #{signal.class}\"\n end\n # if @inners.include?(signal) then\n # raise AnyError, \"SignalI #{signal.name} already present.\"\n # end\n # Set its parent.\n signal.parent = self\n # And add it\n @inners.add(signal)\n end",
"title": ""
},
{
"docid": "c67b3e53d35f5437ef767cb83b5d8540",
"score": "0.52167296",
"text": "def add_child(type, cond, exit)\n debug \"GUARD add_child #{type} \"\n b = Block.new\n b.cond = cond\n b.exit = exit\n b.type = type\n b.level = @level + 1\n\n case type\n when 'do'\n b.id = @id + '_D'\n else\n b.id = @id + '_B'\n end\n\n b.parent = self\n @childln << b\n b\n end",
"title": ""
},
{
"docid": "12b17fb578b10c60a838273972b82623",
"score": "0.521308",
"text": "def wrap_in_block(text_or_opts)\n # avoid wrapping objects in [void][/void]\n bak = @blocks\n @blocks = []\n if text_or_opts.kind_of?(String)\n wrapper = make(:void, :method => 'void', :text => text_or_opts)\n else\n wrapper = make(:void, text_or_opts)\n end\n wrapper.blocks = bak\n @blocks = [wrapper]\n # Force descendants rebuild\n @all_descendants = nil\n end",
"title": ""
},
{
"docid": "d02dc2178f677b534aae1cbd3be15b1f",
"score": "0.52106756",
"text": "def script &block\n blocks.push block\n end",
"title": ""
},
{
"docid": "f396b3fea2f91b3c0b063ffa1574f50c",
"score": "0.5208885",
"text": "def reply_to_parent (workitem)\n\n return super(workitem) if @body_index == nil or @applied_body\n # no body or body just got applied\n\n # apply body of process definition now\n\n @applied_body = true\n\n #store_itself\n # now done in apply_child()\n\n apply_child(@body_index, workitem)\n end",
"title": ""
},
{
"docid": "2b1fe891453d8915d6bb1bb94f774b88",
"score": "0.5206122",
"text": "def extend_block(name, value = nil, &block)\n unless self.template.blocks[name]\n raise NameError, \"Block #{name.inspect} wasn't defined yet, you can't extend it!\"\n end\n self.enhance_block(name, value, &block)\n end",
"title": ""
},
{
"docid": "70759060db6f202b8a1443987f20150d",
"score": "0.5205754",
"text": "def add_block(arg_hash=nil)\n @next_index+=1\n @blocks[@next_index]=Array.new\n if arg_hash!=nil\n if arg_hash.has_key?(\"caption\")\n @block_captions[@next_index]=String.new(arg_hash[\"caption\"])\n end\n end\n return @next_index\n end",
"title": ""
},
{
"docid": "4a102e174204838415ff2bcf8fc4fb9d",
"score": "0.5198569",
"text": "def update_parent\n # add tags to parent, assuming there's only addition\n end",
"title": ""
},
{
"docid": "a973b709cc0d84320fbab5cfd9e19a24",
"score": "0.5198424",
"text": "def block_node\n case sexp_type\n when :method_add_block\n self[2]\n end\n end",
"title": ""
},
{
"docid": "7392582c05d551702f2dc784fb33934b",
"score": "0.51939756",
"text": "def parent_template\n super\n end",
"title": ""
},
{
"docid": "7e6f58d480635a9e62bcbcb8e664cf70",
"score": "0.51896435",
"text": "def append_blob_block(container, blob, content, options = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "f2ee19f93f4c1e07df51088f752b05e4",
"score": "0.51882863",
"text": "def parent=(_); end",
"title": ""
},
{
"docid": "71ec1fe6e61be159bbc9375eed3476f7",
"score": "0.51788205",
"text": "def only_content_block(options = {}, &block)\n content_html_options = {class: 'content content-only-block'}\n unless @render_only_active_content\n content = block_given? ? @template.capture(&block) : @template.render(:partial => options[:partial], :locals => options[:locals])\n @contents << { content: content, html_options: content_html_options, tab_type: :only_content_block }\n end\n nil # returning nil allows the user to call this using <%= tab.only_content_block %> or <% tab.only_content_block %>\n end",
"title": ""
},
{
"docid": "c818c09f4a786666d1b8c7618f422ae4",
"score": "0.5178612",
"text": "def document_add_child(document, options = {})\n return unless current_user_is_editor?\n options.reverse_merge!(:layout => 'page', :title => \"Create a new sub page\")\n content_tag(:ul,\n content_tag(:li,\n link_to( image_tag('icons/plus.png'),\n new_document_url(:layout => options[:layout], :parent_id => document.id),\n :class => 'button documentFormAction', :title => options[:title]\n )\n ),\n :class => 'sideActions forNewItems'\n )\n end",
"title": ""
},
{
"docid": "bee46c98b350ce6cbf3309a811165784",
"score": "0.51743674",
"text": "def ui_container(content = nil, options = nil, html_options = nil, &block)\n UiBibz::Ui::Core::Layouts::Container.new(content, options, html_options, &block).render\n end",
"title": ""
},
{
"docid": "1f6a658aa4d1136eff79531d0f5456ea",
"score": "0.5166856",
"text": "def parent\n @item.parent && Nanoc::ItemView.new(@item.parent)\n end",
"title": ""
},
{
"docid": "9535c103677391eb269d0c5da43122a3",
"score": "0.5163143",
"text": "def <<(component)\n @sub_components << component\n component.parent = self\n end",
"title": ""
},
{
"docid": "6c4f57df886aba1a5ba877a7ebfacca0",
"score": "0.5162551",
"text": "def initialize(parent)\n @parent = parent\n @attributes = {}\n @blocks = []\n end",
"title": ""
},
{
"docid": "893dc37d74e3a703c4331d1391ac0a4a",
"score": "0.51601917",
"text": "def method_missing(name, *args, &block)\n block ||= lambda {} # captures self HERE\n if @parent\n @parent.send(name, *args, &block)\n else\n super\n end\n end",
"title": ""
},
{
"docid": "893dc37d74e3a703c4331d1391ac0a4a",
"score": "0.51601917",
"text": "def method_missing(name, *args, &block)\n block ||= lambda {} # captures self HERE\n if @parent\n @parent.send(name, *args, &block)\n else\n super\n end\n end",
"title": ""
},
{
"docid": "85f8782072a859c04005e6e0d9352676",
"score": "0.51567256",
"text": "def parent(parent_instance)\n raise 'Invalid data' unless parent_instance.definition== @parent_def\n\n @parent_instance = parent_instance\n self\n end",
"title": ""
},
{
"docid": "5574a56e5edd34a3e0de6ae1a0ba2923",
"score": "0.51557624",
"text": "def add_parent_to_component(component)\n component.reagent = self\n end",
"title": ""
},
{
"docid": "e39751872d00cd1853cee707787fa2cd",
"score": "0.51527524",
"text": "def with_parent(parent)\n old_parent, @parent = @parent, parent\n yield\n ensure\n @parent = old_parent\n end",
"title": ""
},
{
"docid": "edd4b105a06f76a72191872de9768a79",
"score": "0.51446694",
"text": "def build_basic_blocks; end",
"title": ""
}
] |
a04900e46f7bac0ad39ed0c4fc15cd89 | def total_travel_time intCoordinates = JSON.parse(self.coordinates) sum_travel_time = 0 intCoordinates.each_with_index do |coordinate, index| next_coordinate = intCoordinates[index+1] if next_coordinate != nil distance = Haversine.distance(coordinate[0], coordinate[1], next_coordinate[0], next_coordinate[1]).to_miles wind = ForecastFetcher.new(coordinate).fetch_wind_data Need to convert wind direction to a degree representation For now, let's just hard code it adjusted_wind_angle = heading(wind["wind_direction"]) boat_heading(coordinate, next_coordinate) boat = Boat.new(adjusted_wind_angle.abs, wind["wind_speed"]) velocity = boat.velocity byebug travel_time = distance / velocity sum_travel_time += travel_time end end byebug sum_travel_time end | [
{
"docid": "d14553fff91074895ae9e1ea008a301b",
"score": "0.92407775",
"text": "def total_travel_time\n coordinates = JSON.parse(self.coordinates)\n sum_travel_time = 0\n total_distance = 0\n array = []\n coordinates.each_with_index do |coordinate_pair, index| \n array << Concurrent::Promises.future(coordinate_pair) do |coordinate_pair|\n ForecastFetcher.new(coordinate_pair).fetch_wind_data \n end\n end\n\n coordinates.each_with_index do |coordinate, index| \n next_coordinate = coordinates[index+1]\n if next_coordinate != nil\n distance = Haversine.distance(coordinate[0], coordinate[1], next_coordinate[0], next_coordinate[1]).to_miles\n total_distance += distance\n wind = array[index].value\n adjusted_wind_angle = heading(wind[\"wind_direction\"]) - boat_heading(coordinate, next_coordinate)\n boat = Boat.new(adjusted_wind_angle.abs, wind[\"wind_speed\"])\n velocity = boat.velocity\n travel_time = distance / velocity\n sum_travel_time += travel_time\n\n end\n end\n sum_travel_time\n time_and_distance = {\"time\": sum_travel_time, \"distance\": total_distance}\n end",
"title": ""
}
] | [
{
"docid": "0f0a3efc4ab31041b0dce580314c1a4c",
"score": "0.69659853",
"text": "def scanDistTimeSpeed(json)\n tripPos = json['tripPos'] ;\n pickUpPos = Geo2D::Point.sureGeoObj([tripPos['pickUp']['x'],\n tripPos['pickUp']['y']]) ;\n dropOffPos = Geo2D::Point.sureGeoObj([tripPos['dropOff']['x'],\n tripPos['dropOff']['y']]) ; \n dist = Sav::Util::averageManhattanDistance(pickUpPos, dropOffPos) ;\n @totalDistance += dist ;\n\n if(json['tripTime']['pickUp'].nil? ||\n json['tripTime']['dropOff'].nil?) then\n ##### ?????\n ##### なぜこのようなケースがあるか不明。\n else\n# time = json['tripTime']['dropOff'] - json['tripTime']['pickUp'] ;\n time = (json['tripTime']['dropOff'] -\n json['tripRequiredTime']['pickUp']) ;\n waitTime = (json['tripTime']['pickUp'] -\n json['tripRequiredTime']['pickUp'])\n @totalTime += time ;\n @waitTimeStatInfo.put(waitTime) ;\n\n speed = dist / time ;\n @speedStatInfo.put(speed) ;\n end\n end",
"title": ""
},
{
"docid": "247e471c45199534372fdeaf17771c04",
"score": "0.68487465",
"text": "def tracker_total_distance\n provide_user_id\n @current_marathon_settings_id = Setting.find_by(account_id: @user_id).id\n @select_tracker_for_total_distance = Tracker.where(settings_id: @current_marathon_settings_id)\n\n @tracker_json = JSON.parse(@select_tracker_for_total_distance.to_json)\n\n @total_distance_run = 0\n for inc in 0..17\n if @tracker_json[inc]\n @total_distance_run = @total_distance_run.to_i + @tracker_json[inc][\"distance_mon\"].to_i + @tracker_json[inc][\"distance_tues\"].to_i + @tracker_json[inc][\"distance_wed\"].to_i + @tracker_json[inc][\"distance_thurs\"].to_i + @tracker_json[inc][\"distance_fri\"].to_i +\n @tracker_json[inc][\"distance_sat\"].to_i + @tracker_json[inc][\"distance_sun\"].to_i\n end\n end\nend",
"title": ""
},
{
"docid": "735672b45385ed71d5efc897ec23b1d8",
"score": "0.67685884",
"text": "def get_est_time\n url = \"https://maps.googleapis.com/maps/api/directions/json?origin=\\\n #{locations[0].coordinates[0]},#{locations[0].coordinates[1]}\\\n &destination=#{locations[1].coordinates[0]},\\\n #{locations[1].coordinates[1]}&key=\\\n #{Rails.application.credentials.gmap_geocode_api_kep}\"\n response = HTTParty.get(url).parsed_response\n self.est_time = ((response['routes'].first['legs'].first['duration']['value']) / 60).round + BUFFER_TIME\n end",
"title": ""
},
{
"docid": "0d025227a0dface46b644e5fd86213a0",
"score": "0.64064276",
"text": "def totalTripTime\n\n end",
"title": ""
},
{
"docid": "e0cfdbde3fc7d3f53497899ba5e64e38",
"score": "0.6314181",
"text": "def get_time\n if(@total_distance < 400)\n s_dist = (@total_distance/2)\n acceleration = (@@plane_speed**2)/(2*s_dist)\n time = @plane_speed/acceleration\n @total_time = 2*time + @layover_time\n else\n s_dist = 200\n acceleration = (@@plane_speed**2)/(2*s_dist)\n time = @@plane_speed/acceleration\n air_dist = @total_distance - 400\n @total_time = 2*time + (air_dist/@@plane_speed) + @layover_time\n end\n puts \"Total time for your journey is #{@total_time} minutes\"\n end",
"title": ""
},
{
"docid": "19142ac11ae96e2bf5f9f3ffe195ec2e",
"score": "0.6270161",
"text": "def create\n route = Route.create!(user_id: params[:user_id], coordinates: params[:coordinates], name: params[:name])\n # byebug\n total_travel_time_and_distance = route.total_travel_time\n puts \"Total Travel Time and Distance\"\n puts total_travel_time_and_distance[\"time\"]\n puts total_travel_time_and_distance[\"distance\"]\n # byebug\n render json: total_travel_time_and_distance\n end",
"title": ""
},
{
"docid": "d8bf6485effff10d096bdd45d4cf7178",
"score": "0.62630624",
"text": "def travel_time\n @error.check_initialized(self)\n total_time{|cell, nextcell| get_travel_time(cell, nextcell)}\n end",
"title": ""
},
{
"docid": "3556f97342353db2d3b42a4b2d021fce",
"score": "0.62601197",
"text": "def get_route_flying_time(metro_list)\n time_sum = 0\n metro_list.each_cons(2) do |metro1, metro2|\n flight_distance = @map.get_route(metro1, metro2)\n if flight_distance > 400\n time = (flight_distance + 400) / 750\n else\n time = sqrt(flight_distance) / 37.5\n end\n time_sum += time\n end\n return time_sum\n end",
"title": ""
},
{
"docid": "2710d3f89c1801eb349dfd4fe946fb4d",
"score": "0.6237122",
"text": "def travel_time(from)\n 1.2 * (@latlng.distance_to(from, {units: :kms}) / 4) * 60 * 60\n end",
"title": ""
},
{
"docid": "448532efecec0642b0fe2182e85e0a53",
"score": "0.6223453",
"text": "def totalFlightTime\n\n end",
"title": ""
},
{
"docid": "c1ac03baaba1132c9df96027195f6c86",
"score": "0.6164406",
"text": "def calculate_waypoints_for_json(file)\n\tpoints_data = []\n\tresult = \"\"\n\tpoints_with_distance = []\n\tdata = File.read(file)\n\tjson_data = JSON.parse(data)\n\tencoded_coords = json_data['routes'][0]['overview_polyline']['points']\n\tdecoded_coords = Polylines::Decoder.decode_polyline(encoded_coords)\n\told_x = 0.0\n\told_y = 0.0\n\tcount = 0\n\ttotaldistance = 0\n\tdecoded_coords.each{|x|\n\t\tif old_x == 0.0 || old_y == 0.0\n\t\t\told_x = x[0]\n\t\t\told_y = x[1]\n\t\t\tpoints_with_distance << [x[0],x[1],totaldistance]\n\t\t\tcount+=1\n\t\t\tnext\n\t\telse\n\t\t\ta = distance [old_x,old_y],[x[0],x[1]]\n\t\t\ttotaldistance += a\n\t\t\tpoints_with_distance << [x[0],x[1],totaldistance] \n\t\t\told_x = x[0]\n\t\t\told_y = x[1]\n\t\t\tcount += 1\n\t\tend\n\t}\n\treturn points_with_distance\nend",
"title": ""
},
{
"docid": "5db3edfa1d95fb991fe090929522e638",
"score": "0.6156468",
"text": "def get_est_time\n if locations[0].coordinates.nil? || locations[1].coordinates.nil?\n logger.warn 'Coordinates did not exist for these locations, returning default est_time'\n self.est_time = 15\n return\n end\n url = \"https://maps.googleapis.com/maps/api/directions/json?origin=\\\n #{locations[0].coordinates[0]},#{locations[0].coordinates[1]}\\\n &destination=#{locations[1].coordinates[0]},\\\n #{locations[1].coordinates[1]}&key=\\\n #{Rails.application.credentials.google_maps_key}\"\n response = HTTParty.get(url).parsed_response\n if response.nil?\n self.est_time = 0\n logger.warn \"Google Maps API returned nothing for est time. Request URL: #{url}\"\n else\n est_time_min = response['routes'].first['legs'].first['duration']['value'] / 60\n buffer_time = est_time_min * 0.1\n self.est_time = (est_time_min + buffer_time).round\n end\n end",
"title": ""
},
{
"docid": "60926a19a2433d590b163c303f60c974",
"score": "0.61464816",
"text": "def travel_time(origin, destination)\n url = \"https://maps.googleapis.com/maps/api/distancematrix/xml?units=imperial&origins=\" + origin + \"&destinations=\" + destination + \"&key=\" + ENV[\"GOOGLE_MAPS_API\"]\n parse_page = Nokogiri::XML(open(url))\n\n return parse_page.css('duration').css('value').text.to_i\nend",
"title": ""
},
{
"docid": "53a7520a077bcf30fdf3b4e916ef4385",
"score": "0.61460066",
"text": "def calculate_and_cache_attributes\n\n last_time = 0\n last_distance = 0\n last_altitude = 0\n total_watts = 0\n total_heart_rate = 0\n total_cadence = 0\n total_speed = 0\n total_altitude = 0\n \n track_points.each do |track_point|\n \n # Initialize \n last_time = track_point.time if last_time == 0\n last_distance = track_point.distance if last_distance == 0\n last_altitude = track_point.altitude if last_altitude == 0\n @min_watts = track_point.watts if @min_watts == 0\n @min_heart_rate = track_point.heart_rate if @min_heart_rate == 0\n @min_cadence = track_point.cadence if @min_cadence == 0\n @min_speed = track_point.speed.round(2) if @min_speed == 0\n @min_altitude = track_point.altitude.round(2) if @min_altitude == 0\n\n # Max/min watts, hr, cadence, speed, altitude, temp\n @max_watts = track_point.watts if track_point.watts > @max_watts\n @min_watts = track_point.watts if track_point.watts < @min_watts\n total_watts += track_point.watts\n\n @max_heart_rate = track_point.heart_rate if track_point.heart_rate > @max_heart_rate\n @min_heart_rate = track_point.heart_rate if track_point.heart_rate < @min_heart_rate\n total_heart_rate += track_point.heart_rate\n\n @max_cadence = track_point.cadence if track_point.cadence > @max_cadence\n @min_cadence = track_point.cadence if track_point.cadence < @min_cadence\n total_cadence += track_point.cadence\n\n @max_speed = track_point.speed.round(2) if track_point.speed > @max_speed\n @min_speed = track_point.speed.round(2) if track_point.speed < @min_speed\n total_speed += track_point.speed\n\n @max_altitude = track_point.altitude.round(2) if track_point.altitude > @max_altitude\n @min_altitude = track_point.altitude.round(2) if track_point.altitude < @min_altitude\n total_altitude += track_point.altitude\n\n # track_point.temp has not been implemented yet. Initialized to 0\n #@max_temp = track_point.temp if track_point.temp > @max_temp\n #@min_temp = track_point.temp if track_point.temp < @min_temp\n\n\n # Joules watts * duration.\n @kjoules += (track_point.watts*elapsed(track_point.time,last_time))/1000\n \n # Increment ride time if we pedal or produce power. Distance is not \n # used given the activity my be on a stationary trainer / rollers.\n if( elapsed(track_point.distance,last_distance) > 0 || \n track_point.cadence > 0 || \n track_point.watts > 0 )\n @ride_time += elapsed(track_point.time,last_time) \n end\n\n # Elevation gain / loss\n if last_altitude <= track_point.altitude\n @elevation_gain += (track_point.altitude - last_altitude)\n else\n @elevation_loss += (last_altitude - track_point.altitude)\n end \n\n last_time=track_point.time\n last_distance=track_point.distance \n last_altitude=track_point.altitude\n @total_trackpoints += 1\n \n end\n\n @avg_watts = (total_watts / @total_trackpoints).round(0)\n @avg_heart_rate = (total_heart_rate / @total_trackpoints).round(0)\n @avg_cadence = (total_cadence / @total_trackpoints).round(0)\n @avg_speed = (total_speed / @total_trackpoints).round(2)\n @avg_altitude = (total_altitude / @total_trackpoints).round(2)\n @elevation_gain = @elevation_gain.round(2)\n @elevation_loss = @elevation_loss.round(2)\n @kjoules = @kjoules.round(2)\n @start_time = track_points.first.time\n\n end",
"title": ""
},
{
"docid": "c1dca7c0d1cb0535e13a022dc12e483d",
"score": "0.6119267",
"text": "def get_route_layover_time(metro_list)\n time_sum = 0\n metro_list.each do |metro|\n time = 2 - (1 / 6) * @map.get_metro(metro)['flight_to'].length\n if time < 0\n time = 0\n end\n time_sum += time\n end\n return time_sum\n end",
"title": ""
},
{
"docid": "2ae01f40a991dafe168dfc8de4450f11",
"score": "0.6098289",
"text": "def total_time\n @bike_trips.reduce(0) { |a, e| a + (e.duration || 0) }\n end",
"title": ""
},
{
"docid": "f52c5f6cea85c61e45526283b0f68dcf",
"score": "0.6068344",
"text": "def compute_distance\n if Route.encoded_priority\n nways = decoded_points.size\n wpoints = decoded_points.collect do |dp|\n Waypoint.new(:lat => dp[0], :lng => dp[1])\n end\n else\n nways = waypoints.size\n wpoints = waypoints\n end\n\n dist = 0\n wpoints.each_with_index do |w,i|\n dist += w.distance_to(wpoints[i + 1]) unless i == nways - 1\n end\n if self.distance_unit == 'km'\n return dist * 1.609344 #No pilla que se utiliza kms por defecto\n end\n dist\n end",
"title": ""
},
{
"docid": "9ff0d827c916789dfa134dfcb06e1f19",
"score": "0.6020917",
"text": "def total_time_spent\n total_time = 0\n @trips.each do |trip|\n trip_in_seconds = trip[:end_time] - trip[:start_time]\n total_time += trip_in_seconds\n end\n return total_time\n end",
"title": ""
},
{
"docid": "933c4a7c833a1f05b20f8c90247e4c3b",
"score": "0.6015755",
"text": "def calc_time(route, airlineData)\n half_dist = route.distance/2\n flight_time = 0\n if half_dist > 200.0\n flight_time = calc_acc_dec_time(200) + (route.distance - 400.0)/750\n else\n flight_time = calc_acc_dec_time(half_dist)\n end\n\n connections = airlineData.metros[route.departure_port][CONNECTION_LIST].size\n layover_time = 2.0 - connections/6.0\n\n return flight_time, layover_time\n end",
"title": ""
},
{
"docid": "9ae1a0a112e66eea9b9d26049857e629",
"score": "0.5996164",
"text": "def envoy_travel_time(v)\n diplomats -2*0.20*v\n merchants -2*0.01*v\n colonists -1*0.10*v\n end",
"title": ""
},
{
"docid": "e714491bf9b2127480109d6deb620fc6",
"score": "0.5972969",
"text": "def envoy_travel_time(v)\n diplomats -2*0.25*v\n merchants -2*0.01*v\n colonists -1*0.10*v\n end",
"title": ""
},
{
"docid": "454562ea89d950ca14242339d541a7d5",
"score": "0.594154",
"text": "def flight_time(origin, destination)\n\n distance = Haversine.distance(origin, destination)\n distance = distance.to_miles / FLIGHTSPEED\n distance.round\nend",
"title": ""
},
{
"docid": "6becfb92033e54886fea74e1e7ef74e3",
"score": "0.59362096",
"text": "def debug_moving_tick( seconds = 3600 ) #TODO -> Add estimated time to res result, and make all the methods CLASS methods in the Geolocation class...\n \n distance_traveled = self.speed * (seconds/3600.to_f) #KM\n return ActiveSupport::JSON.encode( Helpers::Geolocation.move( @army.location, @army.destination, distance_traveled ) )\n end",
"title": ""
},
{
"docid": "ec00e06736c64e0215c2f720aa2fe474",
"score": "0.59205186",
"text": "def get_coordinates(type)\n\t\turi = URI(\"http://which-technical-exercise.herokuapp.com/api/pcsmith86@gmail.com/directions\")\n\t\t#Get data from web service\n\t\thttp = HTTPClient.new\n\t\tresponse = http.get(uri)\n\t\t\n\t\t#Check status of http request\n\t\tif response.status == 200\n\t\t\t#Parse JSON\n\t\t\tdirections = JSON.parse(response.content)\n\t\t\t#directions = JSON.parse(\"{\\\"directions\\\":[\\\"forward\\\",\\\"right\\\",\\\"forward\\\",\\\"forward\\\",\\\"forward\\\",\\\"left\\\",\\\"forward\\\",\\\"forward\\\",\\\"left\\\",\\\"right\\\",\\\"forward\\\",\\\"right\\\",\\\"forward\\\",\\\"forward\\\",\\\"right\\\",\\\"forward\\\",\\\"forward\\\",\\\"left\\\"]}\")\n\n\t\t\t#Check that JSON has parsed correctly\n\t\t\tif directions\n\t\t\t\t#Set initial values of compass, X and Y coordinates and lat/lng\n\t\t\t\tcompass = \"north\"\n\t\t\t\tcoordinates = {:x => 0, :y => 0, :lat => 51.522552, :lng => -0.149413}\n\t\t\t\tgmap = [{:lat => 51.522552, :lng => -0.149413}]\n\t\t\t\t#Process directions and collect coordinates and lat/lng\n\t\t\t\tdirections[\"directions\"].each do |direction|\n\t\t\t\t\t#Process the forward directions, as they will alter the coordinates and lat/lng\n\t\t\t\t\tif direction == \"forward\"\n\t\t\t\t\t\tif compass == \"north\"\n\t\t\t\t\t\t\tcoordinates[:y] += 1\n\t\t\t\t\t\t\tcoordinates[:lat] += 0.001\n\t\t\t\t\t\telsif compass == \"east\"\n\t\t\t\t\t\t\tcoordinates[:x] += 1\n\t\t\t\t\t\t\tcoordinates[:lng] += 0.001\n\t\t\t\t\t\telsif compass == \"south\"\n\t\t\t\t\t\t\tcoordinates[:y] -= 1\n\t\t\t\t\t\t\tcoordinates[:lat] -= 0.001\n\t\t\t\t\t\telsif compass == \"west\"\n\t\t\t\t\t\t\tcoordinates[:x] -= 1\n\t\t\t\t\t\t\tcoordinates[:lng] -= 0.001\n\t\t\t\t\t\tend\n\t\t\t\t\t\t#Add lat/lng to gmap array\n\t\t\t\t\t\tgmap.push({:lat => coordinates[:lat], :lng => coordinates[:lng]})\n\t\t\t\t\telse\n\t\t\t\t\t\t#If the direction is not forward, it muast be left or right. Call the turn function to update the compass variable\n\t\t\t\t\t\tcompass = turn(compass, direction)\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\t\tif type == \"final_coordinates\"\n\t\t\t\t\t#Return final coordinates\n\t\t\t\t\treturn coordinates\n\t\t\t\telsif type == \"gmap\"\n\t\t\t\t\t#Return lat/lng values to draw Google map polyline\n\t\t\t\t\treturn gmap\n\t\t\t\tend\n\t\t\tend\n\t\t#If there is a problem with the JSON call, error gracefully by returning the expected data type but empty\n\t\telsif type == \"final_coordinates\"\n\t\t\treturn Hash.new\n\t\telsif type == \"gmap\"\n\t\t\treturn Array.new\n\t\tend\n\tend",
"title": ""
},
{
"docid": "a22081546509877781afba402138506c",
"score": "0.59026796",
"text": "def total_time_spent\n # @trips.empty? ? 0 : @trips.inject(0) { |total_time, trip| total_time + trip.trip_duration }\n if @trips.empty?\n 0\n else\n @trips.inject(0) do |total_time, trip|\n begin\n trip.trip_duration\n rescue ArgumentError\n next total_time\n end\n total_time + trip.trip_duration\n end\n end\n end",
"title": ""
},
{
"docid": "cda7ac24ce4bcdf038f394962ea6e5eb",
"score": "0.588154",
"text": "def get_walk_time otp_itin, trip_type\n if trip_type.in? [:car, :bicycle]\n return 0\n else\n return otp_itin[\"walkTime\"]\n end\n end",
"title": ""
},
{
"docid": "6f62ae2f9105c2a02c107113590a0c21",
"score": "0.58765453",
"text": "def walk_route(params={})\n\n params[:origin] ||= {:lat =>53.797678, :lon =>-1.5359008} #-1.5359008,53.797678 bus station!\n lon_lat = Course.get_lon_lat(params[:lon_lat])\n \n params[:origin] = {:lat =>lon_lat[:latitude], :lon =>lon_lat[:longitude]} if lon_lat\n\n params[:start_time] ||= self.start_time.strftime(\"%H:%M\")\n if self.start_date < Time.now\n params[:start_date] ||= Time.now.strftime(\"%Y-%m-%d\")\n else\n params[:start_date] ||= self.start_date.strftime(\"%Y-%m-%d\")\n end\n\n time = params[:start_date]+\"T\"+params[:start_time]\n json = {\"locations\" => [{\"lat\"=>params[:origin][:lat], \"lon\"=>params[:origin][:lon]},{\"lat\"=>self.latitude, \"lon\"=> self.longitude}], \"directions_options\"=>{\"units\"=>\"kilometers\"},\"costing\" => \"pedestrian\" }.to_json\n location = \"#{params[:origin][:lon]},#{params[:origin][:lat]};#{self.longitude},#{self.latitude}\"\n url = \"#{AppConfig['osrm_url']}/route/v1/foot/#{location}?overview=false&alternatives=false&steps=true\"\n\n logger.debug \"calling #{url}\"\n\n response = HTTParty.get(url, {\n headers: {\"User-Agent\" => \"Leeds-Adult-Learning;Contact osm @chippy\"} \n })\n\n if response.code != 200\n msg = \"Problem with OSRM walk routing: Code: #{response.code.to_s} Body: \" + response.body.inspect\n raise ApiError, msg\n end\n \n body = JSON.parse(response.body)\n\n duration = body[\"routes\"][0][\"legs\"][0][\"duration\"]\n length = body[\"routes\"][0][\"legs\"][0][\"distance\"]\n departure_time = self.start_time - duration\n arrival_time = self.start_time \n\n parts = []\n body[\"routes\"][0][\"legs\"].each do | leg |\n leg[\"steps\"].each do | step |\n instruction = OSRMTextInstructions.compile(step)\n parts << { \"mode\" => \"foot\",\n \"pre_instruction\" => instruction,\n \"post_instruction\" => \"\",\n \"duration\" => step[\"duration\"],\n \"distance\" => step[\"distance\"],\n \"ref\" => step[\"ref\"]\n } \n end\n end\n \n return {:type => \"foot\",\n :duration => duration,\n :length => length,\n :date => params[:start_date],\n :departure_time => departure_time,\n :arrival_time => arrival_time,\n :parts => parts }\n\n end",
"title": ""
},
{
"docid": "c4fa37c88231ef9d21aeb06431e4c9e0",
"score": "0.5847233",
"text": "def total_time_spent\n # trip_duration method created in trip class\n total_time = @trips.sum { |trip| trip.trip_duration }\n return total_time\n end",
"title": ""
},
{
"docid": "5289529f78d3f5a01ad90a8e3ef0e799",
"score": "0.57891184",
"text": "def gatherCoordsSince\n \tm_id=params[:mission_id]\n \tdatetime=params[:datetime]\n numMaxCoords = params[:numCoords]\n \toffset = params[:offset]\n\n\n \ttrackers=[] # change js array into tracker_ids\n \tif (params[:trackers] != nil) \n params[:trackers].each do |k,v|\n \t\ttrackers << v\n \tend\n \tend\n\n if (datetime != \"10000101\" && datetime != nil)#the map already contains coordinates\n if (trackers != nil)# trackers identifiers are specified\n # order(tracker_id: :asc) is just here for performance boost -> prevent some action to be made js side by Google Map API\n newCoords = (Coordinate.where(id: Coordinate.order(datetime: :desc).where(\"datetime > ?\", datetime).where(tracker_id: trackers).limit(numMaxCoords))).where(\"datetime > ?\", datetime).where(tracker_id: trackers).order(tracker_id: :asc).select(:datetime,:tracker_id,:latitude,:longitude)\n else\n newCoords = []\n end\n render json: newCoords.to_json #(:only =>[:datetime,:tracker_id,:latitude,:longitude]) -> remove ID but is not a direct SQL request\n else #the map does not have any coordinates\n if getMissionIds.size > 0 #if there is currently a mission\n if offset.to_i == 0\n start = Mission.find(m_id).start\n else\n start = (Time.now.utc-offset.to_f)\n end\n if (trackers != nil)# trackers identifiers are specified\n newCoords = (Coordinate.where(id: Coordinate.order(datetime: :desc).where(\"datetime > ?\", start).where(tracker_id: trackers).limit(numMaxCoords))).where(\"datetime > ?\", start).where(tracker_id: trackers).where(\"datetime > ?\", datetime).order(tracker_id: :asc).select(:datetime,:tracker_id,:latitude,:longitude)\n else\n newCoords = []\n end\n render json: newCoords.to_json #(:only =>[:datetime,:tracker_id,:latitude,:longitude]) -> remove ID but is not a direct SQL request\n end\n end\n end",
"title": ""
},
{
"docid": "67b75d0e7827a4f245be47736730b3d5",
"score": "0.5753417",
"text": "def drive_time_in_minutes leg = nil\n if @status != \"OK\"\n drive_time = 0\n else\n drive_time = @directions['routes'].first['legs'].first['duration']['value'].to_i if leg.nil?\n drive_time = leg['duration']['value'].to_i unless leg.nil?\n convert_to_minutes(drive_time)\n end\n end",
"title": ""
},
{
"docid": "e24e4c3bf981085d1fc58f244a8ac1e0",
"score": "0.5750787",
"text": "def total_time; end",
"title": ""
},
{
"docid": "e24e4c3bf981085d1fc58f244a8ac1e0",
"score": "0.5750787",
"text": "def total_time; end",
"title": ""
},
{
"docid": "e24e4c3bf981085d1fc58f244a8ac1e0",
"score": "0.5750787",
"text": "def total_time; end",
"title": ""
},
{
"docid": "d89c89a8b55c6a1970e9404c8f47fdce",
"score": "0.5747475",
"text": "def cost_of_activities_at_destination\n total_cost=cost_of_activities # cost at this location\n my_minor_places.each do |place|\n total_cost += place.cost_of_activities\n end\n end",
"title": ""
},
{
"docid": "6bb284d42503e754510c9c850dad2235",
"score": "0.5729286",
"text": "def total_time\n (@fetch_time || 0) + (@parse_time || 0)\n end",
"title": ""
},
{
"docid": "6bb284d42503e754510c9c850dad2235",
"score": "0.5729286",
"text": "def total_time\n (@fetch_time || 0) + (@parse_time || 0)\n end",
"title": ""
},
{
"docid": "6bb284d42503e754510c9c850dad2235",
"score": "0.5729286",
"text": "def total_time\n (@fetch_time || 0) + (@parse_time || 0)\n end",
"title": ""
},
{
"docid": "9e298d2473298282d98532aed6afa6c8",
"score": "0.572855",
"text": "def total_distance\n distance = 0\n rides.each do |ride|\n distance += ride.distance\n end\n distance\nend",
"title": ""
},
{
"docid": "b76d9c2e16f72557ed9d5968449e9620",
"score": "0.5696389",
"text": "def getRouteInfo(route)\n cities = route.split(\",\")\n dist = 0\n cost = 0\n unitPrice = 0.35\n distance = 0\n #V1^2-V0^2 = 2as\n acceleration = (700.0**2)/(2*200.0)\n time = 0\n if(cities.length < 1)\n return {\"dist\"=>dist, \"cost\"=>cost, \"time\"=>time}\n end\n prev = nil\n isFirst = true\n for curCity in cities\n node = getCode(curCity)\n #check if node exist\n if(node == nil)\n return nil\n end \n if(!isFirst) \n codes = setDistanceMapKey(prev, node.code)\n if (@distanceMap.has_key?(codes))\n #dist\n curDist = @distanceMap[codes]\n dist = dist + curDist\n #cost\n cost = cost + unitPrice*curDist\n temp = unitPrice-0.05\n unitPrice = (temp>0)?temp:0\n #time\n if(dist < 400)\n #s = 0.5*a*t^2\n t= Math.sqrt(dist*2/acceleration)\n time = time + t\n else\n time = time + Math.sqrt((400*2)/acceleration) + (dist-400)/750\n end\n outBounds = @map[prev].destinations.length\n temp = 2 - (1.0/6)*(outBounds-1)\n layover = (temp>0)?temp:0\n time = time+layover\n else\n return nil\n end\n prev = node.code\n else\n prev = node.code\n isFirst = false\n end \n end\n return {\"dist\"=>dist, \"cost\"=>cost.round(2), \"time\"=>time.round(2)}\n end",
"title": ""
},
{
"docid": "798b98593c1d7882a4b8562355b09cf0",
"score": "0.568504",
"text": "def total_distance\n distance = 0 \n self.rides.each { |ride| distance += ride.distance }\n distance.to_f\n end",
"title": ""
},
{
"docid": "660ba9bf9b8e5023251cbef28af5dfc7",
"score": "0.56794006",
"text": "def trip_duration(distance)\n distance * @speed\n end",
"title": ""
},
{
"docid": "c6593a003f1518271ff9e3402779b62d",
"score": "0.56771034",
"text": "def adding_miliseconds\n @route = self.routes\n @routes[\"features\"].each do |link|\n link[\"properties\"][\"speed_miliseconds\"] = link[\"properties\"][\"rt_travel_time\"]*10000\n end\n end",
"title": ""
},
{
"docid": "02043455b9fb364e53377dbe02e2bc26",
"score": "0.567706",
"text": "def time_until(station)\n data = get_and_parse_json\n time = 0\n data['Trips'].each do |trip|\n end\n end",
"title": ""
},
{
"docid": "24ac0c4d06cb23e46b94cbb46449b285",
"score": "0.56704015",
"text": "def trips_summary\n trip_distance = @company.trips.search(params).sum(:distance)\n render json: {total_distance: trip_distance}, status: 201\n end",
"title": ""
},
{
"docid": "1de88ee4e748437a215999698aa9681e",
"score": "0.5666352",
"text": "def totals(json: false)\n \treturn {} if @status==:off\n require 'json' if json\n output={\n name: @name,\n total_time: @total.to_f,\n started: @initial_time,\n finished: @timify_prev,\n locations: {},\n labels: {},\n ranges: {}\n }\n message=\"\\n\\nTotal time <#{@name}>:#{@total.to_f.round(2)}\"\n message+=\"\\nTotal time by location:\\n\"\n @timify.each {|location, secs|\n if @total==0 then\n percent=0\n else\n percent=(secs*100/(@total).to_f).round(0)\n end\n message+= \"\\t#{location}: #{secs.round(2)} (#{percent}%) ##{@count[location]}\\n\"\n output[:locations][location]={\n secs: secs,\n percent: percent,\n count: @count[location]\n }\n }\n if !@timify_by_label.empty?\n message+= \"\\nTotal time by label:\\n\"\n @timify_by_label.each {|label, secs|\n if @total==0 then\n percent=0\n else\n percent=(secs*100/(@total).to_f).round(0)\n end\n message+= \"\\t#{label}: #{secs.round(2)} (#{percent}%) ##{@count[label]}\\n\"\n output[:labels][label]={\n secs: secs,\n percent: percent,\n count: @count[label]\n }\n }\n end\n\n if !@timify_by_range.empty?\n message+= \"\\nTotal time by range:\\n\"\n @timify_by_range.each {|range, secs|\n if @total==0 then\n percent=0\n else\n percent=(secs*100/(@total).to_f).round(0)\n end\n message+= \"\\t#{range}: #{secs.round(2)} (#{percent}%) ##{@count[range]}\\n\"\n output[:ranges][range]={\n secs: secs,\n percent: percent,\n count: @count[range]\n }\n }\n end\n\n message+= \"\\n\\n\"\n output[:message]=message\n puts message if @show\n output=output.to_json if json\n return output\n end",
"title": ""
},
{
"docid": "0160a48e4fd90f761aef8061b5b257d2",
"score": "0.5659625",
"text": "def get_route_time(metro_list)\n return self.get_route_layover_time(metro_list) + self.get_route_flying_time(metro_list)\n end",
"title": ""
},
{
"docid": "6d3d9112772a7e6f3236d9311f337786",
"score": "0.56581885",
"text": "def get_points(jsonRoute)\n\n jsonRoute = JSON.parse(jsonRoute)\n\n # array to hold our our collection of points\n arrayOfCoordinates = Array.new()\n\n\n lat = jsonRoute['routes'][0]['legs'][0]['start_location']['lat']\n lng = jsonRoute['routes'][0]['legs'][0]['start_location']['lng']\n\n firstPoint = Array.new()\n firstPoint.push(lat)\n firstPoint.push(lng)\n\n arrayOfCoordinates.push(firstPoint)\n\n steps = jsonRoute['routes'][0]['legs'][0]['steps']\n\n # go through each step\n steps.each do |step|\n\n # each step, get lat. & lng. location and push \n lat = step[\"end_location\"][\"lat\"]\n lng = step[\"end_location\"][\"lng\"]\n\n endCoordinates = Array.new()\n endCoordinates.push(lat)\n endCoordinates.push(lng)\n\n arrayOfCoordinates.push(endCoordinates)\n\n end\n\n return arrayOfCoordinates\n\n end",
"title": ""
},
{
"docid": "562578bef91c4dc154480574efb30b1f",
"score": "0.5648537",
"text": "def total_km_cal\n @total_km = Math.sqrt((ride.source.latitude - ride.destination.latitude)**2 + (ride.source.longitude - ride.destination.longitude)**2)\n end",
"title": ""
},
{
"docid": "c392e8dd9b424a645b9baf1101422f5c",
"score": "0.5644421",
"text": "def total_duration\n\t\thh_mm_sec physical_objects.inject(0){|sum, p| p[:duration].to_i + sum }\n\tend",
"title": ""
},
{
"docid": "19f72b4d17bb70c811d50d119b7c79d2",
"score": "0.56405264",
"text": "def total_time_spent\n if @trips.empty? == true\n return 0\n else\n time_duration = (@trips).map do |trip|\n Time.parse(trip.end_time) - Time.parse(trip.start_time)\n end\n \n return (time_duration).inject(:+)\n end\n end",
"title": ""
},
{
"docid": "4cf3e004823702fd85448913cb8941fc",
"score": "0.5639781",
"text": "def alltime_total\n @data['alltime']['total']\n end",
"title": ""
},
{
"docid": "fa731feceae95503f9ac1e6fba833b74",
"score": "0.5638634",
"text": "def total_wall_time\n @timing_hash.inject(0) {|total, a|\n total += a[1][:wall_time]\n }\n end",
"title": ""
},
{
"docid": "6d4b8e6d65b1f9aa51c7023a74e3d469",
"score": "0.5633905",
"text": "def trip(distance,km_per_gallon,price_a_gallon,speed)\n time = distance/speed\n cost = distance * price_a_gallon / km_per_gallon\n [time,cost]\nend",
"title": ""
},
{
"docid": "5e0b7a887df3b5b9b1adf3bbf85d3a36",
"score": "0.56169194",
"text": "def return_trip_time(start, dest)\n trip2 = Trip.new(\"Columbus_Circle\", \"Grand_Central\", 9, [\"1\", \"S\"],'<iframe src=\"https://www.google.com/maps/embed?pb=!1m28!1m12!1m3!1d12088.308001632395!2d-73.98839553425857!3d40.76033113259129!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!4m13!3e6!4m5!1s0x89c258f63c9804b5%3A0xacca5e3d4112d7eb!2sColumbus+Cir%2C+New+York%2C+NY!3m2!1d40.7680441!2d-73.9823722!4m5!1s0x89c25a21fb011c85%3A0x37513b7f1821408b!2sGrand+Central+Terminal%2C+East+42nd+Street%2C+New+York%2C+NY!3m2!1d40.7527262!2d-73.9772294!5e0!3m2!1sen!2sus!4v1440768180490\" width=\"600\" height=\"450\" frameborder=\"0\" style=\"border:0\" allowfullscreen></iframe>')\n if start==\"COLUMBUS CIRCLE\" && dest==\"GRAND CENTRAL\"\n return trip2.trip_time\n else\n return \"Not a Valid trip.\"\n end\nend",
"title": ""
},
{
"docid": "c1b2a1d7fec416972479ccc3d0c8af71",
"score": "0.56134796",
"text": "def total_time\n extract_from_time_hash :total_time\n end",
"title": ""
},
{
"docid": "5a370231fa86558ffbb7bbb406ff5bed",
"score": "0.5611726",
"text": "def wo_vehicle_totals\n distance = params[:distance].to_f / 100\n costs = params[:costs].to_f / 10000\n count = params[:count].to_i\n # Minutes average\n average = count > 0 ? distance / count : 0\n # Total\n total = costs\n # Format output values\n distance = number_with_precision(distance.round(2), precision: 2)\n average = number_with_precision(average.round(2), precision: 2)\n total = number_with_precision(total.round(4), precision: 4)\n # Setup JSON hash\n @json_data = { \"distance\" => distance.to_s, \"average\" => average.to_s, \"total\" => total.to_s }\n render json: @json_data\n end",
"title": ""
},
{
"docid": "bdec47c484e693dd5c2b0d11c66f37c5",
"score": "0.5603427",
"text": "def departure_info(route, direction, stop)\n departures = RestClient.get(\"http://svc.metrotransit.org/NexTrip/#{route}/#{direction}/#{stop}?format=json\")\n JSON.parse(departures)\nend",
"title": ""
},
{
"docid": "c5c25cdefa99532ff990423ca038b2b3",
"score": "0.55848944",
"text": "def travel_distance(travel_plan)\n\n # Calculate the total_length_of_trip here!\n\n return total_length_of_trip\n end",
"title": ""
},
{
"docid": "9d607ff2250f50b9db42d652c9a4a654",
"score": "0.55690914",
"text": "def get_data(lat, long, time_current)\n\t\n\ttime_earliest = time_current - REFER * MTOS\n\t\n\tdata = Hash.new\n\t(time_earliest..time_current).step(INTER * MTOS) do |time|\n\t\t#puts Time.at(time)\n\t\t\n\t\tlat_long = lat.to_s + \",\" + long.to_s\n\t\trequest_uri = URI.parse(\"#{BASE_URL}/#{API_KEY}/#{lat_long},#{time}\")\n\t\tforecast = JSON.parse(open(request_uri, \n\t\t\t{ssl_verify_mode: OpenSSL::SSL::VERIFY_NONE}).read)\n\t\tcurrent = forecast['currently']\n\t\t\n\t\t# rainfall, temperature, wind_dir, wind_spd, updated, loc_id?\n\t\t# need controller methods for create if we want to insert\n\t\t# data retrieved for predictions into table\n\t\tdata[time] = Hash.new\n\t\tdata[time]['rainfall'] = current['precipIntensity'] * ITOMM * \n\t\t\tcurrent['precipProbability']\n\t\tdata[time]['temperature'] = (current['temperature'] - 32) * 5/9\n\t\tdata[time]['wind_speed'] = current['windSpeed'] * MTOKM\n\t\tdata[time]['wind_dir'] = current['windBearing']\n\t\tdata[time]['observed'] = current['time']\n\tend\n\treturn data\nend",
"title": ""
},
{
"docid": "d08d0da2206f6a1ed093f59a2df5bd43",
"score": "0.55682504",
"text": "def trip_distance(time)\n @speed * time\n end",
"title": ""
},
{
"docid": "95aa65e7350738b52aad31f3c10ab527",
"score": "0.5560949",
"text": "def transit_route_tapi(params={})\n lon_lat = Course.get_lon_lat(params[:lon_lat])\n lon_lat = \"lonlat:#{lon_lat[:longitude]},#{lon_lat[:latitude]}\" if lon_lat\n origin = params[:origin] || lon_lat || \"postcode:LS2+9DY\" #lonlat:-1.5359008,53.797678 bus station!\n\n params[:destination] ||= \"lonlat:#{self.longitude},#{self.latitude}\"\n\n if self.start_date < Time.now\n params[:start_date] ||= Time.now.strftime(\"%Y-%m-%d\")\n else\n params[:start_date] ||= self.start_date.strftime(\"%Y-%m-%d\")\n end\n\n params[:start_time] ||= self.start_time.strftime(\"%H:%M\")\n \n base_url=\"https://transportapi.com/v3/uk/public/journey\"\n rest_params=\"/from/#{origin}/to/#{params[:destination]}/by/#{params[:start_date]}/#{params[:start_time]}.json\"\n\n query_params = \"?\" + {\n \"app_id\" => AppConfig[\"transportapi_id\"],\n \"app_key\" => AppConfig[\"transportapi_key\"],\n \"modes\" => \"bus\",\n \"service\" => \"southeast\"\n }.map {|k,v| \"#{k}=#{CGI.escape(v)}\"}*\"&\"\n \n url=URI.parse(base_url+rest_params+query_params)\n logger.debug \"calling #{url}\"\n\n response = HTTParty.get(url)\n \n if response.code != 200\n msg = \"Problem with Transport API transit routing: Code: #{response.code.to_s} Body: \" + response.body.inspect\n raise ApiError, msg\n end\n \n body = JSON.parse(response.body)\n\n return nil unless body[\"error\"].blank?\n \n route = body[\"routes\"][0]\n\n duration = route[\"duration\"]\n departure_time = route[\"departure_time\"]\n arrival_time = route[\"arrival_time\"]\n \n\n parts = route[\"route_parts\"].map {| part | \n {\"mode\" => part[\"mode\"],\n \"from\"=> part[\"from_point_name\"], \n \"to\" => part[\"to_point_name\"], \n \"line_name\" => part[\"line_name\"], \n \"departure_time\" => part[\"departure_time\"],\n \"arrival_time\" => part[\"arrival_time\"],\n \"duration\" => part[\"duration\"]} }\n \n return {:type => \"transit\",\n :duration => duration,\n :date => params[:start_date],\n :departure_time => departure_time,\n :arrival_time => arrival_time,\n :parts => parts }\n end",
"title": ""
},
{
"docid": "ebb6e192c5fc07108e6eca5d0fa3abff",
"score": "0.5553591",
"text": "def show\n\n @locations = @travel_map.locations\n\n @hash = Gmaps4rails.build_markers(@locations) do |location, marker|\n marker.lat location.latitude\n marker.lng location.longitude\n end\n \n @shortest_travel_time = \"\"\n \n if @locations.count < 5\n \n @comb_locations = @locations.combination(2).to_a\n \n @comb_locations.each do |location|\n \n puts location\n latlng_origin = location[0].latitude.to_s + \",\" + location[0].longitude.to_s\n latlng_destination = location[1].latitude.to_s + \",\" + location[1].longitude.to_s\n google_initialise = GoogleMap.new(latlng_origin, latlng_destination)\n directions = google_initialise.directions\n puts directions\n body = JSON.parse(directions.body)\n puts body\n \n if body[\"status\"] == \"ZERO_RESULTS\"\n else\n distance = body[\"routes\"][0][\"legs\"][0][\"distance\"][\"value\"]\n end\n end\n \n end\n\n end",
"title": ""
},
{
"docid": "5b884a467df50c4ec1cac347209459a8",
"score": "0.5544923",
"text": "def stats\n\t\t@business = Business.find(params[:id])\n\n # heatmap manipulations\n @start_date = Coordinate.minimum(\"time\").getlocal.strftime(\"%m/%d/%Y %I:%M %p\")\n @end_date = Coordinate.maximum(\"time\").getlocal.strftime(\"%m/%d/%Y %I:%M %p\")\n\n\t\traw_data = JSON.parse(Coordinate.select(\"latitude, longitude\").to_json)\n raw_data.each do |d|\n d[\"count\"] = \"1\"\n end\n # formatting for javascript\n @data = raw_data.to_json.gsub('\"', '').gsub('latitude', 'lat').gsub('longitude', 'lng')\n @size = raw_data.count\n\tend",
"title": ""
},
{
"docid": "fb79f9d8c7a2f607a2766c76ddd76309",
"score": "0.5542453",
"text": "def total_time_spent\n total_duration = trips.sum {|trip| trip.duration}\n return total_duration\n end",
"title": ""
},
{
"docid": "163d824a95b0b48da7412cef193cec4f",
"score": "0.5541167",
"text": "def travel_time\n\t\tfromtime.to_s + \" - \" + totime.to_s\n\n\tend",
"title": ""
},
{
"docid": "a5604af927a581ba53952ea08f46bd64",
"score": "0.55409414",
"text": "def get_points(jsonRoute)\n \n jsonRoute = JSON.parse(jsonRoute)\n\n # array to hold our our collection of points\n arrayOfCoordinates = Array.new()\n \n\n lat = jsonRoute['routes'][0]['legs'][0]['start_location']['lat']\n lng = jsonRoute['routes'][0]['legs'][0]['start_location']['lng']\n\n firstPoint = Array.new()\n firstPoint.push(lat)\n firstPoint.push(lng)\n \n arrayOfCoordinates.push(firstPoint)\n \n steps = jsonRoute['routes'][0]['legs'][0]['steps']\n\n # go through each step\n steps.each do |step|\n \n # each step, get lat. & lng. location and push \n lat = step[\"end_location\"][\"lat\"]\n lng = step[\"end_location\"][\"lng\"]\n \n endCoordinates = Array.new()\n endCoordinates.push(lat)\n endCoordinates.push(lng)\n \n arrayOfCoordinates.push(endCoordinates)\n \n end\n \n return arrayOfCoordinates\n\n end",
"title": ""
},
{
"docid": "b7d67e928a3f99aee126c90fa304459f",
"score": "0.5538337",
"text": "def total_wall_time\n self.timings.wall_time(\"Time for this iteration\")\n # begin\n # time = self.timings.find{|t| t[:description] =~ /Time for this iteration/}\n # time[:wall_time] or 0\n # rescue\n # self.timings.inject(0){|total, time|\n # total = total + (time[:wall_clock_time] || 0)\n # }\n # end\n end",
"title": ""
},
{
"docid": "b958273aa3b8b496f8d19698b72c099f",
"score": "0.55330026",
"text": "def forecast(lat, long)\n url = \"#{BASE_URL}format=application/json&latitude=#{lat}&longitude=#{long}&date=&distance=100&api_key=#{@api_key}\"\n puts url\n uri = URI(url)\n response = HTTP.get(uri)\n result = JSON.parse(response)\n end",
"title": ""
},
{
"docid": "2510c3c2cee907d9c306b1d6397b5262",
"score": "0.5521111",
"text": "def request_car_route_from(coordinates)\n url = 'https://api.mapbox.com/directions/v5/mapbox/driving-traffic/'\n url += \"#{coordinates[:origin_lat]},#{coordinates[:origin_long]};\"\n url += \"#{coordinates[:dest_lat]},#{coordinates[:dest_long]}?access_token=#{@TOKEN}\"\n # url += '&geometries=geojson'\n uri = URI(url)\n response = Net::HTTP.get(uri)\n JSON.parse(response)\nend",
"title": ""
},
{
"docid": "a1fe574d16a0a8080c17b9210b04292f",
"score": "0.5519583",
"text": "def index\n @walks = Walk.all\n if @walks.count > 0\n @latitude = @walks[0].coordinates_start.split(',')[0].tr(\"{\",\"\").to_f\n p @latitude\n @longitude = @walks[0].coordinates_start.split(',')[-1].tr(\"}\",\"\").to_f\n else\n @latitude = 41.45\n @longitude = -0.05\n end\n @walkywalks = []\n @walks.each do |walk|\n @walkywalks << {latitude: walk.coordinates_start.split(',')[0].tr(\"{\",\"\").to_f, longitude: walk.coordinates_start.split(',')[-1].tr(\"}\",\"\").to_f, id: walk.id, title: walk.title, para: walk.description}\n end\n end",
"title": ""
},
{
"docid": "ca76007b896dcc92259fc580d13404fb",
"score": "0.55062926",
"text": "def update!\n\t\treturn if @waypoints.empty?\n\t\t\n\t\t# sort waypoints by time\n\t\t@waypoints.sort!\n\t\t\n\t\t@distance = 0.0\n\t\t@duration = @waypoints.last.time - @waypoints.first.time\n\t\t\n\t\t# these waypoint references only ever point to records with known (rather than interpolated) coordinates\n\t\tprev_point = nil\n\t\tnext_point = nil\n\t\t\n\t\t# loop through points\n\t\t@waypoints.each_with_index do |point, i|\n\t\t\t\n\t\t\tday = ((point.time - @waypoints.first.time)/(24*60*60)).floor\n\t\t\t\n\t\t\t# if source is :spot or :waypoint set title and text to calculated value\n\t\t\tif [:waypoint, :spot].include? point.source\n\t\t\t\t\n\t\t\t\tdistance = prev_point ? point.location - prev_point.location : 0.0\n\t\t\t\telapsed = prev_point ? point.time - prev_point.time : 0.0\n\t\t\t\tspeed = ( elapsed > 0 ) ? distance/(elapsed/3600) : nil\n\t\t\t\t\n\t\t\t\t@distance += distance\n\t\t\t\t\n\t\t\t\tpoint.title = \"Day %d\" % day\n\t\t\t\tpoint.text = \"Traveled %.1f nmi at %.1f knots\" % [distance, speed] if speed\n\t\t\t\t\n\t\t\t\t\n\t\t\t# if source is :sailmail or :log or :message interpolate coordinate from surrounding values\n\t\t\telsif [:message, :log, :sailmail].include? point.source\n\t\t\t\t\n\t\t\t\t# try to find the next point with a known location\n\t\t\t\tnext_point = @waypoints.slice((i + 1)..@waypoints.length).detect{|p| p.known_location? } if next_point.nil? or ( next_point < point )\n\t\t\t\t\n\t\t\t\t# interpolate with available data\n\t\t\t\tif prev_point and next_point\n\t\t\t\t\t\n\t\t\t\t\tp = (point.time - prev_point.time)/(next_point.time - prev_point.time)\n\t\t\t\t\t\n\t\t\t\t\tpoint.location = Geocoordinate.new(\n\t\t\t\t\t\tprev_point.location.latitude + p*(next_point.location.latitude - prev_point.location.latitude),\n\t\t\t\t\t\tprev_point.location.longitude + p*(next_point.location.longitude - prev_point.location.longitude)\n\t\t\t\t\t)\n\t\t\t\t\t\n\t\t\t\telsif prev_point or next_point\n\t\t\t\t\t\n\t\t\t\t\tpoint.location = (prev_point or next_point).location.clone\n\t\t\t\t\t\n\t\t\t\tend\n\t\t\t\t\n\t\t\t\t# automatically set log titles\n\t\t\t\tpoint.title = \"Ship's Log Day %d\" % day if point.source == :log\n\t\t\t\t\n\t\t\t\t\n\t\t\t# unknown point source!\n\t\t\telse\n\t\t\t\traise \"Unkown point source #{point.source}\"\n\t\t\tend\n\t\t\t\n\t\t\t# update prev_point\n\t\t\tprev_point = point if point.known_location?\n\t\t\t\n\t\tend\n\tend",
"title": ""
},
{
"docid": "36e1c5a612e5e93c946399b62f43e1d9",
"score": "0.5503814",
"text": "def get_time_part2(metro, my_graph)\n time = 2.0 + 1.0/6.0 - (1.0/6.0)*my_graph.metro[metro].destination.length\n if time <0\n time = 0\n end\n time\nend",
"title": ""
},
{
"docid": "7eb7efb8b6ef148bc48e2d90a49d6f5c",
"score": "0.55034983",
"text": "def getTimeOfRoute(stops)\n # all computation should be in seconds\n time = 0\n timeAccelerating = (200.0/375.0)*3600 # Time of the period of acceleration/deceleration\n\n velocityKPS = 750.0 / 3600.0 # Velocity in kilometers per second\n\n accelerationKPH = 225.0/64.0 # Acceleration in kilometers per hour\n accelerationKPS = accelerationKPH / 3600.0 # Acceleration in kilometers per seconds squared\n\n connectingFlight = false\n\n until stops.length == 1\n leg = stops[0..1]\n distance = getDistanceOfRoute(leg)\n\n # Airtime logic\n if distance > 400\n time += 2*timeAccelerating\n time += (distance-400)/velocityKPS\n else\n time += 2*Math.sqrt(distance/accelerationKPS)\n end\n\n if connectingFlight\n time += layoverTime(stops[0])\n end\n connectingFlight = true\n stops.shift\n end\n\n return (time / 3600).round(2)\n end",
"title": ""
},
{
"docid": "64ac33a904554f1b0ca4df3529d4063c",
"score": "0.5480879",
"text": "def distance_duration_to other_runner\n distance_url = \"https://maps.googleapis.com/maps/api/distancematrix/json?origins=#{self.location.gsub(\" \",\"%20\")}&destinations=#{other_runner.location.gsub(\" \",\"%20\")}&key=AIzaSyDOxZ6CpbCbh1jxvCsQc_BveDvyW4iiQsU\"\n distance_parsed_result = JSON.parse(open(distance_url).read)\n {distance: distance_parsed_result['rows'][0][\"elements\"][0][\"distance\"][\"text\"], duration: distance_parsed_result['rows'][0][\"elements\"][0][\"duration\"][\"text\"]}\n end",
"title": ""
},
{
"docid": "1737e17a9649051991971018f64d3b60",
"score": "0.5479626",
"text": "def total_distance\n rides.inject(0) { |sum, ride| sum + ride.distance }\n end",
"title": ""
},
{
"docid": "f3f424595d61cdb309cd4f964cd5c93f",
"score": "0.54735744",
"text": "def update_travelled_length(time_at)\n # TODO handle stops\n self.travelled_distance += (time_at - last_seen_time).to_f * VELOCITY / 3600.0\n self.last_seen_time = time_at\n save\n end",
"title": ""
},
{
"docid": "c8688717c97a4287a28d6b4365e54ee7",
"score": "0.5470579",
"text": "def total_distance\n sum_of_distance = 0\n rides.map {|n| n.distance}\n each do |n| n += 1\n sum_of_distance\n end\n end",
"title": ""
},
{
"docid": "d1f6935572a6a052dcb4a63326e113cc",
"score": "0.5457721",
"text": "def mo_mileage\n gettcr = Travelclaimrequest.find(:all, :conditions => [\"travelclaim_id = ?\", id], :select => :id).map(&:id)\n getkm = Traveldetail.find(:all, :conditions => [\"travelclaimrequest_id IN (?)\", gettcr], :select => :distance).map(&:distance)\n \n gkm=0\n if getkm.include?(nil)\n 0.upto(getkm.size-1) do |count|\n if getkm[count]!= nil\n gkm += getkm[count] \n end\n end \n return gkm\n else\n return getkm.inject(:+)\n end\n \n end",
"title": ""
},
{
"docid": "f2e5fca53ee1ef06e2321062d023f151",
"score": "0.5447654",
"text": "def specialcreate\n @trip = Trip.new(\n current_location: params[:current_location],\n destination: params[:destination]\n )\n @trip.save\n\n current_location = @trip.current_location.tr(\" \", \"+\")\n destination = @trip.destination.tr(\" \", \"+\")\n directions = HTTP.get(\"https://maps.googleapis.com/maps/api/directions/json?origin=#{current_location}d&destination=#{destination}&key=#{ENV[\"GOOGLE_KEY\"]}\").parse\n total = HTTP.get(\"https://maps.googleapis.com/maps/api/distancematrix/json?units=imperial&origins=#{current_location}&destinations=#{destination}&key=#{ENV[\"GOOGLE_KEY\"]}\").parse\n # binding.pry\n \n index = 0\n count = 1\n @steps = []\n while index < directions[\"routes\"][0][\"legs\"][0][\"steps\"].count\n if directions[\"routes\"][0][\"legs\"][0][\"steps\"][index][\"html_instructions\"].include?(\"Destination\")\n start = directions[\"routes\"][0][\"legs\"][0][\"steps\"][index][\"html_instructions\"].index(\"Destination\")\n temp_last = directions[\"routes\"][0][\"legs\"][0][\"steps\"][index][\"html_instructions\"].remove(\"<b>\", \"</b>\", \"<div style=\\\"font-size:0.9em\\\">\", \"</div>\", \"Restricted usage road\")\n last = temp_last.length - 1\n @final_direction = directions[\"routes\"][0][\"legs\"][0][\"steps\"][index][\"html_instructions\"][start, last]\n end\n @steps << \"#{count}. #{directions[\"routes\"][0][\"legs\"][0][\"steps\"][index][\"html_instructions\"]}\".remove(\"<b>\", \"</b>\", \"<div style=\\\"font-size:0.9em\\\">\", \"</div>\", \"Restricted usage road\", \"Destination will be on the right\", \"Destination will be on the left\")\n index = index + 1\n count = count + 1\n end\n @steps << \"#{count}. #{@final_direction}\".remove(\"<b>\", \"</b>\", \"<div style=\\\"font-size:0.9em\\\">\", \"</div>\", \"Restricted usage road\")\n\n @destination_lat = directions['routes'][0]['legs'][0]['end_location']['lat']\n @destination_long = directions['routes'][0]['legs'][0]['end_location']['lng']\n @total_time = total['rows'][0]['elements'][0]['duration']['text']\n @total_distance = total['rows'][0]['elements'][0]['distance']['text']\n\n @yelp = HTTP.get(\"https://api.yelp.com/v3/businesses/search?term=food&latitude=#{@destination_lat}&longitude=#{@destination_long}&\", headers: {\"Authorization\": \"Bearer #{ENV['YELP_KEY']}\"}).parse\n @weather = HTTP.get(\"http://api.openweathermap.org/data/2.5/weather?lat=#{@destination_lat}&lon=#{@destination_long}&appid=#{ENV['WEATHER_KEY']}\").parse\n @description = @weather['weather'][0]['main']\n @temp = sprintf(\"%.2f\", (((((@weather['main']['temp']) - 273.15) * 9)/5) + 32))\n @humidity = @weather['main']['humidity']\n @windspeed = @weather['wind']['speed']\n\n index2 = 0\n @names = []\n @images = []\n @rating = []\n @phone = []\n while index2 < @yelp['businesses'].count\n @names << @yelp['businesses'][index2]['name']\n @images << @yelp['businesses'][index2]['image_url']\n @rating << @yelp['businesses'][index2]['rating']\n @phone << @yelp['businesses'][index2]['display_phone']\n index2 = index2 + 1\n end\n\n render 'index.json.jb'\n end",
"title": ""
},
{
"docid": "e1fec9b16834da8ff37863df6665ba1c",
"score": "0.543956",
"text": "def total_time\n time_entries.inject(0) {|sum, time_entry| sum + time_entry.total_time}\n end",
"title": ""
},
{
"docid": "73ccdce2a8344ed26e4e45e8f303da27",
"score": "0.5439231",
"text": "def get_distance (current_location, location_to_visit)\n return $distance_hash[current_location.to_s + \",\" + location_to_visit.to_s]\nend",
"title": ""
},
{
"docid": "91d8a044c30be6b8ba7deccff2972a8f",
"score": "0.5436675",
"text": "def calculate_eta_to_doctor(doctor_id)\n duration = nil\n km = nil\n counting_doctor = Doctor.find_by_id(doctor_id)\n\n origin = counting_doctor.address\n return nil if origin.nil?\n\n destinations = self.address\n\n distance_record = GoogleDistanceRecord.where(origin: origin, destination: destinations, transportation: 'transit').first\n\n if distance_record.present?\n if !distance_record.no_result\n duration = distance_record.duration\n end\n else\n\n result = TransitMode.call_transit(origin, destinations, 'transit')\n\n if result[0] && !result[0][:no_result]\n mm, ss = result[0][:durations].divmod(60)\n duration = (ss >= 30) ? (mm + 1).to_i : mm.to_i\n km = result[0][:km].to_f\n GoogleDistanceRecord.create(origin: origin, destination: destinations, transportation: 'transit', duration: duration, distance: km)\n else\n GoogleDistanceRecord.create(origin: origin, destination: destinations, transportation: 'transit', no_result: true)\n end\n end\n\n duration\n end",
"title": ""
},
{
"docid": "1b1fa93b4226907d7a78f98fdf609443",
"score": "0.5430082",
"text": "def get_locations_weather(location)\n Barometer.new(location).measure\nend",
"title": ""
},
{
"docid": "28751fb21373fd9b91c3a1c240d0989a",
"score": "0.54259616",
"text": "def time_all(start_time)\n current_time = start_time\n sum = 0\n @stations.each_with_index do |station, idx|\n step_time = time_at_step(idx, current_time)\n transfer_time = transfer_at_step(idx, current_time)\n current_time += step_time + transfer_time\n sum += step_time + transfer_time\n end\n sum\n end",
"title": ""
},
{
"docid": "9395428ec944c2eb3e48a6af5e7fbfbb",
"score": "0.5423256",
"text": "def calculate_sum\n sum = 0\n total_lateness = 0\n max_lateness = 0 \n completion = 0\n @sorted_joblist.each_with_index do |job, idx|\n completion += job[1]\n sum += job[0] * completion\n l = completion - job[0]\n l = 0 if l < 0\n max_lateness = l if l > max_lateness\n total_lateness += l\n # puts \"# #{idx + 1} - length: #{job[1]}, deadline: #{job[0]}, completion: #{completion}, l: #{l}\"\n end\n return { total_completion_time: sum, max_lateness: max_lateness, total_lateness: total_lateness }\n end",
"title": ""
},
{
"docid": "bd5e376ddface72c759d01cab47414ee",
"score": "0.5422487",
"text": "def total_distance\n distances = rides.map {|ride| ride.distance}\n # binding.pry\n distances.sum\n end",
"title": ""
},
{
"docid": "2305ed90685408c6e27d0386bec44749",
"score": "0.5416882",
"text": "def getForecastFromHourly(yymmddhh)\n @calledJSON[\"hourly\"].each.with_index do |hour, index|\n if yymmddhh == convertJST(hour[\"dt\"]).slice(0...8)\n windSpeeds = []\n windDirections = [] #first and last\n precipitation = []\n humidity = []\n weatherDescriptions = [] #first and last\n\n for i in index...index + 6\n if @calledJSON[\"hourly\"][i].nil?\n break\n end\n\n windSpeeds.push(msToKph(@calledJSON[\"hourly\"][i][\"wind_speed\"]))\n windDirections.push(@calledJSON[\"hourly\"][i][\"wind_deg\"])\n humidity.push(@calledJSON[\"hourly\"][i][\"humidity\"])\n precipitation.push(@calledJSON[\"hourly\"][i][\"pop\"])\n weatherDescriptions.push(@calledJSON[\"hourly\"][i][\"weather\"][0][\"description\"])\n end\n\n windAvg = (avgOfArray(windSpeeds)).round(0)\n windDirFirstLast = [\n windDegToCardinal(Integer(windDirections[0])),\n windDegToCardinal(Integer(windDirections[windDirections.length - 1]))]\n precipitationAvg = avgOfArray(precipitation)\n humidityAvg = avgOfArray(humidity)\n weatherDescrFirstLast = [weatherDescriptions[0], weatherDescriptions[weatherDescriptions.length - 1]]\n\n return {\n \"forecastSource\" => \"hourly\",\n \"windAvg\" => windAvg, \"windDirFirstLast\" => windDirFirstLast,\n \"precipChanceAvg\" => precipitationAvg, \"humidityAvg\" => humidityAvg,\n \"weatherDescrFirstLast\" => weatherDescrFirstLast\n }\n end # if hour is found\n end #look in each hourly entry\n # if yymmddhh not found\n return nil\n end",
"title": ""
},
{
"docid": "5a419cb5b228dff2090dd006d495a7cd",
"score": "0.54137135",
"text": "def waypoint_longitude\n self.class.degrees_minutes_to_decimal(@fields[8], @fields[9])\n end",
"title": ""
},
{
"docid": "0d534a559d6e299314bd6edf896fb0c1",
"score": "0.5412647",
"text": "def weather_duration\n getWeatherDuration\n end",
"title": ""
},
{
"docid": "24e23acd6c4618445453a1e9caa9be7a",
"score": "0.5410543",
"text": "def get_data(rides)\n\t\tdata = [0, 0, 0, 0]\n\t\trides.each do |ride|\n\t\t\tmiles = ride.distance.to_f*0.000621 \n data[0] += miles\n if ride.commute\n data[1] += miles\n end\n if miles > data[2]\n data[2] = miles\n data[3] = GlobalData.format_name(ride.name)\n end\n end\n return data\n end",
"title": ""
},
{
"docid": "341a564ed32801d68b9f9ffcd85b7f0f",
"score": "0.54076564",
"text": "def test_status\n\n params1 = {:origin => \"La Jolla,CA\",:destination => \"Riverside CA\" }\n params2 = {:origin => nil,:destination => nil }\n params3 = {:origin => \"La Jolla,CA\",:destination => nil }\n params4 = {:origin => nil,:destination => \"Riverside CA\" }\n params5 = {:origin => nil, :destination=> \"\" }\n params6 = {:origin => \"\",:destination => nil }\n params7 = {:origin => \"\",:destination => \"\" }\n params8 = {:origin => \"Argentina\",:destination => \"Riverside CA\" }\n params9 = {:origin => \"joacobkjaods\",:destination => \"Rfsdajklaos\" }\n params10 = {:origin => \"La Jolla,CA\",:destination => \"sdafjkldsajis\" }\n params11 = {:origin => \"fdsjakl324k2ldls\",:destination => \"sdaffds\" }\n params12 = {:origin => \"fdsjakl324k2ldls\",:destination => \"sdaffds\" }\n params13 = {:origin => \"FLOOOR NOO\",:destination => \"MAKA MAKA POOK\" }\n params14 = {:origin => \"KOONNOONI KOOWOWOWO\",:destination => \"La Jolla CA 92092\" }\n params15 = {:origin => \"La JOLLA CA 92092\",:destination => \"konoisisa\" }\n\n json1 = GoogleMaps.get_directions_json(params1)\n json2 = GoogleMaps.get_directions_json(params2)\n json3 = GoogleMaps.get_directions_json(params3)\n json4 = GoogleMaps.get_directions_json(params4)\n json5 = GoogleMaps.get_directions_json(params5)\n json6 = GoogleMaps.get_directions_json(params6)\n json7 = GoogleMaps.get_directions_json(params7)\n json8 = GoogleMaps.get_directions_json(params8)\n json9 = GoogleMaps.get_directions_json(params9)\n json10 = GoogleMaps.get_directions_json(params10)\n json11 = GoogleMaps.get_directions_json(params11)\n json12 = GoogleMaps.get_directions_json(params12)\n json13 = GoogleMaps.get_directions_json(params13)\n json14 = GoogleMaps.get_directions_json(params14)\n json15 = GoogleMaps.get_directions_json(params15)\n\n status1 = GoogleMaps.get_status(json1)\n status2 = GoogleMaps.get_status(json2)\n status3 = GoogleMaps.get_status(json3)\n status4 = GoogleMaps.get_status(json4)\n status5 = GoogleMaps.get_status(json5)\n status6 = GoogleMaps.get_status(json6)\n status7 = GoogleMaps.get_status(json7)\n status8 = GoogleMaps.get_status(json8)\n status9 = GoogleMaps.get_status(json9)\n status10 = GoogleMaps.get_status(json10)\n status11 = GoogleMaps.get_status(json11)\n status12 = GoogleMaps.get_status(json12)\n status13 = GoogleMaps.get_status(json13)\n status14 = GoogleMaps.get_status(json14)\n status15 = GoogleMaps.get_status(json15)\n\n assert_equal(100, status1, \"Status 1 does not match result\")\n assert_equal(104, status2, \"Status 2 does not match result\")\n assert_equal(100, status3, \"Status 3 does not match result\")\n assert_equal(100, status4, \"Status 4 does not match result\")\n assert_equal(104, status5, \"Status 5 does not match result\")\n assert_equal(104, status6, \"Status 6 does not match result\")\n assert_equal(104, status7, \"Status 7 does not match result\")\n assert_equal(102, status8, \"Status 8 does not match result\")\n assert_equal(101, status9, \"Status 9 does not match result\")\n assert_equal(101, status10, \"Status 10 does not match result\")\n assert_equal(101, status11, \"Status 11 does not match result\")\n assert_equal(101, status12, \"Status 12 does not match result\")\n assert_equal(101, status13, \"Status 13 does not match result\")\n assert_equal(101, status14, \"Status 14 does not match result\")\n assert_equal(101, status15, \"Status 15 does not match result\")\n \n end",
"title": ""
},
{
"docid": "e1045f83d5d8995546c2ad3bf2e419ff",
"score": "0.540715",
"text": "def total_time\r\n self.measurement.total_time\r\n end",
"title": ""
},
{
"docid": "998542233869587e9452f0f6608f0051",
"score": "0.5400607",
"text": "def stats\n @stats = {\n total_distance: RunningEvent.sum(:distance),\n total_time: RunningEvent.sum(:finish_time),\n average_speed: (RunningEvent.sum(:finish_time).to_f / 60) / (RunningEvent.sum(:distance).to_f / 1000)\n }\n\n respond_to do |format|\n format.html # stats.html.erb\n format.json { render json: @stats, callback: params[:callback] }\n format.xml { render xml: @stats }\n end\n end",
"title": ""
},
{
"docid": "ee65ebc0c2b1351ef029c8d0be00ca62",
"score": "0.5398874",
"text": "def test_directions_for_start_end_lat_lon\n # Step 1\n params = {\n 'start_lat' => 34.155,\n 'start_lon' => -118.255,\n 'end_lat' => 34.16,\n 'end_lon' => -118.42\n }\n\n get '/directions', params\n assert_response(@response, :success)\n assert_has_keys(@parsed_response, DIRECTIONS_KEYS[:main])\n @parsed_response['Itinerary'].each do |itinerary|\n assert_has_keys(itinerary, DIRECTIONS_KEYS[:itinerary])\n end\n\n total_distance = get_total_distance(@parsed_response['Itinerary'])\n refute_nil(@parsed_response['TotalDistance'], @parsed_response)\n assert_in_epsilon(total_distance, @parsed_response['TotalDistance'], 0.001, @parsed_response)\n refute_nil(@parsed_response['TotalDrivingTime'], @parsed_response)\n assert(@parsed_response['TotalDrivingTime'] > 0, @parsed_response)\n end",
"title": ""
},
{
"docid": "557a9c7c8805eb528382be9fdae278b1",
"score": "0.5398752",
"text": "def calculate_total_distance\n self.points.furtherest.first.distance if self.points.furtherest and self.points.furtherest.first and self.points.furtherest.first.speed\n end",
"title": ""
},
{
"docid": "0e6affcb9a5050b6337b0cead487d740",
"score": "0.53985167",
"text": "def google_distance_duration(origin, mode)\n # Query Google Directions API\n params = { origin: origin, destination: \"#{DESTINATION_LAT},#{DESTINATION_LON}\", mode: mode, sensor: \"false\" }\n results = JSON.parse(HTTParty.get(GOOGLE_DIRECTIONS_API_URL, query: params).body)\n\n # Parse JSON output to get distance and duration\n route = results[\"routes\"][0]\n\n distance = route.nil? ? \"n/a\" : route[\"legs\"][0][\"distance\"][\"value\"]\n duration = route.nil? ? \"n/a\" : route[\"legs\"][0][\"duration\"][\"value\"]/60\n\n return [distance, duration]\nend",
"title": ""
},
{
"docid": "ac3f5e1962face731e241cb1bc1badd6",
"score": "0.53977823",
"text": "def total_time\n total_times.reduce(0.0, :+)\n end",
"title": ""
},
{
"docid": "830847284b32201143a5dfac8f756d7b",
"score": "0.53958476",
"text": "def makeRoute(path, userId)\n # path = \"/Users/aliashafi/Documents/AppAcademy/Projects/summit/db/gpx/Morning_Ride_1.gpx\"\n doc = Nokogiri::XML(open(path))\n gpx = GPX::GPXFile.new(:gpx_file => path)\n\n lon = doc.xpath('//xmlns:trkpt/@lon').map{|pt| pt.to_s.to_f}\n lat = doc.xpath('//xmlns:trkpt/@lat').map{|pt| pt.to_s.to_f}\n\n work_type = doc.xpath('//xmlns:type/text()').map{|pt| pt.to_s}\n\n route = {}\n (0..lat.length).each do |c|\n route[c] = [lon[c],lat[c]]\n end\n route = route.to_json\n\n ele = doc.xpath('//xmlns:ele/text()').map{|pt| pt.to_s.to_f}\n ele = ele.to_json\n title = doc.xpath('//xmlns:name/text()').map{|pt| pt.to_s}\n \n all_time = doc.xpath('//xmlns:time/text()').map{|pt| pt.to_s}\n all_time = all_time.to_json\n\n workout_type = \"\"\n if work_type[0] == \"9\"\n workout_type = \"Run\"\n elsif work_type[0] == \"1\"\n workout_type = \"Bike\"\n end\n\n p workout_type\n\n\n duration = gpx.duration()\n distance = gpx.distance(opts = { :units => 'miles' })\n average_speed = gpx.average_speed()\n # time = gpx.time()\n Workout.create!(\n \"athlete_id\": userId,\n # \"workout_type\": workout_type,\n \"title\": title[0],\n \"description\": \"So fun\",\n \"elapsed_time\": duration,\n \"coordinates\": route,\n # \"elevation\": ele, \n \"distance\": distance,\n \"average_speed\": average_speed,\n # \"time\": time,\n # \"time_stamps\": all_time\n )\nend",
"title": ""
},
{
"docid": "b3459a8630276d9a502ec725b5ee1326",
"score": "0.53942496",
"text": "def today_closest\r\n date_range_object = params[:date_range_object_milli]\r\n lat_lng_object = params[:lat_lng]\r\n branch = params[:branch]\r\n start_milli = date_range_object[:start_date]\r\n end_milli = date_range_object[:end_date]\r\n lat = lat_lng_object[:lat]\r\n lng = lat_lng_object[:lng]\r\n \r\n p start_milli\r\n p end_milli\r\n p lat\r\n p lng\r\n p branch\r\n\r\n best_trips = getClosestTrips(start_milli, end_milli, lat, lng, branch)\r\n render json: best_trips.to_json()\r\nend",
"title": ""
},
{
"docid": "8cfecba0ed34dc471670b733d8f0e564",
"score": "0.5389233",
"text": "def get_route_distance(metro_list)\n distance_sum = 0\n metro_list.each_cons(2) do |metro1, metro2|\n distance_sum += @map.get_route(metro1, metro2)\n end\n return distance_sum\n end",
"title": ""
}
] |
7dd4dcaa2dc9a8c09c4f297120316d97 | POST /assignments POST /assignments.json | [
{
"docid": "f70c773d3c406ba83be07d0b52cc718d",
"score": "0.6649831",
"text": "def create\n respond_to do |format|\n if @assignment.save\n format.html { redirect_to @assignment, :notice => 'Assignment was successfully created.' }\n format.json { render :json => @assignment, :status => :created, :location => @assignment }\n else\n format.html { render :action => 'new' }\n format.json { render :json => @assignment.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] | [
{
"docid": "6036033b73732a6b5794f660654178da",
"score": "0.69726187",
"text": "def create\n @assignment = Assignment.new(assignment_params)\n @assignment.creator_id = current_user.id\n\n # THIS IS ONLY FOR CREATING ASSIGNMENT FOR THE VERY FIRST TIME\n # if users wants to add more users to this, edit should be used and user_assignment_controller for it\n respond_to do |format|\n if @assignment.save\n current_user.assignments << @assignment\n @assignment.update_attribute(:is_done, false)\n @assignment.user_assignments.first.update_attribute(:assignment_id, @assignment.id) # for each?\n format.html { redirect_to current_user, notice: 'Assignment was successfully created.' }\n format.json { render :show, status: :created, location: @assignment }\n else\n format.html { redirect_to :back }\n format.json { render json: @assignment.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9806a7017b589f806669fe126a17549e",
"score": "0.6878969",
"text": "def create_assignment(name)\n @url = \"http://#{$canvas_host}/api/v1/courses/#{$canvas_course_id}/assignments\"\n puts \"@url is #{@url}\"\n\n @payload={'assignment': { \n 'name': name,\n 'points_possible': '0',\n 'grading_type': 'pass_fail',\n 'published': 'true',\n 'submission_types': [ \"none\" ]\n }\n }\n\n @postResponse = HTTParty.post(@url, :body => @payload.to_json, :headers => $header )\n puts(\" POST to create assignment has Response.code #{@postResponse.code} and postResponse is #{@postRepsone}\")\nend",
"title": ""
},
{
"docid": "13d796f9aed39825250edb33a307c7e5",
"score": "0.6873396",
"text": "def create\n @assignment = @user.assignments.new(params[:assignment])\n\n respond_to do |format|\n if @assignment.save\n flash[:notice] = 'Committee assignment was successfully created'\n format.html { redirect_to user_assignments_path(@user) }\n format.xml { render :xml => @assignment, :status => :created, :location => @assignment }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @assignment.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e51326282069149461ecbd785eaaa490",
"score": "0.68665",
"text": "def create\n @assignment = Assignment.new(params[:assignment])\n\n respond_to do |format|\n if @assignment.save\n format.html { redirect_to @assignment, :notice => 'Assignment was successfully created.' }\n format.json { render :json => @assignment, :status => :created, :location => @assignment }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @assignment.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "eb11d280984b5088ad96724047cd729e",
"score": "0.68642163",
"text": "def create\n @assigned = Assigned.new(params[:assigned])\n\n respond_to do |format|\n if @assigned.save\n format.html { redirect_to @assigned, notice: 'Assigned was successfully created.' }\n format.json { render json: @assigned, status: :created, location: @assigned }\n else\n format.html { render action: \"new\" }\n format.json { render json: @assigned.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5aefa1975fba9c6b12e3a01372e056cc",
"score": "0.6848696",
"text": "def create\n unless current_user.assignments.find_by(id: params[:assignment_id])\n render json: format_errors({ assignment_id: [\"is not one of current user's assignments\"] }),\n status: :forbidden\n return\n end\n\n @iteration = Iteration.create(iteration_params)\n\n if @iteration.save\n render json: @iteration, status: :created\n else\n render json: format_errors(@iteration.errors),\n status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "415a5729df0fbcd97ac76a336d6275b2",
"score": "0.68248916",
"text": "def create\n @assignment = Assignment.new(assignment_params)\n @users = User.all\n @resources = Resource.all\n\n respond_to do |format|\n if @assignment.save\n format.html { redirect_to @assignment, notice: 'Assignment was successfully created.' }\n format.json { render :show, status: :created, location: @assignment }\n else\n format.html { render :new }\n format.json { render json: @assignment.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "bd0527949396490e749130cd88ebe7db",
"score": "0.6803875",
"text": "def create\n @assignment = Assignment.new(params[:assignment])\n\n respond_to do |format|\n if @assignment.save\n format.html { redirect_to @assignment, notice: 'Assignment was successfully created.' }\n format.json { render json: @assignment, status: :created, location: @assignment }\n else\n format.html { render action: \"new\" }\n format.json { render json: @assignment.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6807dc93649ea7924323ab11dabc7a22",
"score": "0.6741763",
"text": "def create\n @assignment = Assignment.new(assignment_params)\n\n respond_to do |format|\n if @assignment.save\n format.html { redirect_to @assignment, notice: 'Assignment was successfully created.' }\n format.json { render :show, status: :created, location: @assignment }\n else\n format.html { render :new }\n format.json { render json: @assignment.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ceb342af7abe77281a12a6590f47944d",
"score": "0.67301804",
"text": "def create\n authorize! :create, Assignment\n @assignment = Assignment.new(assignment_params)\n @assignment.task = @task\n # @assignment.creator = current_user\n # @task.work = @work\n\n respond_to do |format|\n if @assignment.save!\n format.html { redirect_to project_task_assignments_path(@project,@task), notice: 'Assignment was successfully created.' }\n format.json { render action: 'show', status: :created, location: project_task_assignments_url(@project,@task) }\n else\n set_users\n @url = project_task_assignments_path(@project,@task)\n format.html { render action: 'new' }\n format.json { render json: @assignment.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "95ee2c9fa4f139d7c44f5edc498d6ba7",
"score": "0.6641556",
"text": "def create\n @assignment = current_user.created_assignments.create(assignment_params)\n @assignment.subtasks.create(params[:assignment][:subtask])\n respond_to do |format|\n if @assignment.save\n AssignmentsWorker.delay.perform(current_user.id)\n format.html { redirect_to @assignment, notice: 'Assignment was successfully created.' }\n format.json { render json: @assignment, status: :created, location: @assignment }\n else\n format.html { render action: \"new\" }\n format.json { render json: @assignment.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d2b754844f3985675286f8e554439a4e",
"score": "0.6603716",
"text": "def create\n @assignment = Assignment.new(assignment_params)\n\n respond_to do |format|\n if @assignment.save\n format.html {redirect_to @assignment, notice: 'Assignment was successfully created.'}\n format.json {render :show, status: :created, location: @assignment}\n else\n format.html {render :new}\n format.json {render json: @assignment.errors, status: :unprocessable_entity}\n end\n end\n end",
"title": ""
},
{
"docid": "ef500a372061282b638f619935d4272f",
"score": "0.6591036",
"text": "def create\n @assignment = Assignment.new(assignment_params.merge(lecturer_id: current_user.id))\n\n if @assignment.save\n if params[:projects_attributes]\n render json: @assignment,\n serializer: Includes::AssignmentSerializer,\n include: 'projects',\n status: :created\n else\n render json: @assignment, status: :created\n end\n else\n render json: format_errors(@assignment.errors),\n status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "c9e6320ea919f54f55df793791725d47",
"score": "0.6521116",
"text": "def create\n @assignment = Assignment.new(assignment_params)\n @labs = Lab.all\n\n respond_to do |format|\n if @assignment.save\n format.html { redirect_to @assignment, notice: 'Assignment was successfully created.' }\n format.json { render :show, status: :created, location: @assignment }\n else\n format.html { render :new }\n format.json { render json: @assignment.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d9bc3cb56df9d5bf06e7c32f599482cd",
"score": "0.6484802",
"text": "def create\n @user_assignment = UserAssignment.new(user_assignment_params)\n\n respond_to do |format|\n if @user_assignment.save\n format.html { redirect_to @user_assignment, notice: 'User assignment was successfully created.' }\n format.json { render :show, status: :created, location: @user_assignment }\n else\n format.html { render :new }\n format.json { render json: @user_assignment.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8e0657091601651fddee71462c526e19",
"score": "0.6479285",
"text": "def create\n @task_assignment = TaskAssignment.new(task_assignment_params)\n\n respond_to do |format|\n if @task_assignment.save\n format.html { redirect_to @task_assignment, notice: 'Task assignment was successfully created.' }\n format.json { render :show, status: :created, location: @task_assignment }\n else\n format.html { render :new }\n format.json { render json: @task_assignment.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8cd6bc760e013d006cc735b4c83d4404",
"score": "0.6473712",
"text": "def create\n @assignment = Assignment.new(assignment_params)\n authorize @assignment\n\n respond_to do |format|\n if @assignment.save\n format.html { redirect_to @assignment, notice: t(:success, :model => Assignment.model_name.human) }\n format.json { render :show, status: :created, location: @assignment }\n else\n format.html { render :new }\n format.json { render json: @assignment.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "efed41b2d0124c1cfcbe3d33fb504a9b",
"score": "0.64724755",
"text": "def create\n # existing = Assignment.where(classroom_id: params[:classroom_id], repo_url: params[:repo_url])\n # if !existing.first.nil?\n # return error_as_json(\"Assignment #{params[:repo_url]} already exists for classroom #{params[:classroom_id]}\")\n # end\n @assignment = Assignment.new(assignment_params)\n @assignment.save ? info_as_json(\"Created assignment #{@assignment.name}\") : error_as_json(@assignment.errors)\n end",
"title": ""
},
{
"docid": "c5f18757efbf4bda2f972ed84c1d952e",
"score": "0.6468092",
"text": "def create\n @roles_assignment = RolesAssignment.new(roles_assignment_params)\n\n respond_to do |format|\n if @roles_assignment.save\n format.html { redirect_to @roles_assignment, notice: 'Roles assignment was successfully created.' }\n format.json { render :show, status: :created, location: @roles_assignment }\n else\n format.html { render :new }\n format.json { render json: @roles_assignment.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a3e39d7564ce01bb6d5737ec2fb22da0",
"score": "0.6444612",
"text": "def save_assignments\n csids = self.assigned_to_ids\n klass = self.is_annotation? ? 'Annotation' : self.class.name\n unless csids.nil?\n new_ids = csids.to_s.split(',').map(&:to_i)\n current_ids = self.reload.assignments.map(&:user_id)\n to_create = new_ids - current_ids\n to_delete = current_ids - new_ids\n to_delete.each do |id|\n Assignment.where(assigned_type: klass, assigned_id: self.id, user_id: id).last.destroy!\n end\n to_create.each do |id|\n Assignment.create!(assigned_type: klass, assigned_id: self.id, user_id: id, message: self.assignment_message)\n end\n # Save the assignment details to send them as Slack notifications\n self.instance_variable_set(\"@assignment\", { to_create: to_create, to_delete: to_delete }) unless to_delete.blank? and to_create.blank?\n end\n end",
"title": ""
},
{
"docid": "27c20d3eb72f6ffdf94001e8013d814b",
"score": "0.6439201",
"text": "def new\n @task = Task.new\n 3.times{@task.assignments.build}\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @task }\n end\n end",
"title": ""
},
{
"docid": "b2af80b8fcf8309d01821676c13ca455",
"score": "0.6410707",
"text": "def create\n @task = Task.find(params[:task_id])\n @assignment = @task.assignments.build(params[:assignment])\n\n respond_to do |format|\n if @assignment.save\n flash[:notice] = 'The assignment was successfully created.'\n format.html { redirect_to project_task_path(@task.project, @task)}\n format.xml { render :xml => @assignment, :status => :created, :location => @assignment }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @assignment.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "599f18c26aacd9fcd8d550b8cdfd5c22",
"score": "0.6398163",
"text": "def create\n @user_assignment = UserAssignment.new(user_assignment_params)\n\n respond_to do |format|\n if @user_assignment.save\n format.html { redirect_to current_user, notice: 'Worker was successfully added' }\n format.json { render :show, status: :created, location: @user_assignment.assignment }\n\n else\n format.html { render :new }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n\n end",
"title": ""
},
{
"docid": "003d31b1d004b2f80da1b26c8652805c",
"score": "0.6395715",
"text": "def assignment_params\n params.require(:assignment).permit(:name, :due_at, :activity_id, :category_id, :status, :is_completed, user_ids: [])\n end",
"title": ""
},
{
"docid": "42e3c72eb7d89ee0aa9f497812b39960",
"score": "0.63562524",
"text": "def create\n @task = Task.new(params[:task])\n respond_to do |format|\n if @task.save\n @del = Delegation.find_by_user_id(params[:user][:id])\n @task.assignments.each do|a|\n a.update_attribute(:delegation_id,@del.id) unless @del.nil?\n end\n format.html { redirect_to @task, notice: 'Task was successfully created.' }\n format.json { render json: @task, status: :created, location: @task }\n else\n format.html { render action: \"new\" }\n format.json { render json: @task.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8b85755f407f4cc7e744c9637120590a",
"score": "0.63427454",
"text": "def create\n @organization = Organization.new(organization_params)\n @organization.assignments << Assignment.new({user: current_user, organization: @organization, is_admin: true, is_active: true})\n\n respond_to do |format|\n if @organization.save\n format.html { redirect_to @organization, notice: 'Organization was successfully created.' }\n format.json { render :show, status: :created, location: @organization }\n else\n format.html { render :new }\n format.json { render json: @organization.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c6bc55a556b78a2b02c840aca7a00790",
"score": "0.6339331",
"text": "def create\n @assignment_special_assignment = Assignment::SpecialAssignment.new(params[:assignment_special_assignment])\n\n respond_to do |format|\n if @assignment_special_assignment.save\n format.html { redirect_to @assignment_special_assignment, notice: 'Special assignment was successfully created.' }\n format.json { render json: @assignment_special_assignment, status: :created, location: @assignment_special_assignment }\n else\n format.html { render action: \"new\" }\n format.json { render json: @assignment_special_assignment.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ea09dcf7280a650319238ca0cea24eea",
"score": "0.63351816",
"text": "def new\n @assignment = @course.assignments.build\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @assignment }\n end\n end",
"title": ""
},
{
"docid": "f5dbdd1b60b14edfff268988fcbcea25",
"score": "0.63301736",
"text": "def assignment_params\n params.require(:assignment).permit(:name, :is_done, :deadline, :group_id, user_assignments_attributes: [:user_id])\n end",
"title": ""
},
{
"docid": "e254aef1c948232ee2cf7aaf5ba24c4f",
"score": "0.6325315",
"text": "def create\n @submission = Submission.new(:student_id => current_student.id, :assignment_id => params[:assignment_id])\n\n respond_to do |format|\n if @submission.save\n @assignment = @submission.assignment\n @assignment.questions.each do |question| \n answer = SubmittedAnswer.new(:submission_id => @submission.id, :question_id => question.id)\n answer.save\n end\n format.html { redirect_to edit_submission_path(@submission), notice: 'Submission was successfully created.' }\n format.json { render json: @submission, status: :created, location: @submission }\n else\n format.html { render action: \"new\" }\n format.json { render json: @submission.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8df8d9590820778318d63c2e6ff4aac7",
"score": "0.6314427",
"text": "def create\n @group = Group.find(params[:group_id])\n @assignment = @group.assignments.build(params[:assignment])\n\n respond_to do |format|\n if @assignment.save\n format.html { redirect_to [:teacher, @group], notice: 'Assignment was successfully created.' }\n format.json { render json: @assignment, status: :created, location: @assignment }\n else\n format.html { render action: \"new\" }\n format.json { render json: @assignment.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "fbc7a2445bf5a38abaf61bdd8e31d7a6",
"score": "0.6295529",
"text": "def create\n params[:assignment].delete(:employee)\n @assignment = Assignment.new(params[:assignment])\n @assignment.start_date = Chronic.parse(params[:assignment][:start_date])\n @assignment.end_date = Chronic.parse(params[:assignment][:end_date])\n\n respond_to do |format|\n if @assignment.save\n format.html { redirect_to @assignment, notice: 'Assignment was successfully created.' }\n format.json { render json: @assignment, status: :created, location: @assignment }\n else\n format.html { render action: \"new\" }\n format.json { render json: @assignment.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e8835356c93bb0e1f06bdb63c994e4ea",
"score": "0.6272393",
"text": "def assignment_params\n params.require(:assignment).permit(:name, :start_date, :end_date, :point, :course_instance_id, :status, :max_attempt)\n end",
"title": ""
},
{
"docid": "c93e93a457c132c24225390e42a9883a",
"score": "0.62663615",
"text": "def assignment_params\n params.require(:assignment).permit(:name, :start_date, :end_date, :rating, :type, :course_id, :questions => [])\n end",
"title": ""
},
{
"docid": "6c03e863d645faf569368c0173a664c5",
"score": "0.62276554",
"text": "def create\n @patient_assignment = PatientAssignment.new(params[:patient_assignment])\n\n respond_to do |format|\n if @patient_assignment.save\n format.html { redirect_to @patient_assignment, notice: 'Patient assignment was successfully created.' }\n format.json { render json: @patient_assignment, status: :created, location: @patient_assignment }\n else\n format.html { render action: \"new\" }\n format.json { render json: @patient_assignment.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d203dce515de930ecb4b43cb887ac2c6",
"score": "0.62209934",
"text": "def assignment_params\n params.require(:assignment).permit(:inspector_id, :inspection_id, :scheduled_for)\n end",
"title": ""
},
{
"docid": "8dd45c2fdce634fc246a1a6ca4be5889",
"score": "0.6219565",
"text": "def create\n @student_assignment = StudentAssignment.new(student_assignment_params)\n\n respond_to do |format|\n if @student_assignment.save\n format.html { redirect_to @student_assignment, notice: 'Student assignment was successfully created.' }\n format.json { render :show, status: :created, location: @student_assignment }\n else\n format.html { render :new }\n format.json { render json: @student_assignment.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ad7dbd56a903346aaad8210daba4f213",
"score": "0.6212147",
"text": "def create\n @solution = Solution.new(solution_params)\n @solution.user_id = current_user.id\n @assignment = Assignment.find(params[:assignment_id])\n respond_to do |format|\n if @solution.save\n format.html { redirect_to @solution, notice: 'Solution was successfully created.' }\n format.json { render :show, status: :created, location: @solution }\n else\n format.html { render :new }\n format.json { render json: @solution.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2395b2f508588218b8400955a570ab55",
"score": "0.6208454",
"text": "def create\n @techers_assignment = TechersAssignment.new(techers_assignment_params)\n\n respond_to do |format|\n if @techers_assignment.save\n format.html { redirect_to @techers_assignment, notice: 'Techers assignment was successfully created.' }\n format.json { render :show, status: :created, location: @techers_assignment }\n else\n format.html { render :new }\n format.json { render json: @techers_assignment.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "40e623d6f71da2b7823a85d767424156",
"score": "0.61804503",
"text": "def create\n @assignment = Assignment.new(params[:assignment].merge(:course_id => params[:course_id]))\n\n respond_to do |format|\n if @assignment.save\n format.html { redirect_to(course_assignment_path(:course_id => params[:course_id], :id => @assignment.id), :notice => 'Assignment was successfully created.') }\n format.xml { render :xml => @assignment, :status => :created, :location => @assignment }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @assignment.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c58646e1418cbab621e25f3091f5c589",
"score": "0.6175752",
"text": "def make_assignments(assigned_questions)\n assigned_questions.each do |question|\n existing_assignment = Assignment.find_by_user_id_and_question_id(self.id,question.id)\n if existing_assignment == nil\n Assignment.create(:question_id => question.id , :user_id => self.id)\n end\n end\n end",
"title": ""
},
{
"docid": "841247bbe8557ae6af692888e20779d5",
"score": "0.61656255",
"text": "def new\n @assignment = @user.assignments.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @assignment }\n end\n end",
"title": ""
},
{
"docid": "a83bd1ff7b04fa24ea3a1f9ce1d39d6e",
"score": "0.61626995",
"text": "def index\n render json: { assignments: [ @assignment.as_json ] }\n end",
"title": ""
},
{
"docid": "8dd2c1723ee9b95ae3d13edc2260a21f",
"score": "0.61268026",
"text": "def create\n @exceller_assignment = ExcellerAssignment.new(exceller_assignment_params)\n\n respond_to do |format|\n if @exceller_assignment.save\n format.html { redirect_to @exceller_assignment, notice: 'Exceller assignment was successfully created.' }\n format.json { render :show, status: :created, location: @exceller_assignment }\n else\n format.html { render :new }\n format.json { render json: @exceller_assignment.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9881bf83e0deaab9d6cd690878cdc1d3",
"score": "0.6126603",
"text": "def create\n @task_assignment = TaskAssignment.new(params[:task_assignment])\n \n respond_to do |format|\n if @task_assignment.save\n format.html { redirect_to(@task_assignment, :notice => 'Task assignment was successfully created.') }\n format.xml { render :xml => @task_assignment, :status => :created, :location => @task_assignment }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @task_assignment.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "81b3d65a219cb5a9ed45fad2f2adde27",
"score": "0.6120948",
"text": "def new\n @assigned = Assigned.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @assigned }\n end\n end",
"title": ""
},
{
"docid": "905dbdf04b00f1a570a0eecb0b70bdf3",
"score": "0.61185336",
"text": "def assignment_params\n params.require(:assignment).permit(:description, :name)\n end",
"title": ""
},
{
"docid": "27093a109b2f1927b58db10feb552f84",
"score": "0.61169344",
"text": "def create\n @event_assignment = EventAssignment.new(event_assignment_params)\n\n respond_to do |format|\n if @event_assignment.save\n format.html { redirect_to @event_assignment, notice: 'Event assignment was successfully created.' }\n format.json { render :show, status: :created, location: @event_assignment }\n else\n format.html { render :new }\n format.json { render json: @event_assignment.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0227ad7d43cec22608ce1308f9651a28",
"score": "0.6106352",
"text": "def index\n @assignments = Assignment.all\n end",
"title": ""
},
{
"docid": "0227ad7d43cec22608ce1308f9651a28",
"score": "0.6106352",
"text": "def index\n @assignments = Assignment.all\n end",
"title": ""
},
{
"docid": "0227ad7d43cec22608ce1308f9651a28",
"score": "0.6106352",
"text": "def index\n @assignments = Assignment.all\n end",
"title": ""
},
{
"docid": "0227ad7d43cec22608ce1308f9651a28",
"score": "0.6106352",
"text": "def index\n @assignments = Assignment.all\n end",
"title": ""
},
{
"docid": "64d807b018072f7c124c52ff722c09a9",
"score": "0.60794425",
"text": "def create\n # raise params.inspect\n @assignment = Assignment.new(assignment_params)\n @assignment.course = Course.find(params[:course_id])\n @assignment.user=current_user\n respond_to do |format|\n if @assignment.save\n format.html { redirect_to @assignment, notice: 'Assignment was successfully created.' }\n format.json { render action: 'show', status: :created, location: @assignment }\n else\n format.html { render action: 'new' }\n format.json { render json: @assignment.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3676e32bc80fba7f4f3c8de303926eac",
"score": "0.6074945",
"text": "def assignment_params\n params.require(:assignment).permit(:name, :teacher_id, :date, grades_attributes:\n [:id, :assignment_id, :student_id, :score, :_destroy])\n end",
"title": ""
},
{
"docid": "5ae2dbb767edb838148f198d6c38b870",
"score": "0.6071649",
"text": "def create\n @assignment = Assignment.new(params[:assignment])\n @assignment.notification_type = params[:notification_type].to_s\n @assignment.user = User.find(current_user)\n @courses = Course.where(:user_id => @assignment.user)\n \n respond_to do |format|\n if @assignment.save\n format.html { redirect_to @assignment, notice: 'Assignment was successfully created.' }\n format.json { render json: @assignment, status: :created, location: @assignment }\n else\n format.html { render action: \"new\" }\n format.json { render json: @assignment.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c51a301fbbe6f213b83de3e555276bf1",
"score": "0.6068171",
"text": "def assignment_params\n params.require(:assignment).permit(:no, :reference, :text, :status_id, :duedate, :user_id, :comment, :community_id, :assignment_status_id, :close_date)\n end",
"title": ""
},
{
"docid": "85d5b73a9ff4da50644fd9f420d1056a",
"score": "0.6062156",
"text": "def new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @assignment }\n end\n end",
"title": ""
},
{
"docid": "3abbd7dd5400e852307c6bb3db1e50e2",
"score": "0.6060276",
"text": "def index\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @assignments }\n end\n end",
"title": ""
},
{
"docid": "2fd25b232a5670956a543a925d839781",
"score": "0.6059282",
"text": "def assignment_params\n params.require(:assignment).permit(:game_id, :employee_id, :role)\n end",
"title": ""
},
{
"docid": "2aa98058e8366c2b089a1af9bd3809fc",
"score": "0.6053189",
"text": "def create\n\t\t@activities = params[:guest][:activity_ids]\n assignment = Assignment.new(params[:guest_id], params[:activity_id])\n\n @activities.each do |a|\n if a != \"\"\n @assignment = Assignment.create(:guest_id => params[:assignments][:guest_id], :activity_id => a)\n # assigned_activity = Assignment.create(:guest_id => params[:guest_id], :activity_id => params[:activity_id])\n end\n end\n\n if @assignment.save\n flash[:notice] = \"Activity assigned.\"\n redirect_to guests_path\n else \n @message = \"Activity not assigned.\"\n end\n\n # redirect_to guests_path\n end",
"title": ""
},
{
"docid": "00d90cd4e5c7235c7623c9d83586be86",
"score": "0.60506326",
"text": "def as_json(assignments)\n assignments.map {|assignment| serialize_assignment(assignment) }\n end",
"title": ""
},
{
"docid": "640026fbad5d353f5169bf03e5b6377d",
"score": "0.6049477",
"text": "def create\n\t\t#render plain: params[:assignment].inspect\n\t\t@assignment = Assignment.new(assignment_params)\n\n#Save assignment if requirements met, else refresh the page.\n\t\tif (@assignment.save)\n\t\t\tredirect_to @assignment\n\t\telse\n\t\t\trender 'new'\n\t\tend \n\tend",
"title": ""
},
{
"docid": "573655177fceebe3af30d18bbbf7ec4d",
"score": "0.60411555",
"text": "def create\n AssignmentNotifier.create(@assignment)\n end",
"title": ""
},
{
"docid": "48152d7818b3d3d2f31956903449f52b",
"score": "0.60392135",
"text": "def create\n @case_assignment = CaseAssignment.new(case_assignment_params)\n\n respond_to do |format|\n if @case_assignment.save\n format.html { redirect_to @case_assignment, notice: 'Case assignment was successfully created.' }\n format.json { render :show, status: :created, location: @case_assignment }\n else\n format.html { render :new }\n format.json { render json: @case_assignment.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "873c10de77f7fc1801fa337c2127abd6",
"score": "0.6028656",
"text": "def assignment\n # Create assignment\n Relationship.create(assignment_parameters)\n \n # Get human readable assignment values\n @assignment_parts = assign_parts(params)\n end",
"title": ""
},
{
"docid": "80d7435ff45c53a51f2530c1c2427d89",
"score": "0.6021736",
"text": "def create_permission_set_assignment(id:, **args)\n params = parameters(args) do\n required_params :user_id\n optional_params :user_id\n end\n request(:post, \"permissionSets/#{id}/assignments\", params)\n end",
"title": ""
},
{
"docid": "a1a3a17b3eaa3269745a18535f4e3cf8",
"score": "0.60216916",
"text": "def create\n @assignment = Assignment.new(assignment_params)\n\n if @assignment.save\n redirect_to @teacher_index_path, notice: 'Assignment was successfully created.'\n else\n render :new\n end\n end",
"title": ""
},
{
"docid": "75e830430d3987aca7b089ecc94a86d6",
"score": "0.60200983",
"text": "def assignments=(value)\n @assignments = value\n end",
"title": ""
},
{
"docid": "75e830430d3987aca7b089ecc94a86d6",
"score": "0.60200983",
"text": "def assignments=(value)\n @assignments = value\n end",
"title": ""
},
{
"docid": "75e830430d3987aca7b089ecc94a86d6",
"score": "0.60200983",
"text": "def assignments=(value)\n @assignments = value\n end",
"title": ""
},
{
"docid": "75e830430d3987aca7b089ecc94a86d6",
"score": "0.60200983",
"text": "def assignments=(value)\n @assignments = value\n end",
"title": ""
},
{
"docid": "75e830430d3987aca7b089ecc94a86d6",
"score": "0.60200983",
"text": "def assignments=(value)\n @assignments = value\n end",
"title": ""
},
{
"docid": "9a21e0e1961d1b0d37a0f59807b4c3ef",
"score": "0.60086304",
"text": "def create\n @assignment = Assignment.new(assignment_params)\n respond_to do |format|\n @assignment.user_mengajukan = current_user.id\n if @assignment.save\n @get = Assignment.last\n format.html { redirect_to detail_assignments_path(@get.id), notice: 'Assignment was successfully created.' }\n format.json { render :show, status: :created, location: @assignment }\n else\n format.html { render :new }\n format.json { render json: @assignment.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "72191f5d2664d42c57ceef25b818d839",
"score": "0.6007349",
"text": "def assigned_params\n params.require(:assigned).permit(:grantor, :grantee, :relation, :can_grant)\n end",
"title": ""
},
{
"docid": "d13177d62bd21faa4b91e6bf5a5eb8dd",
"score": "0.6004977",
"text": "def create\n @ingredient_assignment = IngredientAssignment.new(params[:ingredient_assignment])\n\n respond_to do |format|\n if @ingredient_assignment.save\n format.html { redirect_to @ingredient_assignment, notice: 'Ingredient assignment was successfully created.' }\n format.json { render json: @ingredient_assignment, status: :created, location: @ingredient_assignment }\n else\n format.html { render action: \"new\" }\n format.json { render json: @ingredient_assignment.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "22c57846e574150217007a6cb0bd9b0a",
"score": "0.60045",
"text": "def create\n @activity_participant_assignment = ActivityParticipantAssignment.new(activity_participant_assignment_params)\n\n respond_to do |format|\n if @activity_participant_assignment.save\n format.html { redirect_to @activity_participant_assignment, notice: 'Activity participant assignment was successfully created.' }\n format.json { render :show, status: :created, location: @activity_participant_assignment }\n else\n format.html { render :new }\n format.json { render json: @activity_participant_assignment.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "df742fa23b62bec3bbdc9533f9327a1b",
"score": "0.60017353",
"text": "def create\n @assignment_standard_assignment = Assignment::StandardAssignment.new(params[:assignment_standard_assignment])\n\n respond_to do |format|\n if @assignment_standard_assignment.save\n format.html { redirect_to @assignment_standard_assignment, notice: 'Standard assignment was successfully created.' }\n format.json { render json: @assignment_standard_assignment, status: :created, location: @assignment_standard_assignment }\n else\n format.html { render action: \"new\" }\n format.json { render json: @assignment_standard_assignment.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7054f159ecb38a489a6171f9674c951e",
"score": "0.597795",
"text": "def create\n @assignment = @course.assignments.new(params[:assignment])\n @assignment.save\n @outline = Outline.where(\"course_id = ?\", @course.id).all\n @outline.empty? ? i = 1 : i = @outline.sort_by {|x| x.order_number}.last.order_number += 1\n @content = Outline.new(:course_id => @course.id, :content_type => 'Assignment', :order_number => i, :content_id => @assignment.id)\n @content.save\n @users = User.enrolled(@course)\n @users.each do |u|\n @enrollment = Enrollment.where(:user_id => u.id, :course_id => @course.id).first\n Homework.create(:enrollment_id => @enrollment.id, :assignment_id => @assignment.id, :user_id => u.id)\n end\n \n respond_to do |format|\n if @assignment.save\n format.html { redirect_to edit_course_path(@course), notice: 'Assignment was successfully created.' }\n else\n format.html { render action: \"new\" }\n end\n end\n end",
"title": ""
},
{
"docid": "673fe781af4a5ab8836cd3bc49c02fc9",
"score": "0.5977271",
"text": "def create\n @group_assignment = GroupAssignment.new(group_assignment_params)\n\n respond_to do |format|\n if @group_assignment.save\n format.html { redirect_to @group_assignment, notice: \"Group assignment was successfully created.\" }\n format.json { render :show, status: :created, location: @group_assignment }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @group_assignment.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "593a229ba1e3caf4daeb36b72c3a29be",
"score": "0.59766454",
"text": "def create\n @group_assignment = GroupAssignment.new(group_assignment_params)\n\n respond_to do |format|\n if @group_assignment.save\n format.html { redirect_to @group_assignment, notice: 'Group assignment was successfully created.' }\n format.json { render :show, status: :created, location: @group_assignment }\n else\n format.html { render :new }\n format.json { render json: @group_assignment.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "65d424f2523e41aeb8e51f5221e1d393",
"score": "0.5976052",
"text": "def create\n @assignment_status = AssignmentStatus.new(params[:assignment_status])\n\n respond_to do |format|\n if @assignment_status.save\n format.html { redirect_to @assignment_status, notice: 'Assignment status was successfully created.' }\n format.json { render json: @assignment_status, status: :created, location: @assignment_status }\n else\n format.html { render action: \"new\" }\n format.json { render json: @assignment_status.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3f5150cd27981ab6d9bef2fd75047af2",
"score": "0.5971194",
"text": "def assignment_params\n params.require(:assignment).permit(:name, :basic_info, :course_id, :due)\n end",
"title": ""
},
{
"docid": "fe1b0746c2d6d45dda859fa6f0bc58c2",
"score": "0.59691507",
"text": "def create\n @assignment = Assignment.new(assignment_params)\n @plan = Plan.find(params[:plan_id])\n @assignment.plan_id = @plan.id\n respond_to do |format|\n if @assignment.save\n format.html { redirect_to plan_path(@plan), notice: 'Assignment was successfully created.' }\n format.json { render :show, status: :created, location: @assignment }\n else\n format.html { render :new }\n format.json { render json: @assignment.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "fb1ffceed236acbaeb0c75bac0dd9bd8",
"score": "0.59687716",
"text": "def create\n @assignment = Assignment.new\n @assignment.build_assignment_stat\n @assignment.build_submission_rule\n @assignment.transaction do\n begin\n @assignment, new_required_files = process_assignment_form(@assignment)\n @assignment.token_start_date = @assignment.due_date\n @assignment.token_period = 1\n rescue Exception, RuntimeError => e\n @assignment.errors.add(:base, e.message)\n new_required_files = false\n end\n unless @assignment.save\n @assignments = Assignment.all\n @sections = Section.all\n @clone_assignments = Assignment.where(vcs_submit: true)\n .order(:id)\n render :new\n return\n end\n if params[:persist_groups_assignment]\n clone_warnings = @assignment.clone_groupings_from(params[:persist_groups_assignment])\n unless clone_warnings.empty?\n clone_warnings.each { |w| flash_message(:warning, w) }\n end\n end\n if @assignment.save\n flash_message(:success, I18n.t('assignment.create_success'))\n end\n if new_required_files && !MarkusConfigurator.markus_config_repository_hooks.empty?\n # update list of required files in all repos only if there is a hook that will use that list\n UpdateRepoRequiredFilesJob.perform_later(current_user)\n end\n end\n redirect_to action: 'edit', id: @assignment.id\n end",
"title": ""
},
{
"docid": "31ac4833b85bc1cec3e3f5bc7b65f160",
"score": "0.5962483",
"text": "def new\n if !current_user.instructor?(@course)\n return\n end\n\n @assignment = Assignment.new\n @assignment.name = \"New Assignment\"\n @assignment.reviews_required = 4\n\n if @course.get_students.length <= 4\n @assignment.reviews_required = @course.get_students.length - 1\n end\n\n if @assignment.reviews_required <= 0\n @assignment.reviews_required = 0\n end\n\n @assignment.manual_assignment = true\n @assignment.draft = true\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @assignment }\n end\n end",
"title": ""
},
{
"docid": "335f102aea8d5d68733a1215b95f8fb2",
"score": "0.59591824",
"text": "def assignment_params\n params.require(:assignment).permit(:number)\n end",
"title": ""
},
{
"docid": "41f08374080e65724923bab24207f8e6",
"score": "0.5948137",
"text": "def assignments\n\t\t@course = Course.find(params[:id])\n\t\t\n\t\trespond_to do |format|\n\t\t\tformat.json\n\t\tend\n\tend",
"title": ""
},
{
"docid": "e15e22feddf17d9ef56349b247c04053",
"score": "0.59273404",
"text": "def index\n @assignments = Assignment.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @assignments }\n end\n end",
"title": ""
},
{
"docid": "2143f1c485fa8e043d04efa4b4489898",
"score": "0.5922588",
"text": "def create\n\t\t@assignment = Assignment.new(params[:assignment])\n\t\t@course = @assignment.course\n\t\t\n\t\t# Check permissions\n\t\tif (not @current_user.courses.include?(@course)) && (not @current_user.is_administrator?)\n\t\t\tredirect_to root_path, notice: \"Access Denied\"\n\t\t\treturn\n\t\tend\n\t\t\n\t\trespond_to do |format|\n\t\t\tif @assignment.save\n\t\t\t\tLogsController.createAssignment(@current_user, @assignment)\n\n\t\t\t\tformat.html { redirect_to course_path(@course), :flash => {:success => \"Assignment was successfully created.\"}}\n\t\t\telse\n\t\t\t\t@assignment_types = @course.assignment_types\n\t\t\t\tformat.html { render action: \"new\" }\n\t\t\tend\n\t\tend\n\tend",
"title": ""
},
{
"docid": "70af1b07f631ce6cd65922e2c2af667f",
"score": "0.5916729",
"text": "def assignment_params\n params.require(:assignment).permit(:assignment_id, :assignment_name, :details, :priority, :date_created, :date_due, :is_complete, :grade_received, :select_course)\n end",
"title": ""
},
{
"docid": "e003b43f817e97071c793e4440c598a0",
"score": "0.5912691",
"text": "def new\n @assignment = Assignment.new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @assignment }\n end\n end",
"title": ""
},
{
"docid": "1c3f223b3e98b16dadce139f0aa5dcd2",
"score": "0.59099215",
"text": "def goto_assignments\n goto_controller('Assignments')\n end",
"title": ""
},
{
"docid": "455a7c076af952decd2e5d9d64ab9ab7",
"score": "0.590758",
"text": "def create\n # transform dates from string to DateTime\n params[:assignment].strptime_params! ['due', 'late']\n \n files = params[:assignment][:files]\n\n # remove extra params\n params[:assignment].select!{ |key, val| not ['files'].include? key }\n\n # save any added files\n @assignment = Assignment.new(params[:assignment])\n \n respond_to do |format|\n if @assignment.save\n # add assignment to related section\n @section.assignments << @assignment\n @section.save\n format.html { redirect_to section_assignment_path(@section, @assignment), notice: 'Assignment was successfully created.' }\n format.json { render json: @assignment, status: :created, location: @assignment }\n else\n format.html { render action: \"new\" }\n format.json { render json: @assignment.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "11c8e25a33c00d72c22b779548fd6d6e",
"score": "0.5895897",
"text": "def index\n\t\t@assignments = Assignment.all\n\n\t\trespond_to do |format|\n\t\t\tformat.html # index.html.erb\n\t\t\tformat.json { render json: @assignments }\n\t\tend\n\tend",
"title": ""
},
{
"docid": "4899169b92b1971c61a2c1bf4aa15bd5",
"score": "0.589394",
"text": "def post\n frm.button(:value=>\"Post\").click\n AssignmentsList.new(@browser)\n end",
"title": ""
},
{
"docid": "8545d84abb0c1bd3b73da2a514484b5a",
"score": "0.5890113",
"text": "def create\n unless current_user.instructor?(@course)\n return\n end\n if params[:assignment][:submission_due_date].blank? or params[:assignment][:review_due_date].blank?\n flash[:error] = 'Please fill in dates.'\n redirect_to :back\n return\n end\n\n\n if params['assignment']['submission_due_time(4i)']\n params['assignment']['submission_due_time'] = params['assignment']['submission_due_time(4i)'] + ':' + params['assignment']['submission_due_time(5i)']\n params['assignment'].delete 'submission_due_time(1i)'\n params['assignment'].delete 'submission_due_time(5i)'\n params['assignment'].delete 'submission_due_time(2i)'\n params['assignment'].delete 'submission_due_time(3i)'\n params['assignment'].delete 'submission_due_time(4i)'\n params['assignment'].delete 'submission_due_time(5i)'\n end\n\n if params['assignment']['review_due_time(4i)']\n params['assignment']['review_due_time'] = params['assignment']['review_due_time(4i)'] + ':' + params['assignment']['review_due_time(5i)']\n params['assignment'].delete 'review_due_time(1i)'\n params['assignment'].delete 'review_due_time(5i)'\n params['assignment'].delete 'review_due_time(2i)'\n params['assignment'].delete 'review_due_time(3i)'\n params['assignment'].delete 'review_due_time(4i)'\n params['assignment'].delete 'review_due_time(5i)'\n end\n\n @assignment = Assignment.new(params[:assignment])\n @assignment.course_id = @course.id\n @assignment.draft = true\n\n respond_to do |format|\n if @assignment.save\n format.html { redirect_to [@course, @assignment] }\n format.json { render json: @assignment, status: :created, location: @assignment }\n else\n format.html { render action: \"new\" }\n format.json { render json: @assignment.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4ca32075254765cb52483a56a4a23767",
"score": "0.58880514",
"text": "def new\n @assignment = Assignment.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @assignment }\n end\n end",
"title": ""
},
{
"docid": "4ca32075254765cb52483a56a4a23767",
"score": "0.58880514",
"text": "def new\n @assignment = Assignment.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @assignment }\n end\n end",
"title": ""
},
{
"docid": "a2266a644b82ccc93ee22d40b435128b",
"score": "0.5886589",
"text": "def create_assignments\n self.assignments.each do |a|\n #want to keep the history of responses even if the question no longer applies.\n #it could be that the question was answered in a prior rotation.\n a.destroy unless a.responded\n end\n assigned_users = User.scoped\n assigned_users =assigned_users.where(:rotation => self.rotation)unless rotation == nil\n assigned_users =assigned_users.where(:year => self.year) unless year == nil\n make_assignments(assigned_users)\n clear_old_assignments\n end",
"title": ""
},
{
"docid": "e6112e4cd1d966d7ee9c89c4f00840c9",
"score": "0.5881373",
"text": "def new\n @task = Task.find(params[:task_id])\n @project = @task.project\n @assignment = @task.assignments.build\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @assignment }\n end\n end",
"title": ""
}
] |
bd4cf333ee35bb4dd18a348402b1c15b | Define a pluralization exception. ==== Parameters singular:: singular form of the word plural:: plural form of the word | [
{
"docid": "9e6e951840d2549c915e2a931a79bff0",
"score": "0.62609106",
"text": "def plural_word(singular, plural)\n @plural_of[singular] = plural\n @plural_of[singular.capitalize] = plural.capitalize\n end",
"title": ""
}
] | [
{
"docid": "abdb6a516f9ec7670aaea96f7f8457d6",
"score": "0.6980499",
"text": "def pluralize\n self[-1] == 's' ? \"#{self}es\" : \"#{self}s\"\n end",
"title": ""
},
{
"docid": "8a0ba4ced60536b8af493ba20f0dadee",
"score": "0.6857458",
"text": "def pluralize(singularStr, num)\n if num == 1\n return singularStr\n else\n if singularStr[-1] == \"s\" # singularStr[-1] returns last character of string\n return \"#{singularStr}es\"\n else\n return \"#{singularStr}s\"\n end\n end\n end",
"title": ""
},
{
"docid": "a231c5a551dc07c6ea061af7a911d8b0",
"score": "0.6795783",
"text": "def pluralize( name )\n warn_nyi( \"support for pluralization guides in pluralize()\" )\n return name.pluralize\n end",
"title": ""
},
{
"docid": "1ef82070b98c8e544bfedff5e6921d80",
"score": "0.6755316",
"text": "def test_plural_string\n assert_raises(StandardError) {@p.plural?('1')}\n end",
"title": ""
},
{
"docid": "3a290d982c6ce25ed2c4d6ceb1eab934",
"score": "0.67421454",
"text": "def pluralize(word); end",
"title": ""
},
{
"docid": "c8ac5ed5ff27637bca4b16ffb81a6c51",
"score": "0.67115957",
"text": "def pluralize(count, singular, plural_arg = nil, plural: plural_arg, locale: I18n.locale)\n word = if count == 1 || count.to_s.match?(/^1(\\.0+)?$/)\n singular\n else\n plural || singular.pluralize(locale)\n end\n\n \"#{count || 0} #{word}\"\n end",
"title": ""
},
{
"docid": "4e110fde7bf84db97d2943dec071078e",
"score": "0.670238",
"text": "def pluralize(count, singular, plural)\n word = count == 1 ? singular : plural\n \"#{count || 0} #{word}\"\n end",
"title": ""
},
{
"docid": "c2a3a47317cfe7aa688535478b8eaf80",
"score": "0.6644917",
"text": "def pluralize(locale, entry, count); end",
"title": ""
},
{
"docid": "7d3bb56f8bf2314b192e9016212bfd68",
"score": "0.663192",
"text": "def pluralize(count, singular, plural_arg=nil, plural: plural_arg, locale: I18n.locale)\n self.class.pluralize(count, singular, plural_arg, plural: plural, locale: locale)\n end",
"title": ""
},
{
"docid": "cbe0b0acacd841f5927edcef4720fce8",
"score": "0.6629465",
"text": "def pluralize(count, singular, plural_arg = T.unsafe(nil), plural: T.unsafe(nil), locale: T.unsafe(nil)); end",
"title": ""
},
{
"docid": "a0aab316c399fd38b804367a94d9c50e",
"score": "0.66131777",
"text": "def pluralize(count, singular, plural = nil)\n \"#{count} \" + if count == 1\n singular\n elsif plural\n plural\n elsif Object.const_defined?(\"Inflector\")\n Inflector.pluralize(singular)\n else\n singular + \"s\"\n end\n end",
"title": ""
},
{
"docid": "18f3cd02abd64537b89a41dc4326b8cc",
"score": "0.65920204",
"text": "def pluralize(count, word)\n \"#{word}#{'s' unless count.to_i == 1}\"\n end",
"title": ""
},
{
"docid": "81732faffed8b9c93085450619bf67df",
"score": "0.6587405",
"text": "def pluralize amount, singular\n \"#{amount} #{singular}#{amount == 1 ? '' : 's'}\"\n end",
"title": ""
},
{
"docid": "ac7438fda9bfab2c3fdda398729677c9",
"score": "0.65633094",
"text": "def pluralize_word(singular)\n singular.respond_to?(:pluralize) ? singular.pluralize : singular + 's'\n end",
"title": ""
},
{
"docid": "35d461a547f97a9fcca908bcd3d528f3",
"score": "0.6558034",
"text": "def pluralize(count, word)\n \"#{word}#{'s' unless count.to_f == 1}\"\n end",
"title": ""
},
{
"docid": "3a7c2b749a561a71ebf4160b85c51b88",
"score": "0.652882",
"text": "def pluralize_word(count, singular, plural = nil)\n ((count == 1 || count == '1') ? singular : (plural || singular.pluralize))\n end",
"title": ""
},
{
"docid": "dae9a78d6ba2eae8dd95c44a7592b868",
"score": "0.6510964",
"text": "def default_pluralizer(count)\n count == 1 ? :one : :other\n end",
"title": ""
},
{
"docid": "4c5a395db56637e0f6ebc97b01d26757",
"score": "0.6461134",
"text": "def pluralize(count, singular, plural)\n word = count == 1 ? singular : plural\n \"#{count || 0} #{word}\"\nend",
"title": ""
},
{
"docid": "bd98b17eb6a62c2e9c0a1f7727847488",
"score": "0.6452102",
"text": "def pluralize(word, nb)\n if (nb > 1)\n return \"#{word}s\"\n else\n return \"#{word}\"\n end\nend",
"title": ""
},
{
"docid": "4098653b349c78330b242c196d2e94e6",
"score": "0.6433439",
"text": "def pluralizer num,name\n \n if num >= 2\n p \"#{num} #{name}s.\"\n else\n p \"1 #{name}.\"\n end\nend",
"title": ""
},
{
"docid": "6fbdd0e96dd74d145be25223dfd4a896",
"score": "0.6420235",
"text": "def pluralize(count)\n if custom?\n # todo: make a search from the custom inflector, if doesn't match, simply fallback to @name\n # something like OurInflector.pluralize(@name) || @name\n return @custom_name\n else\n (count == 1 || count =~ /^1([\\.,]0+)?$/) ? \n I18n.t(\"units.#{@yaml}\", :count => 1) : I18n.t(\"units.#{@yaml}\", :count => count)\n end\n end",
"title": ""
},
{
"docid": "4bc617076bb80ce989c3876cd26efac1",
"score": "0.6419562",
"text": "def pluralize(l_string) #count, singular, plural = nil)\n # map the arguments like in the original pluralize method\n count, singular, plural = l_string.split(',').map{ |arg| arg.strip}\n\n \"#{count} \" + if count == 1 || count == '1'\n singular\n elsif plural\n plural\n elsif Object.const_defined?(\"Inflector\")\n Inflector.pluralize(singular)\n else\n singular + \"s\"\n end\n end",
"title": ""
},
{
"docid": "19f0da96989382bace18dc4266bf8b0d",
"score": "0.6409291",
"text": "def plural(*args)\n TextHelper.pluralize(*args)\n end",
"title": ""
},
{
"docid": "d4302cb6df7d32cddbe81a5ccf9b6eaf",
"score": "0.6405463",
"text": "def plural\n\t\tEndings.each { |k, v|\n\t\t\tif name =~ '(.*)' + k + '$'\n\t\t\t\treturn $1.to_s + v\n\t\t\tend\n\t\t}\n\t\treturn \"#{name}s\"\n\tend",
"title": ""
},
{
"docid": "0bfbfafd5e6cbae1b1a2c570659a3a2d",
"score": "0.64025354",
"text": "def pluralize(word)\n result = word.to_s.dup\n\n if word.empty? || inflections.uncountables.include?(result.downcase)\n result\n else\n inflections.plurals.each do |(rule, replacement)| \n break if result.gsub!(rule, replacement)\n end\n result\n end\n end",
"title": ""
},
{
"docid": "18d4e443dcd8984766d61c994ca3c5f8",
"score": "0.6402296",
"text": "def plural(word)\n # special exceptions\n return \"\" if word == \"\"\n if result = plural_of[word]\n return result.dup\n end\n result = word.dup\n regex, hash = pluralization_rules\n result.sub!(regex) {|m| hash[m]}\n plural_of[word] = result\n return result\n end",
"title": ""
},
{
"docid": "0d23a582bb36959cf846600a9eff2d6e",
"score": "0.63998467",
"text": "def pluralize(num, item)\n if item == :warning && num != 1\n \"#{num} Warnings\"\n else\n \"#{num} #{item.capitalize}\"\n end\n end",
"title": ""
},
{
"docid": "40f0df4f40f9204b515e19e172b285d8",
"score": "0.6387321",
"text": "def pluralize(text)\n \"#{text.to_s}s\"\n end",
"title": ""
},
{
"docid": "ac07031be1aa0b3cef43cd0c67af381a",
"score": "0.6381976",
"text": "def pluralize(n, singular, plural=nil)\n if n == 1 \n \"1 #{singular}\"\n elsif plural\n \"#{n} #{plural}\"\n else\n \"#{n} #{singular}s\"\n end\n end",
"title": ""
},
{
"docid": "7a9cc137782e06bbd721c49b5fa48b90",
"score": "0.635197",
"text": "def pluralizer number,noun\n if number <= 0\n \"No #{noun}\"\n elsif number == 1\n \"#{number} #{noun}\" \n else\n \"#{number} #{noun}s\"\n end\nend",
"title": ""
},
{
"docid": "868af58e606e903c2da8dceb29d77e99",
"score": "0.6346136",
"text": "def pluralizer num, noun\n if num != 1\n \"#{num} #{noun}s\"\n else \"#{num} #{noun}\"\n end\nend",
"title": ""
},
{
"docid": "ea47f36a62e396d5bf0087677fcd5b4b",
"score": "0.63416076",
"text": "def pluralize(count, singular, plural = nil)\n \"#{count || 0} \" + ((count == 1 || count == '1') ? singular : (plural || singular.pluralize))\n end",
"title": ""
},
{
"docid": "ea47f36a62e396d5bf0087677fcd5b4b",
"score": "0.63416076",
"text": "def pluralize(count, singular, plural = nil)\n \"#{count || 0} \" + ((count == 1 || count == '1') ? singular : (plural || singular.pluralize))\n end",
"title": ""
},
{
"docid": "fc4395a5c8c91df070d9772388f1dfa8",
"score": "0.6327379",
"text": "def pluralize(count, singular, plural = nil)\n \"#{count || 0} \" + (count == 1 ? singular : (plural || singular.pluralize))\n end",
"title": ""
},
{
"docid": "d1113ecbfd479142f9a8c58fea954aba",
"score": "0.63235617",
"text": "def pluralize\n p = self[ :plural ]\n p = ! scalar? if p.nil?\n p = 's' if p == false\n p = 'p' if p == true\n p.to_s\n end",
"title": ""
},
{
"docid": "6d4306e16ebe55e3fbebaf4ac059b0b6",
"score": "0.6315678",
"text": "def format_error_message( msg, count = nil, singular = nil, *rest )\n return super unless msg.is_a?( Symbol ) and r18n\n if limit = count and singular\n limit = t.form_input.units[ singular, count ].to_s\n end\n text = t.form_input.errors[ msg, *limit, self ].to_s\n super( text )\n end",
"title": ""
},
{
"docid": "2fef05d2b3917f2d54054454b60fb53e",
"score": "0.6311842",
"text": "def pluralizer(noun, num)\n if num > 1\n \"#{num} #{noun}s\"\n elsif num === 1\n \"#{num} #{noun}\"\n elsif num === 0\n \"zero #{noun}s\"\n else\n \"Please enter a whole number\"\n end\nend",
"title": ""
},
{
"docid": "2fef05d2b3917f2d54054454b60fb53e",
"score": "0.6311842",
"text": "def pluralizer(noun, num)\n if num > 1\n \"#{num} #{noun}s\"\n elsif num === 1\n \"#{num} #{noun}\"\n elsif num === 0\n \"zero #{noun}s\"\n else\n \"Please enter a whole number\"\n end\nend",
"title": ""
},
{
"docid": "83ec487e59c3e6286d9beb0329f588c2",
"score": "0.6309288",
"text": "def pluralize(number, text)\n if number != 1\n return number, text + \"s\"\n else\n return number, text\n \n end\n \nend",
"title": ""
},
{
"docid": "309bba3d1cc23042e2d9b41c217e2a1d",
"score": "0.6299302",
"text": "def pluralizer num, noun\n if num == 1\n \"#{num} #{noun}\"\n else\n \"#{num} #{noun}s\"\n end\nend",
"title": ""
},
{
"docid": "436318685328a4635a57d95de7480d88",
"score": "0.6297634",
"text": "def pluralize\n @name.pluralize\n end",
"title": ""
},
{
"docid": "57e40a87139a47ff88b1695b425c4189",
"score": "0.6266911",
"text": "def declension(singular, plural, count)\n count == 1 ? singular : plural\n end",
"title": ""
},
{
"docid": "680b9f45643ef0437885df7cc45bd219",
"score": "0.6254408",
"text": "def test_pluralize_one\n assert_equal \"book\", @d.pluralize(\"book\", 1)\n end",
"title": ""
},
{
"docid": "e925cde38f2d37e8bdbc81c4aba20495",
"score": "0.6248686",
"text": "def pluralize\n self.class.new Inflector.pluralize(self)\n end",
"title": ""
},
{
"docid": "e925cde38f2d37e8bdbc81c4aba20495",
"score": "0.6248686",
"text": "def pluralize\n self.class.new Inflector.pluralize(self)\n end",
"title": ""
},
{
"docid": "0f984595b45cfe7dc70bf2fb1ec9cc6a",
"score": "0.6239431",
"text": "def pluralize_with_count( count=2 )\n count > 1 ? pluralize_without_count : singularize\n end",
"title": ""
},
{
"docid": "18d3458392fa63adf976bb913a2739e8",
"score": "0.6221018",
"text": "def plural(input)\n input.dup.en.plural\n end",
"title": ""
},
{
"docid": "2455c5790064b22ea81f20053d03ed77",
"score": "0.62085503",
"text": "def pluralizer string, n\n if n == 1 \n puts \"#{n} #{string}\"\n elsif n > 1 || n==0\n puts \"#{n} #{string}s\"\n end\nend",
"title": ""
},
{
"docid": "b105f844f10f3e596e0e474234e4fbca",
"score": "0.6191975",
"text": "def pluralize(word)\n result = word.to_s.dup\n\n if word.empty? || inflections.uncountables.include?(result.downcase)\n result\n else\n inflections.plurals.each { |(rule, replacement)| break if result.gsub!(rule, replacement) }\n result\n end\n end",
"title": ""
},
{
"docid": "b105f844f10f3e596e0e474234e4fbca",
"score": "0.6191975",
"text": "def pluralize(word)\n result = word.to_s.dup\n\n if word.empty? || inflections.uncountables.include?(result.downcase)\n result\n else\n inflections.plurals.each { |(rule, replacement)| break if result.gsub!(rule, replacement) }\n result\n end\n end",
"title": ""
},
{
"docid": "f7fd8a7003423b0fef97aab2339007d7",
"score": "0.6181003",
"text": "def pluralize(word)\n return word + \"s\" if pluralize?\n word\nend",
"title": ""
},
{
"docid": "23fae57793b5fbe026f9882315ead0cc",
"score": "0.6178451",
"text": "def plural\n return word if word.to_s.empty?\n\n find_match(Inflection.configuration.plurals[:noun]) ||\n (uncountable? && word) || find_match(Nouns.plurals) || word\n end",
"title": ""
},
{
"docid": "947560c44f76a0de8223ce4e4e2b1985",
"score": "0.61678135",
"text": "def declension(singular, plural, count)\n if count == 1\n singular\n else\n plural\n end\n end",
"title": ""
},
{
"docid": "65310e28182aa686d2561a6dd72bafd5",
"score": "0.6156595",
"text": "def pluralize(word, locale = :en)\n Geode::FastInflector.pluralize(word, locale)\n end",
"title": ""
},
{
"docid": "d8e07b85489357aaf4cda6cf13705eae",
"score": "0.6151077",
"text": "def pluralize_unit_with_locale(count, unit, locale)\n singular = locale.t(:\"units.#{unit}\")\n unit_word = count == 1 ? singular : singular.pluralize\n locale.t(:template, count: count, unit: unit_word)\n end",
"title": ""
},
{
"docid": "988d0cbed28ffaebceafc59ed19e4e48",
"score": "0.61501765",
"text": "def name_plural() name_singular + 's' end",
"title": ""
},
{
"docid": "c4feb3c4f114c4b8d2e2cd71ef42a826",
"score": "0.61445427",
"text": "def plural(rule, replacement)\n @uncountables.delete(rule) if rule.is_a?(String)\n @uncountables.delete(replacement)\n @plurals.prepend([rule, replacement])\n end",
"title": ""
},
{
"docid": "c4feb3c4f114c4b8d2e2cd71ef42a826",
"score": "0.61445427",
"text": "def plural(rule, replacement)\n @uncountables.delete(rule) if rule.is_a?(String)\n @uncountables.delete(replacement)\n @plurals.prepend([rule, replacement])\n end",
"title": ""
},
{
"docid": "b57bcdcd149053ae6b9852220413c433",
"score": "0.612957",
"text": "def test_generate_message_too_short_with_default_message_plural\n assert_equal \"is too short (minimum is 10 characters)\", @person.errors.generate_message(:title, :too_short, count: 10)\n end",
"title": ""
},
{
"docid": "ac8f9c0a96849f47292f0a3c0cffda82",
"score": "0.6125436",
"text": "def plural(rule, replacement)\n @uncountables.delete(rule) if rule.is_a?(String)\n @uncountables.delete(replacement)\n @plurals.insert(0, [rule, replacement])\n end",
"title": ""
},
{
"docid": "ac8f9c0a96849f47292f0a3c0cffda82",
"score": "0.6125436",
"text": "def plural(rule, replacement)\n @uncountables.delete(rule) if rule.is_a?(String)\n @uncountables.delete(replacement)\n @plurals.insert(0, [rule, replacement])\n end",
"title": ""
},
{
"docid": "ac8f9c0a96849f47292f0a3c0cffda82",
"score": "0.6125436",
"text": "def plural(rule, replacement)\n @uncountables.delete(rule) if rule.is_a?(String)\n @uncountables.delete(replacement)\n @plurals.insert(0, [rule, replacement])\n end",
"title": ""
},
{
"docid": "eb6d6bb4769895b700d6910e1de90909",
"score": "0.6117896",
"text": "def pluralize(resource)\n resource =~ /^\\w+y$/ ? resource.sub(/y$/, 'ies') : \"#{resource}s\"\n end",
"title": ""
},
{
"docid": "18403298649d8f5e284d14aaa8e4ff85",
"score": "0.6113501",
"text": "def pluralize_collection collection, noun \n if collection.size == 1 \n \"1 #{noun}\"\n else \n \"#{collection.size} #{noun.pluralize}\"\n end\n end",
"title": ""
},
{
"docid": "818d1ee550d0b33ddf3814d6604d021d",
"score": "0.6099797",
"text": "def simple_pluralize count, singular, plural=nil\n ((count == 1 || count =~ /^1(\\.0+)?$/) ? singular : (plural || singular.pluralize))\n end",
"title": ""
},
{
"docid": "ade3c525b3dedac25baf385a67aae608",
"score": "0.6096839",
"text": "def plural(n, item)\n n == 1 ? \"#{n} #{item}\" : \"#{n} #{item}s\"\nend",
"title": ""
},
{
"docid": "524147943be7bd403ad408f2203515d5",
"score": "0.60939646",
"text": "def arabic_pluralize(number, singular, double, plural, gender_class='male')\n one = gender_class == 'male' ? 'واحد' : 'واحدة'\n case number\n when 0 then \"لا #{plural}\"\n when 1 then \"#{singular} #{one}\"\n when 2 then \"#{double}\"\n when 3..10 then \"#{number} #{plural}\"\n else \"#{number} #{singular}\"\n end\n end",
"title": ""
},
{
"docid": "5609a4126f91919955a359c63813ca77",
"score": "0.60920477",
"text": "def plural(num,str)\n\n num_str = number_format(num)\n if num == 1\n return num_str + ' ' + str\n else\n return num_str + ' ' + str.pluralize\n end \n \n end",
"title": ""
},
{
"docid": "1ffc6ecb9dc31a5953cf3de8a5231bff",
"score": "0.6083518",
"text": "def pluralize(count = nil)\n if count == 1\n self\n else\n MotionSupport::Inflector.pluralize(self)\n end\n end",
"title": ""
},
{
"docid": "ba0038863bcf813bcc09fd105468baf6",
"score": "0.6082284",
"text": "def pluralize(n, str)\n \"#{n} #{str + (n == 1 ? \"\" : \"s\")}\"\nend",
"title": ""
},
{
"docid": "ebf89f2e138a281305c5f57c2150f84d",
"score": "0.6080687",
"text": "def plural(int, str)\n return \"#{int} #{str.pluralize}\" unless int == 1\n \"#{int} #{str.singularize}\"\n end",
"title": ""
},
{
"docid": "ebf89f2e138a281305c5f57c2150f84d",
"score": "0.6080181",
"text": "def plural(int, str)\n return \"#{int} #{str.pluralize}\" unless int == 1\n \"#{int} #{str.singularize}\"\n end",
"title": ""
},
{
"docid": "ebf89f2e138a281305c5f57c2150f84d",
"score": "0.6080181",
"text": "def plural(int, str)\n return \"#{int} #{str.pluralize}\" unless int == 1\n \"#{int} #{str.singularize}\"\n end",
"title": ""
},
{
"docid": "ebf89f2e138a281305c5f57c2150f84d",
"score": "0.6080181",
"text": "def plural(int, str)\n return \"#{int} #{str.pluralize}\" unless int == 1\n \"#{int} #{str.singularize}\"\n end",
"title": ""
},
{
"docid": "797e40221fb4a3986b2e337ecd8f0bda",
"score": "0.6055584",
"text": "def plural_adjective( count=2 )\n\t\tphrase = self.to_s\n\t\tmd = /\\A(\\s*)(.+?)(\\s*)\\Z/.match( phrase )\n\t\tpre, word, post = md.captures\n\n\t\treturn phrase if word.nil? or word.empty?\n\n\t\tplural = postprocess( word, pluralize_special_adjective(word, count) || word )\n\n\t\treturn pre + plural + post\n\tend",
"title": ""
},
{
"docid": "e5f201f91f127425168b9021a38b9c6f",
"score": "0.60358393",
"text": "def test_pluralization\r\n GLoc.add_localized_strings :en, :_gloc_rule_default => %[|n| case n; when 0 then '_none'; when 1 then '_single'; else '_many'; end], :a_single => '%d man', :a_many => '%d men', :a_none => 'No men'\r\n GLoc.add_localized_strings :en, :_gloc_rule_asd => %[|n| n<10 ? '_few' : '_heaps'], :a_few => 'a few men (%d)', :a_heaps=> 'soo many men'\r\n set_language :en\r\n\r\n assert_equal 'No men', lwr(:a, 0)\r\n assert_equal '1 man', lwr(:a, 1)\r\n assert_equal '3 men', lwr(:a, 3)\r\n assert_equal '20 men', lwr(:a, 20)\r\n\r\n assert_equal 'a few men (0)', lwr_(:asd, :a, 0)\r\n assert_equal 'a few men (1)', lwr_(:asd, :a, 1)\r\n assert_equal 'a few men (3)', lwr_(:asd, :a, 3)\r\n assert_equal 'soo many men', lwr_(:asd, :a, 12)\r\n assert_equal 'soo many men', lwr_(:asd, :a, 20)\r\n \r\n end",
"title": ""
},
{
"docid": "0d08d0ca54b9624557db8373ed9f7087",
"score": "0.6027238",
"text": "def plural(palavra)\n \"#{palavra}s\"\nend",
"title": ""
},
{
"docid": "060f0d4c93698bbfc702e4640abb2f1f",
"score": "0.6026785",
"text": "def plural_rule(singular, plural)\n @plural_rules << [singular, plural]\n end",
"title": ""
},
{
"docid": "e4561cd138bc690138a755d7befd9af6",
"score": "0.60255337",
"text": "def test_generate_message_too_long_with_default_message_plural\n assert_equal \"is too long (maximum is 10 characters)\", @person.errors.generate_message(:title, :too_long, count: 10)\n end",
"title": ""
},
{
"docid": "7214302f0a8fc9923d6b641a38570177",
"score": "0.6022989",
"text": "def test_generate_message_wrong_length_with_default_message_plural\n assert_equal \"is the wrong length (should be 10 characters)\", @person.errors.generate_message(:title, :wrong_length, count: 10)\n end",
"title": ""
},
{
"docid": "2385e131d6d9f4ae685b3b6c1ff77563",
"score": "0.59992063",
"text": "def plural(n)\n n == 1 ? \"#{n} bottle\" : \"#{n} bottles\"\nend",
"title": ""
},
{
"docid": "4f5b18ab6c0e099b50506911bc2b515c",
"score": "0.59847057",
"text": "def assertPlural( singular, plural, altplural, comment )\n\t\trval, pl_noun, pl_verb, pl, pl_val, altpl_val = [nil] * 6\n\n\t\tisNv = false\n\t\tcase comment\n\t\twhen /verb/i\n\t\t\tisNv = 'verb'\n\t\twhen /noun/i\n\t\t\tisNv = 'noun'\n\t\tend\n\n\t\top = \"Pluralizing '#{singular}': \"\n\t\tassert_nothing_raised( op + \"plural verb\" ) {\n\t\t\tpl_verb = singular.en.plural_verb\n\t\t}\n\t\tassert_nothing_raised( op + \"plural noun\" ) {\n\t\t\tpl_noun = singular.en.plural_noun\n\t\t}\n\t\tassert_nothing_raised( op + \"plural\" ) {\n\t\t\tpl = singular.en.plural\n\t\t}\n\n\t\tif !altplural.nil? && !altplural.empty?\n\t\t\tbegin\n\t\t\t\tassert_nothing_raised( op + \"classical\" ) {\n\t\t\t\t\tLinguistics::classical = true\n\t\t\t\t\taltpl_val = singular.en.plural\n\t\t\t\t}\n\t\t\tensure\n\t\t\t\tLinguistics::classical = false\n\t\t\tend\n\t\tend\n\n\t\tpl_val = isNv ? (isNv == \"noun\" ? pl_noun : pl_verb) : pl\n\n\t\tassert_equal plural, pl_val, \"Plural of '#{singular}'\"\n\t\tassert_equal altplural, altpl_val,\n\t\t\t\"Classical plural of '#{singular}'\" unless\n\t\t\taltplural.nil? or altplural.empty?\n\tend",
"title": ""
},
{
"docid": "7c58bf53dcec976310ae6e631c181d3b",
"score": "0.5971641",
"text": "def plural( count=2 )\n\t\tphrase = if self.respond_to?( :to_int )\n\t\t\t\tself.numwords\n\t\t\telse\n\t\t\t\tself.to_s\n\t\t\tend\n\n\t\tself.log.debug \"Pluralizing %p\" % [ phrase ]\n\t\tpre = text = post = nil\n\n\t\t# If the string has whitespace, only pluralize the middle bit, but\n\t\t# preserve the whitespace to add back to the result.\n\t\tif md = /\\A(\\s*)(.+?)(\\s*)\\Z/.match( phrase.to_s )\n\t\t\tpre, text, post = md.captures\n\t\telse\n\t\t\treturn phrase\n\t\tend\n\n\t\tplural = postprocess( text,\n\t\t\tpluralize_special_adjective(text, count) ||\n\t\t\tpluralize_special_verb(text, count) ||\n\t\t\tpluralize_noun(text, count) )\n\n\t\treturn pre + plural + post\n\tend",
"title": ""
},
{
"docid": "e57e475afb849dba7d4417e8f60f5f45",
"score": "0.5969871",
"text": "def simple_tag_type_pluralizer(s)\n case s\n when /o\\Z/ then s.sub(/o\\Z/, \"es\")\n when /y\\Z/ then s.sub(/y\\Z/, \"ies\")\n when /ss\\Z/ then s.sub(/ss\\Z/, \"sses\")\n else\n \"#{s}s\"\n end\n end",
"title": ""
},
{
"docid": "f8488f4ff11290cf0c4e5bf4b90cfa8f",
"score": "0.59626365",
"text": "def plural_verb( count=2 )\n\t\tphrase = self.to_s\n\t\tmd = /\\A(\\s*)(.+?)(\\s*)\\Z/.match( phrase )\n\t\tpre, word, post = md.captures\n\n\t\treturn phrase if word.nil? or word.empty?\n\n\t\tplural = postprocess( word,\n\t\t\tpluralize_special_verb(word, count) ||\n\t\t\tpluralize_general_verb(word, count) )\n\n\t\treturn pre + plural + post\n\tend",
"title": ""
},
{
"docid": "738e57a9d9e9cdc488af2cae753b114c",
"score": "0.5957845",
"text": "def inflect(word,count)\n if count>1\n word.pluralize\n else\n word\n end\n end",
"title": ""
},
{
"docid": "8255035748a26c234d3ea81e4d56536e",
"score": "0.59448785",
"text": "def pluralize_model(klass, options = {})\n t(\"activerecord.models.#{klass.model_name.i18n_key}\", :count => options[:count] || 2)\n end",
"title": ""
},
{
"docid": "0f1d62675232be60b972c4a1adcfbab7",
"score": "0.5930365",
"text": "def plural?(word)\n word[-1] == 'S' && word[-2] != 'S'\n end",
"title": ""
},
{
"docid": "d4da873d05c3e56a4c0700d383e661a3",
"score": "0.5926421",
"text": "def plural_without_count(count, word)\n count == 1 ? word : word.pluralize\n end",
"title": ""
},
{
"docid": "47dce7c4f1a3c99c6cf2c9f89cd32fca",
"score": "0.5925437",
"text": "def pluralize(locale, entry, count)\n\n # return the entry directly if it is a string\n return entry unless entry.is_a?(Hash)\n\n key = pluralizer(locale).call(count.nil? ? 1 : count)\n # fallback to other if :zero is not set\n key = :other if key == :zero && !entry.has_key?(:zero)\n\n # raise a pluralization error only if count is explicitely set and the entry is not available\n # else return the entry that may be a hash or the translated string\n if entry.has_key?(key)\n translation entry[key], :plural_key => key.to_s\n elsif count\n raise I18n::InvalidPluralizationData.new(entry, count)\n else\n translation entry, :plural_key => nil\n end\n end",
"title": ""
},
{
"docid": "db8a29478a4f1e6c93632924e871aba9",
"score": "0.5923649",
"text": "def pluralizer number,noun\n if number <= 0\n \"No #{noun}\"\n elsif number == 1\n \"#{number} #{noun}\" \n else\n if noun.downcase == 'geese'\n noun = 'goose'\n elsif noun.downcase == 'child'\n noun = 'children'\n elsif noun.downcase == 'person'\n noun = 'people'\n else\n noun = noun.concat('s')\n end\n \"#{number} #{noun}\"\n end\nend",
"title": ""
},
{
"docid": "7a203ac29e7fa7ac5b5f0db91f34e8fc",
"score": "0.5919789",
"text": "def pluralize\n {'win' => 'wins', 'loss' => 'losses', 'fail' => 'fails'}\n end",
"title": ""
},
{
"docid": "ed5ce3f9344f7402d9c2ee7713cb0c5a",
"score": "0.5901435",
"text": "def pluralizer (noun, number)\n if number == 0 || number == 1\n puts \"#{number} #{noun}\"\n elsif number > 1\n puts \"#{number} #{noun}s\"\n else \n puts \"Please enter a valid positive number\"\n end\nend",
"title": ""
},
{
"docid": "0b3cb868bfb1d6f424f95f29bd0d76d1",
"score": "0.5889917",
"text": "def pluralizer (num, noun)\n return \"#{num} #{noun}\" if num == 1\n return \"#{num} geese\" if noun == \"goose\"\n return \"#{num} sheep\" if noun == \"sheep\"\n return \"#{num} #{noun}s\"\nend",
"title": ""
},
{
"docid": "d27d698161dd8ed1d44c991b3f1c580c",
"score": "0.58865565",
"text": "def pluralizer num, noun\n if num != 1\n \"#{num} #{noun}s\"\n elsif num == 1 \n \"#{num} #{noun}\"\n elsif num != 1 && noun == goose\n \"#{num}, geese\"\n end\nend",
"title": ""
},
{
"docid": "d116fab7e7d9ff73d89aa2bcce2ec6dd",
"score": "0.588441",
"text": "def fix_general(msg, plural, singular)\n case value = msg[plural]\n when Hash\n msg[plural] = [value[singular]]\n when Array\n msg[plural] = value.map{|h| h[singular] }\n end\n end",
"title": ""
},
{
"docid": "a0071f283fca75e5da01bc74d503085e",
"score": "0.58817077",
"text": "def pluralizer (num, noun)\n return \"#{num} #{noun}\"\n return \"#{num} geese\" if noun == \"goose\"\n return \"#{num} sheep\" if noun == \"sheep\"\n return \"#{num} #{noun}s\"\nend",
"title": ""
},
{
"docid": "af0bf04ae9b438135a61bd7818bc20ae",
"score": "0.5879673",
"text": "def test_plural_float\n assert_raises(StandardError) {@p.plural?(nil)}\n end",
"title": ""
},
{
"docid": "df32b5540c09df03fc4e8fbaa589bb4b",
"score": "0.5876064",
"text": "def pluralise(number, word)\n return (number > 1)? \"#{number} #{word}s\" : \"#{number} #{word}\"\nend",
"title": ""
},
{
"docid": "48a3abc435fdde11f47192b30a698e5c",
"score": "0.5874672",
"text": "def pluralize(bottles, text)\n return text + 's' if bottles != 1\n text\nend",
"title": ""
}
] |
01c22ac2a0f1e976505f7d1ce830fe19 | Sets network objects in order to connect to the endpoint. | [
{
"docid": "4ac1fed9578dd2e8b394f92d3701896c",
"score": "0.0",
"text": "def set_request(endpoint)\n puts \"\\nSet request to: #{endpoint}\\n\\n\"\n @url = URI(endpoint)\n @http = Net::HTTP.new(@url.host, @url.port)\n @http.use_ssl = true\n @request = Net::HTTP::Get.new(@url)\n end",
"title": ""
}
] | [
{
"docid": "946d26095238735115035d061764a127",
"score": "0.6690845",
"text": "def connect\n networks = @networks.select {|network| not network.connected? }\n \n EventMachine.run do\n networks.each do |network|\n network.delegate = self\n network.connect\n end\n\n EventMachine.error_handler{|e| p e }\n end\n end",
"title": ""
},
{
"docid": "c04c50cf58e9a1e9f1bc4a34c6da1bef",
"score": "0.66343844",
"text": "def set_connections\n set_enumerable_canyon\n set_duck_type_beach\n set_monkey_patch_city\n set_nil_town\n set_matzburg\n set_hash_crossing\n set_dynamic_palisades\n hash\n end",
"title": ""
},
{
"docid": "dacef70e4309e4a8989bff48ed972e46",
"score": "0.64994544",
"text": "def set_vars\n @network = Network.network\n end",
"title": ""
},
{
"docid": "022d4fff93f1e47c2fdf1f4778c85871",
"score": "0.63442594",
"text": "def set_network(uplink_set, network_type, network_uris)\n net_type = network_type == 'Ethernet' ? :EthernetNetwork : :FCNetwork\n net_class = OneviewSDK.resource_named(net_type, login[:api_version], login[:hardware_variant])\n network_uris.each do |network_uri|\n # Added a block to handle network uris in an uplinkset\n if network_uri.to_s[0..6].include?('/rest/')\n net = net_class.new(@client, uri: network_uri)\n raise \"Network in networkUris not found. Uri specified for the network: #{network_uri}\" unless net.retrieve!\n uplink_set.add_network(net)\n next\n end\n net = net_class.new(@client, name: network_uri)\n raise \"Network in networkUris not found. Name specified for the network: #{network_uri}\" unless net.retrieve!\n uplink_set.add_network(net)\n end\n uplink_set\n end",
"title": ""
},
{
"docid": "e9f857c528b202d732194d0fd9d93022",
"score": "0.63343406",
"text": "def setup\n Netgen.log_info(\"netgen: setting up nodes\")\n @nodes.values.each(&:setup)\n Netgen.log_info(\"netgen: creating links\")\n @nodes.values.each do |node|\n node.setup_links(@nodes)\n end\n end",
"title": ""
},
{
"docid": "8bd7e3ae76ac4e63bf632c3a712448d8",
"score": "0.61790687",
"text": "def set_networks\n networks = OneviewSDK.resource_named('EthernetNetwork', api_version)\n network_uri = networks.get_all(@client).first['uri']\n resource['data']['query_parameters']['networks'] = network_uri unless resource['data']['query_parameters']['networks']\n end",
"title": ""
},
{
"docid": "f442c15a907c0771b6faa06c4dc3b01f",
"score": "0.6073738",
"text": "def initialize\n @left_endpoint = Endpoint.new(self)\n @right_endpoint = Endpoint.new(self)\n @left_endpoint.remote = right_endpoint\n @right_endpoint.remote = left_endpoint\n @endpoints = [left_endpoint, right_endpoint]\n end",
"title": ""
},
{
"docid": "656fb5aae8aef0f3b537b072edf9c99a",
"score": "0.60274905",
"text": "def configure\n @network_manager.configure\n end",
"title": ""
},
{
"docid": "47dec25686bfce165282cf3fcb790952",
"score": "0.60067946",
"text": "def network_connections=(value)\n @network_connections = value\n end",
"title": ""
},
{
"docid": "fb07c977fc07a9b2d7b3d87c7e61ff31",
"score": "0.59401155",
"text": "def initialize\n @networks = Array.new\n @eventloop = EventLoop.new self.networks\n end",
"title": ""
},
{
"docid": "f3c85bd6d382023f07b5de0dc5c6eeb8",
"score": "0.58981836",
"text": "def connect_all\n self.class.addresses(@options[:host], @options[:port]).map do |a|\n identity = self.class.identity(a[:host], a[:port])\n BrokerClient.new(identity, a, @serializer, @exception_stats, @non_delivery_stats, @options, nil)\n end\n end",
"title": ""
},
{
"docid": "f542746dbcead92ff5672cfe83756da7",
"score": "0.5891443",
"text": "def set_all_networks_to_work\n @logger.info(\"Setting all networks to 'Work Network'\")\n command = File.read(File.expand_path(\"../scripts/set_work_network.ps1\", __FILE__))\n @communicator.execute(command, { shell: :powershell })\n end",
"title": ""
},
{
"docid": "675907973893465388eb38cd92428fc0",
"score": "0.58651125",
"text": "def set_http(connection)\n workspaces.each do |w|\n w.http = connection\n w.collections.each do |c|\n c.http = connection\n c.feed.http = connection\n end\n end\n end",
"title": ""
},
{
"docid": "4c634bd9048b53fce408a982978853d7",
"score": "0.5860514",
"text": "def initialize_edges\n @town_names.each do |name|\n @town_connections[name].each do |neighbor_name|\n @graph[name].connect @graph[neighbor_name]\n end\n end\n end",
"title": ""
},
{
"docid": "073a94a929d0aa61089a62881d58f661",
"score": "0.585006",
"text": "def assign_graph_to_qernel_objects\n nodes.each do |node|\n node.graph = self\n node.slots.each { |s| s.graph = self }\n end\n edges.each do |edge|\n edge.graph = self\n edge.query.graph = self\n end\n carriers.each { |c| c.graph = self }\n end",
"title": ""
},
{
"docid": "ab2ff797a9a2d4fc7ad071b5939ab3f9",
"score": "0.5779438",
"text": "def setup_links(nodes)\n super\n @attributes['links'].keys.each do |name|\n spawn(\"ip link set #{name} master br0\")\n end\n end",
"title": ""
},
{
"docid": "1bf0d16891ed1c655274effe4124d207",
"score": "0.5722694",
"text": "def set_network_mode!\n Bitcoin.network = @network\n end",
"title": ""
},
{
"docid": "be07c74813c5b6e52730bb695c991318",
"score": "0.5713672",
"text": "def netset\n obj_retry(\"link\") do; nav.link(:text, 'Network Settings'); end\n end",
"title": ""
},
{
"docid": "f8e8a158a4b9aa8c7944a0789d238eaa",
"score": "0.57122606",
"text": "def initialize (parameters={})\n @network_id = parameters.fetch(:network_id, \"XXXXXX\")\n @network_graph = parameters.fetch(:network_graph, \"XXXXXX\")\n @network_components = parameters.fetch(:network_components, \"XXXXXX\")\n @network_relations = parameters.fetch(:network_relations, \"XXXXXX\")\n @network_kegg_features = parameters.fetch(:network_kegg_features, \"XXXXXX\")\n @network_go_features = parameters.fetch(:network_go_features, \"XXXXXX\")\n @@objects << self\n end",
"title": ""
},
{
"docid": "8a03bb260d935dd1e337bde99b903f18",
"score": "0.56857044",
"text": "def configure_network\n add_static_ips\n add_dhcp_adapters\n configure_routes\n end",
"title": ""
},
{
"docid": "3ee541787b6df76a6c8059b9567d7252",
"score": "0.56724274",
"text": "def set_network\n\t\t@network = calculate_network(@word)\n\t\t#updates the size class variable for the TestWord Object\n\t\t@size = @network.size\n\tend",
"title": ""
},
{
"docid": "5dbb33609080e590a2876e91430ca0cf",
"score": "0.56474584",
"text": "def connect!\n @clients = servers.collect { |server|\n Client.new(server)\n }.compact\n end",
"title": ""
},
{
"docid": "5a07b64ee508fa2ceaa0e849717e19bb",
"score": "0.56389546",
"text": "def start\n @networks.each { |network| network.connect }\n\n until @stop\n select_and_handle for_reading, for_writing\n end\n\n @stop = false\n end",
"title": ""
},
{
"docid": "5d12e9f284716cc11b8bb790090f5364",
"score": "0.5636919",
"text": "def assign_network\n @env.ui.info I18n.t(\"vagrant.actions.vm.network.preparing\")\n\n @env.env.config.vm.network_options.compact.each do |network_options|\n adapter = @env[\"vm\"].vm.network_adapters[network_options[:adapter]]\n adapter.enabled = true\n adapter.attachment_type = :host_only\n adapter.host_interface = network_name(network_options)\n adapter.mac_address = network_options[:mac].gsub(':', '') if network_options[:mac]\n adapter.save\n end\n end",
"title": ""
},
{
"docid": "bd0a4c5954dbfe30a757662b76e88bac",
"score": "0.562734",
"text": "def initialize\n @connections = {}\n end",
"title": ""
},
{
"docid": "bd6b56ed600c044d9b581c614de38afa",
"score": "0.561593",
"text": "def setup_sockets\n options = @settings[:client][:socket] || Hash.new\n options[:bind] ||= \"127.0.0.1\"\n options[:port] ||= 3030\n @logger.debug(\"binding client tcp and udp sockets\", :options => options)\n @sockets << EM::start_server(options[:bind], options[:port], Socket) do |socket|\n socket.logger = @logger\n socket.settings = @settings\n socket.transport = @transport\n end\n @sockets << EM::open_datagram_socket(options[:bind], options[:port], Socket) do |socket|\n socket.logger = @logger\n socket.settings = @settings\n socket.transport = @transport\n socket.protocol = :udp\n end\n end",
"title": ""
},
{
"docid": "f9490d29dc545c483065a31e8192a904",
"score": "0.5581977",
"text": "def connect_to_network(other_network)\n API::Tunnel.create!(env, self, other_network)\n updated_network = environment.reload.networks.find{|n| n.id == id}\n refresh(updated_network.attrs)\n end",
"title": ""
},
{
"docid": "5b6ef805555c06df24a6e50747a486ae",
"score": "0.55811894",
"text": "def set_network\n @network = Network.find(params[:network_id])\n end",
"title": ""
},
{
"docid": "efc8a2385a19dbaea62211facf72b13e",
"score": "0.55783165",
"text": "def set_network\n @network = Network.find(params[:id])\n end",
"title": ""
},
{
"docid": "efc8a2385a19dbaea62211facf72b13e",
"score": "0.55783165",
"text": "def set_network\n @network = Network.find(params[:id])\n end",
"title": ""
},
{
"docid": "efc8a2385a19dbaea62211facf72b13e",
"score": "0.55783165",
"text": "def set_network\n @network = Network.find(params[:id])\n end",
"title": ""
},
{
"docid": "efc8a2385a19dbaea62211facf72b13e",
"score": "0.55783165",
"text": "def set_network\n @network = Network.find(params[:id])\n end",
"title": ""
},
{
"docid": "efc8a2385a19dbaea62211facf72b13e",
"score": "0.55783165",
"text": "def set_network\n @network = Network.find(params[:id])\n end",
"title": ""
},
{
"docid": "f33a5d1b23cbee855318da370eb2ae80",
"score": "0.5561473",
"text": "def networks=(list)\n if list.class == Array\n list = List.new(list)\n list.each_with_index do |value, index|\n if value.is_a?(Hash)\n list[index] = Network.new(value)\n end\n end\n end\n @networks = list\n end",
"title": ""
},
{
"docid": "f33a5d1b23cbee855318da370eb2ae80",
"score": "0.5561473",
"text": "def networks=(list)\n if list.class == Array\n list = List.new(list)\n list.each_with_index do |value, index|\n if value.is_a?(Hash)\n list[index] = Network.new(value)\n end\n end\n end\n @networks = list\n end",
"title": ""
},
{
"docid": "f33a5d1b23cbee855318da370eb2ae80",
"score": "0.5559178",
"text": "def networks=(list)\n if list.class == Array\n list = List.new(list)\n list.each_with_index do |value, index|\n if value.is_a?(Hash)\n list[index] = Network.new(value)\n end\n end\n end\n @networks = list\n end",
"title": ""
},
{
"docid": "1ebaa2b1c285e781a8f576718a649a69",
"score": "0.554028",
"text": "def build_network(call_letters)\n new_network = Network.create(call_letters)\n self.network = new_network\n end",
"title": ""
},
{
"docid": "706aa766d56d6007edb5919d1a306070",
"score": "0.55381227",
"text": "def set_resources\n @network = Network.find_by_slug! params[:id]\n end",
"title": ""
},
{
"docid": "b9ec47c50a852dd49b82a29ac2947ea4",
"score": "0.55182",
"text": "def multi_connect( collection_names, options = {} )\n MultiCollection.new @server, collection_names, options\n end",
"title": ""
},
{
"docid": "d09c8363616a47887def5fcfed154037",
"score": "0.55123097",
"text": "def reset\n NETWORKS_KEYS.each do |network_key|\n send \"#{network_key}=\", {}\n end\n end",
"title": ""
},
{
"docid": "8ffbc8548e98e4744f8f8a8697a7004f",
"score": "0.5510023",
"text": "def connect!(options = {})\n @connection = Base.new options\n end",
"title": ""
},
{
"docid": "cbd017f7762329011780e346a5b3869d",
"score": "0.5508814",
"text": "def connect!\n connections.each &:connect!\n self\n end",
"title": ""
},
{
"docid": "173e7a98000104409de2d77293b491ee",
"score": "0.54999447",
"text": "def set(*args)\n Chef::Log.debug \"connection.set args #{args}\" unless run_context.nil?\n connection.set(*args)\n end",
"title": ""
},
{
"docid": "5ad352c9c1e343d5a86fff71052e5c6c",
"score": "0.5486718",
"text": "def __build_connections\n @request_options = {}\n\n if options.key?(:headers)\n @request_options[:headers] = options[:headers]\n end\n\n client_options = options[:transport_options] || {}\n client_options[:ssl] = options[:ssl] || {}\n\n Connections::Collection.new \\\n :connections => hosts.map { |host|\n host[:protocol] = host[:scheme] || DEFAULT_PROTOCOL\n host[:port] ||= DEFAULT_PORT\n\n host.delete(:user) # auth is not supported here.\n host.delete(:password) # use the headers\n\n url = __full_url(host)\n\n Connections::Connection.new \\\n :host => host,\n :connection => ::Manticore::Client.new(client_options)\n },\n :selector_class => options[:selector_class],\n :selector => options[:selector]\n end",
"title": ""
},
{
"docid": "387a4481f14a8ee98778befa259ebf77",
"score": "0.5458206",
"text": "def network01(broker)\n sconf = Hash.new\n sconf[6400] = ['localhost', 'giocoso']\n sconf[6401] = ['192.168.64.1', 'giocoso']\n sconf[6402] = ['127.0.0.1', 'giocoso']\n\n sc = ServerConnector.new sconf\n sc.start\n\n cconf = Hash.new\n cconf[6500] = []\n cconf[6501] = []\n cconf[6502] = []\n cconf[6503] = []\n cconf[6504] = []\n cconf[6505] = []\n\n cc = ClientConnector.new cconf\n cc.start\n\n #\n broker.port_map(\n PortDesc.new(:remote, sconf[6400][0], 6400),\n PortDesc.new(:local, '', 6500),\n DupTranslator.new\n )\n #\n broker.port_map(\n PortDesc.new(:remote, sconf[6401][0], 6401),\n PortDesc.new(:local, '', 6501)\n )\n #\n broker.port_map(\n PortDesc.new(:remote, sconf[6402][0], 6402),\n PortDesc.new(:local, '', 6502)\n )\n\n #\n broker.port_map(\n PortDesc.new(:remote, sconf[6400][1], 6400),\n PortDesc.new(:local, '', 6503)\n )\n #\n broker.port_map(\n PortDesc.new(:remote, sconf[6401][1], 6401),\n PortDesc.new(:local, '', 6504)\n )\n #\n broker.port_map(\n PortDesc.new(:remote, sconf[6402][1], 6402),\n PortDesc.new(:local, '', 6505)\n )\n #\n broker.port_map(\n PortDesc.new(:remote, sconf[6401][1], 6401),\n PortDesc.new(:remoet, sconf[6401][0], 6401)\n )\n\n broker.set_server_connector sc\n broker.set_client_connector cc\n\nend",
"title": ""
},
{
"docid": "3c373457c4c7ccb6f3ff7eb72d92af85",
"score": "0.54320717",
"text": "def connect_setup\n\t\t\t\tzk.mkdir_p @base_path\n\t\t\t\t@node_path = zk.create \"#{@base_path}/#{NODE_PREFIX}\", @last_known_address, :sequence => true, :ephemeral => true\n\t\t\t\t@nodes = zk.children @base_path, :watch => true\n\t\t\tend",
"title": ""
},
{
"docid": "7e1fe7d77b5fdecdb4ff9b5b55bcddd0",
"score": "0.5422809",
"text": "def set_proxies (mapping)\n\t@proxies.merge! mapping\n\tself\n end",
"title": ""
},
{
"docid": "dc687f0cb88c6c0e83b4e3ba35d9ec90",
"score": "0.5415435",
"text": "def load_with_properties\n item = load_resource\n set_resource(item, OneviewSDK::ServerHardwareType, server_hardware_type, :set_server_hardware_type)\n set_resource(item, OneviewSDK::EnclosureGroup, enclosure_group, :set_enclosure_group)\n set_resource(item, OneviewSDK::FirmwareDriver, firmware_driver, :set_firmware_driver)\n set_connections(item, OneviewSDK::EthernetNetwork, ethernet_network_connections)\n set_connections(item, OneviewSDK::FCNetwork, fc_network_connections)\n set_connections(item, OneviewSDK::NetworkSet, network_set_connections)\n end",
"title": ""
},
{
"docid": "a444be9a85dd47113da905b792a1e5f3",
"score": "0.54140157",
"text": "def prop_set(props)\n Cisco::ChefUtils.generic_prop_set(self, '@router', props)\n end",
"title": ""
},
{
"docid": "3269fa599c106bbbd74c6d2d209d9722",
"score": "0.5402903",
"text": "def configure_network\n return if already_configured?\n add_static_ips\n # add routes for nat server\n # this needs to be done after our IPs are configured\n add_static_routes_for_network\n set_network_configured_marker\n end",
"title": ""
},
{
"docid": "2aa11287163c428681e54ef7096fadd0",
"score": "0.5394571",
"text": "def put_network(ev)\n\t\t@connects.each do |c|\n\t\t\tc.puts(ev.to_net)\n\t\tend\n\tend",
"title": ""
},
{
"docid": "5aead0e55687031bf01c3586c0992eaa",
"score": "0.53857654",
"text": "def connect_all\n @connect_strategy.connect(self)\n end",
"title": ""
},
{
"docid": "2fc6eac7d19c2ace6183b9a025245cf2",
"score": "0.5384248",
"text": "def add_connections node_names\n @connections = @connections.union node_names\n end",
"title": ""
},
{
"docid": "4cc5852ee32f0d8fac1885e27dc964d3",
"score": "0.5383946",
"text": "def initialize(connections)\r\n end",
"title": ""
},
{
"docid": "2007fb90e23b64e75790e1b31f0cffe6",
"score": "0.5375401",
"text": "def networks=(list)\n if list.class == Array\n list = List.new(list)\n list.each_with_index do |value, index|\n if value.is_a?(Hash)\n list[index] = OpenStackNetwork.new(value)\n end\n end\n end\n @networks = list\n end",
"title": ""
},
{
"docid": "4bc83dfde4755e0661d96a919957fd4d",
"score": "0.5372194",
"text": "def set_network\n @network = Network.find(params[:id])\n end",
"title": ""
},
{
"docid": "5f6a4363fa6c57e4e3bab9d3331894a1",
"score": "0.5371121",
"text": "def initialize\n\t\t\t@connections = []\n\t\t\t@subscriptions = []\n\t\tend",
"title": ""
},
{
"docid": "2f23f090da1f91b01d2e2fa089bb15c3",
"score": "0.5366003",
"text": "def open_connections\n start_ipv4_socket\n start_ipv6_socket\n end",
"title": ""
},
{
"docid": "5f52d8068e4cc1f1464061914cf762a1",
"score": "0.53584325",
"text": "def initialize(*args)\n @x, @y = *args\n @net_x = @x\n @net_y = @y\n\n super(*args) # Calls networked initialize\n end",
"title": ""
},
{
"docid": "60bfcfefaf4664b54908c34a3cf8aeca",
"score": "0.5358295",
"text": "def connect\n EM.error_handler do |exception|\n p exception\n end\n\n EM.run do\n @servers.each do |server|\n connection = EM.connect server.host, server.port, Connection, server\n end\n end\n end",
"title": ""
},
{
"docid": "e9d73cb0067894872a412b20f28f42b9",
"score": "0.5347563",
"text": "def set_server() Cproton.pn_transport_set_server(@impl); end",
"title": ""
},
{
"docid": "02560e3cf1890e06db0787ec900c6f27",
"score": "0.53432703",
"text": "def connect!\n connect\n end",
"title": ""
},
{
"docid": "196e0050aa66faa59130ef3b03a5d9af",
"score": "0.5339412",
"text": "def set_network_location\n @network_location = NetworkLocation.find(params[:id])\n end",
"title": ""
},
{
"docid": "7759a4280da8fc18b948befa180e7bda",
"score": "0.53391266",
"text": "def network02(broker)\n sconf = Hash.new\n sconf[6400] = ['localhost']\n sc = ServerConnector.new sconf\n sc.start\n\n cconf = Hash.new\n cconf[6500] = []\n cc = ClientConnector.new cconf\n cc.start\n\n\n broker.port_map(\n PortDesc.new(:remote, sconf[6400][0], 6400),\n PortDesc.new(:local, '', 6500)\n )\n broker.port_map(\n PortDesc.new(:local, '', 6500),\n PortDesc.new(:remote, sconf[6400][0], 6400)\n )\n\n broker.set_server_connector sc\n broker.set_client_connector cc\nend",
"title": ""
},
{
"docid": "665338b909c352c3396abb127aa4c35c",
"score": "0.53303266",
"text": "def storage_connections=(list)\n if list.class == Array\n list = List.new(list)\n list.each_with_index do |value, index|\n if value.is_a?(Hash)\n list[index] = StorageConnection.new(value)\n end\n end\n end\n @storage_connections = list\n end",
"title": ""
},
{
"docid": "665338b909c352c3396abb127aa4c35c",
"score": "0.53300065",
"text": "def storage_connections=(list)\n if list.class == Array\n list = List.new(list)\n list.each_with_index do |value, index|\n if value.is_a?(Hash)\n list[index] = StorageConnection.new(value)\n end\n end\n end\n @storage_connections = list\n end",
"title": ""
},
{
"docid": "939513d1dcc67d830da039207c8d3197",
"score": "0.53104585",
"text": "def addresses=(addrs)\n if @io\n @io.add_addresses(addrs)\n else\n @io = build_socket(addrs)\n end\n end",
"title": ""
},
{
"docid": "2a8894f9f87985e52a8e20c730416237",
"score": "0.5308714",
"text": "def connect(*) end",
"title": ""
},
{
"docid": "c9e4e4d7d4a15f616b251fc2c8c967a0",
"score": "0.5308",
"text": "def assign_network\n @env[:ui].info I18n.t(\"vagrant.actions.vm.network.preparing\")\n\n networks = @env[:vm].driver.read_host_only_interfaces\n adapters = []\n\n # Build the networks and the list of adapters we need to enable\n @env[:vm].config.vm.network_options.compact.each do |network_options|\n network = find_matching_network(networks, network_options)\n\n if !network\n # It is an error case if a specific name was given but the network\n # doesn't exist.\n if network_options[:name]\n raise Errors::NetworkNotFound, :name => network_options[:name]\n end\n\n # Otherwise, we create a new network and put the net network\n # in the list of available networks so other network definitions\n # can use it!\n network = create_network(network_options)\n networks << network\n end\n\n adapters << {\n :adapter => network_options[:adapter] + 1,\n :type => :hostonly,\n :hostonly => network[:name],\n :mac_address => network_options[:mac]\n }\n end\n\n # Enable the host only adapters!\n @env[:vm].driver.enable_adapters(adapters)\n end",
"title": ""
},
{
"docid": "2e3b94584bc907de1aafd0efbc77bc4c",
"score": "0.5303",
"text": "def networks\n Collection::NetworkCollection.new(self)\n end",
"title": ""
},
{
"docid": "d51d863dcddb1c634d0c23921990c9c2",
"score": "0.52947",
"text": "def initialize(addresses)\n @sockets = []\n self.addresses = addresses\n end",
"title": ""
},
{
"docid": "a7626e098ca6e3db6629783d9bdd4d2c",
"score": "0.5293749",
"text": "def set_network(node, ip, names)\n node.vm.network :private_network, ip: ip\n\n primary, *aliases = *names\n\n node.vm.hostname = primary\n node.hostmanager.aliases = aliases\n node.hostmanager.ignore_private_ip = false\n\n node.vm.provider :digital_ocean do |provider, override|\n override.hostmanager.aliases = aliases\n override.hostmanager.ignore_private_ip = true\n end\nend",
"title": ""
},
{
"docid": "59c88d294d99998843958adb85f5c9d5",
"score": "0.5287804",
"text": "def initialize(network_topology)\n @network_topology = network_topology\n end",
"title": ""
},
{
"docid": "2a323d021ce21724f7c47b5550c6ec40",
"score": "0.52848595",
"text": "def initialize(client, params = {}, api_ver = nil)\n super\n # Default values:\n @data['connectionTemplateUri'] ||= nil\n @data['nativeNetworkUri'] ||= nil\n @data['networkUris'] ||= []\n @data['type'] ||= 'network-set'\n end",
"title": ""
},
{
"docid": "6d078924c81a454f2252c9d2699697de",
"score": "0.52809876",
"text": "def setup\n nl = Linux::Netlink::Route::Socket.new\n\n netifs.each do |netif|\n netif.ips.each do |ip|\n begin\n nl.addr.add(index: netif.name, local: ip.address, prefixlen: ip.prefix)\n rescue Errno::EEXIST\n next\n end\n end\n\n netif.routes.each do |route|\n begin\n nl.route.add(\n oif: netif.name,\n dst: route.address,\n dst_len: route.prefix,\n gateway: route.via,\n )\n rescue Errno::EEXIST\n next\n end\n end\n end\n end",
"title": ""
},
{
"docid": "763f584ffe7616f31a9636f42edb6b96",
"score": "0.52805907",
"text": "def network_connection=(type)\n execute :set_network_connection, {}, { parameters: { type: type } }\n end",
"title": ""
},
{
"docid": "933d2ee988357fc085663692005de3c1",
"score": "0.52751803",
"text": "def connections\r\n end",
"title": ""
},
{
"docid": "b881b1422fb36a1e9e980c5d7109c9ca",
"score": "0.52739465",
"text": "def initialize\n @connections = Concurrent::Set.new\n end",
"title": ""
},
{
"docid": "92ef2e989408d3baaae08cedce20db91",
"score": "0.52712363",
"text": "def network03(broker)\n cconf = Hash.new\n cconf[6500] = []\n cconf[6501] = []\n cc = ClientConnector.new cconf\n cc.start\n\n broker.port_map(\n PortDesc.new(:local,'', 6500),\n PortDesc.new(:local,'', 6501)\n )\n broker.port_map(\n PortDesc.new(:local,'', 6501),\n PortDesc.new(:local,'', 6500)\n )\n\n broker.set_client_connector cc\n\nend",
"title": ""
},
{
"docid": "34c2406e4de2f389e8ef48e3e0126ffa",
"score": "0.5269838",
"text": "def write_connections(connections)\n\n # write the connections on this Person\n Person.write_connections_on(self, connections)\n\n connections.each do |conn|\n other_person = Person.find(conn)\n Person.write_connections_on(other_person, self.uri.to_s)\n Organisation.write_link(self.member_of, other_person.member_of)\n end\n\n end",
"title": ""
},
{
"docid": "5f2e0fa1627ffad9e3ecf9bfe6e1191c",
"score": "0.526669",
"text": "def connect\n close\n @nodes_to_try = @nodes.clone\n\n while connecting?\n node = @nodes_to_try.shift\n config = check_is_master(node)\n\n if is_primary?(config)\n set_primary(node)\n else\n set_auxillary(node, config)\n end\n end\n\n pick_secondary_for_read if @read_secondary\n\n if connected?\n BSON::BSON_CODER.update_max_bson_size(self)\n else\n if @secondary_pools.empty?\n close # close any existing pools and sockets\n raise ConnectionFailure, \"Failed to connect any given host:port\"\n else\n close # close any existing pools and sockets\n raise ConnectionFailure, \"Failed to connect to primary node.\"\n end\n end\n end",
"title": ""
},
{
"docid": "c595a1142169aa5447696be498f393a4",
"score": "0.5264846",
"text": "def connect(server)\n @network = server.network\n state.connect(self, server)\n end",
"title": ""
},
{
"docid": "871d6e3bcd5a67c5e0142ebf8c333307",
"score": "0.5262755",
"text": "def connect options\n left_opts = options.shift\n right_opts= options.shift\n\n add_connection( @left, @right, left_opts )\n add_connection( @left, @right, right_opts )\n end",
"title": ""
},
{
"docid": "a5449a4d77507c955aee50a28dc5482f",
"score": "0.52610373",
"text": "def network_connection=(type)\n execute :set_network_connection, {}, { parameters: { type: type } }\n end",
"title": ""
},
{
"docid": "7a5d691d79153b0282a384260b96718e",
"score": "0.5259384",
"text": "def set_relations(object, relations)\n object = peer.local_object(object)\n relations = peer.local_object(relations)\n\n Distributed.update(object.root_object) do\n all_parents = Hash.new { |h, k| h[k] = ValueSet.new }\n all_children = Hash.new { |h, k| h[k] = ValueSet.new }\n \n # Add or update existing relations\n relations.each_slice(3) do |graph, parents, children|\n all_objects = parents.map { |p, _| p } + children.map { |c, _| c }\n Distributed.update_all(all_objects) do\n parents.each_slice(2) do |parent, info|\n next unless parent\n all_parents[graph] << parent\n\n if graph.linked?(parent, object)\n parent[object, graph] = info\n else\n Distributed.update(parent.root_object) do\n parent.add_child_object(object, graph, info)\n end\n end\n end\n children.each_slice(2) do |child, info|\n next unless child\n all_children[graph] << child\n\n if graph.linked?(object, child)\n object[child, graph] = info\n else\n Distributed.update(child.root_object) do\n object.add_child_object(child, graph, info)\n end\n end\n end\n end\n end\n\n Distributed.each_object_relation(object) do |rel|\n # Remove relations that do not exist anymore\n #\n # If the other end of this relation cannot be seen by\n # our remote peer, keep it: it means that the relation\n # is a local-only annotation this pDB has added to the\n # task\n (object.parent_objects(rel).to_value_set - all_parents[rel]).each do |p|\n # See comment above\n next unless p.distribute?\n Distributed.update_all([p.root_object, object.root_object]) do\n p.remove_child_object(object, rel)\n end\n end\n (object.child_objects(rel).to_value_set - all_children[rel]).each do |c|\n # See comment above\n next unless c.distribute?\n Distributed.update_all([c.root_object, object.root_object]) do\n object.remove_child_object(c, rel)\n end\n end\n end\n end\n\n nil\n end",
"title": ""
},
{
"docid": "908510e5b44229f222ee99b2b1660b12",
"score": "0.5254372",
"text": "def network\n {\n following: following,\n followers: followers\n }\n end",
"title": ""
},
{
"docid": "897e66e1017099af9fea019ebe4ebeae",
"score": "0.5252503",
"text": "def set\n @user = User.find_first_by_username(params[:user])\n @networks = params[:networks]\n @networks_to_follow = []\n @networks_to_unfollow = []\n SocialNetworkSite.all.each do |network|\n @networks_to_follow << network if @networks[network.name] == '1' and !current_user.following?(@user, network)\n @networks_to_unfollow << network if @networks[network.name] == '0' and current_user.following?(@user, network)\n end\n current_user.follow(@user, @networks_to_follow) unless @networks_to_follow.empty?\n current_user.unfollow(@user, @networks_to_unfollow) unless @networks_to_unfollow.empty?\n flash[:notice] = ''\n flash[:notice] += \"Successfully added connection to #{@user.username} on #{@networks_to_follow.join(', ')}. \" unless @networks_to_follow.empty?\n flash[:notice] += \"Successfully removed connection to #{@user.username} on #{@networks_to_unfollow.join(', ')}.\" unless @networks_to_unfollow.empty?\n if request.xhr?\n render :nothing => true, :status => 204 # Let jQuery know that we successfully set the connections.\n else\n redirect_to profile_path(@user.username)\n end\n end",
"title": ""
},
{
"docid": "abc8fe7c4ff544024f0f431cda4c6f05",
"score": "0.52487797",
"text": "def set_matzburg\n @matzburg.add_connection(@duck_type_beach)\n @matzburg.add_connection(@monkey_patch_city)\n @matzburg.add_connection(@hash_crossing)\n @matzburg.add_connection(@dynamic_palisades)\n end",
"title": ""
},
{
"docid": "21e82d008d20270ac1afd9a823c4927f",
"score": "0.52450985",
"text": "def configure_networks(node, node_details)\n networks = node_details['networks']\n networks && networks.each do |network|\n network.each do |network_type, network_params|\n if network_params\n network_params = keys_to_symbols(network_params)\n node.vm.network network_type, network_params\n else\n node.vm.network network_type\n end\n end\n end\nend",
"title": ""
},
{
"docid": "11243e7d3b673db6115c51746d5298e9",
"score": "0.5238174",
"text": "def connect\n # Implement in subclass\n end",
"title": ""
},
{
"docid": "e2435c21cfd367a0669d96d780c30514",
"score": "0.52327627",
"text": "def configure!\n @servers.each do |s|\n prepare_servers!(s)\n session_options = { properties: s }\n session_options[:port] = s['port'] if s['port']\n session_options[:password] = s['password'] if s['password']\n if s['ssh_private_key']\n session_options[:auth_methods] = ['publickey']\n session_options[:keys] = [s['ssh_private_key']]\n end\n if s['gateway_host']\n gw_opts = { port: s['gateway_port'] }\n gw_opts[:password] = s['gateway_password'] if s['gateway_password']\n if s['gateway_ssh_private_key']\n gw_opts[:auth_methods] = ['publickey']\n gw_opts[:keys] = s['gateway_ssh_private_key']\n end\n gw = Net::SSH::Gateway.new(s['gateway_host'],\n s['gateway_username'],\n gw_opts)\n @ssh_gateways << gw\n @ssh_sessions << gw.ssh(s['host'],\n s['username'],\n session_options)\n else\n @ssh_sessions << Net::SSH.start(s['host'],\n s['username'],\n session_options)\n end\n end\n end",
"title": ""
},
{
"docid": "9a4c0c9bc78c1f67f7d73780bb736fc3",
"score": "0.5231858",
"text": "def connect!(options={})\n execute_on_servers(options) { }\n end",
"title": ""
},
{
"docid": "22cf2d1b5cc70f9515fbfeb122936978",
"score": "0.5229942",
"text": "def initialize(network)\n @network = Network.new network\n end",
"title": ""
},
{
"docid": "3dbc514ae06713c891aef16434e04db3",
"score": "0.5223876",
"text": "def connect!; end",
"title": ""
},
{
"docid": "d657d5a3d6f8d1c5a732784c6595f8a2",
"score": "0.52222675",
"text": "def connect()\n \n nil\n\n nil\n end",
"title": ""
},
{
"docid": "bd90a05cabe5f9d2fd68e949c6f1dd00",
"score": "0.522029",
"text": "def set_relations(object, relations)\n\t\tobject = peer.local_object(object)\n\t\trelations = peer.local_object(relations)\n\n\t\tDistributed.update(object.root_object) do\n\t\t all_parents = Hash.new { |h, k| h[k] = ValueSet.new }\n\t\t all_children = Hash.new { |h, k| h[k] = ValueSet.new }\n\t\t \n\t\t # Add or update existing relations\n\t\t relations.each_slice(3) do |graph, parents, children|\n\t\t\tall_objects = parents.map { |p, _| p } + children.map { |c, _| c }\n\t\t\tDistributed.update_all(all_objects) do\n\t\t\t parents.each_slice(2) do |parent, info|\n\t\t\t\tnext unless parent\n\t\t\t\tall_parents[graph] << parent\n\n\t\t\t\tif graph.linked?(parent, object)\n\t\t\t\t parent[object, graph] = info\n\t\t\t\telse\n\t\t\t\t Distributed.update(parent.root_object) do\n\t\t\t\t\tparent.add_child_object(object, graph, info)\n\t\t\t\t end\n\t\t\t\tend\n\t\t\t end\n\t\t\t children.each_slice(2) do |child, info|\n\t\t\t\tnext unless child\n\t\t\t\tall_children[graph] << child\n\n\t\t\t\tif graph.linked?(object, child)\n\t\t\t\t object[child, graph] = info\n\t\t\t\telse\n\t\t\t\t Distributed.update(child.root_object) do\n\t\t\t\t\tobject.add_child_object(child, graph, info)\n\t\t\t\t end\n\t\t\t\tend\n\t\t\t end\n\t\t\tend\n\t\t end\n\n\t\t Distributed.each_object_relation(object) do |rel|\n\t\t\t# Remove relations that do not exist anymore\n\t\t\t#\n\t\t\t# If the other end of this relation cannot be seen by\n\t\t\t# our remote peer, keep it: it means that the relation\n\t\t\t# is a local-only annotation this pDB has added to the\n\t\t\t# task\n\t\t\t(object.parent_objects(rel).to_value_set - all_parents[rel]).each do |p|\n\t\t\t # See comment above\n\t\t\t next unless p.distribute?\n\t\t\t Distributed.update_all([p.root_object, object.root_object]) do\n\t\t\t\tp.remove_child_object(object, rel)\n\t\t\t end\n\t\t\tend\n\t\t\t(object.child_objects(rel).to_value_set - all_children[rel]).each do |c|\n\t\t\t # See comment above\n\t\t\t next unless c.distribute?\n\t\t\t Distributed.update_all([c.root_object, object.root_object]) do\n\t\t\t\tobject.remove_child_object(c, rel)\n\t\t\t end\n\t\t\tend\n\t\t end\n\t\tend\n\n\t\tnil\n\t end",
"title": ""
},
{
"docid": "576529a1cda20bb11bbdabac2c8e824d",
"score": "0.52200925",
"text": "def start_network()\r\n network = Docker::Network.all.find { |network| network.info['Name'] == @proxy_net }\r\n @clilog.debug('starting the proxy network') unless network\r\n Docker::Network.create(@proxy_net) unless network\r\n end",
"title": ""
},
{
"docid": "a2159aff38eebcfc10dc238aa2c792df",
"score": "0.5215314",
"text": "def set_Network(value)\n set_input(\"Network\", value)\n end",
"title": ""
},
{
"docid": "d7a428242c3f6c853d669791a73fc89d",
"score": "0.5207601",
"text": "def __setobj__(collection)\n @__delegated_list = collection\n end",
"title": ""
},
{
"docid": "48e98fb663d165c7b880d131595b4150",
"score": "0.5205327",
"text": "def connect(server)\n setup_connection(::DataObjects::Connection.new(uri(server_opts(server))))\n end",
"title": ""
},
{
"docid": "5d6ede1aa235d5acfcf070fd7a3ba8f7",
"score": "0.520526",
"text": "def set_Network(value)\n set_input(\"Network\", value)\n end",
"title": ""
}
] |
a2ac6fe7650fac4bde3584011441ddfc | The response code of the request. | [
{
"docid": "35df2b67591fbeb171be29854d9568e3",
"score": "0.87216306",
"text": "def response_code\n @status\n end",
"title": ""
}
] | [
{
"docid": "b9751edda8e7229698f9b9db8744e3ec",
"score": "0.8795517",
"text": "def response_code\n status_code\n end",
"title": ""
},
{
"docid": "4d4b8155b46a4478597bf871939d8723",
"score": "0.8734735",
"text": "def code\n http_response.code\n end",
"title": ""
},
{
"docid": "4d4b8155b46a4478597bf871939d8723",
"score": "0.8734735",
"text": "def code\n http_response.code\n end",
"title": ""
},
{
"docid": "602497341d2514101b5650f34ae03d24",
"score": "0.87126225",
"text": "def response_status\n @response.code\n end",
"title": ""
},
{
"docid": "bb01f17dec9a2d360b04ebdea8956701",
"score": "0.8681303",
"text": "def response_code\n @code\n end",
"title": ""
},
{
"docid": "571c0c1a265ae5290ce3a407ef1767b2",
"score": "0.8679474",
"text": "def status_code\n @response.status_code\n end",
"title": ""
},
{
"docid": "84bbb3de2b95b9e52b31cf7a63005ed5",
"score": "0.86661977",
"text": "def status_code\n @http_response.code.to_i\n end",
"title": ""
},
{
"docid": "0eff1d205276942deed72695014ef485",
"score": "0.8642402",
"text": "def code\n response.code\n end",
"title": ""
},
{
"docid": "153753ae660fec5d9e92d3ea43628400",
"score": "0.8576332",
"text": "def code\n @response.code\n end",
"title": ""
},
{
"docid": "73b37e790f138b074cf72500658537ce",
"score": "0.8575575",
"text": "def code\n\t\t\t\treturn @resp.code\n\t\t\tend",
"title": ""
},
{
"docid": "9db385007ed5a68cda6da608b2a119dc",
"score": "0.84991723",
"text": "def http_code\n return unless @raw_response.code\n\n Integer(@raw_response.code)\n end",
"title": ""
},
{
"docid": "8081547f32bb50b3af28b05783f85c71",
"score": "0.8498377",
"text": "def status\n @response.code.to_i\n end",
"title": ""
},
{
"docid": "77cba673a07a2af940eb1524dd00625b",
"score": "0.847916",
"text": "def code\n @response.code.to_i\n end",
"title": ""
},
{
"docid": "35e3340ff73ab93d87f5a287706bb45f",
"score": "0.84745765",
"text": "def code\n response.code.to_i\n end",
"title": ""
},
{
"docid": "35e3340ff73ab93d87f5a287706bb45f",
"score": "0.84745765",
"text": "def code\n response.code.to_i\n end",
"title": ""
},
{
"docid": "84b44d679c44a11bc2bdb6c9947c204b",
"score": "0.846624",
"text": "def response_code\n headers['Status'][0,3].to_i rescue 0\n end",
"title": ""
},
{
"docid": "6c8bd9f85fd3cefecce7817defb3c2f8",
"score": "0.84529066",
"text": "def status_code\n http_response.status.to_i\n end",
"title": ""
},
{
"docid": "41735ae1cd70a45c9946c89c123d3c43",
"score": "0.84385324",
"text": "def code\n @response.code.to_i if @response\n end",
"title": ""
},
{
"docid": "de5c31fff17cb8c667151b824f407378",
"score": "0.8405421",
"text": "def code\n Integer(@raw_response.code)\n end",
"title": ""
},
{
"docid": "58f12e5ddb2b05523883d423718dc8ad",
"score": "0.8403244",
"text": "def status_code\n @http_response.status\n end",
"title": ""
},
{
"docid": "c40190fa8f929dac5ce846436f85dd3d",
"score": "0.8373701",
"text": "def response_code\n @response_code\n end",
"title": ""
},
{
"docid": "a30212d85d729ef57e1d3803e7657ce8",
"score": "0.8359341",
"text": "def http_code\n @result.code\n end",
"title": ""
},
{
"docid": "7170aac62d464158c4368b67ec8ed1b7",
"score": "0.8303697",
"text": "def status\n @response.response_code\n end",
"title": ""
},
{
"docid": "da3057b0041ff6c55e8a193f161bfaa9",
"score": "0.81674284",
"text": "def status\n response.code\n end",
"title": ""
},
{
"docid": "dff891414222626a6cfa4b7711af59e0",
"score": "0.8066545",
"text": "def http_response_code\n @attributes[:http_response_code]\n end",
"title": ""
},
{
"docid": "dff891414222626a6cfa4b7711af59e0",
"score": "0.8066545",
"text": "def http_response_code\n @attributes[:http_response_code]\n end",
"title": ""
},
{
"docid": "e1899dab6022506b5c03b31b277cdfb5",
"score": "0.80615795",
"text": "def get_response_code\n @result_code\n end",
"title": ""
},
{
"docid": "6e39860a14c751f96021d20037e887cd",
"score": "0.80335426",
"text": "def response_status\n return @response_status\n end",
"title": ""
},
{
"docid": "252a010446cda190a225507e2f5ac7a0",
"score": "0.8029157",
"text": "def resp_code\n params['resp_code']\n end",
"title": ""
},
{
"docid": "fb4e8437b72da039737f90f12da7d2f8",
"score": "0.79936445",
"text": "def status\n if @real_response.respond_to?(:code)\n @real_response.code.to_i\n else\n @real_response.status.to_i\n end\n end",
"title": ""
},
{
"docid": "cfccbb7d497df1c0353e9821aab80c82",
"score": "0.79134005",
"text": "def response_code; end",
"title": ""
},
{
"docid": "eb593ca35862303c7d0510c709b4bb79",
"score": "0.7858211",
"text": "def response_status\n @response[:status]\n end",
"title": ""
},
{
"docid": "55a7d066e530beb6eb292aef8d8ae8fb",
"score": "0.7820067",
"text": "def http_status\n @response.status\n end",
"title": ""
},
{
"docid": "21dc52c72da3d11afdb2667893386b53",
"score": "0.779704",
"text": "def response_code\n (options[:response_code] || options[:code]).to_i\n end",
"title": ""
},
{
"docid": "8cc081016c491d4e05510a2e691a1574",
"score": "0.7750674",
"text": "def code\n @code ||= @net_http_res.code.to_i\n end",
"title": ""
},
{
"docid": "78d33551d29e06c9346ae03cf4a33bd1",
"score": "0.7710674",
"text": "def get_ResponseStatusCode()\n \t return @outputs[\"ResponseStatusCode\"]\n \tend",
"title": ""
},
{
"docid": "78d33551d29e06c9346ae03cf4a33bd1",
"score": "0.7710674",
"text": "def get_ResponseStatusCode()\n \t return @outputs[\"ResponseStatusCode\"]\n \tend",
"title": ""
},
{
"docid": "78d33551d29e06c9346ae03cf4a33bd1",
"score": "0.7710674",
"text": "def get_ResponseStatusCode()\n \t return @outputs[\"ResponseStatusCode\"]\n \tend",
"title": ""
},
{
"docid": "24011a4e5d5513ff48dd03e2550998dd",
"score": "0.7695519",
"text": "def status_code\n if @json_response.blank?\n get_parsed_singular('statusCode')\n else\n @json_response['ResponseStatus'].to_s\n end\n end",
"title": ""
},
{
"docid": "40375c3f20c757ab48ca8ecfac69167c",
"score": "0.76873386",
"text": "def response_code response\n response.to_s.split[1].to_i\n end",
"title": ""
},
{
"docid": "442cae31e22d2c324985bd0e64119353",
"score": "0.767752",
"text": "def code\n\t\t\t@code ||= @net_http_res.code.to_i\n\t\tend",
"title": ""
},
{
"docid": "c4ecad60f58fb65ee0cec3a1145b2978",
"score": "0.76755595",
"text": "def response_code\n 200 # OK\n end",
"title": ""
},
{
"docid": "38261b7b1b8a5a2638ac08d7498afc72",
"score": "0.76698935",
"text": "def get_ResponseStatusCode()\n \t return @outputs[\"ResponseStatusCode\"]\n \tend",
"title": ""
},
{
"docid": "38261b7b1b8a5a2638ac08d7498afc72",
"score": "0.76697606",
"text": "def get_ResponseStatusCode()\n \t return @outputs[\"ResponseStatusCode\"]\n \tend",
"title": ""
},
{
"docid": "38261b7b1b8a5a2638ac08d7498afc72",
"score": "0.76697606",
"text": "def get_ResponseStatusCode()\n \t return @outputs[\"ResponseStatusCode\"]\n \tend",
"title": ""
},
{
"docid": "38261b7b1b8a5a2638ac08d7498afc72",
"score": "0.76697606",
"text": "def get_ResponseStatusCode()\n \t return @outputs[\"ResponseStatusCode\"]\n \tend",
"title": ""
},
{
"docid": "38261b7b1b8a5a2638ac08d7498afc72",
"score": "0.76697606",
"text": "def get_ResponseStatusCode()\n \t return @outputs[\"ResponseStatusCode\"]\n \tend",
"title": ""
},
{
"docid": "38261b7b1b8a5a2638ac08d7498afc72",
"score": "0.76697606",
"text": "def get_ResponseStatusCode()\n \t return @outputs[\"ResponseStatusCode\"]\n \tend",
"title": ""
},
{
"docid": "38261b7b1b8a5a2638ac08d7498afc72",
"score": "0.76697606",
"text": "def get_ResponseStatusCode()\n \t return @outputs[\"ResponseStatusCode\"]\n \tend",
"title": ""
},
{
"docid": "38261b7b1b8a5a2638ac08d7498afc72",
"score": "0.76697606",
"text": "def get_ResponseStatusCode()\n \t return @outputs[\"ResponseStatusCode\"]\n \tend",
"title": ""
},
{
"docid": "38261b7b1b8a5a2638ac08d7498afc72",
"score": "0.76697606",
"text": "def get_ResponseStatusCode()\n \t return @outputs[\"ResponseStatusCode\"]\n \tend",
"title": ""
},
{
"docid": "38261b7b1b8a5a2638ac08d7498afc72",
"score": "0.76697606",
"text": "def get_ResponseStatusCode()\n \t return @outputs[\"ResponseStatusCode\"]\n \tend",
"title": ""
},
{
"docid": "38261b7b1b8a5a2638ac08d7498afc72",
"score": "0.76697606",
"text": "def get_ResponseStatusCode()\n \t return @outputs[\"ResponseStatusCode\"]\n \tend",
"title": ""
},
{
"docid": "38261b7b1b8a5a2638ac08d7498afc72",
"score": "0.76697606",
"text": "def get_ResponseStatusCode()\n \t return @outputs[\"ResponseStatusCode\"]\n \tend",
"title": ""
},
{
"docid": "38261b7b1b8a5a2638ac08d7498afc72",
"score": "0.76697606",
"text": "def get_ResponseStatusCode()\n \t return @outputs[\"ResponseStatusCode\"]\n \tend",
"title": ""
},
{
"docid": "38261b7b1b8a5a2638ac08d7498afc72",
"score": "0.76697606",
"text": "def get_ResponseStatusCode()\n \t return @outputs[\"ResponseStatusCode\"]\n \tend",
"title": ""
},
{
"docid": "e3dadc55026c22c360d662f33232d136",
"score": "0.76551574",
"text": "def code\n @data['response_code']\n end",
"title": ""
},
{
"docid": "80b50a56af4f4b3d44d56739b069793f",
"score": "0.76551217",
"text": "def get_ResponseStatusCode()\n \t return @outputs[\"ResponseStatusCode\"]\n \tend",
"title": ""
},
{
"docid": "15c75d7f51e2f00e530e5553717443c5",
"score": "0.7650786",
"text": "def code\n @code ||= WebServer::Response::RESPONSE_CODES[@code_no]\n end",
"title": ""
},
{
"docid": "e48ac80f02cc5175ad31bf624d6a3152",
"score": "0.76435125",
"text": "def http_code(res)\n begin\n return Integer res.code\n rescue\n return 500\n end\n end",
"title": ""
},
{
"docid": "2db138d8b712ddc3b8edabc5d80d8199",
"score": "0.7634671",
"text": "def status_code\n data.status_code\n end",
"title": ""
},
{
"docid": "20105eb53ee49ec7f90e25a3eab6bb31",
"score": "0.7612436",
"text": "def code\n\t\t\t\t@code ||= @net_http_res.code.to_i\n\t\t\tend",
"title": ""
},
{
"docid": "9d739c78fa663a261d81864dbf1080ce",
"score": "0.7576375",
"text": "def status\n response.status\n end",
"title": ""
},
{
"docid": "9d739c78fa663a261d81864dbf1080ce",
"score": "0.7576375",
"text": "def status\n response.status\n end",
"title": ""
},
{
"docid": "9d739c78fa663a261d81864dbf1080ce",
"score": "0.7576375",
"text": "def status\n response.status\n end",
"title": ""
},
{
"docid": "cfd8af928a4a4280c3da7563755a78e7",
"score": "0.7574608",
"text": "def code\n @hash['response_code'].to_i\n end",
"title": ""
},
{
"docid": "79dc9c071b8904eb9f313ea995b1cf29",
"score": "0.75718296",
"text": "def status_code\n STATUS_CODE\n end",
"title": ""
},
{
"docid": "90319263e079e2b87141b39472f5a89a",
"score": "0.75641745",
"text": "def code\n (err && err.status_code) || -1\n end",
"title": ""
},
{
"docid": "b9bfd4ba585512b35f4edf6786922961",
"score": "0.7549993",
"text": "def response_status; end",
"title": ""
},
{
"docid": "0f3fb05bfad1fcc97b611d86587dfa00",
"score": "0.7548343",
"text": "def code\n @response.fetch(:error, {}).fetch(:code, nil) if @response.is_a?(Hash) && error?\n end",
"title": ""
},
{
"docid": "49e9f9087ef10ddbdde5272d0c6a2363",
"score": "0.75333637",
"text": "def status\n response.status\n end",
"title": ""
},
{
"docid": "0c7221439e7e1ee719fa99bd6c357437",
"score": "0.74796563",
"text": "def http_status\n self[:status_code]\n end",
"title": ""
},
{
"docid": "57587c0471a0d99d39bb7abbfe6c2b88",
"score": "0.74771255",
"text": "def response_status\n if @response_status.is_a?(Symbol)\n Rack::Utils::SYMBOL_TO_STATUS_CODE[@response_status]\n else\n @response_status.try(:to_i) || 200\n end\n end",
"title": ""
},
{
"docid": "b7e3af9106799c40028ad50e0d589f60",
"score": "0.74660504",
"text": "def code(response)\n /HTTP\\/1\\.1 (\\d+)/.match(response.lines.to_a.first.strip)[1].to_i\n end",
"title": ""
},
{
"docid": "f316e8221278d5f94e5d318d60526e58",
"score": "0.73902047",
"text": "def status_code\n @status_code || 500\n end",
"title": ""
},
{
"docid": "18b47eef7ae1411cbf7764758bf2865c",
"score": "0.7379594",
"text": "def code\n error.status_code\n end",
"title": ""
},
{
"docid": "742ee1ff99a15f5ad3624ad202d39364",
"score": "0.7374466",
"text": "def get_status_code\n return @status_code\n end",
"title": ""
},
{
"docid": "525f0d20c2710e1854798c8666411ff7",
"score": "0.7373639",
"text": "def status_code\n code = @status_code ||= 200\n @status_code = 200 if reset_status_code\n code\n end",
"title": ""
},
{
"docid": "cf99942112adbd32e79e3d6d51b3bc00",
"score": "0.7356657",
"text": "def code\n Integer(error.status_code)\n rescue StandardError\n -1\n end",
"title": ""
},
{
"docid": "2796f102e37431a4625ea844540e53c3",
"score": "0.73337924",
"text": "def code\n @status_code == 200 ? 202 : @status_code\n end",
"title": ""
},
{
"docid": "70bb2ea78257b8d3386c96bfe03e0513",
"score": "0.73222345",
"text": "def last_response_code; end",
"title": ""
},
{
"docid": "2c67f167bcd8316010e53a76511730e0",
"score": "0.7315455",
"text": "def resp_text_code; end",
"title": ""
},
{
"docid": "2c67f167bcd8316010e53a76511730e0",
"score": "0.7315455",
"text": "def resp_text_code; end",
"title": ""
},
{
"docid": "7e16082e2bea2cf14122462a9fadabac",
"score": "0.7302668",
"text": "def code\r\n ActionDispatch::ExceptionWrapper.new(@request.env, @exception).status_code\r\n end",
"title": ""
},
{
"docid": "daa079fe309d8af34b9d043ae1812f97",
"score": "0.72848284",
"text": "def error_code\n @hash['response_code'].to_i\n end",
"title": ""
},
{
"docid": "bffdbff13a705bdba754a48ed68c56d1",
"score": "0.7275151",
"text": "def status_code\n data[:status_code]\n end",
"title": ""
},
{
"docid": "7dfa6756128011f41da96c28ec1428b7",
"score": "0.7266756",
"text": "def status_code\n self.class.status_code\n end",
"title": ""
},
{
"docid": "7dfa6756128011f41da96c28ec1428b7",
"score": "0.7266756",
"text": "def status_code\n self.class.status_code\n end",
"title": ""
},
{
"docid": "dedcb414c0172ba79ef9999232c8188b",
"score": "0.7253863",
"text": "def error_code\n if @response.respond_to?(:error_code)\n @response.error_code\n else\n ''\n end\n end",
"title": ""
},
{
"docid": "e4ab287b833fd9876c1ad5ddf6cb6f10",
"score": "0.72363585",
"text": "def status_code; end",
"title": ""
},
{
"docid": "e4ab287b833fd9876c1ad5ddf6cb6f10",
"score": "0.72363585",
"text": "def status_code; end",
"title": ""
},
{
"docid": "e4ab287b833fd9876c1ad5ddf6cb6f10",
"score": "0.72363585",
"text": "def status_code; end",
"title": ""
},
{
"docid": "e4ab287b833fd9876c1ad5ddf6cb6f10",
"score": "0.72363585",
"text": "def status_code; end",
"title": ""
},
{
"docid": "e4ab287b833fd9876c1ad5ddf6cb6f10",
"score": "0.72363585",
"text": "def status_code; end",
"title": ""
},
{
"docid": "e4ab287b833fd9876c1ad5ddf6cb6f10",
"score": "0.72363585",
"text": "def status_code; end",
"title": ""
},
{
"docid": "e4ab287b833fd9876c1ad5ddf6cb6f10",
"score": "0.72363585",
"text": "def status_code; end",
"title": ""
},
{
"docid": "e4ab287b833fd9876c1ad5ddf6cb6f10",
"score": "0.72363585",
"text": "def status_code; end",
"title": ""
},
{
"docid": "e4ab287b833fd9876c1ad5ddf6cb6f10",
"score": "0.72363585",
"text": "def status_code; end",
"title": ""
},
{
"docid": "7caf43aa8795e48d0172c55c26731b32",
"score": "0.7230526",
"text": "def return_code\n return @return_code\n end",
"title": ""
}
] |
c76b86561ac36e4721c3199630406fe0 | Registers an instance of a CFSM with the event_class processor. Used by the constructor of the CFSM. | [
{
"docid": "04de489edf70d270344a12632996ae05",
"score": "0.6211793",
"text": "def register_cfsm( cfsm )\n ( @cfsms[ cfsm.class ] ||= Array.new ).push( cfsm )\n end",
"title": ""
}
] | [
{
"docid": "5cece65ac9b3f3d4b6fd44b15da016c4",
"score": "0.6230226",
"text": "def register_events(klass, state, other_params, &exec_block)\n @klass_being_defined = klass\n @state_being_defined = state\n\n # if an initial state has not been set, then set it. In practice, means the first state definition\n # gets the initial state.\n @cfsm_initial_state[ klass ] = state unless @cfsm_initial_state[ klass ]\n\n # Evaluate the transition definitions\n self.instance_eval( &exec_block ) if exec_block\n\n @klass_being_defined = nil\n @state_being_defined = nil\n @other_params = other_params\n end",
"title": ""
},
{
"docid": "45b495d9d7bca1e9914cc743402b8aa9",
"score": "0.56769073",
"text": "def register(type, cls); end",
"title": ""
},
{
"docid": "11093c4bddce305d2461b632746c7a67",
"score": "0.5658948",
"text": "def register type, cls\n @@processors[type] = cls\n end",
"title": ""
},
{
"docid": "263b7c6dc610b431f5e5f36a825c3f87",
"score": "0.5517822",
"text": "def new\n @class_register = ClassRegister.new\n end",
"title": ""
},
{
"docid": "106db7b762e3abfe5356bf4e783e30d8",
"score": "0.5366582",
"text": "def register_instance(as_type, instance)\n @@class_registry[as_type.to_sym] = { instance: instance }\nend",
"title": ""
},
{
"docid": "d709692fd5274e2d78efe07767863226",
"score": "0.534545",
"text": "def initialize( namespace )\n @status = :initialising\n\n # keep a record of the namespace.\n @namespace = namespace\n\n # Used to store runtime options.\n @options = nil\n\n ##\n # This variable holds a list of all instantiated FSMs within the namespace. It holds the data as a hash of class to\n # an array of all instantiated FSMs.\n @cfsms = {}\n\n ##\n # This variable holds a list of initial states for all defined classes of CFSM. It is a hash of\n # class to state.\n @cfsm_initial_state = {}\n\n # Hash that provides the collection of parameters that need to be evaluated for a given event_class type.\n #\n # While the CFSMs are being constructed, the hash will point to an array of EventTrees. Each\n # event_class tree represents a condition tree and the transition that will produced. Example:\n #\n # @parameters[ :event_a ] =\n # EventTree[0] = <\n # @condition_tree = { :and => [\n # StateCheck( FsmA, :state_a ), ConditionNode( :==, 'a', 'Peter' ) },\n # @transition = Transition( FsmA, :state_b ) }\n # If event_a is raised, and FsmA is in state_a, and the message contains a field 'a' that has value 'Peter', then\n # FsmA should transition to state_b.\n #\n # The array is then converted into a Hash of ANDed Conditions and the transition. Details\n # in condition_permutations.rb.\n #\n # This is in turn turned into a ConditionGraph representing the tests that need to be carried out\n # together with the transitions. Details in condition_graph.rb\n @conditions = {}\n\n # In order to facilitate faster manipulation of the parameters during the optimisation we cache the\n # parameters. The ConditionCache holds an array of EventConditons with all tests stored only once in\n # the EventCondition. This allows faster manipulation of the tree during optimisation since when comparing\n # conditions we can do this simply on object_id rather than on the whole EventCondition.\n #\n # Once optimisation is complete, this array can be discarded.\n @condition_cache = ConditionParser::ConditionCache.new\n end",
"title": ""
},
{
"docid": "6116ada2dddd92eb612d19649e14b8f8",
"score": "0.5199349",
"text": "def register(klass, overwrite = false, state_machine = nil)\n raise \"Cannot register #{klass}\" unless klass.is_a?(Class)\n\n case name = template = overwrite\n when FalseClass then stores[klass.to_s] ||= new\n when TrueClass then stores[klass.to_s] = new\n when Class then stores[klass.to_s] = stores[template.to_s].clone\n when Symbol then stores[klass.to_s].register(name, state_machine)\n when String then stores[klass.to_s].register(name, state_machine)\n else raise \"Don't know what to do with #{overwrite}\"\n end\n end",
"title": ""
},
{
"docid": "8b0dd655a948041c7c889569d24e7f13",
"score": "0.51899064",
"text": "def on( event_class, parameters = {}, &proc )\n # Create an array to hold the condition trees and their respective transitions.\n @conditions[ event_class ] ||= Array.new\n\n # Make sure we have not yet passed the point of turning this into a ConditionGraph.\n raise TooLateToRegisterEvent if @conditions[ event_class ].is_a? ConditionOptimisation::ConditionGraph\n\n # Create a parse tree with at least a state check.\n fsm_check = ConditionParser::EventCondition::fsm_state_checker(@klass_being_defined, @state_being_defined)\n if_tree = if parameters[:if].nil?\n fsm_check\n else\n {:and => [fsm_check, @@parser.process_if(parameters[:if], event_class, @klass_being_defined)]}\n end\n\n # Create the transition object\n raise BlockAndExecDefined if proc && parameters[:exec]\n proc ||= parameters[:exec]\n transition = CFSMClasses::Transition.new(@klass_being_defined, parameters[:transition], proc )\n\n # Store the event_class.\n @conditions[event_class].push Struct::EventTree.new( if_tree, transition )\n end",
"title": ""
},
{
"docid": "8e76ce600736b18c0dde94db9c4d625a",
"score": "0.5180639",
"text": "def register(instance)\n key = build_key(instance)\n key_registry[key] = instance\n end",
"title": ""
},
{
"docid": "4cb6d608856f2f61d40d3265afd94e08",
"score": "0.5077095",
"text": "def register(class_name, &block)\n\n # Get the message class from the provided class name.\n class_name = class_name.camelize.concat \"Message\"\n message_class = Java::JavaClass.for_name(\"org.nova.net.messages.\".concat class_name)\n\n # Create the message encoder and register it to the handler.\n encoder = ProcMessageEncoder.new block\n @handler.register_encoder message_class, encoder\n end",
"title": ""
},
{
"docid": "cc6240bc5047ce47cf2f75dc841bb685",
"score": "0.4974464",
"text": "def register(klass)\n raise TypeError, \"Can only register classes\" unless klass.is_a? Class\n raise ArgumentError, \"To register, a class must have TYPE defined\" unless klass.const_defined? :TYPE\n registered[klass::TYPE] = klass\n end",
"title": ""
},
{
"docid": "5da6fce29b5e4702470cec8e2055c908",
"score": "0.4952078",
"text": "def register_class(name, clazz)\n register(name, Component::Descriptor.new(clazz))\n end",
"title": ""
},
{
"docid": "98c5117ef6f305850d01a533ac3b8cbb",
"score": "0.49401072",
"text": "def instantiate( included_fsms )\n CFSM.state_machines( self.fsm ).inject([]) do |transitions, fsm|\n if included_fsms == :all || included_fsms.member?( fsm )\n transitions << Transition.new( fsm, self.new_state, self.transition_proc )\n end\n transitions\n end\n # note transitions returned from loop, so implicitly returned from method\n end",
"title": ""
},
{
"docid": "38e0b170b8ae728db2402961399076ec",
"score": "0.4919177",
"text": "def register(key, klass)\n container.register(key, klass)\n end",
"title": ""
},
{
"docid": "d5fbc3084cdf4983dee3dc84444a90a0",
"score": "0.4913797",
"text": "def register\n @is_registered = true\n self\n end",
"title": ""
},
{
"docid": "dfe603272fb4ff22b30ccc2f7d7bf29d",
"score": "0.49124923",
"text": "def register(klass)\n storage.add(klass) if klass\n end",
"title": ""
},
{
"docid": "f950cd5914f916cb926f5a77145f6776",
"score": "0.4909133",
"text": "def register\n cc = 0\n end",
"title": ""
},
{
"docid": "f5bc1095ee4403bd420f10a1f3ffc3c2",
"score": "0.49087963",
"text": "def register(name, klass)\n registry[name.to_sym] = klass\n end",
"title": ""
},
{
"docid": "85a4f08137f69073e8e9c3d3ec367605",
"score": "0.48899055",
"text": "def register(name, klass)\n @registry[name] = klass\n end",
"title": ""
},
{
"docid": "69bf5236985650b1741c176483bfddda",
"score": "0.488392",
"text": "def register(object); end",
"title": ""
},
{
"docid": "24fa8cd21c499cd42597f63b7f7c52d5",
"score": "0.48718444",
"text": "def register(event = nil, &handler)\r\n \r\n @handler = handler\r\n @event_type = event\r\n \r\n @event_type = :any unless event\r\n \r\n if @event_type == :any\r\n handler.instance_eval(&handler)\r\n end\r\n \r\n end",
"title": ""
},
{
"docid": "ca8d6855fc7ef12f420b49c5d9c17ffa",
"score": "0.48533458",
"text": "def run( options )\n # Check that for every defined class in the system, there is at least one instantiated FSM. If not\n # raise an exception.\n @cfsm_initial_state.each_key do |cfsm|\n raise CFSM::EmptyCFSMClass, \"#{namespace} has no instantiated FSMs\" if @cfsms[cfsm].nil?\n end\n\n @status = :running\n\n @options = options\n\n # Do the heavy lifting on converting the condition trees to optimised condition graphs.\n cache_conditions\n convert_trees_to_sets\n convert_sets_to_graph\n\n if CFSM.logger.info?\n @conditions.each_pair do |event_class, condition_graph|\n CFSM.logger.info \"Condition graph for #{event_class.to_s}\"\n condition_graph.inspect.each_line { |line| CFSM.logger.info ' ' << line.chomp }\n end\n end\n\n # For each CFSM namespace, we also have a queue to hold unprocessed events.\n @event_queue ||= PrioQueue.new\n\n # Ensure only one thread is actually in the process_event method.\n @process_mutex = Mutex.new\n\n # If running in sync mode, we set @thread to true to indicate the EventProcessor has been set to\n # run. If we are running in async mode then create a thread with an infinite loop to process incoming events.\n start_thread\n end",
"title": ""
},
{
"docid": "a2d06196fcc15516c2e2b56cbaf2db38",
"score": "0.48491687",
"text": "def new\n @event_registration = EventRegistration.new\n end",
"title": ""
},
{
"docid": "4ba2b094fd9736530e4af5ecf951016d",
"score": "0.48297417",
"text": "def initialize(initial_state, klass, &block)\n @class = klass\n @initial = initial_state\n @states = Hash.new\n @events = Hash.new\n @callbacks = {before: Hash.new , after: Hash.new}\n instance_eval &block\n end",
"title": ""
},
{
"docid": "ecd65b47220947404faf8c568e10032e",
"score": "0.48177263",
"text": "def register_klass(klass)\n self[klass.to_s.make_key] = {}\n CALLBACKS.each do |cb_sym|\n self[klass.to_s.make_key][cb_sym] = []\n end\n end",
"title": ""
},
{
"docid": "3e334efb7f59280a21f0747abd6b6b45",
"score": "0.4785439",
"text": "def register(klass, type)\n registry[type] = klass\n end",
"title": ""
},
{
"docid": "1dbc2702fe77b26ef4b12081d8257e6c",
"score": "0.47729737",
"text": "def create\n\n @event_registration = EventRegistration.new(event_registration_params)\n respond_to do |format|\n if @event_registration.save\n format.html { render action: 'show', notice: \"Registration successful! Want to register for another class?\" }\n format.json { render action: 'show', status: :created, location: @event_registration }\n else\n format.html { render action: 'new' }\n format.json { render json: @event_registration.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8abc9a60375b0169f881a245756e0d8e",
"score": "0.47588286",
"text": "def register(name, klass)\n Registry.instance.register(name, klass)\n end",
"title": ""
},
{
"docid": "e73ef323d1c174c4e5ffb48538f6b5ec",
"score": "0.47539526",
"text": "def add(event_klass, options)\n # TODO raise if events reach batch size?\n events << event_klass.new(self, options)\n end",
"title": ""
},
{
"docid": "17cd3b78dd9843c3356d92b23f2656b8",
"score": "0.47525048",
"text": "def register(type_name, klass = nil, **options, &block)\n registry.register(type_name, klass, **options, &block)\n end",
"title": ""
},
{
"docid": "f84e6a4df6ee17d1f711cf2bd496af37",
"score": "0.47437084",
"text": "def register(as_type, klass, constuctor_args = {})\n fail \"Registry key #{as_type} already taken - please use a different one because all subclass keys are shared\" if @@class_registry.key?(as_type.to_sym)\n @@class_registry[as_type.to_sym] = { klass: klass, args: constuctor_args }\nend",
"title": ""
},
{
"docid": "cda04508cb3ca00f6fb31e27e4d4fc60",
"score": "0.47411653",
"text": "def register_monitored_class(klass)\n @monitored_classes << klass\n end",
"title": ""
},
{
"docid": "fa60e9307fa459db0312609052ea05ab",
"score": "0.47220337",
"text": "def subscribe(cls, &block)\n @subscribers[cls.name] = block\n end",
"title": ""
},
{
"docid": "8d9bde6b2b97834860bd668d2485a07c",
"score": "0.4709804",
"text": "def register_one(owner, event, priority, &block); end",
"title": ""
},
{
"docid": "43839bfbb9013c007726faa53258e131",
"score": "0.47016266",
"text": "def push_reg reg\n @fisk.push reg.to_register\n end",
"title": ""
},
{
"docid": "a318d166efd5cf0fdbfc71c1bfe50cf2",
"score": "0.4697266",
"text": "def registration\n @registration ||= Registration.make!(event: event)\n end",
"title": ""
},
{
"docid": "eeca394b18fd702c0b869698ed6caed4",
"score": "0.46858564",
"text": "def register(handler)\n conf = @config\n bot = self\n isaac = @bot\n\n @bot.register{|type, msg|\n begin\n $log.debug \"Received message: #{type} #{msg}\"\n handler.dispatch(type, msg, bot.clone_state(msg)) # TODO: send a binding?\n rescue Exception => e\n $log.warn e.to_s\n $log.debug e.backtrace.join(\"\\n\")\n end\n }\n end",
"title": ""
},
{
"docid": "6d3c61670220c9eeb3321766b6e6b746",
"score": "0.4671563",
"text": "def set_up_form(form_class, form, token, get_request: false)\n find_or_initialize_registration(token)\n set_workflow_state if get_request\n return false unless setup_checks_pass?\n\n # Set an instance variable for the form (eg. @business_type_form) using the provided class (eg. BusinessTypeForm)\n instance_variable_set(\"@#{form}\", form_class.new(@transient_registration))\n end",
"title": ""
},
{
"docid": "6a33e98d603abee99f630338a57d5dd7",
"score": "0.46671206",
"text": "def on_event_registered(unit, event)\n event\n end",
"title": ""
},
{
"docid": "169a47898f4bfb3a5833b767afc7721f",
"score": "0.46668708",
"text": "def trackClass(clazz)\n @classes.push clazz\n end",
"title": ""
},
{
"docid": "af90ca033206a738b5b5db2d09c935c0",
"score": "0.46638435",
"text": "def fregister(message_type, message_subtype = nil, &listener)\n _register(message_type, message_subtype , Funnel.wrap(listener))\n end",
"title": ""
},
{
"docid": "2f618a4a607f164aa577d2a544b510dd",
"score": "0.4637383",
"text": "def register_state_handler(state, &block)\n register(state_key(state), &block)\n end",
"title": ""
},
{
"docid": "3bf9188ef514cb714e701e844a0b25a5",
"score": "0.4626672",
"text": "def register\n self.class.definitions[name] = self\n self\n end",
"title": ""
},
{
"docid": "a31ff7bcdc9455ce35afc19b1eab1886",
"score": "0.46218905",
"text": "def register(...)\n container.register(...)\n end",
"title": ""
},
{
"docid": "35761a517a159c33b6aa5d449e94a53e",
"score": "0.46190104",
"text": "def register_processor(*args, &block)\n register_preprocessor(*args, &block)\n end",
"title": ""
},
{
"docid": "018b781c1f7d0f33e658d17e6e723c5c",
"score": "0.46103945",
"text": "def set_up_form(form_class, form, token, get_request = false)\n find_or_initialize_transient_registration(token)\n\n set_workflow_state if get_request\n\n return false unless setup_checks_pass?\n\n # Set an instance variable for the form (eg. @business_type_form) using the provided class (eg. BusinessTypeForm)\n instance_variable_set(\"@#{form}\", form_class.new(@transient_registration))\n end",
"title": ""
},
{
"docid": "ea48930f2bfb3dd16194fb13fe79410b",
"score": "0.46094683",
"text": "def initial_state( cfsm_class )\n @cfsm_initial_state[ cfsm_class ]\n end",
"title": ""
},
{
"docid": "1050eab44fe8b533689f7c0c597623c9",
"score": "0.46016714",
"text": "def register_identifier(klass, identifier)\n Emittance::EventLookup::Registry.register_identifier klass: klass, identifier: identifier\n end",
"title": ""
},
{
"docid": "044610222d7334e6a020cfd4964a3ac7",
"score": "0.4601115",
"text": "def process_class(current_class)\n \n STDERR.print \"\\tProcessing #{current_class}\\n\" if @options.verbose\n \n # Only interested in acts_as_state_machine models.\n return unless current_class.respond_to?'states'\n \n node_attribs = []\n node_type = 'aasm'\n \n current_class.states.each do |state_name|\n state = current_class.read_inheritable_attribute(:states)[state_name]\n node_shape = (current_class.initial_state === state_name) ? \", peripheries = 2\" : \"\"\n node_attribs << \"#{current_class.name.downcase}_#{state_name} [label=#{state_name} #{node_shape}];\"\n end\n @graph.add_node [node_type, current_class.name, node_attribs]\n \n current_class.read_inheritable_attribute(:transition_table).each do |event_name, event|\n event.each do |transition|\n @graph.add_edge [\n 'event', \n current_class.name.downcase + \"_\" + transition.from.to_s, \n current_class.name.downcase + \"_\" + transition.to.to_s, \n event_name.to_s\n ]\n end\n end\n end",
"title": ""
},
{
"docid": "23d67defd4fbcf6a4404ec0c28651ca7",
"score": "0.45945668",
"text": "def register\n end",
"title": ""
},
{
"docid": "00a91de66b9d15c30a5b09b88ef719ef",
"score": "0.45887762",
"text": "def register_ctcp(msg, callback)\n @ctcp_callbacks.add(msg.to_s.upcase, callback)\n end",
"title": ""
},
{
"docid": "2b9f1c95beebae5a818ba9ce9aa6197e",
"score": "0.45867854",
"text": "def register(obj)\n case obj\n when Context\n obj.parent_context = self\n @child_contexts << obj\n when NodeAction\n @actions << obj\n end\n self\n end",
"title": ""
},
{
"docid": "eb8c268baf4ce01c1e6ec39757afe768",
"score": "0.45819268",
"text": "def register(ui, event_filter)\n @event_filter = event_filter\n ui.register(self)\n end",
"title": ""
},
{
"docid": "b48cda6b8b1bd6a5ad83c8e1383b5ee4",
"score": "0.45794046",
"text": "def register_for_class(course)\n # binding.pry\n if self.registrations.find_by(course_id: course.to_i).nil?\n Registration.create(student_id:self.id, course_id:course.to_i)\n else\n puts \"__________________________________________________________________________\"\n puts \"\\n❌ Error! You already registered for that class:\".red\n end\n registration_table = self.registrations.includes(:course)\n\n tp registration_table, {\"Subject\" => {:display_method => lambda{|x| x.course.subject}}}, {\"Registered On\" => {:display_method => lambda{|x| x.created_at}}}\n end",
"title": ""
},
{
"docid": "f5aefc3bb96ee71db2226637690cc3b9",
"score": "0.45782238",
"text": "def register(processor)\n return false if @processors.include? processor\n @processors[processor] = true\n end",
"title": ""
},
{
"docid": "454ab8bfbbeb07fe898801bc6c8a5d19",
"score": "0.45747668",
"text": "def gcmake_event\n Event.create :user_id => self.user_id, :gamecall_tag => self.id, :installgc_event_id => self.event_id, :title => self.title, :start_time => self.start_time, :end_time => self.end_time, :event_type => \"Gamecall\"\n end",
"title": ""
},
{
"docid": "16c262d2d1934462fcfbe58b3861daf7",
"score": "0.45734274",
"text": "def register(context)\n @context = context\n end",
"title": ""
},
{
"docid": "d557f0002ebfff4fb674d5d370ff5835",
"score": "0.45632356",
"text": "def register\n return self if registered?\n mod_instance = self\n sess = @session\n # class Class < SugarCRM::Base\n # module_name = \"Accounts\"\n # end\n klass = Class.new(SugarCRM::Base) do\n self._module = mod_instance\n self.session = sess\n end\n \n # class Account < SugarCRM::Base\n @session.namespace_const.const_set self.klass, klass\n self\n end",
"title": ""
},
{
"docid": "dc05004f2409233db21d5ac861c5df6a",
"score": "0.45631146",
"text": "def initialize( sender_type=nil )\n\t\t@sender = self.configured_sender( sender_type )\n\t\t@event_stack = Concurrent::ThreadLocalVar.new( &Array.method(:new) )\n\t\t@context_stack = Concurrent::ThreadLocalVar.new( &Array.method(:new) )\n\tend",
"title": ""
},
{
"docid": "783ddf49c042ffa437b29001d42150eb",
"score": "0.45597026",
"text": "def register_state_handler(state, &block)\n register(\"state_#{state}\", &block)\n end",
"title": ""
},
{
"docid": "e16b366a27b3a518a8f1181fdc461323",
"score": "0.45596603",
"text": "def register(name, check_class)\n @registry[name] = check_class\n end",
"title": ""
},
{
"docid": "fb52bf5515ef8dbfd360216704e99183",
"score": "0.45376778",
"text": "def regist(event, handler)\n @events[event] ||= []\n @events[event] << handler\n end",
"title": ""
},
{
"docid": "a9c087a1aa2918e5f45f29daefe93c5a",
"score": "0.45267868",
"text": "def event(type)\n Event.register(type, self)\n end",
"title": ""
},
{
"docid": "70a517cebb6997835527e7e2fead3f07",
"score": "0.45259497",
"text": "def register(name, options={})\n concerns(options[:as]) if options[:as].present?\n self.name = name.to_sym\n Trackerific::Services[self.name] = self\n end",
"title": ""
},
{
"docid": "df6c65234d0e182c26d6bf8849fa949c",
"score": "0.45185596",
"text": "def register_preprocessor(mime_type, klass, &block)\n expire_index!\n\n if block_given?\n name = klass.to_s\n klass = Class.new(Processor) do\n @name = name\n @processor = block\n end\n end\n\n @preprocessors[mime_type].push(klass)\n end",
"title": ""
},
{
"docid": "afd3f2f1cbe4b9a771af3e65f6e3c09f",
"score": "0.45183963",
"text": "def setup!\n Fission.registration.each do |key, klasses|\n klasses.each do |klass|\n args = [:fission, :workers, *key.split('.')]\n num = nil\n until(args.empty? || num)\n num = Carnivore::Config.get(*args)\n unless(num.is_a?(Fixnum))\n num = nil\n args.pop\n end\n end\n klass.workers = num.is_a?(Fixnum) ? num : 0\n src_key = key.split('.').first\n src = Carnivore::Source.source(src_key)\n if(src)\n name = klass.to_s.split('::').last\n src.add_callback(name, klass)\n else\n Carnivore::Utils.warn \"Workers defined for non-registered source: #{key}\"\n end\n end\n end\n\n # Setup process manager if needed\n # if(Carnivore::Config.get(:fission, :utils, :process, :max_processes).to_i > 0)\n # require 'fission/utils/process'\n # if(Carnivore::Config.get(:fission, :utils, :process, :spawn))\n # ChildProcess.posix_spawn = true\n # end\n # Utils::Process.supervise_as :process_manager\n # end\n end",
"title": ""
},
{
"docid": "854736217d2dcebccc3ceb3693b4fd21",
"score": "0.45051667",
"text": "def add_state(s)\n @states << s\n self\n end",
"title": ""
},
{
"docid": "262b659ebff0af079b54af15a058d33b",
"score": "0.45023683",
"text": "def push(fiber)\n\t\t\t\t@ready.push(fiber)\n\t\t\tend",
"title": ""
},
{
"docid": "9fc8b7a2d222b6c741a90f8c4ac69bb2",
"score": "0.44903788",
"text": "def set_up_form(form_class, form, reg_identifier)\n find_transient_registration(reg_identifier)\n\n # Set an instance variable for the form (eg. @conviction_approval_form) using the provided class\n instance_variable_set(\"@#{form}\", form_class.new(@transient_registration))\n end",
"title": ""
},
{
"docid": "af6f5d8d013e59ea51d2c6d8d8a60c33",
"score": "0.44822872",
"text": "def register(byte, type)\n MAPPINGS[byte] = type\n end",
"title": ""
},
{
"docid": "ca1dfea8c4e7d779a2c22178e3465229",
"score": "0.44773552",
"text": "def register\n end",
"title": ""
},
{
"docid": "ca1dfea8c4e7d779a2c22178e3465229",
"score": "0.44773552",
"text": "def register\n end",
"title": ""
},
{
"docid": "ca1dfea8c4e7d779a2c22178e3465229",
"score": "0.44773552",
"text": "def register\n end",
"title": ""
},
{
"docid": "46f9afad9bb89ef2d3e08f6094dd992f",
"score": "0.44742367",
"text": "def add_wf_processor(document, name, component)\n #processor_port=\"\", port_name=\"\",\n #port_description=\"\", port_example=\"\", port_type=2)\n root = document.root\n\n processors = root.elements[Top_dataflow].elements[\"processors\"]\n\n # Build the processor node\n new_processor = Element.new(\"processor\")\n # Add the name for the processor, if empty use the same as component name\n proc_name = Element.new(\"name\")\n if name.nil? || name == \"\"\n proc_name.text = component.name\n else\n proc_name.text = name\n end\n\n new_processor.add_element(proc_name)\n\n # Add element for procesor inputs\n processor_inputs = Element.new(\"inputPorts\")\n # this can be null at the beginning since it is not connected\n new_processor.add_element(processor_inputs)\n\n # Add element for procesor outputs\n processor_outputs = Element.new(\"outputPorts\")\n # this can be null at the beginning since it is not connected\n new_processor.add_element(processor_outputs)\n\n # Add element for procesor annotations\n processor_annotations = Element.new(\"annotations\")\n # this can be null at the beginning since it is not annotated\n new_processor.add_element(processor_annotations)\n\n # Build element for procesor activities\n processor_activities = Element.new(\"activities\")\n # build an activity node for the component\n activity_node=build_activity_for_component(component)\n # add the activity node to activities\n processor_activities.add_element(activity_node)\n # add activities to processor\n new_processor.add_element(processor_activities)\n\n # Build element for dispatch stack\n processor_dispatch_stack = build_dispatch_stack_for_component()\n # add dispatch stack to processor\n new_processor.add_element(processor_dispatch_stack)\n\n # Build element for iteration stack\n processor_iteration_stack = build_iteration_stack_for_component()\n # add iteration stack to processor\n new_processor.add_element(processor_iteration_stack)\n\n # add the processor to the workflow\n processors.add_element(new_processor)\n end",
"title": ""
},
{
"docid": "8ceb7b7bcc452bb6ebe34fb6f63163a5",
"score": "0.44731018",
"text": "def process workflow_class, message\n @processed_messages << OpenStruct.new(workflow_class: workflow_class, message: message)\n end",
"title": ""
},
{
"docid": "bd488b40ad2da6e6485c703ee32c5f84",
"score": "0.4471683",
"text": "def initialize(event = nil)\n @event = event\n end",
"title": ""
},
{
"docid": "e32d29cd5504646e7a590c3bc8a0986d",
"score": "0.44706222",
"text": "def register\r\n \r\n end",
"title": ""
},
{
"docid": "1bb888db38fd2adcab5f5f623591d2c5",
"score": "0.44638267",
"text": "def sparkRegisterCustomInput(className)\n logNormal($sparkPrefix + \" sparkRegisterCustomInput \" + className + \"\\n\")\n sparkGetSimulationServer()\n sparkCreate(className, $serverPath+'simulation/InputControl/'+className)\nend",
"title": ""
},
{
"docid": "c4f2e3f20a9e02b215dde10dbe0c299b",
"score": "0.44611835",
"text": "def register(*args)\n registry.register(*args)\n end",
"title": ""
},
{
"docid": "ed8613ba62201fb0c5f9f14f0953e491",
"score": "0.44596988",
"text": "def register\n @typeperf = TypeperfWrapper.new(PerfmonProcGetter.new, @interval)\n @counters.each { |counter| @typeperf.add_counter(counter) }\n end",
"title": ""
},
{
"docid": "851936b3aee09c1fa8e13fb11d941d0d",
"score": "0.44478816",
"text": "def register_class(clazz, options)\n handle_drb_error { @server.register_class clazz.name }\n end",
"title": ""
},
{
"docid": "89836aa883beffb15c4eb570871d7640",
"score": "0.44462058",
"text": "def register\n \n end",
"title": ""
},
{
"docid": "6ad899c54959069bee419161244d7dd5",
"score": "0.44375995",
"text": "def create(form_class, form)\n return false unless set_up_form(form_class, form, params[:token])\n\n fetch_presenters\n\n submit_form(instance_variable_get(\"@#{form}\"), transient_registration_attributes)\n end",
"title": ""
},
{
"docid": "9d3f5438ba283adeecedd381343b24d4",
"score": "0.44343382",
"text": "def register(key, &factory)\n @factories[key] = factory\n self\n end",
"title": ""
},
{
"docid": "89167f2d047ffcfde1b8935b8ff33b7a",
"score": "0.44221303",
"text": "def register_ctype(type, klass)\n ctypes[type] = klass\n end",
"title": ""
},
{
"docid": "3c6b1d068e973f1d74bb3a5938268d96",
"score": "0.44218764",
"text": "def register(path)\n\t\t\t\tpath = path.to_sym\n\t\t\t\tif @@registry[path].nil?\n\t\t\t\t\tcallback = proc { |event| Actor[:zk_service].async.event_callback(path, event) }\n\t\t\t\t\t@@registry[path] = @@zk.register(path.to_s, &callback)\n\t\t\t\tend\n\t\t\t\t@@registry_count[path] = (@@registry_count[path] || 0) + 1\n\t\t\tend",
"title": ""
},
{
"docid": "2cc6abad09b046c4f7a9a406945a11b2",
"score": "0.4421874",
"text": "def on(event, &block)\n if block_given?\n if (@@valid_events.include? event)\n define_singleton_method(event, block)\n else\n puts \"Error: trying to assign invalid event | Letteropend::Film, event: #{event}\"\n end\n end\n end",
"title": ""
},
{
"docid": "7b4f04fb254891aeaebfd1d78b7429da",
"score": "0.44209173",
"text": "def create(form_class, form)\n return false unless set_up_form(form_class, form, params[:token])\n\n # Submit the form by getting the instance variable we just set\n submit_form(instance_variable_get(\"@#{form}\"), transient_registration_attributes)\n end",
"title": ""
},
{
"docid": "aa6fc6c27b4678eedcc26829e71067b5",
"score": "0.44165745",
"text": "def register_for(id); end",
"title": ""
},
{
"docid": "287a5d0e43865654f82d5e10a9806998",
"score": "0.44147027",
"text": "def initialize\n @hook_register = Hash.new(nil)\n @lever_register = Hash.new(nil)\n end",
"title": ""
},
{
"docid": "cba739f4f9c5d4ee9b73d68a1871cf23",
"score": "0.4410168",
"text": "def register_node\n @registered = @registry.register_node(system)\n end",
"title": ""
},
{
"docid": "da0f4aa48344bef7fc2f1f8a37a01a95",
"score": "0.4409809",
"text": "def add_new_factory(options={}, &constructor_block)\n factory = Factory::FromArgs.new(options, &constructor_block)\n add_factory_instance(factory, options)\n end",
"title": ""
},
{
"docid": "da0f4aa48344bef7fc2f1f8a37a01a95",
"score": "0.4409809",
"text": "def add_new_factory(options={}, &constructor_block)\n factory = Factory::FromArgs.new(options, &constructor_block)\n add_factory_instance(factory, options)\n end",
"title": ""
},
{
"docid": "7db2f015b3440588743e829ea1e3ec19",
"score": "0.440969",
"text": "def add(c)\n @mutex.synchronize do\n @input << c\n @trigger << \"*\"\n end\n end",
"title": ""
},
{
"docid": "d48a222fbd290ad9db35e9948d48c239",
"score": "0.44020626",
"text": "def initialize(channel, events)\n @events = events\n @channel = channel\n end",
"title": ""
},
{
"docid": "630fc4f8b3c355b0032e9dbfc2b34184",
"score": "0.44007477",
"text": "def on(event, &block)\n event = event.to_sym\n raise ArgumentError, \"Invalid event name: #{event}\" unless LIFECYCLE_EVENTS.include?(event)\n events[event] << block\n end",
"title": ""
},
{
"docid": "3c3d112e2debf89b675c0d3f39b52748",
"score": "0.43998116",
"text": "def register\n return self if registered?\n mod_instance = self\n # class Class < SugarCRM::Base\n # module_name = \"Accounts\"\n # end\n klass = Class.new(SugarCRM::Base) do\n self._module = mod_instance\n end \n \n # class Account < SugarCRM::Base\n SugarCRM.const_set self.klass, klass\n self\n end",
"title": ""
},
{
"docid": "ba73e5d9af7f53999383bc10f9dea280",
"score": "0.43969995",
"text": "def push_state state\n\t\t\t@state_buffer = Proc.new do\n\t\t\t\t@states.push @current_state\n\t\t\t\t@current_state = state\n\t\t\t\t@current_state.setup\n\t\t\tend\n\t\tend",
"title": ""
},
{
"docid": "f136434a457aa482902e15685be76659",
"score": "0.4395995",
"text": "def register\n @workflow_type_options.delete_if {|workflow_type_options| workflow_type_options[:version].nil?}\n @workflow_type_options.each do |workflow_type_options|\n begin\n @service.register_workflow_type(workflow_type_options)\n rescue AWS::SimpleWorkflow::Errors::TypeAlreadyExistsFault => e\n @logger.warn \"#{e.class} while trying to register workflow #{e.message} with options #{workflow_type_options}\"\n # Purposefully eaten up, the alternative is to check first, and who\n # wants to do two trips when one will do?\n end\n end\n end",
"title": ""
},
{
"docid": "41f103070f8114461f0779cb83867972",
"score": "0.43908846",
"text": "def create(state)\n self.class.lock!\n state[:hostname] = Socket.gethostname\n logger.info(\"[Localhost] Instance #{instance} ready.\")\n end",
"title": ""
}
] |
05750c63a913adcde29e8e243ec9d716 | GET /gameboards/1 GET /gameboards/1.json | [
{
"docid": "a81945373733e4951b987de6ea99f9a1",
"score": "0.0",
"text": "def show\n end",
"title": ""
}
] | [
{
"docid": "62cf92c5a4f7380a3ff1ce83344065cd",
"score": "0.75478655",
"text": "def show \n boardgame = Boardgame.find(params[:id])\n render json: boardgame\n end",
"title": ""
},
{
"docid": "d42a1d54643e99fd934c51eb9822091b",
"score": "0.7522744",
"text": "def show\n @boardgame_id = params[:boardgame_id]\n response = HTTParty.get('https://www.boardgameatlas.com/api/search?ids=' + @boardgame_id + '&client_id=' + ENV['CLIENT_ID'])\n @boardgame = response[\"games\"].first\n end",
"title": ""
},
{
"docid": "cb820ec88fba6fcbc685dc832bef9b8c",
"score": "0.7458598",
"text": "def index\n @boards = Board.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @boards }\n end\n end",
"title": ""
},
{
"docid": "b4f1d2986e4c534241d193cd4065bf9f",
"score": "0.7364251",
"text": "def show\n render json: @boardgame\n end",
"title": ""
},
{
"docid": "e258d3615fbfb044bcf98e0177db854e",
"score": "0.7326841",
"text": "def index\n @boardgames = Boardgame.all\n render json: @boardgames \n end",
"title": ""
},
{
"docid": "ea3299e54cb35af5ca2c0297873bbd76",
"score": "0.7173099",
"text": "def get_all_boards\n request(Net::HTTP::Get, \"/api/#{API_VERSION}/#{RESOURCE_NAME}\", nil, nil, false)\n end",
"title": ""
},
{
"docid": "93dd92cd55439fa14284e5325fdf89d2",
"score": "0.7145748",
"text": "def show\n @board = Board.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @board }\n end\n end",
"title": ""
},
{
"docid": "93dd92cd55439fa14284e5325fdf89d2",
"score": "0.7145748",
"text": "def show\n @board = Board.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @board }\n end\n end",
"title": ""
},
{
"docid": "66d401fc9c3b7d26aa7669f594b08aff",
"score": "0.7072082",
"text": "def index\n @game_boards = GameBoard.all\n end",
"title": ""
},
{
"docid": "dde5ca4f3abcd84d1918860cc3fd7313",
"score": "0.70633286",
"text": "def show\n board = Board.find_by(id: params[:id])\n if board.nil?\n board = Board.find_by(custom_url: params[:id])\n if board.nil?\n render json: {error: \"No board found\"}\n return\n end\n end\n render json: board\n return\n end",
"title": ""
},
{
"docid": "d99d3abe8f6ef1414c0ab818e84594f1",
"score": "0.70614624",
"text": "def show\n render json: CommunityBoards.find(params[\"id\"])\n end",
"title": ""
},
{
"docid": "8c4a007aecc67eaaf38769c8e9cc1156",
"score": "0.7054698",
"text": "def index\n\t\tuid = current_user().id\n\t\t@boards = User.find(uid).boards\n\n\t\trender :json => @boards\n end",
"title": ""
},
{
"docid": "7b7612bad7d11ce61611508c2ed19d6e",
"score": "0.7047019",
"text": "def show\n json_response(@board)\n end",
"title": ""
},
{
"docid": "341b897f87bb8dcbe18476ce455431b2",
"score": "0.70067596",
"text": "def index\r\n\tunless user_signed_in?\r\n\t\tredirect_to \"/auth/login\"\r\n\t\treturn\r\n\tend\r\n\t\r\n @boards = Board.getUserBoards(current_user.id)\r\n\r\n respond_to do |format|\r\n format.html # index.html.erb\r\n format.json { render json: @boards }\r\n end\r\n end",
"title": ""
},
{
"docid": "ed51524504e90f676e7251f39ded5d0e",
"score": "0.69958335",
"text": "def index\n\n respond_to do |format|\n format.html { @boards = Board.where network_id: current_user.network_id }\n format.json { @boards = Board.where network_id: current_user.network_id }\n\n end\n end",
"title": ""
},
{
"docid": "395044b6dbb34bc00f143ddb1d650907",
"score": "0.6960851",
"text": "def index\n @games = @match.games\n render json: @games, root: false\n end",
"title": ""
},
{
"docid": "e03b861954cf56734eefe658f5bbfc40",
"score": "0.6938658",
"text": "def index\n @g_game_boards = GGameBoard.all\n end",
"title": ""
},
{
"docid": "b9a8cecdccf09737ec3309f7c293a2d5",
"score": "0.6926405",
"text": "def show\n render json: @game, status: 200\n end",
"title": ""
},
{
"docid": "bd0d8fcad53ffc64a4c20fd31f603a2b",
"score": "0.6916841",
"text": "def index\n user = User.find_by_nickname(params[:nickname])\n @boards = Board.find_all_by_user_id(user.id)\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @boards }\n end\n end",
"title": ""
},
{
"docid": "3deede622c8ad47ca38227b06c6b6204",
"score": "0.6883739",
"text": "def show\n @game = @game_week.games.find(params[:id])\n render json: @game\n end",
"title": ""
},
{
"docid": "2aba877a7321a29b8be7a4918d85e1a2",
"score": "0.6840887",
"text": "def index\n @games = @game_week.games\n render json: @games\n end",
"title": ""
},
{
"docid": "5a6a9457b4514dc39f5897f7f05396c5",
"score": "0.67986375",
"text": "def index\n @boards = Board.joins(:memberships).where('memberships.user_id= ?', @current_user.id)\n json_response(@boards)\n end",
"title": ""
},
{
"docid": "a4a8e6afce30992263d4c8f6fbed920c",
"score": "0.67976403",
"text": "def index\n @scrum_board = ScrumBoard.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @scrum_board }\n end\n end",
"title": ""
},
{
"docid": "5068a0ca27ae23b1d06258f1bf2f195a",
"score": "0.6785816",
"text": "def index\n @games = Game.all\n render json: @games, status: 200\n end",
"title": ""
},
{
"docid": "c7732b8d1fb3f1a3f89bc08a581c627f",
"score": "0.6776845",
"text": "def index\n @boards = Board.all\n end",
"title": ""
},
{
"docid": "c7732b8d1fb3f1a3f89bc08a581c627f",
"score": "0.6776845",
"text": "def index\n @boards = Board.all\n end",
"title": ""
},
{
"docid": "c7732b8d1fb3f1a3f89bc08a581c627f",
"score": "0.6776845",
"text": "def index\n @boards = Board.all\n end",
"title": ""
},
{
"docid": "80fe770d95135515eee16c3fdb477ca1",
"score": "0.67669684",
"text": "def show\n game = Game.find(params[:id])\n render json: game\n end",
"title": ""
},
{
"docid": "06c6a4c484d222856415642faa96a798",
"score": "0.6760291",
"text": "def index\n render json: CommunityBoards.all\n end",
"title": ""
},
{
"docid": "66c643feb7fba5edec82ad9ef950a179",
"score": "0.6751538",
"text": "def index\n @boards = query(Board, :name, :fullname)\n\n respond_to do |format|\n format.html\n format.xml { render :xml => @boards }\n end\n end",
"title": ""
},
{
"docid": "86c56016b41860e9d5db0e31048a111c",
"score": "0.6744902",
"text": "def show\n @game = Game.find(params[:id].to_i)\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @game }\n end\n end",
"title": ""
},
{
"docid": "af8256d6a2a5f118b1a21ad787749239",
"score": "0.67416674",
"text": "def index\n\t\t@boards = Group.find_by_number(params[:group_id]).boards.order(id: :desc)\n\n\t\t# respond_to do |format|\n\t\t\t# format.html\n\t\t\t# format.json { render json: @boards }\n\t\t# end\n\t\t# render json: @boards, include: :comments\n\t\trender json: @boards.to_json(:methods => [:comment_size, :user_nick_name])\n\tend",
"title": ""
},
{
"docid": "3f43dba73b753b20174786b19e04be7f",
"score": "0.6740313",
"text": "def show\n @board = Board.find(params[:id])\n if @board\n render :show\n else\n render json: \"This board does not exist\", status: 422\n end \n \n end",
"title": ""
},
{
"docid": "270004217178d22dbd090aacf926ac2d",
"score": "0.6725588",
"text": "def show\n @baseboard = Baseboard.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @baseboard }\n end\n end",
"title": ""
},
{
"docid": "b49a9213c2fcfbaf78c0ef75757e30ee",
"score": "0.67247015",
"text": "def index\n @games = Game.all\n render json: @games\n end",
"title": ""
},
{
"docid": "b49a9213c2fcfbaf78c0ef75757e30ee",
"score": "0.67247015",
"text": "def index\n @games = Game.all\n render json: @games\n end",
"title": ""
},
{
"docid": "639e699620a1ab54f361a4d41404be70",
"score": "0.6719777",
"text": "def show\n @scoreboard = Scoreboard.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @scoreboard }\n end\n end",
"title": ""
},
{
"docid": "d61775aa12a53daf39fd42a47c28b954",
"score": "0.67111737",
"text": "def index\n # TODO: pagination\n @boards = @boards.order('created_at desc')\n render :index, status: :ok\n end",
"title": ""
},
{
"docid": "61e7436abbe222ea78645431ffc3315b",
"score": "0.6701245",
"text": "def show\n @mainboard = Mainboard.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @mainboard }\n end\n end",
"title": ""
},
{
"docid": "3c632d69dde8f15577bae164a89dd151",
"score": "0.66985947",
"text": "def show\n render json: @game\n end",
"title": ""
},
{
"docid": "3c632d69dde8f15577bae164a89dd151",
"score": "0.66985947",
"text": "def show\n render json: @game\n end",
"title": ""
},
{
"docid": "3c632d69dde8f15577bae164a89dd151",
"score": "0.66985947",
"text": "def show\n render json: @game\n end",
"title": ""
},
{
"docid": "3c632d69dde8f15577bae164a89dd151",
"score": "0.66985947",
"text": "def show\n render json: @game\n end",
"title": ""
},
{
"docid": "3c36a6abda4c028933220a93ae5cd37f",
"score": "0.6682885",
"text": "def getBoard(boardId)\n\tresponse = RestClient.get(\"https://api.trello.com/1/boards/\"+boardId+\"/?&key=\"+$key+\"&token=\"+$token)\n\tresponse = JSON.parse(response)\t\nend",
"title": ""
},
{
"docid": "102fee40069f0a76929a947af157b820",
"score": "0.667746",
"text": "def show\n render :json => Game.find(params[:id])\n end",
"title": ""
},
{
"docid": "6697ed6cf71657bec3af7c4d29d70d31",
"score": "0.667669",
"text": "def show\n render json: @game\n end",
"title": ""
},
{
"docid": "781d222be7133409145d2282906672f9",
"score": "0.6670428",
"text": "def get_board(board, cookie = nil)\n JSON.parse(get(API + \"/board/\" + board, cookie).body)\n end",
"title": ""
},
{
"docid": "598b5e71abca6ba273b26a8fb355aa4c",
"score": "0.6662691",
"text": "def get_user_boards\n board = Board.where(user_id: current_user.id)\n render json: board\n end",
"title": ""
},
{
"docid": "ce2b2df9043def0a0613db19aaa66843",
"score": "0.6648781",
"text": "def show\n @html5game = Html5game.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @html5game }\n end\n end",
"title": ""
},
{
"docid": "08bea4518a25e3b51930ef0b865c9a14",
"score": "0.66413474",
"text": "def index\n games = Game.all\n render json: games, status: :ok \n end",
"title": ""
},
{
"docid": "c719feefd7580aa4e50437078deb8cce",
"score": "0.6635255",
"text": "def show\n render json: @games_leaderboards_score\n end",
"title": ""
},
{
"docid": "aca2dd2ed71112a43324fb992ff3b859",
"score": "0.6633413",
"text": "def show\n @toushikomon_board = ToushikomonBoard.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @toushikomon_board }\n end\n end",
"title": ""
},
{
"docid": "a54561fb42c1397dafc134539a93fc05",
"score": "0.6629577",
"text": "def show\n @game = Game.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @game }\n end\n end",
"title": ""
},
{
"docid": "a54561fb42c1397dafc134539a93fc05",
"score": "0.6629577",
"text": "def show\n @game = Game.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @game }\n end\n end",
"title": ""
},
{
"docid": "a54561fb42c1397dafc134539a93fc05",
"score": "0.6629577",
"text": "def show\n @game = Game.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @game }\n end\n end",
"title": ""
},
{
"docid": "a54561fb42c1397dafc134539a93fc05",
"score": "0.6629577",
"text": "def show\n @game = Game.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @game }\n end\n end",
"title": ""
},
{
"docid": "a54561fb42c1397dafc134539a93fc05",
"score": "0.6629577",
"text": "def show\n @game = Game.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @game }\n end\n end",
"title": ""
},
{
"docid": "a54561fb42c1397dafc134539a93fc05",
"score": "0.6629577",
"text": "def show\n @game = Game.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @game }\n end\n end",
"title": ""
},
{
"docid": "a54561fb42c1397dafc134539a93fc05",
"score": "0.6629577",
"text": "def show\n @game = Game.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @game }\n end\n end",
"title": ""
},
{
"docid": "a54561fb42c1397dafc134539a93fc05",
"score": "0.6629577",
"text": "def show\n @game = Game.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @game }\n end\n end",
"title": ""
},
{
"docid": "a54561fb42c1397dafc134539a93fc05",
"score": "0.6629577",
"text": "def show\n @game = Game.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @game }\n end\n end",
"title": ""
},
{
"docid": "a54561fb42c1397dafc134539a93fc05",
"score": "0.6629577",
"text": "def show\n @game = Game.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @game }\n end\n end",
"title": ""
},
{
"docid": "a54561fb42c1397dafc134539a93fc05",
"score": "0.6629577",
"text": "def show\n @game = Game.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @game }\n end\n end",
"title": ""
},
{
"docid": "972686307ca845f2b8024552d3663c97",
"score": "0.6629237",
"text": "def getBoardsByOrganization(orgId)\n\tboards = RestClient.get(\"https://api.trello.com/1/organizations/\"+orgId+\"/boards?key=\"+$key+\"&token=\"+$token+\"&filter=open\")\n\tboards = JSON.parse(boards)\nend",
"title": ""
},
{
"docid": "f88142281ea43b4e4e6bc11798d0f4e2",
"score": "0.6613584",
"text": "def show\n get_boards_by_user\n end",
"title": ""
},
{
"docid": "9b185332572b31be4e66b2be4673d083",
"score": "0.6604479",
"text": "def index\n @games_boardgames = Games::Boardgame.all\n end",
"title": ""
},
{
"docid": "0e0bc0872efbafb5d784356d44ca32f2",
"score": "0.6588707",
"text": "def show\n @team_game = TeamGame.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @team_game }\n end\n end",
"title": ""
},
{
"docid": "0dcf070acff280e1ba8057c05a3551a9",
"score": "0.65870917",
"text": "def show\r\n @game = Game.find(params[:id])\r\n\r\n respond_to do |format|\r\n format.html # show.html.erb\r\n format.json { render json: @game }\r\n end\r\n end",
"title": ""
},
{
"docid": "7e1a63c8916289b870c7ccdbcaad1620",
"score": "0.6579778",
"text": "def show\n @bettergame = Bettergame.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @bettergame }\n end\n end",
"title": ""
},
{
"docid": "75314619ad1b065f43514f855ab5193a",
"score": "0.6573633",
"text": "def index\n @boards = GameBoard.paginate(page: params[:page])\n end",
"title": ""
},
{
"docid": "206e1d81b35d0e35fae85b8cef8c3cbf",
"score": "0.6568708",
"text": "def index\n @boardgames = Boardgame.all\n end",
"title": ""
},
{
"docid": "a4bcb9c79f387c1bd625215f2f26a926",
"score": "0.6558134",
"text": "def show\n @game = Game.find_by_sql(\"SELECT * FROM Games G WHERE G.id = \" + params[:id]).first()\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @game }\n end\n end",
"title": ""
},
{
"docid": "902554d85013ffc6f4d1cdcd1aaee099",
"score": "0.654152",
"text": "def index\n @games = Game.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @games }\n end\n end",
"title": ""
},
{
"docid": "902554d85013ffc6f4d1cdcd1aaee099",
"score": "0.654152",
"text": "def index\n @games = Game.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @games }\n end\n end",
"title": ""
},
{
"docid": "902554d85013ffc6f4d1cdcd1aaee099",
"score": "0.654152",
"text": "def index\n @games = Game.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @games }\n end\n end",
"title": ""
},
{
"docid": "902554d85013ffc6f4d1cdcd1aaee099",
"score": "0.654152",
"text": "def index\n @games = Game.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @games }\n end\n end",
"title": ""
},
{
"docid": "6f5662b42d92bd57a3d8dc3d5e5b2a42",
"score": "0.65329444",
"text": "def index\n if $game\n game_map = $game.game_board.to_json_map\n game_map[:game_in_play] = $game.game_in_play\n game_map[:awaiting_suggest_response] = $game.awaiting_suggest_response\n game_map[:suggestion] = $game.suggestion\n game_map[:suggest_response] = $game.suggestion\n render json: [game_map]\n else\n render json: []\n end\n end",
"title": ""
},
{
"docid": "83d4b81fa3d19e22ef7d225898365477",
"score": "0.653096",
"text": "def index\n @gameboards = Gameboard.find_by_user_id(payload['user_id']) \n render json: @gameboards, :include => [:kill], :except => [ :created_at, :updated_at]\n\n end",
"title": ""
},
{
"docid": "d0cddc265991e596f942776cf6e004d4",
"score": "0.6526621",
"text": "def show\n render json: @game, root: false\n end",
"title": ""
},
{
"docid": "502c96e573d8a2272691cfc2c4c04ba2",
"score": "0.6526497",
"text": "def show\n @mygame = Mygame.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @mygame }\n end\n end",
"title": ""
},
{
"docid": "d6e7602a23070b27736d456b2cd4e0c2",
"score": "0.652478",
"text": "def show\n @leader_board = LeaderBoard.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @leader_board }\n end\n end",
"title": ""
},
{
"docid": "f6fff751cc13157d48cd3db66be461e1",
"score": "0.65041864",
"text": "def show\n @conversation = Conversation.find(params[:id])\n load_board\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @conversation }\n end\n end",
"title": ""
},
{
"docid": "2df82c6abc2e8ef2c3a817523aed0af0",
"score": "0.65038127",
"text": "def index\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @message_boards }\n end\n end",
"title": ""
},
{
"docid": "5487c38fc36d3865d75e4647642192ca",
"score": "0.6493072",
"text": "def show\n @tournament_game = TournamentGame.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @tournament_game }\n end\n end",
"title": ""
},
{
"docid": "15b9ea6b64f5bf4e16c6a4d82a543bae",
"score": "0.6493021",
"text": "def show\n @board_content = BoardContent.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @board_content }\n end\n end",
"title": ""
},
{
"docid": "61588d92ebde89de21eaea149b139fec",
"score": "0.6489458",
"text": "def index\n @resource_games = Resource::Game.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @resource_games }\n end\n end",
"title": ""
},
{
"docid": "74c2712cecb3719910ccffeee0036039",
"score": "0.64692193",
"text": "def shows\n @game = Game.find(params[:id])\n json_response(@game, :ok)\n end",
"title": ""
},
{
"docid": "7250de7dc383d8adc7a3836eee64568a",
"score": "0.6461559",
"text": "def show\n @motherboard = Motherboard.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @motherboard }\n end\n end",
"title": ""
},
{
"docid": "d17bfef952fc3b93a766fd498dfc6c99",
"score": "0.6459193",
"text": "def index\n @battles = Battle.all\n\n render json: @battles\n end",
"title": ""
},
{
"docid": "85856bc46f4dea8143554ac5bddfa804",
"score": "0.6450467",
"text": "def index\n @mygames = Mygame.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @mygames }\n end\n end",
"title": ""
},
{
"docid": "9ecd13ecd0651d4c7c514e2b99ae5bec",
"score": "0.6449799",
"text": "def show\n @gamecoholder = Gamecoholder.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @gamecoholder }\n end\n end",
"title": ""
},
{
"docid": "f29558e2b0644f17fea8b7fe8fe5361e",
"score": "0.64484715",
"text": "def show\n @game = Game.find(params[:id])\n\n respond_to do |format|\n if !@game.blank?\n format.json { render json: @game }\n else\n format.json { render json: \"{ 'error' : 'Bad parameters, game not founded' }\", status: :unprocessable_entity }\n end\n end \n end",
"title": ""
},
{
"docid": "854eeb118842534d69f7891636dc8149",
"score": "0.64372325",
"text": "def show\n @board = Board.find(params[:id])\n @latest_posts = Post.order(\"created_at DESC\").limit(6)\n @latest_comments = Comment.order(\"created_at DESC\").limit(6)\n @posts = @board.posts.order(\"created_at DESC\").page(params[:page]).per(10)\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @board }\n end\n end",
"title": ""
},
{
"docid": "83a9f016f22e63292e2bd63a250a5de1",
"score": "0.6428467",
"text": "def index\n @boards = Board.limit(NUMBER_OF_BOARDS)\n end",
"title": ""
},
{
"docid": "14f57a293c8b17fa4195683ea49b0c1f",
"score": "0.64254475",
"text": "def boards(options = { :filter => :all })\n return @boards if @boards\n @boards = Client.get(\"/members/#{username}/boards\", options).json_into(Board)\n end",
"title": ""
},
{
"docid": "7f28a68426c6da6f184441322c37dd39",
"score": "0.6425271",
"text": "def show\n render json: @user_board\n end",
"title": ""
},
{
"docid": "186948108ddaba27dcbaa0f4c74c45af",
"score": "0.6424425",
"text": "def index\n @battles = Battle.order('id DESC').limit(100)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @battles }\n end\n end",
"title": ""
},
{
"docid": "4627d1636814b9b8ba32a33091084f9f",
"score": "0.6410385",
"text": "def index\n @games_leaderboards_scores = Games::Leaderboards::Score.all\n\n render json: @games_leaderboards_scores\n end",
"title": ""
},
{
"docid": "5891db8ab8271de9f56e62c23108e1e1",
"score": "0.6408017",
"text": "def show\n @account_game = AccountGame.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @account_game }\n end\n end",
"title": ""
},
{
"docid": "e1c822f1f0390c7a6b76e56725e9f3ae",
"score": "0.6405327",
"text": "def index\n @boards = image_board.boards.all\n end",
"title": ""
},
{
"docid": "8d53596963691af7f5b67c3128db376b",
"score": "0.64038414",
"text": "def show\n @game_history = GameHistory.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @game_history }\n end\n end",
"title": ""
}
] |
520eb00634469947009ff41e86400aa9 | Whether objects are identical to each other | [
{
"docid": "f210b6589b67fc4dd2065be8a64142e4",
"score": "0.0",
"text": "def eql?(other)\n self.class == other.class && self == other\n end",
"title": ""
}
] | [
{
"docid": "784c435f8fc805781a2152d0f854d335",
"score": "0.79315263",
"text": "def identical?; end",
"title": ""
},
{
"docid": "784c435f8fc805781a2152d0f854d335",
"score": "0.79315263",
"text": "def identical?; end",
"title": ""
},
{
"docid": "2650044e29f8cfdcfb568fed6dbd2f76",
"score": "0.7761596",
"text": "def identical?(exp)\n exp.object_id == object_id\n end",
"title": ""
},
{
"docid": "6ab9f46e2ac46433d40d73181fb613a1",
"score": "0.7678666",
"text": "def eql?(obj); self.eql_count += 1; super; end",
"title": ""
},
{
"docid": "6ef7ffce7aa61b400e53e5618bff4168",
"score": "0.75521636",
"text": "def are_identical_symbols_same_objects?\n return true\nend",
"title": ""
},
{
"docid": "ffa293d8c540a93db4efe130b6acc02b",
"score": "0.75109535",
"text": "def objects_duplicable?\n true\n end",
"title": ""
},
{
"docid": "b7fea6103ca6696b2c688a0da422727a",
"score": "0.74851394",
"text": "def are_identical_symbols_same_objects?\n true\nend",
"title": ""
},
{
"docid": "930417f65e0eaa46aab3122ed541b10d",
"score": "0.74774414",
"text": "def eql?(obj)\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "12a7075d31abd913343bcb374a7eae86",
"score": "0.74721426",
"text": "def identical?\n exists?\n end",
"title": ""
},
{
"docid": "12a7075d31abd913343bcb374a7eae86",
"score": "0.74721426",
"text": "def identical?\n exists?\n end",
"title": ""
},
{
"docid": "8c2e302fe7c00adf72ee437acfc83c1f",
"score": "0.7444109",
"text": "def eql?(other)\n return false if !other.instance_of? self.class\n return true if self.object_id == other.object_id\n\n self.raw == other.raw # if it's exactly the same line then the objects are the same\n end",
"title": ""
},
{
"docid": "bf32bb15f3d0dda9c6e4512651f0af99",
"score": "0.7443112",
"text": "def same?(other)\n self.inspect == other.inspect\n end",
"title": ""
},
{
"docid": "70efecebab22c6351f094549935656d6",
"score": "0.73749524",
"text": "def == object\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "973e36bf490dc5ed1dd46e0edb187b49",
"score": "0.7338674",
"text": "def eql?(other)\n return true if object_id == other.object_id\n return false unless self.class === other\n attributes == other.attributes\n end",
"title": ""
},
{
"docid": "e12fe8971a3ee252f0e5e6722f5a4e52",
"score": "0.7298614",
"text": "def identical?(obj)\n raise Taxonifi::ModelError, \"Objects are not comparible.\" if obj.class != self.class\n self.class::ATTRIBUTES.each do |a|\n next if a == :id # don't compare\n return false if obj.send(a) != self.send(a)\n end\n return true\n end",
"title": ""
},
{
"docid": "7d377a0c2c9ffd1e08e50b08c453c677",
"score": "0.72913116",
"text": "def mirrors?(other)\n @subject == other\n end",
"title": ""
},
{
"docid": "fe5834c282edb35766208c1551c498b0",
"score": "0.728822",
"text": "def ==(other)\n return false if self.objects.to_a != other.objects.to_a\n return false if @environmental_factors != other.environmental_factors.to_a\n return false if self.clock != other.clock\n true\n end",
"title": ""
},
{
"docid": "1847d183749c699000907e3271492c42",
"score": "0.7222987",
"text": "def contain_same_objects(array1, array2)\n ok = true\n if array1.size != array2.size\n ok = false\n else\n array1.each {|obj| ok = false if array2.include?(obj) == false }\n end\n\n return ok\n end",
"title": ""
},
{
"docid": "96ab5f21473fa02165b197495c9f6d2c",
"score": "0.7209131",
"text": "def snapshot_identical_to(copy, object)\n object.instance_variables.each do |var|\n unless copy.instance_variable_get(var).equal? object.instance_variable_get(var) then\n return false\n end\n end\n\n return true\n end",
"title": ""
},
{
"docid": "f1094eecce184c7b93ab6e5d4bebd993",
"score": "0.71842587",
"text": "def identical?\n @changes.empty?\n end",
"title": ""
},
{
"docid": "74d2ae23a3ea78325ae8411421e68eff",
"score": "0.71665275",
"text": "def == obj\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "74d2ae23a3ea78325ae8411421e68eff",
"score": "0.71665275",
"text": "def == obj\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "f509845bbf0bc5213db0918bffcfe8e5",
"score": "0.71657425",
"text": "def is_identical_to(obj)\n IdentityFailure.to_matcher(obj)\n end",
"title": ""
},
{
"docid": "52a0082664ee5e9ceff98f6c9f7be074",
"score": "0.713966",
"text": "def eql?(other)\n return false if (other.nil? or self.class != other.class)\n\n ova = other.instance_variables\n iv = instance_variables\n return false if ova.size != iv.size\n\n iv.all? { |vid| instance_variable_get(vid) != other.instance_variable_get(vid) }\n end",
"title": ""
},
{
"docid": "625f951a74884ffac77925391c200a2c",
"score": "0.71336854",
"text": "def is_same()\n return @item1.id == @item2.id\n end",
"title": ""
},
{
"docid": "625f951a74884ffac77925391c200a2c",
"score": "0.71336854",
"text": "def is_same()\n return @item1.id == @item2.id\n end",
"title": ""
},
{
"docid": "aa4969a7b0cb0c74927cfd5b2d675db0",
"score": "0.7129314",
"text": "def similar_to?(obj)\n if obj.is_a? Matrix then\n (self.getCls == obj.getCls && \n self.getRws == obj.getRws ) ? (return true) : (return false)\n end\n return false\n end",
"title": ""
},
{
"docid": "7d73171ce64af0d68ca0b5af9b4f3d2b",
"score": "0.7127573",
"text": "def equals?(instance)\n end",
"title": ""
},
{
"docid": "a38bc0c9f269c603a608d76aa49a54a6",
"score": "0.71175814",
"text": "def same_as?(other)\n return false if other.nil?\n attributes.except('id', 'updated_at', 'created_at', 'user_id') == other.attributes.except('id', 'updated_at', 'created_at', 'user_id')\n end",
"title": ""
},
{
"docid": "a38bc0c9f269c603a608d76aa49a54a6",
"score": "0.71175814",
"text": "def same_as?(other)\n return false if other.nil?\n attributes.except('id', 'updated_at', 'created_at', 'user_id') == other.attributes.except('id', 'updated_at', 'created_at', 'user_id')\n end",
"title": ""
},
{
"docid": "8b820935fe9684d188981696afe45896",
"score": "0.71074766",
"text": "def eql?(o); @items == o.items end",
"title": ""
},
{
"docid": "282082fd3a9acd9e683e6a1ad06804f8",
"score": "0.7098211",
"text": "def ===(other)\n self.attributes == other.attributes\n end",
"title": ""
},
{
"docid": "d344b90c1dfd48fd43d7509601704ac6",
"score": "0.70944405",
"text": "def eql?(obj)\n return false unless (self.class == obj.class)\n \n vars = self.instance_variables\n # check all the other instance vairables\n vars.each do |var|\n return false unless (self.instance_variable_get(var) == obj.instance_variable_get(var))\n end \n return true\n end",
"title": ""
},
{
"docid": "e0944888d21c790242e91ba53a50d29d",
"score": "0.70826596",
"text": "def eql?(other)\n return self.class == other.class && self.hash == other.hash && self == other\n end",
"title": ""
},
{
"docid": "1711327e1da5bf2bc8f3ca27bd8c5fd5",
"score": "0.707468",
"text": "def same?\n uniq.size == 1\n end",
"title": ""
},
{
"docid": "0f99255e1e9b0a4c2df69069056ae50d",
"score": "0.70743173",
"text": "def eql?(other)\n if (other.object_id == self.object_id)\n true\n else\n false\n end\n end",
"title": ""
},
{
"docid": "e56b70f476b6dc01a3596002c33ec3d4",
"score": "0.70696074",
"text": "def equal?(other)\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "de498b7cae8f6453cf2f3a1bd0fc9aa8",
"score": "0.7012796",
"text": "def equal?(other)\n `this.__id__==other.__id__`\n end",
"title": ""
},
{
"docid": "e622041c3f11eed65c42f73a9cde54bd",
"score": "0.70061445",
"text": "def eql?(other)\n `this.__id__==other.__id__`\n end",
"title": ""
},
{
"docid": "33550397482c3e54e3070bab54e17963",
"score": "0.70060915",
"text": "def ==(_other); end",
"title": ""
},
{
"docid": "cf5069d3fc768a8bd657db7d0fc6b793",
"score": "0.7003718",
"text": "def duplicate?(other)\n if ! (lng_rounded == other.lng_rounded && lat_rounded == other.lat_rounded)\n false\n elsif taxon_species != other.taxon_species\n true\n elsif event_date != other.event_date\n false\n else\n true\n end\n end",
"title": ""
},
{
"docid": "0d0dbc7607ef161672d4d89553afbf9e",
"score": "0.69876593",
"text": "def eql? (other) self.class === other && self == other end",
"title": ""
},
{
"docid": "0cfbbf8cefc43131f94dc7bbf7e36636",
"score": "0.6974425",
"text": "def graph_equal_?(o2)\n check_pre((self.graph_obj? and o2.graph_obj?))\n if (self .point1d? and o2 .point1d?) or\n (self== Point2d and o2== Point2d) or \n (self.shape1d? and o2.shape1d?) or\n (self.shape2d? and o2.shape2d?) then\n self == o2\n else\n check_pre((false))\n end\nend",
"title": ""
},
{
"docid": "d490c88092cc0e3234a716756d98fa27",
"score": "0.6955018",
"text": "def eql?(other) return self == other end",
"title": ""
},
{
"docid": "59f2f4ce4b79f5ea5ac2d319216bc202",
"score": "0.6954996",
"text": "def eql?(other)\n return false\n end",
"title": ""
},
{
"docid": "5efd1c82377272010eec88a7695cd9eb",
"score": "0.69531333",
"text": "def ==(o) abstract end",
"title": ""
},
{
"docid": "5efd1c82377272010eec88a7695cd9eb",
"score": "0.69531333",
"text": "def ==(o) abstract end",
"title": ""
},
{
"docid": "758328e272b476277864cd0ed28f5c58",
"score": "0.69512427",
"text": "def graph_equal_?(o2)\n check_pre((self.graph_obj? and o2.graph_obj?))\n if (self.point1d? and o2.point1d?) or\n (self== Point2d and o2== Point2d) or \n (self.shape1d? and o2.shape1d?) or\n (self.shape2d? and o2.shape2d?) then\n self == o2\n else\n check_pre((false))\n end\nend",
"title": ""
},
{
"docid": "758328e272b476277864cd0ed28f5c58",
"score": "0.69512427",
"text": "def graph_equal_?(o2)\n check_pre((self.graph_obj? and o2.graph_obj?))\n if (self.point1d? and o2.point1d?) or\n (self== Point2d and o2== Point2d) or \n (self.shape1d? and o2.shape1d?) or\n (self.shape2d? and o2.shape2d?) then\n self == o2\n else\n check_pre((false))\n end\nend",
"title": ""
},
{
"docid": "758328e272b476277864cd0ed28f5c58",
"score": "0.69512427",
"text": "def graph_equal_?(o2)\n check_pre((self.graph_obj? and o2.graph_obj?))\n if (self.point1d? and o2.point1d?) or\n (self== Point2d and o2== Point2d) or \n (self.shape1d? and o2.shape1d?) or\n (self.shape2d? and o2.shape2d?) then\n self == o2\n else\n check_pre((false))\n end\nend",
"title": ""
},
{
"docid": "758328e272b476277864cd0ed28f5c58",
"score": "0.69512427",
"text": "def graph_equal_?(o2)\n check_pre((self.graph_obj? and o2.graph_obj?))\n if (self.point1d? and o2.point1d?) or\n (self== Point2d and o2== Point2d) or \n (self.shape1d? and o2.shape1d?) or\n (self.shape2d? and o2.shape2d?) then\n self == o2\n else\n check_pre((false))\n end\nend",
"title": ""
},
{
"docid": "758328e272b476277864cd0ed28f5c58",
"score": "0.69512427",
"text": "def graph_equal_?(o2)\n check_pre((self.graph_obj? and o2.graph_obj?))\n if (self.point1d? and o2.point1d?) or\n (self== Point2d and o2== Point2d) or \n (self.shape1d? and o2.shape1d?) or\n (self.shape2d? and o2.shape2d?) then\n self == o2\n else\n check_pre((false))\n end\nend",
"title": ""
},
{
"docid": "16dd7b1b4cf55d3b17a2d52901a5e960",
"score": "0.69444704",
"text": "def eql?(other)\n other.is_a? self.class or return false\n size == other.size or return false\n to_a.zip(other.to_a) { |x, y| x == y or return false }\n true\n end",
"title": ""
},
{
"docid": "9f74424013a1403a37e5a532ce322d63",
"score": "0.6944226",
"text": "def eql?(o); end",
"title": ""
},
{
"docid": "57db87f8903973e82770f699bdd6f82a",
"score": "0.69432586",
"text": "def eql?(comparison_object); end",
"title": ""
},
{
"docid": "518d8a4a30cde1295acd5d50c2075a6e",
"score": "0.69404936",
"text": "def eql?(other)\n return false unless super(other)\n return false unless attributes == other.attributes\n return false unless nodes == other.nodes\n\n true\n end",
"title": ""
},
{
"docid": "24171232a16833267bc773274db56be3",
"score": "0.69330895",
"text": "def === obj\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "24171232a16833267bc773274db56be3",
"score": "0.69330895",
"text": "def === obj\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "c9f28ee35eaf35e1d32d005f20b3d642",
"score": "0.69236064",
"text": "def ==(other); equals(other); end",
"title": ""
},
{
"docid": "99402e413a871c509bb2040cc3840c12",
"score": "0.6916708",
"text": "def eql?(other)\n if self.class == other.class\n identity_as_hash == other.identity_as_hash\n else\n false\n end\n end",
"title": ""
},
{
"docid": "99402e413a871c509bb2040cc3840c12",
"score": "0.6916708",
"text": "def eql?(other)\n if self.class == other.class\n identity_as_hash == other.identity_as_hash\n else\n false\n end\n end",
"title": ""
},
{
"docid": "7020e6ef313c953decd00202a5553206",
"score": "0.6913955",
"text": "def eql?(obj_)\n return false unless obj_.kind_of?(Schema::Wrapper)\n return @root_field == obj_.root_field && @modules == obj_.modules && @aliases == obj_.aliases\n end",
"title": ""
},
{
"docid": "6f69d6a173ad1154640a521313f1675f",
"score": "0.69108415",
"text": "def graph_equal_?(o1, o2)\n check_pre((graph_obj(o1) and graph_obj(o2)))\n if (o1.point1d? and o2.point1d?) or\n (o1.point2d? and o2.point2d?) or \n (shape1d?(o1) and shape1d?(o2)) or\n (shape2d?(o1) and shape2d?(o2)) then\n o1 == o2\n else\n check_pre((false))\n end\nend",
"title": ""
},
{
"docid": "a6b4d4f935e17642c50cf7e087b960cf",
"score": "0.6907273",
"text": "def equal_by_class?(o) o.class == self.class end",
"title": ""
},
{
"docid": "0a9f60093f6a970daa63f6fa8cc11bdd",
"score": "0.6901113",
"text": "def eql?(other); self.hash == other.hash; end",
"title": ""
},
{
"docid": "a8c594c14eefc0a9d950b519d56c7cc2",
"score": "0.68970454",
"text": "def same_jobject?(obj1, obj2)\n System.identityHashCode(obj1) \\\n == System.identityHashCode(obj2)\n end",
"title": ""
},
{
"docid": "c4a59ca1245648aca4d27a503ada702e",
"score": "0.688351",
"text": "def eql?(another)\n (another.class == self.class) && (another.creation_options == self.creation_options)\n end",
"title": ""
},
{
"docid": "0459d0483bb397d1a8ff7ec5939b4a7f",
"score": "0.68823636",
"text": "def == other\n self.class == other.class && # terminate check here if wrong class\n data.object_id == other.data.object_id && # both `data` point to same object\n (instance_variables - [:@data]).all? do |var|\n self.instance_variable_get(var) == other.instance_variable_get(var)\n end\n end",
"title": ""
},
{
"docid": "15bcfbac66dc27fa8c32ecd8e4403455",
"score": "0.68821496",
"text": "def __associations_equal?(obj1, obj2)\n cache1 = obj1.instance_variable_get(:@association_cache)\n cache2 = obj2.instance_variable_get(:@association_cache)\n cache1.size == cache2.size &&\n cache1.all? { |k, v| cache2.key?(k) && __values_equal?(v.target, cache2[k].target) }\n end",
"title": ""
},
{
"docid": "8f52dca9b61e48fd8911bbf24c7053f7",
"score": "0.6881346",
"text": "def ==(obj)\n if obj.is_a? Matrix then\n if (self.getCls == obj.getCls && self.getRws == obj.getRws ) then\n (@mx == obj.export) ? (return true) : (return false)\n end\n end\n return false\n end",
"title": ""
},
{
"docid": "da43d75f35c5a88a213340e2701fef89",
"score": "0.6879653",
"text": "def ===(other)\n true\n end",
"title": ""
},
{
"docid": "f38c7a6457eba376c3ba32a10b6edf24",
"score": "0.6869088",
"text": "def same (a, b)\n a == b\nend",
"title": ""
},
{
"docid": "f9ae747478c4b898733d8f0ff07fc7d7",
"score": "0.6868216",
"text": "def graph_equal_?(o2)\n check_pre((o2.graph_obj?))\n (o2.point1d?) ? (self.int == o2.int) : false\nend",
"title": ""
},
{
"docid": "b5dc9145f7f482d48cea5b3103da92df",
"score": "0.6859542",
"text": "def test_every_object_has_different_id\n obj = Object.new\n another_obj = Object.new\n assert_equal true, obj.object_id != another_obj.object_id\n end",
"title": ""
},
{
"docid": "05e786f8d6ccefea8e47f5c327a3413d",
"score": "0.68573904",
"text": "def ==(other)\n self.class == other.class && attributes == other.attributes\n end",
"title": ""
},
{
"docid": "3bf3a8848d0c06124784f8e2e0e7090e",
"score": "0.68526137",
"text": "def eql?(other)\n self.class == other.class && y == other.y && yn == other.yn &&\n x == other.x && xn == other.xn\n end",
"title": ""
},
{
"docid": "69537a5ae9840382a4a567d9de6559a7",
"score": "0.6848053",
"text": "def eql?(other); end",
"title": ""
},
{
"docid": "69537a5ae9840382a4a567d9de6559a7",
"score": "0.6848053",
"text": "def eql?(other); end",
"title": ""
},
{
"docid": "69537a5ae9840382a4a567d9de6559a7",
"score": "0.6848053",
"text": "def eql?(other); end",
"title": ""
},
{
"docid": "69537a5ae9840382a4a567d9de6559a7",
"score": "0.6848053",
"text": "def eql?(other); end",
"title": ""
},
{
"docid": "69537a5ae9840382a4a567d9de6559a7",
"score": "0.6848053",
"text": "def eql?(other); end",
"title": ""
},
{
"docid": "69537a5ae9840382a4a567d9de6559a7",
"score": "0.6848053",
"text": "def eql?(other); end",
"title": ""
},
{
"docid": "69537a5ae9840382a4a567d9de6559a7",
"score": "0.6848053",
"text": "def eql?(other); end",
"title": ""
},
{
"docid": "69537a5ae9840382a4a567d9de6559a7",
"score": "0.6848053",
"text": "def eql?(other); end",
"title": ""
},
{
"docid": "69537a5ae9840382a4a567d9de6559a7",
"score": "0.6848053",
"text": "def eql?(other); end",
"title": ""
},
{
"docid": "69537a5ae9840382a4a567d9de6559a7",
"score": "0.6848053",
"text": "def eql?(other); end",
"title": ""
},
{
"docid": "69537a5ae9840382a4a567d9de6559a7",
"score": "0.6848053",
"text": "def eql?(other); end",
"title": ""
},
{
"docid": "69537a5ae9840382a4a567d9de6559a7",
"score": "0.6848053",
"text": "def eql?(other); end",
"title": ""
},
{
"docid": "69537a5ae9840382a4a567d9de6559a7",
"score": "0.6848053",
"text": "def eql?(other); end",
"title": ""
},
{
"docid": "69537a5ae9840382a4a567d9de6559a7",
"score": "0.6848053",
"text": "def eql?(other); end",
"title": ""
},
{
"docid": "69537a5ae9840382a4a567d9de6559a7",
"score": "0.6848053",
"text": "def eql?(other); end",
"title": ""
},
{
"docid": "69537a5ae9840382a4a567d9de6559a7",
"score": "0.6848053",
"text": "def eql?(other); end",
"title": ""
},
{
"docid": "69537a5ae9840382a4a567d9de6559a7",
"score": "0.6848053",
"text": "def eql?(other); end",
"title": ""
},
{
"docid": "69537a5ae9840382a4a567d9de6559a7",
"score": "0.6848053",
"text": "def eql?(other); end",
"title": ""
},
{
"docid": "69537a5ae9840382a4a567d9de6559a7",
"score": "0.6848053",
"text": "def eql?(other); end",
"title": ""
},
{
"docid": "69537a5ae9840382a4a567d9de6559a7",
"score": "0.6848053",
"text": "def eql?(other); end",
"title": ""
},
{
"docid": "69537a5ae9840382a4a567d9de6559a7",
"score": "0.6848053",
"text": "def eql?(other); end",
"title": ""
},
{
"docid": "69537a5ae9840382a4a567d9de6559a7",
"score": "0.6848053",
"text": "def eql?(other); end",
"title": ""
},
{
"docid": "69537a5ae9840382a4a567d9de6559a7",
"score": "0.6848053",
"text": "def eql?(other); end",
"title": ""
},
{
"docid": "69537a5ae9840382a4a567d9de6559a7",
"score": "0.6848053",
"text": "def eql?(other); end",
"title": ""
},
{
"docid": "69537a5ae9840382a4a567d9de6559a7",
"score": "0.6848053",
"text": "def eql?(other); end",
"title": ""
}
] |
fb21e84afbf049a83576bca345f5c927 | Ensures that the default rule obeys its assertion | [
{
"docid": "54fea75f8ac9d2b54d5ac18f8833ca02",
"score": "0.6161613",
"text": "def test_default_assert\n @acl.deny!(nil, nil, nil, MockAssertion.new(false))\n assert_equal true, @acl.allowed?\n assert_equal true, @acl.allowed?(nil, nil, 'some_privilege')\n end",
"title": ""
}
] | [
{
"docid": "2051eda4cb05a2ac58610d3830f3ec4d",
"score": "0.6697004",
"text": "def test_default_rule_set\n @acl.allow!\n assert_equal true, @acl.allowed?\n @acl.deny!\n assert_equal false, @acl.allowed?\n end",
"title": ""
},
{
"docid": "a5b64e1dda7970d0b08f303a8e39685b",
"score": "0.6337707",
"text": "def verify_defaults(subject)\n # fetch an existing object to enable lazy-loading\n subject.find if subject.identifier\n subject.add_defaults\n msg = \"#{subject.qp} with default attributes fails validation\"\n assert_nothing_raised(Jinx::ValidationError, msg) { subject.validate }\n end",
"title": ""
},
{
"docid": "1ea0145f1766317f8875773e74bd2a56",
"score": "0.62311155",
"text": "def assertions; end",
"title": ""
},
{
"docid": "1ea0145f1766317f8875773e74bd2a56",
"score": "0.62311155",
"text": "def assertions; end",
"title": ""
},
{
"docid": "33aa44cbc058f97e13d20dcd4dadea5f",
"score": "0.61619174",
"text": "def test_default_rule_set_privilege\n @acl.allow!\n assert_equal true, @acl.allowed?(nil, nil, 'some_privilege')\n @acl.deny!\n assert_equal false, @acl.allowed?(nil, nil, 'some_privilege')\n end",
"title": ""
},
{
"docid": "71935f2e5f49c7c546f55babf5717f4a",
"score": "0.6128344",
"text": "def test_pros_seed_invalid\n set_rule = Rules.new\n actual = set_rule.valid_input? '-323', '123A'\n expected = false\n assert_equal expected, actual\n end",
"title": ""
},
{
"docid": "af7b0ad641ba19a9f06d8beb8a845140",
"score": "0.6099054",
"text": "def test_0000_default\n assert(true)\n end",
"title": ""
},
{
"docid": "8a05dce0f3533dccf79dc311a69045ee",
"score": "0.60360295",
"text": "def check_rule(rule, expected = {})\n assert_equal(expected[:pattern], rule[:pattern])\n assert_equal(expected[:type], rule[:type])\n assert_equal(expected[:response], rule[:response][0])\n end",
"title": ""
},
{
"docid": "e43476fbaaf39868fc9579341a802e4b",
"score": "0.59975314",
"text": "def test_pos_seed_pos_pros\n set_rule = Rules.new\n actual = set_rule.valid_input? '123', '453'\n expected = true\n assert_equal expected, actual\n end",
"title": ""
},
{
"docid": "fe5ff4762c31c86e5b67f602511e4bd7",
"score": "0.59380704",
"text": "def override_default_rule\n return @override_default_rule\n end",
"title": ""
},
{
"docid": "e4ca871297a6dae6c4c130fd70fd01eb",
"score": "0.5929549",
"text": "def test_should_override_rule_definition_manually\n initial = Month.december.christmas\n SmartMonth::Rulesets.add_rule('Christmas', 'December 12th, 2009')\n assert initial != Month.december.christmas\n assert_equal Month.december.christmas, Date.new(2009,12,12)\n end",
"title": ""
},
{
"docid": "1e4068bc31a85a0668cc27d0eaf2251e",
"score": "0.59145844",
"text": "def default_rule &blk\n raise BadDefaultRule.new(\"Can't have a default rule when multiple matches are allowed\") unless Thread.current[@rulesetids.last][:singletary]\n if Thread.current[@rulesetids.last][:singletary] && !Thread.current[@rulesetids.last][:rulematched]\n yield\n else\n Thread.current[@rulesetids.last][:rulematched]\n end\n end",
"title": ""
},
{
"docid": "4af9cb35e4b4b2f1ed2898a1d1c7c32e",
"score": "0.5909028",
"text": "def test_generate_message_accepted_with_default_message\r\n assert_equal \"must be accepted\", @topic.errors.generate_message(:title, :accepted, :default => nil)\r\n end",
"title": ""
},
{
"docid": "8cb773d5b33d21913d2435dd9e1d798d",
"score": "0.588704",
"text": "def test_always_passes\n assert true\n end",
"title": ""
},
{
"docid": "4c0e60c5cd53e5e70c5cba7b28343277",
"score": "0.58691645",
"text": "def rule; end",
"title": ""
},
{
"docid": "7d8830f2bdef8ac9ce6bc904ca10a48d",
"score": "0.5846383",
"text": "def assertions\n @assertions ||= 0\n end",
"title": ""
},
{
"docid": "72d976ff3175818b90493208278cf537",
"score": "0.5841429",
"text": "def default_rule\n '0,1'\n end",
"title": ""
},
{
"docid": "bf27052c4ddc5b10c824bceccc5ce6bb",
"score": "0.5837065",
"text": "def enforcing\n @enforcing\n end",
"title": ""
},
{
"docid": "bf27052c4ddc5b10c824bceccc5ce6bb",
"score": "0.5837065",
"text": "def enforcing\n @enforcing\n end",
"title": ""
},
{
"docid": "0184b9d61f312485e6d1f6660251c9b4",
"score": "0.5833101",
"text": "def assertions\n @assertions || 0\n end",
"title": ""
},
{
"docid": "a1807e4e98d044d0af6c3571bbe17f55",
"score": "0.5822468",
"text": "def test_role_default_rule_set\n role_guest = Rend::Acl::Role.new('guest')\n @acl.add_role!(role_guest)\n @acl.allow!(role_guest)\n assert_equal true, @acl.allowed?(role_guest)\n @acl.deny!(role_guest)\n assert_equal false, @acl.allowed?(role_guest)\n end",
"title": ""
},
{
"docid": "9a2f4e0a6825f653c9edfff99ebfe65f",
"score": "0.5821248",
"text": "def rule(*args)\n raise NotYetImplementedError\n end",
"title": ""
},
{
"docid": "363d69110151d8ef610359771465a0bc",
"score": "0.5817907",
"text": "def test_neg_seed_pos_pros\n set_rule = Rules.new\n actual = set_rule.valid_input? '-123', '453'\n expected = true\n assert_equal expected, actual\n end",
"title": ""
},
{
"docid": "36d6426b60095cdd1428a9f39841eb63",
"score": "0.5809988",
"text": "def expected; end",
"title": ""
},
{
"docid": "0862469cbe0dbd788d722683dab4bfaa",
"score": "0.5793389",
"text": "def check_monkeytest\n check_one('AssertTest')\n end",
"title": ""
},
{
"docid": "2ff23b268f679de5b1980aaafbe6d905",
"score": "0.57873476",
"text": "def check\n !assertion.check\n end",
"title": ""
},
{
"docid": "811f88ffc736056f8a2d02cd28e9a131",
"score": "0.57674944",
"text": "def test_generate_message_inclusion_with_default_message\r\n assert_equal 'is not included in the list', @topic.errors.generate_message(:title, :inclusion, :default => nil, :value => 'title')\r\n end",
"title": ""
},
{
"docid": "0694dd870299cd97530fb612af7f8bc7",
"score": "0.5752901",
"text": "def assertions=(_arg0); end",
"title": ""
},
{
"docid": "0694dd870299cd97530fb612af7f8bc7",
"score": "0.5752901",
"text": "def assertions=(_arg0); end",
"title": ""
},
{
"docid": "0694dd870299cd97530fb612af7f8bc7",
"score": "0.5752901",
"text": "def assertions=(_arg0); end",
"title": ""
},
{
"docid": "dc312ba6a69ed21119e1c49b79d651aa",
"score": "0.5724349",
"text": "def test_should_not_remove_undefined_rule\n assert !SmartMonth::Rulesets.remove_rule(\"Rule fake\")\n end",
"title": ""
},
{
"docid": "208d8264b28e70ebc7832a64e9ed7f37",
"score": "0.5704324",
"text": "def test_has_required_methods\n rule = SubmissionRule.new\n rule.assignment = Assignment.make\n\n assert_raise NotImplementedError do\n rule.commit_after_collection_message\n end\n\n assert_raise NotImplementedError do\n rule.overtime_message\n end\n\n assert_raise NotImplementedError do\n rule.assignment_valid?\n end\n\n assert_raise NotImplementedError do\n rule.apply_submission_rule(nil)\n end\n\n assert_raise NotImplementedError do\n rule.description_of_rule\n end\n\n end",
"title": ""
},
{
"docid": "547ee570d570e6f32fbb1834aadcf1bd",
"score": "0.5701525",
"text": "def test_neg_seed_neg_pros\n set_rule = Rules.new\n actual = set_rule.valid_input? '-123', '-453'\n expected = false\n assert_equal expected, actual\n end",
"title": ""
},
{
"docid": "f5d9316983db039304598a2bc031069c",
"score": "0.5696565",
"text": "def test_invalid_val\n set_rule = Rules.new\n actual = set_rule.pos_int? 'quack'\n expected = false\n assert_equal expected, actual\n end",
"title": ""
},
{
"docid": "d704304b2b78b9cb1ba26f1cd499f7f7",
"score": "0.56934536",
"text": "def validate\n assertions.each { |assertion| assertion.validate }\n end",
"title": ""
},
{
"docid": "0b95a40c438955beb846af15fc1247fb",
"score": "0.56829673",
"text": "def assert_silent; end",
"title": ""
},
{
"docid": "903f87d994defdb1c660f1d9b11220a2",
"score": "0.5661964",
"text": "def check_ruleset(fw, match)\n buf = fw.send(:ruleset)\n assert_equal match, buf\n end",
"title": ""
},
{
"docid": "cd256c48632bfc36daebe787de8ed1f1",
"score": "0.56521523",
"text": "def warn_about_expectations; end",
"title": ""
},
{
"docid": "3c56049dd66f1032f1691f17f56e4323",
"score": "0.5641978",
"text": "def default_test; end",
"title": ""
},
{
"docid": "3c56049dd66f1032f1691f17f56e4323",
"score": "0.5641978",
"text": "def default_test; end",
"title": ""
},
{
"docid": "3c56049dd66f1032f1691f17f56e4323",
"score": "0.5641978",
"text": "def default_test; end",
"title": ""
},
{
"docid": "3c56049dd66f1032f1691f17f56e4323",
"score": "0.5641978",
"text": "def default_test; end",
"title": ""
},
{
"docid": "21d15ebec8e62109422b16a45ff93b2a",
"score": "0.56373584",
"text": "def test_rule_no_turns_after_finish()\n test_lost_and_finished()\n assert_raise(RuleViolationError) do\n @game.do_turn(Turn.new([1,1,1,1]))\n end\n end",
"title": ""
},
{
"docid": "50b168c44e9cac1c4869bef48b3d9a5d",
"score": "0.5631063",
"text": "def ok!\n @assertion_performed = true\n end",
"title": ""
},
{
"docid": "bc990e4c763df97ea75886d30a48d5be",
"score": "0.56255984",
"text": "def test_has_required_rule_fails_when_field_exists_but_nil\n rule = Rule.new\n rule.has_required :title\n\n test_entity = TestEntity.new\n\n result_card = ResultCard.new\n\n assert !rule.evaluate(test_entity, result_card)\n end",
"title": ""
},
{
"docid": "dad5ff6d5295d3aa64948b055b771a61",
"score": "0.5617292",
"text": "def test_assert_system_true\n @subject.assert_system('true') # no exception expected\n end",
"title": ""
},
{
"docid": "c0dffe21ce5f4ae0407ead36fc8f9e1f",
"score": "0.5610516",
"text": "def warn_about_should!; end",
"title": ""
},
{
"docid": "c0dffe21ce5f4ae0407ead36fc8f9e1f",
"score": "0.5610516",
"text": "def warn_about_should!; end",
"title": ""
},
{
"docid": "1383e5024accaef1f4277fb68a0cb03a",
"score": "0.56083876",
"text": "def disallow_expectations; end",
"title": ""
},
{
"docid": "ee11b9258e034e62f175b0b97f69aa53",
"score": "0.5604862",
"text": "def be_true\n TrueAssay.assertor\n end",
"title": ""
},
{
"docid": "b2a9c6597ddaabdc9eed0a7d44132ef2",
"score": "0.55921674",
"text": "def can_assert?(item)\n asserter?(item) &&\n assertable?(item)\n end",
"title": ""
},
{
"docid": "3d52d53a9769a4d0b6e51a6b6bc86457",
"score": "0.5558476",
"text": "def initialize(_base, _def_matcher, _def_resource)\n @rules = Hash.new { |h, k| h[k] = [] }\n _base.rules.each { |k, tests| @rules[k] = tests.clone } unless _base.nil?\n raise Error.new 'Must provide a default test' if _def_matcher.nil?\n @def_matcher = _def_matcher\n @def_resource = _def_resource\n end",
"title": ""
},
{
"docid": "8aba40bb27a53d05f6b9beb3b6580bae",
"score": "0.55366105",
"text": "def or_else(lazy_default_validation)\n raise \"not implemented\"\n end",
"title": ""
},
{
"docid": "8aba40bb27a53d05f6b9beb3b6580bae",
"score": "0.55366105",
"text": "def or_else(lazy_default_validation)\n raise \"not implemented\"\n end",
"title": ""
},
{
"docid": "f6ceed8497e3cba43ff15c2e66803b3c",
"score": "0.553404",
"text": "def assert_default(name, expected)\n manifest = starter.language_manifest('Ruby, MiniTest', 'Fizz_Buzz')\n manifest['id'] = kata_id\n manifest['created'] = time_now\n manifest.delete(name)\n storer.kata_create(manifest)\n assert_equal expected, katas[kata_id].public_send(name)\n end",
"title": ""
},
{
"docid": "51eb85b4387ffd72ffa962a7dad913ba",
"score": "0.5529773",
"text": "def ensure_clause; end",
"title": ""
},
{
"docid": "3a32e8396f5b3de42958f06101416bb0",
"score": "0.55284536",
"text": "def validate_gotcha!(expected = 1)\n raise Gotcha::ValidationError.new unless gotcha_valid?(expected)\n end",
"title": ""
},
{
"docid": "960c4b02b07be490e24a62e9f79e2ffe",
"score": "0.5526043",
"text": "def test_pass_only_test_case\n assert(true)\n end",
"title": ""
},
{
"docid": "c426acd3d974cb81023480688f67c642",
"score": "0.5525117",
"text": "def parameter_rule?; end",
"title": ""
},
{
"docid": "57e0c50aa06e4473f402d432133e242a",
"score": "0.5522038",
"text": "def test_generate_message_invalid_with_default_message\r\n assert_equal 'is invalid', @topic.errors.generate_message(:title, :invalid, :default => nil, :value => 'title')\r\n end",
"title": ""
},
{
"docid": "a8b1575aa14bca793ba2b4ff6cf67b05",
"score": "0.5521953",
"text": "def test_06_add_rule_bad\n id = nil\n same_id = nil\n\n # Add the same rule twice\n assert_nothing_raised do\n id = @@dns.add_rule('j.random.hacker', IN::A) do |transaction|\n transaction.respond!('4.2.4.2')\n end\n end\n\n assert_nothing_raised do\n same_id = @@dns.add_rule('j.random.hacker', IN::A) do |transaction|\n transaction.respond!('4.2.4.2')\n end\n end\n\n assert_equal(id, same_id)\n\n # Use /.../ literal syntax to throw Sourcify exception\n assert_raise do\n id = @@dns.add_rule(/.*/, IN::A) do |transaction|\n transaction.respond!('5.1.5.0')\n end\n end\n end",
"title": ""
},
{
"docid": "8a563336b833646a91b330e6792b7dec",
"score": "0.55159867",
"text": "def test_flexible_rule_false_STRANGE\n c = BlockCondition.new { return false }\n assert_true c.match(\"something\")\n end",
"title": ""
},
{
"docid": "88208714f7ec5429a17562dd6557f4d2",
"score": "0.5514756",
"text": "def test_add_invalid_check_constraint\n @connection.add_check_constraint :trades, \"quantity > 0\", name: \"quantity_check\", validate: false\n\n check_constraints = @connection.check_constraints(\"trades\")\n assert_equal 1, check_constraints.size\n\n cc = check_constraints.first\n assert_predicate cc, :validated?\n end",
"title": ""
},
{
"docid": "b677570f45169d3804b296a539f1d291",
"score": "0.5507729",
"text": "def pass msg = nil\n assert true\n end",
"title": ""
},
{
"docid": "b677570f45169d3804b296a539f1d291",
"score": "0.5507729",
"text": "def pass msg = nil\n assert true\n end",
"title": ""
},
{
"docid": "926ea77bcca334d1e331bc02615c013a",
"score": "0.5507691",
"text": "def test_generate_message_exclusion_with_default_message\r\n assert_equal 'is reserved', @topic.errors.generate_message(:title, :exclusion, :default => nil, :value => 'title')\r\n end",
"title": ""
},
{
"docid": "b1ed7e3618678785e718e56a899c2132",
"score": "0.5483164",
"text": "def test_truth\n\t\tassert true\n\tend",
"title": ""
},
{
"docid": "deca5e01605df7655cd433763b5329db",
"score": "0.54798496",
"text": "def non_example_failure; end",
"title": ""
},
{
"docid": "5728853353a03544a7676e3b6414a7a0",
"score": "0.54761946",
"text": "def rules\n self.class.default_rules + @rules\n end",
"title": ""
},
{
"docid": "620dbb1b089a59ade55399717b1b07f6",
"score": "0.5471945",
"text": "def test_validates_numericality_of_odd_generates_message\r\n Topic.validates_numericality_of :title, :only_integer => true, :odd => true\r\n @topic.title = 0\r\n @topic.errors.expects(:generate_message).with(:title, :odd, {:value => 0, :default => nil})\r\n @topic.valid?\r\n end",
"title": ""
},
{
"docid": "d44f9160bd533c0fb668659ac7262e43",
"score": "0.5468718",
"text": "def test_default\n return true\n end",
"title": ""
},
{
"docid": "1afec7fbe1e105b9ed35245cc8038955",
"score": "0.54635847",
"text": "def default_test\n end",
"title": ""
},
{
"docid": "644fa34e31bc6b4935d6c83f27d318ff",
"score": "0.5463153",
"text": "def be_false\n FalseAssay.assertor\n end",
"title": ""
},
{
"docid": "bc2aefbcad074c982232d5dd95088c7a",
"score": "0.5451603",
"text": "def assign_default_rules\n if rules.nil?\n self.rules = rules_template\n end\n end",
"title": ""
},
{
"docid": "6b786b52783b1f29ac4cf2c3d94c4b26",
"score": "0.54356354",
"text": "def successful_create\n assertions << [ :assert, !@jelly.new_record?, \"Jelly should not be a new record\" ]\n super\n end",
"title": ""
},
{
"docid": "647e94f4340dfe29ef1b6aa1d76fff34",
"score": "0.5419793",
"text": "def test_generate_message_blank_with_default_message\r\n assert_equal \"can't be blank\", @topic.errors.generate_message(:title, :blank, :default => nil)\r\n end",
"title": ""
},
{
"docid": "c70911277a14aadbcde906bf01737ef3",
"score": "0.54195446",
"text": "def assert(fact, message = '')\n fail message unless fact\nend",
"title": ""
},
{
"docid": "10a0888d2980e49e9fdf1974bc61f7d5",
"score": "0.5411223",
"text": "def test_default_ability_values\n assert_equal 10, Character.new.base_wisdom\n end",
"title": ""
},
{
"docid": "84c8fa88991b71d4ff4b0a836331b245",
"score": "0.54102534",
"text": "def defaultify_expectation(exp) # :nodoc:\n last_exp = @expectations.last\n if last_exp != exp\n fail UsageError,\n \"Cannot make a previously defined expection into a default\"\n end\n @expectations.pop\n @defaults << exp\n end",
"title": ""
},
{
"docid": "7bfe0f75309035374cd61821607024b7",
"score": "0.5406469",
"text": "def cop_rule?; end",
"title": ""
},
{
"docid": "82dd5a2c27aa7012aaa996ac0449cd1d",
"score": "0.5406235",
"text": "def test_assert_only_test_case\n assert(false)\n end",
"title": ""
},
{
"docid": "ee57789aa13ab94e9a1f9744e6b748d9",
"score": "0.5403629",
"text": "def force_validation x\n x.options.merge :obligatory => true \n validate x\n x.options.delete :obligatory\n end",
"title": ""
},
{
"docid": "99a0ddf3bfebccd5b295a51408d64009",
"score": "0.5397447",
"text": "def assertions\n @assertions ||= []\n end",
"title": ""
},
{
"docid": "a0bcd01fbbff9ae25073e4a24a6196dc",
"score": "0.53970164",
"text": "def test_role_default_rule_set_privilege\n role_guest = Rend::Acl::Role.new('guest')\n @acl.add_role!(role_guest)\n @acl.allow!(role_guest)\n assert_equal true, @acl.allowed?(role_guest, nil, 'some_privilege')\n @acl.deny!(role_guest)\n assert_equal false, @acl.allowed?(role_guest, nil, 'some_privilege')\n end",
"title": ""
},
{
"docid": "ef246dab90b77bd1ada863628af8fbbf",
"score": "0.53951436",
"text": "def default_test \n end",
"title": ""
},
{
"docid": "066a654cf8e03724a2944cef8ae6109e",
"score": "0.53923243",
"text": "def validation_default; true; end",
"title": ""
},
{
"docid": "066a654cf8e03724a2944cef8ae6109e",
"score": "0.53923243",
"text": "def validation_default; true; end",
"title": ""
},
{
"docid": "c02d73e90f365fd2fa1274b79037777c",
"score": "0.5392204",
"text": "def test_check\n assert_raises(Confuse::Errors::Undefined) { @config.check }\n end",
"title": ""
},
{
"docid": "9c9943779bb5186d29e913cd7116c02a",
"score": "0.5391178",
"text": "def check!\n self.normalize!\n \n __check_coherency\n __check_error\n end",
"title": ""
},
{
"docid": "ea4e22691c0c616e4b3382035ca8a136",
"score": "0.5386734",
"text": "def add_assertion\n @assertions ||= 0\n @assertions += 1\n end",
"title": ""
},
{
"docid": "7249767d7ab02dce4012f84408124b87",
"score": "0.5377793",
"text": "def test(rule)\n rule.exec(self)[-1]\n end",
"title": ""
},
{
"docid": "e36664f3c36964189cb8bf6473b53984",
"score": "0.5376946",
"text": "def override_default_rule=(value)\n @override_default_rule = value\n end",
"title": ""
},
{
"docid": "a8fa4ff3db81192c633e3847d85159cd",
"score": "0.5376296",
"text": "def test_validation_on_create_reverse_catch\n a = Node.create!\n b = Node.create!\n e = Default.create_edge(a,b)\n e2 = Default.create_edge(b,a)\n assert !e2\n assert_raises(ActiveRecord::RecordInvalid) { e3 = Default.create_edge!(b,a) }\n end",
"title": ""
},
{
"docid": "2546addcbd47780fb0f417af1c9ae801",
"score": "0.53705335",
"text": "def test_truth\r\n end",
"title": ""
},
{
"docid": "2546addcbd47780fb0f417af1c9ae801",
"score": "0.53705335",
"text": "def test_truth\r\n end",
"title": ""
},
{
"docid": "2546addcbd47780fb0f417af1c9ae801",
"score": "0.53705335",
"text": "def test_truth\r\n end",
"title": ""
},
{
"docid": "2546addcbd47780fb0f417af1c9ae801",
"score": "0.53705335",
"text": "def test_truth\r\n end",
"title": ""
},
{
"docid": "a75013dc3943e0fb09f280ef24e493e7",
"score": "0.5366745",
"text": "def should(assay)\n assay.to_assertor.assert!(self)\n end",
"title": ""
},
{
"docid": "62dc1906f2eae8726678ff564a7952ce",
"score": "0.53655124",
"text": "def assert \n raise \"Argument Error\" unless yeild \nend",
"title": ""
},
{
"docid": "afd37e9177c6dcb28d8c19fab447055d",
"score": "0.53644186",
"text": "def check_constraints; end",
"title": ""
}
] |
c562f7b0b54f87a7aaeb2607de52d952 | Decode the numeric character reference, such as 8212, to a Unicode glyph so it may be used in an XPath expression. Examples decode_char 60 => "<" Returns the decoded String that corresponds to the numeric character reference | [
{
"docid": "7d1f98df5f5d38df63344d3df6d19b59",
"score": "0.6390701",
"text": "def decode_char number\n [number].pack 'U1'\n end",
"title": ""
}
] | [
{
"docid": "edecbbdf32101f4922143eb9b9f0e936",
"score": "0.74728674",
"text": "def decode_char(char)\n char_value = char.ord\n value = DECODING_TABLE[char_value - 45]\n\n raise ArgumentError, 'Invalid encoding' if value.nil? || value.negative?\n\n value\n end",
"title": ""
},
{
"docid": "4b6f84db8d2c04687316191cbaa1b489",
"score": "0.740955",
"text": "def decode_char(char)\n char_value = char.ord\n value = DECODING_TABLE[char_value - 45]\n\n raise ValueError('Invalid encoding') if value.nil? || value.negative?\n\n value\n end",
"title": ""
},
{
"docid": "cd26ee9b52415f57cb249009a73e1e8e",
"score": "0.72561705",
"text": "def decode_char(input)\n input.mark\n result = nil\n # check first\n first = input.next\n return nil if first.nil?\n return first unless first == \"&\"\n # check second\n second = input.next\n if second == \"#\"\n result = numeric_entity(input)\n elsif second =~ /[a-zA-Z]/\n input.push(second)\n result = named_entity(input)\n else\n input.push(second)\n return nil\n end\n\n if result.nil?\n input.reset\n end\n result\n end",
"title": ""
},
{
"docid": "192aafca9559f18cfedfe076758d9bcc",
"score": "0.71775395",
"text": "def punycode_decode_digit(codepoint); end",
"title": ""
},
{
"docid": "192aafca9559f18cfedfe076758d9bcc",
"score": "0.71775395",
"text": "def punycode_decode_digit(codepoint); end",
"title": ""
},
{
"docid": "3d81e28a6d6e982edd7c5d03088fe873",
"score": "0.7066153",
"text": "def decode_char(input)\n input.mark();\n first = input.next\n if first.nil?\n input.reset\n return nil;\n end\n # if this is not an encoded character, return null\n if first != \"\\\"\"\n input.reset\n return nil\n end\n input.next\n end",
"title": ""
},
{
"docid": "c253b3b476706165f6aa2020018e0d3c",
"score": "0.68503594",
"text": "def decode\n decoding = Proc.new do |str|\n decoded = String.new str\n str.split(//).each_index { |n| decoded[n] = (str[n].ord + n + 1).chr}.reduce(:+)\n decoded\n end\n end",
"title": ""
},
{
"docid": "cb56ea48d99be52214580b8d0e918c95",
"score": "0.6710537",
"text": "def decode(char)\n contact_in = char_to_contact(char)\n contact_out = @wires_inverted[contact_in]\n decoded_char = contact_to_char(contact_out)\n end",
"title": ""
},
{
"docid": "c322f4a3c34b091506c9892586458854",
"score": "0.6636863",
"text": "def decode_char(c, key)\n\n # if c is not a letter between a-z, then return c\n if c < 97 || c > 122\n return c\n end\n \n # if c - ket is less than 97, add 26 to bring it back into the a-z range\n if c - key < 97\n return c - key + 26\n else\n return c - key\n end\nend",
"title": ""
},
{
"docid": "44954f3f8f7341e8efa8ea2073291e1c",
"score": "0.6588416",
"text": "def decode (value)\n value.to_s.sub(/[0]/,'o').sub(/[1]/,'x')\n end",
"title": ""
},
{
"docid": "ec0c4d43c87858a5347ea59ceaf1ede2",
"score": "0.6501118",
"text": "def decode(code, encoding)\n result = \"\"\n case encoding\n when :ascii\n result += (code-1).chr\n else\n case code\n when 0\n result += \" \"\n when 1..26\n # 1 = A, 2 = B...\n result += (code+64).chr\n else\n result += \".\"\n end\n end\n return result\nend",
"title": ""
},
{
"docid": "11d8ce5c2fec56a41edba2b1914a2a3f",
"score": "0.64737993",
"text": "def get_unescape_sequence(charcode)\n \treturn @kw[:unescape] + \"(\" + transform_string(\"%\" + get_hex_string(charcode, 2)) + \")\"\n end",
"title": ""
},
{
"docid": "c27025813813cd88a152b8a4187542cc",
"score": "0.6380251",
"text": "def test_text_charcode\n dec = DecT.new \"123ABCabc\" # 6 * 9 = 54 bit\n assert_nothing_raised { dec.decode(54) }\n dec = DecT.new \"123ABCab@\"\n assert_raise(KeyError) { dec.decode(54) }\n end",
"title": ""
},
{
"docid": "cdc58df8c6536a91dce8c6d761a4b5b1",
"score": "0.6324662",
"text": "def decode_digit(cp)\n cp - 48 < 10 ? cp - 22 : cp - 65 < 26 ? cp - 65 :\n cp - 97 < 26 ? cp - 97 : BASE\n end",
"title": ""
},
{
"docid": "0bbfbccb7612d3b3ae1daa40b89d5bad",
"score": "0.62557155",
"text": "def dec\n char.ord\n end",
"title": ""
},
{
"docid": "8546e1fd08888916b73244ded24c2c63",
"score": "0.62263227",
"text": "def ent_ddec\n foo=[]\n self.scan(/&#\\d+/) { |char| if char =~ /&#(\\d+)/; foo << $1; end }\n newstr=String.new\n foo.each { |char| newstr += char.to_i.chr }\n return newstr\n end",
"title": ""
},
{
"docid": "efeae85bc11d8b435a5f187fac472ba3",
"score": "0.6223736",
"text": "def get_codepoint(character)\n \"%04x\" % character.unpack(\"U\")[0]\n end",
"title": ""
},
{
"docid": "efeae85bc11d8b435a5f187fac472ba3",
"score": "0.6223736",
"text": "def get_codepoint(character)\n \"%04x\" % character.unpack(\"U\")[0]\n end",
"title": ""
},
{
"docid": "a3824ce045545a36688227bc36f6b2fb",
"score": "0.62050414",
"text": "def decode(str)\n str.chars.map { |c| convert(c, true) }.join\n end",
"title": ""
},
{
"docid": "9b1ace009de9caba03531653096b492f",
"score": "0.61395365",
"text": "def convert(letter)\n letter.ord - 96\nend",
"title": ""
},
{
"docid": "787efc4b956353c5525a024984717d82",
"score": "0.6131014",
"text": "def decode(str); end",
"title": ""
},
{
"docid": "96c12db49d39d5361d7f4d1241896ba7",
"score": "0.6082729",
"text": "def _deconvert_char(c, chart)\n begin\n r = chart[c] \n raise if r.nil?\n rescue\n puts \"_deconvert_char failed to find a match for [#{c}]\"\n pp chart\n raise \n end\n r\n end",
"title": ""
},
{
"docid": "0b19088768257090827ccc4c86c1d57b",
"score": "0.6066075",
"text": "def decode text\n CGI.unescape(text)\n end",
"title": ""
},
{
"docid": "f017309b95b23dd802c86530a7736692",
"score": "0.6048872",
"text": "def decode_code\n @code = Rex::Text.to_ascii(Rex::Text.decode_base64(code))\n end",
"title": ""
},
{
"docid": "aaee122f62bcd87d98a3b3e344544abe",
"score": "0.6041174",
"text": "def render_codepoint cp\n '[%04X]' % cp\n end",
"title": ""
},
{
"docid": "c9d8047db1b0b31146cfd60df9a480be",
"score": "0.60302097",
"text": "def decode_char(input)\n return from_ansi(input) if @mode == ANSI_MODE\n return from_mysql(input) if @mode == MYSQL_MODE\n end",
"title": ""
},
{
"docid": "729fc563488b04586a91f78ac3be567a",
"score": "0.6023654",
"text": "def decode()\n shift = frequency(@text)\n @text.each_char { |c| print( (c.ord+shift).chr) } \n end",
"title": ""
},
{
"docid": "137415368511cab5df66996170a6fd8b",
"score": "0.59962696",
"text": "def char_numeric\n fmap(choose(48, 57)) do |v|\n v.chr(CHAR_ENCODING)\n end\n end",
"title": ""
},
{
"docid": "3a6b744dc4cc513941be63b5ff27e332",
"score": "0.59959483",
"text": "def get_utf(character)\r\n character.unpack('U')\r\n end",
"title": ""
},
{
"docid": "4e0f989add2f7d803f347a5fd54d93ba",
"score": "0.5951938",
"text": "def decode (string, num)\n\n p ascii = string.chars.map { |x| x.ord }\n p shift = ascii.map { |x| x - num }\n p shift.map { |x| x.chr }.join\n\n end",
"title": ""
},
{
"docid": "16e8ac247aa72e7a065aa7d9081d12a8",
"score": "0.5925402",
"text": "def parse_char(char)\n RUBY_VERSION > '1.9' ? char : char.chr\n end",
"title": ""
},
{
"docid": "0babab971005d3c12386646c15cb0594",
"score": "0.58931696",
"text": "def decode_sequence(escape_sequence)\n if /=[0-9a-fA-F]{2}/ =~ escape_sequence\n escape_sequence[1, 2].to_i(16).chr\n elsif escape_sequence == \"=#{NEWLINE}\"\n ''\n end\n end",
"title": ""
},
{
"docid": "67e4779112cb9c467b305f5e7dafee13",
"score": "0.5869036",
"text": "def decrypt_char(char)\n return char.ord - @key\n end",
"title": ""
},
{
"docid": "3b49f0d89e82fe1830eb261ab9627cd1",
"score": "0.58683014",
"text": "def getChar(c)\n c.chr\nend",
"title": ""
},
{
"docid": "5811fe252948e518ccb2d3c1ac447ff7",
"score": "0.5858042",
"text": "def decode(int)\n return ((int * 5)/20).chr\n\nend",
"title": ""
},
{
"docid": "c69a0dcbc9f41049dfa17056494d8288",
"score": "0.585373",
"text": "def char_code\n code, char = nil, to_s\n char.each_byte { |x| code = x }\n code\n end",
"title": ""
},
{
"docid": "8998eb13fbb703236377c81298c056ae",
"score": "0.58284974",
"text": "def char(str)\n str.ord\n end",
"title": ""
},
{
"docid": "8998eb13fbb703236377c81298c056ae",
"score": "0.58284974",
"text": "def char(str)\n str.ord\n end",
"title": ""
},
{
"docid": "591eef1b892832a6feb14360bd036fa8",
"score": "0.5805788",
"text": "def decode(str)\n str.gsub(/:(\\S?[\\w-]+):/) {|sym| Emoji.find($1.intern).to_s }\n end",
"title": ""
},
{
"docid": "e29f603cf60a2709ae972a056534d128",
"score": "0.58017975",
"text": "def decode_shift char\n 26 - (char.unpack('C*')[0] - 101)\nend",
"title": ""
},
{
"docid": "7d7bfae0b5caa18766c34ec7385a9920",
"score": "0.578425",
"text": "def utf(char)\n char = char.unpack('U*').first\n case char\n when \"3134\".hex\n # consonants ㄴ \"1102\"\n char = \"1102\".hex\n when \"3141\".hex..\"3143\".hex\n # consonants ㅁ to ㅃ\n char_dist = \"3141\".hex - \"1106\".hex\n char = char - char_dist\n when \"3145\".hex..\"314E\".hex\n # consonants ㅅ to ㅎ\n char_dist = \"3145\".hex - \"1109\".hex\n char = char - char_dist\n when \"314F\".hex..\"3163\".hex\n # vowels ㅏ to ㅣ\n char_dist = \"314F\".hex - \"1161\".hex\n char = char - char_dist\n end\n Array[char].pack('U*')\n end",
"title": ""
},
{
"docid": "e430a7d94caafe811d82f029b16834d2",
"score": "0.5776651",
"text": "def encode_character(char)\n if @@has_ord ||= char.respond_to?(:ord)\n char.ord.to_s\n else\n char[0]\n end\n end",
"title": ""
},
{
"docid": "9ac28a0d446a401352c222a49ffbbc0e",
"score": "0.57751006",
"text": "def decode(code)\n size = code.length\n if (size == 1)\n return CHARS.index(code)\n else\n return decode(code[1, size]) + CHARS.index(code[0, 1]) * BASE** (size - 1)\n end\n end",
"title": ""
},
{
"docid": "7dbef94246bfe384446bd07dd2cd2414",
"score": "0.5773458",
"text": "def decoded\n @str\n end",
"title": ""
},
{
"docid": "de90cc30e20a6e39529d95e5ed14bd73",
"score": "0.5757821",
"text": "def decode_b(str)\n str.gsub!(/=\\?ISO-2022-JP\\?B\\?([!->@-~]+)\\?=/i) {\n decode64($1)\n }\n #str = Kconv::toeuc(str)\n str.gsub!(/=\\?SHIFT_JIS\\?B\\?([!->@-~]+)\\?=/i) {\n decode64($1)\n }\n #str = Kconv::toeuc(str)\n str.gsub!(/\\n/, ' ') \n str.gsub!(/\\0/, '')\n str\n end",
"title": ""
},
{
"docid": "38d34d5b4d85a47d8bd379059575204d",
"score": "0.5746743",
"text": "def decode(str, alphabet=CHARS)\n base = alphabet.size\n l = str.size\n num, i = 0, 0\n\n str.chars do |c|\n power = l - (i + 1)\n num += (alphabet.index(c) * (base ** power))\n i += 1\n end\n num\n end",
"title": ""
},
{
"docid": "d1aa83357e0f7f2978147cc36e88003b",
"score": "0.5742166",
"text": "def codepoint_of(character)\n character.unpack('U*').first\nend",
"title": ""
},
{
"docid": "ede3270454e465682eb935f5a10bd730",
"score": "0.57238215",
"text": "def char_to_int(str) # ascii\n str.ord - 48\nend",
"title": ""
},
{
"docid": "cd5529c88fc1f67f1f2edddfe1427b59",
"score": "0.5716871",
"text": "def ord(char)\n char[0]\n end",
"title": ""
},
{
"docid": "dfd92e7ba8ee108927915466f17af341",
"score": "0.5678697",
"text": "def decode_entities(string)\n string.gsub!(/&#x([a-zA-Z0-9]{1,7});/) { [$1.to_i(16)].pack(\"U\") }\n string.gsub!(/&#(\\d{1,7});/) { [$1.to_i].pack(\"U\") }\n string.gsub(/&([a-zA-Z0-9]+);/) do\n codepoint = html_entities_data[$1]\n codepoint ? [codepoint].pack(\"U\") : $&\n end\n end",
"title": ""
},
{
"docid": "ba701326e194e7171872aa4a5b49c5b4",
"score": "0.56714404",
"text": "def decode_bytea(str)\n str.gsub(/\\\\(\\\\|'|[0-3][0-7][0-7])/) {|s|\n if s.size == 2 then s[1,1] else s[1,3].oct.chr end\n }\n end",
"title": ""
},
{
"docid": "6630c18a23069662e33b2e77956f5213",
"score": "0.56705856",
"text": "def decode(source)\n return source.to_s.gsub(named_entity_regexp) {\n (cp = map[$1]) ? [cp].pack('U') : $&\n }.gsub(/&#([0-9]{1,7});|&#x([0-9a-f]{1,6});/i) {\n $1 ? [$1.to_i].pack('U') : [$2.to_i(16)].pack('U')\n }\n end",
"title": ""
},
{
"docid": "f2cec63515336a646003612affffe5e0",
"score": "0.56564105",
"text": "def to_char(c)\n CHARSET.at(to_integer(c))\nend",
"title": ""
},
{
"docid": "acd6e83812aeab27cee70b5b6c7673f9",
"score": "0.56524163",
"text": "def decode(ht, text)\r\n text.each_char.inject(['', ht]) do |(out, node), sym|\r\n case sym\r\n when '0' then next_node = node.left\r\n when '1' then next_node = node.right\r\n else raise 'Invalid code format'\r\n end\r\n next_node.leaf? ?\r\n [out << next_node.value[0], ht] :\r\n [out, next_node]\r\n end\r\nend",
"title": ""
},
{
"docid": "443aff57aff68452228feef0bd3acb99",
"score": "0.56523496",
"text": "def decode(input)\n return '' if input.empty?\n\n result = ''\n chr_count = 0\n input.each_char do |chr|\n if chr.match?(/[0-9]/)\n chr_count = chr_count.zero? ? chr.to_i : chr_count * 10 + chr.to_i\n else\n chr_count.zero? ? result << chr : result << chr * chr_count\n # result << chr_count.zero? ? chr : chr * chr_count this doesn't work\n chr_count = 0\n end\n end\n result\n end",
"title": ""
},
{
"docid": "bd8c23ecdc112acce0cf5dd835fa2e3f",
"score": "0.564077",
"text": "def convertToCharCodes(str)\n codes = []\n str.each_char do |c|\n codes.push c.unpack(\"U*\")\n end\n return codes.join('-')\nend",
"title": ""
},
{
"docid": "15dc0c80038a2e4a7d6d2463781b3bce",
"score": "0.56285733",
"text": "def decode_entities(str)\n str.gsub(/&[\\S]+;/) do |entity|\n begin\n [Nokogiri::HTML::NamedCharacters[entity[1..-2]]].pack(\"C\")\n rescue TypeError\n entity\n end\n end\n end",
"title": ""
},
{
"docid": "92426883e57fd676502fecfcfcc89b36",
"score": "0.56103605",
"text": "def entity_decoded(s)\n if s && (s.include?('&#') || s.include?('"'))\n CGI.unescapeHTML(s)\n else\n s\n end\n end",
"title": ""
},
{
"docid": "07a347e76fe6b8256c051e166f1dd2d5",
"score": "0.5593488",
"text": "def ord(char)\n char.ord\nrescue\n char[0]\nend",
"title": ""
},
{
"docid": "fcc8f107d4a224cfa636a13b1806825f",
"score": "0.558243",
"text": "def ent_dec\n foo=[]\n self.scan(/./) { |char| foo << \"&\\##{char.ord}\" }\n return foo.join\n end",
"title": ""
},
{
"docid": "23dc09e4f9d0a823638659dab61091e9",
"score": "0.55600077",
"text": "def encoding_for(char)\n encodings[values[char]]\n end",
"title": ""
},
{
"docid": "d6d73fe6ece0ab088212bbd65475658d",
"score": "0.554693",
"text": "def decode(str, depth = 0)\n read_value StringCursor.new(str), depth\n end",
"title": ""
},
{
"docid": "e497fc62f6027310024b2fcdd57faca0",
"score": "0.5545165",
"text": "def get_char_value_from_grammar_char_literal(literal)\n case (literal.length)\n when 3\n # 'x'\n return literal.char_at(1)\n when 4\n # no escape char\n # '\\x' (antlr lexer will catch invalid char)\n if (Character.is_digit(literal.char_at(2)))\n ErrorManager.error(ErrorManager::MSG_SYNTAX_ERROR, \"invalid char literal: \" + literal)\n return -1\n end\n esc_char = literal.char_at(2)\n char_val = self.attr_antlrliteral_escaped_char_value[esc_char]\n if ((char_val).equal?(0))\n # Unnecessary escapes like '\\{' should just yield {\n return esc_char\n end\n return char_val\n when 8\n # '\\u1234'\n unicode_chars = literal.substring(3, literal.length - 1)\n return JavaInteger.parse_int(unicode_chars, 16)\n else\n ErrorManager.error(ErrorManager::MSG_SYNTAX_ERROR, \"invalid char literal: \" + literal)\n return -1\n end\n end",
"title": ""
},
{
"docid": "1ca1b8f8018832deeb52964425e79b97",
"score": "0.5526478",
"text": "def decode(string, base)\r\n\t\treturn string.to_i if base == 10\r\n\r\n\t\tcode_string = @code_strings[base] #get_code_string(base)\r\n\t\tresult = 0\r\n\r\n\t\tif base == 256\r\n\t\t\tdef extract(c, cs)\r\n\t\t\t\treturn cs.index(c)\r\n\t\t\tend\r\n\t\telse\r\n\t\t\tdef extract(c, cs)\r\n\t\t\t\treturn cs.index(c.is_a?(String) ? c : c.chr)\r\n\t\t\tend\r\n\t\tend\r\n\r\n\t\tstring.downcase! if base == 16\r\n\r\n\t\twhile string.length > 0\r\n\t\t\tresult *= base\r\n\t\t\tresult += extract(string[0], code_string)\r\n\t\t\tstring = string[1..-1]\r\n\t\tend\r\n\r\n\t\treturn result\r\n\tend",
"title": ""
},
{
"docid": "782fee760c794efbdc4696bda54dcfe1",
"score": "0.5522282",
"text": "def decrypt(char)\n case char.downcase\n when 'a'..'m'\n (char.ord + 13).chr\n when 'n'..'z'\n (char.ord - 13).chr\n else\n char\n end\nend",
"title": ""
},
{
"docid": "347ca31eb74783ab6b35e3e322491643",
"score": "0.5520466",
"text": "def non_utf8_character\n [0x92].pack('C*')\n end",
"title": ""
},
{
"docid": "347ca31eb74783ab6b35e3e322491643",
"score": "0.5520466",
"text": "def non_utf8_character\n [0x92].pack('C*')\n end",
"title": ""
},
{
"docid": "26a508f4522411c0dbbd90779a0d86d9",
"score": "0.5519495",
"text": "def get_unicode_sequence (charcode)\n\t\treturn transform_string( \"\\\\u\" + get_hex_string(charcode, 4) )\n\tend",
"title": ""
},
{
"docid": "1cd1e863cd30812957421b01e797989f",
"score": "0.55127805",
"text": "def decode(text)\n encoded_str = ''\n text.split('').each_with_index do |char, index|\n current_index = ALPHABET.index(char)\n shift = key[index].nil? ? ALPHABET.index(key[-1]) : ALPHABET.index(key[index])\n encoded_str << ALPHABET[(current_index - shift) % 26]\n end\n\n encoded_str\n end",
"title": ""
},
{
"docid": "d41cde2d1583b02ffe3704e4f9b712a4",
"score": "0.5505288",
"text": "def decode(str)\n str.gsub(/:([^s:]?[\\w-]+):/) {|sym| (Emoji.find($1.intern) || sym).to_s }\n end",
"title": ""
},
{
"docid": "a96421a9c42cc2be2a803e8767b4c057",
"score": "0.54993933",
"text": "def chr\n if String.version[1] < 9\n puts \"chr not supported in Ruby #{RUBY_VERSION}\"\n return 0\n else\n get_char(0)\n end\n end",
"title": ""
},
{
"docid": "cc1b3a13a5badf9b7b90d86154d306d4",
"score": "0.54935217",
"text": "def caesar_decode(string, offset)\n string.split(\"\").map do |character|\n if $array_abc_down.include?(character)\n new_character = $array_abc_down[($array_abc_down.index(character)-offset)%26]\n elsif $array_abc_upper.include?(character)\n new_character = $array_abc_upper[($array_abc_upper.index(character)-offset)%26]\n else\n character \n end\n end.join(\"\") \nend",
"title": ""
},
{
"docid": "0922c73adceab8e5b15ad372b3547132",
"score": "0.54852635",
"text": "def decode(name)\n name.gsub!(/_(?!_)/,' ')\n name.gsub!(/_ /,'_')\n CGI::unescape(name)\n end",
"title": ""
},
{
"docid": "066f097720509db1259531920f417dca",
"score": "0.54850024",
"text": "def edecode\n return @@he.decode(self)\n end",
"title": ""
},
{
"docid": "188e9022201ad5b02c2cdb15ab6476c3",
"score": "0.5483677",
"text": "def decode(text, allow_lowercase = false)\n encoded_re = Regexp.new(\"=([0-9A-F]{2})\", allow_lowercase ? \"i\" : \"\")\n text.gsub(\"\\r\\n\", \"\\n\").gsub(\"=\\n\", \"\").gsub(encoded_re) do\n $1.to_i(16).chr\n end\n end",
"title": ""
},
{
"docid": "57dffa2ccaba1bbe17fd978e31938823",
"score": "0.5471008",
"text": "def transform_char(char)\n\t\t# if we already know about char, just look it up and return it obfu'd.\n\t\tif @characters.include?(char)\n\t\t\treturn @characters[char]\n\t\tend\n\t\tcharcode = char.bytes.first #char[0].ord # this works in Ruby 1.8 and 1.9, nice.\n\t\tif (char == \"\\\\\" or char == \"x\")\n\t\t\t# These chars must be handled apart because the others need them\n\t\t\t@characters[char] = get_unescape_sequence(charcode)\n\t\t\treturn @characters[char]\n\t\tend\n\n\t\tshortest_sequence = get_unicode_sequence(charcode)\n\n\t\t# ASCII@characters can be obtained with hexa and unscape sequences\n\t\tif (charcode < 128)\n\t\t\tunescape_sequence = get_unescape_sequence(charcode)\n\t\t\tif (shortest_sequence.length > unescape_sequence.length)\n\t\t\t\tshortest_sequence = unescape_sequence\n\t\t\tend\n\n\t\t\thex_sequence = get_hex_sequence(charcode)\n\t\t\tif (shortest_sequence.length > hex_sequence.length)\n\t\t\t\tshortest_sequence = hex_sequence\n\t\t\tend\n\t\tend\n\n\t\t@characters[char] = shortest_sequence\n\t\treturn shortest_sequence\n\tend",
"title": ""
},
{
"docid": "a7458126be2077c755eba4009b1f21d5",
"score": "0.54666966",
"text": "def test_should_decode_named_entities_reported_as_missing_in_3_0_1\n assert_decode([178].pack('U'), '²')\n assert_decode([8226].pack('U'), '•')\n assert_decode([948].pack('U'), 'δ')\n end",
"title": ""
},
{
"docid": "71ab011f4fb28191c79c4835ee4d7d12",
"score": "0.5465324",
"text": "def decode(string)\n decoded = ''\n string = string.to_s\n token = 0\n while token <= string.size - 1\n number = decode_map[string[token]].to_s\n decoded += number.size == 1 ? \"0#{number}\" : number\n token += 1\n end\n decoded.to_i\n end",
"title": ""
},
{
"docid": "c414824f3873e8661813eae6235b6110",
"score": "0.5463847",
"text": "def decode(c)\n input = @crypto ? decrypt(c) : c\n @encoder.decode(input)\n end",
"title": ""
},
{
"docid": "91407b603c995de6493aaebc8b3611e9",
"score": "0.54473186",
"text": "def get_antlrchar_literal_for_char(c)\n if (c < Label::MIN_CHAR_VALUE)\n ErrorManager.internal_error(\"invalid char value \" + RJava.cast_to_string(c))\n return \"'<INVALID>'\"\n end\n if (c < self.attr_antlrliteral_char_value_escape.attr_length && !(self.attr_antlrliteral_char_value_escape[c]).nil?)\n return Character.new(?\\'.ord) + self.attr_antlrliteral_char_value_escape[c] + Character.new(?\\'.ord)\n end\n if ((Character::UnicodeBlock.of(RJava.cast_to_char(c))).equal?(Character::UnicodeBlock::BASIC_LATIN) && !Character.is_isocontrol(RJava.cast_to_char(c)))\n if ((c).equal?(Character.new(?\\\\.ord)))\n return \"'\\\\\\\\'\"\n end\n if ((c).equal?(Character.new(?\\'.ord)))\n return \"'\\\\''\"\n end\n return Character.new(?\\'.ord) + Character.to_s(RJava.cast_to_char(c)) + Character.new(?\\'.ord)\n end\n # turn on the bit above max \"\\uFFFF\" value so that we pad with zeros\n # then only take last 4 digits\n hex = JavaInteger.to_hex_string(c | 0x10000).to_upper_case.substring(1, 5)\n unicode_str = \"'\\\\u\" + hex + \"'\"\n return unicode_str\n end",
"title": ""
},
{
"docid": "d42654abe788316a56e13041f9f1e159",
"score": "0.54334795",
"text": "def charCodeAt(ch)\n self[ch].ord unless self[ch].nil?\n end",
"title": ""
},
{
"docid": "8082217f80f3631eb0393c66e4242099",
"score": "0.5426315",
"text": "def ascii_translator(number)\n# method name: #ascii_translator\n# parameter: number (an integer)\n# return value: the number's ASCII character (https://www.ascii-code.com/)\n# hint: use Integer#chr\nnumber.chr\nend",
"title": ""
},
{
"docid": "9defc3e0710e44179d5bfc18e0be8225",
"score": "0.5423001",
"text": "def unicode_filter_decode(str)\n\t\tself.encode_unicode ? Rex::Text.unicode_filter_decode(str) : str\n\tend",
"title": ""
},
{
"docid": "02f00199c7db64348488e0a2a3e04567",
"score": "0.5421872",
"text": "def decode(string)\n return if string.nil?\n CGI.unescapeHTML(string)\n end",
"title": ""
},
{
"docid": "b8493455ba6a0db8889313f64dae09b0",
"score": "0.5420108",
"text": "def char\n fmap(choose(0, 255)) do |v|\n v.chr(CHAR_ENCODING)\n end\n end",
"title": ""
},
{
"docid": "972d8f7e16c671866a9451db07e1afda",
"score": "0.5414492",
"text": "def process(str)\n Unidecoder.new(str).to_ascii\n end",
"title": ""
},
{
"docid": "54bce219cd32fb392f11ca64e7dd291e",
"score": "0.5402484",
"text": "def decode(encoded)\n digits = encoded.split(//).map{ |c| @values[c] }\n Radix.convert_base(digits, base, 256).pack(\"C*\")\n end",
"title": ""
},
{
"docid": "18e9e4de973698d3262761280fb461fd",
"score": "0.5400939",
"text": "def backsub_char(ch)\n\t\t\t(((key.inv_coeff * ((ch.ord - 65) - key.const)) % 26) + 65).chr\n\t\tend",
"title": ""
},
{
"docid": "326beaaa667eb87cabd36946cfd94e76",
"score": "0.53926027",
"text": "def decode(letter)\n\t\tif @word.split(\"\").count(letter) > 1\n\t\t\t@index = find_index(letter)\n\t\t\t@index.each do |ind|\n\t\t\t\t@encoded_word[ind] = letter\n\t\t\t\tjoin_the_letters\n\t\t\tend\n\t\telse\n\t\t\t@encoded_word[@word.index(letter)] = letter\n\t\t\t join_the_letters\n\t\tend\n\t\tp join_the_letters\n\tend",
"title": ""
},
{
"docid": "db888634c81c0889ae325ee4ae25a4e6",
"score": "0.53861153",
"text": "def decode(string)\n `decodeURIComponent(#{string})`\n end",
"title": ""
},
{
"docid": "f569790214c43afc2c1cf45979cc7944",
"score": "0.5385121",
"text": "def value_decode(str); end",
"title": ""
},
{
"docid": "3f5577e941e48fb751a1fd66c4c54d7e",
"score": "0.5382513",
"text": "def parse_numeric_character_reference_end_state\n @character_reference_code = 0xFFFD if @character_reference_code.zero?\n\n @character_reference_code = 0xFFFD if @character_reference_code > 0x10ffff\n\n @character_reference_code = 0xFFFD if @character_reference_code.between?(0xD800, 0xDFFF)\n\n # If the number is a noncharacter, then this is a noncharacter-character-reference parse error.\n # If the number is 0x0D, or a control that's not ASCII whitespace, then this is a control-character-reference parse error. If the number is one of the numbers in the first column of the following table, then find the row with that number in the first column, and set the character reference code to the number in the second column of that row.\n\n @temporary_buffer = String.new\n @temporary_buffer << @character_reference_code\n flush_code_points_consumed_as_character_reference\n @state = @return_state\n end",
"title": ""
},
{
"docid": "a6aa0f09c87a080f6132ab1a4fb5676b",
"score": "0.5375468",
"text": "def unescape_string(input)\n input.gsub(ECHAR) { |escaped| ESCAPE_CHARS[escaped] || escaped[1..-1]}\n end",
"title": ""
},
{
"docid": "7f8b5f667d728b3d25ccdd3e768d9414",
"score": "0.53727335",
"text": "def decode_entities\n return gsub(HTMLEntities::NAMED_ENTITY_REGEXP) { \n HTMLEntities::MAP.has_key?($1) ? [HTMLEntities::MAP[$1]].pack('U') : $& \n }.gsub(/&#([0-9]{1,7});/) { \n [$1.to_i].pack('U') \n }.gsub(/&#x([0-9a-f]{1,6});/i) { \n [$1.to_i(16)].pack('U') \n }\n end",
"title": ""
},
{
"docid": "5b73361d0915a22a94c0e8ca9acf5c93",
"score": "0.53668416",
"text": "def decoded_data\n URI.unescape(@data).encode('UTF-8', 'Windows-1251')\n end",
"title": ""
},
{
"docid": "17c65a2b68096ba96307beb0dbba2693",
"score": "0.5363566",
"text": "def decode(bin)\n m = bin.size % 4\n bin += '=' * (4 - m) if m != 0\n bin.tr('-_', '+/').unpack('m0').first\n end",
"title": ""
},
{
"docid": "57aee11325411a017ddfd1caff6b47f6",
"score": "0.53589123",
"text": "def decrypt_char(char, i, seed)\n (char.hex^VT_TABLE[(i + seed) % 53]).chr\n end",
"title": ""
},
{
"docid": "d11d5aa5d157fd94939f92bbe62a30a6",
"score": "0.535529",
"text": "def hexToDec(hexChar)\n #Between 0 and 9\n if hexChar.match(/\\d/)\n return hexChar.to_i\n else\n case hexChar \n when 'A'\n return 10 \n when 'B'\n return 11 \n when 'C'\n return 12 \n when 'D'\n return 13 \n when 'E'\n return 14 \n when 'F'\n return 15\n end\n end \nend",
"title": ""
},
{
"docid": "d11d5aa5d157fd94939f92bbe62a30a6",
"score": "0.535529",
"text": "def hexToDec(hexChar)\n #Between 0 and 9\n if hexChar.match(/\\d/)\n return hexChar.to_i\n else\n case hexChar \n when 'A'\n return 10 \n when 'B'\n return 11 \n when 'C'\n return 12 \n when 'D'\n return 13 \n when 'E'\n return 14 \n when 'F'\n return 15\n end\n end \nend",
"title": ""
},
{
"docid": "d11d5aa5d157fd94939f92bbe62a30a6",
"score": "0.535529",
"text": "def hexToDec(hexChar)\n #Between 0 and 9\n if hexChar.match(/\\d/)\n return hexChar.to_i\n else\n case hexChar \n when 'A'\n return 10 \n when 'B'\n return 11 \n when 'C'\n return 12 \n when 'D'\n return 13 \n when 'E'\n return 14 \n when 'F'\n return 15\n end\n end \nend",
"title": ""
}
] |
9f20d257dd5a8fba8c5a0052b2c31674 | Throw an exception if dependencies are found. We only return the dependency list since we throw an exception on circular dependencies. | [
{
"docid": "4d18f6c1421280ebf80402c41b525ff2",
"score": "0.0",
"text": "def resolve!\n dl, cl = resolve\n raise GraphException(\"Circular Dependency Detected: %s\" % cl) unless cl.nil?\n dl\n end",
"title": ""
}
] | [
{
"docid": "8687a56b4c4eb9f08506a4901bc3541a",
"score": "0.67496675",
"text": "def enumerate_dependencies\n raise DependencyEnumerationNotImplementedError\n end",
"title": ""
},
{
"docid": "f93b184e43f67a6ac4cab151aef1f42b",
"score": "0.6612601",
"text": "def dependencies\n []\n end",
"title": ""
},
{
"docid": "3c499b6ee297daceded9be1337031e54",
"score": "0.65852433",
"text": "def dependencies\n @dependencies.collect { |name, dependency| dependency }\n end",
"title": ""
},
{
"docid": "5543dce434a59d93e4e7e12d8ceb1d98",
"score": "0.6533117",
"text": "def dependencies\n []\n end",
"title": ""
},
{
"docid": "9d804eb3fbc283150467e2721a8c3b9f",
"score": "0.6476019",
"text": "def dependencies(include_parent = false)\n []\n end",
"title": ""
},
{
"docid": "9d804eb3fbc283150467e2721a8c3b9f",
"score": "0.6476019",
"text": "def dependencies(include_parent = false)\n []\n end",
"title": ""
},
{
"docid": "9d804eb3fbc283150467e2721a8c3b9f",
"score": "0.6476019",
"text": "def dependencies(include_parent = false)\n []\n end",
"title": ""
},
{
"docid": "bb23b184b0acac964b70ee72cca93b64",
"score": "0.64480805",
"text": "def find_dependencies(deps=nil, verbose=false)\n \n deps ||= all_dependencies\n\n search_list = Array(deps)\n found = []\n ret = []\n \n # if we discover a new local package via indirect dependencies then\n # it's dependencies will be fetchable one time.\n fetchable = Set.new\n \n until search_list.empty?\n name, version = search_list.shift\n\n if dup = found.find{|p| p.name == name}\n # already found, check for conflicts\n next if satisfied_by?(version, dup.version)\n raise PackageConflictError.new(name, dup.version, version)\n end\n\n pkg = locate_package(name, version, verbose)\n if pkg.nil? && fetchable.include?(name)\n fetchable.reject! { |x| x == name }\n core_fetch_dependency(name, version, :runtime, true) \n pkg = locate_package name, version, verbose\n end\n \n raise PackageNotFoundError.new(name, version) unless pkg\n\n found << pkg\n\n # Look up dependencies of dependencies\n new_deps = Array(pkg.dependencies) + Array(pkg.dependencies_build)\n if has_local_package? pkg.name\n new_deps += Array(pkg.dependencies_development)\n new_deps.each { |dep| fetchable.add dep.first }\n end\n \n search_list += new_deps\n\n ret << pkg\n end\n\n ret\n end",
"title": ""
},
{
"docid": "c56e0ad0eb7617a5b6d388e0256e1b3b",
"score": "0.64478177",
"text": "def dependencies\n []\n end",
"title": ""
},
{
"docid": "f96e995b458026c8b9afcc0b746ef1b1",
"score": "0.6442081",
"text": "def find_dependencies\n\t\tunless GEMDEPS_FILE.readable?\n\t\t\tself.prompt.warn \"Deps file (%s) is missing or unreadable, assuming no dependencies.\" %\n\t\t\t\t[ GEMDEPS_FILE ]\n\t\t\treturn []\n\t\tend\n\n\t\tfinder = Rake::DevEiate::GemDepFinder.new( GEMDEPS_FILE )\n\t\tfinder.load\n\t\treturn finder.dependencies\n\tend",
"title": ""
},
{
"docid": "5318eea6ead45bb4fe3d9eadc2302028",
"score": "0.63627416",
"text": "def dependencies\n @dependencies ||= []\n end",
"title": ""
},
{
"docid": "5318eea6ead45bb4fe3d9eadc2302028",
"score": "0.63627416",
"text": "def dependencies\n @dependencies ||= []\n end",
"title": ""
},
{
"docid": "5318eea6ead45bb4fe3d9eadc2302028",
"score": "0.63627416",
"text": "def dependencies\n @dependencies ||= []\n end",
"title": ""
},
{
"docid": "5318eea6ead45bb4fe3d9eadc2302028",
"score": "0.63627416",
"text": "def dependencies\n @dependencies ||= []\n end",
"title": ""
},
{
"docid": "83e019e67892fb225047ac42eedf3614",
"score": "0.6288071",
"text": "def resolveDependences(list)\n\n #\n # Resolve potential conflict if interface is unique.\n #\n\n if @unique then\n filtered_interfaces = list.find_all do |f|\n f != self && self.overlap?(f)\n end\n filtered_interfaces.each { |f| list.delete(f) }\n end\n\n #\n # Compute the dependencies and try to resolve the conflicts, if any.\n #\n\n dlist = [ self ]\n dlist, rlist, xlist = self.resolveDependencesRecursive([], list, dlist, [])\n\n rlist.each do |r|\n overlap = []\n r_interface = list.find { |c| c.id == r }\n overlap = xlist.find_all { |x| x.overlap?(r_interface) }\n\n if not overlap.empty? then\n overlap.each { |o| xlist.delete(o) }\n end\n end\n\n if not xlist.empty? then\n error = \"Conflict found: \"\n xlist.each { |x| error += x.id.to_s + ' ' }\n raise Exception.new(error)\n end\n\n return dlist\n end",
"title": ""
},
{
"docid": "96166bd6f7cf08ad9ca77593dcef244d",
"score": "0.62832654",
"text": "def dependencies\n @dependencies ||= []\n end",
"title": ""
},
{
"docid": "c1d91c533bbc4d5eb0494c1bbd675621",
"score": "0.6280556",
"text": "def validate_dependencies\n Spiceweasel::Log.debug(\"cookbook validate_dependencies: '#{@dependencies}'\")\n @dependencies.each do |dep|\n unless member?(dep)\n STDERR.puts \"ERROR: Cookbook dependency '#{dep}' is missing from the list of cookbooks in the manifest.\"\n exit(-1)\n end\n end\n end",
"title": ""
},
{
"docid": "cae2780da41eed0634bbb00a0c339dc1",
"score": "0.6280494",
"text": "def dependencies\n EMPTY_SET\n end",
"title": ""
},
{
"docid": "810b894003441aad9374e01d3b9d354a",
"score": "0.6274763",
"text": "def dependencies( names )\n names.each do |name|\n if calculation = fetch( name, nil )\n calculation.dependencies.each do |dependency|\n names << dependency unless names.include?( dependency )\n end\n end\n end\n end",
"title": ""
},
{
"docid": "a52e4fca90a4031edb37b8748e0089af",
"score": "0.6256889",
"text": "def dependencies_for(specification)\n []\n end",
"title": ""
},
{
"docid": "2898d413376b9d2f39734c0fe44574cb",
"score": "0.6191378",
"text": "def verify_dependencies\n missing_frags = {}\n dependency_graph.each do |fragment, dependencies|\n missing = dependencies.to_set - dependency_graph.keys.to_set\n next unless missing.size > 0\n missing_frags[fragment] = missing.to_a\n end\n\n _fail_because_missing(missing_frags) if missing_frags.size > 0\n end",
"title": ""
},
{
"docid": "d74184466a159770acee33233fbee884",
"score": "0.61503685",
"text": "def lookup_dependencies(cookbook, checked = {})\n Berkshelf.log.debug \" Looking up dependencies for #{cookbook}\"\n\n dependencies = []\n\n lockfile.graph.find(cookbook).dependencies.each do |name, _|\n next if checked[name]\n\n # break cyclic graphs\n checked[name] = true\n\n # this is your standard depth-first tree traversal with the deps first...\n dependencies += lookup_dependencies(name, checked)\n # ..then the node itself\n dependencies << name\n end\n dependencies\n end",
"title": ""
},
{
"docid": "d733dbaa38fb6384d4af8072e0f5b4c4",
"score": "0.61220956",
"text": "def add_depend_list\n list = ''\n if @depedencies.nil? or @depedencies.size == 0\n list = ''\n elsif @depedencies.class == String\n list = \"=> [:#{@depedencies}] \"\n elsif @depedencies.class == Array\n list = '=> [ '\n need_comma = false\n for element in @depedencies\n list = list + ', ' if need_comma\n list = list + \":#{element}\"\n @log.info \" - dependent from : #{element}\"\n need_comma = true\n end\n list = list + ' ] '\n else\n @log.fatal { \"Cannot parse dependencies [#{@depedencies}]\" }; exit\n end\n return list\n end",
"title": ""
},
{
"docid": "c96f1d1c89f7e0a71a65ae0795914e97",
"score": "0.6121725",
"text": "def dependencies\n @dependencies.values\n end",
"title": ""
},
{
"docid": "b2e5735f605438c5eb5627609c925902",
"score": "0.60911685",
"text": "def get_dependencies(_fidl, _interaction_types, _project_dependencies)\n # noop\n end",
"title": ""
},
{
"docid": "b03c704f4f7895daa8f01336a9fce336",
"score": "0.60907096",
"text": "def dependencies\n @dependencies ||= Set.new\n end",
"title": ""
},
{
"docid": "91cd934b3deaeb1059132d9853c39a42",
"score": "0.6086083",
"text": "def dependencies(options = {})\n # backward compatibility\n options = { :scopes => options } if Array === options\n\n # support symbols, but don't fidget with nil\n options[:scopes] = (options[:scopes] || SCOPES_WE_USE).map { |s| s.to_s if s }\n\n # try to cache dependencies also\n @depends_for_scopes ||= {}\n unless depends = @depends_for_scopes[options]\n declared = project['dependencies'].first['dependency'] rescue nil\n depends = (declared || [])\n depends = depends.reject { |dep| value_of(dep['optional']) =~ /true/ } unless options[:optional]\n depends = depends.map { |dep|\n spec = pom_to_hash(dep, properties)\n apply = managed(spec)\n spec = apply.merge(spec) if apply\n\n next if options[:exclusions] && options[:exclusions].any? { |ex| dep['groupId'] == ex['groupId'] && dep['artifactId'] == ex['artifactId'] }\n\n # calculate transitive dependencies\n if options[:scopes].include?(spec[:scope])\n spec.delete(:scope)\n\n exclusions = dep['exclusions'].first['exclusion'] rescue nil\n transitive_deps = POM.load(spec).dependencies(:exclusions => exclusions, :scopes => (options[:scopes_transitive] || SCOPES_TRANSITIVE) ) rescue []\n\n [Artifact.to_spec(spec)] + transitive_deps\n end\n }.flatten.compact #.uniq_by{|spec| art = spec.split(':'); \"#{art[0]}:#{art[1]}\"}\n @depends_for_scopes[options] = depends\n end\n depends\n end",
"title": ""
},
{
"docid": "d34a65622fa37b720163daa2bade7e42",
"score": "0.6055935",
"text": "def unused_dependencies_list\n imports = all_unique_imports.map { |import| import.split.last }\n dependency_list - imports\n end",
"title": ""
},
{
"docid": "d43b2211738acd2c4c9ca9b3fb73afe4",
"score": "0.60074556",
"text": "def dependencies( *args )\n names = args # note: for now assume all args are just names\n # e.g. 'pluto-models', 'pluto-update', etc.\n deps = @versions.select do |rec| names.include?( rec[0] ) end\n .map do |rec| [rec[0], rec[1]] end\n\n ## todo/fix: throw exception if dependency is missing!\n ## names.size == deps.size\n puts \"names.size == deps.size #{names.size} == #{deps.size}\"\n deps\n end",
"title": ""
},
{
"docid": "67ced52f116582056225a2dd68b7bc0d",
"score": "0.5992886",
"text": "def validate_dependencies_are_present!\n if @podfile_dependency_cache.target_definition_list.all?(&:empty?)\n add_warning 'The Podfile does not contain any dependencies.'\n end\n end",
"title": ""
},
{
"docid": "8eff1a0b8bc7493067d19ed226edcbc7",
"score": "0.5949287",
"text": "def gem_dependencies(list, gem_dependencies, options = {})\n gem_dependencies.each do |gd|\n if options['excludes'] && options['excludes'].to_s.split(',').include?(gd.name)\n next\n end\n\n gs = gd.matching_specs.first\n if gs\n unless list[gs.name]\n list[gs.name] = gs\n unless gs.dependencies.empty?\n list = gem_dependencies(list, gs.dependencies, options)\n end\n end\n else\n unless list[gd.name]\n list[gd.name] = Gem::Specification.new(\n gd.name,\n gd.requirements_list.last.scan(/[\\d\\.\\w]+/).first\n )\n rm_dep = remote_dependencies(gd.name, gd.requirements_list.last)\n unless rm_dep.empty?\n list = gem_dependencies(list, rm_dep, options)\n end\n end\n end\n end\n\n list\n end",
"title": ""
},
{
"docid": "70ac1491f29b93b252f3fb4118f16784",
"score": "0.59033656",
"text": "def check_dependencies\n fetch_module_dependencies.map do |dependency, constraint|\n dependency = dependency.sub('-', '/')\n current = dependency == @updated_module ? SemanticPuppet::Version.parse(@updated_module_version) : @forge.get_current_version(dependency)\n [dependency, constraint, current, constraint.include?(current)]\n end\n end",
"title": ""
},
{
"docid": "cd50c9eabdb6a0d97378fcc1a6958ae3",
"score": "0.5897107",
"text": "def dependencies\n version_req = if options[:version]\n ::Gem::Requirement.create(options[:version])\n else\n ::Gem::Requirement.default\n end\n if gem_dir\n ::Gem.clear_paths; ::Gem.path.unshift(gem_dir)\n ::Gem.source_index.refresh!\n end\n deps = []\n ::Gem.source_index.each do |fullname, gemspec| \n if version_req.satisfied_by?(gemspec.version)\n deps << ::Gem::Dependency.new(gemspec.name, \"= #{gemspec.version}\")\n end\n end\n ::Gem.clear_paths if gem_dir\n deps.sort\n end",
"title": ""
},
{
"docid": "07d538ca6b1a8f42c2ef8d913542771f",
"score": "0.58908457",
"text": "def ensure_dependencies(iDepDescList, iParameters = {})\n rError = nil\n rAppliedContextModifiers = {}\n rIgnoredDeps = []\n rUnresolvedDeps = []\n\n lAutoInstall = @DefaultOptions[:auto_install]\n if (iParameters.has_key?(:auto_install))\n lAutoInstall = iParameters[:auto_install]\n end\n lAutoInstallLocation = @DefaultOptions[:auto_install_location]\n if (iParameters.has_key?(:auto_install_location))\n lAutoInstallLocation = iParameters[:auto_install_location]\n end\n lPossibleContextModifiers = @DefaultOptions[:possible_context_modifiers]\n if (iParameters.has_key?(:possible_context_modifiers))\n lPossibleContextModifiers = iParameters[:possible_context_modifiers]\n end\n lPreferredViews = @DefaultOptions[:preferred_views]\n if (iParameters.has_key?(:preferred_views))\n lPreferredViews = iParameters[:preferred_views]\n end\n lPreferredProgressViews = @DefaultOptions[:preferred_progress_views]\n if (iParameters.has_key?(:preferred_progress_views))\n lPreferredProgressViews = iParameters[:preferred_progress_views]\n end\n # First, test if the dependencies are already accessible\n lDepsToResolve = []\n iDepDescList.each do |iDepDesc|\n if (!test_dependency(iDepDesc))\n lDepsToResolve << iDepDesc\n end\n end\n if (!lDepsToResolve.empty?)\n # Try resolving those dependencies with additional locations\n lMissingDependencies = []\n # Check if we can try some ContextModifiers that might find the missing dependencies\n if (lPossibleContextModifiers == nil)\n lMissingDependencies = lDepsToResolve\n else\n lMissingDependencies = getMissingDeps(lDepsToResolve, lPossibleContextModifiers, rAppliedContextModifiers)\n end\n if (!lMissingDependencies.empty?)\n # If we ask for auto-installation, go on\n if (lAutoInstall == nil)\n # Ask the user what to do with those missing dependencies\n rDepsUserChoices = askUserForMissingDeps(lMissingDependencies, lPreferredViews)\n # Create a progression view\n setupPreferredProgress(lPreferredProgressViews) do |ioProgressView|\n # Be careful, as ioProgressView can be nil if no view was found\n if (ioProgressView != nil)\n ioProgressView.set_range(rDepsUserChoices.size)\n end\n # Parse what was returned by the user choices\n rDepsUserChoices.each do |iDepUserChoice|\n lDepDesc = iDepUserChoice.DepDesc\n lIgnore = false\n if (iDepUserChoice.Locate)\n if (ioProgressView != nil)\n ioProgressView.set_title(\"Locate #{lDepDesc.ID}\")\n end\n if (lDepDesc.Testers.size == iDepUserChoice.ResolvedTesters.size)\n # This one was resolved using ContextModifiers.\n # Apply them.\n iDepUserChoice.ResolvedTesters.each do |iTesterName, iCMInfo|\n iCMName, iCMContent = iCMInfo\n access_plugin('ContextModifiers', iCMName) do |ioPlugin|\n ioPlugin.add_location_to_context(iCMContent)\n end\n end\n # Remember what we applied\n rAppliedContextModifiers[lDepDesc.ID] = iDepUserChoice.ResolvedTesters.values\n else\n rUnresolvedDeps << lDepDesc\n lIgnore = true\n end\n elsif (iDepUserChoice.IdxInstaller != nil)\n if (ioProgressView != nil)\n ioProgressView.set_title(\"Install #{lDepDesc.ID}\")\n end\n # This one is to be installed\n # Get the installer plugin\n lInstallerName, _, _ = lDepDesc.Installers[iDepUserChoice.IdxInstaller]\n access_plugin('Installers', lInstallerName) do |ioInstallerPlugin|\n lLocation = nil\n if (ioInstallerPlugin.PossibleDestinations[iDepUserChoice.IdxDestination][0] == DEST_OTHER)\n lLocation = iDepUserChoice.OtherLocation\n else\n lLocation = ioInstallerPlugin.PossibleDestinations[iDepUserChoice.IdxDestination][1]\n end\n lInstallEnv = {}\n rError = install_dependency(lDepDesc, iDepUserChoice.IdxInstaller, lLocation, lInstallEnv)\n # Get what has been modified in the context\n rAppliedContextModifiers[lDepDesc.ID] = lInstallEnv[:ContextModifiers]\n # If an error occurred, cancel\n if (rError != nil)\n break\n end\n end\n else\n if (ioProgressView != nil)\n ioProgressView.set_title(\"Ignore #{lDepDesc.ID}\")\n end\n rIgnoredDeps << lDepDesc\n lIgnore = true\n end\n if (ioProgressView != nil)\n ioProgressView.inc_value\n end\n if (!lIgnore)\n if (ioProgressView != nil)\n ioProgressView.set_title(\"Test #{lDepDesc.ID}\")\n end\n # Test if it was installed correctly\n if (!test_dependency(lDepDesc))\n # Still missing\n rUnresolvedDeps << lDepDesc\n end\n end\n end\n end\n else\n # Create a progression view\n setupPreferredProgress(lPreferredProgressViews) do |ioProgressView|\n # Be careful, as ioProgressView can be nil if no view was found\n if (ioProgressView != nil)\n ioProgressView.set_range(lMissingDependencies.size)\n end\n lMissingDependencies.each do |iDepDesc|\n if (ioProgressView != nil)\n ioProgressView.set_title(\"Installing #{iDepDesc.ID}\")\n end\n # Try to find an installer and a location for the lAutoInstall value\n lIdxInstaller = 0\n lLocation = nil\n iDepDesc.Installers.each do |iInstallerInfo|\n iInstallerName, _, _ = iInstallerInfo\n access_plugin('Installers', iInstallerName) do |iPlugin|\n iPlugin.PossibleDestinations.each do |iDestinationInfo|\n iLocationFlavour, iLocation = iDestinationInfo\n if (iLocationFlavour == lAutoInstall)\n # We found it\n if (iLocationFlavour == DEST_OTHER)\n lLocation = lAutoInstallLocation\n else\n lLocation = iLocation\n end\n break\n end\n end\n end\n if (lLocation != nil)\n break\n end\n lIdxInstaller += 1\n end\n if (lLocation == nil)\n # We were unable to find a correct default location for lAutoInstall\n rError = RuntimeError.new(\"Unable to find a default location for #{lAutoInstall}.\")\n else\n lInstallEnv = {}\n rError = install_dependency(iDepDesc, lIdxInstaller, lLocation, lInstallEnv)\n # Get what has been modified in the context\n rAppliedContextModifiers[iDepDesc.ID] = lInstallEnv[:ContextModifiers]\n # Test if it was installed correctly\n if (!test_dependency(iDepDesc))\n # Still missing\n rUnresolvedDeps << iDepDesc\n end\n end\n if (rError != nil)\n # An error occurred: cancel\n break\n end\n if (ioProgressView != nil)\n ioProgressView.inc_value\n end\n end\n end\n end\n end\n end\n\n return rError, rAppliedContextModifiers, rIgnoredDeps, rUnresolvedDeps\n end",
"title": ""
},
{
"docid": "015b0b97984b2fd9869e510a575bb020",
"score": "0.5887956",
"text": "def conflicting_dependencies\n [@failed_dep.dependency, @activated.request.dependency]\n end",
"title": ""
},
{
"docid": "015b0b97984b2fd9869e510a575bb020",
"score": "0.5887956",
"text": "def conflicting_dependencies\n [@failed_dep.dependency, @activated.request.dependency]\n end",
"title": ""
},
{
"docid": "015b0b97984b2fd9869e510a575bb020",
"score": "0.5887956",
"text": "def conflicting_dependencies\n [@failed_dep.dependency, @activated.request.dependency]\n end",
"title": ""
},
{
"docid": "82e7d4eb61ba6e6744cad8c508c8c216",
"score": "0.58874077",
"text": "def lookup_direct_dependencies!(source)\n return [] unless source\n\n source.dependencies.map do |dependency|\n result = provides_tree.glob(\"/#{dependency}\")\n if (!result || (result.is_a?(Array) && result.empty?))\n Jsus.logger.warn \"#{source.filename} is missing #{dependency.is_a?(SourceFile) ? dependency.filename : dependency.to_s}\"\n end\n result\n end.flatten.map {|tag| lookup(tag) }\n end",
"title": ""
},
{
"docid": "649945c3f87475115c1f53924611ecd9",
"score": "0.58779246",
"text": "def dependencies_for(source, acc = [])\n ds = dependencies.select { |d| d.last == source }.\n map { |d| d.first }\n return acc if ds.empty?\n acc = acc | ds\n ds.each { |d| acc = acc | dependencies_for(d, acc) }\n acc\n end",
"title": ""
},
{
"docid": "64d32b5cf9f57b374be73937731c1d9a",
"score": "0.58775854",
"text": "def dependencies\n @dependencies ||= {}\n end",
"title": ""
},
{
"docid": "be0da85eaa78a11f157ae9fcce8d12f1",
"score": "0.58713514",
"text": "def each_dependency(&block)\n return dependencies_enumerator if block.nil?\n\n dependencies_enumerator.each(&block)\n end",
"title": ""
},
{
"docid": "485a7fd56135d9935986aaa42596b797",
"score": "0.58673865",
"text": "def resolve_dependencies(prev_deps, curr_deps)\n added = curr_deps - prev_deps\n deleted = prev_deps - curr_deps\n split_dependencies(added, deleted)\n end",
"title": ""
},
{
"docid": "13804649237e20bd7d3b24bd29427dd6",
"score": "0.58620495",
"text": "def required_dependencies\n dependencies - optional_dependencies\n end",
"title": ""
},
{
"docid": "80701364e65e56bb54153727803cdd5c",
"score": "0.5860816",
"text": "def getDependencies service\r\n deps = []\r\n Util.csprojs(service).each do |csproj|\r\n deps += getDeps(csproj) \r\n end\r\n return deps.uniq\r\nend",
"title": ""
},
{
"docid": "201bef3aba37b69c1bc1bc3fef629efa",
"score": "0.5859848",
"text": "def dependencies(include_parent = false)\n include_parent ? [ parent ] : []\n end",
"title": ""
},
{
"docid": "992ed6b8e1729d653a7957dbc30ea91c",
"score": "0.5859143",
"text": "def dependencies_have_failed?\n return @dependencies_have_failed unless @dependencies_have_failed.nil?\n failed = select do |task|\n task.failed?\n end\n debug \"Found failed dependencies: #{failed.map { |t| t.name }.join ', '}\" if failed.any?\n @dependencies_have_failed = failed.any?\n end",
"title": ""
},
{
"docid": "85869a8151cffbce8825db2e571ca56f",
"score": "0.58578354",
"text": "def computeDependences(list)\n dependences = OCMSet.new\n\n OCMSet::SECTIONS.each do |section|\n @require[section].each do |req|\n found = false\n\n list.each do |iface|\n for context in iface.provide do\n if context[section].include?(req) then\n dependences[section] << iface\n found = true\n break\n end\n end\n end\n\n raise \"#{@id.name}: no dependence found for #{req.name}.\" unless found\n end\n end\n\n return dependences.values.flatten.uniq\n end",
"title": ""
},
{
"docid": "e1ba96f72f6bcc682002785916c55d08",
"score": "0.58527833",
"text": "def check_dependencies\n ok = true\n\n @config.each_pair { |type, values|\n next if !values.instance_of?(Array)\n _shortclass, cfg_name, _cfg_plural, _classname = MU::Cloud.getResourceNames(type, false)\n next if !cfg_name\n values.each { |resource|\n next if !resource.kind_of?(Hash) or resource[\"dependencies\"].nil?\n addme = []\n deleteme = []\n\n resource[\"dependencies\"].each { |dependency|\n dependency[\"their_phase\"] ||= dependency[\"phase\"]\n dependency.delete(\"phase\")\n dependency[\"my_phase\"] ||= dependency[\"no_create_wait\"] ? \"groom\" : \"create\"\n dependency.delete(\"no_create_wait\")\n # make sure the thing we depend on really exists\n sibling = haveLitterMate?(dependency['name'], dependency['type'])\n if !sibling\n MU.log \"Missing dependency: #{type}{#{resource['name']}} needs #{cfg_name}{#{dependency['name']}}\", MU::ERR\n ok = false\n next\n end\n\n # Fudge dependency declarations to quash virtual_names that we know\n # are extraneous. Note that wee can't do all virtual names here; we\n # have no way to guess which of a collection of resources is the\n # real correct one.\n if sibling['virtual_name'] == dependency['name']\n real_resources = []\n found_exact = false\n resource[\"dependencies\"].each { |dep_again|\n if dep_again['type'] == dependency['type'] and sibling['name'] == dep_again['name']\n dependency['name'] = sibling['name']\n found_exact = true\n break\n end\n }\n if !found_exact\n all_siblings = haveLitterMate?(dependency['name'], dependency['type'], has_multiple: true)\n if all_siblings.size > 0\n all_siblings.each { |s|\n newguy = dependency.clone\n newguy['name'] = s['name']\n addme << newguy\n }\n deleteme << dependency\n MU.log \"Expanding dependency which maps to virtual resources to all matching real resources\", MU::NOTICE, details: { sibling['virtual_name'] => addme }\n next\n end\n end\n end\n\n if dependency['their_phase'] == \"groom\"\n sibling['dependencies'].each { |sib_dep|\n next if sib_dep['type'] != cfg_name or sib_dep['their_phase'] != \"groom\"\n cousin = haveLitterMate?(sib_dep['name'], sib_dep['type'])\n if cousin and cousin['name'] == resource['name']\n MU.log \"Circular dependency between #{type} #{resource['name']} <=> #{dependency['type']} #{dependency['name']}\", MU::ERR, details: [ resource['name'] => dependency, sibling['name'] => sib_dep ]\n ok = false\n end\n }\n end\n\n # Check for a circular relationship that will lead to a deadlock\n # when creating resource. This only goes one layer deep, and does\n # not consider groom-phase deadlocks.\n if dependency['their_phase'] == \"groom\" or\n dependency['my_phase'] == \"groom\" or (\n !MU::Cloud.resourceClass(sibling['cloud'], type).deps_wait_on_my_creation and\n !MU::Cloud.resourceClass(resource['cloud'], type).waits_on_parent_completion\n )\n next\n end\n\n if sibling['dependencies']\n sibling['dependencies'].each { |sib_dep|\n next if sib_dep['type'] != cfg_name or sib_dep['my_phase'] == \"groom\"\n cousin = haveLitterMate?(sib_dep['name'], sib_dep['type'])\n if cousin and cousin['name'] == resource['name']\n MU.log \"Circular dependency between #{type} #{resource['name']} <=> #{dependency['type']} #{dependency['name']}\", MU::ERR, details: [ resource['name'] => dependency, sibling['name'] => sib_dep ]\n ok = false\n end\n }\n end\n }\n resource[\"dependencies\"].reject! { |dep| deleteme.include?(dep) }\n resource[\"dependencies\"].concat(addme)\n resource[\"dependencies\"].uniq!\n\n }\n }\n\n ok\n end",
"title": ""
},
{
"docid": "4d14b168da17a1a8d26b60477a79b0c2",
"score": "0.58491576",
"text": "def dependency_list\n @target.dependencies.map(&:display_name)\n end",
"title": ""
},
{
"docid": "69048dad3e9d3a38145611aca56fe147",
"score": "0.5845688",
"text": "def dependencies\n @dependencies\n end",
"title": ""
},
{
"docid": "6e36b1d2386beb0e25136d497f8229e9",
"score": "0.58386475",
"text": "def dependencies(recurse: true)\n return @dependencies if @dependencies\n if depends.nil? || depends.empty?\n @dependencies = nil\n else\n @dependencies = depends.map do |name, dependency|\n loader = StackFileLoader.for(dependency['stack'], self)\n deps = { 'name' => name, 'stack' => loader.source, 'variables' => dependency.fetch('variables', Hash.new) }\n if recurse\n child_deps = loader.dependencies\n deps['depends'] = child_deps unless child_deps.nil?\n end\n deps\n end\n end\n end",
"title": ""
},
{
"docid": "53c081d57072337fbc700328b21b9c4f",
"score": "0.58206487",
"text": "def depends_on()\n if @value.nil?\n return []\n end\n unless @depends_on\n @depends_on = @value.variables.collect do |var|\n\ttmp = @parent.variable_by_name(var)\n\ttmp or raise \"Can't locate variable dependency '#{var}'!\"\n end\n end\n @depends_on\n end",
"title": ""
},
{
"docid": "fed245d7689483d5f52f8aff94356702",
"score": "0.5806789",
"text": "def check_dependents \r\n self.class.send(:dependent_tables).each{|sym_dependent_table|\r\n raise LookupItemInUseException.new if self.send(sym_dependent_table).size > 0\r\n }\r\n end",
"title": ""
},
{
"docid": "431e4d138e17abebe150ed85940a0f73",
"score": "0.58012956",
"text": "def dependencies(&block)\n deps = ::OSGi::Dependencies.new(project)\n deps.read\n deps.dependencies + deps.projects\n end",
"title": ""
},
{
"docid": "69f643462c66ad13d5930acfad6e7974",
"score": "0.5798042",
"text": "def load_dependencies\n dependencies.each { |dependency| dependency }\n end",
"title": ""
},
{
"docid": "71a7f4e506bd3ba2cefb713bc78356f2",
"score": "0.5796273",
"text": "def validate_duplicate_dependencies # :nodoc:\n # NOTE: see REFACTOR note in Gem::Dependency about types - this might be brittle\n seen = Gem::Dependency::TYPES.inject({}) {|types, type| types.merge({ type => {}}) }\n\n error_messages = []\n @specification.dependencies.each do |dep|\n if prev = seen[dep.type][dep.name]\n error_messages << <<-MESSAGE\nduplicate dependency on #{dep}, (#{prev.requirement}) use:\n add_#{dep.type}_dependency '#{dep.name}', '#{dep.requirement}', '#{prev.requirement}'\n MESSAGE\n end\n\n seen[dep.type][dep.name] = dep\n end\n if error_messages.any?\n error error_messages.join\n end\n end",
"title": ""
},
{
"docid": "185d8ac89db2a8a5a9eeca8d201ad315",
"score": "0.57959795",
"text": "def get_dependencies\n @dependencies\n end",
"title": ""
},
{
"docid": "9675fee60076e2ef67704e509697bbb3",
"score": "0.57882345",
"text": "def dependencies\n raise \"#{self.class} needs to overwrite dependencies\"\n end",
"title": ""
},
{
"docid": "569a944c3270fe68871717875c2fdab1",
"score": "0.5765913",
"text": "def dependencies(recurse: true)\n return @dependencies if @dependencies\n depends = yaml['depends']\n if depends.nil? || depends.empty?\n @dependencies = nil\n else\n @dependencies = depends.map do |name, dependency|\n reader = StackFileLoader.for(dependency['stack'], self)\n deps = { 'name' => name, 'stack' => reader.source, 'variables' => dependency.fetch('variables', Hash.new) }\n if recurse\n child_deps = reader.dependencies\n deps['depends'] = child_deps unless child_deps.nil?\n end\n deps\n end\n end\n end",
"title": ""
},
{
"docid": "25de35c26e34d115cc5fe0183ae5a93b",
"score": "0.575844",
"text": "def deps(sequence)\n return [] unless checker.valid? # Exit early if it's bad data\n all = [] # Start collecting the list.\n CeleryScript::TreeClimber.travel(tree, ->(n) {\n # Iterate over each node, looking for \"args of interest\".\n # Tools, sub sequences, etc.\n ARGS_OF_INTEREST.map do |arg, klass|\n id = n&.args&.fetch(arg, nil)&.value\n all.push(klass.find(id)) if id\n end\n })\n\n # Filter out the target sequence to prevent runaway recursion.\n # It would be impossible to delete recursive sequences otherwise.\n all.select! { |d| !(d.is_a?(Sequence) && (d.id == sequence.id)) }\n\n # Finally, output the data in a format that can directly be used by\n # SequenceDependency#create!().\n return all.uniq.map do |d|\n { sequence: sequence, dependency_type: d.class, dependency_id: d.id }\n end\n end",
"title": ""
},
{
"docid": "6ec17f86214f3859a99e2778be4cb980",
"score": "0.5740089",
"text": "def dependencies\n return @dependencies unless @dependencies.nil?\n @dependencies = [ ]\n lockfile.each_line do |line|\n if line =~ /^\\s{4}([-\\w_.0-9]+)\\s*\\((.*)\\)/\n @dependencies << [$1, $2]\n end\n end\n @dependencies\n end",
"title": ""
},
{
"docid": "9a92bfa4c9204d93e734da76ed0b8a53",
"score": "0.57387185",
"text": "def validate_dependencies # :nodoc:\n warning_messages = []\n @specification.dependencies.each do |dep|\n prerelease_dep = dep.requirements_list.any? do |req|\n Gem::Requirement.new(req).prerelease?\n end\n\n warning_messages << \"prerelease dependency on #{dep} is not recommended\" if\n prerelease_dep && !@specification.version.prerelease?\n\n open_ended = dep.requirement.requirements.all? do |op, version|\n not version.prerelease? and (op == '>' or op == '>=')\n end\n\n if open_ended\n op, dep_version = dep.requirement.requirements.first\n\n segments = dep_version.segments\n\n base = segments.first 2\n\n recommendation = if (op == '>' || op == '>=') && segments == [0]\n \" use a bounded requirement, such as '~> x.y'\"\n else\n bugfix = if op == '>'\n \", '> #{dep_version}'\"\n elsif op == '>=' and base != segments\n \", '>= #{dep_version}'\"\n end\n\n \" if #{dep.name} is semantically versioned, use:\\n\" \\\n \" add_#{dep.type}_dependency '#{dep.name}', '~> #{base.join '.'}'#{bugfix}\"\n end\n\n warning_messages << [\"open-ended dependency on #{dep} is not recommended\", recommendation].join(\"\\n\") + \"\\n\"\n end\n end\n if warning_messages.any?\n warning_messages.each {|warning_message| warning warning_message }\n end\n end",
"title": ""
},
{
"docid": "35fb9001137084d1d12c3a48f4bb38ba",
"score": "0.573755",
"text": "def dependency_order\n result = []\n disabled = {}\n predecessors = build_predecessors\n while disabled.size < @specs.size\n\tcandidate = @specs.find { |spec|\n\t ! disabled[spec.full_name] &&\n\t active_count(predecessors[spec.full_name], disabled) == 0\n\t}\n\tif candidate\n\t disabled[candidate.full_name] = true\n\t result << candidate\n\telsif candidate = @specs.find { |spec| ! disabled[spec.full_name] }\n\t # This case handles circular dependencies. Just choose a\n\t # candidate and move on.\n\t disabled[candidate.full_name] = true\n\t result << candidate\n\telse\n\t # We should never get here, but just in case we will terminate \n\t # the loop.\n\t break\n\tend\n end\n result\n end",
"title": ""
},
{
"docid": "277f15187b5d5a45f01e8a22209cf6db",
"score": "0.57225454",
"text": "def load_dependencies\n result = zh_client.dependencies(repo_name)\n\n result[\"dependencies\"].each do |hash|\n blocking = add_or_find(hash[\"blocking\"])\n blocked = add_or_find(hash[\"blocked\"])\n\n add_edge(blocked, blocking)\n end\n end",
"title": ""
},
{
"docid": "07a17474a0409f2cd1777099cbb555cb",
"score": "0.5714135",
"text": "def dependency_paths\n @dependency_paths ||= []\n end",
"title": ""
},
{
"docid": "92389ed5208f80bc2d475772238ab4c1",
"score": "0.5711069",
"text": "def dependencies\n to_a.reject { |a| a.filename.eql?(self.filename) }\n end",
"title": ""
},
{
"docid": "607556695238506f1154dfb3ad999fcd",
"score": "0.5702298",
"text": "def collect_dependencies(dependency, known_dependencies: {})\n dep_spec = dependency.matching_specs\n return known_dependencies if dep_spec.empty?\n\n dep_spec = dep_spec.first\n known_dependencies[dep_spec.name] = dep_spec.version\n dep_spec.dependencies.each do |dep|\n unless known_dependencies.has_key?(dep.name)\n collect_dependencies(dep, known_dependencies: known_dependencies)\n end\n end\n known_dependencies\n end",
"title": ""
},
{
"docid": "c9b02eb33cde230cb48050f6382e8743",
"score": "0.5701365",
"text": "def dependencies\n members.each_with_object([]) do |attr_name, depends|\n value = send(attr_name)\n value = pipeline.objects.fetch(value) if value.is_a?(Symbol)\n depends << value.dependencies << value if value.is_a?(PipelineObject)\n end.flatten\n end",
"title": ""
},
{
"docid": "79782342c980b86eb0b51e2039c619a7",
"score": "0.5694024",
"text": "def lookup_dependencies(source_or_source_key)\n source = lookup(source_or_source_key)\n result = []\n looked_up = []\n if source\n dependencies = lookup_direct_dependencies(source)\n while !((dependencies - looked_up).empty?)\n dependencies.each { |d| result << d; looked_up << d }\n dependencies = dependencies.map {|d| lookup_direct_dependencies(d).to_a }.flatten.uniq\n end\n end\n result\n end",
"title": ""
},
{
"docid": "916bc501ecd0113e00f96ea95cda2724",
"score": "0.5678292",
"text": "def getWcfDependencies service\r\n deps = []\r\n Util.csprojs(service).each do |csproj|\r\n deps += getWcfDeps(csproj) \r\n end\r\n return deps.uniq\r\nend",
"title": ""
},
{
"docid": "515f0d98bc06151fc74e86af6e4dffb9",
"score": "0.5666479",
"text": "def dependencies_satisfied?\n missing_dependencies.empty?\n end",
"title": ""
},
{
"docid": "daef0bd277f508253e39e5a2cd16fe43",
"score": "0.56661993",
"text": "def dependencies(name)\n dependencies = []\n submodule = submodule(name)\n if submodule.has_key?(:dependencies)\n submodule[:dependencies].each do |dependency|\n dependencies << dependency\n dependencies << dependencies(dependency)\n end\n end\n\n dependencies.flatten.uniq.sort\n end",
"title": ""
},
{
"docid": "63e9ab48a952a7f75e237edbdfd377ea",
"score": "0.56657654",
"text": "def dependencies(ctx)\n deps = []\n visitor = ConsCellVisitor.df_visitor(self)\n skip_children = false\n loop do\n side, cell = visitor.resume(skip_children)\n if cell.kind_of?(Core::LogVarRef)\n deps << ctx.lookup(cell.name).i_name\n skip_children = true\n else\n skip_children = false\n end\n break if side == :stop\n end\n\n Set.new(deps)\n end",
"title": ""
},
{
"docid": "d187077be82fc9c08d9de8cb9f825370",
"score": "0.5659579",
"text": "def recursive_dependencies(&block)\n Dependency.expand(self, &block)\n end",
"title": ""
},
{
"docid": "d2809043f6b902b2a83895a65339f634",
"score": "0.5657788",
"text": "def get_dependencies_from_metadata(metadata)\n checker = DependencyChecker::MetadataChecker.new(metadata, @forge, @updated_module, @updated_module_version)\n checker.check_dependencies\n end",
"title": ""
},
{
"docid": "e55439b7ba9dde3aad0b9b387eaf787a",
"score": "0.56570166",
"text": "def depend_upon(match_name) #, constraint)\n list = []\n each do |name, libs|\n case libs\n when Library\n list << libs if libs.requirements.any?{ |r| match_name == r['name'] } \n else\n libs.each do |lib|\n list << lib if lib.requirements.any?{ |r| match_name == r['name'] } \n end\n end\n end\n list\n end",
"title": ""
},
{
"docid": "1aa7dff8b2d9690510b6cf09977fbde3",
"score": "0.5652239",
"text": "def check_dependencies!(dep)\n depend_on(dep)\n depend_on_asset(dep)\n rescue Sprockets::FileNotFound\n end",
"title": ""
},
{
"docid": "61668e39d2517da78ca65563966a60ea",
"score": "0.56353146",
"text": "def locked_specs_as_deps\n deps = @dependencies & @locked_deps\n\n @dependencies.each do |dep|\n next if deps.include?(dep)\n deps << dep if @locked_specs.any? { |s| s.satisfies?(dep) }\n end\n\n meta_deps = @locked_specs.for(deps).map do |s|\n dep = Gem::Dependency.new(s.name, s.version)\n @locked_deps.each do |d|\n dep.source = d.source if d.name == dep.name\n end\n dep\n end\n end",
"title": ""
},
{
"docid": "2041eb955ab1b30042933e56048d8a3d",
"score": "0.56347173",
"text": "def depends_upon(match_name) #, constraint)\n list = []\n $LEDGER.each do |name, libs|\n case libs\n when Library\n list << libs if libs.requirements.any?{ |r| match_name == r['name'] } \n else\n libs.each do |lib|\n list << lib if lib.requirements.any?{ |r| match_name == r['name'] } \n end\n end\n end\n list\n end",
"title": ""
},
{
"docid": "8c91d4750714e26da4cce0910f326f55",
"score": "0.56324625",
"text": "def skipDeps(deps) \n deps = deps.select { |ding| !ding.include?(\"/commons-cli\") }\n deps = deps.select { |ding| !ding.include?(\"/commons-logging\") }\n deps = deps.select { |ding| !ding.include?(\"/commons-lang-2.1\") }\n deps = deps.select { |ding| !ding.include?(\"/commons-pool\") }\n return deps\nend",
"title": ""
},
{
"docid": "f15a47454e1d7b99365357d2a804053e",
"score": "0.5617166",
"text": "def create_dependencies(con)\n @resolving_dependencies = true\n dependencies.each do |_, d|\n fail CircularDependencyError.new(name, d.name) if d.resolving_dependencies\n d.create_dependencies(con)\n d.create_or_update!(con)\n end\n @resolving_dependencies = false\n end",
"title": ""
},
{
"docid": "175fd3a480daa2c50b34bc5389fe06cd",
"score": "0.5614585",
"text": "def dependencies_for(model)\n dependencies = Set.new\n # Each association is a dependency\n model.reflect_on_all_associations.each do |ass|\n relation_name = ass.name.to_s\n class_name = ass.options[:class_name] || relation_name.singularize.camelize\n\n dependencies.add? class_name\n end\n dependencies\n end",
"title": ""
},
{
"docid": "9205791d41a562ae35af330ef82f0088",
"score": "0.56048274",
"text": "def group_vulnerable_dependencies(dependencies)\n results = []\n grouped = dependencies.group_by { |d| d[:ID] }\n grouped.each do |_key, values|\n vuln = {}\n values.each do |v|\n vuln = v if v[:Database] == GITHUB_DATABASE_STRING\n end\n results.append(vuln.empty? ? values[0] : vuln)\n end\n results\n end",
"title": ""
},
{
"docid": "e79470f6a69ef9b4c82f6ddf34e0a400",
"score": "0.56033564",
"text": "def dependencies\n manager.dependencies\n end",
"title": ""
},
{
"docid": "b05694b56c550e43055ce26bd32e6295",
"score": "0.55992144",
"text": "def dependencies\n if @options[:dependencies]\n deps = [] << @options[:dependencies]\n deps.flatten.collect { |item|\n item = File.join(item,'**/*') if File.directory?(item)\n Dir.glob item\n }.flatten.uniq.collect { |item|\n File.directory?(item) ? nil : item\n }.compact\n else\n false\n end\n end",
"title": ""
},
{
"docid": "7d891d088a5aee6b4d684d48c02ed7f2",
"score": "0.559329",
"text": "def resolve_dependencies!\n return unless Config.resolve? && targets.any?\n\n puts 'resolving dependencies...'\n each_threaded(targets) do |target|\n Depends.resolve(target, self)\n end\n end",
"title": ""
},
{
"docid": "43078f4f730b5f5874c824e14f05470e",
"score": "0.5581057",
"text": "def cached_dependencies\n @dependencies ||= enumerate_dependencies.compact\n end",
"title": ""
},
{
"docid": "66bbff54a906ea4dbdcb190f7b3b1a59",
"score": "0.5569916",
"text": "def vendor(dependencies)\n return nil if dependencies.nil? || dependencies.empty?\n @dep_list = Resolver.resolve(dependencies, @cache, @cwd, @backend)\n end",
"title": ""
},
{
"docid": "eff07e2ff68f97498ec1ac4b597854a0",
"score": "0.556633",
"text": "def dependency_links\n if @dependencies.nil?\n # Build the mapping: feature identifier => feature\n features_by_id = id2features\n\n # Resolve the dependency tags\n resolve_dependencies(features_by_id)\n end\n\n return @dependencies\n end",
"title": ""
},
{
"docid": "75ddbcf8d14792e85fe987fdcb0c89e9",
"score": "0.5556535",
"text": "def dependencies(source, done=[])\n d_path = source.ext(\"d\") # get the dependency file\n Rake::Task[d_path].invoke # ensure the dependency file exists\n d_file = IO.read(d_path) # read the dependencies from dependency file\n d_file = d_file.split(': ')[1].gsub(\"\\n\",'').gsub('\\\\ ','').gsub(/\\s+/,' ').split(' ') # get a list of dependencies\n d_list = [] # list of dependencies\n # only save dependencies which are in our source directories\n d_file.each do |d|\n SRC_DIRS.each do |dir|\n if File.dirname(d)==dir then\n d_list << d\n end\n end\n end\n # get the dependencies of these dependencies, if we don't know them already\n done << source.ext(\"o\")\n done.uniq!\n d_list.each do |d|\n d = d.ext(\"o\")\n next if done.include? d\n done += dependencies(d, done)\n end\n done.uniq!\n return done\nend",
"title": ""
},
{
"docid": "a41e6ce3df83ac4b8d29f39ccd8f4da1",
"score": "0.55449295",
"text": "def enabled_dependencies\n @dependencies.reject(&:ignore?)\n end",
"title": ""
},
{
"docid": "bcdbeabf1317cf50515e7327ad6a78ec",
"score": "0.55344504",
"text": "def dependent_modules\n out = [ ]\n @dependencies.each { |dependency| out << @module_set[dependency] }\n out\n end",
"title": ""
},
{
"docid": "f291c5b5c234c1de98101521696f68df",
"score": "0.5505026",
"text": "def missing_deps_for(gem)\n # Comparison by name here assuming if it is in existing spec,\n # spec author will have ensured versions are correct for their purposes\n gem.deps.select { |dep| requirements_for_gem(dep.name).empty? }\n end",
"title": ""
},
{
"docid": "4b6aa91f9d14ddb3365e79db57583110",
"score": "0.5502105",
"text": "def dependent_gems(check_dev=true)\n out = []\n Gem::Specification.each do |spec|\n deps = check_dev ? spec.dependencies : spec.runtime_dependencies\n deps.each do |dep|\n if self.satisfies_requirement?(dep)\n sats = []\n find_all_satisfiers(dep) do |sat|\n sats << sat\n end\n out << [spec, dep, sats]\n end\n end\n end\n out\n end",
"title": ""
},
{
"docid": "f26b3d5e382559b0cc7357d22d8d1a87",
"score": "0.5501401",
"text": "def walk_down_dependencies(pkg_name, known_deps=Array.new)\n\talldeps = Array.new\n\t@total_deps[pkg_name].each { |m|\n\t\tunless alldeps.include?(m) || m.nil? || known_deps.include?(m) \n\t\t\talldeps = alldeps + walk_down_dependencies(m, alldeps)\n\t\tend\n\t\talldeps.push m\n\t}\n\talldeps.uniq!\n\talldeps.push pkg_name\n\t# puts alldeps.join(\", \") \n\treturn alldeps.compact \nend",
"title": ""
},
{
"docid": "921352138fee1061720f1156a7039a10",
"score": "0.5500929",
"text": "def resolve_dependencies\r\n @nodes.each do |node|\r\n puts \"processing #{node}\"\r\n\r\n node.outgoing_dependencies do |dependency|\r\n providers = nodes_satisfying(dependency.target)\r\n node.add_dependency(dependency, providers)\r\n end\r\n \r\n node.dependencies.values.each { |vals| vals.sort! }\r\n end\r\n end",
"title": ""
},
{
"docid": "79cb97e3b85353c98c8b4f02d73f0f11",
"score": "0.54941636",
"text": "def requires *deps\n return unless @dependency_lib\n\n @parents.concat(deps).uniq!\n deps.each do |dep|\n @dependency_lib.dependencies[dep].each{|d| d.add_child(@name) }\n end\n end",
"title": ""
},
{
"docid": "bb4b28273069edb1164bebf9730d5685",
"score": "0.5492694",
"text": "def dependencies\n self.config.depends || []\n end",
"title": ""
},
{
"docid": "6e94a71adb456a6476073938747c00df",
"score": "0.54902345",
"text": "def get_dep_names(data)\n return unless data.key?(\"dependencies\")\n\n data['dependencies'].each do |name, dep_info|\n @deps[name] = {}\n get_dep_names(dep_info) if dep_info['dependencies']\n end\n end",
"title": ""
},
{
"docid": "ef7ba3eb6cbe17e166b60dc440ffb633",
"score": "0.5485084",
"text": "def dependencies_for(specification)\n specification.dependencies\n end",
"title": ""
},
{
"docid": "08605f475c8982e5d9f28c13541320a7",
"score": "0.5484653",
"text": "def errors\n errors = []\n all_providers = @cursors.collect {|cursor| cursor.providers }.flatten.compact.uniq\n @cursors.each do |cursor|\n errors << \"#{cursor} is not valid!\" unless cursor.valid?\n cursor.dependencies.each do |dep|\n errors << \"#{cursor}'s dependency on '#{dep}' is not met. (#{dep} does not exist?)\" unless all_providers.include?(dep)\n end\n end\n errors\n end",
"title": ""
}
] |
94aca09564789f1a0194663c6c09aea0 | Some properties shouldn't be included in an allprop request but it's nice to do some sanity checking so keeping a list is good | [
{
"docid": "11c2425cbaf4be0d0f48a10e4b7a4949",
"score": "0.0",
"text": "def properties\n gather_properties(false).inject([]) do |ret, (namespace, proplist)|\n proplist.each do |prop|\n ret << { name: prop, ns_href: namespace, children: [], attributes: [] }\n end\n ret\n end\n end",
"title": ""
}
] | [
{
"docid": "3341ffc02e345084985698572147f185",
"score": "0.6794829",
"text": "def get_all\n props=available_properties\n get *props\n end",
"title": ""
},
{
"docid": "223462d937720213a6e765807e99d15c",
"score": "0.6675078",
"text": "def list_invalid_properties\n invalid_properties = super\n if @action_url.nil?\n invalid_properties.push('invalid value for \"action_url\", action_url cannot be nil.')\n end\n\n if @call_connect_url.nil?\n invalid_properties.push('invalid value for \"call_connect_url\", call_connect_url cannot be nil.')\n end\n\n if @calling_number.nil?\n invalid_properties.push('invalid value for \"calling_number\", calling_number cannot be nil.')\n end\n\n if @destination.nil?\n invalid_properties.push('invalid value for \"destination\", destination cannot be nil.')\n end\n\n invalid_properties\n end",
"title": ""
},
{
"docid": "9bc933f1c11c7d5577577b8c18730361",
"score": "0.66391",
"text": "def rest_post_only_properties(rest_post_only_properties = NOT_PASSED)\n if rest_post_only_properties != NOT_PASSED\n @rest_post_only_properties = Array(rest_post_only_properties).map(&:to_sym)\n end\n @rest_post_only_properties || []\n end",
"title": ""
},
{
"docid": "6a82f095a42ecd8e36c696f1dd2644f8",
"score": "0.66371423",
"text": "def list_invalid_properties\n invalid_properties = Array.new\n if @_links.nil?\n invalid_properties.push('invalid value for \"_links\", _links cannot be nil.')\n end\n\n if @_id.nil?\n invalid_properties.push('invalid value for \"_id\", _id cannot be nil.')\n end\n\n if @url.nil?\n invalid_properties.push('invalid value for \"url\", url cannot be nil.')\n end\n\n if @on.nil?\n invalid_properties.push('invalid value for \"on\", on cannot be nil.')\n end\n\n if @tags.nil?\n invalid_properties.push('invalid value for \"tags\", tags cannot be nil.')\n end\n\n invalid_properties\n end",
"title": ""
},
{
"docid": "3befe9474ee66502b802203c67cbc9dd",
"score": "0.66206956",
"text": "def list_invalid_properties\n invalid_properties = Array.new\n if @id.nil?\n invalid_properties.push('invalid value for \"id\", id cannot be nil.')\n end\n\n if @is_company.nil?\n invalid_properties.push('invalid value for \"is_company\", is_company cannot be nil.')\n end\n\n if @donate_all.nil?\n invalid_properties.push('invalid value for \"donate_all\", donate_all cannot be nil.')\n end\n\n invalid_properties\n end",
"title": ""
},
{
"docid": "951ee70e91b22e6a448e0b77f497d095",
"score": "0.6572214",
"text": "def list_invalid_properties\n invalid_properties = Array.new\n if @id.nil?\n invalid_properties.push('invalid value for \"id\", id cannot be nil.')\n end\n\n if @domain.nil?\n invalid_properties.push('invalid value for \"domain\", domain cannot be nil.')\n end\n\n if @is_resolving.nil?\n invalid_properties.push('invalid value for \"is_resolving\", is_resolving cannot be nil.')\n end\n\n if @is_used_for_blog_post.nil?\n invalid_properties.push('invalid value for \"is_used_for_blog_post\", is_used_for_blog_post cannot be nil.')\n end\n\n if @is_used_for_site_page.nil?\n invalid_properties.push('invalid value for \"is_used_for_site_page\", is_used_for_site_page cannot be nil.')\n end\n\n if @is_used_for_landing_page.nil?\n invalid_properties.push('invalid value for \"is_used_for_landing_page\", is_used_for_landing_page cannot be nil.')\n end\n\n if @is_used_for_email.nil?\n invalid_properties.push('invalid value for \"is_used_for_email\", is_used_for_email cannot be nil.')\n end\n\n if @is_used_for_knowledge.nil?\n invalid_properties.push('invalid value for \"is_used_for_knowledge\", is_used_for_knowledge cannot be nil.')\n end\n\n invalid_properties\n end",
"title": ""
},
{
"docid": "0da9c105b8eaa11736aebc6cbd23b9a2",
"score": "0.6571057",
"text": "def list_invalid_properties\n invalid_properties = []\n invalid_properties\n end",
"title": ""
},
{
"docid": "35a62d534698aa79b6ceb774058be1e2",
"score": "0.65664905",
"text": "def list_invalid_properties\n invalid_properties = Array.new\n if @name.nil?\n invalid_properties.push('invalid value for \"name\", name cannot be nil.')\n end\n\n if @name.to_s.length < 1\n invalid_properties.push('invalid value for \"name\", the character length must be great than or equal to 1.')\n end\n\n if @url.nil?\n invalid_properties.push('invalid value for \"url\", url cannot be nil.')\n end\n\n if @url.to_s.length < 1\n invalid_properties.push('invalid value for \"url\", the character length must be great than or equal to 1.')\n end\n\n if !@ca_cert.nil? && @ca_cert.to_s.length < 1\n invalid_properties.push('invalid value for \"ca_cert\", the character length must be great than or equal to 1.')\n end\n\n if !@client_cert.nil? && @client_cert.to_s.length < 1\n invalid_properties.push('invalid value for \"client_cert\", the character length must be great than or equal to 1.')\n end\n\n if !@client_key.nil? && @client_key.to_s.length < 1\n invalid_properties.push('invalid value for \"client_key\", the character length must be great than or equal to 1.')\n end\n\n if !@proxy_url.nil? && @proxy_url.to_s.length < 1\n invalid_properties.push('invalid value for \"proxy_url\", the character length must be great than or equal to 1.')\n end\n\n if !@download_concurrency.nil? && @download_concurrency < 1\n invalid_properties.push('invalid value for \"download_concurrency\", must be greater than or equal to 1.')\n end\n\n invalid_properties\n end",
"title": ""
},
{
"docid": "b3e45517e44935d4bb334aa13be08627",
"score": "0.65275633",
"text": "def list_invalid_properties\n invalid_properties = Array.new\n if @name.nil?\n invalid_properties.push('invalid value for \"name\", name cannot be nil.')\n end\n\n if @slug.nil?\n invalid_properties.push('invalid value for \"slug\", slug cannot be nil.')\n end\n\n if @sku.nil?\n invalid_properties.push('invalid value for \"sku\", sku cannot be nil.')\n end\n\n if @status.nil?\n invalid_properties.push('invalid value for \"status\", status cannot be nil.')\n end\n\n if @product.nil?\n invalid_properties.push('invalid value for \"product\", product cannot be nil.')\n end\n\n if @option_set.nil?\n invalid_properties.push('invalid value for \"option_set\", option_set cannot be nil.')\n end\n\n invalid_properties\n end",
"title": ""
},
{
"docid": "e2c6e09c8521e46c0e070d10c6d7f687",
"score": "0.65026146",
"text": "def list_invalid_properties\n invalid_properties = Array.new\n \n \n return invalid_properties\n end",
"title": ""
},
{
"docid": "e2c6e09c8521e46c0e070d10c6d7f687",
"score": "0.65026146",
"text": "def list_invalid_properties\n invalid_properties = Array.new\n \n \n return invalid_properties\n end",
"title": ""
},
{
"docid": "e2c6e09c8521e46c0e070d10c6d7f687",
"score": "0.65026146",
"text": "def list_invalid_properties\n invalid_properties = Array.new\n \n \n return invalid_properties\n end",
"title": ""
},
{
"docid": "e2c6e09c8521e46c0e070d10c6d7f687",
"score": "0.65026146",
"text": "def list_invalid_properties\n invalid_properties = Array.new\n \n \n return invalid_properties\n end",
"title": ""
},
{
"docid": "e2c6e09c8521e46c0e070d10c6d7f687",
"score": "0.65026146",
"text": "def list_invalid_properties\n invalid_properties = Array.new\n \n \n return invalid_properties\n end",
"title": ""
},
{
"docid": "e2c6e09c8521e46c0e070d10c6d7f687",
"score": "0.65026146",
"text": "def list_invalid_properties\n invalid_properties = Array.new\n \n \n return invalid_properties\n end",
"title": ""
},
{
"docid": "e2c6e09c8521e46c0e070d10c6d7f687",
"score": "0.65026146",
"text": "def list_invalid_properties\n invalid_properties = Array.new\n \n \n return invalid_properties\n end",
"title": ""
},
{
"docid": "e2c6e09c8521e46c0e070d10c6d7f687",
"score": "0.65026146",
"text": "def list_invalid_properties\n invalid_properties = Array.new\n \n \n return invalid_properties\n end",
"title": ""
},
{
"docid": "e2c6e09c8521e46c0e070d10c6d7f687",
"score": "0.65026146",
"text": "def list_invalid_properties\n invalid_properties = Array.new\n \n \n return invalid_properties\n end",
"title": ""
},
{
"docid": "e2c6e09c8521e46c0e070d10c6d7f687",
"score": "0.65026146",
"text": "def list_invalid_properties\n invalid_properties = Array.new\n \n \n return invalid_properties\n end",
"title": ""
},
{
"docid": "e2c6e09c8521e46c0e070d10c6d7f687",
"score": "0.65026146",
"text": "def list_invalid_properties\n invalid_properties = Array.new\n \n \n return invalid_properties\n end",
"title": ""
},
{
"docid": "e2c6e09c8521e46c0e070d10c6d7f687",
"score": "0.65026146",
"text": "def list_invalid_properties\n invalid_properties = Array.new\n \n \n return invalid_properties\n end",
"title": ""
},
{
"docid": "e2c6e09c8521e46c0e070d10c6d7f687",
"score": "0.65026146",
"text": "def list_invalid_properties\n invalid_properties = Array.new\n \n \n return invalid_properties\n end",
"title": ""
},
{
"docid": "e2c6e09c8521e46c0e070d10c6d7f687",
"score": "0.65026146",
"text": "def list_invalid_properties\n invalid_properties = Array.new\n \n \n return invalid_properties\n end",
"title": ""
},
{
"docid": "e2c6e09c8521e46c0e070d10c6d7f687",
"score": "0.65026146",
"text": "def list_invalid_properties\n invalid_properties = Array.new\n \n \n return invalid_properties\n end",
"title": ""
},
{
"docid": "e2c6e09c8521e46c0e070d10c6d7f687",
"score": "0.65026146",
"text": "def list_invalid_properties\n invalid_properties = Array.new\n \n \n return invalid_properties\n end",
"title": ""
},
{
"docid": "e2c6e09c8521e46c0e070d10c6d7f687",
"score": "0.65026146",
"text": "def list_invalid_properties\n invalid_properties = Array.new\n \n \n return invalid_properties\n end",
"title": ""
},
{
"docid": "e2c6e09c8521e46c0e070d10c6d7f687",
"score": "0.65026146",
"text": "def list_invalid_properties\n invalid_properties = Array.new\n \n \n return invalid_properties\n end",
"title": ""
},
{
"docid": "e2c6e09c8521e46c0e070d10c6d7f687",
"score": "0.65026146",
"text": "def list_invalid_properties\n invalid_properties = Array.new\n \n \n return invalid_properties\n end",
"title": ""
},
{
"docid": "e2c6e09c8521e46c0e070d10c6d7f687",
"score": "0.65026146",
"text": "def list_invalid_properties\n invalid_properties = Array.new\n \n \n return invalid_properties\n end",
"title": ""
},
{
"docid": "e2c6e09c8521e46c0e070d10c6d7f687",
"score": "0.65026146",
"text": "def list_invalid_properties\n invalid_properties = Array.new\n \n \n return invalid_properties\n end",
"title": ""
},
{
"docid": "e2c6e09c8521e46c0e070d10c6d7f687",
"score": "0.65026146",
"text": "def list_invalid_properties\n invalid_properties = Array.new\n \n \n return invalid_properties\n end",
"title": ""
},
{
"docid": "e2c6e09c8521e46c0e070d10c6d7f687",
"score": "0.65026146",
"text": "def list_invalid_properties\n invalid_properties = Array.new\n \n \n return invalid_properties\n end",
"title": ""
},
{
"docid": "e2c6e09c8521e46c0e070d10c6d7f687",
"score": "0.65026146",
"text": "def list_invalid_properties\n invalid_properties = Array.new\n \n \n return invalid_properties\n end",
"title": ""
},
{
"docid": "e2c6e09c8521e46c0e070d10c6d7f687",
"score": "0.65026146",
"text": "def list_invalid_properties\n invalid_properties = Array.new\n \n \n return invalid_properties\n end",
"title": ""
},
{
"docid": "e2c6e09c8521e46c0e070d10c6d7f687",
"score": "0.65026146",
"text": "def list_invalid_properties\n invalid_properties = Array.new\n \n \n return invalid_properties\n end",
"title": ""
},
{
"docid": "e2c6e09c8521e46c0e070d10c6d7f687",
"score": "0.65026146",
"text": "def list_invalid_properties\n invalid_properties = Array.new\n \n \n return invalid_properties\n end",
"title": ""
},
{
"docid": "e2c6e09c8521e46c0e070d10c6d7f687",
"score": "0.65026146",
"text": "def list_invalid_properties\n invalid_properties = Array.new\n \n \n return invalid_properties\n end",
"title": ""
},
{
"docid": "e2c6e09c8521e46c0e070d10c6d7f687",
"score": "0.65026146",
"text": "def list_invalid_properties\n invalid_properties = Array.new\n \n \n return invalid_properties\n end",
"title": ""
},
{
"docid": "e2c6e09c8521e46c0e070d10c6d7f687",
"score": "0.65026146",
"text": "def list_invalid_properties\n invalid_properties = Array.new\n \n \n return invalid_properties\n end",
"title": ""
},
{
"docid": "6eef5152190cfe0aa8f95e9b83774a4e",
"score": "0.6468365",
"text": "def list_invalid_properties\n invalid_properties = Array.new\n if @id.nil?\n invalid_properties.push('invalid value for \"id\", id cannot be nil.')\n end\n\n if @order.nil?\n invalid_properties.push('invalid value for \"order\", order cannot be nil.')\n end\n\n if @sort_order.nil?\n invalid_properties.push('invalid value for \"sort_order\", sort_order cannot be nil.')\n end\n\n if @metadata.nil?\n invalid_properties.push('invalid value for \"metadata\", metadata cannot be nil.')\n end\n\n if @state.nil?\n invalid_properties.push('invalid value for \"state\", state cannot be nil.')\n end\n\n invalid_properties\n end",
"title": ""
},
{
"docid": "ae40e5ae74371c2fe564a103611191a6",
"score": "0.6457969",
"text": "def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end",
"title": ""
},
{
"docid": "ae40e5ae74371c2fe564a103611191a6",
"score": "0.64578635",
"text": "def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end",
"title": ""
},
{
"docid": "ae40e5ae74371c2fe564a103611191a6",
"score": "0.64578635",
"text": "def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end",
"title": ""
},
{
"docid": "ae40e5ae74371c2fe564a103611191a6",
"score": "0.64578635",
"text": "def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end",
"title": ""
},
{
"docid": "ae40e5ae74371c2fe564a103611191a6",
"score": "0.64578635",
"text": "def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end",
"title": ""
},
{
"docid": "ae40e5ae74371c2fe564a103611191a6",
"score": "0.64578635",
"text": "def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end",
"title": ""
},
{
"docid": "ae40e5ae74371c2fe564a103611191a6",
"score": "0.64578635",
"text": "def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end",
"title": ""
},
{
"docid": "ae40e5ae74371c2fe564a103611191a6",
"score": "0.64578635",
"text": "def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end",
"title": ""
},
{
"docid": "ae40e5ae74371c2fe564a103611191a6",
"score": "0.64578635",
"text": "def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end",
"title": ""
},
{
"docid": "ae40e5ae74371c2fe564a103611191a6",
"score": "0.64578635",
"text": "def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end",
"title": ""
},
{
"docid": "ae40e5ae74371c2fe564a103611191a6",
"score": "0.64578635",
"text": "def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end",
"title": ""
},
{
"docid": "ae40e5ae74371c2fe564a103611191a6",
"score": "0.64578635",
"text": "def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end",
"title": ""
},
{
"docid": "ae40e5ae74371c2fe564a103611191a6",
"score": "0.64578635",
"text": "def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end",
"title": ""
},
{
"docid": "ae40e5ae74371c2fe564a103611191a6",
"score": "0.64578635",
"text": "def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end",
"title": ""
},
{
"docid": "ae40e5ae74371c2fe564a103611191a6",
"score": "0.64578635",
"text": "def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end",
"title": ""
},
{
"docid": "ae40e5ae74371c2fe564a103611191a6",
"score": "0.64578635",
"text": "def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end",
"title": ""
},
{
"docid": "ae40e5ae74371c2fe564a103611191a6",
"score": "0.64578635",
"text": "def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end",
"title": ""
},
{
"docid": "ae40e5ae74371c2fe564a103611191a6",
"score": "0.64578635",
"text": "def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end",
"title": ""
},
{
"docid": "ae40e5ae74371c2fe564a103611191a6",
"score": "0.64578635",
"text": "def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end",
"title": ""
},
{
"docid": "ae40e5ae74371c2fe564a103611191a6",
"score": "0.64578635",
"text": "def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end",
"title": ""
},
{
"docid": "ae40e5ae74371c2fe564a103611191a6",
"score": "0.64578635",
"text": "def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end",
"title": ""
},
{
"docid": "ae40e5ae74371c2fe564a103611191a6",
"score": "0.64578635",
"text": "def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end",
"title": ""
},
{
"docid": "ae40e5ae74371c2fe564a103611191a6",
"score": "0.64578635",
"text": "def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end",
"title": ""
},
{
"docid": "ae40e5ae74371c2fe564a103611191a6",
"score": "0.64578635",
"text": "def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end",
"title": ""
},
{
"docid": "ae40e5ae74371c2fe564a103611191a6",
"score": "0.64578635",
"text": "def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end",
"title": ""
},
{
"docid": "ae40e5ae74371c2fe564a103611191a6",
"score": "0.64578635",
"text": "def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end",
"title": ""
},
{
"docid": "ae40e5ae74371c2fe564a103611191a6",
"score": "0.64578635",
"text": "def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end",
"title": ""
},
{
"docid": "ae40e5ae74371c2fe564a103611191a6",
"score": "0.64578635",
"text": "def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end",
"title": ""
},
{
"docid": "ae40e5ae74371c2fe564a103611191a6",
"score": "0.64578635",
"text": "def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end",
"title": ""
},
{
"docid": "ae40e5ae74371c2fe564a103611191a6",
"score": "0.64578635",
"text": "def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end",
"title": ""
},
{
"docid": "ae40e5ae74371c2fe564a103611191a6",
"score": "0.64578635",
"text": "def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end",
"title": ""
},
{
"docid": "ae40e5ae74371c2fe564a103611191a6",
"score": "0.64578635",
"text": "def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end",
"title": ""
},
{
"docid": "ae40e5ae74371c2fe564a103611191a6",
"score": "0.64578635",
"text": "def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end",
"title": ""
},
{
"docid": "ae40e5ae74371c2fe564a103611191a6",
"score": "0.64578635",
"text": "def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end",
"title": ""
},
{
"docid": "ae40e5ae74371c2fe564a103611191a6",
"score": "0.64578635",
"text": "def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end",
"title": ""
},
{
"docid": "ae40e5ae74371c2fe564a103611191a6",
"score": "0.64578635",
"text": "def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end",
"title": ""
},
{
"docid": "ae40e5ae74371c2fe564a103611191a6",
"score": "0.64578635",
"text": "def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end",
"title": ""
},
{
"docid": "ae40e5ae74371c2fe564a103611191a6",
"score": "0.64578635",
"text": "def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end",
"title": ""
},
{
"docid": "ae40e5ae74371c2fe564a103611191a6",
"score": "0.64578635",
"text": "def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end",
"title": ""
},
{
"docid": "ae40e5ae74371c2fe564a103611191a6",
"score": "0.64578635",
"text": "def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end",
"title": ""
},
{
"docid": "ae40e5ae74371c2fe564a103611191a6",
"score": "0.64578635",
"text": "def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end",
"title": ""
},
{
"docid": "ae40e5ae74371c2fe564a103611191a6",
"score": "0.64578635",
"text": "def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end",
"title": ""
},
{
"docid": "ae40e5ae74371c2fe564a103611191a6",
"score": "0.64578635",
"text": "def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end",
"title": ""
},
{
"docid": "ae40e5ae74371c2fe564a103611191a6",
"score": "0.64578635",
"text": "def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end",
"title": ""
},
{
"docid": "ae40e5ae74371c2fe564a103611191a6",
"score": "0.64578635",
"text": "def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end",
"title": ""
},
{
"docid": "ae40e5ae74371c2fe564a103611191a6",
"score": "0.64578635",
"text": "def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end",
"title": ""
},
{
"docid": "ae40e5ae74371c2fe564a103611191a6",
"score": "0.64578635",
"text": "def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end",
"title": ""
},
{
"docid": "ae40e5ae74371c2fe564a103611191a6",
"score": "0.64578635",
"text": "def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end",
"title": ""
},
{
"docid": "ae40e5ae74371c2fe564a103611191a6",
"score": "0.64578635",
"text": "def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end",
"title": ""
},
{
"docid": "ae40e5ae74371c2fe564a103611191a6",
"score": "0.64578635",
"text": "def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end",
"title": ""
},
{
"docid": "ae40e5ae74371c2fe564a103611191a6",
"score": "0.64578635",
"text": "def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end",
"title": ""
},
{
"docid": "ae40e5ae74371c2fe564a103611191a6",
"score": "0.64578635",
"text": "def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end",
"title": ""
},
{
"docid": "ae40e5ae74371c2fe564a103611191a6",
"score": "0.64578635",
"text": "def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end",
"title": ""
},
{
"docid": "ae40e5ae74371c2fe564a103611191a6",
"score": "0.64578635",
"text": "def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end",
"title": ""
},
{
"docid": "ae40e5ae74371c2fe564a103611191a6",
"score": "0.64578635",
"text": "def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end",
"title": ""
},
{
"docid": "ae40e5ae74371c2fe564a103611191a6",
"score": "0.64578635",
"text": "def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end",
"title": ""
},
{
"docid": "ae40e5ae74371c2fe564a103611191a6",
"score": "0.64578635",
"text": "def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end",
"title": ""
},
{
"docid": "ae40e5ae74371c2fe564a103611191a6",
"score": "0.64578635",
"text": "def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end",
"title": ""
},
{
"docid": "ae40e5ae74371c2fe564a103611191a6",
"score": "0.64578635",
"text": "def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end",
"title": ""
},
{
"docid": "ae40e5ae74371c2fe564a103611191a6",
"score": "0.64578635",
"text": "def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end",
"title": ""
},
{
"docid": "ae40e5ae74371c2fe564a103611191a6",
"score": "0.64578635",
"text": "def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end",
"title": ""
}
] |
ccf61930ca8d0c8099475160f6130678 | Delete an Existing Section and Its Associated Rules Removes serviceinsertion section from the system. ServiceInsertion section with rules can only be deleted by passing \"cascade&x3D;true\" parameter. | [
{
"docid": "d8e2fa29e485959d056920a846d1d109",
"score": "0.6364848",
"text": "def delete_service_insertion_section_with_http_info(section_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: ManagementPlaneApiServicesServiceInsertionApi.delete_service_insertion_section ...'\n end\n # verify the required parameter 'section_id' is set\n if @api_client.config.client_side_validation && section_id.nil?\n fail ArgumentError, \"Missing the required parameter 'section_id' when calling ManagementPlaneApiServicesServiceInsertionApi.delete_service_insertion_section\"\n end\n # resource path\n local_var_path = '/serviceinsertion/sections/{section-id}'.sub('{' + 'section-id' + '}', section_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'cascade'] = opts[:'cascade'] if !opts[:'cascade'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ManagementPlaneApiServicesServiceInsertionApi#delete_service_insertion_section\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
}
] | [
{
"docid": "7ef9ebdbecb974c09aaf4bbde1bb251d",
"score": "0.6895533",
"text": "def delete_service_insertion_section(section_id, opts = {})\n delete_service_insertion_section_with_http_info(section_id, opts)\n nil\n end",
"title": ""
},
{
"docid": "310e605381801743f38fc1d66a949d28",
"score": "0.6804388",
"text": "def delete_service_insertion_section(section_id, opts = {})\n delete_service_insertion_section_with_http_info(section_id, opts)\n return nil\n end",
"title": ""
},
{
"docid": "356a0a9d9cbc298651d3f9a855e9c05a",
"score": "0.67029524",
"text": "def delete_service_insertion_rule(section_id, rule_id, opts = {})\n delete_service_insertion_rule_with_http_info(section_id, rule_id, opts)\n nil\n end",
"title": ""
},
{
"docid": "e9324d4d3fdb10eac68491d98f9766a1",
"score": "0.6656655",
"text": "def destroy\n if @section.status == 'draft'\n if params[:cascade] == 'true'\n @section.cascading_action do |element|\n # Original item for deletion can be used elsewhere, children must not be reused\n element.destroy if element.status == 'draft' && (element.exclusive_use? || element == @section)\n end\n end\n @section.destroy\n render json: @section\n else\n render json: @section.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "da4340f76d11f922ba3b9d794264f86d",
"score": "0.6590634",
"text": "def delete_service_insertion_rule(section_id, rule_id, opts = {})\n delete_service_insertion_rule_with_http_info(section_id, rule_id, opts)\n return nil\n end",
"title": ""
},
{
"docid": "dd4a8b2a82450280ae59d763951c47b3",
"score": "0.6499589",
"text": "def delete_service_insertion_section_with_http_info(section_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: ServicesApi.delete_service_insertion_section ...\"\n end\n # verify the required parameter 'section_id' is set\n if @api_client.config.client_side_validation && section_id.nil?\n fail ArgumentError, \"Missing the required parameter 'section_id' when calling ServicesApi.delete_service_insertion_section\"\n end\n # resource path\n local_var_path = \"/serviceinsertion/sections/{section-id}\".sub('{' + 'section-id' + '}', section_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'cascade'] = opts[:'cascade'] if !opts[:'cascade'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ServicesApi#delete_service_insertion_section\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "e15496c519fe6b24353cd983ee895242",
"score": "0.6431154",
"text": "def destroy\n begin\n @section.destroy\n flash[:success] = \"successfully destroyed.\"\n rescue ActiveRecord::DeleteRestrictionError => e\n @section.errors.add(:base, e)\n flash[:error] = \"#{e}\"\n redirect_to section_url\n else\n redirect_to sections_url\n end\n end",
"title": ""
},
{
"docid": "bff3223a440c4c6d9f7532cee4d01e0c",
"score": "0.6373395",
"text": "def destroy_section\n cs = ControlSection.first(:control_id => params[:id], :section_id => params[:section_id])\n if cs && cs.destroy\n flash[:notice] = 'Section was successfully detached.'\n else\n flash[:error] = 'Failed'\n end\n redirect_to edit_control_path(Control.find(params[:id]))\n end",
"title": ""
},
{
"docid": "9d21c9391f8fd05a90edf74666593a7f",
"score": "0.63626426",
"text": "def delete()\n\n client.delete(\"/sections/#{gid}\") && true\n end",
"title": ""
},
{
"docid": "5a6c8d366f1447f05a17a1c6ae9fabf3",
"score": "0.6277302",
"text": "def destroy\n @section = Section.find params[:id]\n @section.destroy\n flash[:success] = \"Section deleted\"\n redirect_to admin_sections_path\n end",
"title": ""
},
{
"docid": "48ba32da002074521aa2a6fa1a177e6d",
"score": "0.62411225",
"text": "def destroy\n @section.destroy\n @sections = Section.all\n \n end",
"title": ""
},
{
"docid": "1ed653b47682b9a0998d5acd3a951e93",
"score": "0.61837786",
"text": "def destroy\n @service_section.destroy\n respond_to do |format|\n format.html { redirect_to service_sections_url, notice: \"Service section was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "2f2d6be81e6894d9c87a0f67b782f83a",
"score": "0.61507916",
"text": "def destroy\n @section = Section.find(params[:id])\n @section.destroy\n\n respond_to do |format|\n format.html { redirect_to(retrospective_sections_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "09ce53de05387f4960794bfa63d95ffc",
"score": "0.6146027",
"text": "def revise_service_insertion_section_with_rules_revise_with_rules(section_id, service_insertion_section_rule_list, opts = {})\n data, _status_code, _headers = revise_service_insertion_section_with_rules_revise_with_rules_with_http_info(section_id, service_insertion_section_rule_list, opts)\n data\n end",
"title": ""
},
{
"docid": "70f47b5e4fe3ac6ae19d0d43cae0006b",
"score": "0.61242324",
"text": "def destroy\n if !has_right?(:delete)\n redirect_to :unauthorized\n return\n end\n\n @section = Section.find_by_permalink(params[:id])\n @section.destroy\n\n respond_to do |format|\n format.html { redirect_to sections_url }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "f0ca7a207cdb6a1dc5c96bd13f93666a",
"score": "0.6120629",
"text": "def delete_service_insertion_rule_with_http_info(section_id, rule_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: ServicesApi.delete_service_insertion_rule ...\"\n end\n # verify the required parameter 'section_id' is set\n if @api_client.config.client_side_validation && section_id.nil?\n fail ArgumentError, \"Missing the required parameter 'section_id' when calling ServicesApi.delete_service_insertion_rule\"\n end\n # verify the required parameter 'rule_id' is set\n if @api_client.config.client_side_validation && rule_id.nil?\n fail ArgumentError, \"Missing the required parameter 'rule_id' when calling ServicesApi.delete_service_insertion_rule\"\n end\n # resource path\n local_var_path = \"/serviceinsertion/sections/{section-id}/rules/{rule-id}\".sub('{' + 'section-id' + '}', section_id.to_s).sub('{' + 'rule-id' + '}', rule_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ServicesApi#delete_service_insertion_rule\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "a7f3b73c2de210d74a85f3ac07a68594",
"score": "0.60842556",
"text": "def delete_section( section )\n @ini.delete section.to_s\n end",
"title": ""
},
{
"docid": "c38c22074aa7405227b8b31bd347d0b8",
"score": "0.6054149",
"text": "def revise_service_insertion_section_with_rules_revise_with_rules(section_id, service_insertion_section_rule_list, opts = {})\n data, _status_code, _headers = revise_service_insertion_section_with_rules_revise_with_rules_with_http_info(section_id, service_insertion_section_rule_list, opts)\n return data\n end",
"title": ""
},
{
"docid": "9b16012b8d3a40d699c7d58510d342c6",
"score": "0.60441816",
"text": "def delete_related_sections\n self.sections.each do |section|\n # Or perhaps instead of destroy, you would\n # move them to a another page.\n section.destroy\n end\n end",
"title": ""
},
{
"docid": "f201a2e3eeb3b7e7f6e16be63b27d5c3",
"score": "0.60205215",
"text": "def destroy\n @section = @encyclopaedia.sections.find(params[:id])\n @section.destroy\n\n respond_to do |format|\n puts \"redirecting...\"\n format.html { redirect_to(encyclopaedia_sections_url(@encyclopaedia)) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "e2c85c95bbd15ef982dc0cdd02b7fab7",
"score": "0.60122496",
"text": "def destroy\n @section = current_cookbook.sections.find(params[:id])\n @section.destroy\n redirect_to sections_path, notice: \"Section: #{@section.name} was successfully removed\"\n end",
"title": ""
},
{
"docid": "e6f96e95ce583bded50046d395f46f85",
"score": "0.60065126",
"text": "def destroy\n if @section.destroy\n respond_to do |format|\n format.html { redirect_to template_sections_path(@section.template), notice: 'Seção excluída com sucesso.' }\n format.json { head :no_content }\n end\n else\n redirect_to template_sections_path(@section.template), alert: 'Seção não pode ser excluída: existem trabalhos que usam esse template.'\n end\n end",
"title": ""
},
{
"docid": "4338daf39e6c029dc838d04359a3d521",
"score": "0.6006359",
"text": "def delete_section_with_http_info(section_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: ServicesApi.delete_section ...\"\n end\n # verify the required parameter 'section_id' is set\n if @api_client.config.client_side_validation && section_id.nil?\n fail ArgumentError, \"Missing the required parameter 'section_id' when calling ServicesApi.delete_section\"\n end\n # resource path\n local_var_path = \"/firewall/sections/{section-id}\".sub('{' + 'section-id' + '}', section_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'cascade'] = opts[:'cascade'] if !opts[:'cascade'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ServicesApi#delete_section\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "4338daf39e6c029dc838d04359a3d521",
"score": "0.6006359",
"text": "def delete_section_with_http_info(section_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: ServicesApi.delete_section ...\"\n end\n # verify the required parameter 'section_id' is set\n if @api_client.config.client_side_validation && section_id.nil?\n fail ArgumentError, \"Missing the required parameter 'section_id' when calling ServicesApi.delete_section\"\n end\n # resource path\n local_var_path = \"/firewall/sections/{section-id}\".sub('{' + 'section-id' + '}', section_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'cascade'] = opts[:'cascade'] if !opts[:'cascade'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ServicesApi#delete_section\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "004eec3679ab8def32b69c690aef5eda",
"score": "0.60002404",
"text": "def destroy\n @section = Section.find(params[:id])\n @section.destroy\n\n respond_to do |format|\n format.html { redirect_to(sections_url) }\n# format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "e8e15dc8769d686cfec35ad6f3767a89",
"score": "0.59987354",
"text": "def destroy\n @section = Section.find(params[:id])\n @section.destroy\n\n respond_to do |format|\n format.html { redirect_to [:admin,:sections], notice: 'Раздел удален.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "589ef7a9712f50976cdcd3c7d2c9a32e",
"score": "0.59742063",
"text": "def destroy\n @section = Section.find(params[:id])\n @section.destroy\n\n respond_to do |format|\n format.html { redirect_to(root_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "22aa2cb9320565691bc17c153d4a71fa",
"score": "0.5970054",
"text": "def delete_section(section_id)\n dead_presentations = []\n dead_rosters = []\n curr_section = Section.find(section_id)\n curr_section.presentations.each { |pres| dead_presentations << pres.id }\n curr_section.rosters.each { |roster| dead_rosters << roster.id }\n dead_presentations.each { |id| delete_presentation(id) }\n dead_rosters.each { |id| delete_roster(id) }\n curr_section.destroy\n end",
"title": ""
},
{
"docid": "d2bb0e2938d4c4f3417e1330fbc97e6b",
"score": "0.5960836",
"text": "def delete_section(org_unit_id, section_id)\n path = \"/d2l/api/lp/#{$lp_ver}/#{org_unit_id}/sections/#{section_id}\"\n _delete(path)\nend",
"title": ""
},
{
"docid": "5efe9d1c6970cd878e4c9e1d52f41587",
"score": "0.59442884",
"text": "def destroy\n @guide_section.destroy\n respond_to do |format|\n format.html { redirect_to guide_sections_url, notice: \"Section was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "fa9de98ce8869ce96cacfc9646de639c",
"score": "0.593348",
"text": "def destroy\n @section ||= Section.find(params[:id])\n @section.destroy\n\n respond_to do |format|\n format.html { redirect_to sections_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "feeef0749f02ad379dca7d636774effd",
"score": "0.59229445",
"text": "def destroy\n @section = @learning_module.sections.find(params[:id])\n @section.destroy\n\n respond_to do |format|\n format.html { redirect_to @learning_module }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "e2b5632be515dcf4f86f5ea48a5c9075",
"score": "0.5905997",
"text": "def test_delete_section\n remote_file_name = 'TestDeleteSection.docx'\n\n upload_file File.join(local_test_folder, local_file), remote_data_folder + '/' + remote_file_name\n\n request = DeleteSectionRequest.new(name: remote_file_name, section_index: 0, folder: remote_data_folder)\n\n @words_api.delete_section(request)\n end",
"title": ""
},
{
"docid": "ebb04865ae756520eb4ef93bc17dcedd",
"score": "0.5885406",
"text": "def destroy\n @section = Section.find(params[:id])\n @section.destroy\n\n respond_to do |format|\n format.html { redirect_to sections_url }\n # format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "9b4ac341d9f29efc93193714d8dcc26d",
"score": "0.5882313",
"text": "def revise_service_insertion_section_with_rules_revise_with_rules_with_http_info(section_id, service_insertion_section_rule_list, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: ServicesApi.revise_service_insertion_section_with_rules_revise_with_rules ...\"\n end\n # verify the required parameter 'section_id' is set\n if @api_client.config.client_side_validation && section_id.nil?\n fail ArgumentError, \"Missing the required parameter 'section_id' when calling ServicesApi.revise_service_insertion_section_with_rules_revise_with_rules\"\n end\n # verify the required parameter 'service_insertion_section_rule_list' is set\n if @api_client.config.client_side_validation && service_insertion_section_rule_list.nil?\n fail ArgumentError, \"Missing the required parameter 'service_insertion_section_rule_list' when calling ServicesApi.revise_service_insertion_section_with_rules_revise_with_rules\"\n end\n if @api_client.config.client_side_validation && !opts[:'id'].nil? && opts[:'id'].to_s.length > 64\n fail ArgumentError, 'invalid value for \"opts[:\"id\"]\" when calling ServicesApi.revise_service_insertion_section_with_rules_revise_with_rules, the character length must be smaller than or equal to 64.'\n end\n\n if @api_client.config.client_side_validation && opts[:'operation'] && !['insert_top', 'insert_bottom', 'insert_after', 'insert_before'].include?(opts[:'operation'])\n fail ArgumentError, 'invalid value for \"operation\", must be one of insert_top, insert_bottom, insert_after, insert_before'\n end\n # resource path\n local_var_path = \"/serviceinsertion/sections/{section-id}?action=revise_with_rules\".sub('{' + 'section-id' + '}', section_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'id'] = opts[:'id'] if !opts[:'id'].nil?\n query_params[:'operation'] = opts[:'operation'] if !opts[:'operation'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(service_insertion_section_rule_list)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:POST, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ServiceInsertionSectionRuleList')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ServicesApi#revise_service_insertion_section_with_rules_revise_with_rules\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "6d570b4f717b30d296cf1ce6116c2c59",
"score": "0.5878533",
"text": "def destroy\n @section = Section.find(params[:id])\n @section.destroy\n\n respond_to do |format|\n format.html { redirect_to sections_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "6d570b4f717b30d296cf1ce6116c2c59",
"score": "0.5878533",
"text": "def destroy\n @section = Section.find(params[:id])\n @section.destroy\n\n respond_to do |format|\n format.html { redirect_to sections_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "3afcf1db9040de982c0576d60e118aa7",
"score": "0.5875407",
"text": "def delete_service_insertion_rule_with_http_info(section_id, rule_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: ManagementPlaneApiServicesServiceInsertionApi.delete_service_insertion_rule ...'\n end\n # verify the required parameter 'section_id' is set\n if @api_client.config.client_side_validation && section_id.nil?\n fail ArgumentError, \"Missing the required parameter 'section_id' when calling ManagementPlaneApiServicesServiceInsertionApi.delete_service_insertion_rule\"\n end\n # verify the required parameter 'rule_id' is set\n if @api_client.config.client_side_validation && rule_id.nil?\n fail ArgumentError, \"Missing the required parameter 'rule_id' when calling ManagementPlaneApiServicesServiceInsertionApi.delete_service_insertion_rule\"\n end\n # resource path\n local_var_path = '/serviceinsertion/sections/{section-id}/rules/{rule-id}'.sub('{' + 'section-id' + '}', section_id.to_s).sub('{' + 'rule-id' + '}', rule_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ManagementPlaneApiServicesServiceInsertionApi#delete_service_insertion_rule\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "9139a915fabab7a6e0575239aa15ffad",
"score": "0.58690363",
"text": "def destroy\n @section = Section.find(params[:id])\n @section.destroy\n\n respond_to do |format|\n format.html { redirect_to sections_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "8e90f2ccbe6d463207cadf01a48e1584",
"score": "0.5861995",
"text": "def delete_section(request)\n begin\n data, _status_code, _headers = delete_section_with_http_info(request)\n rescue ApiError => e\n if e.code == 401\n request_token\n data, _status_code, _headers = delete_section_with_http_info(request)\n else\n raise\n end\n end\n nil\n end",
"title": ""
},
{
"docid": "b3cab0808be5d407a2e812e89cc18ff3",
"score": "0.5846315",
"text": "def destroy\n @caravan_make_section = CaravanMakeSection.find(params[:id])\n @caravan_make_section.destroy\n\n respond_to do |format|\n format.html { redirect_to(caravan_make_sections_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "0e7f37dd4e39332a1ad286e7eb9615ed",
"score": "0.5845824",
"text": "def destroy\n @article_section = ArticleSection.find(params[:id])\n @article_section.destroy\n\n respond_to do |format|\n format.html { redirect_to(article_sections_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "0a1ec32054e00c7ea79c6c3a5ec7c2ed",
"score": "0.58428586",
"text": "def destroy\n @car_make_section = CarMakeSection.find(params[:id])\n @car_make_section.destroy\n\n respond_to do |format|\n format.html { redirect_to(car_make_sections_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "4c9555b6c935dd060dfa0af5d9413661",
"score": "0.5839094",
"text": "def admin_destroysection\n \t@section = Section.find(params[:section_id])\n authorize @section.version.phase.dmptemplate\n \t@version = @section.version\n \t@phase = @version.phase\n @section.destroy\n respond_to do |format|\n format.html { redirect_to admin_phase_dmptemplate_path(:id => @phase.id, :version_id => @version.id, :edit => 'true' ), notice: I18n.t('org_admin.templates.destroyed_message') }\n end\n \tend",
"title": ""
},
{
"docid": "67c9dcd570fcf2a6e9658e57f77730b3",
"score": "0.5835016",
"text": "def destroy\n @sub_section = SubSection.find(params[:id])\n @sub_section.destroy\n\n respond_to do |format|\n format.html { redirect_to(sub_sections_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "aaee29193cf97f8ba49e5d029a161257",
"score": "0.58348924",
"text": "def create_delete_section\n respond_url = delete_section_project_deployments_url(@project)\n\n multiple_create(:delete_section, respond_url) do\n @deployments = deployment.search_in_delete_section(params[:search])\n end\n end",
"title": ""
},
{
"docid": "546c22ceecba0b03707a93f36bf7b55a",
"score": "0.58186144",
"text": "def delete_dne_section_with_http_info(section_id, operation, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: ServicesApi.delete_dne_section ...\"\n end\n # verify the required parameter 'section_id' is set\n if @api_client.config.client_side_validation && section_id.nil?\n fail ArgumentError, \"Missing the required parameter 'section_id' when calling ServicesApi.delete_dne_section\"\n end\n # verify the required parameter 'operation' is set\n if @api_client.config.client_side_validation && operation.nil?\n fail ArgumentError, \"Missing the required parameter 'operation' when calling ServicesApi.delete_dne_section\"\n end\n # verify enum value\n if @api_client.config.client_side_validation && !['insert_top', 'insert_bottom', 'insert_after', 'insert_before'].include?(operation)\n fail ArgumentError, \"invalid value for 'operation', must be one of insert_top, insert_bottom, insert_after, insert_before\"\n end\n if @api_client.config.client_side_validation && !opts[:'id'].nil? && opts[:'id'].to_s.length > 64\n fail ArgumentError, 'invalid value for \"opts[:\"id\"]\" when calling ServicesApi.delete_dne_section, the character length must be smaller than or equal to 64.'\n end\n\n # resource path\n local_var_path = \"/network-encryption/sections/{section-id}\".sub('{' + 'section-id' + '}', section_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'operation'] = operation\n query_params[:'cascade'] = opts[:'cascade'] if !opts[:'cascade'].nil?\n query_params[:'id'] = opts[:'id'] if !opts[:'id'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ServicesApi#delete_dne_section\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "160daf75ad6ca50110613d7f50276d92",
"score": "0.57991225",
"text": "def destroy\n @section.destroy\n respond_to do |format|\n format.html { redirect_to test_paper_sections_url, notice: 'Test paper section was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "e6f8a9412e4679c1f9f4f317554ee8c0",
"score": "0.5789304",
"text": "def destroy\n @section.destroy\n respond_to do |format|\n format.html { redirect_to sections_path }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "3e8fdaf349bff569b20bc5463f61e4f9",
"score": "0.57872295",
"text": "def delete(id:, cascade: 'none')\n id_check('id', id)\n valid_value_check(:cascade, cascade, VALID_CASCADES)\n\n cf_delete(path: \"/zones/#{zone_id}/firewall/access_rules/rules/#{id}\")\n end",
"title": ""
},
{
"docid": "7bcf28aa7650793b842a10a6dfe78c1f",
"score": "0.57849044",
"text": "def del(type, section, data_keys, layer = 'controller')\n return nil unless check_par(type, Symbol,\n section, Symbol,\n data_keys, [Symbol, Array],\n layer, [String, NilClass])\n\n keys = build_keys(type, section, data_keys)\n\n layer = 'controller' if layer.nil? || %w(app map).include?(layer)\n\n delete_map(section, keys[2]) if keys[0] == :sections\n\n p_del(:keys => keys, :name => layer)\n end",
"title": ""
},
{
"docid": "2da3555050d7b50f60c40b4a830f7054",
"score": "0.5772999",
"text": "def destroy\n @section.destroy\n respond_to do |format|\n format.html { redirect_to sections_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "eb20e33281e7950de9ad702db79b050e",
"score": "0.57675326",
"text": "def destroy\n @caravan_model_section = CaravanModelSection.find(params[:id])\n @caravan_model_section.destroy\n\n respond_to do |format|\n format.html { redirect_to(caravan_model_sections_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "dc81c987485bf041e382f26d71d59804",
"score": "0.57612795",
"text": "def destroy\n @top_section = TopSection.find(params[:id])\n if !@top_section.nil? && !@top_section.sections.empty? && @top_section.sections.count > 0\n flash[:error] = l(:error_can_not_delete_topsection_unless_sections)\n flash[:notice] = \"Verificare la lista delle sotto sezioni (\" + @top_section.sections.count.to_s + \") qui sotto <ol>\"\n @top_section.sections.each do |sec|\n flash[:notice] += \"<li>\" + sec.full_name + \"</li>\"\n end\n flash[:notice] += \"</ol>\"\n else\n if @top_section.id == FeeConst::DEFAULT_TOP_SECTION\n flash[:error] = l(:error_can_not_delete_system, :name => \"questa sezione \")\n else\n @top_section.destroy\n end\n end\n\n respond_to do |format|\n format.html { redirect_to(top_sections_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "49d31fa4111fe74b8f13a42c595ca50c",
"score": "0.57568485",
"text": "def destroy\n @section = Section.find(params[:id])\n @section.destroy\n respond_to do |format|\n format.html { redirect_to sections_url, notice: \"Section was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "2d6d6b69202c9002fe15e565911e9a1d",
"score": "0.5754724",
"text": "def destroy\n @boats_domicile_type_section = BoatsDomicileTypeSection.find(params[:id])\n @boats_domicile_type_section.destroy\n\n respond_to do |format|\n format.html { redirect_to(boats_domicile_type_sections_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "fb6cdedaba4f51c42dfba8d714519bf0",
"score": "0.57501644",
"text": "def destroy\n @section = Section.find(params[:id])\n if !@section.nil? && !@section.issues.empty? && @section.issues.count > 0\n flash[:error] = l(:error_can_not_delete_section_unless_issues)\n flash[:notice] = \"Verificare la lista degli articoli (\" + @section.issues.count.to_s + \") legati qui sotto <ol>\"\n @section.issues.each do |art|\n flash[:notice] += \"<li>\" + art.to_s + \"</li>\"\n end\n flash[:notice] += \"</ol>\"\n else\n if @section.id == FeeConst::DEFAULT_SECTION\n flash[:error] = l(:error_can_not_delete_system, :name => \"questa sotto sezione\")\n else\n @section.destroy\n end\n end\n\n respond_to do |format|\n format.html { redirect_to(sections_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "97647536c676019bda82c3dc5b04b13a",
"score": "0.5745539",
"text": "def destroy\n @document_section.destroy\n respond_to do |format|\n format.html { redirect_to admin_document_path(@document), notice: 'Section was successfully deleted.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "78a877154595caceeeb0f428f78f00c3",
"score": "0.57358533",
"text": "def destroy\n @guide_section = GuideSection.find(params[:id])\n @guide_section.destroy\n\n respond_to do |format|\n format.html { redirect_to guide_sections_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "78a877154595caceeeb0f428f78f00c3",
"score": "0.57358533",
"text": "def destroy\n @guide_section = GuideSection.find(params[:id])\n @guide_section.destroy\n\n respond_to do |format|\n format.html { redirect_to guide_sections_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "f55aa501230b52b5d58ca8a7c15d81a5",
"score": "0.57201576",
"text": "def revise_service_insertion_section_revise(section_id, service_insertion_section, opts = {})\n data, _status_code, _headers = revise_service_insertion_section_revise_with_http_info(section_id, service_insertion_section, opts)\n data\n end",
"title": ""
},
{
"docid": "7d42949799c09edd7e588668ada6f299",
"score": "0.5710681",
"text": "def delete\n run_hooks(:before, :delete)\n native_document.delete\n run_hooks(:after, :delete)\n end",
"title": ""
},
{
"docid": "e6e338899e4f6b819202bf59566f73f5",
"score": "0.57058144",
"text": "def destroy\n @paragraph = Paragraph.find(params[:id])\n @section=@paragraph.section\n @paragraph.destroy\n\n respond_to do |format|\n format.html { redirect_to section_url(@section) }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "ef2c5f6af378916dc1c50a0f467d3166",
"score": "0.57028276",
"text": "def destroy\n @cvsection = Cvsection.find(params[:id])\n @cvsection.destroy\n\n respond_to do |format|\n format.html { redirect_to cvsections_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "e33d0fc99c6f159de6651c5c59d2487e",
"score": "0.57017475",
"text": "def destroy\n tmp = @line.section_id\n @line.destroy\n respond_to do |format|\n format.html { redirect_to lines_url(:section_id => tmp), notice: 'Line was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "ac436495b0ca3876fcc0708f4a190d24",
"score": "0.57010555",
"text": "def del(*keys)\n return nil if keys.length == 0\n return p_del(:default, *keys) if @data_options[:section].nil?\n p_del(@data_options[:section], *keys)\n end",
"title": ""
},
{
"docid": "8091c306c5ea1a109b635f61a5e2c24d",
"score": "0.5694356",
"text": "def admin_destroy\n @section = Section.includes(phase: :template).find(params[:section_id])\n authorize @section\n @phase = @section.phase\n current_tab = params[:r] || 'all-templates'\n if @section.destroy\n @phase.template.dirty = true\n @phase.template.save!\n redirect_to admin_show_phase_path(id: @phase.id, r: current_tab), notice: success_message(_('section'), _('deleted'))\n else\n @edit = (@phase.template.org == current_user.org)\n @open = true\n @sections = @phase.sections\n @section_id = @section.id\n @question_id = nil\n\n flash[:alert] = failed_destroy_error(@section, _('section'))\n if @phase.template.customization_of.present?\n @original_org = Template.where(dmptemplate_id: @phase.template.customization_of).first.org\n else\n @original_org = @phase.template.org\n end\n redirect_to(admin_show_phase_path(id: @phase.id, r: current_tab))\n end\n end",
"title": ""
},
{
"docid": "c7d79b440f49ed008c04c56bc999cbaf",
"score": "0.5692752",
"text": "def delete service\n\t @name_services.delete service\n\tend",
"title": ""
},
{
"docid": "e8c39b49d48919526df71595914456a8",
"score": "0.5686817",
"text": "def destroy\n @menu_section = @menu_sections.find(params[:id])\n @menu_section.destroy\n\n respond_to do |format|\n format.html { redirect_to menu_sections_url }\n end\n end",
"title": ""
},
{
"docid": "761eeaf1aa078a7f59cac51858ac6623",
"score": "0.5670129",
"text": "def revise_service_insertion_section_with_rules_revise_with_rules_with_http_info(section_id, service_insertion_section_rule_list, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: ManagementPlaneApiServicesServiceInsertionApi.revise_service_insertion_section_with_rules_revise_with_rules ...'\n end\n # verify the required parameter 'section_id' is set\n if @api_client.config.client_side_validation && section_id.nil?\n fail ArgumentError, \"Missing the required parameter 'section_id' when calling ManagementPlaneApiServicesServiceInsertionApi.revise_service_insertion_section_with_rules_revise_with_rules\"\n end\n # verify the required parameter 'service_insertion_section_rule_list' is set\n if @api_client.config.client_side_validation && service_insertion_section_rule_list.nil?\n fail ArgumentError, \"Missing the required parameter 'service_insertion_section_rule_list' when calling ManagementPlaneApiServicesServiceInsertionApi.revise_service_insertion_section_with_rules_revise_with_rules\"\n end\n if @api_client.config.client_side_validation && !opts[:'id'].nil? && opts[:'id'].to_s.length > 64\n fail ArgumentError, 'invalid value for \"opts[:\"id\"]\" when calling ManagementPlaneApiServicesServiceInsertionApi.revise_service_insertion_section_with_rules_revise_with_rules, the character length must be smaller than or equal to 64.'\n end\n\n if @api_client.config.client_side_validation && opts[:'operation'] && !['insert_top', 'insert_bottom', 'insert_after', 'insert_before'].include?(opts[:'operation'])\n fail ArgumentError, 'invalid value for \"operation\", must be one of insert_top, insert_bottom, insert_after, insert_before'\n end\n # resource path\n local_var_path = '/serviceinsertion/sections/{section-id}?action=revise_with_rules'.sub('{' + 'section-id' + '}', section_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'id'] = opts[:'id'] if !opts[:'id'].nil?\n query_params[:'operation'] = opts[:'operation'] if !opts[:'operation'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(service_insertion_section_rule_list)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:POST, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ServiceInsertionSectionRuleList')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ManagementPlaneApiServicesServiceInsertionApi#revise_service_insertion_section_with_rules_revise_with_rules\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "b814a40784faf5f3788133d2d9182a48",
"score": "0.5669688",
"text": "def destroy\n @guide_section = GuideSection.find(params[:id])\n # save display order and parent id for use later in reordering sections\n @display_order = @guide_section.display_order\n @parent_id = @guide_section.parent_id\n @destroyed = @guide_section.id\n @guide_section.destroy\n \n @guide = Guide.find(params[:guide_id])\n @guide_sections = GuideSection.find_all_by_guide_id(@guide.id, :order => \"display_order ASC\")\n # reorder sections so that there are no gaps unless the section just deleted was the last\n unless @display_order == @guide_sections.size\n \tcounter = 1\n\t @guide_sections.each do |guide_section|\n\t \tguide_section.display_order = counter\n\t \t# if destroy section had children then denest all children one level\n\t \tguide_section.parent_id == @destroyed ? guide_section.parent_id = @parent_id : nil\n\t \tguide_section.save\n\t \tcounter += 1\n\t end\n\t end\n\n respond_to do |format|\n format.html { redirect_to guide_guide_sections_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "f4b8d3aabedccbceb4b45c8787843a4d",
"score": "0.5659433",
"text": "def destroy\n @moto_make_section = MotoMakeSection.find(params[:id])\n @moto_make_section.destroy\n\n respond_to do |format|\n format.html { redirect_to(moto_make_sections_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "0c2b5caff23f8611a58deae49983f97d",
"score": "0.5637808",
"text": "def destroy\n @section = Section.find(params[:id])\n book = @section.book\n @section.destroy\n respond_to do |format|\n format.html { redirect_to book_sections_url(book) }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "39ae14266a7678be5c6e05d0b53e5b0f",
"score": "0.5620419",
"text": "def destroy\n @sectioned = @section.sectioned\n @section.destroy\n respond_to do |format|\n format.html { redirect_to polymorphic_url(@sectioned), notice: 'Section was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "eff879deceec5da58902084fd85e82b3",
"score": "0.5620182",
"text": "def destroy\n @sub_section = SubSection.find(params[:id])\n @sub_section.destroy\n\n respond_to do |format|\n format.html { redirect_to sub_sections_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "eff879deceec5da58902084fd85e82b3",
"score": "0.5620182",
"text": "def destroy\n @sub_section = SubSection.find(params[:id])\n @sub_section.destroy\n\n respond_to do |format|\n format.html { redirect_to sub_sections_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "ca1172b29016dd06cd58100d94520b31",
"score": "0.5618709",
"text": "def delete_section?\n section == 'Delete'\n end",
"title": ""
},
{
"docid": "74b68ad39571da1057bf73ccef6bba8d",
"score": "0.5616516",
"text": "def destroy\n @sectioned = @section.sectioned\n @section.destroy\n respond_to do |format|\n @sections = @sectioned.sections.includes([:rich_text_body]).order(:position)\n# format.html { redirect_to polymorphic_url(@sectioned), notice: 'Section was successfully destroyed.' }\n format.json { head :no_content }\n if @sectioned.class.name == 'Chapter'\n @asides = @sectioned.asides\n end\n flash.now[:now] = \"Section was successfully destroyed.\"\n format.turbo_stream { render \"shared/destroy\", locals: { object: Section.new } }\n end\n end",
"title": ""
},
{
"docid": "58ae4993f528818c0596952303dae693",
"score": "0.5610259",
"text": "def delete_section\n @deployments = deployment.search_in_delete_section(params[:search_file])\n index_respond\n end",
"title": ""
},
{
"docid": "38b20d3e40f32bbc87308c037608e012",
"score": "0.56014663",
"text": "def destroy\n @section = @day.sections.find(params[:id])\n @section.destroy\n\n respond_to do |format|\n format.html { redirect_to sections_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "0381e4fd5e4ca463a5a29f898ad0c21b",
"score": "0.559853",
"text": "def delete_section(section_name)\n if @data.key?(section_name)\n @data.delete(section_name)\n else\n fail \"Cannot delete nonexistent section: #{ section_name }\"\n end\n end",
"title": ""
},
{
"docid": "3b9edc2d872b7fb0b6850806a12b88d3",
"score": "0.5592855",
"text": "def destroy\n @section.destroy\n respond_to do |format|\n format.html { redirect_to book_chapter_sections_path(@book, @chapter), notice: 'Section was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "c6a63463df69a8f9ae391f7e8667486f",
"score": "0.5590423",
"text": "def destroy\n target = @section.parent ? section_path(@section.parent) : root_url\n @section.destroy\n respond_to do |format|\n format.html { redirect_to target, notice: 'Section was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "e0b7a9587828b9564738795db137654b",
"score": "0.55878085",
"text": "def destroy\n @section = Section.find(params[:id])\n @section.destroy\n\n respond_to do |format|\n format.html { redirect_to sections_url, notice: \"Sekcia bola vymazaná.\" }\n format.json { head :no_content }\n format.js { render nothing: true, status: 200 }\n end\n end",
"title": ""
},
{
"docid": "4bc632425a51e77fd865b684a0a2da9c",
"score": "0.55877",
"text": "def revise_service_insertion_section_revise(section_id, service_insertion_section, opts = {})\n data, _status_code, _headers = revise_service_insertion_section_revise_with_http_info(section_id, service_insertion_section, opts)\n return data\n end",
"title": ""
},
{
"docid": "73c7d1bbed7b084c550dd513381a7fec",
"score": "0.5586462",
"text": "def destroy\n load_single.destroy\n respond_to do |format|\n format.html { redirect_to(page_sections_path(@page)) }\n end\n end",
"title": ""
},
{
"docid": "1ce962ba04d91882a4ba7cbb89044dd2",
"score": "0.5579884",
"text": "def destroy\n @section.destroy\n respond_to do |format|\n format.html { redirect_to sections_url, notice: 'Section was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1ce962ba04d91882a4ba7cbb89044dd2",
"score": "0.55781573",
"text": "def destroy\n @section.destroy\n respond_to do |format|\n format.html { redirect_to sections_url, notice: 'Section was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1ce962ba04d91882a4ba7cbb89044dd2",
"score": "0.55781573",
"text": "def destroy\n @section.destroy\n respond_to do |format|\n format.html { redirect_to sections_url, notice: 'Section was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "7a90442ccd2f6bd088b573d7f7115f88",
"score": "0.55420876",
"text": "def test_service_delete\n\t\t\tcount = 0\n\t\t\tbegin\n\t\t\t\texpected = $aut.service_create(\"TestService\".concat((count = count+1).to_s), \"TestService\", \"This is a test description\")\n\t\t\tend while(expected[1].key?(\"error\"))\n\t\t\texpected = expected[1][\"OS-KSADM:service\"][\"id\"]\n\t\t\t$aut.service_get(expected)\n\t\t\texpected = $aut.service_delete(expected)[0]\n\t\t\tassert(expected)\n\t\tend",
"title": ""
},
{
"docid": "51208b45088d021b37f00a5259cef025",
"score": "0.55410993",
"text": "def destroy\n @catalog_section = CatalogSection.find(params[:id])\n @catalog_section.destroy\n\n respond_to do |format|\n format.html { redirect_to catalog_sections_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "152645c125b7473a8a9049b1c56a9585",
"score": "0.5529846",
"text": "def delete_dne_section(section_id, operation, opts = {})\n delete_dne_section_with_http_info(section_id, operation, opts)\n return nil\n end",
"title": ""
},
{
"docid": "44047b8ef7fb713d6d2f90050e791976",
"score": "0.5520243",
"text": "def destroy\n @feature_section.destroy\n respond_to do |format|\n format.html { redirect_to feature_sections_url, notice: \"Feature section was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "f2d01f8d5438eaeed4d38d09f9c6bd3b",
"score": "0.55066323",
"text": "def destroy\n @researchsection = Researchsection.find(params[:id])\n @researchsection.destroy\n\n respond_to do |format|\n format.html { redirect_to researchsections_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "3ff22a631fc81bf7a558fcf930b16390",
"score": "0.5503246",
"text": "def delete_section(section_id, opts = {})\n delete_section_with_http_info(section_id, opts)\n return nil\n end",
"title": ""
},
{
"docid": "3ff22a631fc81bf7a558fcf930b16390",
"score": "0.5503246",
"text": "def delete_section(section_id, opts = {})\n delete_section_with_http_info(section_id, opts)\n return nil\n end",
"title": ""
},
{
"docid": "06b7143cd5b46a927463207fd323f75a",
"score": "0.54890245",
"text": "def destroy\n @section.destroy\n respond_to do |format|\n format.html { redirect_to sections_url, notice: 'Sections and Surveys were successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "169cce382a2b02712a79b7a6e5ce8456",
"score": "0.5485711",
"text": "def destroy\n @service = @definition.service\n @definition.destroy\n respond_to do |format|\n format.html { redirect_to @service, notice: 'Definition was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "f2e50c665dec47fa83a1dde11316ab8d",
"score": "0.5484673",
"text": "def destroy\n @machine_make_section = MachineMakeSection.find(params[:id])\n @machine_make_section.destroy\n\n respond_to do |format|\n format.html { redirect_to(machine_make_sections_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "ed922a4deee27adfe03e1541f17be810",
"score": "0.54764676",
"text": "def destroy\n @caravan_town_type_section = CaravanTownTypeSection.find(params[:id])\n @caravan_town_type_section.destroy\n\n respond_to do |format|\n format.html { redirect_to(caravan_town_type_sections_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
}
] |
955682ca468c5e008cd668bc3b2b61f7 | Public: View partner's root admin detail by click root admin email/username Examples | [
{
"docid": "b9d71911f439ba325b14573932e3bcd0",
"score": "0.65548337",
"text": "def view_root_admin_detail(search_key)\n find(:xpath, \"//a[text()='#{search_key}']\").click\n end",
"title": ""
}
] | [
{
"docid": "18bcfc546e7246be8308a9aa7642dc6b",
"score": "0.6841317",
"text": "def go_to_admin_page\n user_name.click\n admin_link.click\n end",
"title": ""
},
{
"docid": "ab6175b2205d44702c610bd36ce9fbfd",
"score": "0.67544657",
"text": "def display_resource(admin)\r\n admin.login\r\n end",
"title": ""
},
{
"docid": "f7eb4921527b35f842e077b5919dcc59",
"score": "0.6638234",
"text": "def show_admin\n screen_name(\"Inicial-Admin\")\n\n distribute_ots\n\n respond_to do |format|\n format.html { render action: \"show_admin\" }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "ee3ed234f4863daf711b690c0c13e6b1",
"score": "0.6462778",
"text": "def admin\n #TODO\n end",
"title": ""
},
{
"docid": "5de1481e626a11ede2e1d3eff4d6c67c",
"score": "0.638164",
"text": "def viewer\n admin\n end",
"title": ""
},
{
"docid": "95a0d98fc811aecbbde254cbf80037a4",
"score": "0.63310957",
"text": "def show\n add_breadcrumb t(:'hyrax.controls.home'), root_path\n add_breadcrumb t(:'hyrax.admin.sidebar.accounts'), proprietor_accounts_path\n add_breadcrumb @account.tenant, edit_proprietor_account_path(@account)\n\n admin_page = params[:user_superadmin_page]\n @current_superusers = User.where(email: @account.admin_emails).page(admin_page).per(5) if @account.admin_emails\n @current_nonadmin_users = User.order('email').page(params[:user_page]).per(5)\n end",
"title": ""
},
{
"docid": "755b82447182fd08b70d203eb210516c",
"score": "0.62465566",
"text": "def show\n\t\trequire_admin!\n\tend",
"title": ""
},
{
"docid": "8b861f6eed91486bd1a432f4449ffddd",
"score": "0.62047076",
"text": "def info_for_edit_page\n @is_super_adm = is_super?\n\n if @is_super_adm\n # Loading Choosing of adm\n @admins = User.admins_list\n\n if @admins.empty?\n @mentors = [@admins]\n else\n employee = @user.client.employee\n if employee.present?\n @admins_cur = employee.employee_id\n @mentors_cur = @user.client.employee_id\n else\n @admins_cur = params[:administrator_id]\n @mentors_cur = 0\n end\n @mentors = User.mentors_list(@admins_cur, additional_users: User.all_local_admins)\n end\n elsif current_user.local_admin?\n @mentors = User.mentors_list(current_user.role_model.id, additional_users: [current_user])\n @mentors_cur = @user.client.employee_id\n end\n end",
"title": ""
},
{
"docid": "88c67d420227d8874140a5464768ce27",
"score": "0.61607116",
"text": "def admin_name\n self.user.name\n end",
"title": ""
},
{
"docid": "db2dfae624d1b925cc4609a18175f5b2",
"score": "0.61382955",
"text": "def admin\n end",
"title": ""
},
{
"docid": "db2dfae624d1b925cc4609a18175f5b2",
"score": "0.61382955",
"text": "def admin\n end",
"title": ""
},
{
"docid": "db2dfae624d1b925cc4609a18175f5b2",
"score": "0.61382955",
"text": "def admin\n end",
"title": ""
},
{
"docid": "db2dfae624d1b925cc4609a18175f5b2",
"score": "0.61382955",
"text": "def admin\n end",
"title": ""
},
{
"docid": "741ea59492030f54c4a01cd45b39fa07",
"score": "0.61160177",
"text": "def show\n checkadmin\n end",
"title": ""
},
{
"docid": "d5b21f7cfe3a45b642c2975b81205d61",
"score": "0.6109515",
"text": "def index\n @username = (is_admin? ? params[:id] : current_user_model.username)\n @pronoun = (is_admin? ? \"\" : \" Your \")\n @username = current_user_model.username if @username.blank?\n if is_admin?\n @investigators = Investigator.by_name\n render :action => 'admin_index'\n else\n render\n end\n end",
"title": ""
},
{
"docid": "41ef15182a818075118602db40ab7090",
"score": "0.6104721",
"text": "def admin_username\n vm.os_profile.admin_username\n end",
"title": ""
},
{
"docid": "f38bcc143210468e0c83b3228ce96d50",
"score": "0.6083681",
"text": "def admin\n\n end",
"title": ""
},
{
"docid": "a422addaeab5743d4970367beb92eea3",
"score": "0.60681325",
"text": "def admin\n @shell.admin\n end",
"title": ""
},
{
"docid": "f68d893bcee5616b465352046f4ff9bd",
"score": "0.6050444",
"text": "def show\n @user = current_user\n @admin = @user.admin\n unless @admin\n redirect_to :root, :alert => t(\"notice.access\")\n end\n end",
"title": ""
},
{
"docid": "ff9dbc0eb020fc774b5a1a726d4fc0e0",
"score": "0.6043027",
"text": "def show\n set_administrator\n end",
"title": ""
},
{
"docid": "b5e9c5ae586448bfef2726d7f1dbeddc",
"score": "0.6019413",
"text": "def show\n owner(@account, @current_user.id) if !admin_signed_in?\n end",
"title": ""
},
{
"docid": "a8e5cea942abb2d768cb1a5e4d1a65d1",
"score": "0.6007221",
"text": "def admin\n self.sitemap\n self.follow('dtime:dashboard:admin')\n self.get\n self\n end",
"title": ""
},
{
"docid": "4ec588b9acd77a3fa717cf3009ef2a44",
"score": "0.5967072",
"text": "def get_admin()\n erb :\"#{here}/views/admin\"\n end",
"title": ""
},
{
"docid": "f7f1caf9d85778adea187acf5bb3e4f8",
"score": "0.5923021",
"text": "def admin_id\n 9\n end",
"title": ""
},
{
"docid": "d13fa3a7b5e4fc8907252ed86bbc5002",
"score": "0.59045863",
"text": "def admin_show\n @user = Admin.where(role_id: 1).order(name: :asc)\n add_breadcrumb 'utilisateurs', :parametre_admin_path\n add_breadcrumb 'administrateurs & décideurs', :parametre_admins_admin_show_path\n #render layout: 'fylo'\n render layout: 'views/index'\n end",
"title": ""
},
{
"docid": "5cc4c9bfd7cb0fc4abe139f62acaf2cf",
"score": "0.58951956",
"text": "def admin_user\n #redirect_to(root_url) unless\n current_user.admin || current_user.super_admin?# || top_layer_administrator\n end",
"title": ""
},
{
"docid": "9c6cfbba495aec10f988934f153138da",
"score": "0.58495444",
"text": "def index\n #displays session variable onto the console\n puts session[:current_user_id]\n # here we get the superadmin of the particular id\n @superadmin=Superadmin.first\n # we get moderators that belongs to that superadmins\n @moderators= @superadmin.moderators\n end",
"title": ""
},
{
"docid": "622c8412405df51dd7ae3d1b726be468",
"score": "0.5837978",
"text": "def admin_link\n admin_app_url(:host => CONSTANTS[:base_url_host], :offering => offering, :id => self)\n end",
"title": ""
},
{
"docid": "ba4bc30fd2542d1a9dd4c469b9e4eaa1",
"score": "0.5831891",
"text": "def show\n authorize! :read, @admin_system_admin\n end",
"title": ""
},
{
"docid": "dd62a00c34914b5805a62047aecc434d",
"score": "0.582593",
"text": "def show\n current_client == current_user\n unless current_user.admin?\n unless @client == current_user\n redirect_to :back, :alert => \"Access denied.\"\n end\n end\n\n end",
"title": ""
},
{
"docid": "6d66ed0644c9f4f2cdcf91990557c2ac",
"score": "0.5802367",
"text": "def username\n \"administrator\"\n end",
"title": ""
},
{
"docid": "1fa1da298eea57a41510f4b3b7d1faa9",
"score": "0.57899624",
"text": "def dashboard_admin\n @user = current_user\n @users = User.all\n @grid = AdminsGrid.new(params[:admins_grid]) do |scope|\n scope.page(params[:page]).per(10)\n end\n @index_path = request.path\n end",
"title": ""
},
{
"docid": "d93831d56909cd38ca8d7f17a0ab3152",
"score": "0.5789022",
"text": "def show\n @retaileradmin = Retaileradmin.find(params[:id])\n end",
"title": ""
},
{
"docid": "761418ea334010405ca9611c8ebead81",
"score": "0.5786932",
"text": "def admin_user\n redirect_to root_url, notice: \"You do not have permission to view or edit this information.\" unless current_user.admin?\n end",
"title": ""
},
{
"docid": "1a6d3386a9c37575d76ddcfc6332918a",
"score": "0.57850236",
"text": "def admin_xml(path,method=:get,options={})\n xml_message(amee_admin,\"/admin#{path}\",method,options)\n end",
"title": ""
},
{
"docid": "7372e16623a37cdf29ef12731c987ac3",
"score": "0.5781041",
"text": "def show_admins\r\n @admins_pages, @admins = paginate(:users, \r\n :conditions => ['level = 2'],\r\n :order => 'username') \r\n end",
"title": ""
},
{
"docid": "9f66150ea37b48a8cecd84ca80a82e77",
"score": "0.5768515",
"text": "def index\n if current_user.admin_group?\n @admin_user = current_user\n\n breadcrumbs.add I18n.t(\"helpers.titles.#{current_action}\", :model => Model_class.model_name.human), auth_assign_permits_path\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @admin_user }\n end\n end\n end",
"title": ""
},
{
"docid": "d1b5cb9f5edf655b244e0a7ea0250135",
"score": "0.5762739",
"text": "def show_details\n effective_sysadmin(@user, @role_limit)\n end",
"title": ""
},
{
"docid": "84f8cdf22f6dcc987f629a546d8407ab",
"score": "0.5755674",
"text": "def current_admin_user\n current_spree_user\n end",
"title": ""
},
{
"docid": "0c73a29d2f12903338692e086250c2ce",
"score": "0.5748034",
"text": "def show\n @admin = Admin.find_by(id: session[:admin_id])\n end",
"title": ""
},
{
"docid": "1aed4c3dacd01c11079397ddf1b57971",
"score": "0.573282",
"text": "def show\n @title = 'Users Management'\n @breadcrumb = 'Users > Show'\n end",
"title": ""
},
{
"docid": "3c7ae3b216e201ae44760202adfeb4d2",
"score": "0.57326126",
"text": "def admin\r\n unless session[ :admin ] || session[ :netid ] == Person.find_by_id( params[ :id ] ).netid\r\n flash[ :error ] = 'No access to ' + params[ :id ]\r\n\t if request.env[\"PATH_INFO\"]\r\n \tredirect_to '/login?previous_page=' + request.env[\"PATH_INFO\"] + '?' + request.env[ 'QUERY_STRING' ].gsub(/\\&/,'%26')\r\n\t else\r\n\t \tredirect_to '/login'\r\n\t end\r\n false\r\n end\r\n end",
"title": ""
},
{
"docid": "36ba29df32508d50a2a005aa6c8c3a57",
"score": "0.5726208",
"text": "def admin_person\n redirect_to(root_url) unless current_person.admin?\n end",
"title": ""
},
{
"docid": "36ba29df32508d50a2a005aa6c8c3a57",
"score": "0.5726208",
"text": "def admin_person\n redirect_to(root_url) unless current_person.admin?\n end",
"title": ""
},
{
"docid": "e6539b6f69ab33ffa4754fb3af1010c5",
"score": "0.57097024",
"text": "def admin_index\n return unless (user_is_allowed_to 'view', 'rets_properties') \n render :layout => 'caboose/admin' \n end",
"title": ""
},
{
"docid": "1abaad6ee95ce1350610f8ac0ab65542",
"score": "0.57065564",
"text": "def show\n isadmin\n end",
"title": ""
},
{
"docid": "b7970305a25ceeefffda2b1f3a28d4d8",
"score": "0.5689464",
"text": "def admin_user\n redirect_to(root_url) unless current_user.admin? # se current_user.admin for falso redireciona para pagina principal\n end",
"title": ""
},
{
"docid": "849a83116357fb13c8423f9dc1209a6e",
"score": "0.5684252",
"text": "def index\n render ('index') #render the admin_helpers view. The main page controller calls this action after the admin_helpers logs in\n end",
"title": ""
},
{
"docid": "70b507a16587ac016f0f713747fc4171",
"score": "0.56814986",
"text": "def admin_user\n\t\tredirect_to(root_url) unless current_user.admin? #NB il metodo \"admin?\" è stato aggiunto direttamente da Rails quando alla creazione ha visto che admin è un booleano\n\tend",
"title": ""
},
{
"docid": "2895d31a3958c1e0830f93670345398a",
"score": "0.56745976",
"text": "def current_user\n current_admin_user\n end",
"title": ""
},
{
"docid": "2895d31a3958c1e0830f93670345398a",
"score": "0.56745976",
"text": "def current_user\n current_admin_user\n end",
"title": ""
},
{
"docid": "1898c0210280f8d5e757828f09e58301",
"score": "0.56665915",
"text": "def user\n session[AutoAdmin::AutoAdminConfiguration.admin_model_id] ? AutoAdmin::AutoAdminConfiguration.admin_model.find(session[AutoAdmin::AutoAdminConfiguration.admin_model_id]) : nil\n end",
"title": ""
},
{
"docid": "e6ce6fbb8b02727d9e40376cbac6ead1",
"score": "0.56655514",
"text": "def admin(target = nil)\n raw \"ADMIN #{target}\".strip << \"\\r\\n\"\n end",
"title": ""
},
{
"docid": "6c47c609682db3dfdbfa2140208940f4",
"score": "0.56645507",
"text": "def admin\n\t\tauthenticate_user!\n\t if current_user.admin\n\t\t return\n\t else\n\t\t redirect_to root_url\n\t end\n\tend",
"title": ""
},
{
"docid": "41670400143f405e28be8f3dcadeaa71",
"score": "0.5660813",
"text": "def admin_user\n\t\t\tredirect_to(root_url) unless current_user.admin?\n\t end",
"title": ""
},
{
"docid": "24d9c8ec4463edaf7e1fedf9e7607eda",
"score": "0.56576556",
"text": "def admin_user\n\t\tunless admin? \n\t\t\tflash[:danger] = \"Only administrators have access to this page\"\n\t\t\tredirect_back_or(root_url) \n\t\tend\n\tend",
"title": ""
},
{
"docid": "014f506cac77f2b16237ba6827bffa16",
"score": "0.565003",
"text": "def show\n @admin_admin_user = Admin::AdminUser.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @admin_admin_user }\n end\n end",
"title": ""
},
{
"docid": "7bc6c03acf6defc46298492f35a77dfa",
"score": "0.5649198",
"text": "def show\n\t\t\tputs current_user.is_admin?\n\tend",
"title": ""
},
{
"docid": "99c55c810972c22014ba2931f990a572",
"score": "0.5648947",
"text": "def show\n\t\t@user = User.find_by_md5(params[:id])\n\t\t@admin = User.find(1)\n\t\tsignin_and_active(@user,@admin)\n\n\tend",
"title": ""
},
{
"docid": "d01e3e7e777ecd4097c2d7ba81166348",
"score": "0.5648905",
"text": "def admin(target = nil)\n send_data(\"ADMIN #{target}\".strip)\n end",
"title": ""
},
{
"docid": "b5d47e322bdfcb73335f805b09f9b465",
"score": "0.56459135",
"text": "def admin?\r\n infoxml = get_info\r\n return infoxml['isadmin'] == '1'\r\n end",
"title": ""
},
{
"docid": "25c7ddc8381592eb3195eb35ffb51dd5",
"score": "0.5635822",
"text": "def admin_user\n \t\tredirect_to(root_url) unless current_user.admin?\n \tend",
"title": ""
},
{
"docid": "200811046c3c75af5b7e7a42715eec40",
"score": "0.56242585",
"text": "def show\n #@auth_assign_permit = Auth::AssignPermit.find(params[:id])\n @owner_user = User.find(params[:id])\n if params[\"admin_group\"]\n if current_user.owner_users(params[\"admin_group\"]).include? @owner_user\n breadcrumbs.add I18n.t(\"helpers.titles.#{current_action}\", :model => Model_class.model_name.human), auth_assign_permit_path(@owner_user)\n end\n end\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @owner_user }\n end\n end",
"title": ""
},
{
"docid": "0e7033e7b87b7405195b26a7e32de4a1",
"score": "0.55976945",
"text": "def show\n @parent = Parent.find(params[:id])\n\n \t# check that the issuer of the request has both the username and ID, prevent attack\n \tif params[:login].gsub(/ /,'') != @parent.login.gsub(/ /,'')\n \tlog_attack \"parent show \" + params[:id] + \" : \" + params[:login] + \" - parent.login = \" + @parent.login \t\n \t\trespond_to do |format|\n \t\tformat.xml { render :xml => errorRsp( \"Security error, contact support\" ) }\n \t\t end\n \t\treturn\n \tend \n \t\n \t\n respond_to do |format|\n format.xml { render :xml => @parent }\n end\n end",
"title": ""
},
{
"docid": "7e9d5da990420d980524684e6e44d6ff",
"score": "0.55961096",
"text": "def owner\r\n\t\t\t`#{BITS::BITSADMIN} /getowner {#{@id}}`\r\n\t\tend",
"title": ""
},
{
"docid": "4e87039ea31ea73e366ba0e8fd29a71a",
"score": "0.5596087",
"text": "def members_login\r\n\t@title = \"Members Login\"\r\n end",
"title": ""
},
{
"docid": "e175f6a19b4e672bd85f71c8c39adfec",
"score": "0.5594697",
"text": "def show\n admin_only do\n end\n end",
"title": ""
},
{
"docid": "bc04bcf3143e3a9ae1f19d3352c13d70",
"score": "0.5586207",
"text": "def admin\n @attributes[:admin]\n end",
"title": ""
},
{
"docid": "e65fd8a44210c1b471bc14242fc7ec2d",
"score": "0.55808896",
"text": "def index\n if current_user.admin == 0\n @eleves_cu = @eleves.where(:user_id => current_user.id).all\n end\n end",
"title": ""
},
{
"docid": "eece8d532dd202c5e1ef86af6c98faf5",
"score": "0.55779845",
"text": "def show\n restrict 'allow only admins' or begin\n @admin = Admin.find_by_id(params[:id]) || current_user\n respond_to do |format|\n format.html # show.rhtml\n format.xml { render :xml => @admin.to_xml }\n end\n end\n end",
"title": ""
},
{
"docid": "eece8d532dd202c5e1ef86af6c98faf5",
"score": "0.55779845",
"text": "def show\n restrict 'allow only admins' or begin\n @admin = Admin.find_by_id(params[:id]) || current_user\n respond_to do |format|\n format.html # show.rhtml\n format.xml { render :xml => @admin.to_xml }\n end\n end\n end",
"title": ""
},
{
"docid": "3f797766a07f2eb15e34543e7d1bc9a4",
"score": "0.55763066",
"text": "def show\n if(@user.parent_id !=0 && @user.parent_id)\n @manager = User.find(@user.parent_id)\n end\n end",
"title": ""
},
{
"docid": "67f9748f0238cf68aec788847ea23a59",
"score": "0.55747676",
"text": "def admin_user\n unless admin_user?\n redirect_to login_url\n end\n end",
"title": ""
},
{
"docid": "4eafaeec45b93f588e78640da0c94e11",
"score": "0.5571148",
"text": "def index\n #if admin, \n # show all accounts\n # else\n \n @accounts = current_user.accounts\n \n end",
"title": ""
},
{
"docid": "d2a548e951c800f900f3cb074d0ab314",
"score": "0.5570817",
"text": "def show\n require_user()\n end",
"title": ""
},
{
"docid": "2b489614b6a555263bf4189574f04586",
"score": "0.55669725",
"text": "def show\n drop_breadcrumb(\"用户管理\",users_path)\n drop_page_title(\"用户详情\")\n drop_breadcrumb\n end",
"title": ""
},
{
"docid": "30cd72bda7fc6fef11d54d5f4d718132",
"score": "0.556544",
"text": "def index\n @admin = Admin.find_by(id: session[:admin_id])\n @admins = Admin.select_admins_to_show(@admin)\n end",
"title": ""
},
{
"docid": "ec227298db5483b6a27f0b16e3c0d414",
"score": "0.5560879",
"text": "def show\n @admin = Admin.find(params[:id])\n @admins = Admin.all\n end",
"title": ""
},
{
"docid": "06ba2ab5010cf1f1066f9978cf9a7e50",
"score": "0.55598634",
"text": "def admin_user\n\t\t\tredirect_to(root_url) unless current_user.admin?\n\t\tend",
"title": ""
},
{
"docid": "06ba2ab5010cf1f1066f9978cf9a7e50",
"score": "0.55598634",
"text": "def admin_user\n\t\t\tredirect_to(root_url) unless current_user.admin?\n\t\tend",
"title": ""
},
{
"docid": "b67a9b157b17600e88b5da953aac353d",
"score": "0.55540454",
"text": "def edit\n find_admin_by_id\n end",
"title": ""
},
{
"docid": "106eb0043a724a8232a703706267f7ee",
"score": "0.5548577",
"text": "def account_setup # GET 'admins#account_setup'\n authenticate_admin\n if @current_admin == nil\n redirect_to root_path\n end\n end",
"title": ""
},
{
"docid": "60d07911c614fe44956ae9dabc4bb8ce",
"score": "0.5548174",
"text": "def show\n redirect_to useradmin_members_path(params[:id])\n end",
"title": ""
},
{
"docid": "33e4d6b14d5472ec72de529c86b7c2f3",
"score": "0.5545262",
"text": "def search_admins\n unless @current_admin.is_super_admin\n flash[:error]=\"You are not authorized to navigate to this page \"\n redirect_to admin_index_path\n return\n end\n @sub_admin=Admin.new\n end",
"title": ""
},
{
"docid": "4834d7d6173639ce7fb3951028b6f48b",
"score": "0.5544599",
"text": "def index\n @title = \"Welcome to Pastr, #{request.env[\"REMOTE_USER\"]}.\"\n end",
"title": ""
},
{
"docid": "02dcf9763129c16bf941fe10a74f4090",
"score": "0.55398834",
"text": "def show\n is_admin?\n end",
"title": ""
},
{
"docid": "bc523873401591b24e731460cdad9673",
"score": "0.55392957",
"text": "def admin_user\n #redirect_to(root_url) unless\n current_user.admin?\n end",
"title": ""
},
{
"docid": "bc523873401591b24e731460cdad9673",
"score": "0.55392957",
"text": "def admin_user\n #redirect_to(root_url) unless\n current_user.admin?\n end",
"title": ""
},
{
"docid": "5fb9c76b6e3b3cad74ca628acfc26584",
"score": "0.5538531",
"text": "def show\n @user = User.where(params[:id])\n \n drop_breadcrumb(@user.name, admin_role_path(@user))\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @user }\n end\n end",
"title": ""
},
{
"docid": "111ab94ddf42b26378aa3724cae20a3a",
"score": "0.5532833",
"text": "def goto_author_feedbacks\n node_object = TreeFolder.find_by_name('Author Feedback')\n session[:root] = FolderNode.find_by_node_object_id(node_object.id).id\n redirect_to controller: 'tree_display', action: 'list'\n end",
"title": ""
},
{
"docid": "c233e605724e6bda95249842818add4b",
"score": "0.55289614",
"text": "def admin_user\n redirect_to(root_path) unless is_admin?\n end",
"title": ""
},
{
"docid": "55052b3eb71b6ad4070efef76492ae8f",
"score": "0.5524774",
"text": "def current_user\n current_admin\n end",
"title": ""
},
{
"docid": "28edef705be12646539625f196b5338c",
"score": "0.55240184",
"text": "def show\n is_admin?\n end",
"title": ""
},
{
"docid": "5bed3a693bbd04ffb43bd7515f70780e",
"score": "0.55226445",
"text": "def remote_user\n frontend.remote_user\n end",
"title": ""
},
{
"docid": "91082078fb933609f4f7e30010b53ae8",
"score": "0.5519182",
"text": "def show\n admin_only\n end",
"title": ""
},
{
"docid": "91082078fb933609f4f7e30010b53ae8",
"score": "0.5519182",
"text": "def show\n admin_only\n end",
"title": ""
},
{
"docid": "91082078fb933609f4f7e30010b53ae8",
"score": "0.5519182",
"text": "def show\n admin_only\n end",
"title": ""
},
{
"docid": "1f4fe21e8c65f788435792e46dcb41a1",
"score": "0.55184275",
"text": "def admin_user\n\t\tredirect_to(root_url) unless current_user.admin?\n\tend",
"title": ""
},
{
"docid": "1f4fe21e8c65f788435792e46dcb41a1",
"score": "0.55184275",
"text": "def admin_user\n\t\tredirect_to(root_url) unless current_user.admin?\n\tend",
"title": ""
},
{
"docid": "1f4fe21e8c65f788435792e46dcb41a1",
"score": "0.55184275",
"text": "def admin_user\n\t\tredirect_to(root_url) unless current_user.admin?\n\tend",
"title": ""
}
] |
44a8ceed87759deb1c5b978051c7c717 | Never trust parameters from the scary internet | [
{
"docid": "05f488b59593c3742ca2bf3a8112c759",
"score": "0.0",
"text": "def survey_assignment_params\n params.require(:survey_assignment)\n .permit(:survey_id, :send_before, :send_date_relative_to,\n :send_date_days, :courses_user_role, :published,\n :follow_up_days_after_first_notification, :send_email,\n :notes, :email_template, campaign_ids: [])\n end",
"title": ""
}
] | [
{
"docid": "18afb42e150844bd18f1e85299b3d366",
"score": "0.6356325",
"text": "def magic_params_not_truly_understood\n \"timekey=1&custom_search=0\"\n end",
"title": ""
},
{
"docid": "da6c876ecbcaca1e732b80b99d350d30",
"score": "0.63462347",
"text": "def query_string_ignore; end",
"title": ""
},
{
"docid": "3c39d545f1af86e519f83831715e473c",
"score": "0.632924",
"text": "def query_parameters; end",
"title": ""
},
{
"docid": "4bd3ca9051bd14a38081c2a545afc3b3",
"score": "0.62407076",
"text": "def trust_input; end",
"title": ""
},
{
"docid": "df3eadedb85fd314e598bc447d0e3092",
"score": "0.6225432",
"text": "def query_string_ignore=(_arg0); end",
"title": ""
},
{
"docid": "17b5cf96637f1e06fed167a5e3f019df",
"score": "0.615386",
"text": "def httponly=(_arg0); end",
"title": ""
},
{
"docid": "11aab8e9695616c3412a5a75cdcaf0f8",
"score": "0.61039084",
"text": "def request_params; end",
"title": ""
},
{
"docid": "11aab8e9695616c3412a5a75cdcaf0f8",
"score": "0.61039084",
"text": "def request_params; end",
"title": ""
},
{
"docid": "13375ecab781ad3c87e987814c5311ad",
"score": "0.60658884",
"text": "def request_parameters; end",
"title": ""
},
{
"docid": "6008e8707eafce375988b3c7ccf098c3",
"score": "0.6018842",
"text": "def original_params; end",
"title": ""
},
{
"docid": "6de7a6312ec21facc1b0624653596a86",
"score": "0.601178",
"text": "def query_parameters\n end",
"title": ""
},
{
"docid": "18258908649263e22022f27f0275cfb8",
"score": "0.59930074",
"text": "def request_params=(_arg0); end",
"title": ""
},
{
"docid": "17f4a82985988162eedbc0446dca88f7",
"score": "0.5990617",
"text": "def raw_params(auth); end",
"title": ""
},
{
"docid": "257c231996f7890b0847a9d6caedbb80",
"score": "0.5966327",
"text": "def httponly; end",
"title": ""
},
{
"docid": "77f5795d1b9e0d0cbd4ea67d02b5ab7f",
"score": "0.5940835",
"text": "def safe_params\n params.except(:host, :port, :protocol).permit!\n end",
"title": ""
},
{
"docid": "d497f151d55b83d6497abcd6e74112e6",
"score": "0.5927209",
"text": "def params\n raise Dzl::NYI\n end",
"title": ""
},
{
"docid": "f4fe4701c4ee9927b368879ccde657d7",
"score": "0.59201413",
"text": "def query_string; end",
"title": ""
},
{
"docid": "f4fe4701c4ee9927b368879ccde657d7",
"score": "0.59201413",
"text": "def query_string; end",
"title": ""
},
{
"docid": "f4fe4701c4ee9927b368879ccde657d7",
"score": "0.59201413",
"text": "def query_string; end",
"title": ""
},
{
"docid": "7402112b5e653d343b91b6d38c203c59",
"score": "0.58774334",
"text": "def params; end",
"title": ""
},
{
"docid": "7402112b5e653d343b91b6d38c203c59",
"score": "0.58774334",
"text": "def params; end",
"title": ""
},
{
"docid": "7402112b5e653d343b91b6d38c203c59",
"score": "0.5876203",
"text": "def params; end",
"title": ""
},
{
"docid": "7402112b5e653d343b91b6d38c203c59",
"score": "0.5876203",
"text": "def params; end",
"title": ""
},
{
"docid": "7402112b5e653d343b91b6d38c203c59",
"score": "0.5876203",
"text": "def params; end",
"title": ""
},
{
"docid": "7402112b5e653d343b91b6d38c203c59",
"score": "0.5876203",
"text": "def params; end",
"title": ""
},
{
"docid": "7402112b5e653d343b91b6d38c203c59",
"score": "0.5876203",
"text": "def params; end",
"title": ""
},
{
"docid": "7402112b5e653d343b91b6d38c203c59",
"score": "0.5876203",
"text": "def params; end",
"title": ""
},
{
"docid": "7402112b5e653d343b91b6d38c203c59",
"score": "0.5876203",
"text": "def params; end",
"title": ""
},
{
"docid": "7402112b5e653d343b91b6d38c203c59",
"score": "0.5876203",
"text": "def params; end",
"title": ""
},
{
"docid": "7402112b5e653d343b91b6d38c203c59",
"score": "0.5876203",
"text": "def params; end",
"title": ""
},
{
"docid": "7402112b5e653d343b91b6d38c203c59",
"score": "0.5876203",
"text": "def params; end",
"title": ""
},
{
"docid": "7402112b5e653d343b91b6d38c203c59",
"score": "0.5876203",
"text": "def params; end",
"title": ""
},
{
"docid": "7402112b5e653d343b91b6d38c203c59",
"score": "0.5876203",
"text": "def params; end",
"title": ""
},
{
"docid": "7402112b5e653d343b91b6d38c203c59",
"score": "0.5876203",
"text": "def params; end",
"title": ""
},
{
"docid": "7402112b5e653d343b91b6d38c203c59",
"score": "0.5876203",
"text": "def params; end",
"title": ""
},
{
"docid": "7402112b5e653d343b91b6d38c203c59",
"score": "0.5876203",
"text": "def params; end",
"title": ""
},
{
"docid": "7402112b5e653d343b91b6d38c203c59",
"score": "0.5876203",
"text": "def params; end",
"title": ""
},
{
"docid": "7402112b5e653d343b91b6d38c203c59",
"score": "0.5876203",
"text": "def params; end",
"title": ""
},
{
"docid": "7402112b5e653d343b91b6d38c203c59",
"score": "0.5876203",
"text": "def params; end",
"title": ""
},
{
"docid": "7402112b5e653d343b91b6d38c203c59",
"score": "0.5876203",
"text": "def params; end",
"title": ""
},
{
"docid": "d85238c393386bfc12d89dd8351415e5",
"score": "0.58372724",
"text": "def ssl_params; end",
"title": ""
},
{
"docid": "e533d3f339dd4af414772f63b3225cc7",
"score": "0.5823517",
"text": "def params; {}; end",
"title": ""
},
{
"docid": "e533d3f339dd4af414772f63b3225cc7",
"score": "0.5823517",
"text": "def params; {}; end",
"title": ""
},
{
"docid": "62ea8792dac3d7936bc4ba4054c87370",
"score": "0.58056515",
"text": "def build_param_string\n # @request_param_string ||= @request_params.collect { |key, value| \"#{key}=#{value}\" }.join('&')\n ga = @request_params_hash\n @request_params_string = 'http://' + URI_HOST +\n URI_EMBED_PATH +\n \"country=#{ga[:country]}&state=#{ga[:state]}&county=#{ga[:county]}&locality=#{ga[:locality]}&points=\" +\n \"#{ga[:Latitude]}|#{ga[:Longitude]}|#{ga[:Placename]}|#{ga[:Score]}|#{ga[:Uncertainty]}\" +\n \"&georef=run|#{ga[:H20]}|#{ga[:HwyX]}|#{ga[:Uncert]}|#{ga[:Poly]}|#{ga[:DisplacePoly]}|\" +\n \"#{ga[:RestrictAdmin]}|#{ga[:BG]}|#{ga[:LanguageIndex]}\" +\n \"&gc=#{ga[:gc]}\"\n end",
"title": ""
},
{
"docid": "a9c7a26321aece97177c8759acb05ab5",
"score": "0.5785191",
"text": "def params() request.params end",
"title": ""
},
{
"docid": "b395a9e11a9636906b3fcad148bfc0d1",
"score": "0.5781408",
"text": "def skip_parameter_encoding(action); end",
"title": ""
},
{
"docid": "46fd8eda8df01af425087c1f4001f104",
"score": "0.57613254",
"text": "def sec_params; [] end",
"title": ""
},
{
"docid": "16045153acbe8ca9c0c9eb010a0258fb",
"score": "0.5747945",
"text": "def query_string=(_arg0); end",
"title": ""
},
{
"docid": "16045153acbe8ca9c0c9eb010a0258fb",
"score": "0.5747945",
"text": "def query_string=(_arg0); end",
"title": ""
},
{
"docid": "ad422be035447f679fd4b98a865b33fa",
"score": "0.5728551",
"text": "def encode_parameters(params); end",
"title": ""
},
{
"docid": "17cdd09057550bc0c84c1d753341e2c2",
"score": "0.5716234",
"text": "def httponly?; end",
"title": ""
},
{
"docid": "a3dc8b6db1e6584a8305a96ebb06ad21",
"score": "0.57141334",
"text": "def need_params\n end",
"title": ""
},
{
"docid": "fc43ee8cb2466a60d4a69a04461c601a",
"score": "0.57049084",
"text": "def check_params; true; end",
"title": ""
},
{
"docid": "fc43ee8cb2466a60d4a69a04461c601a",
"score": "0.57049084",
"text": "def check_params; true; end",
"title": ""
},
{
"docid": "d776711817bf6bc1f145594060bfb5e1",
"score": "0.5689096",
"text": "def parameters; end",
"title": ""
},
{
"docid": "d776711817bf6bc1f145594060bfb5e1",
"score": "0.5689096",
"text": "def parameters; end",
"title": ""
},
{
"docid": "d776711817bf6bc1f145594060bfb5e1",
"score": "0.5689096",
"text": "def parameters; end",
"title": ""
},
{
"docid": "d776711817bf6bc1f145594060bfb5e1",
"score": "0.5689096",
"text": "def parameters; end",
"title": ""
},
{
"docid": "d776711817bf6bc1f145594060bfb5e1",
"score": "0.5689096",
"text": "def parameters; end",
"title": ""
},
{
"docid": "d776711817bf6bc1f145594060bfb5e1",
"score": "0.5689096",
"text": "def parameters; end",
"title": ""
},
{
"docid": "d776711817bf6bc1f145594060bfb5e1",
"score": "0.5689096",
"text": "def parameters; end",
"title": ""
},
{
"docid": "d776711817bf6bc1f145594060bfb5e1",
"score": "0.5689096",
"text": "def parameters; end",
"title": ""
},
{
"docid": "d776711817bf6bc1f145594060bfb5e1",
"score": "0.5689096",
"text": "def parameters; end",
"title": ""
},
{
"docid": "a85da61a1cb5fdbb7a31c4e065bcc785",
"score": "0.56881505",
"text": "def http_parameter_in_favourite_for_params\n\t\tx= \"\"\n\t\t@parameters.each { |k,v| x << \"#{k}=#{v}&\" if v.present? } if @parameters.present?\n\t\tx\n\tend",
"title": ""
},
{
"docid": "4cbc667688d124aa3bafb113a052e560",
"score": "0.567287",
"text": "def url_params params\n '?' + URI.encode(params.collect{ |key, value| \"#{key}=#{value}\"}.join('&')) unless params.empty? \n end",
"title": ""
},
{
"docid": "ad3d654f7a6a56f11395971429a90531",
"score": "0.5669607",
"text": "def normalize_encode_params(params); end",
"title": ""
},
{
"docid": "5784a22c378c0da2ce360008f4cad112",
"score": "0.56548625",
"text": "def common_parameters\n {\n :format => :json,\n :key => ExpediaApi.api_key\n }\n end",
"title": ""
},
{
"docid": "8fa507ebc4288c14857ace21acf54c26",
"score": "0.5646859",
"text": "def strong_params\n # to dooo\n end",
"title": ""
},
{
"docid": "bd826c318f811361676f5282a9256071",
"score": "0.5644841",
"text": "def filter_parameters; end",
"title": ""
},
{
"docid": "821c32ece28e6bac3d394b0d7056bc4b",
"score": "0.56438655",
"text": "def params; request.params; end",
"title": ""
},
{
"docid": "821c32ece28e6bac3d394b0d7056bc4b",
"score": "0.56438655",
"text": "def params; request.params; end",
"title": ""
},
{
"docid": "4dca9d0e8d2b7ae7871144ff5c8c469c",
"score": "0.5639051",
"text": "def params=(_); end",
"title": ""
},
{
"docid": "4dca9d0e8d2b7ae7871144ff5c8c469c",
"score": "0.5639051",
"text": "def params=(_); end",
"title": ""
},
{
"docid": "4dca9d0e8d2b7ae7871144ff5c8c469c",
"score": "0.5639051",
"text": "def params=(_); end",
"title": ""
},
{
"docid": "59c0de61300d238be54c8177d75f626c",
"score": "0.56351227",
"text": "def shorten_params\n params.permit :longUrl\n end",
"title": ""
},
{
"docid": "1051b4381524750ed16573cb2a5de819",
"score": "0.56324005",
"text": "def set_params(easy)\n params.escape = true\n base_url, base_params = url.split(\"?\")\n base_params += \"&\" if base_params\n easy.url = \"#{base_url}?#{base_params}#{params.to_s}\"\n end",
"title": ""
},
{
"docid": "3e0f979898154265a832d1d1c9612156",
"score": "0.5616554",
"text": "def clean_params(params); end",
"title": ""
},
{
"docid": "60a32cf4c1c461f4b2660e16b6964919",
"score": "0.5611912",
"text": "def secure_params(hash)\n\t\t\t\thash\t\n\t\t\tend",
"title": ""
},
{
"docid": "05fbd70e72d49271579df13657463c8e",
"score": "0.56074506",
"text": "def unsafe_params\n @unsafe_params ||= params.to_unsafe_h\n end",
"title": ""
},
{
"docid": "bc8e1e239aa61c094f4017dc8ec3dde4",
"score": "0.55973566",
"text": "def query_string\n end",
"title": ""
},
{
"docid": "c0a529ea6d62ca5afd8bcf155c6211b9",
"score": "0.5596976",
"text": "def common_parameters\n { :cid => Expedia.cid, :sig => signature, :apiKey => Expedia.api_key, :minorRev => Expedia.minor_rev,\n :_type => 'json', :locale => Expedia.locale, :currencyCode => Expedia.currency_code }\n end",
"title": ""
},
{
"docid": "ed89cffe2dbd6a98725a73fc189dcfb9",
"score": "0.5562681",
"text": "def build_exclusive_url(url = T.unsafe(nil), params = T.unsafe(nil), params_encoder = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "ed89cffe2dbd6a98725a73fc189dcfb9",
"score": "0.5562681",
"text": "def build_exclusive_url(url = T.unsafe(nil), params = T.unsafe(nil), params_encoder = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "47df65c9eeab3c8de00f522c164be65f",
"score": "0.55576104",
"text": "def sanitized_query_string(inline_variables: T.unsafe(nil)); end",
"title": ""
},
{
"docid": "feab628add85f3ce23dbe4b8be520231",
"score": "0.5525622",
"text": "def preflight\n end",
"title": ""
},
{
"docid": "31c62d642d37795a9fe26bbdaead7ba0",
"score": "0.55238205",
"text": "def query_string\n\t\t\tURI.encode_www_form(@params)\n\t\tend",
"title": ""
},
{
"docid": "0812ac0baec42937f68895fbbe182710",
"score": "0.55211484",
"text": "def params(*) end",
"title": ""
},
{
"docid": "0812ac0baec42937f68895fbbe182710",
"score": "0.55211484",
"text": "def params(*) end",
"title": ""
},
{
"docid": "0812ac0baec42937f68895fbbe182710",
"score": "0.55211484",
"text": "def params(*) end",
"title": ""
},
{
"docid": "0812ac0baec42937f68895fbbe182710",
"score": "0.55211484",
"text": "def params(*) end",
"title": ""
},
{
"docid": "ebef11bbc97edeccd34658fe0d4393a9",
"score": "0.55155224",
"text": "def mechanic_params\n\n end",
"title": ""
},
{
"docid": "7a68714ad4aef7f9c025ff0c09f799e5",
"score": "0.5515061",
"text": "def Params(requireds, optionals, rest, posts, keywords, keyword_rest, block); end",
"title": ""
},
{
"docid": "c436017f4e8bd819f3d933587dfa070a",
"score": "0.5508819",
"text": "def filtered_parameters; end",
"title": ""
},
{
"docid": "04221d95c31ba5b864c365d1a88b8286",
"score": "0.5508053",
"text": "def url=(_arg0); end",
"title": ""
},
{
"docid": "04221d95c31ba5b864c365d1a88b8286",
"score": "0.5508053",
"text": "def url=(_arg0); end",
"title": ""
},
{
"docid": "04221d95c31ba5b864c365d1a88b8286",
"score": "0.5508053",
"text": "def url=(_arg0); end",
"title": ""
},
{
"docid": "04221d95c31ba5b864c365d1a88b8286",
"score": "0.5508053",
"text": "def url=(_arg0); end",
"title": ""
},
{
"docid": "c69e886f9e0060d69a904eadb3cb93de",
"score": "0.55073386",
"text": "def generate_params\n\t\t\tparams.require(:actual_url)\n\t\tend",
"title": ""
},
{
"docid": "334bb199d0fe27321b245dfaaf18fefb",
"score": "0.5493584",
"text": "def required_parameters\n params = \"apiKey=#{CGI.escape(@@api_key)}\"\n params += \"&secret=#{CGI.escape(@@api_secret)}\"\n params += \"&format=json\"\n end",
"title": ""
},
{
"docid": "ece4e5a0b1abc33d6bafdf3efff7d7c8",
"score": "0.54702795",
"text": "def init_api (p)\n\t\ttoken = \"IP\"\n\t \tpassage = URI::encode(p)\n\t \toptions = [\"output-format=html\"].join(\"&\")\n\t \turl = URI.parse(\"http://www.esvapi.org/v2/rest/passageQuery?key=#{token}&passage=#{passage}&#{options}\")\n\t \treq = Net::HTTP::Get.new(url.to_s)\n\t\tNet::HTTP.start(url.host, url.port) {|http|\n\t\t http.request(req)\n\t\t}\n\tend",
"title": ""
},
{
"docid": "74b5f5f78d03a31b8198064607200cb3",
"score": "0.5468066",
"text": "def prepare_parameters(params)\n # S_Sh I kill you!\n no_p = params[:no_publish].to_s\n no_s = params[:no_show].to_s\n params[:no_publish] = no_p == 'on' || no_p == '1' ? 1 : 0\n params[:no_show] = no_s == 'on' || no_s == '1' ? 1 : 0\n params\n end",
"title": ""
}
] |
58aa81f219e0a96ac5e60eb98b67d927 | Delete the specified option. Just a shortcut for settings.set(:name, nil). | [
{
"docid": "60e61822f80ed821cecb536111a73c16",
"score": "0.6280896",
"text": "def remove(name)\n set(name, nil)\n end",
"title": ""
}
] | [
{
"docid": "d230f7e31193ea84fc9d187b79be3de2",
"score": "0.77402306",
"text": "def delete_option(name)\n if option = options(:reload).find_by_name(name.to_s)\n option = option.destroy\n options(:reload)\n option\n end\n end",
"title": ""
},
{
"docid": "fb7cd4a0ef198bd74affd851bc22ea58",
"score": "0.7408975",
"text": "def del_option(*args)\n # Extract function options\n as_object = args.extract_options![:as_object]\n name = args[0]\n # Delete option\n if self.check_option_name(name)\n option = self.where(:name => name).first\n as_object ? option.destroy : option.destroy.value if option\n end\n end",
"title": ""
},
{
"docid": "3b5086f917d1f2b070106ff8055b9e83",
"score": "0.7002959",
"text": "def force_delete\n key = OPTION_PARAMETER_MAP[__method__]\n parameter_setting(key)\n end",
"title": ""
},
{
"docid": "3b5086f917d1f2b070106ff8055b9e83",
"score": "0.7002959",
"text": "def force_delete\n key = OPTION_PARAMETER_MAP[__method__]\n parameter_setting(key)\n end",
"title": ""
},
{
"docid": "c470b70abf19d8900b5ed3d102a90aa2",
"score": "0.6913127",
"text": "def delete(name, options = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "c470b70abf19d8900b5ed3d102a90aa2",
"score": "0.6913127",
"text": "def delete(name, options = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "5523e67d2824cea58d1ff4f6c7047fa7",
"score": "0.6726308",
"text": "def remove_option(name=nil)\n if name.class == String && !block_given?\n @j_del.java_method(:removeOption, [Java::java.lang.String.java_class]).call(name)\n return self\n end\n raise ArgumentError, \"Invalid arguments when calling remove_option(name)\"\n end",
"title": ""
},
{
"docid": "3929b7f703a8df614df9d86430f8f6fa",
"score": "0.67035264",
"text": "def remove_option\n end",
"title": ""
},
{
"docid": "240bc0d658e8e6014ae73e9239b4fda4",
"score": "0.6686529",
"text": "def delete(setting)\n record.unset(setting)\n end",
"title": ""
},
{
"docid": "8f75d63031723725e5b04c832593ebd6",
"score": "0.66728497",
"text": "def delete!\n opts = {:option_id => self.option_id}\n Twocheckout::API.request(:post, 'products/delete_option', opts)\n end",
"title": ""
},
{
"docid": "dace9a4b9718829644dfccccf1618498",
"score": "0.6668515",
"text": "def delete(options = {})\n self.class.delete(name, options)\n end",
"title": ""
},
{
"docid": "04646c7333005166e1be815e8ed23e11",
"score": "0.66645575",
"text": "def delete_options\r\n @options = {}\r\n end",
"title": ""
},
{
"docid": "1ad880db13129ab3f3de47d93def4911",
"score": "0.66235334",
"text": "def delete_option(option_id)\n client.delete(\"/customFields/#{id}/options/#{option_id}\")\n end",
"title": ""
},
{
"docid": "31e30644edd1df9ee952e3da7a0c9153",
"score": "0.6614754",
"text": "def destroy\n @option.destroy\n\n head :no_content\n end",
"title": ""
},
{
"docid": "c7e57d408b4d3cf0a043045c6939f79b",
"score": "0.660563",
"text": "def delete_option()\n\n @raw.json_hash[\"Animals\"][@ani][\"Habitats\"][@hab][\"Menus\"][@menu][\"Options\"].tap do |options|\n options.delete(@opt)\n end\n\n json_prune()\n\n end",
"title": ""
},
{
"docid": "8347d17eacc605dd2aa82370a62eed30",
"score": "0.6596851",
"text": "def remove_option(name)\n @option_list.reject! { |args, handler| args.any? { |x| x =~ /^#{name}/ } }\n end",
"title": ""
},
{
"docid": "8be8b48c019639eb3aa97628407229c6",
"score": "0.65948683",
"text": "def emergency_delete\n key = OPTION_PARAMETER_MAP[__method__]\n parameter_setting(key)\n end",
"title": ""
},
{
"docid": "8be8b48c019639eb3aa97628407229c6",
"score": "0.65948683",
"text": "def emergency_delete\n key = OPTION_PARAMETER_MAP[__method__]\n parameter_setting(key)\n end",
"title": ""
},
{
"docid": "b247773dd3ac6c3cc74ab40d08fcd939",
"score": "0.658021",
"text": "def destroy\n @property_hash[:ensure] = :absent\n # Destroy not an option for now. LSP Settings should be set to something.\n # we need some default destroy values in the mappings so we know ahead of time what to put unless the user supplies\n # but this would just ensure a value the setting should go back to\n end",
"title": ""
},
{
"docid": "27760790f6f031aefa6d413b246ad4bf",
"score": "0.65476614",
"text": "def truncate_delete\n key = OPTION_PARAMETER_MAP[__method__]\n parameter_setting(key)\n end",
"title": ""
},
{
"docid": "27760790f6f031aefa6d413b246ad4bf",
"score": "0.65476614",
"text": "def truncate_delete\n key = OPTION_PARAMETER_MAP[__method__]\n parameter_setting(key)\n end",
"title": ""
},
{
"docid": "54701ec780fd1c38208c3991abb4e68b",
"score": "0.650728",
"text": "def remove_option(*args)\n commit(\"removeOption\", *args)\n end",
"title": ""
},
{
"docid": "a3615187eef8a43d23651762b3000159",
"score": "0.6458122",
"text": "def unset(name, allow_recursion=true)\n if(@settings[name].nil?)\n if(!allow_recursion)\n raise(Settings::ValidationError, \"No such setting!\")\n end\n\n return Settings::GLOBAL.unset(name)\n end\n\n set(name, @settings[name][:default].to_s(), allow_recursion)\n end",
"title": ""
},
{
"docid": "0a6ca62bd5e934b0421cf65ca81f65cb",
"score": "0.6444293",
"text": "def delete_options slist, kind, err = true\n raise \"@options not yet initialized (call setup to do that)\" if\n !defined? @options\n @options.delete slist, kind, err\n end",
"title": ""
},
{
"docid": "e49c01e0f7906143ddd9a02e9d9429e5",
"score": "0.6404597",
"text": "def destroy *_\n @option = users_options.find(params[:id])\n @option.destroy\n\n head :no_content\n end",
"title": ""
},
{
"docid": "bd6dccbe70af38e03fd048be43886b3f",
"score": "0.6368619",
"text": "def delete(name)\n configure(\"no username #{name}\")\n end",
"title": ""
},
{
"docid": "494a10927df2ad92d2f0e3a59e6fe9b3",
"score": "0.6349052",
"text": "def delete(name)\n configure(\"no alias #{name}\")\n end",
"title": ""
},
{
"docid": "230c56000dd73a9e153593b112fb13ad",
"score": "0.6326146",
"text": "def deregister_options(*names)\n names.each { |name|\n real_name = self.datastore.find_key_case(name)\n self.datastore.delete(name)\n self.options.remove_option(name)\n if real_name != name\n self.options.remove_option(real_name)\n end\n }\n end",
"title": ""
},
{
"docid": "516242ea833aa54dec46fee9eee1760f",
"score": "0.6313759",
"text": "def unset(key)\n @settings.delete(key)\n end",
"title": ""
},
{
"docid": "38fcd65798d4ea8ff8994ceaa742e358",
"score": "0.6312529",
"text": "def delete!(options = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "88675e66560706d3c2e8839454d21d2f",
"score": "0.6301739",
"text": "def delete(preference)\n preferences.delete(preference.to_sym)\n save!\n end",
"title": ""
},
{
"docid": "e195f70d79b1fbf2ac0b8fb95ea6a346",
"score": "0.62984085",
"text": "def delete! key = nil\n if key.nil?\n @fields.clear\n else\n key = key.to_sym\n unless @fields.key? key\n raise ArgumentError, \"Key #{key.inspect} does not exist\"\n end\n field = @fields.delete key\n singleton_class.send :remove_method, :\"#{key}\"\n singleton_class.send :remove_method, :\"#{key}=\" if field.is_a? Option\n end\n self\n end",
"title": ""
},
{
"docid": "26f5e8d3dbf21ca565d9f7b383fdb438",
"score": "0.62772036",
"text": "def delete(name, options = nil)\n options = merged_options(options)\n\n instrument(:delete, name) do\n delete_entry(normalize_key(name, options), options)\n end\n end",
"title": ""
},
{
"docid": "1017ad6910839f53326eb3d3cddc7b9d",
"score": "0.6232463",
"text": "def removed_option!(old_option_name)\n raise ArgumentError, \":#{old_option_name} is no longer available\" if options.key?(old_option_name)\n end",
"title": ""
},
{
"docid": "6d8b4e134bba20b84d5bec385d466424",
"score": "0.6207085",
"text": "def delete; Setting.without_default_scope{ super } end",
"title": ""
},
{
"docid": "08ecde5808584f679d8b38d1bc10b3a6",
"score": "0.6163386",
"text": "def remove_option(variant_field_option)\n variant_field_option.mark_for_destruction\n end",
"title": ""
},
{
"docid": "a09c16caf464e7b2eabdb8e28917d658",
"score": "0.61581975",
"text": "def delete(name = nil, options = {})\n Base.delete(path(name)).success?\n end",
"title": ""
},
{
"docid": "87bcf4fb75c8951351bad269b27de6b9",
"score": "0.6146021",
"text": "def delete *args; Setting.unscoped{ super } end",
"title": ""
},
{
"docid": "4bb9997d436a9e45c8c42df293634ab4",
"score": "0.61314183",
"text": "def destroy\n @option = @options.find(params[:id])\n @option.destroy\n\n respond_to do |format|\n format.html { redirect_to options_url }\n end\n end",
"title": ""
},
{
"docid": "63284adf972136cc29e9b09be359de26",
"score": "0.6131381",
"text": "def destroy\n @opt = Opt.find(params[:id])\n @opt.destroy\n\n respond_to do |format|\n format.html { redirect_to opts_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "2f634b644339d7673f3516f04aa39d1d",
"score": "0.61200464",
"text": "def delete(name, options = nil)\n options = merged_options(options)\n\n instrument(:delete, name) do\n delete_entry(namespaced_key(name, options), options)\n end\n end",
"title": ""
},
{
"docid": "463dfc403bf73affb0d498e7177b12d2",
"score": "0.6110616",
"text": "def delete(name, options = nil)\n super\n @cache.delete name\n end",
"title": ""
},
{
"docid": "1425dc1c4e0b2ee3c53539d5e661a3e7",
"score": "0.61008507",
"text": "def unset ( var )\n @settings << [ :unset, var ]\n end",
"title": ""
},
{
"docid": "72ff875aed3d447dc1d3246fc42e2c14",
"score": "0.60928655",
"text": "def delete(name)\n attr = self[name]\n self[name] = nil\n attr\n end",
"title": ""
},
{
"docid": "8951dbbe3cc369aff7aa5c0bd1bc6199",
"score": "0.6089748",
"text": "def delete(name = nil, options = {})\n find(name).delete_all if options[:force]\n \n name = path(name)\n Base.delete(name).success?\n end",
"title": ""
},
{
"docid": "25ddeb269ffb5de9388ccf449521e9eb",
"score": "0.60758305",
"text": "def destroy\n @option = Option.find(params[:id])\n option_type = @option.option_type\n @option.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_options_url(:option_type => option_type) }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "ddb053f71acf49f4569642cff77c0494",
"score": "0.6070755",
"text": "def destroy\n @option = Option.find(params[:id])\n @option.destroy\n\n respond_to do |format|\n format.html { redirect_to(options_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "ddb053f71acf49f4569642cff77c0494",
"score": "0.607033",
"text": "def destroy\n @option = Option.find(params[:id])\n @option.destroy\n\n respond_to do |format|\n format.html { redirect_to(options_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "5d854f89ec311fcdae56d1ada44aa357",
"score": "0.6060628",
"text": "def destroy\n @option = Option.find(params[:id])\n @option.destroy\n\n respond_to do |format|\n format.html { redirect_to options_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "f6d6f0417f2f4ed0d114a751f9a8b82d",
"score": "0.6059596",
"text": "def delete_cookie(name, options=\"\")\n if options.kind_of? Hash\n\t\t ordered_keys = options.keys.sort {|a,b| a.to_s <=> b.to_s }\n\t\t options = ordered_keys.collect {|key| \"#{key}=#{options[key]}\" }.join(\", \")\n end\n remote_control_command \"deleteCookie\", [name,options,]\n end",
"title": ""
},
{
"docid": "f8cc0d671c4686160dc167d90413eeb3",
"score": "0.6023624",
"text": "def delete(key)\n @config.delete key.to_sym\n end",
"title": ""
},
{
"docid": "3b2a5fd1103080fbd31621f7e66d2159",
"score": "0.6018423",
"text": "def delete_cookie(name,optionsString)\n do_command(\"deleteCookie\", [name,optionsString,])\n end",
"title": ""
},
{
"docid": "73904d0534fc63a2ba41f53817575dce",
"score": "0.6017272",
"text": "def uhook_destroy_ubiquo_setting(ubiquo_setting)\n ubiquo_setting.destroy\n end",
"title": ""
},
{
"docid": "9cdc8af27b3a7b1e77233c64f82f708d",
"score": "0.6009707",
"text": "def clear_options\n @options = nil\n end",
"title": ""
},
{
"docid": "9cdc8af27b3a7b1e77233c64f82f708d",
"score": "0.6009707",
"text": "def clear_options\n @options = nil\n end",
"title": ""
},
{
"docid": "b6defc1cae95703a1c6fc7d2634885ae",
"score": "0.5997547",
"text": "def destroy(var_name)\n var_name = var_name.to_s\n obj = object(var_name)\n raise SettingNotFound, \"Setting variable \\\"#{var_name}\\\" not found\" if obj.nil?\n\n obj.destroy\n true\n end",
"title": ""
},
{
"docid": "c8d7fa93a13ac0c16387cbe34fd12b4e",
"score": "0.5989024",
"text": "def delete(name, _options = {})\n exec(\"delete\", c: name, p: port)\n end",
"title": ""
},
{
"docid": "74a61d7a847108d1569ea54211af27cc",
"score": "0.5988882",
"text": "def destroy\n @setting = @user.setting.find(params[:id])\n @setting.destroy\n\n respond_to do |format|\n format.html { redirect_to settings_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "631a0e497cc66936ca86d8ee1e15a764",
"score": "0.59831417",
"text": "def set_option(option, value)\n if @@all_options.include?(option)\n if !value.nil?\n @options[option] = value\n else\n @options.delete(option)\n end\n else\n raise HTMLDocException.new(\"Invalid option #{option.to_s}\")\n end\n end",
"title": ""
},
{
"docid": "b66c56f456b3541b54e05f6e981630fd",
"score": "0.5979025",
"text": "def delete(options={})\n bucket.delete(@name, options)\n end",
"title": ""
},
{
"docid": "cfa20647d42b60f72316f1b874c256a1",
"score": "0.59722096",
"text": "def delete(key, options=nil)\n @store.delete(key)\n end",
"title": ""
},
{
"docid": "8dffa3e7402c167ca5050e0181de94d9",
"score": "0.5970572",
"text": "def destroy\n @user_setting.destroy\n\n head :no_content\n end",
"title": ""
},
{
"docid": "0f11a8cc3be938108634c0b690c324d0",
"score": "0.59601754",
"text": "def delete(k, ignored_options = nil)\n storage.delete k\n end",
"title": ""
},
{
"docid": "a2adbe14d21d8bdfc15e71265d13c6b8",
"score": "0.59544086",
"text": "def delete key\n @configs.delete key.to_sym\n end",
"title": ""
},
{
"docid": "e0669917f0938d4690dc3ea711c492e7",
"score": "0.59499544",
"text": "def destroy\n @option = @asset.options.find(params[:id])\n @option.destroy\n\n respond_to do |format|\n format.html { redirect_to asset_options_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "e68cde34eb2bde4613f7c3686244ba80",
"score": "0.5947142",
"text": "def delete_value(name)\n\t\treturn self.client.sys.registry.delete_value(self.hkey, name)\n\tend",
"title": ""
},
{
"docid": "de308636c70e80dd84326d57cba6b75f",
"score": "0.59461737",
"text": "def delete!\n @value = ''\n self\n end",
"title": ""
},
{
"docid": "f3ee255010c81ce073cbd8a32687c2ca",
"score": "0.5937518",
"text": "def destroy\n @defaulter_setting.destroy\n respond_to do |format|\n format.html { redirect_to defaulter_settings_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "33c5dea1dc4a8cc0c4fcceeccc5365e8",
"score": "0.59365505",
"text": "def destroy\n authorize @option_set\n @option_set.destroy\n protocol_action(\"удаление опций #{@option_set.name}\")\n respond_to do |format|\n flash[:success] = t('flashes.destroy', model: OptionSet.model_name.human)\n format.html { redirect_to option_sets_url}\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "c1c68b10ef33c9d1370c012d69a807d7",
"score": "0.59307677",
"text": "def destroy\n @setting.destroy\n respond_to do |format|\n format.html { redirect_to(admin_settings_url) }\n format.xml { head :ok }\n format.js\n end\n website.add_log(user: current_user, action: \"Deleted setting: #{@setting.name}\")\n end",
"title": ""
},
{
"docid": "e73250a78864768ecdce33932eb69740",
"score": "0.59243846",
"text": "def delete(options = {})\n options = nil if options.empty?\n compose('delete',options)\n end",
"title": ""
},
{
"docid": "6bef291b8db3c3897cf6c01e73213c5b",
"score": "0.5918059",
"text": "def set_DeleteOptions(value)\n set_input(\"DeleteOptions\", value)\n end",
"title": ""
},
{
"docid": "6bef291b8db3c3897cf6c01e73213c5b",
"score": "0.5916755",
"text": "def set_DeleteOptions(value)\n set_input(\"DeleteOptions\", value)\n end",
"title": ""
},
{
"docid": "6406c97f37f200863236d0fb9a1f6633",
"score": "0.5913167",
"text": "def delete_options args\n opt = args[ :options ]\n raise \"Missing options\" if !opt\n raise \"Empty options\" if opt.empty?\n type, err = args[ :option_type ], args[ :err ]\n err = true if err.nil?\n\n # make a local copy of global options if necessary and delete options from copy\n if type\n raise \"Bad type: #{type}\" if :cpp != type\n @options_cpp = get_cpp_options\n @options_cpp.delete opt, err\n else\n @options = get_options\n @options.delete opt, err\n end\n Build.logger.debug \"Deleted %s from target %s (type = %s)\" % [opt.to_s, @path, type]\n end",
"title": ""
},
{
"docid": "9d9a0c068ecc8e0e4b4c10cd17b0cc09",
"score": "0.5910707",
"text": "def destroy\n @option_value = @option.option_values.find(params[:id])\n @option_value.destroy\n\n respond_to do |format|\n format.html { redirect_to asset_option_option_values_url(@asset, @option) }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "25a2de017e9ac5365790080e4de97101",
"score": "0.59054226",
"text": "def clear\n @options = ''\n end",
"title": ""
},
{
"docid": "30c831f3d63128cd97cbe39f61ed4aa8",
"score": "0.5904388",
"text": "def clear\n @options.clear\n end",
"title": ""
},
{
"docid": "6e1c27b92fe3b5a47f3d30fc3ebdc784",
"score": "0.5899812",
"text": "def destroy\n @option.destroy\n respond_to do |format|\n format.html { redirect_to options_url, notice: 'Option was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "0fbdf314c9f77993108ef78192dbc069",
"score": "0.58962727",
"text": "def del(options={})\n super()\n end",
"title": ""
},
{
"docid": "672f5bb4d8969fec16d350204fcca662",
"score": "0.588663",
"text": "def destroy\n @opt.destroy\n respond_to do |format|\n format.html { redirect_to opts_url, notice: 'Opt was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "cc7b20789b8cfd2218be85edfd09d463",
"score": "0.5874389",
"text": "def remove_option(option_id)\n db = set_db()\n\n db.execute('DELETE FROM options WHERE option_id=?', option_id)\n db.execute('DELETE FROM votes WHERE option_id=?', option_id)\nend",
"title": ""
},
{
"docid": "2045ab7693c6cae14efd489d321c9a13",
"score": "0.5871934",
"text": "def destroy\n authorize @option\n @option.destroy\n respond_to do |format|\n format.html { redirect_to options_url, notice: 'option was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "d57514b0e2fd1c5dedf6493cb8b1a0c4",
"score": "0.586224",
"text": "def unset ( var )\n@settings << [ :unset, var ]\nend",
"title": ""
},
{
"docid": "0d12a6fbf849b7a3861d9428f03ed85e",
"score": "0.58265734",
"text": "def unset(key)\n SETTINGS[key] = false\n end",
"title": ""
},
{
"docid": "e700ac526e73a79a5efcdd669cae17f9",
"score": "0.5815636",
"text": "def destroy\n\t\t@setting.destroy\n\t\trespond_to do |format|\n\t\t\tformat.html { redirect_to settings_url, notice: 'Setting was successfully destroyed.' }\n\t\t\tformat.json { head :no_content }\n\t\tend\n\tend",
"title": ""
},
{
"docid": "e27493375033f28e0fb32c138f586ff9",
"score": "0.5812635",
"text": "def rm(key, options = {})\n case key\n when 'dummy'\n puts \"DirectoryChoosers: dummy, chooser: dummy, rm, options: #{options.to_s}\"\n 0\n end\n end",
"title": ""
},
{
"docid": "5bcee80b6774153cdf5e0eea9cce5bab",
"score": "0.5810168",
"text": "def destroy\n @option.destroy\n respond_to do |format|\n format.html do\n redirect_to options_url,\n notice: 'Option was successfully destroyed.'\n end\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "0284d66feceadf40f1a2fd72f1a4836d",
"score": "0.5804894",
"text": "def destroy\n @option_value.destroy\n respond_to do |format|\n format.html { redirect_to option_values_url, notice: 'Option value was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "ac6a9ef1467a27e8f7c748969ac7a116",
"score": "0.579941",
"text": "def destroy\n # authorize\n authorize! :delete, @option\n @option.destroy\n \n render nothing:true\n flash[:notice] = 'Xóa tùy chọn cài đặt thành công.'\n end",
"title": ""
},
{
"docid": "7b5ce1615d54ad99934b48c278b5edcd",
"score": "0.57915705",
"text": "def destroy\n @setting = Setting.find(params[:id])\n @setting.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_settings_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "5ec7c4af62d121299f8d2cf29063b343",
"score": "0.57886565",
"text": "def delete(key, opts = {})\n # do nothing\n end",
"title": ""
},
{
"docid": "010e7d4b760e0c0bca56db554c7e174c",
"score": "0.5787146",
"text": "def delete(key)\n config.delete(key)\n end",
"title": ""
},
{
"docid": "c8afb95c552ebbd57837eb41cc058ed9",
"score": "0.5786473",
"text": "def destroy(var_name)\n var_name = var_name.to_s\n if self[var_name]\n object(var_name).destroy\n true\n else\n raise ConfigNotFound, \"Setting config key \\\"#{var_name}\\\" not found\"\n end\n end",
"title": ""
},
{
"docid": "ab82a6e069bc010f700163f22fdb67b6",
"score": "0.57792956",
"text": "def destroy\n @message_option.destroy\n end",
"title": ""
},
{
"docid": "8666c3c647af7fe87e56cbe77b9b10d3",
"score": "0.57773423",
"text": "def delete(name, options = {})\n return unless @cookies.has_key? name.to_s\n\n options.symbolize_keys!\n handle_options(options)\n\n value = @cookies.delete(name.to_s)\n @delete_cookies[name.to_s] = options\n value\n end",
"title": ""
},
{
"docid": "d608070d7e768f56d79d20956769c4a7",
"score": "0.57700247",
"text": "def delete(key)\n standardUserDefaults.delete(key)\n end",
"title": ""
},
{
"docid": "2bceb70b30f862ae2d4c55a09e5dedb2",
"score": "0.5759322",
"text": "def destroy\n @setting = Setting.find(params[:id])\n @setting.destroy\n\n respond_to do |format|\n format.html { redirect_to settings_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "2bceb70b30f862ae2d4c55a09e5dedb2",
"score": "0.5759322",
"text": "def destroy\n @setting = Setting.find(params[:id])\n @setting.destroy\n\n respond_to do |format|\n format.html { redirect_to settings_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "2bceb70b30f862ae2d4c55a09e5dedb2",
"score": "0.5758849",
"text": "def destroy\n @setting = Setting.find(params[:id])\n @setting.destroy\n\n respond_to do |format|\n format.html { redirect_to settings_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "5d79861334e99d9fda520594517efc48",
"score": "0.5754924",
"text": "def destroy\n @setting = Setting.find(params[:id])\n @setting.destroy\n redirect_to admin_path \n end",
"title": ""
}
] |
69b1e6c7708c56c4ef98b6ecbcb3c0cd | HACK: hacky implementation right here right now | [
{
"docid": "10923fa54cf139e10fcc7a354f527ffc",
"score": "0.0",
"text": "def mod_codes\n return @mod_codes if @mod_codes\n\n @mod_codes = []\n snapshots.each do |s|\n s.content.each.each do |i|\n i.mod_codes.each do |mod_code|\n @mod_codes << {:mod_code => mod_code, :name => i.name}\n end\n end\n end\n\n return @mod_codes\n end",
"title": ""
}
] | [
{
"docid": "ef1e4c0cc26e4eec8642a7d74e09c9d1",
"score": "0.665668",
"text": "def private; end",
"title": ""
},
{
"docid": "bc658f9936671408e02baa884ac86390",
"score": "0.5860367",
"text": "def anchored; end",
"title": ""
},
{
"docid": "0b8b7b9666e4ed32bfd448198778e4e9",
"score": "0.5854217",
"text": "def probers; end",
"title": ""
},
{
"docid": "d8ae3e2b236950074c4632d180274b8a",
"score": "0.57038623",
"text": "def specie; end",
"title": ""
},
{
"docid": "d8ae3e2b236950074c4632d180274b8a",
"score": "0.57038623",
"text": "def specie; end",
"title": ""
},
{
"docid": "d8ae3e2b236950074c4632d180274b8a",
"score": "0.57038623",
"text": "def specie; end",
"title": ""
},
{
"docid": "d8ae3e2b236950074c4632d180274b8a",
"score": "0.57038623",
"text": "def specie; end",
"title": ""
},
{
"docid": "65ffca17e416f77c52ce148aeafbd826",
"score": "0.5699215",
"text": "def schubert; end",
"title": ""
},
{
"docid": "d996063a1bda83fd8644c8cbac831e61",
"score": "0.56916165",
"text": "def rassoc(p0) end",
"title": ""
},
{
"docid": "4a8a45e636a05760a8e8c55f7aa1c766",
"score": "0.5502832",
"text": "def terpene; end",
"title": ""
},
{
"docid": "a7e46056aae02404670c78192ffb8f3f",
"score": "0.54021233",
"text": "def original_result; end",
"title": ""
},
{
"docid": "991b6f12a63ef51664b84eb729f67eed",
"score": "0.5396688",
"text": "def formation; end",
"title": ""
},
{
"docid": "1f60ec3e87d82a4252630cec8fdc8950",
"score": "0.53884065",
"text": "def berlioz; end",
"title": ""
},
{
"docid": "d88aeca0eb7d8aa34789deeabc5063cf",
"score": "0.5372322",
"text": "def offences_by; end",
"title": ""
},
{
"docid": "cfbcefb24f0d0d9b60d1e4c0cf6273ba",
"score": "0.5328516",
"text": "def trd; end",
"title": ""
},
{
"docid": "4e7f63d2e8327143b97af38c6fce7a24",
"score": "0.5308438",
"text": "def original; end",
"title": ""
},
{
"docid": "255b128abb2eb262fd52b20ff68129b9",
"score": "0.52992797",
"text": "def escaper=(_); end",
"title": ""
},
{
"docid": "5971f871580b6a6e5171c35946a30c95",
"score": "0.52975625",
"text": "def stderrs; end",
"title": ""
},
{
"docid": "3fc62999f66ac51441f9ba80922d1854",
"score": "0.5290696",
"text": "def escaper; end",
"title": ""
},
{
"docid": "a02f7382c73eef08b14f38d122f7bdb9",
"score": "0.5290615",
"text": "def custom; end",
"title": ""
},
{
"docid": "a02f7382c73eef08b14f38d122f7bdb9",
"score": "0.5290615",
"text": "def custom; end",
"title": ""
},
{
"docid": "ad244bd0c45d5d9274f7612fa6fee986",
"score": "0.5287898",
"text": "def suivre; end",
"title": ""
},
{
"docid": "2c8e599b8829e8b044b3679f00d49206",
"score": "0.52517015",
"text": "def transform; end",
"title": ""
},
{
"docid": "cf2231631bc862eb0c98d89194d62a88",
"score": "0.52464926",
"text": "def identify; end",
"title": ""
},
{
"docid": "acb84cf7ec5cb9f480913c612a384abb",
"score": "0.5241835",
"text": "def probers=(_arg0); end",
"title": ""
},
{
"docid": "06b6203baf3c9311f502228839c5ab4e",
"score": "0.5237819",
"text": "def intensifier; end",
"title": ""
},
{
"docid": "3103349d09f884a9193b8c4ac184a666",
"score": "0.5232302",
"text": "def wrapper; end",
"title": ""
},
{
"docid": "28012efb188002843ef6e540786c5732",
"score": "0.5223374",
"text": "def rest_positionals; end",
"title": ""
},
{
"docid": "0225a9f23a0fa436bcdab339adc872dd",
"score": "0.520893",
"text": "def same; end",
"title": ""
},
{
"docid": "05f30dbaa95cab56c89348edb221f3ed",
"score": "0.5204433",
"text": "def ext=(_arg0); end",
"title": ""
},
{
"docid": "05f30dbaa95cab56c89348edb221f3ed",
"score": "0.5204433",
"text": "def ext=(_arg0); end",
"title": ""
},
{
"docid": "05f30dbaa95cab56c89348edb221f3ed",
"score": "0.5204433",
"text": "def ext=(_arg0); end",
"title": ""
},
{
"docid": "51cbc664905c5759f5e6775045d2aad7",
"score": "0.51719606",
"text": "def next() end",
"title": ""
},
{
"docid": "51cbc664905c5759f5e6775045d2aad7",
"score": "0.51719606",
"text": "def next() end",
"title": ""
},
{
"docid": "2d8d9f0527a44cd0febc5d6cbb3a22f2",
"score": "0.51679474",
"text": "def weber; end",
"title": ""
},
{
"docid": "3fe16723cfe073a33d3a2398f331e395",
"score": "0.51615876",
"text": "def transformations; end",
"title": ""
},
{
"docid": "4f0a4656cc8371322fe53a0792e78206",
"score": "0.51515186",
"text": "def offences_by=(_arg0); end",
"title": ""
},
{
"docid": "8742865b78eb755e40bb1bff22199433",
"score": "0.5146793",
"text": "def internship_passed; end",
"title": ""
},
{
"docid": "6a6ed5368f43a25fb9264e65117fa7d1",
"score": "0.5134041",
"text": "def internal; end",
"title": ""
},
{
"docid": "4ad19d3270d712a0b1427d62090e5438",
"score": "0.5129162",
"text": "def ibu; end",
"title": ""
},
{
"docid": "983a5b9de63b609981f45a05ecc2741f",
"score": "0.5117442",
"text": "def fallbacks=(_arg0); end",
"title": ""
},
{
"docid": "00e36d36d077f9f970f4710e8ec44c09",
"score": "0.51122767",
"text": "def at(p0) end",
"title": ""
},
{
"docid": "f4af92669f80e6e7ee6a7a44a06eb48f",
"score": "0.5100391",
"text": "def pos() end",
"title": ""
},
{
"docid": "f4af92669f80e6e7ee6a7a44a06eb48f",
"score": "0.5100391",
"text": "def pos() end",
"title": ""
},
{
"docid": "f4af92669f80e6e7ee6a7a44a06eb48f",
"score": "0.5100391",
"text": "def pos() end",
"title": ""
},
{
"docid": "f4af92669f80e6e7ee6a7a44a06eb48f",
"score": "0.5100391",
"text": "def pos() end",
"title": ""
},
{
"docid": "7ff2011fa3dc45585a9272310eafb765",
"score": "0.5088479",
"text": "def isolated; end",
"title": ""
},
{
"docid": "7ff2011fa3dc45585a9272310eafb765",
"score": "0.5088479",
"text": "def isolated; end",
"title": ""
},
{
"docid": "a3c677de4120a6b1a1688fb1c77520ce",
"score": "0.5086205",
"text": "def pos; end",
"title": ""
},
{
"docid": "a3c677de4120a6b1a1688fb1c77520ce",
"score": "0.5086205",
"text": "def pos; end",
"title": ""
},
{
"docid": "a3c677de4120a6b1a1688fb1c77520ce",
"score": "0.5086205",
"text": "def pos; end",
"title": ""
},
{
"docid": "a3c677de4120a6b1a1688fb1c77520ce",
"score": "0.5086205",
"text": "def pos; end",
"title": ""
},
{
"docid": "a3c677de4120a6b1a1688fb1c77520ce",
"score": "0.5086205",
"text": "def pos; end",
"title": ""
},
{
"docid": "a3c677de4120a6b1a1688fb1c77520ce",
"score": "0.5086205",
"text": "def pos; end",
"title": ""
},
{
"docid": "f53478c78bfb65847a5452ef55a4e8ef",
"score": "0.50760096",
"text": "def transforms; end",
"title": ""
},
{
"docid": "bf12558134d51a34e62da7291fe95772",
"score": "0.50695044",
"text": "def getc() end",
"title": ""
},
{
"docid": "bf12558134d51a34e62da7291fe95772",
"score": "0.50695044",
"text": "def getc() end",
"title": ""
},
{
"docid": "bf12558134d51a34e62da7291fe95772",
"score": "0.50695044",
"text": "def getc() end",
"title": ""
},
{
"docid": "b3d7c178b277afaefb1b9648335941e7",
"score": "0.5065021",
"text": "def loc; end",
"title": ""
},
{
"docid": "b3d7c178b277afaefb1b9648335941e7",
"score": "0.5065021",
"text": "def loc; end",
"title": ""
},
{
"docid": "b3d7c178b277afaefb1b9648335941e7",
"score": "0.5065021",
"text": "def loc; end",
"title": ""
},
{
"docid": "3b4df29992323899033bb22a35a64989",
"score": "0.5060732",
"text": "def malts; end",
"title": ""
},
{
"docid": "5ad7e5c7a147626a2b0a2c5956411be5",
"score": "0.5059833",
"text": "def r; end",
"title": ""
},
{
"docid": "5ad7e5c7a147626a2b0a2c5956411be5",
"score": "0.5059833",
"text": "def r; end",
"title": ""
},
{
"docid": "07388179527877105fd7246db2b49188",
"score": "0.50548947",
"text": "def villian; end",
"title": ""
},
{
"docid": "b6ea57868f70d34431fd3ddce643afcb",
"score": "0.5051009",
"text": "def hiss; end",
"title": ""
},
{
"docid": "13289d4d24c54cff8b70fcaefc85384e",
"score": "0.5042916",
"text": "def verdi; end",
"title": ""
},
{
"docid": "3660c5f35373aec34a5a7b0869a4a8bd",
"score": "0.50282586",
"text": "def implementation; end",
"title": ""
},
{
"docid": "3660c5f35373aec34a5a7b0869a4a8bd",
"score": "0.50282586",
"text": "def implementation; end",
"title": ""
},
{
"docid": "854ea5492fc848ebf904cdf30a301a92",
"score": "0.50120264",
"text": "def first_offset; end",
"title": ""
},
{
"docid": "854ea5492fc848ebf904cdf30a301a92",
"score": "0.50120264",
"text": "def first_offset; end",
"title": ""
},
{
"docid": "f1736df8e6642c2eeb78e4b30e5cf678",
"score": "0.5011672",
"text": "def from; end",
"title": ""
},
{
"docid": "f1736df8e6642c2eeb78e4b30e5cf678",
"score": "0.5011672",
"text": "def from; end",
"title": ""
},
{
"docid": "f1736df8e6642c2eeb78e4b30e5cf678",
"score": "0.5011672",
"text": "def from; end",
"title": ""
},
{
"docid": "f1736df8e6642c2eeb78e4b30e5cf678",
"score": "0.5011672",
"text": "def from; end",
"title": ""
},
{
"docid": "1fb5656a611cdfc55677736d61f1a0b6",
"score": "0.49960515",
"text": "def starting_position=(_arg0); end",
"title": ""
},
{
"docid": "d8216257f367748eea163fc1aa556306",
"score": "0.49934095",
"text": "def bs; end",
"title": ""
},
{
"docid": "48412710c08492591f41ec0553b303ce",
"score": "0.49924675",
"text": "def starting_position; end",
"title": ""
},
{
"docid": "d4248303d83e601fedcb6595d7408f7d",
"score": "0.49907938",
"text": "def expanded; end",
"title": ""
},
{
"docid": "3fff7ea9b6967fb0af70c64a4d13faae",
"score": "0.49844134",
"text": "def parts; end",
"title": ""
},
{
"docid": "3fff7ea9b6967fb0af70c64a4d13faae",
"score": "0.49844134",
"text": "def parts; end",
"title": ""
},
{
"docid": "3fff7ea9b6967fb0af70c64a4d13faae",
"score": "0.49844134",
"text": "def parts; end",
"title": ""
},
{
"docid": "2cc9969eb7789e4fe75844b6f57cb6b4",
"score": "0.49743852",
"text": "def refutal()\n end",
"title": ""
},
{
"docid": "aa42d70a3ce50db7898a79931a25559f",
"score": "0.4970098",
"text": "def origin=(_arg0); end",
"title": ""
},
{
"docid": "d1f83d159b425bfc5239dc520da21ea7",
"score": "0.49695334",
"text": "def next!() end",
"title": ""
},
{
"docid": "18b70bef0b7cb44fc22c66bf7965c231",
"score": "0.496951",
"text": "def first; end",
"title": ""
},
{
"docid": "18b70bef0b7cb44fc22c66bf7965c231",
"score": "0.496951",
"text": "def first; end",
"title": ""
},
{
"docid": "be04cb55a462491abd1acf5950c83572",
"score": "0.49686596",
"text": "def jack_handey; end",
"title": ""
},
{
"docid": "65868f3890b7055ca6fbf5f330690d03",
"score": "0.4967086",
"text": "def method_731(base); end",
"title": ""
},
{
"docid": "eb813b4c171b5a75ecb2253b743e7c3a",
"score": "0.49648008",
"text": "def parslet; end",
"title": ""
},
{
"docid": "eb813b4c171b5a75ecb2253b743e7c3a",
"score": "0.49648008",
"text": "def parslet; end",
"title": ""
},
{
"docid": "eb813b4c171b5a75ecb2253b743e7c3a",
"score": "0.49648008",
"text": "def parslet; end",
"title": ""
},
{
"docid": "eb813b4c171b5a75ecb2253b743e7c3a",
"score": "0.49648008",
"text": "def parslet; end",
"title": ""
},
{
"docid": "32707388ee934a1c3d65af6c286bd3af",
"score": "0.49612504",
"text": "def index(p0) end",
"title": ""
},
{
"docid": "32707388ee934a1c3d65af6c286bd3af",
"score": "0.49612504",
"text": "def index(p0) end",
"title": ""
},
{
"docid": "456acb6fbbfa8d19490feed3f145af4e",
"score": "0.49573576",
"text": "def deco_pos; end",
"title": ""
},
{
"docid": "4e92bc73e3a3a62167e2eccd3d1b1761",
"score": "0.4948741",
"text": "def sld; end",
"title": ""
},
{
"docid": "0eb3d9fe5f9f25d5d4681707022b9ab6",
"score": "0.49432608",
"text": "def ignores; end",
"title": ""
},
{
"docid": "752e2844a9f276ee5cfa6836def131a9",
"score": "0.49366778",
"text": "def tld; end",
"title": ""
},
{
"docid": "752e2844a9f276ee5cfa6836def131a9",
"score": "0.49366778",
"text": "def tld; end",
"title": ""
},
{
"docid": "531eb9a85b5b3d2b679b55156dc6de28",
"score": "0.49338457",
"text": "def too_complex; end",
"title": ""
}
] |
586c088d6db5fa0fcf9ae87c115e4935 | Helpers that provide the final structure of an offering plus related answers for each question: | [
{
"docid": "d8de669e657b587ed9d65ca6da63ee8e",
"score": "0.52268994",
"text": "def report_json(answers)\n runnable = @offering.runnable\n if @activity_id\n runnable = Activity.find(@activity_id)\n end\n\n if runnable.is_a?(ExternalActivity) && runnable.template\n runnable = runnable.template\n end\n # Provide chain of associations to load to avoid N+1 queries (values obtained thanks to Bullet gem).\n associations_to_load = {sections: {pages: [{page_elements: :embeddable}, :section ]}}\n if runnable.is_a? Investigation\n investigation_json(runnable, answers, associations_to_load)\n elsif runnable.is_a? Activity\n activity_json(runnable, answers, associations_to_load[:sections])\n end\n end",
"title": ""
}
] | [
{
"docid": "e5efe40aec12f6ef25798af238bbed64",
"score": "0.64362586",
"text": "def answers\n record_collection.map.with_index(1) do |person, index|\n [\n Separator.new(\"#{name}_index_title\", index:),\n FreeTextAnswer.new(:person_full_name, person.full_name),\n FreeTextAnswer.new(:person_privacy_known, person.privacy_known.try(:capitalize)),\n contact_details_privacy_preferences(person),\n previous_name_answer(person),\n Answer.new(:person_sex, person.gender),\n DateAnswer.new(:person_dob, person.dob,\n show: respondents_only && person.dob_estimate.blank?),\n DateAnswer.new(:person_dob_estimate, person.dob_estimate),\n FreeTextAnswer.new(:person_birthplace, person.birthplace),\n FreeTextAnswer.new(:person_address,\n data_or_private(person, person.full_address, ContactDetails::ADDRESS.to_s),\n show: true),\n Answer.new(:person_residence_requirement_met, person.residence_requirement_met),\n FreeTextAnswer.new(:person_residence_history, person.residence_history,\n show: person.residence_requirement_met == 'no'),\n FreeTextAnswer.new(:person_email,\n data_or_private(person, email_answer(person), ContactDetails::EMAIL.to_s)),\n FreeTextAnswer.new(:person_home_phone,\n data_or_private(person,\n home_phone_answer(person),\n ContactDetails::HOME_PHONE.to_s)),\n FreeTextAnswer.new(:person_mobile_phone,\n data_or_private(\n person, mobile_phone_answer(person), ContactDetails::MOBILE.to_s\n )),\n Answer.new(:person_voicemail_consent, person.voicemail_consent), # This shows only if a value is present\n FreeTextAnswer.new(\n :person_relationship_to_children,\n RelationshipsPresenter.new(c100_application).relationship_to_children(\n person, show_person_name: false, bypass_c8: bypass_relationships_c8?\n )\n ),\n Partial.row_blank_space,\n ]\n end.flatten.select(&:show?)\n end",
"title": ""
},
{
"docid": "cbe20cd18e5fa9576b76c401c425cfdf",
"score": "0.636727",
"text": "def appt_questionnaires\n base_qm[:questionnaire].each_with_object({}) do |quest, acc|\n questionnaire_id = quest['id']\n acc[questionnaire_id] = quest\n end\n end",
"title": ""
},
{
"docid": "287c0ee8ae6b8ee494cdfa36d40beaa9",
"score": "0.63324565",
"text": "def answer question\n\n # find the value that should be entered\n data = request[question[:reference_identifier]]\n\n response_set.responses.where(question_id: question).delete_all\n\n case question.type\n\n when :none\n answer = question.answers.first\n response_set.responses.create({\n answer: answer,\n question: question,\n answer.value_key => data\n })\n\n when :one\n # the value is the reference identifier of the target answer\n answer = question.answers.where(reference_identifier: data).first\n\n unless answer.nil?\n response_set.responses.create({\n answer: answer,\n question: question\n })\n end\n\n when :any\n # the value is an array of the chosen answers\n answers = question.answers.where(reference_identifier: data)\n answers.each do |answer|\n response_set.responses.create({\n answer: answer,\n question: question\n })\n end\n\n when :repeater\n # the value is an array of answers\n answer = question.answers.first\n i = 0\n data.each do |value|\n response_set.responses.create({\n answer: answer,\n question: question,\n answer.value_key => value,\n response_group: i\n })\n i += 1\n end\n\n else\n throw \"not handled> #{question.inspect}\"\n end\n\n end",
"title": ""
},
{
"docid": "287c0ee8ae6b8ee494cdfa36d40beaa9",
"score": "0.63324565",
"text": "def answer question\n\n # find the value that should be entered\n data = request[question[:reference_identifier]]\n\n response_set.responses.where(question_id: question).delete_all\n\n case question.type\n\n when :none\n answer = question.answers.first\n response_set.responses.create({\n answer: answer,\n question: question,\n answer.value_key => data\n })\n\n when :one\n # the value is the reference identifier of the target answer\n answer = question.answers.where(reference_identifier: data).first\n\n unless answer.nil?\n response_set.responses.create({\n answer: answer,\n question: question\n })\n end\n\n when :any\n # the value is an array of the chosen answers\n answers = question.answers.where(reference_identifier: data)\n answers.each do |answer|\n response_set.responses.create({\n answer: answer,\n question: question\n })\n end\n\n when :repeater\n # the value is an array of answers\n answer = question.answers.first\n i = 0\n data.each do |value|\n response_set.responses.create({\n answer: answer,\n question: question,\n answer.value_key => value,\n response_group: i\n })\n i += 1\n end\n\n else\n throw \"not handled> #{question.inspect}\"\n end\n\n end",
"title": ""
},
{
"docid": "31f5559559c294710b8c380fdcc49a11",
"score": "0.6270766",
"text": "def questionnaire_items\n questions = opts[:questionnaire_response]&.questionnaire_response_data&.fetch('item')\n\n composer.move_down(composer.bounds.top - 120)\n\n questions.each do |q|\n answers = q['answer']\n\n composer.table([[q['text'], '']], table_question_style)\n composer.move_down(16)\n\n answers.each do |a|\n composer.table([['', a['valueString']]], table_answer_style)\n composer.move_down(10)\n end\n end\n end",
"title": ""
},
{
"docid": "eb034ed50408839f4b34724c5540e29a",
"score": "0.62466174",
"text": "def answers\n object.answers.collect do |a|\n {\n id: a.id,\n user_id: a.user_id,\n alternative_id: a.alternative_id\n }\n end\n end",
"title": ""
},
{
"docid": "4984bb679c65cc6748744410b8ea65fe",
"score": "0.6068892",
"text": "def get_student_answers\n # Collect all the student answers for given offering.\n student_ids = @students.map { |s| s.id }\n report_learners = Report::Learner.where(offering_id: @offering.id, student_id: student_ids)\n\n answers = report_learners.map do |report_learner|\n student_id = report_learner.student_id\n report_learner.answers.map do |embeddable_key, answer|\n # Process some answers type to provide cleaner format, names, etc.\n question_type = API::V1::Report.embeddable_type(embeddable_key)\n answer[:type] = question_type\n answer[:embeddable_key] = embeddable_key\n answer[:student_id] = student_id\n if question_type == 'Embeddable::MultipleChoice'\n process_multiple_choice_answer(answer)\n elsif question_type == 'Embeddable::ImageQuestion'\n process_image_question_answer(answer)\n end\n answer\n end\n end\n # Flatten answers and group them by the embeddable key.\n answers.flatten.sort_by { |s| s[:student_name] }.group_by { |a| a[:embeddable_key] }\n end",
"title": ""
},
{
"docid": "57077c39d679c0c99967652d06b7cbbd",
"score": "0.6035566",
"text": "def answers_for_question(question)\n @answers_for_question ||= {}\n @answers_for_question[question] ||= Answer.first_level_only\n .joins(:form_item)\n .where(response_id: responses.map(&:id))\n .where(\"form_items.question_id\" => question.id)\n .index_by(&:response_id)\n end",
"title": ""
},
{
"docid": "c6a0aface575e7b0439a814766d79128",
"score": "0.6025393",
"text": "def answers\n [].tap do |a|\n a << teaching_maths_or_physics\n a << current_school\n a << initial_teacher_training_subject\n a << initial_teacher_training_subject_specialism if eligibility.initial_teacher_training_subject_specialism.present?\n a << has_uk_maths_or_physics_degree if eligibility.has_uk_maths_or_physics_degree.present?\n a << qts_award_year\n a << employed_as_supply_teacher\n a << has_entire_term_contract if eligibility.employed_as_supply_teacher?\n a << employed_directly if eligibility.employed_as_supply_teacher?\n a << disciplinary_action\n a << formal_performance_action\n end\n end",
"title": ""
},
{
"docid": "c1215fa81b4f1c6da7db5c25520f4202",
"score": "0.60205394",
"text": "def get_answer(offering_question_id, offering_question_option_id=nil)\n question = offering.questions.find(offering_question_id)\n if offering_question_option_id.nil? && !question.display_as.include?(\"checkbox_options\")\n answer = answers.find_or_create_by_offering_question_id(offering_question_id).answer\n self.class.send :define_method, \"dynamic_answer_#{offering_question_id.to_s}=\", Proc.new {|argv| set_answer(offering_question_id, argv)}\n else\n option_answer = answers.find_by_offering_question_option_id(offering_question_option_id)\n answer = option_answer.nil? ? \"false\" : option_answer.answer\n self.class.send :define_method, \"dynamic_answer_#{offering_question_id.to_s}_#{offering_question_option_id.to_s}=\",\n Proc.new {|argv| set_answer(offering_question_id, argv, offering_question_option_id)}\n end \n type_cast_dynamic_answer(answer)\n end",
"title": ""
},
{
"docid": "19bb9303d9588141a4dc16b9aeb0c88a",
"score": "0.5936213",
"text": "def answers\n [].tap do |a|\n a << qts_award_year\n a << claim_school\n a << current_school\n a << subjects_taught\n a << leadership_position\n a << mostly_performed_leadership_duties if eligibility.had_leadership_position?\n a << student_loan_amount\n end\n end",
"title": ""
},
{
"docid": "476550babccf846ee56727783616aff7",
"score": "0.5907602",
"text": "def show\n \n @offering = Offering.find_by_id(params[:id])\n @resource = Resource.find @offering.resource_id\n @question = Question.new\n @negociation = Negociation.new\n @questions = @offering.questions\n @event = Event.find @offering.event_id\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @offering }\n end\n end",
"title": ""
},
{
"docid": "2d59f911f0323602fe697bbc47d74a83",
"score": "0.59005517",
"text": "def answers\n @answers ||= generate_answers\n end",
"title": ""
},
{
"docid": "64e408f3ed08d85baa30d54ffd67432b",
"score": "0.58861506",
"text": "def answer_a_question\n user = current_user\n render_401 and return unless user\n question = ShortQuestion.find_by_id(params[:id])\n render_404 and return unless question\n\n obj = {\n :qid => params[:id],\n :answer => params[:choice]\n }\n \n answers = {}\n $r.multi do\n $r.lpush(\"user:#{user.id}:questions\", obj)\n $r.hincrby(\"question:#{question.id}:answers\", \"choice#{params[:choice]}\", 1)\n choices = $r.hget(\"question:#{question.id}:answers\", :num_choices)\n for i in 1..choices\n answers[i] = $r.hget(\"question:#{question.id}:answers\", \"choice#{i}\")\n end\n end\n render :json => {\n :success => true,\n :answers => answers\n }\n end",
"title": ""
},
{
"docid": "8906571d1bf2865f6d66c3bd932f5cdc",
"score": "0.5884954",
"text": "def answers\n extracted_answers = []\n\n unless self.qp_values.nil?\n self.qp_values.each do |answer| \n extracted_answers.push(ResponseAnswer.new(answer))\n end \n end\n\n return extracted_answers \n end",
"title": ""
},
{
"docid": "2879576ed4e72711c6b517bd12172bee",
"score": "0.58833396",
"text": "def render_multiple_choice(q)\n ans = array_of_answers(q)\n question_text = q.multiple ? '(Select all that apply.) ' + q.question_text : q.question_text\n question_type = q.multiple ? 'multiple_answers_question' : 'multiple_choice_question'\n comments_key = q.raw? ? :incorrect_comments_html : :incorrect_comments_text\n\n ques = {\n :quiz_group_id => @current_group_id,\n :question_name => \"#{q.points} point#{'s' if q.points > 1}\",\n :question_type => question_type,\n :points_possible => q.points,\n :question_text => question_text,\n :position => 10000,\n :answers => ans\n }\n { question: ques }\n end",
"title": ""
},
{
"docid": "d941a4e2db699a66558b50a9db5bb065",
"score": "0.58691245",
"text": "def answer_options(question)\n body = []\n today = question[:include_today].present? ? 0 : 1\n from_days_ago = question[:from_days_ago]\n date_format = question[:date_format].presence || DATE_FORMAT\n from_days_ago.downto(today) do |days_ago|\n date = days_ago.days.ago\n next if [6, 0].include?(date.wday) && question[:exclude_weekends].present?\n\n formatted_date = I18n.l(date, locale: question[:locale], format: date_format)\n option = {\n title: formatted_date,\n value: I18n.l(date, locale: :en, format: DATE_FORMAT_BACKEND)\n }\n option[:shows_questions] = question[:shows_questions] if question[:shows_questions].present?\n option[:hides_questions] = question[:hides_questions] if question[:hides_questions].present?\n if question[:morning_and_afternoon]\n option[:title] = \"#{formatted_date} #{I18n.t('time.am', locale: question[:locale])}\"\n option[:value] = I18n.l(date, locale: :en, format: DATE_FORMAT_BACKEND_AM)\n end\n body << days_option_body(question, option.merge(raw: option.deep_dup))\n next unless question[:morning_and_afternoon]\n\n new_option = option.merge(title: \"#{formatted_date} #{I18n.t('time.pm', locale: question[:locale])}\",\n value: I18n.l(date, locale: :en, format: DATE_FORMAT_BACKEND_PM))\n body << days_option_body(question, new_option.merge(raw: new_option.deep_dup))\n end\n safe_join(body)\n end",
"title": ""
},
{
"docid": "dd96a38f5826bb5b41371c14c473582a",
"score": "0.58512837",
"text": "def question_details\n result = []\n entities.each do |entity|\n group = entity.meta_attribute_entity_group\n result.push({\n :questions=>questions_for_entity(entity).map{|q|q.attribute_name},\n :table=>entity.entity_type,\n :year=>entity.reference_year,\n :group=>group.group_name,\n :parent_table=>group.parent_table,\n :link_to=>(group.parent_group.nil? ? nil : group.parent_group.parent_table)\n })\n end\n result\n end",
"title": ""
},
{
"docid": "6b39a042ddb3b38e62919a073020863f",
"score": "0.5843474",
"text": "def generate_answers\n raise \"This should be handled by subclasses!\"\n end",
"title": ""
},
{
"docid": "189d967ee494481644b8a7d1686b25a1",
"score": "0.5822389",
"text": "def answers_json\n return false unless @questions\n out = {}\n @questions.each do |q|\n q_id = q.id\n out[q_id] = {}\n q.answers.each do |a|\n a_id = a.id\n out[q_id][a_id] = {}\n a.inputs.each do |i|\n out[q_id][a_id][i.key] = i.value\n end\n end\n end\n\n out\n end",
"title": ""
},
{
"docid": "e8856d692c936f7054f4916af2c1785e",
"score": "0.5821132",
"text": "def answers\n card = @generation.question_card.question_card\n @answers = @generation.variants.map do |v|\n tasks = Nokogiri::HTML(card).css('.task').map do |task|\n gen_task = v.generated_tasks.find_by(task_in_card: task[:id].to_i)\n task_text = generate_task_text( gen_task )\n t = gen_task.task\n\n generated_variables = gen_task.generated_variables.map { |var| [var.variable.name, var.value] }.to_h\n\n t.calculated_variables.each do |var|\n res = calculate(var.formula, generated_variables)\n generated_variables[var.name] = res\n end\n answer = paste_variables(t.answer, generated_variables)\n\n {\n name: task[:task_name],\n task: t,\n task_text: task_text,\n answer: answer\n }\n end\n {\n variant: v.number,\n tasks_in_card: tasks\n }\n end\n\n respond_to do |format|\n format.html { render layout: false }\n format.pdf do\n orientation = params[:orientation] ? 'Portrait' : 'Landscape'\n render pdf: \"answers\", # Excluding \".pdf\" extension.\n orientation: orientation\n end\n end\n end",
"title": ""
},
{
"docid": "1a9232a28119255049c5a965ed4b0e02",
"score": "0.57516086",
"text": "def question\n answer.question\n end",
"title": ""
},
{
"docid": "7105b4a844c0d651cfff7fac82317cad",
"score": "0.57422686",
"text": "def build_quiz_variant\n quiz_content = Array.new\n \n @quiz.questions.all.each do |question|\n question_hash = Hash.new\n question_hash[:prompt] = question.question\n \n\t\t answers = Array.new\n \n question.answers.all.each do |cur_answer|\n \t\tanswers << QuizMaster::Answer.new(cur_answer.value, cur_answer.is_correct, anchored: cur_answer.anchored)\n end\n\t\t\n question_hash[:answers] = answers\n quiz_content << question_hash\n end\n\n quiz_content.map! { |q| QuizMaster::Question.new(q) }\n\n quiz = QuizMaster::Quiz.new(quiz_content)\n\n if quiz_content.empty?\n nil\n elsif @quiz.shuffled?\n answer_reorderings = quiz.answer_reordering_vectors\n question_reordering = quiz.question_reordering_vector\n\n QuizMaster::QuizVariant.new(quiz, answer_reorderings, question_reordering)\n else\n quiz\n end\n end",
"title": ""
},
{
"docid": "6f13523f50c8a1310004c1feff07f0ee",
"score": "0.5724131",
"text": "def index\n @question_option_selections = @question_answer.question_option_selections\n end",
"title": ""
},
{
"docid": "7e0fbf22d6d10fa66b9626dd2fe47c42",
"score": "0.57229805",
"text": "def answers(options={})\n parse_answers(request(singular(id) + \"answers\", options))\n end",
"title": ""
},
{
"docid": "f96e54afa97aec961228ac376db9a8f6",
"score": "0.5719082",
"text": "def answers\n @answers ||= {}\n end",
"title": ""
},
{
"docid": "ca069c6c6079a29bd2c948c2628ce0cb",
"score": "0.57129973",
"text": "def build_answers\n existing_answers = answers.index_by &:question_id\n survey.questions.each do |q|\n next if existing_answers.has_key? q.id\n answers.build question: q\n end\n end",
"title": ""
},
{
"docid": "8fcec8f136e91da173a997c1f5052904",
"score": "0.57112586",
"text": "def formulate_question\n @category = @user.available_questions.sample.keys\n @category_instance = Category.all.select {|cat| cat.name == @category[0]}\n category_hash = @user.available_questions.select {|h| h.keys == @category}\n @country = category_hash[0].values[0].sample\n @country_instance = Country.all.select {|cou| cou.name == @country}\n pose_question\n end",
"title": ""
},
{
"docid": "b885941665b14fe180b154a81f30ca4e",
"score": "0.57012296",
"text": "def generate_answers\n masterless = @options[:masterless]\n return super if masterless\n\n dashboard = only_host_with_role(@hosts, 'dashboard')\n database = only_host_with_role(@hosts, 'database')\n master = only_host_with_role(@hosts, 'master')\n\n the_answers = super\n if dashboard != master\n # in 3.2, dashboard needs the master certname\n the_answers[dashboard.name][:q_puppetmaster_certname] = master.to_s\n end\n\n # do we want to check for updates?\n pe_check_for_updates = answer_for(@options, :q_pe_check_for_updates, 'n')\n the_answers[dashboard.name][:q_pe_check_for_updates] = pe_check_for_updates\n the_answers[master.name][:q_pe_check_for_updates] = pe_check_for_updates\n\n if @options[:type] == :upgrade && dashboard != database\n # In a split configuration, there is no way for the upgrader\n # to know how much disk space is available for the database\n # migration. We tell it to continue on, because we're\n # awesome.\n the_answers[dashboard.name][:q_upgrade_with_unknown_disk_space] = 'y'\n end\n @hosts.each do |h|\n h[:answers] = the_answers[h.name]\n end\n return the_answers\n end",
"title": ""
},
{
"docid": "1a743f2ff4e7991bb590255ec20dc0c2",
"score": "0.56514037",
"text": "def add_questions_answers(responses)\n content = \"\"\n responses.each do |response|\n answer = response.answer\n if !response.string_value.nil?\n content += \"<b>#{response.question.text}</b> - #{CGI::escapeHTML(response.string_value)}\\n\"\n elsif answer.text == \"Date\"\n content += \"<b>#{response.question.text}</b> - #{response.datetime_value.to_date}\\n\"\n else\n content += \"<b>#{response.question.text}</b> - #{CGI::escapeHTML(response.answer.text.to_str)}\\n\"\n end\n end\n content\n end",
"title": ""
},
{
"docid": "f3f6359ce2a1b7b7cb654a51d326e1a1",
"score": "0.5647747",
"text": "def answers(options={})\n @answers = self.class.parse_answers(request(singular(question_id) + \"/answers\", options))\n end",
"title": ""
},
{
"docid": "76363245fd00e830f7059255333baa3a",
"score": "0.56474775",
"text": "def survey_answers\n survey_questions.map(&:survey_answers).flatten\n end",
"title": ""
},
{
"docid": "f394328e870b1dd3029886c1c2735a2b",
"score": "0.5643115",
"text": "def create\n @answer = @question.answers.build(answer_params)\n @answer.save\n respond_with( [ :admin, @survey, @section, @question, @answer ] )\n end",
"title": ""
},
{
"docid": "f3bb145bacbc1b96f43e628c50181727",
"score": "0.5626317",
"text": "def define_dynamic_answer_setters!\n if offering\n offering.questions.find_all_by_dynamic_answer(true).each do |oq|\n if oq.display_as.include?(\"checkbox_options\")\n oq.options.each do |option|\n self.class.send :define_method, \"dynamic_answer_#{oq.id.to_s}_#{option.id.to_s}=\", Proc.new {|argv| set_answer(oq.id, argv, option.id)}\n end \n else\n self.class.send :define_method, \"dynamic_answer_#{oq.id.to_s}=\", Proc.new {|argv| set_answer(oq.id, argv)}\n end \n end\n end\n end",
"title": ""
},
{
"docid": "0145a0581c5b052df90dd43511fe2bf7",
"score": "0.56190664",
"text": "def answer\n @form_data = Form.get_published_form(params[:code])\n if @form_data.nil?\n redirect_to \"/dashboard\"\n else\n @questions = Question.get_questions_by_ids(@form_data['id'], JSON.parse(@form_data['question_order']))\n @all_options = Option.collect_options_per_quetions(JSON.parse(@form_data['question_order']))\n end\n end",
"title": ""
},
{
"docid": "5abca2d5690e0766f63b50657e45e973",
"score": "0.56070215",
"text": "def set_answer(offering_question_id, answer, offering_question_option_id=nil)\n question = offering.questions.find(offering_question_id)\n if offering_question_option_id.nil?\n if question.display_as.include?(\"date\")\n if answer[\"year\"].empty? || answer[\"month\"].empty? || answer[\"day\"].empty?\n answer = nil\n else\n answer = answer[\"year\"]+\"-\"+answer[\"month\"]+\"-\"+answer[\"day\"]\n end\n end \n answers.find_or_create_by_offering_question_id(offering_question_id).update_attribute(:answer, answer)\n else\n option_answer = answers.find_or_create_by_offering_question_option_id(offering_question_option_id)\n option_answer.update_attribute(:answer, answer)\n option_answer.update_attribute(:offering_question_id, offering_question_id)\n end \n end",
"title": ""
},
{
"docid": "9ef44201a55d0f4698242fd6547a9514",
"score": "0.55869126",
"text": "def quiz_detail\r\n result ={}\r\n qzps = self.bank_qizpoint_qzps\r\n node = BankNodestructure.where(:uid => self.node_uid).first\r\n result[:subject] = node.subject\r\n result[:grade]= node.grade\r\n result[:version] = node.version + \"(\"+ node.volume + \")\"\r\n result[:text] = self.text\r\n result[:node_uid] = node.uid\r\n result[:answer] = self.answer\r\n result[:desc] =self.desc\r\n result[:levelword2]=self.levelword2\r\n result[:bank_qizpoint_qzps] = qzps.map{|qzp|\r\n { \r\n \"type\" => qzp.type,\r\n \"type_label\" => Common::Locale::i18n(\"dict.#{qzp.type}\"),\r\n \"answer\" => qzp.answer,\r\n \"desc\" => qzp.desc,\r\n \"score\" => qzp.score,\r\n \"bank_checkpoint_ckps\" => qzp.bank_checkpoint_ckps.map{|bcc|\r\n {\r\n \"dimesion\" => bcc.dimesion,\r\n \"rid\" => bcc.rid,\r\n \"uid\" => bcc.uid,\r\n \"checkpoint\" => bcc.checkpoint,\r\n \"desc\" => bcc.desc\r\n }\r\n }\r\n }\r\n } \r\n result\r\n end",
"title": ""
},
{
"docid": "8a45d46c8d19554042e612e47370d5d2",
"score": "0.55743617",
"text": "def create_a_question\n q = ShortQuestion.create({\n :text => params[:text],\n :belongs_to_topic => params[:topic],\n :by => params[:by] || \"admin\",\n :by_id => params[:by_id]\n })\n params[:answers].each do |ans|\n a = q.short_answers.create({\n :text => ans.text,\n :choice_num => ans.choice \n })\n end\n $r.hset(\"question:#{q.id}:answers\", :num_choices, params[:answers].length)\n # Not setting the value of the answers to 0, as any increment will take care of initializing those keys\n end",
"title": ""
},
{
"docid": "ef23c5ed5c7eed9586c9dde36ae3acf8",
"score": "0.55726933",
"text": "def get_answers\n @answers\n end",
"title": ""
},
{
"docid": "6f142b05bf7a2f04ed22fed83e07fe37",
"score": "0.5555128",
"text": "def get_polls_and_answers(polls)\n pollArray = []\n if polls.length > 0\n polls.each {|poll|\n pollArray.push({\n id: poll.id,\n title: poll.title,\n question: poll.question,\n answers: poll.answers\n })\n }\n end\n puts pollArray\n pollArray\n end",
"title": ""
},
{
"docid": "74cb685b55081c2d44f666f5b67ec8cb",
"score": "0.55366945",
"text": "def survey_responses\n if teachercon?\n Pd::TeacherconSurvey.where(pd_enrollment: enrollments)\n elsif local_summer?\n Pd::LocalSummerWorkshopSurvey.where(pd_enrollment: enrollments)\n else\n raise 'Not supported for this workshop type'\n end\n end",
"title": ""
},
{
"docid": "b8456d3f3dae0e47517125b92bcfa6c6",
"score": "0.55202055",
"text": "def create_new_offering(award_info, quarter, appl)\r\n\t\toffering = Offering.create(:name => award_info.Award_title, :description => award_info.Award_description, :quarter_offered_id => quarter.id, :unit_id => UNIT_ID)\r\n#\t\tputs \" Created \" + offering.name + \" offering for quarter id: \" + offering.quarter_offered_id .to_s\r\n\t\t\r\n\t\t# Creating enrty in the award type linking table\r\n\t\tOfferingAwardType.create(:offering_id => offering.id, :award_type_id => award_info.award_type_id)\r\n\t\t\r\n\t\t# Fgures out when to use 0, 5, or 20 as the max score \r\n\t\t# Add in the Offering Review Criterion\r\n\t\tmax_score = 0\r\n\t\tunless award_info.award_type_id == 1 # There is no max score for leadership awards so it is kept at 0\r\n\t\t\tif appl.YEAR.to_i > 2004 \r\n\t\t\t\tmax_score = 20\r\n\t\t\telse\r\n\t\t\t\t# max_score = 5\r\n\t\t\tend\r\n\t\tend\r\n\t\t\r\n\t\tif appl.YEAR.to_i > 2004 \r\n\t\t\tOfferingReviewCriterion.create(:offering_id => offering.id, :title => \"Total\", :max_score => max_score)\r\n\t\tend\r\n\t\t\r\n\t\t# Create Application Review Decision Types\r\n\t\tdecision_types = Hash[\"Yes, Interview\" => YES_INTERVIEW_ID, \"Yes\" => YES_ID, \"No\" => NO_ID]\r\n\t\tdecision_types.each do |decision_type, application_status_type_id|\r\n\t\t\tappl_review_decision_type = ApplicationReviewDecisionType.new\r\n\t\t\tappl_review_decision_type.offering_id = offering.id\r\n\t\t\tappl_review_decision_type.title = decision_type\r\n\t\t\tappl_review_decision_type.application_status_type_id = application_status_type_id\r\n\t\t\tif decision_type == \"No\"\r\n\t\t\t\tappl_review_decision_type.yes_option = 0\r\n\t\t\telse\r\n\t\t\t\tappl_review_decision_type.yes_option = 1\r\n\t\t\tend\r\n\t\t\tappl_review_decision_type.save!\r\n\t\tend\r\n\t\t# Create Offering Statuses\r\n\t\toffering_statuses = Hash[\"Awarded\" => AWARDED_ID, \"Not Awarded After Interview\" => NOT_INTERVIEW_ID, \"Not Awarded\" => NOT_AWARDED_ID]\r\n\t\toffering_statuses.each do |offering_status, application_status_type_id|\r\n\t\t\tOfferingStatus.create(:offering_id => offering.id, :public_title => offering_status, :application_status_type_id => application_status_type_id)\r\n\t\tend\r\n\t\t\r\n\t\t# Add in the open_date and and the deadline\r\n\t\toffering.open_date = quarter.first_day\r\n\t\toffering.deadline = quarter.first_day + 3.months\r\n#\t\tputs \" Offering open: #{offering.open_date} close: #{offering.deadline}\"\r\n\t\t\r\n\t\t# Save the offering\r\n\t\toffering.save! \r\n\t\t\r\n\t\treturn offering\r\n\t\t\r\n\tend",
"title": ""
},
{
"docid": "06590f99ad1118fb44ae424a24cb11b3",
"score": "0.5515484",
"text": "def parse_base_results\n r = HashWithIndifferentAccess.new\n @assessment.questions.each_with_index do |question, order|\n result = HashWithIndifferentAccess.new\n choices = Array.new\n id = question['id']\n label = question['question']\n q_choices = choices_for_question_id(id)\n q_choices.each_with_index do |choice, c_order|\n c_id = choice['id']\n c_label = choice['label']\n c_correct = (answer_for_question_id(id) == c_id)\n c_value = default_choice_value(c_id, c_correct, c_label, c_order)\n choices.push(c_value)\n end\n result['id'] = id\n result['order'] = order\n result['question'] = label\n result['choices'] = choices\n result['total'] = 0.0 # ADDED, if refactor.\n result['percentages'] = percentages_from_decimal(0.0)\n r[id] = result\n end\n r\n end",
"title": ""
},
{
"docid": "917bc056eaf719f7a64fe988480331fa",
"score": "0.55122876",
"text": "def answers\n return Answer.where(question_id: self.id) \n end",
"title": ""
},
{
"docid": "eb2227085bafc5015b38a80ed1fb18ba",
"score": "0.55102104",
"text": "def answer(qid, create_if_missing = true)\n answer = answers.where(:question_id => qid).order(\"created_at DESC\").first\n question = Question.find(qid)\n if answer.nil? && create_if_missing then\n answer = Answer.new\n answer.plan_id = id\n answer.question_id = qid\n answer.text = question.default_value\n default_options = Array.new\n question.question_options.each do |option|\n if option.is_default\n default_options << option\n end\n end\n answer.question_options = default_options\n end\n return answer\n end",
"title": ""
},
{
"docid": "af67a950cbf110df0a7b6f491190aca9",
"score": "0.54943657",
"text": "def get_explanations(knowledge, sorted_affinities)\n hash_dimension2answers = answers.group_by do |answer|\n answer.has_opinion? ? answer.question(knowledge).dimension : :no_opinion\n end\n\n explanations = {}\n hash_question_idurl2min_max_weight = {}\n answers.each do |answer|\n question = answer.question(knowledge)\n hash_pidurl2weight = question.delta_weight(answer)\n hash_pidurl2weight = hash_pidurl2weight * question.weight\n min_weight, max_weight = hash_pidurl2weight.min_max\n hash_question_idurl2min_max_weight[answer.question_idurl] = [min_weight, max_weight]\n ab = (min_weight == max_weight) ? nil : Root.rule3_ab(min_weight, max_weight)\n sorted_affinities.each do |affinity|\n product_idurl = affinity.product_idurl\n weight = hash_pidurl2weight[product_idurl]\n explanations[product_idurl] ||= {}\n explanations[product_idurl][answer.question_idurl] = { :sum => weight, :percentage => (ab ? Root.rule3_cache(weight, ab) : 1.0) }\n end\n end\n\n # compute the sum per dimension\n hash_dimension2answers.each do |dimension, answers_4_dimension|\n puts \"answers_4_dimension=#{answers_4_dimension.class}\"\n sum_weight_questions = answers_4_dimension.inject(0.0) { |s, answer| s += answer.question(knowledge).weight }\n explanations.each do |product_idurl, explanation|\n sum_weight = 0.0\n sum_percentage = 0.0\n sum_weight_questions = 0.0\n answers_4_dimension.each do |answer|\n question_weight = answer.question(knowledge).weight\n sum_weight += explanation[answer.question_idurl][:sum]\n sum_percentage += (explanation[answer.question_idurl][:percentage] * question_weight)\n sum_weight_questions += question_weight\n end\n explanation[\"dimension_#{dimension}\"] = {:sum => sum_weight, :percentage => sum_percentage / sum_weight_questions }\n end\n end\n\n # compute the total sum\n sum_weight_questions = answers.inject(0.0) { |s, answer| s += answer.question(knowledge).weight }\n explanations.each do |product_idurl, explanation|\n sum_weight = answers.inject(0.0) { |s, answer| s += explanation[answer.question_idurl][:sum] }\n sum_percentage = answers.inject(0.0) { |s, answer| s += (explanation[answer.question_idurl][:percentage] * answer.question(knowledge).weight) }\n\n explanation[\"aggregated_dimensions\"] = {:sum => sum_weight, :percentage => sum_percentage / sum_weight_questions }\n end\n\n [explanations, hash_dimension2answers, hash_question_idurl2min_max_weight]\n end",
"title": ""
},
{
"docid": "5465769dca431da5bd797edc15f48f3a",
"score": "0.54658353",
"text": "def populate_display(current_qid)\n questions = Array.new {Hash.new}\n while current_qid != nil\n current_question = Questionnaire.find(current_qid)\n associated_answer = Answers.get_answer_from current_question\n\n # put question to front so it is in order from first to last question\n questions.unshift({:question => current_question.question, :answer => associated_answer})\n if current_qid != Questionnaire.get_root_question_id # root question has no parent question\n @current_selected_answers.push(Answers.get_answer_leading_to(current_question).id) \n end\n\n current_qid = current_question.parent_id\n end\n questions\n end",
"title": ""
},
{
"docid": "f32709a079b4887e7eb78ce92596781f",
"score": "0.5461294",
"text": "def create_assessment\n @unique_questions = []\n\n questions = QuizQuestion.for_language_course(self, [\"multiple_choice\", \"short_answer\"])\n questions_grouped_by_lesson = questions.group_by(&:lesson_id).values.shuffle\n\n setup_multiple_choice_questions(questions_grouped_by_lesson)\n setup_short_answer_questions(questions_grouped_by_lesson)\n\n @unique_questions\n end",
"title": ""
},
{
"docid": "cda624c5ff06ae54863ecb82019f116d",
"score": "0.54496354",
"text": "def render_answer_form(form, question_entity)\n prefix = prefix_for_form(form) + \"[answers]\"\n answer = form.object.build_answers # answer belonging to answer_responder(form.object)\n answer.questionnaire_run_id = question_entity.run_id # answer also belongs to question_entity\n options = question_entity.options_from_question\n case question_entity.question_type\n when Questionnaire::Free_Form_Type\n render :partial => \"answers/textarea_answering\",\n :locals => {:answer => answer, :prefix => prefix}\n when Questionnaire::Single_Choice_Type\n render :partial => \"answers/radio_answering\",\n :locals => {:answer => answer, :prefix => prefix, :options => options}\n when Questionnaire::Multiple_Choice_Type\n render :partial => \"answers/checkbox_answering\",\n :locals => {:answer => answer, :prefix => prefix, :options => options}\n end \n end",
"title": ""
},
{
"docid": "e32ff0b2e8b6dcffbc2e5899e8a810a0",
"score": "0.5439474",
"text": "def as_answerlets(options)\n ((options[:kind] == \"original\" ? food_groups : food_groups_update) || {}).map do |ing, nutrients|\n Answerlet.new(match_answer: self, ingredient: ing, nutrients: nutrients, kind: options[:kind],\n modified: options[:kind] == \"update\" && nutrients.sort != food_groups[ing].sort)\n end\n end",
"title": ""
},
{
"docid": "0ee4bc6ef13ad29c1f270d37b3a44e9b",
"score": "0.54388446",
"text": "def questions_and_answers\n @questions_and_answers ||= QuestionsAndAnswers.new(group.custom_questions.required, custom_answers)\n end",
"title": ""
},
{
"docid": "91a57453f75bae10ffc63ad497c3b283",
"score": "0.5417572",
"text": "def show\n # @answers = @response.answers\n # @questionnaire_name = @response.questionnaire.name\n # @user = @response.user\n end",
"title": ""
},
{
"docid": "f77ffc45114d5c0557d2710f920b70d2",
"score": "0.5416591",
"text": "def quizzes\n if @quiz_divs\n @quiz_divs.map do |quiz_div|\n arr = quiz_div.children.inner_text.split(\"\\n\").delete_if(&:blank?)\n {\n title: arr[1],\n options: arr[2..-3],\n explanation: arr[-2]\n }\n end\n end\n end",
"title": ""
},
{
"docid": "63a094325ced4a76569efb8920b5bfcc",
"score": "0.54160756",
"text": "def all_answers_for(question)\n answers.select {|a| a.question == question}\n end",
"title": ""
},
{
"docid": "a86498cfb27edbe23730c9cad9916fdf",
"score": "0.54106355",
"text": "def prebooking_questions\n\n # this is a patch\n if @url.blank? or @token.blank?\n return []\n end\n\n [\n {\n question: \"How many guests will be riding with you?\", \n choices: [0,1,2,3], \n code: \"guests\"\n },\n {\n question: \"How many attendants will be riding with you?\", \n choices: [0,1,2,3], \n code: \"attendants\"\n },\n {\n question: \"How many mobility devices will you be bringing?\", \n choices: [0,1,2,3], \n code: \"mobility_devices\"\n },\n {\n question: \"What is your trip purpose?\", \n choices: (trip_purposes[\"trip_purposes\"] || \n Config.ride_pilot_purposes.try(:map) {|k,v| {\"name\" => k, \"code\" => v}} || \n []).map{|p| [p[\"name\"], p[\"code\"]]}, \n code: \"purpose\"\n }\n ]\n end",
"title": ""
},
{
"docid": "b6b9387142057b49e718eed8f1613b6e",
"score": "0.53995717",
"text": "def answers\n request('answers')\n end",
"title": ""
},
{
"docid": "fd4802b3847ae8541517c006ac451582",
"score": "0.5398991",
"text": "def survey_answer_for attempt, question\n question.field(attempt: attempt, answer: attempt.answer_to(question))\n\n render partial: question.field.show_path, locals: { question: question }\n end",
"title": ""
},
{
"docid": "3fbf0bc092b7c3a9d7d3af7fe3fa057c",
"score": "0.53982496",
"text": "def index\n #show answers for particular survey\n @survey = Survey.find(params[:survey_id])\n @answers = @survey.answers.order(\"question_id, created_at\")\n \n #show answers for specific question\n if (params[:question_id])\n @question = Question.find(params[:question_id])\n @answers = @question.answers.order(\"question_id, created_at\")\n end\n #show answers for specific response\n if (params[:response_id])\n @response = Response.find(params[:response_id])\n @answers = @response.answers.order(\"question_id\")\n end\n end",
"title": ""
},
{
"docid": "43313c98f7922cd3157a8dd655ac5b65",
"score": "0.5388725",
"text": "def to_a\n appointments.each_with_object([]) do |appt, accumulator|\n key = context_key(appt)\n next unless hashed_questionnaires.key?(key)\n\n accumulator << { appointment: appt.to_h, questionnaire: questions_with_qr(key) }\n end\n end",
"title": ""
},
{
"docid": "27bed90a68550532786e708b878a8ff9",
"score": "0.5388213",
"text": "def create_answers_if\n if self.type.name == 'satisfaction-100'\n 5.times do |n|\n Answer.create(question: self, value: (n*25).to_s + \"%\")\n end\n end\n if self.type.name == 'free-text'\n Answer.create(question: self, value: \"textarea\")\n end\n end",
"title": ""
},
{
"docid": "5a092dc17cdbaf89ac61d00793b3df21",
"score": "0.53774804",
"text": "def complete(count, answer = nil, questionnaire_min, questionnaire_max, dropdown_or_scale)\n html = '<div><label for=\"responses_' + count.to_s + '\">' + txt + '</label></div>'\n question_advices = QuestionAdvice.where(question_id: id).sort_by(&:id)\n advice_total_length = 0\n question_advices.each do |question_advice|\n advice_total_length += question_advice.advice.length if question_advice.advice && question_advice.advice != ''\n end\n # show advice given for different questions\n html += advices_criterion_question(count, question_advices) if !question_advices.empty? && (advice_total_length > 0)\n # dropdown options to rate a project based on the question\n html += dropdown_criterion_question(count, answer, questionnaire_min, questionnaire_max) if dropdown_or_scale == 'dropdown'\n # scale options to rate a project based on the question\n html += scale_criterion_question(count, answer, questionnaire_min, questionnaire_max) if dropdown_or_scale == 'scale'\n safe_join([''.html_safe, ''.html_safe], html.html_safe)\n end",
"title": ""
},
{
"docid": "c6aeacf7d4d146cf036a12278f1725bc",
"score": "0.53691286",
"text": "def show\n @questions = Question.find(params[:id])\n @answers = @question.answers.all\n end",
"title": ""
},
{
"docid": "0e0f3a8662b3c111e2b231fcce7b8d82",
"score": "0.5366825",
"text": "def answer_form\n AnswerForm.new(view_context)\n end",
"title": ""
},
{
"docid": "623540e5e4c18cb0b4f0aab8eba7223e",
"score": "0.53590935",
"text": "def show\n @qa = Qa.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :xml => @qa.to_json(:include => [:answer, :question]) }\n end\n end",
"title": ""
},
{
"docid": "9e78451bb409b48d12ce9f838a626613",
"score": "0.5356919",
"text": "def answers_by_views(options={})\n parse_answers(request(singular(id) + \"answers/views\", options))\n end",
"title": ""
},
{
"docid": "18086b061dc9d3a8a1d62fbe549e94bf",
"score": "0.53413016",
"text": "def render_answer_entity(answer_entity, question_entity)\n (answer = answer_entity.answer).blank? and return \"\"\n options = question_entity.options_from_question\n case question_entity.question_type\n when Questionnaire::Free_Form_Type\n answer\n when Questionnaire::Single_Choice_Type\n choiced = answer.to_i\n correct_answer = question_entity.correct_ans\n render :partial => \"answers/radio_answer\",\n :locals => {:options => options, :choiced => choiced, :correct_answer => correct_answer}\n when \"checkbox\"\n choiced = answer_entity.multiple_choice_answers\n render :partial => \"answers/checkbox_answer\",\n :locals => {:options => options, :choiced => choiced}\n end \n end",
"title": ""
},
{
"docid": "3d3bd35fb211a7b4c31e90b6a1855800",
"score": "0.5337412",
"text": "def show\n idx = params[:id]\n @question = Question.find(params[:id])\n @newAnswer = Answer.new(:question_id => params[:id])\n @Answers = Answer.where(question_id: idx)\n @answer = Answer.all\n end",
"title": ""
},
{
"docid": "949c52dbda62a6c62f8ffd1261259c5f",
"score": "0.5329791",
"text": "def info() quiz_question.info end",
"title": ""
},
{
"docid": "d5b2e4fcc5c248dfa076c46362ab3a39",
"score": "0.532553",
"text": "def quiz_answer(quiz)\n if quiz.answer_type == 'multi'\n show_multi_answer(quiz.answers.first.text, quiz.answer_input)\n elsif quiz.answer_type == 'check'\n show_check_answer(quiz.answers.first.text, quiz.answer_input)\n else\n quiz.answers.first.text\n end\n end",
"title": ""
},
{
"docid": "8a08d9929b963205923ff6e98c277327",
"score": "0.5306936",
"text": "def inspect_question(q)\n index_question(q) unless q.tag.empty?\n ref_question(q)\n q.answers.each { |a| ref_answer(q, a) }\n end",
"title": ""
},
{
"docid": "1f9f72f6cc0d2e02bd7f2e26c69df301",
"score": "0.53062344",
"text": "def show\n # raise \"#{params}\"\n @answers = @question.answers.offset(1) # exclude the first record\n # because it's attached to question\n @answer = @question.answers.first\n @answer_tags = @answer.answer_tags\n @tags = []\n @answer_tags.each do |answer_tag|\n tag = Tag.find(answer_tag[:tag_id])\n @tags.push(tag)\n end\n end",
"title": ""
},
{
"docid": "1960228317fd736ca0d6c7fea24ee908",
"score": "0.5305568",
"text": "def sibling_responses\n ac = {answer_choice_id: self.answer_choice_id, id: self.id}\n Response.find_by_sql([<<-SQL, ac])\n SELECT\n\t\t\t\t\trespones.*\n\t\t\t\tFROM (\n\t\t\t\t\tSELECT\n\t\t\t\t\t\tquestions.*\n\t\t\t\t\tFROM\n\t\t\t\t\t\tquestions\n\t\t\t\t\t\t\tJOIN answer_choices ON answer_choices.question_id = questions.id\n\t\t\t\t\tWHERE\n\t\t\t\t\t\tanswer_choices.id = :answer_choice_id\n\t\t\t\t\t) AS quest\n\t\t\t\t\tJOIN\n\t\t\t\t\t\tanswer_choices ON answer_choices.question_id = questions.id\n\t\t\t\t\tJOIN\n\t\t\t\t\t\tresponses ON responses.answer_choice_id = answer_choices.id\n\t\t\t\t\tWHERE\n\t\t\t\t\t\t(responses.id != :id)\n\t\t\t\tSQL\n end",
"title": ""
},
{
"docid": "d1dbd2b8e5ad8fdee28d65280a8ed520",
"score": "0.53038496",
"text": "def show_explanation\n @room = current_user.room\n @question = @room.question\n return if !@room.show_explanation?\n last_choice = current_user.histories.last.choice if !current_user.histories.empty?\n current_user_choice = (last_choice and last_choice.question_id==@question.id) ? last_choice : nil\n\n puts \"User #{current_user.id} chose #{current_user_choice.id if current_user_choice}\"\n @choices = @question.choices.collect do |choice| {\n data: choice,\n result: if choice.correct\n \"correct\"\n elsif current_user_choice and choice.id==current_user_choice.id\n \"selected\"\n end,\n selected: @room.active_users.all.select {|u| u.histories.last.choice_id == choice.id if !u.histories.empty?}\n }\n end\n messages = {\n correct: \"Congratulations! You got the right answer.\",\n incorrect: \"Sorry, you got the wrong answer. See explanation below.\",\n blank: \"You didn't select an answer. See explanation below.\"\n }\n styles = {\n correct: \"alert alert-success\",\n incorrect: \"alert alert-error\",\n blank: \"alert\"\n }\n # If there's a choice_id (user chose a choice) and that choice is correct\n if current_user.status != 0\n #If user didn't select answer\n if current_user_choice==nil\n @change= current_user.lose_to!(@question)\n @message = messages[:blank]\n @style = styles[:blank]\n #If user chose an incorrect answer\n elsif !current_user_choice.correct?\n @change = current_user.lose_to!(@question)\n @message = messages[:incorrect]\n @style = styles[:incorrect]\n else\n @change = current_user.win_to!(@question)\n @message = messages[:correct]\n @style = styles[:correct]\n end\n end\n render partial: \"show_explanation\"\n end",
"title": ""
},
{
"docid": "f3dfca211bce5d9f881bd6fd63bd2df1",
"score": "0.53022593",
"text": "def answers(options={})\n self.class.parse_answers(request(singular(user_id) + \"/answers\", options))\n end",
"title": ""
},
{
"docid": "d85359d94c1fa73ba8ae607e62f70d95",
"score": "0.52962714",
"text": "def answers\n [answer_1, answer_2]\n end",
"title": ""
},
{
"docid": "e41f62b82c72758b845b1884b0563e4d",
"score": "0.5295512",
"text": "def make_vote_data(question_id) #:doc:\n result = ActiveRecord::Base.connection.execute(\n \"SELECT items_votes.item_id AS winner_id, items_prompts.item_id AS\n loser_id, votes.tracking FROM votes INNER JOIN prompts ON (prompts.id=votes.prompt_id\n AND prompts.question_id=#{question_id}) INNER JOIN items_votes ON\n (items_votes.vote_id=votes.id) INNER JOIN items_prompts ON\n items_prompts.prompt_id=prompts.id AND items_prompts.item_id!=\n items_votes.item_id\"\n )\n votes = {}\n visits = []\n items = []\n # use votes.tracking to distinguish visitors\n while rec = result.fetch_hash\n winner_id, loser_id = rec['winner_id'], rec['loser_id']\n for id in [winner_id, loser_id]\n items << id unless items.include?(id)\n end\n winner = items.index(winner_id)\n loser = items.index(loser_id)\n\n tracking = rec['tracking']\n unless visits.include?(tracking)\n votes[visits.length] = []\n visits << tracking\n end\n visit = visits.index(tracking)\n # votes[visit] << [winner, loser]\n votes[visit] << winner << loser\n end\n result.free\n [votes, visits, items]\n end",
"title": ""
},
{
"docid": "f98e80cd8614b22e655ddfca86234732",
"score": "0.52871895",
"text": "def answer\n if answered?\n answers.last.answer\n else\n [{:answer => \"not answered\"}]\n end\n end",
"title": ""
},
{
"docid": "474f530849ff2da3b9058955f33bba2b",
"score": "0.5284144",
"text": "def index\n @quizzes_answers = Quizzes::Answer.all\n end",
"title": ""
},
{
"docid": "65055c3ac2fc944c742726ce833721e2",
"score": "0.52809006",
"text": "def show \n @answers = @question.answers\n @photos = @question.photos\nend",
"title": ""
},
{
"docid": "486e5ea162d3d05183b287ac0495f16b",
"score": "0.5275614",
"text": "def index\n @given_answers = GivenAnswer.all\n end",
"title": ""
},
{
"docid": "b79aa04b1cd895c7b02c81719b52249e",
"score": "0.52731985",
"text": "def show\n authorize! :answer, @questionnaire\n\n respond_to do |format|\n format.html {\n @answer_set = AnswerSet.new()\n @answer_set.questionnaire_id = @questionnaire.id\n @answer_set.init_questionnaire(@questionnaire)\n }\n format.json { render :json => @questionnaire.questions.to_json }\n end\n end",
"title": ""
},
{
"docid": "5887f75b8511079cf9e777cdaa745edc",
"score": "0.5257529",
"text": "def show\n @question_sheet = @answer_sheet.question_sheet\n pf = Qe.table_name_prefix\n @elements = @question_sheet.pages.collect {|p| p.elements.includes(:pages).order(\"#{pf}pages.number,#{pf}page_elements.position\").all}.flatten\n @elements = QuestionSet.new(@elements, @answer_sheet).elements.group_by{ |e| e.pages.first }\n end",
"title": ""
},
{
"docid": "518d33a9741814452b4dae115e26cf35",
"score": "0.5252565",
"text": "def relatedQuestions(section)\n relQuestions = []\n\n questions = sectionQuestions(pretest())\n questions.each do |question|\n question.getActivityReferences.getVector.each do |reference|\n if section.equals(reference.getReferencedObject)\n relQuestions << question\n break\n end\n end\n end\n \n relQuestions\nend",
"title": ""
},
{
"docid": "518d33a9741814452b4dae115e26cf35",
"score": "0.5252565",
"text": "def relatedQuestions(section)\n relQuestions = []\n\n questions = sectionQuestions(pretest())\n questions.each do |question|\n question.getActivityReferences.getVector.each do |reference|\n if section.equals(reference.getReferencedObject)\n relQuestions << question\n break\n end\n end\n end\n \n relQuestions\nend",
"title": ""
},
{
"docid": "c7b617c27f04dc51fb39f14e11f74d57",
"score": "0.52493274",
"text": "def relatedQuestions(section)\n relQuestions = []\n \n questions = sectionQuestions(pretest())\n questions.each do |question|\n question.getActivityReferences.getVector.each do |reference|\n if section.equals(reference.getReferencedObject)\n relQuestions << question\n break\n end\n end\n end\n \n relQuestions\n end",
"title": ""
},
{
"docid": "9847c16ba9a01bee58f67291385b6189",
"score": "0.52475005",
"text": "def answer_present\n if self.question.qtype == 'one_response' && self.response_id.nil?\n errors.add(:base, 'Please fill in an answer before leaving this page.' )\n return false\n elsif self.question.qtype == 'likert_scale' && self.response_id.nil?\n errors.add(:base, 'Please fill in an answer before leaving this page.' )\n return false\n\n elsif self.question.qtype == 'rank_three' \n responses = self.multianswers.map( &:rank ).compact\n if responses.length == 3 \n array_wanted = [1, 2, 3]\n if array_wanted == responses.sort\n return true\n else \n errors.add(:base, 'Please ensure all items are unique.' )\n return false\n end \n else \n errors.add(:base, 'Please ensure 3 items are ranked.' )\n return false\n end\n\n elsif self.question.qtype == 'rank_five' \n responses = self.multianswers.map( &:rank ).compact\n if responses.length == 5 \n array_wanted = [1, 2, 3, 4, 5]\n if array_wanted == responses.sort\n return true\n else \n errors.add(:base, 'Please ensure all items are unique.' )\n return false\n end \n else \n errors.add(:base, 'Please ensure 5 items are ranked.' )\n return false\n end\n end\n end",
"title": ""
},
{
"docid": "6bed85e8874dfd3a1bca71ffef87accf",
"score": "0.5237141",
"text": "def answer_params\n params.permit(:assignment_id)\n params.permit(:page)\n params.require(:answer).permit(:response, :revision_name, :revision_list, :question_id, :user_id, :predicted_score, :current_score, :evaluations_wanted, :total_evaluations, :confidence, :assignment_id,\n :reflection, :review_request, :revision_email_sent, :useful_feedback)\n end",
"title": ""
},
{
"docid": "ff983a0daf5ff03a9579b2ceec90d6c4",
"score": "0.52345467",
"text": "def answer_dictionary (profile)\n answers = {}\n profile['answers'].each do |answer|\n answers << {\n answer['questionId'] => answer\n }\n end\n answers\nend",
"title": ""
},
{
"docid": "142edf04f3a580dd2b52e85ec97dd63b",
"score": "0.5234179",
"text": "def index\n render status: :ok, json: @simple_question_alternatives\n end",
"title": ""
},
{
"docid": "4d415ecc0e52b0e20486917e004d336a",
"score": "0.5225988",
"text": "def answer(params={})\n matching_answer_class.new(params.merge(question: self))\n end",
"title": ""
},
{
"docid": "20d6517c93f785a4c3c419d8d68217d7",
"score": "0.5225543",
"text": "def index\n @answers = @question.answers\n respond_with( @answers )\n end",
"title": ""
},
{
"docid": "0e520c33d25de4d7871c539f50cfef67",
"score": "0.52252984",
"text": "def show\n @answer = Answer.new\n @comment_question = CommentQuestion.new\n @comment_report_question = CommentReportQuestion.new\n @question_report = QuestionReport.new\n @comment_report_answer = CommentReportAnswer.new\n end",
"title": ""
},
{
"docid": "53967d764ec3c2605a8448eccf51cb26",
"score": "0.522378",
"text": "def populate_from_hash(hash)\n # Response mission should already be set\n raise \"Submissions must have a mission\" if @response.mission.nil?\n\n Odk::DecoratorFactory.decorate_collection(@response.form.children).each do |item|\n if item.group?\n (hash[item.odk_code] || []).each_with_index do |instance, inst_num|\n item.children.each do |qing|\n add_answers_for_qing(Odk::DecoratorFactory.decorate(qing), instance, inst_num + 1)\n end\n end\n else\n add_answers_for_qing(item, hash, 1)\n end\n end\n @response.incomplete ||= (hash[Odk::FormDecorator::IR_QUESTION] == \"yes\")\n end",
"title": ""
},
{
"docid": "91e1df2c3bcf32822b8b15705a242652",
"score": "0.5223519",
"text": "def to_hash\n {\n response_id: response_id,\n question_id: question_id,\n option_id: option_id,\n question_pipe: question_pipe,\n submitted_at: submitted_at,\n survey_id: survey_id,\n other_text: other_text,\n answer_text: option_id || other_text ? nil : answer_text\n }.reject { |k, v| v.nil? }\n end",
"title": ""
},
{
"docid": "b4ec2870264559e59886d093b00307f9",
"score": "0.5221612",
"text": "def make_question_answer_tree\n before :each do\n @reply = 1\n @type_vendor = make_forms_for_app_type \"vendor\"\n @type_donor = make_forms_for_app_type \"donor\"\n \n @q1 = Questionnaire.create(:question => \"hello world\")\n @q2 = Questionnaire.create(:question => \"how are you?\")\n @a1a = Answers.create(:ans => \"hi\", :questionnaire_id => @q1.id, :leads_to => @q2.id)\n @a1b = Answers.create(:ans => @type_donor.app_type, :questionnaire_id => @q1.id, :results_to => @type_donor.id)\n @a2 = Answers.create(:ans => @type_vendor.app_type, :questionnaire_id => @q2.id, :results_to => @type_vendor.id)\n @q2.parent_id = @a1a.id\n @q2.save\n end\n end",
"title": ""
},
{
"docid": "3c1073e4f2d35c8acabbf711b6f444bf",
"score": "0.522141",
"text": "def answers\n return @answers\n end",
"title": ""
},
{
"docid": "fb15daa7e23d0b884df6a48b4787cb9f",
"score": "0.5220522",
"text": "def index\n @responses = @survey.responses\n @questions = Question.all\n end",
"title": ""
},
{
"docid": "2534025e83b4a6f9b222fb85da6c51e3",
"score": "0.5219048",
"text": "def answer_texts\n self.answers.map { |a| a.choice }\n end",
"title": ""
},
{
"docid": "2534025e83b4a6f9b222fb85da6c51e3",
"score": "0.5219048",
"text": "def answer_texts\n self.answers.map { |a| a.choice }\n end",
"title": ""
},
{
"docid": "d9432163e402599ee6a070c1aa091daa",
"score": "0.52140725",
"text": "def show\n \n load_quiz_section_and_question\n load_option\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @option }\n end\n end",
"title": ""
}
] |
731df24d5dbab592a4f72150bdbe24e7 | PUT /prizes/1 PUT /prizes/1.json | [
{
"docid": "97510980040b29e497414e4b4f648db0",
"score": "0.61921686",
"text": "def update\n @prize = Prize.find(params[:id])\n\n respond_to do |format|\n if @prize.update_attributes(params[:prize])\n format.html { redirect_to @prize, notice: 'Prize was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @prize.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] | [
{
"docid": "a4530fa50876643fa2a05de5c23da8fb",
"score": "0.61975837",
"text": "def update\n respond_to do |format|\n if @prize.update(prize_params) && @prize.inventory.update(qty_available: @prize.qty_available)\n format.html { redirect_to admin_prize_path(@prize), notice: t(:updated, scope:'actioncontroller.prize') }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @prize.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "eaa377fcff8440ab48da56e1fad40059",
"score": "0.6035297",
"text": "def update\n @size = Size.find_by(params[:id])\n respond_to do |format|\n if @size.update(size_params)\n format.html { redirect_to @size, notice: 'size was successfully updated.' }\n format.json { render :show, status: :ok, location: @size }\n else\n format.html { render :edit }\n format.json { render json: @size.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1c88954da843b4d172f456db3327c4aa",
"score": "0.5939571",
"text": "def update\n @size = Size.find(params[:id])\n\n respond_to do |format|\n if @size.update_attributes(params[:size])\n format.html { redirect_to @size, notice: 'Size has been updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @size.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "78000cd45ec71f270d06691cf743bb45",
"score": "0.5930327",
"text": "def update\n @product.sizes = params[:product][:sizes]\n if @product.update(product_params)\n update_product_filter\n render json: @product, status: :ok\n else\n render_api_error(0, 422, 'error', @product.errors) \n end\n end",
"title": ""
},
{
"docid": "2572fb900123dab962d92dfd5cd31505",
"score": "0.5916551",
"text": "def update\n spice = Spice.find_by(id: params[:id])\n spice.update(spice_params)\n render json: spice\nend",
"title": ""
},
{
"docid": "bcce266e6c4aecbccc4f4fadaacbb6c9",
"score": "0.5904183",
"text": "def update\n if @user_prize.update(user_prize_params)\n render json: @user_prize, status: :ok, location: @user_prize\n else\n render json: @user_prize.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "188a7f2b5505804aab9aeaab566198e6",
"score": "0.5878576",
"text": "def update\n @prize = Prize.find(params[:id])\n respond_to do |format|\n if @prize.update_attributes(params[:prize])\n format.html { redirect_to @prize, notice: 'O prêmio foi atualizado com sucesso.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @prize.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a96c107bf04b09edaf08857b1a15d868",
"score": "0.58736074",
"text": "def set_prize\n @prize = Prize.find(params[:id])\n end",
"title": ""
},
{
"docid": "610900c1038b4df404037123228dfa35",
"score": "0.5771686",
"text": "def update\n @sizing = Sizing.find(params[:id])\n\n respond_to do |format|\n if @sizing.update_attributes(params[:sizing])\n format.html { redirect_to @sizing, notice: 'Sizing was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @sizing.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "174ad5f5537baa8be1164d646d78c44c",
"score": "0.5771023",
"text": "def create\n @product = Product.new(product_params)\n @product.sizes = params[:product][:sizes]\n if @product.save\n render json: @product, status: :created\n else\n render_api_error(0, 422, 'error', @product.errors) \n end\n end",
"title": ""
},
{
"docid": "afe98c2ba1cbfb9e13087540f2f3596b",
"score": "0.5766456",
"text": "def set_prize\n @prize = Prize.find(params[:id])\n end",
"title": ""
},
{
"docid": "afe98c2ba1cbfb9e13087540f2f3596b",
"score": "0.5766456",
"text": "def set_prize\n @prize = Prize.find(params[:id])\n end",
"title": ""
},
{
"docid": "afe98c2ba1cbfb9e13087540f2f3596b",
"score": "0.5766456",
"text": "def set_prize\n @prize = Prize.find(params[:id])\n end",
"title": ""
},
{
"docid": "afe98c2ba1cbfb9e13087540f2f3596b",
"score": "0.5766456",
"text": "def set_prize\n @prize = Prize.find(params[:id])\n end",
"title": ""
},
{
"docid": "afe98c2ba1cbfb9e13087540f2f3596b",
"score": "0.5766456",
"text": "def set_prize\n @prize = Prize.find(params[:id])\n end",
"title": ""
},
{
"docid": "140b951155eb642a052b4fd5b1db6c6e",
"score": "0.57580453",
"text": "def prize_params\n params.require(:prize).permit(:name, :qty_available)\n end",
"title": ""
},
{
"docid": "dca53acfda4012232d64f9bd961e580d",
"score": "0.57296693",
"text": "def set_prize\n @prize = Prize.find(params[:id])\n end",
"title": ""
},
{
"docid": "21d2d358b8f54df840fc4e2b900c52ec",
"score": "0.57282764",
"text": "def set_prize\n @comp = Comp.find(params[:comp_id])\n @prize = @comp.prizes.find(params[:id])\n end",
"title": ""
},
{
"docid": "6b6ee1ceaa3a79f2d51486490b4baec1",
"score": "0.5705481",
"text": "def update\n respond_to do |format|\n if @plan_size.update(plan_size_params)\n format.html { redirect_to @plan_size, notice: 'Plan size was successfully updated.' }\n format.json { render :show, status: :ok, location: @plan_size }\n else\n format.html { render :edit }\n format.json { render json: @plan_size.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "371afdc97426a26f6cc82c87f73995f7",
"score": "0.5699421",
"text": "def update\n @ski_size = SkiSize.find(params[:id])\n\n respond_to do |format|\n if @ski_size.update_attributes(params[:ski_size])\n format.html { redirect_to @ski_size, notice: 'Ski size was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @ski_size.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "60068f0f289176a384f1c3fd373ac1fa",
"score": "0.56891286",
"text": "def update\n @line_item.quantity = params[:quantity]\n @line_item.save\n render json: @line_item\n end",
"title": ""
},
{
"docid": "e0a870f7134198cf9642a1d581e85796",
"score": "0.56792676",
"text": "def update\n respond_to do |format|\n if @prize_provider.update(prize_provider_params)\n format.html { redirect_to @prize_provider, notice: 'Prize provider was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @prize_provider.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b3592029b508cac9969b5d5716784d0f",
"score": "0.56728816",
"text": "def set_size\n @size = size.find(params[:size_id])\n end",
"title": ""
},
{
"docid": "a4d0d4ad875ec472695c910b93d1d77e",
"score": "0.56349427",
"text": "def update\n @prize = Prize.find(params[:id])\n if @prize.update_attributes(params[:prize])\n redirect_to @prize, :flash => { :success => \"Prize updated\" }\n else\n @title = \"Update Prize\"\n render 'edit'\n end\n end",
"title": ""
},
{
"docid": "5415dd9daf19a37d69af7be46cf9143f",
"score": "0.56262606",
"text": "def set_size\n @size = Size.find(params[:id])\n end",
"title": ""
},
{
"docid": "5415dd9daf19a37d69af7be46cf9143f",
"score": "0.56262606",
"text": "def set_size\n @size = Size.find(params[:id])\n end",
"title": ""
},
{
"docid": "5415dd9daf19a37d69af7be46cf9143f",
"score": "0.56262606",
"text": "def set_size\n @size = Size.find(params[:id])\n end",
"title": ""
},
{
"docid": "dec7a8d1b0f8f98382dca81df2e48660",
"score": "0.5624818",
"text": "def destroy\n @prize = Prize.find(params[:id])\n @prize.destroy\n\n respond_to do |format|\n format.html { redirect_to prizes_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "ea416b077fa0aa7e84ec3fe2ef9c3772",
"score": "0.5607948",
"text": "def put\n request_method('PUT')\n end",
"title": ""
},
{
"docid": "ce635e7990a5de7eab174b2d47d4629d",
"score": "0.5601303",
"text": "def prize_params\n params.require(:prize).permit(:name, :description, :sponsor_id, :priority)\n end",
"title": ""
},
{
"docid": "8e18db431964c254de53caa41795b702",
"score": "0.5574077",
"text": "def put *args\n make_request :put, *args\n end",
"title": ""
},
{
"docid": "f8ba4e5137b6197c33fc19267775e390",
"score": "0.55598813",
"text": "def destroy\n @prize = Prize.find(params[:id])\n @prize.destroy\n\n respond_to do |format|\n format.html { redirect_to prizes_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "881ee2d406b61b1247e340639b235e1b",
"score": "0.552899",
"text": "def update\n @siz = Siz.find(params[:id])\n\n respond_to do |format|\n if @siz.update_attributes(params[:siz])\n format.html { redirect_to @siz, notice: 'Siz was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @siz.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "fff28b9db3580b3fdc2b2ade6d853c3b",
"score": "0.5527788",
"text": "def update\n @promotion = Promotion.find(params[:id])\n\n if @promotion.update(promotion_params)\n head :no_content\n else\n render json: @promotion.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "3057668c051f10d532595a7b2b7c37c3",
"score": "0.5517636",
"text": "def update\n @size_list = SizeList.find(params[:id])\n\n if @size_list.update(size_list_params)\n head :no_content\n else\n render json: @size_list.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "82b38d3b6d6b83911ed5dcb22aea1abe",
"score": "0.5502215",
"text": "def update\n Product.update(Product.find_by(name: params[:name]).id , \"inventory_count\" => params[:count])\n render json: \"Success, the object's inventory was updated\"\n end",
"title": ""
},
{
"docid": "15443e2225c486b04e2a7d7d20820526",
"score": "0.54811233",
"text": "def update\n if @spot.update(spot_params)\n render json: @spot\n else\n render json: @spot.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "fbd7c46b15ae2792fd842ba0d764b7d0",
"score": "0.5473858",
"text": "def put uri, args = {}; Request.new(PUT, uri, args).execute; end",
"title": ""
},
{
"docid": "684cccab8717b5866d44a734cb97b5f8",
"score": "0.5468717",
"text": "def put(options = {})\n request :put, options\n end",
"title": ""
},
{
"docid": "6eccf0cb1ebc7404a9ae8d73fad0c91a",
"score": "0.54683423",
"text": "def put(*args)\n request :put, *args\n end",
"title": ""
},
{
"docid": "5963eefc6570ddceb24e005cebee04eb",
"score": "0.5458318",
"text": "def create\n @prize = Prize.new(prize_params)\n @prize.build_inventory(qty_available: @prize.qty_available)\n respond_to do |format|\n if @prize.save\n format.html { redirect_to admin_prize_path(@prize), notice: t(:created, scope:'actioncontroller.prize') }\n format.json { render action: 'show', status: :created, location: @prize }\n else\n format.html { render action: 'new' }\n format.json { render json: @prize.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a1b4792464eea4b9fa38aec443e3fc06",
"score": "0.54405034",
"text": "def update_quota\n # render text: \"hello\" and return\n quota_setting = Carnival.where(survey_id: Carnival::PRE_SURVEY, type: Carnival::SETTING).first\n quota_setting.quota[\"gender\"] = params[:gender].values.map! { |e| e.to_i }\n quota_setting.quota[\"age\"] = params[:age].values.map! { |e| e.to_i }\n quota_setting.quota[\"income\"] = params[:income].values.map! { |e| e.to_i }\n quota_setting.quota[\"education\"] = params[:education].values.map! { |e| e.to_i }\n params[:region].each do |k,v|\n\t quota_setting.quota[\"region\"][k] = v.to_i\n\t\tend\n quota_setting.save\n redirect_to action: :pre_surveys and return\n end",
"title": ""
},
{
"docid": "b2e92ed75e2186fbeddd0e9b7e571f6f",
"score": "0.5439694",
"text": "def update\n respond_to do |format|\n if @shoe_size.update(shoe_size_params)\n format.html { redirect_to @shoe_size, notice: 'Shoe size was successfully updated.' }\n format.json { render :show, status: :ok, location: @shoe_size }\n else\n format.html { render :edit }\n format.json { render json: @shoe_size.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "cd1240546fafa9d0a819cec6e3886bc2",
"score": "0.54179305",
"text": "def update\n respond_to do |format|\n if @size_option.update(size_option_params)\n format.html { redirect_to @size_option, notice: 'Size option was successfully updated.' }\n format.json { render :show, status: :ok, location: @size_option }\n else\n format.html { render :edit }\n format.json { render json: @size_option.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a9fcfc0809e23d982bc280317292a643",
"score": "0.5417673",
"text": "def size_update\n @order = Order.find(params[:id])\n all_params = {line_items: line_item_params,\n prop_params: properties_params,\n order_id: params[:id],\n recharge_token: ENV['RECHARGE_TOKEN'],\n current_user_id: current_user.id,\n }\n recharge_size_update(all_params)\n redirect_to :action => \"show\", :id => params[:id]\n end",
"title": ""
},
{
"docid": "28333f0e170e0746a1503936e660ee98",
"score": "0.5415796",
"text": "def update\n respond_to do |format|\n if @vm_size.update(vm_size_params)\n format.html { redirect_to @vm_size, notice: 'Vm size was successfully updated.' }\n format.json { render :show, status: :ok, location: @vm_size }\n else\n format.html { render :edit }\n format.json { render json: @vm_size.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "866189ec60d5c0c5b37bea5baebf4406",
"score": "0.5412639",
"text": "def save_floorplan_settings(args = {}) \n put(\"/userproperties.json/floorplan/#{args[:floorplanId]}\", args)\nend",
"title": ""
},
{
"docid": "6bb3bca5bbff4bc5e535c2c1ee3043bf",
"score": "0.5407792",
"text": "def update\n @size_option = SizeOption.find(params[:id])\n\n respond_to do |format|\n if @size_option.update_attributes(params[:size_option])\n format.html { redirect_to admins_size_options_url, notice: 'Shirt size was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @size_option.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "cce33f4024c7a68f7911919e5510d2f8",
"score": "0.5396414",
"text": "def put(options)\n post(options)\n end",
"title": ""
},
{
"docid": "1637b166a6f4d45ad73c2efd4ea40e5f",
"score": "0.53919685",
"text": "def update\n if @additive.update(params.permit(:quantity, :description))\n render json: @additive \n else\n\t\t\t\trender json: @additive.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "9df77e909babf99582c29a3b748911a6",
"score": "0.5389307",
"text": "def update\n user_item = UserItem.find(params[:id])\n user_item.update(quantity: user_item_params[:quantity])\n render json: user_item\n end",
"title": ""
},
{
"docid": "6b08baddaa3202efbcad4b03c8e1df06",
"score": "0.5380223",
"text": "def update\n @tire_size = TireSize.find(params[:id])\n\n respond_to do |format|\n if @tire_size.update_attributes(params[:tire_size])\n format.html { redirect_to @tire_size, notice: 'Tire size was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @tire_size.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2afa62d40b44a4dd35d3d7a8529574f1",
"score": "0.5372057",
"text": "def put(request)\n policyfile_data = parse_json(request.body)\n policy_name = request.rest_path[5]\n revision_id = policyfile_data[\"revision_id\"]\n\n # If the policy revision being submitted does not exist, create it.\n # Storage: /organizations/ORG/policies/POLICY/revisions/REVISION\n policyfile_path = request.rest_path[0..1] + [\"policies\", policy_name, \"revisions\", revision_id]\n unless exists_data?(request, policyfile_path)\n create_data(request, policyfile_path[0..-2], revision_id, request.body, :create_dir)\n end\n\n # if named policy exists and the given revision ID exists, associate the revision ID with the policy\n # group.\n # Storage: /organizations/ORG/policies/POLICY/revisions/REVISION\n response_code = exists_data?(request) ? 200 : 201\n set_data(request, nil, to_json(revision_id), :create, :create_dir)\n\n already_json_response(response_code, request.body)\n end",
"title": ""
},
{
"docid": "a1180b85a98a5e652f2c5f2f1e253ca7",
"score": "0.53719324",
"text": "def put\n end",
"title": ""
},
{
"docid": "f544b8d44f0f010d7a5e8cae9503dc87",
"score": "0.5367349",
"text": "def create\n @prize = Prize.new(params[:prize])\n\n respond_to do |format|\n if @prize.save\n format.html { redirect_to url_for(:controller=>\"prizes\", :action=>\"index\"), notice: 'Prize was successfully created.' }\n format.json { render json: @prize, status: :created, location: @prize }\n else\n format.html { render action: \"new\" }\n format.json { render json: @prize.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d36582c2ad0354160a286992894970c9",
"score": "0.53625995",
"text": "def update\n @contest_prize = ContestPrize.find(params[:id])\n\n respond_to do |format|\n if @contest_prize.update_attributes(params[:contest_prize])\n format.html { redirect_to @contest_prize, notice: 'Contest prize was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @contest_prize.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4f48118b6e4ff08be980b30127783444",
"score": "0.5357899",
"text": "def update\n respond_to do |format|\n if @pricing_bill.update(pricing_bill_params)\n format.json { head :no_content }\n else\n format.json { render json: @pricing_bill.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4bb06384cb72b8b8745a18a2aa293503",
"score": "0.5353287",
"text": "def destroy\n @prize = Prize.find(params[:id])\n @prize.destroy\n redirect_to prizes_path\n end",
"title": ""
},
{
"docid": "f2f92be40fad3a788904431f6e1abe3c",
"score": "0.5349707",
"text": "def update\n respond_to do |format|\n if @product_size.update(product_size_params)\n format.html { redirect_to @product_size, notice: 'Product size was successfully updated.' }\n format.json { render :show, status: :ok, location: @product_size }\n else\n format.html { render :edit }\n format.json { render json: @product_size.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8d39e0d39d17057879b4956b197b156f",
"score": "0.53496104",
"text": "def prize_params\n params.require(:prize).permit(:name, :ncoin, :img)\n end",
"title": ""
},
{
"docid": "596decc948ce5b8583cd3ab80358fb63",
"score": "0.5347326",
"text": "def update!(**args)\n @quantity = args[:quantity] if args.key?(:quantity)\n @size_gb = args[:size_gb] if args.key?(:size_gb)\n end",
"title": ""
},
{
"docid": "596decc948ce5b8583cd3ab80358fb63",
"score": "0.5347326",
"text": "def update!(**args)\n @quantity = args[:quantity] if args.key?(:quantity)\n @size_gb = args[:size_gb] if args.key?(:size_gb)\n end",
"title": ""
},
{
"docid": "596decc948ce5b8583cd3ab80358fb63",
"score": "0.5347326",
"text": "def update!(**args)\n @quantity = args[:quantity] if args.key?(:quantity)\n @size_gb = args[:size_gb] if args.key?(:size_gb)\n end",
"title": ""
},
{
"docid": "882c8317370987b86425c0adbf5bfe8c",
"score": "0.53428143",
"text": "def update_aos_version(args = {}) \n put(\"/aosversions.json/#{args[:aosVersionId]}\", args)\nend",
"title": ""
},
{
"docid": "e85282fc6869428df08fcab7116d0e2e",
"score": "0.5335311",
"text": "def update\n respond_to do |format|\n if @applied_size.update(applied_size_params)\n format.html { redirect_to @applied_size, notice: 'Applied size was successfully updated.' }\n format.json { render :show, status: :ok, location: @applied_size }\n else\n format.html { render :edit }\n format.json { render json: @applied_size.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1c35f89f4e93251128bbf53c08021b3d",
"score": "0.53331864",
"text": "def update\n @company_id = company_params[:company_id]\n @reponse = HTTParty.put(\"https://rails-api-ipo.herokuapp.com/api/v1/companies/#{@company_id}.json\",\n :body => {:company_name => company_params[:company_name]}.to_json,\n :headers => { 'Content-Type' => 'application/json' } )\n respond_to do |format|\n format.html { redirect_to '/companies/'+(@reponse['id'].to_s), notice: 'Company was successfully created.' }\n end\n end",
"title": ""
},
{
"docid": "9c60f64bf45a3ac1d676bdf5d0805005",
"score": "0.53155774",
"text": "def update\n respond_to do |format|\n if @quize.update(quize_params)\n format.html { redirect_to @quize, notice: \"Quize was successfully updated.\" }\n format.json { render :show, status: :ok, location: @quize }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @quize.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "475b33cdc423c003ae227762695b3a58",
"score": "0.5308819",
"text": "def product_size_params\n params.require(:product_size).permit(:name, :collection_id)\n end",
"title": ""
},
{
"docid": "f2df519f5f3e4e97f5d15ef1cce8d418",
"score": "0.5306455",
"text": "def update\n vote_id = params.require(:id)\n vote_params = params.require(:vote).\n permit(vote_proposal_options_attributes: [:id, :_destroy])\n if vote_params.blank?\n vote_params = params.require(:vote).permit(vote_proposal_option_ids: [])\n end\n \n id = vote_params[:vote_proposal_option_ids][0]\n\n # Detect does not hit database.\n vote = current_or_guest_user.votes.detect {|vote| vote.id == vote_id.to_i }\n proposal = vote.vote_proposal\n option = proposal.vote_proposal_options.detect {|opt| opt.id == id.to_i }\n\n begin \n current_or_guest_user.vote proposal, option\n status = \"ok\"\n rescue ArgumentError\n status = \"invalid\"\n end\n\n proposal.publish\n\n respond_to do |format|\n format.html {\n redirect_back(fallback_location: vote_proposal_path(proposal))\n }\n format.json {\n if status == \"ok\"\n data = proposal.find_counter_cache_record(option)\n else\n data = {invalid: status}\n end\n render json: data\n }\n end\n end",
"title": ""
},
{
"docid": "dc7c92960fe376ea0603f752fec55ae2",
"score": "0.5297102",
"text": "def destroy\n @prize.destroy\n respond_to do |format|\n format.html { redirect_to admin_prizes_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "03e5d0df57666ed622c2d877f1010244",
"score": "0.52943766",
"text": "def update\n @prefecture.objectId = params[\"id\"]\n @prefecture.regionId = params[\"r_id\"]\n @prefecture.name = params[\"name\"]\n @prefecture.acl = nil\n respond_to do |format|\n if @prefecture.save\n format.html { redirect_to prefecture_path(params['id']), notice: \"Prefecture was successfully updated.\" }\n format.json { render :show, status: :ok, location: @prefecture }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @prefecture.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "aa0b87a16ede7353758305dbbaf57c22",
"score": "0.5291684",
"text": "def put(*a) route 'PUT', *a end",
"title": ""
},
{
"docid": "08928a8dcb9d3bc993fd21219d4e79a0",
"score": "0.52851605",
"text": "def update\n respond_to do |format|\n # spot = HTTParty.get(\"http://localhost:3000/spots/#{params[:id]}\" )\n if @spot.update(spot_params)\n HTTParty.patch(\"http://localhost:3000/spots/#{params[:id]}?name=#{spot_params[:name]}&lat=#{spot_params[:lat]}&lon=#{spot_params[:lon]}&description=#{spot_params[:description]}&features=#{spot_params[:features]}&spot_type=#{spot_params[:spot_type]}&img=#{spot_params[:img]}\")\n @spot.spot_photos.attach(params[:spot][:spot_photos])\n format.html { redirect_to @spot, notice: 'Spot was successfully updated.' }\n format.json { render :show, status: :ok, location: @spot }\n else\n format.html { render :edit }\n format.json { render json: @spot.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3cdd49d0898ac44c080e3d4187071646",
"score": "0.5279733",
"text": "def update\n @apartment = Apartment.find(params[:id])\n\n if @apartment.update_attributes(params[:apartment])\n head :no_content\n else\n render json: @apartment.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "5daa956444f2e7c1e7fbf1e4433d53a0",
"score": "0.52795273",
"text": "def index\n @prizes = current_admin.prizes.all\n end",
"title": ""
},
{
"docid": "027ce54b824d1f834f8e574c926d8a96",
"score": "0.5279231",
"text": "def size_params\n params.require(:size).permit(:name, :code_size)\n end",
"title": ""
},
{
"docid": "fb8bba170a6cd4fa0e6daa36a1cd076b",
"score": "0.5273478",
"text": "def prize_params\n params.require(:prize).permit(:name, :participation_id)\n end",
"title": ""
},
{
"docid": "739fc1f374f654df7155942e8664166d",
"score": "0.5272933",
"text": "def update\n\n if params[:upvote]\n @recipe = Recipe.find_by(id: params[:id])\n @recipe.upvotes = @recipe.upvotes + 1\n @recipe.save\n render json: @recipe\n end\n\n \n # redirect_to \"/recipes\"\n end",
"title": ""
},
{
"docid": "c37720db4e207809988bbaf81da1164b",
"score": "0.5271353",
"text": "def prize_params\n params.require(:prize).permit(:name, :description, :raffle_id, :prize_category_id, :avatar)\n end",
"title": ""
},
{
"docid": "dd4437688d187b36af64fe44f4e4458c",
"score": "0.5268308",
"text": "def update\n @promocion = Promocion.find(params[:id])\n\n respond_to do |format|\n if @promocion.update_attributes(params[:promocion])\n format.html { redirect_to @promocion, notice: 'Promocion was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @promocion.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4b29d58fa0a6430a123c611e6bb68bba",
"score": "0.5262996",
"text": "def update\n respond_to do |format|\n if @products_size.update(products_size_params)\n format.html { redirect_to @products_size, notice: 'Products size was successfully updated.' }\n format.json { render :show, status: :ok, location: @products_size }\n else\n format.html { render :edit }\n format.json { render json: @products_size.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "11121476217f458129b11f6447608aee",
"score": "0.52573204",
"text": "def put(path, params: {}, headers: {})\n request_json :put, path, params, headers\n end",
"title": ""
},
{
"docid": "61b4b0a7b63839d69784553e88f216e8",
"score": "0.52440464",
"text": "def pricing width, height, pcb_layers, quantity = nil\n post_request \"pricing\", {width_in_mils: width, height_in_mils: height, pcb_layers: pcb_layers, quantity: quantity}\n end",
"title": ""
},
{
"docid": "5e9e4bf2e33702f46b3eccb0fdf9a21d",
"score": "0.5238055",
"text": "def index\n @user_prizes = UserPrize.all\n \n render json: @user_prizes\n end",
"title": ""
},
{
"docid": "8526bda945752e27df3ffdba1b7efea0",
"score": "0.5237053",
"text": "def update_mobile_carrier(args = {}) \n put(\"/mobile.json/#{args[:carrierId]}\", args)\nend",
"title": ""
},
{
"docid": "b2d5fc83a907f25e5176864fa6beb3d0",
"score": "0.52343684",
"text": "def put_rest(path, json) \n run_request(:PUT, create_url(path), json)\n end",
"title": ""
},
{
"docid": "f67c2668488df6429bdca0b8f8ad3d21",
"score": "0.5231809",
"text": "def index\n @prizes = Prize.all\n end",
"title": ""
},
{
"docid": "b3c28204889ebadee4d894df4da4ca3f",
"score": "0.5229086",
"text": "def set_shoe_size\n @shoe_size = ShoeSize.find(params[:id])\n end",
"title": ""
},
{
"docid": "1136c8f1a99c6a9b15be6cb74e661683",
"score": "0.5228161",
"text": "def create\n @prize = current_admin.prizes.build(params[:prize])\n if @prize.save\n redirect_to @prize, :flash => { :success => \"Prize created\" }\n else\n render 'sessions/new'\n end\n end",
"title": ""
},
{
"docid": "2cc482818e111af9b01538b4a583e715",
"score": "0.5217236",
"text": "def put(url, params)\n request = HTTPI::Request.new(resource_url(url, query_params(params[:query])))\n request.body = params[:body].to_json\n execute_request(:put, request, params)\n end",
"title": ""
},
{
"docid": "c765129cd70c7ce96dbddf29eb5ae4e7",
"score": "0.5211877",
"text": "def create\n @size = Size.new(params[:size])\n\n respond_to do |format|\n if @size.save\n format.html { redirect_to @size, notice: 'Size has been created.' }\n format.json { render json: @size, status: :created, location: @size }\n else\n format.html { render action: \"new\" }\n format.json { render json: @size.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5c2ce1bc5926a7b9cddab54535dee3fc",
"score": "0.52115595",
"text": "def destroy\n @prize.destroy\n respond_to do |format|\n format.html { redirect_to prizes_url, notice: 'Prize was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "fe34f93da0751ad55cc5052cfdd2366c",
"score": "0.52112275",
"text": "def update\n render json: Person.update(params[\"id\"], params[\"person\"])\n end",
"title": ""
},
{
"docid": "2c150bd5b040c700de78d47b2ab3fd6a",
"score": "0.52064955",
"text": "def update\n @business_size = BusinessSize.find(params[:id])\n\n respond_to do |format|\n if @business_size.update_attributes(params[:business_size])\n format.html { redirect_to @business_size, notice: 'Business size was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @business_size.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2201c8459e41fa0e0d3e05197ca9d54e",
"score": "0.5185008",
"text": "def update\n respond_to do |format|\n if @phenotype.update(phenotype_params)\n format.html { redirect_to @phenotype, notice: \"Phenotype was successfully updated.\" }\n format.json { render :show, status: :ok, location: @phenotype }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @phenotype.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4c70f08146c51d96e1c9d21bad555de5",
"score": "0.51793313",
"text": "def update\n @miscellaneous_pricing = MiscellaneousPricing.find(params[:id])\n\n if @miscellaneous_pricing.update(miscellaneous_pricing_params)\n head :no_content\n else\n render json: @miscellaneous_pricing.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "f478aff975cc84e0c76f5ea64b83c64e",
"score": "0.517854",
"text": "def set_product_size\n @product_size = ProductSize.find(params[:id])\n end",
"title": ""
},
{
"docid": "0c2efed06d64a4de58c7fdcad1c8a72e",
"score": "0.5177032",
"text": "def update\n @project_prize = ProjectPrize.find(params[:id])\n\n respond_to do |format|\n if @project_prize.update_attributes(params[:project_prize])\n format.html { redirect_to(@project_prize, :notice => 'ProjectPrize was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @project_prize.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c2453d8069282284c7458abddc6e56b9",
"score": "0.51746535",
"text": "def put(data, options={})\n raise NotImplementedError, \"We only puts to singular resources.\" if count > 1\n first.put(data, options)\n end",
"title": ""
},
{
"docid": "03cf2c9b91ff3d93509664e5934ec7ed",
"score": "0.5171807",
"text": "def update\n\n @propose = Propose.find(params[:id])\n\n respond_to do |format|\n if @propose.update_attributes(params[:propose])\n format.html { redirect_to @propose, :notice => 'Propose was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @propose.errors, :status => :unprocessable_entity }\n end\n end\n\n\n end",
"title": ""
}
] |
bb8131918eada115df5f38c2d11da645 | validates :customer_company_id , presence: true validates :name , presence: true validates :first_last_name , presence: true | [
{
"docid": "08a56e0ed39bd6263f7a3a0b473086cf",
"score": "0.0",
"text": "def full_name\n \"#{name} #{first_last_name} #{second_last_name}\"\n end",
"title": ""
}
] | [
{
"docid": "6ee7fb0848477ec634cea019c17ee8cc",
"score": "0.66956395",
"text": "def valid_attributes\n {\n company_id: company.id\n }\n end",
"title": ""
},
{
"docid": "66bbe03605106d05337f1fb310f5b92c",
"score": "0.6668644",
"text": "def validate\n validates_presence([:name, :phone])\n end",
"title": ""
},
{
"docid": "37059fe883a55f0d84863a715311b8af",
"score": "0.6662096",
"text": "def customer_company_params\n params.require(:customer_company).permit(:company_customer, :rfc, :registered_name, :consortium, :active, :customer_company_id)\n end",
"title": ""
},
{
"docid": "3ace224fc9bc860cc956d2ae9793d874",
"score": "0.66316396",
"text": "def company_selected?\n return unless company_number.blank? || company_name.blank? || address_line1.blank?\n\n errors.add(:company_number, :company_not_chosen)\n end",
"title": ""
},
{
"docid": "09cd5774c2401686f1875bef2bdfef8c",
"score": "0.6544617",
"text": "def customer_params\n params.require(:customer).permit(:CompanyName, :NameOfContact, :CompanyContactPhone, :EmailOfTheCompany, :CompanyDescription, :NameOfServiceTechAuthority, :TechAuhtorityPhone, :TechManagerServiceEmail)\n end",
"title": ""
},
{
"docid": "59bccca6127be9e00b4249ecd04d3a41",
"score": "0.6540129",
"text": "def validate_pos_invoice\n if self.customer_id && !self.pos_invoice_addresses\n raise_error('Billing address Required!!!!')\n end\nend",
"title": ""
},
{
"docid": "aebc6a45dd90d600d64b6f1a85d648b6",
"score": "0.65038115",
"text": "def crm_customer_params\n params.require(:customer).permit(:name, :gender, :mobile, :address, :zip,:company,:birth_date,\n :email,:password,:customer_type_id,:is_enabled,:province_id,\n :city_id,:area_id) \n end",
"title": ""
},
{
"docid": "7a0fe06968d76a19ffc93ef71e960d5a",
"score": "0.6484682",
"text": "def customer_params\n params.require(:customer).permit(:phone, :first_name, :last_name, :campaign_id, :custom1, :custom2, :custom3)\n end",
"title": ""
},
{
"docid": "929db4bbfd9c388e7d2952313c0257f2",
"score": "0.6473962",
"text": "def customer_params\n params.require(:customer).permit(:company_id, :title, :first_name, :surname, :position, :address_1, :address_2, :city, :county, :country, :postcode, :phone, :alt_phone, :email, :company_name, :notes)\n end",
"title": ""
},
{
"docid": "8db68d8619be33071a45f50460a76dad",
"score": "0.64677376",
"text": "def customer_params\n params.require(:customer).permit(:first_name, :last_name, :phone_number , :city)\n end",
"title": ""
},
{
"docid": "7c1b7faf932588e39ecd64dfa09084dc",
"score": "0.64542294",
"text": "def customer_company_params\n params.require(:customer_company).permit(:company_name, :company_code, :location, :website, :organization_id, :display_name, :remarks,address_attributes: [:id, :address_line1,:address_line2, :city, :state, :country, :postal_code],contact_attributes:[:id,:email,:mobile,:fax],social_network_attributes:[:id,:facebook,:twitter,:skype,:google_plus,:linkedin],customer_account_attributes: [:id, :tin, :gst_no, :tan, :pan, :gst_treatment_id, :currency, :payment_terms, :taxable, :tax_exempt_reason, :place_of_supply, address_attributes: [:id, :address_line1,:address_line2, :city, :state, :country, :postal_code]],customer_contact_people_attributes:[:id, :salutation, :first_name, :last_name, :department, :is_primary, contact_attributes:[:id, :email, :mobile, :fax],address_attributes: [:id, :address_line1,:address_line2, :city, :state, :country, :postal_code]])\n end",
"title": ""
},
{
"docid": "91db412d586ffd5d90ade320461e1046",
"score": "0.6368753",
"text": "def customer_params\n params.require(:customer).permit(:name, :company_name, :address1, :address2, :postal_code)\n end",
"title": ""
},
{
"docid": "78ffa731385b3b0644269a35e5c27e02",
"score": "0.6345135",
"text": "def contact_fields\n if contact_type == 'contact'\n validates_length_of :first_name, minimum: 2, maximum: 20 if validates_presence_of :first_name\n validates_length_of :last_name, minimum: 2, maximum: 20 if validates_presence_of :last_name\n end\n end",
"title": ""
},
{
"docid": "f140cad01c856125b2264b7b37d3bf99",
"score": "0.63327575",
"text": "def validate\n errors.add(:post_office, \"- must be filled for postalcode #{self.postal_code}\") if self.post_office.blank? && !self.postal_code.blank?\n errors.add(:postal_code, \"- must be filled for #{self.post_office}\") if self.postal_code.blank? && !self.post_office.blank? \n errors.add_to_base(\"- Person must have at least one phonenumber\") if (self.phone_home.blank? && self.phone_cell.blank? && self.phone_work.blank?) \n end",
"title": ""
},
{
"docid": "0bf36412f9e7f8c8a116a9a213b5d42b",
"score": "0.6323433",
"text": "def customer_contact_params\n params.require(:customer_contact).permit(:Last_Name, :First_Name, :Company_Name, :Email_Address, :Prod_Instance)\n end",
"title": ""
},
{
"docid": "c6a24bc5d8fba80bf1a710b97aa16bbd",
"score": "0.63125557",
"text": "def customer_params\n params.require(:customer).permit(:name, :complete_name, :email, :address, :state, :country)\n end",
"title": ""
},
{
"docid": "bd9cd02799ac149a8d83eb112e1a82c6",
"score": "0.63022727",
"text": "def customer_params\n params.require(:customer).permit(:firstname, :lastname, :email, :phone, :country_id, :state_id, :city, :zipcode, :address, :customerstatusid)\n end",
"title": ""
},
{
"docid": "9ff9dcfd1affe887c814b3a64edc0f80",
"score": "0.6287679",
"text": "def customer_params\n params.require(:customer).permit(:first_name, :middle_name, :last_name, :address, :phone, :email, :gender, :age, :status)\n end",
"title": ""
},
{
"docid": "9c41569458142db3d26f9cbac5ccfd26",
"score": "0.6284855",
"text": "def customer_params\n params.require(:customer).permit(:name, :fname, :mname, :country, :city, :uf, :birth, :email, :annotation, :schooling, :civil_status, :cpf, :rg)\n end",
"title": ""
},
{
"docid": "dc1ef265e33166fbae2893bd94432dcd",
"score": "0.6267673",
"text": "def company_params\n params.required(:company).permit(:name)\n end",
"title": ""
},
{
"docid": "760d4bdb7d927db893438ec06022678f",
"score": "0.626379",
"text": "def validate_name\n errors.add(:abstract, \"person_name or company_name must be present\") unless (person_name || company_name)\n end",
"title": ""
},
{
"docid": "1166dc0cfa903f373deff2fbdcc11281",
"score": "0.6254727",
"text": "def validate_name_and_entity_id\n @patient.valid?\n #@patient.errors.add(:entity_id, I18n.t('patients.create.no_entity')) if @patient.new_record? && !@patient.entity_id.present?\n @patient.errors.add(:name, I18n.t('patients.create.no_name')) unless @patient.name.present?\n @patient.errors.empty?\n end",
"title": ""
},
{
"docid": "b340c9685fe10230b6dd22b1170cca31",
"score": "0.62480277",
"text": "def company_create_params\r\n params.require(:company).permit(:company_name, :first_name, :last_name,\r\n :phone, :contract_start, :contract_end, :owner_id)\r\n end",
"title": ""
},
{
"docid": "6cbc171c188074aa929c8fb1ad45efa3",
"score": "0.62340134",
"text": "def company_params\n params.require(:company).permit(:account_id, :name, :name_addon, :comments, :zip, :city, :street, :streetno, :country, :gender, :firstname, :lastname, :tel1, :tel2, :fax, :email, :homepage, :logo, :companystatus_id, :companynumber, :vat_number)\n end",
"title": ""
},
{
"docid": "bc4a385b59cd89e69e0b2cb26efbdc32",
"score": "0.6210049",
"text": "def customer_params\n params.require(:customer).permit(:first_name, :last_name, :email, :phone, :address, :city, :state_id, :zipcode, :country_id, :comment, :customer_status_id)\n end",
"title": ""
},
{
"docid": "2211d96e4966e3f4724cfebe24bc7bfa",
"score": "0.6204772",
"text": "def new_customer_params\n params.require(:customer).permit(:name, :email, :phone, :description, :company, :address, :city, :state, :zip)\n end",
"title": ""
},
{
"docid": "92ed11eb871da850fa5a7d472d99395f",
"score": "0.61895895",
"text": "def company_params\n params.require(:company).permit(:companyname, :city ,:user_id, :fieldofbusiness)\n end",
"title": ""
},
{
"docid": "1606d15cb976aa64a7596ed446bdc29a",
"score": "0.6172051",
"text": "def customer_params\n params.require(:customer).permit(:lastName, :firstName, :email)\n end",
"title": ""
},
{
"docid": "0aadc5e7d7bf6655865d0b1080b43e56",
"score": "0.61690223",
"text": "def customer_params\n params.require(:customer).permit(:first_name, :last_name, :user_id)\n end",
"title": ""
},
{
"docid": "dea824eeff7dc0c599cb953af0344cde",
"score": "0.61664546",
"text": "def validate\n super\n errors.add(:name, \"can't be empty\") if name.blank?\n errors.add(:category_id, \"can't be empty\") if category_id.blank?\n errors.add(:price, \"can't be empty\") if price.blank?\n end",
"title": ""
},
{
"docid": "7da2f1ddb422135efb5b82bb39e946ee",
"score": "0.61570275",
"text": "def customer_params\n params.require(:customer).permit(:name, :last_name, :phone, :address)\n end",
"title": ""
},
{
"docid": "a9f517e8b0ed43cf557ec6aa406f7ceb",
"score": "0.61380976",
"text": "def validate \n#\tfirst check whether combo fields have been selected\n\t is_valid = true\n\t if is_valid\n\t\t is_valid = ModelHelper::Validations.validate_combos([{:account_code => self.account_code}],self) \n\tend\n\t#now check whether fk combos combine to form valid foreign keys\n\t if is_valid\n\t\t is_valid = set_account\n\t end\n\t if is_valid\n\t\t is_valid = ModelHelper::Validations.validate_combos([{:party_type_name => self.party_type_name},{:party_name => self.party_name},{:role_name => self.role_name}],self) \n\tend\n\t#now check whether fk combos combine to form valid foreign keys\n\t if is_valid\n\t\t is_valid = set_parties_role\n\t end\n\t#validates uniqueness for this record\n\t if self.new_record? && is_valid\n\t\t validate_uniqueness\n\t end\nend",
"title": ""
},
{
"docid": "9a8eaa8b6d078da14870e9affc22782c",
"score": "0.6133918",
"text": "def customer_params\n params.require(:customer).permit(:name)\n # , :username, :email)\n end",
"title": ""
},
{
"docid": "e83e985d1491e26095b938a171cc4ff5",
"score": "0.6124858",
"text": "def credit_company_params\n params.require(:credit_company).permit(:name, :short_name, :identifier, :contact, :phone, :email, :website, :location_id, :executive_id)\n end",
"title": ""
},
{
"docid": "12dfb77f85062a869b6f43340e51d4d5",
"score": "0.6113502",
"text": "def customer_params\n params.require(:customer).permit :name,\n :surname,\n :mobile,\n :email\n end",
"title": ""
},
{
"docid": "3cb51fa289a36caa4c5dd0b78a73bf67",
"score": "0.6107898",
"text": "def company_params\n params.require(:company).permit(:company_logo,:manual_company_code, :group_id, :name, :company_type_id, :registration_no, :description, :pan_card_no, :tax_no, :professional_tax_no, :address, :city, :district_id, :country_id, :pin_code, :state_id, :email, :contact_no, :web_site, :starting_date, :ceo_name)\n end",
"title": ""
},
{
"docid": "b229caf6c2db694699fb4ebf9c183916",
"score": "0.61069196",
"text": "def customer_customer_params\n params.require(:customer_customer).permit(:company_name, :company_description, :city, :zip_code, :avatar)\n end",
"title": ""
},
{
"docid": "41e0742a15a08df5aad379acf89921f8",
"score": "0.6106268",
"text": "def customer_params\n permit = [:name, :name2, :vat_number, :business_id, :phone, :mobile, :contact_person, :email, :invoice_email, :phone2, :mobile2, :contact_person2, :email2, :url, :remarks, :avatar, :plan_id, location_attributes: [:id, :latitude, :longitude, :address, :address2, :city, :country, :zip,:_destroy]]\n permit << :parent_id if current_user.is_admin? || current_company.is_jvp? # reseller already checked params[:action] == \"create\"\n permit << :is_blocked if current_user.is_admin? || current_company.is_jvp? # reseller already checked params[:action] == \"create\"\n permit += [:premium_from, :premium_until] if current_user.is_admin? || current_company.is_jvp? || current_company.is_partner?\n params.require(:company).permit(*permit)\n end",
"title": ""
},
{
"docid": "e60a620f75473955f6f56983b9fc37c0",
"score": "0.6103887",
"text": "def company_params\n params.require(:client_company).permit(:company_name, :address, :phone,\n :primary_poc_first_name, :primary_poc_last_name, :poc_email,\n :poc_phone, :status, :client_po_number, :closed_at,\n :country_name, :poc_country, :company_id, :phone_country_code,\n :primary_poc_country_code, :city, :state, :poc_name)\n end",
"title": ""
},
{
"docid": "ef4244f413b23babc0c6cf8f04c8e8db",
"score": "0.6097776",
"text": "def update_company company_name\n if self.valid?\n unless company_name.nil?\n company_name = company_name.strip\n if company_name.blank?\n self.company_id = 0\n self.company_name = ''\n else\n company = Company.find_or_create_by_name company_name\n unless company.id == self.company_id\n self.company_id = company.id\n self.company_name = company.name\n end\n end\n end\n end\n end",
"title": ""
},
{
"docid": "e26f84e65c5dd00f372366e1e4094db2",
"score": "0.60963434",
"text": "def customer_params\n params.require(:customer).permit(:customer_name, :customer_street, :customer_town, :customer_phone, :customer_fax, :customer_email, :customer_notes, :customer_surname, :customer_mobile, :customer_club, :customer_newsletter, :supplier_id, :customer_group)\n end",
"title": ""
},
{
"docid": "8f0ae33075a8fa0d356f34fc58a25a80",
"score": "0.60869014",
"text": "def customer_params\n params.require(:customer).permit(:customer_id, :last_name, :first_name, :email, :home_phone, :cell_phone, :fax, :address, :city, :state_province, :zip_postal_code, :country_region)\n end",
"title": ""
},
{
"docid": "743221b9ef603a8d2d63ce9a7198deaa",
"score": "0.60859",
"text": "def create\n\t\t@company = Company.new(company_params)\n\t\t# for admin to add a company\n\t\tif admin? && @company.save\n\t\t\tflash[:success] = \"#{@company.name} was successfully saved!\"\n\t\t\tredirect_to beanformed_company_beans_path(@company.id)\n\t\t# for all users; new companies come in as approved : false\n\t\telsif @company.save\n\t\t\tflash[:success] = \"Thanks for registering #{@company.name}! You will be notified when you are approved!\"\n\t\t\t@roaster = Roaster.find(session[:roaster_id])\n\t\t\t@roaster.update({company_id: @company.id, phone: params[:company][:phone], role: \"pending\"})\n\t\t\tredirect_to new_beanformed_company_path\n\t\telse\n\t\t\tflash[:error] = \"Please fill out all fields.\"\n\t\t\tredirect_to new_beanformed_company_path\n\t\tend\n\tend",
"title": ""
},
{
"docid": "3ab7255c68156dfc4758121600e70ef7",
"score": "0.60852873",
"text": "def company_name_params\n params.require(:company_name).permit(:date, :amount, :payroll_type, :search_engine, :month, :year, :miscellaneous_expense_type, :company_id)\n end",
"title": ""
},
{
"docid": "56093a622720283fa8ca84ea8e63da92",
"score": "0.60632217",
"text": "def validate_lock_customer_account\n\n end",
"title": ""
},
{
"docid": "76327533d753ad87afeb693fca0a1869",
"score": "0.6063141",
"text": "def validate\n validates_contact\n end",
"title": ""
},
{
"docid": "493aa1330310da845d9909c4757b01ea",
"score": "0.6054431",
"text": "def customer_name\n company.blank? ? full_name : \"#{company} (#{full_name})\"\n end",
"title": ""
},
{
"docid": "493aa1330310da845d9909c4757b01ea",
"score": "0.6054431",
"text": "def customer_name\n company.blank? ? full_name : \"#{company} (#{full_name})\"\n end",
"title": ""
},
{
"docid": "babbb8f64153730f9bb17500fbe7b3d4",
"score": "0.6053732",
"text": "def company_params\n params.require(:company).permit(:company_number, :name, :address_line_1, :address_line_2, :post_code, :city)\n end",
"title": ""
},
{
"docid": "1b4d70c7e1be4ebac40ff7bed601942b",
"score": "0.6051065",
"text": "def validate \n#\tfirst check whether combo fields have been selected\n\t is_valid = true\n\t if is_valid\n\t\t is_valid = ModelHelper::Validations.validate_combos([{:contact_method_type_code => self.contact_method_type_code},{:contact_method_code => self.contact_method_code}],self) \n\tend\n\t#now check whether fk combos combine to form valid foreign keys\n\t if is_valid\n\t\t is_valid = set_contact_method\n\t end\n\t if is_valid\n\t\t is_valid = ModelHelper::Validations.validate_combos([{:party_type_name => self.party_type_name},{:party_name => self.party_name}],self) \n\tend\n\t#now check whether fk combos combine to form valid foreign keys\n\t if is_valid\n\t\t is_valid = set_party\n\t end\n\t#validates uniqueness for this record\n\t if self.new_record? && is_valid\n\t\t validate_uniqueness\n\t end\nend",
"title": ""
},
{
"docid": "c85e43f53f7380fd9726bc73bb487322",
"score": "0.60491675",
"text": "def listed_company_params\n params.require(:listed_company).permit(:status,:name, :contact_no, :email, :location, :code, :optinal_contact_no)\n end",
"title": ""
},
{
"docid": "f397c01818b87a838cb43802f8db3460",
"score": "0.60484743",
"text": "def customer_params\n params.require(:customer).permit(:first_name, :last_name, :email, :phone, :birthdate, :postcode, :address, :city, :country, :gender, :password, :confirmation)\n end",
"title": ""
},
{
"docid": "c6f75bed68c0b00717ffa0800c620b7c",
"score": "0.60426337",
"text": "def contact_company_params\n params.require(:contact_company).permit(:name, :address, :postcode, :state)\n end",
"title": ""
},
{
"docid": "6bb2ac1098ef23720106f26b82488659",
"score": "0.6042018",
"text": "def customermaster_params\n params.require(:customermaster).permit(:customername, :customeraddress, :customerfax, :customerphone, :customeremail, :customertin, :customercst,:companyname,:username,:year)\n end",
"title": ""
},
{
"docid": "95737c5b0b7145673020078de009423f",
"score": "0.60393083",
"text": "def customer_params\n params.require(:customer).permit(\n :name,\n :email,\n :address,\n :org_number,\n :contact_person,\n :phone)\n end",
"title": ""
},
{
"docid": "865d59f6824e05cd581538ef4e587280",
"score": "0.6026179",
"text": "def customer_params\n params.require(:customer).permit(:name, :phone_1, :phone_2, :email, :notes)\n end",
"title": ""
},
{
"docid": "eb99779b0cb43911bc484a776ff5061e",
"score": "0.60178417",
"text": "def single_customer_params\n unless params[:single_customer].nil?\n params.require(:single_customer).permit(:name, :gender, :ethnic_name, :birth, :id_no, :id_address, :hukou_type, \n :education, :tel, :other_contact_person, :other_contact_call, :qq, :wechat, \n :email, :communication_address, :is_doc_for_shebao, :is_doc_for_shigong, \n :is_doc_for_shenggong, :is_doc_for_butuichajia, :is_doc_for_xufei, \n :is_doc_for_qita, :is_usage_zhengchang, :is_usage_ruxue, :is_usage_luohu, \n :is_usage_shenyu, :is_usage_yiliao, :is_usage_gouche, :is_usage_goufang, \n :is_usage_daikuan, :creator, :creator_tel, :comment, :user_id, :input_date, \n :document_no, :workflow_state, :comment_for_qita)\n end\n end",
"title": ""
},
{
"docid": "1eca6bd3eeb624ad5c4bbe74325beabe",
"score": "0.601122",
"text": "def validate\n if !new_record? && current?\n errors.add('contact_name', 'Please provide a contact name for your enquiry') unless contact_name.present?\n errors.add('contact_phone', 'Please provide a phone number where we may contact you at about your enquiry') unless contact_phone.present?\n end\n end",
"title": ""
},
{
"docid": "af4233d3176c2895ae8821ef486c6063",
"score": "0.6004208",
"text": "def validate \n#\tfirst check whether combo fields have been selected\n\t is_valid = true\n\t if is_valid\n\t\t is_valid = ModelHelper::Validations.validate_combos([{:postal_address_type_code => self.postal_address_type_code},{:city => self.city},{:address1 => self.address1}],self) \n\tend\n\t#now check whether fk combos combine to form valid foreign keys\n\t if is_valid\n\t\t is_valid = set_postal_address\n\t end\n\t if is_valid\n\t\t is_valid = ModelHelper::Validations.validate_combos([{:party_type_name => self.party_type_name},{:party_name => self.party_name}],self) \n\tend\n\t#now check whether fk combos combine to form valid foreign keys\n\t if is_valid\n\t\t is_valid = set_party\n\t end\n\t#validates uniqueness for this record\n\t if self.new_record? && is_valid\n\t\t validate_uniqueness\n\t end\nend",
"title": ""
},
{
"docid": "cea023a898daf2dc949061c2b7c992fe",
"score": "0.5999563",
"text": "def customer_params\n\t params.require(:customer).permit(:company_id, :pharmacy_id, :person_image_id, :prescriber_id, :facility_id, :head_of_household_id, :legacy_customer_id_number, :active, :last_name, :first_name, :middle_name, :address1, :address2, :city, :state, :zip_code, :doc_u_dose, :doc_u_dose_group, :birthdate, :ssn, :phone_number, :cell_number, :fax_number, :work_number, :email, :alternate_address, :gender, :tax_exempt, :discount_name, :discount_pct, :nursing_home_resident, :price_based_pricing_schedule, :childproof_cap, :generic_substitution, :last_rx_report_date, :pregnant, :nursing, :height, :weight, :other_language, :terminal, :deceased_date, :needs_review, :signature_on_file, :hippa_signature_date, :smoker, :location_code, :residence_code, :wellness, :ethnicity, :preferred_contact_method, :account_number, :memo, :notes, :special_label, :receive_text_msg, :auto_fill_maintenance_rx, :flavor, :remote_access)\n end",
"title": ""
},
{
"docid": "c4435f33c98e5c9ffdd2fb471801b4dc",
"score": "0.5995917",
"text": "def validations\n {\n 'Plan' => {\n 'Name' => 'string'\n },\n 'Company' => {\n 'Name' => 'string'\n }\n }\n end",
"title": ""
},
{
"docid": "ed365e5710e85fb696c09a02b5736dca",
"score": "0.5995605",
"text": "def customer_params\n params.require(:customer).permit(:email, :first_name, :last_name, :custid, :dob, :active, :notes)\n end",
"title": ""
},
{
"docid": "e97909a33f73b83829dd712853087701",
"score": "0.59893626",
"text": "def validate \n errors.add(:email, \"must be valid.\") unless email.include?(\"@\") \n if account.include?(\" \") \n errors.add(:account,\"cannot include spaces.\") \n end \n end",
"title": ""
},
{
"docid": "33582de3a386ddac62fdcd54fdbd0e53",
"score": "0.5988475",
"text": "def account_company_params\n params.require(:account_company).permit(:name, :phone_number, :enabled)\n end",
"title": ""
},
{
"docid": "e2e29ce8a031ddedcb1d54f439d6fe7b",
"score": "0.5979522",
"text": "def customer_params\n params.require(:customer).permit(:name, :phone, :delivery_date, :work, :mobile, :address, :request_date, :cash, :paid, :remained, :lft_sp, :lft_cl, :lft_ax, :rght_sp, :rght_cl, :rght_ax, :doctor, :req_store, :deliv_store, :comment, :delivered)\n end",
"title": ""
},
{
"docid": "4b71738bad15e8aa8f13b1fb49ddd9eb",
"score": "0.5978837",
"text": "def customer_params\n params.require(:customer).permit(:customer_name, :customer_code, :warehouse_id, :warehouse_code, :office_id, contact_attributes:[:landline,:extension,:mobilenumber1,:mobilenumber2,:email],address_attributes:[:address1,:address2,:city,:state,:country])\n end",
"title": ""
},
{
"docid": "f6847ca2296d8b4625f5aa9df0abad56",
"score": "0.59779495",
"text": "def business_company_param\n params.require(:business_company).permit(\n :name,\n :type_identification,\n :rif,\n :email,\n :phone,\n :status,\n :address,\n :business_company_type_id,\n :firt_name_responsable,\n :last_name_responsable\n )\n end",
"title": ""
},
{
"docid": "ffc5f4a1765266049d9cab37ef17092d",
"score": "0.5976947",
"text": "def company_params\n params.require(:company).permit(:Company_Name, :Company_Adrres_Code, :Company_Transport_Number,\n :Company_Mail, :Company_Web_Site, :Company_Registration_Status)\n end",
"title": ""
},
{
"docid": "991fe982c267f80c4f7e8fb1b5d48a25",
"score": "0.59763765",
"text": "def create\n @customer = Customer.new(customer_params)\n @customer.phone = Generic.clean_phone(@customer.phone)\n \n respond_to do |format|\n if @customer.save\n format.html {\n redirect_to campaign_customers_path\n }\n format.json { render :show, status: :created, location: @customer }\n else\n format.html { render :new }\n format.json { render json: @customer.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1a79a204573c0b81afc6f8949d19edc9",
"score": "0.59712684",
"text": "def validated_for_update?(c)\n valid = true\n if first_name.blank? && last_name.blank?\n c.errors.add_to_base(\"Must enter contact name\")\n valid = false\n end\n ex_email = Contact.find(:first, :include => [:emails], :conditions => [\"emails.email_text = ? AND contacts.user_id = ? AND contacts.id != ? AND merged_to_form_contact_id = 0\", email, user_id, c.id])\n if ex_email\n c.errors.add_to_base(\"Contact already in network\")\n valid = false\n end\n valid\n end",
"title": ""
},
{
"docid": "d47c60ef327c274b012a13bbacc67f60",
"score": "0.59712195",
"text": "def company_params\n params.require(:company).permit(:name, :address, :city, :state, :zipcode, :contact_name, :contact_email, :current_account_manager, :admin_id, :agency_id, :phone_number,\n orders_attributes: [:id, :company_id, :agency_id, :account_manager_id, :manager_id, :mark_up, :title,\n :notes, :number_needed, :needed_by, :urgent, :active, :dt_req, :bg_check, :stwb, :heavy_lifting, :shift, :est_duration])\n end",
"title": ""
},
{
"docid": "0b5e852b35ea785e0cada4a51ebe63ee",
"score": "0.59680134",
"text": "def test_presence_of_name\n client = Client.new(:tat => 13, :partener_bank_group_code => 'HJ',\n :internal_tat => 89, :group_code => 'JO',:max_jobs_per_user_payer_wise => 5,\n :max_jobs_per_user_client_wise => 5, :max_eobs_per_job => 5)\n assert_equal(false, client.save, \"Name can't be blank!\")\n end",
"title": ""
},
{
"docid": "798c7e4525f67aabea426d559a186232",
"score": "0.59597373",
"text": "def customer_params\n params.require(:customer).permit(:email, :password, :password_confirmation, :firstname, :lastname, :address, :postcode, :city, :phone, :age, :gender)\n end",
"title": ""
},
{
"docid": "8d9199c38981e233d087cb13a51aabcc",
"score": "0.59518737",
"text": "def basic_company_details_valid?\n return true unless AccountType.other_organisation?(account_type)\n\n company.valid?(account_type.registration_type.to_sym)\n end",
"title": ""
},
{
"docid": "7615e2d398dffaabf0cb1f8e612519e0",
"score": "0.59479505",
"text": "def validate\n super\n validates_presence :account\n validates_unique :account\n end",
"title": ""
},
{
"docid": "5d1fced0d352d70ba0a81e1eec8d56c9",
"score": "0.5945599",
"text": "def customer_params\n params.require(:customer).permit(:customer_name, :username, :registration_date, :email, :phone_number, :address, :gender)\n end",
"title": ""
},
{
"docid": "d9f1749ca445b209cc4fbd45006b784d",
"score": "0.5941601",
"text": "def valid?\n return false if @name.nil?\n return false if @name.to_s.length > 50\n return false if @prefix_suffix_option.nil?\n prefix_suffix_option_validator = EnumAttributeValidator.new('String', [\"Prefix\", \"Suffix\"])\n return false unless prefix_suffix_option_validator.valid?(@prefix_suffix_option)\n return false if !@invoice_pre_suffix.nil? && @invoice_pre_suffix.to_s.length > 5\n application_units_validator = EnumAttributeValidator.new('String', [\"Amount\", \"Hours\", \"Incidents\"])\n return false unless application_units_validator.valid?(@application_units)\n application_cycle_validator = EnumAttributeValidator.new('String', [\"Contract2Weeks\", \"Contract4Weeks\", \"ContractYear\", \"CalendarMonth\", \"CalendarQuarter\", \"CalendarWeek\", \"ContractQuarter\", \"CalendarYear\"])\n return false unless application_cycle_validator.valid?(@application_cycle)\n return false if @employee_comp_rate.nil?\n employee_comp_rate_validator = EnumAttributeValidator.new('String', [\"Actual\", \"Hourly\"])\n return false unless employee_comp_rate_validator.valid?(@employee_comp_rate)\n return false if @employee_comp_not_exceed.nil?\n employee_comp_not_exceed_validator = EnumAttributeValidator.new('String', [\"Billing\", \"Percent\", \"Amount\"])\n return false unless employee_comp_not_exceed_validator.valid?(@employee_comp_not_exceed)\n return false if @invoicing_cycle.nil?\n invoicing_cycle_validator = EnumAttributeValidator.new('String', [\"CalendarYear\", \"ContractYear\"])\n return false unless invoicing_cycle_validator.valid?(@invoicing_cycle)\n return false if !@invoice_description.nil? && @invoice_description.to_s.length > 4000\n return false if @bill_time.nil?\n bill_time_validator = EnumAttributeValidator.new('String', [\"Billable\", \"DoNotBill\", \"NoCharge\", \"NoDefault\"])\n return false unless bill_time_validator.valid?(@bill_time)\n return false if @bill_expenses.nil?\n bill_expenses_validator = EnumAttributeValidator.new('String', [\"Billable\", \"DoNotBill\", \"NoCharge\", \"NoDefault\"])\n return false unless bill_expenses_validator.valid?(@bill_expenses)\n return false if @bill_products.nil?\n bill_products_validator = EnumAttributeValidator.new('String', [\"Billable\", \"DoNotBill\", \"NoCharge\", \"NoDefault\"])\n return false unless bill_products_validator.valid?(@bill_products)\n return true\n end",
"title": ""
},
{
"docid": "b7c84e4638ae72e905cc09daef75714f",
"score": "0.5939453",
"text": "def validate \n#\tfirst check whether combo fields have been selected\n\t is_valid = true\n\t if is_valid\n\t\t is_valid = ModelHelper::Validations.validate_combos([{:short_description => self.short_description}],self) \n\tend\n\t#now check whether fk combos combine to form valid foreign keys\n\t if is_valid\n\t\t is_valid = set_organization\n\t end\n\t if is_valid\n\t\t is_valid = ModelHelper::Validations.validate_combos([{:target_market_name => self.target_market_name}],self) \n\tend\n\t#now check whether fk combos combine to form valid foreign keys\n\t if is_valid\n\t\t is_valid = set_target_market\n\t end\n\t#validates uniqueness for this record\n\t if self.new_record? && is_valid\n\t\t validate_uniqueness\n\t end\nend",
"title": ""
},
{
"docid": "ff74c08b00f4e11d644b2c3592be988d",
"score": "0.59313416",
"text": "def create\n @customer_company = CustomerCompany.new(customer_company_params)\n @customer_company.created_user_id = current_user.id\n respond_to do |format|\n if @customer_company.save\n format.html { redirect_to @customer_company, notice: t(\"controllers.create_success\") }\n format.json { render :show, status: :created, location: @customer_company }\n else\n @customer_companies_options = CustomerCompany.where(active: true, consortium: true).map{|m| [ m.company_customer , m.id ] }\n format.html { render :new }\n format.json { render json: @customer_company.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1f312c6241dfd6b510c217347026d568",
"score": "0.5928139",
"text": "def customer_params\n params.require(:customer).permit(:accountid, :userclass, :fullname, :password, :zipcode, :address, :country, :birthday, :sex, :nationality, :tel, :fax, :mobile, :email, :parentid, :bank_id, :holderid, :service1, :service2, :cbc)\n end",
"title": ""
},
{
"docid": "bf8f73e7a762daa00487b912aaeae0c5",
"score": "0.5927447",
"text": "def customer_params\n params.require(:customer).permit(:state_id, :city_id, :name, :email, :mobile)\n end",
"title": ""
},
{
"docid": "ca0c565ac3c2d6fb06b83248a7aa7e7b",
"score": "0.59243906",
"text": "def invoced_company_params\n\n params.require(:invoced_company).permit(:name, :address, :city_cp, :country, :phone, :cif)\n\n end",
"title": ""
},
{
"docid": "1b0007616224b564d09e80c8b3920be4",
"score": "0.59238076",
"text": "def customer_params\n params.require(:customer).permit(:name, :print_name, :contact_person, :contact_phone, \n :is_leaf, :group_id)\n end",
"title": ""
},
{
"docid": "5184118b3b0c1d79007b2ec975e241aa",
"score": "0.5921526",
"text": "def customer_params\n params.require(:customer).permit(:first_name, :last_name, :mobile, :otpsent, :otpreceived)\n end",
"title": ""
},
{
"docid": "a7f88dffd79dffcdb13928e7d3d3e745",
"score": "0.59134364",
"text": "def create\n \n \n cusname = params[:name]\n cusroll = params[:rollno]\n cusmob = params[:mobnum]\n Customer.new(cusname => :name , cusroll => :rollNum, cusmob => :mobNum )\n \n \n \n\n # respond_to do |format|\n # if @order.save\n # format.html { redirect_to @order, notice: 'Order was successfully created.' }\n # format.json { render :show, status: :created, location: @order }\n # else\n # format.html { render :new }\n # format.json { render json: @order.errors, status: :unprocessable_entity }\n # end\n # end\n end",
"title": ""
},
{
"docid": "59dc2e2a64877999346e5010fa6ef782",
"score": "0.59123653",
"text": "def company_params\n params.require(:company).permit({:users_attributes => [:first_name, :surname, :email, :role, :active, :password, :password_confirmation, :state]}, :check_field, :name, :tel, :www, :reg_address, :reg_number, :reg_name, :reg_location, :read_term, :category, :logo, :no_licence)\n end",
"title": ""
},
{
"docid": "b66995a94b8b012e021fb9c52ccb197d",
"score": "0.5909834",
"text": "def validate \n#\tfirst check whether combo fields have been selected\n\t is_valid = true\n\t if is_valid\n\t\t is_valid = ModelHelper::Validations.validate_combos([{:farm_group_code => self.farm_group_code},{:id => self.id}],self) \n\tend\n\t#now check whether fk combos combine to form valid foreign keys\n\t if is_valid\n\t\t is_valid = set_farm_group\n\t end\n\t if is_valid\n\t\t is_valid = ModelHelper::Validations.validate_combos([{:party_type_name => self.party_type_name},{:party_name => self.party_name},{:role_name => self.role_name},{:id => self.id}],self) \n\tend\n\t#now check whether fk combos combine to form valid foreign keys\n\t if is_valid\n\t\t is_valid = set_parties_role\n\t end\n\t#validates uniqueness for this record\n\t if self.new_record? && is_valid\n\t\t validate_uniqueness\n\t end\nend",
"title": ""
},
{
"docid": "1051de8d297b05a591af583c5773e713",
"score": "0.590768",
"text": "def customer_params\n params.require(:customer).permit(:email, :password, :password_confirmation, :customerName, :contactName, :address, :city, :postalCode, :country)\n end",
"title": ""
},
{
"docid": "cf3eec7810b4f6adec33eafd10108afc",
"score": "0.5905836",
"text": "def validation_name\n @company = Company.accessible_by(current_ability).where(:name => params[:name]).first\n\n if @company\n render json: false\n else\n render json: true\n end\n end",
"title": ""
},
{
"docid": "4c51b7974ac7852b655549c1bedf5b11",
"score": "0.5905422",
"text": "def company_params\n params.require(:company).permit(:name, :address)\n end",
"title": ""
},
{
"docid": "41bdfb5635a1d9339a5aeaf9399d9d26",
"score": "0.59004426",
"text": "def validate \n#\tfirst check whether combo fields have been selected\n\t is_valid = true\n\t if is_valid\n\t\t is_valid = ModelHelper::Validations.validate_combos([{:commodity_code => self.commodity_code}],self) \n\tend\n\t#now check whether fk combos combine to form valid foreign keys\n\t if is_valid\n\t\t is_valid = set_commodity\n\t end\n\t#validates uniqueness for this record\n\t if self.new_record? && is_valid\n\t\t validate_uniqueness\n\t end\nend",
"title": ""
},
{
"docid": "546de63a882a8c3112d29d1ece27e9a1",
"score": "0.5900327",
"text": "def customer_params\n params.require(:customer).permit(:name, :phone, :email, :desc, :subscribed, :accessible, :child_friendly)\n end",
"title": ""
},
{
"docid": "d57412da3d7dd3b6ce2727562c48271a",
"score": "0.58965576",
"text": "def customer_params\n params.require(:customer).permit(:user_id, :company_name, requests_attributes: [:id, :customer_id, :contact_firstname, :contact_lastname, :title, :email, :phone, :street_address, :city, :date, :zip_code])\n end",
"title": ""
},
{
"docid": "4202cfc23d55cd1777140b10ed7e10f2",
"score": "0.58945936",
"text": "def companycreation_params\n params.require(:companycreation).permit(:companyname)\n end",
"title": ""
},
{
"docid": "119b4dc4744a25d2e65c5e24d48fe798",
"score": "0.58824813",
"text": "def customer_params\n params.require(:customer).permit(:name)\n end",
"title": ""
},
{
"docid": "bab0a1fcef28b61edb5782b50965e053",
"score": "0.5878912",
"text": "def company_params\n params.require(:company).permit(:user_id, :name, :location_id, :description, :web, :phone)\n end",
"title": ""
},
{
"docid": "7968c24c17fb9191487933ec9d30682c",
"score": "0.58725226",
"text": "def company_params\n params.require(:company).permit(:name)\n end",
"title": ""
},
{
"docid": "7968c24c17fb9191487933ec9d30682c",
"score": "0.58725226",
"text": "def company_params\n params.require(:company).permit(:name)\n end",
"title": ""
},
{
"docid": "7968c24c17fb9191487933ec9d30682c",
"score": "0.58725226",
"text": "def company_params\n params.require(:company).permit(:name)\n end",
"title": ""
},
{
"docid": "2dab989309315f396044632bb719551b",
"score": "0.5870791",
"text": "def company_params\n params.require(:company).permit(:id, :name, :address, :id_number1, :id_number2, :address, :city, :state, :country, :zip_code, :telephone, :fax, :email, :web, :contact, :initial_cycle, :final_cycle, :plan, :counter, :limit, :note, :date_format, :unit, :separator, :delimiter, :id_number1_label)\n end",
"title": ""
},
{
"docid": "f70a67a7684cd3ab3896914ef3cd93b4",
"score": "0.5865143",
"text": "def use_existing_customer?(params)\n params[:customer_id].present?\n end",
"title": ""
}
] |
c244f9b88e3541335f3b215f1546f9f6 | FIXME: Urgh. Global variables. Need to eliminate these! | [
{
"docid": "7fd2e22f13428d59a448fd3b198b687b",
"score": "0.0",
"text": "def reset_global_classes\n SheetNames.instance.clear\n SharedStrings.instance.clear\n end",
"title": ""
}
] | [
{
"docid": "ef1e4c0cc26e4eec8642a7d74e09c9d1",
"score": "0.7150872",
"text": "def private; end",
"title": ""
},
{
"docid": "3d8e32cf91d050f42553f552c35f4cee",
"score": "0.6874897",
"text": "def global; end",
"title": ""
},
{
"docid": "0b8b7b9666e4ed32bfd448198778e4e9",
"score": "0.66097915",
"text": "def probers; end",
"title": ""
},
{
"docid": "559f2e9692169a65a455772d6daaca89",
"score": "0.6557038",
"text": "def global_variables() end",
"title": ""
},
{
"docid": "57b3793bd8f85fb9b09df8cc98724ba1",
"score": "0.6525384",
"text": "def globals; end",
"title": ""
},
{
"docid": "57b3793bd8f85fb9b09df8cc98724ba1",
"score": "0.6525384",
"text": "def globals; end",
"title": ""
},
{
"docid": "77d6274fb54695f0fe26ab41866beeea",
"score": "0.64638656",
"text": "def global?; end",
"title": ""
},
{
"docid": "d0793afb0e4a1174a3337a6489dad2ae",
"score": "0.62011886",
"text": "def global?; true end",
"title": ""
},
{
"docid": "2cc9969eb7789e4fe75844b6f57cb6b4",
"score": "0.6122126",
"text": "def refutal()\n end",
"title": ""
},
{
"docid": "6a6ed5368f43a25fb9264e65117fa7d1",
"score": "0.60634345",
"text": "def internal; end",
"title": ""
},
{
"docid": "b3d7c178b277afaefb1b9648335941e7",
"score": "0.6054805",
"text": "def loc; end",
"title": ""
},
{
"docid": "b3d7c178b277afaefb1b9648335941e7",
"score": "0.6054805",
"text": "def loc; end",
"title": ""
},
{
"docid": "b3d7c178b277afaefb1b9648335941e7",
"score": "0.6054805",
"text": "def loc; end",
"title": ""
},
{
"docid": "cdd16ea92eae0350ca313fc870e10526",
"score": "0.5984328",
"text": "def who_we_are\r\n end",
"title": ""
},
{
"docid": "f441b8118e227a06e7a1c24b554ba9b4",
"score": "0.59806204",
"text": "def blg; end",
"title": ""
},
{
"docid": "0a39799e76643367f1b6bfac65569895",
"score": "0.5950954",
"text": "def used?; end",
"title": ""
},
{
"docid": "19e38e37d9f3ce87dc1fbf5494560ea0",
"score": "0.5900673",
"text": "def global\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "e524ba185c05b88d0475b0fc4d95cde9",
"score": "0.58565986",
"text": "def common\n \n end",
"title": ""
},
{
"docid": "65ffca17e416f77c52ce148aeafbd826",
"score": "0.58553874",
"text": "def schubert; end",
"title": ""
},
{
"docid": "7ff2011fa3dc45585a9272310eafb765",
"score": "0.5847467",
"text": "def isolated; end",
"title": ""
},
{
"docid": "7ff2011fa3dc45585a9272310eafb765",
"score": "0.5847467",
"text": "def isolated; end",
"title": ""
},
{
"docid": "5971f871580b6a6e5171c35946a30c95",
"score": "0.5827891",
"text": "def stderrs; end",
"title": ""
},
{
"docid": "1f60ec3e87d82a4252630cec8fdc8950",
"score": "0.58248675",
"text": "def berlioz; end",
"title": ""
},
{
"docid": "a29c5ce532d6df480df4217790bc5fc7",
"score": "0.57870865",
"text": "def extra; end",
"title": ""
},
{
"docid": "b8ecb400cb030efcfbf142f3d520461a",
"score": "0.5781772",
"text": "def local_variables() end",
"title": ""
},
{
"docid": "4a8a45e636a05760a8e8c55f7aa1c766",
"score": "0.5776527",
"text": "def terpene; end",
"title": ""
},
{
"docid": "d8ae3e2b236950074c4632d180274b8a",
"score": "0.5772531",
"text": "def specie; end",
"title": ""
},
{
"docid": "d8ae3e2b236950074c4632d180274b8a",
"score": "0.5772531",
"text": "def specie; end",
"title": ""
},
{
"docid": "d8ae3e2b236950074c4632d180274b8a",
"score": "0.5772531",
"text": "def specie; end",
"title": ""
},
{
"docid": "d8ae3e2b236950074c4632d180274b8a",
"score": "0.5772531",
"text": "def specie; end",
"title": ""
},
{
"docid": "5cf2cba0ee7f9825b63b087af5363b37",
"score": "0.5770909",
"text": "def init; end",
"title": ""
},
{
"docid": "5cf2cba0ee7f9825b63b087af5363b37",
"score": "0.5770909",
"text": "def init; end",
"title": ""
},
{
"docid": "5cf2cba0ee7f9825b63b087af5363b37",
"score": "0.5770909",
"text": "def init; end",
"title": ""
},
{
"docid": "5cf2cba0ee7f9825b63b087af5363b37",
"score": "0.5770909",
"text": "def init; end",
"title": ""
},
{
"docid": "06b6203baf3c9311f502228839c5ab4e",
"score": "0.57704276",
"text": "def intensifier; end",
"title": ""
},
{
"docid": "7135a3da9424b7116661eb538eb3f26c",
"score": "0.57662094",
"text": "def rossini; end",
"title": ""
},
{
"docid": "4e6ac675f77b6dbaa5f17bc5c8cb9507",
"score": "0.5758616",
"text": "def variables; end",
"title": ""
},
{
"docid": "4e6ac675f77b6dbaa5f17bc5c8cb9507",
"score": "0.5758616",
"text": "def variables; end",
"title": ""
},
{
"docid": "2d8d9f0527a44cd0febc5d6cbb3a22f2",
"score": "0.5753719",
"text": "def weber; end",
"title": ""
},
{
"docid": "14ec9b02656739171923bd18072bb3a9",
"score": "0.57352275",
"text": "def getlocal() end",
"title": ""
},
{
"docid": "a02f7382c73eef08b14f38d122f7bdb9",
"score": "0.5733703",
"text": "def custom; end",
"title": ""
},
{
"docid": "a02f7382c73eef08b14f38d122f7bdb9",
"score": "0.5733703",
"text": "def custom; end",
"title": ""
},
{
"docid": "4463b65c57e07f544d0288a8a3deba80",
"score": "0.5732062",
"text": "def external; end",
"title": ""
},
{
"docid": "92eb67ffdf10584ed31a74e05f590cc5",
"score": "0.570462",
"text": "def gounod; end",
"title": ""
},
{
"docid": "83341ff0d64168d9ba0614958fec4414",
"score": "0.5702803",
"text": "def used_names; end",
"title": ""
},
{
"docid": "8742865b78eb755e40bb1bff22199433",
"score": "0.568557",
"text": "def internship_passed; end",
"title": ""
},
{
"docid": "4ad19d3270d712a0b1427d62090e5438",
"score": "0.5677552",
"text": "def ibu; end",
"title": ""
},
{
"docid": "9d841b89340438a2d53048b8b0959e75",
"score": "0.56441414",
"text": "def sitemaps; end",
"title": ""
},
{
"docid": "ad244bd0c45d5d9274f7612fa6fee986",
"score": "0.5626709",
"text": "def suivre; end",
"title": ""
},
{
"docid": "b61a4ba68f80637b0607ef5e33968e0b",
"score": "0.561753",
"text": "def pausable; end",
"title": ""
},
{
"docid": "01aa8a279f8410fe445f4355072d70e1",
"score": "0.5604289",
"text": "def local?; end",
"title": ""
},
{
"docid": "13289d4d24c54cff8b70fcaefc85384e",
"score": "0.55963063",
"text": "def verdi; end",
"title": ""
},
{
"docid": "ef1d8de1edccec3a664454458fd41227",
"score": "0.55752623",
"text": "def extra_state; end",
"title": ""
},
{
"docid": "acb84cf7ec5cb9f480913c612a384abb",
"score": "0.5562875",
"text": "def probers=(_arg0); end",
"title": ""
},
{
"docid": "444bed95337127100f046e3a253bd296",
"score": "0.55438834",
"text": "def appraisals; end",
"title": ""
},
{
"docid": "444bed95337127100f046e3a253bd296",
"score": "0.55438834",
"text": "def appraisals; end",
"title": ""
},
{
"docid": "c6715731f631b8a346d3c5119cf80414",
"score": "0.55272573",
"text": "def declared_in; end",
"title": ""
},
{
"docid": "bc658f9936671408e02baa884ac86390",
"score": "0.5523256",
"text": "def anchored; end",
"title": ""
},
{
"docid": "ee927502c251b167dc506cf6cfafcc30",
"score": "0.55226254",
"text": "def upc_e; end",
"title": ""
},
{
"docid": "868bee689e613366bcde437be63323ba",
"score": "0.55133975",
"text": "def init\n\n end",
"title": ""
},
{
"docid": "2dbabd0eeb642c38aad852e40fc6aca7",
"score": "0.550416",
"text": "def operations; end",
"title": ""
},
{
"docid": "2dbabd0eeb642c38aad852e40fc6aca7",
"score": "0.550416",
"text": "def operations; end",
"title": ""
},
{
"docid": "d88aeca0eb7d8aa34789deeabc5063cf",
"score": "0.54989827",
"text": "def offences_by; end",
"title": ""
},
{
"docid": "ab428ae414d7b57bc8d56e38b8d48302",
"score": "0.5498231",
"text": "def setup; end",
"title": ""
},
{
"docid": "ab428ae414d7b57bc8d56e38b8d48302",
"score": "0.5498231",
"text": "def setup; end",
"title": ""
},
{
"docid": "ab428ae414d7b57bc8d56e38b8d48302",
"score": "0.5498231",
"text": "def setup; end",
"title": ""
},
{
"docid": "ab428ae414d7b57bc8d56e38b8d48302",
"score": "0.5498231",
"text": "def setup; end",
"title": ""
},
{
"docid": "ab428ae414d7b57bc8d56e38b8d48302",
"score": "0.5498231",
"text": "def setup; end",
"title": ""
},
{
"docid": "ab428ae414d7b57bc8d56e38b8d48302",
"score": "0.5498231",
"text": "def setup; end",
"title": ""
},
{
"docid": "ab428ae414d7b57bc8d56e38b8d48302",
"score": "0.5498231",
"text": "def setup; end",
"title": ""
},
{
"docid": "ab428ae414d7b57bc8d56e38b8d48302",
"score": "0.5498231",
"text": "def setup; end",
"title": ""
},
{
"docid": "ab428ae414d7b57bc8d56e38b8d48302",
"score": "0.5498231",
"text": "def setup; end",
"title": ""
},
{
"docid": "ab428ae414d7b57bc8d56e38b8d48302",
"score": "0.5498231",
"text": "def setup; end",
"title": ""
},
{
"docid": "ab428ae414d7b57bc8d56e38b8d48302",
"score": "0.5498231",
"text": "def setup; end",
"title": ""
},
{
"docid": "ab428ae414d7b57bc8d56e38b8d48302",
"score": "0.5498231",
"text": "def setup; end",
"title": ""
},
{
"docid": "ab428ae414d7b57bc8d56e38b8d48302",
"score": "0.5498231",
"text": "def setup; end",
"title": ""
},
{
"docid": "ab428ae414d7b57bc8d56e38b8d48302",
"score": "0.5498231",
"text": "def setup; end",
"title": ""
},
{
"docid": "ab428ae414d7b57bc8d56e38b8d48302",
"score": "0.5498231",
"text": "def setup; end",
"title": ""
},
{
"docid": "ab428ae414d7b57bc8d56e38b8d48302",
"score": "0.5498231",
"text": "def setup; end",
"title": ""
},
{
"docid": "ab428ae414d7b57bc8d56e38b8d48302",
"score": "0.5498231",
"text": "def setup; end",
"title": ""
},
{
"docid": "ab428ae414d7b57bc8d56e38b8d48302",
"score": "0.5498231",
"text": "def setup; end",
"title": ""
},
{
"docid": "ab428ae414d7b57bc8d56e38b8d48302",
"score": "0.5498231",
"text": "def setup; end",
"title": ""
},
{
"docid": "4ea6f5c11a3bc16e2394d273e748b292",
"score": "0.54953045",
"text": "def internal?; end",
"title": ""
},
{
"docid": "356bca0411fed0b950c92dd90d0234f1",
"score": "0.5494628",
"text": "def constants() end",
"title": ""
},
{
"docid": "1a9a05bcb6be9d92cd780b74a75569ef",
"score": "0.54945093",
"text": "def placebo?; false end",
"title": ""
},
{
"docid": "3b4df29992323899033bb22a35a64989",
"score": "0.5475811",
"text": "def malts; end",
"title": ""
},
{
"docid": "b9999c43a175046b3b41d2329fdb080c",
"score": "0.5475575",
"text": "def used_names=(_arg0); end",
"title": ""
},
{
"docid": "cfbcefb24f0d0d9b60d1e4c0cf6273ba",
"score": "0.5472346",
"text": "def trd; end",
"title": ""
},
{
"docid": "3db157d82460cb0632778815b62dbc35",
"score": "0.54595405",
"text": "def dh; end",
"title": ""
},
{
"docid": "0eb3d9fe5f9f25d5d4681707022b9ab6",
"score": "0.54498184",
"text": "def ignores; end",
"title": ""
},
{
"docid": "a686c2902f0397781aa1ce9d2887aa42",
"score": "0.5448889",
"text": "def final; end",
"title": ""
},
{
"docid": "69ef761d2d34082fff413ed91509afda",
"score": "0.5448273",
"text": "def main_variable ; end",
"title": ""
},
{
"docid": "07388179527877105fd7246db2b49188",
"score": "0.5443142",
"text": "def villian; end",
"title": ""
},
{
"docid": "45b9e5d1da1562a27f15ce5cb9b634ca",
"score": "0.5435324",
"text": "def ext; end",
"title": ""
},
{
"docid": "45b9e5d1da1562a27f15ce5cb9b634ca",
"score": "0.5435324",
"text": "def ext; end",
"title": ""
},
{
"docid": "5ad7e5c7a147626a2b0a2c5956411be5",
"score": "0.5429781",
"text": "def r; end",
"title": ""
},
{
"docid": "5ad7e5c7a147626a2b0a2c5956411be5",
"score": "0.5429781",
"text": "def r; end",
"title": ""
},
{
"docid": "b39da31c0be918b4e30fd9a065b6908d",
"score": "0.5427949",
"text": "def post_init\n\tend",
"title": ""
},
{
"docid": "a3c677de4120a6b1a1688fb1c77520ce",
"score": "0.5423734",
"text": "def pos; end",
"title": ""
},
{
"docid": "a3c677de4120a6b1a1688fb1c77520ce",
"score": "0.5423734",
"text": "def pos; end",
"title": ""
},
{
"docid": "a3c677de4120a6b1a1688fb1c77520ce",
"score": "0.5423734",
"text": "def pos; end",
"title": ""
}
] |
a678e3f7895f8eddfe67277701111d2b | POST /direccionusuarios POST /direccionusuarios.json | [
{
"docid": "69456168db1eeffe0d9602cd1db7af4a",
"score": "0.65892506",
"text": "def create\n @direccionusuario = Direccionusuario.new(params[:direccionusuario])\n\n respond_to do |format|\n if @direccionusuario.save\n format.html { redirect_to @direccionusuario, notice: 'Direccionusuario was successfully created.' }\n format.json { render json: @direccionusuario, status: :created, location: @direccionusuario }\n else\n format.html { render action: \"new\" }\n format.json { render json: @direccionusuario.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] | [
{
"docid": "5c59423470262fe98adee25cde455b9e",
"score": "0.6440713",
"text": "def create\n params[:direccion][:usuario_id] = current_usuario.id\n\n format_direccion_params\n\n @direccion = Direccion.new(params[:direccion])\n\n if @direccion.save\n render 'direcciones/show'\n else\n render json: camelcase_keys_from_a_hash(@direccion.errors.messages), status: :bad_request\n end\n end",
"title": ""
},
{
"docid": "2a71a96c412440bbc66d7e9ee1399c8b",
"score": "0.6249096",
"text": "def create\n @diretorio = Diretorio.new(diretorio_params)\n if @diretorio.save\n render json: @diretorio\n else\n render json: @diretorio.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "4f4f787b31951e7770f6ddd8936f2b1c",
"score": "0.61293495",
"text": "def post_criar_usuario\r\n self.class.post(\"/usuario/novo\", :body => @dados_header)\r\n \t#json_criar_usuario.to_json) \r\n end",
"title": ""
},
{
"docid": "eff22c3ce192f1e07c936f8dafad5fd4",
"score": "0.6016281",
"text": "def create\n @usuario = Usuario.new(usuario_params)\n\n\n respond_to do |format|\n if @usuario.save\n format.html { redirect_to @usuario, notice: 'Usuario was successfully created.' }\n format.json { render :show, status: :created, location: @usuario }\n saveAllPalpitesToUser(@usuario)\n else\n format.html { render :new }\n format.json { render json: @usuario.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ff12be4b35aa46c0e1139f2d2588ec63",
"score": "0.5987278",
"text": "def create\n\n respond_to do |format|\n if @direccion.save\n format.html { redirect_to @direccion, notice: 'Direccion creada exitosamente.' }\n format.json { render :show, status: :created, location: @direccion }\n else\n format.html { render :new }\n format.json { render json: @direccion.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "980e482d81238088b757487b3908c191",
"score": "0.595763",
"text": "def create\n\t\t@direccion = Direccion.new(params[:direccion])\n\n\t\trespond_to do |format|\n\t\t\t@direccion.personas_id=session[:id]\n\t\t\tif @direccion.save\n\t\t\t NUESTRO_LOG.info \"Se guardo la direccion correctamente\"\n\t\t\t\tformat.html { redirect_to(@direccion, :notice => t('direccioncreada')) }\n\t\t\t\tformat.xml { render :xml => @direccion, :status => :created, :location => @direccion }\n\t\t\telse\n\t\t\t\tformat.html { render :action => \"new\" }\n\t\t\t\tformat.xml { render :xml => @direccion.errors, :status => :unprocessable_entity }\n\t\t\tend\n\t\tend\n\tend",
"title": ""
},
{
"docid": "12ed06e318f1cad60cffe65d52d2e96c",
"score": "0.586189",
"text": "def create\n @direcciones_entrega = current_user.direcciones_entregas.build(direcciones_entrega_params)\n\n respond_to do |format|\n if @direcciones_entrega.save\n format.html { redirect_to @direcciones_entrega, notice: 'Direcciones entrega was successfully created.' }\n format.json { render :show, status: :created, location: @direcciones_entrega }\n else\n format.html { render :new }\n format.json { render json: @direcciones_entrega.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "878830dbc8f6247605864b59da840b0a",
"score": "0.5826233",
"text": "def create\n @direc = Direc.new(direc_params)\n\t@user = User.new(user_params)\n\n respond_to do |format|\n if @user.save\n\t\t@direc.user_id = @user.id;\n\t\tif @direc.save\n\t\t\tformat.html { redirect_to @direc, notice: 'Direc was successfully created.' }\n\t\t\tformat.json { render :show, status: :created, location: @direc }\n\t\tend\n else\n format.html { render :new }\n format.json { render json: @direc.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0d1f8e9052d692d06c13f94915a9619f",
"score": "0.5808403",
"text": "def index\n @diretorios = Diretorio.where(pessoa_id: params[:usuario]).first\n render json: @diretorios\n end",
"title": ""
},
{
"docid": "d5b6080ec9c4600fcf9a0775877ea0b7",
"score": "0.57381773",
"text": "def direc_params\n params.require(:direc).permit(:nome, :dataNasc, :nBI, :morada, :cp, :localidade, :email, :user_id)\n end",
"title": ""
},
{
"docid": "ef4d6503367c74a16165e85997e5ac4b",
"score": "0.57285005",
"text": "def create\n @usuario_unidad = UsuarioUnidad.new(usuario_unidad_params)\n\n respond_to do |format|\n if @usuario_unidad.save\n format.html { redirect_to @usuario_unidad, notice: 'Usuario unidad was successfully created.' }\n format.json { render :show, status: :created, location: @usuario_unidad }\n else\n format.html { render :new }\n format.json { render json: @usuario_unidad.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e113c6704eeeb0d89c28837441400fb3",
"score": "0.5707508",
"text": "def new\n @direccionusuario = Direccionusuario.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @direccionusuario }\n end\n end",
"title": ""
},
{
"docid": "dabe43840f7a9b65b7ba336a8c2932cd",
"score": "0.56795573",
"text": "def diretorio_params\n params.require(:diretorio).permit(:nome, :pessoa_id, :diretorio_id)\n end",
"title": ""
},
{
"docid": "af2b8a9abf842732becb5f0632bbaaa7",
"score": "0.5672677",
"text": "def create\n comunidad = params[:comunidad_user][:comunidad_id]\n user = params[:user_ids]\n @comunidad_user = user.map { |d| ComunidadUser.create(comunidad_id: comunidad, user_id: d) } \n\n respond_to do |format|\n #if @comunidad_user.save\n format.html { redirect_to comunidades_users_path, notice: 'Comunidad user was successfully created.' }\n # format.json { render action: 'show', status: :created, location: @comunidad_user }\n #else\n # format.html { render action: 'new' }\n # format.json { render json: @comunidad_user.errors, status: :unprocessable_entity }\n end\n #end\n end",
"title": ""
},
{
"docid": "8c0a210cebc7c3f206936df3293bc81f",
"score": "0.5637029",
"text": "def create\n @usuario = Usuario.new(usuario_params)\n @caminho = admin_usuarios_path\n respond_to do |format|\n if @usuario.save\n format.html { redirect_to admin_usuario_path(@usuario), notice: 'Usuario was successfully created.' }\n format.json { render :show, status: :created, location: @usuario }\n else\n format.html { render :new }\n format.json { render json: @usuario.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d7c1cd3eccb5fd64e5e304e67faedfd4",
"score": "0.56334865",
"text": "def direccion_params\n params.require(:direccion).permit(:sucursal_id, :calle, :numero, :colonia, :delegacion, :cp, :telefono, :referencia, :mapsgoogle, :matriz, :photo, :cliente_id)\n end",
"title": ""
},
{
"docid": "22d73d014cf1b7e083d2fb3d8adddbdf",
"score": "0.5631473",
"text": "def set_users\n\t userslist = []\n\t @users = User.all\n\t \t\t@users.all.each do |u|\n\t\t\t \t usuarios =\t{\n\t\t\t \t \t :id => u.id, :rut => u.rut, :nombre => u.nombre,\n\t\t\t \t\t :apellido => u.apellido, :image => u.image,\n\t\t\t \t\t :email => u.email, :birth => u.birth,\n\t\t\t \t\t :password => u.password\n\t\t\t \t\t}\n\t\t\t \t\tuserslist << usuarios\t\n\t\t \t end\n\n\t\t\tFile.open(\"public/usuarios.json\",\"w+\") do |f|\n\t\t\t f.write(userslist.to_json)\n\t\t\tend\t \n\t end",
"title": ""
},
{
"docid": "747fa45cbf4104d136b634684ae2147e",
"score": "0.5585166",
"text": "def index\n @users = []\n\n response = RestClient.get 'https://proyectofinal.planodelta.digital/api/usuarios'\n json = JSON.parse response\n \n if !json.nil?\n json.map do |usuario|\n puts usuario[\"id\"]\n @users << User.new(id: \"#{usuario[\"id\"]}\", userName: \"#{usuario[\"nombreUsuario\"]}\", password: \"#{usuario[\"password\"]}\", admin: \"#{usuario[\"admin\"]}\")\n end\n end\n \n end",
"title": ""
},
{
"docid": "e0eb0eacb8ce344af82d72d1bc3474d1",
"score": "0.55744994",
"text": "def direcciones_entrega_params\n params.require(:direcciones_entrega).permit(:estado, :municipio, :colonia, :numero, :cp, :telefono, :notas, :user_id)\n end",
"title": ""
},
{
"docid": "2f6c22c7c85ad69a361c487fefdf59ef",
"score": "0.55703795",
"text": "def create\n @diretor = Diretor.new(diretor_params)\n\n respond_to do |format|\n if @diretor.save\n format.html { redirect_to @diretor, notice: 'Um novo diretor foi criado com sucesso.' }\n format.json { render json: @diretor, status: :created, location: @diretor }\n else\n format.html { render action: \"new\" }\n format.json { render json: @diretor.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ebe7b3157db2f3945d9836be63e92c43",
"score": "0.5563789",
"text": "def usuario_params\n params.require(:usuario).permit(:nome, :email, :password, :password_confirmation, :tipo, :ativo, :telefone, :departamento_id, departamento_ids:[])\n end",
"title": ""
},
{
"docid": "856d1535c3628ae73d9a6367c9d38d22",
"score": "0.5536353",
"text": "def create\n @recursousuario = Recursousuario.new(recursousuario_params)\n\n respond_to do |format|\n if @recursousuario.save\n format.html { redirect_to @recursousuario, notice: 'Recursousuario was successfully created.' }\n format.json { render :show, status: :created, location: @recursousuario }\n else\n format.html { render :new }\n format.json { render json: @recursousuario.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "50cee0926d08d485bf1d16ee830a246b",
"score": "0.5529813",
"text": "def create\n\t\t@usuario = Usuario.new(usuario_params)\n\n\t\t @usuario.save\n\t\t\trender json: @usuario, status: :created\n\t\t\n\tend",
"title": ""
},
{
"docid": "e24f98b60f6db483ccb0d4684bbe54dc",
"score": "0.5518648",
"text": "def direccion_params\n params.require(:direccion).permit(:barrio, :direccion, :tel, :numero_id, :municipio_id)\n end",
"title": ""
},
{
"docid": "efc5ad8329e46dd6f47ceed75ec0572b",
"score": "0.551326",
"text": "def createUnidades\n\t\tnum = 0\n\t\ttamanioUnidad = params[\"unidades\"].length\n\t\twhile num < tamanioUnidad\n\t\t\tnumS = num.to_s\n\t\t\tunidad = Nivel.new\n\t\t\tunidad.unidad = params[\"unidades\"][numS][\"numero\"]\n\t\t\tunidad.credito = params[\"unidades\"][numS][\"hora\"]\n\t\t\tunidad.nombre = params[\"unidades\"][numS][\"nombre\"]\n\t\t\tunidad.contenido_id = params[\"idContenido\"]\n\t\t\tunidad.nivel_id = nil\n\t\t\tif params[\"unidades\"][numS][\"subnivel\"] != \"\" \n\t\t\t\tban = 0\n\t\t\t\ttamanioSubunidad = params[\"unidades\"][numS][\"subnivel\"].length\n\t\t\t\tunidad.save()\n\t\t\t\twhile ban < tamanioSubunidad\n\t\t\t\t\tbanS = ban.to_s\n\t\t\t\t\tsubunidad = Nivel.new\n\t\t\t\t\tsubunidad.unidad = params[\"unidades\"][numS][\"subnivel\"][banS][\"subnumero\"]\n\t\t\t\t\tsubunidad.credito = params[\"unidades\"][numS][\"subnivel\"][banS][\"subhora\"]\n\t\t\t\t\tsubunidad.nombre = params[\"unidades\"][numS][\"subnivel\"][banS][\"subnombre\"]\n\t\t\t\t\tsubunidad.contenido_id = params[\"idContenido\"]\n\t\t\t\t\tsubunidad.nivel_id = unidad.id\n\t\t\t\t\tsubunidad.save()\n\t\t\t\t\tban = ban + 1\n\t\t\t\tend\n\t\t\telse\n\t\t\t\tunidad.save()\n\t\t\tend\n\t\t\tnum = num + 1\n\t\tend\n\t\tnum = 0\n\t\tif params[\"salir\"] == \"true\"\n\t\t\tlinks = \"/academico\"\n\t\t\treturn render json: {link: links},status: :ok\n\t\telsif params[\"salir\"] == \"truefalse\"\n\t\t\t\tlinks = \"\"\n\t\t\t\tmensaje = \"Se guardo exitosamente\"\n\t\t\t\treturn render json: {link: links,mensaje:mensaje},status: :ok\n\t\telse \n\t\t\tlinks = '/academico/prospecto/dirigido/'+params[\"curso\"]+'/crear/'+params[\"idContenido\"]\n\t\t\treturn render json: {link: links},status: :ok\n\t\tend\n\tend",
"title": ""
},
{
"docid": "f1b810b3955f8b692d7c5cb525ae99ad",
"score": "0.54996556",
"text": "def datos_usuario_params\n params.require(:datos_usuario).permit(:nombres, :apellidos, :direccion, :telefono, :ci)\n end",
"title": ""
},
{
"docid": "95391617f1731cec52a85937f3689c90",
"score": "0.54970455",
"text": "def create\n @usuario_perfil = UsuarioPerfil.new(params[:usuario_perfil])\n\n respond_to do |format|\n if @usuario_perfil.save\n format.html { redirect_to @usuario_perfil, :notice => 'Usuario perfil was successfully created.' }\n format.json { render :json => @usuario_perfil, :status => :created, :location => @usuario_perfil }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @usuario_perfil.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "bceab6b3de9831db8b5f76b7437680e4",
"score": "0.54866534",
"text": "def create\n @usuario = User.new(user_params)\n @usuario.ativo = true\n @usuario.mudar_senha = true\n\n \n if current_user.tipo!=\"MASTER\"\n if @usuario.tipo\n if @usuario.tipo==\"LIDERANCA\"\n @entidade = current_user.entidade\n @superiores = @entidade.users.where(:tipo=>\"COORDENADOR\").collect{|u|[u.name,u.id]}\n elsif @usuario.tipo==\"CADASTRO\"\n @entidade = current_user.entidade\n @superiores = @entidade.users.where(:tipo=>\"LIDERANCA\").collect{|u|[u.name,u.id]}\n elsif @usuario.tipo==\"COORDENADOR\" or @usuario.tipo==\"DIGITADOR\" or @usuario.tipo==\"CONFIRMADOR\"\n @superior = current_user.entidade.users.where(:tipo=>\"ADMINISTRADOR\").first\n end\n end\n end\n\n respond_to do |format|\n if @usuario.save\n flash[:notice] = @@msgs\n format.html { redirect_to usuarios_url }\n format.json { render json: @usuario, status: :created, location: @usuario }\n else\n flash[:alert] = @@msge\n format.html { render action: \"new\" }\n format.json { render json: @usuario.errors, status: :unprocessable_entity }\n \n end\n end\n end",
"title": ""
},
{
"docid": "cac485ca7b5f1e5bbcf80713c423d52a",
"score": "0.5484909",
"text": "def update\n if @diretorio.update(diretorio_params)\n render json: @diretorio\n else\n render json: @diretorio.errors, status: :unprocessable_entity \n end\n end",
"title": ""
},
{
"docid": "b3cac057a1d0b9549467119a02c093fe",
"score": "0.54825145",
"text": "def create\r\n @usuario = Usuario.new(usuario_params)\r\n #@usuario= Usuario.new(params[:perfil][:0], params[:usuario][:User_Name], params[:usuario][:Password])\r\n respond_to do |format|\r\n if @usuario.save\r\n Usuario.stateUpdate(@usuario.usuario_id,params[:usuario][:Estado])\r\n Persona.updateCodigoUsuario(@@id_persona, @usuario.usuario_id)\r\n #personAux=Persona.find(@@id_persona)\r\n format.html { redirect_to usuarios_path, notice: 'Usuario creado exitosamente.' }\r\n format.json { render :show, status: :created, location: @usuario }\r\n else\r\n format.html { render :new }\r\n format.json { render json: @usuario.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end",
"title": ""
},
{
"docid": "9a69dbb485268c987e7e204a4acc5c61",
"score": "0.5474694",
"text": "def create\n @user_unidad = UserUnidad.new(user_unidad_params)\n\n respond_to do |format|\n if @user_unidad.save\n format.html { redirect_to @user_unidad, notice: 'User unidad was successfully created.' }\n format.json { render action: 'show', status: :created, location: @user_unidad }\n else\n format.html { render action: 'new' }\n format.json { render json: @user_unidad.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "08c105ec910c21655de3d3029486d9ec",
"score": "0.5470845",
"text": "def create\n @usuario = Usuario.new(usuario_params)\n\n respond_to do |format|\n if @usuario.save\n format.html { redirect_to root_path, notice: 'Tus datos se registraron correctamente. Gracias.' }\n format.json { render action: 'show', status: :created, location: @usuario }\n else\n @referer = @usuario.referer\n @landing = @usuario.landing\n format.html { render action: 'new' }\n format.json { render json: @usuario.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "61d1321d2c6b9b716f8a0b0101fe71b9",
"score": "0.5451969",
"text": "def create\n @usuariocompleto = Usuario.new(usuariocompleto_params)\n\n respond_to do |format|\n if @usuariocompleto.save\n format.html { redirect_to @usuariocompleto, notice: 'Usuário was successfully created.' }\n format.json { render :show, status: :created, location: @usuariocompleto }\n else\n format.html { render :new }\n format.json { render json: @usuariocompleto.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "270b0424532c17d5e5970fd7a32a11ee",
"score": "0.54232526",
"text": "def create\n @diretor = Diretor.new(params[:diretor])\n\n respond_to do |format|\n if @diretor.save\n format.html { redirect_to @diretor, notice: 'Diretor was successfully created.' }\n format.json { render json: @diretor, status: :created, location: @diretor }\n else\n format.html { render action: \"new\" }\n format.json { render json: @diretor.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c0952e59a6c2924ea47afa7b7170805d",
"score": "0.5416159",
"text": "def recursousuario_params\n params.require(:recursousuario).permit(:id, :email, :cedula, :libro, :idlibro)\n end",
"title": ""
},
{
"docid": "30d7066fc106ccd29659475d2085bc8f",
"score": "0.539978",
"text": "def create\n @usuario = Usuario.new(usuario_params)\n\n respond_to do |format|\n if @usuario.save\n addlog(\"Criou um usuário\")\n format.html { redirect_to @usuario, notice: 'Usuário cadastrado com sucesso .' }\n format.json { render :show, status: :created, location: @usuario }\n else\n format.html { render :new }\n format.json { render json: @usuario.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "02a8d3927309715e03f0752dae421ef8",
"score": "0.5391699",
"text": "def sucursal_params\r\n params.require(:sucursal).permit(:direccion, :telefono)\r\n end",
"title": ""
},
{
"docid": "dbe6cd6134e66f8caaacc2842f1a1ed5",
"score": "0.53722",
"text": "def diretor_params\n params.require(:diretor).permit(:nome)\n end",
"title": ""
},
{
"docid": "42b3aeb0b9a1927a0ce5680d83fff0d8",
"score": "0.53706133",
"text": "def create\n @usuario = Usuario.new(params[:usuario])\n #@usuario.datos_id = -1\n #@usuario.datos_type = \"Root\"\n\n respond_to do |format|\n if @usuario.save\n flash[:notice] = 'El usuario fue creado satisfactoriamente.'\n\t\t\t\t\tsession[:usuario_id] = @usuario.id\n format.html { redirect_to(:controller => \"admin\", :action => \"login\" ) }\n\n else\n format.html { render :action => \"new\" }\n end\n end\n end",
"title": ""
},
{
"docid": "a4b967204e0020c60e8c94e5c4d14446",
"score": "0.5369688",
"text": "def create\n if params[:negocio_propio]\n @propietario = Usuario.find(params[:usuario_id])\n authorize! :update, @propietario\n @negocio_propio = Negocio.find(params[:negocio_id])\n if @negocio_propio.propietarios << @propietario\n render json: @negocio_propio.propietarios, status: :created\n else\n render json: @negocio_propio.propietarios.errors, status: :unprocessable_entity\n end\n else\n @usuario = Usuario.new\n authorize! :create, @usuario\n @usuario.update(parametros_crear_usuario)\n if @usuario.save\n render json: @usuario, status: :created\n else\n render json: @usuario.errors, status: :unprocessable_entity\n end \n end\n end",
"title": ""
},
{
"docid": "3aec0aa5ee979d0cfde77bc4472f410c",
"score": "0.53686327",
"text": "def user_unidad_params\n params.require(:user_unidad).permit(:unidad_id, :user_ids => [])\n end",
"title": ""
},
{
"docid": "48123a0b05b4b54135b0bf394145d055",
"score": "0.53413504",
"text": "def create\n @direcciones_factura = current_user.direcciones_facturas.build(direcciones_factura_params)\n\n respond_to do |format|\n if @direcciones_factura.save\n format.html { redirect_to @direcciones_factura, notice: 'Direcciones factura was successfully created.' }\n format.json { render :show, status: :created, location: @direcciones_factura }\n else\n format.html { render :new }\n format.json { render json: @direcciones_factura.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8fc299db6e5200e96f1ad0527753554b",
"score": "0.533649",
"text": "def create\n password = generar_clave\n params[:ciudadano][:barrio_id] = nil if params[:ciudadano][:barrio_id].to_i == 0 \n @ciudadano = Ciudadano.new(params[:ciudadano])\n @ciudadano.password=password\n @usuario = User.new(\n :name=>@ciudadano.apellido+\" \"+@ciudadano.nombre,\n :login=>@ciudadano.dni,\n :email=>@ciudadano.email,\n :password=>password,\n :password_confirmation=>password\n )\n @usuario.tipo=\"ciudadano\"\n @usuario.save\n @ciudadano.user_id = @usuario.id\n respond_to do |format|\n if @ciudadano.save \n format.html { redirect_to @ciudadano, :notice => 'Ciudadano ha sido creado.' }\n format.json { render :json => @ciudadano, :status => :created, :location => @ciudadano }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @ciudadano.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "630087fe430a09533e69e013b080fcd6",
"score": "0.533239",
"text": "def create\n @usuario = Usuario.new(usuario_params)\n\n respond_to do |format|\n if @usuario.save\n format.html { redirect_to usuarios_url, notice: 'Usuario creado.' }\n format.json { render :show, status: :created, location: @usuario }\n else\n format.html { render :new }\n format.json { render json: @usuario.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9faf45762cd18be5accb6927be635a35",
"score": "0.5324596",
"text": "def create\r\n @usuario = Usuario.new(params[:usuario])\r\n\r\n respond_to do |format|\r\n if @usuario.save\r\n format.html { redirect_to @usuario, notice: 'Usuario creado con exito.' }\r\n format.json { render json: @usuario, status: :created, location: @usuario }\r\n else\r\n format.html { render action: \"new\" }\r\n format.json { render json: @usuario.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end",
"title": ""
},
{
"docid": "2a7a3f7799eceb3d9e3ab42ea2bdc75a",
"score": "0.5322491",
"text": "def create\n @usuario = Usuario.new(usuario_params)\n if (current_user) #Quien lo está creando es un admin? -> el usuario que va a crear también lo es.\n @usuario.usuar_tipo_cod = 'A'\n end\n respond_to do |format|\n if @usuario.save\n if (current_user) #Ya esta dentro del sistema?\n else\n session[:usuarios_id] = @usuario.id #si no lo esta ingresarlo. \n end\n \n format.html { redirect_to @usuario, notice: 'Usuario creado con exito.' }\n format.json { render :show, status: :created, location: @usuario }\n else\n format.html { render :new }\n format.json { render json: @usuario.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "cd49bfefe6e7b8f3156c45e6e9c2753d",
"score": "0.53220445",
"text": "def create\n @usuario = Usuario.new(usuario_params)\n @usuario[:periodo] = get_periodo_activo()\n @usuario[:cuenta] = @usuario[:cuenta].upcase\n\n respond_to do |format|\n if @usuario.save\n format.html { render :show}\n format.json { render :show, status: :created, location: @usuario }\n else\n format.html { render :new }\n format.json { render json: @usuario.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2f1736c81c7d0c8feecfd081f7896b56",
"score": "0.53189605",
"text": "def create\n @produto = Produto.new(produto_params)\n @usuario = Usuario.find(params[:produto][:usuario][:usuario_id])\n\n @produto.usuarios << @usuario\n\n respond_to do |format|\n if @produto.save\n format.html { redirect_to @produto, notice: 'Produto was successfully created.' }\n format.json { render :show, status: :created, location: @produto }\n else\n format.html { render :new }\n format.json { render json: @produto.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9744858150148123af5d08050e856530",
"score": "0.5316585",
"text": "def seguridad_usuario_params\n params.require(:seguridad_usuario).permit(:username, :nombres, :apellidos)\n end",
"title": ""
},
{
"docid": "1eabea4974452b031fb4833c42fcdde7",
"score": "0.5314644",
"text": "def create\n @user = User.new({:name => params[:name],\n :email => params[:email],\n :nickname => params[:nickname],\n :password => params[:password],\n :puntuacion => params[:puntuacion],\n :categoria => params[:categoria]}\n )\n if @user.save\n render :json => @user\n else\n render :json => {:status => :error, :message => 'Datos invalidos no se pueden repetir nickname ni email'}\n end\n\n end",
"title": ""
},
{
"docid": "29df7d7a9a34b11b535e829ffa4ab4fe",
"score": "0.5304595",
"text": "def create\n @usuario = Usuario.new(usuario_params)\n\n respond_to do |format|\n if @usuario.save\n format.html { redirect_to inicia_sesion_usuarios_url, notice: 'Tu cuenta fue creada exitosamente.' }\n format.json { render action: 'show', status: :created, location: @usuario }\n else\n format.html { render action: 'new' }\n format.json { render json: @usuario.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0eea1d8c2f7d8d8462cc40263fd63e9d",
"score": "0.5295855",
"text": "def guardar_usuario\n\t\tActiveRecord::Base.transaction do\n\t\t\tbegin\n\n\t\t\t\tuser = User.create!(\n\t\t\t\t\t:email => params[:email],\n\t\t\t\t\t:password => params[:password] ,\n\t\t\t\t\t:var_usuario_nombre => params[:nombre],\n\t\t\t\t\t:var_usuario_apellido => params[:apellido],\n\t\t\t\t\t:var_usuario_documento => params[:num_doc]\n\t\t\t\t)\n\n\t\t\t\tif params[:persona].nil? == false\n\t\t\t\t\tpersona = UsuarioMenu.create!(\n\t\t\t\t\t\t:user => user,\n\t\t\t\t\t\t:menu => Menu.find_by(var_menu_nombre: \"persona\")\n\t\t\t\t\t\t)\n\t\t\t\tend\n\n\t\t\t\tif params[:diezmo].nil? == false\n\t\t\t\t\tdiezmo = UsuarioMenu.create!(\n\t\t\t\t\t\t:user => user,\n\t\t\t\t\t\t:menu => Menu.find_by(var_menu_nombre: \"diezmo\")\n\t\t\t\t\t\t)\n\t\t\t\tend\n\n\t\t\t\tif params[:ofrenda].nil? == false \n\t\t\t\t\tofrenda = UsuarioMenu.create!(\n\t\t\t\t\t\t:user => user,\n\t\t\t\t\t\t:menu => Menu.find_by(var_menu_nombre: \"ofrenda\")\n\t\t\t\t\t\t)\n\t\t\t\tend\n\n\t\t\t\tif params[:asistencia].nil? == false \n\t\t\t\t\tasistencia = UsuarioMenu.create!(\n\t\t\t\t\t\t:user => user,\n\t\t\t\t\t\t:menu => Menu.find_by(var_menu_nombre: \"asistencia\")\n\t\t\t\t\t\t)\n\t\t\t\tend\n\n\t\t\t\tif params[:informacion].nil? == false\n\t\t\t\t\tinformacion = UsuarioMenu.create!(\n\t\t\t\t\t\t:user => user,\n\t\t\t\t\t\t:menu => Menu.find_by(var_menu_nombre: \"informacion\")\n\t\t\t\t\t\t)\n\t\t\t\tend\n\n\t\t\t\tif params[:configuracion].nil? == false\n\t\t\t\t\tconfiguracion = UsuarioMenu.create!(\n\t\t\t\t\t\t:user => user,\n\t\t\t\t\t\t:menu => Menu.find_by(var_menu_nombre: \"configuracion\")\n\t\t\t\t\t\t)\n\t\t\t\tend\n\t\t\t\t\t\n\t\t\trescue\n\t\t\t\traise ActiveRecord::Rollback\n\t\t\tend\n\t\tend\n\t\trender :json => {:resp => params }, :status => :ok\n\tend",
"title": ""
},
{
"docid": "abd39bebfaa09ddb855263dbf5f32110",
"score": "0.52941006",
"text": "def create\n @usuario = Usuario.new(params[:usuario])\n @usuario.usuario_id = current_usuario.id\n\n respond_to do |format|\n if @usuario.save\n format.html { redirect_to @usuario }\n format.json { render json: @usuario, status: :created, location: @usuario }\n else\n format.html { render action: \"new\" }\n format.json { render json: @usuario.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "901f951fce26c239e73fa4c299ce5caf",
"score": "0.52850085",
"text": "def create\n @centro_salud = CentroSalud.new(centro_salud_params)\n @centro_salud.usuario_id = params[:usuario_id_aux]\n @usuario=Usuario.find(params[:usuario_id_aux])\n @centro_salud.nombre = @usuario.nombre\n\n respond_to do |format|\n if not_update_tipo_usuario\n if @centro_salud.save\n @usuario.tipo_usuario = 2\n @usuario.rol_id = @centro_salud.id\n if @usuario.save\n format.html { redirect_to @centro_salud }\n #format.json { render :show, status: :created, location: @centro_salud }\n else\n @centro_salud.delete\n @usuario.errors.each do |name_, erro|\n flash[name_] = erro\n end\n format.html { redirect_to registro_centro_path(@usuario) }\n end\n else\n @centro_salud.errors.each do |name_, erro|\n flash[name_] = erro\n end\n format.html { redirect_to registro_centro_path(@usuario) }\n end\n else\n @usuario.errors.each do |name_, erro|\n flash[name_] = erro\n end\n format.html { redirect_to already_registered_path }\n end\n\n end\n end",
"title": ""
},
{
"docid": "43cdb0192f271b3920d730a7d6ef2880",
"score": "0.5281761",
"text": "def create\n @usuario = Usuario.new(usuario_params)\n\n respond_to do |format|\n if @usuario.save\n format.html { redirect_to @usuario, notice: 'Usuario creado existosamente.' }\n format.json { render :show, status: :created, location: @usuario }\n else\n format.html { render :new }\n format.json { render json: @usuario.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a901a8bf7bc950c1e14af8771c75384b",
"score": "0.5269415",
"text": "def create\n @usuario = Usuario.new(usuario_params)\n respond_to do |format|\n if @usuario.save\n format.html { redirect_to @usuario, flash: {success: 'Usuário registrado com sucesso.'} }\n format.json { render :show, status: :created, location: @usuario }\n else\n format.html { render :new }\n format.json { render json: @usuario.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "43db5233e827676737fe4d802fa84b4a",
"score": "0.52647746",
"text": "def create\n @clientes = Cliente.all\n @sucursales = Sucursal.where(\"cliente_id = ?\", params[:direccion][:cliente_id]).order(:nombre)\n\n #@direccion = Direccion.new(direccion_params)\n @direccion.sucursal_id =params[:direccion][:sucursal_id]\n @direccion.cliente_id =params[:direccion][:cliente_id]\n respond_to do |format|\n if @direccion.save\n format.html { redirect_to @direccion, notice: 'Direccion was successfully created.' }\n format.json { render action: 'show', status: :created, location: @direccion }\n else\n format.html { render action: 'new', :layout => \"layout_2\" }\n format.json { render json: @direccion.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8090ca2930570c8dfbd0e4d0f8b59deb",
"score": "0.5263944",
"text": "def create\n @usuario = User.new(usuario_params)\n respond_to do |format|\n if @usuario.save\n flash[:success] = @@msgs\n format.html { redirect_to usuarios_url }\n format.json { render :show, status: :created, location: @usuario }\n format.js {}\n else\n format.html { render :new }\n format.json { render json: @usuario.errors, status: :unprocessable_entity }\n format.js { render :new, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "efa0627d75bb6f83c00865313146e246",
"score": "0.5249073",
"text": "def create\n @usuario = Usuario.new(usuario_params)\n\n respond_to do |format|\n if @usuario.save\n format.html { redirect_to @usuario, notice: 'Usuario creado exitosamente.' }\n format.json { render :show, status: :created, location: @usuario }\n else\n format.html { render :new }\n format.json { render json: @usuario.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "bdf92ea8c633018a30732a916d812550",
"score": "0.52477837",
"text": "def create\n @usuario = Usuario.new(params[:usuario])\n\n respond_to do |format|\n if @usuario.save\n format.html { redirect_to @usuario, notice: 'Usuario was successfully created.' }\n format.json { render json: @usuario, status: :created, location: @usuario }\n else\n format.html { render action: \"new\" }\n format.json { render json: @usuario.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "bdf92ea8c633018a30732a916d812550",
"score": "0.52477837",
"text": "def create\n @usuario = Usuario.new(params[:usuario])\n\n respond_to do |format|\n if @usuario.save\n format.html { redirect_to @usuario, notice: 'Usuario was successfully created.' }\n format.json { render json: @usuario, status: :created, location: @usuario }\n else\n format.html { render action: \"new\" }\n format.json { render json: @usuario.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "37985c48d5b61c8f5cf1435be046c885",
"score": "0.5243899",
"text": "def create\n # Cria um novo usuário\n \tuser = User.new(users_params)\n \tif user.save\n \t\trender json: :success, status: 201\n \telse\n \t\trender json: user.errors, status: :unprocessable_entity\n \tend\n end",
"title": ""
},
{
"docid": "2584e9ffc6031fe7d43b04176edb287b",
"score": "0.5242961",
"text": "def create\n @usuario = Usuario.new(params[:usuario])\n @usuario.codigo = (@usuario.Nombre[0,1] + @usuario.Apellido[0,3]).upcase\n @codigos = Usuario.count(:all, :conditions => [\"codigo LIKE ?\" ,@usuario.codigo] )\n \n \n \n if @codigos > 0\n @usuario.codigo = @usuario.codigo + Usuario.codigoHelper(@codigos)\n end\n \n \n if @codigos > 26\n flash[:notice] = \"Demasiados usuarios con este codigo, por favor contactese con el administrador del sistema.\" \n redirect_to :action => \"index\", :controller => \"usuarios\" \n return \n end\n tempPassword = @usuario.Password\n @usuario.Password = Digest::SHA1.hexdigest(@usuario.Password)\n respond_to do |format|\n if @usuario.save\n @usuario.Password = tempPassword\n UsuarioMailer.welcome_email(@usuario).deliver\n #Se quito ya que los usuarios no se registran, admin los crea\n #session[:Usuario_id] = @usuario.id\n format.html { redirect_to usuarios_path, notice: 'Usuario fue creado exitosamente.' }\n format.json { render json: @usuario, status: :created, location: @usuario }\n else\n case @usuario.idTipoUsuario.to_s\n when \"2\"\n format.html { render action: \"nuevo_gerente\" }\n format.json { render json: @usuario.errors, status: :unprocessable_entity }\n when \"3\"\n format.html { render action: \"nuevo_cajero\" }\n format.json { render json: @usuario.errors, status: :unprocessable_entity }\n when \"4\"\n format.html { render action: \"nuevo_cliente\" }\n format.json { render json: @usuario.errors, status: :unprocessable_entity }\n end\n end\n end\n end",
"title": ""
},
{
"docid": "13498b580f850d73ded395fa7a246896",
"score": "0.52429354",
"text": "def create\n @usuario = Usuario.new(usuario_params)\n\n respond_to do |format|\n if @usuario.save\n @pessoa = Pessoa.find(usuario_params[:pessoa_id]).update_attributes!(usuario_id: @usuario.id)\n format.html { redirect_to admin_usuario_path(@usuario), notice: I18n.t('messages.cadastro_sucesso') }\n format.json { render :show, status: :created, location: @usuario }\n else\n format.html { render :new }\n format.json { render json: @usuario.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3ff32530e988a6b472f76dca719c5180",
"score": "0.524243",
"text": "def create\n @usuario = Usuario.new(usuario_params)\n\n respond_to do |format|\n if @usuario.save\n format.html { redirect_to @usuario, notice: 'Usuario creado correctamente.' }\n format.json { render :show, status: :created, location: @usuario }\n else\n format.html { render :new }\n format.json { render json: @usuario.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2994d6ed3eef06fce20e9a31cc980daf",
"score": "0.523874",
"text": "def create\r\n @usuario = Usuario.new(us_params)\r\n\r\n respond_to do |format|\r\n if @usuario.save\r\n format.html { redirect_to @usuario, notice: 'Usuario creado con exito.' }\r\n format.json { render :show, status: :created, location: @usuario }\r\n else\r\n format.html { render :new }\r\n format.json { render json: @usuario.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n\r\nend",
"title": ""
},
{
"docid": "8a80d9f66ab46888c94686b0fb3966b1",
"score": "0.5238517",
"text": "def usuario_params\n params.require(:usuario).permit(:categorium_id, :numero, :razon_social, :domicilio_postal, :domicilio_servicio, :circunscripcion, :sector, :tipo, :manzana, :parcela, :unidad_funcional, :latitud, :longitud, :fecha_alta, :fecha_baja, persona_attributes: [:tipo_documento_id, :nro_documento, :apellido, :nombre, :telefono, :email], usuario_medidors_attributes: [:id, :medidor_id, :_destroy])\n end",
"title": ""
},
{
"docid": "a522a324a4fd1af86503aca7ab8deb3a",
"score": "0.5237917",
"text": "def create\n @datos_usuario = DatosUsuario.new(datos_usuario_params)\n\n respond_to do |format|\n if @datos_usuario.save\n format.html { redirect_to @datos_usuario, notice: 'Datos usuario was successfully created.' }\n format.json { render action: 'show', status: :created, location: @datos_usuario }\n else\n format.html { render action: 'new' }\n format.json { render json: @datos_usuario.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1bfcae6b281518fde8b69e99f9f266f6",
"score": "0.523643",
"text": "def create\n @grupo_de_despesa = GrupoDeDespesa.new()\n\t@grupo_de_despesa[:descricao] = params[:grupo_de_despesa][:descricao]\n\t@grupo_de_despesa[:data_das_despesas] = params[:grupo_de_despesa][:data_das_despesas]\n\t@grupo_de_despesa[:usuario] = Usuario.find(params[:grupo_de_despesa][:usuario].to_i)\n\n respond_to do |format|\n if @grupo_de_despesa.save\n format.html { redirect_to @grupo_de_despesa, notice: 'Grupo de despesa was successfully created.' }\n format.json { render json: @grupo_de_despesa, status: :created, location: @grupo_de_despesa }\n else\n format.html { render action: \"new\" }\n format.json { render json: @grupo_de_despesa.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ac0eb47ec5eb496b33e0a021b4b3e17d",
"score": "0.5223831",
"text": "def usuario_unidad_params\n params.require(:usuario_unidad).permit(:usuario_id, :unidad_id)\n end",
"title": ""
},
{
"docid": "d7cfa1b3e56274abcf6cf76bc36e3c67",
"score": "0.52129537",
"text": "def create\n if params[:admin] == 'admin'\n @usuario = Administrador.new(params[:usuario])\n else\n @usuario = Cooperativa.new(params[:usuario])\n end\n\n respond_to do |format|\n if @usuario.save\n format.html { redirect_to [:admin, @usuario], :notice => 'Exemplo was successfully created.' }\n format.json { render :json => @usuario, :status => :created, :location => @usuario }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @usuario.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d7f35f43900e0ed65378c5f841447175",
"score": "0.51996017",
"text": "def set_auth_users\n Log.add_info(request, params.inspect)\n\n raise(RequestPostOnlyException) unless request.post?\n\n @folder = Folder.find(params[:id])\n\n if Folder.check_user_auth(@folder.id, @login_user, 'w', true)\n\n read_users = []\n write_users = []\n users_auth = params[:users_auth]\n unless users_auth.nil?\n users_auth.each do |auth_param|\n user_id = auth_param.split(':').first\n auths = auth_param.split(':').last.split('+')\n if auths.include?('r')\n read_users << user_id\n end\n if auths.include?('w')\n write_users << user_id\n end\n end\n end\n\n user_id = @folder.get_my_folder_owner\n if !user_id.nil? and (!read_users.include?(user_id.to_s) or !write_users.include?(user_id.to_s))\n flash[:notice] = 'ERROR:' + t('folder.my_folder_without_auth_owner')\n else\n @folder.set_read_users(read_users)\n @folder.set_write_users(write_users)\n\n @folder.save\n\n flash[:notice] = t('msg.register_success')\n end\n else\n flash[:notice] = 'ERROR:' + t('folder.need_auth_to_modify')\n end\n\n @group_id = params[:group_id]\n SqlHelper.validate_token([@group_id])\n\n if @group_id.blank?\n @users = []\n else\n @users = Group.get_users(@group_id)\n end\n render(:partial => 'ajax_auth_users', :layout => false)\n\n rescue => evar\n Log.add_error(request, evar)\n render(:partial => 'ajax_auth_users', :layout => false)\n end",
"title": ""
},
{
"docid": "3c9c8640b0035da66e86456387757bd2",
"score": "0.5196879",
"text": "def create\n @usuario = Usuario.new(usuario_params)\n\n respond_to do |format|\n if @usuario.save\n format.html { redirect_to @usuario, notice: 'Usuário foi criado com sucesso.' }\n format.json { render :show, status: :created, location: @usuario }\n else\n format.html { render :new }\n format.json { render json: @usuario.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5a982cfcf17816ee795fd32e51019b20",
"score": "0.51965517",
"text": "def create\n @user = User.new\n @user.name = params[:name]\n @user.dni = params[:dni]\n @user.email = params[:email]\n @user.password = params[:password]\n @user.password_confirmation = params[:password_confirmation]\n @user.save!\n\n render json: { params: params, notice: 'Usuario registrado exitosamente' }\n end",
"title": ""
},
{
"docid": "a05ecc38aa0a680a9b6c4a07cd25295e",
"score": "0.5190818",
"text": "def create\n @usuario = Usuario.new(usuario_params)\n\n respond_to do |format|\n if @usuario.save\n format.html { redirect_to @usuario, notice: 'Usuario was successfully created.' }\n format.json { render :show, status: :created, location: @usuario }\n else\n format.html { render :new }\n format.json { render json: @usuario.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a05ecc38aa0a680a9b6c4a07cd25295e",
"score": "0.5190818",
"text": "def create\n @usuario = Usuario.new(usuario_params)\n\n respond_to do |format|\n if @usuario.save\n format.html { redirect_to @usuario, notice: 'Usuario was successfully created.' }\n format.json { render :show, status: :created, location: @usuario }\n else\n format.html { render :new }\n format.json { render json: @usuario.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d52e65ccc2e60d463384878d0aaddeb2",
"score": "0.5184746",
"text": "def create\n\t @user = Usuario.new(usuario_params) \n\t respond_to do |format|\n\t if @user.save\n\t format.html { redirect_to backoffice_usuarios_path, notice: 'Usuario creado con exito.' }\n\t format.json { render :show, status: :created, location: @my_app }\n\t else\n\t format.html { render :new }\n\t format.json { render json: @user.errors, status: :unprocessable_entity }\n\t end\n\t end\n\t end",
"title": ""
},
{
"docid": "8021cb562f7062ab418bb4988aaab395",
"score": "0.5183776",
"text": "def create\n\n # RDCU - CU01 : Demarrer Ajout Restaurateur (API)\n\n @res = User.new(all_user_params)\n\n # RDCU - CU01 : Entrer Information\n\n @account = Restaurateur.new(restaurateur_params)\n @res.account = @account\n\n if not restaurants_params.empty?\n restaurants_params.each do |restoId|\n @resto = Restaurant.find_by_id(restoId)\n if @resto\n @res.account.restaurants.push(@resto)\n end\n end\n end\n\n # Response\n\n if @res.save\n @restaurateur = @res\n render 'restaurateurs/show'\n else\n render :json => @res.errors, :status => :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "956ea3e6309d7d71dbb72ab8a7828e91",
"score": "0.5183551",
"text": "def duenio_params\n params.require(:duenio).permit(:nombre, :direccion, :image)\n end",
"title": ""
},
{
"docid": "cfa577c8dedc25e3e05504c024405ac0",
"score": "0.5182817",
"text": "def usuario_params\n params.require(:user).permit(:permissao, :nome, :empresa_id, :ativo, :mudar_senha, :email, \n :password, :password_confirmation,\n :sign_in_count, :current_sign_in_at, :last_sign_in_at, :current_sign_in_ip,\n :current_password, :last_sign_in_ip, :plano_ids => [])\n end",
"title": ""
},
{
"docid": "ce09df75854137d3659d722694e05b1f",
"score": "0.51808935",
"text": "def create\n @unidade = Unidade.new(params[:unidade])\n\n respond_to do |format|\n if @unidade.save\n format.html { redirect_to [:admin, @unidade], notice: 'Unidade cadastrada com sucesso.' }\n format.json { render json: @unidade, status: :created, :location => admin_unidades_path }\n else\n format.html { render action: \"new\" }\n format.json { render json: @unidade.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7a45035dab4a1cb1e70191f72346e31a",
"score": "0.5180218",
"text": "def create #IGNORE\n @usuario = Usuario.new(params[:usuario])\n \n respond_to do |format|\n if @usuario.save\n flash[:notice] = 'Usuario creado correctamente.'\n format.html { redirect_to(@usuario) }\n else\n format.html {\n draw_map(true)\n render :action => \"edit\"\n }\n format.xml { render :xml => @usuario.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "dd66d1e55d8e2920e8ff0cef701881ae",
"score": "0.51756656",
"text": "def create\n @usuariopregao = Usuariopregao.new(usuariopregao_params)\n\n respond_to do |format|\n if @usuariopregao.save\n format.html { redirect_to @usuariopregao, notice: 'Usuariopregao was successfully created.' }\n format.json { render :show, status: :created, location: @usuariopregao }\n else\n format.html { render :new }\n format.json { render json: @usuariopregao.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a7b5cd6318a2ce85301e3550b6950450",
"score": "0.51681304",
"text": "def create\n @usuario_cargo = UsuarioCargo.new(usuario_cargo_params)\n\n respond_to do |format|\n if @usuario_cargo.save\n format.html { redirect_to @usuario_cargo, notice: \"Usuario cargo was successfully created.\" }\n format.json { render :show, status: :created, location: @usuario_cargo }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @usuario_cargo.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4dae5bffafa98da4d6846fa897e239db",
"score": "0.51636606",
"text": "def create_user\n url = Addressable::URI.new(\n scheme: 'http',\n host: 'localhost',\n port: 3000,\n path: '/users.json'\n ).to_s\n\n puts RestClient.post(\n url,\n { user: { username: \"Gizmo\"} }\n )\nend",
"title": ""
},
{
"docid": "18a2463b1e53472817dc50058350c247",
"score": "0.5162897",
"text": "def usuario_params\n params.require(:usuario).permit(:nome, :email, :senha, :endereco, :denuncias, :perfil_id)\n end",
"title": ""
},
{
"docid": "727016d08d189a19b098d57310dd889f",
"score": "0.5161118",
"text": "def juntum_params\n params.require(:juntum).permit(:nombre, :fecha, :descripcion, usuario_ids:[])\n end",
"title": ""
},
{
"docid": "ffef349dcb17c08d02faaa7c4967f759",
"score": "0.5160484",
"text": "def usuario_registro\n if params[:nombre].blank?\n showError(\"Denegado - Falta nombre\") and return\n elsif params[:apellidos].blank?\n showError(\"Denegado - Falta apellidos\") and return\n elsif params[:telefono].blank?\n showError(\"Denegado - Falta telefono\") and return\n elsif params[:ciudad].blank?\n showError(\"Denegado - Falta ciudad\") and return\n elsif params[:email].blank?\n showError(\"Denegado - Falta email\") and return\n elsif params[:password].blank?\n showError(\"Denegado - Falta password\") and return\n elsif RestaurantesUsuario.where(:email => params[:email])\n showError(\"Denegado - Usuario ya existe\") and return\n end\n\n @restauranteUsuario = RestaurantesUsuario.create(:fecha => Time.zone.now.strftime(\"%F\"), :hora => Time.zone.now.strftime(\"%T\"), :nombre => params[:nombre], :apellidos => params[:apellidos], :telefono => params[:telefono], :ciudad => params[:ciudad], :medio => params[:medio], :email => params[:email], :password => OpenSSL::HMAC.hexdigest('sha256', 'colombia', params[:password]) )\n\n if @restauranteUsuario.exists?\n respond_to do |format|\n format.json { render json: @restaurantesReservas }\n format.xml { render '/app/views/api_mesafijas/usuario_registro.xml.builder' }\n end\n else\n showError(\"Error - No se ha podido registrar el usuario\") and return\n end\n end",
"title": ""
},
{
"docid": "69d9c462e2a9ec7ab12902217b64949d",
"score": "0.51592374",
"text": "def create\n @apodos_usuario = ApodosUsuario.new(params[:apodos_usuario])\n\n respond_to do |format|\n if @apodos_usuario.save\n format.html { redirect_to @apodos_usuario, notice: 'Apodos usuario was successfully created.' }\n format.json { render json: @apodos_usuario, status: :created, location: @apodos_usuario }\n else\n format.html { render action: \"new\" }\n format.json { render json: @apodos_usuario.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "10193460f23f092f995782f4a4046992",
"score": "0.5157636",
"text": "def create\n if current_user.nil?\n redirect_to(log_in_path) and return\n end\n \n @usuario = Usuario.find(params[:usuario_id])\n @usuario_seccion = @usuario.usuarios_secciones.create(params[:usuario_seccion])\n \n\n respond_to do |format|\n if @usuario_seccion.save\n format.html { redirect_to @usuario }\n format.json { render json: @usuario_seccion, status: :created, location: @usuario_seccion }\n else\n @usuario_seccion.seccion_id = \"\"\n format.html { render 'usuarios/show' }\n format.json { render json: @usuario_seccion.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d45b1b1e3b9d7444e213a6a5e56beed6",
"score": "0.51535577",
"text": "def usuario_params\n params.permit(:login, :nombre, :password, :password_confirmation,\n :nivel, :estado_id, :tipoImpresora, :usuariocre)\n end",
"title": ""
},
{
"docid": "22201f22e629399ac67e583badeab894",
"score": "0.5152873",
"text": "def post_users_json payload\n\tJSON.parse ( rest_client_request :post, HF_URL, payload ).body\nend",
"title": ""
},
{
"docid": "1b0a525478b73a9fc8b8b45d328fa1e6",
"score": "0.5143453",
"text": "def create\n \t@usuario = Usuario.new usuario_params\n \t@usuario.save\n redirect_to usuarios_path\n end",
"title": ""
},
{
"docid": "f37615c24fe3ca677d7239877207cf5a",
"score": "0.51416445",
"text": "def create\n @login = params[:viewUser]\n @pass = params[:viewSenha]\n\n @usuario = Usuario.new\n\n if @usuario.existe_usuario(@login, @pass) then\n redirect_to '/usuarios'\n else\n redirect_to '/'\n end\n\n end",
"title": ""
},
{
"docid": "d0cd632f14d959996325cb2336c64895",
"score": "0.51395994",
"text": "def index\n @usuarios = Usuario.all\n render :json => @usuarios\n end",
"title": ""
},
{
"docid": "1a64f8e034f7c94bdb5896ea74d5d9e3",
"score": "0.513708",
"text": "def create\n @usuario = User.new(params[:usuario])\n respond_to do |format|\n if @usuario.save\n format.json { render :json => @usuario, :status => :created, :location => @usuario }\n format.html { redirect_to @usuario, :notice => 'Usuario was successfully created.' }\n else\n # render action: \"new\"\n format.html { render :new }\n format.json { render :json => @usuario.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "aec00be167bdcebe18b676cf28e20078",
"score": "0.5136108",
"text": "def create\n @usuario = Usuario.new(usuario_params)\n\n respond_to do |format|\n if @usuario.save\n format.html { redirect_to @usuario, notice: 'Usuario was successfully created.' }\n format.json { render action: 'show', status: :created, location: @usuario }\n else\n format.html { render action: 'new' }\n format.json { render json: @usuario.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "aec00be167bdcebe18b676cf28e20078",
"score": "0.5136108",
"text": "def create\n @usuario = Usuario.new(usuario_params)\n\n respond_to do |format|\n if @usuario.save\n format.html { redirect_to @usuario, notice: 'Usuario was successfully created.' }\n format.json { render action: 'show', status: :created, location: @usuario }\n else\n format.html { render action: 'new' }\n format.json { render json: @usuario.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "aec00be167bdcebe18b676cf28e20078",
"score": "0.5136108",
"text": "def create\n @usuario = Usuario.new(usuario_params)\n\n respond_to do |format|\n if @usuario.save\n format.html { redirect_to @usuario, notice: 'Usuario was successfully created.' }\n format.json { render action: 'show', status: :created, location: @usuario }\n else\n format.html { render action: 'new' }\n format.json { render json: @usuario.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "baa619cef2bacfe3a33197c038ceda91",
"score": "0.51344097",
"text": "def create\n @user = Usuario.new(params[:usuario])\n @orgaos=Orgao.order(:sigla).collect{|o|[o.sigla,o.id]}\n respond_to do |format|\n if @user.save\n format.html { redirect_to(usuarios_url, :notice => 'Usuario criado com sucesso.') }\n format.xml { render :xml => @user, :status => :created, :location => @user }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @user.errors, :status => :unprocessable_entity }\n end\n end\n\n end",
"title": ""
}
] |
7ff92862c76b55b5a3014b17e39f63de | POST /catalogs POST /catalogs.json | [
{
"docid": "aceac9bec1f337ccf3638afb427a35a4",
"score": "0.60797757",
"text": "def create\n @catalog = Catalog.new(catalog_params)\n @catalog.textbook_id = session[:textbook_id]\n @catalog.user_id = current_user.id\n\n respond_to do |format|\n if @catalog.save\n session[:new_catalog_serial] = @catalog.serial\n format.html { redirect_to @catalog, notice: \"目录已被成功创建\" }\n format.json { render :show, status: :created, location: @catalog }\n else\n format.html { render :new }\n format.json { render json: @catalog.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] | [
{
"docid": "92dd45ef71df8a96ffaca939d7ede19a",
"score": "0.7375994",
"text": "def create\n @catalog = Catalog.new(catalog_params)\n\n respond_to do |format|\n if @catalog.save\n format.html { redirect_to '/catalogs', notice: 'Catalog was successfully updated.' }\n format.json { render :show, status: :created, location: @catalog }\n else\n format.html { render :new }\n format.json { render json: @catalog.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9e88ac9e819bf4456c28cdf47672fcfa",
"score": "0.7359111",
"text": "def create\n @catalog = Catalog.new(params[:catalog])\n\n respond_to do |format|\n if @catalog.save\n format.html { redirect_to @catalog, notice: 'Catalog was successfully created.' }\n format.json { render json: @catalog, status: :created, location: @catalog }\n else\n format.html { render action: \"new\" }\n format.json { render json: @catalog.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e7928f28c33f8e77c4e2c51a2e5788f8",
"score": "0.72596157",
"text": "def create\n @catalog = Catalog.new(catalog_params)\n\n respond_to do |format|\n if @catalog.save\n format.html { redirect_to @catalog, notice: 'Catalog was successfully created.' }\n format.json { render action: 'show', status: :created, location: @catalog }\n else\n format.html { render action: 'new' }\n format.json { render json: @catalog.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "75c41e0a23532bebb7c8f0a36f38b111",
"score": "0.69715965",
"text": "def create\n @admin_catalog = Admin::Catalog.new(params[:admin_catalog])\n\n respond_to do |format|\n if @admin_catalog.save\n format.html { redirect_to @admin_catalog, notice: 'Catalog was successfully created.' }\n format.json { render json: @admin_catalog, status: :created, location: @admin_catalog }\n else\n format.html { render action: \"new\" }\n format.json { render json: @admin_catalog.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "56b75d84dc97531e7f41b2308354c254",
"score": "0.6905046",
"text": "def create\n @catalogs_resource = Catalogs::Resource.new(catalogs_resource_params)\n if @catalogs_resource.save\n flash[:success] = t('notices.saved_successfully')\n index\n end\n end",
"title": ""
},
{
"docid": "7af3d063e4c29e2f434b2c63e8d944ef",
"score": "0.6697459",
"text": "def new\n @catalog = Catalog.new\n @catalog.catalogitems.build\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @catalog }\n end\n end",
"title": ""
},
{
"docid": "c3ed32ba9a77c798104230e8a46b2128",
"score": "0.6676856",
"text": "def create\n @catalog = Catalog.new(catalog_params)\n if @catalog.save\n redirect_to dashboard_catalog_path(@catalog), notice: 'Catalog was successfully created.'\n else\n render :new\n end\n end",
"title": ""
},
{
"docid": "c9c34e33f4d40c205bdfdd80deb16641",
"score": "0.66686344",
"text": "def create\n @sub_catalog = SubCatalog.new(sub_catalog_params)\n\n respond_to do |format|\n if @sub_catalog.save\n format.html { redirect_to @sub_catalog, notice: 'Sub catalog was successfully created.' }\n format.json { render action: 'show', status: :created, location: @sub_catalog }\n else\n format.html { render action: 'new' }\n format.json { render json: @sub_catalog.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "42202d545fe3907f6255d00ad61eccff",
"score": "0.6651445",
"text": "def create\n @main_catalog = MainCatalog.new(main_catalog_params)\n\n respond_to do |format|\n if @main_catalog.save\n format.html { redirect_to @main_catalog, notice: 'Main catalog was successfully created.' }\n format.json { render action: 'show', status: :created, location: @main_catalog }\n else\n format.html { render action: 'new' }\n format.json { render json: @main_catalog.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "692b82bddb0d9b686787419ba4e1b3b5",
"score": "0.66389364",
"text": "def create\n @catalogo = Catalogo.new(params[:catalogo])\n\n respond_to do |format|\n if @catalogo.save\n format.html { redirect_to @catalogo, notice: 'Catalogo was successfully created.' }\n format.json { render json: @catalogo, status: :created, location: @catalogo }\n else\n format.html { render action: \"new\" }\n format.json { render json: @catalogo.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d06c27f69d84bcb3f5df8c815d3b3807",
"score": "0.66260564",
"text": "def create\n @catalog = Catalog.new(params[:catalog])\n\n if Catalog.order('nindex').count != 0\n @catalog.nindex = Catalog.order('nindex').last().nindex + 1\n else\n @catalog.nindex = 1\n end\n\n respond_to do |format|\n if @catalog.save\n format.html { redirect_to @catalog, notice: 'Catalog was successfully created.' }\n format.json { render json: @catalog, status: :created, location: @catalog }\n else\n format.html { render action: \"new\" }\n format.json { render json: @catalog.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7775fec9fe9f3a7e23786457c427c1f9",
"score": "0.6624008",
"text": "def create\n @catalog = Catalog.create(catalog_params)\n redirect_to :root\n end",
"title": ""
},
{
"docid": "11d15eebdfc70dadad8a59be8198ae4d",
"score": "0.6623096",
"text": "def create_catalog(catalog_post_request, opts = {})\n data, _status_code, _headers = create_catalog_with_http_info(catalog_post_request, opts)\n data\n end",
"title": ""
},
{
"docid": "568f2efde185e170808951e1f474f10c",
"score": "0.66128635",
"text": "def create\n @article_catalog = ArticleCatalog.new(article_catalog_params)\n\n respond_to do |format|\n if @article_catalog.save\n format.html { redirect_to @article_catalog, notice: 'Article catalog was successfully created.' }\n format.json { render :show, status: :created, location: @article_catalog }\n else\n format.html { render :new }\n format.json { render json: @article_catalog.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "48b8bec16f9af5f2f797839ba85a2024",
"score": "0.6580228",
"text": "def create_catalog(org_id, catalog_name, catalog_description)\n builder = Nokogiri::XML::Builder.new do |xml|\n xml.AdminCatalog(\n 'xmlns' => 'http://www.vmware.com/vcloud/v1.5',\n 'name' => catalog_name\n ) { xml.Description catalog_description }\n\n end\n\n params = {\n 'method' => :post,\n 'command' => \"/admin/org/#{org_id}/catalogs\"\n }\n\n response, _headers = send_request(\n params,\n builder.to_xml,\n 'application/vnd.vmware.admin.catalog+xml'\n )\n task_id = URI(response.css(\n \"AdminCatalog Tasks Task[operationName='catalogCreateCatalog']\"\n ).first[:href]).path.gsub('/api/task/', '')\n\n catalog_id = URI(response.css(\n \"AdminCatalog Link [type='application/vnd.vmware.vcloud.catalog+xml']\"\n ).first[:href]).path.gsub('/api/catalog/', '')\n\n { :task_id => task_id, :catalog_id => catalog_id }\n end",
"title": ""
},
{
"docid": "610cb49e02e5c65a469dd7533e545ad5",
"score": "0.64737946",
"text": "def create\n @address_catalog = AddressCatalog.new(params[:address_catalog])\n\n respond_to do |format|\n if @address_catalog.save\n format.html { redirect_to @address_catalog, :notice => 'Address catalog was successfully created.' }\n format.json { render :json => @address_catalog, :status => :created, :location => @address_catalog }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @address_catalog.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8432fe52e154969e2d82b5b1c4c95eec",
"score": "0.6461305",
"text": "def create_catalog_with_http_info(catalog_post_request, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: EcommerceApi.create_catalog ...'\n end\n # verify the required parameter 'catalog_post_request' is set\n if @api_client.config.client_side_validation && catalog_post_request.nil?\n fail ArgumentError, \"Missing the required parameter 'catalog_post_request' when calling EcommerceApi.create_catalog\"\n end\n # resource path\n local_var_path = '/catalogs'\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n content_type = @api_client.select_header_content_type(['application/json'])\n if !content_type.nil?\n header_params['Content-Type'] = content_type\n end\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body] || @api_client.object_to_http_body(catalog_post_request)\n\n # return_type\n return_type = opts[:debug_return_type] || 'Catalog'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['Apikey']\n\n new_options = opts.merge(\n :operation => :\"EcommerceApi.create_catalog\",\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: EcommerceApi#create_catalog\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "40aa858ac7a2a021490ca27e62c42456",
"score": "0.64270204",
"text": "def create\n @catalog_object = CatalogObject.new(params[:catalog_object])\n\n respond_to do |format|\n if @catalog_object.save\n format.html { redirect_to @catalog_object, notice: 'Catalog object was successfully created.' }\n format.json { render json: @catalog_object, status: :created, location: @catalog_object }\n else\n format.html { render action: \"new\" }\n format.json { render json: @catalog_object.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6f118fd2c50d93379c70a66e9180a8e5",
"score": "0.6426562",
"text": "def new\n @catalog = Catalog.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @catalog }\n end\n end",
"title": ""
},
{
"docid": "6f118fd2c50d93379c70a66e9180a8e5",
"score": "0.6426562",
"text": "def new\n @catalog = Catalog.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @catalog }\n end\n end",
"title": ""
},
{
"docid": "40040393db7f54a4c8d679a18ebd5335",
"score": "0.6355998",
"text": "def create\n @catalogo = Catalogo.new(catalogo_params)\n\n respond_to do |format|\n if @catalogo.save\n format.html { redirect_to @catalogo, notice: 'Su servicio ha sido creado satisfactoriamente. ' }\n format.json { render :show, status: :created, location: @catalogo }\n else\n format.html { render :new }\n format.json { render json: @catalogo.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e039b49afd3a6768109a3effa05d110b",
"score": "0.63279647",
"text": "def create\n @admin_catalogue = Admin::Catalogue.new(admin_catalogue_params)\n\n respond_to do |format|\n if @admin_catalogue.save\n format.html { redirect_to admin_catalogues_url, notice: 'Catalogue was successfully created.' }\n format.json { render :show, status: :created, location: @admin_catalogue }\n else\n format.html { render :new }\n format.json { render json: @admin_catalogue.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2db008e503768f15c1ef098a235e3a63",
"score": "0.63269407",
"text": "def create\n @catalogue = Catalogue.new(catalogue_params) \n \n @catalogue.save\n render action: 'index'\n \n end",
"title": ""
},
{
"docid": "f962adc062903cbb6e9788fad7c73950",
"score": "0.6258942",
"text": "def catalogs\n result = {}\n @server.request_json(:get, path(:catalogs),\n :expected_status_code => 200).each do |catalog|\n result[catalog['id']] = Catalog.new(:server => self, :id => catalog['id'])\n end\n result\n end",
"title": ""
},
{
"docid": "ca5e8ea00da1fa756ef87daff6ac257a",
"score": "0.62574947",
"text": "def create\n # Controllers, following Trailblazer philosophy/architecture, should be treated as \n # HTTP lean points, responsible for getting the HTTP request, and calling the \n # corresponding ooperation, it should have minimal business logic, the business logic\n # is moved to the operation\n\n respond_to do |format|\n run Catalog::Create do |op|\n format.html { redirect_to op.model, notice: 'Catalog was successfully created.' }\n format.json { render :show, status: :created, location: op.model }\n end\n # next is executed if Catalog not created\n @form.prepopulate!\n format.html { render :new } #render action: :new\n format.json { render json: @form.errors, status: :unprocessable_entity }\n end\n end",
"title": ""
},
{
"docid": "fa31e9b0316857290df632dc9505e6ec",
"score": "0.62425786",
"text": "def create\n\t\t# POST /cats/\n\t\t# Content-Length: ...\n\t\t#\n\t\t#{ \"cat\": {\"name\": \"Sally\"}}\n\t\t@cat = Cat.new(cat_params)\n\n\t\tif @cat.save\n\t\t\t# params[:cat][:tag_ids].each do |tag_id|\n\t\t\t# \tTagging.create!(cat_id: @cat.id, tag_id: tag_id)\n\t\t\t# end\n\n\t\t\tflash[:notice] = \"Created #{@cat.name}\"\n\t\t\t# render json: cat\n\t\t\t# render :show\n\t\t\tredirect_to cat_url(@cat)\n\t\telse\n\t\t\t# raise \"Hell\"\n\t\t\t# render json: @cat.errors.full_messages, status: :unprocessable_entity\n\t\t\trender :new\n\t\tend\n\tend",
"title": ""
},
{
"docid": "23bb265aedc32e6838c6c3a9521a546f",
"score": "0.62395024",
"text": "def create\n # @product_catalog = ProductCatalog.new(product_catalog_params)\n # @product_catalog.save\n # respond_with(@product_catalog)\n \n end",
"title": ""
},
{
"docid": "8f555e1904915f0371bde5bcb93692fd",
"score": "0.622499",
"text": "def create\n @catalogue = Catalogue.new(params[:catalogue])\n\n respond_to do |format|\n if @catalogue.save\n format.html { redirect_to catalogues_url, :notice => 'Catalogue was successfully created.' }\n else\n format.html { render :action => \"new\" }\n end\n end\n end",
"title": ""
},
{
"docid": "e0ec6592d7c633cd71a5b0bc7a55707d",
"score": "0.62236404",
"text": "def create\n @user = current_user\n @catalog = @user.catalogs.new(catalog_params)\n\n if @catalog.save\n redirect_to user_url(@user), notice: 'Book Successfully added to collection.'\n else\n render :new\n end\n end",
"title": ""
},
{
"docid": "315d5bcda50284b78768ae305525efe4",
"score": "0.62166715",
"text": "def new\n @bilder = Bilder.new(:catalog_id => params[:catalog_id])\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @bilder }\n end\n end",
"title": ""
},
{
"docid": "8c1cc6027c3285565d21682cab133695",
"score": "0.6203944",
"text": "def catalog_params\n params.require(:catalog).permit(:name, :description, :points, :categories_id)\n end",
"title": ""
},
{
"docid": "6e468000618721bbcaabc68620c3904f",
"score": "0.61972415",
"text": "def create\n @catalog_item = CatalogItem.new(catalog_item_params)\n\n respond_to do |format|\n if @catalog_item.save\n format.html { redirect_to @catalog_item, notice: 'Catalog item was successfully created.' }\n format.json { render :show, status: :created, location: @catalog_item }\n else\n format.html { render :new }\n format.json { render json: @catalog_item.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "eee096a983d9fded11d38055da4b9031",
"score": "0.6189014",
"text": "def catalog_info\n new_api_call_builder\n .request(new_request_builder(HttpMethodEnum::GET,\n '/v2/catalog/info',\n 'default')\n .header_param(new_parameter('application/json', key: 'accept'))\n .auth(Single.new('global')))\n .response(new_response_handler\n .deserializer(APIHelper.method(:json_deserialize))\n .is_api_response(true)\n .convertor(ApiResponse.method(:create)))\n .execute\n end",
"title": ""
},
{
"docid": "fe316dbb3025456886676625d144fe16",
"score": "0.6185245",
"text": "def create\n @catalogue = Catalogue.new(params[:catalogue])\n\n respond_to do |format|\n if @catalogue.save\n format.html { redirect_to(@catalogue, :notice => 'Catalogue was successfully created.') }\n format.xml { render :xml => @catalogue, :status => :created, :location => @catalogue }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @catalogue.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8709c3dcca344d727390a9afdbda8f73",
"score": "0.6173127",
"text": "def create\n @catalogs_resource = Catalogs::Resource.new(params[:catalogs_resource])\n\n respond_to do |format|\n if @catalogs_resource.save\n format.html { redirect_to(@catalogs_resource, :notice => 'Nuevo registro guardado.') }\n format.xml { render :xml => @catalogs_resource, :status => :created, :location => @catalogs_resource }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @catalogs_resource.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0b935f123a7c53e2fad953ddba963777",
"score": "0.61383086",
"text": "def subcatalogs\n @catalogs = Catalog.where parent: params[:id]\n respond_to do |format|\n format.json\n end\n end",
"title": ""
},
{
"docid": "e2152188c9a8521285a15c9225fa2da5",
"score": "0.6090266",
"text": "def new\n @admin_catalog = Admin::Catalog.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @admin_catalog }\n end\n end",
"title": ""
},
{
"docid": "ccc79c43684b8c3c928895dbc2ba1dea",
"score": "0.6065311",
"text": "def create\n @beer_catalog = BeerCatalog.new(beer_catalog_params)\n\n respond_to do |format|\n if @beer_catalog.save\n format.html { redirect_to @beer_catalog, notice: 'Beer catalog was successfully created.' }\n format.json { render :show, status: :created, location: @beer_catalog }\n else\n format.html { render :new }\n format.json { render json: @beer_catalog.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b02474a2b971c14e4ee853fbab227fc4",
"score": "0.6038266",
"text": "def create\n render json: Cat.create(cat_params)\n end",
"title": ""
},
{
"docid": "f97da4d39d9b74988b5647f48cc9c31f",
"score": "0.6034463",
"text": "def create\n @catalog_section = CatalogSection.new(params[:catalog_section])\n\n respond_to do |format|\n if @catalog_section.save\n format.html { redirect_to @catalog_section, notice: 'Catalog section was successfully created.' }\n format.json { render json: @catalog_section, status: :created, location: @catalog_section }\n else\n format.html { render action: \"new\" }\n format.json { render json: @catalog_section.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "def3fa2bd73dd2cfb00ecdc1b4e79ba9",
"score": "0.6008508",
"text": "def create\n @catalogs_status = Catalogs::Status.new(catalogs_status_params)\n\n respond_to do |format|\n if @catalogs_status.save\n format.html { redirect_to @catalogs_status, notice: 'Status was successfully created.' }\n format.json { render :show, status: :created, location: @catalogs_status }\n else\n format.html { render :new }\n format.json { render json: @catalogs_status.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4ca531b4bf7e1f9be11ec1ecb5625895",
"score": "0.6005274",
"text": "def catalog_params\n params.require(:catalog).permit(:name)\n end",
"title": ""
},
{
"docid": "366fbc29b9de08d5c2647f365d325a1b",
"score": "0.5992518",
"text": "def new\n @catalog_object = CatalogObject.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @catalog_object }\n end\n end",
"title": ""
},
{
"docid": "d4093a05a77adfb4f8d43d514ce7f23a",
"score": "0.5987172",
"text": "def create\n @tipo_catalogo = TipoCatalogo.new(tipo_catalogo_params)\n\n respond_to do |format|\n if @tipo_catalogo.save\n format.html { redirect_to @tipo_catalogo, notice: 'TipoCatalogo foi criado com sucesso.' }\n format.json { render :show, status: :created, location: @tipo_catalogo }\n else\n format.html { render :new }\n format.json { render json: @tipo_catalogo.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "891e1cc9340d75d70bcfe40568325129",
"score": "0.597257",
"text": "def index\n @catalogs = Catalog.all\n end",
"title": ""
},
{
"docid": "891e1cc9340d75d70bcfe40568325129",
"score": "0.597257",
"text": "def index\n @catalogs = Catalog.all\n end",
"title": ""
},
{
"docid": "891e1cc9340d75d70bcfe40568325129",
"score": "0.597257",
"text": "def index\n @catalogs = Catalog.all\n end",
"title": ""
},
{
"docid": "16957f46dd0771c267b493266587d2e0",
"score": "0.59680086",
"text": "def create\n @catalogs_resource_type = Catalogs::ResourceType.new(catalogs_resource_type_params)\n if @catalogs_resource_type.save\n flash[:success] = t('notices.saved_successfully')\n index\n end\n end",
"title": ""
},
{
"docid": "f83ce844e4ae2eaaca730e749ed97c6b",
"score": "0.59399635",
"text": "def create\n @rest_cat = RestCat.new(rest_cat_params)\n\n respond_to do |format|\n if @rest_cat.save\n format.html { redirect_to @rest_cat, notice: 'Rest cat was successfully created.' }\n format.json { render :show, status: :created, location: @rest_cat }\n else\n format.html { render :new }\n format.json { render json: @rest_cat.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "92443ff50a9a89038e51284f4a11ada6",
"score": "0.59218127",
"text": "def create\n @catalogue = Catalogue.find(params[:catalogue_id])\n @cat_editorial = @catalogue.cat_editorial.new(cat_editorial_params)\n\n respond_to do |format|\n if @cat_editorial.save\n format.html { redirect_to catalogue_path(@catalogue), notice: 'Cat editorial was successfully created.' }\n format.json { render :show, status: :created, location: @cat_editorial }\n else\n format.html { render :new }\n format.json { render json: @cat_editorial.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "17809a72616b13b94c04b59c61560010",
"score": "0.5905622",
"text": "def catalog_params\n params[:catalog].permit(:library_name, :name)\n end",
"title": ""
},
{
"docid": "dac0637499ecc0389a983d91b662a6db",
"score": "0.58990234",
"text": "def create\n @catalogo_tipo_catalogo = Catalogo::TipoCatalogo.new(params[:catalogo_tipo_catalogo])\n\n respond_to do |format|\n if @catalogo_tipo_catalogo.save\n format.html { redirect_to edit_catalogo_tipo_catalogo_path(@catalogo_tipo_catalogo), notice: 'Guardado Correctamente.' }\n format.json { render json: @catalogo_tipo_catalogo, status: :created, location: @catalogo_tipo_catalogo }\n else\n format.html { render action: \"new\" }\n format.json { render json: @catalogo_tipo_catalogo.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "93a1180aba0e448c2d3ec83bf721c47e",
"score": "0.5863679",
"text": "def catalog\n unless params[:path].blank?\n category = SitescanCommon::Category.find_by! path: params[:path]\n name = category.name\n description = category.description\n breadcrumbs = category.breadcrumbs\n category_children = category.descendants.where depth: (category.depth + 1)\n result = category.catalog(filter_params)\n else # All products.\n name = nil\n description = nil # If nil ja add default description.\n breadcrumbs = []\n category_children = SitescanCommon::Category.roots\n result = SitescanCommon::Product\n .catalog_products filter_params: filter_params\n end\n\n subcategories = result.aggs['categories_id']['buckets'].map do |c|\n cat = category_children.where(id: c['key']).first\n if cat\n {name: cat.name, path: cat.path, items: c['doc_count']}\n else\n false\n end\n end.select{|c| c}\n\n prods = result.map do |p|\n prod = SitescanCommon::Product.find p['_id']\n min_price = p['0'].min\n prod.catalog_hash.merge({ price: min_price })\n end\n cat = {\n category: name,\n description: description,\n breadcrumbs: breadcrumbs,\n subcategories: subcategories,\n products: prods,\n total_items: result.total_count\n }\n render json: cat\n end",
"title": ""
},
{
"docid": "7b95a18d279908c31e706c527a0ffa7d",
"score": "0.5860652",
"text": "def create\n @cat = Cat.new(cat_params)\n\n if @cat.save\n # Can use :created instead of 201\n render json: @cat, status: 201, location: \"/cats/#{@cat[:id]}\"\n else\n # Can use :unprocessable_entity instead of 422\n render json: @cat.errors, status: 422\n end\n end",
"title": ""
},
{
"docid": "d3020f8fd9aebe8cc0bb46c2644233b3",
"score": "0.5858967",
"text": "def create\n @url_catalog = UrlHashGenerator.new(url_catalog_params).generate\n\n respond_to do |format|\n if @url_catalog.save\n format.html { redirect_to @url_catalog, notice: \"Url catalog was successfully created.\" }\n format.json { render :show, status: :created, location: @url_catalog }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @url_catalog.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c8ccc04091f08176cae78e744a13748a",
"score": "0.5851388",
"text": "def create\n @catalogo = Catalogo.new(params[:catalogo])\n @catalogo.user = current_user;\n\n respond_to do |format|\n if @catalogo.save\n format.html { redirect_to @catalogo, notice: 'Catalogo was successfully created.' }\n format.json { render json: @catalogo, status: :created, location: @catalogo }\n else\n format.html { render action: \"new\" }\n format.json { render json: @catalogo.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6fde8cadf843691e0a59a8a89d1cd1d4",
"score": "0.58455575",
"text": "def new\n @catalogo = Catalogo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @catalogo }\n end\n end",
"title": ""
},
{
"docid": "6fde8cadf843691e0a59a8a89d1cd1d4",
"score": "0.58455575",
"text": "def new\n @catalogo = Catalogo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @catalogo }\n end\n end",
"title": ""
},
{
"docid": "9665ee15b17d2ebe19160363a33a92ab",
"score": "0.5825491",
"text": "def create\n # POST /cats\n # Content-Length: ...\n #\n # { \"cat\": { \"name\": \"Sally\" } }\n\n @cat = Cat.new(cat_params)\n\n if @cat.save\n # cat_url(@cat) == /cats/...\n flash[:notice] = \"Created #{@cat.name}\"\n redirect_to cat_url(@cat)\n else\n # redirect_to new_cat_url\n render :new\n\n # render json: @cat.errors.full_messages, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "8d78d397be426389e7c10bca3bb39213",
"score": "0.5802765",
"text": "def new\n @catalog_section = CatalogSection.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @catalog_section }\n end\n end",
"title": ""
},
{
"docid": "96bb575f97924abea99ca7756e55b6e5",
"score": "0.57920235",
"text": "def create\n @goods_catalog = GoodsCatalog.new(goods_catalog_params)\n\n respond_to do |format|\n if @goods_catalog.save\n format.html { redirect_to [:admin, @goods_catalog], notice: '商品分类创建成功.' }\n format.json { render action: 'show', status: :created, location: @goods_catalog }\n else\n format.html { render action: 'new' }\n format.json { render json: @goods_catalog.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5b4465c7dd4603d479f540f010f59f14",
"score": "0.5789266",
"text": "def create\n @catalog_auction = CatalogAuction.new(catalog_auction_params)\n\n respond_to do |format|\n if @catalog_auction.save\n format.html { redirect_to @catalog_auction, notice: 'Catalog auction was successfully created.' }\n format.json { render :show, status: :created, location: @catalog_auction }\n else\n format.html { render :new }\n format.json { render json: @catalog_auction.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1bf2fbf3e0f1b5b30c35d69b3b626d59",
"score": "0.57759887",
"text": "def create\n \n @itemcatalog = Itemcatalog.new(params[:itemcatalog])\n @itemcatalog.user_id = session['user_id']\n\n respond_to do |format|\n if @itemcatalog.save\n format.html { redirect_to('/admin/itemcatalogs', :notice => 'Itemcatalog was successfully created.') }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @itemcatalog.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e369f1cbbca3571d83ec8f3605ff838c",
"score": "0.57642895",
"text": "def create\n @life_catalog = LifeCatalog.new(params[:life_catalog])\n\n respond_to do |format|\n if @life_catalog.save\n flash[:notice] = 'LifeCatalog was successfully created.'\n format.html { redirect_to(life_catalogs_url) }\n format.xml { render :xml => @life_catalog, :status => :created, :location => @life_catalog }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @life_catalog.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c368cc9ddf168ea29d6f09a8409570a0",
"score": "0.57548875",
"text": "def search_catalog_objects(body:)\n new_api_call_builder\n .request(new_request_builder(HttpMethodEnum::POST,\n '/v2/catalog/search',\n 'default')\n .header_param(new_parameter('application/json', key: 'Content-Type'))\n .body_param(new_parameter(body))\n .header_param(new_parameter('application/json', key: 'accept'))\n .body_serializer(proc do |param| param.to_json unless param.nil? end)\n .auth(Single.new('global')))\n .response(new_response_handler\n .deserializer(APIHelper.method(:json_deserialize))\n .is_api_response(true)\n .convertor(ApiResponse.method(:create)))\n .execute\n end",
"title": ""
},
{
"docid": "909726b763eb3239f04d660ed2290db3",
"score": "0.57501495",
"text": "def create\n @catalogs_contract = Catalogs::Contract.new(catalogs_contract_params)\n\n respond_to do |format|\n if @catalogs_contract.save\n format.html { redirect_to @catalogs_contract, notice: 'Contract was successfully created.' }\n format.json { render :show, status: :created, location: @catalogs_contract }\n else\n format.html { render :new }\n format.json { render json: @catalogs_contract.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f521c15b9690eaebca1c567a8dc3fed7",
"score": "0.5746941",
"text": "def create\n @asset_item_detail_catalog = AssetItemDetailCatalog.new(params[:asset_item_detail_catalog])\n\n respond_to do |format|\n if @asset_item_detail_catalog.save\n flash[:notice] = 'AssetItemDetailCatalog was successfully created.'\n format.html { redirect_to(asset_item_detail_catalogs_url) }\n format.xml { render :xml => @asset_item_detail_catalog, :status => :created, :location => @asset_item_detail_catalog }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @asset_item_detail_catalog.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5afbd6d507e715299bab0ece51cd74a2",
"score": "0.57295495",
"text": "def create\n category = Category.new(params[:category])\n\n if category.save\n response = formatted_response(true, category, t('api.message.catalog.categories.create.success'))\n else\n response = formatted_response(false, category.errors, t('api.message.catalog.categories.create.failure'))\n end\n\n render :json => response\n end",
"title": ""
},
{
"docid": "8d020fd314b95a7a9598550f1d4c735c",
"score": "0.571299",
"text": "def create\n @catalog_item = CatalogItem.new(params[:catalog_item])\n\n respond_to do |format|\n if @catalog_item.save\n flash[:notice] = 'CatalogItem was successfully created.'\n format.html { redirect_to(@catalog_item) }\n format.xml { render :xml => @catalog_item, :status => :created, :location => @catalog_item }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @catalog_item.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5a55b848245a2a7ef79c19389eeb88dd",
"score": "0.5697586",
"text": "def new\n @catalogs_resource = Catalogs::Resource.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @catalogs_resource }\n end\n end",
"title": ""
},
{
"docid": "4adf8ba1cfee2a1fd1cfac8f57129e5c",
"score": "0.567759",
"text": "def create\n @clave_catalogo = ClaveCatalogo.new(clave_catalogo_params)\n\n respond_to do |format|\n if @clave_catalogo.save\n format.html { redirect_to @clave_catalogo, notice: 'La clave de catálogo se creó correctamente.' }\n format.json { render :show, status: :created, location: @clave_catalogo }\n else\n format.html { render :new }\n format.json { render json: @clave_catalogo.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4926c050fd935cb0f87193a46c03aac0",
"score": "0.567509",
"text": "def create\n @cat = Cat.new(cat_params)\n if @cat.save\n redirect_to cat_url(@cat)\n else\n render json: @cat.errors.full_messages, status: 422 # unprocesable entity\n end\n end",
"title": ""
},
{
"docid": "86b16f8994018c8df674bb1135534fea",
"score": "0.5670434",
"text": "def create\n @sale_collection = SaleCollection.new(sale_collection_params)\n\n respond_to do |format|\n if @sale_collection.save\n format.html { redirect_to sale_collections_path(@sale_collection.sale.id), notice: 'Sale collection was successfully added.' }\n format.json { render :show, status: :created, location: @sale_collection }\n else\n format.html { render :new }\n format.json { render json: @sale_collection.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9d3292f32f9c6e8a51c5927b41cdab1a",
"score": "0.56651276",
"text": "def create\n return false unless authorize(permissions = [\"administer_catalog\"])\n @catalog_type = CatalogType.new(params[:catalog_type])\n\n respond_to do |format|\n if @catalog_type.save\n flash.now[:notice] = t('admin.catalog_type.flash.created')\n format.html { redirect_to(@catalog_type) }\n format.xml { render :xml => @catalog_type, :status => :created, :location => @catalog_type }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @catalog_type.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d0a8c7398d55c9c460d9f13433f2cebf",
"score": "0.5664487",
"text": "def create\n @catalogue = Catalogue.new(catalogue_params)\n @artwork = Artwork.new(artwork_params)\n @artist = Artist.new(artist_params)\n @contact = Contact.new(contact_params)\n @history = History.new(history_params)\n \n \n respond_to do |format|\n if @catalogue.save\n format.html { redirect_to @catalogue, notice: 'Catalogue was successfully created.' }\n format.json { render :show, status: :created, location: @catalogue }\n else\n format.html { render :new }\n format.json { render json: @catalogue.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "52805a2b20f2c49ebc513ddd7eba5aa6",
"score": "0.56589496",
"text": "def search_catalog_items(body:)\n new_api_call_builder\n .request(new_request_builder(HttpMethodEnum::POST,\n '/v2/catalog/search-catalog-items',\n 'default')\n .header_param(new_parameter('application/json', key: 'Content-Type'))\n .body_param(new_parameter(body))\n .header_param(new_parameter('application/json', key: 'accept'))\n .body_serializer(proc do |param| param.to_json unless param.nil? end)\n .auth(Single.new('global')))\n .response(new_response_handler\n .deserializer(APIHelper.method(:json_deserialize))\n .is_api_response(true)\n .convertor(ApiResponse.method(:create)))\n .execute\n end",
"title": ""
},
{
"docid": "2ed05351f8959b1c59c31fd25ed18632",
"score": "0.5645031",
"text": "def create\n response, status = BeyondApi::Request.post(@session,\n \"/carts\")\n\n handle_response(response, status)\n end",
"title": ""
},
{
"docid": "ff89d0a4f6d31b7b91a87495518771eb",
"score": "0.56378",
"text": "def catalog_params\n params.require(:catalog).permit(:name, :path, :default, :watch_path, :type, :sync_from_catalog, :sync_from_albums, :import_mode)\n end",
"title": ""
},
{
"docid": "c296dc1d26f80f6d3af111e2ce44a72e",
"score": "0.5632408",
"text": "def create\n cartridge = current_user.cartridges.build({\n name: params[:name],\n xml: params[:xml]\n })\n if cartridge.save\n render json: cartridge, status: 201\n else\n render json: { errors: cartridge.errors }, status: 422\n end\n end",
"title": ""
},
{
"docid": "d44e454b01e1adba63326f1db3ba6c3f",
"score": "0.5624009",
"text": "def catalogue_params\n params.require(:catalogue).permit(:title, :description)\n end",
"title": ""
},
{
"docid": "998f288eaa3a60787ac3bcb05f62bdc3",
"score": "0.56169367",
"text": "def create\n @especie_catalogo = EspecieCatalogo.new(especie_catalogo_params)\n\n respond_to do |format|\n if @especie_catalogo.save\n format.html { redirect_to @especie_catalogo, notice: 'Especie catalogo was successfully created.' }\n format.json { render action: 'show', status: :created, location: @especie_catalogo }\n else\n format.html { render action: 'new' }\n format.json { render json: @especie_catalogo.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1602b1a65bd543a0033ba8e74e65e434",
"score": "0.561322",
"text": "def create\n @correlation_collection = CorrelationCollection.new(correlation_collection_params)\n\n respond_to do |format|\n if @correlation_collection.save\n format.html { redirect_to @correlation_collection, notice: 'Correlation collection was successfully created.' }\n format.json { render :show, status: :created, location: @correlation_collection }\n else\n format.html { render :new }\n format.json { render json: @correlation_collection.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "16f079a0cdf153c830adcf45ca8cbcab",
"score": "0.56027037",
"text": "def catalog_params\n\t\tparams.require(:catalog).permit(:name, :sector_id, :description, :user_id)\n\tend",
"title": ""
},
{
"docid": "cf634a7a3f3bd85288dd764b756ffc75",
"score": "0.56000704",
"text": "def create\n collection = Collection.find(params[:collection_id])\n p collection\n p \"8\" * 25\n tag = collection.tags.new(name: params[:name])\n \n if tag.save\n p tag\n p tag.collections\n render json: tag\n else\n render(status 404)\n end\n end",
"title": ""
},
{
"docid": "4f8b3761bab1663b5d89ef46a00b58b6",
"score": "0.55965775",
"text": "def create\n @auto_cat = AutoCat.new(params[:auto_cat])\n\n respond_to do |format|\n if @auto_cat.save\n format.html { redirect_to @auto_cat, notice: 'Auto cat was successfully created.' }\n format.json { render json: @auto_cat, status: :created, location: @auto_cat }\n else\n format.html { render action: \"new\" }\n format.json { render json: @auto_cat.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3d864ba6bda80f6effa9c782eb8714b6",
"score": "0.5585048",
"text": "def batch_retrieve_catalog_objects(body:)\n new_api_call_builder\n .request(new_request_builder(HttpMethodEnum::POST,\n '/v2/catalog/batch-retrieve',\n 'default')\n .header_param(new_parameter('application/json', key: 'Content-Type'))\n .body_param(new_parameter(body))\n .header_param(new_parameter('application/json', key: 'accept'))\n .body_serializer(proc do |param| param.to_json unless param.nil? end)\n .auth(Single.new('global')))\n .response(new_response_handler\n .deserializer(APIHelper.method(:json_deserialize))\n .is_api_response(true)\n .convertor(ApiResponse.method(:create)))\n .execute\n end",
"title": ""
},
{
"docid": "42c5f444561ab4f7945fa89e86c5f3e9",
"score": "0.55676204",
"text": "def catalog_params\n params.require(:catalog).permit(:title, :publisher)\n end",
"title": ""
},
{
"docid": "ee38fb6c252add3f6dd2eeec97e33feb",
"score": "0.55526006",
"text": "def create\n @collection = Admin::Collection.new(collection_params)\n\n if @collection.save\n render json: @collection, status: :created#, location: @collection\n else\n render json: @collection.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "bc6d8884df543a3a18172c21ffb4f026",
"score": "0.5550669",
"text": "def catalog_params\n params.require(:catalog).permit(:serial, :user_id, :textbook_id, :lesson_id)\n end",
"title": ""
},
{
"docid": "fb320feb1a5cec68a9d04d91d041e563",
"score": "0.5549529",
"text": "def create_catalog_sale_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: StoreSalesApi.create_catalog_sale ...\"\n end\n # resource path\n local_var_path = \"/store/sales\"\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[:'catalog_sale'])\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 => 'CatalogSale')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: StoreSalesApi#create_catalog_sale\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "31d88bc853592304818a16dd5d2d663d",
"score": "0.554941",
"text": "def create\n @cat = Cat.new(cat_params)\n\n respond_to do |format|\n if @cat.save\n format.html { redirect_to @cat, notice: 'Cat was successfully created.' }\n format.json { render :show, status: :created, location: @cat }\n else\n format.html { render :new }\n format.json { render json: @cat.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "31d88bc853592304818a16dd5d2d663d",
"score": "0.554941",
"text": "def create\n @cat = Cat.new(cat_params)\n\n respond_to do |format|\n if @cat.save\n format.html { redirect_to @cat, notice: 'Cat was successfully created.' }\n format.json { render :show, status: :created, location: @cat }\n else\n format.html { render :new }\n format.json { render json: @cat.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "79387537ae729d9015e3e6e67d6bebe6",
"score": "0.5545155",
"text": "def set_newscatalogs\n \t\t@newscatalogs = Newscatalog.find(params[:id])\n \tend",
"title": ""
},
{
"docid": "c08327a0ea730df75cfdac3217ef53b2",
"score": "0.55444586",
"text": "def create\n @artcat = Artcat.new(artcat_params)\n\n respond_to do |format|\n if @artcat.save\n format.html { redirect_to @artcat, notice: 'Artcat was successfully created.' }\n format.json { render :show, status: :created, location: @artcat }\n else\n format.html { render :new }\n format.json { render json: @artcat.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "79c757f81c509c6dac2fadbe64062f75",
"score": "0.5540837",
"text": "def get_catalog_data\n ConnectionController.service_request(\"catalog.php\",nil,\"get\",nil,nil,url_for(:controller => :Product, :action => :http_callback),nil,nil)\n end",
"title": ""
},
{
"docid": "e3857448d00df9d5c180d9fcfca8db63",
"score": "0.5535021",
"text": "def create\n\t\t@product = Product.new(product_params.except(:price, :discount, :categories))\n\t\t\n\t\tbegin\n\t\t\tproduct_params[:categories].each do |name|\n\t\t\t\t@product.categories << Category.find_by_name(name)\n\t\t\tend\n\t\t\t\n\t\t\t@product.save\n\t\trescue => ex\n\t\t\trender json: {message: ex.message}\n\t\tend\n\t\t\t\n\t\trender json: @product, status: :ok\n\tend",
"title": ""
},
{
"docid": "17b3271a88365650639773fdab7dfd54",
"score": "0.5534972",
"text": "def create\n @catalog = Catalog.new(params[:catalog])\n \n publisher = current_user.publishers.find_by_id(@catalog.publisher_id)\n if publisher.nil?\n raise 'Publisher does not exist'\n end\n \n respond_to do |format|\n if @catalog.save\n format.html { redirect_to @catalog, :notice => 'Catalog was successfully created.' }\n else\n format.html { render :action => \"new\" }\n end\n end\n end",
"title": ""
},
{
"docid": "e200b58fc9e91c6c9a852c62c41ecb66",
"score": "0.5534317",
"text": "def catalog_params\n params.require(:catalog).permit(:name, :path, :default, :watch_path, :type, :sync_from_catalog, :sync_from_albums, :import_mode)\n end",
"title": ""
},
{
"docid": "1a5d180d358a9018a783dd315ea98779",
"score": "0.5523575",
"text": "def create\r\n @catalogo = Item.new(catalogo_params)\r\n @catalogo.suporte_id = 1\r\n\r\n respond_to do |format|\r\n if @catalogo.save\r\n format.html { redirect_to catalogo_path(@catalogo), notice: 'Catálogo criado com sucesso.' }\r\n format.json { render :show, status: :created, location: @catalogo }\r\n else\r\n format.html { render :new }\r\n format.json { render json: @catalogo.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end",
"title": ""
},
{
"docid": "0891f5c2af4a7dd0b8d7fc9c9dedc567",
"score": "0.5522805",
"text": "def create_hyperflex_app_catalog_with_http_info(hyperflex_app_catalog, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: HyperflexApi.create_hyperflex_app_catalog ...'\n end\n # verify the required parameter 'hyperflex_app_catalog' is set\n if @api_client.config.client_side_validation && hyperflex_app_catalog.nil?\n fail ArgumentError, \"Missing the required parameter 'hyperflex_app_catalog' when calling HyperflexApi.create_hyperflex_app_catalog\"\n end\n # resource path\n local_var_path = '/api/v1/hyperflex/AppCatalogs'\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n content_type = @api_client.select_header_content_type(['application/json'])\n if !content_type.nil?\n header_params['Content-Type'] = content_type\n end\n header_params[:'If-Match'] = opts[:'if_match'] if !opts[:'if_match'].nil?\n header_params[:'If-None-Match'] = opts[:'if_none_match'] if !opts[:'if_none_match'].nil?\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body] || @api_client.object_to_http_body(hyperflex_app_catalog)\n\n # return_type\n return_type = opts[:debug_return_type] || 'HyperflexAppCatalog'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['cookieAuth', 'http_signature', 'oAuth2', 'oAuth2']\n\n new_options = opts.merge(\n :operation => :\"HyperflexApi.create_hyperflex_app_catalog\",\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: HyperflexApi#create_hyperflex_app_catalog\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
}
] |
1bcbaeb5a86c12e7b7234ede828475a0 | Extracts a players name. It's slightly more complicated because so many players were scattered by the desert | [
{
"docid": "872bba71c39948c84f401decef1938b7",
"score": "0.67759967",
"text": "def getName(player)\n if player[\"permAttr\"].include?(\"SCATTERED\")\n player[\"state\"][\"unscatteredName\"]\n else\n player[\"name\"]\n end\nend",
"title": ""
}
] | [
{
"docid": "617edf1b8e4fa673c56efd148c30a079",
"score": "0.72701997",
"text": "def getPlayerNames(players)\n players.collect do |player|\n player.name\n end\n end",
"title": ""
},
{
"docid": "57a992302e54c667da6ab405d1e2727e",
"score": "0.7250427",
"text": "def player_names\n players.map {|player| player.name }.join(' vs. ')\n end",
"title": ""
},
{
"docid": "57a992302e54c667da6ab405d1e2727e",
"score": "0.7250427",
"text": "def player_names\n players.map {|player| player.name }.join(' vs. ')\n end",
"title": ""
},
{
"docid": "e9de6a58e9f1517cf6b356ff64a16425",
"score": "0.6964627",
"text": "def get_players_names\n players_names = []\n 0.upto(@player_cnt - 1) do |x|\n name = nil\n while name == nil\n print \"What's you name, [Player #{(x + 1).to_s}]? \"\n name = gets\n name = name.strip\n\n # Check for names that are too long\n if name.length > MAX_PLAYER_NAME_LENGTH\n name = name.slice(0..(MAX_PLAYER_NAME_LENGTH - 1))\n end\n\n if name == \"\"\n name = \"Player \" + (x + 1).to_s\n elsif name.downcase == \"q\"\n throw :quit\n elsif name.downcase == \"i\"\n name = nil\n instructions\n elsif players_names.include?(name) or name == Dealer::DEALERS_NAME\n # Check for the existence of the same name\n name = nil\n try_again\n end\n end\n players_names[x] = name\n end\n return players_names\n end",
"title": ""
},
{
"docid": "6fb557308b447624f25b71141222fcb9",
"score": "0.69562644",
"text": "def player_names\n names = []\n self.groups.each do |g|\n g.players.each { |p| names << p.login }\n end\n names\n end",
"title": ""
},
{
"docid": "9a91eda592397f1f1453af304ab6480e",
"score": "0.6924687",
"text": "def n_name\n @n_name ||= players[2]\n end",
"title": ""
},
{
"docid": "9a91eda592397f1f1453af304ab6480e",
"score": "0.6924687",
"text": "def n_name\n @n_name ||= players[2]\n end",
"title": ""
},
{
"docid": "2793059f562dd0d9cd2ac5022c455be8",
"score": "0.69234705",
"text": "def team_for_player(urt, nickname)\n sleep 1\n players = urt.rcon('players').split(\"\\n\")\n player = players.keep_if { |line|\n line =~ /^\\d/ && line.split(' ')[1] == nickname\n }[0]\n if player\n player.split(' ')[2]\n else\n 'UNKNOWN'\n end\nend",
"title": ""
},
{
"docid": "05fd5eb19bd4062a59d362df77f702dc",
"score": "0.6858099",
"text": "def name_of_player\n #michael jordan - bulls \n \"#{self.name}\"\n end",
"title": ""
},
{
"docid": "99cb0bf281273699d908ca72a1327f9a",
"score": "0.6838641",
"text": "def get_name\n\t\tname = \"player x\" \n\t\tif !self.f_n.nil? && !self.f_n.empty?\n\t\t\tname = self.f_n\n\t\telsif !self.n_n.nil? && !self.n_n.empty?\n\t\t\tname = self.n_n\n\t\tend\n\t\tname\n\tend",
"title": ""
},
{
"docid": "4b589102675fc754a8af0d50a465e73a",
"score": "0.6807708",
"text": "def player_name(player_id)\n player = Player.where(player_id: player_id).first\n \n if player.present?\n str = \"#{player.first_name} #{player.last_name}\"\n else\n str = 'No player name found'\n end\n \n return str\n end",
"title": ""
},
{
"docid": "fe37f1950d0b9b713f2068656c73f27c",
"score": "0.6799359",
"text": "def player_name\n team_name\n end",
"title": ""
},
{
"docid": "2949e163306b67fc216270261b796ee3",
"score": "0.6768462",
"text": "def get_a_player(player_name)\n for player in @players\n if player == player_name\n return player_name\n end\n end\n end",
"title": ""
},
{
"docid": "545174e26b987446fc3d0590bd7692c7",
"score": "0.6750145",
"text": "def s_name\n @s_name ||= players[0]\n end",
"title": ""
},
{
"docid": "545174e26b987446fc3d0590bd7692c7",
"score": "0.6750145",
"text": "def s_name\n @s_name ||= players[0]\n end",
"title": ""
},
{
"docid": "e2e0699931678c5ae9360cd10ce1ba73",
"score": "0.6725573",
"text": "def e_name\n @e_name ||= players[3]\n end",
"title": ""
},
{
"docid": "e2e0699931678c5ae9360cd10ce1ba73",
"score": "0.6725573",
"text": "def e_name\n @e_name ||= players[3]\n end",
"title": ""
},
{
"docid": "f7dbff874c91fa00e5d688dfe8fa1cbb",
"score": "0.6724414",
"text": "def player_name\n @data.trainer.name\n end",
"title": ""
},
{
"docid": "a2f274d8a544fe11e011898de3dfd0f1",
"score": "0.6715657",
"text": "def players\n return unless user\n return user.full_name unless opponent\n \"#{user.full_name} v #{opponent.full_name}\"\n end",
"title": ""
},
{
"docid": "da3c27dfc80b2b0930c6807f7a952f39",
"score": "0.6612486",
"text": "def first_player_name\n self.players[0].nil? ? nil : self.players[0].name\n end",
"title": ""
},
{
"docid": "e82e529d79ac7c819219d8857373b180",
"score": "0.65954226",
"text": "def player_names\n join_teams.map do |player|\n player[:player_name]\n end\nend",
"title": ""
},
{
"docid": "b58251039629e26749f4ec4cd8aed560",
"score": "0.6552359",
"text": "def player_name\n @name\n end",
"title": ""
},
{
"docid": "5d09fca0a6802d2612fd0aaf09f30faf",
"score": "0.6527893",
"text": "def get_name(interface, player)\n @name = interface.ask_user(\"#{player.name}, what is your name? \")\n while @name == ''\n @name = interface.ask_user(\"That's a terrible name, try another! \")\n end\n @name.capitalize!\n end",
"title": ""
},
{
"docid": "6ae69e22c9dbd176d8401830693f6008",
"score": "0.65143913",
"text": "def player_name(team, num)\n send(team.to_s + \"_\" + %w(lead second third fourth alternate).at(num - 1))\n end",
"title": ""
},
{
"docid": "942625bf22ec89af9076915bc4c4d323",
"score": "0.64736086",
"text": "def get_parsed_games_player_names(parsed_games, account_id, region_name)\n list_ids = [account_id]\n\n parsed_games.each do |game|\n if game.fellow_players.nil?\n raise Lol::InvalidAPIResponse.new(\"yolo\", \"swag\")\n end\n game.fellow_players.each do |player|\n list_ids << player.summoner_id\n end\n end\n sliced_lists = list_ids.each_slice(40).to_a\n all_names = {}\n\n client = get_check_client(region_name)\n\n sliced_lists.each do |list|\n names = client.summoner.name(list)\n all_names = all_names.merge(names)\n end\n puts all_names\n return all_names\n end",
"title": ""
},
{
"docid": "5c47d2dec0f650dc7437fd208d1fa0df",
"score": "0.64618266",
"text": "def second_player_name\n self.players[1].nil? ? nil : self.players[1].name\n end",
"title": ""
},
{
"docid": "96a23b96dcd95494c06df4dc1cd9d3b7",
"score": "0.645458",
"text": "def player_name(player_id)\n @names_cache[player_id] ||= without_locking do\n Player.select(\"name\").where(:id => player_id).c_select_value\n end\n\n @names_cache[player_id]\n end",
"title": ""
},
{
"docid": "f546807a2c4082fb881831a00aa80baa",
"score": "0.6434303",
"text": "def player_name(player_number)\n player_number == 1 ? player1 : player2\n end",
"title": ""
},
{
"docid": "a8fca5f6bfe53cf1ae2f580d63803c73",
"score": "0.6433299",
"text": "def name_to_key(player)\n [player['name'], player['firstName']].map { |name|\n name.upcase.gsub(/\\s+/, \"\")\n }.join(\"\")\n end",
"title": ""
},
{
"docid": "c5d681c97eb49df4cf6599393aaa7130",
"score": "0.64209265",
"text": "def human_players\n raw_match['human_players']\n end",
"title": ""
},
{
"docid": "0599ceff842710bf443f2deadafce4f1",
"score": "0.6417384",
"text": "def name_to_key(player)\n [player['name'], player['firstName']].map {\n |name| name.upcase.gsub(/\\s+/, \"\")\n }.join(\"\")\n end",
"title": ""
},
{
"docid": "dd56f3ed0fd5faadae236f1d832b7faa",
"score": "0.64035356",
"text": "def w_name\n @w_name ||= players[1]\n end",
"title": ""
},
{
"docid": "dd56f3ed0fd5faadae236f1d832b7faa",
"score": "0.64035356",
"text": "def w_name\n @w_name ||= players[1]\n end",
"title": ""
},
{
"docid": "7ec4de10317f25f997fcae74cbdaec68",
"score": "0.63658345",
"text": "def get_a_player(player_name)\n player = []\n get_players_n_stats.reject do |name| \n unless name[:player_name] == player_name\n player << name\n end \n end \nend",
"title": ""
},
{
"docid": "618c267995456c777553ae36ccd20029",
"score": "0.63623327",
"text": "def cur_name\n @players[@current_player].name\n end",
"title": ""
},
{
"docid": "e9dbf01ba12b7b1e3e6a1cbc875e87e7",
"score": "0.6361626",
"text": "def find_player_name(hash)\n hash[:player_name]\nend",
"title": ""
},
{
"docid": "f11044872deea929de186836a8cfa772",
"score": "0.6355513",
"text": "def find_players(name)\n other_players.select{|p| p.name == name}\n end",
"title": ""
},
{
"docid": "03d78ddb4341f5745059f34d4e3f4345",
"score": "0.6344664",
"text": "def get_name(player)\n puts \"Welcome, #{player}, what is your name?\"\n gets.chomp\n end",
"title": ""
},
{
"docid": "4877b43859c15cb376c8610fdac0d428",
"score": "0.6315586",
"text": "def name\n self[:name] || \"#{player1.name} vs. #{player2.name}\"\n end",
"title": ""
},
{
"docid": "5ce7d71f40bcac2db9923291005e9ebb",
"score": "0.6307867",
"text": "def get_list_playersname\n\t\t\tres = []\n\t\t\t@players_for_core.each do |k,v|\n\t\t\t\tres << k\n\t\t\tend\n\t\t\treturn res\n\t\tend",
"title": ""
},
{
"docid": "0683f702b2427019ed4b3f6fb5e81f04",
"score": "0.6290038",
"text": "def get_player_list\n players.map { |p| \"Player \" + p.turn_order.to_s + \": \" + p.name + \" | \" }.join.to(-3)\n end",
"title": ""
},
{
"docid": "6f6f6757930afda3fef65538b1fde01c",
"score": "0.62846434",
"text": "def get_first_name_of_season_winner(data, season)\n # code here\n data[season].each do |ladies|\n ladies.each do |stats, info|\n if info == \"Winner\"\n name_full = ladies[\"name\"]\n return name_full.split(\" \").first\n end\n #binding.pry\n end\n end\nend",
"title": ""
},
{
"docid": "f2d20821702571a93646bcf52c156a91",
"score": "0.62840647",
"text": "def name\r\n return \"\" if battle_members.size == 0\r\n return leader.name if battle_members.size == 1\r\n return sprintf(Vocab::PartyName, leader.name)\r\n end",
"title": ""
},
{
"docid": "a1f3a5c5fa08c8d3ad151dc10c25e2ec",
"score": "0.6272639",
"text": "def game_name\n raw_name = @ele.css('.search_name h4').first\n # Killing special characters, Encoding::ISO_8859_1 was a pain to convert to UTF-8 versions.\n raw_name ? raw_name.content.gsub(/[\\s]+/, \" \").gsub(/[^a-zA-Z0-9 :\\-\\&\\.,]/, '') : ''\n end",
"title": ""
},
{
"docid": "ecf736d9feafee5618fe0c6da3055494",
"score": "0.62697464",
"text": "def get_player2_name_by_game_id(game_id)\n sql = %q[SELECT u.username FROM games as g, users as u WHERE g.id = u.id AND g.id = $1]\n result = db.exec(sql, [game_id])\n result.first\n end",
"title": ""
},
{
"docid": "a3c813e7f87fc42517673f19685e246d",
"score": "0.6265775",
"text": "def name_all_players()\n set_name()\n set_other_name()\n end",
"title": ""
},
{
"docid": "927e7b8eb83c7f83e3a318ae16057d86",
"score": "0.6263313",
"text": "def get_first_name_of_season_winner(data, season)\n # code here\n winner_name = \"\"\n\n data.each do |data_season, participants|\n\n if data_season == season\n participants.each do |participant|\n participant.each do |detail_key, detail_value|\n if detail_value == \"Winner\"\n winner_name = participant[\"name\"]\n end\n end\n end\n end\n end\n\n winner_name_split = winner_name.split(\" \")\n winner_name = winner_name_split[0]\n # binding.pry\n\n winner_name\nend",
"title": ""
},
{
"docid": "fb2574009f9fbf31470ab0bc72fbc87c",
"score": "0.6250113",
"text": "def get_first_name_of_season_winner(data, season)\n data[season].each do |contestants|\n if contestants[\"status\"] == \"Winner\"\n return contestants[\"name\"].split(\" \").first\n end\n end\nend",
"title": ""
},
{
"docid": "f5da05464395a8b41895900d24b01435",
"score": "0.62435985",
"text": "def get_player1_name_by_game_id(game_id)\n sql = %q[SELECT u.username FROM games as g, users as u WHERE g.id = u.id AND g.id = $1]\n result = db.exec(sql, [game_id])\n result.first\n end",
"title": ""
},
{
"docid": "2267b733ab670e7407dbc0be2976951c",
"score": "0.62358636",
"text": "def extract_player(prints, time)\n time = guessable_time(time)\n\n players = prints.inject([]) do |arr,p|\n arr << $1 if p =~ /^(.+)\\^7 reached the finish line in \\^\\d#{time}/\n arr << $1 if p =~ /^Time performed by (.+)\\^7 : \\^\\d#{time}/\n arr\n end\n\n conditionally_raise \"No player was found.\" if players.empty?\n conditionally_raise \"Not only one player was found #{players.inspect}.\" if players.size > 1\n\n players.first\n end",
"title": ""
},
{
"docid": "877bebd03af130b3a0ad4b63bd33d7ff",
"score": "0.62358636",
"text": "def player_stats(player_name)\n player_stats = []\n game_hash.each do |location, team_data|\n team_data[:players].each do |player, stats|\n if player.downcase == player_name.downcase\n player_stats << stats\n end\n end\n end\n player_stats[0]\nend",
"title": ""
},
{
"docid": "8c98c4931a9b623f4ae730fab0e1425c",
"score": "0.6228516",
"text": "def game_name_for(game, parties, mode = :simple)\n name = \"\"\n if mode == :simple\n name = truncate(game.name, :length => parties > 1 ? 9 : 12)\n elsif mode == :advanced\n name = game.name\n end \n end",
"title": ""
},
{
"docid": "85ffd11493787deca9d6f66cbad177dc",
"score": "0.62250847",
"text": "def player_stats(p_name)\n stats = ''\n game_hash.each do |_location, team_data|\n team_data.each do |attribute, values|\n next unless attribute == :players\n\n values.each do |person, data|\n stats = data if person == p_name\n end\n end\n end\n stats\nend",
"title": ""
},
{
"docid": "0e3dc9ce4c6387041c9cf1259e248bcf",
"score": "0.6202339",
"text": "def get_player(name)\n @players[name]\n end",
"title": ""
},
{
"docid": "41f9d78e81fca13fc3c1746fea498ec9",
"score": "0.62001336",
"text": "def label_with_players\n if self.singles?\n return self.name\n else\n \"#{self.name} (#{self.team_members_label})\"\n end\n end",
"title": ""
},
{
"docid": "5dc6db57290a15703b1795606ad5ab4b",
"score": "0.6200067",
"text": "def player_stats (player_name)\n game_hash.each do |loc, data|\n data[:players].each do |player|\n if player[:player_name] == player_name\n return player\n end\n end\n end\n end",
"title": ""
},
{
"docid": "6fd77459406395331cb560ad10123da8",
"score": "0.61783737",
"text": "def getOtherPlayerName(user)\n if user.id == player1_id\n return User.find(player2_id).displayName\n end\n User.find(player1_id).displayName\n end",
"title": ""
},
{
"docid": "cc0fa4bd0cfd99c905a74929f2f7bb96",
"score": "0.6129734",
"text": "def get_player_name\n\t\tplayer_name = Mastermind::get_user_input(\"Enter your name: \")\n\t\tplayer_name = \"Player 1\" if player_name.strip == \"\"\n\t\tplayer_name\n\tend",
"title": ""
},
{
"docid": "d7a4deb482c6ba77f32e3b73c7a8844c",
"score": "0.61217475",
"text": "def get_first_name_of_season_winner(data, season)\n \twinner_first_name = \"\"\n\n \tdata[season].each do |stats|\n\t\tstats.each do |ind_stat, value|\n\t\t\tif value == \"Winner\"\n\t\t\t\twinner_first_name = stats[\"name\"].split(\" \")[0]\n\t\t\tend\n\t\tend\n \tend\n\twinner_first_name\nend",
"title": ""
},
{
"docid": "dafb02db7f55afbf55468c07f67f2705",
"score": "0.6106066",
"text": "def get_player_username(player_id)\n ActiveRecord::Base.connection.execute(\"SELECT GET_PLAYER_USERNAME(#{player_id}) as player_username\").first[\"player_username\"]\n end",
"title": ""
},
{
"docid": "dafb02db7f55afbf55468c07f67f2705",
"score": "0.6106066",
"text": "def get_player_username(player_id)\n ActiveRecord::Base.connection.execute(\"SELECT GET_PLAYER_USERNAME(#{player_id}) as player_username\").first[\"player_username\"]\n end",
"title": ""
},
{
"docid": "8079f3a4840e0318dfdfeef217c2ac4d",
"score": "0.6100756",
"text": "def getPlayer\n \"Ekipi: #{name} ka: #{num}lojtar dhe ata jane: #{@player}\" \n end",
"title": ""
},
{
"docid": "8ef12cafe402efb290a74e9a42d05150",
"score": "0.6097868",
"text": "def get_first_name_of_season_winner(data, season)\n data.each do | season_num, season_data|\n season_data.each do | contestant_data |\n if season_num == season\n return contestant_data[\"name\"].split(\" \")[0]\n end\nend\nend\nend",
"title": ""
},
{
"docid": "c116d1bfc03f70140b225a26f8ab6a40",
"score": "0.6094467",
"text": "def get_player_name(term)\n return term.params.first.name\n end",
"title": ""
},
{
"docid": "066222887a637983ea85fb722c891a86",
"score": "0.60741544",
"text": "def all_team_players(team_name, game)\n game.each do |team, team_hash|\n if team_hash[:name] == team_name\n return (team_hash[:players].collect do |player, player_hash|\n player_hash[:name]\n end)\n end\n end\nend",
"title": ""
},
{
"docid": "9b268f6e07ce63f75591a43501359af5",
"score": "0.6067038",
"text": "def player_name(num)\n\t\tputs \"Please enter Player #{ num }'s name:\"\n\t\tgets.chomp\n\tend",
"title": ""
},
{
"docid": "e7b9d3804f0bd0a1a33757a2a338cb77",
"score": "0.60663265",
"text": "def player_names\n @player_names = (\"Drew\")\n end",
"title": ""
},
{
"docid": "5ddad2e79ba57329c9aaab67cb7c9eb2",
"score": "0.60657007",
"text": "def get_first_name_of_season_winner(data, season)\n data[season].find{|person| person[\"status\"] == \"Winner\"}[\"name\"].split(\" \").first \nend",
"title": ""
},
{
"docid": "ca484e437ce16fd72ad3452d39f3e250",
"score": "0.60604787",
"text": "def opponentname(opponent,season)\n opponent = Opponent.find_by_id(opponent)\n if season >= opponent.previousnamestart and season <= opponent.previousnameend\n return opponent.previousname\n elsif season >= opponent.previousnamestart2 and season <= opponent.previousnameend2\n return opponent.previousname2\n else\n return opponent.shortname\n end\n end",
"title": ""
},
{
"docid": "6a1f22dea9837f7ce6f7dedfe3bbec90",
"score": "0.6055758",
"text": "def name\n self.player.name\n end",
"title": ""
},
{
"docid": "211f6942ebb231e89ea0303a47e5bdee",
"score": "0.60435224",
"text": "def get_first_name_of_season_winner(data, season)\n data[season].each do |hash|\n if hash[\"status\"].downcase == \"winner\"\n first_name = hash[\"name\"].split(\" \")\n return first_name[0]\n end\n end\nend",
"title": ""
},
{
"docid": "c5c82ca92f2b8a7d7f689feca8e87443",
"score": "0.6034075",
"text": "def player_by_name name\n @ranking.select {|p| p[:name] == name}.first\n end",
"title": ""
},
{
"docid": "0785079270ceca7633501492875624a1",
"score": "0.60328776",
"text": "def player_stats(player_name)\n stats_hash = {}\n game_hash.values.each do |team|\n team[:players].each do |player|\n if player.has_value?(player_name)\n player.delete(:player_name)\n return player\n end\n end\n end\n stats_hash\nend",
"title": ""
},
{
"docid": "1265bfad248d83c22708c51922267265",
"score": "0.6031348",
"text": "def get_first_name_of_season_winner(data, season)\n data[season].each do |contestant_hash|\n if contestant_hash[\"status\"].downcase == \"winner\"\n return contestant_hash[\"name\"].split(\" \").first\n end\n end\nend",
"title": ""
},
{
"docid": "9d524ff22c1c9d0cf378b111c2db6bf0",
"score": "0.60265625",
"text": "def player_stats(name)\n result = join_teams.select do |player|\n player[:player_name] == name\nend\n result[0]\nend",
"title": ""
},
{
"docid": "457a553b998501aa43ae1b5c7c765cfc",
"score": "0.6025301",
"text": "def get_player(string)\n arr = string.split(\"|\")\n name = @names[arr.last.strip.downcase]\n player = @players[name]\n #Check clan\n tags = arr.size\n while tags > 1\n clan = @clans[arr[-tags].strip.downcase]\n #add to player's clan set\n player.clan << clan\n tags -= 1\n end\n return player\n end",
"title": ""
},
{
"docid": "1d755c565aadb35d440353ccf52b74f8",
"score": "0.6009836",
"text": "def asking_names\n puts \"\\n-------------------------------------------------------\"\n puts \"What is the name of Player #{@@player_instance} ?\"\n player_name = gets.chomp\n return player_name\n end",
"title": ""
},
{
"docid": "7c077e413d6aa99951b6d0534498a7f6",
"score": "0.60059947",
"text": "def player_names\n puts \"1 . Entrez le pseudo du premier joeurs, vous utilisez le X : \"\n name1 = gets.chomp.upcase\n puts \"\"\n puts \"2 . Entrez le pseudo du second joeurs, vous utilisez le O : \"\n name2 = gets.chomp.upcase\n\n @player1.name = name1\n @player2.name = name2\n end",
"title": ""
},
{
"docid": "2846634a347cad93a54082ee375a21ef",
"score": "0.6001658",
"text": "def get_names\n\t\t\tputs \"\\nPlayer 1 (white), what is your name?\"\n\t\t\tplayer1 = $stdin.gets.chomp\n\t\t\tputs \"\\nPlayer 2 (black), what is your name?\"\n\t\t\tplayer2 = $stdin.gets.chomp\n\t\t\tset_players(player1, player2)\n\t\t\t# go to show_status\n\t\tend",
"title": ""
},
{
"docid": "9c32826c2d7c12ee816d1a3c3fc91e82",
"score": "0.5998261",
"text": "def player_with_longest_name(team_name)\n players = player_names(team_name)\n length = 0\n longest_name = \"\"\n players.each do |player|\n if length < player.length\n length = player.length\n longest_name = player\n end\n end\n return longest_name\nend",
"title": ""
},
{
"docid": "f9050490d6fe729c2db6f3771db45d01",
"score": "0.5996042",
"text": "def gets_name(player_number)\n\t\tputs \"What's player #{player_number}'s name?\"\n\t\treturn input = gets.chomp\n\tend",
"title": ""
},
{
"docid": "81d89286dacb90ead02212c02a432489",
"score": "0.5986106",
"text": "def test_name_getter\n\t\tplayer = Player.new(name: \"shawn\", move: \"f\", number_of_wins: \"10\")\n\t\tassert(\"shawn\", player.name)\n\tend",
"title": ""
},
{
"docid": "244ac3ad6555f66bf79308a82102106d",
"score": "0.5980266",
"text": "def get_first_name_of_season_winner(data, season)\n # code here\n data[season].each do |info|\n if info[\"status\"] == \"Winner\"\n return info[\"name\"].split(\" \")[0]\n end\n end\nend",
"title": ""
},
{
"docid": "523a7aa9d74ec3fe85ab67cbc25b93d8",
"score": "0.5972163",
"text": "def player_with_longest_name(game_data)\n game_data.map do |team|\n team[:players].map do |player|\n player[:name]\n end\n end.flatten.sort {|a,b| b.length - a.length }[0]\nend",
"title": ""
},
{
"docid": "bef306389fac4649aedf40962f53cffe",
"score": "0.59641635",
"text": "def extract_name(member_page)\n # Hon Kate Ellis MP\n name_text = member_page.at(\"h2\").text\n\n name_split = name_text.split()\n name_split.pop\n name_split.shift\n\n surname = name_split.pop\n firstname = name_split.join(\" \")\n\n @first = firstname\n @surname = surname\n\n end",
"title": ""
},
{
"docid": "d4caf5ae6a3f5d2268809402a60c3de3",
"score": "0.5962741",
"text": "def player_name(player)\n @player_turn = Text.new(\n \"#{player}'s turn.\",\n x: 180, y: 30, z: 10,\n color: 'black', size: 30)\n end",
"title": ""
},
{
"docid": "3e4d352f72ad37b28fd617b8fb4ceadf",
"score": "0.59419936",
"text": "def get_first_name_of_season_winner(data, season)\n winner = \"\"\n \n data.each do |season_num, contestants|\n if season_num == season\n contestants.each do |contestant|\n if contestant[\"status\"] == \"Winner\"\n winner = contestant[\"name\"].split(\" \").first\n end\n end\n end\n end\n \n winner\nend",
"title": ""
},
{
"docid": "aa8436b389c9768ee39bd17dd72ed701",
"score": "0.5933196",
"text": "def opponent_name\n opponent.try(:full_name)\n end",
"title": ""
},
{
"docid": "52ab85522985150537b24ad2a9c61758",
"score": "0.5926656",
"text": "def get_first_name_of_season_winner(data, season)\n\n\tseason_data = []\n\tdata.each do |var_season, var_season_data|\n\t\tif var_season == season\n\t\t\tseason_data = var_season_data\n\t\tend\n\tend\n\tseason_data\n\n\twinner_data = {}\n\tseason_data.each do |contestant|\n\t\t\tif contestant[\"status\"] == \"Winner\"\n\t\t\twinner_data = contestant\n\t\t\tend\n\tend\n\twinner_data\n\n # code here\n \n winner_name = winner_data[\"name\"]\n\n return winner_name.split.first\nend",
"title": ""
},
{
"docid": "10bdd432d6eea8314e82948321524d12",
"score": "0.592344",
"text": "def find_player_by_name(name)\n\t\t\t\t@player_lookup_by_shortname[name.to_shortname]\n\t\t\tend",
"title": ""
},
{
"docid": "b477928d48c0f65f0e9527d8e1b04e86",
"score": "0.5914978",
"text": "def player_with_longest_name()\n all_players_array = get_all_players()\n max_len = 0\n max_name = \"\"\n len = all_players_array.length()\n i = 0\n while i < len\n player = all_players_array[i]\n p_name = player[:player_name]\n p_len = p_name.length\n if(p_len > max_len)\n max_len = p_len\n max_name = p_name\n end\n i += 1\n end\n\n return max_name\nend",
"title": ""
},
{
"docid": "2ae9e0f1281403e30e0434a48242fa14",
"score": "0.59148383",
"text": "def name_from_username(username)\n where(:username => username).map(&:name).first\n end",
"title": ""
},
{
"docid": "33b41d3d535c2ec4740b5b3d2d849c81",
"score": "0.5913868",
"text": "def get_first_name_of_season_winner(data, season)\n # code here\t \n data[season].each do |contestant| #iterate with each over the data hash\n if contestant[\"status\"] == \"Winner\" \n return contestant[\"name\"].split.first #string manipulation \n end\n end\nend",
"title": ""
},
{
"docid": "ad44a46fd7c2c6b296c11df72c10a9a3",
"score": "0.5910959",
"text": "def get_full_name\n \"#{season_description} - #{team_name}: #{rank}\"\n end",
"title": ""
},
{
"docid": "86a470b87f1d10288e38403e38bc7f0e",
"score": "0.59038454",
"text": "def get_card_holder_name_parts\n \tparts = self.card_holder.split(' ')\n \tname_parts = []\n \tname_parts << parts[0]\n \tname_parts << (parts[1, parts.length-1].join(' '))\n\n \tname_parts\n end",
"title": ""
},
{
"docid": "7ee6623d4425e02978419d5d40ab2233",
"score": "0.59013027",
"text": "def get_first_name_of_season_winner(data, season)\n season_hash_array = data[season]\n season_winner = \"\"\n season_hash_array.each do |contestant|\n if contestant[\"status\"] == \"Winner\"\n season_winner = contestant[\"name\"]\n end\n end\n season_winner = season_winner.split\n return season_winner[0]\nend",
"title": ""
},
{
"docid": "89f7753a698ab8afd742a88f63e121a9",
"score": "0.5895073",
"text": "def get_first_name_of_season_winner(data, season)\n data[season].select do |contestant|\n contestant[\"status\"] == \"Winner\"\n return contestant[\"name\"].split[0]\n end\nend",
"title": ""
},
{
"docid": "6ea53503ef307bd3777c6ce791af6074",
"score": "0.5886256",
"text": "def player_name(player)\n player == 1 ? @player1_name : @player2_name\nend",
"title": ""
},
{
"docid": "7fe60dcca7391c0c2061786a03362a2f",
"score": "0.5885716",
"text": "def extract_names(field)\n field.strip.gsub(/\\s+/, \" \") =~ /(.*), (.*)/ or raise \"cannot parse name \\\"#{field}\\\"\"\n last = $1.strip\n first = $2.strip\n if first =~ /\"(.*)\"$/\n nick = $1.strip\n [nick, last]\n else\n first.sub!(/ \\([[[:alpha:]]]+\\.\\)$/, \"\") # \"Jane (Jr.)\" => \"Jane\"\n first.sub!(/ [[:alpha:]]\\.$/, \"\") # \"John Q.\" => \"John\"\n [first, last]\n end\nend",
"title": ""
},
{
"docid": "92e385590ee2f9a15a65c86ad1fdb278",
"score": "0.5884782",
"text": "def format_contestant_name(contestant_data)\n name = contestant_data[\"name\"]\n split_name = name.split(\" \")\n split_name[0]\nend",
"title": ""
}
] |
8cf6bb133874553981634d5d85ef5517 | GET /servers/1 GET /servers/1.json | [
{
"docid": "5d95bfbe4e74ab1938a9a2d0b9549818",
"score": "0.65457726",
"text": "def show\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @server }\n end\n end",
"title": ""
}
] | [
{
"docid": "5470e53212426fc808d7cf3d24680747",
"score": "0.77584976",
"text": "def servers\n response = get \"server\"\n data = JSON.parse response.body\n data[\"servers\"][\"server\"]\n end",
"title": ""
},
{
"docid": "9169d5bb8ca2efc7681814498e1c0242",
"score": "0.7471584",
"text": "def index\n @servers = all_servers\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @servers }\n end\n end",
"title": ""
},
{
"docid": "9bee2db3303cf15a3b948b01bdefab98",
"score": "0.7199877",
"text": "def index\n @servers = compute.servers\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @servers }\n end\n end",
"title": ""
},
{
"docid": "1af69bdfe44635816e242aca585b7d4b",
"score": "0.71700495",
"text": "def index\n @servers = Server.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @servers }\n end\n end",
"title": ""
},
{
"docid": "1af69bdfe44635816e242aca585b7d4b",
"score": "0.71700495",
"text": "def index\n @servers = Server.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @servers }\n end\n end",
"title": ""
},
{
"docid": "3fabb46ce329abad0e8e38b91bd8033b",
"score": "0.71122605",
"text": "def index\n @servers = Server.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @servers }\n end\n end",
"title": ""
},
{
"docid": "ce00762ead63d5285a718d24dcf3bfb2",
"score": "0.70577055",
"text": "def show\n @server = get_server(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @server }\n end\n end",
"title": ""
},
{
"docid": "3005b2f70ef8d071210eda2170a77660",
"score": "0.6980551",
"text": "def show\n @server = Server.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @servers }\n format.xml { render :xml => @server }\n end\n end",
"title": ""
},
{
"docid": "c86bad702a8c5cd3e4c8cd6ca1568144",
"score": "0.6970045",
"text": "def show\n @server = Server.find(params[:id])\n resp\n end",
"title": ""
},
{
"docid": "866a5e547eefbc51ef182f0a5fccc2f0",
"score": "0.6965349",
"text": "def index\n @servers = Server.includes(:license).includes(:client).includes(:parent).first(500)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @servers }\n end\n end",
"title": ""
},
{
"docid": "87ef803c20adffd4c5d56820b1e84017",
"score": "0.6954349",
"text": "def show\n @server = Server.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @server }\n end\n end",
"title": ""
},
{
"docid": "87ef803c20adffd4c5d56820b1e84017",
"score": "0.6954349",
"text": "def show\n @server = Server.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @server }\n end\n end",
"title": ""
},
{
"docid": "87ef803c20adffd4c5d56820b1e84017",
"score": "0.6954349",
"text": "def show\n @server = Server.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @server }\n end\n end",
"title": ""
},
{
"docid": "85f02d63d78b715050a9c81c3b1991c5",
"score": "0.69396544",
"text": "def servers\n nr_api.get(url('servers')).body['servers']\n rescue NoMethodError\n []\n end",
"title": ""
},
{
"docid": "a1dd8b1a2b7efe96096e284edf772cba",
"score": "0.69154704",
"text": "def index\n @servers = Server.order(:ordinal).all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @servers }\n end\n end",
"title": ""
},
{
"docid": "6f3f448ee4d528583b73e78248a62c23",
"score": "0.68826586",
"text": "def show\n\t\t@server = Server.find(params[:id])\n\n\t\trespond_to do |format|\n\t\t\tformat.html # show.html.erb\n\t\t\tformat.json { render json: @server }\n\t\tend\n\tend",
"title": ""
},
{
"docid": "1bb4e8a93dd1762bb01e36fca78600c1",
"score": "0.6876788",
"text": "def show\n @server = compute.get_server(params[:id])\n @server_detail = compute.get_server_detail(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @server }\n end\n end",
"title": ""
},
{
"docid": "261f064a62d585d0be8cad866fcae2ff",
"score": "0.68450814",
"text": "def get_servers\n puts \"Getting server list\"\n servers = @conn.list_servers\n\n for server in servers.body['servers']\n puts server\n end\n\n return servers.body['servers']\n end",
"title": ""
},
{
"docid": "224346a8dd128f15922d462aa8094b95",
"score": "0.6781266",
"text": "def show\n @server = RdsServer.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @server }\n end\n end",
"title": ""
},
{
"docid": "35ede9fd999481782b9cbd3db312c49f",
"score": "0.6686447",
"text": "def index\n @servers = Server.all\n\n respond_with @servers \n end",
"title": ""
},
{
"docid": "b5bdd1d510d46cdd4baaf76566a884e2",
"score": "0.666989",
"text": "def server_info\r\n request(url: '/server/info', method: :get).perform!\r\n end",
"title": ""
},
{
"docid": "289b2e43c95970bac073e565062e5a0a",
"score": "0.6650313",
"text": "def information\n params = { command: 'server_info', id: server_id }\n get('/json.php', params)\n end",
"title": ""
},
{
"docid": "2382d2c8884cffb153aa37fb2bac355a",
"score": "0.663712",
"text": "def server_by_id(server_id)\n get(\"Server/#{server_id}\")\n end",
"title": ""
},
{
"docid": "089a47b2cebc756fe76d680806f30f6f",
"score": "0.6618985",
"text": "def index\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @ss_servers }\n end\n end",
"title": ""
},
{
"docid": "3d638b80c5387f5cd3ad02ad9a5ea71d",
"score": "0.6617217",
"text": "def show\n @master_server = MasterServer.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @master_server }\n end\n end",
"title": ""
},
{
"docid": "649d5157139eeca0d6a050583cf3c0c4",
"score": "0.6605794",
"text": "def get\n @response = self.class.get(\"#{@server_uri}/resource_name/#{@opts[:id]}.json\")\n end",
"title": ""
},
{
"docid": "b49d8b2aa4cdcf8a293956fe256c8aa1",
"score": "0.66005397",
"text": "def show\n @version = ApplicationController::HEPHAESTUS_VERSION\n @server = Server.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @server }\n end\n end",
"title": ""
},
{
"docid": "e90e77118d843480f5dd496d817b6db0",
"score": "0.6597418",
"text": "def show\n if @server\n render json: represent_server(@server).to_json\n else\n render status: 404, json: { errors: 'server not found' }\n end\n end",
"title": ""
},
{
"docid": "8c5900c1338208acd230549320c4e4d4",
"score": "0.6554671",
"text": "def name_servers\n response = @client.rest_get(@data['uri'] + '/nameServers')\n response.body\n end",
"title": ""
},
{
"docid": "0219da1db8c49b9758fb86b8fe10b818",
"score": "0.6549486",
"text": "def servers\n local_server_address = cluster_manager.local_server_address\n servers={local_server_address => {:server_address => local_server_address}}\n cluster_manager.servers.each do |k,v|\n servers[k] = v.to_hash\n end\n content={:servers => servers}\n respond 200, content\n end",
"title": ""
},
{
"docid": "1042b8d29bfb761a54353ba7bee9ddc1",
"score": "0.65377927",
"text": "def index\n @title = \"All Servers\"\n @servers = Server.fields(\"fqdn\", \"lastseen\").sort(:fqdn).all\n respond_with(@servers)\n end",
"title": ""
},
{
"docid": "f3789136f605b3850b6473c8efb93b1c",
"score": "0.6521661",
"text": "def show\n @database1 = Database1.find(params[:id])\n @server_options = Server.all.map{|u| [ u.server_name, u.id ] }\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @database1 }\n end\n end",
"title": ""
},
{
"docid": "df0a61348c7cb5c32266cbb5c0cda4e3",
"score": "0.6513896",
"text": "def index\n @servers = Server.all\n end",
"title": ""
},
{
"docid": "df0a61348c7cb5c32266cbb5c0cda4e3",
"score": "0.6513896",
"text": "def index\n @servers = Server.all\n end",
"title": ""
},
{
"docid": "df0a61348c7cb5c32266cbb5c0cda4e3",
"score": "0.6513896",
"text": "def index\n @servers = Server.all\n end",
"title": ""
},
{
"docid": "fbdb01e9fae7bbe7be1191d06630b707",
"score": "0.6471132",
"text": "def show\n @server_status = ServerStatus.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @server_status }\n end\n end",
"title": ""
},
{
"docid": "6d527fd2dba849f2cfa5bd1d71017bca",
"score": "0.6465526",
"text": "def show\n @server = Server.find(params[:id])\n\n respond_with @server\n end",
"title": ""
},
{
"docid": "f076bea2f63c389dfcaa7060a2e1814d",
"score": "0.644054",
"text": "def index\n if params[:service_id].nil?\n @servers = subdomain.servers\n else\n @servers = subdomain.services.find(params[:service_id]).servers\n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @servers }\n end\n end",
"title": ""
},
{
"docid": "8d1d4aa629ecf7764a3c206a17d7c3a5",
"score": "0.6438746",
"text": "def show\n @server = Server.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @server }\n format.xml { render :xml => @server }\n end\n end",
"title": ""
},
{
"docid": "0462c77d23a2ec76b9272afbbd141d8c",
"score": "0.64305484",
"text": "def get_server(args)\n # for convenience\n server_id = args[:server_id]\n server_name = args[:server_name]\n deployment_id = args[:deployment_id]\n deployment_name = args[:deployment_name]\n indent = args[:indent] || ''\n \n args_no_pass = args.reject {|key, _| key == :password }\n @logger.debug \"#{indent}get_server(#{args_no_pass.inspect})\"\n \n if server_id and server_id > 0\n server = @client.servers(:id => server_id).show\n if server.nil?\n @logger.warn \"#{indent}get_server(): No Server (id=#{server_id}) found\"\n return\n end\n \n d = server.deployment\n deployment_id = (File.basename d.href).to_i\n \n @logger.debug \"#{indent}get_server(): Found Server (id=#{server_id}) in Deployment (id=#{deployment_id})\"\n else\n servers = @client.servers.index(:filter => [\"name==#{server_name}\"])\n # exact match the name\n servers.delete_if {|s| s.name != server_name }\n @logger.debug \"#{indent}get_server(): #{servers.size} exact matches for server name '#{server_name}'.\"\n \n filtered = []\n # find the server with the correct deployment id, if specified\n if deployment_id || deployment_name\n servers.each {|s|\n server_id = (File.basename s.href).to_i\n # get the deployment for the server\n d = s.deployment\n d_id = (File.basename d.href).to_i\n @logger.debug \"#{indent}get_server(): Server (id=#{server_id}) in Deployment (id=#{deployment_id})\"\n \n # if we have the deployment id, perfect match, save it\n if d_id == deployment_id\n @logger.debug \"#{indent}get_server(): Server matches Deployment by id\"\n deployment_name = d.name\n filtered = [s]\n break\n # else we have to get the deployment by name and take the first that matches\n elsif deployment_name\n @logger.debug \"#{indent}get_server(): Seeing if Deployment (id=#{d_id}) matches deployment by name '#{deployment_name}'\"\n d = get_deployment(:deployment_id => d_id.to_i)\n if d.name == deployment_name\n @logger.debug \"#{indent}get_server(): Matched Deployment (id=#{d_id}, name=#{d.name})\"\n deployment_id = d_id\n filtered = [s]\n break\n end\n end\n }\n \n servers = filtered\n end\n \n if servers.nil? || servers.empty?\n @logger.warn \"#{indent}get_server(): No server matches name='#{server_name}'\"\n return\n elsif servers.size > 1\n @logger.warn \"#{indent}get_server(): Multiple server matches for name='#{server_name}'\"\n return\n end\n \n @logger.debug \"#{indent}get_server(): Found servers for Server (id=#{server_id}, name=#{server_name}) in Deployment (id=#{deployment_id}, name=#{deployment_name})\"\n # only one server left\n server = servers.first.show\n end\n \n @logger.debug \"#{indent}get_server(): Returning Server (id=#{server_id}, name=#{server_name}) dump: #{server.inspect}\"\n \n return server\n end",
"title": ""
},
{
"docid": "c42c57edd9516ad0dec2917f194cb93f",
"score": "0.64281666",
"text": "def index\n @database1s = Database1.all\n @server_options = Server.all.map{|u| [ u.server_name, u.id ] }\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @database1s }\n end\n end",
"title": ""
},
{
"docid": "16a21d16489364922220a78f3cb453c3",
"score": "0.6418467",
"text": "def status\n result = $redis.hget('servers', id)\n result = '{}' if result.nil?\n JSON.parse(result)\n end",
"title": ""
},
{
"docid": "d6190353a78e3e4975c7c72e4079a893",
"score": "0.63707167",
"text": "def index\n @servers = current_user.servers\n end",
"title": ""
},
{
"docid": "4d2e0bd8939c79becffac26f506e9ae8",
"score": "0.63441133",
"text": "def list_servers\n connection.get do |req|\n req.url \"agent/servers\"\n end\n end",
"title": ""
},
{
"docid": "37312283e2500b6f7830efc08d4e004c",
"score": "0.62778044",
"text": "def get_instances\n logger.info \"getting instances for #{@hostname}\"\n compute_url=\"#{@compute_url}/servers/detail?all_tenants=true\"\n response_raw=RestClient::Request.execute(method: :get, :url => compute_url, headers: {\"X-Auth-Token\" => @token}, :verify_ssl => false)\n json_data = JSON.parse(response_raw.body)[\"servers\"]\n logger.info \"recieved #{json_data.count} instances from #{@hostname}\"\n json_data\n end",
"title": ""
},
{
"docid": "c6207f7f8ab6a22388fabeab68ef96bd",
"score": "0.6276297",
"text": "def show\n respond_with(@server = Server.find(params[:id]))\n end",
"title": ""
},
{
"docid": "ee6bed1953db47a161ea97560af99155",
"score": "0.6204951",
"text": "def show\n @server = Server.find(params[:id])\n @port = Port.all\n @ports = Array.new\n\n\n @server.port.each do |x|\n @ports << x.port\n end\n\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @server }\n end\n end",
"title": ""
},
{
"docid": "9f4dc1458c7d37e30629bf901cee3402",
"score": "0.6198575",
"text": "def get_clients_by_devices(args = {}) \n get(\"/clients.json/stats/device\", args)\nend",
"title": ""
},
{
"docid": "c3888af5fb2bcb7e59a9d271cf6a2974",
"score": "0.6190426",
"text": "def show\n @server = current_user.servers.find(params[:id])\n end",
"title": ""
},
{
"docid": "183bdee1898c532a6e520a1395d850cb",
"score": "0.6181659",
"text": "def resource_servers(page: nil, per_page: nil)\n request_params = {\n page: !page.nil? ? page.to_i : nil,\n per_page: !page.nil? && !per_page.nil? ? per_page.to_i : nil\n }\n get(resource_servers_path, request_params)\n end",
"title": ""
},
{
"docid": "a48845ebf56bb05d93db52e29384f817",
"score": "0.61751205",
"text": "def show\n @solr_server = SolrServer.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @solr_server }\n end\n end",
"title": ""
},
{
"docid": "70cb5a78e33e85110c26360dd267c680",
"score": "0.6167185",
"text": "def show\n @configuration_server = Cnf::Server.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @configuration_server }\n end\n end",
"title": ""
},
{
"docid": "e0fae4cc6797dd433bebb43b99ba4e8e",
"score": "0.6166142",
"text": "def show\n @serv = Serv.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @serv }\n end\n end",
"title": ""
},
{
"docid": "e0fae4cc6797dd433bebb43b99ba4e8e",
"score": "0.6166142",
"text": "def show\n @serv = Serv.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @serv }\n end\n end",
"title": ""
},
{
"docid": "722494a3d6f922ce1c229877148b73e3",
"score": "0.61561733",
"text": "def server_id\n client.servers.index.first.show.href.split('/')[-1]\nend",
"title": ""
},
{
"docid": "f54445a5742e5f9d245bc12bed9e0203",
"score": "0.61554295",
"text": "def server\n servers[0]\n end",
"title": ""
},
{
"docid": "89e0ab838b2ebf660bdb154570fe306d",
"score": "0.61525697",
"text": "def show\n @server = Server.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n end\n end",
"title": ""
},
{
"docid": "342b22b02da17d8dbcc4d46cb363ff07",
"score": "0.6129179",
"text": "def show\n @server = current_user.account.servers.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @server }\n end\n end",
"title": ""
},
{
"docid": "37dc9f27ca789f4333c0b7f3ef861487",
"score": "0.61058044",
"text": "def list_servers\n Util.cachier('list_servers') do\n Client.servers.sort_by { |hsh| hsh['last_reported_at'] }.collect do |server|\n {\n name: server['name'],\n last_reported_at: server['last_reported_at'],\n id: server['id'],\n reporting: server['reporting']\n }\n end\n end\n end",
"title": ""
},
{
"docid": "7b5eb7dd94e00ffc9346304909606997",
"score": "0.6100252",
"text": "def get_servers(host=nil, port=nil)\n host ||= '63.146.124.21'\n port ||= 20810\n # TODO 6 ?\n cmd = \"getservers 6 full empty\"\n servers = []\n #TODO need to read all the responses, not just the first\n request_many(cmd, host, port) do |resp, _|\n break if resp.nil?\n servers += parse_serversResponse(resp)\n end\n\n servers\n end",
"title": ""
},
{
"docid": "84ebd276ed12954b40c03a6ac4afe1a7",
"score": "0.6100197",
"text": "def get_servers\n request_string = construct_request\n response = get_response request_string\n json = JSON.parse response.body\n servers = json.collect{|piece| piece[\"certname\"]}.uniq.sort\n if servers.empty?\n raise \"\\n****************************\\nTHERE IS NO SERVER TO DEPLOY TO, CHECK YOUR PUPPET SITE.PP\\n**************************\"\n end\n return servers\n end",
"title": ""
},
{
"docid": "ae972bdbaff4cf1fcdb84bce4c2ae04b",
"score": "0.6087163",
"text": "def servers; end",
"title": ""
},
{
"docid": "ae972bdbaff4cf1fcdb84bce4c2ae04b",
"score": "0.6087163",
"text": "def servers; end",
"title": ""
},
{
"docid": "9093687c27f3a91df26a63a925169f22",
"score": "0.60742486",
"text": "def servers\n @servers ||= {}\n @servers\n end",
"title": ""
},
{
"docid": "480eac2f236cbbbd3dc30983e1396f03",
"score": "0.60713327",
"text": "def show\n @server = Server.find(params[:id])\n @users = User.where(hostname: @server.hostname)\n @pids = Pid.where(hostname: @server.hostname)\n @networks = Network.where(hostname: @server.hostname)\n end",
"title": ""
},
{
"docid": "724bcc73683e52f0f78fa020a95caee1",
"score": "0.6071288",
"text": "def show\n @servers = Server.find_all_by_datacenter_id(@datacenter.id)\n end",
"title": ""
},
{
"docid": "29ee532f706d649c1727651c525de459",
"score": "0.6060932",
"text": "def index\n render json: client.list\n end",
"title": ""
},
{
"docid": "c578a1db34a0216e90384e35363a5dc5",
"score": "0.60573983",
"text": "def index\n @server_property = ServerProperty.first\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @server_properties }\n end\n end",
"title": ""
},
{
"docid": "1f6be1a357d676d269f841025c7e0ccf",
"score": "0.6049487",
"text": "def index\n @servers = current_user.account.servers.includes(:ports, :pages)\n\n if @servers.count == 0\n redirect_to new_server_url\n return\n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.js { render(:partial => 'server_list.html.haml', :layout => false, \n :locals => {:servers => @servers}) }\n format.xml { render :xml => @servers }\n end\n end",
"title": ""
},
{
"docid": "9d5864b8adcb2f034f78f76c7bf5b659",
"score": "0.6030334",
"text": "def status\n servers_service = ServersService.new\n response = servers_service.status\n render json: response[:body], status: response[:status]\n end",
"title": ""
},
{
"docid": "b0b5dd4e7c5ea7a31a3c397811ea3dca",
"score": "0.60300714",
"text": "def servers\n @servers\n end",
"title": ""
},
{
"docid": "11f28c5518ebe2edd89e71da5cbb22f5",
"score": "0.6023693",
"text": "def fetch_virtualserver_stats(url_prefix, vs)\n url = \"#{url_prefix}/api/tm/3.3/status/local_tm/statistics/virtual_servers/#{vs}\"\n begin\n response = get_response(url)\n vs_stats = JSON.parse(response.body)\n vs_stats['statistics']\n rescue => e\n e.response \n end\nend",
"title": ""
},
{
"docid": "6705ce58e3a30164615451aa94030fb8",
"score": "0.60036755",
"text": "def index\n @varnish_servers = VarnishServer.page(params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @varnish_servers }\n end\n end",
"title": ""
},
{
"docid": "18bbc18b3b623435843bd889497c7290",
"score": "0.5992787",
"text": "def servers\n login\n\n uri = @services['compute'] + 'servers/detail'\n\n body = get uri\n\n body['servers'].map do |server|\n vm = Server.new server\n vm.openstack = self\n vm\n end\n end",
"title": ""
},
{
"docid": "959aa15ebb9f4a9f9cd9d7919b3b3e62",
"score": "0.5977392",
"text": "def show\n @varnish_server = VarnishServer.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @varnish_server }\n end\n end",
"title": ""
},
{
"docid": "b568de645d15707b33b25753e458d31c",
"score": "0.59631175",
"text": "def list_top_clients(args = {}) \n get(\"/clients.json/stats/top\", args)\nend",
"title": ""
},
{
"docid": "8928a984ba783471cf0c95feb1149eae",
"score": "0.5952637",
"text": "def get_server(id)\n server = @cs_conn.server(id.to_i)\n {\n :id => server.id,\n :progress => server.progress,\n :status => server.status,\n :public_ip => server.addresses[:public][0],\n :private_ip => server.addresses[:private][0]\n }\n end",
"title": ""
},
{
"docid": "e691054a99152f1ce3704d900f3eef6c",
"score": "0.59504086",
"text": "def show\n @server = Server.find(params[:server_id])\n @ping_log = @server.ping_logs.find(params[:id])\n\n respond_to do |format|\n format.html { render :show, layout: false } # show.html.erb\n format.json { render json: @ping_log }\n end\n end",
"title": ""
},
{
"docid": "b9cc61e4169afbb358e0350e1f9905d5",
"score": "0.5948779",
"text": "def show\n @serverrack = Serverrack.find(params[:id])\n @rackitem = Rackitem.new\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @serverrack }\n end\n end",
"title": ""
},
{
"docid": "ce2522561e05e6c29b10a258e7c85ead",
"score": "0.5938879",
"text": "def sample \n if !logged_in? \n render json: [\"Invalid credentials\"], status: 401\n else \n @servers = Server.first(3)\n render :index\n end \n end",
"title": ""
},
{
"docid": "35a55b1afe6392a5873866b31d04a1e7",
"score": "0.59343475",
"text": "def servers\n @servers.keys\n end",
"title": ""
},
{
"docid": "43237f330f7a78823ea8c13ff04589ce",
"score": "0.5926826",
"text": "def servers\n @servers ||= []\n end",
"title": ""
},
{
"docid": "6e50ae275a18d34f633f94d3a50b4bbb",
"score": "0.5906004",
"text": "def vms(opts = {})\n client.servers\n end",
"title": ""
},
{
"docid": "211d74780f8b3b2d163d3c65f3a45b59",
"score": "0.5880342",
"text": "def show\n @pos_server = PosServer.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @pos_server }\n end\n end",
"title": ""
},
{
"docid": "60f5ad9162149b59a8d402272f525d0a",
"score": "0.58637255",
"text": "def servers\n print_servers\n end",
"title": ""
},
{
"docid": "d490cc4ff417f0bb37b50f42f604461b",
"score": "0.58622336",
"text": "def index\n @app_servers = AppServer.all\n end",
"title": ""
},
{
"docid": "dc5fe8ea99114ca8a5c6fc56dd1e60c2",
"score": "0.5848717",
"text": "def servers\n @servers = Server.where([\"servers.app_id = ?\", params[:id]])\n if @servers.empty?\n @servers = Server.all\n flash[:notice] = 'No servers assigned to this application yet, showing all servers.'\n render 'servers/index' and return\n end\n render 'servers/index'\n end",
"title": ""
},
{
"docid": "241da30b7d6f168a44bd9ffbe75bdda4",
"score": "0.58371943",
"text": "def getServers(admin)\n serverInfos = admin.getClusterMetrics.getLiveServerMetrics.keySet\n servers = []\n serverInfos.each do |server|\n servers << server.getServerName\n end\n servers\nend",
"title": ""
},
{
"docid": "4fca87732b08dee9180999c3a340bd42",
"score": "0.58327305",
"text": "def servers\n [:default]\n end",
"title": ""
},
{
"docid": "ccdec0d6cc37f446842f31debab81e93",
"score": "0.58268005",
"text": "def show\n render json: @api_v1_client\n end",
"title": ""
},
{
"docid": "4c82aa368df5c414e6f8e29da6a1f58b",
"score": "0.5825887",
"text": "def show\n @stay_in = \"Chi Tiết Server\"\n @admin_server = Server.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @admin_server }\n end\n end",
"title": ""
},
{
"docid": "fd6dfaadc6d3ff72c0bb509aeab39a76",
"score": "0.58155",
"text": "def show\n render json: @client\n end",
"title": ""
},
{
"docid": "0eb809381d474f639e60b318a303a57c",
"score": "0.5811605",
"text": "def show\n @server = Server.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @server }\n end\n end",
"title": ""
},
{
"docid": "b7c09f0a64b30c7b8f1cb861f31f9802",
"score": "0.58039236",
"text": "def servers\n @servers = Server.where([\"servers.environment_id = ?\", params[:id]])\n if @servers.empty?\n @servers = Server.all\n flash[:notice] = 'No servers assigned to this environment yet, showing all servers.'\n render 'servers/index' and return\n end\n render 'servers/index'\n end",
"title": ""
},
{
"docid": "24aabe95c32fb4290d7672add4f124a1",
"score": "0.58038765",
"text": "def pick_server(server)\n @servers[server]\n end",
"title": ""
},
{
"docid": "bb6daed34388c42b9650f53e5f95941d",
"score": "0.57998943",
"text": "def resource_servers_path\n @resource_servers_path ||= '/api/v2/resource-servers'\n end",
"title": ""
},
{
"docid": "dc41a49cb3497d778ab721410a5b8e2b",
"score": "0.57997215",
"text": "def server_status\n nessus_rest_get('server/status')\n end",
"title": ""
},
{
"docid": "c0ffa931d98d5ce1e2041a93d545d9ea",
"score": "0.5779908",
"text": "def index\n @clients = Client.all\n\n render json: @clients\n end",
"title": ""
}
] |
b9d3188b09afdd5cea9c081978d840a5 | Test for getting drawin objects | [
{
"docid": "531fab95ab6a922d14cf6e112c2bf311",
"score": "0.5479201",
"text": "def test_get_document_drawing_objects\n filename = 'test_multi_pages.docx'\n remote_name = 'TestGetDocumentDrawingObjects.docx'\n\n st_request = PutCreateRequest.new remote_test_folder + test_folder + '/' + remote_name, File.open(local_common_folder + filename, \"r\").read\n @storage_api.put_create st_request\n\n request = GetDocumentDrawingObjectsRequest.new remote_name, remote_test_folder + test_folder, :node_path => 'sections/0'\n result = @words_api.get_document_drawing_objects request\n assert_equal 200, result.code\n end",
"title": ""
}
] | [
{
"docid": "a4a4b82c76cbddb926dd3cca12da96a8",
"score": "0.61519283",
"text": "def drawings; end",
"title": ""
},
{
"docid": "abca22c0896b784cf06e5a838c1caeed",
"score": "0.5837669",
"text": "def has_drawing?; end",
"title": ""
},
{
"docid": "a4ca3ff95947eefa961d4a72aaa739fa",
"score": "0.57563704",
"text": "def objects; end",
"title": ""
},
{
"docid": "a4ca3ff95947eefa961d4a72aaa739fa",
"score": "0.57563704",
"text": "def objects; end",
"title": ""
},
{
"docid": "a7d16fc3a819f0a3d6e0448d45fe81df",
"score": "0.57482517",
"text": "def graph_obj?(in_object)\n\tshape?(in_object) or point?(in_object)\nend",
"title": ""
},
{
"docid": "547028680301353d64bf96e77b84354b",
"score": "0.5731909",
"text": "def objects_in_shape\n return Object.where(\"ST_Covers('#{self.geog_shape}', geog_point)\") if self.has_attribute?(:geog_shape)\n end",
"title": ""
},
{
"docid": "6262a4de0c88dc32fba7c83ac85a4294",
"score": "0.56529737",
"text": "def test_default\n [@window, @sprite, @bitmap].each{|container|\n uc = UCEnemyGraphic.new(container, Rect.new(0, 0, 96, 96), nil)\n uc.draw()\n }\n return true\n end",
"title": ""
},
{
"docid": "e8acc67d482e61aa219666b55fc6e418",
"score": "0.5649654",
"text": "def test_objects\n assert_kind_of(Teil, @cover)\n assert_kind_of(Teil, @coachwork)\n assert_kind_of(Teil, @back_door)\n end",
"title": ""
},
{
"docid": "e1f2ac6226eb391a5a38c078a9da7541",
"score": "0.5600455",
"text": "def find_selected_object(x, y, view)\r\n return nil if not @corners\r\n pickray = view.pickray(x, y)\r\n wall_base_plane = [ @corners[0], Z_AXIS ]\r\n orig_point = Geom::intersect_line_plane(pickray, wall_base_plane)\r\n return nil if not orig_point\r\n point = Geom::Point3d.new(orig_point)\r\n # create a transformation if wall angle is not zero\r\n rotate_transform = Geom::Transformation.rotation(@corners[0], Z_AXIS, -@wall.angle.degrees)\r\n \r\n wall_start = Geom::Point3d.new(@wall.origin)\r\n wall_end = Geom::Point3d.new(@wall.endpt)\r\n if (@wall.angle != 0)\r\n wall_start.transform!(rotate_transform)\r\n wall_end.transform!(rotate_transform)\r\n point.transform!(rotate_transform)\r\n end\r\n \r\n wall_vec = wall_end - wall_start\r\n \r\n @wall.objects.each do |obj|\r\n \r\n # find the four corners of the object\r\n wall_vec.length = obj.center_offset - obj.width/2\r\n obj_start = wall_start + wall_vec\r\n wall_vec.length = obj.width\r\n obj_end = obj_start + wall_vec\r\n obj_vec = obj_end - obj_start\r\n next if (obj_vec.length <= 0)\r\n case @wall.justify\r\n \twhen \"left\"\r\n \t\ttransform = Geom::Transformation.new(obj_start, [0, 0, 1], -90.degrees)\r\n \twhen \"right\"\r\n \t transform = Geom::Transformation.new(obj_start, [0, 0, 1], 90.degrees)\r\n \twhen \"center\"\r\n \t # TODO\r\n \telse\r\n \t transform = Geom::Transformation.new\r\n \t UI.messagebox \"invalid justification\"\r\n \tend\t\t\r\n \t\t\t\r\n \tobj_vec.transform!(transform)\r\n \tobj_vec.length = @wall.width\r\n \t obj_start_offset = obj_start.offset(obj_vec)\r\n\r\n # determine if the point lies within the rectangle\r\n # puts \"orig_point = \" + orig_point.inspect \r\n # puts \"point = \" + point.inspect\r\n # puts \"obj_start = \" + obj_start.inspect\r\n # puts \"obj_end = \" + obj_end.inspect\r\n # puts \"obj_start_offset = \" + obj_start_offset.inspect\r\n if ((point.y > min(obj_start.y, obj_end.y)) &&\r\n (point.y < max(obj_start.y, obj_end.y)) &&\r\n (point.x > min(obj_start.x, obj_start_offset.x)) &&\r\n (point.x < max(obj_start.x, obj_start_offset.x)))\r\n # puts \"found\"\r\n view.invalidate\r\n return(obj)\r\n end\r\n end\r\n return(nil) # didn't find a door or window under the mouse\r\nend",
"title": ""
},
{
"docid": "ad22af24d30446ed0643eb4b15d24c90",
"score": "0.55907923",
"text": "def test_default_4Vertices\n [@window, @sprite, @bitmap].each{|container|\n c = CPolygon.new(container, [[200,200],[250,200],[250,250],[200,250]], Color.hp_gauge_color1)\n c.draw()\n }\n return true\n end",
"title": ""
},
{
"docid": "fc79e967546fb33ef2490268574de182",
"score": "0.5543548",
"text": "def usable_objects(map, battle)\n map.objects_near(self, battle)\n end",
"title": ""
},
{
"docid": "5bcc94338ce1d0e07cc0f81192c319f7",
"score": "0.5542374",
"text": "def test_border_4Vertices\n [@window, @sprite, @bitmap].each{|container|\n c = CPolygon.new(container, [[250,200],[300,200],[300,250],[250,250]], nil, false, nil,\n 1, Color.hp_gauge_color1)\n c.draw()\n }\n return true\n end",
"title": ""
},
{
"docid": "7641822b8c0be6a6d6c9872dd47f7576",
"score": "0.552099",
"text": "def test_default\n [@window, @sprite, @bitmap].each{|container|\n c = CPolygon.new(container, [[0,0],[100,0],[100,50],[0,50]], Color.hp_gauge_color1)\n c.draw()\n }\n return true\n end",
"title": ""
},
{
"docid": "c1c719fe747136220817073f702c2d21",
"score": "0.5499048",
"text": "def drawers\n @drawers ||= []\n end",
"title": ""
},
{
"docid": "6b927436b3748b4d50e0459750441edf",
"score": "0.549094",
"text": "def test_default_7Vertices\n [@window, @sprite, @bitmap].each{|container|\n c = CPolygon.new(container, [[200,310],[210,280],[250,260],[290,280],[300,310],[270,340],[230,340]], Color.hp_gauge_color1)\n c.draw()\n }\n return true\n end",
"title": ""
},
{
"docid": "bb8b65be234601e8107075d8771a1ff0",
"score": "0.54840153",
"text": "def draw?\n\n end",
"title": ""
},
{
"docid": "b369dc44d2bf855dbde77e316221928a",
"score": "0.5473894",
"text": "def find_selected_object(x, y, view)\r\n # puts \"corners = \" + @corners.inspect\r\n return nil if (@corners.length != 5)\r\n pickray = view.pickray(x, y)\r\n wall_base_plane = [ @corners[0], Z_AXIS ]\r\n orig_point = Geom::intersect_line_plane(pickray, wall_base_plane)\r\n # puts \"pt = \" + orig_point.inspect\r\n return nil if not orig_point\r\n point = Geom::Point3d.new(orig_point)\r\n # create a transformation if wall angle is not zero\r\n rotate_transform = Geom::Transformation.rotation(@corners[0], Z_AXIS, -@wall.angle.degrees)\r\n \r\n wall_start = Geom::Point3d.new(@wall.origin)\r\n wall_end = Geom::Point3d.new(@wall.endpt)\r\n if (@wall.angle != 0)\r\n wall_start.transform!(rotate_transform)\r\n wall_end.transform!(rotate_transform)\r\n point.transform!(rotate_transform)\r\n end\r\n \r\n wall_vec = wall_end - wall_start\r\n \r\n @wall.objects.each do |obj|\r\n \r\n # find the four corners of the object\r\n wall_vec.length = obj.center_offset - obj.width/2\r\n obj_start = wall_start + wall_vec\r\n wall_vec.length = obj.width\r\n obj_end = obj_start + wall_vec\r\n obj_vec = obj_end - obj_start\r\n next if (obj_vec.length <= 0)\r\n case @wall.justify\r\n \twhen \"left\"\r\n \t\ttransform = Geom::Transformation.new(obj_start, [0, 0, 1], -90.degrees)\r\n \twhen \"right\"\r\n \t transform = Geom::Transformation.new(obj_start, [0, 0, 1], 90.degrees)\r\n \twhen \"center\"\r\n \t # TODO\r\n \telse\r\n \t transform = Geom::Transformation.new\r\n \t UI.messagebox \"invalid justification\"\r\n \tend\t\t\r\n \t\t\t\r\n \tobj_vec.transform!(transform)\r\n \tobj_vec.length = @wall.width\r\n \t obj_start_offset = obj_start.offset(obj_vec)\r\n\r\n # determine if the point lies within the rectangle\r\n # puts \"orig_point = \" + orig_point.inspect \r\n # puts \"point = \" + point.inspect\r\n # puts \"obj_start = \" + obj_start.inspect\r\n # puts \"obj_end = \" + obj_end.inspect\r\n # puts \"obj_start_offset = \" + obj_start_offset.inspect\r\n if ((point.y > min(obj_start.y, obj_end.y)) &&\r\n (point.y < max(obj_start.y, obj_end.y)) &&\r\n (point.x > min(obj_start.x, obj_start_offset.x)) &&\r\n (point.x < max(obj_start.x, obj_start_offset.x)))\r\n # puts \"found\"\r\n view.invalidate\r\n return(obj)\r\n end\r\n end\r\n return(nil) # didn't find a door or window under the mouse\r\nend",
"title": ""
},
{
"docid": "59c96951bc544cd603d573d4121a8cc1",
"score": "0.5471265",
"text": "def determine_rects\n end",
"title": ""
},
{
"docid": "59c96951bc544cd603d573d4121a8cc1",
"score": "0.5471265",
"text": "def determine_rects\n end",
"title": ""
},
{
"docid": "3be62996f8cc2ec30907c261919f9969",
"score": "0.5466386",
"text": "def draw?\n end",
"title": ""
},
{
"docid": "28aa7f7351b7008ae713457a8deb64cd",
"score": "0.54419297",
"text": "def test_border_7Vertices\n [@window, @sprite, @bitmap].each{|container|\n c = CPolygon.new(container, [[300,310],[310,280],[350,260],[390,280],[400,310],[370,340],[330,340]], nil, false, nil,\n 1, Color.hp_gauge_color1)\n c.draw()\n }\n return true\n end",
"title": ""
},
{
"docid": "2f6a7253394429490be5ab93bad9755d",
"score": "0.54413694",
"text": "def test_notFilled_Border\n [@window, @sprite, @bitmap].each{|container|\n c = CPolygon.new(container, [[0,100],[100,100],[100,150],[0,150]], nil, false, nil,\n 1, Color.hp_gauge_color1)\n c.draw()\n }\n return true\n end",
"title": ""
},
{
"docid": "6ffc8ff5237f2d1c96e6dcf65a3490d6",
"score": "0.5439365",
"text": "def test_default\n [@window, @sprite, @bitmap].each{|container|\n c = CRectangle.new(container, Rect.new(0, 0, 100, 50), Color.hp_gauge_color1)\n c.draw()\n }\n return true\n end",
"title": ""
},
{
"docid": "1a34e51f33b4ef318fe490d201b7f8f4",
"score": "0.54385984",
"text": "def test_border_6Vertices\n [@window, @sprite, @bitmap].each{|container|\n c = CPolygon.new(container, [[100,300],[125,260],[175,260],[200,300],[175,340],[125,340]], nil, false, nil,\n 1, Color.hp_gauge_color1)\n c.draw()\n }\n return true\n end",
"title": ""
},
{
"docid": "efe38fcdf1934363e205ad782b0f85f0",
"score": "0.5425975",
"text": "def test_border_8Vertices\n [@window, @sprite, @bitmap].each{|container|\n c = CPolygon.new(container, [[475,285],[500,260],[525,260],[550,285],[550,310],[525,335],[500,335],[475,310]], nil, false, nil,\n 1, Color.hp_gauge_color1)\n c.draw()\n }\n return true\n end",
"title": ""
},
{
"docid": "030a03be8f606b91a2f5d7a6cd84ac65",
"score": "0.5425518",
"text": "def usable_objects(map, battle)\n map.objects_near(self, battle)\n end",
"title": ""
},
{
"docid": "d198d636441bc5df10ca0055fdd821b7",
"score": "0.54240704",
"text": "def test_default_5Vertices\n [@window, @sprite, @bitmap].each{|container|\n c = CPolygon.new(container, [[300,220],[325,200],[350,220],[340,250],[310,250]], Color.hp_gauge_color1)\n c.draw()\n }\n return true\n end",
"title": ""
},
{
"docid": "18822b5649bbc348ba7016f3a65bbb09",
"score": "0.54141456",
"text": "def test_default_6Vertices\n [@window, @sprite, @bitmap].each{|container|\n c = CPolygon.new(container, [[0,300],[25,260],[75,260],[100,300],[75,340],[25,340]], Color.hp_gauge_color1)\n c.draw()\n }\n return true\n end",
"title": ""
},
{
"docid": "ce965d2da1963e9928313e0bf34ad0df",
"score": "0.5407838",
"text": "def test_border_5Vertices\n [@window, @sprite, @bitmap].each{|container|\n c = CPolygon.new(container, [[350,220],[375,200],[400,220],[390,250],[360,250]], nil, false, nil,\n 1, Color.hp_gauge_color1)\n c.draw()\n }\n return true\n end",
"title": ""
},
{
"docid": "11de9c3fa2e636fe92a18af5b29b6548",
"score": "0.53999466",
"text": "def test_is_polygon_api_example\n # For backwards compatibility, only run test if curve instance has\n # is_polygon? method\n if Sketchup::Curve.new().public_methods.include? \"is_polygon?\"\n assert_nothing_raised do\n # Create a polygon and check its edge\n ents = Sketchup.active_model.entities\n ents.add_ngon [0, 0, 0], [0, 0, 1], 10, 6\n curve = nil\n ents.each { |e| curve = e.curve if e.is_a? Sketchup::Edge }\n is_poly = curve.is_polygon?\n end\n end\n end",
"title": ""
},
{
"docid": "1705b3b301ee003da7b14c877f3e25f0",
"score": "0.53952926",
"text": "def draw w\r\n objects = []\r\n @map.each do |row|\r\n row.each do |tiles|\r\n tiles.each do |tile|\r\n next if !tile\r\n tile.is_ground? && w.draw(tile.sprite)\r\n end\r\n end\r\n end\r\n @skills.each do |x|\r\n x.draw w\r\n end\r\n @objects.each do |obj|\r\n w.draw obj.sprite\r\n if obj.class == Dude\r\n w.draw obj.hp_bar\r\n w.draw obj.hp_bar_outline\r\n end\r\n end\r\n end",
"title": ""
},
{
"docid": "da02a6116eb5c97d4229b275df0d3439",
"score": "0.53930485",
"text": "def is_cybox_object?\n namespace =~ /objects#/\n end",
"title": ""
},
{
"docid": "9470d7afa3acb3963a0d3395ef211e88",
"score": "0.5382467",
"text": "def has_drawing? # rubocop:disable Naming/PredicateName\n @drawing.is_a? Drawing\n end",
"title": ""
},
{
"docid": "49a39c4291459d484f9e1deae6dc46b8",
"score": "0.538213",
"text": "def hit_by?(obj)\n end",
"title": ""
},
{
"docid": "7d5ee806ee7623fc6da826e246d59dcc",
"score": "0.5371035",
"text": "def test_border\n [@window, @sprite, @bitmap].each{|container|\n c = CPolygon.new(container, [[0,50],[100,50],[100,100],[0,100]], Color.gauge_back_color, true, Color.gauge_back_color,\n 1, Color.hp_gauge_color1)\n c.draw()\n }\n return true\n end",
"title": ""
},
{
"docid": "726522a50e5ec4f7a359553fe554c8c1",
"score": "0.5361198",
"text": "def test_default_8Vertices\n [@window, @sprite, @bitmap].each{|container|\n c = CPolygon.new(container, [[400,285],[425,260],[450,260],[475,285],[475,310],[450,335],[425,335],[400,310]], Color.hp_gauge_color1)\n c.draw()\n }\n return true\n end",
"title": ""
},
{
"docid": "1a5e4f47f1df9933da0b85ba86eb9de0",
"score": "0.53514206",
"text": "def test_notFilled_inactiveBorder\n [@window, @sprite, @bitmap].each{|container|\n c = CPolygon.new(container, [[100,100],[200,100],[200,150],[100,150]], nil, false, nil,\n 1, Color.hp_gauge_color1)\n c.active = false\n c.draw()\n }\n return true\n end",
"title": ""
},
{
"docid": "0ebf0ccb136d1f24a3f7b3d76cdf5ed7",
"score": "0.53444874",
"text": "def test_notFilled_Border\n [@window, @sprite, @bitmap].each{|container|\n c = CEllipse.new(container, 50, 250, 50, 25, nil, false, nil,\n 1, Color.hp_gauge_color1)\n c.draw()\n }\n return true\n end",
"title": ""
},
{
"docid": "41e80390b9448a03a0bf726d19b3535a",
"score": "0.5335628",
"text": "def testRectangle\n model = Sketchup.active_model\n #entities = model.active_entities\n\n #model.materials.each {|x|\n # puts x\n #}\n\n d = Rectangle.new(50.mm, 400.mm, 1000.mm, Geom::Vector3d.new(10.mm, 10.mm, 10.mm), MaterialHandler.new([model.materials[0], model.materials[1]]))\n faces = d.draw(model)\nend",
"title": ""
},
{
"docid": "ae73bdeaa5533d7987404803cd0d9ca6",
"score": "0.5332346",
"text": "def test_inactiveBorder\n [@window, @sprite, @bitmap].each{|container|\n c = CPolygon.new(container, [[100,50],[200,50],[200,100],[100,100]], Color.gauge_back_color, true, Color.gauge_back_color,\n 1, Color.hp_gauge_color1)\n c.active = false\n c.draw()\n }\n return true\n end",
"title": ""
},
{
"docid": "edee81948265a4fd8a9354cd0f7f59f9",
"score": "0.53278637",
"text": "def test_default\n [@window, @sprite, @bitmap].each{|container|\n c = CEllipse.new(container, 50, 50, 50, 25, Color.hp_gauge_color1)\n c.draw()\n }\n return true\n end",
"title": ""
},
{
"docid": "120963abfabaf8ed724ea40e43f4a70a",
"score": "0.5322663",
"text": "def test_default_3Vertices\n [@window, @sprite, @bitmap].each{|container|\n c = CPolygon.new(container, [[0,200],[100,200],[50,250]], Color.hp_gauge_color1)\n c.draw()\n }\n return true\n end",
"title": ""
},
{
"docid": "0226797556ce80f6c0dae121cff8869b",
"score": "0.5315432",
"text": "def drawObjects painter\n\n # Paint backdrop \n painter.drawImage $back_drop_x, $back_drop_y, @back_drop\n \n # Paint buildings\n p=0\n q=0\n while p < $bldgs.count\n painter.drawImage $static_x[q], $static_y[q], $bldgs[p] unless $bldgs[p]==nil\n # Due to the way we store collison data, this logic ensures each building\n # is placed in the right place\n q+=( $bldgs[p].width / ( SPRITE_WIDTH / (ERR_TOLERANCE * 2 ) ) \\\n *( $bldgs[p].height / (SPRITE_HEIGHT / ( ERR_TOLERANCE * 2 ) ) ) )\n p+=1\n end \n \n # Paint player\n painter.drawImage $player_x[0], $player_y[0], @marine unless @just_shot==true && @shoot_dir==\"up\"\n \n # Paint beasties\n if $beast_hidden != 1\n $beasts.each { |active_beast|\n if $beast_life[active_beast] > 0\n painter.drawImage $beast_x[active_beast], $beast_y[active_beast], @beasty\n end\n }\n end\n \n # Paint bullets\n # (We don't currently set @shoot to false, only to true after first hit)\n if @shoot==true\n if $shots_direc.count != 0\n $shots_direc.keys.each {\n |i| painter.drawImage $player_x[i], $player_y[i], $pewpew_sprites[$shots_direc[i]] \\\n unless $shots_direc[i]==nil\n }\n end\n end \n \n # Paint shooting animation (if just_shot), has to be after bullet painting to prevent overlay\n if @just_shot==true\n case @shoot_dir\n when \"left\"\n print \"@shooty_sprite_left.height: \", $shooty_sprites[\"left\"].height, \"\\n\"\n display_x = 0 - $shooty_sprites[\"left\"].width\n display_y = ( SPRITE_HEIGHT / 2 - ( $shooty_sprites[\"left\"].height ) )\n @shooty_sprite=$shooty_sprites[\"left\"]\n when \"right\"\n display_x = SPRITE_WIDTH\n display_y = ( SPRITE_HEIGHT / 2 - ( $shooty_sprites[\"right\"].height ) ) \n @shooty_sprite=$shooty_sprites[\"right\"]\n when \"up\"\n display_x = ( SPRITE_WIDTH / 2 )\n\t display_y = 0 - $shooty_sprites[\"up\"].height + 12\n @shooty_sprite=$shooty_sprites[\"up\"]\n when \"down\"\n display_x= ( SPRITE_WIDTH / 2 )\n\t display_y= ( SPRITE_HEIGHT / 2 ) \n @shooty_sprite=$shooty_sprites[\"down\"]\n else\n end\n painter.drawImage $player_x[0] + display_x, $player_y[0] + display_y, @shooty_sprite\n painter.drawImage $player_x[0], $player_y[0], @marine if @shoot_dir==\"up\"\n end \n end",
"title": ""
},
{
"docid": "377ece4d5f0ce9fe0dbff55ba5dd41f8",
"score": "0.53121716",
"text": "def test_anyDirections\n [@window, @sprite, @bitmap].each{|container|\n c = CLine.new(container, 100, 150, 200, 150, Color.hp_gauge_color1)\n c.draw()\n c = CLine.new(container, 100, 125, 200, 175, Color.hp_gauge_color1)\n c.draw()\n c = CLine.new(container, 150, 125, 150, 175, Color.hp_gauge_color1)\n c.draw()\n c = CLine.new(container, 200, 125, 100, 175, Color.hp_gauge_color1)\n c.draw()\n }\n return true\n end",
"title": ""
},
{
"docid": "e4a0bf824cc52aea0ea289776fa8cc05",
"score": "0.5304853",
"text": "def test_border_3Vertices\n [@window, @sprite, @bitmap].each{|container|\n c = CPolygon.new(container, [[100,200],[200,200],[150,250]], nil, false, nil,\n 1, Color.hp_gauge_color1)\n c.draw()\n }\n return true\n end",
"title": ""
},
{
"docid": "4f6965af1b97346d38fa966b54ebb4ef",
"score": "0.5304678",
"text": "def graph_obj?() true end",
"title": ""
},
{
"docid": "aadd5f82ab82e5bf2f4e33497af701a4",
"score": "0.5300389",
"text": "def check_graphics\n graphics.each do |graphic|\n return false unless graphic.public || graphic.user == self.author\n end\n end",
"title": ""
},
{
"docid": "ee192f249868f505738b5680d6d6fd46",
"score": "0.529626",
"text": "def test_that_the_round_exists\n card_1 = Card.new(\"3\",\"Hearts\")\n card_2 = Card.new(\"4\", \"Clubs\")\n deck = Deck.new([card_1, card_2])\n round = Round.new(deck)\n assert_instance_of Deck, round.deck\n end",
"title": ""
},
{
"docid": "a94da92059c5968789b0feb2dc9f1c0c",
"score": "0.5292179",
"text": "def using_object_ids?\n self.class.using_object_ids?\n end",
"title": ""
},
{
"docid": "d271595a85ce21df64ab99814bc18047",
"score": "0.5281817",
"text": "def test_default\n [@window, @sprite, @bitmap].each{|container|\n c = CTriangle.new(container, 0, 0, 100, 0, 50, 50, Color.hp_gauge_color1)\n c.draw()\n }\n return true\n end",
"title": ""
},
{
"docid": "b0e2ef8b849bf538ebd271e746ed70e8",
"score": "0.5279919",
"text": "def __inside__\n @obj\n end",
"title": ""
},
{
"docid": "1bdfeb9b7a5704230f4cc19b1c18eabc",
"score": "0.52759033",
"text": "def test_border\n [@window, @sprite, @bitmap].each{|container|\n c = CEllipse.new(container, 50, 150, 50, 25, Color.gauge_back_color, true, Color.gauge_back_color,\n 1, Color.hp_gauge_color1)\n c.draw()\n }\n return true\n end",
"title": ""
},
{
"docid": "27f78b1452a69175e6c48126d50ec331",
"score": "0.527308",
"text": "def test_default\n [@window, @sprite, @bitmap].each{|container|\n c = CLine.new(container, 0, 25, 100, 25, Color.hp_gauge_color1)\n c.draw()\n }\n return true\n end",
"title": ""
},
{
"docid": "c54483a3cd8442ac16bb92e1d8492646",
"score": "0.5266477",
"text": "def owned_objects\n return @owned_objects\n end",
"title": ""
},
{
"docid": "c54483a3cd8442ac16bb92e1d8492646",
"score": "0.5266477",
"text": "def owned_objects\n return @owned_objects\n end",
"title": ""
},
{
"docid": "22aec10ee1be9de57f44f631a6920eb3",
"score": "0.52609193",
"text": "def special_objects\n @special_objects\n end",
"title": ""
},
{
"docid": "5c434a181c4f31087b74b929dab14b2c",
"score": "0.5259017",
"text": "def game_objects_of_class(klass)\n @game_objects.select { |game_object| game_object.is_a? klass }\n end",
"title": ""
},
{
"docid": "81ed9829f52efc487d4dd9e538f116a7",
"score": "0.52530324",
"text": "def test_inactive\n [@window, @sprite, @bitmap].each{|container|\n c = CPolygon.new(container, [[100,0],[200,0],[200,50],[100,50]], Color.hp_gauge_color1)\n c.active = false\n c.draw()\n }\n return true\n end",
"title": ""
},
{
"docid": "7dc20d076b688983067ee439223b4d1d",
"score": "0.5246707",
"text": "def draw_party_guests\n case Bubs::PartyGuests::GUEST_WINDOW_STYLE\n when 0\n draw_party_guest_faces\n when 1\n draw_party_guest_graphics\n end\n end",
"title": ""
},
{
"docid": "9a6ccf61ddc0df259faccc1bbdb617c7",
"score": "0.52457535",
"text": "def test_is_collected_by\n assert @nolan.magazines.empty?\n assert @make.readers.empty?\n assert_add_to_collection @nolan, :magazines, @make\n \n # Prevent duplicate records\n assert_no_difference @nolan.magazines, :size do\n @nolan.magazines << @make\n end\n \n # test the other end of the has_many association\n assert @make.readers(true).include?(@nolan)\n assert_equal 1, @make.readers.size\n # don't allow duplicate records\n assert_no_difference @make.readers, :size do\n @make.readers << @nolan\n end\n end",
"title": ""
},
{
"docid": "d522a5717f8c02b3ff2f893f516731c0",
"score": "0.5242182",
"text": "def test_notFilled_inactiveBorder\n [@window, @sprite, @bitmap].each{|container|\n c = CEllipse.new(container, 150, 250, 50, 25, nil, false, nil,\n 1, Color.hp_gauge_color1)\n c.active = false\n c.draw()\n }\n return true\n end",
"title": ""
},
{
"docid": "6a2ce255d3f414b44498148a1670e6d2",
"score": "0.52367187",
"text": "def graph_obj?(o)\n point?(o) or shape?(o)\nend",
"title": ""
},
{
"docid": "ba0996fbd9f656c52093506ca91a70c2",
"score": "0.5231104",
"text": "def draw(view)\r\n # Show the current input point\r\n if (@ip.valid? && @ip.display?)\r\n @ip.draw(view)\r\n @drawn = true\r\n end \r\n\r\n # draw the outline of the wall\r\n draw_outline(view, @wall.origin, @wall.endpt, @wall.width, @wall.justify, \"gray\")\r\n vec = @end_pt - @start_pt\r\n # draw the outline of each door and window\r\n @wall.objects.each do |obj|\r\n vec.length = obj.center_offset - obj.width/2\r\n obj_start = @wall.origin + vec\r\n vec.length = obj.width\r\n obj_end = obj_start + vec\r\n draw_outline(view, obj_start, obj_end, @wall.width, @wall.justify, \"gray\")\r\n end\r\n draw_outline(view, @start_pt, @end_pt, @wall.width, @wall.justify, \"orange\", 2)\r\n @drawn = true\r\nend",
"title": ""
},
{
"docid": "f8a60666c0cc4b1e1812e183457427d9",
"score": "0.5226677",
"text": "def isInside(dobj)\n return false if dobj.nil?\n\n p = @obj\n while p\n return true if p == dobj\n\n p = p.getParentObject\n end\n\n false\n end",
"title": ""
},
{
"docid": "5bd2f00cc14324719e02ef477c4021d8",
"score": "0.5224529",
"text": "def get_objects\n return @Backend.get_known_objects\n end",
"title": ""
},
{
"docid": "ab17147a612fd9015280aece92610425",
"score": "0.52116585",
"text": "def test_get_all\n item1 = @owner.create_item(\"testobject1\", 50, 1)\n item2 = Item.created(\"testobject2\", 50, @owner, 1, \"bla\")\n item2.save\n item3 = @owner.create_item(\"testobject3\", 50, 1)\n item1.active= true\n item2.active= true\n item3.active = false\n assert(Item.get_all(\"\").include?(item1), \"Active Items should be in the list\")\n assert(Item.get_all(\"\").include?(item2), \"Active Items should be in the list\")\n assert(!Item.get_all(\"\").include?(item3), \"Inactive Items should not be in the list\")\n assert(!Item.get_all(@owner.name).include?(item1), \"Items of the viewer parameter should not be in the list\")\n end",
"title": ""
},
{
"docid": "ec78484e7aecbf4570de6a67b0c543d7",
"score": "0.520963",
"text": "def avail_in(*) end",
"title": ""
},
{
"docid": "df61e3e506bb06e3330ccab99e82da8c",
"score": "0.5190128",
"text": "def objected?\n objections.count - objection_withdrawns.count > 0\n end",
"title": ""
},
{
"docid": "ead580c13242c4e9c98f817505fe23d7",
"score": "0.5188526",
"text": "def test_inactiveBorder\n [@window, @sprite, @bitmap].each{|container|\n c = CEllipse.new(container, 150, 150, 50, 25, Color.gauge_back_color, true, Color.gauge_back_color,\n 1, Color.hp_gauge_color1)\n c.active = false\n c.draw()\n }\n return true\n end",
"title": ""
},
{
"docid": "ecc36c3fb9f74fdce05687859030b9b0",
"score": "0.5179484",
"text": "def has_corners?\n\n component_def.entities.any? do |e|\n e.get_attribute(ATTR_DICT_PART, \"corner\") && e.get_attribute(ATTR_DICT_PART, \"name\")\n end\n\n end",
"title": ""
},
{
"docid": "4c0e656c6e5aeb773164038c8ff1caa9",
"score": "0.51692253",
"text": "def artists_with_paintings\n this_gallery_arr = Painting.all.select do |painting_ob|\n #binding.pry\n painting_ob.gallery == self\n end\n this_gallery_arr.map do |painting_ob|\n painting_ob.artist\n end\nend",
"title": ""
},
{
"docid": "c89474a98bd7842137b4f282e188d49b",
"score": "0.5159919",
"text": "def get_glued_instances\n end",
"title": ""
},
{
"docid": "c89474a98bd7842137b4f282e188d49b",
"score": "0.5159919",
"text": "def get_glued_instances\n end",
"title": ""
},
{
"docid": "f9bed75306c0700a43297a09b818b7bf",
"score": "0.51583153",
"text": "def test_border\n [@window, @sprite, @bitmap].each{|container|\n uc = UCBar.new(container, Rect.new(300, 0, 100, 24), Color.hp_gauge_color1, \n Color.hp_gauge_color2, Color.gauge_back_color, 10, 100, 1, Color.gauge_border_color)\n uc.draw()\n }\n return true\n end",
"title": ""
},
{
"docid": "773546bbc804ea8eaf668b77ea0fec7b",
"score": "0.51532096",
"text": "def owner?\n self.businesses.any?\n end",
"title": ""
},
{
"docid": "b74e133256262aab1f374273355b1607",
"score": "0.51515603",
"text": "def drawings\n Drawing.where(label: self)\n end",
"title": ""
},
{
"docid": "02b6ce1fd358abc9fee7d38453e18815",
"score": "0.51421756",
"text": "def objects\n @pdf.spatial_objects.reject { |type, _| not @pdf.explicit_call? type }\n end",
"title": ""
},
{
"docid": "28ac66a82fe38728eea4a9837e3bd6ac",
"score": "0.514027",
"text": "def child_objects; end",
"title": ""
},
{
"docid": "b27d4dd85adb9b0bc693b3f599180a06",
"score": "0.51342547",
"text": "def test_overdrawn_method_should_return_overdrawn_accounts\n od_checking = bank_accounts(:overdrawn_checking)\n od_savings = bank_accounts(:overdrawn_savings)\n assert_equal [od_checking, od_savings], BankAccount.overdrawn.find(:all, :order => 'type asc')\n assert_equal [od_checking], CheckingAccount.overdrawn\n assert_equal [od_savings], SavingsAccount.overdrawn\n end",
"title": ""
},
{
"docid": "ed45765bfbefbb5c45e34b93733c871a",
"score": "0.5131895",
"text": "def graph_obj?()\n self.point? or self.shape?\nend",
"title": ""
},
{
"docid": "acd5b14bb03afb47f9f30fccb3a29a98",
"score": "0.51296794",
"text": "def draw_object_effects\n for i in 0..Det_Config::OBJECT_DETAILS.size-1\n draw_effects(Det_Config::OBJECT_DETAILS[i])\n end\n end",
"title": ""
},
{
"docid": "86f5e7ae9af040449ea29e2f5cc6e884",
"score": "0.512912",
"text": "def test_default\n [@window, @sprite, @bitmap].each{|container|\n uc = UCBar.new(container, Rect.new(0, 0, 100, 24), Color.hp_gauge_color1, \n Color.hp_gauge_color2, Color.gauge_back_color, nil, nil)\n uc.draw()\n }\n return true\n end",
"title": ""
},
{
"docid": "b18c5ab6d5ecfa89758fb54cda0355f8",
"score": "0.5128854",
"text": "def oids; end",
"title": ""
},
{
"docid": "b18c5ab6d5ecfa89758fb54cda0355f8",
"score": "0.5128854",
"text": "def oids; end",
"title": ""
},
{
"docid": "d1c6eb6dcdbc269c5100d2db43dd3226",
"score": "0.51283985",
"text": "def summoned_object?\r\r\n return true\r\r\n end",
"title": ""
},
{
"docid": "f989bc7f3b7aae9a167a8ac1fb1cb7f1",
"score": "0.51241666",
"text": "def test_invisible\n [@window, @sprite, @bitmap].each{|container|\n c = CPolygon.new(container, [[200,0],[300,0],[300,50],[200,50]], Color.hp_gauge_color1)\n c.visible = false\n c.draw()\n }\n return true\n end",
"title": ""
},
{
"docid": "d41e19aac0260da323ad5411d86d49cb",
"score": "0.51152325",
"text": "def test_inactiveBorder\n [@window, @sprite, @bitmap].each{|container|\n uc = UCBar.new(container, Rect.new(200, 24, 100, 24), Color.hp_gauge_color1, \n Color.hp_gauge_color2, Color.gauge_back_color, 10, 100, 1, Color.gauge_border_color)\n uc.active = false\n uc.draw()\n }\n return true\n end",
"title": ""
},
{
"docid": "65276166fb18ace158ad2d82f0d9f142",
"score": "0.51096445",
"text": "def graphobj?(o)\n point?(o) or shape?(o)\n end",
"title": ""
},
{
"docid": "fee69243878e5b68be4a441d233634b7",
"score": "0.51082915",
"text": "def test_inactive\n [@window, @sprite, @bitmap].each{|container|\n c = CRectangle.new(container, Rect.new(100, 0, 100, 50), Color.hp_gauge_color1)\n c.active = false\n c.draw()\n }\n return true\n end",
"title": ""
},
{
"docid": "d322c51dde133937a0febe1d3529f83a",
"score": "0.51006526",
"text": "def artist_names_with_paintings\n artist_name_arr = Painting.all.select do |painting_ob|\n #binding.pry\n painting_ob.gallery == self\n end\n artist_name_arr.map do |painting_ob|\n painting_ob.artist.name\n end\nend",
"title": ""
},
{
"docid": "dd77ef51049eb4b4708c34e6a6b44a66",
"score": "0.509934",
"text": "def test_notFilled_Border\n [@window, @sprite, @bitmap].each{|container|\n c = CTriangle.new(container, 0, 100, 100, 100, 50, 150, nil, false, nil,\n 1, Color.hp_gauge_color1)\n c.draw()\n }\n return true\n end",
"title": ""
},
{
"docid": "b74d35f3af802ecd469f154578810cb7",
"score": "0.5098627",
"text": "def test_render_drawing_object\n filename = 'test_multi_pages.docx'\n remote_name = 'TestRenderDrawingObject.docx'\n index = 0\n format = 'png'\n\n st_request = PutCreateRequest.new remote_test_folder + test_folder + '/' + remote_name, File.open(local_common_folder + filename, \"r\").read\n @storage_api.put_create st_request\n\n request = RenderDrawingObjectRequest.new remote_name, format, index, remote_test_folder + test_folder, :node_path => 'sections/0'\n result = @words_api.render_drawing_object request\n assert result.length > 0, 'Error occurred while drawing object rendering'\n end",
"title": ""
},
{
"docid": "53b7e8820fed2c942220de4b753c43af",
"score": "0.5097486",
"text": "def paintings\n Painting.all.select{|painting_instance| painting_instance.gallery == self}\n end",
"title": ""
},
{
"docid": "12c4a520ce36d0ee4fd9fe4090b80235",
"score": "0.50925463",
"text": "def draw(view)\r\n # show the wall base outline\r\n\r\n # draw the outline of the wall\r\n @corners[0] = @wall.origin\r\n @corners[1] = @wall.endpt\r\n (a, b) = draw_outline(view, @corners[0], @corners[1], @wall.width, @wall.justify, \"gray\")\r\n # puts \"a = \" + a.inspect\r\n @corners[2] = b\r\n @corners[3] = a\r\n @corners[4] = @corners[0]\r\n vec = @corners[1] - @corners[0]\r\n @wall.objects.each do |obj|\r\n vec.length = obj.center_offset - obj.width/2\r\n obj_start = @wall.origin + vec\r\n vec.length = obj.width\r\n obj_end = obj_start + vec\r\n if (defined?(@selected_obj) && (obj == @selected_obj))\r\n if (@state != STATE_MOVING)\r\n draw_outline(view, obj_start, obj_end, @wall.width, @wall.justify, \"red\", 3)\r\n end\r\n else\r\n draw_outline(view, obj_start, obj_end, @wall.width, @wall.justify, \"gray\")\r\n end\r\n end\r\n if (@state == STATE_MOVING)\r\n draw_outline(view, @start_pt, @end_pt, @wall.width, @wall.justify, \"red\", 2)\r\n end\r\n \r\n @drawn = true\r\nend",
"title": ""
},
{
"docid": "05fe462ab8e05fffec57c7a0c5243f03",
"score": "0.5091532",
"text": "def create_objects\n $fork = GameObject.new(\n \"Fork\",\n \"This is a fork\",\n \"On the table, there is a fork.\",\n {},\n true,\n true\n )\n $bag = GameObject.new(\n \"Bag\",\n \"This is a bag\",\n \"There is a small bag on the floor.\",\n {},\n false,\n true\n )\n $balloon = GameObject.new(\n \"Balloon\",\n \"This is an inflated balloon\",\n \"A balloon is rolling on the floor.\",\n {},\n true,\n true\n )\n $punched_balloon = GameObject.new(\n \"Punched balloon\",\n \"It's a deflated balloon with a tiny hole in it\",\n \"\",\n {},\n false,\n false\n )\n $chest = GameObject.new(\n \"Chest\",\n \"A big chest, with an almost even bigger padlock on it.\",\n \"In the corner of the room is a big chest.\",\n {},\n false,\n true\n )\n $key = GameObject.new(\n \"Key\",\n \"A key, to open stuff.\",\n \"A small key lies on the floor.\",\n {},\n true,\n true\n )\n $ball = GameObject.new(\n \"Ball\",\n \"A ball.\",\n \"\",\n {},\n true,\n false\n )\nend",
"title": ""
},
{
"docid": "cae87276ef73ee21a672970c81a542f2",
"score": "0.5084403",
"text": "def my_paintings\n Painting.all.select do |painting|\n painting.artist == self\n end\n end",
"title": ""
},
{
"docid": "caaa12f31136d21545c3178804720f14",
"score": "0.5079995",
"text": "def test_inheritance_w_fixtures\n pp = PaperPile.find_by_name('Rooted Soot')\n assert pp.papers.size == 1\n end",
"title": ""
},
{
"docid": "989dc073f854d4f27ca027be239d6e62",
"score": "0.5079764",
"text": "def test_border\n [@window, @sprite, @bitmap].each{|container|\n c = CTriangle.new(container, 0, 50, 100, 50, 50, 100, Color.gauge_back_color, true, Color.gauge_back_color,\n 1, Color.hp_gauge_color1)\n c.draw()\n }\n return true\n end",
"title": ""
},
{
"docid": "5233ea6ad11b11fd319d4a4c9e896c3f",
"score": "0.50797635",
"text": "def test_notFilled_inactiveBorder\n [@window, @sprite, @bitmap].each{|container|\n c = CTriangle.new(container, 100, 100, 200, 100, 150, 150, nil, false, nil,\n 1, Color.hp_gauge_color1)\n c.active = false\n c.draw()\n }\n return true\n end",
"title": ""
},
{
"docid": "e40fab65c287d466794ae12517323978",
"score": "0.50770336",
"text": "def owns?(object); object.owners.include?(self) end",
"title": ""
}
] |
3d1afdfcb03b8d6dbcc7fd74d177adff | PATCH/PUT /tuition_statuses/1 PATCH/PUT /tuition_statuses/1.json | [
{
"docid": "e687b32242f4ecac9a8607da1aa489da",
"score": "0.6785879",
"text": "def update\n respond_to do |format|\n if @tuition_status.update(tuition_status_params)\n format.html { redirect_to @tuition_status, notice: 'Tuition status was successfully updated.' }\n format.json { render :show, status: :ok, location: @tuition_status }\n else\n format.html { render :edit }\n format.json { render json: @tuition_status.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] | [
{
"docid": "b212ededef956ae42fe3057638e2e119",
"score": "0.6890222",
"text": "def update\n @status = current_user.statuses.find(params[:id])\n if params[:status] && params[:status].has_key?(:user_id)\n params[:status].delete(:user_id) \n end\n respond_to do |format|\n if @status.update_attributes(params[:status])\n format.html { redirect_to @status, notice: 'Ticket was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @status.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3eee5d854667c02d6591db136fdc5ae9",
"score": "0.6771677",
"text": "def update\n @status = current_user.statuses.find(params[:id])\n if params[:status] && params[:status].has_key?(:user_id)\n params[:status].delete(:user_id)\n end\n respond_to do |format|\n if @status.update_attributes(params[:status])\n current_user.create_activity(@status, 'updated')\n format.html { redirect_to statuses_url, notice: 'Status was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @status.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "246db776af7b0ec1e5b05763c0f81ce7",
"score": "0.6750026",
"text": "def update!(**args)\n @statuses = args[:statuses] if args.key?(:statuses)\n end",
"title": ""
},
{
"docid": "246db776af7b0ec1e5b05763c0f81ce7",
"score": "0.6750026",
"text": "def update!(**args)\n @statuses = args[:statuses] if args.key?(:statuses)\n end",
"title": ""
},
{
"docid": "1bd42c75551db34c318863228bd5baf6",
"score": "0.6660894",
"text": "def update\n @status = current_user.statuses.find(params[:id])\n\n respond_to do |format|\n if status_params && @status.update(status_params)\n format.html { redirect_to @status, notice: 'Status was successfully updated.' }\n format.json { render :show, status: :ok, location: @status }\n else\n format.html { render :edit }\n format.json { render json: @status.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9972ef5265812d3620198aa9947e97d6",
"score": "0.6580615",
"text": "def tweet(status)\n @client.update(status)\n end",
"title": ""
},
{
"docid": "6eab2a68e363715f605515f0ecaade02",
"score": "0.64665496",
"text": "def update\n respond_to do |format|\n if @tcstatus.update(tcstatus_params)\n format.html { redirect_to @tcstatus, notice: 'Tcstatus was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @tcstatus.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "54c4ec5aabd6e652c8b7f4e777021c5a",
"score": "0.6404332",
"text": "def update\n params[:status][:tag_ids] ||= []\n @status = current_user.statuses.find(params[:id])\n\n respond_to do |format|\n if @status.update_attributes(params[:status])\n format.html { redirect_to filmy_path, notice: 'Zmodyfikowano dane o filmie.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\", notice: 'Nie zmodyfikowano danych o filmie. Spróbuj ponownie.' }\n format.json { render json: @status.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0e6afea47a1660b36970af1b8b54c656",
"score": "0.638578",
"text": "def update\n @status = current_user.statuses.find(params[:id])\n\n respond_to do |format|\n if @status.update_attributes(params[:status])\n flash[:notice] = 'Status was successfully updated.'\n format.html { redirect_to(@status) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @status.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "eaa7fbc296dce5de9cb3d60fb5029bd8",
"score": "0.6369959",
"text": "def update\n @todo_status = TodoStatus.find(params[:id])\n\n respond_to do |format|\n if @todo_status.update_attributes(params[:todo_status])\n format.html { redirect_to @todo_status, notice: 'Todo status was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @todo_status.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "32f1723432e70ed28a613c04078a6da7",
"score": "0.636138",
"text": "def update_status!( status , in_reply_to_status_id = nil )\n\t\tbegin\n\t\t\tif in_reply_to_status_id\n\t\t\t\tresponse = access_token.post('/statuses/update.json', { :status => status, :in_reply_to_status_id => in_reply_to_status_id })\n\t\t\telse\n\t\t\t\tresponse = access_token.post('/statuses/update.json', { :status => status })\n\t\t\tend\n\t\t\tcase response\n\t\t\twhen Net::HTTPSuccess\n\t\t\t\tmessage=JSON.parse(response.body)\n\t\t\t\traise TwitterOauth::UnexpectedResponse unless message.is_a? Hash\n\t\t\t\tmessage\n\t\t\telse\n\t\t\t\traise TwitterOauth::APIError\n\t\t\tend\n\t\trescue => err\n\t\t\tputs \"Exception in update_status!: #{err}\"\n\t\t\traise err\n\t\tend\n\tend",
"title": ""
},
{
"docid": "27f14629cb038dac9384c8bf20a06dd3",
"score": "0.6320313",
"text": "def update\n @status = Status.find(params[:id])\n\n if @status.update(params[:status])\n head :no_content\n else\n render json: @status.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "51e5c2209003fffb41fe914390f48674",
"score": "0.6317901",
"text": "def update\n @tweet = Tweet.find(params[:id])\n @username = User.find(session[:user_id]).username\n \n respond_to do |format|\n if @tweet.update_attributes(:sentiment=>params[:tweet][:sentiment],:username=>@username)\n format.html { redirect_to '/', notice: 'Tweet was successfully classified as #{{-1=>\"not sure\",0=>\"negative\",1=>\"positive\"}[params[:tweet][:sentiment]]}.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @tweet.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f428f462359b707aa52192b951a48aef",
"score": "0.6304848",
"text": "def update\n if @status.update(status_params)\n render json: @status, status: :ok\n else\n render json: @status.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "8e24ee85e51bc916fe41fd10a0423e1f",
"score": "0.6281248",
"text": "def update\n respond_to do |format|\n if @status.update(base_status_params)\n format.html { redirect_to base_statuses_url, notice: 'Approval type was successfully updated.' }\n format.json { render :show, status: :ok, location: @status }\n else\n @statuses = BaseStatus.all.map{ |c| c = (c.id == @status.id)? @status:c}\n @status = BaseStatus.new\n format.html { render :index }\n format.json { render json: @status.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8a88b5766fd34d1c68d639ce7a2e2a40",
"score": "0.6271114",
"text": "def update_appointment_status\n\t\tid = params[:id]\n\t\t#user_token = params[:user_token]\n\t\tappointment_status = params[:appointment_status]\n\n\t\turl = \"https://sdpm-appointment-service.herokuapp.com/appointment/#{id}?appointment_status=#{appointment_status}\"\n\n\t\tresponse = RestClient::Request.execute(\n \t\tmethod: :put, \n \t\t\turl: url\n\t\t)\n\n\t\trender :json => response\n\tend",
"title": ""
},
{
"docid": "35a7afa1f2853d631014c55d28b64f02",
"score": "0.62698686",
"text": "def update\n respond_to do |format|\n if @task_status.update(task_status_params)\n format.html { redirect_to task_status_url(@task_status), notice: \"Task status was successfully updated.\" }\n format.json { render :show, status: :ok, location: @task_status }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @task_status.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b66b666e52e16592ab89b416b2257a88",
"score": "0.6256101",
"text": "def update\n # find the status within current user's scope\n @status = current_user.statuses.find(params[:id])\n\n # :status is a required in params (see status_params below), so we'd get an exception prior to this block\n if !params[:status]\n respond_to do |format|\n format.html { redirect_to @status, notice: 'Nothing to update.' }\n format.json { head :no_content }\n return\n end\n end\n\n # filter out any potentially malicious user_id injected into our status parameters\n params[:status].delete(:user_id) if params[:status].has_key?(:user_id)\n\n respond_to do |format|\n if @status.update(status_params)\n format.html { redirect_to @status, notice: 'Status was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @status.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "34d831db7d39cc32bfbc3860966fb4ef",
"score": "0.625099",
"text": "def update_status(payload, status)\n sha = payload.after\n repo = payload.repository.full_name\n state, description = status.first\n\n # setup http post\n uri = URI.parse(\"#{GITHUB_ROOT}/repos/#{repo}/statuses/#{sha}\")\n http = Net::HTTP.new(uri.host, uri.port)\n http.use_ssl = true\n\n # post to GitHub\n params = {:state => state, :description => description, :context => CONTEXT}\n http.post(uri.path, params.to_json, HEADERS)\nend",
"title": ""
},
{
"docid": "3c73942b6b062c3383b141bd23bc218a",
"score": "0.62365925",
"text": "def update_twitter_status!( status , in_reply_to_status_id = nil )\n self.twitagent.update_twitter_status!( status , in_reply_to_status_id )\n rescue => err\n # The user might have rejected this application. Or there was some other error during the request.\n RAILS_DEFAULT_LOGGER.error \"#{err.message} Failed update twitter status\"\n return\n end",
"title": ""
},
{
"docid": "1e6b3492eabde6e3de492781ea91521c",
"score": "0.62237227",
"text": "def update_tickets_status(id, status)\n request = prepare_request(id)\n request.body = \"<ticket><status type='integer'>#{get_id_from_status(status)}</status></ticket>\"\n send_request(request)\n end",
"title": ""
},
{
"docid": "e6c6751d2b7f74c60b9699ac158412fc",
"score": "0.6221496",
"text": "def update\n\n\n respond_to do |format|\n if @status.update_attributes(status_params)\n format.html { redirect_to @status, notice: 'Status was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @status.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d95bf51a09a4e312932d6ffdf8fd568d",
"score": "0.62116426",
"text": "def update\n\t\trespond_to do |format|\n\t\t\tif @ustatus.update(ustatus_params)\n\t\t\t\tformat.html { redirect_to @ustatus, notice: 'Ustatus was successfully updated.' }\n\t\t\t\tformat.json { render :show, status: :ok, location: @ustatus }\n\t\t\telse\n\t\t\t\tformat.html { render :edit }\n\t\t\t\tformat.json { render json: @ustatus.errors, status: :unprocessable_entity }\n\t\t\tend\n\t\tend\n\tend",
"title": ""
},
{
"docid": "3113c6e67835cab9bd00e938f0da510e",
"score": "0.6206857",
"text": "def update\n @httpstatus = Httpstatus.find(params[:id])\n\n respond_to do |format|\n if @httpstatus.update_attributes(params[:httpstatus])\n format.html { redirect_to @httpstatus, notice: 'Httpstatus was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @httpstatus.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "dc38e7fb0cb7f1aa8cab1055e2337a01",
"score": "0.62034875",
"text": "def update\n respond_to do |format|\n if @status.update_attributes(status_params)\n format.html { redirect_to @status, notice: 'Status was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @status.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a5a506beda2fb3f8558a6a247b41525d",
"score": "0.6200729",
"text": "def update\n @status = Status.find(params[:id])\n respond_to do |format|\n if @status.update_attributes(params[:status].except(:position, :isoform_ids, :reagent_id))\n format.html { redirect_to @status, notice: 'Status was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @status.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b906c1de550969044571173bf0038aff",
"score": "0.61981815",
"text": "def update\n if @statu.update(status_params)\n render json: @statu\n # 'Status was successfully updated.'\n else\n render json: @statu.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "1ea2699908111e94ce9efcc6970f9ac9",
"score": "0.6194378",
"text": "def update\n @status = Status.find(params[:id])\n\n respond_to do |format|\n if @status.update_attributes(params[:status])\n format.html { redirect_to @status, notice: t(:status_updated) }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @status.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7b6c801579f7592abc806311cc73146f",
"score": "0.6189012",
"text": "def update\n @custom_tweet = CustomTweet.find(params[:id])\n\n respond_to do |format|\n if @custom_tweet.update_attributes(params[:custom_tweet])\n format.html { redirect_to @custom_tweet, notice: 'Custom tweet was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @custom_tweet.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2e86e18d22f1546b774f2128616bb6a6",
"score": "0.6180516",
"text": "def update\n @status = Status.find(params[:id])\n \n respond_to do |format|\n if @status.update(status_params)\n format.html { redirect_to @status, notice: 'Status was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @status.errors, status: :unprocessable_entity }\n end\n \n end\n end",
"title": ""
},
{
"docid": "6a4f4c183be5c69a06b13f9b953a2e0c",
"score": "0.6167405",
"text": "def update\n respond_to do |format|\n if @sulabh_request_status.update(sulabh_request_status_params)\n format.html { redirect_to @sulabh_request_status, notice: 'Sulabh request status was successfully updated.' }\n format.json { render :show, status: :ok, location: @sulabh_request_status }\n else\n format.html { render :edit }\n format.json { render json: @sulabh_request_status.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "77061d1957e824eea012e0195c8a8459",
"score": "0.615877",
"text": "def update\n respond_to do |format|\n if @trstatus.update(trstatus_params)\n format.html { redirect_to @trstatus, notice: 'Trstatus was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @trstatus.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6581e786bedacd3ddf1202f1cfe0786d",
"score": "0.61498874",
"text": "def update\n @tweet = Tweet.find(params[:id])\n\n if @tweet.update(tweet_params)\n head :no_content\n else\n render json: @tweet.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "02723c47336e5c8068d54104840cc156",
"score": "0.6149131",
"text": "def update\n @status = Status.find(params[:id])\n\n respond_to do |format|\n if @status.update_attributes(params[:status])\n format.html { redirect_to @status, notice: 'Status was successfully updated.' }\n format.json { head :no_content }\nelse\n format.html { render action: \"edit\" }\n format.json { render json: @status.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "493bf63544ba4fcf060ba74b4043fda1",
"score": "0.6145542",
"text": "def update\n @status_ticket = StatusTicket.find(params[:id])\n\n respond_to do |format|\n if @status_ticket.update_attributes(params[:status_ticket])\n format.html { redirect_to(@status_ticket, :notice => 'Status ticket was successfully updated.') }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @status_ticket.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "58650b5dd1e7cde8ee6610fa37b50ba1",
"score": "0.61327285",
"text": "def update\n respond_to do |format|\n if @trump_tweet.update(trump_tweet_params)\n format.html { redirect_to @trump_tweet, notice: 'Trump tweet was successfully updated.' }\n format.json { render :show, status: :ok, location: @trump_tweet }\n else\n format.html { render :edit }\n format.json { render json: @trump_tweet.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2c7aa5e0f13e515978f5631d33b115ad",
"score": "0.61299086",
"text": "def update_status!( status , in_reply_to_status_id = nil )\n self.twitagent.update_status!( status , in_reply_to_status_id )\n rescue => err\n # The user might have rejected this application. Or there was some other error during the request.\n Rails.logger.info \"#{err.message} Failed update status\"\n return\n end",
"title": ""
},
{
"docid": "6195e18c995b5a68288fceccda25790e",
"score": "0.612407",
"text": "def update\n @status = Status.find(params[:id])\n\n respond_to do |format|\n if @status.update_attributes(params[:status])\n format.html { redirect_to @status, notice: 'Status was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @status.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6195e18c995b5a68288fceccda25790e",
"score": "0.6122992",
"text": "def update\n @status = Status.find(params[:id])\n\n respond_to do |format|\n if @status.update_attributes(params[:status])\n format.html { redirect_to @status, notice: 'Status was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @status.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6195e18c995b5a68288fceccda25790e",
"score": "0.6122992",
"text": "def update\n @status = Status.find(params[:id])\n\n respond_to do |format|\n if @status.update_attributes(params[:status])\n format.html { redirect_to @status, notice: 'Status was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @status.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6195e18c995b5a68288fceccda25790e",
"score": "0.6122992",
"text": "def update\n @status = Status.find(params[:id])\n\n respond_to do |format|\n if @status.update_attributes(params[:status])\n format.html { redirect_to @status, notice: 'Status was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @status.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6195e18c995b5a68288fceccda25790e",
"score": "0.6122992",
"text": "def update\n @status = Status.find(params[:id])\n\n respond_to do |format|\n if @status.update_attributes(params[:status])\n format.html { redirect_to @status, notice: 'Status was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @status.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "581c57b3a158f0f5793a74e6c241f78e",
"score": "0.61114115",
"text": "def update_status(status, reply_id = nil)\n return 'status must been less than 140 characters.' if status.length > 140\n return 'status must have at least one character.' if status.length < 1\n return 'at first you must been logged in' if !@username and !@password\n \n api_url = 'http://renoter.com/statuses/update.json'\n url = URI.parse(api_url)\n request = Net::HTTP::Post.new(url.path)\n request.basic_auth(@username, @password)\n request.set_form_data({'status'=> status, 'in_reply_to_status_id' => reply_id})\n response = Net::HTTP.new(url.host, url.port).start {|http| http.request(request) }\n JSON.parse response.body\n end",
"title": ""
},
{
"docid": "cd75eb71c5b4284f793eb23360712dda",
"score": "0.6110477",
"text": "def update\n respond_to do |format|\n if @pending_toot.update(pending_toot_params)\n format.html { redirect_to @pending_toot, notice: 'Pending toot was successfully updated.' }\n format.json { render :show, status: :ok, location: @pending_toot }\n else\n format.html { render :edit }\n format.json { render json: @pending_toot.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d0fbe8585bd60d85fc51f5612a5acf2c",
"score": "0.6089608",
"text": "def update\n @special_status = SpecialStatus.find(params[:id])\n\n respond_to do |format|\n if @special_status.update_attributes(params[:special_status])\n format.html { redirect_to @special_status, notice: 'Special status was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @special_status.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1d34d40d70a481abf0a5aaf6a19ea2ad",
"score": "0.60859966",
"text": "def update\n respond_to do |format|\n @statuses = Project.statuses.keys\n if @project.update(project_params)\n format.html { redirect_to edit_project_path(@project), notice: 'Project was successfully updated.' }\n format.json { render :show, status: :ok, location: @project }\n else\n format.html { render :edit }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d28e7f870c1ce945d14e66031428abcb",
"score": "0.60790527",
"text": "def update\n @sample = Sample.find(params[:id])\n get_statuses(@sample)\n \n respond_to do |format|\n if @sample.update_attributes(params[:sample])\n flash[:notice] = 'Sample was successfully updated.'\n format.html { redirect_to sample_url(@sample) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @sample.errors.to_xml }\n end\n end\n end",
"title": ""
},
{
"docid": "0f6b06b74f56b02fb60743f704fbd6ca",
"score": "0.6064784",
"text": "def update\n @status = current_account.statuses.find(params[:id])\n if @status.update_attributes(params[:status])\n flash[:notice] = 'Status was successfully updated.'\n redirect_to(statuses_path)\n else\n render :action => \"edit\"\n end\nend",
"title": ""
},
{
"docid": "376770d4daf61e7c7c7d4873be1c38b4",
"score": "0.6063628",
"text": "def test_should_update_status_post_via_API_JSON\r\n get \"/logout\"\r\n put \"/status_posts/1.json\", :api_key => 'testapikey',\r\n :status_post => {:body => 'API Status Post 1' }\r\n assert_response :success\r\n end",
"title": ""
},
{
"docid": "ed469b09e913d34dd95570a5364f5729",
"score": "0.60635406",
"text": "def update\n respond_to do |format|\n if @tipoestatus.update(tipoestatus_params)\n format.html { redirect_to @tipoestatus, notice: 'Tipoestatus was successfully updated.' }\n format.json { render :show, status: :ok, location: @tipoestatus }\n else\n format.html { render :edit }\n format.json { render json: @tipoestatus.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7b538d0d2d05e2f3dce12dbb8c2cf1f8",
"score": "0.6062649",
"text": "def update\n begin\n todo = Todo.find(params[:id])\n\n if todo_params[:subject] != '' && (todo_params[:status] == 'pending' || todo_params[:status] == 'done' || todo_params[:status].nil?)\n todo.update_attributes(todo_params)\n result = { notice: 'Successfully updated.' }\n status = 200\n else\n result = {\n notice: 'Cannot update!!', \n message: \"Please define the subject, and status must be 'pending' or 'done'.\" \n }\n\n status = 400\n end\n rescue => ex\n result = {\n notice: 'Cannot update!!'\n }\n\n status = 400\n end\n\n respond_to do |format|\n format.html { render :json => result, :status => status }\n format.json { render :json => result, :status => status }\n end\n end",
"title": ""
},
{
"docid": "2ed8661cdb0bc9b079e2c106b16914f7",
"score": "0.6061392",
"text": "def update\n respond_to do |format|\n if @train_status.update(train_status_params)\n format.html { redirect_to @train_status, notice: 'Train status was successfully updated.' }\n format.json { render :show, status: :ok, location: @train_status }\n else\n format.html { render :edit }\n format.json { render json: @train_status.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "fae0d6c3190be4c7a1f8d582222e3d4d",
"score": "0.60559374",
"text": "def update\n respond_to do |format|\n if @status.update(status_params)\n format.html { redirect_to @status, notice: 'Status was successfully updated.' }\n format.json { render :show, status: :ok, location: @status }\n else\n format.html { render :edit }\n format.json { render json: @status.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "fae0d6c3190be4c7a1f8d582222e3d4d",
"score": "0.60559374",
"text": "def update\n respond_to do |format|\n if @status.update(status_params)\n format.html { redirect_to @status, notice: 'Status was successfully updated.' }\n format.json { render :show, status: :ok, location: @status }\n else\n format.html { render :edit }\n format.json { render json: @status.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "fae0d6c3190be4c7a1f8d582222e3d4d",
"score": "0.60559374",
"text": "def update\n respond_to do |format|\n if @status.update(status_params)\n format.html { redirect_to @status, notice: 'Status was successfully updated.' }\n format.json { render :show, status: :ok, location: @status }\n else\n format.html { render :edit }\n format.json { render json: @status.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "fae0d6c3190be4c7a1f8d582222e3d4d",
"score": "0.60559374",
"text": "def update\n respond_to do |format|\n if @status.update(status_params)\n format.html { redirect_to @status, notice: 'Status was successfully updated.' }\n format.json { render :show, status: :ok, location: @status }\n else\n format.html { render :edit }\n format.json { render json: @status.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "fae0d6c3190be4c7a1f8d582222e3d4d",
"score": "0.60559374",
"text": "def update\n respond_to do |format|\n if @status.update(status_params)\n format.html { redirect_to @status, notice: 'Status was successfully updated.' }\n format.json { render :show, status: :ok, location: @status }\n else\n format.html { render :edit }\n format.json { render json: @status.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "fae0d6c3190be4c7a1f8d582222e3d4d",
"score": "0.60555655",
"text": "def update\n respond_to do |format|\n if @status.update(status_params)\n format.html { redirect_to @status, notice: 'Status was successfully updated.' }\n format.json { render :show, status: :ok, location: @status }\n else\n format.html { render :edit }\n format.json { render json: @status.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6e500cb76bff41458855a2a1866c6bb6",
"score": "0.60545534",
"text": "def update\n @status_test = StatusTest.find(params[:id])\n\n respond_to do |format|\n if @status_test.update_attributes(params[:status_test])\n format.html { redirect_to @status_test, notice: 'Status test was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @status_test.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "14e314e753d45482277b5ba71a12357a",
"score": "0.60532904",
"text": "def update\r\n respond_to do |format|\r\n origin_params = tactic_task_params\r\n origin_params[\"finished_time\"] = Time.now if origin_params[\"status\"] == \"已完成\"\r\n if @tactic_task.update(origin_params)\r\n format.json { render json: {\r\n msg: \"更新成功!\",\r\n success: true,\r\n data: {\r\n headers: TacticTask.attribute_names,\r\n task: @tactic_task\r\n }\r\n }\r\n }\r\n format.html{ redirect_to position_decisions_path, notice: \"更新成功\"}\r\n else\r\n format.any { render json: {msg: \"更新失败!\", success: false}, status: :unprocessable_entity}\r\n end\r\n end\r\n end",
"title": ""
},
{
"docid": "ce59e1bee85048bb5a0bcfc2572a9bae",
"score": "0.60500836",
"text": "def update_status()\n path = '/account/status'\n\n params = {\n }\n \n headers = {\n \"content-type\": 'application/json',\n }\n\n @client.call(\n method: 'PATCH',\n path: path,\n headers: headers,\n params: params,\n response_type: Models::User\n )\n end",
"title": ""
},
{
"docid": "a852650cb5490e857d767ca85d617a92",
"score": "0.6041854",
"text": "def update\n tweet = Tweet.find(params[:id])\n tweet.update(tweet_params)\n render(json: {tweet: tweet}, status: 201)\n end",
"title": ""
},
{
"docid": "7b0c2bf73689354acd925af5f5d51973",
"score": "0.6038775",
"text": "def update\n @add_status = AddStatus.find(params[:id])\n\n respond_to do |format|\n if @add_status.update_attributes(params[:add_status])\n format.html { redirect_to @add_status, :notice => 'Add status was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @add_status.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "845196de744c72327ac306a4f6f1e15c",
"score": "0.603679",
"text": "def update\n respond_to do |format|\n if @status.update(status_params)\n format.html { redirect_to @status, notice: \"Status was successfully updated.\" }\n format.json { render :show, status: :ok, location: @status }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @status.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "739ed167429c4dfcd6a26537d2638b70",
"score": "0.6036659",
"text": "def update\n respond_to do |format|\n if @tweet.update(tweet_params)\n format.html { redirect_to tweets_path, notice: t('tweet_update_success')}\n format.json { head :no_content }\n else\n format.html { redirect_to tweets_path }\n format.json { render json: @tweet.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b5bfe79eee9498431063cc499bf77615",
"score": "0.6032467",
"text": "def post_status_updates(options={})\n post(\"1/status_updates\", options, :format => :json, :phoenix => true)\n end",
"title": ""
},
{
"docid": "db280714f42b83990a69be8fef41b8de",
"score": "0.6018927",
"text": "def update\n respond_to do |format|\n if @api_v1_pending.update(api_v1_pending_params)\n format.html { redirect_to @api_v1_pending, notice: 'Pending was successfully updated.' }\n format.json { render :show, status: :ok, location: @api_v1_pending }\n else\n format.html { render :edit }\n format.json { render json: @api_v1_pending.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0eb8e6c83b0244f8817c55ecf146efae",
"score": "0.6013746",
"text": "def update\n @thief_talent = ThiefTalent.find(params[:id])\n\n if @thief_talent.update(thief_talent_params)\n head :no_content\n else\n render json: @thief_talent.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "b1f967561d2a983000bedcc94925bd70",
"score": "0.6013641",
"text": "def update\n @activity_tweet = ActivityTweet.find(params[:id])\n\n respond_to do |format|\n if @activity_tweet.update_attributes(params[:activity_tweet])\n format.html { redirect_to @activity_tweet, notice: 'Activity tweet was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @activity_tweet.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3fb4d0cfee0cb4dd2801ee0bcd6c918b",
"score": "0.6011817",
"text": "def update_with_status(params)\r\n # Check if status has just been switched to cancelled\r\n if params[:status] == 'cancelled'\r\n cancel\r\n end\r\n\r\n self.update params\r\n end",
"title": ""
},
{
"docid": "f1fd35125a835d451cd3b3eb3273fbd2",
"score": "0.6011669",
"text": "def update\n respond_to do |format|\n if @user_workflow_status.update(user_workflow_status_params)\n format.html { redirect_to @user_workflow_status, notice: 'User workflow status was successfully updated.' }\n format.json { render :show, status: :ok, location: @user_workflow_status }\n else\n format.html { render :edit }\n format.json { render json: @user_workflow_status.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1047449e243f3c610d656dd97775705d",
"score": "0.60035616",
"text": "def update\n @tweet = Tweet.find(params[:id])\n\n respond_to do |format|\n if @tweet.update_attributes(params[:tweet])\n format.html { redirect_to @tweet, notice: 'Tweet was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @tweet.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1047449e243f3c610d656dd97775705d",
"score": "0.60035616",
"text": "def update\n @tweet = Tweet.find(params[:id])\n\n respond_to do |format|\n if @tweet.update_attributes(params[:tweet])\n format.html { redirect_to @tweet, notice: 'Tweet was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @tweet.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1047449e243f3c610d656dd97775705d",
"score": "0.60035616",
"text": "def update\n @tweet = Tweet.find(params[:id])\n\n respond_to do |format|\n if @tweet.update_attributes(params[:tweet])\n format.html { redirect_to @tweet, notice: 'Tweet was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @tweet.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1047449e243f3c610d656dd97775705d",
"score": "0.60035616",
"text": "def update\n @tweet = Tweet.find(params[:id])\n\n respond_to do |format|\n if @tweet.update_attributes(params[:tweet])\n format.html { redirect_to @tweet, notice: 'Tweet was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @tweet.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "fc49a0e5e6dd2d63640473f8e94e829b",
"score": "0.5999776",
"text": "def update\n @status = Status.find(params[:id])\n\n respond_to do |format|\n if @status.update_attributes(params[:status])\n flash[:notice] = 'Status was successfully updated.'\n format.html { redirect_to('/statuses') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @status.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8326f5a83173289349d530c2435dea5a",
"score": "0.5991896",
"text": "def update\n logger.debug \"debug:params=#{params.inspect}\"\n @app_status = AppStatus.find(params[:id].to_i)\n @app_status.status_name = params[:status_name]\n @app_status.follow_up = params[:follow_up].to_i\n\n respond_to do |format|\n if @app_status.update(app_status_params)\n format.html { redirect_to app_statuses_url, notice: 'App status was successfully updated.' }\n format.json { render :show, status: :ok, location: @app_status }\n else\n format.html { render :edit }\n format.json { render json: @app_status.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "cfea2077e3513a78aaef5ddbf69e9d18",
"score": "0.59882843",
"text": "def update\n respond_to do |format|\n if @barangay_lti_status.update(barangay_lti_status_params)\n format.html { redirect_to @barangay_lti_status, notice: 'Barangay lti status was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @barangay_lti_status.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "21748cf65af23111e0d1fa7a6cc05832",
"score": "0.59859",
"text": "def update\n @tweet = Tweet.find(params[:id])\n\n respond_to do |format|\n if @tweet.update_attributes(params[:tweet])\n format.html { redirect_to @tweet, notice: 'Tweet was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @tweet.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "21748cf65af23111e0d1fa7a6cc05832",
"score": "0.59859",
"text": "def update\n @tweet = Tweet.find(params[:id])\n\n respond_to do |format|\n if @tweet.update_attributes(params[:tweet])\n format.html { redirect_to @tweet, notice: 'Tweet was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @tweet.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1a1bdff483fbcbc68600326c2bd3baf8",
"score": "0.59830457",
"text": "def update\n @tweet = Tweet.find(params[:id])\n \n respond_to do |format|\n if @tweet.update_attributes(params[:tweet])\n format.html { redirect_to home_path }\n format.json { head :no_content }\n else\n format.html { redirect_to home_path, alert:'Error saving tweet' }\n format.json { render json: @tweet.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4373ed1b58765d39c1305133c63f4088",
"score": "0.5982607",
"text": "def update\n @breadcrumb = 'update'\n @ticket_status = TicketStatus.find(params[:id])\n @ticket_status.updated_by = current_user.id if !current_user.nil?\n\n respond_to do |format|\n if @ticket_status.update_attributes(params[:ticket_status])\n format.html { redirect_to @ticket_status,\n notice: (crud_notice('updated', @ticket_status) + \"#{undo_link(@ticket_status)}\").html_safe }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @ticket_status.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "18f285b1d02c52b1fd77d66a86b78aad",
"score": "0.598192",
"text": "def update\n @tweet = Tweet.find(params[:id])\n\n respond_to do |format|\n if @tweet.update_attributes(params[:tweet])\n format.html { redirect_to tweets_url, notice: 'Tweet was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @tweet.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "658a5ef4bcb33c36e5b5f51bdd84fe00",
"score": "0.59707475",
"text": "def update_status\n update status: current_status! unless (id.present? && status.to_sym == current_status!)\n end",
"title": ""
},
{
"docid": "d185856e4b16343baa71bbfa6ff29f5f",
"score": "0.59690803",
"text": "def update\n @status_update = StatusUpdate.find(params[:id])\n\n respond_to do |format|\n if @status_update.update_attributes(params[:status_update])\n format.html { redirect_to @status_update, notice: 'Status update was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @status_update.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "10ac1d669c34f92acfc5e4d7b966a87b",
"score": "0.59635514",
"text": "def update\n @smalltrialstatus = Smalltrialstatus.find(params[:id])\n\n respond_to do |format|\n if @smalltrialstatus.update_attributes(params[:smalltrialstatus])\n format.html { redirect_to @smalltrialstatus, notice: 'Smalltrialstatus was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @smalltrialstatus.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "70e50c97bad266508fa0499f02543f35",
"score": "0.5947885",
"text": "def update\n @l_tweet = LTweet.find(params[:id])\n\n respond_to do |format|\n if @l_tweet.update_attributes(params[:l_tweet])\n format.html { redirect_to @l_tweet, :notice => 'L tweet was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @l_tweet.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ce7c7fe0b8255dc500877925ed4cb7a4",
"score": "0.5946612",
"text": "def update\n respond_to do |format|\n if @tweet.update(tweet_params)\n format.html { redirect_to @tweet, notice: 'Tweet was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @tweet.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "57a369311ec8ab8b6bcf436ce34b201a",
"score": "0.5941079",
"text": "def update_status\n new_status = params[:status]\n error = nil\n if Source::STATUS_TYPES.map(&:first).member? new_status\n @source.status = new_status\n @source.save\n else\n error = \"Invalid status\"\n end\n\n respond_to do |format|\n format.html {\n if error.blank?\n render nothing: true\n else\n render status: :unprocessable_entity, html: \"Invalid status\"\n end\n }\n format.json {\n if error.blank?\n render nothing: true\n else\n render status: :unprocessable_entity, json: { \"errors\" => { base: \"Invalid status\" } }\n end\n }\n end\n end",
"title": ""
},
{
"docid": "62d23419da6bdaf0e98577557e09a1ae",
"score": "0.59401906",
"text": "def update\n respond_to do |format|\n if @test_status.update(test_status_params)\n format.html { redirect_to @test_status, notice: 'Test status was successfully updated.' }\n format.json { render :show, status: :ok, location: @test_status }\n else\n format.html { render :edit }\n format.json { render json: @test_status.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c3c8eaf8aba863488bd9c7094006b67c",
"score": "0.59395033",
"text": "def update\n @question_status = QuestionStatus.find(params[:id])\n\n respond_to do |format|\n if @question_status.update_attributes(params[:question_status])\n format.html { redirect_to @question_status, notice: 'Question status was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @question_status.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ac0204e738251db076fca7c26ad4c6a0",
"score": "0.5938342",
"text": "def meeting_update_status(*args)\n params = Zoom::Params.new(Utils.extract_options!(args))\n params.require(:meeting_id).permit(:action)\n Utils.parse_response self.class.put(\"/meetings/#{params[:meeting_id]}/status\", body: params.except(:meeting_id).to_json, headers: request_headers)\n end",
"title": ""
},
{
"docid": "0cb835bd29d24726dfb4c537f00d9094",
"score": "0.59382474",
"text": "def track_status\n p params\n @todo = Todo.find(params[:id])\n @todo.update(task_status: params[:new_status])\n end",
"title": ""
},
{
"docid": "f3e5007e55d872cd04fea6d58a8c32c5",
"score": "0.59375364",
"text": "def set_tuition_status\n @tuition_status = TuitionStatus.find(params[:id])\n end",
"title": ""
},
{
"docid": "6d3de01793e1045f12c9df15c8ea7f37",
"score": "0.5936589",
"text": "def update\n @tuition = Tuition.find(params[:id])\n\n respond_to do |format|\n if @tuition.update_attributes(params[:tuition])\n format.html { redirect_to @tuition, notice: 'Tuition was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @tuition.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2192bb85096528e9cb78e4bfc32681c4",
"score": "0.5933132",
"text": "def update\n @task = Task.find(params[:id])\n\n if @task.update(params[:task])\n render json: @task, status: :accepted\n else\n render json: @task.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "7f998f6e4c31519b67254097b4960f34",
"score": "0.5932927",
"text": "def update_status\t#\tPUT\n\t\t@sample_transfer.update_attributes!(:status => params[:status])\n\trescue ActiveRecord::RecordNotSaved, ActiveRecord::RecordInvalid \n\t\tflash[:error] = \"Sample Transfer Status Update failed\"\n\tensure\n\t\tredirect_to sample_transfers_path\n\tend",
"title": ""
},
{
"docid": "c5812f44c792c097be3e2db7e603c143",
"score": "0.59302676",
"text": "def update_status status, duration = nil\n\n\t# gets a corresponding message\n message = get_message_for status, duration\n\t# posts it to slack\n post_to_slack status, message\n\nend",
"title": ""
},
{
"docid": "618971e632e087585bc43007ebac09ad",
"score": "0.5929893",
"text": "def update\n @tweet = Tweet.find(params[:id])\n\n respond_to do |format|\n if @tweet.update_attributes(tweet_params)\n format.html { redirect_to @tweet, notice: 'Tweet was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @tweet.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7d515f34609fe7b0f6e0b0c2c2b4b381",
"score": "0.5925586",
"text": "def update\n respond_to do |format|\n if @api_v1_task.update(api_v1_task_params)\n format.html { redirect_to @api_v1_task, notice: 'Task was successfully updated.' }\n format.json { render :show, status: :ok, location: @api_v1_task }\n else\n format.html { render :edit }\n format.json { render json: @api_v1_task.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
496be75c61cf5a359a2a78518af94bbd | Submission Details 29 / 29 test cases passed. Status: Accepted Runtime: 132 ms Submitted: 0 minutes ago You are here! Your runtime beats 50.00% of ruby submissions. Even Steven | [
{
"docid": "49351c065057dea1aed83925f02dff2e",
"score": "0.0",
"text": "def word_break(s, word_dict)\n result = []\n dictionary = word_dict.inject({}) { |acc, x|\n acc[x] ||= true\n acc\n }\n\n n = s.size\n can_break = Array.new(n + 1) { false }\n can_break[n] = true\n (n - 1).downto(0).each { |i|\n i.upto(n - 1).each { |j|\n if dictionary[s[i...(j + 1)]] && can_break[j + 1]\n can_break[i] = true\n break\n end\n }\n }\n\n word_break_helper(s, 0, \"\", result, dictionary, can_break)\n\n return result\nend",
"title": ""
}
] | [
{
"docid": "359faf4bb738944cd4ea5220166509dc",
"score": "0.6687641",
"text": "def mt_51_char_first_name\r\n# This is a negative test for the Mt4 CI Demo form\r\n $test_count = $test_count + 1\r\n $test_count1 = $test_count \r\n $results.puts \"\"\r\n $results.puts \"Starting MT4 51 char invalid format Test.\"\r\n setup_negative_test\r\n site_connect_ci\r\n accept_cookie_policy\r\n get_server_name\r\n mt_validate_title_demo_signup\r\n $results.puts \"51 char invalid format test, brand = \" + $brand\r\n mt_populate_form_first_name_51_char\r\n mt_populate_form_last_name\r\n mt_populate_form_email\r\n mt_populate_form_phone_number\r\n mt_negative_demo_form_submit\r\n mt_negative_validate_confirm_page\r\n $results.puts \"***** MT4 51 char First Name Test Completed, Status:\" \r\n $results.puts \"Total Test Executed Pass / Fail (Running Total for Test Audit Trail.)\"\r\n $results.puts \"Test Count = \" + $test_count1.to_s\r\n $results.puts \"Test Pass Count = \" + $test_pass_count.to_s\r\n $results.puts \"Test Failed Count = \" + $test_failed_count.to_s\r\n $summary_results.puts \"***** MT4 51 char First Name Test Completed, Status:\"\r\n $summary_results.puts \"Total Test Executed Pass / Fail (Running Total for Test Audit Trail.)\"\r\n $summary_results.puts \"Test Count = \" + $test_count1.to_s\r\n $summary_results.puts \"Test Pass Count = \" + $test_pass_count.to_s\r\n $summary_results.puts \"Test Failed Count = \" + $test_failed_count.to_s\r\n $results.puts \"***************************************************************************\"\r\n $results.puts \"End MT4 Negative Form Test 51 char First Name, Country = \" + $country \r\n $results.puts \"***************************************************************************\"\r\n $summary_results.puts \"*******************************************************************\"\r\n $summary_results.puts \"******* End MT4 51 char First Name Test. ************************\"\r\n $summary_results.puts \"*******************************************************************\"\r\nend",
"title": ""
},
{
"docid": "b58cbce0e86395667aaeb65004559c80",
"score": "0.6564559",
"text": "def running_test_case; end",
"title": ""
},
{
"docid": "c2965f867944334b9ec91f494aefc83c",
"score": "0.6505009",
"text": "def ci_51_char_first_name\r\n# This is a negative test for the CI Demo form\r\n $test_count = $test_count + 1\r\n $test_count1 = $test_count \r\n $results.puts \"\"\r\n $results.puts \"Starting CI 51 char invalid format Test.\"\r\n setup_negative_test\r\n site_connect_ci\r\n accept_cookie_policy\r\n get_server_name\r\n ci_validate_title_demo_signup\r\n $results.puts \"51 char invalid format test, brand = \"+$brand\r\n ci_populate_form_first_name_51_char\r\n ci_populate_form_last_name\r\n ci_populate_form_email\r\n ci_populate_form_phone_number\r\n ci_negative_demo_form_submit\r\n ci_negative_validate_confirm_page\r\n $results.puts \"***** CI 51 char Last Name Test Completed, Status:\" \r\n $results.puts \"Total Test Executed Pass / Fail (Running Total for Test Audit Trail.)\"\r\n $results.puts \"Test Count = \" + $test_count1.to_s\r\n $results.puts \"Test Pass Count = \" + $test_pass_count.to_s\r\n $results.puts \"Test Failed Count = \" + $test_failed_count.to_s\r\n $summary_results.puts \"***** CI 51 char Last Name Test Completed, Status:\"\r\n $summary_results.puts \"Total Test Executed Pass / Fail (Running Total for Test Audit Trail.)\"\r\n $summary_results.puts \"Test Count = \" + $test_count1.to_s\r\n $summary_results.puts \"Test Pass Count = \" + $test_pass_count.to_s\r\n $summary_results.puts \"Test Failed Count = \" + $test_failed_count.to_s\r\n $results.puts \"***************************************************************************\"\r\n $results.puts \"End CI Negative Form Test 51 char Last Name, Country = \" + $country \r\n $results.puts \"***************************************************************************\"\r\n $summary_results.puts \"*******************************************************************\"\r\n $summary_results.puts \"******* End CI 51 char Last Name Test. ***************************\"\r\n $summary_results.puts \"*******************************************************************\" \r\nend",
"title": ""
},
{
"docid": "a2595bdb72097cbe26bd54f2bf2df2fc",
"score": "0.62775195",
"text": "def mt_first_name_with_numbers\r\n# This is a negative test for the MT4 CI Demo form (only letters are valid).\r\n $test_count = $test_count + 1\r\n $test_count1 = $test_count \r\n $results.puts \"\"\r\n $results.puts \"Starting MT4 First Name has number Test.\"\r\n setup_negative_test\r\n site_connect_ci\r\n accept_cookie_policy\r\n get_server_name\r\n mt_validate_title_demo_signup\r\n $results.puts \"first name with number test, brand = \"+$brand\r\n mt_populate_form_first_name_with_numbers\r\n mt_populate_form_last_name\r\n mt_populate_form_email\r\n mt_populate_form_phone_number\r\n mt_negative_demo_form_submit\r\n mt_negative_validate_confirm_page\r\n $results.puts \"***** MT4 First Name has Number Test Completed, Status:\" \r\n $results.puts \"Total Test Executed Pass / Fail (Running Total for Test Audit Trail.)\"\r\n $results.puts \"Test Count = \" + $test_count1.to_s\r\n $results.puts \"Test Pass Count = \" + $test_pass_count.to_s\r\n $results.puts \"Test Failed Count = \" + $test_failed_count.to_s\r\n $summary_results.puts \"***** MT4 First Name has Number Test Completed, Status:\"\r\n $summary_results.puts \"Total Test Executed Pass / Fail (Running Total for Test Audit Trail.)\"\r\n $summary_results.puts \"Test Count = \" + $test_count1.to_s\r\n $summary_results.puts \"Test Pass Count = \" + $test_pass_count.to_s\r\n $summary_results.puts \"Test Failed Count = \" + $test_failed_count.to_s\r\n $results.puts \"***************************************************************************\"\r\n $results.puts \"End MT4 Negative Form Test First Name has Number, Country = \" + $country \r\n $results.puts \"***************************************************************************\"\r\n $summary_results.puts \"*******************************************************************\"\r\n $summary_results.puts \"******* End MT4 First Name has Number Test. ***********************\"\r\n $summary_results.puts \"*******************************************************************\"\r\nend",
"title": ""
},
{
"docid": "be358557e509719b4e3c82efef66bfbe",
"score": "0.6268912",
"text": "def ci_first_name_with_numbers\r\n# This is a negative test for the CI Demo form\r\n $test_count = $test_count + 1\r\n $test_count1 = $test_count \r\n $results.puts \"\"\r\n $results.puts \"Starting CI First Name has number Test.\"\r\n setup_negative_test\r\n site_connect_ci\r\n accept_cookie_policy\r\n get_server_name\r\n ci_validate_title_demo_signup\r\n $results.puts \"first name with numbers test, brand = \" + $brand\r\n ci_populate_form_first_name_with_numbers\r\n ci_populate_form_last_name\r\n ci_populate_form_email\r\n ci_populate_form_phone_number\r\n ci_negative_demo_form_submit\r\n ci_negative_validate_confirm_page\r\n $results.puts \"***** CI First Name has Number Test Completed, Status:\" \r\n $results.puts \"Total Test Executed Pass / Fail (Running Total for Test Audit Trail.)\"\r\n $results.puts \"Test Count = \" + $test_count1.to_s\r\n $results.puts \"Test Pass Count = \" + $test_pass_count.to_s\r\n $results.puts \"Test Failed Count = \" + $test_failed_count.to_s\r\n $summary_results.puts \"***** CI First Name has Number Test Completed, Status:\"\r\n $summary_results.puts \"Total Test Executed Pass / Fail (Running Total for Test Audit Trail.)\"\r\n $summary_results.puts \"Test Count = \" + $test_count1.to_s\r\n $summary_results.puts \"Test Pass Count = \" + $test_pass_count.to_s\r\n $summary_results.puts \"Test Failed Count = \" + $test_failed_count.to_s\r\n $results.puts \"***************************************************************************\"\r\n $results.puts \"End CI Negative Form Test First Name has Number, Country = \" + $country \r\n $results.puts \"***************************************************************************\"\r\n $summary_results.puts \"*******************************************************************\"\r\n $summary_results.puts \"******* End CI First Name has Number Test. ************************\"\r\n $summary_results.puts \"*******************************************************************\"\r\nend",
"title": ""
},
{
"docid": "49ef3a85c6c442cb3ae353a493475a09",
"score": "0.62062377",
"text": "def test_new_microtask\r\n #@assignment = assignments(:Assignment_Microtask1)\r\n questionnaire_id = questionnaires(:questionnaire1).id\r\n instructorid = users(:instructor1).id\r\n courseid = courses(:course_object_oriented).id,\r\n number_of_topics = SignUpTopic.count\r\n # create a new assignment\r\n post :new, :assignment => { :name => \"Assignment_Microtask1\",\r\n :directory_path => \"CSC517_instructor1/Assignment_Microtask1\",\r\n :submitter_count => 0,\r\n :course_id => courseid,\r\n :instructor_id => instructorid,\r\n :num_reviews => 1,\r\n :num_review_of_reviews => 0,\r\n :num_review_of_reviewers => 0,\r\n :review_questionnaire_id => questionnaire_id,\r\n :reviews_visible_to_all => 0,\r\n :require_signup => 0,\r\n :num_reviewers => 3,\r\n :team_assignment => 0,\r\n :team_count => 1,\r\n :microtask => true }\r\n\r\n assert_response 200\r\n assert Assignment.find(:all, :conditions => \"name = 'Assignment_Microtask1'\")\r\n\r\n end",
"title": ""
},
{
"docid": "8f1c94592f39e6f7649463118849a3c2",
"score": "0.62043",
"text": "def test_cases; end",
"title": ""
},
{
"docid": "3a1e3ee62c9e62d6f70fbffc261db32f",
"score": "0.6193834",
"text": "def performance(index)\n puts \"\\n#{@testcase.name}\\n\"\n puts \" %-10s %-20s %-8s %s \" % [\"#{@response.runtime.to_s[0..6]}s\", \"[#{result_case}]\", @testcase.request['method'], @response.fully_qualified_path]\n end",
"title": ""
},
{
"docid": "45aeb830c8cb9f44586ace2e9cdd15fb",
"score": "0.614896",
"text": "def post_ruby\n \n code = params[:code]\n step = params[:step]\n @step = Step.find(step)\n @valid = 0\n @testCount = @step.code_tests.count\n @step.code_tests.each do |test|\n code = validateCode(code)\n @testcode = code + \"\\n print \" + test.input \n testResult = testResult(@testcode)\n logger.info\"..............................#{testResult}\"\n if testResult.to_s == test.output \n @valid += 1 \n end\n \n \n end\n @message = \"#{@valid} out of #{@testCount} testcases passed\"\n render json: {status: 'SUCCESS', testPass: @valid, testCount: @testCount, message:@message },status: :ok\n end",
"title": ""
},
{
"docid": "3ff5829b916483334cfa49972da59b54",
"score": "0.6105483",
"text": "def get_test_run_summary_report(test_report, test_summary)\n file_data = test_report\n file_lines = file_data.split(\"\\n\")\n\n=begin\n #Remove the duplicate headings\n title = 0\n i = 0\n file_lines.each do |line|\n i += 1\n if line.match(/<h1 align='center'><u>(\\w|\\s)+<\\/u><\\/h1><br\\/>/)\n title += 1\n if title > 1\n file_lines.delete_at(i-1)\n end\n end\n end\n=end\n\n test_run_summary = <<-EOS\n <h1 align='center'><u>#{test_summary[:title]}<\\/u><\\/h1><br\\/>\n EOS\n\n #Get the test run details from the report\n file_data.match(/<td>Kadu server:(.+)<\\/td>/)\n kadu_server = $1\n test_suites = file_data.scan(/<th align=\"center\">(.+)<\\/th>/)\n test_suite_status = file_data.scan(/Test suite status: <font id=(statuspass|statusfail)>(.*)<\\/font>/)\n\n i = 0\n test_status = {}\n test_suites.each do |test_suite|\n test_status[test_suite] = test_suite_status[i]\n i +=1\n end\n\n test_status = test_status.sort_by{|name,status| status}\n\n test_run_time_in_secs = Time.parse(test_summary[:test_run_end_time].to_s) - Time.parse(test_summary[:test_run_start_time].to_s)\n\n # Get the test case numbers\n passed_tcs = 0\n failed_tcs = 0\n blocked_tcs = 0\n\n file_lines.each do |line|\n passed_tcs +=1 if line.match(\"Test result status: <font id=statuspass>PASS</font>\")\n failed_tcs +=1 if line.match(\"Test result status: <font id=statusfail>FAIL</font>\")\n blocked_tcs +=1 if line.match(\"Test result status: <font id=statusfail>BLOCK</font>\")\n end\n total_tcs_count = passed_tcs + failed_tcs + blocked_tcs\n\n #Create the test run summary section\n test_run_summary += <<-EOS\n <a name=summary></a>\n <table id=\"specifications\" width=\"500px\">\n <tr><td><strong>Kadu Server:</strong></td><td>#{kadu_server}</td></tr>\n <tr><td><strong>Country:</strong></td><td>#{test_summary[:country]}</td></tr>\n <tr><td><strong>Test Run Started On:</strong></td><td>#{test_summary[:test_run_start_time]}</td></tr>\n <tr><td><strong>Duration:</strong></td><td>#{test_run_time_in_secs} secs</td></tr>\n <tr><td><strong>Number of test cases executed:</strong></td><td>#{total_tcs_count}</td></tr>\n <tr><td><strong>Number of test cases passed:</strong></td><td>#{passed_tcs}</td></tr>\n <tr><td><strong>Number of test cases failed:</strong></td><td>#{failed_tcs}</td></tr>\n <tr><td><strong>Number of test cases blocked:</strong></td><td>#{blocked_tcs}</td></tr>\n </table>\n <br>\n EOS\n if !test_summary[:known_issues].nil?\n test_run_summary += <<-EOS\n #{get_fail_test_details(test_summary[:known_issues])}\n <br>\n EOS\n end\n\n test_run_summary += <<-EOS\n <table id=\"specifications\" width=\"900px\">\n <tr>\n <th >Test Suite</th>\n <th >Test Suite Status</th>\n </tr>\n EOS\n i = 0\n test_status.each do |suite_name,suite_status|\n test_run_summary += <<-EOS\n <tr>\n <td><a href=\"##{replace_space_by_dash(suite_name.to_s.gsub(/\"|\\[|\\]/,''))}\">#{suite_name.to_s.gsub(/\"|\\[|\\]/,'')}</a></td>\n <td><font id=#{suite_status[0]}>#{suite_status[1]}</font></td>\n </tr>\n EOS\n i +=1\n end\n test_run_summary += <<-EOS\n </table>\n <br>\n <hr size=2 color=\"#000080\">\n <br/>\n EOS\n\n # Convert the section into array and add it to the file at the start.\n test_run_summary = test_run_summary.split(\"\\n\")\n i = 0\n file_lines.each do |line|\n i += 1\n if line.match(/<center>/)\n j = i\n test_run_summary.each do |row|\n file_lines.insert(j,row)\n j +=1\n end\n break\n end\n end\n\n report = \"\"\n file_lines.each do |line|\n report += <<-EOS\n #{line}\n EOS\n end\n report\n end",
"title": ""
},
{
"docid": "5a4611c2abd8d87da273054b80362747",
"score": "0.6071512",
"text": "def running_test_step; end",
"title": ""
},
{
"docid": "98ea056d10d209e60793583458282e19",
"score": "0.60712314",
"text": "def test\n false_good, true_bad = get_counts(@testing_bad)\n true_good, false_bad = get_counts(@testing_good)\n\n correct = true_good.length + true_bad.length\n total = correct + false_bad.length + false_good.length\n ratio = format_ratio(1.0 * correct / total)\n\n bad_total = false_good.length + true_bad.length\n bad_ratio = format_ratio(1.0 * true_bad.length / bad_total)\n\n good_total = true_good.length + false_bad.length\n good_ratio = format_ratio(1.0 * true_good.length / good_total)\n\n puts \"Accuracy: #{ratio} (#{correct} of #{total})\"\n\n puts \"Bad commit accuracy: #{bad_ratio} (#{true_bad.length} of #{bad_total})\"\n print_failures(true_bad)\n\n puts \"Good commit accuracy: #{good_ratio} (#{true_good.length} of #{good_total})\"\n print_failures(true_good)\n end",
"title": ""
},
{
"docid": "0819e0abbfa5152428b784917c5f325c",
"score": "0.60261637",
"text": "def run_tests\n test_suite = self.task.tests.order(:order)\n testsStrings = test_suite.map do |test|\n test_string = task.fxn_name + \"(\"\n test_string + \"...\"+test.parsed_inputs.to_s + \")\"\n end\n formated_user_code = self.solution.gsub(\"\\n\", \" \")\n data = JSON.dump({user_code: formated_user_code, tests: testsStrings})\n uri = URI.parse(\"https://wci7v1nq8j.execute-api.us-west-2.amazonaws.com/v1\")\n http = Net::HTTP.new(uri.host, uri.port)\n http.use_ssl = true\n http.verify_mode = OpenSSL::SSL::VERIFY_NONE\n request = Net::HTTP::Post.new(uri.request_uri)\n request.body = data\n response = http.request(request)\n response = JSON.parse(response.body)\n if response[\"errorMessage\"]\n message = response[\"errorMessage\"]\n if message.include?(\"timed out\")\n message = \"Task timed out after 4.00 seconds\"\n end\n return {error: true, error_message: message }\n end\n user_results = response[\"results\"]\n test_results = {log: response[\"log\"].gsub(\"\\n\", \"<br/>\"), results: {} }\n test_suite.each_with_index do |test, idx|\n result = user_results[idx]\n passed = result == test.output\n test_result = {\n passed: passed,\n expected: test.output.to_s,\n received: result.to_s\n }\n test_results[:results][test.order] = test_result\n end\n handle_completion(test_results[:results])\n test_results\n end",
"title": ""
},
{
"docid": "3922ef7bdf2af7da982c3939424917a6",
"score": "0.60245144",
"text": "def post\n j :pass\nlabel :fail\n RVTEST_FAIL()\nlabel :pass\n RVTEST_PASS()\n RVTEST_CODE_END()\n end",
"title": ""
},
{
"docid": "2f578bf703f00444d47354c6512ae471",
"score": "0.60087353",
"text": "def test_002\n\n # login\n login\n @@pu = 1\n @@pj = 1\n open\"/devgroup/pj_index/#{@@pu}/#{@@pj}\"\n wait_for_page_to_load \"30000\"\n\n # test for individual analysis task\n open(\"/task/index2/#{@@pu}/#{@@pj}\")\n #The contents of a display of a \"master\" tab become\n # a thing for individual analysis task registration.\n click $xpath[\"task\"][\"main_area_td4\"]\n wait_for_page_to_load \"30000\"\n assert is_text_present(_(\"Registration of an Analysis Task\"))\n # select analyze type: 個人解析\n select \"analyze_type\", \"label=#{@individual}\"\n #Click Master tab\n click $xpath[\"task\"][\"master_tab\"]\n assert !60.times{ break if (is_text_present(_(\"Select a master\")) rescue false); sleep 2 }\n #Select \"uploading a file individually\"\n click \"file_upload_upload_way_upload_each\"\n assert is_text_present(_(\"Uploaded individually.\"))\n click $xpath[\"task\"][\"read_tree\"]\n\n assert !60.times{ break if (is_text_present(_(\"Directory structure\")) rescue false); sleep 2 }\n # logout\n logout\n\n end",
"title": ""
},
{
"docid": "baf68989aaa09af4cbc0f1b870718cc5",
"score": "0.6006724",
"text": "def create\n @submission = current_user.submissions.new(submission_params)\n result = SandboxService.query(@submission.challenge.title, @submission.code)\n puts result\n\n @submission.length = @submission.code.chars.length\n @submission.time = result['time']\n @submission.passed = result['passed']\n\n if @submission.passed?\n old_submission = @challenge.submissions.find_by(code: @submission.code, user: current_user)\n if old_submission.present?\n old_submission.update(time: @submission.time) if @submission.time < old_submission.time\n\n redirect_to(challenge_path(@challenge),\n notice: \"Your code passed the test, but you've already submitted it.\",\n result: result['result'])\n elsif @submission.save\n redirect_to(challenge_path(@challenge), notice: 'Submission was successfully created.',\n result: result['result'])\n else\n redirect_to(challenge_path(@challenge), alert: 'Something went wrong!')\n end\n else\n redirect_to(challenge_path(@challenge), alert: 'Your submission failed the test.',\n result: result['result'], error: result['error'])\n end\n end",
"title": ""
},
{
"docid": "7e23a85200c951455bf512fa898af50e",
"score": "0.60040885",
"text": "def test_003\n\n # login\n login\n @@pu = 1\n @@pj = 1\n open\"/devgroup/pj_index/#{@@pu}/#{@@pj}\"\n wait_for_page_to_load \"30000\"\n\n # test for individual analysis task\n open(\"/task/index2/#{@@pu}/#{@@pj}\")\n #The contents of a display of a \"master\" tab become\n # a thing for individual analysis task registration.\n click $xpath[\"task\"][\"main_area_td4\"]\n wait_for_page_to_load \"30000\"\n assert is_text_present(_(\"Registration of an Analysis Task\"))\n # select analyze type: 個人解析\n select \"analyze_type\", \"label=#{@individual}\"\n click $xpath[\"task\"][\"master_tab\"]\n assert !60.times{ break if (is_text_present(_(\"Select a master\")) rescue false); sleep 2 }\n # select uploading method in the master tab\n assert is_text_present(_(\"Select a master\"))\n assert is_text_present(_(\"Master\"))\n assert is_text_present(_(\"Select the upload method of individual analysis files\"))\n assert is_text_present(_(\"Upload of individual analysis files\"))\n\n #Select \"uploading a file individually\"\n click \"file_upload_upload_way_upload_each\"\n assert is_text_present(_(\"Uploaded individually.\"))\n #Click button Read tree\n click $xpath[\"task\"][\"read_tree\"]\n assert !60.times{ break if (is_text_present(_(\"Directory structure\")) rescue false); sleep 2 }\n #It will return, if a check is returned for uploading collectively (F2-003)\n click $xpath[\"task\"][\"master_tab\"]\n assert !60.times{ break if (is_text_present(_(\"Select a master\")) rescue false); sleep 2 }\n # logout\n logout\n\n end",
"title": ""
},
{
"docid": "d4fa97428dda8e31626f37eaf9d58ee6",
"score": "0.5929162",
"text": "def atest_ID_25891_scheduled_posts_02\n login $user_1_email, $master_password\n go_to_edit_profile_page\n $profiles_your_posts.click\n sleep 5\n go_to_scheduled_tab_on_your_post_page\n verify_text \"Your Posts\",\"Current Drafts\", \"Scheduled Posts\", \"Published Posts\", \"Scheduled\"\n assert $profile_edit_post.exists?\n assert $profile_delete.exists?\n assert $count_of_scheduled.exists?\n end",
"title": ""
},
{
"docid": "f060cecc57781af64c834fcd07fbd5c2",
"score": "0.5896285",
"text": "def ab_test(nRequest, nThread, uri)\n res = %x(ab -n #{nRequest} -c #{nThread} #{uri})\n return res.match(/(?<=Time taken for tests:).*(?=seconds)/).to_s.to_f, res.match(/(?<=Time per request:).*(?=\\[ms\\] \\(mean\\))/).to_s.to_f\nend",
"title": ""
},
{
"docid": "0a0e0335bd6a25cbff0de3c5b12c29b5",
"score": "0.5891634",
"text": "def be_verbose(index)\n puts \"\\n#{result_case} (#{index+1})- #{@testcase.unique_identifier} - \\\"#{@testcase.name}\\\"\"\n puts @error_message\n puts(\"Request runtime: #{@response.runtime}\")\n puts(\" More more more verbosity\\n\")\n puts(\" request method: #{@testcase.request['method']}\")\n puts(\" resource path: #{@testcase.request['path']}\")\n puts(\" request headers: #{@testcase.request['headers']}\")\n puts(\" JSON body sent: #{@testcase.request['body']}\")\n puts(\" expectation:\")\n puts(\" response status code: #{@testcase.response_expectation['status_code']}\")\n puts(\" response headers: #{@testcase.response_expectation['headers']}\")\n puts(\" response body: #{@testcase.response_expectation['body']}\")\n puts(\" result:\")\n puts(\" response status code: #{@response.code}\")\n puts(\" response headers: #{@response.headers}\")\n puts(\" response body: #{JSON.parse(@response.body) rescue nil}\")\n end",
"title": ""
},
{
"docid": "2a7f97b345d1fb1f1872e6d1442dbebc",
"score": "0.5868161",
"text": "def unofficial_submit\n \n feedback_str = request.body.read\n\n @course = Course.where(:id => params[:course_id]).first\n @assessment = Assessment.where(:id => params[:id]).first\n @user = User.where(:email => params[:user]).first\n\n if !@course then\n puts \"ERROR: invalid course\"\n exit\n end\n\n if !@user then\n puts \"ERROR: invalid username (#{user}) for class #{course.id}\"\n exit\n end\n\n if !@assessment then\n puts \"ERROR: Invalid Assessment (#{assessment}) for course #{course.id}\"\n exit\n end\n\n if !@assessment.allow_unofficial then\n puts \"ERROR: This assessment does not allow Unofficial Submissions\"\n exit\n end\n\n @result = params[:result]\n\n if !@result then\n puts \"ERROR: No result!\"\n exit\n end\n\n # Everything looks OK, so append the autoresult to the log.txt file for this lab\n @logger = Logger.new(\"#{Rails.root}/courses/#{@course.name}/#{@assessment.name}/log.txt\")\n @logger.add(Logger::INFO) { \"#{@user.email},0,#{@result}\" }\n\n # Load up the lab.rb file\n modName = @assessment.name + (@course.name).gsub(/[^A-Za-z0-9]/,\"\")\n require(\"#{Rails.root}/assessmentConfig/#{@course.name}-#{@assessment.name}.rb\")\n eval(\"extend #{modName.camelcase}\")\n\n begin\n # Call the parseAutoresult function defined in the lab.rb file. If\n # the list of scores it returns is empty, then we the lab developer is\n # asking us not to create an unofficial submission in the\n # database. Simply return a successful status string to the client and\n # exit.\n scores = parseAutoresult(@result,false)\n\n if scores.keys.length == 0 then \n render :nothing => true and return\n end\n\n # Try to find an existing unofficial submission (always version 0). \n submission = @assessment.submissions.where(:version=>0,:user_id=>@user.id).first\n if !submission then\n submission = @assessment.submissions.new(:version=>0,\n :autoresult=>@result,\n :user_id=>@user.id,\n :submitted_by_id=>0)\n submission.save!()\n else\n #update this one\n submission.autoresult= @result\n submission.created_at = Time.now()\n submission.save!()\n end\n\n\n # Update the scores in the db's unofficial submission using the list\n # returned by the parseAutoresult function\n for key in scores.keys do\n problem = @assessment.problems.where(:name => key).first\n score = submission.scores.where(:problem_id => problem.id).first\n if !score then \n score = submission.scores.new(:problem_id=>problem.id)\n end\n score.score = scores[key]\n score.released = true\n score.grader_id= 0\n score.save!()\n end\n rescue Exception => e\n print e\n end\n\n\n render :nothing => true and return\n\n end",
"title": ""
},
{
"docid": "5265d026e5ab5aa3b78b88297d88f93b",
"score": "0.5836111",
"text": "def test_loop(type, quiz_name, quiz, user_name, time)\r\n clear\r\n # Initialize the array container for all necessary arguments\r\n status = []\r\n total_score = 0\r\n correct_count = 0\r\n incorrect_count = 0\r\n result = nil\r\n right_answer = nil\r\n start_time = 0\r\n status.push(total_score).push(correct_count).push(incorrect_count)\r\n # Loop the length of the quiz collection times to finish the test\r\n (1..quiz['Content'].size).each do |i|\r\n # Workaround timeout method by using the timeout libray in Ruby which automatically terminate the previous thread in a setting time\r\n Timeout.timeout(time) do\r\n clear\r\n # Get the start time stamp for future score calculation\r\n start_time = Process.clock_gettime(Process::CLOCK_MONOTONIC)\r\n # Displaying the question content and prompt for selection\r\n puts '-------------------Time is ticking:D---------------------------'.colorize(:light_magenta)\r\n puts 'You have get ' + (status[1]).to_s.colorize(:light_yellow) + ' correct answer(s) so far. And the total score is' + \" #{status[0]}.\\n\\n\".colorize(:light_blue)\r\n puts \"Question #{i}.\".colorize(:blue) + \" #{quiz['Content'][i - 1]['Question']}\\n\\n\"\r\n right_answer = quiz['Content'][i - 1]['Right_answer']\r\n\r\n # According to the selection, invoke the vailidat_answer method and pass necessary attributes\r\n options = [\r\n { name: \"A. #{quiz['Content'][i - 1]['A']}\", value: lambda {\r\n result = 'A'\r\n return result, right_answer, status, start_time, time\r\n } },\r\n { name: \"B. #{quiz['Content'][i - 1]['B']}\", value: lambda {\r\n result = 'B'\r\n return result, right_answer, status, start_time, time\r\n } },\r\n { name: \"C. #{quiz['Content'][i - 1]['C']}\", value: lambda {\r\n result = 'C'\r\n return result, right_answer, status, start_time, time\r\n } },\r\n { name: \"D. #{quiz['Content'][i - 1]['D']}\", value: lambda {\r\n result = 'D'\r\n return result, right_answer, status, start_time, time\r\n } }\r\n ]\r\n option = @prompt.select(\r\n \"Please select the answer as fast as you can to gain more score.\\nIf you select wrong answer or time expired, you will not get the score for Question #{i}\", options, help: \"(Pressing Enter to go back)\\n\\n\\n\", show_help: :always, per_page: 4\r\n )\r\n end\r\n validate_answer(result, right_answer, status, start_time, time)\r\n # If time expired, then apply the following logic to assian attribute to validate method\r\n rescue Timeout::Error\r\n clear\r\n timeout_banner\r\n puts\r\n puts \"\\n\\nOh, no!!! The #{time}s haven been passed.\"\r\n start_time = Process.clock_gettime(Process::CLOCK_MONOTONIC)\r\n right_answer = quiz['Content'][i - 1]['Right_answer']\r\n result = 'expired'\r\n validate_answer(result, right_answer, status, start_time, time)\r\n end\r\n\r\n clear\r\n test_banner\r\n puts\r\n puts \"Well done, My friend. You did a great job! Let's see waht the results is.\"\r\n enter_to_continue\r\n mode = @test.time_level.key(time)\r\n # Gather all the necessary attributes and form a array\r\n status.push(type).push(quiz_name).push(user_name).push(mode)\r\n # After finsih the test loop, pass attribute array to display result and save method\r\n dispaly_result_and_save(status)\r\n end",
"title": ""
},
{
"docid": "9674ebe3035065ac118fc8ce74ee7d68",
"score": "0.58315897",
"text": "def testNominalShort\n setupTest do |iTasksFileName, iTicketsFileName|\n $Context[:OS_ExecAnswers] = [\n # svn co => success\n [ 0, '' ],\n # deliver => success, generating files\n [ 0, '', @@Generator_SingleDummyGem ]\n ]\n executeProcess(\n [\n '-u', 'ReleaseUser',\n '-b', 'BranchName',\n '-c', 'ReleaseComment',\n '-v', '0.0.1.20100317',\n '-t', iTasksFileName,\n '-k', iTicketsFileName,\n '-s', 'MySVNRep',\n '-d', '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 ]\n }\n } ),\n iSlaveActions\n )\n end\n end\n end",
"title": ""
},
{
"docid": "4e3c44d5cc15ec14628ca23fd2b5f93f",
"score": "0.58246285",
"text": "def report()\n print \"\\n\"\n\n $asserts.each do |msg|\n puts msg\n end\n\n $total_test = $ok_test.+($ko_test)\n print('Total: ')\n print($total_test)\n print(\"\\n\")\n\n print(' OK: ')\n print($ok_test)\n print(\"\\n\")\n print(' KO: ')\n print($ko_test)\n print(\"\\n\")\n print('Crash: ')\n print($kill_test)\n print(\"\\n\")\n\n if Object.const_defined?(:Time)\n print(' Time: ')\n print(Time.now - $test_start)\n print(\" seconds\\n\")\n end\nend",
"title": ""
},
{
"docid": "4e3c44d5cc15ec14628ca23fd2b5f93f",
"score": "0.58246285",
"text": "def report()\n print \"\\n\"\n\n $asserts.each do |msg|\n puts msg\n end\n\n $total_test = $ok_test.+($ko_test)\n print('Total: ')\n print($total_test)\n print(\"\\n\")\n\n print(' OK: ')\n print($ok_test)\n print(\"\\n\")\n print(' KO: ')\n print($ko_test)\n print(\"\\n\")\n print('Crash: ')\n print($kill_test)\n print(\"\\n\")\n\n if Object.const_defined?(:Time)\n print(' Time: ')\n print(Time.now - $test_start)\n print(\" seconds\\n\")\n end\nend",
"title": ""
},
{
"docid": "f5e39b27af7c629be55dbacf47e46ff8",
"score": "0.57892627",
"text": "def test_process_assignments\n \n board_prep_sections = [oi_category_sections(:board_prep_1),\n oi_category_sections(:board_prep_2),\n oi_category_sections(:board_prep_3)]\n section_ids = board_prep_sections.collect { |s| s.id }\n team_member_list = [@siva_e]\n \n section_selections = {}\n section_ids.each { |id| section_selections[id.to_s] = '0' }\n\n\n # Try accessing from an account that is not a PCB Designer and\n # verify that the user is redirected.\n post(:process_assignments,\n { :category => { :id => @board_prep.id },\n :design => { :id => @mx234a.id },\n :section => section_selections },\n pat_dfm_session)\n assert_redirected_to(:controller => 'tracker', :action => 'index')\n assert_equal(\"You are not authorized to access this page\", flash['notice'])\n \n \n # Verify that a contractor PCB Designer can not access the list.\n post(:process_assignments,\n { :category => { :id => @board_prep.id },\n :design => { :id => @mx234a.id },\n :section => section_selections },\n siva_designer_session)\n assert_redirected_to(:controller => 'tracker', :action => 'index')\n #assert_equal(\"You are not authorized to access this page\", flash['notice'])\n\n end",
"title": ""
},
{
"docid": "a9f4c2a19b80ba89e2afaa1cdd14095b",
"score": "0.5778009",
"text": "def test_case; end",
"title": ""
},
{
"docid": "e907809bdaca5a6fc6b82e85a5637eb2",
"score": "0.57629985",
"text": "def perform(submission)\n p \"Process #{submission}\"\n SubmissionRunner.new.run submission\n end",
"title": ""
},
{
"docid": "e83e54df4441f794d197d4726baac777",
"score": "0.5762467",
"text": "def publish_test_results(test_category, test_phase, test_suite_result_list)\n ReportLog.entering(@@class_name, __method__.to_s)\n\n test_suite_result_list.each do |test_suite_result|\n test_suite_name = test_suite_result['TestSuiteName']\n test_count = test_suite_result['TestCount'].to_i\n error_count = test_suite_result['ErrorCount'].to_i\n failure_count = test_suite_result['FailureCount'].to_i\n\n pass_rate = 1 - (error_count.to_f + failure_count.to_f)/test_count.to_f\n\n input = Hash.new\n input[:RTCConfig] = data_for(:RTC_config)\n\n if pass_rate < get_threshold_value(data_for(:RTC_defect_threshold)[:minor_threshold])\n # pass rate standard not met, create or update existing defect\n if pass_rate < get_threshold_value(data_for(:RTC_defect_threshold)[:blocker_threshold])\n defect_severity = Constants::RTC_SEVERITY_BLOCKER\n elsif pass_rate < get_threshold_value(data_for(:RTC_defect_threshold)[:major_threshold])\n defect_severity = Constants::RTC_SEVERITY_MAJOR\n elsif pass_rate < get_threshold_value(data_for(:RTC_defect_threshold)[:normal_threshold])\n defect_severity = Constants::RTC_SEVERITY_NORMAL\n else\n defect_severity = Constants::RTC_SEVERITY_MINOR\n end\n\n # Check from the TEST DB whether there is already an open defect for this test suite\n # if yes, update it\n # if no, create a new one\n\n # set up RTC client and run /getOpenTestAutoDefect API\n ReportLog.info('Pass rate beneath standard. Update existing open defect or create a new one.')\n ReportLog.info(\"Looking for open defect for test suite #{test_suite_name} ...\")\n @api = RTCClientRestAPI.new(data_for(:RTC_client_api_url)[:RTC_REST_URL_getOpenTestAutoDefect])\n @payload = JSON.generate(input)\n @params = Hash.new\n @params[Constants::PARAM_TEST_SUITE_NAME] = test_suite_name\n rtc_client = RTCRestClient.new(Constants::REST_TYPE_PUT, @api, @params, @payload)\n rtc_client.run_api\n if rtc_client.run_successfully\n @params = Hash.new\n @params[Constants::PARAM_TEST_CATEGORY] = test_category\n @params[Constants::PARAM_TEST_PHASE] = test_phase\n @params[Constants::PARAM_DEFECT_SEVERITY] = defect_severity\n input['TestSuiteResult'] = test_suite_result\n @payload = JSON.generate(input)\n if rtc_client.response_body.fetch(Constants::JSON_KEY_RESULT).nil?\n # no existing open defect, create a new one\n ReportLog.info('Open defect not found. Creating a new one...')\n # set up RTC client and run /createTestAutoDefect API\n @api = RTCClientRestAPI.new(data_for(:RTC_client_api_url)[:RTC_REST_URL_createTestAutoDefect])\n rtc_client = RTCRestClient.new(Constants::REST_TYPE_POST, @api, @params, @payload)\n rtc_client.run_api\n if rtc_client.run_successfully\n ReportLog.info('Created a new defect.')\n ReportLog.info(\"RTC client response: #{rtc_client.response_body.to_s}\")\n else\n raise construct_api_failure_msg(rtc_client)\n end\n else\n # existing open defect found, update it\n ReportLog.info('Open defect found. Updating its content...')\n # set up RTC client and run /updateTestAutoDefect API\n @api = RTCClientRestAPI.new(data_for(:RTC_client_api_url)[:RTC_REST_URL_updateTestAutoDefect])\n @params[Constants::PARAM_DEFECT_NUM] = rtc_client.response_body.fetch(Constants::JSON_KEY_RESULT).fetch('Defect Number').to_s\n rtc_client = RTCRestClient.new(Constants::REST_TYPE_POST, @api, @params, @payload)\n rtc_client.run_api\n if rtc_client.run_successfully\n ReportLog.info('Updated the open defect.')\n ReportLog.info(\"RTC client response: #{rtc_client.response_body.to_s}\")\n else\n raise construct_api_failure_msg(rtc_client)\n end\n end\n else\n raise construct_api_failure_msg(rtc_client)\n end\n else\n # pass rate reached standard, close open defect automatically\n # Check from the TEST DB whether there is already an open defect for this test suite\n # if yes, close it\n # if no, do nothing, you are good\n\n # set up RTC client for /getOpenTestAutoDefect API\n ReportLog.info('Pass rate reached standard. Close open defect if there is any.')\n ReportLog.info(\"Looking for open defect for test suite #{test_suite_name} ...\")\n @api = RTCClientRestAPI.new(data_for(:RTC_client_api_url)[:RTC_REST_URL_getOpenTestAutoDefect])\n @payload = JSON.generate(input)\n @params = Hash.new\n @params[Constants::PARAM_TEST_SUITE_NAME] = test_suite_name\n rtc_client = RTCRestClient.new(Constants::REST_TYPE_PUT, @api, @params, @payload)\n rtc_client.run_api\n if rtc_client.run_successfully\n @params = Hash.new\n if rtc_client.response_body.fetch(Constants::JSON_KEY_RESULT).nil?\n # do nothing\n else\n # existing open defect found, close it\n ReportLog.info('Open defect found. Closing it...')\n # set up RTC client and run /closeTestAutoDefect API\n @api = RTCClientRestAPI.new(data_for(:RTC_client_api_url)[:RTC_REST_URL_closeTestAutoDefect])\n @params[Constants::PARAM_DEFECT_NUM] = rtc_client.response_body.fetch(Constants::JSON_KEY_RESULT).fetch('Defect Number').to_s\n @params[Constants::PARAM_COMMENT] = \"Closed defect upon test execution at #{test_suite_result['ExecutionTimestamp']} \"\n + \"from build #{test_suite_result['Build']['BuildName']} \"\n + \"with an acceptable pass rate of #{pass_rate}.\"\n @params[Constants::PARAM_BUILD_NAME] = test_suite_result['Build']['BuildName']\n rtc_client = RTCRestClient.new(Constants::REST_TYPE_PUT, @api, @params, @payload)\n rtc_client.run_api\n if rtc_client.run_successfully\n ReportLog.info('Closed the open defect.')\n ReportLog.info(\"RTC client response: #{rtc_client.response_body.to_s}\")\n else\n raise construct_api_failure_msg(rtc_client)\n end\n end\n else\n raise construct_api_failure_msg(rtc_client)\n end\n end\n end\n ReportLog.exiting(@@class_name, __method__.to_s)\n end",
"title": ""
},
{
"docid": "6ef322d63a74a7e98d626795ecedc354",
"score": "0.57538116",
"text": "def test_assign_groups_to_reviews\n\n post(:assign_groups_to_reviews,\n { :review_type => {\n # 1-Final, 2-Routing, 3-Pre-Art, 4-Placement, 5-Release\n '5_1'=>'1', '5_2'=>'0', '5_3'=>'1', '5_4'=>'0', '5_5'=>'0', #HWENG\n '6_1'=>'1', '6_2'=>'1', '6_3'=>'1', '6_4'=>'0', '6_5'=>'1', #VALOR\n '7_1'=>'1', '7_2'=>'1', '7_3'=>'0', '7_4'=>'1', '7_5'=>'1', #CE-DFT\n '8_1'=>'0', '8_2'=>'0', '8_3'=>'1', '8_4'=>'0', '8_5'=>'1', #DFM\n '9_1'=>'1', '9_2'=>'0', '9_3'=>'1', '9_4'=>'1', '9_5'=>'0', #TDE\n '10_1'=>'1', '10_2'=>'0', '10_3'=>'1', '10_4'=>'1', '10_5'=>'0', #MECHANICAL\n '11_1'=>'0', '11_2'=>'1', '11_3'=>'1', '11_4'=>'1', '11_5'=>'0', #MECH-MFG\n '12_1'=>'1', '12_2'=>'0', '12_3'=>'0', '12_4'=>'0', '12_5'=>'1', #PCB DESIGN\n '13_1'=>'1', '13_2'=>'0', '13_3'=>'1', '13_4'=>'0', '13_5'=>'0', #PLANNING\n '14_1'=>'1', '14_2'=>'0', '14_3'=>'0', '14_4'=>'0', '14_5'=>'0', #PCB IG\n '15_1'=>'1', '15_2'=>'0', '15_3'=>'0', '15_4'=>'0', '15_5'=>'0', #LIBRARY\n '16_1'=>'0', '16_2'=>'0', '16_3'=>'1', '16_4'=>'1', '16_5'=>'1', #PCB MECH\n '17_1'=>'1', '17_2'=>'1', '17_3'=>'1', '17_4'=>'1', '17_5'=>'1', #SLM BOM\n '18_1'=>'0', '18_2'=>'1', '18_3'=>'1', '18_4'=>'1', '18_5'=>'0', #SLM-Vendor\n '19_1'=>'1', '19_2'=>'0', '19_3'=>'0', '19_4'=>'0', '19_5'=>'1' #OPS MGR\n } },\n cathy_admin_session)\n\n post :review_type_role_assignment, {}, cathy_admin_session\n\n assert_response :success\n\n roles = assigns(roles)['roles']\n review_types = assigns(review_types)['review_types']\n\n expected_values = [\n {:name => 'Hardware Engineering Manager',\n :review_types => []},\n {:name => 'Operations Manager',\n :review_types => ['Final', 'Release']},\n {:name => 'PCB Design',\n :review_types => ['Final', 'Release']},\n {:name => 'Program Manager',\n :review_types => []},\n {:name => 'DFM',\n :review_types => ['Pre-Artwork', 'Release']},\n {:name => 'CE-DFT',\n :review_types => ['Final', 'Placement', 'Release', 'Routing']},\n {:name => 'Compliance - EMC', \n :review_types => []},\n {:name => 'Compliance - Safety', \n :review_types => []},\n {:name => 'Library',\n :review_types => ['Final']},\n {:name => 'ECN',\n :review_types => []},\n {:name => 'HWENG',\n :review_types => ['Final', 'Pre-Artwork']},\n {:name => 'Mechanical',\n :review_types => ['Final', 'Placement', 'Pre-Artwork']},\n {:name => 'Mechanical-MFG',\n :review_types => ['Placement', 'Pre-Artwork', 'Routing']},\n {:name => 'Planning',\n :review_types => ['Final', 'Pre-Artwork']},\n {:name => 'PCB Input Gate',\n :review_types => ['Final']},\n {:name => 'PCB Mechanical',\n :review_types => ['Placement', 'Pre-Artwork', 'Release']},\n {:name => 'SLM BOM',\n :review_types => ['Final', 'Placement', 'Pre-Artwork', 'Release', 'Routing']},\n {:name => 'SLM-Vendor',\n :review_types => ['Placement', 'Pre-Artwork', 'Routing']},\n {:name => 'TDE',\n :review_types => ['Final', 'Placement', 'Pre-Artwork']},\n {:name => 'Valor', \n :review_types => ['Final', 'Pre-Artwork', 'Release', 'Routing']}\n ]\n\n #assert_equal(expected_values, roles)\n assert_equal(expected_values.size, roles.size)\n assert_equal(5, review_types.size)\n\n roles.each_with_index { |role, i|\n expected_role = expected_values[i]\n assert_equal(expected_role[:name], role.name)\n \n returned_rts = role.review_types.collect { |rt| rt.name }\n\n returned_rts = returned_rts.sort_by { |rt| rt }\n returned_rts.each_with_index { |review_type, j|\n expected_name = expected_role[:review_types][j]\n assert_equal(expected_role[:name]+'::'+expected_name.to_s,\n role.name+'::'+review_type)\n }\n\n }\n\n expected_values = [\n {:name => 'Pre-Artwork',\n :role_names => ['DFM', 'HWENG', 'Mechanical', 'Mechanical-MFG', 'PCB Mechanical', 'Planning', 'SLM BOM', 'SLM-Vendor', 'TDE', 'Valor']},\n {:name => 'Placement', \n :role_names => ['CE-DFT', 'Mechanical', 'Mechanical-MFG', 'PCB Mechanical', 'SLM BOM', 'SLM-Vendor', 'TDE']},\n {:name => 'Routing', \n :role_names => ['CE-DFT', 'Mechanical-MFG', 'SLM BOM', 'SLM-Vendor', 'Valor']},\n {:name => 'Final',\n :role_names => ['CE-DFT', 'HWENG', 'Library', 'Mechanical', 'Operations Manager', 'PCB Design', 'PCB Input Gate', 'Planning', 'SLM BOM', 'TDE', 'Valor']},\n {:name => 'Release', \n :role_names => ['CE-DFT', 'DFM', 'Operations Manager', 'PCB Design', 'PCB Mechanical', 'SLM BOM', 'Valor']}\n ]\n review_types.each { |review_type| \n expected_rt = expected_values.shift\n\n returned_roles = []\n review_type.roles.each { |role| returned_roles.push(role.name) }\n\n returned_roles.sort.each { |role|\n expected_role = expected_rt[:role_names]\n expected_name = expected_role.shift\n assert_equal(expected_rt[:name]+'::'+expected_name, \n review_type.name+'::'+role)\n }\n }\n\n end",
"title": ""
},
{
"docid": "18d3e19cdb1211dae8876c4803fb4f2b",
"score": "0.57447356",
"text": "def submits; end",
"title": ""
},
{
"docid": "28f4d66cfbf3ace110e6f14da7930a03",
"score": "0.5742334",
"text": "def testNominalWithRegressionShort\n setupTest do |iTasksFileName, iTicketsFileName|\n $Context[:OS_ExecAnswers] = [\n # svn co => success\n [ 0, '' ],\n # Run regression => success\n [ 0, '' ],\n # deliver => success, generating files\n [ 0, '', @@Generator_SingleDummyGem ]\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 '-r', 'test/runReg'\n ]\n ) do |iError, iSlaveActions|\n checkCallsMatch(\n [\n [ 'query', 'svn co MySVNRep' ],\n [ 'query', 'test/runReg' ],\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 ]\n }\n } ),\n iSlaveActions\n )\n end\n end\n end",
"title": ""
},
{
"docid": "38a3fd7269acc23d9e9ad422cb365507",
"score": "0.57411325",
"text": "def test_008\n\n # login\n login\n\n # Open PU management page\n open_pu_management_page_1\n\n #Find a PU\n\n @@pu = Pu.find_by_name('SamplePU1')\n open \"/devgroup/pu_index/#{@@pu.id}\"\n wait_for_page_to_load \"30000\"\n\n sleep 2\n\n #Find a PJ of PU\n open_pj_management_page(@@pu.id)\n @@pj = Pj.find_by_name('SamplePJ1')#\n open\"/devgroup/pj_index/#{@@pu.id}/#{@@pj.id}\"\n wait_for_page_to_load \"30000\"\n\n #Open \"Registration of analysis task\" page\n open(\"/task/index2/#{@@pu.id}/#{@@pj.id}\")\n # test master of PJ is not registered\n assert is_text_present(_(\"Details of an analysis task\"))\n click $xpath[\"task\"][\"main_area_td4\"]\n assert !60.times{ break if (is_text_present(_(\"Registration of an Analysis Task\")) rescue false); sleep 2 }\n\n click $xpath[\"task\"][\"general_control_tab\"]\n assert !60.times{ break if (is_text_present(_(\"Basic Setting\")) rescue false); sleep 2 }\n sleep 3\n select \"analyze_type\", \"label=#{@individual}\"\n sleep 3\n click $xpath[\"task\"][\"master_tab\"]\n assert !60.times{ break if (is_text_present(_(\"Select a master\")) rescue false); sleep 2 }\n\n # test for value of master into combobox in master tab\n assert_equal [\"sample_c_cpp\"], get_select_options(\"master_id\")\n assert is_text_present(_(\"Optional setting\"))\n\n click $xpath[\"task\"][\"registration_task_button\"]\n sleep 2\n #assert !60.times{ break if (is_text_present(\"解析ツール未選択 入力内容に問題があるためタスクを登録できません。\") rescue false); sleep 2 }\n\n\n # logout\n logout\n\n end",
"title": ""
},
{
"docid": "3fc2b24227cbb5f7478364c1e6487863",
"score": "0.5740607",
"text": "def run_tests\n check_solution(1, [6, 29, 18, 2, 72, 19, 18, 10, 37], 18, 2)\n check_solution(2, [6, 29, 18, 2, 72, 19, 18, 10, 37], 9, -1)\nend",
"title": ""
},
{
"docid": "d7cc623b57fa0ed14fc99896e0767282",
"score": "0.5731132",
"text": "def report_results(result, score)\n api_token = ENV[\"API_TOKEN\"]\n test_url = ENV[\"API_URL\"]\n track_id = ENV[\"TRACK_ID\"]\n\n test_number = result.name[5..6]\n if test_number == \"58\" #final test code\n puts \"Congratulations on passing the tests!\"\n passed_tests = true\n end\n\n if api_token && test_url && (result.result_code != '.' || passed_tests)\n puts \"Reporting results...\"\n require \"net/http\"\n params = {'test_number'=> score,\n 'api_token' => api_token,\n 'track_id' => track_id\n }\n begin\n res = Net::HTTP.post_form(URI.parse(test_url), params)\n if res.code == \"200\"\n puts \"Results successfully submitted to #{test_url}\"\n end\n rescue\n puts \"Failed to submit results.\"\n end\n end\n end",
"title": ""
},
{
"docid": "a8369c576caa8ca0a65a30b7402b5ff6",
"score": "0.5729327",
"text": "def submit_result\n process_submit_response(submit_request) if @score > 1363\n end",
"title": ""
},
{
"docid": "18d95deebcd75fc5ab1ed1307fe184b5",
"score": "0.57170594",
"text": "def log_submit\n @user = User.find_by(email: params[:user])\n @cud = @user ? @course.course_user_data.find_by(user_id: @user.id) : nil\n unless @cud\n err = \"ERROR: invalid username (#{params[:user]}) for class #{@course.id}\"\n render(plain: err, status: :bad_request) && return\n end\n\n @assessment = @course.assessments.find_by(name: params[:name])\n if !@assessment\n err = \"ERROR: Invalid Assessment (#{params[:id]}) for course #{@course.id}\"\n render(plain: err, status: :bad_request) && return\n elsif !@assessment.allow_unofficial\n err = \"ERROR: This assessment does not allow Log Submissions\"\n render(plain: err, status: :bad_request) && return\n end\n\n @result = params[:result]\n render(plain: \"ERROR: No result!\", status: :bad_request) && return unless @result\n\n # Everything looks OK, so append the autoresult to the log.txt file for this lab\n ASSESSMENT_LOGGER.setAssessment(@assessment)\n ASSESSMENT_LOGGER.log(\"#{@user.email},0,#{@result}\")\n\n # Load up the lab.rb file\n mod_name = @assessment.name + (@course.name).gsub(/[^A-Za-z0-9]/, \"\")\n require(Rails.root.join(\"assessmentConfig\", \"#{@course.name}-#{@assessment.name}.rb\"))\n eval(\"extend #{mod_name.camelcase}\")\n\n begin\n # Call the parseAutoresult function defined in the lab.rb file. If\n # the list of scores it returns is empty, then we the lab developer is\n # asking us not to create an unofficial submission in the\n # database. Simply return a successful status string to the client and\n # exit.\n scores = parseAutoresult(@result, false)\n\n render(plain: \"OK\", status: 200) && return if scores.keys.length == 0\n\n # Try to find an existing submission (always version 0).\n submission = @assessment.submissions.find_by(version: 0, course_user_datum_id: @cud.id)\n if !submission\n submission = @assessment.submissions.new(\n version: 0,\n autoresult: @result,\n user_id: @cud.id,\n submitted_by_id: 0,\n )\n submission.save!\n else\n # update this one\n submission.autoresult = @result\n submission.created_at = Time.now\n submission.save!\n end\n\n # Update the scores in the db's unofficial submission using the list\n # returned by the parseAutoresult function\n scores.keys.each do |key|\n problem = @assessment.problems.find_by(name: key)\n score = submission.scores.find_or_initialize_by(problem_id: problem.id)\n score.score = scores[key]\n score.released = true\n score.grader_id = 0\n score.save!\n end\n rescue StandardError => e\n ExceptionNotifier.notify_exception(e, env: request.env,\n data: {\n user: current_user,\n course: @course,\n assessment: @assessment,\n submission: submission,\n })\n COURSE_LOGGER.log(e.to_s)\n end\n\n render(plain: \"OK\", status: 200) && return\n end",
"title": ""
},
{
"docid": "b2ce1e4eb88e4e1297ad5b76d06af502",
"score": "0.571694",
"text": "def testNominal\n executeProcess(\n [\n '--masterticket', '123',\n '--slaveticket', '456'\n ]\n ) do |iError, iSlaveActions|\n assert_equal(\n {\n Tools::TicketTracker => {\n Actions::Ticket_RejectDuplicate => [\n [ '123', '456' ]\n ]\n }\n },\n iSlaveActions\n )\n end\n end",
"title": ""
},
{
"docid": "034099c2e9a919e1e9659584f6cfeb72",
"score": "0.5693583",
"text": "def submission_params\n params.require(:submission).permit(:ta_id, :subm_file, :tests_passed, :total_tests, :ta_grade, :is_valid, :late_penalty, :final_grade_override, :ta_comment, :comment_override)\n end",
"title": ""
},
{
"docid": "7637d213ea78e68e181b0e2be17735fd",
"score": "0.5685753",
"text": "def test_thread_answer\n threads = []\n (1..10).each{\n threads << Thread.new{\n post \"/answer\"\n assert last_response.status == 201\n assert last_response.body.include?('action='), 'not found: action'\n assert last_response.body.include?('hi pre answer'), 'not found: hi pre answer'\n \n action = last_response.body.scan(/action=\\\"([^\\\"]+)\\\"/).first.first\n id = action.scan(/[^\\/]+$/).first\n send_digits = SecureRandom.random_number(3000)\n post \"/digits/%s\" % id, {:Digits => send_digits}\n assert last_response.status == 201, 'bad response'\n assert last_response.body.include?('<Speak >%d</Speak>' % send_digits), 'Not get the digit send %s' % send_digits\n }\n }\n threads.each{|t| t.join}\n threads.clear()\n end",
"title": ""
},
{
"docid": "5fa5bf32a1c3e2247672b3747e873622",
"score": "0.5684149",
"text": "def clean_exit\n\ttasks_passed = all_by_exit_status(@task_data['test_exit_status_passed'])\n\ttasks_failed = all_by_exit_status(@task_data['test_exit_status_failed'])\n\ttasks_skipped = all_by_exit_status(@task_data['test_exit_status_skipped'])\n\ttasks_error \t = all_by_exit_status(@task_data['test_exit_status_error'])\n\tnoelement_error\t = all_by_exit_status(@task_data['test_exit_status_noelement'])\n @task_data.merge!({'execution_time' => @taskchain.execution_time, 'tasks_passed' => tasks_passed, 'tasks_failed' => tasks_failed, 'tasks_skipped' => tasks_skipped, 'tasks_error' => tasks_error, 'test_exit_status_noelement' => noelement_error })\n \n\tPublisher.new(@task_data).publish_reports\t \n\t\n\tputs(\"\\n==> DONE\\n\\n\")\n puts(\"[ ::\\n\")\n puts(\"[ :: [SESSION]\\n\")\n\tputs(\"[ ::\\n\")\n\t# Team City Result\n @teamcity_result = tasks_failed.length == 0 && tasks_error.length == 0 && noelement_error.length == 0 ? \"[TCRESULT]=SUCCESSFUL\\n\" : \"[TCRESULT]=UNSUCCESSFUL\\n\"\n\tputs @teamcity_result\n\tputs(\"[ ::\\n\")\n\t\n\tputs(\"[TC] Target BIZ File : [#{@neo_bizfile}]\")\n printf(\"%-27s %s\\n\",\"[TC] -- tests passed:\", tasks_passed.length.to_s)\n printf(\"%-27s %s\\n\",\"[TC] -- tests failed:\", tasks_failed.length.to_s)\n printf(\"%-27s %s\\n\",\"[TC] -- tests executed:\",@taskchain.executed_tasks.to_s)\n printf(\"%-27s %s\\n\",\"[TC] -- tests skipped:\", tasks_skipped.length.to_s)\n printf(\"%-27s %s\\n\",\"[TC] -- tests error:\", tasks_error.length.to_s)\n printf(\"%-27s %s\\n\",\"[TC] -- tests no element:\", noelement_error.length.to_s)\n printf(\"%-27s %.2f %s\\n\",\"[TC] -- execution time:\", @taskchain.execution_time, \"secs\")\n\tprintf(\" -- reports prepared \\t: #{ENV[\"reports\"]}\\n\")\n printf(\" -- logs prepared \\t: #{ENV[\"LOGS\"]}\\n\")\n\t\n\tputs(\"[TC] Tasklist :\\n\")\t\t\n\t@taskchain.taskchain_array.each do |task|\n\t\tputs(\"[TC] \\t{#{task.taskname}}\\n\")\t\t\t\n\t\ttask.examples.each do |ex|\n\t\t\tputs(\"[TC] \\t\\t[#{ex} ]\\n\")\n\t\tend\n\tend\n\n\tif tasks_error.length > 0\n\t\tputs(\"\\n\\n==> STATUS: [ some tests failed - execution failed ]\\n\")\n\t\texit(1)\n\telse\n\t\texit(0)\n\tend\nend",
"title": ""
},
{
"docid": "ba22383221429ffa2e58051f4a05ed04",
"score": "0.56812984",
"text": "def run_best_case\n user = User.find(1)\n timetable = user.timetables[2]\n timetable.subjects = user.subjects.ids.sample(5)\n\n p \">>>>>>> Running Best Case for Population Size\"\n run_for_population_size(timetable)\n # p \">>>>>>> Running Best Case for Generations\"\n # run_for_generations(timetable)\n\n # tp all_runs\n #tp all_runs.map { |x| x[:chromosomes] }\n #p all_runs.map(&:fitness).inject(0, :+) / all_runs.size\n #tp all_runs[0].data.collect {|x| x.subject }\n end",
"title": ""
},
{
"docid": "805fd9e3833fad5ccfa046597169d85b",
"score": "0.56718135",
"text": "def report()\n print \"\\n\"\n $asserts.each do |err, str, iso, e|\n print(err);\n print_assertion_string(str, iso)\n if e\n print(\" => \")\n print(e.message)\n end\n print(\"\\n\")\n end\n\n $total_test = $ok_test.+($ko_test)\n print('Total: ')\n print($total_test)\n print(\"\\n\")\n\n print(' OK: ')\n print($ok_test)\n print(\"\\n\")\n print(' KO: ')\n print($ko_test)\n print(\"\\n\")\n print('Crash: ')\n print($kill_test)\n print(\"\\n\")\n\n if Object.const_defined?(:Time)\n print(' Time: ')\n print(Time.now - $test_start)\n print(\" seconds\\n\")\n end\nend",
"title": ""
},
{
"docid": "4f88649d5070f20eecd9d9e40668549a",
"score": "0.5662041",
"text": "def atest_ID_25891_scheduled_posts_01\n login $user_1_email, $master_password\n go_to_edit_profile_page\n $profiles_your_posts.click\n sleep 5\n scheduledPostCount = count_scheduled_current\n if (scheduledPostCount < 5)\n i=1\n while i < 3\n $browser.goto($patch_note)\n $post_pick_group.when_present().click\n $group_select.when_present().select(\"Sports\")\n $post_compose_note.wait_until_present()\n $browser.link(:text, \"Basketball\").when_present().click\n $post_compose_note.when_present().set(\"Note field populated by automated test.\")\n $advanced_options.when_present().click\n currentTime = Time.now() + 2\n currentDate = currentTime.strftime(\"%Y-%m-%d\")\n $post_advanced_calendar.when_present().set(\"#{currentDate}\")\n $post_advanced_time.when_present().set(\"11:00 PM\")\n sleep 3\n $browser.link(:text => /11:00/).click\n $profile_schedule.when_present().fire_event(\"onclick\")\n sleep 3\n i = i+1\n end\n end\n end",
"title": ""
},
{
"docid": "3f280c87fe3f8e9fdf293a6a5315df33",
"score": "0.5644364",
"text": "def test_step; end",
"title": ""
},
{
"docid": "4997244f5a4d11640cfe7ace0a3209dd",
"score": "0.56435114",
"text": "def test_exercise_1124\n verify_method :exercise_1124,\n :with => [{params: [1111111, 1234567], expect: 1},\n {params: [33 * 7, 33 * 23], expect: 33},\n {params: [41 * 13, 41 * 29], expect: 41}]\n\n end",
"title": ""
},
{
"docid": "c8863d023c5c275cdeb48ac5b9e41384",
"score": "0.56426466",
"text": "def report\n\t\t\tputs \"Tests: #{@ok} ok, #{@fail} failures.\"\n\t\t\tif (@fail > 0)\n\t\t\t\tputs \"*** THERE WERE FAILURES *** \"\n\t\t\telse \n\t\t\t\tputs \"*** ALL TESTS PASSED ***\"\n\t\t\tend\n\t\tend",
"title": ""
},
{
"docid": "aef9e61f9bdb8c028954479f3beab415",
"score": "0.5632487",
"text": "def test_stats(example)\n file_path = example.metadata[:file_path].gsub('./qa/specs/features', '')\n api_fabrication = ((example.metadata[:api_fabrication] || 0) * 1000).round\n ui_fabrication = ((example.metadata[:browser_ui_fabrication] || 0) * 1000).round\n\n {\n name: 'test-stats',\n time: time,\n tags: {\n name: example.full_description,\n file_path: file_path,\n status: example.execution_result.status,\n smoke: example.metadata.key?(:smoke).to_s,\n reliable: example.metadata.key?(:reliable).to_s,\n quarantined: quarantined(example.metadata),\n retried: ((example.metadata[:retry_attempts] || 0) > 0).to_s,\n job_name: job_name,\n merge_request: merge_request,\n run_type: run_type,\n stage: devops_stage(file_path),\n testcase: example.metadata[:testcase]\n },\n fields: {\n id: example.id,\n run_time: (example.execution_result.run_time * 1000).round,\n api_fabrication: api_fabrication,\n ui_fabrication: ui_fabrication,\n total_fabrication: api_fabrication + ui_fabrication,\n retry_attempts: example.metadata[:retry_attempts] || 0,\n job_url: QA::Runtime::Env.ci_job_url,\n pipeline_url: env('CI_PIPELINE_URL'),\n pipeline_id: env('CI_PIPELINE_ID'),\n merge_request_iid: merge_request_iid\n }\n }\n rescue StandardError => e\n log(:error, \"Failed to transform example '#{example.id}', error: #{e}\")\n nil\n end",
"title": ""
},
{
"docid": "00830f67a43519da4b2370a08e8af388",
"score": "0.56308883",
"text": "def test_TestPaper\n # login(\"cn.fra\", \"12345\")\n begin\n\n @@title=$question\n $action.open($link+\"/Course/ExamTemplateTrain.aspx\")\n assert_equal(@@loginpage.getTitle,\"EF Online Academy\")\n @@testpaperpage.addNew\n @@testpaperpage.title(@@title)\n\n @@testpaperpage.uniqueId(Time.now.to_s)\n @@testpaperpage.description(@@title)\n @@testpaperpage.totalScore(\"100\")\n @@testpaperpage.passScore(\"0\")\n @@testpaperpage.testTime(\"10\")\n @@testpaperpage.layout \"123\"\n @@testpaperpage.tag\n # @@testpaperpage.addGroup \"1\",@@title\n @@testpaperpage.addGroup @@title\n sleep 3\n @@testpaperpage.ok\n sleep 6\n @@testpaperpage.titleFilter(@@title)\n @@testpaperpage.search\n sleep 3\n assert($action.findelementByName(\"ctl00$cphMain$rptList$ctl00$imgBtnEdit\"))\n $log.puts(__method__.to_s+\" -------------------pass \\n\")\n\n rescue\n $log.puts(__method__.to_s+\" -------------------fail \\n\")\n $action.screenshot($path)\n puts \":error:#{$!}-----at:#{$@} \\n\"\n end\n end",
"title": ""
},
{
"docid": "e4dc3df2a489fb1bddcc5bb4b5db0fc0",
"score": "0.5621283",
"text": "def test_005\n\n # login\n login\n\n # Open PU management page\n open_pu_management_page_1\n\n # #Find a PU\n #Pu created\n pu_name = 'pu'\n register_pu(pu_name)\n @@pu = Pu.find(:last)\n open \"/devgroup/pu_index/#{@@pu.id}\"\n wait_for_page_to_load \"30000\"\n\n sleep 2\n\n #Find a PJ of PU\n open_pj_management_page(@@pu.id)\n pj_name = 'pj'\n register_pj(pj_name)\n @@pj = Pj.find(:last)\n open\"/devgroup/pj_index/#{@@pu.id}/#{@@pj.id}\"\n wait_for_page_to_load \"30000\"\n\n # test for individual analysis task\n open(\"/task/index2/#{@@pu.id}/#{@@pj.id}\")\n #The contents of a display of a \"master\" tab become\n # a thing for individual analysis task registration.\n click $xpath[\"task\"][\"main_area_td4\"]\n wait_for_page_to_load \"30000\"\n assert is_text_present(_(\"Registration of an Analysis Task\"))\n # select analyze type: 個人解析\n select \"analyze_type\", \"label=#{@individual}\"\n click $xpath[\"task\"][\"master_tab\"]\n assert !60.times{ break if (is_text_present(_(\"Select a master\")) rescue false); sleep 2 }\n # Below \"selection of the upload method of an individual analysis file\" is displayed.\n assert is_text_present(_(\"Select a master\"))\n assert is_text_present(_(\"Master\"))\n assert is_text_present(_(\"Select the upload method of individual analysis files\"))\n assert is_text_present(_(\"Upload of individual analysis files\"))\n\n @@pu.destroy\n # logout\n logout\n\n end",
"title": ""
},
{
"docid": "673fffe280dadec43056f2952087a93e",
"score": "0.56134087",
"text": "def final_test\n return unless MiniApivore.all_test_ran?\n\n @errors = MiniApivore.prepare_untested_errors\n assert(@errors.empty?, @errors.join(\"\\n\"))\n\n # preventing duplicate execution\n MiniApivore.runnable_list << \"#{self.class}::#{__method__}_runned\"\n end",
"title": ""
},
{
"docid": "d7e35adc0bde252ec7449c513f78a0e8",
"score": "0.56127757",
"text": "def test_scenario9\n \n data = [[File.dirname(__FILE__)+'/data/iris.csv', {\"petal length\" => 5}, \"000004\", 'Iris-versicolor', {}, \"probability\"],\n [File.dirname(__FILE__)+'/data/iris.csv', {\"petal length\" => 2}, \"000004\", 'Iris-setosa', {}, \"probability\" ]\n ]\n puts\n puts \"Scenario: Successfully comparing predictions for logistic regressions with operating kind and supervised model:\"\n\n data.each do |filename, data_input, objective, prediction_result, params, operating_kind|\n puts\n puts \"Given I create a data source uploading a <%s> file\" % filename\n source = @api.create_source(filename, {'name'=> 'source_test', 'project'=> @project[\"resource\"]})\n\n puts \"And I wait until the source is ready\"\n assert_equal(BigML::HTTP_CREATED, source[\"code\"])\n assert_equal(1, source[\"object\"][\"status\"][\"code\"])\n assert_equal(@api.ok(source), true)\n \n puts \"And I create a dataset\"\n dataset=@api.create_dataset(source)\n\n puts \"And I wait until the dataset is ready\"\n assert_equal(BigML::HTTP_CREATED, dataset[\"code\"])\n assert_equal(1, dataset[\"object\"][\"status\"][\"code\"])\n assert_equal(@api.ok(dataset), true)\n \n puts \"And I create a logistic regression with objective\" \n logisticregression=@api.create_logisticregression(dataset)\n\n puts \"And I wait until the logistic regression is ready\"\n assert_equal(BigML::HTTP_CREATED, logisticregression[\"code\"])\n assert_equal(1, logisticregression[\"object\"][\"status\"][\"code\"])\n assert_equal(@api.ok(logisticregression), true)\n \n puts \"And I create a local logistic regression\"\n localSupervisedModel = BigML::SupervisedModel.new(logisticregression)\n\n puts \"When I create a prediction for <%s>\" % [JSON.generate(data_input)]\n prediction = @api.create_prediction(logisticregression['resource'], data_input, {\"operating_kind\" => operating_kind})\n \n assert_equal(BigML::HTTP_CREATED, prediction[\"code\"])\n assert_equal(@api.ok(prediction), true)\n\n puts \"Then the prediction for <%s> is <%s>\" % [objective, prediction_result]\n \n if !prediction['object']['prediction'][objective].is_a?(String)\n assert_equal(prediction['object']['prediction'][objective].to_f.round(5), prediction_result.to_f.round(5))\n else\n assert_equal(prediction['object']['prediction'][objective], prediction_result)\n end\n \n puts \"And I create a local prediction for <%s>\" % JSON.generate(data_input)\n local_prediction = localSupervisedModel.predict(data_input, {\"operating_kind\" => operating_kind})\n \n puts \"Then the local prediction is <%s>\" % prediction_result\n \n if local_prediction.is_a?(Array)\n local_prediction = local_prediction[0]\n elsif local_prediction.is_a?(Hash)\n local_prediction = local_prediction['prediction']\n else\n local_prediction = local_prediction\n end \n\n assert_equal(local_prediction, prediction_result)\n \n end\n \n end",
"title": ""
},
{
"docid": "0b550f209ce3fef3f2d0abdeea54c612",
"score": "0.5612562",
"text": "def go_run_tests\n @status = :running\n Thread.new do\n begin\n test_cases = @test_suite.sources\n\n @mutex.synchronize do\n @test_cases = test_cases\n @test_results = {}\n end\n\n @test_suite.run_tests do |result|\n @mutex.synchronize do\n @test_results[result[:source]] = result[:result]\n end\n end\n\n rescue => e\n puts e\n print e.bracktrace.join(\"\\n\")\n ensure\n @status = :ran\n end\n\n end\n end",
"title": ""
},
{
"docid": "b03a1b0d3472c5c749a5290a4322414b",
"score": "0.56056535",
"text": "def test_00010_profanity_blocker\n \t@loginpage.login($user1)\n enable_profanity_blocker($networkslug, true)\n #check community post\n title_before = \"watir test profanity blocker - #{get_timestamp}\"\n title_after = PageObject.new(@browser).create_conversation($network, $networkslug, \"A Watir Topic\", \"discussion\", title_before, false)\n title_before[\"test profanity\"] = \"**** *********\"\n assert title_before == title_after\n # comment_root_post\n # reply_to_comment\n # #check hybris post\n # create_post_from_hybris\n enable_profanity_blocker($networkslug, false)\n title2_before = \"watir test profanity blocker - #{get_timestamp}\"\n title2_after = PageObject.new(@browser).create_conversation($network, $networkslug, \"A Watir Topic\", \"question\", title2_before, false)\n assert title2_before == title2_after\n end",
"title": ""
},
{
"docid": "773615762f1ee60ba00448ece18fd2ae",
"score": "0.5605162",
"text": "def create\n @concept = CustomizedConcept.find(params[:test_attempt][:customized_concept_id])\n @tests = @concept.tests\n @test_attempt = @concept.test_attempts.new(test_attempt_params)\n @course = @concept.course\n @answer_records = @test_attempt.answer_records\n \n @error_test = check_answer(params[:select_answers])\n respond_to do |format|\n if (@error_test.length == 0) \n @test_attempt.test_time_sec = Time.now.to_i - @test_attempt.test_time_sec\n if @test_attempt.save\n format.html { redirect_to course_customized_concept_path(@course, @concept), notice: 'Successfully pass' }\n format.json { render :show, status: :created, location: @test_attempt }\n end\n else\n\t\t\t\t@test_attempt.retry_time += 1\n\t\t\t\tbinding.pry\n @error_test.each do |e|\n @answer_records.each do |a|\n a.error_times += 1 if a.test == e\n end\n end\n format.html { render :new }\n format.json { render json: @test_attempt.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "bfe6082caaf5b3163e7e61e7a6abce02",
"score": "0.5593293",
"text": "def test\n\n puts \"Performing test tasks:\"\n\n puts \"Test 1 \" + (generate_intcode([1, 0, 0, 0, 99]) === [2, 0, 0, 0, 99] ? \"succeeded\": \"failed\") + \"!\"\n puts \"Test 2 \" + (generate_intcode([2, 3, 0, 3, 99]) === [2, 3, 0, 6, 99] ? \"succeeded\": \"failed\") + \"!\"\n puts \"Test 3 \" + (generate_intcode([2, 4, 4, 5, 99, 0]) === [2, 4, 4, 5, 99, 9801] ? \"succeeded\": \"failed\") + \"!\"\n puts \"Test 4 \" + (generate_intcode([1, 1, 1, 4, 99, 5, 6, 0, 99]) === [30, 1, 1, 4, 2, 5, 6, 0, 99] ? \"succeeded\": \"failed\") + \"!\"\n\nend",
"title": ""
},
{
"docid": "268be48e154ef515feb2b67adc3579b4",
"score": "0.5585398",
"text": "def test_VerifyQuestionSetJobBoard\n randomName = SecureRandom.hex(4)\n randomReq = \"0\" + SecureRandom.hex(4)\n \n randomEmail = SecureRandom.hex(4) \n randomLastName = SecureRandom.hex(4)\n \n #PRECONDITION: Must be logged in\n Common.login(Users::USER_EMAIL, Users::PASSWORD)\n home_url = $browser.current_url\n \n #PRECONDITION: Must have a Question Set created, with Questions already created, some with Optional = true some not, some with Text= true, some not and combined.\n self.CreateQuestionSetWithQuestions(randomName)\n \n #Create Job with Question Set asociated\n Common.goToTab(HomePage::REQUISITIONS_LINK_XPATH)\n $wait.until{\n $browser.find_element(:xpath => RequisitionsHomePage::REQUISITIONS_PAGE_BTN_NEW_XPATH).displayed?\n }\n Common.click_and_load(RequisitionsHomePage::REQUISITIONS_PAGE_BTN_NEW_XPATH) \n $wait.until{\n $browser.find_element(:xpath => RequisitionsNewAndEdit::REQUISITIONS_NEW_BTN_CONTINUE_XPATH).displayed?\n }\n Common.click_and_load(RequisitionsNewAndEdit::REQUISITIONS_NEW_BTN_CONTINUE_XPATH) \n $wait.until{\n $browser.find_element(:id => RequisitionsNewAndEdit::REQUISITIONS_NEW_JOB_TITLE_ID).displayed?\n }\n $browser.find_element(:id => RequisitionsNewAndEdit::REQUISITIONS_NEW_JOB_TITLE_ID).send_keys randomReq\n $browser.find_element(:xpath => RequisitionsNewAndEdit::REQUISITIONS_NEW_PRIMARY_RECRUITER_TEXT_XPATH).send_keys RequisitionsNewAndEdit::REQUISITIONS_NEW_DATA_PRIMARY_RECRUITER_TEXT\n $browser.find_element(:xpath => RequisitionsNewAndEdit::REQUISITIONS_NEW_LOCATION_XPATH).send_keys RequisitionsNewAndEdit::REQUISITIONS_NEW_DATA_LOCATION_TEXT\n $browser.find_element(:xpath => RequisitionsNewAndEdit::REQUISITIONS_NEW_DEPARTAMENT_OPTION_XPATH).click\n $browser.find_element(:xpath => RequisitionsNewAndEdit::REQUISITIONS_NEW_MIN_SALARY_XPATH).send_keys RequisitionsNewAndEdit::REQUISITIONS_NEW_DATA_MIN_SALARY_TEXT\n $browser.find_element(:xpath => RequisitionsNewAndEdit::REQUISITIONS_NEW_MAX_SALARY_XPATH).send_keys RequisitionsNewAndEdit::REQUISITIONS_NEW_DATA_MAX_SALARY_TEXT\n $browser.find_element(:xpath => RequisitionsNewAndEdit::REQUISITIONS_NEW_QUESTIONS_SET_XPATH).send_keys randomName\n unless $browser.find_element(:xpath => RequisitionsNewAndEdit::REQUISITIONS_NEW_POST_JOB_BOX_XPATH).attribute(\"checked\")\n $browser.find_element(:xpath => RequisitionsNewAndEdit::REQUISITIONS_NEW_POST_JOB_BOX_XPATH).click\n end\n \n Common.click_and_load(RequisitionsNewAndEdit::REQUISITIONS_NEW_BTN_SAVE_XPATH)\n \n #JobBoard without login\n CustomSettings.JobBoardLogin(false)\n \n Common.goToTab(HomePage::BOARD_SETUP_TAB_LINK_XPATH)\n Common.displayed(BoardSetupHomePage::CAREERS_LINK_LIST_XPATH)\n Common.click_and_load(BoardSetupHomePage::CAREERS_LINK_LIST_XPATH)\n CustomSettings.BoardSetupInit\n CustomSettings.ResumeRequired(false)\n CustomSettings.DefineEEOQuestions(false, false, false, false, false)\n \n # 1 - Apply to a job from the job board site, with Question Set asociated.\n $browser.get(HomePage::JOB_BOARD_URL)\n $wait.until{\n $browser.find_element(:xpath => JobBoardHomePage::JOB_BOARD_JOB_LIST_XPATH).displayed?\n }\n Common.click_and_load(JobBoardHomePage::JOB_BOARD_JOB_LIST_XPATH + \"//*[text()[contains(.,'\" + randomReq + \"')]]\") \n $wait.until{\n $browser.find_element(:xpath => JobBoardJobDetail::JOB_BOARD_APPLY_JOB_LINK_XPATH).displayed?\n }\n Common.click_and_load(JobBoardJobDetail::JOB_BOARD_APPLY_JOB_LINK_XPATH) \n $wait.until{\n $browser.find_element(:xpath => JobBoardJobDetail::JOB_BOARD_APPLY_JOB_EMAIL_XPATH).displayed?\n }\n $browser.find_element(:xpath => JobBoardJobDetail::JOB_BOARD_APPLY_JOB_EMAIL_XPATH).send_keys randomEmail + Users::EMAIL_DOMAIN\n $browser.find_element(:xpath => JobBoardJobDetail::JOB_BOARD_APPLY_JOB_FIRST_NAME_XPATH).send_keys randomEmail\n $browser.find_element(:xpath => JobBoardJobDetail::JOB_BOARD_APPLY_JOB_LAST_NAME_XPATH).send_keys randomLastName\n \n #If How did you hear about us? is displayed\n begin\n aboutUsSelect = $browser.find_element(:xpath => JobBoardJobDetail::JOB_BOARD_APPLY_JOB_HEAR_ABOUT_US_XPATH).displayed?\n rescue\n aboutUsSelect = false\n end \n if aboutUsSelect\n $browser.find_element(:xpath => JobBoardJobDetail::JOB_BOARD_APPLY_JOB_HEAR_ABOUT_US_XPATH).send_keys \"Job Board\"\n end\n \n Common.click_and_load(JobBoardJobDetail::JOB_BOARD_APPLY_JOB_CONTINUE_XPATH) \n $wait.until{\n $browser.find_element(:xpath => JobBoardJobDetail::JOB_BOARD_APPLY_JOB_RETURN_JOBSEARCH_XPATH).displayed?\n }\n begin\n continue_button = $browser.find_element(:xpath => JobBoardJobDetail::JOB_BOARD_APPLY_JOB_CONTINUE_XPATH).displayed?\n rescue\n continue_button = false\n end \n if continue_button\n Common.click_and_load(JobBoardJobDetail::JOB_BOARD_APPLY_JOB_CONTINUE_XPATH)\n end\n \n $wait.until{\n $browser.find_element(:xpath => JobBoardJobDetail::JOB_BOARD_APPLY_JOB_RETURN_JOBSEARCH_XPATH).displayed?\n }\n begin\n continue_button = $browser.find_element(:xpath => JobBoardJobDetail::JOB_BOARD_APPLY_JOB_CONTINUE_XPATH).displayed?\n rescue\n continue_button = false\n end \n if continue_button\n Common.click_and_load(JobBoardJobDetail::JOB_BOARD_APPLY_JOB_CONTINUE_XPATH)\n end\n \n # 2 - Verify that questions are shown correctly\n # Question 1 must be required and no text\n $wait.until{\n $browser.find_element(:xpath => JobBoardJobDetail::JOB_BOARD_QUESTIONS_SET_QUESTION_1_XPATH).displayed?\n }\n assert $wait.until {\n $browser.find_element(:xpath => JobBoardJobDetail::JOB_BOARD_QUESTIONS_SET_QUESTION_1_XPATH + \"//*[@class='atsRequired']\")\n $browser.find_element(:xpath => JobBoardJobDetail::JOB_BOARD_QUESTIONS_SET_QUESTION_1_INPUT_XPATH + \"//select\")\n }\n \n # Question 2 must be optional and no text\n assert $wait.until {\n $browser.find_element(:xpath => JobBoardJobDetail::JOB_BOARD_QUESTIONS_SET_QUESTION_2_XPATH)\n $browser.find_element(:xpath => JobBoardJobDetail::JOB_BOARD_QUESTIONS_SET_QUESTION_2_INPUT_XPATH + \"//select\")\n }\n \n # Question 3 must be optional and text\n assert $wait.until {\n $browser.find_element(:xpath => JobBoardJobDetail::JOB_BOARD_QUESTIONS_SET_QUESTION_3_XPATH)\n $browser.find_element(:xpath => JobBoardJobDetail::JOB_BOARD_QUESTIONS_SET_QUESTION_3_INPUT_XPATH + \"//textarea\")\n }\n \n # Question 4 must be required and text\n assert $wait.until {\n $browser.find_element(:xpath => JobBoardJobDetail::JOB_BOARD_QUESTIONS_SET_QUESTION_4_XPATH + \"//*[@class='atsRequired']\")\n $browser.find_element(:xpath => JobBoardJobDetail::JOB_BOARD_QUESTIONS_SET_QUESTION_4_INPUT_XPATH + \"//textarea\")\n }\n # 3 - Answer questions\n $browser.find_element(:xpath => JobBoardJobDetail::JOB_BOARD_QUESTIONS_SET_QUESTION_1_INPUT_XPATH + \"//select\").send_keys \"YES\"\n $browser.find_element(:xpath => JobBoardJobDetail::JOB_BOARD_QUESTIONS_SET_QUESTION_2_INPUT_XPATH + \"//select\").send_keys \"YES\"\n $browser.find_element(:xpath => JobBoardJobDetail::JOB_BOARD_QUESTIONS_SET_QUESTION_3_INPUT_XPATH + \"//textarea\").send_keys \"YES\"\n $browser.find_element(:xpath => JobBoardJobDetail::JOB_BOARD_QUESTIONS_SET_QUESTION_4_INPUT_XPATH + \"//textarea\").send_keys \"YES\"\n \n # 4 - Click on Submit\n Common.click_and_load(JobBoardJobDetail::JOB_BOARD_QUESTIONS_SET_BTN_SUBMIT_XPATH)\n \n #RESULTS\n $browser.get(home_url)\n Common.goToTab(HomePage::QUESTION_SETS_LINK_XPATH)\n $wait.until{\n $browser.find_element(:xpath => QuestionSetsHomePage::QUESTION_SETS_HOME_BTN_NEW_XPATH).displayed?\n }\n Common.click_and_load(QuestionSetsHomePage::QUESTION_SET_LIST_XPATH + \"//*[text()[contains(.,'\" + randomName + \"')]]\") \n \n $wait.until{\n $browser.find_element(:xpath => QuestionSetsDetail::QUESTION_SETS_DETAIL_NEW_QUESTION_XPATH).displayed?\n }\n assert $wait.until { \n $browser.find_element(:xpath => QuestionSetsDetail::QUESTION_SET_DETAIL_PRESCREENS_FIRST_XPATH).displayed?\n $browser.find_element(:xpath => QuestionSetsDetail::QUESTION_SET_DETAIL_PRESCREENS_SECOND_XPATH).displayed?\n $browser.find_element(:xpath => QuestionSetsDetail::QUESTION_SET_DETAIL_PRESCREENS_THIRD_XPATH).displayed?\n $browser.find_element(:xpath => QuestionSetsDetail::QUESTION_SET_DETAIL_PRESCREENS_FOURTH_XPATH).displayed?\n }\n Common.click_and_load(QuestionSetsDetail::QUESTION_SET_DETAIL_PRESCREENS_FIRST_APPLICATION_XPATH)\n $wait.until{\n $browser.find_element(:xpath => ApplicationsDetailPage::APPLICATIONS_DETAIL_PRESCREEN_1_XPATH).displayed?\n }\n $browser.find_element(:xpath => ApplicationsDetailPage::APPLICATIONS_DETAIL_JOB_TEXT_XPATH + \"[//*[text()[contains(.,'\" + randomReq + \"')]]]\").displayed?\n assert $wait.until { \n $browser.find_element(:xpath => ApplicationsDetailPage::APPLICATIONS_DETAIL_PRESCREEN_1_XPATH).displayed?\n $browser.find_element(:xpath => ApplicationsDetailPage::APPLICATIONS_DETAIL_PRESCREEN_2_XPATH).displayed?\n $browser.find_element(:xpath => ApplicationsDetailPage::APPLICATIONS_DETAIL_PRESCREEN_3_XPATH).displayed?\n $browser.find_element(:xpath => ApplicationsDetailPage::APPLICATIONS_DETAIL_PRESCREEN_4_XPATH).displayed?\n }\n \n end",
"title": ""
},
{
"docid": "9d0423c085b6a5d2d5d6f8effcc9cf7f",
"score": "0.5580029",
"text": "def exec\n question = Question.find(self.question_id)\n tmp = Time.now.to_i\n\n\t\t# Compila a resposta\n compile_result = Judge::compile(self.lang,self.response,tmp)\n\n\t\t# Verifica se houve erro de compilacao\n if compile_result[0] != 0\n self.compile_errors = compile_result[1]\n self.correct = false\n else\n\n\t\t\t# Se compilou, executa os casos de teste.\n correct = Judge::test(lang,compile_result[1],question.test_cases,tmp)\n\n self.results = Hash.new\n self.correct = true\n\t\t\t# para cada caso de teste salva os dados retornados\n\t\t\t# os dados retornados estarao na variavel 'r'\n\t\t\t# cada caso de teste tem seus dados armazenados no hash 'results'\n correct.each do |id,r|\n\n self.results[id] = Hash.new\n self.results[id][:error] = false\n self.results[id][:diff_error] = false\n self.results[id][:time_error] = false\n self.results[id][:exec_error] = false\n self.results[id][:presentation_error] = false\n self.results[id][:content] = question.test_cases.find(id).content\n\n self.results[id][:title] = question.test_cases.find(id).title\n self.results[id][:show_input_output] = question.test_cases.find(id).show_input_output\n\n if question.test_cases.find(id).show_input_output\n self.results[id][:input] = r[1][0]\n self.results[id][:output_expected] = r[1][1]\n end\n\n self.results[id][:output] = r[1][2]\n self.results[id][:id] = id\n\n\t\t\t\t# cada erro possui um numero de identificacao\n if r[0] == 3\n self.correct = false\n self.results[id][:error] = true\n self.results[id][:diff_error] = true\n elsif r[0] == 2\n self.correct = false\n self.results[id][:error] = true\n self.results[id][:presentation_error] = true\n elsif r[0] == 143 || r[0] == 141\n self.correct = false\n self.results[id][:error] = true\n self.results[id][:time_error] = true\n elsif r[0] != 0\n self.correct = false\n self.results[id][:error] = true\n self.results[id][:exec_error] = true\n end\n\n\t\t\t\t# se o numero de tentativas for suficiente para mostrar dicas, salva a dica na resposta do caso de teste.\n if Answer.where(user_id: self.user_id, question_id: self.question_id, correct: false, compile_errors: nil).count >= question.test_cases.find(id).tip_limit-1 || self.correct\n self.results[id][:tip] = question.test_cases.find(id).tip\n end\n\n #self.results[id][:output2] = simple_format r[1][0]\n end\n end\n true\n end",
"title": ""
},
{
"docid": "1e9ea76cd3f6aca9bfd374535d7c8240",
"score": "0.5555358",
"text": "def loadtest()\n\n # Redirect $stdout (Console output) to nil\n\n # Workout the delay time of the script\n $scriptdelaytime = $scriptdelaytime + $ramp_up_time\n\n # Sleep for that delay time, so we can start ramping up users incrementally\n sleep $scriptdelaytime\n\n # Get which cucumber scenario by using the $vuser_inc variable.\n cucumber_scenario = $vuser_scenarios[$vuser_inc]\n # Increase this variable by 1 so the other scenarios can use it\n $vuser_inc = $vuser_inc + 1\n\n # convervate the cucumber scenario name, into the class name\n scenario_name = cucumber_scenario.gsub('(','').gsub(')', '').gsub(/ /, '_').capitalize\n\n # create an instance of the class from the (step_defitions/performance) file\n script = Module.const_get(scenario_name).new\n\n # Increase the variable which keeps track of running virtual users\n $running_v_users = $running_v_users + 1\n\n iteration = 0\n\n # Loop through for the duration of the test, this will run the test each time it loops\n while ((Time.new.to_i) < ($starttime + $duration)) do\n\n iteration += 1\n\n # Works out the start time of the current test (iteration)\n scriptstart_time = Time.now\n\n # We'll run the test in a try/except block to ensure it doesn't kill the thread\n begin\n # Call the threads action step\n script.v_action()\n\n # As the test has finished, work out the duration\n script_duration = (Time.now - scriptstart_time) * 1000\n\n # If the duration is above the x axis current value, let's increase it\n if ((script_duration / 1000) > $max_x) then\n $max_x = (script_duration / 1000).ceil + 1\n end\n\n # If the current cucumber scenario have no results, lets define their arrays\n if ($results_scenarios[cucumber_scenario].nil?) then\n $results_scenarios[cucumber_scenario] = []\n $results_scenarios_graph[cucumber_scenario] = {}\n end\n\n # Add the duration of the test to an array so we can work our max/min/avg etc...\n $results_scenarios[cucumber_scenario] << script_duration\n\n # For each second we need to build up an average, so need to build up another array\n # based on the current time\n current_time_id = $duration - (($starttime + $duration) - Time.new.to_i) + 1\n\n # If the array doesn't exist for the current time, then lets define it\n if($results_scenarios_graph[cucumber_scenario][current_time_id].nil? == true) then\n $results_scenarios_graph[cucumber_scenario][current_time_id] = Array.new()\n end\n\n # Add the value to the array\n $results_scenarios_graph[cucumber_scenario][current_time_id].push(script_duration)\n\n rescue Exception=>e\n # If it fails, keep a log of why, then carry on\n\n error = {}\n error['error_message'] = e.to_s + '<br>' + e.backtrace.to_s\n error['error_iteration'] = iteration\n error['error_script'] = cucumber_scenario\n\n # $stdout.puts 'Error: ' + e + \"\\n\" + backtrace.map {|l| \" #{l}\\n\"}.join\n\n\n $scenario_errors[cucumber_scenario] += 1\n\n #$stdout.puts $scenario_errors\n\n $error_log << error\n\n $total_failures += 1\n # $stdout.puts 'Error: ' + e + \"\\n\" + backtrace.map {|l| \" #{l}\\n\"}.join\n end\n\n $scenario_iterations[cucumber_scenario] += 1\n\n\n # Sleep a second between each scenario. This will need to be parametised soon\n sleep(1)\n\n end\n # Once the test has finished, lets decrease the $running_v_users value\n $running_v_users = $running_v_users - 1\n\nend",
"title": ""
},
{
"docid": "a660d858bd6c8e71e16fa4acc9738174",
"score": "0.5551204",
"text": "def test_scm_st_017\n printf \"\\n Test 017\"\n open_periodical_analysis_setting_tab\n fill_scm_form(\"SVN\",\n nil,\n nil,\n WRONG_URL,\n LOGIN_RIGHT_KEYWORD,\n PASSWORD_RIGHT_KEYWORD,\n nil,\n MASTER_BASE_NAME_RIGHT_KEYWORD,\n 1,\n 0\n )\n click $display_scm_xpath[\"save_button\"]\n sleep SLEEP_TIME\n # assert(is_text_present($display_scm[\"url_error\"]))\n sleep SLEEP_TIME\n logout\n end",
"title": ""
},
{
"docid": "2c7792113f3e6a7b897090f47ee25903",
"score": "0.5550793",
"text": "def run_tests\n check_solution(1, (100..200).to_a, 135, 35)\n check_solution(2, [13, 19, 24, 29, 32, 37, 43], 35, -1)\nend",
"title": ""
},
{
"docid": "1cbab3d4a1fcc651df478e30651c3cff",
"score": "0.55438685",
"text": "def test_run_completed(test_run)\n report_results test_run\n end",
"title": ""
},
{
"docid": "e28983aa3d263023e31d76b4acc851aa",
"score": "0.5543524",
"text": "def create\n if @test.done.blank?\n redirect_to root_path, warning: \"This test have not finished yet\"\n return\n end\n params[:submission] = {}\n params[:submission][:user_id] = current_user.id\n @submission = @test.submissions.create(submission_params)\n respond_to do |format|\n if @submission.save\n @test.questions.each do |question|\n question.answers.each do |answer|\n answer.answers_of_questions.create({choice: false, question_id: question.id, submission_id: @submission.id})\n end\n end\n format.html { redirect_to edit_test_submission_path(@test, @submission) }\n else\n format.html { render :new }\n end\n end\n end",
"title": ""
},
{
"docid": "af33e5ecec8e05ed0541cd9f1c6d2d0d",
"score": "0.5538392",
"text": "def run_worst_case\n user = User.find(1)\n timetable = user.timetables[0]\n timetable.subjects = user.subjects.ids.sample(20)\n\n p \">>>>>>> Running Worst Case for Population Size\"\n run_for_population_size(timetable)\n # p \">>>>>>> Running Worst Case for Generations\"\n # run_for_generations(timetable)\n\n # tp all_runs.map { |x| x[:chromosomes] }\n #p all_runs.map(&:fitness).inject(0, :+) / all_runs.size\n #tp all_runs[0].data.collect {|x| x.subject }\n end",
"title": ""
},
{
"docid": "b1835d9cd9b7d56818f81d856d6ebf93",
"score": "0.5533917",
"text": "def investigate\n puts \"\\nRequesting JSON from #{url} and testing\"\n tests.each_pair do |test, block|\n print \" - #{test}\\n\"\n check test, block\n end\n summary\n exit_status\n end",
"title": ""
},
{
"docid": "428b5d1eaf9535043f41374ccd294f0d",
"score": "0.55271655",
"text": "def test_steps; end",
"title": ""
},
{
"docid": "428b5d1eaf9535043f41374ccd294f0d",
"score": "0.55271655",
"text": "def test_steps; end",
"title": ""
},
{
"docid": "230b2390fafa7ad886aaa1f13230081a",
"score": "0.5525653",
"text": "def test_exercise_119\n verify_method :exercise_119,\n :with => [{param: 1, expect: '1'},\n {param: 2, expect: '10'},\n {param: 3, expect: '11'},\n {param: 8, expect: '1000'},\n {param: 11, expect: '1011'}]\n end",
"title": ""
},
{
"docid": "e051e0550c0cabc1033f9b2a59884c33",
"score": "0.55190456",
"text": "def test_instance_params\n params.require(:test_instance).permit(\n :runtime_seconds, :mesa_version, :omp_num_threads, :compiler,\n :compiler_version, :platform_version, :passed, :computer_id,\n :test_case_id, :success_type, :failure_type, :steps, :retries, :backups,\n :summary_text, :diff, :checksum, :total_runtime_seconds, :re_time,\n :rn_mem, :re_mem\n )\n end",
"title": ""
},
{
"docid": "da0357a2b96a610e1869a3bc7a1a68bc",
"score": "0.5517087",
"text": "def test_007\n\n # login\n login\n\n # Open PU management page\n open_pu_management_page_1\n\n #Find a PU\n @@pu = Pu.find_by_name('SamplePU1')\n\n open \"/devgroup/pu_index/#{@@pu.id}\"\n wait_for_page_to_load \"30000\"\n\n sleep 2\n\n #Find a PJ of PU\n open_pj_management_page(@@pu.id)\n @@pj = Pj.find_by_name('SamplePJ1')\n\n open\"/devgroup/pj_index/#{@@pu.id}/#{@@pj.id}\"\n wait_for_page_to_load \"30000\"\n\n #Open \"Registration of analysis task\" page\n open(\"/task/index2/#{@@pu.id}/#{@@pj.id}\")\n # test master of PJ is not registered\n assert is_text_present(_(\"Details of an analysis task\"))\n click $xpath[\"task\"][\"main_area_td4\"]\n assert !60.times{ break if (is_text_present(_(\"Registration of an Analysis Task\")) rescue false); sleep 2 }\n\n click $xpath[\"task\"][\"general_control_tab\"]\n assert !60.times{ break if (is_text_present(_(\"Basic Setting\")) rescue false); sleep 2 }\n sleep 3\n select \"analyze_type\", \"label=#{@individual}\"\n sleep 3\n click $xpath[\"task\"][\"master_tab\"]\n assert !60.times{ break if (is_text_present(_(\"Select a master\")) rescue false); sleep 2 }\n # test for value of master into combobox in master tab\n assert_equal [\"sample_c_cpp\"], get_select_options(\"master_id\")\n assert is_text_present(_(\"Optional setting\"))\n # click link setup QAC\n assert is_text_present(\"qac\")\n sleep 3\n click $xpath[\"task\"][\"option_setup_link\"]\n # check log in the navigation bar\n assert !60.times{ break if (is_text_present(_(\"It returns to the state before a save.\")) rescue false); sleep 2 }\n # click link setup QAC++\n assert is_text_present(\"qacpp\")\n sleep 3\n click $xpath[\"task\"][\"option_setup_link2\"]\n sleep 2\n # check log in the navigation bar\n assert !60.times{ break if (is_text_present(_(\"It returns to the state before a save.\")) rescue false); sleep 2 }\n\n\n # logout\n logout\n\n end",
"title": ""
},
{
"docid": "ac94a857b99813ec9b97c01562b12822",
"score": "0.5514237",
"text": "def run\n # header\n cols = [:title, :candidates, :s30, :s40, :s50, :c_tm, :s_tm, :correct]\n puts cols.join(\"\\t\")\n\n # simhash: 5..9\n @matcher.options[:candidates] = :simhash\n 5.upto(9).each do |i|\n @matcher.options[:simhash_max_hamming] = i\n report(\"simhash #{i}\")\n end\n\n # ngrams: 5..3\n @matcher.options[:candidates] = :ngrams\n 5.downto(3).each do |i|\n @matcher.options[:ngram_overlaps] = i\n report(\"ngrams #{i}\")\n end\n\n # all\n @matcher.options[:candidates] = :all\n report(\"all\")\n end",
"title": ""
},
{
"docid": "9e612e3f77446cf5ca53617cfc02e609",
"score": "0.55123293",
"text": "def test_exercise_1128\n verify_method :exercise_1128,\n :with => [{param: [0, 0, 1, 2, 3, 3], expect: [0, 1, 2, 3]},\n {param: [0, 1, 2, 3], expect: [0, 1, 2, 3]},\n {param: [0, 0], expect: [0]},\n {param: [0], expect: [0]}]\n end",
"title": ""
},
{
"docid": "20f0605389a0cef5a52fd7abf5aae431",
"score": "0.55071694",
"text": "def morning_email_3\n # improves on old method by calculating slow/inefficient cases by looking\n # at performance relative to average _and_ sandard deviations.\n\n # Gather all the commits, agnostic of what branch(es) they belong to\n # sort them all in order of most recent to oldest\n start_date = 1.day.ago\n commit_ids = TestInstance.where(created_at: start_date..DateTime.now)\n .pluck(:commit_id).uniq\n @commits_tested = Commit.includes(test_case_commits: :test_case).find(commit_ids)\n @commits_tested.sort! { |a, b| -(a.commit_time <=> b.commit_time) }\n\n # Assign commits to their various branches. A commit might belong to more\n # than one branch, and that's okay; it won't result in duplicate db hits\n # since they're already loaded\n branch_ids = BranchMembership.where(commit_id: commit_ids)\n .pluck(:branch_id).uniq\n @branch_data = {}\n branch_ids.each do |branch_id|\n this_branch = Branch.includes(:commits).find(branch_id)\n # sorting is the same as @commits_tested, but we only include commits\n # that are part of the branch.\n @branch_data[this_branch] = @commits_tested.select do |commit|\n this_branch.commits.include? commit\n end\n end\n\n # make sure the main is the first branch displayed, if at all\n @ordered_branches = @branch_data.keys\n main_loc = @ordered_branches.map(&:id).index(Branch.main.id)\n if main_loc\n @ordered_branches.insert(\n 0, @ordered_branches.delete(@ordered_branches[main_loc])\n )\n end\n\n @commit_data = {}\n\n @commits_tested.each do |commit|\n test_case_commits = commit.test_case_commits.to_a\n res = {}\n res[:status] = case commit.status\n when 3 then :mixed\n when 2 then :checksums\n when 1 then :failing\n when 0 then :passing\n else\n :other\n end\n res[:tested_count] = (commit.passed_count + commit.failed_count +\n commit.mixed_count + commit.checksum_count)\n res[:computer_counts] = { total: commit.computer_count }\n res[:failing_cases] = test_case_commits.select { |tcc| tcc.status == 1 }\n res[:checksum_cases] = test_case_commits.select { |tcc| tcc.status == 2 }\n res[:mixed_cases] = test_case_commits.select { |tcc| tcc.status == 3 }\n res[:pass_counts] = {}\n res[:fail_counts] = {}\n res[:checksum_counts] = {}\n\n test_case_commits.each do |tcc|\n res[:computer_counts][tcc] = tcc.computer_count\n res[:checksum_counts][tcc] = tcc.checksum_count if tcc.status >= 2\n if tcc.status >= 3\n res[:pass_counts][tcc] = tcc.test_instances.where(passed: true).count\n res[:fail_counts][tcc] = tcc.test_instances.where(passed: false).count\n end\n end\n\n @commit_data[commit] = res\n end\n @make_green = \"style='color: rgb(0, 153, 51)'\".html_safe\n @make_yellow = \"style= 'color: rgb(255, 153, 0)'\".html_safe\n @make_blue = \"style= 'color: rgb(78, 114, 219)'\".html_safe\n @make_red = \"style='color: rgb(204, 0, 0)'\".html_safe\n @make_cyan = \"style='color: rgb(79, 159, 181)'\".html_safe\n\n # set up countdown at top of the email\n @countdown_days = countdown_days\n @countdown_color = case countdown_color\n when :red then @make_red\n when :yellow then @make_yellow\n when :green then @make_green\n else\n nil \n end\n\n # set up issue count\n @release_blocker_count = nil\n @release_blocker_count = Commit.api.issues(Commit.repo_path,\n labels: 'release-blocker', state: 'open').length\n @release_blocker_color = if @release_blocker_count.zero?\n @make_green\n else\n @make_red\n end\n\n # send the message\n mail(to: 'mesa-developers@lists.mesastar.org, p7r3d3c7y5u1u9e8@mesadevelopers.slack.com',\n subject: \"MesaTestHub Report #{Date.today}\")\n end",
"title": ""
},
{
"docid": "411312250dbf31206afd7f32298ce046",
"score": "0.55042595",
"text": "def test_report_success_output_after_successfully_cracked\n\t\tguess = 'axel'\n\t\ttarget = Digest::MD5.hexdigest(guess)\n\t\tnum_tries = @pass_cracker.num_tries\n\t\ttime_elapsed = @pass_cracker.timer.time_elapsed\n\n\t\tassert_output(/Cracked password in #{num_tries} tries, time elapsed: #{0.0}\\nThe password is axel.\\n/){@pass_cracker.successfully_cracked?(guess, target)}\n\tend",
"title": ""
},
{
"docid": "fb5cbb70be3c1a1436415a1e7c3b5a1f",
"score": "0.55003405",
"text": "def createTeamCampaignSpecificCause(teamcampaign_url, camp_org, camp_title, camp_story, camp_goalamount, camp_goaldate)\n\t\n\tputs \"************** START : Create Team Campaign Page ****************\"\t\n\t$camp_title = camp_title\n\t$browser.open teamcampaign_url\n\t$browser.wait_for_page_to_load \n\tputs \"Step 1 : Entering valid details for creating Team Campaign page\"\n\t$browser.click \"campaign_fundraise_for_any_org_true\"\n\t$browser.type \"campaign_title\", $camp_title\n\t$browser.type \"campaign_intro\", camp_story\n\t$browser.type \"//body[@id='tinymce']\", camp_story\n\t$browser.click \"//a[@id='campaign_about_numlist']/span\"\n\t$browser.type \"campaign_goal_amount\", camp_goalamount\n\t$browser.click \"campaign_start_at\"\n\t$browser.click camp_goaldate\n\t$browser.click \"campaign_end_at\"\n\t$browser.click camp_goaldate\n\t$browser.click \"campaign_enable_offline_donations\"\n\t#***************** Button position check *****************#\n\t@createteambutton_topposition = $browser.get_element_position_top \"//button[@type='submit']\"\n\tputs \"CreateTeam button Top position : #{@createteambutton_topposition}\"\n\tif @createteambutton_topposition == '258'\n\t\tputs \"UI Check : Pass. CreateTeam button is present at the correct position in CreateTeam screen.\"\n\telse\n\t\tputs \"UI Check : Fail. CreateTeam button is not present at the correct position in CreateTeam screen.\"\n\tend\n\t$browser.click \"//button[@type='submit']\"\n\t$browser.wait_for_page_to_load \n\tbegin\n\t\tassert $browser.is_text_present(\"Congratulations! Your team has been created.\")\n\t\tputs \"Step 2 : Passed. Team Campaign for #{camp_org} was created successfully.\"\n\trescue Test::Unit::AssertionFailedError\n\t\tputs \"Step 2 : Failed. Team Campaign for #{camp_org} was not created successfully.\"\n\tend\n\tbegin\n\t\tassert $browser.is_text_present(\"of $101\")\n\t\tputs \"Step 3 : Passed. Entered Campaign goal amount gets displayed in Story page.\"\n\trescue Test::Unit::AssertionFailedError\n\t\tputs \"Step 3 : Failed. Incorrect Campaign goal amount gets displayed in Story page.\"\n\tend\n\tbegin\n\t\tassert $browser.is_text_present(\"#{$camp_title}\")\n\t\tputs \"Step 4 : Passed. Entered Campaign title gets displayed in Story page.\"\n\trescue Test::Unit::AssertionFailedError\n\t\tputs \"Step 4 : Failed. Incorrect Campaign title gets displayed in Story page.\"\n\tend\n\tbegin\n\t\tassert $browser.is_text_present(\"to start\")\n\t\tputs \"Step 5 : Passed. Count says 'to start' label.\"\n\trescue Test::Unit::AssertionFailedError\n\t\tputs \"Step 5 : Failed. Count doesn't say 'to start' label.\"\n\tend\n\t\n\tputs \"************** END : Create Team Campaign Page ****************\"\t\n\t\nend",
"title": ""
},
{
"docid": "84f5ee5692f9c6851cfaeadc76d28ca9",
"score": "0.5496563",
"text": "def run_tests()\n check_solution(1,\"aaabbc\", \"3a2bc\")\n check_solution(2, \"xxyyyyzz\", \"2x4y2z\")\n check_solution(3, \"qqqqq\", \"5q\")\n check_solution(4, \"mississippi\", \"mi2si2si2pi\")\nend",
"title": ""
},
{
"docid": "84f5ee5692f9c6851cfaeadc76d28ca9",
"score": "0.5496563",
"text": "def run_tests()\n check_solution(1,\"aaabbc\", \"3a2bc\")\n check_solution(2, \"xxyyyyzz\", \"2x4y2z\")\n check_solution(3, \"qqqqq\", \"5q\")\n check_solution(4, \"mississippi\", \"mi2si2si2pi\")\nend",
"title": ""
},
{
"docid": "84f5ee5692f9c6851cfaeadc76d28ca9",
"score": "0.5496563",
"text": "def run_tests()\n check_solution(1,\"aaabbc\", \"3a2bc\")\n check_solution(2, \"xxyyyyzz\", \"2x4y2z\")\n check_solution(3, \"qqqqq\", \"5q\")\n check_solution(4, \"mississippi\", \"mi2si2si2pi\")\nend",
"title": ""
},
{
"docid": "8565de233139e9ad6a1506a3006ea95d",
"score": "0.5492029",
"text": "def runTest(browser)\n puts \"Step 2: At step description here\"\n #Do shit here\n #....\n puts \"Step 3: ....\"\n #Do more shit here\n #....\n\n puts \"Expected Result:\"\n puts \"Result that we expect to happen.\"\n\n if true #Test passed condition here\n self.passed = true\n puts \"TEST PASSED. Add some description/details here\"\n else #Test failed condition here\n self.passed = false\n puts \"TEST FAILED. Show what we have screwed up\"\n end\n end",
"title": ""
},
{
"docid": "8fbc98d9068bd9c82033a031286f0a1e",
"score": "0.54909277",
"text": "def tests; end",
"title": ""
},
{
"docid": "8fbc98d9068bd9c82033a031286f0a1e",
"score": "0.54909277",
"text": "def tests; end",
"title": ""
},
{
"docid": "f1d8f6a618c8625af9012ebdfa3c1027",
"score": "0.54904276",
"text": "def clean_exit\n\ttasks_passed = all_by_exit_status(@task_data['test_exit_status_passed'])\n\ttasks_failed = all_by_exit_status(@task_data['test_exit_status_failed'])\n\ttasks_skipped = all_by_exit_status(@task_data['test_exit_status_skipped'])\n @task_data.merge!({'execution_time' => @chain.execution_time, 'tasks_passed' => tasks_passed, 'tasks_failed' => tasks_failed, 'tasks_skipped' => tasks_skipped})\n \n\tPublisher.new(@task_data).publish_reports\t \n\t\n if tasks_failed.length == 0\n\t\tputs \"[TCRESULT]=SUCCESSFUL\\n\"\n\telse\n\t\tputs \"[TCRESULT]=UNSUCCESSUL\\n\"\n\tend\n\t\n\tputs(\"\\n==> DONE\\n\\n\")\n puts(\"[ :: [SESSION]\\n\")\n puts(\"[TC] -- tests passed : #{tasks_passed.length.to_s}\\n\")\n puts(\"[TC] -- tests failed : #{tasks_failed.length.to_s}\\n\")\n puts(\"[TC] -- tests executed : #{@chain.executed_tasks.to_s}\\n\")\n puts(\"[TC] -- tests skipped : #{tasks_skipped.length.to_s}\\n\") \n puts(\"[TC] -- execution time : #{@chain.execution_time.to_s} secs\\n\")\t\n\tputs(\" -- reports prepared: #{@reports_dir}\\n\")\n puts(\" -- logs prepared : #{@logs_dir}\\n\")\n\t\n\tputs(\"[TC] The test run contained the following tasks :\\n\")\n\t@chain.get_tasknames.each do |taskname|\n\t\tputs(\"[TC] -> #{taskname}\\n\")\t\n\tend\n\t\t\n\tif @task_data['test_retry']\n\t\tputs(\" -- tests re-tried : #{@tests_retried_counter.to_s}\\n\")\n\tend\n\tif tasks_failed.length > 0\n\t\tputs(\"\\n\\n==> STATUS: [ some tests failed - execution failed ]\\n\")\n\t\texit(1)\n\tend\n\texit(0)\nend",
"title": ""
},
{
"docid": "b763f66c23bd0fc399436e1b6b728784",
"score": "0.5487734",
"text": "def check_rerun\n\tcontent = get_junit_line\n\n\t# Check number of failures, nb of errors, nb of tests\n\t/failures=\\\"(?<failure>[^\\\"]*)\\\"/ =~ content\n\t/errors=\\\"(?<error>[^\\\"]*)\\\"/ =~ content\n\t# /skipped=\\\"([^\\\"]*)\\\"/ =~ content\n\t/tests=\\\"(?<test>[^\\\"]*)\\\"/ =~ content\n\n\terrors = error.to_i + failure.to_i\n\tratio = errors.to_f / test.to_f\n\n\t# Debug line and return results\n\tif ratio == 0\n\t\tputs \"Nothing to rerun\"\n\telsif ratio > 0 && ratio < 0.4\n\t\tputs \"Rerun\"\n\telse\n\t\tputs \"Too many errors (#{errors} / #{test}) , please launch again the whole job\"\n\tend\n\tratio\nend",
"title": ""
},
{
"docid": "157d013b7fb232b26c691a6a766f783a",
"score": "0.5483695",
"text": "def read_and_run(access_token, issue_key, issue_id)\n errors = []\n execution_id = 0\n begin \n test_steps = @j2jira.read_test_data(issue_key, issue_id)\n execution_id = @j2jira.new_execution(issue_key, issue_id)\n test_steps.each_with_index do |step, index|\n api_spec_json = JSON.parse(step[\"step\"]) \n errors = @validator.validate_api_spec(api_spec_json)\n return errors unless errors.size.eql?(0)\n api_req_body = step[\"data\"]\n res_schema = step[\"result\"]\n controls = api_spec_json[\"api_spec\"][\"controls\"]\n delay_minutes = controls.nil? ? 0 : controls[\"delay_minutes\"]\n return [] if delay_minutes.eql?(-1)\n puts \"before sleep: #{Time.now}\"\n sleep delay_minutes*60 unless delay_minutes.eql?(0)\n puts \"after sleep #{Time.now}\"\n errs = run_step(access_token, api_spec_json, api_req_body, res_schema)\n errors << \"step #{index} failed with errors: #{errs.join('|')}\" unless errs.size.eql?(0)\n #skip iteration when errors exists in a given step.\n break if errors.size > 0 \n end \n rescue JSON::ParserError => pe\n errors << \"error in test case, please check json format for Test Step, Test Data and Expected Result or the API response\" \n rescue Exception => e \n puts \"exception occured #{e}\"\n errors << \"something went wrong - #{e.message}\"\n ensure\n puts \"do we have errors for the Jira Issue: #{issue_key}? #{errors}\"\n @failed_executions+= 1 unless errors.size.eql?(0)\n @j2jira.update_test_case(execution_id, issue_key, errors) unless execution_id.eql?(0)\n @j2jira.issue_comment(issue_key, errors) \n end \n end",
"title": ""
},
{
"docid": "f56acb9862bf951deaae545e8ff1820a",
"score": "0.5483482",
"text": "def test_scenario8\n \n data = [[File.dirname(__FILE__)+'/data/iris.csv', {\"petal length\" => 5}, \"000004\", 'Iris-versicolor', {}, \"probability\"],\n [File.dirname(__FILE__)+'/data/iris.csv', {\"petal length\" => 2}, \"000004\", 'Iris-setosa', {}, \"probability\" ]\n ]\n puts\n puts \"Scenario: Successfully comparing predictions for logistic regressions with operating kind\"\n\n data.each do |filename, data_input, objective, prediction_result, params, operating_point|\n puts\n puts \"Given I create a data source uploading a <%s> file\" % filename\n source = @api.create_source(filename, {'name'=> 'source_test', 'project'=> @project[\"resource\"]})\n\n puts \"And I wait until the source is ready\"\n assert_equal(BigML::HTTP_CREATED, source[\"code\"])\n assert_equal(1, source[\"object\"][\"status\"][\"code\"])\n assert_equal(@api.ok(source), true)\n \n puts \"And I create a dataset\"\n dataset=@api.create_dataset(source)\n\n puts \"And I wait until the dataset is ready\"\n assert_equal(BigML::HTTP_CREATED, dataset[\"code\"])\n assert_equal(1, dataset[\"object\"][\"status\"][\"code\"])\n assert_equal(@api.ok(dataset), true)\n \n puts \"And I create a logistic regression with objective\" \n logisticregression=@api.create_logisticregression(dataset)\n\n puts \"And I wait until the logistic regression is ready\"\n assert_equal(BigML::HTTP_CREATED, logisticregression[\"code\"])\n assert_equal(1, logisticregression[\"object\"][\"status\"][\"code\"])\n assert_equal(@api.ok(logisticregression), true)\n \n puts \"And I create a local logistic regression\"\n localLogisticRegression = BigML::Logistic.new(logisticregression)\n\n puts \"When I create a prediction for <%s>\" % [JSON.generate(data_input)]\n prediction = @api.create_prediction(logisticregression['resource'], data_input, {\"operating_kind\" => operating_point})\n \n assert_equal(BigML::HTTP_CREATED, prediction[\"code\"])\n assert_equal(@api.ok(prediction), true)\n\n puts \"Then the prediction for <%s> is <%s>\" % [objective, prediction_result]\n \n if !prediction['object']['prediction'][objective].is_a?(String)\n assert_equal(prediction['object']['prediction'][objective].to_f.round(5), prediction_result.to_f.round(5))\n else\n assert_equal(prediction['object']['prediction'][objective], prediction_result)\n end\n \n puts \"And I create a local prediction for <%s>\" % JSON.generate(data_input)\n local_prediction = localLogisticRegression.predict(data_input, {\"operating_kind\" => operating_point})\n \n puts \"Then the local prediction is <%s>\" % prediction_result\n \n if local_prediction.is_a?(Array)\n local_prediction = local_prediction[0]\n elsif local_prediction.is_a?(Hash)\n local_prediction = local_prediction['prediction']\n else\n local_prediction = local_prediction\n end \n\n assert_equal(local_prediction, prediction_result)\n \n end\n \n end",
"title": ""
},
{
"docid": "814d562c56ffc425561dd9ef077463b8",
"score": "0.54809433",
"text": "def test_scenario15\n data = [['data/iris.csv', {\"weight_field\" => \"000000\", \"missing_numerics\" => false}, {\"petal width\" => 1.5, \"petal length\" => 2, \"sepal width\" => 1}, 'Iris-versicolor', 0.9547, '000004']]\n puts \"\"\n puts \"Scenario: Successfully comparing predictions with text options\"\n\n data.each do |filename, parms, data_input, prediction_result, probability, objective|\n puts\n puts \"Given I create a data source uploading a <%s> file\" % filename\n\n source = @api.create_source(File.dirname(__FILE__)+\"/\"+filename, {'name'=> 'source_test', 'project'=> @project[\"resource\"]})\n\n puts \"And I wait until the source is ready\"\n assert_equal(BigML::HTTP_CREATED, source[\"code\"])\n assert_equal(1, source[\"object\"][\"status\"][\"code\"])\n assert_equal(@api.ok(source), true)\n\n puts \"And I create a dataset\"\n dataset=@api.create_dataset(source)\n\n puts \"And I wait until the dataset is ready\"\n assert_equal(BigML::HTTP_CREATED, dataset[\"code\"])\n assert_equal(1, dataset[\"object\"][\"status\"][\"code\"])\n assert_equal(@api.ok(dataset), true)\n \n puts \"And I create a logistic regression model with objective <%s> and params <%s>\" % [objective, parms]\n logistic_regression = @api.create_logisticregression(dataset, {'objective_field' => objective}.merge(parms))\n \n puts \"And I wait until the logistic regression model is ready\"\n assert_equal(BigML::HTTP_CREATED, logistic_regression[\"code\"])\n assert_equal(@api.ok(logistic_regression), true)\n\n puts \"And I create a local logistic regression model\"\n localLogisticRegression = BigML::Logistic.new(logistic_regression)\n\n puts \"When I create a logistic regression prediction for <%s>\" % JSON.generate(data_input)\n prediction = @api.create_prediction(logistic_regression, data_input)\n assert_equal(BigML::HTTP_CREATED, prediction[\"code\"])\n\n puts \"Then the logistic regression prediction is <%s>\" % prediction_result\n assert_equal(prediction_result, prediction[\"object\"][\"output\"])\n\n puts \"And the logistic regression probability for the prediction is <%s>\" % probability\n\n prediction[\"object\"][\"probabilities\"].each do |prediction_value, remote_probability|\n if prediction_value == prediction[\"object\"][\"output\"]\n assert_equal(remote_probability.to_f.round(3),probability.round(3))\n break\n end\n end\n\n puts \"And I create a local logistic regression prediction for <%s>\" % JSON.generate(data_input)\n local_prediction = localLogisticRegression.predict(data_input, {\"full\" => true})\n\n puts \"Then the local logistic regression prediction is <%s>\" % prediction_result\n assert_equal(prediction_result, local_prediction[\"prediction\"])\n\n puts \"And the local logistic regression probability for the prediction is <%s>\" % probability\n assert_equal(probability.round(4), local_prediction[\"probability\"].round(4))\n\n end\n end",
"title": ""
},
{
"docid": "78a5fad33facdfceebce0da90849b574",
"score": "0.5475844",
"text": "def test_results_victory\r\n assert_output(\"Going home victorious!\\n\") { @g.results(10) }\r\n end",
"title": ""
},
{
"docid": "70d3a24989fd4041fe9737593069bf5b",
"score": "0.5475808",
"text": "def submission_params\n params.require(:submission).permit(:full_name, :email, :project_repo, :project_url, :oop_best_practices, :modular_dev, :workflow_understanding, :testing, :database_knowledge, :debugging, :problem_solving, :javascript, :html, :css, :teamwork, :self_motivation, :communication_skils, :energy_level, :intelligence)\n end",
"title": ""
},
{
"docid": "f9b8a3c689f304a84e5c9cb4c0c150e5",
"score": "0.5473168",
"text": "def test_004\n\n # login\n login\n\n # Open PU management page\n open_pu_management_page_1\n\n # #Find a PU\n #Pu created\n pu_name = 'pu'\n register_pu(pu_name)\n @@pu = Pu.find(:last)\n open \"/devgroup/pu_index/#{@@pu.id}\"\n wait_for_page_to_load \"30000\"\n\n sleep 2\n\n #Find a PJ of PU\n open_pj_management_page(@@pu.id)\n pj_name = 'pj'\n register_pj(pj_name)\n @@pj = Pj.find(:last)\n open\"/devgroup/pj_index/#{@@pu.id}/#{@@pj.id}\"\n wait_for_page_to_load \"30000\"\n\n # test for individual analysis task\n open(\"/task/index2/#{@@pu.id}/#{@@pj.id}\")\n #The contents of a display of a \"master\" tab become\n # a thing for individual analysis task registration.\n click $xpath[\"task\"][\"main_area_td4\"]\n wait_for_page_to_load \"30000\"\n assert is_text_present(_(\"Registration of an Analysis Task\"))\n # select analyze type: 全体解析 (Analysis of all)\n select \"analyze_type\", \"label=#{@overall}\"\n click $xpath[\"task\"][\"master_tab\"]\n assert !60.times{ break if (is_text_present(_(\"Select a master\")) rescue false); sleep 2 }\n #There is no display below \"selection of the upload method of an individual analysis file.\"\n assert !is_text_present(_(\"Select the upload method of individual analysis files\"))\n\n @@pu.destroy\n # logout\n logout\n\n end",
"title": ""
},
{
"docid": "e237cb8d4ac8b462dee64461319928ad",
"score": "0.54721653",
"text": "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",
"title": ""
},
{
"docid": "8bf3edafb0e25a3fcb95e5cd7efeaafc",
"score": "0.5466525",
"text": "def test_NewQuestionText \n randomName = SecureRandom.hex(4)\n randomReq = SecureRandom.hex(4)\n \n randomEmail = SecureRandom.hex(4) \n randomLastName = SecureRandom.hex(4)\n \n #PRECONDITION: Must be logged in\n Common.login(Users::USER_EMAIL, Users::PASSWORD)\n \n #Create an empty Question Sets\n self.CreateQuestionSetEmpty(randomName)\n \n #Create Job with Question Set asociated\n Common.goToTab(HomePage::REQUISITIONS_LINK_XPATH)\n $wait.until{\n $browser.find_element(:xpath => RequisitionsHomePage::REQUISITIONS_PAGE_BTN_NEW_XPATH).displayed?\n }\n Common.click_and_load(RequisitionsHomePage::REQUISITIONS_PAGE_BTN_NEW_XPATH) \n $wait.until{\n $browser.find_element(:xpath => RequisitionsNewAndEdit::REQUISITIONS_NEW_BTN_CONTINUE_XPATH).displayed?\n }\n Common.click_and_load(RequisitionsNewAndEdit::REQUISITIONS_NEW_BTN_CONTINUE_XPATH) \n $wait.until{\n $browser.find_element(:xpath => RequisitionsNewAndEdit::REQUISITIONS_NEW_QUESTIONS_SET_XPATH).displayed?\n }\n $browser.find_element(:id => RequisitionsNewAndEdit::REQUISITIONS_NEW_JOB_TITLE_ID).send_keys randomReq\n $browser.find_element(:xpath => RequisitionsNewAndEdit::REQUISITIONS_NEW_PRIMARY_RECRUITER_TEXT_XPATH).send_keys RequisitionsNewAndEdit::REQUISITIONS_NEW_DATA_PRIMARY_RECRUITER_TEXT\n $browser.find_element(:xpath => RequisitionsNewAndEdit::REQUISITIONS_NEW_LOCATION_XPATH).send_keys RequisitionsNewAndEdit::REQUISITIONS_NEW_DATA_LOCATION_TEXT\n $browser.find_element(:xpath => RequisitionsNewAndEdit::REQUISITIONS_NEW_DEPARTAMENT_OPTION_XPATH).click\n $browser.find_element(:xpath => RequisitionsNewAndEdit::REQUISITIONS_NEW_MIN_SALARY_XPATH).send_keys RequisitionsNewAndEdit::REQUISITIONS_NEW_DATA_MIN_SALARY_TEXT\n $browser.find_element(:xpath => RequisitionsNewAndEdit::REQUISITIONS_NEW_MAX_SALARY_XPATH).send_keys RequisitionsNewAndEdit::REQUISITIONS_NEW_DATA_MAX_SALARY_TEXT\n $browser.find_element(:xpath => RequisitionsNewAndEdit::REQUISITIONS_NEW_QUESTIONS_SET_XPATH).send_keys randomName\n \n unless $browser.find_element(:xpath => RequisitionsNewAndEdit::REQUISITIONS_NEW_POST_JOB_BOX_XPATH).attribute(\"checked\")\n $browser.find_element(:xpath => RequisitionsNewAndEdit::REQUISITIONS_NEW_POST_JOB_BOX_XPATH).click\n end\n \n Common.click_and_load(RequisitionsNewAndEdit::REQUISITIONS_NEW_BTN_SAVE_XPATH)\n Common.displayed(RequisitionsDetail::REQUISITIONS_DETAIL_NAME_XPATH)\n \n # 1 - Click on Tab \"Question Sets\"\n Common.goToTab(HomePage::QUESTION_SETS_LINK_XPATH)\n $wait.until{\n $browser.find_element(:xpath => QuestionSetsHomePage::QUESTION_SETS_HOME_BTN_NEW_XPATH).displayed?\n }\n \n # 2 - Click on previously created Question Set's name from the list\n Common.click_and_load(QuestionSetsHomePage::QUESTION_SET_LIST_XPATH + \"//*[text()[contains(.,'\" + randomName + \"')]]\")\n $wait.until{\n $browser.find_element(:xpath => QuestionSetsDetail::QUESTION_SETS_DETAIL_NEW_QUESTION_XPATH).displayed? \n }\n \n # 3 - Click on \"New Question\"\n Common.click_and_load(QuestionSetsDetail::QUESTION_SETS_DETAIL_NEW_QUESTION_XPATH)\n $wait.until{\n $browser.find_element(:xpath => QuestionSetsNewQuestion::QUESTION_SETS_NEW_QUESTION_NAME_XPATH).displayed?\n }\n \n # 4 - Fill all the fields\n $browser.find_element(:xpath => QuestionSetsNewQuestion::QUESTION_SETS_NEW_QUESTION_NAME_XPATH).send_keys QuestionSetsNewQuestion::QUESTION_SETS_NEW_QUESTION_NAME_TEXT_XPATH\n $browser.find_element(:xpath => QuestionSetsNewQuestion::QUESTION_SETS_NEW_QUESTION_ORDER_XPATH).send_keys QuestionSetsNewQuestion::QUESTION_SETS_NEW_QUESTION_ORDER_INT_XPATH\n $browser.find_element(:xpath => QuestionSetsNewQuestion::QUESTION_SETS_NEW_QUESTION_QUESTION_XPATH).send_keys QuestionSetsNewQuestion::QUESTION_SETS_NEW_QUESTION_NAME_TEXT_XPATH\n\n # 5 - Check \"Text\" box\n unless $browser.find_element(:xpath => QuestionSetsNewQuestion::QUESTION_SETS_NEW_QUESTION_TEXT_XPATH).attribute(\"checked\")\n $browser.find_element(:xpath => QuestionSetsNewQuestion::QUESTION_SETS_NEW_QUESTION_TEXT_XPATH).click\n end\n \n # 6 - Click on \"Save\"\n Common.click_and_load(QuestionSetsNewQuestion::QUESTION_SETS_NEW_QUESTION_BTN_SAVE_XPATH)\n \n $wait.until{\n $browser.find_element(:xpath => QuestionDetailPage::QUESTION_DETAIL_NEW_ANSWER_XPATH).displayed?\n }\n \n #RESULTS\n # 6 - You will be redirected to the \"Question\" page.\n assert $wait.until{\n $browser.find_element(:xpath => QuestionDetailPage::QUESTION_DETAIL_QUESTION_NAME_XPATH + \"//*[text()[contains(.,'\" + QuestionSetsNewQuestion::QUESTION_SETS_NEW_QUESTION_NAME_TEXT_XPATH + \"')]]\")\n $browser.find_element(:xpath => QuestionDetailPage::QUESTION_DETAIL_TEXT_XPATH + \"//*[@title='Checked']\") \n }\n \n # 7 - Click on Tab \"Question Sets\"\n Common.goToTab(HomePage::QUESTION_SETS_LINK_XPATH)\n $wait.until{\n $browser.find_element(:xpath => QuestionSetsHomePage::QUESTION_SETS_HOME_BTN_NEW_XPATH).displayed?\n }\n \n # 8 - Click on previously created Question Set's name from the list\n Common.click_and_load(QuestionSetsHomePage::QUESTION_SET_LIST_XPATH + \"//*[text()[contains(.,'\" + randomName + \"')]]\")\n $wait.until{\n $browser.find_element(:xpath => QuestionSetsDetail::QUESTION_SETS_DETAIL_NEW_QUESTION_XPATH).displayed? \n }\n \n # 9 - Click on \"New Question\"\n Common.click_and_load(QuestionSetsDetail::QUESTION_SETS_DETAIL_NEW_QUESTION_XPATH)\n $wait.until{\n $browser.find_element(:xpath => QuestionSetsNewQuestion::QUESTION_SETS_NEW_QUESTION_NAME_XPATH).displayed?\n }\n \n # 10 - Fill all the fields\n $browser.find_element(:xpath => QuestionSetsNewQuestion::QUESTION_SETS_NEW_QUESTION_NAME_XPATH).send_keys QuestionSetsNewQuestion::QUESTION_SETS_NEW_QUESTION_NAME_2_TEXT_XPATH\n $browser.find_element(:xpath => QuestionSetsNewQuestion::QUESTION_SETS_NEW_QUESTION_ORDER_XPATH).send_keys QuestionSetsNewQuestion::QUESTION_SETS_NEW_QUESTION_ORDER_2_INT_XPATH\n $browser.find_element(:xpath => QuestionSetsNewQuestion::QUESTION_SETS_NEW_QUESTION_QUESTION_XPATH).send_keys QuestionSetsNewQuestion::QUESTION_SETS_NEW_QUESTION_NAME_2_TEXT_XPATH\n\n # 11 - Uncheck \"Text\" box\n if $browser.find_element(:xpath => QuestionSetsNewQuestion::QUESTION_SETS_NEW_QUESTION_TEXT_XPATH).attribute(\"checked\")\n $browser.find_element(:xpath => QuestionSetsNewQuestion::QUESTION_SETS_NEW_QUESTION_TEXT_XPATH).click\n end\n \n # 12 - Click on \"Save\"\n Common.click_and_load(QuestionSetsNewQuestion::QUESTION_SETS_NEW_QUESTION_BTN_SAVE_XPATH)\n \n $wait.until{\n $browser.find_element(:xpath => QuestionDetailPage::QUESTION_DETAIL_QUESTION_NAME_XPATH).displayed?\n } \n \n #RESULTS\n # 12 - You will be redirected to the \"Question\" page.\n assert $wait.until {\n $browser.find_element(:xpath => QuestionDetailPage::QUESTION_DETAIL_QUESTION_NAME_XPATH + \"//*[text()[contains(.,'\" + QuestionSetsNewQuestion::QUESTION_SETS_NEW_QUESTION_NAME_2_TEXT_XPATH + \"')]]\")\n $browser.find_element(:xpath => QuestionDetailPage::QUESTION_DETAIL_TEXT_XPATH + \"//*[@title='Not Checked']\") \n }\n \n Common.goToTab(HomePage::BOARD_SETUP_TAB_LINK_XPATH)\n Common.displayed(BoardSetupHomePage::CAREERS_LINK_LIST_XPATH)\n Common.click_and_load(BoardSetupHomePage::CAREERS_LINK_LIST_XPATH)\n CustomSettings.BoardSetupInit\n CustomSettings.ResumeRequired(false)\n CustomSettings.DefineEEOQuestions(false, false, false, false, false)\n #JobBoard without login \n CustomSettings.JobBoardLogin(false)\n \n # 13 - Apply to a job from the job board site, with Question Set asociated.\n $browser.get(HomePage::JOB_BOARD_URL)\n $wait.until{\n $browser.find_element(:xpath => JobBoardHomePage::JOB_BOARD_RETURN_TO_SEARCH_XPATH).displayed?\n }\n Common.click_and_load(JobBoardHomePage::JOB_BOARD_JOB_LIST_XPATH + \"//*[text()[contains(.,'\" + randomReq + \"')]]\") \n $wait.until{\n $browser.find_element(:xpath => JobBoardJobDetail::JOB_BOARD_APPLY_JOB_LINK_XPATH).displayed?\n }\n Common.click_and_load(JobBoardJobDetail::JOB_BOARD_APPLY_JOB_LINK_XPATH) \n $wait.until{\n $browser.find_element(:xpath => JobBoardJobDetail::JOB_BOARD_APPLY_JOB_EMAIL_XPATH).displayed?\n }\n $browser.find_element(:xpath => JobBoardJobDetail::JOB_BOARD_APPLY_JOB_EMAIL_XPATH).send_keys randomEmail + Users::EMAIL_DOMAIN\n $browser.find_element(:xpath => JobBoardJobDetail::JOB_BOARD_APPLY_JOB_FIRST_NAME_XPATH).send_keys randomEmail\n $browser.find_element(:xpath => JobBoardJobDetail::JOB_BOARD_APPLY_JOB_LAST_NAME_XPATH).send_keys randomLastName\n \n #If How did you hear about us? is displayed\n begin\n aboutUsSelect = $browser.find_element(:xpath => JobBoardJobDetail::JOB_BOARD_APPLY_JOB_HEAR_ABOUT_US_XPATH).displayed?\n rescue\n aboutUsSelect = false\n end \n if aboutUsSelect\n $browser.find_element(:xpath => JobBoardJobDetail::JOB_BOARD_APPLY_JOB_HEAR_ABOUT_US_XPATH).send_keys \"Job Board\"\n end\n \n Common.click_and_load(JobBoardJobDetail::JOB_BOARD_APPLY_JOB_CONTINUE_XPATH)\n \n $wait.until{\n $browser.find_element(:xpath => JobBoardJobDetail::JOB_BOARD_APPLY_JOB_RETURN_JOBSEARCH_XPATH).displayed?\n }\n begin\n continue_button = $browser.find_element(:xpath => JobBoardJobDetail::JOB_BOARD_APPLY_JOB_CONTINUE_XPATH).displayed?\n rescue\n continue_button = false\n end \n if continue_button\n Common.click_and_load(JobBoardJobDetail::JOB_BOARD_APPLY_JOB_CONTINUE_XPATH)\n end\n \n $wait.until{\n $browser.find_element(:xpath => JobBoardJobDetail::JOB_BOARD_APPLY_JOB_RETURN_JOBSEARCH_XPATH).displayed?\n }\n begin\n continue_button = $browser.find_element(:xpath => JobBoardJobDetail::JOB_BOARD_APPLY_JOB_CONTINUE_XPATH).displayed?\n rescue\n continue_button = false\n end \n if continue_button\n Common.click_and_load(JobBoardJobDetail::JOB_BOARD_APPLY_JOB_CONTINUE_XPATH)\n end\n \n \n $wait.until{\n $browser.find_element(:xpath => JobBoardJobDetail::JOB_BOARD_APPLY_JOB_SUBMIT_XPATH).displayed?\n }\n \n #14 - Verify that questions from question set are shown correctly, check their order.\n \n assert $wait.until {\n $browser.find_element(:xpath, JobBoardJobDetail::JOB_BOARD_APPLY_JOB_QUESTION_1_TR_XPATH + \"//textarea\").displayed?\n $browser.find_element(:xpath, JobBoardJobDetail::JOB_BOARD_APPLY_JOB_QUESTION_2_TR_XPATH + \"//select\").displayed?\n } \n #Check order\n assert_match QuestionSetsNewQuestion::QUESTION_SETS_NEW_QUESTION_NAME_TEXT_XPATH, $browser.find_element(:xpath => JobBoardJobDetail::JOB_BOARD_APPLY_JOB_QUESTION_NAME_1_XPATH).text\n assert_match QuestionSetsNewQuestion::QUESTION_SETS_NEW_QUESTION_NAME_2_TEXT_XPATH, $browser.find_element(:xpath => JobBoardJobDetail::JOB_BOARD_APPLY_JOB_QUESTION_NAME_2_XPATH).text\n \n end",
"title": ""
},
{
"docid": "01c0619013227b05e3b52c2c45eff571",
"score": "0.54653585",
"text": "def test_002_wip\r\n\r\n begin\r\n\r\n sTestCase_Name = \"test_002_wip\"\r\n puts2(\"Starting Testcase: #{sTestCase_Name}\")\r\n\r\n sleep(2)\r\n \r\n=begin\r\n\r\n# Example outputs on Win7 64bit for FF3.6.28 and IE 8\r\n\r\nBrowser name: Netscape\r\nBrowser version: 5.0 (Windows; en-US)\r\nCookies Enabled: true\r\nPlatform: Win32\r\nUser Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.2.28) Gecko/20120306 Firefox/3.6.28\r\nappCodeName: Mozilla\r\n\r\nBrowser name: Microsoft Internet Explorer\r\nBrowser version: 4.0 (compatible; MSIE 8.0; Windows NT 6.0; WOW64; Trident/4.0; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; .NET CLR 3.5.30729; .NET CLR 3.0.30729; .NET4.0C; MS-RTC LM 8)\r\nCookies Enabled: true\r\nPlatform: Win32\r\nUser Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; WOW64; Trident/4.0; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; .NET CLR 3.5.30729; .NET CLR 3.0.30729; .NET4.0C; MS-RTC LM 8)\r\nappCodeName: Mozilla\r\n\r\n=end\r\n\r\n\r\n\r\n\r\n if($bUseWebDriver == false)\r\n\t puts2(\"Browser appName: \" + $browser.execute_script(\"window.navigator.appName\").to_s)\r\n\t puts2(\"Browser appVersion: \" + $browser.execute_script(\"window.navigator.appVersion\").to_s)\r\n\t puts2(\"Cookies Enabled: \" + $browser.execute_script(\"window.navigator.cookieEnabled\").to_s)\r\n\t puts2(\"Platform: \" + $browser.execute_script(\"window.navigator.platform\").to_s)\r\n\t puts2(\"User Agent: \" + $browser.execute_script(\"window.navigator.userAgent\").to_s)\r\n\t puts2(\"appCodeName: \" + $browser.execute_script(\"window.navigator.appCodeName\").to_s)\r\n else\r\n\t puts2(\"Browser appName: \" + $browser.execute_script(\"return window.navigator.appName\").to_s)\r\n\t puts2(\"Browser appVersion: \" + $browser.execute_script(\"return window.navigator.appVersion\").to_s)\r\n\t puts2(\"Cookies Enabled: \" + $browser.execute_script(\"return window.navigator.cookieEnabled\").to_s)\r\n\t puts2(\"Platform: \" + $browser.execute_script(\"return window.navigator.platform\").to_s)\r\n\t puts2(\"User Agent: \" + $browser.execute_script(\"return window.navigator.userAgent\").to_s)\r\n\t puts2(\"appCodeName: \" + $browser.execute_script(\"return window.navigator.appCodeName\").to_s)\r\n end\r\n\r\n puts2(\"Brand: \" + $browser.brand())\r\n puts2(\"Version: \" + $browser.version())\r\n \r\n #puts2(\"Is jQuery active?\")\r\n #$browser.execute_script(\"return jQuery.active == 0\")\r\n\r\n rescue => e\r\n\r\n puts2(\"*** ERROR Backtrace: \" + e.message + \"\\n\" + e.backtrace.join(\"\\n\"), \"ERROR\")\r\n\r\n ensure\r\n\r\n $browser.close()\r\n\r\n end\r\n\r\nend",
"title": ""
},
{
"docid": "0140667604cdf3864d942c47cafabe13",
"score": "0.54599607",
"text": "def update_intest\n @context = 1\n update_submission\n end",
"title": ""
},
{
"docid": "3ba5d9cb2d2471490d5c07778f5849f1",
"score": "0.5459517",
"text": "def test02_donate_post_comment\n\t\n\t$Browser.click \"link=BROWSE\"\n\t$Browser.wait_for_page_to_load \n\tassert_equal \"Learn about nonprofits and donate to charity - Razoo\", $Browser.get_title\n\t$Browser.type \"parametricKeyword\", \"harvard college\"\n\tsleep 10\n\t$Browser.click \"link=Harvard College\"\n\t$Browser.wait_for_page_to_load \n\tassert_equal \"Harvard College - Razoo\", $Browser.get_title\n\t$Browser.click \"donation_amount\"\n\t$Browser.type \"donation_amount\", \"10\"\n\t$Browser.click \"storyDonateButton\"\n\t$Browser.wait_for_page_to_load \n\tassert_equal \"An inspiring place to donate and raise money - Razoo\", $Browser.get_title\n\t$Browser.click \"donationSubmit\"\n\t$Browser.wait_for_page_to_load \n\tbegin\n\t\tassert $Browser.is_text_present(\"Processing Donation...\")\n\t\tputs \"Processing Donation...\"\n\trescue Test::Unit::AssertionFailedError\n\t\t$verification_errors << $!\n\tend\n\tassert_equal \"An inspiring place to donate and raise money - Razoo\", $Browser.get_title\n\tbegin\n\t\tassert $Browser.is_text_present(\"$10.00\")\n\t\tputs \"$10.00 is present in the Thank You screen.\"\n\trescue Test::Unit::AssertionFailedError\n\t\t$verification_errors << $!\n\tend\n\tbegin\n\t\tassert $Browser.is_text_present(\"Harvard College\")\n\t\tputs \"Donation made to Harvard College\"\n\trescue Test::Unit::AssertionFailedError\n\t\t$verification_errors << $!\n\tend\n\t$Browser.click \"thankYouEgress\"\n\t$Browser.wait_for_page_to_load \n\tassert_equal \"Harvard College - Razoo\", $Browser.get_title\n\t$Browser.type \"comment_body\", \"Im posting the comment!!\"\n\tsleep 5\n\t$Browser.click \"comment_submit\"\n\tsleep 10\n\tassert $Browser.is_text_present(\"Thank you, your comment has been posted.\")\n\tputs \"Text is present\"\n\t$Browser.click \"link = Post your comment to Facebook\"\n\t\n\tsleep 10\n\t$Browser.wait_for_pop_up \"_blank\", \"30\"\n\t$Browser.select_window \"name=_e_2QUk\"\n\t$Browser.type \"email\", \"fbuser1@rediffmail.com\"\n\t$Browser.type \"pass\", \"111111\"\n\t$Browser.click \"login\"\n\t$Browser.wait_for_page_to_load \n\t\t\n\tbegin\n\t\tassert $Browser.is_text_present(\"Im posting the comment!!\")\n\trescue Test::Unit::AssertionFailedError\n\t\t$verification_errors << $!\n\tend\n\t$Browser.click \"publish\"\n\t$Browser.wait_for_page_to_load \n\tbegin\n\t\tassert $Browser.is_text_present(\"Im posting the comment!!\")\n\t\tputs \"Comment posted successfully. Comment verified in Story page.\"\n\trescue Test::Unit::AssertionFailedError\n\t\t$verification_errors << $!\n\tend\n\t$Browser.click \"link=ACCOUNT\"\n\t$Browser.wait_for_page_to_load \n\tassert_equal \"An inspiring place to donate and raise money - Razoo\", $Browser.get_title\n\tbegin\n\t\tassert $Browser.is_text_present(\"\\\"Im posting the comment!!\\\"\")\n\t\tputs \"Comment verified in My Account screen.\"\n\trescue Test::Unit::AssertionFailedError\n\t\t$verification_errors << $!\n\tend\nend",
"title": ""
},
{
"docid": "45c6f09fcd92f4a4421a5dbe4c1a7741",
"score": "0.5456255",
"text": "def testNominal\n setupTest do |iTasksFileName, iTicketsFileName|\n $Context[:OS_ExecAnswers] = [\n # svn co => success\n [ 0, '' ],\n # deliver => success, generating files\n [ 0, '', @@Generator_SingleDummyGem ]\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 ]\n }\n } ),\n iSlaveActions\n )\n end\n end\n end",
"title": ""
},
{
"docid": "3e7f1484e12f9b96a4e0e4e8fcfda202",
"score": "0.54525536",
"text": "def compare_run_times(tests, method1, method2)\n total_time_map_reduce = 0\n total_time_regex = 0\n\n tests.each do |test|\n map_reduce_time = time_method(method1, test[:text])\n regex_time = time_method(method2, test[:text])\n\n total_time_map_reduce += map_reduce_time\n total_time_regex += regex_time\n end\n\n puts\n puts \"Map Reduce Total Time: #{total_time_map_reduce.round(2)} milliseconds\"\n puts \"Regex Total Time: #{total_time_regex.round(2)} milliseconds\"\nend",
"title": ""
},
{
"docid": "2394b79f5bffb803e8579dc22eede2af",
"score": "0.5451995",
"text": "def posttestrail(runId, caseId, statusId, versionId, elapsedseconds)\r\n\r\n uri = \"http://testrailgw.jupiter.bbc.co.uk/?action=add_result_for_case&run_id=#{runId}&case_id=#{caseId}&status_id=#{statusId}&version=#{versionId}&elapsed_seconds=#{elapsedseconds}&sharedSecret=thI5iSourSHAREDsecret\"\r\n #uri = \"http://testrailgw.jupiter.bbc.co.uk/?action=add_result_for_case&run_id=110324&case_id=665022&status_id=1&version=Test&elapsed_seconds=12&sharedSecret=thI5iSourSHAREDsecret\"\r\n\r\n uri = uri.gsub(\" \", \"%20\")\r\n xml_data = open(uri).read\r\n if(xml_data.include? '\"test_id\":')\r\n recorded = xml_data.split('\"test_id\":')[1]\r\n testID = recorded.split(',\"status_id\"')[0]\r\n puts \"TestID:\"+testID\r\n else\r\n puts xml_data\r\n fail \"Cannot Post result to Testrail, check Webservice\"\r\n end\r\n\r\n timeStamp = Time.now.strftime (\"posted at %H:%M %d/%m/%Y\")\r\n files = \"//zgbwcfs3005.jupiter.bbc.co.uk/QA/Jenkins/Jupiter/ICETEAresultupdatelog.txt\"\r\n f = File.open(files,'a')\r\n f.write \"#{testID} #{timeStamp}\"\r\n f.close\r\nend",
"title": ""
},
{
"docid": "4e8e33895583bec0cc6303efe0b8d465",
"score": "0.5450405",
"text": "def generate_grade(expected,results)\n test = {}\n if expected[\"make_output\"][\"exit_code\"] != 0\n test[:status] = \"build_failure\"\n test[:build_results] = results[\"make_output\"][\"make_output\"]\n else\n test[:status] = \"graded\"\n test[:build_results] = \"\" #no need for build results if it is graded\n end\n\n total_grade_points = 0\n total_out_of = 0\n test[:testcases] = {}\n\n cases = expected[\"test_cases\"].zip(results[\"test_cases\"])\n cases.each do |e_case, r_case|\n diff = Diffy::Diff.new(e_case[\"output\"], r_case[\"output\"], :source => 'strings')\n\n if diff.to_a != []\n grade_points = 0\n diff_string = diff.to_s(:html)\n else\n grade_points = e_case['points']\n diff_string = \"\"\n end\n out_of = e_case['points']\n test[:testcases][e_case[\"command\"]] =\n {\n :grade_points => grade_points,\n :out_of => out_of,\n :diff => diff_string\n }\n total_grade_points += grade_points\n total_out_of += out_of\n end\n test[:total_grade_points] = total_grade_points\n test[:total_out_of] = total_out_of\n test\n end",
"title": ""
},
{
"docid": "42cf80b6013ef8911cd46808e0f3ce2b",
"score": "0.54491043",
"text": "def test_results_sad\r\n assert_output(\"Going home sad.\\n\") { @g.results(9) }\r\n end",
"title": ""
},
{
"docid": "00aeccd84e7b87d8fe0d37d61b56f3f0",
"score": "0.54454035",
"text": "def executeSimpleTest(iSimpleTestData)\n lMaxDays = 10\n lFirstDay = Date.new(2000, 1, 1)\n # Create a standard calendar (lMaxDays days, 1 hour per day) for each resource\n # It will be populated lated\n # map< Date, Integer >\n lCalendar = {}\n # Create the index of resources\n # map< String, Resource >\n lResourcesMap = {}\n # Create the index of tasks\n # map< String, Task >\n lTasksMap = {}\n # Create the final assignment\n # map< Task, map< Date, map< Resource, Integer > > >\n lFinalAssignment = {}\n iSimpleTestData.each do |iSimpleTaskInfo|\n lTaskName, lResourceName, lPriority, lSizing, lSuccessorNamesList, lStrFinalAssignment = iSimpleTaskInfo\n if (lStrFinalAssignment.size > lMaxDays)\n lMaxDays = lStrFinalAssignment.size\n end\n # Do we already know this resource ?\n if (!lResourcesMap.has_key?(lResourceName))\n # Create the resource\n lResource = Resource.new(lResourceName, lCalendar)\n lResourcesMap[lResourceName] = lResource\n else\n lResource = lResourcesMap[lResourceName]\n end\n lTask = Task.new(lTaskName, lPriority, lSizing, {lResource => lSizing}, [])\n lTasksMap[lTaskName] = lTask\n # Set its final assignment info\n lFinalTaskAssignment = {}\n lIdxDay = 0\n lStrFinalAssignment.each_byte do |iChar|\n if (iChar == 61) # 61 == '='\n lFinalTaskAssignment[lFirstDay + lIdxDay] = {lResource => 1}\n end\n lIdxDay += 1\n end\n lFinalAssignment[lTask] = lFinalTaskAssignment\n end\n # Create the list of tasks\n # list< Task >\n lTasksList = []\n # Now populate the successors\n iSimpleTestData.each do |iSimpleTaskInfo|\n lTaskName, lResourceName, lPriority, lSizing, lSuccessorNamesList, lStrFinalAssignment = iSimpleTaskInfo\n # Retrieve the task\n lTask = lTasksMap[lTaskName]\n # Parse each successor\n lSuccessorsList = []\n lSuccessorNamesList.each do |iSuccessorName|\n # Retrieve the successor, and add it\n lSuccessorsList << lTasksMap[iSuccessorName]\n end\n # Set the successors in the real task\n lTask.Successors = lSuccessorsList\n # Add the task to the list\n lTasksList << lTask\n end\n # Create a standard project (lMaxDays days, starting from january 1st 2000)\n lProject = Project.new(lFirstDay, lFirstDay + lMaxDays)\n # Populate the calendar of each resource\n lMaxDays.times do |iIdx|\n lCalendar[lFirstDay + iIdx] = 1\n end\n # Execute the test\n executeTest(lTasksList, lProject, lFinalAssignment)\n end",
"title": ""
},
{
"docid": "2b9a2edc3b36799a8c63ab20093c2f71",
"score": "0.5444019",
"text": "def testNominalWithRegressionFailed\n setupTest do |iTasksFileName, iTicketsFileName|\n $Context[:OS_ExecAnswers] = [\n # svn co => success\n [ 0, '' ],\n # Run regression => failure\n [ 1, '' ]\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 '--regressioncmd', 'test/runReg'\n ],\n :Error => WEACE::Master::Server::Processes::Dev_Release::RegressionError\n )\n end\n end",
"title": ""
}
] |
b98b9637eca93986db156bdd58657a94 | Is local fetching enabled? | [
{
"docid": "34daf0f5ba1290666d7569f954654948",
"score": "0.0",
"text": "def local?\n options[:domain] == :local || options[:domain] == :both\n end",
"title": ""
}
] | [
{
"docid": "94596f687c7ef859ff1a31c358f08429",
"score": "0.7340015",
"text": "def fetchable?\n @fetchable\n end",
"title": ""
},
{
"docid": "af19127511ebfcb65487e32526344ca3",
"score": "0.7317867",
"text": "def fetch?\n true\n end",
"title": ""
},
{
"docid": "0dca2756c542bbfa8d06020c17bb5cde",
"score": "0.73155385",
"text": "def local?\n true\n end",
"title": ""
},
{
"docid": "c1de3554bae9746f7cf9455c45d69715",
"score": "0.718319",
"text": "def local_request?\n true\n end",
"title": ""
},
{
"docid": "b64ccabca407bea7f22d857660d26442",
"score": "0.7147416",
"text": "def fetchable?\n !@url.to_s.empty?\n end",
"title": ""
},
{
"docid": "506ee80f03fcacf5401487b906912d37",
"score": "0.7055766",
"text": "def local?\n !(source.kind_of?(Sources::Http) && !store)\n end",
"title": ""
},
{
"docid": "a9624006a596ac9101c0ec7206d3cfa3",
"score": "0.70229673",
"text": "def local?\n scheme == \"local\"\n end",
"title": ""
},
{
"docid": "e051da3f479b6f1d5cea32c5b47e8a29",
"score": "0.7012459",
"text": "def local?\n @local_mode\n end",
"title": ""
},
{
"docid": "9214c80a7d6de4432c060563234c7b18",
"score": "0.70091945",
"text": "def local?\n false\n end",
"title": ""
},
{
"docid": "77dde9f729f8e20dee85bdd514e43293",
"score": "0.69750506",
"text": "def local?\n if @local\n true\n else\n false\n end\n end",
"title": ""
},
{
"docid": "2104e11b112b7d2e26b35ddc4f8cd307",
"score": "0.6949988",
"text": "def local?\n @local\n end",
"title": ""
},
{
"docid": "bfb2fb1f4d9b8f7583b0f7bfe28db131",
"score": "0.6922525",
"text": "def local_request?\n false\n end",
"title": ""
},
{
"docid": "bfb2fb1f4d9b8f7583b0f7bfe28db131",
"score": "0.6922525",
"text": "def local_request?\n false\n end",
"title": ""
},
{
"docid": "bfb2fb1f4d9b8f7583b0f7bfe28db131",
"score": "0.6922525",
"text": "def local_request?\n false\n end",
"title": ""
},
{
"docid": "b5e9e83599bc2b2c7abc96a49ae818a3",
"score": "0.6919682",
"text": "def local_request?\n return false\n end",
"title": ""
},
{
"docid": "9dfbf464485afe8f10799b6f09dcdb60",
"score": "0.6895257",
"text": "def qualifies_for_fetching?\n raise ActiveRecord::RecordNotFound unless @person.present?\n return false if @person.fetch_status == Public::Status_Unfetchable\n\n # local users don't need to be fetched\n if @person.local?\n set_fetch_status Public::Status_Unfetchable\n return false\n end\n\n # this record is already being worked on\n return false if @person.fetch_status > Public::Status_Initial\n\n # ok, let's go\n @person.remote? &&\n @person.fetch_status == Public::Status_Initial\n end",
"title": ""
},
{
"docid": "d5bb6d8adeea2ecf500c3ad10654756f",
"score": "0.6886884",
"text": "def fetchable?\n @scheme.downcase.to_s.match(/http/) ? true : false\n end",
"title": ""
},
{
"docid": "21af20082c0127a9bd404b0d7a1e633b",
"score": "0.68192",
"text": "def local?\n !local_tap.nil?\n end",
"title": ""
},
{
"docid": "ca4728e403aeeac39ed0a039bb4a26e4",
"score": "0.68132",
"text": "def local_request?\n false \n end",
"title": ""
},
{
"docid": "e6e8a1bba39c572acc09f9aba6f18594",
"score": "0.6785031",
"text": "def local?\n !!@local\n end",
"title": ""
},
{
"docid": "f8b675e81a018f3bc652d1999bae4223",
"score": "0.6762402",
"text": "def local?\n @type == \"local\"\n end",
"title": ""
},
{
"docid": "803a4120d1d1d2db3c8e172c7dae846d",
"score": "0.67597",
"text": "def local?\n return @local if @local\n return !@location.start_with?('http') if @location\n true\n end",
"title": ""
},
{
"docid": "2973ca70cd57c42c127b8749d9730406",
"score": "0.66565377",
"text": "def allow_local_requests?\n true\n end",
"title": ""
},
{
"docid": "0fabb1e2da730fd5ec15ba4d55a12176",
"score": "0.6612942",
"text": "def allow_local_requests?\n false\n end",
"title": ""
},
{
"docid": "1e29c68462867385c7ef2ed70e217dd4",
"score": "0.6565572",
"text": "def remote?\n !local?\n end",
"title": ""
},
{
"docid": "051b52ae3b0061f8987477ba9aef396c",
"score": "0.65254647",
"text": "def fetched?\n return true if @flags.include?(:fetched)\n return false if @flags.include?(:transient) or @flags.include?(:unfetched)\n nondomain? or dependent? ? fetched_dependent? : fetched_independent?\n end",
"title": ""
},
{
"docid": "4ea6ac98df783adeb60047a8bbd0c574",
"score": "0.6504538",
"text": "def local_request?\n return false if RAILS_ENV == 'production'\n end",
"title": ""
},
{
"docid": "67de4939a2fa040e1bf8867071d14da2",
"score": "0.6498525",
"text": "def local_request?\n false if RAILS_ENV == 'production'\n end",
"title": ""
},
{
"docid": "431eab6a8202d9e8dad97a738202556c",
"score": "0.64893544",
"text": "def test_locally?\n @capabilities[\"browserstack.local\"] == true && using_browserstack?\n end",
"title": ""
},
{
"docid": "bc93687b63d2e87c76c3b52ca20d7446",
"score": "0.64586353",
"text": "def is_fetchable\n return @is_fetchable\n end",
"title": ""
},
{
"docid": "5acfe15b74ee2677b4102efd819143af",
"score": "0.64575833",
"text": "def local?\n @attributes.has_key?(:local_path_to_file) && File.exist?(@attributes[:local_path_to_file])\n end",
"title": ""
},
{
"docid": "d20da8583df199dacaaf417c52a8622c",
"score": "0.64478683",
"text": "def server?\n !local?\n end",
"title": ""
},
{
"docid": "679c4a2545dcad19b069dfd9d97ed13a",
"score": "0.6445903",
"text": "def local?\n vcs.local?\n end",
"title": ""
},
{
"docid": "5d269cf219125aaecbdb14ee53eca785",
"score": "0.644225",
"text": "def enabled?\n return false if !@remote_url.nil? &&\n Fizzy::Sync.others(self).any? { |e|\n @remote_url.to_s.start_with?(\"#{e.name}:\")\n }\n return true if default? && Fizzy::Sync.others(self).\n map { |e| e.new(@local_dir_path, @remote_url) }.\n all? { |e| !e.enabled? }\n end",
"title": ""
},
{
"docid": "c7150565903a6b9268ed2d7ced6c4c7b",
"score": "0.64409614",
"text": "def enabled?\n return false if !@remote_url.nil? &&\n Fizzy::Sync.others(self).any? { |e|\n @remote_url.to_s.start_with?(\"#{e.name}:\")\n }\n return true if default? && Fizzy::Sync.others(self).\n map { |e| e.new(@local_dir_path, @remote_url) }.\n all? { |e| !e.enabled? }\n end",
"title": ""
},
{
"docid": "8bd41de16515dbb36a804cb0f8c32bad",
"score": "0.64096797",
"text": "def local_request?\n return false\n [\"127.0.0.1\"].include?(request.remote_ip)\n end",
"title": ""
},
{
"docid": "c70b693ffb67fcd12be2da172e641a42",
"score": "0.6406096",
"text": "def serve_local?\r\n # serve local files if no remote host was defined\r\n return true if @remote_host.nil?\r\n \r\n # otherwise, serve local files if all of the following are true\r\n !matches_any?(@path, @settings['always_from_remote']) && # path does not match an 'always_from_remote' pattern\r\n exists_locally?(@path) && # path exists on local filesystem\r\n !@path.end_with?('/') # path is not a directory (forces fetch of remote \r\nend",
"title": ""
},
{
"docid": "8615d8e43d41d4ce2cb861daf069e0d9",
"score": "0.6404229",
"text": "def is_local\n return @path[0,7] == \"file://\"\n end",
"title": ""
},
{
"docid": "6781fab418bc29e01e03e0a0b6c3eb85",
"score": "0.63672745",
"text": "def local?\n ROCKET.server_id.to_s == @server.to_s\n end",
"title": ""
},
{
"docid": "36f7835d51f78617b9284f867154b8ba",
"score": "0.63549995",
"text": "def local_request?\n request.remote_ip == '127.0.0.1'\n end",
"title": ""
},
{
"docid": "84fb5f7efc47fb3a0cb9aa34b2612421",
"score": "0.6342869",
"text": "def local_request?\n request.remote_ip == '127.0.0.1' || (current_user && current_user.has_role?('admin')) || RAILS_ENV == 'development'\n end",
"title": ""
},
{
"docid": "38f19d79236ca5b10b8676230502ea14",
"score": "0.6284319",
"text": "def local?\n !global?\n end",
"title": ""
},
{
"docid": "85dc3e35d928a96a2af087dd03f4d23f",
"score": "0.6280249",
"text": "def fetched?\n @fetched\n end",
"title": ""
},
{
"docid": "ba0cf33f41ff6fa642669bb9563d63c4",
"score": "0.62683606",
"text": "def local?; DRb.here?(uri) end",
"title": ""
},
{
"docid": "ba0cf33f41ff6fa642669bb9563d63c4",
"score": "0.62683606",
"text": "def local?; DRb.here?(uri) end",
"title": ""
},
{
"docid": "5a359d287f147b000e33f84398919eb1",
"score": "0.62549937",
"text": "def fetched?\n !@neography.nil?\n end",
"title": ""
},
{
"docid": "19be6f67838ebf28cae9c0ba115e47d3",
"score": "0.62534183",
"text": "def local?; true end",
"title": ""
},
{
"docid": "19be6f67838ebf28cae9c0ba115e47d3",
"score": "0.62534183",
"text": "def local?; true end",
"title": ""
},
{
"docid": "19be6f67838ebf28cae9c0ba115e47d3",
"score": "0.62534183",
"text": "def local?; true end",
"title": ""
},
{
"docid": "07e64c84f5427e91d230aaa748d2f9bf",
"score": "0.62265295",
"text": "def valid_for_local?(local); end",
"title": ""
},
{
"docid": "6806cafc0da4363adef4abfb1204ddda",
"score": "0.621858",
"text": "def local?\n @riak.nil?\n end",
"title": ""
},
{
"docid": "1714d1ab22223d7c7caac6994ad6064c",
"score": "0.61941504",
"text": "def local? localhost: true\n if host && !host.empty?\n return true if localhost == :any\n return localhost && (host.downcase == LOCALHOST)\n elsif path && path.start_with?(DBL_SLASH)\n return false\n end\n true\n end",
"title": ""
},
{
"docid": "7c5bab96ede842b046391b572fdd081e",
"score": "0.61923146",
"text": "def force_local?\n [:all, :local].include?(@force).tap do |force|\n puts \"\\n!!! Local branches forced\" if force\n end\n end",
"title": ""
},
{
"docid": "6d44ed544fa030b7b3cf74cad33a6317",
"score": "0.61883605",
"text": "def has_remote_sources?\n each_remote_source(false).any? { true }\n end",
"title": ""
},
{
"docid": "1f0029633abb8231eb05ce679a4d33da",
"score": "0.6168693",
"text": "def online?\n true\n end",
"title": ""
},
{
"docid": "a8b17121dfd9ed4eafd2de80c5cab9da",
"score": "0.61665916",
"text": "def fetched?\n !@fetch_time.nil?\n end",
"title": ""
},
{
"docid": "ae7cf449a7a83c8a88bc6be4e9fdc237",
"score": "0.6149766",
"text": "def execute_externally?\n @configuration.execution_mode == :external ||\n @configuration.execution_mode.in?([:async, :async_server]) && !in_server_process?\n end",
"title": ""
},
{
"docid": "e40e9d2128bb264d59a3258a10887eee",
"score": "0.61393166",
"text": "def local?\n\t\t@host == @provider.domain\n\tend",
"title": ""
},
{
"docid": "5e2184c59ad4ecc3be0705d948590177",
"score": "0.612662",
"text": "def local_network?\n address_is_local? request.remote_ip\n end",
"title": ""
},
{
"docid": "5d26a622f683b4e4ba3094789adb8a74",
"score": "0.6123928",
"text": "def perform_local_check\n Checker::Local.new.check(urls)\n end",
"title": ""
},
{
"docid": "2131eeeb06a964c42da2fe4d22e43fae",
"score": "0.6114853",
"text": "def local?\n return @local if @local\n return false if @location =~ /\\A#{URI::regexp}\\z/\n true\n end",
"title": ""
},
{
"docid": "14acffc85bf9b4aa0621b53f1e6ae124",
"score": "0.61112416",
"text": "def is_external?\n return (@request.headers['HTTP_CANDLEPIN_CONTEXT'] == 'External')\n end",
"title": ""
},
{
"docid": "abecee26aac70d927a2c8de863e2852f",
"score": "0.6108063",
"text": "def enabled?\n ( super ||\n (!@remote_url.nil? && @remote_url.to_s.start_with?(\"#{@name}:\")) ||\n local_valid_repo?)\n end",
"title": ""
},
{
"docid": "5bca0de745bd65338227cf5a26224872",
"score": "0.6104361",
"text": "def caching_enabled?\n Caching.enabled\n end",
"title": ""
},
{
"docid": "cfce2a507e7017f349d0598c80b9e1f1",
"score": "0.60992914",
"text": "def has_remote?\n # NOTE ARes#exists? is broken:\n # https://rails.lighthouseapp.com/projects/8994/tickets/1223-activeresource-head-request-sends-headers-with-a-nil-key\n #\n return !remote(true).nil? rescue false\n end",
"title": ""
},
{
"docid": "83c61c92897a9285e445d5d72a7dd93e",
"score": "0.60782325",
"text": "def local_request?\n request.ip == '127.0.0.1' and Razor.config['auth.allow_localhost']\n end",
"title": ""
},
{
"docid": "191ed2650b59b6eeb892e5aedef4ff8b",
"score": "0.607721",
"text": "def enabled?\n ( super ||\n !@remote_path.nil? && @remote_path.directory? ||\n local_valid_repo?)\n end",
"title": ""
},
{
"docid": "1be6ac2fce7b945987312667adba1366",
"score": "0.6076868",
"text": "def fetched?\n fetch_failed? || !@get_response.nil?\n end",
"title": ""
},
{
"docid": "c322c5903dfc1a71f64f7fa1ad4ac4fc",
"score": "0.60745394",
"text": "def fetched?\n !@fetch_time.nil?\n end",
"title": ""
},
{
"docid": "c322c5903dfc1a71f64f7fa1ad4ac4fc",
"score": "0.60745394",
"text": "def fetched?\n !@fetch_time.nil?\n end",
"title": ""
},
{
"docid": "814feb33febc759c94acc74cc7d19f48",
"score": "0.6071439",
"text": "def remote?\n !hosted?\n end",
"title": ""
},
{
"docid": "456a7436fdb3ca7bacff1799d82b9c73",
"score": "0.60680014",
"text": "def enabled?\n (super ||\n (!@remote_url.nil? && @remote_url.to_s.start_with?(\"#{@name}:\")) ||\n local_valid_repo?)\n end",
"title": ""
},
{
"docid": "456a7436fdb3ca7bacff1799d82b9c73",
"score": "0.60680014",
"text": "def enabled?\n (super ||\n (!@remote_url.nil? && @remote_url.to_s.start_with?(\"#{@name}:\")) ||\n local_valid_repo?)\n end",
"title": ""
},
{
"docid": "5714a3bc8ef37070556f96ca040a69bc",
"score": "0.60667837",
"text": "def local_request?\n remote = IPAddr.new(request.remote_ip)\n !self.class.local_addresses.detect { |addr| addr.include?(remote) }.nil?\n end",
"title": ""
},
{
"docid": "5714a3bc8ef37070556f96ca040a69bc",
"score": "0.60667837",
"text": "def local_request?\n remote = IPAddr.new(request.remote_ip)\n !self.class.local_addresses.detect { |addr| addr.include?(remote) }.nil?\n end",
"title": ""
},
{
"docid": "739a25f45eb79e3e1972dea2a262b68a",
"score": "0.606594",
"text": "def online?\n false\n end",
"title": ""
},
{
"docid": "931b19c916ac1d90a31d446dcbcab44b",
"score": "0.60472715",
"text": "def check_local_only\n return true if Rails.env == \"test\"\n \n if Yogo::Setting[:local_only] && ![\"127.0.0.1\", \"0:0:0:0:0:0:0:1%0\"].include?(request.env[\"REMOTE_ADDR\"])\n # Raise a 403 exception or perhaps just redirect.\n render_optional_error_file(:forbidden)\n end\n end",
"title": ""
},
{
"docid": "56246ed2c50318408a018c1a6f8d3cf5",
"score": "0.60404825",
"text": "def is_localhost_mode?\n true\n end",
"title": ""
},
{
"docid": "56246ed2c50318408a018c1a6f8d3cf5",
"score": "0.60404825",
"text": "def is_localhost_mode?\n true\n end",
"title": ""
},
{
"docid": "131596d79f9df98c3a4d1abf6437d7dd",
"score": "0.6029454",
"text": "def remote\r\n @local.nil? || @local == false\r\n end",
"title": ""
},
{
"docid": "c11ec1ec1b25e5cf8c8fb27b10cac149",
"score": "0.6028271",
"text": "def allow_local_requests?\n Gitlab::CurrentSettings.allow_local_requests_from_web_hooks_and_services?\n end",
"title": ""
},
{
"docid": "26b3199b03510077cc2b011ba713ee7b",
"score": "0.60226685",
"text": "def execute_externally?\n execution_mode.nil? ||\n execution_mode == :external ||\n (execution_mode.in?([:async, :async_server]) && !in_server_process?)\n end",
"title": ""
},
{
"docid": "ca6dc6daac595c44e43e2ef869105a32",
"score": "0.6017138",
"text": "def check_local_only\n return true if Rails.env == \"test\"\n\n if Setting[:local_only] && ![\"127.0.0.1\", \"0:0:0:0:0:0:0:1%0\"].include?(request.env[\"REMOTE_ADDR\"])\n # Raise a 403 exception or perhaps just redirect.\n render_optional_error_file(:forbidden)\n end\n end",
"title": ""
},
{
"docid": "fb09d271af128b36d7d96d344cd5a4be",
"score": "0.6011246",
"text": "def enabled?\n !!Thread.current[\"[mongo]:query_cache:enabled\"]\n end",
"title": ""
},
{
"docid": "fb09d271af128b36d7d96d344cd5a4be",
"score": "0.6011246",
"text": "def enabled?\n !!Thread.current[\"[mongo]:query_cache:enabled\"]\n end",
"title": ""
},
{
"docid": "12a6be5b62eb74745f8911af08d3b27e",
"score": "0.6002794",
"text": "def consider_all_requests_local; end",
"title": ""
},
{
"docid": "7751bccc049e4b6d993f4482239d6a01",
"score": "0.60003674",
"text": "def local?\n case @hostname\n when 'localhost'\n true\n when @sys_hostname ||= Socket.gethostname\n true\n else\n false\n end\n end",
"title": ""
},
{
"docid": "f1302018952042d7d8e819ddfaf101af",
"score": "0.59947217",
"text": "def online?\r\n !!Rails.cache.read(\"online.#{id}\")\r\n end",
"title": ""
},
{
"docid": "882801b0901754731ecaddd32d336325",
"score": "0.5993235",
"text": "def cache_enabled?\n !cache_store.nil?\n end",
"title": ""
},
{
"docid": "1fc31457115a1fcba0455396acc6aff0",
"score": "0.5986558",
"text": "def lp?\n @nsx_client.get(@url)\n end",
"title": ""
},
{
"docid": "708f5e4ecb713802d5f4501d1d55455e",
"score": "0.5986526",
"text": "def enabled?\n (super ||\n !@remote_path.nil? && @remote_path.directory? ||\n local_valid_repo?)\n end",
"title": ""
},
{
"docid": "7bb01984c64ed315973579e6112388bf",
"score": "0.5984444",
"text": "def caching_enabled?\n File.exists? caching_marker\n end",
"title": ""
},
{
"docid": "1a20fdf188b2eaecc1c7fc34481a2ee5",
"score": "0.597068",
"text": "def local_request?\n request.ip == '127.0.0.1' and Razor.config['auth.allow_localhost']\n end",
"title": ""
},
{
"docid": "3c9dca81fcc1c279bc3f831bf803f69c",
"score": "0.5969794",
"text": "def enabled?\n !!Thread.current[\"[mongoid]:query_cache:enabled\"]\n end",
"title": ""
},
{
"docid": "3c9dca81fcc1c279bc3f831bf803f69c",
"score": "0.5969794",
"text": "def enabled?\n !!Thread.current[\"[mongoid]:query_cache:enabled\"]\n end",
"title": ""
},
{
"docid": "3c9dca81fcc1c279bc3f831bf803f69c",
"score": "0.5969794",
"text": "def enabled?\n !!Thread.current[\"[mongoid]:query_cache:enabled\"]\n end",
"title": ""
},
{
"docid": "d82b5e3f5d2830b4dec6451ebae19064",
"score": "0.5969049",
"text": "def remote?\n true\n end",
"title": ""
},
{
"docid": "d82b5e3f5d2830b4dec6451ebae19064",
"score": "0.5969049",
"text": "def remote?\n true\n end",
"title": ""
},
{
"docid": "84bb2b00286ba8f89cb1be457b12346e",
"score": "0.5966951",
"text": "def available?\n request(:get, '/information', :authorization => false).success?\n end",
"title": ""
},
{
"docid": "2ea1276f0bb56b3ddf041d70eff02112",
"score": "0.59663767",
"text": "def loaded?\n self['@url'] ? true : false\n end",
"title": ""
},
{
"docid": "dadcecbf168d60eb30ea4aa9f3f4091b",
"score": "0.59485644",
"text": "def from_cache?()\n return self.has_key?('--from-cache')\n end",
"title": ""
}
] |
c7f608a9990018ecfbd91ff51faf369e | GET Modifies the starting location passed via URL (QR Codes) | [
{
"docid": "54391a3109886bbc00eccf872a964ed5",
"score": "0.53085655",
"text": "def start\n unless params[:location].blank? or cookies[:origin].present?\n params[:location].slice!(0) if params[:location][0].upcase == \"R\" # Remove proceeding R if present\n start_location = params[:location].to_s.rjust(4, '0').prepend(\"R\") # Add zero padding and Prepend R\n cookies.permanent[:start_location] = start_location.upcase\n end\n\n redirect_to root_path\n end",
"title": ""
}
] | [
{
"docid": "6465891401ffbe939f5bca9ab38a017f",
"score": "0.6063354",
"text": "def qrcode\n \"#{self.short_url}.qrcode\"\n end",
"title": ""
},
{
"docid": "31193e9465170bf8b2ebc15b87df27af",
"score": "0.5992996",
"text": "def show\n @qrcode = Qrcode.find(params[:id])\n params[:quest_id]\n if @qrcode.imgloc == nil\n @qrcode.imgloc = request.protocol+request.host_with_port+request.fullpath+\".png\"\n @qrcode.save\n end\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @qrcode }\n format.png { render :qrcode => @qrcode.ref }\n end\n end",
"title": ""
},
{
"docid": "db43b8a0fe4c24e239ab8d83545a741a",
"score": "0.59017223",
"text": "def fetch_qr_code\n self.qr_code = QrCodeFetcher.qr_code(code)\n end",
"title": ""
},
{
"docid": "0e43d1a5bf1bf10125fe74ae082ffbaa",
"score": "0.58357555",
"text": "def url_for_rbgk(barcode)\r\n \"http://apps.kew.org/herbcat/getImage.do?imageBarcode=\" + barcode\r\nend",
"title": ""
},
{
"docid": "93e896f519481c26ec1233eb5bac2274",
"score": "0.57575226",
"text": "def get_url path\n\t\t\t\t@browser.get path, {}, {'REQUEST_URI' => ['http://example.org', path].join('/')}\n\t\t\t\tresponse = @browser.last_response\n\t\t\t\tresponse.body\n\t\t\tend",
"title": ""
},
{
"docid": "16f43a608b0948d81781073643ff0749",
"score": "0.57145125",
"text": "def goto_url(url)\n response = Net::HTTP.get_response(URI.parse(url))\n status = response.code.to_i\n \n if status >= 300 and status < 400\n url = response['Location']\n # TODO - put general url beggining instead\n url = \"http://magiccards.info\" + url unless url.start_with?('http://')\n goto_url(url)\n else\n return url, response.body\n end\n end",
"title": ""
},
{
"docid": "76308ac57fb8027d690c39aaaf89a5f8",
"score": "0.5650885",
"text": "def get(url); end",
"title": ""
},
{
"docid": "c39a0b5e65fb8eb87ff7d69ca77107f6",
"score": "0.5636417",
"text": "def request_uri; end",
"title": ""
},
{
"docid": "73599ade4128aada8741bc7d2702ce76",
"score": "0.5618531",
"text": "def qrcode\n @qr = RQRCode::QRCode.new(\"http://0.0.0.0:3000/visit/#{self.tag}\", :size => 6)\n return @qr\n end",
"title": ""
},
{
"docid": "c4a974e0620a12c22f6e81d097771e25",
"score": "0.56021017",
"text": "def geturl() \n\t\treturn self.response.geturl()\n end",
"title": ""
},
{
"docid": "23e3e55e6557b0107dd707a5e374d6a3",
"score": "0.5528537",
"text": "def amend origin_url\n origin_url.sub! /^\"?([^\"]*)\"?/, '\\\\1' # Remove any enclosing quotes\n query_str = (match = origin_url.match /^[^?]*\\?(.*)/ ) ? match[1] : \"\"\n query_params = query_str.empty? ? {} : Hash[ CGI.parse(query_str).map { |elmt| [elmt.first.to_sym, elmt.last.first] } ]\n # Format refers to how to present the content: within a dialog, or on a page\n @mode = query_params[:mode]\n end",
"title": ""
},
{
"docid": "d7c0b67520b0a2e3319df7a1fa77cc9e",
"score": "0.55196327",
"text": "def request_url\n base_url = \"http://#{api_host}#{PATH}?\"\n base_url << \"appid=#{app_id}\"\n base_url << \"&callname=#{call_name}\"\n base_url << \"&siteid=#{site_id}\"\n base_url << \"&version=#{API_VERSION}\"\n base_url\n end",
"title": ""
},
{
"docid": "bffba8a6ce224fdb215caf54caec864e",
"score": "0.54990554",
"text": "def getFinalUrl(url)\n return Net::HTTP.get_response(URI(url))['location']\nend",
"title": ""
},
{
"docid": "2dede1892257726b063c20b49fd83d0f",
"score": "0.5458087",
"text": "def parse_uri(rq,params)\n\t\t\tparams[:q].gsub!(\"\\\"\",\"\")\n\t\t\turl_string = \"#{BASE_URI}#{rq}?\"\n\t\t\turi = URI(url_string)\n\t\t\turi.query = URI.encode_www_form(params)\n\t\t\turi\n\t\tend",
"title": ""
},
{
"docid": "bd586389e50d85bc07a639c8d7345827",
"score": "0.5451542",
"text": "def show\n @qrcode = Qrcode.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @qrcode }\n end\n end",
"title": ""
},
{
"docid": "b2d5541dadfcf2f7ee842ff31faadc9c",
"score": "0.54461706",
"text": "def start\n unless params[:origin].blank?\n params[:origin].slice!(0) if params[:origin][0].upcase == \"R\" # Remove proceeding R if present\n origin = params[:origin].to_s.rjust(4, '0').prepend(\"R\") # Add zero padding and Prepend R\n session[:start] = origin.upcase\n end\n\n redirect_to \"/map\"\n end",
"title": ""
},
{
"docid": "7e24bce4cfaaddf347ea60cb75b5292c",
"score": "0.54420274",
"text": "def on_request_uri(cli, req)\n\t\tcode = %Q{\n\t\t\tdocument.body.innerHTML = \"<iframe src=tel:#{datastore['phoneNumber']}></iframe>\";\n\t\t\tXSSF_POST(\"Phone call launched\",'#{self.name}');\n\t\t}\n\t\t\n\t\tsend_response(cli, code)\n\tend",
"title": ""
},
{
"docid": "dc0c4de77376254cb75fb163623827e0",
"score": "0.5427587",
"text": "def get( lat, long )\n @curl.http_post(\n Curl::PostField.content( 'appid', YahooGeo::api_key ),\n Curl::PostField.content( 'autoDisambiguate', 'true' ),\n Curl::PostField.content( 'outputType', 'xml' ),\n Curl::PostField.content( 'documentType', 'text/html' ),\n Curl::PostField.content( 'documentContent', \"<meta name=\\\"ICBM\\\" content=\\\"#{lat}, #{long}\\\">\" )\n )\n\n if @curl.response_code != 200 then\n # there must be a better way to get the response message\n h = @curl.header_str.split(/\\r\\n/)[0].split\n msg = h[2..h.length].join( ' ' )\n parse_error( @curl.response_code, msg )\n else\n @curl.body_str\n end\n end",
"title": ""
},
{
"docid": "703d29cb22710e9145b90d9859a710a3",
"score": "0.54146326",
"text": "def set_url(quantity)\n if @type == 'mercadolivre'\n url_aux = @url.remove(@url_mercado_livre)\n \"https://api.mercadolibre.com/sites/MLB/search?nickname=#{url_aux}&offset=#{quantity}\"\n else\n url_aux = if @url.ends_with?('/')\n @url\n else\n \"#{@url}/\"\n end\n \"#{url_aux}api/catalog_system/pub/products/search?_from=#{quantity}&_to=#{quantity + 49}\"\n end\n end",
"title": ""
},
{
"docid": "55acb10df3a1717d9678e2c8b0f719f7",
"score": "0.5401245",
"text": "def resolved_uri; end",
"title": ""
},
{
"docid": "612763c324b44c3569080873526aaa5f",
"score": "0.5398504",
"text": "def show\n @page = @page_rate.page\n @pr_qrcode_path = get_qrcode(@page_rate)\n end",
"title": ""
},
{
"docid": "60aed3a21b3a39a94fb1d2b941b1f3c3",
"score": "0.53917897",
"text": "def show\n @url = \"https://www.karmagrove.com/events/#{@event.id}/tickets/#{@ticket_purchase.ticket.id}/ticket_purchases/#{@ticket_purchase.id}\"\n @qr = RQRCode::QRCode.new( @url, :size => 7, :level => :h )\n end",
"title": ""
},
{
"docid": "a274f88ab3f5ededcef8a2001c247da7",
"score": "0.53660786",
"text": "def url\n uri\n end",
"title": ""
},
{
"docid": "a274f88ab3f5ededcef8a2001c247da7",
"score": "0.53660786",
"text": "def url\n uri\n end",
"title": ""
},
{
"docid": "b5a94276edfa0426ca23389f5d4fdd97",
"score": "0.5345767",
"text": "def location\n @client.get(\"#{path}/location\")\n end",
"title": ""
},
{
"docid": "383d01260ca71daaf340efba5b6899c9",
"score": "0.53405607",
"text": "def show\n @geocach = Geocach.find(params[:id])\n qr_code = \"#{ENV['URL']}#{@geocach.random_code}\"\n @qr = RQRCode::QRCode.new( qr_code.to_s , :size => 10, :level => :h )\n\n \n @qr_code = \"#{ENV['URL']}#{@geocach.random_code}\"\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @geocach }\n format.png { render :qrcode => qr_code, :size => 10, :level => :h }\n format.gif { render :qrcode => qr_code, :size => 10, :level => :h }\n format.jpeg { render :qrcode => qr_code, :size => 10, :level => :h }\n end\n end",
"title": ""
},
{
"docid": "34fe01bf436229675a27fc80e6ed8bd7",
"score": "0.5319304",
"text": "def final_url\n call_once\n @headers[\"location\"] || @request.getURI.to_string\n end",
"title": ""
},
{
"docid": "0d8d1203961db5a9d468b9c6ef9055b0",
"score": "0.5296493",
"text": "def url_for_mnhn(barcode)\r\n #\"https://science.mnhn.fr/institution/mnhn/collection/p/item/\" + barcode #herbarium sheets\r\n \"https://science.mnhn.fr/institution/mnhn/collection/f/item/\" + barcode #fossil slides\r\nend",
"title": ""
},
{
"docid": "1a11b0dceb05860b47982e5f11642961",
"score": "0.52924067",
"text": "def gen_qr_code data\r\n begin\r\n # Form query\r\n query = \"#{URL}#{QUERY}#{data}\"\r\n # Write file to output path\r\n File.open(QR_OUTPUT_PATH, \"wb\") do |file| \r\n file.write HTTParty.get(URI.escape query).parsed_response\r\n end\r\n # Update UI\r\n @qr_img_label.set_pixmap(Qt::Pixmap.new(QR_OUTPUT_PATH))\r\n @qr_data_label.set_text(data)\r\n rescue => e\r\n puts e.inspect\r\n title = \"QR Error\"\r\n error = \"Error: \\\"#{data}\\\" could not be rendered as QR Code!\"\r\n build_message_box(title, error)\r\n end\r\n end",
"title": ""
},
{
"docid": "3c83569b5b5714fcc51dba31e650a0aa",
"score": "0.5290759",
"text": "def url\n endpoint+'?'+query_string\n end",
"title": ""
},
{
"docid": "26fc2b062f64ba98a6955ec2a141237c",
"score": "0.5262279",
"text": "def geocoder\n begin\n render(:json => open(\"#{GEOCODER_URL}&#{request.query_string}\"){|f| f.read})\n rescue SocketError\n render(:text => $!.to_s, :status => 500)\n end\n end",
"title": ""
},
{
"docid": "27f5d3647e487388699fb6d9bcd8b386",
"score": "0.5256085",
"text": "def request(url)\n raise TypeError, 'url must be a String or respond_to #to_s' unless url.is_a?(String) || url.respond_to?(:to_s)\n @parameters['url'] = url.to_s # The URL must contain the entire URL with the _escaped_fragment_ parsed out\n \n content_from_response(send_request)\n end",
"title": ""
},
{
"docid": "44314f82bea2d1c2417ce2bd1b60d8ba",
"score": "0.5244048",
"text": "def get_url\n\t\t@url = \"http://finance.yahoo.com/q?s=#{@big_symbol}\"\n\tend",
"title": ""
},
{
"docid": "05a924f61fa454781e538c2a5f56807d",
"score": "0.52427906",
"text": "def open_url(code)\n url = URL+code\n puts url\n open(url).read\n end",
"title": ""
},
{
"docid": "b6ea83ae892a3760631b6b7a4e42abc2",
"score": "0.5229663",
"text": "def show\n @build = @project.builds.order('created_at DESC').first\n\n @ios_ipa_url = project_build_url(@project, @build, format: 'ipa')\n @ios_ad_hoc_url = \"itms-services://?action=download-manifest&url=#{project_build_url(@project, @build, format: 'plist')}\"\n @ios_qr = RQRCode::QRCode.new(@ios_ad_hoc_url, :size => 10, :level => :h )\n @android_apk_url = project_build_url(@project, @build, format: 'apk')\n @android_qr = RQRCode::QRCode.new(@android_apk_url, :size => 6, :level => :h )\n\n @ios_short_url = Net::HTTP.get(URI(\"http://www.35nic.com/shorturl/urlapi.asp?ourl=#{@ios_ipa_url}\"))\n @android_short_url = Net::HTTP.get(URI(\"http://www.35nic.com/shorturl/urlapi.asp?ourl=#{@android_apk_url}\"))\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @project }\n end\n\n end",
"title": ""
},
{
"docid": "57eeae95a334e65163d7df4af43f5dd2",
"score": "0.5226014",
"text": "def ciao\n redirect_to '/' && return if params[:url].blank?\n @ua = {:action => UserAction.id_for('external_url'), :data => {:source => params[:source]}}\n url = Base64.decode64(params[:url])\n url = \"http://#{url}\" unless url.match(/https?:\\/\\//) != nil\n redirect_to url\n end",
"title": ""
},
{
"docid": "791261e2cd007cde3f3a4c5e3a1a68c5",
"score": "0.5212362",
"text": "def consume_url; end",
"title": ""
},
{
"docid": "d9ab10d4fcdb2311d712cb74de4e846b",
"score": "0.5202371",
"text": "def extract_access_code_from_link\n \turi = URI(\"#{request.protocol}#{request.host_with_port}#{request.fullpath}\")\n \taccess_code = uri.query.split('&')[0].split('=')[1]\n end",
"title": ""
},
{
"docid": "dbadd1d9d104ccd6545fc3525e381c58",
"score": "0.51910925",
"text": "def original_url\n url\n end",
"title": ""
},
{
"docid": "48254e23f15699497dc98665574ed980",
"score": "0.5185221",
"text": "def get_URI()\n \t return @outputs[\"URI\"]\n \tend",
"title": ""
},
{
"docid": "48254e23f15699497dc98665574ed980",
"score": "0.5185221",
"text": "def get_URI()\n \t return @outputs[\"URI\"]\n \tend",
"title": ""
},
{
"docid": "48254e23f15699497dc98665574ed980",
"score": "0.5185221",
"text": "def get_URI()\n \t return @outputs[\"URI\"]\n \tend",
"title": ""
},
{
"docid": "48254e23f15699497dc98665574ed980",
"score": "0.5185221",
"text": "def get_URI()\n \t return @outputs[\"URI\"]\n \tend",
"title": ""
},
{
"docid": "5c44f7654e8ab3892111453c44cc7f2f",
"score": "0.5181466",
"text": "def show\n url = \"https://www.mdme.us/clinics/#{@clinic.slug}/checkin\"\n @qr = RQRCode::QRCode.new(url, size: 6)\n end",
"title": ""
},
{
"docid": "c1ee400ee5f93aa923e361b9f273e660",
"score": "0.5170855",
"text": "def on_request_uri(cli, req)\n\t\n\t\tcode = %Q{\n\t\t\tvar ret = '';\n\t\t\tvar quicktime = false;\n\t\t\tvar unsafe = true;\n\n\t\t\tif( window.navigator.javaEnabled() )\tret += \"JAVA ENABLED \\\\n\";\n\t\t\telse \t\t\t\t\t\t\t\t\tret += \"JAVA NOT AVAILABLE \\\\n\";\n\n\t\t\tif (navigator.mimeTypes && navigator.mimeTypes[\"application/x-shockwave-flash\"]) ret += \"FLASH AVAILABLE \\\\n\";\n\t\t\telse \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t ret += \"FLASH NOT AVAILABLE \\\\n\";\n\n\t\t\tif (navigator.plugins)\n\t\t\t\tfor (i=0; i < navigator.plugins.length; i++ )\n\t\t\t\t\tif (navigator.plugins[i].name.indexOf(\"QuickTime\")>=0)\n\t\t\t\t\t\tquicktime = true;\n\n\t\t\tif ((navigator.appVersion.indexOf(\"Mac\") > 0) && (navigator.appName.substring(0,9) == \"Microsoft\") && (parseInt(navigator.appVersion) < 5) )\n\t\t\t\tquicktime = true;\n\t\n\t\t\t(quicktime) ? ret += \"QUICKTIME AVAILABLE \\\\n\" : ret += \"QUICKTIME NOT AVAILABLE \\\\n\";\n\n\n\t\t\tif ((navigator.userAgent.indexOf('MSIE') != -1) && (navigator.userAgent.indexOf('Win') != -1))\tret += \"VBSCRIPT AVAILABLE \\\\n\";\n\t\t\telse\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tret += \"VBSCRIPT NOT AVAILABLE \\\\n\";\n\n\t\t\ttry{ test = new ActiveXObject(\"WbemScripting.SWbemLocator\"); } \n\t\t\tcatch(ex){unsafe = false;} \n \n\t\t\t(unsafe) ? ret += \"UNSAFE ACTIVE X ACTIVATED \\\\n\" : ret += \"UNSAFE ACTIVE X NOT ACTIVATED \\\\n\";\n\n\t\t\t\n\t\t\tif (navigator.plugins && navigator.plugins.length > 0) {\n\t\t\t\tvar pluginsArrayLength = navigator.plugins.length;\n\t\t\t\tret += \"PLUGINS : \\\\n\";\n\t\t\t\tfor (pluginsArrayCounter = 0 ; pluginsArrayCounter < pluginsArrayLength ; pluginsArrayCounter++ ) {\n\t\t\t\t\tret += \"\\\\t * \" + navigator.plugins[pluginsArrayCounter].name;\n\t\t\t\t\tif(pluginsArrayCounter < pluginsArrayLength-1)\n\t\t\t\t\t\tret += String.fromCharCode(10);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tXSSF_POST(ret, '#{self.name}');\n\t\t}\n\n\t\tsend_response(cli, code)\n\tend",
"title": ""
},
{
"docid": "34f7bc4fa9bd7d4ae0ad9b0d6b959b63",
"score": "0.51603234",
"text": "def api_request(city)\n url = \"https://jobs.github.com/positions.json?utf8=%E2%9C%93&description=&location=\"+city\n #Escape and parse URL for proper formatting.\n escaped_url = URI.escape(url)\n parsed_url = URI.parse(escaped_url)\n #Make the HTTP request.\n request = Net::HTTP.get(parsed_url)\n #Parse the JSON response.\n response = JSON.parse(request)\n #Returns all listings for the given city.\n return response\n end",
"title": ""
},
{
"docid": "aa1bd15228fbe2703998aede9c6f3c23",
"score": "0.5155941",
"text": "def square_uri\n square_params\n uri\n end",
"title": ""
},
{
"docid": "861d85d8fd6234b79cb44386962aba1f",
"score": "0.5155247",
"text": "def long_url\n @client.redirect_ok = false\n page = @client.get @short #Get the Long URL\n long = page.header['location']\n puts \"#{@short} => #{long}\"\n long\n end",
"title": ""
},
{
"docid": "9d4abd0881b4a19863f2c95922bcada5",
"score": "0.51483494",
"text": "def request_uri\n calculate_uri(@http_request.url)\n end",
"title": ""
},
{
"docid": "716f61169a78dfb8458f5322081d1406",
"score": "0.5145577",
"text": "def request_uri\n return unless @path\n\n url = @query ? \"#@path?#@query\" : @path.dup\n url.start_with?(?/.freeze) ? url : ?/ + url\n end",
"title": ""
},
{
"docid": "d95898320eb4a9bf7e1075a360f51420",
"score": "0.51393795",
"text": "def get query = nil\n\t\tif (query = make_query query)\n\t\t\t@uri.query = @uri.query ? @uri.query+\"&\"+query : query\n\t\tend\n\t\tfull_path = @uri.path + (@uri.query ? \"?#{@uri.query}\" : \"\")\n\t\t\t\n\t\treq = Net::HTTP::Get.new(full_path)\n\t\t# puts Net::HTTP::Proxy(@proxy_host, @proxy_port, @proxy_user, @proxy_pwd).get(@uri)\n\t\tdo_http req\n\tend",
"title": ""
},
{
"docid": "4296aa0349b97e2224abb1b489bffc11",
"score": "0.5139201",
"text": "def get_location\n\n end",
"title": ""
},
{
"docid": "d755cd44fbb50b7a2120570c04577056",
"score": "0.5130371",
"text": "def get(request)\n @connection.get request.qpath\n end",
"title": ""
},
{
"docid": "8a88b57f8d80083fc6c9777ba6cc9e73",
"score": "0.5125447",
"text": "def get_next_uri\n @is_getting_uri.lock\n uri = URI(\"https://admission.umontreal.ca/programmes-detudes/?type=888&tx_solr[page]=#{@i}&_=1482177335727\")\n @i += 1\n @is_getting_uri.unlock\n return uri\nend",
"title": ""
},
{
"docid": "1f68d1ec6691373cacfec5e1500c132f",
"score": "0.5123799",
"text": "def get_qr_code(opts = {})\n data, _status_code, _headers = get_qr_code_with_http_info(opts)\n data\n end",
"title": ""
},
{
"docid": "5aa40b44af4813252bb9e240730b1941",
"score": "0.51201713",
"text": "def full_location; end",
"title": ""
},
{
"docid": "e10be5cddf35b374a0f8395cb1a7721e",
"score": "0.51190484",
"text": "def url\n raise InvalidQueryError unless query && page\n\n \"http://#{ENDPOINT}#{REQUEST_URI}\" + # base\n \"?#{canonical_query_string}\" + # query\n \"&Signature=#{uri_escape(signature)}\" # signature\n end",
"title": ""
},
{
"docid": "daccd4ac86f1543ee0e6661956ffbabe",
"score": "0.51174384",
"text": "def show\n @qrcode = RQRCode::QRCode.new(url_for(@service.lineup))\n @svg = @qrcode.as_svg(\n color: \"000\",\n shape_rendering: \"crispEdges\",\n module_size: 7,\n standalone: true,\n use_path: true\n )\n @pulll = \"ksksksksks\"\n end",
"title": ""
},
{
"docid": "9061fa09ffb6fda563c89748973fadd6",
"score": "0.51120466",
"text": "def requested_url\n raise \"URL could not be detected.\" unless @args[:request_args][:url]\n @args[:request_args][:url]\n end",
"title": ""
},
{
"docid": "ddd3bb77f5e2c4877b4d339454a09ec6",
"score": "0.5111204",
"text": "def set_qr\n @qr = Qr.find(params[:id])\n end",
"title": ""
},
{
"docid": "4f55b4a8f4573f1614d9ff60b3b4970e",
"score": "0.5101558",
"text": "def get_qr_code_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: Class1InstanceApi.get_qr_code ...'\n end\n # resource path\n local_var_path = '/qr_code'\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['image/png'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body]\n\n # return_type\n return_type = opts[:debug_return_type] || 'File'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['instanceId', 'token']\n\n new_options = opts.merge(\n :operation => :\"Class1InstanceApi.get_qr_code\",\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: Class1InstanceApi#get_qr_code\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "bf7595ac9656fef69b9be6ec110f7654",
"score": "0.5100545",
"text": "def getit\n @record = Record.find(params[:id])\n head :bad_request and return if @record.nil?\n @record.rebuild_openurl!(current_primary_institution.code) if @record.expired?\n # If external system is primo and we have a primo_id, link to primo\n if has_primo_as_external_system? && @record.external_id && ENV['PERSISTENT_LINKER_URL']\n redirect_to \"#{ENV['PERSISTENT_LINKER_URL']}#{@record.external_id}?institution=#{current_primary_institution.code.upcase}\"\n else\n # Otherwise use getit\n redirect_to getit_url + strip_getit_prefix(@record.url)\n end\n end",
"title": ""
},
{
"docid": "719abfe06c0425a877e037557654ca04",
"score": "0.5093682",
"text": "def generate_next_url\n if eds_session.has_key? :query_string\n url = HTMLEntities.new.decode eds_session[:query_string]\n\n #blacklight expects the search term to be in the parameter 'q'.\n #q is moved back to 'query-1' in 'generate_api_query'\n #should probably pull from Info method to determine replacement strings\n #i could turn the query into a Hash, but available functions to do so delete duplicated params (Addressable)\n url.gsub!(\"query-1=AND,TI:\", \"q=\")\n url.gsub!(\"query-1=AND,AU:\", \"q=\")\n url.gsub!(\"query-1=AND,SU:\", \"q=\")\n url.gsub!(\"query-1=AND,\", \"q=\")\n\n #Rails framework doesn't allow repeated params. turning these into arrays fixes it.\n url.gsub!(\"facetfilter=\", \"facetfilter[]=\")\n url.gsub!(\"limiter=\", \"limiter[]=\")\n\n #i should probably pull this from the query, not the URL\n if (params[:search_field]).present?\n url << \"&search_field=\" << params[:search_field].to_s\n end\n return url\n else\n return ''\n end\n end",
"title": ""
},
{
"docid": "a39fd0b78a4074d0a1ffffc4f510faa2",
"score": "0.50929755",
"text": "def get_url(url)\n myurl = URI.parse(url)\n req = Net::HTTP::Get.new(url)\n res = Net::HTTP.start(myurl.host, myurl.port) { |http|\n http.request(req)\n }\n \n res.body # return\n end",
"title": ""
},
{
"docid": "883c2f2a5b1b47d896c99a039faaa854",
"score": "0.5092232",
"text": "def httpget_geo_callback\n if @params['body']['results'] && @params['body']['results'].length > 0\n address = @params['body']['results'][0]['formatted_address'] \n accuracy = @params['accuracy'].to_i.to_s\n WebView.execute_js('setFieldValue(\"location\",\"'+address+' \\n('+Localization::Request[:accuracy]+' = '+accuracy+' '+Localization::Request[:meter]+')\");')\n Alert.hide_popup \n elsif @params['body']['status']\n WebView.execute_js('setFieldValue(\"location\",\"'+@params['body']['status']+' accuracy = '+@params['accuracy']+'\");')\n Alert.hide_popup \n else\n WebView.execute_js('setFieldValue(\"location\",\"'+@params['body'].to_s+'\");')\n Alert.hide_popup \n end\n end",
"title": ""
},
{
"docid": "7a7718b2cefa0249e1142179c1de773d",
"score": "0.50909895",
"text": "def get url\n RestClient::Request.execute(:method => :get, :url => url, :headers => lbaas_headers, :timeout => @timeout, :open_timeout => @open_timeout)\n end",
"title": ""
},
{
"docid": "6e31ebe3351ab893d46199c6d8d49ac2",
"score": "0.50907797",
"text": "def index\n\t#params[:quest_id]\n #@qrcodes = Qrcode.find_all_by_userid(current_user.id)\n #@qrcodes= Qrcode.all\n@qrcodes = Qrcode.find_all_by_quest_id(params[:quest_id])\n@quest = Quest.find(params[:quest_id])\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @qrcodes }\n end\n end",
"title": ""
},
{
"docid": "0b60ee31e41279c1dbb6eb58abb991e7",
"score": "0.5087599",
"text": "def original_url; end",
"title": ""
},
{
"docid": "b9c9ef6f33e1d07d73f2b9cf2dd2678e",
"score": "0.50816804",
"text": "def url\n PagSeguro.site_url(\"v2/authorization/request.jhtml?code=#{code}\") if code\n end",
"title": ""
},
{
"docid": "0531eaf6dd06d71dbda95f6c442e2b4c",
"score": "0.5073065",
"text": "def get(url)\n navigate.to(url)\n end",
"title": ""
},
{
"docid": "6cbaa2f3f5ca4e5f6dc1d0da8ae61e7e",
"score": "0.50723743",
"text": "def current_parameters\n @interface.yahoo_url_parameters\n end",
"title": ""
},
{
"docid": "06a1e0010dd52e145294eb034569e101",
"score": "0.50703025",
"text": "def on_request_uri(cli, req)\r\n\t\tsend_response(cli, %Q{window.location.replace('#{datastore['Website']}');})\r\n\tend",
"title": ""
},
{
"docid": "fc04811ebbd25996de6770231d201d5a",
"score": "0.50635344",
"text": "def content_get\n\t\t\t# compress GET requests to try and stay under that 8KB request limit\n\t\t\tdeflated_request = Zlib::Deflate.deflate(@request, 9)[2..-5]\n\t\t\t# strict_encode64() isn't available? sub out the newlines\n\t\t\t@request_params[\"SAMLRequest\"] = Base64.encode64(deflated_request).gsub(/\\n/, \"\")\n\t\t\t\n\t\t\tLogging.debug \"SAMLRequest=#{@request_params[\"SAMLRequest\"]}\"\n\t\t\turi = Addressable::URI.parse(@URL)\n\t\t\turi.query_values = @request_params\n\t\t\turl = uri.to_s\n\t\t\t#url = @URL + \"?SAMLRequest=\" + @request_params[\"SAMLRequest\"]\n\t\t\tLogging.debug \"Sending to URL #{url}\"\n\t\t\treturn url\n\t\tend",
"title": ""
},
{
"docid": "e8563c46816e198c2c48ae81fbe7fe68",
"score": "0.5052128",
"text": "def request_uri\n @request_uri ||= ImpURI.request_uri(@uri)\n end",
"title": ""
},
{
"docid": "d6fcbe55b34ced67591c0a0cdd0882a9",
"score": "0.5047981",
"text": "def location= uri\n native.open uri\n end",
"title": ""
},
{
"docid": "e29aa40b82cf0ed50f0696c085e709d5",
"score": "0.50479734",
"text": "def start_url(url)\n @start_url = url\n end",
"title": ""
},
{
"docid": "e5db5001a7fe2d1ced768381f76b84ed",
"score": "0.5047048",
"text": "def uri\n @uri\n end",
"title": ""
},
{
"docid": "e5db5001a7fe2d1ced768381f76b84ed",
"score": "0.5047048",
"text": "def uri\n @uri\n end",
"title": ""
},
{
"docid": "e0e9582adb86f79f498dcaf79e153b40",
"score": "0.5041344",
"text": "def getLocation\n loc = Addressable::URI.new(\n :scheme => \"https\",\n :host => \"maps.googleapis.com\",\n :path => \"maps/api/geocode/json\",\n :query_values => {:address => \"160+Folsom,+San+Francisco,+CA\",\n :sensor => \"false\"}).to_s\n\n location_request = RestClient.get(loc)\n parsed_location_request = JSON.parse(location_request)\n\n lat = parsed_location_request[\"results\"][0][\"geometry\"][\"location\"][\"lat\"].to_s\n lng = parsed_location_request[\"results\"][0][\"geometry\"][\"location\"][\"lng\"].to_s\n\n [lat,lng]\nend",
"title": ""
},
{
"docid": "ff89da9241d451b984cf80104eba8218",
"score": "0.5036086",
"text": "def checkout_uri # TODO cambiar por direccion real\n @command.continue_shopping_url = \"http://200.116.131.110:3000/cart/step2\"\n response = @command.send_to_google_checkout.redirect_url \n end",
"title": ""
},
{
"docid": "d746da410f4d66f88d64e1d1863e7844",
"score": "0.5033801",
"text": "def url\n end",
"title": ""
},
{
"docid": "8a7e8a002f85b45785529684a7ec5703",
"score": "0.5032958",
"text": "def uri; end",
"title": ""
},
{
"docid": "8a7e8a002f85b45785529684a7ec5703",
"score": "0.5032958",
"text": "def uri; end",
"title": ""
},
{
"docid": "8a7e8a002f85b45785529684a7ec5703",
"score": "0.5032958",
"text": "def uri; end",
"title": ""
},
{
"docid": "8a7e8a002f85b45785529684a7ec5703",
"score": "0.5032958",
"text": "def uri; end",
"title": ""
},
{
"docid": "8a7e8a002f85b45785529684a7ec5703",
"score": "0.5032958",
"text": "def uri; end",
"title": ""
},
{
"docid": "8a7e8a002f85b45785529684a7ec5703",
"score": "0.5032958",
"text": "def uri; end",
"title": ""
},
{
"docid": "8a7e8a002f85b45785529684a7ec5703",
"score": "0.5032958",
"text": "def uri; end",
"title": ""
},
{
"docid": "8a7e8a002f85b45785529684a7ec5703",
"score": "0.5032958",
"text": "def uri; end",
"title": ""
},
{
"docid": "8a7e8a002f85b45785529684a7ec5703",
"score": "0.5032958",
"text": "def uri; end",
"title": ""
},
{
"docid": "8a7e8a002f85b45785529684a7ec5703",
"score": "0.5032958",
"text": "def uri; end",
"title": ""
},
{
"docid": "8a7e8a002f85b45785529684a7ec5703",
"score": "0.5032958",
"text": "def uri; end",
"title": ""
},
{
"docid": "8a7e8a002f85b45785529684a7ec5703",
"score": "0.5032958",
"text": "def uri; end",
"title": ""
},
{
"docid": "871bf1f04d7add0f18a232e6014f04ff",
"score": "0.50306",
"text": "def get_url\n \"http://#{self.domain}/#{self.path}#{self.params.it_keys_to_get_param}\"\n end",
"title": ""
},
{
"docid": "2dc9df4fb8be2ef3ebff5d1b94ce9c16",
"score": "0.5028245",
"text": "def locate(address)\n location = (address.is_a?(String) ? address : location_from_params(address).to_s(:country => false))\n # yahoo pukes on line breaks\n get :location => location.gsub(\"\\n\", ', ')\n end",
"title": ""
},
{
"docid": "2dc9df4fb8be2ef3ebff5d1b94ce9c16",
"score": "0.5028245",
"text": "def locate(address)\n location = (address.is_a?(String) ? address : location_from_params(address).to_s(:country => false))\n # yahoo pukes on line breaks\n get :location => location.gsub(\"\\n\", ', ')\n end",
"title": ""
},
{
"docid": "51d81b9b94a24302759342e944f97303",
"score": "0.50269985",
"text": "def request_url input\n query = { \"appid\" => @token, \"input\" => \"#{input}\" }.merge @options\n\n RequestURI.dup.tap do |this|\n this.query = URI.encode_www_form query\n end\n end",
"title": ""
},
{
"docid": "596130fcda9d52d29946c26ac37af09a",
"score": "0.50252146",
"text": "def request_uri\n return nil if absolute? && scheme !~ /^https?$/\n res = path.to_s.empty? ? \"/\" : path\n res += \"?#{self.query}\" if self.query\n return res\n end",
"title": ""
},
{
"docid": "83c951cf5bf68f2e8210a48eeabd0a5d",
"score": "0.5016627",
"text": "def make_url\n # This works for most of the twitter calls\n \"http://ws.audioscrobbler.com/2.0/?method=#{resource_path}&artist=#{identifier}&limit=100&page=#{page}&api_key=#{api_key}&format=json\"\n end",
"title": ""
},
{
"docid": "3d820eebceab04086c9f7c2ea21f7787",
"score": "0.5016167",
"text": "def full_url\n mini_url = MiniUrl.find_by(url_code: params[:url_code])\n # raise not found exception for url code not present in db\n unless mini_url\n raise Exceptions::EmptyObjectError.new('Unable to find url for redirection.')\n end\n render location: mini_url.url, status: 307\n # increase redirect count and update after responding with actual url\n mini_url.redirect_count += 1\n unless mini_url.update\n logger.error \"Some error in updating redirect count for mini url - #{mini_url.url_code}\"\n end\n rescue Exceptions::EmptyObjectError => e\n render json: {error: e}, status: 404\n end",
"title": ""
}
] |
bf37860d5d5cdb186c62f1ecad248971 | List Services for infra Paginated list of Services for infra. | [
{
"docid": "99abc0450421eb106a5e013400bf94f1",
"score": "0.0",
"text": "def list_services_for_tenant_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: PolicyApi.list_services_for_tenant ...\"\n end\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicyApi.list_services_for_tenant, must be smaller than or equal to 1000.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 0\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicyApi.list_services_for_tenant, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = \"/infra/services\"\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'included_fields'] = opts[:'included_fields'] if !opts[:'included_fields'].nil?\n query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?\n query_params[:'sort_ascending'] = opts[:'sort_ascending'] if !opts[:'sort_ascending'].nil?\n query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ServiceListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyApi#list_services_for_tenant\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
}
] | [
{
"docid": "1c01d83635a27954cd320212dc87d094",
"score": "0.74385226",
"text": "def index\n @page_count, @services = Locomotive::Service.paginated(:page => (params[:page] || 1).to_i)\n display @services\n end",
"title": ""
},
{
"docid": "43ad96e510b75ddd3460a80ac60a7163",
"score": "0.7103048",
"text": "def service_list # rubocop:disable Metrics/AbcSize\n list_result = SrvList.new(@options)\n helper = PaasHelpers.new if @options[:paas_rest_endpoint]\n @options[:paas_rest_endpoint] = helper.paas_url(@options) if @options[:paas_rest_endpoint]\n list_result.url = @options[:paas_rest_endpoint] if @options[:paas_rest_endpoint]\n if @options[:inst]\n inst_list(list_result)\n else\n result = list_result.service_list\n @util.response_handler(result)\n JSON.pretty_generate(JSON.parse(result.body))\n end\n end",
"title": ""
},
{
"docid": "eb936b8eaa49e4a9609471a70bfbe0d7",
"score": "0.69706553",
"text": "def index\n @services = Service.all.page(params[:page])\n end",
"title": ""
},
{
"docid": "8e6668d7d85dfa78f01e767a1c1a1cbd",
"score": "0.6937321",
"text": "def index\n\t\t@services = services\n\tend",
"title": ""
},
{
"docid": "c2c0d53b2bbf9d8f8799683e5a2d41e1",
"score": "0.68434",
"text": "def index\n @it_services = ItService.all\n end",
"title": ""
},
{
"docid": "f2a7506f00f67701e75c1bb0a41b199b",
"score": "0.68124574",
"text": "def index\n @user = current_user\n @services = Service.order(sort_column + \" \" + sort_direction).paginate(:per_page => 8, :page => params[:page])\n end",
"title": ""
},
{
"docid": "c984685404a15fb6895e7897e69342f1",
"score": "0.67498165",
"text": "def index\n @services = Service.all\n end",
"title": ""
},
{
"docid": "c984685404a15fb6895e7897e69342f1",
"score": "0.67498165",
"text": "def index\n @services = Service.all\n end",
"title": ""
},
{
"docid": "c984685404a15fb6895e7897e69342f1",
"score": "0.67498165",
"text": "def index\n @services = Service.all\n end",
"title": ""
},
{
"docid": "c984685404a15fb6895e7897e69342f1",
"score": "0.67498165",
"text": "def index\n @services = Service.all\n end",
"title": ""
},
{
"docid": "c984685404a15fb6895e7897e69342f1",
"score": "0.67498165",
"text": "def index\n @services = Service.all\n end",
"title": ""
},
{
"docid": "c984685404a15fb6895e7897e69342f1",
"score": "0.67498165",
"text": "def index\n @services = Service.all\n end",
"title": ""
},
{
"docid": "c984685404a15fb6895e7897e69342f1",
"score": "0.67498165",
"text": "def index\n @services = Service.all\n end",
"title": ""
},
{
"docid": "02563395169454b85b465b7b5b12426f",
"score": "0.6741705",
"text": "def index\n #@services = Service.paginate(page: params[:page])\n @services = Service.paginate(:page => params[:service_page], :per_page => 8)\n end",
"title": ""
},
{
"docid": "35a7418c2c3270f7a8cae066b723ac49",
"score": "0.6725776",
"text": "def services\n @services = Service.all\n end",
"title": ""
},
{
"docid": "31d309f4c4b1f1bfa65f28a22c9c06d0",
"score": "0.66901976",
"text": "def index\r\n @services = Service.all\r\n end",
"title": ""
},
{
"docid": "6891e179254681d8603e47c87a4c09d5",
"score": "0.66477495",
"text": "def index\n @ivr_services = IvrService.all\n end",
"title": ""
},
{
"docid": "892088b50bf837b257bdc8943a986522",
"score": "0.66220266",
"text": "def index\n @class_services = ClassService.all\n end",
"title": ""
},
{
"docid": "d6873f01fd97a90227cddfd397db1e17",
"score": "0.66204816",
"text": "def index\n super\n @services = Service.all\n end",
"title": ""
},
{
"docid": "1f94ad851e13e12488fb524388014a23",
"score": "0.66162884",
"text": "def index\n @our_services = OurService.all\n end",
"title": ""
},
{
"docid": "ebe514c18cc054477b6b5147c9a9c89f",
"score": "0.66006356",
"text": "def services\n get('catalog/services')\n end",
"title": ""
},
{
"docid": "46195fab7aa19923e85663b8d124d718",
"score": "0.6593299",
"text": "def index\n @service_requests = ServiceRequest.all.order(:id).paginate(page: params[:page], per_page: 10 )\n end",
"title": ""
},
{
"docid": "c154959679eee42b2efafbca25f0f336",
"score": "0.6577334",
"text": "def index\n @services = current_user.company.services.where(tipo: \"Servicio\").search_by_name(params[:name]).search_by_code(params[:code]).search_by_category(params[:category]).search_with_stock(params[:stock]).paginate(page: params[:page], per_page: 9)\n end",
"title": ""
},
{
"docid": "cf516c31a71ff0031dceaecd28db4849",
"score": "0.65655756",
"text": "def index\n @services = if current_user.admin\n Service.all.page params[:page]\n elsif current_user.employee\n current_user.employee.services.where(employee_id: current_user.employee.id).page params[:page]\n else\n current_user.client.services.page params[:page]\n end\n end",
"title": ""
},
{
"docid": "f4216303c145e7578e6263d28f1482ff",
"score": "0.6560873",
"text": "def index\n \t@services = Service.order('nome')\n\tend",
"title": ""
},
{
"docid": "c7760b07b4497b23a85afab2e7218d1d",
"score": "0.6552325",
"text": "def index\n @servservices = Servservice.all\n end",
"title": ""
},
{
"docid": "a2579d7ab195719504f1df5714e44419",
"score": "0.6550617",
"text": "def get_services\n with_monitoring do\n raw_response = perform(:get, \"/services?limit=#{LIMIT}&query=#{QUERY}\")\n\n PagerDuty::ExternalServices::Response.from(raw_response)\n end\n end",
"title": ""
},
{
"docid": "a1e35ca87816d3f1e0caf86ff0b0a055",
"score": "0.6545937",
"text": "def services\n @@api.get(endpoint: \"services\")\n end",
"title": ""
},
{
"docid": "dc1f8f80e5c98258daf476e8a7ee64c9",
"score": "0.653268",
"text": "def index\n @customs_service_departments = CustomsServiceDepartment.all.paginate(page: params[:page], per_page: 15)\n end",
"title": ""
},
{
"docid": "1e86241652bccb1465817e1f67553d9b",
"score": "0.6522919",
"text": "def index\n @services = Service.order(created_at: :desc)\n json_response(@services)\n end",
"title": ""
},
{
"docid": "3ecc8dd27e08e0a8a262f26e20a81d2c",
"score": "0.65192914",
"text": "def index\n @servicios = Servicio.all\n end",
"title": ""
},
{
"docid": "3ecc8dd27e08e0a8a262f26e20a81d2c",
"score": "0.65192914",
"text": "def index\n @servicios = Servicio.all\n end",
"title": ""
},
{
"docid": "15e639a3882e4b1882ec3bb403902e27",
"score": "0.65158266",
"text": "def index\n @services = Service.all\n #debug()\n end",
"title": ""
},
{
"docid": "7412d733d36e734b43402fabfacc3886",
"score": "0.6508854",
"text": "def index\n @vendor_services = VendorService.all\n end",
"title": ""
},
{
"docid": "b72c3c3dff9509ddc297d52b91d147b4",
"score": "0.6482546",
"text": "def index\n @clinic_services = ClinicService.all\n end",
"title": ""
},
{
"docid": "426ba949172a629772699227ffd9e209",
"score": "0.6481277",
"text": "def index\n @service_of_dependences = ServiceOfDependence.all\n end",
"title": ""
},
{
"docid": "4e1c34f81b9182f661729e8fad839256",
"score": "0.64636743",
"text": "def index\n @service_type_services = ServiceTypeService.all\n end",
"title": ""
},
{
"docid": "e9cb3b1fe959bcaf90bd8bc8ca93ea2a",
"score": "0.64618194",
"text": "def index\n authorize skip_scoping: true\n @services = apply_authz_scopes(on: Service).includes(:client, :city, :driver).all.order(created_at: :desc)\n end",
"title": ""
},
{
"docid": "9b8a9ad00ec55a35c5472e7d7e9a068d",
"score": "0.64587855",
"text": "def index\n @services = current_user.services.order('provider asc')\n end",
"title": ""
},
{
"docid": "9b8a9ad00ec55a35c5472e7d7e9a068d",
"score": "0.64587855",
"text": "def index\n @services = current_user.services.order('provider asc')\n end",
"title": ""
},
{
"docid": "b002af49c7866a257b8765064fb716ab",
"score": "0.64255357",
"text": "def all_services; end",
"title": ""
},
{
"docid": "98f8c081f9625999e33aed31d3012fda",
"score": "0.6409361",
"text": "def index\n @serviceproviders = Serviceprovider.all\n end",
"title": ""
},
{
"docid": "8de38cb6c59a15235e2df222ea04c980",
"score": "0.64086807",
"text": "def index\n @user_services = UserService.all\n end",
"title": ""
},
{
"docid": "bb65b5fe3b11ad1b7ffbffb6b646c26e",
"score": "0.6405636",
"text": "def index\n @extra_services = ExtraService.all\n end",
"title": ""
},
{
"docid": "e01071224edc6e26407d4fa1e066e514",
"score": "0.6368493",
"text": "def index\n @translation_services = TranslationService.all\n end",
"title": ""
},
{
"docid": "0b05a40656a888299846f1d76c7794f8",
"score": "0.636614",
"text": "def get_all_services()\n return @services\n end",
"title": ""
},
{
"docid": "493f936c49f2ca69dfc085b52c0513ba",
"score": "0.63657564",
"text": "def index\n @service_providers = ServiceProvider.all\n end",
"title": ""
},
{
"docid": "493f936c49f2ca69dfc085b52c0513ba",
"score": "0.63657564",
"text": "def index\n @service_providers = ServiceProvider.all\n end",
"title": ""
},
{
"docid": "d2b8f71bbe7e252267411f1842e942e5",
"score": "0.63483906",
"text": "def list\n \tservice_list.each do |service|\n puts \"=== #{service.name} on #{service.host}:#{service.port} ===\"\n puts \" #{service.description}\"\n puts \" http://#{service.host}:#{service.port}/\"\n puts\n end\n end",
"title": ""
},
{
"docid": "2bca19e3716ad4f31df07265c4c39824",
"score": "0.63482165",
"text": "def index\n @services = @user.services\n end",
"title": ""
},
{
"docid": "30a2ef76d25b4c109fbc248c9ae20d08",
"score": "0.6340694",
"text": "def index\n @services = Service.where(\"admin_id = ?\",current_admin.id)\n end",
"title": ""
},
{
"docid": "c90e3450a676df4012f099752c03797e",
"score": "0.6329924",
"text": "def list_cloud_services\n request_path = '/services/hostedservices'\n request = ManagementHttpRequest.new(:get, request_path, nil)\n response = request.call\n Serialization.cloud_services_from_xml(response)\n end",
"title": ""
},
{
"docid": "6e14f4b5535977ea22b16b84d16bd14e",
"score": "0.6324334",
"text": "def index\n @subservices = Subservice.all\n end",
"title": ""
},
{
"docid": "589b9056109fb5a41e61179ccbee1a37",
"score": "0.632112",
"text": "def index\n @kind_of_services = KindOfService.all\n end",
"title": ""
},
{
"docid": "2c59387b3249fd5a3904fb9da90254f2",
"score": "0.6292938",
"text": "def list\n\t\t@service_requests = ServiceRequest.all\n\tend",
"title": ""
},
{
"docid": "27c22a985bd484e2cd654690aa277dbf",
"score": "0.62923384",
"text": "def list\n logger.debug(\"Getting all provisioned services for user: #{user.id}\")\n\n cfgs = ServiceConfig.find_all_by_user_id(user.id)\n logger.debug(\"Found #{cfgs.length} provisioned services for user: #{user.id}\")\n ret = cfgs.map {|cfg| cfg.as_legacy}\n logger.debug(\"Returning configs: #{ret.inspect}\")\n\n render :json => ret\n end",
"title": ""
},
{
"docid": "65943acf207410a6c582bcd820cd9c32",
"score": "0.6290996",
"text": "def index\n @servicos = Servico.all\n end",
"title": ""
},
{
"docid": "65943acf207410a6c582bcd820cd9c32",
"score": "0.6290996",
"text": "def index\n @servicos = Servico.all\n end",
"title": ""
},
{
"docid": "2d5e9da8efd18ab488380d05ba043196",
"score": "0.6279065",
"text": "def list_services(opts= {})\n c = @client[\"#{@account}/services\"]\n headers = gen_headers(opts)\n attempt(opts[:attempts]) do\n do_get(c, headers)\n end\n end",
"title": ""
},
{
"docid": "0ff789e76ab815818fa98ad2983aad61",
"score": "0.6265181",
"text": "def index\n @service_stations = ServiceStation.all\n @service_stations = @service_stations.order(:name).page(params[:page] || 1)\n end",
"title": ""
},
{
"docid": "22ac84da9c3cbadbb4ac217d598b38eb",
"score": "0.62614065",
"text": "def list_services\n response = @http_client.get(prefix_path('services'))\n AgentListServicesResponse.new(response)\n end",
"title": ""
},
{
"docid": "a816e93fcfc0af457993c9312f722e29",
"score": "0.6254894",
"text": "def index\n @online_services = OnlineService.all\n end",
"title": ""
},
{
"docid": "13392e9be298cb81a481696be097d81c",
"score": "0.6254149",
"text": "def index\n @services = Array.new\n @services.push(available?(Service.new('SERVICE_COPYRIGHTSTATUS', SERVICE_COPYRIGHTSTATUS + \"/12345\")))\n @services.push(available?(Service.new('SERVICE_COLLECTION', SERVICE_COLLECTION + \"12345\")))\n @services.push(available?(Service.new('SERVICE_CATALOG_SEARCH', SERVICE_CATALOG_SEARCH)))\n @services.push(available?(Service.new('SERVICE_DCM_SEARCH', SERVICE_DCM_SEARCH + \"?q=*:*\")))\n @services.push(available?(Service.new('SERVICE_RIGHTSHOLDER_SEARCH', SERVICE_RIGHTSHOLDER_SEARCH + \"?q=*:*\")))\n @services.push(available?(Service.new('SERVICE_TRIM', SERVICE_TRIM + \"12345\")))\n @services.push(available?(Service.new('SERVICE_NLATHUMB', SERVICE_NLATHUMB + \"382365\")))\n @services.push(available?(Service.new('SERVICE_VOYAGERDB', SERVICE_VOYAGERDB + \"record/12345/authorities\")))\n @services.push(available?(Service.new('SERVICE_DCMDB', SERVICE_DCMDB)))\n end",
"title": ""
},
{
"docid": "187d742c5aade007f44ff2963f23769f",
"score": "0.6247155",
"text": "def index\n @optin_services = OptinService.all\n end",
"title": ""
},
{
"docid": "27e0010b6c7da6680a4d1a7131db21bf",
"score": "0.6242614",
"text": "def services_list\n available_services.map(&:to_hash)\n end",
"title": ""
},
{
"docid": "862e745c656ca9fb3b2f1bb2c003858f",
"score": "0.62379694",
"text": "def index\n @orden_servicios = OrdenServicio.all\n end",
"title": ""
},
{
"docid": "503a545f8111d2b37a86f5b57c1f4fd0",
"score": "0.6233404",
"text": "def index\n @service_sections = ServiceSection.all\n end",
"title": ""
},
{
"docid": "57f264c1523d61c491d333412d0a0942",
"score": "0.6231856",
"text": "def index\n @service_requests = ServiceRequest.all\n end",
"title": ""
},
{
"docid": "57f264c1523d61c491d333412d0a0942",
"score": "0.6231856",
"text": "def index\n @service_requests = ServiceRequest.all\n end",
"title": ""
},
{
"docid": "28bb6d1a4a8be6670757df4e4a9c469f",
"score": "0.6227618",
"text": "def index\n @dive_services = DiveService.all\n end",
"title": ""
},
{
"docid": "2992a8b250570458a31b306accc7b4cd",
"score": "0.6218357",
"text": "def index\n @service_lists = current_user.business.service_lists.all\n end",
"title": ""
},
{
"docid": "68a6458495d9dcc57cadfb4e5801b67a",
"score": "0.6217261",
"text": "def index\n @services = Service.where(:company_id => current_user.company.id).paginate(:page => params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @services }\n end\n end",
"title": ""
},
{
"docid": "5bf2c89b1750d5d4c4e7b5e851714010",
"score": "0.6211545",
"text": "def index\n @services = Service.alphabetical.paginate(page: params[:page]).per_page(5)\n @categories = Category.alphabetical\n end",
"title": ""
},
{
"docid": "def8e63ff9c03328bf100a89db31c9d1",
"score": "0.6205957",
"text": "def index\n services = Rails.cache.fetch('services') { CodeburnerUtil.get_services }\n\n render(:json => { \"count\": services.length, \"results\": services })\n end",
"title": ""
},
{
"docid": "6be1950affdb04c34c98bb3b39cfa6ba",
"score": "0.6203644",
"text": "def services\n @stashboard.services\n end",
"title": ""
},
{
"docid": "19268051f9eb9120976dc2f342d52dc6",
"score": "0.6199874",
"text": "def index\n @ordem_servicos = OrdemServico.all\n @ordem_servicos = @ordem_servicos.order(created_at: :desc)\n @ordem_servicos = @ordem_servicos.page params['page']\n end",
"title": ""
},
{
"docid": "50ed1f1bf11813670514da2dc2950aee",
"score": "0.61819595",
"text": "def index\n @services = current_user.services\n\n if user_signed_in? && current_user.is_admin? && !params.has_key?(:normal)\n @users = User.all\n @services = Service.all.paginate(:page => params[:page], :per_page => 12)\n render :\"admin_service\"\n end\n end",
"title": ""
},
{
"docid": "1ba1cc3a7257a1b039ca11e282c36cc6",
"score": "0.61817557",
"text": "def services\n Naiad.services\n end",
"title": ""
},
{
"docid": "1c5d75e84e2317492145a39e17a7f8d8",
"score": "0.61735594",
"text": "def index\n @groups = Group.order(:name)\n @services = filter_services(params[:search])\n @services = sort_results(params, @services)\n @services = @services.paginate(:page => params[:page], \n :per_page => session[:results_per_page])\n @new_service = Service.new\n end",
"title": ""
},
{
"docid": "0bbb9a87cbdafdc285ee51d3402d3fd3",
"score": "0.616469",
"text": "def index\n dependence = Dependence.where(code: current_user.dependence.code).first\n @services_of_dependences = dependence.service_of_dependences.joins(:service).order(\"name ASC\")\n \n end",
"title": ""
},
{
"docid": "e1589282251ea443658892caa1c19b71",
"score": "0.61610174",
"text": "def index\n @service_types = ServiceType.all\n end",
"title": ""
},
{
"docid": "a14031215581642466e7caf4a2fe5abd",
"score": "0.6157496",
"text": "def index\n if (!params[:search].nil?)\n if (current_user.role? (:admin))\n @services = Service.joins(:service_translations).where(\"service_translations.language_id=1 and LOWER(service_translations.name) LIKE LOWER(?)\", \"%#{params[:search]}%\").page(params[:page]).per(10)\n else\n @services = Service.joins(:service_translations).where(\"service_translations.language_id=1 and services.web_user_id=? and LOWER(service_translations.name) LIKE LOWER(?)\", current_user.id,\"%#{params[:search]}%\").page(params[:page]).per(10)\n end\n else\n if (current_user.role? (:admin))\n @services = Service.page(params[:page]).per(10)\n else\n @services = current_user.web_user.services.page(params[:page]).per(10) if current_user && current_user.web_user\n end\n end\n respond_to do |format|\n format.html{}\n format.json{}\n end\n end",
"title": ""
},
{
"docid": "2333edbc651b4986b02bd63d4f3d7b34",
"score": "0.61559683",
"text": "def load_services\n @services = @group.services(@year).paginate(:page => \n params[:services_page], :per_page => session[:results_per_page])\n end",
"title": ""
},
{
"docid": "d2d90d6b86578209cc8d25b692280725",
"score": "0.6152686",
"text": "def services\n end",
"title": ""
},
{
"docid": "add0163ff58e6ba9cb8d03678cfe5634",
"score": "0.6149364",
"text": "def list_cloud_services\n request_path = '/services/hostedservices'\n request = client.management_request(:get, request_path)\n response = request.call\n Serialization.cloud_services_from_xml(response)\n end",
"title": ""
},
{
"docid": "b26eba8f28c98d64f31aac5d4709a34d",
"score": "0.6145",
"text": "def services\n collector.services.each do |service|\n parse_service(service)\n end\n end",
"title": ""
},
{
"docid": "1d1992f07c8ba81d427a13e116a8c2ac",
"score": "0.6134612",
"text": "def index\n @landscaping_services = LandscapingService.all\n end",
"title": ""
},
{
"docid": "5b09798331403da8ae2ec3e8b9357f61",
"score": "0.6126097",
"text": "def index\r\n #@servicos = Servico.all\r\n @servicos = @laboratorio.servicos\r\n end",
"title": ""
},
{
"docid": "5b19b7bd93c5c38b922fe67e32ead428",
"score": "0.6124626",
"text": "def index\n\n @services = Service.all\n @nservice = Service.new\n end",
"title": ""
},
{
"docid": "90ded881d92785345415abde253509c0",
"score": "0.61226577",
"text": "def index\n @service = Fl::Framework::Service::List.new(current_user, params, self)\n r = @service.index({ includes: [ ] }, query_params, pagination_params)\n respond_to do |format|\n format.html do\n end\n\n format.json do\n if r\n render :json => { :lists => hash_objects(r[:result], @service.to_hash_params), :_pg => r[:_pg] }\n else\n error_response(generate_error_info(@service))\n end\n end\n end\n end",
"title": ""
},
{
"docid": "7ee9a647db20d574704bbd7205f32404",
"score": "0.6112335",
"text": "def index\n @services = @person.services.paginate(:page => params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @services }\n end\n end",
"title": ""
},
{
"docid": "59108596f9da73172a9c639f367cfe0c",
"score": "0.6102044",
"text": "def services_refresh\n authorize!(:view_central_services)\n\n searchable = params[:sSearch]\n\n query_params = get_list_query_params(\n get_service_column(get_sort_column_no))\n\n central_services = CentralService.\n get_central_services(query_params)\n count = CentralService.get_service_count(searchable)\n\n result = []\n central_services.each do |each|\n service_id = each.target_service\n provider_name = service_id ?\n XRoadMember.get_name(service_id.member_class, service_id.member_code) :\n \"\"\n result << {\n :central_service_code => each.service_code,\n :provider_name => provider_name,\n :id_service_code => service_id ? service_id.service_code : \"\",\n :id_service_version => service_id ? service_id.service_version : \"\",\n :id_provider_code => service_id ? service_id.member_code : \"\",\n :id_provider_class => service_id ? service_id.member_class : \"\",\n :id_provider_subsystem => service_id ? service_id.subsystem_code : \"\"\n }\n end\n\n render_data_table(result, count, params[:sEcho])\n end",
"title": ""
},
{
"docid": "66c967fe26337103a014965c7e44654e",
"score": "0.60913944",
"text": "def index\n @registro_cliente_servicios = Registro::ClienteServicio.all\n end",
"title": ""
},
{
"docid": "764dc4449703748eb368e26f2a887dc9",
"score": "0.608631",
"text": "def index\n @tech_services = TechService.all\n end",
"title": ""
},
{
"docid": "66e22d47e47276c11de8a96379fa1069",
"score": "0.60849315",
"text": "def index\n @reservation2_services = Reservation2Service.all\n end",
"title": ""
},
{
"docid": "ae9cf65c0fb9477467d8e7a0d11867c5",
"score": "0.6082446",
"text": "def services\n @services ||= []\n end",
"title": ""
},
{
"docid": "ae9cf65c0fb9477467d8e7a0d11867c5",
"score": "0.6082446",
"text": "def services\n @services ||= []\n end",
"title": ""
},
{
"docid": "aa4f7294151861eeee620b6d01a01710",
"score": "0.6082246",
"text": "def index\n @admin_agreement_services = Admin::AgreementService.all\n end",
"title": ""
},
{
"docid": "d5e701947f6d63b2080ee139b0c4e31e",
"score": "0.60817564",
"text": "def index\n @service_items = current_user.business.service_items.all\n end",
"title": ""
},
{
"docid": "8f424623c86cec311652fad9e5884e30",
"score": "0.6080964",
"text": "def index\n #@facilities = Facility.paginate(:page => params[:facility_page], :per_page => 10)\n @facilities = current_service_manager.service.facilities.paginate(:page => params[:facility_page], :per_page => 10)\n end",
"title": ""
},
{
"docid": "9e4aa1d9d5052ac91457ef4c4d753612",
"score": "0.607314",
"text": "def index\n @tipo_servicios = TipoServicio.all\n end",
"title": ""
}
] |
731eaf0cf0e1a81dc5ca9d86f4c9cc7e | Returns the body of the response of the API Call to get an specific question. Raises QuizException if the status is not 200 | [
{
"docid": "4caea49ebd412474abe47fbd28b5afc8",
"score": "0.7421037",
"text": "def get_question(question)\n questionResp = @connection.get(\"#{Quiz::QUESTION}?id=#{question}\")\n raise QuizException.new(\"Failed to get question, API responded with status #{quizResp.status} and error #{quizResp.body[\"error\"]}\") if questionResp.status != 200\n questionResp.body\n\n end",
"title": ""
}
] | [
{
"docid": "c89b8b2a67525ea8fafaecd7feda0479",
"score": "0.7089223",
"text": "def get_question()\n\t\t# build the url\n\t\turl = @base_address + '/question'\n\t\t# make the request, the response will be the return value of the method\n\t\t@question = RestClient.get url\n\tend",
"title": ""
},
{
"docid": "a6bcdd439b521721baa67588ade81754",
"score": "0.7017944",
"text": "def get_question\n uri = 'http://jservice.io/api/random?count=1'\n request = HTTParty.get(uri)\n puts \"[LOG] #{request.body}\"\n response = JSON.parse(request.body).first\n # Some questions have no question, some have been marked invalid by the admin\n if response['question'].nil? || response['question'].strip == '' ||\n (!response['invalid_count'].nil? && response['invalid_count'].to_i > 0)\n response = get_question\n end\n response['value'] = 200 if response['value'].nil?\n response['answer'] = Sanitize.fragment(response['answer'].gsub(/\\s+( |&)\\s+/i, ' and '))\n response['expiration'] = params['timestamp'].to_f + ENV['SECONDS_TO_ANSWER'].to_f\n response\nend",
"title": ""
},
{
"docid": "5afde4b47b63412f47671a563689f5b6",
"score": "0.6699561",
"text": "def get_question_from_stack_overflow question_id\n puts \"Getting question #{question_id} from Stackoverflow..\"\n \n # Get question from Stackoverflow\n response = RubyStackoverflow.questions_by_ids([question_id],{:filter => 'withBody'})\n \n if response.data == nil\n return {\n 'success' => false,\n 'message' => response.inspect\n }\n else\n return {\n 'success' => true,\n 'question' => response.data.first\n }\n \n end\n end",
"title": ""
},
{
"docid": "e76a374e8986951a6354ed897e2ecd66",
"score": "0.6498342",
"text": "def get_quiz(name,id)\n quizResp = @connection.get(\"#{Quiz::SCORE}?quiz=#{id}&name=#{name}\")\n raise QuizException.new(\"Failed to get quiz, API responded with status #{quizResp.status} and error #{quizResp.body[\"error\"]}\") if quizResp.status != 200\n quizResp.body\n\n end",
"title": ""
},
{
"docid": "8644fa78fd8e5cd46c35ddaa7e96d3e5",
"score": "0.64959896",
"text": "def response_body\n @response_body ||= if response = Curl.get(url)\n response.body_str\n end\n\n rescue Curl::Err::SSLConnectError, Curl::Err::HostResolutionError\n puts \"Could not connect to Quandl API. Please try again\"\n exit 1\n end",
"title": ""
},
{
"docid": "30eff0f73559a4aca8baae473aa7b2bb",
"score": "0.6430068",
"text": "def not_enough_questions_response\n { statusCode: 404,\n errorCode: 'NOT_ENOUGH_QUESTIONS',\n message: 'Not enough questions could be generated for the quiz.' }.to_json\n end",
"title": ""
},
{
"docid": "4884ff3a6983546b776e8154ea0e58f7",
"score": "0.6159658",
"text": "def show\n @quiz = current_org.quizzes.find(params[:id])\n\n respond_to do |format|\n format.html\n format.json { render json: @quiz }\n end\n end",
"title": ""
},
{
"docid": "0db51f2f0325706e48fd3273cac40646",
"score": "0.61394453",
"text": "def question_not_found_response\n { statusCode: 404,\n errorCode: 'QUESTION_NOT_FOUND',\n message: 'The question could not be found for the user.' }.to_json\n end",
"title": ""
},
{
"docid": "a678ee6a1d872ef256dc4a17a1359b5f",
"score": "0.60826045",
"text": "def iron_api_response\n\t\t\turi = URI(\"https://www.quandl.com/api/v3/datasets/FRED/M0442AUS37980M290NNBR.json?api_key=PSfJy_uEog7spRv_K5mY\")\n\t\t\tresponse = Net::HTTP.get(uri)\n\t\t\tparsed = JSON.parse(response)\n\t\t\tparsed[\"results\"]\n\t\t\t# included print for testing purposes\n\t\t\tprint parsed\n\t\tend",
"title": ""
},
{
"docid": "3153260f46e0a01c3a5ef28b32805dfe",
"score": "0.60773635",
"text": "def quiz_not_started_response\n { statusCode: 404,\n errorCode: 'QUIZ_NOT_STARTED',\n message: 'A new quiz has not been started for the user.' }.to_json\n end",
"title": ""
},
{
"docid": "6ecd461ad140c536c7f8fdf0edb54c38",
"score": "0.60654026",
"text": "def handle_get(body)\n make_response(200, obtain_questions(body))\nend",
"title": ""
},
{
"docid": "59938496bdcee48ae94ddf83f6a47d79",
"score": "0.5995181",
"text": "def get_question_with_http_info(id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: GamificationTriviaApi.get_question ...\"\n end\n # verify the required parameter 'id' is set\n if @api_client.config.client_side_validation && id.nil?\n fail ArgumentError, \"Missing the required parameter 'id' when calling GamificationTriviaApi.get_question\"\n end\n # resource path\n local_var_path = \"/trivia/questions/{id}\".sub('{' + 'id' + '}', id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['oauth2_client_credentials_grant', 'oauth2_password_grant']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'QuestionResource')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: GamificationTriviaApi#get_question\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "f21bdf5068d061850a35a8ce3e340eba",
"score": "0.5986817",
"text": "def questions\n self.class.get('/2.2/questions', @options)\n end",
"title": ""
},
{
"docid": "9f18bdf0e93b3e77ec3e3b1d3c95da9e",
"score": "0.5982594",
"text": "def question_response\n { question: question_hash }.to_json\n end",
"title": ""
},
{
"docid": "80e65a7b5d94871ec276652c5654eef9",
"score": "0.5976557",
"text": "def getsurveyquestion_app\n response = getsurvey_question(params[:form_id].to_i)\n if response.present?\n puts \"Got all survey questions!\"\n render json: { message: response }, status: 200 \n else\n puts \"Could not get survey questions!\"\n render json: { message: 'Could not get survey questions!'}, status: 403\n end\n end",
"title": ""
},
{
"docid": "65710ea2d0473ec248767a4f73450483",
"score": "0.594862",
"text": "def show\n @quiz_question = @quiz_page.quiz_questions.find(params[:id])\n\n # TODO might want a json response here\n respond_to do |format|\n format.html { redirect_to(learning_module_section_quiz_page_quiz_questions_path) }\n format.xml { render :xml => @quiz_question }\n end\n end",
"title": ""
},
{
"docid": "615fcf14b094fbc9b631372f3129fa6f",
"score": "0.59208566",
"text": "def get_survey_reponse\n url = ApiRequest.base_path(\"questionpro.survey.surveyResponse\")\n result = self.class.get(url, body: self.options)\n \n self.full_response = result\n self.status = result['status']\n\n response = SurveyResponse.new(result['response']['surveyResponse'])\n\n return response\n end",
"title": ""
},
{
"docid": "175a8e1deb6ef39a103c4d01e93a4151",
"score": "0.58703184",
"text": "def get_questions\r\n items = get_items\r\n make_response(HttpStatus::OK, make_result_list(items))\r\nend",
"title": ""
},
{
"docid": "5c1386be6b8484aa46d02a66fa49803f",
"score": "0.585379",
"text": "def get_questions \n\tquestions_raw = RestClient.get(\"https://opentdb.com/api.php?amount=50&difficulty=easy&type=multiple\")\n\tJSON.parse(questions_raw)['results']\nend",
"title": ""
},
{
"docid": "ec6122a9988305653d1bfd0817d8c57e",
"score": "0.5815814",
"text": "def get_question_using_get_with_http_info(question_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: QuestionnaireApi.get_question_using_get ...'\n end\n # verify the required parameter 'question_id' is set\n if @api_client.config.client_side_validation && question_id.nil?\n fail ArgumentError, \"Missing the required parameter 'question_id' when calling QuestionnaireApi.get_question_using_get\"\n end\n # resource path\n local_var_path = '/nucleus/v1/question/{question_id}'.sub('{' + 'question_id' + '}', question_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['oauth2']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Question')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: QuestionnaireApi#get_question_using_get\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "d4c40943626d7e283492da2006bbdf10",
"score": "0.5787356",
"text": "def quick_answer_with_http_info(q, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: DefaultApi.quick_answer ...'\n end\n # verify the required parameter 'q' is set\n if @api_client.config.client_side_validation && q.nil?\n fail ArgumentError, \"Missing the required parameter 'q' when calling DefaultApi.quick_answer\"\n end\n # resource path\n local_var_path = '/recipes/quickAnswer'\n\n # query parameters\n query_params = opts[:query_params] || {}\n query_params[:'q'] = q\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] || 'Object' \n\n # auth_names\n auth_names = opts[:auth_names] || ['apiKeyScheme']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: DefaultApi#quick_answer\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "9d2672fabca836c74ca9eb86c1892fd7",
"score": "0.5758374",
"text": "def get_random_question_from_api\n response_string = RestClient.get('https://opentdb.com/api.php?amount=50&category=17&type=multiple')\n response_hash = JSON.parse(response_string)\n #get random question\n size = response_hash[\"results\"].count\n rand_i = rand(size)\n return response_hash[\"results\"][rand_i]\n #return random question with keys \"question\", \"correct_answer\", \"incorrect_answers\"\nend",
"title": ""
},
{
"docid": "13f864855fcee29f91b2fa284c7049e7",
"score": "0.5746473",
"text": "def get_survey\n url = ApiRequest.base_path(\"questionpro.survey.getSurvey\")\n result = self.class.get(url, body: self.options)\n \n self.full_response = result\n self.status = result['status']\n\n survey = Survey.new(result['response'])\n\n return survey\n end",
"title": ""
},
{
"docid": "daf45aa54d5f7ff9819d5fb85de7cff0",
"score": "0.5743367",
"text": "def show\n @quiz = Quiz.includes(:questions).find(params[:id])\n if !(@quiz.accessible(current_user.id, current_user.institution_id))\n respond_to do |format|\n format.html { redirect_to action: \"index\" }\n format.json { render json: @quiz.errors, status: :unprocessable_entity }\n end\n return\n end\n @question = @quiz.questions\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @quiz }\n end\n end",
"title": ""
},
{
"docid": "3fd5087110a78cb899713a309a6006db",
"score": "0.5736526",
"text": "def question\n ques_type = params[:within].try([:ques_type])\n ques_id = params[:within].try([:ques_id])\n question = get_custom_ques current_user.id,ques_type,ques_id\n render json: question\n end",
"title": ""
},
{
"docid": "2858531acaac2fc0ab3b3a3b5767e30d",
"score": "0.5707801",
"text": "def get_questions_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: GamificationTriviaApi.get_questions ...\"\n end\n # resource path\n local_var_path = \"/trivia/questions\"\n\n # query parameters\n query_params = {}\n query_params[:'size'] = opts[:'size'] if !opts[:'size'].nil?\n query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?\n query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil?\n query_params[:'filter_search'] = opts[:'filter_search'] if !opts[:'filter_search'].nil?\n query_params[:'filter_idset'] = opts[:'filter_idset'] if !opts[:'filter_idset'].nil?\n query_params[:'filter_category'] = opts[:'filter_category'] if !opts[:'filter_category'].nil?\n query_params[:'filter_tagset'] = opts[:'filter_tagset'] if !opts[:'filter_tagset'].nil?\n query_params[:'filter_tag'] = opts[:'filter_tag'] if !opts[:'filter_tag'].nil?\n query_params[:'filter_type'] = opts[:'filter_type'] if !opts[:'filter_type'].nil?\n query_params[:'filter_published'] = opts[:'filter_published'] if !opts[:'filter_published'].nil?\n query_params[:'filter_import_id'] = opts[:'filter_import_id'] if !opts[:'filter_import_id'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['oauth2_client_credentials_grant', 'oauth2_password_grant']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'PageResourceQuestionResource')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: GamificationTriviaApi#get_questions\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "5ab7f35f935e6262b0c0ab0d035fc257",
"score": "0.5707061",
"text": "def show\n \n @quiz = Quiz.find(params[:id])\n\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @quiz }\n end\n end",
"title": ""
},
{
"docid": "92b1c8038f6c2594ca268bec0ccae900",
"score": "0.57066745",
"text": "def get_single_quiz_question(course_id,quiz_id,id,opts={})\n query_param_keys = [\n \n ]\n\n form_param_keys = [\n \n ]\n\n # verify existence of params\n raise \"course_id is required\" if course_id.nil?\n raise \"quiz_id is required\" if quiz_id.nil?\n raise \"id is required\" if id.nil?\n # set default values and merge with input\n options = underscored_merge_opts(opts,\n :course_id => course_id,\n :quiz_id => quiz_id,\n :id => id\n )\n\n # resource path\n path = path_replace(\"/v1/courses/{course_id}/quizzes/{quiz_id}/questions/{id}\",\n :course_id => course_id,\n :quiz_id => quiz_id,\n :id => id)\n headers = nil\n form_params = select_params(options, form_param_keys)\n query_params = select_query_params(options, query_param_keys)\n\n response = mixed_request(:get, path, query_params, form_params, headers)\n QuizQuestion.new(response)\n \n end",
"title": ""
},
{
"docid": "b6128e74cd5d96d057a84e963e20b63d",
"score": "0.5706063",
"text": "def show\n if current_user and current_user.admin?\n @question = Quiz::Question.find(params[:id])\n else\n @question = Quiz::Question.visible.find(params[:id])\n end\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @question, only: [:id, :title], methods: [:possible_answers], callback: params[:callback] }\n format.xml { render xml: @question, only: [:id, :title], methods: [:possible_answers] }\n end\n end",
"title": ""
},
{
"docid": "eb83694e8a97043c30999dbb4894ed2a",
"score": "0.57045895",
"text": "def show\n question = GroupeQuestionService.instance.afficherQuestionParId(params[:id])\n (question != nil) ? (render json: question, status: :ok) : (render json: nil, status: :not_found)\n end",
"title": ""
},
{
"docid": "c50bf6381329d810f0f3cb00c8ee02a4",
"score": "0.5697465",
"text": "def show\n #@quiz = Quiz.find(params[:id])\n @quiz=Quiz.where(:id => params[:id], :course_id => params[:course_id])\n @course = Course.find(params[:course_id])\n \n if @quiz.empty?\n redirect_to course_quizzes_path(params[:course_id]), :alert=> \"No such quiz\"\n else\n \n @quiz=@quiz.first\n @questions= @quiz.questions\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @quiz }\n end\n end\n end",
"title": ""
},
{
"docid": "882865244ff52b3093dbd6e4f37e9bc3",
"score": "0.56959707",
"text": "def show\n quiz = Quiz.find(params[:id])\n render json: QuizSerializer.new(quiz)\n end",
"title": ""
},
{
"docid": "7575c4c85eb63a232057954da4bafc66",
"score": "0.56924075",
"text": "def show\n authorize! :show, QuizPergunta\n @quiz_pergunta_respostas = QuizPerguntaResposta.where(quiz_pergunta_id: @quiz_pergunta)\n end",
"title": ""
},
{
"docid": "122993fe93c6aa90e9da5db5ae124c89",
"score": "0.56506777",
"text": "def quick_answer_with_http_info(q, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: RecipesApi.quick_answer ...'\n end\n # verify the required parameter 'q' is set\n if @api_client.config.client_side_validation && q.nil?\n fail ArgumentError, \"Missing the required parameter 'q' when calling RecipesApi.quick_answer\"\n end\n # resource path\n local_var_path = '/recipes/quickAnswer'\n\n # query parameters\n query_params = opts[:query_params] || {}\n query_params[:'q'] = q\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body]\n\n # return_type\n return_type = opts[:debug_return_type] || 'QuickAnswer200Response'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['apiKeyScheme']\n\n new_options = opts.merge(\n :operation => :\"RecipesApi.quick_answer\",\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: RecipesApi#quick_answer\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "9393d65a96009916a578ad0b04495239",
"score": "0.5633241",
"text": "def question(uin)\n uri = URI.parse(File.join(@base_url, \"api/qais/questions/#{uin}\"))\n issue_request(:get, uri.to_s)\n end",
"title": ""
},
{
"docid": "5a1f6998cf6da5830bd05ff58ba7376f",
"score": "0.56089574",
"text": "def question_already_answered_response\n { statusCode: 403,\n errorCode: 'QUESTION_ALREADY_ANSWERED',\n message: 'The question has already been answered.' }.to_json\n end",
"title": ""
},
{
"docid": "ed5e5af0f66e7a23511f5774e2ef13d8",
"score": "0.5602577",
"text": "def get_response\n\t\tresponse = RestClient.get(@url,\n\t\t\tparams: {\n\t\t\t\tkey: @key,\n\t\t\t\ttext: @text,\n\t\t\t\tlang: @lang,\n\t\t\t}\n\t\t)\n\t\treturn response\n\tend",
"title": ""
},
{
"docid": "75acb30e543c512f3339c066c47d1cc7",
"score": "0.5602285",
"text": "def show\n\t\tbegin\n\t\t\t@quiz = Quiz.new JSON.parse(session[:quiz])\n\t\trescue\n\t\t\t# redirect_to @opportunity.link if @opportunity.link.present? && params[:follow].present?\n\t\t\tredirect_to root_url unless logged_in?\n\t\tend\n\n\t\t@other_opps = @quiz.present? ? @quiz.results(@opportunity.id).take(3).map{ |r| \"#{r.name}\" }.join(\", \") : []\n\t\t@results_str = @quiz.present? ? Base64.encode64(@quiz.questions.to_json) : nil\n\tend",
"title": ""
},
{
"docid": "a934461a21c51b0cbb30aacc1130f061",
"score": "0.5594243",
"text": "def show\n question = QuestionService.instance.afficherQuestionParId(params[:id])\n (question != nil) ? (render json: question, status: :ok) : (render json: nil, status: :not_found)\n end",
"title": ""
},
{
"docid": "43b14cdf71ca2abfa4f9687eea9dff4a",
"score": "0.5594063",
"text": "def get_question_answer_with_http_info(question_id, id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: GamificationTriviaApi.get_question_answer ...\"\n end\n # verify the required parameter 'question_id' is set\n if @api_client.config.client_side_validation && question_id.nil?\n fail ArgumentError, \"Missing the required parameter 'question_id' when calling GamificationTriviaApi.get_question_answer\"\n end\n # verify the required parameter 'id' is set\n if @api_client.config.client_side_validation && id.nil?\n fail ArgumentError, \"Missing the required parameter 'id' when calling GamificationTriviaApi.get_question_answer\"\n end\n # resource path\n local_var_path = \"/trivia/questions/{question_id}/answers/{id}\".sub('{' + 'question_id' + '}', question_id.to_s).sub('{' + 'id' + '}', id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['oauth2_client_credentials_grant', 'oauth2_password_grant']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'AnswerResource')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: GamificationTriviaApi#get_question_answer\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "7e976427d3669a3d69988f10997430f3",
"score": "0.557308",
"text": "def show\n \n load_quiz_and_section\n load_question\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @question }\n end\n end",
"title": ""
},
{
"docid": "e6eaf9cbf70e9f91f4c442e549d6bcf7",
"score": "0.5566338",
"text": "def show\n response = get_resource(RESOURCE, params[:id])\n if response.success?\n @questionnaire = Fhir::Questionnaire.parse_ehmbr(response.body)\n else\n send_operation_outcome(response)\n end\n end",
"title": ""
},
{
"docid": "e573d4039fc52f1fe5be4766640ddcfa",
"score": "0.5562279",
"text": "def show\n if @user\n render :json => @subject.to_json(:include => :quizzes)\n else \n render text: \"Token failed verification\", status: 422\n end\n end",
"title": ""
},
{
"docid": "e4c59ec976c5c0833225834a268f3851",
"score": "0.5562219",
"text": "def show\n @v1_question = V1::Question.find(params[:id])\n\n render json: @v1_question\n end",
"title": ""
},
{
"docid": "ec98483cd89d8bef497ace4112f18cea",
"score": "0.55591124",
"text": "def question\n\t\tQuestion.find(self.question_id) rescue nil\n\tend",
"title": ""
},
{
"docid": "79eaa3a26d64347b1fb75620eaaf88f8",
"score": "0.5558732",
"text": "def query_raw(q=Query.new)\n yield q if block_given?\n\n uri = URI(self.web_service + '?' + q.to_s)\n puts \"GET #{uri.to_s}\"\n\n res = Net::HTTP.get_response uri\n c = res.code.to_i\n h = res.to_hash\n\n if c == 200\n return res.body\n elsif c == 400\n raise InvalidQueryError\n elsif c == 204\n raise NoMatchingRecordsError\n elsif c == 500\n raise ServerSideError\n elsif c == 302 && (h.include?(\"missing_key\") || h.include?(\"invalid_key\"))\n raise InvalidKeyError\n else\n raise CensusApiError, \"Unexpected HTTP response code: #{r}\"\n end\n end",
"title": ""
},
{
"docid": "7db2bb2ba7727521a4b6cd8d3ae7db65",
"score": "0.5557718",
"text": "def show\n @text_question = @base_question.text_questions.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @text_question }\n end\n end",
"title": ""
},
{
"docid": "d18aca5f2f7bb6e4453931e203b77ef4",
"score": "0.5557538",
"text": "def get_question\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "0229bfa460972e41c06879281b4470f8",
"score": "0.5556838",
"text": "def get_question\n question = MathGame::Question.new\n if question.correct\n puts \"Correct!\"\n @result = true\n else\n @lose_life\n puts \"Wrong!\"\n end\n end",
"title": ""
},
{
"docid": "7f1ae72046b2f7c8194a5daa11cd50bf",
"score": "0.55490386",
"text": "def smerf_get_question_answer(question, responses)\n if (!smerf_question_answered?(question, responses))\n return nil\n else\n return responses[question.code]\n end\n end",
"title": ""
},
{
"docid": "d554802c181c7e46c428933a34fb92e1",
"score": "0.5540404",
"text": "def get_a_question_detail_with_http_info(page_id, question_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: SurveysPagesAndQuestionsApi.get_a_question_detail ...'\n end\n # verify the required parameter 'page_id' is set\n if @api_client.config.client_side_validation && page_id.nil?\n fail ArgumentError, \"Missing the required parameter 'page_id' when calling SurveysPagesAndQuestionsApi.get_a_question_detail\"\n end\n # verify the required parameter 'question_id' is set\n if @api_client.config.client_side_validation && question_id.nil?\n fail ArgumentError, \"Missing the required parameter 'question_id' when calling SurveysPagesAndQuestionsApi.get_a_question_detail\"\n end\n # resource path\n local_var_path = '/v3/surveys/310099766/pages/{PAGE_ID}/questions/{QUESTION_ID}'.sub('{' + 'PAGE_ID' + '}', page_id.to_s).sub('{' + 'QUESTION_ID' + '}', question_id.to_s)\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n return_type = opts[:return_type] \n\n auth_names = opts[:auth_names] || []\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type)\n\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: SurveysPagesAndQuestionsApi#get_a_question_detail\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "d46887ad237fc5b68205a00742edc6e9",
"score": "0.55227166",
"text": "def get_single_quiz(course_id,id,opts={})\n query_param_keys = [\n \n ]\n\n form_param_keys = [\n \n ]\n\n # verify existence of params\n raise \"course_id is required\" if course_id.nil?\n raise \"id is required\" if id.nil?\n # set default values and merge with input\n options = underscored_merge_opts(opts,\n :course_id => course_id,\n :id => id\n )\n\n # resource path\n path = path_replace(\"/v1/courses/{course_id}/quizzes/{id}\",\n :course_id => course_id,\n :id => id)\n headers = nil\n form_params = select_params(options, form_param_keys)\n query_params = select_query_params(options, query_param_keys)\n\n response = mixed_request(:get, path, query_params, form_params, headers)\n Quiz.new(response)\n \n end",
"title": ""
},
{
"docid": "0c3ff991f08db04087b97579a417fd1c",
"score": "0.5500574",
"text": "def show\n @quiz = Quiz.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @quiz }\n end\n end",
"title": ""
},
{
"docid": "fa91bf98e1f079c927a85c05117ee909",
"score": "0.54959035",
"text": "def question_by_id(id)\n begin \n question = Question.find(id)\n rescue ActiveRecord::RecordNotFound\n halt 404\n end\n end",
"title": ""
},
{
"docid": "5a94fc783e04886efd8660104e9a5fd9",
"score": "0.5487765",
"text": "def show\n question = QuestionChoixService.instance.afficherQuestionParId(params[:id])\n (question != nil) ? (render json: question, status: :ok) : (render json: nil, status: :not_found)\n end",
"title": ""
},
{
"docid": "27b74e8e51e28895296a6c2ceec64f30",
"score": "0.5485524",
"text": "def answer\n params[:respondent_id] = current_user.id\n result = Question.answer params\n\n if result[:status] != 0\n render json: result\n else\n render json: { status: 0 }\n end\n end",
"title": ""
},
{
"docid": "aa44adc51b21e5e69d423f16fa27a181",
"score": "0.54805094",
"text": "def survey_question(request)\n dashboard_request('GET', '/api/survey-questions/' + request[:questionId], request)\n end",
"title": ""
},
{
"docid": "16afa97ee46d12ca13d22bd9510f2076",
"score": "0.5479881",
"text": "def show\n render status: :ok, json: @simple_question\n end",
"title": ""
},
{
"docid": "90c696dfb307c3dcfa23ff7b1c649afe",
"score": "0.5474037",
"text": "def get_question\n Question.find(params[:id])\n end",
"title": ""
},
{
"docid": "ec3e92fc8f17c94536adc856de0aafaf",
"score": "0.5473056",
"text": "def get_question_answers_with_http_info(question_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: GamificationTriviaApi.get_question_answers ...\"\n end\n # verify the required parameter 'question_id' is set\n if @api_client.config.client_side_validation && question_id.nil?\n fail ArgumentError, \"Missing the required parameter 'question_id' when calling GamificationTriviaApi.get_question_answers\"\n end\n # resource path\n local_var_path = \"/trivia/questions/{question_id}/answers\".sub('{' + 'question_id' + '}', question_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['oauth2_client_credentials_grant', 'oauth2_password_grant']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Array<AnswerResource>')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: GamificationTriviaApi#get_question_answers\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "0e68dfce09d6fd337114921075dd815f",
"score": "0.5437128",
"text": "def getsurveyresponse_app\n response = getsurvey_response(params[:survey_id].to_i, params[:ai_id].to_i)\n if response.present?\n puts \"Got all survey responses!\"\n render json: { message: response }, status: 200\n else\n puts \"Could not get survey responses!\"\n render json: { message: 'Could not get survey responses!'}, status: 403\n end\n end",
"title": ""
},
{
"docid": "33e8d544894f192bb492d4f0ee366902",
"score": "0.5423579",
"text": "def get_one\n return render json: @answer\n end",
"title": ""
},
{
"docid": "76ad3a0e4f8ef152e6f5b5a27dff2eb8",
"score": "0.54216075",
"text": "def survey_question(survey_id, question_id, options={})\n get(\"survey/#{survey_id}/surveyquestion/#{question_id}\", options)\n end",
"title": ""
},
{
"docid": "449ec94c88c7af33a474e0f60c7cbc4b",
"score": "0.5416437",
"text": "def find_question\n \t@question = Question.where(id:params[:question_id])[0]\n\t\trender json: {success: false, message: 'Invalid Question ID !'}, status: 400 if @question.nil?\n\tend",
"title": ""
},
{
"docid": "ec133947ce436f2796b619889d148788",
"score": "0.5415478",
"text": "def get(query_type, options)\n begin\n res = client.get(query_type, options)\n case res.status\n when 200\n Success(MultiJson.load(res.env[:body])[\"data\"])\n when 400\n # This little gem of inconsitency is because Promeheus returns error messages as\n # json (correct) and Loki returns plain text (wrong). I have opened an issue ...\n begin\n Failure(MultiJson.load(res.env[:body])[\"error\"])\n rescue MultiJson::ParseError\n Failure(res.env[:body])\n end\n when 422\n Failure(\"Unprocessable Entity: the request was well formed but cannot be executed (RFC4918)\")\n when 503\n Failure(\"Service Unavailable: The server has either timed out or aborted the query\")\n else\n Failure(res.env[:body])\n end\n rescue Faraday::ConnectionFailed => e\n Failure(e.message)\n end\n end",
"title": ""
},
{
"docid": "4a8c46d786d555943579e577de7d372f",
"score": "0.54079705",
"text": "def get_response_for question\n print question + \": \"\n gets.chomp\n end",
"title": ""
},
{
"docid": "6c8cec857c68b20b0d275b24ddf27b63",
"score": "0.5399586",
"text": "def show\n @quiz1 = Quiz1.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @quiz1 }\n end\n end",
"title": ""
},
{
"docid": "e9e3939945b2cda81c4d747ad3bbbd5b",
"score": "0.5390707",
"text": "def referQuestion\n result = Hash.new\n result['status'] = true\n\n begin # try\n result['data'] = Question.find_by( id: params[:id], \n lang: params[:lang], \n deleted_at: nil)\n rescue # catch\n result['status'] = false\n result['error'] = \"#{$!}\"\n ensure # finally\n render json: result\n end\n end",
"title": ""
},
{
"docid": "75273eed53dac458fd2e79932b25580b",
"score": "0.5382217",
"text": "def get_survey\n message = ''\n questions = []\n sid = params[:surveyInstanceID]\n begin\n survey_instance = FormInstance.find(sid)\n rescue ActiveRecord::RecordNotFound\n message = 'Invalid survey instance ID'\n rescue Exception\n message = 'Unexpected Error'\n else\n if FormInstanceHelper.valid_survey(survey_instance) == true\n message = 'Success'\n\n # form list of objects that have a survey name and reading\n survey = survey_instance.form_type\n items = survey.item_types.order(question_order: :asc)\n\n # Iterate over the questions for the form type of the given form\n # instance. Put all of them into a list and send the list to the client.\n question_list = []\n items.each do |i|\n q = i.question\n answer_list = []\n q.answers.each do |a|\n opt = {:answerID => a.id, :answerText => a.text}\n answer_list.push(opt)\n end\n question = {\n :quesID => q.id,\n :questionType => q.qtype,\n :questionText => q.text,\n :answerOptions => answer_list\n }\n question_list.push(question)\n end\n else\n message = 'Survey has expired'\n end\n end\n\n # This just gets the interval for the form type.\n interval = survey_instance.patient.patient_forms.where('stage_number = ?', survey_instance.patient.current_stage)\n interval = interval.where('form_type_id= ?', survey_instance.form_type.id).first()\n\n response = {\n :surveyInstanceID => sid,\n :surveyName => survey_instance.form_type.name,\n :surveyFrequency => interval,\n :message => message,\n :questions => question_list\n }\n\n render json: response\n end",
"title": ""
},
{
"docid": "165a0cafc0107d69de755212011aa836",
"score": "0.537282",
"text": "def single_question\n q = Question.find(params[:id])\n api = ApiConsumer.new\n meta = api.mampf(params[:id].split(\",\"))\n render json: [JsonResolver.new(q, 0, meta[params[:id]]).resolve]\n end",
"title": ""
},
{
"docid": "697f76d2d377db9a843cfea6cbcf4971",
"score": "0.53649503",
"text": "def question\n Question.find_by_id(@question_id)\n end",
"title": ""
},
{
"docid": "df511d8ad83c6c868619b16f96dde6aa",
"score": "0.53588843",
"text": "def show\n @survey_question = SurveyQuestion.find(params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @survey_question }\n end\n end",
"title": ""
},
{
"docid": "87031780af65427f231c543f0ebb7015",
"score": "0.5349566",
"text": "def get_question_all_using_get_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: QuestionnaireApi.get_question_all_using_get ...'\n end\n # resource path\n local_var_path = '/nucleus/v1/question'\n\n # query parameters\n query_params = {}\n query_params[:'ascending'] = opts[:'ascending'] if !opts[:'ascending'].nil?\n query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil?\n query_params[:'order_by'] = opts[:'order_by'] if !opts[:'order_by'].nil?\n query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?\n query_params[:'size'] = opts[:'size'] if !opts[:'size'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['*/*'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['oauth2']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'PageQuestion')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: QuestionnaireApi#get_question_all_using_get\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "735f872823c60b35fa9e409e67776220",
"score": "0.53475237",
"text": "def get_questionnaire_using_get_with_http_info(questionnaire_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: QuestionnaireApi.get_questionnaire_using_get ...'\n end\n # verify the required parameter 'questionnaire_id' is set\n if @api_client.config.client_side_validation && questionnaire_id.nil?\n fail ArgumentError, \"Missing the required parameter 'questionnaire_id' when calling QuestionnaireApi.get_questionnaire_using_get\"\n end\n # resource path\n local_var_path = '/nucleus/v1/questionnaire/{questionnaire_id}'.sub('{' + 'questionnaire_id' + '}', questionnaire_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['*/*'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['oauth2']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Questionnaire')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: QuestionnaireApi#get_questionnaire_using_get\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "072ce5af136995466734c80db656da55",
"score": "0.5343958",
"text": "def show\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @quiz_type }\n end\n end",
"title": ""
},
{
"docid": "e23a915f6d57319e8212912e454745d3",
"score": "0.53383845",
"text": "def index\n @response = []\n get_questions\n render json: @response, status => 200\n rescue StandardError => e # rescu if any exception occure\n render json: { message: 'Error: Something went wrong... ' }, status: :bad_request\n end",
"title": ""
},
{
"docid": "4d970b4fba837bbf9d2097596a1dbad3",
"score": "0.53245777",
"text": "def questions\n request('questions')\n end",
"title": ""
},
{
"docid": "eb22358f195b65fcd8a63810df8160f8",
"score": "0.5322557",
"text": "def show\n @body_class = 'questions'\n @question = Question.find(params[:id])\n @title = \"Question ##{@question.id}\"\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @question }\n end\n end",
"title": ""
},
{
"docid": "06b351da7a032973c7f0e9111e2c8694",
"score": "0.5315693",
"text": "def show\n @quizz = Quizz.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @quizz }\n end\n end",
"title": ""
},
{
"docid": "bea66a666bb2298aae8f6e66e8758f9d",
"score": "0.53057665",
"text": "def questions\n get_and_parse[\"results\"]\nend",
"title": ""
},
{
"docid": "48d2737405ce8d178afab64ca4591ea9",
"score": "0.52995145",
"text": "def show\n @enq_question = EnqQuestion.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @enq_question }\n end\n end",
"title": ""
},
{
"docid": "f090b325dadd5e941fb804ec273bb51d",
"score": "0.52990085",
"text": "def get_question\n @question = Question.find(params[:id])\n end",
"title": ""
},
{
"docid": "40306d2d4a2bae87a373ff597215481a",
"score": "0.52922416",
"text": "def get_question_info\n @qstGroup = params[:questionGroup]\n @qstType = params[:questionType]\n @questionTypes = QuestionService.get_question_info(@qstGroup, @qstType)\n render json: @questionTypes\n end",
"title": ""
},
{
"docid": "f46b60654dc2ab43b85f6924a6861004",
"score": "0.5282886",
"text": "def manage_question(body)\r\n upload_questions(JSON.parse(body)['questions'])\r\n get_questions\r\nend",
"title": ""
},
{
"docid": "2961b62a727ce95de77c17eb1f576106",
"score": "0.52767587",
"text": "def show\n @quiz_questions = QuizQuestion.where(:quize_id => @quize.id)\n end",
"title": ""
},
{
"docid": "3c082dfbd8563e37f85a32d61ab584f3",
"score": "0.527561",
"text": "def check_questions\r\n response = Request.get_request(URL_QUESTION)\r\n questions = []\r\n if response.success?\r\n data = Request.manage_response(response)\r\n end\r\n data.each do |question|\r\n questions << Question.new(question)\r\n end\r\n questions\r\nend",
"title": ""
},
{
"docid": "a29d70ef803bef9b3e53a868517b9a0d",
"score": "0.52754897",
"text": "def create\n if Api::V1::Response.count < 1\n @question.errors.add :response, 'insufficient number of responses'\n render json: @question.errors, status: :internal_server_error\n else\n @question.response = Api::V1::Response.offset(rand Api::V1::Response.count).first\n\n if @question.save\n render json: @question, status: :created, location: @question\n else\n render json: @question.errors, status: :unprocessable_entity\n end\n end\n end",
"title": ""
},
{
"docid": "16b6c17eb7894f27cac82169cfd75f27",
"score": "0.5271928",
"text": "def show\n @online_quiz = OnlineQuiz.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @online_quiz }\n end\n end",
"title": ""
},
{
"docid": "86bb82b8415287f2c8cff54a5a5e45d9",
"score": "0.5262985",
"text": "def show\n @my_question = My_question.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @my_question }\n end\n end",
"title": ""
},
{
"docid": "69000a18df66384f9ab79d04e0dba251",
"score": "0.5262891",
"text": "def show\n \t@question = Question.find(params[:id])\n\n \trespond_to do |format|\n \t\tformat.html\n \t\tformat.json { render json: @question.to_json }\n \tend\n end",
"title": ""
},
{
"docid": "b31c80fc8b71f5a6d341a8516360aeaa",
"score": "0.5262239",
"text": "def show\n @question ||= Question.find(params[:id])\n assert(@questions.kind_of?(Question))\n return @question\n end",
"title": ""
},
{
"docid": "e06c9071fcf61173c2c1de5f0f302fa7",
"score": "0.52612203",
"text": "def get url\n response = self.class.get(url)\n if response[\"status\"]\n raise InvalidAPIResponse.new(response[\"status\"][\"message\"])\n else\n response\n end\n end",
"title": ""
},
{
"docid": "76b7d81ba12ffe9e9b084707fb634165",
"score": "0.52543855",
"text": "def show\n #@quiz = Quiz.find(params[:id])\n @quiz=Quiz.where(:id => params[:id], :course_id => params[:course_id])\n @course = Course.find(params[:course_id])\n #Time.zone=ActiveSupport::TimeZone[@course.time_zone]\n if @quiz.empty?\n redirect_to course_quizzes_path(params[:course_id]), :alert=> \"No such quiz\"\n else\n \n @quiz=@quiz.first\n @questions= @quiz.questions\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @quiz }\n end\n end\n end",
"title": ""
},
{
"docid": "8ca7c3f759b9118b5a35045343dda914",
"score": "0.52528465",
"text": "def get_survey_questions_0_with_http_info(id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: SurveysApi.get_survey_questions_0 ...\"\n end\n # verify the required parameter 'id' is set\n if @api_client.config.client_side_validation && id.nil?\n fail ArgumentError, \"Missing the required parameter 'id' when calling SurveysApi.get_survey_questions_0\"\n end\n # resource path\n local_var_path = \"/surveys/{id}/questions\".sub('{' + 'id' + '}', id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/x-www-form-urlencoded'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['jwt']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'InlineResponse20013')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: SurveysApi#get_survey_questions_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "69644a7bbbf95122ddc0cc2ab3142d99",
"score": "0.5251441",
"text": "def get_question\n\t\t\t@question = Question.find(params[:question_id])\n\t\tend",
"title": ""
},
{
"docid": "83699c69193549c6036ee7c199226a27",
"score": "0.52491903",
"text": "def get_single_quiz_submission_question(quiz_submission_id,id,opts={})\n query_param_keys = [\n :include\n ]\n\n form_param_keys = [\n \n ]\n\n # verify existence of params\n raise \"quiz_submission_id is required\" if quiz_submission_id.nil?\n raise \"id is required\" if id.nil?\n # set default values and merge with input\n options = underscored_merge_opts(opts,\n :quiz_submission_id => quiz_submission_id,\n :id => id\n )\n\n # resource path\n path = path_replace(\"/v1/quiz_submissions/{quiz_submission_id}/questions/{id}\",\n :quiz_submission_id => quiz_submission_id,\n :id => id)\n headers = nil\n form_params = select_params(options, form_param_keys)\n query_params = select_query_params(options, query_param_keys)\n\n response = mixed_request(:get, path, query_params, form_params, headers)\n response\n \n end",
"title": ""
},
{
"docid": "0efb1293374d61f8d6e524dfee1e1b65",
"score": "0.52475417",
"text": "def question\n return @question\n end",
"title": ""
},
{
"docid": "5d26fd471bcbe3f1197f7dd6845c75db",
"score": "0.5247386",
"text": "def show\n respond_with( @question )\n end",
"title": ""
},
{
"docid": "8f643dabd055432b36508db24e70194b",
"score": "0.5241942",
"text": "def response\n RestClient::Request.execute(\n method: method,\n url: url,\n timeout: timeout,\n headers: headers,\n payload: body.to_json\n )\n end",
"title": ""
},
{
"docid": "0de787632196257e41dbba01f3bbf860",
"score": "0.5241541",
"text": "def questions\n @current_user = current_user\n if params[:question_id]\n return response_for_single_question(params[:question_id].to_i)\n elsif params[:game_id]\n return response_for_unanswered_game_questions(params[:game_id].to_i)\n elsif params[:about_user_id]\n @about_user = User.find_by(id: params[:about_user_id].to_i)\n else\n @about_user = @current_user\n end\n\n @questions = get_questions(@current_user, @about_user, params[:max])\n\n if @current_user != @about_user\n @questions_for_me = get_questions_I_should_answer_today(@current_user)\n @questions_for_me_json = @questions_for_me.as_json(include: {choices: {:me => true}})\n @questions_json = @questions.as_json(include: :choices, :name => @about_user.first_name)\n else\n @questions_json = @questions.as_json(include: {choices: {:me => true}})\n end\n\n render json: {\n about_user: @about_user.as_json(include: :user_photos, :current_user_id => @current_user.id),\n guess_game_questions: @questions_json,\n questions_for_me: @questions_for_me_json\n }\n end",
"title": ""
}
] |
f6208dd395a2e2e715e8862c16239f6e | if tile has more than one intratile paths, connections using those paths cannot be identified with just a hex name | [
{
"docid": "e75e885b54b28ae3558d68c8a190a120",
"score": "0.5635767",
"text": "def ambiguous_connection?\n @ambiguous_connection ||= @paths.count { |p| p.nodes.size > 1 } > 1\n end",
"title": ""
}
] | [
{
"docid": "c2375129737c0f59406798746458c9e2",
"score": "0.565871",
"text": "def render_path\n # If the star and target are disconnected there will only be one path\n # The path should not render in that case\n unless state.path.size == 1\n state.path.each_key do | cell |\n # Renders path on both grids\n outputs.solids << scale_up(cell).merge(path_color)\n outputs.solids << early_exit_scale_up(cell).merge(path_color)\n end\n end\n end",
"title": ""
},
{
"docid": "6dab935de649e6c6d7454fd9e50acb71",
"score": "0.5630957",
"text": "def hex_edge_cost(conn)\n conn[:paths].each_cons(2).sum do |a, b|\n a.hex == b.hex ? 0 : 1\n end\n end",
"title": ""
},
{
"docid": "d5c393a6d708d2a7fd988a04dc597761",
"score": "0.55039454",
"text": "def path_clear?\n i = 0\n if @target_cell.path.length < 2 \n @target_path = @target_cell.path\n else\n @target_path = @target_cell.path[1...@target_cell.path.length - 1]\n end\n @target_path.each do |coor|\n i += 1 if @gameboard[coor[0]][coor[1]] != \"\\u{25A0}\" && @gameboard[coor[0]][coor[1]] != \"\\u{25A1}\"\n end\n i == 0 ? true : false\n end",
"title": ""
},
{
"docid": "a9340606facbed4cbd358df890d53552",
"score": "0.5494146",
"text": "def bitfield_from_connection(connection, hexside_bits)\n bitfield = [0]\n connection.each do |conn|\n paths = conn[:chain][:paths]\n if paths.size == 1 # special case for tiny intra-tile path like in 18NewEngland (issue #6890)\n hexside_left = paths[0].nodes[0].id\n check_edge_and_set(bitfield, hexside_left, hexside_bits)\n if paths[0].nodes.size > 1 # local trains may not have a second node\n hexside_right = paths[0].nodes[1].id\n check_edge_and_set(bitfield, hexside_right, hexside_bits)\n end\n else\n (paths.size - 1).times do |index|\n # hand-optimized ruby gives faster opal code\n node1 = paths[index]\n node2 = paths[index + 1]\n case node1.edges.size\n when 1\n # node1 has 1 edge, connect it to first edge of node2\n hexside_left = node1.edges[0].id\n hexside_right = node2.edges[0].id\n check_and_set(bitfield, hexside_left, hexside_right, hexside_bits)\n when 2\n # node1 has 2 edges, connect them as well as 2nd edge to first node2 edge\n hexside_left = node1.edges[0].id\n hexside_right = node1.edges[1].id\n check_and_set(bitfield, hexside_left, hexside_right, hexside_bits)\n hexside_left = hexside_right\n hexside_right = node2.edges[0].id\n check_and_set(bitfield, hexside_left, hexside_right, hexside_bits)\n else\n puts \" ERROR: auto-router found unexpected number of path node edges #{node1.edges.size}. \"\\\n 'Route combos may be be incorrect'\n end\n end\n end\n end\n bitfield\n end",
"title": ""
},
{
"docid": "246bbed2d98187b9e2468fd495e5c720",
"score": "0.5382396",
"text": "def disambiguate_node(nodes)\n onodes = nodes.select(&:offboard?)\n\n # find first and last nodes in current route\n list = connection_data.empty? ? [@last_node].compact : [head[:left], tail[:right]]\n return if list.empty?\n\n # if those match either of the nodes in the tile, use it and remember it\n if (match = onodes.find { |n| list.include?(n) })\n touch_node(match)\n @last_offboard = [match]\n return\n end\n\n # otherwise use a node on the tile that connects to the current route\n # if multiple, ignore the most recently used one\n candidates = onodes.select { |node| list.any? { |last| select(last, node)[0] } }\n if candidates.size > 1\n touch_node((candidates - @last_offboard)[0])\n @last_offboard = []\n elsif candidates.one?\n touch_node(candidates[0])\n @last_offboard = []\n end\n end",
"title": ""
},
{
"docid": "4da09951d260c51663655336deacc358",
"score": "0.5325003",
"text": "def add_connector(topo_cell)\n connector = HexConnector.new(topo_cell,self)\n @river_mouth_hex = connector.river_mouth_hex if connector.river_mouth_hex != nil\n mark_hexes(:water, connector.get_hexes)\n connector.get_connection_points.each_pair do |dir,hex|\n s = topo_cell[:s]\n t = topo_cell[:t]\n c1 = @cx_list.find {|cc| cc[:s1] == s && cc[:t1] == t && cc[:dir1] == dir}\n c2 = @cx_list.find {|cc| cc[:s2] == s && cc[:t2] == t && cc[:dir2] == dir}\n c1[:hex1] = hex unless c1 == nil\n c2[:hex2] = hex unless c2 == nil\n end\n end",
"title": ""
},
{
"docid": "c0b4ec60e41c199bdeaa7a94149ebe37",
"score": "0.53149617",
"text": "def getDirectConnections(keys,map)\n thissprite=getMapSprite(map)\n thisdims=MapFactoryHelper.getMapDims(map)\n ret=[]\n for i in keys\n next if i==map\n othersprite=getMapSprite(i)\n otherdims=MapFactoryHelper.getMapDims(i)\n x1=(thissprite.x-othersprite.x)/4\n y1=(thissprite.y-othersprite.y)/4\n if (x1==otherdims[0] || x1==-thisdims[0] || \n y1==otherdims[1] || y1==-thisdims[1])\n ret.push(i)\n end \n end\n # If no direct connections, add an indirect connection\n if ret.length==0\n key=(map==keys[0]) ? keys[1] : keys[0]\n ret.push(key)\n end\n return ret\n end",
"title": ""
},
{
"docid": "5255664875b5f6555e34a0b86ac18478",
"score": "0.5242838",
"text": "def wrapped?(next_tile, path_tiles)\n return false if path_tiles.empty? || path_tiles.nil?\n last_tile_letter = path_tiles.last[0]\n next_tile_letter = next_tile[0]\n if next_tile_letter == \"h\" && last_tile_letter == \"a\"\n return true\n elsif next_tile_letter == \"a\" && last_tile_letter == \"h\"\n return true\n else \n return false\n end\n end",
"title": ""
},
{
"docid": "bf293f50ea545fbd47e79127ae108a8a",
"score": "0.5219881",
"text": "def getDirectConnections(keys,map)\r\n thissprite=getMapSprite(map)\r\n thisdims=MapFactoryHelper.getMapDims(map)\r\n ret=[]\r\n for i in keys\r\n next if i==map\r\n othersprite=getMapSprite(i)\r\n otherdims=MapFactoryHelper.getMapDims(i)\r\n x1=(thissprite.x-othersprite.x)/4\r\n y1=(thissprite.y-othersprite.y)/4\r\n if (x1==otherdims[0] || x1==-thisdims[0] ||\r\n y1==otherdims[1] || y1==-thisdims[1])\r\n ret.push(i)\r\n end\r\n end\r\n # If no direct connections, add an indirect connection\r\n if ret.length==0\r\n key=(map==keys[0]) ? keys[1] : keys[0]\r\n ret.push(key)\r\n end\r\n return ret\r\n end",
"title": ""
},
{
"docid": "2d0c002a476d30eb92b3e02763df6023",
"score": "0.521279",
"text": "def check_king_path(king_tile,direction,danger_tiles)\n\n\t\t0.upto(2) do |num|\n\t\t\tking_check?(king_tile.neighbor(direction * num).to_s,danger_tiles)\n\t\tend\n\n\n\tend",
"title": ""
},
{
"docid": "f7921064ebd4bf145391786b2f2d4612",
"score": "0.52011144",
"text": "def test_multiple_path\r\n (1..5).each do |x|\r\n trip = Driver.new(Random.new(15), x)\r\n assert_nil trip.drive_path\r\n end\r\n end",
"title": ""
},
{
"docid": "4b17465387a2f2f2fb0df7f99ba174e5",
"score": "0.51856965",
"text": "def tile_from(tiles)\n tiles[0] != tiles[2] ? '^' : '.'\n end",
"title": ""
},
{
"docid": "ef56421a84ee58d1fc0bd2ed12848291",
"score": "0.5164242",
"text": "def get_path(connect_list)\n path = Array.new\n connect_list.Path.each do |each_path|\n next if each_path.size == 1\n tmp2 = Array.new\n each_path.each do |path|\n tmp = Array.new\n tmp << path.InstName\n tmp << path.Name\n tmp << path.ConnectedWireName\n tmp << path.MSB\n tmp << path.LSB\n tmp << path.BusPortion\n tmp2 << tmp\n end\n path << tmp2\n end\n return path\nend",
"title": ""
},
{
"docid": "a16d94d99de6839ccf8f81ee0b474935",
"score": "0.51517653",
"text": "def calculate_paths\n @topology.each_switch do | swi |\n @path[swi] = {}\n @topology.each_switch do | swj |\n @path[swi][swj] = {:intermediate_dpid => nil, :link_weight => nil}\n end\n @path[swi][swi] = {:intermediate_dpid => nil, :link_weight => 0}\n end\n\n @topology.adjacency.each do | swi, swjs |\n swjs.each do | swj, port_number |\n puts \"ERROR\" unless @path.include?(swi)\n @path[swi] = {} unless @path.include?(swi) # add by morimoto\n #puts \"path[#{swi}] = #{@path[swi]}\"\n #puts \"path[#{swi}][#{swj}] = #{@path[swi][swj]}\"\n @path[swi][swj] = {:intermediate_dpid => nil, :link_weight => 1}\n end\n end\n @topology.each_switch do | swk |\n @topology.each_switch do | swi |\n @topology.each_switch do | swj |\n # puts \"swk=#{swk} swi=#{swi} swj=#{swj} swk=#{swj}\"\n if @path[swi][swk][:link_weight] \n if @path[swk][swj][:link_weight]\n ikj_weight = @path[swi][swk][:link_weight] + @path[swk][swj][:link_weight]\n if !@path[swi][swj][:link_weight] or ikj_weight < @path[swi][swj][:link_weight]\n # puts \"swk=#{swk} swi=#{swi} swj=#{swj} swk=#{swj} !!!\"\n # puts \"pat = #{@path[swi][swj][:link_weight]}\"\n # puts \"ikj = #{ikj_weight}\"\n # if @path[swi][swk][:link_weight] > 1 or @path[swk][swj][:link_weight] > 1\n # inte_\n @path[swi][swj] = {:intermediate_dpid => swk, :link_weight => ikj_weight}\n # puts \"#{swi} to #{swj} -> #{@path[swi][swj]}\"\n elsif ikj_weight == @path[swi][swj][:link_weight]\\\n and @path[swi][swj][:link_weight] != 0\\\n and @path[swi][swj][:link_weight] != 1\\\n and @path[swi][swj][:intermediate_dpid] != swk \\\n and swi != swk and swj != swk\n # puts \"intermidiate = #{@path[swi][swj][:intermediate_dpid]}\"\n number_path = 2\n number_path = @path[swi][swj][:path_number] + 1 if @path[swi][swj][:path_number]\n number_switch = \"no.\" + number_path.to_s + \"switch\"\n # puts \"#{number_path}\"\n #@path[swi][swj] = {:intermediate_dpid => swk, :link_weight => ikj_weight, :path_number => number_path}\n @path[swi][swj][:path_number] = number_path\n @path[swi][swj][number_switch] = swk\n end\n end\n end\n end\n end\n end\n self.topology.display\n # puts \" \"\n display_path\n # puts \"count !\"\n end",
"title": ""
},
{
"docid": "5a731c7e58994577a8dfa3c7ba2249c7",
"score": "0.51356745",
"text": "def unique_paths(max_col, max_row)\n unique_paths_helper(max_col, max_row, 1, 1, {})\nend",
"title": ""
},
{
"docid": "edc3dd916dea6dacc261b47af068243f",
"score": "0.5110184",
"text": "def path_exists?(zone,hex1,hex2)\n root = hex1.clone\n branches = [root]\n zone << hex2\n path_found = false\n\n until path_found || branches.empty?\n branches.shuffle!\n ptr = branches.pop\n nbrs = zone.find_all {|z| adjacent?(z,ptr)}\n if nbrs.include?(hex2)\n path_found = true\n else\n branches = branches + nbrs\n zone = zone - nbrs\n end\n end\n path_found\n end",
"title": ""
},
{
"docid": "0e79557e9793de045dc0b2737efe504e",
"score": "0.5099113",
"text": "def lattice_paths(n, it) # n = size of grid (e.g. n = 20 => 20x20, with m = 21 => 21x21 nodes), it = number of iterations to perform to approximate # of possible lattice paths\ncolumns = []\nm = n + 1\nm.times do\n columns << Array.new(m, 0)\nend\npaths = []\nit.times do\n columns[0][0] = 1\n columns[n][n] = 0\n path = Array.new\n until columns[n][n] == 1 do\n coordinates = columns.coordinates(1)\n cord_a = coordinates[0]\n cord_b = coordinates[1]\n if (cord_a + 1) > n\n columns[cord_a][(cord_b + 1)] = 1\n elsif (cord_b + 1 ) > n\n columns[(cord_a + 1)][cord_b] = 1\n else\n if rand() >= 0.5\n columns[(cord_a + 1)][cord_b] = 1\n else\n columns[cord_a][(cord_b + 1)] = 1\n end\n end\n columns[cord_a][cord_b] = 0\n coordinates = columns.coordinates(1)\n path << coordinates\n end\n paths << path.join(\"\") unless paths.include?(path.join(\"\"))\nend\n#print paths\n#puts \"\"\n#print columns\n#puts \"\"\nreturn paths.length\nend",
"title": ""
},
{
"docid": "ae84759dfc45fa6741a0fc5a2410430d",
"score": "0.508894",
"text": "def unique_paths(col, row) # returns total number of unique paths from S to curr_coord\n return 0 if col == 0 && row == 0\n return 1 if col == 1 || row == 1\n return unique_paths(col - 1, row) + unique_paths(col, row - 1)\nend",
"title": ""
},
{
"docid": "a8085c691ae4502a8c812531cbcee357",
"score": "0.5080335",
"text": "def route(net_id, max_detour_factor = 2)\n\t\tfail if net_id > @netlist.length - 1 || net_id < 0\n\t\tnet_desc = @netlist[net_id]\n\t\tfrom, to = net_desc.t1_name, net_desc.t2_name\n\t\t#to, from = net_desc.t1_name, net_desc.t2_name\n\t\tfail unless from && to # class is string or maybe integer?\n\t\tfail if from == to\n\t\tfail unless start_node = @regions.find{|r| r.incident && r.vertex.name == from}\n\t\tif @rstyles\n\t\t\tnet_desc.trace_clearance = @rstyles[net_desc.style_name].trace_clearance\n\t\t\tnet_desc.trace_width = @rstyles[net_desc.style_name].trace_width\n\t\telse\n\t\t\tnet_desc.trace_width = Trace_Width \n\t\t\tnet_desc.trace_clearance = Clearance \n\t\tend\n=begin\nvery basic test for using rescue vias\n\t\tunless path = dijkstra(start_node, to, net_desc)\n\t\t\tnet_desc = net_desc.dup\n\t\t\tnet_desc.t2_name = 'rescue_via'\n\t\t\tpath = dijkstra(start_node, 'rescue_via', net_desc)\n\t\t\tif path \n\t\t\t\tpath[0].vertex.name = 'used_rescue_via'\n\t\t\tend\n\t\tend\n\t\tunless path #= dijkstra(start_node, to, net_desc)\n=end\n\t\tif max_detour_factor == 0\nreturn dijkstra(start_node, to, net_desc, 1.5) != nil\n\t\tend\n\n\n\t\tunless path = dijkstra(start_node, to, net_desc, max_detour_factor)\n\t\t\tif max_detour_factor != 2\n\t\t\tputs 'dijkstra failed!'\n\t\t\tx, y = @regions.find{|r| r.incident && r.vertex.name == to}.vertex.xy\n\t\t\t@pic.set_source_rgba(1, 1, 1, 1)\n\t\t\t@pic.set_line_width(ATW)\n\t\t\t@pic.move_to(x, y)\n\t\t\t@pic.line_to(*start_node.vertex.xy)\n\t\t\t@pic.stroke\n\t\t\tend\n\t\t\treturn false\n\t\tend\n\t\tfirst = path[-1]\n\t\tlast = path[0]\n\t\tfail if first == last\n\t\tif path.length > 2 # ignore direct connections without a single split region!\n\t\t\tfirst.idirs << [path[-2].rx - first.vertex.x, path[-2].ry - first.vertex.y] # same as above\n\t\t\tlast.idirs << [path[1].rx - last.vertex.x, path[1].ry - last.vertex.y]\n\t\t\t###first.idirs << [cur.rx - first.rx, cur.ry - first.ry] # this may work when we fix qbors() too\n\t\tend\n\t\tr1 = r2 = nil\n\t\t@pic.arc(first.vertex.x, first.vertex.y, 2 * ATW, 0, 6)\n\t\t@pic.stroke\n\t\t@pic.move_to(first.vertex.x, first.vertex.y)\n\t\tpath.reverse.each_cons(3){|prv, cur, nxt|\n\t\t\tfail unless prv && cur && nxt \n\t\t\tne, ne_comp = full_split_neighbor_list(prv, nxt, cur)\n\t\t\tfail if ne_comp.include?(prv) || ne_comp.include?(nxt)\n\t\t\tfail if ne.include?(prv) || ne.include?(nxt)\n\t\t\tne << nxt\n\t\t\tne_comp << nxt\n\t\t\tif r1\n\t\t\t\tne.delete(r2)\n\t\t\t\tne_comp.delete(r1)\n\t\t\telse\n\t\t\t\tne << prv\n\t\t\t\tne_comp << prv\n\t\t\tend\n\t\t\t@regions.delete(cur)\n\t\t\tr1 = Region.new(cur.vertex)\n\t\t\tr2 = Region.new(cur.vertex)\n\t\t\tr1.idirs = cur.idirs.dup\n\t\t\tr2.idirs = cur.idirs.dup\n\t\t\tr1.odirs = cur.odirs.dup\n\t\t\tr2.odirs = cur.odirs.dup\n\t\t\tr1.incident =\tr2.incident = cur.incident\n\t\t\t# give r1 and r2 an offset vector perpendicular to the path to allow a distinction\n\t\t\tif false#nxt.vertex == prv.vertex\n\t\t\t\tputs '+++', nxt.vertex.xy\n\t\t\t\t@pic.arc(nxt.vertex.x, nxt.vertex.y, 12 * ATW, 0, 4)\n\t\t@pic.stroke\n\n\t\t\tend\n\n\t\t\tdx1 = dy1 = dx2 = dy2 = 0\n\t\t\tif prv == first\n\t\t\t\t#puts \"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\"\n\t\t\t\tdx2 = cur.rx - prv.rx\n\t\t\t\tdy2 = cur.ry - prv.ry\n\t\t\t\th = Math::hypot(dx2, dy2)\n\t\t\t\tdx2 /= h\n\t\t\t\tdy2 /= h\n\t\t\tend\n\t\t\tif nxt == last\n\t\t\t\t#puts \"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\"\n\t\t\t\tdx1 = nxt.rx - cur.rx\n\t\t\t\tdy1 = nxt.ry - cur.ry\n\t\t\t\th = Math::hypot(dx1, dy1)\n\t\t\t\tdx1 /= h\n\t\t\t\tdy1 /= h\n\t\t\tend\n\t\t\tif prv == first || nxt == last\n\t\t\t\tr1.g = r2.g = cur.g * 0.5\n\t\t\t\tdy = (dx1 + dx2)\n\t\t\t\tdx = -(dy1 + dy2)\n\t\t\t\th = Math::hypot(dx, dy) / cur.g # zero for full 2 PI turn\n\t\t\t\tdx /= h \n\t\t\t\tdy /= h\n\t\t\t\t#fail if dx == 0 || dy == 0\n\t\t\t\tr1.ox = cur.ox + dx\n\t\t\t\tr1.oy = cur.oy + dy\n\t\t\t\tr2.ox = cur.ox - dx\n\t\t\t\tr2.oy = cur.oy - dy\n\t\t\t\tr1.rx = r1.vertex.x + r1.ox\n\t\t\t\tr1.ry = r1.vertex.y + r1.oy\n\t\t\t\tr2.rx = r2.vertex.x + r2.ox\n\t\t\t\tr2.ry = r2.vertex.y + r2.oy\n\t\t\telse\n\n\t\t\t\tr1.ox = cur.ox\n\t\t\t\tr1.oy = cur.oy\n\t\t\t\tr2.ox = cur.ox\n\t\t\t\tr2.oy = cur.oy\n\t\t\t\tr1.rx = cur.rx\n\t\t\t\tr1.ry = cur.ry\n\t\t\t\tr2.rx = cur.rx\n\t\t\t\tr2.ry = cur.ry\n\t\t\tend\n\n\n\n\t\t\tif true#nxt.vertex != prv.vertex # h == 0\n\t\t\t\t#r1.g = r2.g = cur.g * 0.5 # magnitude of additional offset decreases for each split by factor 0.5 \n\t\t\t\t#dx1 = nxt.vertex.x - cur.vertex.x\n\t\t\t\t#dy1 = nxt.vertex.y - cur.vertex.y\n\t\t\t\tdx1 = nxt.rx - cur.rx\n\t\t\t\tdy1 = nxt.ry - cur.ry\n\t\t\t\th = Math::hypot(dx1, dy1)\n\t\t\t\tdx1 /= h\n\t\t\t\tdy1 /= h\n\t\t\t\t#dx2 = cur.vertex.x - prv.vertex.x\n\t\t\t\t#dy2 = cur.vertex.y - prv.vertex.y\n\t\t\t\tdx2 = cur.rx - prv.rx\n\t\t\t\tdy2 = cur.ry - prv.ry\n\t\t\t\th = Math::hypot(dx2, dy2)\n\t\t\t\tdx2 /= h\n\t\t\t\tdy2 /= h\n\t\t\t\tdy = (dx1 + dx2)\n\t\t\t\tdx = -(dy1 + dy2)\n\t\t\t\th = Math::hypot(dx, dy) #/ cur.g # zero for full 2 PI turn\n\t\t\t\tdx /= h \n\t\t\t\tdy /= h\n\t\t\t\t#r1.ox = cur.ox + dx\n\t\t\t\t#r1.oy = cur.oy + dy\n\t\t\t\t#r2.ox = cur.ox - dx\n\t\t\t\t#r2.oy = cur.oy - dy\n\t\t\t\t#r1.rx = r1.vertex.x + r1.ox\n\t\t\t\t#r1.ry = r1.vertex.y + r1.oy\n\t\t\t\t#r2.rx = r2.vertex.x + r2.ox\n\t\t\t\t#r2.ry = r2.vertex.y + r2.oy\n\t\t\tend\n\t\t\t@regions << r1 << r2\n\t\t\tcur.neighbors.each{|el| el.neighbors.delete(cur)}\n\t\t\tne.each{|el|\n\t\t\t\tel.neighbors << r1\n\t\t\t\tr1.neighbors << el\n\t\t\t}\n\t\t\tne_comp.each{|el|\n\t\t\t\tel.neighbors << r2\n\t\t\t\tr2.neighbors << el\n\t\t\t}\n\t\t\tif cur.lr_turn != cur.outer\n\t\t\t\tr1.incident = false\n\t\t\telse\n\t\t\t\tr2.incident = false\n\t\t\tend\n\t\t\tif cur.outer && dx\n\t\t\t\tif cur.lr_turn\n\t\t\t\t\tr2.odirs << [dx, dy]\n\t\t\t\telse\n\t\t\t\t\tr1.odirs << [-dx, -dy]\n\t\t\t\tend\n\t\t\tend\n\t\t\t@pic.line_to(cur.vertex.x, cur.vertex.y)\n\t\t}\n\n\t\t@pic.line_to(last.vertex.x, last.vertex.y)\n\t\t@pic.stroke\n\n\t\tpstep = nil\n\t\tpath.each_with_index{|cur, i| \n\t\t\tnxt = (i == path.length - 1 ? nil : path[i + 1])\n\t\t\tprv = (i == 0 ? nil : path[i - 1])\n\t\t\tnv = (nxt ? nxt.vertex : nil)\n\t\t\tpv = (prv ? prv.vertex : nil)\n\t\t\tcv = cur.vertex\n\t\t\tstep = Step.new(pv, nv, @path_ID)\n\t\t\tstep.outer = cur.outer\n\t\t\tstep.lr_turn = !cur.lr_turn\n\t\t\tstep.net_desc = net_desc\n\t\t\tstep.vertex = cv\n\t\t\tstep.pstep = pstep\n\t\t\tpstep = step\n\t\t\tif prv and nxt\n\t\t\t\tcv.update(step) # TODO: if one vertex includes his neighbor vertex, then skip that one!\n\t\t\t\tcv.unfriendly_resize\n\t\t\t\tstep.rgt = step.outer != cur.lr_turn\n\t\t\t\tstep.xt = !step.outer\n\t\t\t\tcv.attached_nets << step\n\t\t\telse\n\t\t\t\tstep.rgt = false\n\t\t\t\tcv.incident_nets << step\n\t\t\tend\n\t\t}\n\t\t@path_ID += 1\n\t\twhile p = pstep.pstep\n\t\t\tp.nstep = pstep\n\t\t\tpstep = p\n\t\tend\n\t\treturn true\n\tend",
"title": ""
},
{
"docid": "6170498fda2c0cba2723bebbad4e5b32",
"score": "0.5044061",
"text": "def get_path hostip, datapath_id\n puts \"USING PATH #{@used_paths.current}\"\n case @used_paths.current\n when \"I2\" # All traffic goes via I2\n if @switches.key(datapath_id) == \"SLSDX\"\n return \"I2\"\n elsif @switches.key(datapath_id) == \"SOXSDX\"\n return \"I2\"\n end\n\n when \"ORNL\" # All traffic via ORNL\n if @switches.key(datapath_id) == \"SLSDX\"\n return \"ORNL\"\n elsif @switches.key(datapath_id) == \"SOXSDX\"\n return \"ORNL\"\n end\n\n when \"ESNET\" # All traffic via ORNL\n if @switches.key(datapath_id) == \"SLSDX\"\n return \"ESNET\"\n elsif @switches.key(datapath_id) == \"SOXSDX\"\n return \"ESNET\"\n end\n\n when \"I2-ESNET\" # Radars 1 and 2 via ESNET, radars 3 and 4 via I2\n if @switches.key(datapath_id) == \"SLSDX\"\n if @radars_sl[0] == hostip.to_s || @radars_sl[1] == hostip.to_s\n return \"ESNET\"\n elsif @radars_sl[2] == hostip.to_s || @radars_sl[3] == hostip.to_s\n return \"I2\"\n end\n elsif @switches.key(datapath_id) == \"SOXSDX\"\n # puts \"#{@radars_sl[0]}, #{hostip}\"\n if @radars_sl[0] == hostip.to_s || @radars_sl[1] == hostip.to_s\n # puts \"get_path ESNET\"\n return \"ESNET\"\n elsif @radars_sl[2] == hostip.to_s || @radars_sl[3] == hostip.to_s\n return \"I2\"\n end \n end\n\n when 1000 # To SOXSDL via ESNET, back via I2\n if @switches.key(datapath_id) == \"SLSDX\"\n return \"ESNET\"\n elsif @switches.key(datapath_id) == \"SOXSDX\"\n return \"I2\"\n end\n\n else\n puts \"WARNING: Case not defined!!\"\n end\n end",
"title": ""
},
{
"docid": "01c0787b0227e9a6da2727933fe5aad4",
"score": "0.50404185",
"text": "def find_path(source, target, map)\n came_from = {}\n frontier = [source]\n\n # Sets up the search to begin from the source\n came_from[source] = nil\n @main_loop_count = 0\n\n max_y = map.size - 1\n max_x = map[0].size - 1\n target_x = target[0]\n target_y = target[1]\n\n # Until the target is found or there are no more cells to explore from\n until came_from.has_key?(target) || frontier.empty?\n @main_loop_count += 1\n\n # Take the next frontier cell\n new_frontier = frontier.shift\n\n # Find the adjacent neighbors\n adjacent_neighbors = []\n\n # Gets all the valid adjacent_neighbors into the array\n # From southern neighbor, clockwise\n nfx = new_frontier[0]\n nfy = new_frontier[1]\n adjacent_neighbors << [nfx , nfy - 1] unless nfy == 0\n adjacent_neighbors << [nfx - 1, nfy ] unless nfx == 0\n adjacent_neighbors << [nfx , nfy + 1] unless nfy == max_y\n adjacent_neighbors << [nfx + 1, nfy ] unless nfx == max_x\n\n adjacent_neighbors << [nfx - 1, nfy - 1] unless nfx == 0 || nfy == 0\n adjacent_neighbors << [nfx - 1, nfy + 1] unless nfx == 0 || nfy == max_y\n adjacent_neighbors << [nfx + 1, nfy + 1] unless nfx == max_x || nfy == max_y\n adjacent_neighbors << [nfx + 1, nfy - 1] unless nfx == max_x || nfy == 0\n\n # For each of its neighbors\n # adjacent_neighbors(new_frontier).each do |neighbor|\n adjacent_neighbors.each do |neighbor|\n # That have not been visited and are not walls\n unless came_from.has_key?(neighbor) || map[neighbor[1]][neighbor[0]] != '.'\n # Add them to the frontier and mark them as visited\n frontier << neighbor\n came_from[neighbor] = new_frontier\n end\n end\n\n # Sort the frontier so cells that are close to the target are then prioritized\n frontier = frontier.sort_by { |cell| (target_x - cell[0]).abs + (target_y - cell[1]).abs }\n # @frontier.sort! { |c1, c2| ((target_x - c1[0]).abs + (target_y - c1[1]).abs) <=> ((target_x - c2[0]).abs + (target_y - c2[1]).abs) }\n # @frontier = merge_sort(@frontier, target_x, target_y)\n end\n\n # If the search found the target\n if came_from.has_key?(target)\n # Calculates the path between the target and star for the greedy search\n # Only called when the greedy search finds the target\n path = []\n next_endpoint = came_from[target]\n while next_endpoint\n path << next_endpoint\n next_endpoint = came_from[next_endpoint]\n end\n path\n else\n return nil\n end\n end",
"title": ""
},
{
"docid": "47c1452c34883bd2192e03f54b2e390b",
"score": "0.5038686",
"text": "def is_junction?(id,way_ids)\n\t\tsql = \"SELECT COUNT(*) FROM planet_osm_ways WHERE #{id}=ANY(nodes) AND id IN (#{way_ids.join(',')})\"\n\t\t$conn.exec(sql)[0]['count'].to_i > 1\n\tend",
"title": ""
},
{
"docid": "20c707809a413a2c3de586a08a4ce942",
"score": "0.5031583",
"text": "def heuristic_calc_path\n # Start from the target\n endpoint = grid.target\n # And the cell it came from\n next_endpoint = heuristic.came_from[endpoint]\n while endpoint && next_endpoint\n # Draw a path between these two cells and store it\n path = get_path_between(endpoint, next_endpoint)\n heuristic.path << path\n # And get the next pair of cells\n endpoint = next_endpoint\n next_endpoint = heuristic.came_from[endpoint]\n # Continue till there are no more cells\n end\n end",
"title": ""
},
{
"docid": "27d86aab6bf578929acc0fa224d4613f",
"score": "0.50253755",
"text": "def alreadyUsed? path, coords\n path.each() do |point| \n return true if point[0] == coords[0] && point[1] == coords[1] \n end\n false\n end",
"title": ""
},
{
"docid": "560d7ef5b688606d6a31aa1c04d51c70",
"score": "0.50101566",
"text": "def find_redundant_connection(edges)\n fromto=(1..edges.length+1).to_a\n edges.each do |edge|\n if (fromto[edge[1]] == fromto[edge[0]])\n return edge \n else\n fromto[edge[1]] = fromto[edge[0]]\n end\n p fromto\n end\n false\nend",
"title": ""
},
{
"docid": "e7c166074f4c61296b17b2f60660887e",
"score": "0.500955",
"text": "def valid?\n valid = true\n @path.each do |node|\n unless @map.tiles.dig(node.tile.grid_position.x, node.tile.grid_position.y).entity == node.tile.entity\n valid = false\n break\n end\n end\n\n return valid\n end",
"title": ""
},
{
"docid": "4a61829462e9c394418f9fb47a16b33f",
"score": "0.49776128",
"text": "def resolve_alternates(load_path, logical_path); end",
"title": ""
},
{
"docid": "4a61829462e9c394418f9fb47a16b33f",
"score": "0.49776128",
"text": "def resolve_alternates(load_path, logical_path); end",
"title": ""
},
{
"docid": "4a61829462e9c394418f9fb47a16b33f",
"score": "0.49776128",
"text": "def resolve_alternates(load_path, logical_path); end",
"title": ""
},
{
"docid": "5572a429d6617454930a98dd57412151",
"score": "0.49698815",
"text": "def robot_path(grid)\n visited = Set.new\n find_path(0, 0, grid, visited)\nend",
"title": ""
},
{
"docid": "b1db6640113dd1eea60d8a51fd8b2520",
"score": "0.49532047",
"text": "def find_other_pieces(path)\n path.select do |piece|\n next(false) if piece.nil?\n\n true\n end\n end",
"title": ""
},
{
"docid": "137a8869a123b4dca154f811036b97bd",
"score": "0.49507767",
"text": "def logical_paths; end",
"title": ""
},
{
"docid": "25460b43fc48a02e9f5fd6053a5d9aae",
"score": "0.4932558",
"text": "def find_path(grid)\n to_walk = [[0, 0]]\n\n\nend",
"title": ""
},
{
"docid": "8083cf5eb9ee6daaef2064c777e721bc",
"score": "0.4930978",
"text": "def findPath(source, sink, edges, path, illegalturns)\n # If we completed the path, return\n if source == sink\n return path\n end\n \n # Go through each edge out of here\n edges.keys.each { |edge|\n if edges[edge][0] == source # we found an edge out\n if (not illegalturns[source]) || (not path.include?(illegalturns[source][0])) or illegalturns[source][1] != edges[edge][1]\n # does not match to an illegal turn\n nxt = edges[edge][1]\n # check to make sure we haven't been here already\n if not path.include?(nxt)\n temp = findPath(nxt, sink, edges, path.clone.push(nxt), illegalturns)\n if temp\n return temp\n end\n end\n else\n # This turn is not legal\n end\n end\n }\n # If we went through all edges and found no new unique path return empty\n return nil\nend",
"title": ""
},
{
"docid": "53894aeee1436864da0ec462b7f987e3",
"score": "0.4924408",
"text": "def unique_paths_with_obstacles(obstacle_grid)\n (0...obstacle_grid.size).each { |i|\n (0...obstacle_grid[0].size).each { |j|\n if obstacle_grid[i][j] == 1\n obstacle_grid[i][j] = 0\n next\n end\n \n if i == 0 && j == 0\n obstacle_grid[i][j] = 1\n next\n end\n \n obstacle_grid[i][j] = (i > 0 && obstacle_grid[i - 1][j] > 0 ? obstacle_grid[i - 1][j] : 0) +\n (j > 0 && obstacle_grid[i][j - 1] > 0 ? obstacle_grid[i][j - 1] : 0)\n }\n }\n \n obstacle_grid[-1][-1]\nend",
"title": ""
},
{
"docid": "abc1cf0182030566c730ead01fb63ca3",
"score": "0.4907383",
"text": "def king_and_knight_path(all_paths, board, colour)\n real_path = []\n all_paths.each do |position|\n square = board[position[0]][position[1]]\n next if colour == 'white' && @white_pieces.any?(square)\n next if colour == 'black' && @black_pieces.any?(square)\n\n real_path << position\n end\n real_path\n end",
"title": ""
},
{
"docid": "930963ee68f1b8a7af148fa98f2e4541",
"score": "0.49038902",
"text": "def connect_endpoints_to_path\n # We always want to make sure that we have at least 2 points on a link\n issue = false\n coords = oldcoords = self.view_path_coordinates[\"LonLat\"]\n if coords.length < 1 || !equalCoordinates?(coords.first, self.from.location.coordinates[\"LonLat\"])\n issue = ISSUE_DISTANCE < getGeoDistance(coords.first, self.from.location.coordinates[\"LonLat\"])\n coords = [self.from.location.coordinates[\"LonLat\"]] + coords\n end\n if coords.length < 2 || !equalCoordinates?(coords.last, self.to.location.coordinates[\"LonLat\"])\n issue = issue || ISSUE_DISTANCE < getGeoDistance(coords.last, self.to.location.coordinates[\"LonLat\"])\n coords = coords + [self.to.location.coordinates[\"LonLat\"]]\n end\n self.view_path_coordinates = { \"LonLat\" => coords }\n return issue\n end",
"title": ""
},
{
"docid": "82b81cd21435a14123b8b8f5c04afedc",
"score": "0.4901844",
"text": "def connect_cx(cx)\n\n # extract values from input parameter cx\n s1 = cx[:s1]\n t1 = cx[:t1]\n hex1 = cx[:hex1]\n a1= hex1[:a]\n b1 = hex1[:b]\n dir1 = cx[:dir1]\n s2 = cx[:s2]\n t2 = cx[:t2]\n hex2 = cx[:hex2]\n a2 = hex2[:a]\n b2 = hex2[:b]\n dir2 = cx[:dir2]\n case dir1\n when :S\n mode = :vert\n north_point = hex1\n south_point = hex2\n when :N\n mode = :vert\n north_point = hex2\n south_point = hex1\n when :E\n mode = :horz\n west_point = hex1\n east_point = hex2\n when :W\n mode = :horz\n west_point = hex2\n east_point = hex1\n end\n\n # get the zone of possible connector hexes for vertical or horizontal\n # connection\n case mode\n\n # get top and bottom bounding lanes for zone for a vertical connection\n when :vert\n max_west = 8*s1-7\n max_east = 8*s1-2\n\n top = []\n hx = north_point\n until hx[:a] == max_west || hx == south_point\n hx = next_hex(hx,:SW)\n top << hx\n end\n top << next_hex(north_point,:S)\n hx = north_point\n until hx[:a] == max_east\n hx = next_hex(hx,:SE)\n top << hx\n end\n top.sort_by! {|hh| hh[:a]}\n\n btm = []\n hx = south_point\n until hx[:a] == max_west\n hx = next_hex(hx,:NW)\n btm << hx\n end\n btm << next_hex(south_point,:N)\n hx = south_point\n until hx[:a] == max_east\n hx = next_hex(hx,:NE)\n btm << hx\n end\n btm.sort_by! {|hh| hh[:a]}\n\n hhxx1 = north_point\n hhxx2 = south_point\n\n # get top and bottom bounding lanes for zone for a horizontal connection\n when :horz\n a1 = west_point[:a]\n b1 = west_point[:b]\n a2 = east_point[:a]\n b2 = east_point[:b]\n delta_a = a2-a1\n delta_b = b2-b1\n zpat = ((delta_a-a1%2+1)/2).to_i\n delta_a_top = zpat-delta_b\n a_top = a1+delta_a_top\n zpab = -((delta_a+a1%2)/2).to_i\n delta_a_btm = delta_b-zpab\n a_btm = a1+delta_a_btm\n zpbt = ((delta_a+a1%2-1)/2).to_i\n delta_b_top = ((delta_b-zpbt)/2).to_i\n b_top = b1+delta_b_top\n zpbb = -((delta_a-a1%2)/2).to_i\n delta_b_btm = ((delta_b-zpbb+1)/2).to_i\n b_btm = b1+delta_b_btm\n\n top = []\n max_west = west_point[:a]+1\n hx = {a: a_top, b: b_top}\n top << hx\n\n until hx[:a] == max_west\n hx = next_hex(hx,:SW)\n top << hx\n end\n\n hx = {a: a_top, b: b_top}\n max_east = east_point[:a]-1\n until hx[:a] == max_east\n hx = next_hex(hx,:SE)\n top << hx\n end\n top.sort_by! {|hh| hh[:a]}\n\n btm = []\n hx = {a: a_btm, b: b_btm}\n btm << hx\n until hx[:a] == max_west\n hx = next_hex(hx,:NW)\n btm << hx\n end\n\n hx = {a: a_btm, b: b_btm}\n until hx[:a] == max_east\n hx = next_hex(hx,:NE)\n btm << hx\n end\n btm.sort_by! {|hh| hh[:a]}\n\n hhxx1 = west_point\n hhxx2 = east_point\n\n end\n\n # use the top and bottom bounding lanes to construct the connection zone\n zone = []\n zone_width = 0\n zone_width = top.length if top.respond_to?(:length)\n 0.upto(zone_width-1) do |i|\n top_hex = top[i]\n btm_hex = btm[i]\n aa = top_hex[:a]\n b1 = top_hex[:b]\n b2 = btm_hex[:b]\n b1.upto(b2) {|bb| zone << {a: aa, b: bb} }\n end\n\n # pick a random connecting path through the zone\n path = []\n until zone == []\n zone.shuffle!\n hx = zone.pop\n path << hx unless path_exists?(zone+path,hhxx1,hhxx2)\n end\n path.each {|hx| put(hx,:water)}\n\n end",
"title": ""
},
{
"docid": "40862f3e274997e958575b86b3864f68",
"score": "0.48930544",
"text": "def mark_path(wire)\n all_possible_pos = [];\n current_x = 0\n current_y = 0\n\n wire.each do |turn|\n uni_dir_moves = turn[1..-1].to_i\n\n case turn[0]\n when \"R\"\n uni_dir_moves.times do |move|\n current_x += 1;\n all_possible_pos << [current_x, current_y]\n end\n when \"U\"\n uni_dir_moves.times do |move|\n current_y += 1;\n all_possible_pos << [current_x, current_y]\n end \n when \"L\"\n uni_dir_moves.times do |move|\n current_x -= 1;\n all_possible_pos << [current_x, current_y]\n end \n when \"D\"\n uni_dir_moves.times do |move|\n current_y -= 1;\n all_possible_pos << [current_x, current_y]\n end \n else\n \"The End\"\n end\n end\n\n all_possible_pos\nend",
"title": ""
},
{
"docid": "46a88e00f865719255532f0903e32776",
"score": "0.48888284",
"text": "def unique_paths(rows, columns, memo = {})\nend",
"title": ""
},
{
"docid": "5e50c09075de392ea6aafca2569d9c15",
"score": "0.4885583",
"text": "def direct_path\n if (delta_row.abs <= 1 and delta_column.abs <= 1) or piece.kind_of? Chess::Pieces::Knight\n []\n end\n end",
"title": ""
},
{
"docid": "dc8ece264d74372277ed7ea9b3f40df5",
"score": "0.4876609",
"text": "def routes_to names, u = '0', path = []\n names = [names].flatten.collect{|n|n.to_s} if path.empty?\n routes = []\n @universes[u].cells.each do |c|\n c_path = path + [c.id]\n if c.material.nil?\n if c.fill.nil?\n # void\n elsif c.fill.class.to_s =~ /universe/i\n routes += self.routes_to( names, c.fill.id, c_path)\n else\n dx,dy = c.fill.dimensions\n c.fill.elements.collect {|el| el.id} .each_with_index do |id,i|\n lat = '[%3d %3d 0]' % [i%dx - dx/2, i/dx - dy/2]\n routes += self.routes_to( names, id, path + [c.id + lat] )\n end\n end\n elsif names.include? c.material.name #== name.to_s\n routes << c_path\n end\n end\n if path.empty? and not routes.nil?\n i = 0\n routes = routes.collect { |r| \" (%s) $ %d \" % [r.reverse.join(' < '), i+=1] }\n coors = []\n routes.join.scan(/\\[\\s*(-?\\d+)\\s+(-?\\d+)\\s+\\d+\\s*\\]/).each_slice(2) do |a|\n coors << a.flatten.join(' ')\n end\n matlab = \"routes = [%s];\" % coors.join(' ; ');\n return [routes, matlab]\n end\n return routes\n end",
"title": ""
},
{
"docid": "2ce24e775eeb70b8093048f31325cf6d",
"score": "0.48672822",
"text": "def generate_paths_for(offsets, board)\n path_tiles = []\n all_coordinates = Board.tiles.keys\n current_position_index = all_coordinates.index(@position.to_sym) \n\n offsets.each do |offset|\n i = 1\n # max length of a path in any direction is 7\n 7.times do |n| \n adjusted_offset = offset * i \n next_tile = generate_adjacent_tiles([adjusted_offset])[0]\n case \n when next_tile.nil? || wrapped?(next_tile, path_tiles)\n break\n when board.is_piece?(next_tile)\n if board.is_enemy?(next_tile, @color)\n path_tiles << next_tile\n break\n else\n break\n end\n end\n path_tiles << next_tile\n i += 1\n end\n end\n path_tiles\n end",
"title": ""
},
{
"docid": "ff69160d47400256652dfdbac8264b72",
"score": "0.48661035",
"text": "def horizontal_connect_four?\n last_disc = @board.last_disc\n connected_discs = []\n # Add discs to the right of last disc until different disc, empty cell or board edge is hit\n current_disc = @board.get_disc(last_disc.column_index + 1, last_disc.row_index)\n until current_disc != last_disc\n connected_discs << current_disc\n current_disc = @board.get_disc(current_disc.column_index + 1, current_disc.row_index)\n end\n # Add discs to the left of last disc until different disc, empty cell or board edge is hit\n current_disc = @board.get_disc(last_disc.column_index - 1, last_disc.row_index)\n until current_disc != last_disc\n connected_discs << current_disc\n current_disc = @board.get_disc(current_disc.column_index - 1, current_disc.row_index)\n end\n # Add last disc\n connected_discs << last_disc\n connected_discs.length == 4\n end",
"title": ""
},
{
"docid": "3f9df28fa7c3541ba44a29e1efeed8ca",
"score": "0.48619094",
"text": "def rect?\n paths.any? && (@tile.preferred_city_town_edges[self] || (exits.size < 2 && paths.size < 3))\n end",
"title": ""
},
{
"docid": "e0d61c2e08cb71987154c0d8a4767d26",
"score": "0.48595318",
"text": "def valid?\n valid = true\n @path.each do |node|\n unless @map.grid.dig(node.tile.position.x, node.tile.position.y).element == node.tile.element\n valid = false\n break\n end\n end\n\n return valid\n end",
"title": ""
},
{
"docid": "abb673394f8cb2570138ffe058d9868e",
"score": "0.4855797",
"text": "def find_path\n\n #Add start point to \"open\" list\n open = Array.new\n closed = Array.new\n parented_start = ParentedPoint.new(@start_loc.x, @start_loc.y, nil)\n open.push(parented_start)\n\n #Add squares adjacent to starting point to open list\n adj = get_adjacent_tiles(parented_start)\n adj.each {|element| open.push(element)}\n #adj.each {|a| p \"Found adjacent at: #{a.x}, #{a.y} , g=#{a.g},h=#{a.h(@destination)},f=#{a.f(@destination)}\"}\n\n #delete starting point from open list\n open.delete(parented_start)\n closed.push(parented_start)\n ##open.each {|curr| puts \"have #{curr.x}, #{curr.y} f=#{curr.f(@destination)}\"}\n\n path = nil\n until open.empty?\n #find lowest \"f\" score on open list, add it to closed list, remove it from open list\n low_f = lowest_f(open, @destination)\n ##puts \"at #{low_f.x}, #{low_f.y} f=#{low_f.f(destination)}\"\n if low_f.x == @destination.x && low_f.y == @destination.y\n path = Array.new\n path_curr = low_f\n until path_curr == nil\n path.push Point.new(path_curr.x,path_curr.y)\n path_curr = path_curr.parent\n end\n path.reverse!\n ##path.each {|p_c| print \"#{p_c.x},#{p_c.y} \"}\n puts ''\n break;\n end\n closed.push( low_f )\n open.delete( low_f )\n\n #Add tiles adjacent to \"low_f\" to open list\n adj = get_adjacent_tiles(low_f)\n adj.each do |curr|\n #ignore if on the \"closed list\"\n on_closed = false\n closed.each do |c_obj|\n if curr.x == c_obj.x && curr.y == c_obj.y\n on_closed = true\n break\n end\n end\n if on_closed\n next\n end\n #check if tile is in \"open\" list already\n open_obj = nil\n open.each do |o_obj|\n if curr.x == o_obj.x && curr.y == o_obj.y\n open_obj = o_obj\n break\n end\n end\n #if current is already in \"open\" list, check \"g\" scores\n if open_obj != nil\n ##puts \"#{curr.x}, #{curr.y} is already in open list!\"\n #if current \"g\" score is less then \"g\" score of object in open list, replace object in open list\n if curr.g < open_obj.g\n open.delete(open_obj)\n open.push(curr)\n else\n ##puts \"open path better for #{curr.x}, #{curr.y}\"\n end\n else\n #if not in \"open\" list, add to open list\n open.push(curr)\n ##puts \" add #{curr.x}, #{curr.y} f=#{curr.f(@destination)}\"\n end\n end\n\n end\n\n @path = path\n\n end",
"title": ""
},
{
"docid": "8b43296eeb56af7c0a80a71c475b8391",
"score": "0.4839452",
"text": "def describe_paths(connections)\n connections.to_a.map { | (direction, (passage, next_location)) |\n \"There is a #{passage} going #{direction} from here.\"\n }\n end",
"title": ""
},
{
"docid": "f8e5843d6a6e81ebcfff548e4e36c273",
"score": "0.4835853",
"text": "def latticePaths(n)\n \nend",
"title": ""
},
{
"docid": "12826713e018b697c87f366b8289c135",
"score": "0.48302177",
"text": "def find_redundant_connection(edges)\n graph = Hash.new\n\n edges.each do |a, b|\n # 检查是否造成回路 = 之前已经联通了 + 新的连线也能造成回路\n if graph[a] && dfs_check_if_connected(a, b, graph)\n return [a, b]\n end\n\n # memorize the connection\n graph[a] ||= []\n graph[b] ||= []\n graph[a].push b\n graph[b].push a\n end\nend",
"title": ""
},
{
"docid": "5099681c90727a44b3fab98a88feae8f",
"score": "0.4825487",
"text": "def path_clear?\n clear = true\n piece_coords = game.piece_map\n if @x0 != @x1 && @y0 == @y1 # Check horizontal path\n @x1 > @x0 ? x = @x0 + 1 : x = @x0 - 1\n until x == @x1 do\n if piece_coords.include?([x, @y0])\n clear = false\n break\n end\n x > @x1 ? x -= 1 : x += 1\n end\n elsif @x0 == @x1 && @y0 != @y1 # Check vertical path\n @y1 > @y0 ? y = @y0 + 1 : y = @y0 - 1\n until y == @y1 do\n if piece_coords.include?([@x0, y])\n clear = false\n break\n end\n y > @y1 ? y -= 1 : y += 1\n end\n elsif @x0 != @x1 && @y0 != @y1 # Check diagonal path\n @x1 > @x0 ? x = @x0 + 1 : x = @x0 - 1\n @y1 > @y0 ? y = @y0 + 1 : y = @y0 - 1\n until x == @x1 && y == @y1 do\n if piece_coords.include?([x, y])\n clear = false\n break\n end\n x > @x1 ? x -= 1 : x += 1\n y > @y1 ? y -= 1 : y += 1\n end\n end\n clear\n end",
"title": ""
},
{
"docid": "f49468c82817bbfe5fb90e62cc74deb3",
"score": "0.48197815",
"text": "def discover_path(root, terminus, board)\n path = []\n\n queue = [].push(terminus)\n\n until queue.empty?\n vertex = queue.shift\n\n path.insert(0, vertex.to_a) if path.empty? || vertex.to_a == root.to_a || \\\n (vertex.end_points.include?(path[0]) && !path.include?(vertex.to_a) \\\n && !dead_end?(vertex, board))\n\n break if vertex.to_a == root.to_a\n\n vertices = vertex.end_points\n\n vertices.each { |v| queue.push(board[v[0]][v[1]]) \\\n if board[v[0]][v[1]].visited }\n end\n\n path\nend",
"title": ""
},
{
"docid": "2693c5497a0e2fcfcf7521e538ecfb36",
"score": "0.48161",
"text": "def test_connections\n @doors.all? do |k, v|\n v[-1] ? v[-1].leads_to?(self.class, k): true\n end\n end",
"title": ""
},
{
"docid": "37a1a79058e9f481ec2bf8aeec881635",
"score": "0.48145294",
"text": "def choose_unexplored_neighbour(node, arches)\n @a[node][arches].each do |vertex|\n if !@a[vertex][2]\n # mark it as explored and return\n !@a[vertex][2] = true\n return vertex\n end\n end\n # if we are here we found nothing\n return false\n end",
"title": ""
},
{
"docid": "d9fe0f75fd7dcdb2692bd3954364c52c",
"score": "0.48112595",
"text": "def mark_path(path)\n path.each do |step|\n set_path_node(step.x, step.y) if step != @start_node && step != @destination_node\n end\n end",
"title": ""
},
{
"docid": "32ecad504aeaef5cce99338468f732e3",
"score": "0.47788996",
"text": "def disjoint? other\n yours = other.nodes[1..-2].map{|x| x.hash}\n mine = @nodes[1..-2].map{|x| x.hash}\n \n # false if your path has one of my nodes\n mine.each{|a| return false if yours.include? a }\n \n # no matches\n true\n end",
"title": ""
},
{
"docid": "e69750b52d24be6dc2971fb4b85722b0",
"score": "0.47779116",
"text": "def solve begTile, endTile\n if @solver.reachable? begTile, endTile\n \"There is a valid path between #{begTile} and #{endTile}.\\n\"\n else\n \"There is not a valid path between #{begTile} and #{endTile}.\\n\"\n end\n end",
"title": ""
},
{
"docid": "1dfcbdcdb03a36afe276011d22eb8f77",
"score": "0.4777737",
"text": "def determineTileCords\n state.tempCounter ||= 1 # initializes tempCounter to 1\n state.tileQuantity.times do # there are 6 different kinds of tiles\n state.tileCords += [[state.tempX, state.tempY, state.tempCounter]] # adds tile definition to collection\n state.tempX += 75 # increments tempX to put horizontal space between the patterned tiles\n state.tempCounter += 1 # increments tempCounter\n if state.tempX > 200 # if tempX exceeds 200 pixels\n state.tempX = 50 # a new row of patterned tiles begins\n state.tempY -= 75 # the new row is 75 pixels lower than the previous row\n end\n end\n end",
"title": ""
},
{
"docid": "c946410ac4b8322cdae25a4b4f5e98a1",
"score": "0.47663012",
"text": "def visit_first_swch(node, worklist=nil)\n node.paths\n end",
"title": ""
},
{
"docid": "5b5f0100021da9bb5e58c24ffe22f68e",
"score": "0.47605652",
"text": "def valid_path(cells, testing = false)\n piece = cells[0].piece\n diff = pos_difference(cells)\n \n inc = piece.increments.include?(diff) ? diff : diff_to_inc(diff)\n result = false\n read = @board.cells[alpha_add(cells[0].pos, inc)]\n loop do\n if read == cells[1]\n result = true\n break\n elsif read.piece != nil\n break\n end\n read = @board.cells[alpha_add(read.pos, inc)]\n end\n if result == false\n puts \"no path for #{cells[0].piece.class} #{cells[0].pos} ==> #{cells[1].pos}\" if !testing\n end\n result\n end",
"title": ""
},
{
"docid": "ead10033fd6aaa203cb283f90a2def7a",
"score": "0.4753183",
"text": "def unique_paths(rows, columns)\n return 1 if rows == 1 || columns == 1\n unique_paths(rows - 1, columns) + unique_paths(rows, columns - 1)\nend",
"title": ""
},
{
"docid": "6f95f1a0a3cde167f14afaa3302d8a55",
"score": "0.47476175",
"text": "def clean_pathfinding_arrow\r\r\n dir = [2,4,6,8]\r\r\n for i in 0..$game_map.width\r\r\n for j in 0..$game_map.height\r\r\n for c in 0...4\r\r\n if $game_map.passable?(i,j,dir[c]) && $game_player.passable?(i,j,dir[c])\r\r\n $game_map.data[i,j,2] = 893 \r\r\n end\r\r\n \r\r\n end # for c\r\r\n end # for j \r\r\n end # for i\r\r\n end",
"title": ""
},
{
"docid": "7f375ba9f16f0b2321f9e714dcf82ff1",
"score": "0.4736774",
"text": "def upgrade_tokenable?(hex)\n from = hex.tile\n\n return false if from.color == :yellow && !@phase.tiles.include?(:green)\n return false if from.color == :green && (from.label.to_s != 'N' || !@phase.tiles.include?(:brown))\n return false if from.color == :brown\n\n from_exits = from.exits\n legal_exits = Engine::Tile::ALL_EDGES.select { |e| from.hex.neighbors[e] }\n @tiles.any? do |to|\n next unless Engine::Tile::COLORS.index(to.color) == (Engine::Tile::COLORS.index(from.color) + 1)\n next unless upgrades_to_correct_label?(from, to)\n\n to_exits = to.exits\n Engine::Tile::ALL_EDGES.any? { |rot| exits_match?(to_exits, rot, from_exits, legal_exits) }\n end\n end",
"title": ""
},
{
"docid": "709ce64cd8ef4c2a803bfc3e0016fd45",
"score": "0.47346762",
"text": "def dijkstra_calc_path\n # Start from the target\n endpoint = grid.target\n # And the cell it came from\n next_endpoint = dijkstra.came_from[endpoint]\n while endpoint && next_endpoint\n # Draw a path between these two cells and store it\n path = get_path_between(endpoint, next_endpoint)\n dijkstra.path << path\n # And get the next pair of cells\n endpoint = next_endpoint\n next_endpoint = dijkstra.came_from[endpoint]\n # Continue till there are no more cells\n end\n end",
"title": ""
},
{
"docid": "480e3213fab79399fb1f2fb0fc715844",
"score": "0.47262648",
"text": "def tiles\n map{ |link| link.tile }\n end",
"title": ""
},
{
"docid": "0f3175b231fa53a3c544e70863036f29",
"score": "0.47182083",
"text": "def find_matching_tile(unknown)\n @solution.each do |(x, y), soln|\n [NORTH, EAST, SOUTH, WEST].each do |direction|\n # skip if already something here\n dx, dy = case direction\n when NORTH then [0, 1]\n when EAST then [-1, 0]\n when SOUTH then [0, -1]\n when WEST then [1, 0]\n end\n next if @solution.key?([x + dx, y + dy])\n\n # try each unplaced tile in each orientation to see if it could be\n # placed next to `soln`\n unknown.each.with_index do |tile, i|\n [false, true].each do |hflip|\n [false, true].each do |vflip|\n [false, true].each do |transpose|\n if tile.edge(direction, hflip, vflip, transpose) == soln[:edges][(direction + 2) % 4]\n # match!\n return [i, x + dx, y + dy, hflip, vflip, transpose]\n end\n end\n end\n end\n end\n end\n end\n end",
"title": ""
},
{
"docid": "b5e0b18373d65748cccfaae1ac655be0",
"score": "0.4716951",
"text": "def show_path_to(node)\n if node.depth != 1\n board, color = show_path_to node.parent\n i, j = extract_move(node, color)\n board.add_stone(i, j, color)\n else\n board = @initial_board.clone\n color = @ia_color\n end\n show_node(node, board, color, i, j)\n return [board, (color == 1 ? 2 : 1)]\n end",
"title": ""
},
{
"docid": "72dd9362375374e1ee64d5deca88cca1",
"score": "0.46981192",
"text": "def find_all_connections_between_two_nodes(graph, initial_path, terminal_oriented_node,\n leash_length, recoherence_kmer, sequence_hash, options={})\n\n problems = find_all_problems(graph, initial_path, terminal_oriented_node, leash_length, recoherence_kmer, sequence_hash, options)\n\n paths = find_paths_from_problems(problems, recoherence_kmer, options)\n return paths\n end",
"title": ""
},
{
"docid": "3e5994c241b6148897498c9a6c6013cb",
"score": "0.46963003",
"text": "def create_tile(paths)\n Tile.new paths: paths\n end",
"title": ""
},
{
"docid": "1717ae8d504b0b723753950966c5c08d",
"score": "0.46939182",
"text": "def test_remove_multiple_loops\n @grid = Grid.new(:rows => 5,\n :columns => 5,\n :obstacles => [], :moved => 0)\n @grid.visited = path = [[1,1],[1,2],[2,2],[2,1],[3,1],[3,2],\n [4,2],[4,1],[5,1]]\n ideal_path =[[1,1],[2,1],[3,1],[4,1],[5,1]]\n\n @grid.remove_loops\n assert_equal 5, @grid.visited.count\n assert_equal ideal_path, @grid.visited\n end",
"title": ""
},
{
"docid": "183a8f3282ad7bec6862bbdf82d91896",
"score": "0.46852943",
"text": "def path_layers limit=100\n layers = []\n\n # Duplicate matrix because it will be modified\n mat = @matrix.dup\n\n loop do\n raise 'Exceeded threshold of 100, graph contains loop!' if limit == 0\n break if mat.empty?\n layer = []\n DirectedMatrixGraph.transpose(mat).each_pair do |dest, src_set|\n if src_set.empty?\n layer.push dest\n mat.delete dest\n end\n end\n layers.push layer\n limit -= 1\n end\n\n layers\n end",
"title": ""
},
{
"docid": "59812803467538a4a312315c9f09a8fe",
"score": "0.4646371",
"text": "def adjacent_unknown_tile(tile)\n tile.neighbours.find {|t| t.state == :unknown }\n end",
"title": ""
},
{
"docid": "0c2b7163164fc7330bb36d7527fedbcc",
"score": "0.46462187",
"text": "def all_links_mesh(r,c)\n\nend",
"title": ""
},
{
"docid": "faeb5bf1df20a6d7f4a4c43585b70385",
"score": "0.46396777",
"text": "def get_adjacent_walls tile\n adjacent_tiles = self.get_adjacent_tiles tile\n invalid_tiles = Array.new\n adjacent_tiles.each do |adj_tile|\n if (adj_tile.is_floor || adj_tile.x==0 || adj_tile.y==0 || adj_tile.x==@width-1 || adj_tile.y==@height-1)\n invalid_tiles.push adj_tile\n end\n end\n adjacent_tiles-invalid_tiles\n end",
"title": ""
},
{
"docid": "7ce0853e0ce0df8605f17f427d7f4194",
"score": "0.46358696",
"text": "def complete?\n stations = map.tile_objects.select { |x| x.is_a?(Entities::StationObject) }\n station_pairs = stations.group_by(&:number)\n\n station_pairs.each do |_, (a, b)|\n if connects?(a.point.moved(a.orientation), b.point.moved(b.orientation))\n return true\n end\n end\n\n false\n end",
"title": ""
},
{
"docid": "392af431f1cc34c45bb7a6d9f38c52f9",
"score": "0.46336544",
"text": "def path(c,r, matrix_map)\n \n \n\nend",
"title": ""
},
{
"docid": "bdbb443a338bf68f5b6f9d20076ffa20",
"score": "0.4632191",
"text": "def lattice_paths(m, n)\n #YOUR WORK HERE\nend",
"title": ""
},
{
"docid": "5c13746074536a977ee5abb9dd80b57a",
"score": "0.4631148",
"text": "def resolve_conflicts\n neighbours = @nodes\n new_chain = nil\n\n # We're only looking for chains longer than ours\n mmy_chain_length = @chain.length\n\n neighbours.each do |node|\n # Fetch others chain\n res = Net::HTTP.start(node[:host], node[:port]) do |http|\n http.get '/chain'\n end\n\n data = JSON.parse res.body\n length = data['length']\n chain = data['chain']\n\n # Check if the length is longer and the chain is valid\n if length > my_chain_length && valid_chain(chain)\n my_chain_length = length\n new_chain = chain\n end\n end\n\n if !!new_chain\n @chain = new_chain\n return true\n end\n end",
"title": ""
},
{
"docid": "1f4d7e782f10f4a147846ebc6a386ce3",
"score": "0.46286803",
"text": "def paths_in_cycle(cycle, max_paths = 1)\n raise ArgumentError, \"negative or zero max_paths\" if max_paths < 1\n\n # Calculate our filtered outbound vertex lists...\n adj = {}\n cycle.each do |vertex|\n adj[vertex] = adjacent(vertex).select{|s| cycle.member? s}\n end\n\n found = []\n\n # frame struct is vertex, [path]\n stack = [[cycle.first, []]]\n while frame = stack.shift do\n if frame[1].member?(frame[0]) then\n found << frame[1] + [frame[0]]\n break if found.length >= max_paths\n else\n adj[frame[0]].each do |to|\n stack.push [to, frame[1] + [frame[0]]]\n end\n end\n end\n\n return found.sort\n end",
"title": ""
},
{
"docid": "0dbb69e46360c5b5dedfb8253e1e07fe",
"score": "0.46279234",
"text": "def trace begTile, endTile\n check_valid = self.solve begTile, endTile\n return check_valid if (check_valid.include? (\"not\"))\n path = (@solver.pathfind begTile, endTile).dup\n self.clear\n path\n end",
"title": ""
},
{
"docid": "a39918a8e05e1c9d95c60f68e592103f",
"score": "0.46277672",
"text": "def breakable?(king, square)\n x1 = king.x\n y1 = king.y\n x2 = square.x\n y2 = square.y\n\n threat_path = detect_path(x1, y1, x2, y2)\n # puts \"Printing threat path\"\n # threat_path.each { |s| p s }\n\n condition = false\n\n if threat_path.length > 1 \n if king.color == 'white'\n threat_path.map { |square| square.color = 'black' }\n condition = true if threat_path.any? { |square| reachable?(square) == true }\n\n elsif king.color == 'black'\n threat_path.map { |square| square.color = 'white' }\n condition = true if threat_path.any? { |square| reachable?(square) == true }\n end\n end\n\n condition\n end",
"title": ""
},
{
"docid": "66cc45544c3437eafe077f366b899068",
"score": "0.46274996",
"text": "def paths_diverge?\n spoofed_tr_loop = @spoofed_tr.contains_loop?()\n tr_loop = @tr.contains_loop?()\n\n compressed_spooftr = @spoofed_tr.compressed_prefix_path\n compressed_tr = @tr.compressed_prefix_path\n \n divergence = !Path.share_common_path_prefix?(compressed_spooftr, compressed_tr)\n\n ## XXX Change $LOG?\n #$LOG.puts \"spooftr_loop!(#{@src}, #{@dst}) #{@spoofed_tr.map { |h| h.ip }}\" if spoofed_tr_loop\n #$LOG.puts \"tr_loop!(#{@src}, #{@dst}) #{@tr.map { |h| h.ip}}\" if tr_loop\n #$LOG.puts \"divergence!(#{@src}, #{@dst}) #{compressed_spooftr} --tr-- #{compressed_tr}\" if divergence\n\n return spoofed_tr_loop || tr_loop || divergence\n end",
"title": ""
},
{
"docid": "38546c9237d4fa19b4f248aa7ce20219",
"score": "0.46256775",
"text": "def check_neighbour(tms, level)\n path = Mapping::GlobalMercator.tms_to_quad_tree_tile_code(tms[:x], tms[:y], tms[:zoom])\n node = Map::Node.find_by_path(path)\n if node.blank?\n node = Map::Node.find_by_path(path[0, path.length-1])\n end\n if node.blank?\n puts \"ERROR: did not find a node for #{ path } and #{ path[0, path.length-1] }.\"\n return []\n elsif node.level < level\n if !node.leaf\n puts \"ERROR: this node was expected to be a leaf node!\"\n return []\n end\n return [ node ]\n else\n return []\n end\nend",
"title": ""
},
{
"docid": "6262ece12ba5051b738b876efe08cc08",
"score": "0.46219254",
"text": "def check_overlap_single(route)\n tracks = []\n\n route.paths.each do |path|\n a = path.a\n b = path.b\n\n tracks << [path.hex, a.num, path.lanes[0][1]] if a.edge?\n tracks << [path.hex, b.num, path.lanes[1][1]] if b.edge?\n\n # check track between edges and towns not in center\n # (essentially, that town needs to act like an edge for this purpose)\n if b.edge? && a.town? && (nedge = a.tile.preferred_city_town_edges[a]) && nedge != b.num\n tracks << [path.hex, a, path.lanes[0][1]]\n end\n if a.edge? && b.town? && (nedge = b.tile.preferred_city_town_edges[b]) && nedge != a.num\n tracks << [path.hex, b, path.lanes[1][1]]\n end\n end\n\n tracks.group_by(&:itself).each do |k, v|\n raise GameError, \"Route cannot reuse track on #{k[0].id}\" if v.size > 1\n end\n end",
"title": ""
},
{
"docid": "481b10019a76c8df7db80bedbdbb8048",
"score": "0.46165237",
"text": "def passable?(x,y)\n \t@tiles[x / @tile_size][y / @tile_size]==Objects::PassableTop ||\n \t@tiles[x / @tile_size][y / @tile_size]==Objects::PassableTopLeft ||\n \t@tiles[x / @tile_size][y / @tile_size]==Objects::PassableTopRight ||\n @tiles[x / @tile_size][y / @tile_size]==Objects::PassableCaged ||\n @tiles[x / @tile_size][y / @tile_size]==Objects::PassableSingle ||\n \t@tiles[x / @tile_size][y / @tile_size]==Objects::IndoorPedestial\n end",
"title": ""
},
{
"docid": "a0a237bac1e60d9566ec37592a0e4948",
"score": "0.46154875",
"text": "def autotile_edge(autotile, x, y, z)\n\t\treturn autotile != (tile_id(x, y, z) - 2048) / 48\n\tend",
"title": ""
},
{
"docid": "51e3de09a1551495014b53cccebc77d1",
"score": "0.46039695",
"text": "def potential_tiles(entity, hex)\n return [] unless (tile_ability = abilities(entity))\n\n candidates = super\n candidates << @game.osterath_tile if hex.name == 'E8' && entity == @game.konzession_essen_osterath\n return candidates if candidates.empty? || tile_ability.owner != @game.seilzuganlage\n\n potentials = @game.all_potential_upgrades(hex.tile).map(&:name)\n candidates.select { |t| @game.upgrades_to?(hex.tile, t) && potentials.include?(t.name) }\n end",
"title": ""
},
{
"docid": "a41d6899613d69c6b6fa7ec09dcf4841",
"score": "0.46039593",
"text": "def visit_first_pntr(node, worklist=nil)\n node.paths\n end",
"title": ""
},
{
"docid": "dee1dd9a164e4036897a4ccfe1b33cbd",
"score": "0.4603216",
"text": "def lattice_paths(start, end)\n\n\n\n\nend",
"title": ""
},
{
"docid": "b81e7f93ae690ceb360cc5f289f80511",
"score": "0.46015576",
"text": "def check_neighbour(tms, level)\n path = Mapping::GlobalMercator.tms_to_quad_tree_tile_code(tms[:x], tms[:y], tms[:zoom])\n node = Map::Node.find_by_path(path)\n if node.blank?\n node = Map::Node.find_by_path(path[0, path.length-1])\n end\n if node.blank?\n puts \"ERROR: did not find a node for #{ path } and #{ path[0, path.length-1] }.\"\n []\n elsif node.level < level\n unless node.leaf\n puts \"ERROR: this node was expected to be a leaf node!\"\n return []\n end\n [node]\n else\n []\n end\nend",
"title": ""
},
{
"docid": "7f9184763275bcab82a791c10f9ad12f",
"score": "0.45899376",
"text": "def get_tile_url\r\n end",
"title": ""
},
{
"docid": "e0a3a356018af3337f5f45b2c0ef178f",
"score": "0.4588323",
"text": "def open_path_to_destination\n if path = path_to_destination\n path.each { |cell| return false if occupied?(cell) }\n end\n end",
"title": ""
},
{
"docid": "0c54fa4dae76a5c65671c51b36c59728",
"score": "0.45826185",
"text": "def get_redundant_resistors\n\n # Make a copy of the shortest path array\n path = @shortest_path.dup \n\n # Make a copy of the hash\n circuit = @circuit.dup\n\n # remove the shortest path nodes from the tree\n # along with its back reference\n while (node = path.pop) # set and check for nil\n circuit[path[-1]].delete node if path[-1]\n circuit[node].delete path[-1] if path[-1]\n end\n\n # Actual pretty printing!\n circuit.each_pair do |key, value|\n # remove the back-references\n value.keys.each { |k| circuit[k].delete(key) if circuit.has_key?(k) }\n value.each_pair do |node, resistance|\n @redundant_resistors << [ key, node, resistance ]\n end\n end\n end",
"title": ""
},
{
"docid": "cbe4ec9ba7add5f1a7cf8e6c25db900e",
"score": "0.45780113",
"text": "def discover start, exits, path = [], &on_route_found\n return if not start.allows_private_vehicles?\n return if path.include?(start) # avoid loops\n # check if start is the road segment we search for\n on_route_found[Route.new(path + [start])] if exits.include?(start)\n if start.is_a?(Connector)\n # you can only search on by going to the connected link\n discover(start.to_link, exits, path + [start], &on_route_found)\n else\n # start is a link and has zero or more outgoing connectors \n start.outgoing_connectors.each do |conn|\n discover(conn, exits, path + [start], &on_route_found)\n end\n end\n end",
"title": ""
},
{
"docid": "db7b945119f2845096c284ccb8d52682",
"score": "0.45774698",
"text": "def shortest_path(input, portals, portal_links, row, col, steps=0)\n # puts \"#{row}, #{col}: #{steps}\"\n\n v = input[row][col]\n input[row][col] = ' '\n # print_map(input)\n\n min_dist = adjacent_squares(input, row, col).map do |sq, r, c|\n if (other_side = portal_links[[r,c]])\n # puts \"portal! from #{[r,c]} to #{other_side}\"\n # this is a portal entry, teleport!\n shortest_path(input, portals, portal_links, other_side[0], other_side[1], steps + 2)\n elsif [r,c] == portals[\"ZZ\"].first\n puts \"found exit in #{steps + 1} steps\"\n steps + 1\n else\n shortest_path(input, portals, portal_links, r, c, steps + 1)\n end\n end.compact.min\n\n input[row][col] = v\n min_dist\nend",
"title": ""
},
{
"docid": "3391f391d24c00596493304303c21c04",
"score": "0.45763493",
"text": "def assemble(tiles, used, picture, row, col, size)\n # end recursion col or row is outside the grid\n return true if col == size || row == size\n\n tiles.each do |tile|\n id = tile.id\n next if used.include?(id)\n\n # set candidate\n used.add(id)\n\n # search for each combinations\n tile.combinations.each do |combi|\n picture[row][col] = combi\n\n # check left, if not needed it's a match (true by default)\n lfit = col > 0 ? combi.match_edge?(:l, picture[row][col - 1]) : true\n # check down, if not needed it's a match (true by default)\n ufit = row > 0 ? combi.match_edge?(:u, picture[row - 1][col]) : true\n\n # match\n if lfit && ufit then\n # compute next row and col\n nrow = ((size*row + col + 1) / size).floor\n ncol = ((col + 1) % size).floor\n # check if a subsolution exists\n return true if assemble(tiles, used, picture, nrow, ncol, size)\n end\n end\n\n # if not, remove the used candidate\n used.delete(id)\n end\n\n # if nothing is found, just return false\n false\nend",
"title": ""
},
{
"docid": "d876f215e885dd3ca27db6829ad4d6c3",
"score": "0.45750582",
"text": "def set_link_characteristics(path, value)\n topo = value[:topology]\n interface = path[-2]\n Topology[topo].build_links(interface)\n end",
"title": ""
},
{
"docid": "5d60688392824481f4250693b896f39e",
"score": "0.45739743",
"text": "def contains_cycle2 node\n hare = tortoise = node\n cycle = false\n until hare.next.nil? do\n hare = hare.next.next\n tortoise = tortoise.next\n if hare == tortoise\n cycle = true\n break\n end\n end\n cycle\nend",
"title": ""
},
{
"docid": "0f5d7a069e59aca50b1f1ecb3f93b569",
"score": "0.45714203",
"text": "def find_hit_ship_tiles(tile, directions)\n tiles = [tile]\n directions.each do |dir|\n t = tile\n while t = @board.get_neighbour(t, dir)\n if t.state == :hit\n tiles << t\n else\n break\n end\n end\n end\n tiles\n end",
"title": ""
},
{
"docid": "3089da30fc1e8c357305547aa9145a45",
"score": "0.45709905",
"text": "def uniqueness_nodes\r\n\t\tif Location.find(location1_id).equals?(Location.find(location2_id))\r\n\t\t errors.add(:base, \"An edge may not have the same start and end point\")\r\n\t\tend\r\n\t end",
"title": ""
}
] |
77cd68afc432558bfcc1543135e1c4a1 | GET /books GET /books.json | [
{
"docid": "b36eb7cf735edc58276235a34a64f516",
"score": "0.0",
"text": "def index\n @raw_query_param = params[:query]\n where_query = \"\n REPLACE(REPLACE(REPLACE(REPLACE(LOWER(books.title), 'č', 'c'), 'š', 's'), 'ž', 'z'), ' ', '') LIKE :query OR\n REPLACE(REPLACE(REPLACE(REPLACE(LOWER(authors.name), 'č', 'c'), 'š', 's'), 'ž', 'z'), ' ', '') LIKE :query OR\n REPLACE(REPLACE(REPLACE(REPLACE(LOWER(genres.name), 'č', 'c'), 'š', 's'), 'ž', 'z'), ' ', '') LIKE :query\n \"\n query_param = @raw_query_param.delete(' ').downcase.gsub('č', 'c').gsub('š', 's').gsub('ž', 'z') rescue ''\n\n if is_int? @raw_query_param\n where_query = where_query + \"OR books.internal_number = :raw_query\"\n end\n\n @books = Book.all\n .left_joins(:author, :genre)\n .where(\n where_query,\n {\n query: \"%#{query_param}%\",\n raw_query: @raw_query_param,\n }\n )\n .order(is_borrowed: :desc, title: :asc)\n\n @total_books_count = Book.all.count\n @borrowed_books_count = Book.all\n .where(is_borrowed: true)\n .count\n\n end",
"title": ""
}
] | [
{
"docid": "0dcef7df140be07467764e06d44a75c9",
"score": "0.7966849",
"text": "def index\n @books = get_books()\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @books }\n end\n end",
"title": ""
},
{
"docid": "60973656e5d53c2355cc3aaa79804fee",
"score": "0.7777254",
"text": "def index\n render json: @books, status: 200\n end",
"title": ""
},
{
"docid": "c4746dc91005a0d372416b076d43946f",
"score": "0.7684243",
"text": "def index\n @books = Book.all\n render json: @books\n end",
"title": ""
},
{
"docid": "4d76321d7f98df82813ba2a970ad84dd",
"score": "0.76810783",
"text": "def index\n @books = Book.all\n\n render json: @books\n end",
"title": ""
},
{
"docid": "cb4ed5eefdf1702a83001f8b236dabea",
"score": "0.7655723",
"text": "def show\n @books = Books.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @books }\n end\n end",
"title": ""
},
{
"docid": "43ace69b1ac0ba0b7022de4e1678bbaf",
"score": "0.7578786",
"text": "def index\n @books = Book.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @books }\n end\n end",
"title": ""
},
{
"docid": "43ace69b1ac0ba0b7022de4e1678bbaf",
"score": "0.7578786",
"text": "def index\n @books = Book.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @books }\n end\n end",
"title": ""
},
{
"docid": "43ace69b1ac0ba0b7022de4e1678bbaf",
"score": "0.7578786",
"text": "def index\n @books = Book.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @books }\n end\n end",
"title": ""
},
{
"docid": "ec8a6a39a665c3c0058cb986dea89ba0",
"score": "0.7503258",
"text": "def index\n render json: user_shelf.books\n end",
"title": ""
},
{
"docid": "c11298681f7cf213bcd7741df3ffbd12",
"score": "0.7446029",
"text": "def index\n @books = current_user.books\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @books }\n end\n end",
"title": ""
},
{
"docid": "98d1e0d1caba8f30ab7dbfa13fb23639",
"score": "0.74290556",
"text": "def get_book(book_id)\n self.http_get('/api/books/' + book_id)['book']\n end",
"title": ""
},
{
"docid": "81d60dd2c2fbb9ce3a2077389621438a",
"score": "0.7411101",
"text": "def index\n @books= Book.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @books }\n end\n end",
"title": ""
},
{
"docid": "4e178b40c1dcc1ef5fec101d9f7d0eda",
"score": "0.7388181",
"text": "def mybooks\n @mybooks = current_user.books\n @api = ENV['GOODREADS_KEY']\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @mybooks }\n end\n end",
"title": ""
},
{
"docid": "9542d20703ddf184e1ee152f0d078856",
"score": "0.7387447",
"text": "def index\n\t\t@title = \"Books\"\n\n\t\trespond_to do |format|\n\t\t\tformat.html {\n\n\t\t\t} \n\t\t\tformat.json {\n\t\t\t\t@books = Book.all\n\t\t\t}\n\t\t\t\n\t\tend\n\tend",
"title": ""
},
{
"docid": "9264c6d4d9233458b06fef3a820b9b80",
"score": "0.73867893",
"text": "def show\n @books = HTTParty.get \"https://www.googleapis.com/books/v1/volumes?q=#{CityPage.find(params[:id]).city}+expats&key=AIzaSyBi-ieqecE99YvszjWHBtq_eZORbhN-8HQ\"\n @books = JSON.parse @books.body\n p @books[\"items\"][0][\"accessInfo\"][\"webReaderLink\"]\n @books_all = [@books[\"items\"][0],\n @books[\"items\"][1],\n @books[\"items\"][2]\n ]\n\n end",
"title": ""
},
{
"docid": "8de874563ae84684a70f98ce82406027",
"score": "0.73494726",
"text": "def fetch_books\n\t\t@response ||= HTTParty.get('https://www.googleapis.com/books/v1/volumes?filter=free-ebooks&q=a')\n\t\n\t\t@books ||= if @response.success?\n\t\t\tJSON.parse(@response.body)['items']\n\t\telse\n\t\t\t[] \n\t\tend\n\tend",
"title": ""
},
{
"docid": "4931a53e839e152f6f302685a9f8bb64",
"score": "0.733731",
"text": "def book\n render :json => Book.find(params[:id]).to_json\n end",
"title": ""
},
{
"docid": "6fbeb5d969a27a3a4f8b940b4a708a66",
"score": "0.7318939",
"text": "def index\n @user = User.find(session[:userId])\n @books = @user.books\n puts \"Libros de #{@user.username} #{@user.id} #{@user.books}\"\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @books }\n end\n end",
"title": ""
},
{
"docid": "17b6fc22debd82176b715656f5a068a3",
"score": "0.7309",
"text": "def show\n render json: book\n end",
"title": ""
},
{
"docid": "9efcb81c275a4694251e006109fd65c8",
"score": "0.7280258",
"text": "def index\n render json: Book.all\n end",
"title": ""
},
{
"docid": "49abef20db0f0aecff520cfd28ebeac0",
"score": "0.7269589",
"text": "def index\n # @books = Book.all\n @books = Book.page(params[:page]).per(10)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @books, status: :ok }\n end\n end",
"title": ""
},
{
"docid": "7739a3019781e3c211f95fbb44941d4c",
"score": "0.7241448",
"text": "def show\n @author = Author.find(params[:id])\n @books = @author.books\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @author }\n end\n end",
"title": ""
},
{
"docid": "41f6b6c03821ea3e021464c68aa3a3d0",
"score": "0.723858",
"text": "def show\n render json: @book\n end",
"title": ""
},
{
"docid": "1b276a43a594c4c9abcdd87ac59948ee",
"score": "0.72362983",
"text": "def show\n @book = Book.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @book }\n end\n end",
"title": ""
},
{
"docid": "1b276a43a594c4c9abcdd87ac59948ee",
"score": "0.72362983",
"text": "def show\n @book = Book.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @book }\n end\n end",
"title": ""
},
{
"docid": "1b276a43a594c4c9abcdd87ac59948ee",
"score": "0.72362983",
"text": "def show\n @book = Book.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @book }\n end\n end",
"title": ""
},
{
"docid": "1b276a43a594c4c9abcdd87ac59948ee",
"score": "0.72362983",
"text": "def show\n @book = Book.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @book }\n end\n end",
"title": ""
},
{
"docid": "1b276a43a594c4c9abcdd87ac59948ee",
"score": "0.72362983",
"text": "def show\n @book = Book.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @book }\n end\n end",
"title": ""
},
{
"docid": "1b276a43a594c4c9abcdd87ac59948ee",
"score": "0.72362983",
"text": "def show\n @book = Book.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @book }\n end\n end",
"title": ""
},
{
"docid": "1b276a43a594c4c9abcdd87ac59948ee",
"score": "0.72362983",
"text": "def show\n @book = Book.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @book }\n end\n end",
"title": ""
},
{
"docid": "1b276a43a594c4c9abcdd87ac59948ee",
"score": "0.72362983",
"text": "def show\n @book = Book.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @book }\n end\n end",
"title": ""
},
{
"docid": "1b276a43a594c4c9abcdd87ac59948ee",
"score": "0.72362983",
"text": "def show\n @book = Book.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @book }\n end\n end",
"title": ""
},
{
"docid": "1b276a43a594c4c9abcdd87ac59948ee",
"score": "0.72362983",
"text": "def show\n @book = Book.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @book }\n end\n end",
"title": ""
},
{
"docid": "1b276a43a594c4c9abcdd87ac59948ee",
"score": "0.72362983",
"text": "def show\n @book = Book.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @book }\n end\n end",
"title": ""
},
{
"docid": "712e8bb3b34421835d881db56bcd551c",
"score": "0.723529",
"text": "def show\n @book = Book.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @book }\n end\n end",
"title": ""
},
{
"docid": "712e8bb3b34421835d881db56bcd551c",
"score": "0.723529",
"text": "def show\n @book = Book.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @book }\n end\n end",
"title": ""
},
{
"docid": "61bc3948ed991bb9dddd1d8035760c2d",
"score": "0.7222297",
"text": "def getbooksjson\n\n @customer = Customer.find(params[:id]) \n @order = @customer.order\n @orderitems = Orderitem.find_all_by_order_id(@order)\n @book = Book.find_all_by_id(@orderitems)\n\n render :json => @book \n\t\n end",
"title": ""
},
{
"docid": "b6363dc65eee6d7005fa955d75ba723e",
"score": "0.7214994",
"text": "def index\n respond_to do |format|\n format.html { redirect_to root_path }\n format.json { render :json => @books }\n end\n end",
"title": ""
},
{
"docid": "7e4343abaf36e23c9f20df39c8cef898",
"score": "0.72103167",
"text": "def index\n @biblebooks = Biblebook.all\n\n respond_to do |format|\n format.html\n format.json{ render json: @biblebooks, root: false}\n end\n end",
"title": ""
},
{
"docid": "4ed50a9dcfbae49fd9b418521674dff1",
"score": "0.7206895",
"text": "def show \n @book = Book.find_by(id: params[:id])\n render json: @book\n\n end",
"title": ""
},
{
"docid": "1568187e2ce23daaff3e3fa8b499f291",
"score": "0.7204579",
"text": "def show\n render json: @book\n end",
"title": ""
},
{
"docid": "85c36bca1e947cec7f3cb597d9f63496",
"score": "0.71880984",
"text": "def get_books\n books = self.http_get('/api/books')['books']\n books_list = Array.new\n books.each do |book|\n books_list << Book.new(self, book)\n end\n end",
"title": ""
},
{
"docid": "ccdf0a42f2ad912c8fa25f53850a28eb",
"score": "0.7157607",
"text": "def show\n @book = Book.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @book }\n end\n end",
"title": ""
},
{
"docid": "ccdf0a42f2ad912c8fa25f53850a28eb",
"score": "0.7157607",
"text": "def show\n @book = Book.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @book }\n end\n end",
"title": ""
},
{
"docid": "307b57007a4d5917dfea437c342fcef0",
"score": "0.71571827",
"text": "def show\n render json: Book.find(params[:id]), status: :ok\n end",
"title": ""
},
{
"docid": "5e2c42bea4167d9b50652ab6a4903b76",
"score": "0.71495414",
"text": "def fetch_books(search_term)\n\n response = RestClient.get(\"https://www.googleapis.com/books/v1/volumes?q=#{search_term}\")\n JSON.parse(response)\nend",
"title": ""
},
{
"docid": "8e9c025db33952d8be6211006934118f",
"score": "0.71030784",
"text": "def bookFind(search)\n \n url = \"https://www.googleapis.com/books/v1/volumes?q=#{search}&key=AIzaSyC9XbOjIglj8HSgR3jVwvK6q49Z9RnFfrU\"\n \n response = HTTParty.get(url)\n book_data = JSON.parse(response.body)\n \n # pp book_data[\"items\"][2] #pp is pretty print; to have ruby print out objects/structs in nice format\n \n # one_book = book_data[\"items\"][2][\"volumeInfo\"][\"title\"]\n # return one_book\n \n return book_data\n \nend",
"title": ""
},
{
"docid": "3391542ed346de25a0e82e22ae4e0eec",
"score": "0.7091306",
"text": "def show\n book = Book.find_by(id: params[:id])\n\n if book\n render json: book, status: 200\n else\n render json: {error: \"Book not found\"}\n end\n end",
"title": ""
},
{
"docid": "459f0e16747f137b042efb3944079c11",
"score": "0.7065111",
"text": "def index\n @books = Book.order(title: :desc)\n render json: @books\n end",
"title": ""
},
{
"docid": "d770acde7611b31db58ad18b48b10075",
"score": "0.7055948",
"text": "def show\n @user = User.find(params[:user_id])\n @book = @user.books.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @book }\n end\n end",
"title": ""
},
{
"docid": "cf2244fc39abad20d3735536d24f7f89",
"score": "0.70463026",
"text": "def show\n @books_on_loan = BooksOnLoan.find(params[:id])\n respond_to do |format|\n format.json { render json: @books_on_loan }\n end\n end",
"title": ""
},
{
"docid": "b700aa8755296049766480b9c640fd4a",
"score": "0.70401347",
"text": "def index\n @books = Book.limit(100).order(:id)\n render json: {status: 'SUCCESS', message: 'Loaded all books', data: @books}, status: :ok\n end",
"title": ""
},
{
"docid": "f016570ed38cc242c61b30bc2cf43f87",
"score": "0.7039942",
"text": "def index\n if params[:item_id]\n render json: Book.where(item_id: params[:item_id])\n elsif params[:user_id]\n render json: Book.where(user_id: params[:user_id])\n else\n render status: :not_found\n end\n end",
"title": ""
},
{
"docid": "aab5f7faaf84eb03755f409de455fbf9",
"score": "0.70312023",
"text": "def show\n @booksale = Booksale.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @booksale }\n end\n end",
"title": ""
},
{
"docid": "759c3fb8cc6a0544a13a29c634c88c34",
"score": "0.69824594",
"text": "def show\n book = Book.includes(:library, :categories).find(params[:id])\n render json: book, library: true, categories: true, status: :ok\n end",
"title": ""
},
{
"docid": "978666d328e0e92c0c77f51eb842a895",
"score": "0.69821507",
"text": "def show\n @books_category = BooksCategory.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @books_category }\n end\n end",
"title": ""
},
{
"docid": "2caf474f4b0090f4a1e0ebec59d67cb5",
"score": "0.69802386",
"text": "def show\n get_book(params[:id])\n puts @book.to_json\n if @book\n @chapters = @book.chapters.sort!{|a, b| a.number <=> b.number}\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @book }\n end\n else\n redirect_to \"/\"\n end\n end",
"title": ""
},
{
"docid": "533668087d0e5ffdcc784932f375adb6",
"score": "0.69754267",
"text": "def new\n @books = Books.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @books }\n end\n end",
"title": ""
},
{
"docid": "671444328a2292f9b521f4bdd9346f1a",
"score": "0.6947331",
"text": "def show\n @book_list = BookList.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @book_list }\n end\n end",
"title": ""
},
{
"docid": "34c6d0b6f32772ea8ae3e1ed3ffda201",
"score": "0.6943237",
"text": "def get_data_from_books_api\n input = get_user_input\n url_to_fetch = URL + input\n RestClient.get(url_to_fetch).body\nend",
"title": ""
},
{
"docid": "cc2cf0acfde04d18ec085343c976854d",
"score": "0.6933418",
"text": "def index\n @books = Book.all\n respond_with(@books)\n end",
"title": ""
},
{
"docid": "ae11cce5c30a779517b6c6396f1e7de0",
"score": "0.6930202",
"text": "def index\n @lendbooks = Lendbook.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @lendbooks }\n end\n end",
"title": ""
},
{
"docid": "7512ecbf2c2e364c46dfb30c16b5b845",
"score": "0.69259703",
"text": "def show\n @mybook = Mybook.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @mybook }\n end\n end",
"title": ""
},
{
"docid": "37a49fb6535493306a078a4a6f8e15d4",
"score": "0.6914224",
"text": "def index\n # raise Book.search(params[:q])\n respond_to do |format|\n format.html{@books = Book.ordering.page(params[:page])}\n format.json{\n @books = Book.search(params[:q])\n }\n end\n end",
"title": ""
},
{
"docid": "f0d0d08d553063dae3921ca510b8f0fc",
"score": "0.6913647",
"text": "def search\n puts request.headers[\"Author\"]\n author_string = request.headers[\"Author\"]\n title_string = request.headers[\"Title\"]\n user = User.find(params[:user_id])\n render json: user.search_books(author_string, title_string)\n end",
"title": ""
},
{
"docid": "106ca7e327779f57223363d4da839956",
"score": "0.68813205",
"text": "def get_books(response)\n response[\"items\"]\nend",
"title": ""
},
{
"docid": "d4d00a84e68cd58c3b624d24af478925",
"score": "0.6873788",
"text": "def index\n @api_books = Api::Book.all.page(params[:page]).per(100)\n end",
"title": ""
},
{
"docid": "1bee19e84bfccf315efb40ebd7e8c515",
"score": "0.68631816",
"text": "def show\n @authorbook = Authorbook.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @authorbook }\n end\n end",
"title": ""
},
{
"docid": "184d31b9ff22775cb13a35515259ee7d",
"score": "0.68613195",
"text": "def find\n # @book = Book.first\n @book = Book.search(params[:title])\n respond_to do |format|\n format.json do\n render json: @book.to_json\n end\n end\n end",
"title": ""
},
{
"docid": "7628d9194145888458094057861970c3",
"score": "0.6847232",
"text": "def show\n render json: @book, status: :ok\n end",
"title": ""
},
{
"docid": "1c0b5c1bbd5cfa2ad962e313fc69dcd2",
"score": "0.6824821",
"text": "def show\n booking = Book.find(params[:id])\n render json: booking\n end",
"title": ""
},
{
"docid": "7106d2d46fce8463a82f3cbd9557d8e9",
"score": "0.68217194",
"text": "def show\n @book_detail = BookDetail.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @book_detail }\n end\n end",
"title": ""
},
{
"docid": "f5bc957652ce83aa0291013279c1adf7",
"score": "0.6812384",
"text": "def show\n author = @book.author\n logger.debug \"著者は#{author}です。googleBookApiを呼び出します。\"\n uri = URI.parse URI.encode \"https://www.googleapis.com/books/v1/volumes?q=#{author}\"\n json = Net::HTTP.get(uri)\n rst = JSON.parse(json)\n @abooks = []\n rst[\"items\"].each {|item|\n info = item[\"volumeInfo\"]\n sale = item[\"saleInfo\"]\n if info[\"language\"] != \"ja\" then\n logger.debug \"日本語以外の書籍のためスキップします。\\n\"\n next\n end\n title = nilCheck(info[\"title\"])\n desc = nilCheck(info[\"description\"])\n pub = nilCheck(info[\"publisher\"])\n date = nilCheck(info[\"publishedDate\"])\n page = nilCheck(info[\"pageCount\"])\n image = nilCheck(info[\"imageLinks\"], \"thumbnail\")\n price = nilCheck(sale[\"retailPrice\"], \"amount\")\n price = price == \"none\" ? price : price.to_i\n @abooks.push({\"title\" => title, \"desc\" => desc, \"pub\" => pub, \"page\" => page, \"image\" => image, \"price\" => price, \"date\" => date })\n logger.debug \"title:#{title}_____desc:#{desc}_____pub:#{pub}_____date:#{date}_____page:#{page}_____image:#{image}_____price:#{price}\\n\"\n }\n end",
"title": ""
},
{
"docid": "0b48bda78f0f7a72758bdae8b375a94e",
"score": "0.6808326",
"text": "def new\n @book = Book.new\n @genres = Genre.all\n @authors = Author.all\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @book }\n end\n end",
"title": ""
},
{
"docid": "1cf7ee6d1060b494988c84b2b11ef5bb",
"score": "0.6799435",
"text": "def index\n @books = Book.order('id desc')\n if request.xhr?\n @books = Book.where(\"name like ?\",\"%#{params[:term]}%\")\n end\n respond_to do |format|\n format.html # index.html.erb\n unless request.xhr?\n format.json { render json: @books }\n else\n format.json { render json: @books.map{|d| Hash[id: d.id,name: d.name]} }\n end\n\n end\n end",
"title": ""
},
{
"docid": "97a8c7946acf51c29620090c95a76faa",
"score": "0.6785201",
"text": "def show\n @book_url = BookUrl.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @book_url }\n end\n end",
"title": ""
},
{
"docid": "f02a2114c2075c4044fa3fe43e495609",
"score": "0.67843103",
"text": "def show\n @book = Book.find(params[:id])\n @comments = @book.comments;\n @users = @book.users;\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @book }\n end\n end",
"title": ""
},
{
"docid": "d96e65789df2ec27a6610ba0eb68fd21",
"score": "0.6774295",
"text": "def index\n #Pagination\n #books= Book.all\n books= Book.limit(limit).offset(params[:offset])\n #Representer to format the response\n render json: BooksRepresenter.new(books).as_json\n #render json: Book.all\n end",
"title": ""
},
{
"docid": "d338f5c93273ddc785da05c6bbe40c2b",
"score": "0.67727506",
"text": "def show\n\t\t@book_id = params[:id]\n\t\t@book = Book.find_by(id: @book_id)\n\t\t@author_id = @book.author_id\n\t\t@chapter_of_book_count = Chapter.where(book_id: @book_id).count\n\t\t@chapter_list = Chapter.where(book_id: @book_id)\n\t\t@author_detail = Author.find_by(id: @author_id)\n\t\trender json: {chapter_count: @chapter_of_book_count, book: @book, author: @author_detail, chapterlist:@chapter_list}\n\tend",
"title": ""
},
{
"docid": "5bd9147fed35c5a96eae4be7fd7f0e93",
"score": "0.67707795",
"text": "def show\n @book_collection = BookCollection.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @book_collection }\n end\n end",
"title": ""
},
{
"docid": "efccd61a874d3bfc9fc076bca86a6d75",
"score": "0.6756332",
"text": "def index\n #for searching\n # @existed_books = Book.all\n # @existed_books = Book.paginate(:page => params[:page], :per_page => 20, :order => 'updated_at DESC')\n @existed_books = Book.available.paginate(:page => params[:page], :per_page => 20, :order => 'updated_at DESC')\n\n # for creating\n @book = Book.new\n #respond_to do |format|\n #format.html # index.html.erb\n #format.json { render json: @books }\n #end\n end",
"title": ""
},
{
"docid": "5f293436220df5b22459969d416c45ef",
"score": "0.6749675",
"text": "def book_info\n isbn_info = OpenLibraryService.new.book_info(params['isbn'])\n return record_not_found unless isbn_info\n render(json: isbn_info)\n end",
"title": ""
},
{
"docid": "7feb7e2bc1e9aadb79732ea0586a7641",
"score": "0.67470366",
"text": "def index\n @structures = Structure.find_all_by_book_id(params[:book_id])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @structures }\n end\n end",
"title": ""
},
{
"docid": "56f9b79247976458f8fac09444328044",
"score": "0.67247355",
"text": "def index\n author_id = params[:author_id]\n # If not coming from /authors/:author_id/books\n if author_id.nil?\n @books = Book.all\n else\n @author = Author.find_by(id: author_id)\n if @author\n @books = @author.books\n # We couldn't find the given author_id in the database\n else\n head :not_found\n end\n end\n end",
"title": ""
},
{
"docid": "bda8d824b6a74d4f02bb7e8744317e51",
"score": "0.67237616",
"text": "def show\n @item = Book.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @item }\n end\n end",
"title": ""
},
{
"docid": "d1fd32b0d2642c306cd77314c993580b",
"score": "0.6719138",
"text": "def index\n \t#find just the books that is saved in user preferences\n @books = current_user.books.all\n\t\trespond_with(@books)\n end",
"title": ""
},
{
"docid": "07ae3a92c6ed4b59919f668b973c3710",
"score": "0.67189085",
"text": "def get_book_info\n result = Searcher.new(params[:q]).get_search_data\n\n render json: {\n err: nil,\n params: params,\n total_result: result.entries.count,\n result: result.entries\n }\n end",
"title": ""
},
{
"docid": "d14fa4eae427f784183a3029b422d59c",
"score": "0.671532",
"text": "def bible_books_helper\n res = {}\n req = Net::HTTP.get_response(URI.parse('https://getbible.net/index.php?option=com_getbible&task=bible.books&format=json&v=kjv'))\n JSON.parse(req.body[1...-2]).map{|book|\n req2 = Net::HTTP.get_response(URI.parse(\"https://getbible.net/index.php?option=com_getbible&task=bible.chapter&format=json&v=asv&nr=#{book['book_nr']}\"))\n book['chapters'] = JSON.parse(req2.body[1...-2]).count\n res[book['ref']] = book\n }\n res\n end",
"title": ""
},
{
"docid": "05c2bfef13aa0e26b0dc385d7920a277",
"score": "0.6714537",
"text": "def index\n # @books = Book.all\n @books = Book.paginate(:page => params[:page], :per_page=>10)\n\n respond_to do |format|\n format.html # index.html.erb\n # format.json { render :json => @books}\n format.json { render :json => BooksDatatable.new(view_context)}\n end\n end",
"title": ""
},
{
"docid": "f0227ebec0cefd5978ac6520f7c2cf9b",
"score": "0.6713483",
"text": "def books(query = {})\n run(:get, \"consulta/biblioteca/#{query_to_url(query)}\")\n end",
"title": ""
},
{
"docid": "e1627f80d2ee886530429197f11f13d5",
"score": "0.67066556",
"text": "def load_content_book\n @book = Book.find(params[:id])\n respond_to do |format|\n if @book != nil\n format.json { render json: @book, status: :ok, location: @book }\n else\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "62b427d956ec79a4cdb85ed6ef053675",
"score": "0.67041445",
"text": "def show\n @book = Book.find(params[:id])\n @purchases = @book.purchases\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @book }\n end\n end",
"title": ""
},
{
"docid": "bc050a97b239aa5d896fa75996a41a99",
"score": "0.67033416",
"text": "def index\n #render json: Book.all\n @books= Book.all\n options = { include: [:user] }\n render json: BookSerializer.new(@books, options).serializable_hash\n end",
"title": ""
},
{
"docid": "7e9c2518444f619f39e56a5c621968f6",
"score": "0.6702875",
"text": "def index\n if params[:book_id].blank? && params[:id].blank?\n @sections = Section.all\n else\n book_id = params[:id] ? params[:id] : params[:book_id]\n @sections = Section.find_all_by_book_id(book_id)\n @book = Book.find(book_id)\n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @sections }\n end\n end",
"title": ""
},
{
"docid": "13ed715e95051e27416cdc62db5686e4",
"score": "0.6699363",
"text": "def show\n @user = User.find(session[:userId])\n @book = Book.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @book }\n end\n end",
"title": ""
},
{
"docid": "981893f7072c68778f286292b965578c",
"score": "0.6698481",
"text": "def show\n @book_det = BookDet.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @book_det }\n end\n end",
"title": ""
},
{
"docid": "53cf38bcbda0e43094db78cc27a3107b",
"score": "0.6693739",
"text": "def show\n @bank_book = BankBook.get(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @bank_book }\n end\n end",
"title": ""
},
{
"docid": "99e79defb86fb64eb757482a6033121c",
"score": "0.6689674",
"text": "def show\n @user_books = @user.books.page params[:page]\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @user }\n end\n end",
"title": ""
},
{
"docid": "6be7351024804ee32ce4e48ec6273282",
"score": "0.6683575",
"text": "def book(id)\n Hashie::Mash.new(request(\"/book/show\", id: id)[\"book\"])\n end",
"title": ""
},
{
"docid": "ff6b2aca01e3bbc4c039e861fb458403",
"score": "0.6683213",
"text": "def index\n if params[:book_id]\n @book_suggestions = find_book.book_suggestions\n render json: @book_suggestions\n else\n @book_suggestions = BookSuggestion.all\n render json: @book_suggestions\n end\n end",
"title": ""
},
{
"docid": "19de4c93a8161e517d64d647ca4cc09b",
"score": "0.66717136",
"text": "def search_specifc_book(id_book,book_title,book_id,book_publishDate)\n @response = self.class.get(\"/Books/#{id_book}\",\n :headers => {\"Content-Type\": 'application/json; charset=utf-8; v=1.0', \"path\": \"#{$id_book}\"}) \n $book_title = @response[\"title\"]\n $book_id = @response[\"id\"]\n end",
"title": ""
}
] |
d062a42f9a9ab80f61c9b105a562fbf7 | DELETE /spring_letters/1 DELETE /spring_letters/1.json | [
{
"docid": "c5fd29d27354c11e4cf31bb6a256403b",
"score": "0.7346637",
"text": "def destroy\n @spring_letter.destroy\n respond_to do |format|\n format.html { redirect_to admin_spring_letters_url, notice: 'Spring letter was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
}
] | [
{
"docid": "46e14a7ccd23f3409079e015a359397f",
"score": "0.72909635",
"text": "def destroy\n @letter.destroy\n respond_to do |format|\n format.html { redirect_to root_path }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "82f414bbc9a50899b62de333c0561187",
"score": "0.724189",
"text": "def destroy\n @subletter.destroy\n respond_to do |format|\n format.html { redirect_to subletters_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "6e2b501b2652947ac1f3cc43818f10bb",
"score": "0.72146255",
"text": "def destroy\n @letter.destroy\n respond_to do |format|\n format.html { redirect_to letters_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "6e2b501b2652947ac1f3cc43818f10bb",
"score": "0.72146255",
"text": "def destroy\n @letter.destroy\n respond_to do |format|\n format.html { redirect_to letters_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "6e2b501b2652947ac1f3cc43818f10bb",
"score": "0.72146255",
"text": "def destroy\n @letter.destroy\n respond_to do |format|\n format.html { redirect_to letters_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "6e2b501b2652947ac1f3cc43818f10bb",
"score": "0.72146255",
"text": "def destroy\n @letter.destroy\n respond_to do |format|\n format.html { redirect_to letters_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "6e2b501b2652947ac1f3cc43818f10bb",
"score": "0.72146255",
"text": "def destroy\n @letter.destroy\n respond_to do |format|\n format.html { redirect_to letters_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "6e2b501b2652947ac1f3cc43818f10bb",
"score": "0.72146255",
"text": "def destroy\n @letter.destroy\n respond_to do |format|\n format.html { redirect_to letters_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "d151efa13f594ba83afb9f6217663f8e",
"score": "0.712317",
"text": "def destroy\n @letter = Letter.find(params[:id])\n @letter.destroy\n\n respond_to do |format|\n format.html { redirect_to letters_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "068b186395daa5032d584370f9870344",
"score": "0.7037917",
"text": "def destroy\n @letter = current_user.letters.find(params[:id])\n @letter.destroy\n\n respond_to do |format|\n format.html { redirect_to letters_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "7c0f811171ee500a0bba4b07e6287169",
"score": "0.6989485",
"text": "def destroy\n @letter.destroy\n respond_to do |format|\n format.html { redirect_to letters_url, notice: 'Letter was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "7c0f811171ee500a0bba4b07e6287169",
"score": "0.6989485",
"text": "def destroy\n @letter.destroy\n respond_to do |format|\n format.html { redirect_to letters_url, notice: 'Letter was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "7c0f811171ee500a0bba4b07e6287169",
"score": "0.6989485",
"text": "def destroy\n @letter.destroy\n respond_to do |format|\n format.html { redirect_to letters_url, notice: 'Letter was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1cb9a400a049a13a1cc0da3d5c20c8bb",
"score": "0.6917638",
"text": "def destroy\n @admin_letter.destroy\n respond_to do |format|\n format.html { redirect_to admin_letters_url, notice: 'Letter was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "b1a17c1ee1af05c79fe156622df44818",
"score": "0.69102526",
"text": "def delete(path)\n begin\n response = client[path].delete :accept => 'application/json'\n rescue Exception => e\n puts e.inspect\n end\n end",
"title": ""
},
{
"docid": "704198957a1d2e6e7f664b8e523db683",
"score": "0.6782502",
"text": "def destroy\n @first_letter = FirstLetter.find(params[:id])\n @first_letter.destroy\n\n respond_to do |format|\n format.html { redirect_to(\"/clients/#{@first_letter.client_id}/first_letters\") }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "d734d3f7fa5e2b6985a0297439e0a1d6",
"score": "0.6720437",
"text": "def destroy\n @esod_internal_letter.destroy\n respond_to do |format|\n format.html { redirect_to esod_internal_letters_url, notice: 'Internal letter was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "2e75a5a35b98aaa0f9d2c64839587114",
"score": "0.67149645",
"text": "def delete\n render json: Text.delete(params[\"id\"])\n end",
"title": ""
},
{
"docid": "c8038aa73e6a770368ddc72d550f133f",
"score": "0.67075866",
"text": "def test_delete\n delete :delete, params: { alpha2: 'za' }, **{ format: 'json' }\n\n assert_response 200\n assert_equal(countries.first.name, 'South Africa', 'Not working.')\n assert_equal(countries.first.active, false, 'Not working.')\n end",
"title": ""
},
{
"docid": "7452c4d15daf08108aaa5a1b728adb31",
"score": "0.6705911",
"text": "def destroy\n @json.destroy\n\n head :no_content\n end",
"title": ""
},
{
"docid": "82879ea49ab4fdf087edbca44de8fea6",
"score": "0.6699017",
"text": "def destroy\n delword = Word.find_by_word(params[:id])\n delword.destroy\n\n respond_to do |format|\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "3f19c73fda8970036f75c30c857f0839",
"score": "0.66713357",
"text": "def destroy\n @jsonbeepdatum.destroy\n respond_to do |format|\n format.html { redirect_to jsonbeepdata_url, notice: 'Jsonbeepdatum was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "36e921d72e8e7d62e407ebe56e71d0b3",
"score": "0.6660572",
"text": "def destroy\n @sword.destroy\n respond_to do |format|\n format.html { redirect_to swords_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a8bcb16cba5aea1dba4b6062b1950cc2",
"score": "0.66300356",
"text": "def destroy\n @ng_word = NgWord.find(params[:id])\n @ng_word.destroy\n\n respond_to do |format|\n format.html { redirect_to @current_account }\n format.json { render json: @ng_word }\n end\n end",
"title": ""
},
{
"docid": "ec82ec167aeb9def9f79a034e648a6d5",
"score": "0.6617163",
"text": "def destroy\n \n @letterhead.destroy\n \n respond_to do |format|\n format.html { redirect_to cases_path }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "7290f0e6fbc8eb802f96850a60c2d19f",
"score": "0.66033065",
"text": "def destroy\n @snake = Snake.find(params[:id])\n @snake.destroy\n\n respond_to do |format|\n format.html { redirect_to snakes_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "b844c69e110f8d3e36fed312328a7127",
"score": "0.6588618",
"text": "def destroy\n @key_word.destroy\n respond_to do |format|\n format.html { redirect_to key_words_url, notice: 'Key word was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "b844c69e110f8d3e36fed312328a7127",
"score": "0.6588618",
"text": "def destroy\n @key_word.destroy\n respond_to do |format|\n format.html { redirect_to key_words_url, notice: 'Key word was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "da9dea2b7f2f1515416748e3b33bc995",
"score": "0.6567476",
"text": "def destroy\n p \"Character destroy route accessed\"\n set_character\n render json: @character.destroy()\n end",
"title": ""
},
{
"docid": "3ccd2fbecbaa95071b33c865c59c07fc",
"score": "0.65543395",
"text": "def delete(*args)\n RubyKong::Request::Api.delete args[0]\n end",
"title": ""
},
{
"docid": "75a785bddc2252b3dfe08070dcb44399",
"score": "0.6552324",
"text": "def delete(args)\n if args[:json]\n post(args.merge(method: :delete))\n else\n get(args.merge(method: :delete))\n end\n end",
"title": ""
},
{
"docid": "7ffa1ec8e2e3639257b10595aa7ad319",
"score": "0.6538802",
"text": "def destroy\n @letter_order = LetterOrder.find_by_uuid(params[:id])\n authorize! :destroy, @letter_order\n\n @letter_order.destroy\n\n respond_to do |format|\n format.html { redirect_to letter_orders_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "171d5204ba2b07b5bfbbee3421df28d0",
"score": "0.65265405",
"text": "def destroy\n @letter_grade.destroy\n respond_to do |format|\n format.html { redirect_to letter_grades_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "05edc7078e37dcb6428455a858bd77de",
"score": "0.65256256",
"text": "def destroy\n @legs1.destroy\n respond_to do |format|\n format.html { redirect_to legs1s_url, notice: 'Legs1 was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "174b723f9e43bfa7501a9cdc389e4c1b",
"score": "0.65245456",
"text": "def delete\n @response = self.class.delete(\"#{@server_uri}/resource_name/#{@opts[:id]}.json\")\n end",
"title": ""
},
{
"docid": "8f314271b6ddc87eeeea2ba210ec49d1",
"score": "0.6523006",
"text": "def delete\n render json: Person.delete(params[\"id\"])\n end",
"title": ""
},
{
"docid": "feb05fa712cede2232b7a79bf0cdeb56",
"score": "0.6520687",
"text": "def delete\n render json: Entry.delete(params[\"id\"])\n end",
"title": ""
},
{
"docid": "b445c184893647d3482f8fbc6a507a52",
"score": "0.6510455",
"text": "def delete(path, params = {})\n path += '.json'\n res = @connection.delete(path, @header)\n parse_response(res)\n end",
"title": ""
},
{
"docid": "efcdf74dfaaed1f537d8f30fc7cec450",
"score": "0.65053844",
"text": "def destroy\n @helloworld = Helloworld.find(params[:id])\n @helloworld.destroy\n\n respond_to do |format|\n format.html { redirect_to helloworlds_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "773e5d611adeb09776f9c841e1b876cc",
"score": "0.65013087",
"text": "def delete_json(path, params = {}, headers = {})\n json_request(:delete, path, params, headers)\n end",
"title": ""
},
{
"docid": "dfc4d1aac6899baf67939cdedcb33ca3",
"score": "0.65006214",
"text": "def destroy\n @auto_wash.destroy\n respond_to do |format|\n format.html { redirect_to auto_washes_url, notice: 'Auto wash was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "744140e6fa03223db9adbaf503802216",
"score": "0.6499053",
"text": "def destroy\n @gword.destroy\n respond_to do |format|\n format.html { redirect_to gwords_url, notice: 'Der Eintrag wurde erfolgreich gelöscht.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "9f32b6bff5d50b337bef96e91926b454",
"score": "0.6494692",
"text": "def destroy\n @key_word = KeyWord.find(params[:id])\n @key_word.destroy\n\n respond_to do |format|\n format.html { redirect_to key_words_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "5309e606deb5fdb2a690d8d3d7eda9b0",
"score": "0.6494491",
"text": "def destroy\n @agnieszka1 = Agnieszka1.find(params[:id])\n @agnieszka1.destroy\n\n respond_to do |format|\n format.html { redirect_to agnieszka1s_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "8cf47ae38c69c32a7dd60858897d27e5",
"score": "0.64849824",
"text": "def destroy\n @knife.destroy\n respond_to do |format|\n format.html { redirect_to knives_url, notice: \"Knife was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "82bb2141c0678aca5fe92aa892d2a70e",
"score": "0.64718616",
"text": "def destroy\n @behat = Behat.find(params[:id])\n @behat.destroy\n\n respond_to do |format|\n format.html { redirect_to behats_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "9497f8d4e7559d238ba41fcb78693ea6",
"score": "0.64695275",
"text": "def destroy\n @kebab.destroy\n respond_to do |format|\n format.html { redirect_to kebabs_url, notice: 'Kebab was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "45cd6098a26570ec213e4936d7258f36",
"score": "0.64651567",
"text": "def destroy\n @snake.destroy\n respond_to do |format|\n format.html { redirect_to snakes_url, notice: \"Snake was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "48e61125123243683b8f9c9cf56866f5",
"score": "0.6462236",
"text": "def destroy\n @admin_name_exercise.destroy\n respond_to do |format|\n format.html { redirect_to admin_name_exercises_url, notice: 'Name exercise was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1ada2c844030e62d6d50c7e8141d8b96",
"score": "0.6460871",
"text": "def destroy\n @word.destroy\n respond_to do |format|\n format.html { redirect_to words_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "d738fcb5e740234caff41e1079400d59",
"score": "0.6460089",
"text": "def destroy\n @legume.destroy\n respond_to do |format|\n format.html { redirect_to legumes_url, notice: 'Legume was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "7619bcf3671554e67f22405c295e4257",
"score": "0.64593816",
"text": "def destroy\n @ng_ruby.destroy\n respond_to do |format|\n format.html { redirect_to ng_rubies_url, notice: 'Ng ruby was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "0bf611eafc7dd74194215bcacb7614d0",
"score": "0.64545524",
"text": "def destroy\n @character_blueprint.destroy\n respond_to do |format|\n format.html { redirect_to character_blueprints_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "da14b262cf29514c5b386832ee843e26",
"score": "0.6452673",
"text": "def destroy\n @appendix.destroy\n respond_to do |format|\n format.html { redirect_to appendixes_url, notice: 'Appendix was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "545a430f8de36d8a85ac96c28e787f7d",
"score": "0.64514303",
"text": "def destroy\n @json_sample = JsonSample.find(params[:id])\n @json_sample.destroy\n\n respond_to do |format|\n format.html { redirect_to json_samples_url }\n format.json { render json: {msg: \"complete\", status: \"OK\"} }\n end\n end",
"title": ""
},
{
"docid": "fdfa5f023a5b91de7150a7231284ceb6",
"score": "0.64497614",
"text": "def delete(name)\n validate_path_elements(name)\n\n client.request(\n method: :delete,\n path: name,\n expected: 204\n )\n end",
"title": ""
},
{
"docid": "0f288f9d0effd35a94a7b70277356fc8",
"score": "0.6447296",
"text": "def destroy\n @testjson.destroy\n respond_to do |format|\n format.html { redirect_to testjsons_url, notice: 'Testjson was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "0f97d9d22be8d3bcc1043c07f4d4cd38",
"score": "0.64430994",
"text": "def destroy\n @sims_employee_word.destroy\n respond_to do |format|\n format.html { redirect_to sims_employee_words_url, notice: t('flash.notice.destroied.') }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "58304a4987caf6d8d918944890fdf6b4",
"score": "0.6439966",
"text": "def destroy\n @client_bed.destroy\n respond_to do |format|\n format.html { redirect_to client_beds_url, notice: 'Client bed was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a4d8f604211ac7843be2f850cb367611",
"score": "0.6437811",
"text": "def destroy\n @sentence = Sentence.find(params[:id])\n @sentence.destroy\n\n respond_to do |format|\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "d7aeb970c017594e57ecd968c83abaa0",
"score": "0.6434145",
"text": "def destroy\n @word.destroy\n respond_to do |format|\n format.html { redirect_to words_url, notice: 'Palavra foi excluida com sucesso.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "9410f5d5c06a5d4acee3b61e4f080658",
"score": "0.64323384",
"text": "def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end",
"title": ""
},
{
"docid": "9410f5d5c06a5d4acee3b61e4f080658",
"score": "0.64323384",
"text": "def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end",
"title": ""
},
{
"docid": "9410f5d5c06a5d4acee3b61e4f080658",
"score": "0.64323384",
"text": "def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end",
"title": ""
},
{
"docid": "308c171f9099f537d67a780aca8ffdec",
"score": "0.6430872",
"text": "def destroy\n @keg.destroy\n respond_to do |format|\n format.html { redirect_to kegs_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "419097c1c4a142adaf725a2112822e8e",
"score": "0.64226145",
"text": "def delete\n request_method('DELETE')\n end",
"title": ""
},
{
"docid": "51b8fa7103ecf9672d76a31c77e7adb4",
"score": "0.6418404",
"text": "def destroy\n @edict.destroy\n respond_to do |format|\n format.html { redirect_to edicts_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "9c8ef0b4313fef9d26c4290371bc530d",
"score": "0.6416671",
"text": "def delete!\n client.delete(:path => base_path)\n nil\n end",
"title": ""
},
{
"docid": "d5aa9fc7dc0504dab5685583fe8b88b8",
"score": "0.6408526",
"text": "def destroy\n @monkey.destroy\n respond_to do |format|\n format.html { redirect_to monkeys_url, notice: 'Monkey was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "904adf76e5af414b1af1a75bf18e0bee",
"score": "0.6407465",
"text": "def destroy\n @legshome1.destroy\n respond_to do |format|\n format.html { redirect_to legshome1s_url, notice: 'Legshome1 was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "90480c2354286de44e977ededc4a05c8",
"score": "0.64072084",
"text": "def destroy\n @word.destroy\n respond_to do |format|\n format.html { redirect_to words_url, notice: 'Tłumaczenie zostało usunięte.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "5b22920d931949e6c08fc758420043b8",
"score": "0.6406617",
"text": "def destroy\n @dust_bath.destroy\n respond_to do |format|\n format.html { redirect_to dust_baths_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "35aa89b649455365a39a7cbd6f3a23c9",
"score": "0.6404974",
"text": "def destroy\n @clientes1.destroy\n respond_to do |format|\n format.html { redirect_to clientes1s_url, notice: 'Clientes1 was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "82111d5c0ee1149d096dc5ef3c10873e",
"score": "0.6404544",
"text": "def destroy\n @knjige.destroy\n respond_to do |format|\n format.html { redirect_to knjiges_url, notice: 'Knjige was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "af2b7ebb7708a928dce03f5d316211e6",
"score": "0.6400288",
"text": "def destroy\n @ak542.destroy\n respond_to do |format|\n format.html { redirect_to ak542s_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "33ae3fbaabb68170de9f95477c22d5d1",
"score": "0.6397179",
"text": "def delete_json(path)\n retries = 0\n begin\n return resource(path).delete()\n rescue => e\n if e.kind_of?(RestClient::Exception) and e.http_code == 503 and retries < RETRY_503_MAX\n # the G5K REST API sometimes fail with error 503. In that case we should just wait and retry\n puts(\"G5KRest: DELETE #{path} failed with error 503, retrying after #{RETRY_503_SLEEP} seconds\")\n retries += 1\n sleep RETRY_503_SLEEP\n retry\n end\n handle_exception(e)\n end\n end",
"title": ""
},
{
"docid": "802d5f9933df88b5892bbe45c484b91c",
"score": "0.6396329",
"text": "def destroy\n @kela.destroy\n respond_to do |format|\n format.html { redirect_to kelas_url, notice: 'Kela was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "37d3418e8c2d2639f043950f56df5b3a",
"score": "0.6394838",
"text": "def destroy\n @angular.destroy\n respond_to do |format|\n format.html { redirect_to angulars_url, notice: 'Angular was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "fbd9f4cb2f208e81864344425fa699d4",
"score": "0.6393943",
"text": "def destroy\n @singlegame.destroy\n respond_to do |format|\n format.html { redirect_to singlegames_url, notice: 'Singlegame was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "dc8069c58110a97b29e9f10f89666c2e",
"score": "0.63927835",
"text": "def destroy\n @try1.destroy\n respond_to do |format|\n format.html { redirect_to try1s_url, notice: 'Try1 was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "9a87cd14d005675cad5aa5b84737cef0",
"score": "0.6387393",
"text": "def destroy\n @lsa_word = LsaWord.find(params[:id])\n @lsa_word.destroy\n\n respond_to do |format|\n format.html { redirect_to lsa_words_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "09839ae34313f956ebaa756a169a5176",
"score": "0.6384166",
"text": "def destroy\n @chapstick.destroy\n respond_to do |format|\n format.html { redirect_to chapsticks_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "20c3cf09f0d9cfa31a26f11e34c0895a",
"score": "0.6381697",
"text": "def destroy\n @berkela.destroy\n respond_to do |format|\n format.html { redirect_to berkelas_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "eca623012ecc5a2b668b2f8957715020",
"score": "0.63810194",
"text": "def destroy\n @text_replica.destroy\n respond_to do |format|\n format.html { redirect_to replicas_url, notice: 'TextReplica was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "5f5b6c6e05c9c2eb62b85555320e5697",
"score": "0.63782835",
"text": "def delete\n @recipe = Recipe.find(params[:id])\n @recipe.delete\n render :json => {\n message: \"recipe deleted\"\n }\n end",
"title": ""
},
{
"docid": "5dead364dc103aead1d20740c3917d0a",
"score": "0.6368674",
"text": "def destroy\n @gs1_master.destroy\n respond_to do |format|\n format.html { redirect_to gs1_masters_url, notice: DELETE_NOTICE }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "e2a991d26fb0b553e3edd62c989cc85d",
"score": "0.63677084",
"text": "def destroy\n @say = Say.find(params[:id])\n @say.destroy\n\n respond_to do |format|\n format.html { redirect_to says_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "f199891bb0f668355294c62d5ec380d5",
"score": "0.63676727",
"text": "def destroy\n @wordup = Wordup.find(params[:id])\n @wordup.destroy\n\n respond_to do |format|\n format.html { redirect_to wordups_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "88a6126ca6ca4ab7ba417a142b0a5fab",
"score": "0.63669914",
"text": "def destroy\n @invite_letter.destroy\n respond_to do |format|\n format.html { redirect_to invite_letters_url, notice: 'Invite letter was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "7292895b8a48e07466b377315d5c5ea5",
"score": "0.6365243",
"text": "def delete(e)\n url = \"https://#{@username}:#{@password}@#{@host}#{@docroot}#{e}\"\n return RestClient.delete(url)\n end",
"title": ""
},
{
"docid": "4da5aac2f431a94ee6df981624c501a0",
"score": "0.63648385",
"text": "def destroy\n @stake.destroy\n respond_to do |format|\n format.html { redirect_to stakes_url, notice: 'Stake was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "22d0d8ff40288660407ac7e71e17ee79",
"score": "0.636273",
"text": "def destroy\n @alpha_scaffold.destroy\n respond_to do |format|\n format.html { redirect_to alpha_scaffolds_url, notice: 'Alpha scaffold was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "266ff91b0c70838c2f07be7dce57dce5",
"score": "0.6360582",
"text": "def destroy\n @key = Keys.find(params[:id])\n @key.destroy\n\n respond_to do |format|\n format.html { redirect_to keys_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "2cdbe399173e14d37402e4b8a6b4e559",
"score": "0.6359955",
"text": "def destroy\n @jewel = Jewel.find(params[:id])\n @jewel.destroy\n\n respond_to do |format|\n format.html { redirect_to root_path }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1e8e4c12ac12829192fa5425880068a6",
"score": "0.63589877",
"text": "def destroy\n @jewelry = Jewelry.find(params[:id])\n @jewelry.destroy\n\n respond_to do |format|\n format.html { redirect_to jewelries_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "0387aa3c568d857184e97a214e580a14",
"score": "0.63580483",
"text": "def delete(path, params = {}, payload = {})\n JSON.parse Generic.delete(@base_url, @headers, path, params, payload)\n end",
"title": ""
},
{
"docid": "b34581749c56dc741abe7169e512df94",
"score": "0.63571596",
"text": "def destroy\n @word.destroy\n respond_to do |format|\n format.html { redirect_to admin_words_path, notice: 'Word was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "2d5574b83e687eed0d9770c9c5cbd05d",
"score": "0.63542783",
"text": "def destroy\n @gamblegame = Gamblegame.find(params[:id])\n @gamblegame.destroy\n\n respond_to do |format|\n format.html { redirect_to gamblegames_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "6a46a50ef4ae364d0efd96dc2ce2449e",
"score": "0.635296",
"text": "def destroy\n @word = Word.find(params[:id])\n @word.destroy\n\n respond_to do |format|\n format.html { redirect_to words_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "6a46a50ef4ae364d0efd96dc2ce2449e",
"score": "0.635296",
"text": "def destroy\n @word = Word.find(params[:id])\n @word.destroy\n\n respond_to do |format|\n format.html { redirect_to words_url }\n format.json { head :no_content }\n end\n end",
"title": ""
}
] |
a945eb4700ad1eb2984a9e598eb820d5 | Build the JSON response | [
{
"docid": "14d87e6db05f4eca8c33ade5f2ceb23e",
"score": "0.60626704",
"text": "def json_response(entry, status = 200)\n json = entry_submission.to_json(entry)\n render_response(json, status, 'application/json')\n end",
"title": ""
}
] | [
{
"docid": "3564da23cd25c49c23851e955e2a6a84",
"score": "0.76296294",
"text": "def build_response\n { status: :success, data: {} }\n end",
"title": ""
},
{
"docid": "37647cc0104b859dcb53b1256cb2781f",
"score": "0.71188194",
"text": "def build_response\n enrich_object(fawry_api_response)\n end",
"title": ""
},
{
"docid": "2a1e74f4ca516f589ec0df24e061ab36",
"score": "0.70998526",
"text": "def return_json_response\n response['Content-Type'] = 'application/json'\n @cbr_json_response = true\n end",
"title": ""
},
{
"docid": "255dcb6a7cf9045f27c33e77d41cbddd",
"score": "0.6926823",
"text": "def json_response(data = {})\n base = {\n 'api_version' => VERSION,\n 'auth' => 1,\n 'last_refreshed_on_time' => Feed.last_refreshed_at.to_i\n }\n\n content_type :json\n base.merge(data).to_json\n end",
"title": ""
},
{
"docid": "c1e0763040db9a564b2ca0989f825bcb",
"score": "0.6599565",
"text": "def response\n response_parts = []\n response_parts << '\"version\": \"1.1\"'\n response_parts << '\"id\": ' + @id.to_json if @id\n if @error\n response_parts << '\"error\": ' + {:name => 'JSONRPCError'}.merge(@error).to_json\n else\n response_parts << '\"result\": ' + @result.to_json\n end\n '{' + response_parts.join(', ') + \"}\\n\" \n end",
"title": ""
},
{
"docid": "0d47b933919ff81533361efa026de67d",
"score": "0.6516173",
"text": "def build_response(session_end = true)\n response_object = build_response_object(session_end)\n response = Hash.new\n response[:version] = @version\n response[:sessionAttributes] = @session_attributes unless @session_attributes.empty?\n response[:response] = response_object\n response.to_json\n end",
"title": ""
},
{
"docid": "0cf5547832e9f87c6c74ae51ca3b6ab4",
"score": "0.649884",
"text": "def build_jason\n if @content.is_a?(Array)\n @content[0] = build_header_and_text_hashs @content[0] unless @content[0].empty?\n @content[2] = build_header_and_text_hashs @content[2] unless @content[2].empty?\n content_hash = {}\n content_hash = content_hash.merge(@content[0]) unless @content[0] || @content[0].empty?\n content_hash = content_hash.merge(@content[1])\n content_hash = content_hash.merge(@content[2]) unless @content[2] || @content[2].empty?\n @content = content_hash\n else\n @content = build_header_and_text_hashs @content\n end\n back_hash = build_back_portion @content\n document_hash = build_front_portion.merge( @content ).merge( back_hash ); back_hash = {}\n @content = {\n \"id\" => sha,\n \"nodes\" => document_hash\n }\n end",
"title": ""
},
{
"docid": "df85ef95592e0f52ecee3258c458078a",
"score": "0.6457355",
"text": "def tojson\n\t\tend",
"title": ""
},
{
"docid": "3c64bfd3e129fd949a789e0d31060483",
"score": "0.6436084",
"text": "def build_response(connection, request); end",
"title": ""
},
{
"docid": "370fe5878ae2653f4eaac2a23363a78f",
"score": "0.6391287",
"text": "def assemble\n render json: assembled\n end",
"title": ""
},
{
"docid": "0cfc6a57faae3b2ea587e0c848efaaa8",
"score": "0.63440406",
"text": "def json_out(data)\n content_type 'application/json', :charset => 'utf-8'\n data.to_json + \"\\n\"\n end",
"title": ""
},
{
"docid": "0cfc6a57faae3b2ea587e0c848efaaa8",
"score": "0.63440406",
"text": "def json_out(data)\n content_type 'application/json', :charset => 'utf-8'\n data.to_json + \"\\n\"\n end",
"title": ""
},
{
"docid": "0cfc6a57faae3b2ea587e0c848efaaa8",
"score": "0.63440406",
"text": "def json_out(data)\n content_type 'application/json', :charset => 'utf-8'\n data.to_json + \"\\n\"\n end",
"title": ""
},
{
"docid": "a7e4c850e08fbc806008430d11b04961",
"score": "0.6342556",
"text": "def json\n {\"creation_date\" => @creation_date}\n end",
"title": ""
},
{
"docid": "e68f1e646d5b43a435a6b84e998aa3ca",
"score": "0.63407165",
"text": "def build_object\n response = make_request\n body = JSON.load(response.body) if response.body \n body = { response: body } if body.is_a? Array\n hash = body.to_snake_keys if body\n response_object = Hashie::Mash.new(hash)\n response_object.status_code = response.code.to_i unless response_object.status_code\n response_object\n end",
"title": ""
},
{
"docid": "842e01c904c368c93e78848818bf06f7",
"score": "0.6324255",
"text": "def build_response\n return { \"error\": \"invalid account or no billable accounts\" } if @accounts.blank?\n\n response = []\n total_devices = 0\n total_firewalls = 0\n total_mailboxes = 0\n total_cost = 0\n @accounts.each do |acc|\n next if acc.trial?\n\n subtotal = ((@devices[acc.path] || 0) + (@firewalls[acc.path] || 0))\n total_cost += subtotal\n total_devices += @devices[acc.path] || 0\n total_firewalls += @firewalls[acc.path] || 0\n total_mailboxes += @mailboxes[acc.path] || 0\n response << {\n name: acc.name,\n devices: @devices[acc.path] || 0,\n firewalls: @firewalls[acc.path] || 0,\n mailboxes: @mailboxes[acc.path] || 0,\n subtotal: subtotal\n }\n end\n\n {\n total_devices: total_cost,\n devices: total_devices,\n firewalls: total_firewalls,\n mailboxes: total_mailboxes,\n details: response,\n billing_start_date: @start_date,\n billing_end_date: @end_date\n }\n end",
"title": ""
},
{
"docid": "3df978d2bf0ca1dc76f6a472ca146a40",
"score": "0.6302586",
"text": "def json_formatter\n # Create hash formatted to robot's API for final output with empty \"command_values\" array\n # json_output = { \"robot_commands\" => @command_array.length, \"command_values\" => [] }\n json_output = { }\n # Loop through the @command_array instance variable created above\n command_body = @command_array.each do | command |\n # Add a hash to the \"command_values\" array in the json_output hash for each robot instruction\n # json_output[ \"command_values\" ] << { \"line\" => \"#{ @command_array.index( command ) }\", \"value\" => \"#{ command }\" } \n json_output[ \"cmd#{ @command_array.index( command ) + 1 }\" ] = \"#{ command }\" \n # Set the array element to empty string so that the proper index is set above when it comes back around\n # in the event of duplicate instructions\n @command_array[ @command_array.index( command ) ] = \"\"\n end \n # Convert json_output hash to JSON object, and assign to @output new instance variable\n @output = json_output.to_json\n end",
"title": ""
},
{
"docid": "fcdfa3a2b2b727cd7db790b3ca51df56",
"score": "0.6272985",
"text": "def as_json(options = {})\n {\n :id => self.id,\n :title => '',\n :client => self.client.first_name + ' ' + self.client.last_name,\n :name => self.name,\n# :description => self.description || \"\",\n :start => start_datetime.rfc822,\n :start_window => start_window.rfc822,\n :end => '',\n :allDay => '',\n# :recurring => false,\n :url => Rails.application.routes.url_helpers.job_request_path(id)\n } \n end",
"title": ""
},
{
"docid": "ec267f6fc80aec9f8785a03477a9dcd3",
"score": "0.62612337",
"text": "def prepare_json\n to_return = Hash.new()\n to_return[:primary_key] = @primary_key\n to_return[:name] = @name\n to_return[:identifier] = @identifier\n to_return[:cloudkit_identifier] = @user_record_name\n to_return[:cloudkit_last_modified_device] = @cloudkit_last_modified_device\n to_return[:html] = generate_html\n\n to_return\n end",
"title": ""
},
{
"docid": "1bac8e03ab279d51c4c97352f30e7781",
"score": "0.6241117",
"text": "def json_response (status, data, message)\n\t\t{\n\t\t\t\tstatus: status,\n\t\t\t\tdata: data,\n\t\t\t\tmessage: message\n\t\t}\n\tend",
"title": ""
},
{
"docid": "ae94725fc7de99b46e482be3c269556f",
"score": "0.6220197",
"text": "def render_json\n end",
"title": ""
},
{
"docid": "cc9b9761bf2cf55663da788652fa536e",
"score": "0.62126803",
"text": "def build_response(json)\n klass = AdaptivePayments.const_get(operation.to_s + \"Response\")\n klass.from_json(json.to_s)\n end",
"title": ""
},
{
"docid": "cdf8a1c13b5658b891c2821cdcd3ee84",
"score": "0.6206871",
"text": "def to_api_json\n Jbuilder.encode do |json|\n json.set!(:week_start, @week.start.in_time_zone.to_i)\n json.set!(:week_end, @week.end.in_time_zone.to_i)\n json.set!(:week_number, @week.number)\n\n json.albums do\n json.array! @albums do |album|\n json.call(album, :name, :uuid)\n json.set!(:artist, album.artist.name)\n json.set!(:thumbnail_url, album.image || album.thumbnail)\n json.set!(:release_date, album.release_date.in_time_zone.to_i)\n json.set!(:release_date_string, album.release_date.to_s)\n json.set!(:age, album.anniversary.count)\n json.set!(:day_of_week, album.anniversary.current.strftime('%A'))\n json.set!(:anniversary, album.anniversary.current.in_time_zone.to_i)\n json.set!(:anniversary_string, album.anniversary.current.to_s)\n json.set!(:review_link, album.link)\n json.set!(:rating, album.rating)\n json.set!(:link, \"/albums/#{album.slug}\")\n end\n end\n end\n end",
"title": ""
},
{
"docid": "e94756baaaf2e5c08e7f6575370f6aa2",
"score": "0.6204647",
"text": "def create_json\n respond_to do | wants |\n wants.json do\n _create do | image, image_placement |\n if image.save && image_placement.save\n render :layout => false, :json => { :status => 'UPLOADED', :image_url => url_for(:action=>'show', :id=>image_placement.id, :only_path => true)} \n # returning application/json, text/x-json, text/json cause Firefox 3 to try to open an app\n # returning text/html or application/xhtml+xml causes ampersands (&) in json \n # strings to get html_escape (&)\n response.content_type = Mime::HTML\n else\n render :layout => false, :json => { :status => 'FAILED'}\n # otherwise Rails returns application/json and Firefox 3 tries to open an app\n response.content_type = Mime::HTML\n end\n end\n end\n end\n end",
"title": ""
},
{
"docid": "a5c829dfcd9a7d5489cf58db8f3808d9",
"score": "0.61781645",
"text": "def json\n h = Hash.new\n\n h[\"description\"] = overview # add \"...\" if over certain size\n h[\"sources\"] = [full_name]\n h[\"subtitle\"] = \"(#{year}) #{genre}\"\n h[\"thumb\"] = poster\n h[\"art\"] = art\n\n t = name[0..32]\n t = t + \"..\" if t.size > 32\n h[\"title\"] = t\n\n h[\"rating\"] = rating\n h[\"runtime\"] = runtime\n\n h\n end",
"title": ""
},
{
"docid": "8f1d4a2a4b36f56ab0d66f496813eb15",
"score": "0.6173205",
"text": "def prep_for_json\n build_json = {}\n build_json['phone_number'] = self.phone_number\n if (!self.attendee_user_id.nil?) ## might be nil for non_user\n build_json['user_id'] = self.attendee_user_id\n end\n build_json['status'] = self.status\n build_json['role'] = self.role\n\n build_json\n end",
"title": ""
},
{
"docid": "6cae6eec1702512a4966493f526cfa65",
"score": "0.6156955",
"text": "def json_resp body, status = 200, headers = {}\n\t\t\tjs = body.to_json\n\n\t\t\t[status,\n\t\t\t\t{ 'Content-Type' => 'application/json',\n\t\t\t\t 'Content-Length' => js.bytesize.to_s,\n\t\t\t\t}.merge(headers),\n\t\t\t [js]]\n\t\tend",
"title": ""
},
{
"docid": "6fb8a10599b7c455cec64bff35f1ae19",
"score": "0.61529446",
"text": "def response_build_hash\n if @_config.json_root.present?\n begin\n fetch_from_body @_config.json_root\n rescue\n raise ResponseBuilderError, \"Could not find key #{@_config.json_root} in:\\n#{response_body}\"\n end\n else\n response_body\n end\n end",
"title": ""
},
{
"docid": "e28b9d0dbd7ae5a65408a0e5d7742248",
"score": "0.6146616",
"text": "def to_json\n MultiJson.encode(result)\n end",
"title": ""
},
{
"docid": "fd1be94c16a6fc869475858b575bc7dc",
"score": "0.6135126",
"text": "def render\n Oj.dump(to_json)\n end",
"title": ""
},
{
"docid": "f3cbf8e0f6863b5847bf990a370ad069",
"score": "0.61347574",
"text": "def json_response(status = 200)\n locale = self.mounting_point.default_locale\n\n if self.request.path =~ /^\\/(#{self.mounting_point.locales.join('|')})+(\\/|$)/\n locale = $1\n end\n\n hash = @entry.to_hash(false).tap do |_hash|\n if !@entry.valid?\n _hash['errors'] = @entry.errors.inject({}) do |memo, name|\n memo[name] = ::I18n.t('errors.messages.blank', locale: locale)\n memo\n end\n end\n end\n\n [status, { 'Content-Type' => 'application/json' }, [hash.to_json]]\n end",
"title": ""
},
{
"docid": "b4d019854fda53c86b3091a7e1a10947",
"score": "0.61343884",
"text": "def json(data={}, options={})\n response[CONTENT_TYPE] = APPLICATION_JSON\n response.status = options[:status] if options.has_key?(:status)\n response.write self.class.json_serializer.dump(data)\n end",
"title": ""
},
{
"docid": "9a3a430b5b0ae317387f680a6ae88109",
"score": "0.61339176",
"text": "def as_json()\n data = {\n 'redirectCount' => self.redirects_count,\n 'startDate' => self.created_at.utc.iso8601,\n }\n\n if self.redirects_count > 0\n data['lastSeenDate'] = self.last_redirect_at.utc.iso8601\n end\n\n data\n end",
"title": ""
},
{
"docid": "b55e218865c654ecd18b541bececdbd6",
"score": "0.6132326",
"text": "def make_response(status, body)\n {\n statusCode: status,\n body: JSON.pretty_generate(body)\n }\nend",
"title": ""
},
{
"docid": "47285c786ac0ef605d1d64019cf497cc",
"score": "0.61306155",
"text": "def json\n {}\n end",
"title": ""
},
{
"docid": "c8c5ec5622cf58fb7edaf4f4ff3ad9fb",
"score": "0.61290306",
"text": "def build_json_data(h)\n # building each item of the json data\n json_items = h.keys().map { |k| \"\\\"#{k}\\\": \\\"#{h[k]}\\\"\" }\n\n # actually returning the json data\n return \"{#{json_items.join(', ')}}\"\n end",
"title": ""
},
{
"docid": "eaf8d5e4634e96e9bedb36933500b938",
"score": "0.6113419",
"text": "def to_s # :nocov:\n s = []\n s << \"JsonResponse:#{self.object_id}\"\n s << \" status: #{self.status}\"\n s << \" code: #{self.code}\"\n s << \" message: #{self.message}\"\n s << \" data: \" + MultiJson.dump(self.data)\n s.join(\"\\n\")\n end",
"title": ""
},
{
"docid": "6e3c8dace4e158c7888fbabd75ea0a88",
"score": "0.6111956",
"text": "def build_JSON\n temp_hash = Hash.from_xml(build_XML)\n temp_hash[\"Envelope\"].delete(\"xmlns:xsi\")\n temp_hash[\"Envelope\"].delete(\"xsi:noNamespaceSchemaLocation\")\n temp_hash = json_recursive_reformat(temp_hash)\n json_result = JSON.pretty_generate(temp_hash) # Making the result more human-readable.\n return json_result\n end",
"title": ""
},
{
"docid": "37aa0ec27fd362404d6b531353ad08ce",
"score": "0.6106867",
"text": "def to_api_json\n Jbuilder.encode do |json|\n highlighted_album_json(json)\n week_json(json)\n albums_json(json)\n end\n end",
"title": ""
},
{
"docid": "716e3fe5255734817b9c89d79fe364b1",
"score": "0.6102377",
"text": "def API_RESPONSE(status, body)\n JSON.generate({:status => status, :body => body});\nend",
"title": ""
},
{
"docid": "6d1bb9e31e183ad32bf45b8eb36d9f34",
"score": "0.61000943",
"text": "def to_json\n @request.perform\n end",
"title": ""
},
{
"docid": "ac81a1771ef0eaa4c8afe1da6825491d",
"score": "0.6082962",
"text": "def as_json\n\t\t{\n\t\t\t:id => self.id,\n\t\t\t:nombre => self.nombre,\n\t\t\t:abreviacion => self.abreviacion,\n\t\t}\t\t\n\tend",
"title": ""
},
{
"docid": "e8212db442d24f785931aae51d23a370",
"score": "0.6081247",
"text": "def as_json(_options = {})\n {:http_response => to_hash}\n end",
"title": ""
},
{
"docid": "381d81b26e8ccb0d71474ee3019741ac",
"score": "0.6068553",
"text": "def json\n @@id += 1\n \"{\" +\n \"\\\"type\\\": \\\"#{@type}\\\", \\\"id\\\": \\\"A#{@@id}\\\", \\\"value\\\": \\\"#{@value}\\\", \" +\n \"\\\"offset\\\": #{@offset}, \\\"length\\\": #{@length}\" +\n \"}\"\n end",
"title": ""
},
{
"docid": "2aff285c561de6325b791ae663225345",
"score": "0.6067934",
"text": "def response\n # Dump it to JSON\n MultiJson.dump({\n status: @app_response.status,\n headers: @app_response.headers,\n body: @app_response.body\n })\n end",
"title": ""
},
{
"docid": "025c63a3d6f97e20b6182d7deaa55f10",
"score": "0.60595596",
"text": "def toJson()\n json = { 'class' => self.class.to_s }\n json['id'] = @id ;\n json['index'] = @index ;\n json['allow'] = @allow ;\n json['disallow'] = @disallow ;\n json['speed'] = @speed ;\n json['length'] = @length ;\n json['originalId'] = @originalId ;\n\n json['shape'] = genShapeJson() ;\n\n return json ;\n end",
"title": ""
},
{
"docid": "6a58705155357ef86b7cb14274cde754",
"score": "0.60579014",
"text": "def json_data\n json_format = params[:json_format] or 'default'\n case json_format\n when 'basic'\n collection.map { |v| { 'id' => v.product.id, 'name' => v.product.name }}.uniq { |i| i['id'] }.to_json\n when 'autocomplete'\n collection.map { |v| {\n :data => {\n :id => v.id,\n :product_id => v.product.id,\n :name => v.fullname,\n :sku => v.sku,\n :count_on_hand => v.count_on_hand,\n :image_url => (v.images.count > 0 ? v.images.first.attachment.url(:mini) : nil)\n },\n :value => v.fullname,\n :result => v.fullname\n }\n }.to_json\n else\n collection.to_json(:include => {:variants => {:include => {:option_values => {:include => :option_type},\n :images => {:only => [:id], :methods => :mini_url}}},\n :images => {:only => [:id], :methods => :mini_url}, :master => {}})\n end\n end",
"title": ""
},
{
"docid": "c783ab216023e2c15466417d4b3d17fe",
"score": "0.6057348",
"text": "def to_api_json\n Jbuilder.encode do |json|\n json.albums do\n json.array! @albums do |album|\n json.call(album, :name, :uuid)\n json.set!(:artist, album.artist_name)\n json.set!(:artist_twitter_screen_name, twitter_screen_name(album))\n json.set!(:thumbnail_url, album.image || album.thumbnail)\n json.set!(:release_date, album.release_date.in_time_zone.to_i)\n json.set!(:release_date_string, album.release_date.to_s)\n json.set!(:age, album.anniversary.count)\n json.set!(:day_of_week, album.anniversary.current.strftime('%A'))\n json.set!(:anniversary, album.anniversary.current.in_time_zone.to_i)\n json.set!(:anniversary_string, album.anniversary.current.to_s)\n json.set!(:review_link, album.link)\n json.set!(:rating, album.rating)\n json.set!(:generated_fun_fact_description, album.generated_fun_fact_description)\n json.set!(:fun_fact_description, album.fun_fact_description)\n json.set!(:fun_fact_source, album.fun_fact_source)\n json.set!(:link, \"/albums/#{album.slug}\")\n json.set!(:update, \"/v1/admin/albums/#{album.id}\")\n end\n end\n end\n end",
"title": ""
},
{
"docid": "f0c75a30ba9ed370105a85c2f6fb64dd",
"score": "0.60521626",
"text": "def toJson()\n return ({\"basename\" => @basename,\n \"config\" => @config,\n \"demandStat\" => @demandStat,\n }) ;\n end",
"title": ""
},
{
"docid": "e75f340b1faedb8215a467a9f4e1ca44",
"score": "0.6048977",
"text": "def prepare_json\n to_return = Hash.new()\n to_return[:primary_key] = @primary_key\n to_return[:note_id] = @note.note_id\n to_return[:uuid] = @uuid\n to_return[:type] = @type\n to_return[:conforms_to] = @conforms_to\n to_return[:alt_text] = @alt_text\n to_return[:token_identifier] = @token_identifier\n to_return[:html] = generate_html\n\n to_return\n end",
"title": ""
},
{
"docid": "4155c142d2ef2c51b960c410dea4d4f1",
"score": "0.60468835",
"text": "def make_response(status, body)\r\n {\r\n statusCode: status,\r\n body: JSON.generate(body)\r\n }\r\nend",
"title": ""
},
{
"docid": "c57b3316d2ee56ad6897af41341f48c3",
"score": "0.6035327",
"text": "def format_response(operation_results)\n {\n \"results\" => operation_results\n }\n end",
"title": ""
},
{
"docid": "7ea21b514f94ff8122cffaac456d0f66",
"score": "0.60334694",
"text": "def render(options={})\n status = options[:status] || 200\n response = JSON.dump(options[:json])\n\n [status, { 'Content-Type' => 'application/json' }, [response]]\n end",
"title": ""
},
{
"docid": "a7e60e5c73bdfb3560f5f1aba85752b6",
"score": "0.60332525",
"text": "def to_json\n\t\t\t{name: @name, ar_model: @ar_model.to_json, api_model: @api_model.to_json}\n\t\tend",
"title": ""
},
{
"docid": "96e836813b2b5b1edf4286fcdb7b9dee",
"score": "0.6022305",
"text": "def json_response(method = '', value = '')\n response = {\n status: 'success',\n version: 1,\n method: method,\n data: value\n }\n response\n end",
"title": ""
},
{
"docid": "8528e0ae8d46368e1eff8100317d9876",
"score": "0.6022153",
"text": "def json(data={}, options={})\n response[CONTENT_TYPE] = APPLICATION_JSON\n response.status = options[:status] if options.has_key?(:status)\n response.write JSON.generate(data)\n end",
"title": ""
},
{
"docid": "5dc0bf4bd3ce91af0a7a10b143475dbc",
"score": "0.6017176",
"text": "def json_\n hash = {\n \"Id\" => id,\n \"Created\" => created,\n \"CreatedBy\" => created_by,\n \"Modified\" => modified,\n \"ModifiedBy\" => modified_by\n }\n\n hash.to_json\n end",
"title": ""
},
{
"docid": "5c6eb5d3087995e27462a5c0303badfc",
"score": "0.601569",
"text": "def json_\n hash = {\n \"Id\" => id,\n \"AccountId\" => account_id,\n \"SubscriptionId\" => subscription_id,\n \"Name\" => name,\n \"CampaignTypeId\" => campaign_type_id,\n \"ContentId\" => content_id,\n \"Session\" => session,\n \"SessionLength\" => session_length,\n \"UserData\" => user_data,\n \"SingleUse\" => single_use,\n \"SingleUseContentId\" => single_use_content_id\n }\n\n hash.to_json\n end",
"title": ""
},
{
"docid": "6fdfd9bca01e3795628c201c53b33aa5",
"score": "0.60099334",
"text": "def index\n @short_term_goals = ShortTermGoal.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @short_term_goals }\n format.json {\n #Format Response\n results = Array.new\n puts \"Print some tags: \"\n @short_term_goals.each do |goal|\n results << {\n 'id' => goal.id,\n 'name' => goal.name,\n 'description' => goal.description,\n 'long_term_goal_id' => goal.long_term_goal_ids, \n 'school_year' => goal.school_year,\n 'tasks' => Array.new, \n 'tag' => goal.tag.name.gsub!(/\\s*/,'').downcase,\n }\n goal.tasks.each do |task|\n results[results.length-1]['tasks'] << {\n 'id' => task.id,\n 'name' => task.name,\n 'description' => task.description\n }\n end\n end \n #send response\n render :json => results\n }\n end\n end",
"title": ""
},
{
"docid": "ceb291460af90d9c0f213d7011cd415c",
"score": "0.600884",
"text": "def json(response, options = {})\n render options.merge(:json => response)\n end",
"title": ""
},
{
"docid": "83a30f8c9d95687e888150dedcf61ff0",
"score": "0.60041785",
"text": "def to_response\n\t\t\t\t@details.merge(:code => @code)\n\t\t\tend",
"title": ""
},
{
"docid": "a0cacfa8048b47189cf8dd40050485ff",
"score": "0.5998761",
"text": "def make_response(status, body)\n {\n statusCode: status,\n body: JSON.generate(body)\n }\nend",
"title": ""
},
{
"docid": "c7071eacd1307916c8419eaa235e6484",
"score": "0.5988408",
"text": "def to_json\n # convert the result to JSON\n MultiJson.dump(to_hash)\n end",
"title": ""
},
{
"docid": "4faaadd1d830766444e93560f3c42bd6",
"score": "0.5985496",
"text": "def generate_html_and_build_response!\n controller = self.class_to_model_name\n response_body = Poseidon::View.new.render(controller, meth, self)\n response.merge!(body: response_body)\n return response\n end",
"title": ""
},
{
"docid": "a7a8032313008ac389c39201bdfbb91a",
"score": "0.59817713",
"text": "def render\n Oj.dump(to_json)\n end",
"title": ""
},
{
"docid": "ad2816f75a6976d0eab1cf40cc7384df",
"score": "0.5979727",
"text": "def json_data\n { id: self.id, membership_id: self.membership_id, amount: self.amount.round(2), paid_by: self.user.full_name, description: self.description, vendor: self.vendor, group_id: self.group.id }\n end",
"title": ""
},
{
"docid": "e2b80fb1ffe7d82ddb584a07beaade97",
"score": "0.5967116",
"text": "def as_json(options = {})\n {\n :id => self.id,\n :title => self.title+\" by \"+self.counselor.full_name,\n :start => start_at.rfc822,\n :end => end_at.rfc822,\n :allDay => 0,\n :recurring => false\n # :url => '/'+self.counselor.class.to_s.downcase+'/dashboards'\n }\n\n end",
"title": ""
},
{
"docid": "8bf0660521ec25b63a80f1084876dcb7",
"score": "0.5963002",
"text": "def format_json\n {\n id: self.id,\n email: self.email,\n username: self.username,\n first_name: self.first_name,\n last_name: self.last_name,\n tagline: self.tagline,\n bio: self.bio,\n avatar: self.avatar,\n default_league_id: self.default_league_id\n }\n end",
"title": ""
},
{
"docid": "59622b5fffae49b96fecb75905f1fcd1",
"score": "0.5959768",
"text": "def make_response(status, body)\n {\n statusCode: status,\n body: JSON.generate(body)\n }\nend",
"title": ""
},
{
"docid": "59622b5fffae49b96fecb75905f1fcd1",
"score": "0.5959768",
"text": "def make_response(status, body)\n {\n statusCode: status,\n body: JSON.generate(body)\n }\nend",
"title": ""
},
{
"docid": "081827a3fac92a5cb2100229bcd62606",
"score": "0.5953037",
"text": "def json_reflect\n @content_type = 'text/plain'\n @render_nothing = true\n @rendered_template = true\n @current_layout = nil\n h = {}\n params.each do |x,y|\n h[x]=y\n end\n write_json h\n end",
"title": ""
},
{
"docid": "5af97984eabb92fc70c47c2390a286fc",
"score": "0.5944457",
"text": "def json\n Oj.to_json(@req)\n end",
"title": ""
},
{
"docid": "985672432aeeebaa57862ced13481510",
"score": "0.5942504",
"text": "def as_json(_options = {})\n {:http_client_response => to_hash}\n end",
"title": ""
},
{
"docid": "2f947178f5ce36a1700c4ca7df6a4784",
"score": "0.5942046",
"text": "def to_json\n [status, price, date]\n .reduce(&:merge)\n .to_json\n end",
"title": ""
},
{
"docid": "7f597d37900d4f7240881630ddd0de9f",
"score": "0.593325",
"text": "def render_output name = nil, items = nil\n content_type :json\n\n #compose output JSON\n output = {:status => \"ok\", :executed_at => Time.now.strftime(\"%Y-%m-%d %H:%M:%S\"), :message => \"ok\"}\n \n #items and name specified\n return JSON.pretty_generate(output.merge({ name => items })) if name && items\n\n #name specified\n return JSON.pretty_generate(output.merge({ :output => name })) if name\n\n #only response with ok message\n return JSON.pretty_generate(output)\nend",
"title": ""
},
{
"docid": "3d3d9b3cede5b6c3fd20bf00c3631680",
"score": "0.59229636",
"text": "def render_json\n {\n items: buyers.map { |a| BuyerPresenter.new(a).new_application_data.as_json }.to_json,\n count: total_entries\n }\n end",
"title": ""
},
{
"docid": "dce6d29b2f337594ae4b0d840edb2620",
"score": "0.59096766",
"text": "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",
"title": ""
},
{
"docid": "b76a53394bd4d8dd0a11d1ad3ca44c77",
"score": "0.5902441",
"text": "def json_data_response( status, errors = nil )\n response =\n {\n id: @import_file.id,\n title: @import_file.title,\n goal_id: @import_file.goal_id,\n created_at: @import_file.created_at,\n updated_at: @import_file.updated_at,\n json_data: JSON.parse(@import_file.json_data)\n }\n\n response[:errors] = errors unless errors.nil?\n json_response(response, status)\n end",
"title": ""
},
{
"docid": "72562e2fd8f3378a763a017d9e6d9ff7",
"score": "0.5902037",
"text": "def format_json(params, response)\n all_json = {}\n times = get_times(params)\n\n # Create A Hash that contains an empty list for each Fedora Type\n Fedora_Types.each do |key, value|\n all_json.store(value.pluralize.to_sym, [])\n end\n\n response[:response][:docs].each do |doc|\n # First determine type of this specific druid\n type = doc[Type_Field.to_sym][0]\n\n # Make the JSON for this druid\n\n title1 = doc[Title_Field.to_sym]\n title2 = doc[Title_Field_Alt.to_sym]\n title = title1.nil? ? title2.nil? ? '' : title2[0] : title1[0] # look in two different fields for a title and grab the other if the first is nil (setting title to blank if both are nil)\n\n j = {:druid => doc[ID_Field.to_sym], :latest_change => determine_latest_date(times, doc[Last_Changed_Field.to_sym]), :title => title}\n j[:catkey] = doc[CatKey_Field.to_sym][0] unless doc[CatKey_Field.to_sym].nil?\n\n # Append this little json stub to its proper parent array\n all_json[type.downcase.pluralize.to_sym] << j\n end\n\n # Now we need to delete any nil arrays and sum the ones that aren't nil\n total_count = 0\n a = {}\n all_json.each do |key, value|\n if value.size == 0\n all_json.delete(key)\n else\n a[key] = value.size\n total_count += value.size\n end\n end\n a[:total_count] = total_count\n all_json.store(:counts, a)\n all_json\n end",
"title": ""
},
{
"docid": "b3505091b79660963b84c855f3f8db5e",
"score": "0.59015054",
"text": "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",
"title": ""
},
{
"docid": "d32929cb3898105f1f278dbf1de4bb46",
"score": "0.58991545",
"text": "def to_json\n\n end",
"title": ""
},
{
"docid": "debca2d2c43aea37fd26d7d66251d57a",
"score": "0.5896022",
"text": "def as_json(options={})\n super.merge(\n {\n :reported_mileage => self.reported_mileage,\n :last_maintenance_date => self.last_maintenance_date,\n :license_plate => self.license_plate,\n :serial_number => self.serial_number,\n :gross_vehicle_weight => self.gross_vehicle_weight,\n :vehicle_usage_codes => self.vehicle_usage_codes,\n :vehicle_rebuild_type_id => self.vehicle_rebuild_type.present? ? self.vehicle_rebuild_type.to_s : nil\n })\n end",
"title": ""
},
{
"docid": "f5e4f92ed360803f7bf1527c839a3e50",
"score": "0.58939815",
"text": "def conv_to_json\n {\n :id => self.id,\n :borough_id => self.borough_id,\n :business_quantity => self.business_quantity,\n :woman_quantity => self.woman_quantity,\n :people_quantity => self.people_quantity,\n :man_quantity => self.man_quantity,\n :woman_ceo_quantity => self.woman_ceo_quantity \n }\n end",
"title": ""
},
{
"docid": "7d9cc8eb01df1a4c56dce7fa22f6fdfc",
"score": "0.5891782",
"text": "def json_index_bundles_categories\n\n respond_to do |format|\n\n\n @bundles_categories = Bundle.select(\"DISTINCT(LOWER(LTRIM(RTRIM(category)))) as category\")\n\n\n @bundles_brands = Bundle.select(\"DISTINCT(LOWER(LTRIM(RTRIM(brand)))) as brand\")\n\n\n @bundles_styles = Bundle.select(\"DISTINCT(LOWER(LTRIM(RTRIM(style)))) as style\")\n\n\n @bundles_colors = Bundle.select(\"DISTINCT(LOWER(LTRIM(RTRIM(color)))) as color\")\n\n\n @bundles_makes = Bundle.select(\"DISTINCT(LOWER(LTRIM(RTRIM(make)))) as make\")\n\n\n @bundles_locations = Bundle.select(\"DISTINCT(LOWER(LTRIM(RTRIM(location)))) as location\")\n\n\n\n format.json { render json:{ bundles_categories:@bundles_categories,\n bundles_brands:@bundles_brands,\n bundles_styles:@bundles_styles,\n bundles_colors:@bundles_colors,\n bundles_makes:@bundles_makes,\n bundles_locations:@bundles_locations\n }}\n end\n end",
"title": ""
},
{
"docid": "9a38e63e073b0e18266a088b2e8da986",
"score": "0.58912694",
"text": "def json(data = {})\n Rack::Response.new(data.to_json, 200, {\n \"Content-Type\" => \"application/json\",\n })\n end",
"title": ""
},
{
"docid": "378dff609a62878915f8d1fab57a8360",
"score": "0.58902055",
"text": "def as_json(options={})\n\n response = {\n :id => @base_char.id,\n :name => name,\n :status => status,\n :is_ready => is_ready,\n :recovery_time_ms => recovery_time_ms,\n :test_time => @base_char.recovery_time,\n :level => @base_char.level,\n :exp => @base_char.exp,\n :att_points => @base_char.att_points,\n :base_str => @base_char.base_str,\n :base_agi => @base_char.base_agi,\n :base_end => @base_char.base_end,\n :base_int => @base_char.base_int,\n :base_x => @base_char.base_x,\n :str => @str,\n :agi => @agi,\n :end => @end,\n :int => @int,\n :x => @x,\n :intimidate => @intimidate,\n :discipline => @discipline,\n :judgement => @judgement,\n :wins => @base_char.wins,\n :losses => @base_char.losses,\n :weapon => @weapon.to_s,\n :weapon_id => @weapon.id,\n :armour => @armour.to_s,\n :armour_id => @armour.id,\n :conditions => conditions,\n :traits => traits,\n :username => account.username\n # history\n }\n \n return response\n end",
"title": ""
},
{
"docid": "b22ea24b39f1599e32ffbf0fc4c10a6b",
"score": "0.58898205",
"text": "def build_error_response(error)\n error_messages = messages_from_error(error)\n\n JsonRender.convert(:status => :error, :messages => error_messages)\n end",
"title": ""
},
{
"docid": "7fece26826a2248c9758a408a6e1cfa8",
"score": "0.588592",
"text": "def as_json\n {\n code: code,\n field: field,\n message: full_message\n }\n end",
"title": ""
},
{
"docid": "7332efe5623656d2de5a2b75a6f9317c",
"score": "0.58807576",
"text": "def json(data = {}, status: 200, to_json_opts: {})\n Rack::Response.new(data.send(:to_json, to_json_opts), status, {\n \"Content-Type\" => \"application/json\",\n })\n end",
"title": ""
},
{
"docid": "2a8a613785612f6292971cb689458312",
"score": "0.5871155",
"text": "def createDirectJSON\n result = \"{\"\n if(!@params['hp'].nil? && !(@params['hp'].to_i == 0))\n result += \"\\\"hp\\\":\"\n result += @params['hp'] \n end\n if(!@params['exp'].nil? && !(@params['exp'].to_i == 0))\n if(result.length > 2)\n result += \",\"\n end\n result += \"\\\"exp\\\":\"\n result += @params['exp'] \n end\n if(!@params['gold'].nil? && !(@params['gold'].to_i == 0))\n if(result.length > 2)\n result += \",\"\n end\n result += \"\\\"gold\\\":\" \n result += @params['gold']\n end\n result += \"}\"\n result\n end",
"title": ""
},
{
"docid": "ce35159e3e83a063f971b5abe8aca63c",
"score": "0.5865969",
"text": "def to_json\n {:pid=>self.pid,\n :name=>self.name,\n :status=>self.status,\n :release_date=>self.release_date,\n :episodes=>self.get_json_episodes,\n :generas=>self.generas,\n :related_shows=>self.related_shows\n }\n end",
"title": ""
},
{
"docid": "17499ff46007366eadadec94d0b33aa0",
"score": "0.58633906",
"text": "def as_json\n\t\t{\n\t\t\t:id => self.id,\n\t\t\t:agencia => self.agencia.as_json,\n\t\t\t:usuario => self.usuario.as_json,\n\t\t}\n\tend",
"title": ""
},
{
"docid": "17feefcf579591e6a03a0e4cd2a0f150",
"score": "0.5858913",
"text": "def to_json\n Formatter::JSON.render(self)\n end",
"title": ""
},
{
"docid": "0a0aada2105d4a1573e2ce1a5e81223c",
"score": "0.58588636",
"text": "def generate_json\n if @path\n output = formatted_output\n File.open(@path, 'w') { |f| f.write(output.to_json) }\n end\n end",
"title": ""
},
{
"docid": "0a0aada2105d4a1573e2ce1a5e81223c",
"score": "0.58588636",
"text": "def generate_json\n if @path\n output = formatted_output\n File.open(@path, 'w') { |f| f.write(output.to_json) }\n end\n end",
"title": ""
},
{
"docid": "69b1482e7c89e16fc40e71d8589c9705",
"score": "0.58498716",
"text": "def to_response\n slice(:id, :username, :cash, :referrals).to_json\n end",
"title": ""
},
{
"docid": "6b2416e351a97411ea1ff12e035431a7",
"score": "0.58474636",
"text": "def build_success_output(data)\n\t \t{data: data, code: 200, result: \"success\"}\n\t end",
"title": ""
},
{
"docid": "9c915b459e5295854974cba1fdf973ed",
"score": "0.5846185",
"text": "def build_json_from_params \n #Construct array for holding categories\n arr = [] \n get_categories.each do |cat| #Meow\n #For each category create a map {}\n new_cat = {}\n new_cat[\"name\"] = cat[0]\n new_cat[\"steps\"] = []\n get_steps(cat).each do |step|\n #For each step create a map {}\n new_cat_step = {}\n new_cat_step[\"name\"] = step[2]\n #get options returns a list of maps of options\n new_cat_step[\"options\"] = get_options(step) \n new_cat[\"steps\"] << new_cat_step\n end \n arr << new_cat\n end\n json = {\"categories\" => arr, \"prompt\" => params[:prompt]}\n return json\n end",
"title": ""
},
{
"docid": "2d10aadbb427c3bac31d3e3590d50dbe",
"score": "0.5845563",
"text": "def prepare_json\n to_return = Hash.new()\n to_return[:version] = @version\n to_return[:file_path] = @file_path\n to_return[:backup_type] = @backup.type\n to_return[:html] = generate_html\n\n # Add in AppleNotesAccounts\n to_return[:accounts] = Hash.new()\n @accounts.each do |account_id, account|\n to_return[:accounts][account_id] = account.prepare_json\n end\n\n # Add in AppleCloudKitShareParticipants\n to_return[:cloudkit_participants] = Hash.new()\n @cloud_kit_participants.each do |record_id, cloudkit_participant|\n to_return[:cloudkit_participants][record_id] = cloudkit_participant.prepare_json\n end\n\n # Add in AppleNotesFolders\n to_return[:folders] = Hash.new()\n @folders.each do |folder_id, folder|\n to_return[:folders][folder_id] = folder.prepare_json if !folder.is_child?\n end\n\n # Add in AppleNotes\n to_return[:notes] = Hash.new()\n @notes.each do |note_id, note|\n to_return[:notes][note_id] = note.prepare_json\n end\n\n to_return\n end",
"title": ""
},
{
"docid": "7d1e3ea610a13d4041a6f7785190ca94",
"score": "0.58443254",
"text": "def build\n headers = {\n 'Authorization' => \"Passcode #{passcode}\",\n }\n headers['Content-Type'] = content_type if content_type\n headers['Sub-Merchant-Id'] = sub_merchant_id if sub_merchant_id\n headers\n end",
"title": ""
}
] |
83d3131d948284a082809818793fe125 | PUT /feedbacks/1 PUT /feedbacks/1.json | [
{
"docid": "d97fd66c7d8019c07e552de6def88213",
"score": "0.71118873",
"text": "def update\n @feedback = Feedback.find(params[:id])\n\n respond_to do |format|\n if @feedback.update_attributes(params[:feedback])\n format.html { redirect_to @feedback, notice: 'Feedback was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @feedback.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] | [
{
"docid": "d7e3523b3cfdad8e224ae64bf8cbd5a9",
"score": "0.7388445",
"text": "def update\n respond_to do |format|\n if @feedback.update(feedback_params)\n format.json { head :no_content }\n else\n format.json { render json: @feedback.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "73ca8fe1abc2cd10d8133837db1c048c",
"score": "0.7190995",
"text": "def update\n @feedback = Feedback.find(params[:id])\n \n respond_to do |format|\n if @feedback.update_attributes(params[:feedback])\n format.html { redirect_to @feedback, notice: 'Feedback was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @feedback.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7998462af24da894eb090d158c1e95e8",
"score": "0.7178437",
"text": "def update\n respond_to do |format|\n if @feedback.update(feedback_params)\n format.html { redirect_to feedbacks_path, notice: 'Feedback was successfully updated.' }\n format.json { render :index, status: :ok, location: @feedback }\n else\n format.html { render :edit }\n format.json { render json: @feedback.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a952b47c4193be53694fdb310562d0f9",
"score": "0.7171556",
"text": "def update\n respond_to do |format|\n if @feedback.update(feedback_params)\n format.html { redirect_to @feedback, notice: t('feedback_update_success') }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @feedback.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4087e95b72b4f10465b695efcfeb71ff",
"score": "0.7167801",
"text": "def update\n @feedback = Feedback.find(params[:id])\n\n respond_to do |format|\n if @feedback.update_attributes(params[:feedback])\n format.html { redirect_to @feedback, :notice => 'Feedback was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @feedback.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "17f2c096798e7ddae85cd04876bf020d",
"score": "0.70972097",
"text": "def update\n respond_to do |format|\n if @feedback.update(feedback_params)\n Events.delay.assign_feedback(@feedback.id) if @feedback.to != nil && @feedback.answer == nil\n format.html { redirect_to feedbacks_url, notice: t(:feedback_was_successfully_updated, scope: [:notices]) }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @feedback.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2afa9a3c324a89578954155040c1c1f6",
"score": "0.7074516",
"text": "def update\n respond_to do |format|\n if @feedback.update(feedback_params)\n format.html { redirect_to @feedback, notice: 'Feedback was successfully updated.' }\n format.json { render :show, status: :ok, location: @feedback }\n else\n format.html { render :edit }\n format.json { render json: @feedback.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2afa9a3c324a89578954155040c1c1f6",
"score": "0.7074516",
"text": "def update\n respond_to do |format|\n if @feedback.update(feedback_params)\n format.html { redirect_to @feedback, notice: 'Feedback was successfully updated.' }\n format.json { render :show, status: :ok, location: @feedback }\n else\n format.html { render :edit }\n format.json { render json: @feedback.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2afa9a3c324a89578954155040c1c1f6",
"score": "0.7074516",
"text": "def update\n respond_to do |format|\n if @feedback.update(feedback_params)\n format.html { redirect_to @feedback, notice: 'Feedback was successfully updated.' }\n format.json { render :show, status: :ok, location: @feedback }\n else\n format.html { render :edit }\n format.json { render json: @feedback.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2afa9a3c324a89578954155040c1c1f6",
"score": "0.7074516",
"text": "def update\n respond_to do |format|\n if @feedback.update(feedback_params)\n format.html { redirect_to @feedback, notice: 'Feedback was successfully updated.' }\n format.json { render :show, status: :ok, location: @feedback }\n else\n format.html { render :edit }\n format.json { render json: @feedback.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "09b2db17aa7669d628ece27edf8373d4",
"score": "0.7054819",
"text": "def update\n respond_to do |format|\n if @feedback.update_attributes(feedback_params)\n format.html { redirect_to @feedback, notice: 'Feedback was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @feedback.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6a38247de5bb33e675b2ee68d54607a5",
"score": "0.7022915",
"text": "def update\n respond_to do |format|\n if @feedback.update(feedback_params)\n format.html { redirect_to feedbacks_url, notice: t('flash.notice.updating_feedback') }\n format.json { render :show, status: :ok, location: @feedback }\n else\n format.html { render :edit, alert: t('flash.alert.updating_feedback') }\n format.json { render json: @feedback.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "91f1b7380c4df4e45f78d510dfa08e1d",
"score": "0.7013985",
"text": "def update\n respond_to do |format|\n if @feedback.update(feedback_params)\n format.html { redirect_to @feedback, notice: 'Feedback was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @feedback.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "91f1b7380c4df4e45f78d510dfa08e1d",
"score": "0.7013985",
"text": "def update\n respond_to do |format|\n if @feedback.update(feedback_params)\n format.html { redirect_to @feedback, notice: 'Feedback was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @feedback.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "653937f7b57ba0c9e98e01ed3c262ec6",
"score": "0.701053",
"text": "def update\n respond_to do |format|\n if @feedback.update(feedback_params)\n @feedbacks = Feedback.all\n format.html { redirect_to @feedback, notice: 'Feedback was successfully updated.' }\n format.json { render :show, status: :ok, location: @feedback }\n format.line { render :index }\n else\n format.html { render :edit }\n format.json { render json: @feedback.errors, status: :unprocessable_entity }\n format.line { render json: flex_text(@feedback.errors.to_s) }\n end\n end\n end",
"title": ""
},
{
"docid": "fb7cdae32a3fdeb1f32763041fc51d93",
"score": "0.69463164",
"text": "def update\n respond_to do |format|\n if @feedback.update(feedback_params)\n format.html { redirect_to user_root_url, notice: 'Feedback was successfully updated.' }\n format.json { render :show, status: :ok, location: @feedback }\n else\n format.html { render :edit }\n format.json { render json: @feedback.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2f2e57dcf72896f29455b845ed6b764f",
"score": "0.6934145",
"text": "def submit_feedback(label, feedback)\n response = @api.request(\n :put,\n \"#{@location}/#{label}\",\n headers: { 'content-type' => @api.version_header[:accept] },\n body: feedback.to_json\n )\n rescue Gini::Api::RequestError => e\n if e.api_status == 422\n raise Gini::Api::DocumentError.new(\n \"Failed to submit feedback for label '#{label}' (code=#{e.api_status}, msg=#{e.api_response.body})\",\n response\n )\n end\n raise\n end",
"title": ""
},
{
"docid": "6d80928c1cb9f12e8fda4b864e3b2a6d",
"score": "0.6912034",
"text": "def update\n respond_to do |format|\n if @feedback.update(feedback_params)\n format.html { redirect_to dashboard_show_url, notice: 'Feedback was successfully updated.' }\n format.json { render :show, status: :ok, location: @feedback }\n else\n format.html { render :edit }\n format.json { render json: @feedback.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8f021b15bc863ea56e2fba2c77028312",
"score": "0.6870932",
"text": "def update\n respond_to do |format|\n if @question_feedback.update(question_feedback_params)\n format.html { redirect_to @question_feedback, notice: 'Question feedback was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @question_feedback.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8317e9e166000bf5056a38e591f4414a",
"score": "0.68662393",
"text": "def update\n @user = User.find(current_user)\n @feedback = Feedback.find(params[:id])\n\n respond_to do |format|\n if @feedback.update_attributes(params[:feedback])\n format.html { redirect_to @feedback, notice: 'Feedback was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @feedback.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8317e9e166000bf5056a38e591f4414a",
"score": "0.68662393",
"text": "def update\n @user = User.find(current_user)\n @feedback = Feedback.find(params[:id])\n\n respond_to do |format|\n if @feedback.update_attributes(params[:feedback])\n format.html { redirect_to @feedback, notice: 'Feedback was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @feedback.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7cc74745db25b61b19a4a2c39bd0f428",
"score": "0.683952",
"text": "def update\n redirect_to :root\n return\n @feedback = Feedback.find(params[:id])\n\n respond_to do |format|\n if @feedback.update_attributes(params[:feedback])\n format.html { redirect_to @feedback, notice: 'Feedback was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @feedback.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a80b695089fb2578fa3a253c08906263",
"score": "0.680734",
"text": "def update\n respond_to do |format|\n if @my_feedback.update(my_feedback_params)\n format.html { redirect_to @my_feedback, notice: 'My feedback was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @my_feedback.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2a64c90e5773ad000bb52d1614192b0c",
"score": "0.67565936",
"text": "def update\n @user_feedback = UserFeedback.find(params[:id])\n\n respond_to do |format|\n if @user_feedback.update_attributes(params[:user_feedback])\n format.html { redirect_to @user_feedback, notice: 'User feedback was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @user_feedback.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9323d4e68eab7ba4692486d8eaf97233",
"score": "0.67400205",
"text": "def update\n @feedback = Feedback.find(params[:id])\n params[:feedback][:my_tag_ids] ||= []\n respond_to do |format|\n if @feedback.update_attributes(params[:feedback])\n format.html { redirect_to(admin_feedbacks_url, :notice => 'Feedback was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @feedback.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4c6095a0b0219485269bc3cad8334729",
"score": "0.67360795",
"text": "def update\n @admin_feedback = Admin::Feedback.find(params[:id])\n\n respond_to do |format|\n if @admin_feedback.update_attributes(params[:admin_feedback])\n format.html { redirect_to admin_feedback_path(@admin_feedback), notice: 'Feedback was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @admin_feedback.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "45e6fef71fb7c18c99c0049331e28425",
"score": "0.6718917",
"text": "def update\n add_breadcrumb 'New Feedback'\n\n respond_to do |format|\n if @feedback.update(feedback_params)\n format.html do\n redirect_to feedbacks_url, notice: 'Feedback was successfully updated.'\n end\n # format.json { render :show, status: :ok, location: @feedback }\n else\n format.html { render :edit , status: :unprocessable_entity }\n format.json do\n render json: @feedback.errors, status: :unprocessable_entity\n end\n end\n end\n end",
"title": ""
},
{
"docid": "8411de15d9d9211865cdbb558c0e8a67",
"score": "0.67103606",
"text": "def update\n @feedback = Feedback.find(params[:id])\n\n respond_to do |format|\n if @feedback.update_attributes(params[:feedback])\n format.html { redirect_to [:admin, @feedback], notice: 'Отзыв успешно обновлен.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @feedback.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "60a6fa7e28e061f371258da4fdd80de3",
"score": "0.66907775",
"text": "def update\n @feedback = Feedback.find(params[:id])\n\n respond_to do |format|\n if @feedback.update_attributes(params[:feedback])\n format.html { redirect_to(@feedback, :notice => 'Feedback was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @feedback.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6c33c51da3bda54973dbaf0e4608d8cd",
"score": "0.6680949",
"text": "def update\n @feedback = Feedback.find(params[:id])\n\n respond_to do |format|\n if @feedback.update_attributes(params[:feedback])\n flash[:notice] = 'Feedback was successfully updated.'\n format.html { redirect_to(@feedback) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @feedback.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "427ecc28dc6373cd67afba87858bc8d9",
"score": "0.66611606",
"text": "def update\n @feedback = Feedback.find(params[:id])\n authorize! :update , @feedback\n\n respond_to do |format|\n if @feedback.update_attributes(feedback_params)\n format.html { redirect_to @feedback, notice: 'Feedback was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @feedback.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "abb0b2a231c60a272856415082e0e30f",
"score": "0.6658679",
"text": "def update\n respond_to do |format|\n if @user_feedback.update(user_feedback_params)\n format.html { redirect_to @user_feedback, notice: 'User feedback was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @user_feedback.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "dfd0b8ad3737f33ac75c4f6f2f537769",
"score": "0.6636456",
"text": "def update\n respond_to do |format|\n if @user_feedback.update(user_feedback_params)\n format.html { redirect_to @user_feedback, notice: 'User feedback was successfully updated.' }\n format.json { render :show, status: :ok, location: @user_feedback }\n else\n format.html { render :edit }\n format.json { render json: @user_feedback.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b5da7c5a06c8be007743945b1a240e6b",
"score": "0.66279286",
"text": "def update\n @feedback = Feedback.find(params[:id])\n logger.info \"フィードバック #{@feedback.id} を更新します。\"\n @feedback.last_updated_at = Time.now\n ActiveRecord::Base.transaction do\n respond_to do |format|\n if @feedback.update_attributes(feedback_params)\n logger.info \"フィードバック #{@feedback.id} を更新しました。\"\n format.html { redirect_to article_path(@feedback.article_id), notice: get_resource('success') }\n #format.json { head :no_content }\n else\n logger.info \"フィードバックの更新に失敗しました。\"\n format.html { render action: \"edit\" }\n #format.json { render json: @feedback.errors, status: :unprocessable_entity }\n end\n end\n end\n end",
"title": ""
},
{
"docid": "96d3d3eea7fce4382b186788be9c3d5f",
"score": "0.66271675",
"text": "def submit\n @feedback = Feedback.find(params[:id])\n @feedback.submitted = true\n\n respond_to do |format|\n if @feedback.save\n format.html { redirect_to welcome_index_path, notice: 'Feedback was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @feedback.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "706b586961802c238a9838c7419a7214",
"score": "0.6600588",
"text": "def user_feedback\n @response = ApplicationRecord::Response.find(params[:id])\n @response.update(feedback: params[:response][:feedback])\n redirect_to feedback_response_path\n end",
"title": ""
},
{
"docid": "66765e9e5687b1302cc1956005aa2b62",
"score": "0.65924543",
"text": "def update\n respond_to do |format|\n if @userfeedback.update(userfeedback_params)\n format.html { redirect_to @userfeedback, notice: 'Userfeedback was successfully updated.' }\n format.json { render :show, status: :ok, location: @userfeedback }\n else\n format.html { render :edit }\n format.json { render json: @userfeedback.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d7b70cfda8ccdddc3ab831503872ba15",
"score": "0.6520201",
"text": "def create\n @feedback = Feedback.new(feedback_params)\n\n respond_to do |format|\n if @feedback.save\n format.json { render json: @feedback, status: :created, location: api_feedback_url(@feedback) }\n else\n format.json { render json: @feedback.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0ce947b8fa820651b4878f3dd2abd41d",
"score": "0.65124536",
"text": "def update\n \n if @feedback.update(feedback_params)\n redirect_to @feedback, notice: 'Feedback was successfully updated.'\n else\n render :edit\n end\n end",
"title": ""
},
{
"docid": "ebfb536cb9686ff4150eb20e3fedf0ed",
"score": "0.64848155",
"text": "def set_feedback\r\n @feedback = Feedback.find(params[:id])\r\n end",
"title": ""
},
{
"docid": "7bce9cddf0eb3361c5ef86c7af02baec",
"score": "0.6479323",
"text": "def set_feedback\n @feedback = Feedback.find(params[:id])\n end",
"title": ""
},
{
"docid": "7bce9cddf0eb3361c5ef86c7af02baec",
"score": "0.6479323",
"text": "def set_feedback\n @feedback = Feedback.find(params[:id])\n end",
"title": ""
},
{
"docid": "7bce9cddf0eb3361c5ef86c7af02baec",
"score": "0.6479323",
"text": "def set_feedback\n @feedback = Feedback.find(params[:id])\n end",
"title": ""
},
{
"docid": "7bce9cddf0eb3361c5ef86c7af02baec",
"score": "0.6479323",
"text": "def set_feedback\n @feedback = Feedback.find(params[:id])\n end",
"title": ""
},
{
"docid": "7bce9cddf0eb3361c5ef86c7af02baec",
"score": "0.6479323",
"text": "def set_feedback\n @feedback = Feedback.find(params[:id])\n end",
"title": ""
},
{
"docid": "7bce9cddf0eb3361c5ef86c7af02baec",
"score": "0.6479323",
"text": "def set_feedback\n @feedback = Feedback.find(params[:id])\n end",
"title": ""
},
{
"docid": "7bce9cddf0eb3361c5ef86c7af02baec",
"score": "0.6479323",
"text": "def set_feedback\n @feedback = Feedback.find(params[:id])\n end",
"title": ""
},
{
"docid": "7bce9cddf0eb3361c5ef86c7af02baec",
"score": "0.6479323",
"text": "def set_feedback\n @feedback = Feedback.find(params[:id])\n end",
"title": ""
},
{
"docid": "fabbd44af7fe1e82fe6873aba465b70f",
"score": "0.6461125",
"text": "def update\n respond_to do |format|\n if @interviewerfeedback.update(interviewerfeedback_params)\n format.html { redirect_to @interviewerfeedback, notice: 'Interviewerfeedback was successfully updated.' }\n format.json { render :show, status: :ok, location: @interviewerfeedback }\n else\n format.html { render :edit }\n format.json { render json: @interviewerfeedback.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ddc29c35424a268d8b236f01d22d7977",
"score": "0.6457387",
"text": "def update\n respond_to do |format|\n if @cms_feedback.update(cms_feedback_params)\n format.html { redirect_to @cms_feedback, notice: 'Feedback was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @cms_feedback.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "895f2c4707e9a490ca7d4da2aa4f20c1",
"score": "0.6440381",
"text": "def update\n respond_to do |wants|\n if @feedback.update_attributes(params[:feedback])\n flash[:notice] = 'Model was successfully updated.'\n wants.html { redirect_to(@feedback) }\n wants.xml { head :ok }\n else\n wants.html { render :action => \"edit\" }\n wants.xml { render :xml => @feedback.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d4918e0904d56e27f6ce1925e909c130",
"score": "0.64269966",
"text": "def set_feedback\n @feedback = Feedback.find(params[:id])\n end",
"title": ""
},
{
"docid": "d4918e0904d56e27f6ce1925e909c130",
"score": "0.64269966",
"text": "def set_feedback\n @feedback = Feedback.find(params[:id])\n end",
"title": ""
},
{
"docid": "d4918e0904d56e27f6ce1925e909c130",
"score": "0.64269966",
"text": "def set_feedback\n @feedback = Feedback.find(params[:id])\n end",
"title": ""
},
{
"docid": "d4918e0904d56e27f6ce1925e909c130",
"score": "0.64269966",
"text": "def set_feedback\n @feedback = Feedback.find(params[:id])\n end",
"title": ""
},
{
"docid": "d4918e0904d56e27f6ce1925e909c130",
"score": "0.64269966",
"text": "def set_feedback\n @feedback = Feedback.find(params[:id])\n end",
"title": ""
},
{
"docid": "d4918e0904d56e27f6ce1925e909c130",
"score": "0.64269966",
"text": "def set_feedback\n @feedback = Feedback.find(params[:id])\n end",
"title": ""
},
{
"docid": "d4918e0904d56e27f6ce1925e909c130",
"score": "0.64269966",
"text": "def set_feedback\n @feedback = Feedback.find(params[:id])\n end",
"title": ""
},
{
"docid": "d4918e0904d56e27f6ce1925e909c130",
"score": "0.64269966",
"text": "def set_feedback\n @feedback = Feedback.find(params[:id])\n end",
"title": ""
},
{
"docid": "d4918e0904d56e27f6ce1925e909c130",
"score": "0.64269966",
"text": "def set_feedback\n @feedback = Feedback.find(params[:id])\n end",
"title": ""
},
{
"docid": "d4918e0904d56e27f6ce1925e909c130",
"score": "0.64269966",
"text": "def set_feedback\n @feedback = Feedback.find(params[:id])\n end",
"title": ""
},
{
"docid": "d4918e0904d56e27f6ce1925e909c130",
"score": "0.64269966",
"text": "def set_feedback\n @feedback = Feedback.find(params[:id])\n end",
"title": ""
},
{
"docid": "d4918e0904d56e27f6ce1925e909c130",
"score": "0.64269966",
"text": "def set_feedback\n @feedback = Feedback.find(params[:id])\n end",
"title": ""
},
{
"docid": "d4918e0904d56e27f6ce1925e909c130",
"score": "0.64269966",
"text": "def set_feedback\n @feedback = Feedback.find(params[:id])\n end",
"title": ""
},
{
"docid": "d4918e0904d56e27f6ce1925e909c130",
"score": "0.64269966",
"text": "def set_feedback\n @feedback = Feedback.find(params[:id])\n end",
"title": ""
},
{
"docid": "d4918e0904d56e27f6ce1925e909c130",
"score": "0.64269966",
"text": "def set_feedback\n @feedback = Feedback.find(params[:id])\n end",
"title": ""
},
{
"docid": "d4918e0904d56e27f6ce1925e909c130",
"score": "0.64269966",
"text": "def set_feedback\n @feedback = Feedback.find(params[:id])\n end",
"title": ""
},
{
"docid": "d4918e0904d56e27f6ce1925e909c130",
"score": "0.64269966",
"text": "def set_feedback\n @feedback = Feedback.find(params[:id])\n end",
"title": ""
},
{
"docid": "d4918e0904d56e27f6ce1925e909c130",
"score": "0.64269966",
"text": "def set_feedback\n @feedback = Feedback.find(params[:id])\n end",
"title": ""
},
{
"docid": "d4918e0904d56e27f6ce1925e909c130",
"score": "0.64269966",
"text": "def set_feedback\n @feedback = Feedback.find(params[:id])\n end",
"title": ""
},
{
"docid": "d4918e0904d56e27f6ce1925e909c130",
"score": "0.64269966",
"text": "def set_feedback\n @feedback = Feedback.find(params[:id])\n end",
"title": ""
},
{
"docid": "d4918e0904d56e27f6ce1925e909c130",
"score": "0.64269966",
"text": "def set_feedback\n @feedback = Feedback.find(params[:id])\n end",
"title": ""
},
{
"docid": "d4918e0904d56e27f6ce1925e909c130",
"score": "0.64269966",
"text": "def set_feedback\n @feedback = Feedback.find(params[:id])\n end",
"title": ""
},
{
"docid": "d4918e0904d56e27f6ce1925e909c130",
"score": "0.64269966",
"text": "def set_feedback\n @feedback = Feedback.find(params[:id])\n end",
"title": ""
},
{
"docid": "d4918e0904d56e27f6ce1925e909c130",
"score": "0.64269966",
"text": "def set_feedback\n @feedback = Feedback.find(params[:id])\n end",
"title": ""
},
{
"docid": "d4918e0904d56e27f6ce1925e909c130",
"score": "0.64269966",
"text": "def set_feedback\n @feedback = Feedback.find(params[:id])\n end",
"title": ""
},
{
"docid": "d4918e0904d56e27f6ce1925e909c130",
"score": "0.64269966",
"text": "def set_feedback\n @feedback = Feedback.find(params[:id])\n end",
"title": ""
},
{
"docid": "d4918e0904d56e27f6ce1925e909c130",
"score": "0.64269966",
"text": "def set_feedback\n @feedback = Feedback.find(params[:id])\n end",
"title": ""
},
{
"docid": "d4918e0904d56e27f6ce1925e909c130",
"score": "0.64269966",
"text": "def set_feedback\n @feedback = Feedback.find(params[:id])\n end",
"title": ""
},
{
"docid": "dfcb255734d0fafb88f9d88935ac6115",
"score": "0.6424755",
"text": "def feedback_params\n params.require(:feedbacks).permit(:feedback)\n end",
"title": ""
},
{
"docid": "7afa414aa545770906f88beacc91f760",
"score": "0.6399634",
"text": "def update\n respond_to do |format|\n if @feedback_comment.update(feedback_comment_params)\n format.html { redirect_to @feedback_comment, notice: 'Feedback comment was successfully updated.' }\n format.json { render :show, status: :ok, location: @feedback_comment }\n else\n format.html { render :edit }\n format.json { render json: @feedback_comment.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "fc6e1346c0024737fdfdc872e842a1f5",
"score": "0.63798803",
"text": "def update\n respond_to do |format|\n if @feedback_form.update(feedback_form_params)\n format.html { redirect_to @feedback_form, notice: 'Feedback form was successfully updated.' }\n format.json { render :show, status: :ok, location: @feedback_form }\n else\n format.html { render :edit }\n format.json { render json: @feedback_form.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "fc6a2dd6fca958fbfeafdf2c80dce82b",
"score": "0.6373736",
"text": "def update\n respond_to do |format|\n if @feedback_input.update(feedback_input_params)\n format.html { redirect_to @feedback_input, notice: 'Feedback input was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @feedback_input.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e609d1f94f218f6300c23a8ac4d010f0",
"score": "0.6369778",
"text": "def create\n @feedback = Feedback.new(params[:feedback])\n\n respond_to do |format|\n if @feedback.save\n format.html { redirect_to feedbacks_path, :notice => 'Feedback was successfully created.' }\n format.json { render :json => @feedback, :status => :created, :location => @feedback }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @feedback.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "79c25c8b666a4b151906aae0cd2fdf33",
"score": "0.63506645",
"text": "def set_feedback\n @feedback = Feedback.where(id: params[:id]).first\n end",
"title": ""
},
{
"docid": "681a9bf432b1887e5b0d4fba2fd15e69",
"score": "0.63390845",
"text": "def update\n respond_to do |format|\n if @negative_feedback.update(negative_feedback_params)\n format.html { redirect_to @negative_feedback, notice: 'Negative feedback was successfully updated.' }\n format.json { render :show, status: :ok, location: @negative_feedback }\n else\n format.html { render :edit }\n format.json { render json: @negative_feedback.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d645941bdf9bdbc8dede98a457643d47",
"score": "0.63387686",
"text": "def update\n respond_to do |format|\n if @feedback.update(contact_params)\n format.html { redirect_to [@contact,@feedback], notice: 'Feedback was successfully updated.' }\n format.json { render :show, status: :ok, location: @feedback }\n else\n format.html { render :edit }\n format.json { render json: @feedback.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "73da1abd6bb335add50291ef19241014",
"score": "0.632514",
"text": "def update\n @feedback_category = FeedbackCategory.find(params[:id])\n\n respond_to do |format|\n if @feedback_category.update_attributes(params[:feedback_category])\n format.html { redirect_to @feedback_category, notice: 'Feedback category was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @feedback_category.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0e7b2c092f75440ead6e47d58f95cd30",
"score": "0.63209444",
"text": "def update\n @customer_feedback = CustomerFeedback.find(params[:id])\n\n respond_to do |format|\n if @customer_feedback.update_attributes(customer_feedback_params)\n format.html { redirect_to @customer_feedback, notice: 'Customer feedback was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @customer_feedback.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ca5455c3421b26413f7571a2d9edd458",
"score": "0.630046",
"text": "def set_feedback\n @feedback = current_user.feedbacks.find(params[:id])\n end",
"title": ""
},
{
"docid": "93aef2cbd851ba11efb9c6c0aea1a809",
"score": "0.6300404",
"text": "def feedback_params\n params.require(:feedback).permit(:title, :survey_type, :survey_url, :representative_profile_id)\n end",
"title": ""
},
{
"docid": "359211ba5b0f17dabe07a5abafa0ee9f",
"score": "0.6292847",
"text": "def update\n @feedback_vote = FeedbackVote.find(params[:id])\n\n respond_to do |format|\n if @feedback_vote.update_attributes(params[:feedback_vote])\n format.html { redirect_to @feedback_vote, notice: 'Feedback vote was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @feedback_vote.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "557c841bd7cab336c361d5bed6d78075",
"score": "0.6292006",
"text": "def update\n @feedback = Feedback.find(params[:id])\n if params[:submit_final_button]\n @feedback.submitted = true\n end\n\n respond_to do |format|\n if @feedback.update_attributes(params[:feedback])\n format.html do\n redirect_to edit_review_feedback_path(@review.id, @feedback.id)\n flash[:success] = 'Feedback was successfully updated.'\n end\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @feedback.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c3fbdaebc7130abd2256a8b0202b8b57",
"score": "0.6291507",
"text": "def set_feedback\n @feedback = Feedback.find_by_hashed_id(params[:id])\n end",
"title": ""
},
{
"docid": "cba5cdac8aac8ee13efc66fb8234c020",
"score": "0.62874997",
"text": "def update\n\n if @generated_feedback.update(generated_feedback_params)\n redirect_to(edit_auto_gens_path, :notice => \"Generated feedback was successfully edited.\")\n else\n redirect_to(edit_auto_gens_path, :notice => \"Generated feedback was not successfully edited.\")\n end\n end",
"title": ""
},
{
"docid": "7ca13ade387b466efeb7edf9c66bf4a0",
"score": "0.6276324",
"text": "def update\n respond_to do |format|\n if @admin_feedback.update(admin_feedback_params)\n @admin_feedbacks = Admin::Feedback.paginate(:page => params[:page])\n format.html { redirect_to @admin_feedback, notice: 'Feedback was successfully updated.' }\n format.json { render :show, status: :ok, location: @admin_feedback }\n format.js { render :layout => false }\n else\n format.html { render :edit }\n format.json { render json: @admin_feedback.errors, status: :unprocessable_entity }\n format.js { render :layout => false }\n end\n end\n end",
"title": ""
},
{
"docid": "e6168cf82e332632bbc7ab6d74c85c2d",
"score": "0.62666583",
"text": "def update\n @feedback = Feedback.find(params[:id])\n\n respond_to do |format|\n if @feedback.update_attributes(params[:feedback])\n Workstream.register_user_action(@company.id, @current_user.id, request.remote_ip,\n \" support voted as #{@feedback.vote}\", \"updated\", @current_user.branch_id)\n format.html { redirect_to(@feedback, :notice => 'Feedback was successfully updated.') }\n format.xml { head :ok }\n else\n @menu = \"Feedback\"\n @page_name = \"User Feedback\"\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @feedback.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
c1aa4376ae3073e328cb338ab4284320 | Refresh the flag if the room doesn't exist or the user list is empty | [
{
"docid": "d57c827b1695abf3937a2a935aa361be",
"score": "0.54776466",
"text": "def refresh_live_status\n # only check if flag is live\n if self.live?\n is_live = NuveHook::Nuve.live_room?(self.hash_token)\n unless is_live\n self.set_status(:pending)\n end\n end\n\n self.live?\n end",
"title": ""
}
] | [
{
"docid": "19e645d571a7f92935cb0df76a386c4e",
"score": "0.7048682",
"text": "def room_empty\n @guest_list.length == 0\n end",
"title": ""
},
{
"docid": "40e86f400d5a6dc7626562bc97d3b8b4",
"score": "0.6960307",
"text": "def no_users_ready!\n RoomUser.where(room_id: id).update_all(ready: false)\n end",
"title": ""
},
{
"docid": "dfdf83fb918dfd4972cdf5562eeeed87",
"score": "0.6666295",
"text": "def reload_rooms!\n return true if cache == :none\n\n @rooms.clear\n api.get_joined_rooms.joined_rooms.each do |id|\n r = ensure_room(id)\n r.reload!\n end\n\n true\n end",
"title": ""
},
{
"docid": "1104978fab029cceab6a956f5c784e55",
"score": "0.66506577",
"text": "def all_users_ready!\n RoomUser.where(room_id: id).update_all(ready: true)\n end",
"title": ""
},
{
"docid": "4d2af249b88b1c40326c6a87cac7bbdf",
"score": "0.64346784",
"text": "def all_users_ready?\n nr_members = members.size\n nr_ready = RoomUser.where(room_id: id, ready: true).count\n nr_members > 0 && nr_ready == nr_members\n end",
"title": ""
},
{
"docid": "da3d45b0cb18f40011640d6857a2a6c8",
"score": "0.6337425",
"text": "def user_ready!(user)\n room_user = RoomUser.where(room_id: id, user_id: user.id).first\n if room_user\n room_user.ready = true\n room_user.save!\n end\n end",
"title": ""
},
{
"docid": "ac234f9586c5e1a5294ff9bb39315d50",
"score": "0.6241379",
"text": "def update_room_status\n room.update(:is_available => true)\n end",
"title": ""
},
{
"docid": "619c0fca83ae5243c16b8b083316e0b6",
"score": "0.6239081",
"text": "def check_room_user\n if current_user.id != @room.user.id\n redirect_to rooms_path, notice: \"Cannot edit a room belonging to another user.\"\n end\n end",
"title": ""
},
{
"docid": "4b1a6bdf8794f2b2d0914714b7148161",
"score": "0.6233609",
"text": "def user_list\n @room = current_user.room\n @user_list = @room.users\n @status = [\"Not in any room\", \"Answering\", \"Confirmed\", \"Ready\"]\n render partial: \"user_list\"\n end",
"title": ""
},
{
"docid": "6324f7da20240d24c90b86d24bb51aaa",
"score": "0.61833155",
"text": "def request_rooms\n @requested_rooms = true\n end",
"title": ""
},
{
"docid": "2959f9b3a6275968bf5a961b340686a2",
"score": "0.6136616",
"text": "def ready\n @room = current_user.room\n current_user.status = 3\n current_user.save\n publish(\"presence-room_#{@room.id}\",\"users_change\",{})\n if @room.show_next_question?\n @next_question = choose_question(@room)\n @room.users.each do |user|\n user.status = 1\n user.save\n end\n publish(\"presence-room_#{@room.id}\",\"next_question\", {\n question_id: @next_question.id\n })\n end\n render :json => {\n room_id: @room.id\n }\n end",
"title": ""
},
{
"docid": "aa190370502a38205e9f4fdb5bec3a64",
"score": "0.6065611",
"text": "def admin_tries_to_leave_nonempty_org?\n org.admin == @user && org.users.count > 1\n end",
"title": ""
},
{
"docid": "1c534de21aa5499187bb53b1797f80ef",
"score": "0.6062108",
"text": "def room?\n !client.room.nil?\n end",
"title": ""
},
{
"docid": "db04b988f35db8cf851c7a0a54b9de6b",
"score": "0.6019638",
"text": "def check_for_room_owner\n unless whoami_owns_room?(ChatRoom.find(params[:id]))\n flash[:notice] = \"You do not have permissions to archive this room\"\n redirect_to chat_rooms_url\n end\n end",
"title": ""
},
{
"docid": "5d89f396667481beacb2a6139c764e2a",
"score": "0.6012677",
"text": "def check_membership\n unless @room.members.member? @user_id\n head :unauthorized\n end\n end",
"title": ""
},
{
"docid": "737a4b4e27ce5e17a5619314026113df",
"score": "0.6005041",
"text": "def room\n\n if User.exists?(username:params[:username])\n\n @username = params[:username]\n\n @user = User.find_by_username(params[:username])\n @user_theme = UsersTheme.find_by_user_id(@user.id)\n\n set_room_user @user\n @skip_header = true\n @skip_footer = true\n @room_backgroud_color = true\n\n\n\n respond_to do |format|\n format.html\n format.json { render json:@user.as_json(only: [:id,:name, :username, :image_name ]) }\n end\n else\n redirect_to(root_path)\n end\n end",
"title": ""
},
{
"docid": "c2d7011e95e952c1457515f56091d74d",
"score": "0.59800273",
"text": "def room\n client.room || raise(APIError, 'User is not currently in a room')\n end",
"title": ""
},
{
"docid": "6544a9d8d4dc98f20008bd53aa589505",
"score": "0.59732807",
"text": "def empty?\n users.empty?\n end",
"title": ""
},
{
"docid": "410f76ab21de93c2b0249427698b80d5",
"score": "0.5944099",
"text": "def refresh_live_status\n # only check if flag is live\n if self.status.live?\n is_live = NuveHook::Nuve.live_room?(self.hash_token)\n unless is_live\n self.update_attributes(status: :pending)\n begin\n NuveHook::Nuve.delete_room(self.hash_token)\n rescue\n Rails.logger.info \"Couldn't delete licode room\"\n end\n end\n end\n\n self.status.live?\n end",
"title": ""
},
{
"docid": "99a8416824f6c221c312886b9a06983d",
"score": "0.5933522",
"text": "def rooms_set?\n venue.present? && venue.rooms.count > 0\n end",
"title": ""
},
{
"docid": "883acd63f109e12d41f8a8615e037276",
"score": "0.59250563",
"text": "def member_of_room?(room)\n RoomUser.exists?(room_id: room.id, user_id: id)\n end",
"title": ""
},
{
"docid": "52c551660d805149e5a30186b4579ed7",
"score": "0.5919852",
"text": "def room\n ## shows items user has created in room, in the view ##\n\t@user = current_user\n\ti = Item.check_timeout() ##checks if item has timedout and should be unclaimed\n\n respond_to do |format|\n format.html # room.html.erb\n format.json { render json: @user }\n end\n end",
"title": ""
},
{
"docid": "8468c0028b85268ec47017e8f1e7f6a9",
"score": "0.59188545",
"text": "def verify_room_ownership\n bring_to_room unless @room.owned_by?(current_user)\n end",
"title": ""
},
{
"docid": "484ddfaa767c8e4965ac7e29dfbbc758",
"score": "0.5918347",
"text": "def recently_request_rooms?\n @requested_rooms\n end",
"title": ""
},
{
"docid": "d3ec82a10d8ff62d379e4a976be3f59b",
"score": "0.5895989",
"text": "def no_users\n if ! self.resource.nil?\n update_game({ :started => false })\n self.reset(true)\n end\n end",
"title": ""
},
{
"docid": "44199529bb49c92536e3ba338da6e30b",
"score": "0.5885859",
"text": "def index\n @rooms = Room.any_of( {:_id.in => current_user.profile.playing_rooms.map{ |u| u._id.to_s}}, {:is_private => false })\n end",
"title": ""
},
{
"docid": "d53bfac55f5c772851dc4ecb773ae948",
"score": "0.5874374",
"text": "def insert_current_user_into_room\n\t\troom = Room.find(params[:id])\n\n\t\tif room.full?\n\t\t\tredirect_to rooms_url(@hotel.id), alert: \"Quarto está cheio. Tente outro.\"\n\t\telse\n\t\t\tcurrent_user.update(room_id: room.id)\n\t\t\tredirect_to rooms_url(@hotel.id), notice: \"Você está no quarto #{room.number} do hotel #{room.hotel.name}\"\n\t\tend\n\tend",
"title": ""
},
{
"docid": "082d3d6f691197b0304ae1b7398022f6",
"score": "0.58563787",
"text": "def empty?\n user.empty?\n end",
"title": ""
},
{
"docid": "cec0a4ce18b916f25981120c2f2dc154",
"score": "0.5835376",
"text": "def check_in(guest, room_name)\n if !room_exists?(room_name)\n puts 'sorry, room does not exist'\n else\n if @rooms[room_name].add_occupant(guest)\n puts 'check in successful'\n else\n puts 'sorry, room is full'\n end\n end\n end",
"title": ""
},
{
"docid": "8fe7bbe890fbacb97117dd7b1033e1ea",
"score": "0.5831323",
"text": "def is_member?(room)\n if RoomUser.find_by(room_id: room.id, user_id: self.id)\n true\n else\n false\n end\n end",
"title": ""
},
{
"docid": "ced63f9a9be962459f10150887950d82",
"score": "0.58310604",
"text": "def room\n\n if User.exists?(username:params[:username])\n\n # We set a few variables for the room - the user's name, a user object, and the user's theme.\n # We ought to use them.\n @username = params[:username]\n @user = User.find_by_username(params[:username])\n @user_theme = UsersTheme.find_by_user_id(@user.id)\n\n\n # Here we set a cookie\n set_room_user @user\n\n # Note: we also have access to a function that checks to see if the room user is the same as the user\n\n # SET STATIC CONTENTS\n @static_contents = StaticContent.all\n\n\n\n @skip_header = true\n @skip_container = true\n @skip_footer = true\n @room_backgroud_color = true\n\n\n\n respond_to do |format|\n format.html\n format.json { render json:@user.as_json(only: [:id,:name, :username, :image_name ]) }\n end\n else\n redirect_to(root_path)\n end\n end",
"title": ""
},
{
"docid": "5e2c0497e3f286318af93bc1f0b5a24c",
"score": "0.5800682",
"text": "def create\n if @room.has_space? && @room.status == 'open'\n @user = User.create(name: params[:name])\n @user.name = @user.name+'1' if @room.has_name_already?(@user)\n @user.room = @room\n if @user.save\n render json: @user\n else\n render json: {error:\"User could not be created\"}, status: 400\n end\n else\n render json: {error:\"The room is full, only 6 players are allowed per room\"}, status: 400 if !@room.has_space?\n render json: {error:\"This room is not open and cannot be joined\"}, status: 400 if @room.status != 'open'\n end\n end",
"title": ""
},
{
"docid": "48730f51e9d024e92523aaa2cf791e1d",
"score": "0.5774638",
"text": "def join(user)\n # Check if the user already joined the room or the room is open\n if not self.join?(user) and not self.is_full? and self.status == ROOM_STATUS[:open]\n self.users << user\n self.set_user_status(user, USER_STATUS[:join])\n self.edit_occupancy\n return self.save\n else\n return false\n end\n end",
"title": ""
},
{
"docid": "dd8b406453e2501b97730cd2d5451012",
"score": "0.5759246",
"text": "def force_reload_for_uid?(uid, full)\n (not @roster.get_user(uid) and not full) ? true : false\n end",
"title": ""
},
{
"docid": "46b0423008b0e71ef4980bd5c3333452",
"score": "0.5750525",
"text": "def check_in(guest, room)\n if room.current_space > 0\n room.add_guest_to_room(guest)\n room.add_to_tab(15.00)\n else\n room.clear_room\n end\n end",
"title": ""
},
{
"docid": "30256cadfa27c375dffebabdae33a658",
"score": "0.57385993",
"text": "def checkin\n update_attributes(:room_id => nil)\n end",
"title": ""
},
{
"docid": "322a97a261a84ae1bad632bb153c9032",
"score": "0.57358825",
"text": "def room_exists?(room_name)\n if @rooms.include?(room_name)\n return true\n end\n false\n end",
"title": ""
},
{
"docid": "f36a2609a0d0d21a43dc5418f45865d4",
"score": "0.5722992",
"text": "def room_user?(user)\n user == room_user\n end",
"title": ""
},
{
"docid": "7961f15ec03d6d443e40001a5b1406ad",
"score": "0.57173634",
"text": "def new\n @have_users = User.not_portus.any?\n super\n end",
"title": ""
},
{
"docid": "2aa510a31718cad29b8e82ba58983d62",
"score": "0.5709567",
"text": "def update_clearlist(room)\n\t\tcleared = @clearlist[room.id]\n\t\t\n\t\t@clearlist[room.id] = true\n\t\t\n\t\treturn cleared\n\tend",
"title": ""
},
{
"docid": "a6fea3191b790a78ed62210c90310fa7",
"score": "0.5697258",
"text": "def user_room_status\n results = []\n self.users.each do |user|\n user_json = {}\n user_json[:name] = user.name\n user_json[:email] = user.email\n user_json[:status] = self.user_status(user)\n results << user_json\n end\n results\n end",
"title": ""
},
{
"docid": "9c8955aafd4f18783c0eaac38a2e999e",
"score": "0.5689155",
"text": "def garbage_check(id)\n\t return @rooms.include?(id)\n\tend",
"title": ""
},
{
"docid": "9c8955aafd4f18783c0eaac38a2e999e",
"score": "0.5689155",
"text": "def garbage_check(id)\n\t return @rooms.include?(id)\n\tend",
"title": ""
},
{
"docid": "7941f2742b858c47841e98cddb6b7bc5",
"score": "0.56867415",
"text": "def all_users_ready?\n ready = true\n self.users.each do |user|\n if self.user_status(user) != USER_STATUS[:ready]\n ready = false\n end\n end\n # return ready\n ready\n end",
"title": ""
},
{
"docid": "bf8fd580e5fe90c08d03b1f6848dea4a",
"score": "0.56829184",
"text": "def join?(user)\n # Update the room -> user based on user_id\n\n # return true if the user can join the room; otherwise false\n users.include?(user)\n end",
"title": ""
},
{
"docid": "cbfc5f4a9f8835a80f14232f5735e322",
"score": "0.56785995",
"text": "def new\n @have_users = User.any?\n super\n end",
"title": ""
},
{
"docid": "7a012e194a1755f20ed7538b08c8f171",
"score": "0.5678134",
"text": "def room_availability_check\n if room.present? && !room.available?(check_in, check_out)\n errors.add(:room, \"is not available right now and booked already\")\n end\n end",
"title": ""
},
{
"docid": "5f1533ee50d9e45ed9bd8e1d159ad8af",
"score": "0.5655794",
"text": "def ensure_user_exists\n \n return false unless ensure_building_exists;\n \n attempt_to_load_user();\n \n if @user == nil\n redirect_to :action=>:login and return false;\n elsif @user.business.building != @building\n add_error \"USER AND BUILDING DON'T MATCH\";\n logout and return false;\n end\n \n @business = @user.business;\n \n return true;\n end",
"title": ""
},
{
"docid": "0302297163e50a82a3ecf62c18f5278e",
"score": "0.565449",
"text": "def update_users\n\t\t unless user_ids.blank?\n\t\t self.meeting_users.each do |p|\n\t\t p.destroy unless (user_ids.include?(p.user_id.to_s))\n \t user_ids.delete(p.user_id.to_s) \n \t\t end\n \t\tuser_ids.each do |c|\n \tself.meeting_users.create(:user_id => c) unless c.blank?\n \t\tend\n \t\treload\n\t\tend\n\tend",
"title": ""
},
{
"docid": "fbf4b5371ef8bf9c146d150b0f126f5d",
"score": "0.56433284",
"text": "def newRoom?\n @params[:sid].blank? && @params[:request_ids].blank? \n end",
"title": ""
},
{
"docid": "6ff126f124cf3a09b5ea0d5320708f86",
"score": "0.56433254",
"text": "def manage_rooms\n @userId = UserService.find_user session[:user]\n @ListOfRooms = RoomService.find_all();\n @RoomTypes = RoomTypeService.find_all()\n @ListOfBuildings = BuildingService.find_all()\n @RoomList = []\n @ListOfBuildings.each {|b|\n rooms = RoomService.find_all_in_building(b)\n @RoomList << [b,rooms]\n }\n end",
"title": ""
},
{
"docid": "8da92c67b4ead410a5df11dcc5593225",
"score": "0.5640448",
"text": "def check_availability_and_confirm\n if free_room.present?\n reservation = free_room.reservations.build(reservation_params.merge(user: user))\n reservation.save\n else\n reservation = Reservation.new\n reservation.errors.add(:room, \"not available\")\n end\n reservation\n end",
"title": ""
},
{
"docid": "bcf0105d745fb57cadfd073ccdce648b",
"score": "0.5637787",
"text": "def room_in_mem?( name )\r\n\t\t\treturn ! @rooms[ name.to_sym ].nil?\r\n\t\tend",
"title": ""
},
{
"docid": "b2fafdf6b1556df9c71204b844bbcf46",
"score": "0.56355286",
"text": "def add_user(user)\n params = { room_id: id, user_id: user.id }\n if open\n RoomUser.create(params) unless RoomUser.exists?(params)\n true\n else\n false\n end\n end",
"title": ""
},
{
"docid": "cd22b7839a926f33c80103c6e6a71fad",
"score": "0.56322044",
"text": "def set_room\n @room = Room.joins(:house).where('\"houses\".owner_id=?',current_user.id).find(params[:id],:readonly=>false)\n @facilities = listOfRoom\n @selected_facilities = value_to_array(@room.facilities)\n end",
"title": ""
},
{
"docid": "d8e09f0ade62454005f503c6fb0e7f35",
"score": "0.56321466",
"text": "def find_availabe_rooms\n @all_rooms.find_all { |room| room.count_customers == 0}\n end",
"title": ""
},
{
"docid": "2bc22b04b7ee04d64c2d9f9981e75b26",
"score": "0.5617645",
"text": "def show\n @user = current_user\n isAreadyInside = RoomsUsers.find_by_user_id_and_room_id(@user.id,@room.id)\n if(isAreadyInside == nil)\n #New user enter to the room\n RoomsUsers.create!({:user_id => @user.id, :room_id => @room.id})\n\n @usersIn= @room.users.reverse!\n @privateMessages={}\n\n @usersIn.each { |u| \n if u.id != current_user.id\n @privateMessages[u.id] = Message.where(\" messages.room_id = ? and ((messages.to = ? and messages.user_id = ?) or (messages.to = ? and messages.user_id = ?))\",@room.id,current_user.id,u.id,u.id,current_user.id)\n end\n }\n\n @messages = @room.messages.where('\"messages\".\"to\" is NULL')\n\n @new_message = Message.new\n\n #PrivatePub.publish_to(\"/rooms/#{@room.id}\", \"console.log('entro otra nea')\")\n render :layout => \"chat_layout\"\n else\n redirect_to(root_url, :notice => \"It seems you're already on that room\")\n end\n end",
"title": ""
},
{
"docid": "b4b95483eef6d5f23f493e9cd50bfb3b",
"score": "0.5616524",
"text": "def create\n add_users_to_room\n end",
"title": ""
},
{
"docid": "01c62ae4fd742afb545c81dc973648f3",
"score": "0.5616098",
"text": "def assigned?\n return true unless @room.nil?\n false\n end",
"title": ""
},
{
"docid": "755c76c8a5732ebbb3065e4cd4a703e8",
"score": "0.5599159",
"text": "def room_is_full?()\n if @guests.count < @capacity\n return false\n else\n return true\n end\n end",
"title": ""
},
{
"docid": "66afa85aefe5661f5cec30e2c5dd151b",
"score": "0.55981123",
"text": "def my_room \n if current_user != @room.activity.user\n head(:unauthorized)\n end\n end",
"title": ""
},
{
"docid": "a5527dd4c1919795b5cfd8461b0beb33",
"score": "0.5595146",
"text": "def refreshedRooms site, options\n @roomList.reloadData\n \n # Only select all rooms on first run\n if options[\"select\"]\n \n # Start join process for rooms you were in before loading application\n _rooms = Preferences.sharedPreferences.getRooms\n\n # Get the last active room, then fire the event on each room list item (to join it), then set the last active room in the defaults.\n # Firing the event updates the 'last_active_room', so this is a bit of a workaround.\n last_active_room = Preferences.sharedPreferences.getDefault(:last_active_room)\n site.rooms.values.each do |room|\n if _rooms.include?(room.id)\n @roomList.selectView room.listItemView\n end\n end\n\n Preferences.sharedPreferences.setDefault(last_active_room, :last_active_room)\n \n # Reload room list\n @roomList.deselectAllViews\n @roomList.reloadData\n\n # Select the room that was last active, if one exists\n last_active_room = Preferences.sharedPreferences.getDefault(:last_active_room)\n @last_joined_room = site.rooms[last_active_room] unless site.rooms[last_active_room].nil?\n \n # Make sure to select it if it's ever been found, since deselectAllViews gets called once for each site!\n if @last_joined_room && @last_joined_room.joined\n @roomList.selectView @last_joined_room.listItemView\n @selected = @last_joined_room.controller\n end\n \n end\n\n window.setTitle(\"#{@selected.site.title} - #{@selected.room.title}\") if !@selected.nil? && site.rooms.values.size == 0\n\tend",
"title": ""
},
{
"docid": "255612c9dbea031f5892f5e0af67eb3e",
"score": "0.5577938",
"text": "def index\n @rooms = Room.all\n #@rooms = current_user.rooms if current_user.present?\n end",
"title": ""
},
{
"docid": "a96b05ede981399fe7e24cf520a700c6",
"score": "0.55711895",
"text": "def filled_up\n \t# if event.capacity?\n self.users.count >= self.capacity\n # else\n # false\n # end\n end",
"title": ""
},
{
"docid": "2ece0a1c545b22f852c7506539ae3665",
"score": "0.55623525",
"text": "def userAvailable(id,ws)\n allData = ws.rows.flatten\n gsNRows = ws.num_rows\n if allData.exclude?(id.to_s)\n ws[gsNRows+1,1] = id\n ws[gsNRows+1,2] = 0\n ws[gsNRows+1,3] = Time.now.utc\n ws[gsNRows+1,4] = 5\n ws.save\n ws.reload\n return true\n end\nend",
"title": ""
},
{
"docid": "dd71aef3833326e1ee4881f986a31f80",
"score": "0.5562149",
"text": "def member?(room)\n\t\trooms.include?(room)\n\tend",
"title": ""
},
{
"docid": "d90894cd0b93b596011c20bff3b3ee88",
"score": "0.5536333",
"text": "def before_destroy\n if self.listings.empty? \n true\n else\n errors.add_to_base(\"A user who has listings cannot be removed.\") \n false\n end\n end",
"title": ""
},
{
"docid": "7f21d8ec5b10c9e6680829e82d175731",
"score": "0.55357504",
"text": "def check_for_chat_room_member\n unless @chat_room.participants.include?(@whoami)\n flash[:notice] = \"You are not a member of this chat room\"\n redirect_to(chat_rooms_url)\n end\n end",
"title": ""
},
{
"docid": "ae249cc97c34b5acb773b5753d833755",
"score": "0.55319715",
"text": "def set_rooms_user\n @rooms_user = RoomsUser.find(params[:id])\n end",
"title": ""
},
{
"docid": "7b01942d39e54ff47799ab210344fefa",
"score": "0.5531594",
"text": "def is_owner?(room)\n if room.user_id == self.id\n true\n else\n false\n end\n end",
"title": ""
},
{
"docid": "367b7f6890c71bf726fd215e93cf9d35",
"score": "0.5526887",
"text": "def room_availability_check\n if rooms.present? && !rooms.available?(start_date, last_date)\n errors.add(:rooms, \"is not available right now and booked already\")\n end\n end",
"title": ""
},
{
"docid": "14ce291c4d7bd2a21034a146de768c94",
"score": "0.55251676",
"text": "def set_room\n @room = current_user.chat_rooms.find_by(id: params[:id])\n redirect_to chat_rooms_path unless @room\n end",
"title": ""
},
{
"docid": "2ef61df9a9ccc8b9d48c89724881381a",
"score": "0.5509482",
"text": "def show\n# if @room.public\n @room.add_member @user_id\n render :template => 'rooms/show.xml.builder', :layout => false\n=begin\n if @room.invited(room_params[:user_id]) == false\n head :unauthorized\n else\n render :template => 'rooms/show.xml.builder', :layout => false\n end \n end\n=end else\n end",
"title": ""
},
{
"docid": "345f5fec52df475f5bb750756cd92223",
"score": "0.55072707",
"text": "def your_reservations\n @rooms = current_user.rooms\n end",
"title": ""
},
{
"docid": "4382ffe3930ba13bafd7eb330c868191",
"score": "0.55025357",
"text": "def setEmptyRoom\n @map[@currentRoom-1][6] = 0\n end",
"title": ""
},
{
"docid": "adf0d837fb3ffe020b42409d4382ec10",
"score": "0.54951566",
"text": "def set_room\r\n if Room.exists?(id: params[:id])\r\n @room = Room.find(params[:id])\r\n else\r\n redirect_to root_path\r\n end\r\n end",
"title": ""
},
{
"docid": "8006003e5eca7191260c0c66e6e32106",
"score": "0.5493277",
"text": "def show\n\t\n @room = Room.find(params[:id])\n @user = get_user\n \n session[:room_id] = @room.id #Needed for adding to favorites\n @fav = Favorite.for_user(session[:user_id]).find(:first, :conditions => ['room_id = ?', @room.id])\n \n \n @college= @room.college\n @room_profile = RoomProfile.find(:first, :conditions => ['room_id = ?', params[:id]])\n #FIX THIS so that \"Request this room\" doesn't show if the renter has already requested the room\n @renter = Renter.find(:first, :conditions => ['user_id = ?', @user.id])\n @reserved = Transaction.find(:first, :conditions => ['room_id = ? and renter_id = ?', @room.id, @renter.id])\n @host = Host.find(:first, :conditions => ['user_id = ?', @user.id])\n \n @room_host = User.find(:first, :conditions => ['id = ?', @room.host.user_id])\n @host_profile = Profile.find(:first, :conditions => ['user_id = ?', @room_host.id])\n \n \n\t\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @room }\n end\n end",
"title": ""
},
{
"docid": "4834761a32e584c04d8d95b39ad4d7a8",
"score": "0.5490384",
"text": "def empty?\n @json_data['users'].empty?\n end",
"title": ""
},
{
"docid": "95dfbfd703f924dc7fc9300b127b968f",
"score": "0.548779",
"text": "def join\n @room.users << current_user\n render json: @room, status: :ok\n end",
"title": ""
},
{
"docid": "5522bd949cd59ca72cf85b569d2dc865",
"score": "0.5476832",
"text": "def starred\n @chatroom = Chatroom.new\n @rooms = current_user.get_starred_chatrooms\n end",
"title": ""
},
{
"docid": "1e2df61048398df03babb392386df33a",
"score": "0.54765624",
"text": "def set_room\n @room = current_user.rooms.find(params[:id] || params[:room_id])\n end",
"title": ""
},
{
"docid": "2a33f50d13d732f8bccc5e4ec1e8aee0",
"score": "0.5476177",
"text": "def set_rooms\n\t@rooms = Room.all\n end",
"title": ""
},
{
"docid": "25728c401cab909e6425d87599f25b1a",
"score": "0.54759735",
"text": "def show\n @chatroom = Chatroom.find(params[:chatroom_id])\n @chatroom_user = @chatroom.chatroom_users.where(user_id: current_user.id).first_or_create\n @chatroom_user.update_attribute(:admin, true)\n redirect_to @chatroom\n end",
"title": ""
},
{
"docid": "2d93423ca704fb1e15320a58962b1e7f",
"score": "0.546844",
"text": "def ais_in_room\n @@ais_in_room.select { |ai| puts ai.username }\n end",
"title": ""
},
{
"docid": "fc7bc04cfd218f9a205962209b558de3",
"score": "0.54667294",
"text": "def roster(room)\n [user]\n end",
"title": ""
},
{
"docid": "69128dd56df755487b2fbb34433f50f3",
"score": "0.54666096",
"text": "def check_in(guests)\n set_max_capacity()\n @max_capacity > @guest_list.count() ? @guest_list.push(*guests) : \"Room #{@name} is full\"\n end",
"title": ""
},
{
"docid": "c508b4666f80cee208133d51b428ce87",
"score": "0.54633266",
"text": "def room\r\n return @room || Room.inactive_room\r\n end",
"title": ""
},
{
"docid": "326904744000e40a235d82d00818d432",
"score": "0.5454077",
"text": "def show\n \n @room = Room.find(params[:id])\n flash[:notice] = nil\n\n if !session[:user_id]\n session[:return_to_controller] = 'room'\n session[:return_to_action] = 'roomManager'\n redirect_to :controller=>'account', :action=> 'login'\n return\n end\n\n @am = session[:am]\n acc = Account.find_by_username(session[:user_id])\n if(acc.nil?)\n flash[:notice] = \"Need to login first\"\n session[:return_to_controller] = 'rooms'\n session[:return_to_action] = 'show'\n redirect_to :controller=>'account', :action=> 'login'\n return\n end\n\n @roomName = @room.roomName\n @roominfo = @am.getRoomInfo(@room.roomName) if !@room.roomName.nil?\n\n if(!@roominfo.nil? and @roominfo.isConnected == true)\n room = Room.find_by_roomName(@room.roomName) if !@room.roomName.nil?\n @users = User.find_all_by_room_id(room.id) if !room.nil?\n else\n flash[:notice] = @room.roomName + \" is disconnected.\"\n end\n\n \n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @room }\n end\n end",
"title": ""
},
{
"docid": "c73e15ec56790a1af63c9cde25cf8d9f",
"score": "0.5453461",
"text": "def set_room\n @room = current_user.rooms.find(params[:id])\n end",
"title": ""
},
{
"docid": "c430917eda42ba4484755fa9d448a460",
"score": "0.5453325",
"text": "def add_member(user)\n if self.locked\n self.members.create(:user_id=>user.id) if self.members.where(:user_id=>user.id).blank?\n false\n else\n self.members.create(:user_id=>user.id,:status=>'approval') if self.members.where(:user_id=>user.id).blank?\n true\n end\n end",
"title": ""
},
{
"docid": "31e38e51669f1482683745d45c9b1966",
"score": "0.54530996",
"text": "def available?\n user_id.zero?\n end",
"title": ""
},
{
"docid": "c6664ea896426ac2f7e00f12f015f1e7",
"score": "0.5452691",
"text": "def empty?\n #Check whether any hazard exist\n # puts hazardRoom\n if !hazardRoom\n return true\n end\n return false \n end",
"title": ""
},
{
"docid": "bf60223e22e97ed1c4331fa14d719efc",
"score": "0.54311323",
"text": "def exist?\n userinfo.exist?\n end",
"title": ""
},
{
"docid": "4088775e16b3b8a06a0dfb6cf6039716",
"score": "0.54236495",
"text": "def room_availability_in_area\n\t @rooms = Room.find_is_available_area(params[:body][:franchisee_id],params[:body][:area_code],params[:body][:check_in].to_date,params[:body][:check_out].to_date)\n\tend",
"title": ""
},
{
"docid": "aa84ddecd32004e98caeaef351654642",
"score": "0.5422868",
"text": "def update_all?\n user.user?\n end",
"title": ""
},
{
"docid": "12eb5dc87d22d47ccc8e367e6e90e4cc",
"score": "0.54228115",
"text": "def live_session\n @room = Room.find(params[:room_id])\n user_registered = @conference.user_registered?(current_user)\n can_view = user_registered || current_user.roles.where(id: @conference.roles).any?\n\n if @room.url.present? && can_view\n current_user.mark_attendance_for_conference(@conference)\n else\n redirect_to conference_schedule_path(@conference),\n error: 'You cannot join this room yet. Please try again closer to the start of the event.'\n end\n end",
"title": ""
},
{
"docid": "5dd62c594a724ccc147e2729ee33f7a2",
"score": "0.542212",
"text": "def can_i_reserve?\n @room = Room.friendly.find(params[:id])\n !current_user || (!do_i_have_powers? && !current_user.reservations.exists?(room_id: @room.id))\n end",
"title": ""
},
{
"docid": "e136a1a9c04abf3d31476debec73aa2b",
"score": "0.5421283",
"text": "def populate_users\n create_system_users if User.table_exists? and User.count == 0\nend",
"title": ""
},
{
"docid": "17104443c61cbc752ccad52a36fda132",
"score": "0.54086614",
"text": "def reading_room_client?\n false\n end",
"title": ""
},
{
"docid": "4603438df5712d59dabb2d4e49aa44c9",
"score": "0.54010147",
"text": "def index\n @rooms = find_latest_rooms\n # if @rooms.blank?\n # Room.generateNewRoomOnTheHour\n # size = (Roombase.all).size\n # while @rooms.size != size\n # @rooms = find_latest_rooms\n # end\n # end\n end",
"title": ""
}
] |
64e30dd5f3109461b953d3bf6826a97a | DELETE /proyectos/1 DELETE /proyectos/1.json | [
{
"docid": "586b2ec4bc191be6d3e9a0fcef469bd0",
"score": "0.7202633",
"text": "def destroy\n @proyecto.destroy\n respond_to do |format|\n format.html { redirect_to proyectos_url }\n format.json { head :no_content }\n end\n end",
"title": ""
}
] | [
{
"docid": "b1a17c1ee1af05c79fe156622df44818",
"score": "0.72127426",
"text": "def delete(path)\n begin\n response = client[path].delete :accept => 'application/json'\n rescue Exception => e\n puts e.inspect\n end\n end",
"title": ""
},
{
"docid": "773e5d611adeb09776f9c841e1b876cc",
"score": "0.70486176",
"text": "def delete_json(path, params = {}, headers = {})\n json_request(:delete, path, params, headers)\n end",
"title": ""
},
{
"docid": "b445c184893647d3482f8fbc6a507a52",
"score": "0.70401883",
"text": "def delete(path, params = {})\n path += '.json'\n res = @connection.delete(path, @header)\n parse_response(res)\n end",
"title": ""
},
{
"docid": "01215bdc50e2a927cc0d7ba54e5d48d3",
"score": "0.7012569",
"text": "def destroy\n @proyect.destroy\n respond_to do |format|\n format.html { redirect_to proyects_url, notice: 'Proyect was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "beb0d7f2ad87e99879b9f09eca6f901c",
"score": "0.69968206",
"text": "def destroy\n @proyecto.destroy\n respond_to do |format|\n format.html { redirect_to proyectos_url, notice: 'Se borró el proyecto exitosamente' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "bbb1479e670b5ec444ef4211650bfb2c",
"score": "0.69834304",
"text": "def destroy\n @procon = Procon.find(params[:id])\n @procon.destroy\n\n respond_to do |format|\n format.html { redirect_to procons_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "65875f15a253a4fa4f1bbe6c701c1915",
"score": "0.69779223",
"text": "def destroy\n @proyecto.destroy\n respond_to do |format|\n format.html { redirect_to proyectos_url, notice: 'Proyecto borrado.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "641f9352ab31ef66a24767e4c82b39e1",
"score": "0.6977564",
"text": "def destroy\n @prodotto = Prodotto.find(params[:id])\n @prodotto.destroy\n\n respond_to do |format|\n format.html { redirect_to prodotti_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "ed3c15dfc72a312ed468df218a76ca7e",
"score": "0.69432664",
"text": "def destroy\n @proyecto.destroy\n respond_to do |format|\n format.html { redirect_to proyectos_url, notice: 'Proyecto was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1b0af3d53700c03759074051e7e0bafc",
"score": "0.6922902",
"text": "def destroy\n @proyect.destroy\n respond_to do |format|\n format.html { redirect_to menu_investigacion_1_path, notice: 'La actividad se elimino con exito.' }\n format.json { head :no_content }\n end\n\n end",
"title": ""
},
{
"docid": "fc89f49ea22c97b0b2a387e1ae19ac48",
"score": "0.6917797",
"text": "def destroy\n @proyecto = Proyecto.find (params[:id])\n @proyecto.destroy\n respond_to do |format|\n format.html { redirect_to '/mostrar_proyectos', notice: 'Documento eliminado.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "440a13da8da829cb04e1785decae5b97",
"score": "0.6905406",
"text": "def delete\n Proyecto.destroy(params[:id])\n redirect_to proyectos_path\n end",
"title": ""
},
{
"docid": "e012511ae558c052410a1381a535cf13",
"score": "0.6901317",
"text": "def destroy\n @proyectominero3.destroy\n respond_to do |format|\n format.html { redirect_to proyectominero3s_url, notice: 'Proyectominero3 was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "0f2f42faee011429b1e9328b8c8efe4a",
"score": "0.68687814",
"text": "def destroy\n @hogar_proyect.destroy\n respond_to do |format|\n format.html { redirect_to hogar_proyects_url, notice: 'Hogar proyect was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "fd53de37c76f9a53f9ddda3d50564e8a",
"score": "0.68589914",
"text": "def destroy\n @protesto.destroy\n respond_to do |format|\n format.html { redirect_to protestos_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "b9b34b33e0fe914d1fb8a01f64b1a67e",
"score": "0.68068594",
"text": "def destroy\n @presupuesto_inicial_proyecto.destroy\n respond_to do |format|\n format.html { redirect_to presupuesto_inicial_proyectos_url, notice: \"Presupuesto inicial proyecto was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "cc0f4845fb56c1d85d2c82f90eb6711a",
"score": "0.68059915",
"text": "def destroy\n @procedencium.destroy\n respond_to do |format|\n format.html { redirect_to procedencia_url, notice: 'La procedencia fue eliminada correctamente.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "8f20038262a9a4d72ce15e345042aade",
"score": "0.6805956",
"text": "def destroy\n @progect = Progect.find(params[:id])\n @progect.destroy\n\n respond_to do |format|\n format.html { redirect_to progects_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "6d2f5cc463347cca9e6cae9a547a1df5",
"score": "0.68022585",
"text": "def destroy\n @caracteristicas_proyecto.destroy\n respond_to do |format|\n format.html { redirect_to caracteristicas_proyectos_url, notice: 'Caracteristicas proyecto was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "ba57d71f3b95ed0e444e5cb2ef4677d5",
"score": "0.6802029",
"text": "def destroy\n @anteproyecto.destroy\n respond_to do |format|\n format.html { redirect_to anteproyectos_url, notice: 'Anteproyecto was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "698603775139cb7889f24e9b2515f523",
"score": "0.6789103",
"text": "def destroy\n @prodotti.destroy\n respond_to do |format|\n format.html { redirect_to prodottis_url, notice: \"Prodotti was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "bd01164c6edd3314ec13ec01f586fae8",
"score": "0.67864054",
"text": "def destroy\n @pelicula = Pelicula.find(params[:id])\n @pelicula.destroy\n render json: {message: 'Eliminated'}, status: :ok\n\n end",
"title": ""
},
{
"docid": "3ea4a9a832a83077e9863037e574ec34",
"score": "0.678323",
"text": "def destroy\n @proyecto = Proyecto.find(params[:id])\n @proyecto.destroy\n\n respond_to do |format|\n format.html { redirect_to(proyectos_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "fdef1380137e9615bda387f980b13dd4",
"score": "0.67785656",
"text": "def destroy\n @prospecto = Prospecto.find(params[:id])\n @prospecto.destroy\n\n respond_to do |format|\n format.html { redirect_to prospectos_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "9106867cee9e8775ba817195d3bc2020",
"score": "0.67728716",
"text": "def delete_rest(path) \n run_request(:DELETE, create_url(path)) \n end",
"title": ""
},
{
"docid": "dc6d522d0409971453f6af7bd6070644",
"score": "0.6771364",
"text": "def destroy\n @proceso.destroy\n respond_to do |format|\n format.html { redirect_to procesos_url, notice: 'El proceso fue eliminado con éxito.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "22d613cd950f8d6a8cbd0e0ce0ff0bca",
"score": "0.6771026",
"text": "def destroy\n @anteproyecto.destroy\n respond_to do |format|\n format.html { redirect_to anteproyectos_url, notice: 'El anteproyecto fue satisfactoriamente eliminado.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "2eda5ca0a894a625643b638ddd51f91b",
"score": "0.6758467",
"text": "def destroy\n @proceso.destroy\n respond_to do |format|\n format.html { redirect_to procesos_url, notice: 'Proceso was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "4bd0acde57f2cb3cf07dd5db63d52b4c",
"score": "0.6755685",
"text": "def destroy\n @identificacion_proyecto.destroy\n respond_to do |format|\n format.html { redirect_to identificacion_proyectos_url, notice: 'Identificacion proyecto was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "b1e2fbd7398eb1cc0d6d5e0571f37d61",
"score": "0.67551327",
"text": "def destroy\n @proceso.destroy\n respond_to do |format|\n format.html { redirect_to procesos_url, notice: \"Proceso was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "f8306c4fb385030525b8c53e79b1b730",
"score": "0.6750934",
"text": "def destroy\n @proyecto_id = @punto.proyecto_id\n @punto.destroy\n respond_to do |format|\n format.html { redirect_to controller: \"puntos\", action: \"index\", proyecto_id: @proyecto_id }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "e59696d385f8c67c7ff4a9bb8ab085ae",
"score": "0.6739617",
"text": "def destroy\n @producao.destroy\n respond_to do |format|\n format.html { redirect_to producaos_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "4c1c164b581dbae14285797e584e8fb7",
"score": "0.6739225",
"text": "def delete_tenant_circle(args = {}) \n delete(\"/tenantcircles.json/#{args[:circleId]}\", args)\nend",
"title": ""
},
{
"docid": "0387aa3c568d857184e97a214e580a14",
"score": "0.6738811",
"text": "def delete(path, params = {}, payload = {})\n JSON.parse Generic.delete(@base_url, @headers, path, params, payload)\n end",
"title": ""
},
{
"docid": "663787a6bd0f9d5b16534d8199bd7929",
"score": "0.67375267",
"text": "def destroy\n @promocion = Promocion.find(params[:id])\n @promocion.destroy\n\n respond_to do |format|\n format.html { redirect_to promociones_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "0bb6a4d0e257d708a1e43fa77e18033e",
"score": "0.6723548",
"text": "def destroy\n @pia_ocotals_proyecto = PiaOcotalsProyecto.find(params[:id])\n @pia_ocotals_proyecto.destroy\n\n respond_to do |format|\n format.html { redirect_to(pia_ocotals_proyectos_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "c1cde2518cb592b6add14fe05ae1b37d",
"score": "0.6719108",
"text": "def delete\n options = self.to_h \n uri = self.class.path_builder(:delete, self.id)\n data = {}\n data['id'] = self.id \n data = data.to_json\n VivialConnect::Client.instance.make_request('DELETE', uri, data)\n end",
"title": ""
},
{
"docid": "682f861dfae7ed2b8903a8cfb87e6afe",
"score": "0.67135304",
"text": "def destroy\n @actividad_proyecto.destroy\n respond_to do |format|\n format.html { redirect_to actividades_proyectos_url, notice: 'Actividad proyecto was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "3b6e71435585e0fe445bb86f65f16a30",
"score": "0.671253",
"text": "def destroy\n @v2_pessoa.destroy\n respond_to do |format|\n format.html { redirect_to v2_pessoas_url, notice: \"Pessoa was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "6005b9b7e2c4d0f509483ab9884b1d75",
"score": "0.6705881",
"text": "def destroy\n @propietario = Propietario.find(params[:id])\n @propietario.destroy\n \n respond_to do |format|\n flash[:notice] = \"Propietario eliminado exitosamente\"\n format.html { redirect_to propietarios_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1abb26bf31f5093c3848b2927ff648be",
"score": "0.6705",
"text": "def destroy\n @aplicacion = Aplicacion.find(params[:id])\n @aplicacion.destroy\n\n respond_to do |format|\n format.html { redirect_to aplicaciones_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "9410f5d5c06a5d4acee3b61e4f080658",
"score": "0.670314",
"text": "def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end",
"title": ""
},
{
"docid": "9410f5d5c06a5d4acee3b61e4f080658",
"score": "0.670314",
"text": "def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end",
"title": ""
},
{
"docid": "9410f5d5c06a5d4acee3b61e4f080658",
"score": "0.670314",
"text": "def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end",
"title": ""
},
{
"docid": "ed624a826b7802bc99f7fabb917704ab",
"score": "0.669573",
"text": "def destroy\n @orgao_sistema_proprio.destroy\n respond_to do |format|\n format.html { redirect_to orgao_sistemas_proprios_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "28bd18c4fd8609e62f97769a53448785",
"score": "0.6692134",
"text": "def destroy\n @puesto = Puesto.find(params[:id])\n @puesto.destroy\n\n respond_to do |format|\n format.html { redirect_to puestos_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "e1d9ee58019f47666ff7eb509f66d1f9",
"score": "0.66868764",
"text": "def destroy\n @proceso = Proceso.find(params[:id])\n @proceso.destroy\n\n respond_to do |format|\n format.html { redirect_to(procesos_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "159f039562ea84f11fe28f5c7dad5d9e",
"score": "0.6684888",
"text": "def destroy\n @provi = Provi.find(params[:id])\n @provi.destroy\n\n respond_to do |format|\n format.html { redirect_to provis_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "6a19ba99f0d1f7225b5ed73fe068136d",
"score": "0.6682235",
"text": "def delete(path, params: {}, headers: {})\n request_json :delete, path, params, headers\n end",
"title": ""
},
{
"docid": "409510a7999dbcf8a0a53f86d2545881",
"score": "0.6681067",
"text": "def destroy\n @prodotto.destroy\n respond_to do |format|\n format.html { redirect_to prodottos_url, notice: 'Prodotto was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "99f1cef4426fe4c4a9c6fee22f69b17b",
"score": "0.6678421",
"text": "def destroy\n @opcione.destroy\n respond_to do |format|\n format.html { redirect_to opciones_url, notice: 'Opcione was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "8f6517e174b707badace2daafbe6d151",
"score": "0.66776264",
"text": "def destroy\n @prodotto.destroy\n respond_to do |format|\n format.html { redirect_to prodottos_url, notice: \"Prodotto was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a6856d895dc2552da18b118d9e76dff0",
"score": "0.66735977",
"text": "def destroy\n @produto = Produto.find(params[:id])\n @produto.destroy\n\n respond_to do |format|\n format.html { redirect_to produtos_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "ba67ebd85114998e01be10599c8943ca",
"score": "0.667235",
"text": "def delete(path)\n RestClient.delete request_base+path\n end",
"title": ""
},
{
"docid": "f57488830e1ae18466c48a26722fd7d7",
"score": "0.6672113",
"text": "def destroy\n @proyectoetapa.destroy\n respond_to do |format|\n format.html { redirect_to proyectoetapas_url, notice: 'Proyectoetapa was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "5667aabff619a13546d0275766c8d7ee",
"score": "0.6667615",
"text": "def destroy\n @proyecto = Proyecto.find(params[:id])\n @proyecto.destroy\n\n redirect_to(proyectos_url)\n end",
"title": ""
},
{
"docid": "7244714f519620c858204d5752488208",
"score": "0.66592175",
"text": "def destroy\n @prova.destroy\n respond_to do |format|\n format.html { redirect_to provas_url, notice: 'Prova was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "00c90bc63b0302afbbc4b2979ae20b57",
"score": "0.66548604",
"text": "def api_delete(path, data = {})\n api_request(:delete, path, :data => data).parsed\n end",
"title": ""
},
{
"docid": "2fa0a3656e86962ca1a10fa31aede189",
"score": "0.66537154",
"text": "def destroy\n @productos_json.destroy\n respond_to do |format|\n format.html { redirect_to productos_jsons_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "9c8ef0b4313fef9d26c4290371bc530d",
"score": "0.66532016",
"text": "def delete!\n client.delete(:path => base_path)\n nil\n end",
"title": ""
},
{
"docid": "a93d9a13574eb911c38a5d6e9aec4864",
"score": "0.6650215",
"text": "def destroy\n @propietario.destroy\n respond_to do |format|\n format.html { redirect_to propietarios_url, notice: 'Propietario was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "681bdc3e1d0103665d966d27434436fa",
"score": "0.66475797",
"text": "def destroy\n\t @empleado_proyecto.destroy\n\t respond_to do |format|\n\t format.json { head :no_content }\n\t end\n\tend",
"title": ""
},
{
"docid": "095787d103b998711c936f623db80dca",
"score": "0.6646968",
"text": "def destroy\n @proceso_detalle.destroy\n respond_to do |format|\n format.html { redirect_to proceso_detalles_url, notice: 'Proceso detalle was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "e04c4276c3163481210f8909b09b0e32",
"score": "0.6646422",
"text": "def destroy\n @servico_passeio.destroy\n respond_to do |format|\n format.html { redirect_to servico_passeios_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "d8c484ef247ad1a8ebfca1f29a66d22d",
"score": "0.66456556",
"text": "def destroy\n @ejercicio1 = Ejercicio1.find(params[:id])\n @ejercicio1.destroy\n\n respond_to do |format|\n format.html { redirect_to ejercicio1s_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "b6ac44edd621f4d220e665e0704a3ecc",
"score": "0.6643702",
"text": "def destroy\n @pessoa.destroy\n render json: @pessoa\n end",
"title": ""
},
{
"docid": "29a20243ec74dbc23ea6c08a4ffb2d67",
"score": "0.66425014",
"text": "def destroy\n @prodcuto.destroy\n respond_to do |format|\n format.html { redirect_to prodcutos_url, notice: 'Prodcuto eliminado satisfactoriamente.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "16a04e64629f7eb527a2345e0495ed2b",
"score": "0.6641429",
"text": "def destroy\n @profissional = Profissional.find(params[:id])\n @profissional.destroy\n\n respond_to do |format|\n format.html { redirect_to profissionais_url, notice: \"Profissional excluído com sucesso.\" }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "47a3c9c28e1fcd0fcae5ea58416b42bd",
"score": "0.6637257",
"text": "def delete(path)\n api :delete, path\n end",
"title": ""
},
{
"docid": "353213b42c4e781bb462ea2f73703ba5",
"score": "0.66370857",
"text": "def destroy\n @pessoa.destroy\n \n respond_to do |format|\n format.html { redirect_to pessoas_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "6fe663b0fca5bb810c3b5316f41c23fd",
"score": "0.6634488",
"text": "def destroy\n @progre.destroy\n respond_to do |format|\n format.html { redirect_to progres_url, notice: 'Progre was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "d1e18d91e72313108c17761e2a27f0e6",
"score": "0.66340727",
"text": "def destroy\n @proyecto_usuario.destroy\n respond_to do |format|\n format.html { redirect_to proyecto_usuarios_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "4ac0592812da86863b4954941a073482",
"score": "0.6632309",
"text": "def destroy\n @action = \"delete\"\n puts \"pase por aca destroy !\"\n @proyecto = Proyecto.find(params[:id])\n @proyecto.destroy\n\n respond_to do |format|\n format.html { redirect_to(proyectos_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "86a99d9b4b085c685cd36dda924be4da",
"score": "0.6631656",
"text": "def destroy\n @banco_proyecto.destroy\n respond_to do |format|\n format.html { redirect_to banco_proyectos_url, notice: 'Banco proyecto was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "d6a90567f69773cf7c21bf41968feff8",
"score": "0.6631431",
"text": "def destroy\n @exco = Exco.find(params[:id])\n @exco.destroy\n\n respond_to do |format|\n format.html { redirect_to excos_path }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "75a785bddc2252b3dfe08070dcb44399",
"score": "0.66275835",
"text": "def delete(args)\n if args[:json]\n post(args.merge(method: :delete))\n else\n get(args.merge(method: :delete))\n end\n end",
"title": ""
},
{
"docid": "660c8fb275102a2665b7efda9a1d7584",
"score": "0.6625117",
"text": "def destroy\n @tipologium = Tipologium.find(params[:id])\n @tipologium.destroy\n\n respond_to do |format|\n format.html { redirect_to tipologia_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "20cb2fee2e91d0b7fae286e3af101efb",
"score": "0.6624277",
"text": "def destroy\n @punto = Punto.find(params[:id])\n @punto.destroy\n\n respond_to do |format|\n format.html { redirect_to puntos_url(:proyecto_id=>@punto.proyecto_id) }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "173f0d8364d7c76c52d3a264609513d0",
"score": "0.66241056",
"text": "def destroy\n @envio.destroy\n respond_to do |format|\n format.html { redirect_to envios_url, notice: 'Envio was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1f48b238a108c515e4a5e44c2c6d9c22",
"score": "0.66240597",
"text": "def destroy\n @prochy.destroy\n respond_to do |format|\n format.html { redirect_to prochies_url, notice: 'Запись успешно удалена.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "9d855f873fb84d1e7c81ee58e0711a0e",
"score": "0.66236705",
"text": "def destroy\n @conexao.destroy\n respond_to do |format|\n format.html { redirect_to conexoes_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "78e386edaf9083574bee9d7122d651fb",
"score": "0.6622678",
"text": "def destroy\n @opcion.destroy\n respond_to do |format|\n format.html { redirect_to opcions_url, notice: 'Opcion was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "108f0ce96e0f4bbcc8879792c294aae8",
"score": "0.6614915",
"text": "def destroy\n @prospecto_ocupacion.destroy\n respond_to do |format|\n format.html { redirect_to prospecto_ocupaciones_url, notice: 'Prospecto ocupacion was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "b7aa5afb0632d570794ea7a026498672",
"score": "0.6614278",
"text": "def destroy\n @clientetipo = Clientetipo.find(params[:id])\n @clientetipo.destroy\n\n respond_to do |format|\n format.html { redirect_to clientetipos_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "c5138e13e0b0687225bebab0e1e85b57",
"score": "0.6613087",
"text": "def destroy\n @proyecto_minero.destroy\n respond_to do |format|\n format.html { redirect_to proyecto_mineros_url, notice: 'Proyecto minero was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "337eef30b257e13dc0d82a9dc013fc9c",
"score": "0.66118497",
"text": "def destroy\n @proj_arquitetonico.destroy\n respond_to do |format|\n format.html { redirect_to proj_arquitetonicos_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "6aacef0a41b0cab169d450bf06d67c78",
"score": "0.6604977",
"text": "def destroy\n @apuestum = Apuestum.find(params[:id])\n @apuestum.destroy\n\n respond_to do |format|\n format.html { redirect_to apuesta_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "62bd83caf7ad939b7afc6e1746f25b7b",
"score": "0.66025907",
"text": "def delete\n @layout = \"back\"\n puts \"Destruction en attente\"\n\n @produit.delete!\n respond_to do |format|\n format.html { redirect_to produits_url, notice: 'Produit was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "b6db2bfd7e105be65ed231e3d8849af0",
"score": "0.65991175",
"text": "def destroy\n @tiposuario.destroy\n respond_to do |format|\n format.html { redirect_to tiposuarios_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "befbbfee69356e2e8d74e3feb5d8ec0a",
"score": "0.6595699",
"text": "def destroy\n @puntaje = Puntaje.find(params[:id])\n @puntaje.destroy\n\n respond_to do |format|\n format.html { redirect_to puntajes_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "7951071c34197e98969cc3699b0b6c67",
"score": "0.6594958",
"text": "def destroy\n @produccion.destroy\n respond_to do |format|\n format.html { redirect_to produccions_url, notice: 'Produccion was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "89e1cfc5d43b449ffcc2998688852627",
"score": "0.65947264",
"text": "def destroy\n @prospy = Prospy.find(params[:id])\n @prospy.destroy\n\n respond_to do |format|\n format.html { redirect_to prospies_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "57b799133d29316426c358002043baa2",
"score": "0.6589739",
"text": "def delete_rest(path, headers={}) \n run_request(:DELETE, create_url(path), headers) \n end",
"title": ""
},
{
"docid": "ac051b7769e46d3cbab1d5fda84d7f00",
"score": "0.65891707",
"text": "def destroy\n @condominios = Condominio.find(params[:id])\n @condominios.destroy\n\n respond_to do |format|\n format.html { redirect_to condominia_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "822ddea2e45bf78350003645efcbdb54",
"score": "0.65867454",
"text": "def delete uri, args = {}; Request.new(DELETE, uri, args).execute; end",
"title": ""
},
{
"docid": "2d9d65720f35da4ec01561842f1d34b5",
"score": "0.6585766",
"text": "def destroy\n @experiencium = Experiencium.find(params[:id])\n @experiencium.destroy\n\n respond_to do |format|\n format.html { redirect_to experiencia_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "3fc09c47cf7791434e21495645d9870c",
"score": "0.65835965",
"text": "def destroy\n @punto_servicio = PuntoServicio.find(params[:id])\n @punto_servicio.destroy\n\n respond_to do |format|\n format.html { redirect_to punto_servicios_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "55c8641ba4c9f8f176ecbec1acdee55f",
"score": "0.65812415",
"text": "def destroy\n @usuarioequipo.destroy\n respond_to do |format|\n format.html { redirect_to usuarioequipos_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "5c402c8cb925a2bdb68860ebaef63c81",
"score": "0.657997",
"text": "def destroy\n @profesion = Profesion.find(params[:id])\n @profesion.destroy\n\n respond_to do |format|\n format.html { redirect_to profesiones_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "be967fe93439033b41867ffcb4131e45",
"score": "0.6579244",
"text": "def destroy\n @proprietario.destroy\n respond_to do |format|\n format.html { redirect_to proprietarios_url, notice: \"Proprietario foi apagado com sucesso.\" }\n format.json { head :no_content }\n end\n end",
"title": ""
}
] |
df66ae5493331483970019a5c8b2706d | Creates a new group object to perform operations base_name: is the dn of the base root. Returns a new Group object. Returns nil if the dn is not in the server. | [
{
"docid": "c822b6e19446def4cd4351c778bc2bda",
"score": "0.68426347",
"text": "def group(base_name)\n entry = domain(base_name).bind\n return unless entry\n\n if @virtual_attributes.enabled?\n VirtualGroup.new(self, entry)\n else\n Group.new(self, entry)\n end\n end",
"title": ""
}
] | [
{
"docid": "b3b8db5fd486f561f92444f445748df1",
"score": "0.71146464",
"text": "def get_or_create_group(name)\n require_relative 'group'\n Group.new(@api, @api.do_request(\"POST\", get_base_api_path() + \"/groups\", {'name' => name}))\n end",
"title": ""
},
{
"docid": "b3b8db5fd486f561f92444f445748df1",
"score": "0.71128786",
"text": "def get_or_create_group(name)\n require_relative 'group'\n Group.new(@api, @api.do_request(\"POST\", get_base_api_path() + \"/groups\", {'name' => name}))\n end",
"title": ""
},
{
"docid": "b3b8db5fd486f561f92444f445748df1",
"score": "0.71128786",
"text": "def get_or_create_group(name)\n require_relative 'group'\n Group.new(@api, @api.do_request(\"POST\", get_base_api_path() + \"/groups\", {'name' => name}))\n end",
"title": ""
},
{
"docid": "dc52a4b1095d8e2f03a8c673db00902e",
"score": "0.65202975",
"text": "def new_group(name, path = nil)\n main_group.new_group(name, path)\n end",
"title": ""
},
{
"docid": "d7c8186aa9b6408d11e6fca39ce69bde",
"score": "0.6394335",
"text": "def create_group(**data)\n return if data[:name].nil? # Breaks things in SSO!\n\n create_object(type: 'Group', data: data)\n end",
"title": ""
},
{
"docid": "44105f8f312c2dd586adc52e2f0d4931",
"score": "0.6364858",
"text": "def get_or_create_group\n if has_group?\n name = metadata['group']\n\n db = DB::Groups.find(name, pool)\n grp = load_group\n\n if db.nil?\n # The group does not exist, create it\n Commands::Group::Create.run!(\n pool: pool.name,\n name: grp.name\n )\n\n return DB::Groups.find(name, pool) || (fail 'expected group')\n end\n\n db\n\n else\n DB::Groups.default(pool)\n end\n end",
"title": ""
},
{
"docid": "0b72845c4ec355b714ed061372105091",
"score": "0.6316012",
"text": "def create_group(name)\n self.class.post(\"#{@url}/rest/user-management/groups\", basic_auth: @auth, body: generate_group_payload(name), headers: {'Content-Type' => 'application/json'})\n end",
"title": ""
},
{
"docid": "287d35e3e536a988db94e7aa572af1c0",
"score": "0.63111144",
"text": "def create_group(group)\n unless group.loaded?\n group_filter = Net::LDAP::Filter.eq(\"objectclass\", \"group\")\n # The return value will be false explicitly if the search fails,\n # otherwise it will be an array of entries. Therefore it is important\n # to check for false explicitly for a failure. A failure indicates\n # that the group needs to be created.\n found = @ldap.search(:base => group.distinguished_name,\n :filter => group_filter,\n :scope => Net::LDAP::SearchScope_BaseObject,\n :return_result => false)\n\n # The group should not already exist of course. This is to make sure\n # it is not already there in the case it was manually created but\n # matches a group that already exists.\n if found == false\n RADUM::logger.log(\"[AD #{self.root}]\" +\n \" create_group(<#{group.name}>)\", LOG_DEBUG)\n\n # Note that all the attributes need to be strings in this hash.\n attr = {\n :groupType => group.type.to_s,\n # All groups are of the objectclasses \"top\" and \"group\".\n :objectclass => [\"top\", \"group\"],\n :sAMAccountName => group.name\n }\n\n attr.merge!({\n :gidNumber => group.gid.to_s,\n :msSFU30Name => group.name,\n :msSFU30NisDomain => group.nis_domain,\n :unixUserPassword => group.unix_password\n }) if group.instance_of?(UNIXGroup)\n\n if group.instance_of?(UNIXGroup)\n attr.merge!({ :description => \"UNIX group #{group.name}\" })\n else\n attr.merge!({ :description => \"Group #{group.name}\" })\n end\n\n RADUM::logger.log(\"\\n\" + attr.to_yaml + \"\\n\\n\", LOG_DEBUG)\n @ldap.add :dn => group.distinguished_name, :attributes => attr\n check_ldap_result\n end\n\n # At this point, we need to pull the RID value back out and set it\n # because it is needed later. This is needed even if the group was\n # found and not created because it had not been loaded yet. Later\n # calls like create_user() look for the RID of the primary_group.\n entry = @ldap.search(:base => group.distinguished_name,\n :filter => group_filter,\n :scope => Net::LDAP::SearchScope_BaseObject).pop\n group.set_rid sid2rid_int(entry.objectSid.pop)\n # Note: unlike a user, the group cannot be considered loaded at this\n # point because we have not handled any group memberships that might\n # have been set. Users at this poing in the create_user() method\n # can be considered loaded. Just noting this for my own reference.\n end\n end",
"title": ""
},
{
"docid": "eba4e6c8f7ac7abbcc380d91489c637f",
"score": "0.6226837",
"text": "def create(name)\n response = @client.post('groups', name: name)\n verify response,\n bad_request: 'Field is invalid',\n forbidden: 'You do not have permission to create a group',\n internal_server_error: 'Server failed to create the group'\n end",
"title": ""
},
{
"docid": "db8bb50f6c35229c1eea871d5bf21820",
"score": "0.62092286",
"text": "def create\n name = group_params[:name]\n\n if LDAP::Group.create(name)\n render json: {success: true, message: \"group #{name} created.\"}, status: :ok\n else\n render json: {error: \"failed to create group\"}, status: :unprocessable_entity\n end\n rescue => e\n render json: {error: e.message}, status: :unprocessable_entity\n end",
"title": ""
},
{
"docid": "3168b71484939a00d29ed75e3e194b94",
"score": "0.620381",
"text": "def new_group(name, path = nil, source_tree = :group)\n group = project.new(PBXGroup)\n children << group\n group.name = name\n group.set_source_tree(source_tree)\n group.set_path(path)\n group\n end",
"title": ""
},
{
"docid": "21b75cdd2be176cba3b3b701d03b2794",
"score": "0.61999804",
"text": "def create_group(name, options = {})\n options[:name] = name\n object_from_response(GroupMe::Group, :post, '/groups', options)\n end",
"title": ""
},
{
"docid": "814f99b211822ae19ebf3ba7d830534a",
"score": "0.6145353",
"text": "def group\n return nil unless group_id\n @group ||= Group.new(@instance, group_id)\n end",
"title": ""
},
{
"docid": "814f99b211822ae19ebf3ba7d830534a",
"score": "0.6145353",
"text": "def group\n return nil unless group_id\n @group ||= Group.new(@instance, group_id)\n end",
"title": ""
},
{
"docid": "c93687484797622efa33fcaa0e5cd59d",
"score": "0.61351323",
"text": "def group_create(body, opts = {})\n group_create_with_http_info(body, opts)\n nil\n end",
"title": ""
},
{
"docid": "c6255bf719ca75fd20142c57fed0fbea",
"score": "0.61125636",
"text": "def create_group(name, member_of = [\"ALL\"], members = []) \n @group.create_new(name, member_of, members) \n rescue => e\n raise e\n end",
"title": ""
},
{
"docid": "cee2d5d7c828bcaccf80af52adddc76f",
"score": "0.6109989",
"text": "def create_group(name)\n return group = Group.create(name: name)\nend",
"title": ""
},
{
"docid": "98fff4aec4627e65adf99362da138322",
"score": "0.610648",
"text": "def create_group(groupname)\n payload = { group: {name: groupname}}\n endpoint = '/groups'\n url = self.base_url.to_s + endpoint.to_s + self.format.to_s\n self.post_data(url, payload)\n end",
"title": ""
},
{
"docid": "5120fc1d5de064ae9f71c26f4a5a09b5",
"score": "0.6061558",
"text": "def create_group(name, path)\n body = {:name => name, :path => path}\n post(\"/groups\", :body => body)\n end",
"title": ""
},
{
"docid": "5120fc1d5de064ae9f71c26f4a5a09b5",
"score": "0.6061558",
"text": "def create_group(name, path)\n body = {:name => name, :path => path}\n post(\"/groups\", :body => body)\n end",
"title": ""
},
{
"docid": "821c279faa1719695e3c1af4a6e05412",
"score": "0.6050672",
"text": "def create_group(attributes = {})\n elektron_identity.post(\"groups\") { { group: attributes } }.body[\"group\"]\n end",
"title": ""
},
{
"docid": "16767c6d48e70aa0940ffefa4b2570e5",
"score": "0.6029714",
"text": "def create_group(name, params = {})\n params[:name] = name\n post('groups', params)\n end",
"title": ""
},
{
"docid": "70cf1574bf8931dc34c2d25d46dbc7f2",
"score": "0.60085475",
"text": "def create(params = {})\n raise Exception.new(\"Missing required parameters: name, system_wildcard\") if params[:name].nil? || params[:system_wildcard].nil?\n raw_result = make_request('groups.json', 'post', {\"group[name]\" => params[:name], \"group[system_wildcard]\" => params[:system_wildcard]})\n Group.new(raw_result)\n end",
"title": ""
},
{
"docid": "6118d9ac75b38c5545032f2293dea2fd",
"score": "0.6001571",
"text": "def new_group(name, path = nil, source_tree = :group)\n main_group.new_group(name, path, source_tree)\n end",
"title": ""
},
{
"docid": "f6b3ba84d530780750580c9183e6ee05",
"score": "0.5996187",
"text": "def create_group(name, options = {})\n options[:name] = name\n post '/groups', options\n end",
"title": ""
},
{
"docid": "4700623f03adebce9dca1caf748aaa6a",
"score": "0.5985564",
"text": "def create_group(group_name, path = '/')\n request(\n 'Action' => 'CreateGroup',\n 'GroupName' => group_name,\n 'Path' => path,\n :parser => Fog::Parsers::AWS::IAM::CreateGroup.new\n )\n end",
"title": ""
},
{
"docid": "9707340adb808cb8a74e6593bdfc5778",
"score": "0.59807694",
"text": "def create_group(title)\n response = @api.post('groups/default/full', create_group_xml(title), {},\n 'Content-Type' => 'application/atom+xml')\n Group.new(Hashie::Mash.new(JSON.parse(response.body)).entry)\n end",
"title": ""
},
{
"docid": "1e18d1e1c31507bbfc9d4f726e203c29",
"score": "0.59587395",
"text": "def create_group(group_id, request)\n start.uri('/api/group')\n .url_segment(group_id)\n .body_handler(FusionAuth::JSONBodyHandler.new(request))\n .post()\n .go()\n end",
"title": ""
},
{
"docid": "12be72f0c66e0d5dde93866fc55d4eb2",
"score": "0.59531033",
"text": "def create_new_group(group_info)\n description = {\n :owner => group_info[:owner],\n :desc => group_info[:desc]\n }\n json = {\n :method => \"group_add\",\n :params => [ [], {\n :cn => group_info[:group_name],\n :description => description.to_s\n } ]\n }\n\n begin\n resp = _ipa_json_rpc json\n rescue\n return false \n end\n\n Rails.logger.debug \"create_new_group() => \" + resp.to_s + \" ==> \" + resp['result']['completed'].to_s\n if resp['result']['completed'] != 0\n # Add owner\n add_user group_info[:owner], group_info[:group_name]\n true\n else\n false\n end\n end",
"title": ""
},
{
"docid": "eed29c964e25be504f0dbb4cecf6ce19",
"score": "0.5946769",
"text": "def create_group(group_id, request)\n start.uri('/api/group')\n .url_segment(group_id)\n .body_handler(FusionAuth::JSONBodyHandler.new(request))\n .post()\n .go()\n end",
"title": ""
},
{
"docid": "fcd390abd28009247959aafc326003f4",
"score": "0.5946201",
"text": "def create(name)\n if all.include?(name)\n return false\n else\n result = Confluence.conn.addGroup(name)\n Confluence.logger.debug(\"Created group: #{name}\")\n end\n result\n end",
"title": ""
},
{
"docid": "889823289b1bdf38107e2675f0fde8e2",
"score": "0.5930303",
"text": "def create\n parent = Object.const_get(session[:group_type]).find(params[:id])\n begin\n Group.check_for_existing(parent, params[:group][:name], session[:group_type])\n @group = Object.const_get('Group').create(name: params[:group][:name], parent_id: parent.id)\n GroupNode.create(parent_id: parent.id, node_object_id: @group.id)\n undo_link(\"The group \\\"#{@group.name}\\\" has been successfully created.\")\n redirect_to action: 'list', id: parent.id\n rescue GroupExistsError\n flash[:error] = $ERROR_INFO\n redirect_to action: 'new', id: parent.id\n end\n end",
"title": ""
},
{
"docid": "90f47d811a8929cccf8dd5f7453d152e",
"score": "0.5924769",
"text": "def group\n Group.new(metadata[\"group\"])\n end",
"title": ""
},
{
"docid": "3b2ec4c944a0f591407d1d84bf185f11",
"score": "0.589893",
"text": "def find_group(name)\n NetCDF::Group.new(@netcdf_elmt.findGroup(name))\n end",
"title": ""
},
{
"docid": "f31d2a017777a7d104e103c0fd49c3e2",
"score": "0.58842486",
"text": "def group\n group_id = params[:group_id] || params[:id]\n @group ||= if group_id =~ /^\\d+$/\n Group.find group_id\n else\n Group.find_by_unix_group_name group_id\n end\n end",
"title": ""
},
{
"docid": "0614b44d6ac7d0cbf643b24250fa655a",
"score": "0.5882525",
"text": "def create_group(options={})\n Group.create self, options\n end",
"title": ""
},
{
"docid": "0614b44d6ac7d0cbf643b24250fa655a",
"score": "0.5882525",
"text": "def create_group(options={})\n Group.create self, options\n end",
"title": ""
},
{
"docid": "0614b44d6ac7d0cbf643b24250fa655a",
"score": "0.5882525",
"text": "def create_group(options={})\n Group.create self, options\n end",
"title": ""
},
{
"docid": "6dfdaf84fa0554b002bf8863bf40fb85",
"score": "0.5875997",
"text": "def addGroup name\n group = Modeles::Group.new :name => name\n ret = group.save\n if ret\n GroupInfos.new group\n end\n end",
"title": ""
},
{
"docid": "34aa235762d77b9f42a10eab867f5a9e",
"score": "0.58751965",
"text": "def create_full_group(creator, groupname, title = '', description = '')\n @sling.switch_user(creator)\n\n group = Group.new(groupname)\n\n params = {\"data\" => JSON.generate({\n \"id\" => groupname,\n \"title\" => title,\n \"description\" => description,\n \"joinability\" => \"yes\",\n \"visibility\" => \"public\",\n \"tags\" => [\"test-tag1\", \"test-tag2\"],\n \"worldTemplate\" => \"/var/templates/worlds/group/simple-group\",\n \"_charset_\" => \"utf-8\",\n \"usersToAdd\" => [{\n \"userid\" => creator.name,\n \"name\" => creator.name,\n \"firstname\" => creator.firstName,\n \"role\" => \"manager\",\n \"roleString\" => \"Manager\",\n \"creator\" => \"true\"\n }]\n })}\n\n result = @sling.execute_post(@sling.url_for($GROUP_WORLD_URI), params)\n @sling.switch_user(User.admin_user)\n if (result.code.to_i > 299)\n @log.error result.body\n return nil\n end\n\n # return the group that was created in create_target_group\n return group\n end",
"title": ""
},
{
"docid": "99f951493acca260df7348965548a2d8",
"score": "0.5867716",
"text": "def get_group(id)\n Group.new self, id\n end",
"title": ""
},
{
"docid": "99f951493acca260df7348965548a2d8",
"score": "0.5867716",
"text": "def get_group(id)\n Group.new self, id\n end",
"title": ""
},
{
"docid": "99f951493acca260df7348965548a2d8",
"score": "0.5867716",
"text": "def get_group(id)\n Group.new self, id\n end",
"title": ""
},
{
"docid": "5e24b677434b6b4d0b701e99ae02d973",
"score": "0.58485496",
"text": "def create_group(name)\n params = { name: name }\n\n request :post,\n '/v3/team/groups.json',\n params\n end",
"title": ""
},
{
"docid": "a23fed456bb301fd805263cb72d09112",
"score": "0.58478993",
"text": "def group(id)\n Group.new id, @api\n end",
"title": ""
},
{
"docid": "ba68bc41da2d57be6179a5a0276b6d3a",
"score": "0.5817525",
"text": "def create(name)\n Group.assert\n @name = name\n @path = Group.path_to name\n FileUtils.mkdir_p @path\n end",
"title": ""
},
{
"docid": "26c2b22930a4bbd9903ceeea2ec3d6f2",
"score": "0.5816757",
"text": "def group(name = nil)\n if name\n @group = name.to_s\n else\n @group ||= from_superclass(:group, \"standard\")\n end\n end",
"title": ""
},
{
"docid": "9ddf929c680b9d6a3d9361025e9f4352",
"score": "0.58149016",
"text": "def new \n @group = Group.new\n end",
"title": ""
},
{
"docid": "df0fcb4ea941defa1115631e74554d74",
"score": "0.5803143",
"text": "def add_group(group, server_name = nil)\n addr_group = session.railgun.util.alloc_and_write_wstring(group)\n # https://docs.microsoft.com/zh-cn/windows/win32/api/lmaccess/ns-lmaccess-group_info_1\n # Set up the GROUP_INFO_1 structure.\n group_info_1 = [\n addr_group,\n 0x0\n ].pack(client.arch == ARCH_X86 ? \"VV\" : \"QQ\")\n result = client.railgun.netapi32.NetGroupAdd(server_name, 1, group_info_1, 4)\n client.railgun.multi([\n [\"kernel32\", \"VirtualFree\", [addr_group, 0, MEM_RELEASE]], # addr_group\n ])\n return result\n end",
"title": ""
},
{
"docid": "356e325fd1beb382167bfa84063e0fda",
"score": "0.5795402",
"text": "def group(name = nil)\n if name\n @group = name.to_s\n else\n @group ||= from_superclass(:group, \"standard\")\n end\n end",
"title": ""
},
{
"docid": "79daa18dd8f2e72676aadbdbd82e5522",
"score": "0.5790548",
"text": "def group(group_name = nil)\n @group = group_name unless group_name.nil?\n @group\n end",
"title": ""
},
{
"docid": "7525861bff1082b009ed08f11497868a",
"score": "0.57842857",
"text": "def create_group(attributes = {})\n api.identity.create_group(group: attributes).data\n end",
"title": ""
},
{
"docid": "a065d734b5b05aa79fe3d24f881a382c",
"score": "0.5763278",
"text": "def group(name=nil)\n case name\n when nil\n @group ||= from_superclass(:group, 'standard')\n else\n @group = name.to_s\n end\n end",
"title": ""
},
{
"docid": "1a5c67f44c1d62f98b0eee28c8d5f274",
"score": "0.57632136",
"text": "def new\n @group = Group.new\n end",
"title": ""
},
{
"docid": "1a5c67f44c1d62f98b0eee28c8d5f274",
"score": "0.57632136",
"text": "def new\n @group = Group.new\n end",
"title": ""
},
{
"docid": "1a5c67f44c1d62f98b0eee28c8d5f274",
"score": "0.57632136",
"text": "def new\n @group = Group.new\n end",
"title": ""
},
{
"docid": "1a5c67f44c1d62f98b0eee28c8d5f274",
"score": "0.57632136",
"text": "def new\n @group = Group.new\n end",
"title": ""
},
{
"docid": "1a5c67f44c1d62f98b0eee28c8d5f274",
"score": "0.57632136",
"text": "def new\n @group = Group.new\n end",
"title": ""
},
{
"docid": "1a5c67f44c1d62f98b0eee28c8d5f274",
"score": "0.57632136",
"text": "def new\n @group = Group.new\n end",
"title": ""
},
{
"docid": "1a5c67f44c1d62f98b0eee28c8d5f274",
"score": "0.57632136",
"text": "def new\n @group = Group.new\n end",
"title": ""
},
{
"docid": "1a5c67f44c1d62f98b0eee28c8d5f274",
"score": "0.57632136",
"text": "def new\n @group = Group.new\n end",
"title": ""
},
{
"docid": "1a5c67f44c1d62f98b0eee28c8d5f274",
"score": "0.57632136",
"text": "def new\n @group = Group.new\n end",
"title": ""
},
{
"docid": "1a5c67f44c1d62f98b0eee28c8d5f274",
"score": "0.57632136",
"text": "def new\n @group = Group.new\n end",
"title": ""
},
{
"docid": "583692873ae05f6665a3c211b553fcfc",
"score": "0.57629853",
"text": "def object_group(group_name, create = false)\n group_name = group_name.nil? ? nil : group_name.to_s\n group = @runtime_groups[group_name]\n return group if group\n if create\n @runtime_groups[group_name] =\n WebkitRemote::Client::JsObjectGroup.new(group_name, self)\n else\n nil\n end\n end",
"title": ""
},
{
"docid": "dac771c7c6c28fd892f64a27b554eb9e",
"score": "0.5760901",
"text": "def group!( name )\n\t\t\tgroup = groups.find{|g| g.name == name}\n\t\t\tif group.nil?\n\t\t\t\tgroups << group = Group.new( name, [], [] )\n\t\t\tend\n\n\t\t\tgroup\n\t\tend",
"title": ""
},
{
"docid": "5063e4c015f2952e601aac7cac7aff45",
"score": "0.5754394",
"text": "def group(groupid = nil)\n Group.new(@api, @userid, groupid)\n end",
"title": ""
},
{
"docid": "3c0f8184d4cd5367ab58b763ce36a768",
"score": "0.57327586",
"text": "def create_node_group\n if @options[:an] && @options[:env]\n if @options[:pgn]\n @options[:pgn] = get_group_id_by_name(@options[:pgn].strip)\n else\n @options[:pgn] = get_group_id_by_name('default')\n end\n \n group_id = get_group_id\n \n group = Hash.new\n \n group['id'] = group_id unless group_id.nil?\n group['name'] = @options[:an]\n group['parent'] = @options[:pgn]\n group['environment'] = @options[:env].strip\n group['environment_trumps'] = @options[:override]\n group['classes'] = Hash.new\n \n begin\n @puppetclassify.groups.create_group(group)\n rescue Exception => e\n puts e.message\n puts e.backtrace\n end\n else\n raise OptionParser::MissingArgument\n end\n end",
"title": ""
},
{
"docid": "fda846f7724cb0cc0a47c31779da1f9f",
"score": "0.57128555",
"text": "def group\r\n @group || ( @group = Group.new( self ))\r\n end",
"title": ""
},
{
"docid": "e39670a3d6426b7b4bdf2ef3172fa140",
"score": "0.57100934",
"text": "def create\n @group = Group.create(group_params(:name, :description))\n if @group.valid?\n GroupMember.create(group_id: @group.id, user_id: @signed_in_user.id)\n redirect_to group_path(@group)\n else\n flash[:errors] = @group.errors.full_messages\n redirect_to new_group_path\n end\n end",
"title": ""
},
{
"docid": "1acfdeaff1d6b1b5722b7f3cfc064602",
"score": "0.5690542",
"text": "def group(name, &block)\n verify_key?(name)\n group = @group.find_group(name)\n unless group\n verify_available?(name, :group)\n group = @group.add_group(name)\n end\n \n # Chain it\n builder = self.class.new(group)\n builder.define(&block) if block\n builder\n end",
"title": ""
},
{
"docid": "91e838d26f355d4715c655485eeb8377",
"score": "0.56582046",
"text": "def create\n\t\t\n\t\t@group = Group.new(group_params)\n\t\t\n\t\t@group.users << current_user\n\t\t@group.leaders = [current_user.id.to_s]\n\t\t#The created group email should be \"group-name + group-id\", this will prevent people making groups of the same name\n\t\t# with matching emails. Also this makes it so we don't have to return a \"this group already exists\" error, which would\n\t\t# allow people to infer the name of groups on the system\n\t\t#We must save first to get an id generated however\n\t\tputs \"DEBUG===============\"\n\t\tgname = @group.group_name.gsub(/\\s/, \"\")\n\t\tputs gname\n\t\tputs \"====================\"\n\t\tif gname =~ /^[a-zA-Z0-9]+$/\n\t\t\t@group.save\n\t\t\t\n\t\t\t@group.email = gname + \"+\" + @group.id + $Domain\n\t\t\tputs \"DEBUG======2========\"\n\t\t\tputs @group.email\n\t\t\tputs \"====================\"\n\t\t\t# Passphrase for pgp keys is bull-s*** right now, may change later\n\t\t\tKeyGenerator::generatePGPkeyGPGme(@group.group_name, @group.email, \"asldkfjlksdjf\")\n\n\t\t\tcurrent_user.save\n\n\t\t\t\n\t\t\trespond_to do |format|\n\t\t\t\tif @group.save\n\t\t\t\t\tformat.html { redirect_to @group, notice: 'Group was successfully created.' }\n\t\t\t\t\tformat.json { render :show, status: :created, location: @group }\n\t\t\t\telse\n\t\t\t\t\tformat.html { render :new }\n\t\t\t\t\tformat.json { render json: @group.errors, status: :unprocessable_entity }\n\t\t\t\tend\n\t\t\tend\n\t\telse\n\t\t\trespond_to do |format|\n\t\t\t\tformat.html { redirect_to root_url, notice: 'Group was NOT created. Group name must be alpha-numeric characters.'}\n\t\t\tend\n\t\tend\n\n\tend",
"title": ""
},
{
"docid": "597bd95a85c0f4250cf1338c288359fa",
"score": "0.5655471",
"text": "def get_group(g_name)\n unless @groups.has_key?(g_name)\n @groups[g_name] = Group.new(g_name, self)\n LOG.debug{\"Added group '#{g_name}' to Volume '#{@name}'.\"}\n end\n return @groups[g_name]\n end",
"title": ""
},
{
"docid": "b166116a81332731545ad9f7894820fc",
"score": "0.5653258",
"text": "def create_user_group(group_name)\n path = self.api_root + \"/api/groups/#{group_name}\"\n process_firecloud_request(:post, path)\n end",
"title": ""
},
{
"docid": "ffda1e91650c9706c228495f363d807a",
"score": "0.56115603",
"text": "def new(attrs={})\n actor_and_group_names = attrs.delete(:actor_and_group_names) || attrs.delete(\"actor_and_group_names\")\n group = Group.on(group_db).new(attrs)\n group.database = group_db\n group.authz_id_mapper = authz_id_mapper\n group.mappers = mappers\n group.actor_and_group_names = actor_and_group_names if actor_and_group_names\n group\n end",
"title": ""
},
{
"docid": "e39193d89a68c509cf834126cfdbedc6",
"score": "0.5607334",
"text": "def create_group(name)\n if group_does_not_exist(name)\n @groups << ASEPalette::Group.new(name)\n true\n else\n raise Error, \"A group named #{name} already exists\"\n end\n end",
"title": ""
},
{
"docid": "bd54ddc921b1c98fa4b20954f43ff796",
"score": "0.56055546",
"text": "def group(name)\n groups.object_named(name)\n end",
"title": ""
},
{
"docid": "1b02d4a3790b47c965940d597958e59b",
"score": "0.5599503",
"text": "def create\n @group = Group.new\n @group.safe_update(%w[name legend description default_tags subdomain logo forum\n custom_favicon language theme custom_css wysiwyg_editor], params[:group])\n\n @group.safe_update(%w[isolate domain private], params[:group]) if current_user.admin?\n\n @group.owner = current_user\n @group.state = \"active\"\n\n @group.widgets << TagCloudWidget.new\n @group.widgets << TopUsersWidget.new\n @group.widgets << BadgesWidget.new\n\n respond_to do |format|\n if @group.save\n @group.add_member(current_user, \"owner\")\n flash[:notice] = I18n.t(\"groups.create.flash_notice\")\n format.html { redirect_to(domain_url(:custom => @group.domain, :controller => \"admin/manage\", :action => \"properties\")) }\n format.json { render :json => @group.to_json, :status => :created, :location => @group }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @group.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "aced71a297176c4613655d60c5e4f3ec",
"score": "0.55919015",
"text": "def group\n @group ||= self.class.group_name parts[11]\n end",
"title": ""
},
{
"docid": "7cd7517266f3b2d88067c07f52d2cef2",
"score": "0.5588998",
"text": "def create_group(group)\n post(\"group.update\", self.class.xml_doc.request { |r|\n r.name group\n })\n end",
"title": ""
},
{
"docid": "78eb154a6781d188843ec4f3a8a234fa",
"score": "0.5570851",
"text": "def find_or_create_group(name)\n found_groups = @groups.select { |group| group.name == name }\n if found_groups.length > 0\n found_groups[0]\n else\n new_group = ASEPalette::Group.new(name)\n @groups << new_group\n new_group\n end\n end",
"title": ""
},
{
"docid": "76efb8c0f55019148ed8a88f8edf961c",
"score": "0.55691046",
"text": "def get_group( name )\r\n if ( !@groups.has_key?( name ) )\r\n @groups[name] = Group.new( name )\r\n end\r\n return @groups[name]\r\n end",
"title": ""
},
{
"docid": "b3334101c253827daea785f36a1dab2e",
"score": "0.5568991",
"text": "def create_group(group_name, opts = {})\n data, _status_code, _headers = create_group_with_http_info(group_name, opts)\n data\n end",
"title": ""
},
{
"docid": "ef48f01999a96cbc129e7853e447fdf3",
"score": "0.5560866",
"text": "def new\n @group = current_user.new_group()\n end",
"title": ""
},
{
"docid": "2c9b3d90668b1366a94fdfe6711064cc",
"score": "0.5560802",
"text": "def create_group(group_info)\n members, api_path, api_calls = group_info[:members], group_info[:api_path], group_info[:api_calls]\n @groups << {members: members, api_path: api_path, api_calls: []}\n end",
"title": ""
},
{
"docid": "fd9f39cc3efe6fe6f40b3db68c98684b",
"score": "0.5559128",
"text": "def groups_create(options={})\n throw ArgumentError.new(\"Required arguments :name missing\") if options[:name].nil?\n post(\"groups.create\", options)\n end",
"title": ""
},
{
"docid": "fd9f39cc3efe6fe6f40b3db68c98684b",
"score": "0.5559128",
"text": "def groups_create(options={})\n throw ArgumentError.new(\"Required arguments :name missing\") if options[:name].nil?\n post(\"groups.create\", options)\n end",
"title": ""
},
{
"docid": "340e56b210ddc6f1ba07e399fc1faa3b",
"score": "0.55178124",
"text": "def create_group(group_name, project)\n project.main_group.groups.each do |group|\n if group.name == group_name\n group.remove_from_project()\n end\n end\n\n puts ''\n puts '---------------------'\n puts '🗂 Creating group 🗂'\n puts '---------------------'\n puts ''\n\n puts '💾 Creating group \"' + group_name + '\" on ' + project.path.to_s\n\n group = project.main_group.new_group(group_name)\n return group\nend",
"title": ""
},
{
"docid": "b7f47a7df7a527a4dfdcc4a1f71d6915",
"score": "0.55049086",
"text": "def create_contact_group!(params = {})\n cleaned = params.permit(:name)\n create(\"contact_groups\", cleaned)\n end",
"title": ""
},
{
"docid": "09864aff1eb0b6f4fe56a981c7804c44",
"score": "0.5499658",
"text": "def _add_group(e)\n # e.name should be group\n Msg.give_up('No group in cdb') unless e.name == 'group'\n gid = e.attr2item(@grps)\n ___add_member(e, gid)\n end",
"title": ""
},
{
"docid": "84563354c7941cd3bd46866486b7b306",
"score": "0.5498345",
"text": "def create_group(opts = {})\n data, _status_code, _headers = create_group_with_http_info(opts)\n return data\n end",
"title": ""
},
{
"docid": "d617f1e6399eb33b45d47e94c04b5dba",
"score": "0.54808336",
"text": "def create\n @group = Group.new(group_params)\n\n if @group.save\n render :show, status: :created, location: api_group_url(@group, format: :json)\n else\n render json: @group.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "be25d36c137ed2a43f7d9f103536feac",
"score": "0.54805887",
"text": "def newGroup(nameSpec, path=nil, sourceTree=nil)\n $stderr.puts(\"*** ERROR: No group name specified\") if !nameSpec || nameSpec.length == 0\n groupParts = nameSpec.split(':')\n parentGroup = self.rootGroup\n while groupParts.count > 1\n nextGroup = groupParts.shift\n matchingChildren = getObjectProperty(parentGroup, 'children').find_all {|child| getObjectProperty(child, 'name') == nextGroup}\n $stderr.puts(\"*** ERROR: Multiple sibling groups with the name '#{nextGroup}' [nameSpec=#{nameSpec}]\") if matchingChildren.count >= 2\n parentGroup = matchingChildren.count == 0 ? newGroupExplicit(nextGroup, parentGroup, nil, nil) : matchingChildren[0]\n end\n newGroupExplicit(groupParts.shift, parentGroup, path, sourceTree)\n end",
"title": ""
},
{
"docid": "fe54146c568b7d2131594c5c2ca5615e",
"score": "0.5479225",
"text": "def add_group(name, options = {})\n group = groups(name)\n if group.nil?\n group = Group.new(name, options)\n @groups << group\n end\n group\n end",
"title": ""
},
{
"docid": "5d13591bd14c7d99930b7992aa6ad752",
"score": "0.54757696",
"text": "def group(name)\n return H5Group.open(@id, name)\n end",
"title": ""
},
{
"docid": "332bae7091a59dd77ef05a3a4cd8ea3f",
"score": "0.54727894",
"text": "def create\n ldapPassword=File.open('config/password','r').first.split(\"\\n\")[0]\n auth = {:method=>:simple, :username=>\"cn=admin,dc=cws,dc=net\", :password=>ldapPassword}\n ldap=Net::LDAP.new(:host=>'ldap.cws.net', :port=>636, :auth=>auth, :encryption=>:simple_tls)\n \n #can we connect to the ldap server\n if ldap.bind\n treebase=\"ou=Group,dc=cws,dc=net\"\n attrs=[\"gidNumber\"]\n filter = Net::LDAP::Filter.eq( \"cn\", \"*\" )\n \n #find next available gidNumber \n gidNumber='1'\n ldap.search(:base=>treebase, :attributes=>attrs,:filter=>filter) do |entry|\n if entry[:gidnumber][0].to_i > gidNumber.to_i\n gidNumber=entry[:gidnumber][0]\n end\n end\n\n #prepare our data for entry to ldap\n dn=\"cn=#{groupname},ou=Group,dc=cws,dc=net\"\n attrs={ :cn=>groupname,\n :objectClass=> ['posixGroup','top'],\n :gidNumber=> gidNumber }\n\n #try to add new entry\n if ldap.add(:dn=>dn,:attributes=>attrs)\n true\n else\n ldaperror=ldap.get_operation_result\n errors.add \"ldap could not add group #{ldaperror}\",'ldap.add errors'\n errors.add attrs.to_s,'group_attributes'\n false\n end\n else\n ldaperror=ldap.get_operation_result\n errors.add \"ldap could not add group #{ldaperror}','ldap.add errors\"\n false\n end\n end",
"title": ""
},
{
"docid": "6a68bbe46de92ccb37cbe7e99a4898eb",
"score": "0.546524",
"text": "def group(name)\n return H5Group.open(@id, name)\n end",
"title": ""
},
{
"docid": "fd2dbcb03f2d8b5f220cf0d71d3fdaaa",
"score": "0.5464987",
"text": "def create\n params = group_params\n\n if !params.has_key?(:active)\n params[:active] = true\n end\n\n @group = Api::V1::Group.new(params)\n\n if @group.save\n render json: @group, status: :created\n else\n render json: @group.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "69975c5a2cb0e7499230e37b0d30a96d",
"score": "0.54566103",
"text": "def add_group(parent, name)\n NetCDF::GroupWriter.new(@netcdf_elmt.addGroup(parent, name))\n end",
"title": ""
},
{
"docid": "1ef338f552a80cb2487c855f151bc134",
"score": "0.5446212",
"text": "def [](group_name)\n groups[group_name] ||= Group.new\n end",
"title": ""
},
{
"docid": "92a62db9947ae39e2d5d132d822471e0",
"score": "0.5444007",
"text": "def create\n ::Domain::Person::Group::Command::CreateCommand.call(\n name: person_group_params[:name],\n accessible_user_id_param: current_access_user_id_param,\n parent_group_id_param: person_group_params[:parent_group_id_param]\n )\n\n redirect_to debug_person_groups_path, notice: 'Group was successfully created.'\n end",
"title": ""
}
] |
fd304c9e9b10f151c82036d197904bdb | Remove one or more zones from a load balancer. Returns a list of updated availability zones for the load balancer. elb.disable_availability_zones_for_load_balancer("testkd1", "useast1c") => ["useast1a"] | [
{
"docid": "49cc06ec175e142283c66f1b59d683c6",
"score": "0.7716844",
"text": "def disable_availability_zones_for_load_balancer(load_balancer_name, *availability_zones)\n availability_zones.flatten!\n request_hash = amazonize_list(\"AvailabilityZones.member\", availability_zones)\n request_hash.merge!( 'LoadBalancerName' => load_balancer_name )\n link = generate_request(\"DisableAvailabilityZonesForLoadBalancer\", request_hash)\n request_info(link, AvailabilityZonesForLoadBalancerParser.new(:logger => @logger))\n end",
"title": ""
}
] | [
{
"docid": "61a6e4a50c5d992a72c4622b84b420b8",
"score": "0.7996026",
"text": "def disable_availability_zones_for_load_balancer( options = {} )\n raise ArgumentError, \"No :load_balancer_name provided\" if options[:load_balancer_name].nil? || options[:load_balancer_name].empty?\n raise ArgumentError, \"No :availability_zones provided\" if options[:availability_zones].nil? || options[:availability_zones].empty?\n\n params = {}\n\n params['LoadBalancerName'] = options[:load_balancer_name]\n params.merge!(pathlist('AvailabilityZones.member', [options[:availability_zones]].flatten))\n\n return response_generator(:action => \"DisableAvailabilityZonesForLoadBalancer\", :params => params)\n end",
"title": ""
},
{
"docid": "9a70768f60ac6fc62245e9c4799c79ee",
"score": "0.7894173",
"text": "def disable_availability_zones_for_load_balancer(availability_zones, lb_name)\n params = Fog::AWS.indexed_param('AvailabilityZones.member', [*availability_zones])\n request({\n 'Action' => 'DisableAvailabilityZonesForLoadBalancer',\n 'LoadBalancerName' => lb_name,\n :parser => Fog::Parsers::AWS::ELB::DisableAvailabilityZonesForLoadBalancer.new\n }.merge!(params))\n end",
"title": ""
},
{
"docid": "c91527a1f8842b03f623ec5285ae7bcb",
"score": "0.62544185",
"text": "def load_balancers_to_remove\n @aws.load_balancer_names - @local.load_balancers\n end",
"title": ""
},
{
"docid": "e03f488fc478cc26e23c28968f8df4a5",
"score": "0.5912562",
"text": "def deregister_instances_from_load_balancer( options = {} )\n raise ArgumentError, \"No :instances provided\" if options[:instances].nil? || options[:instances].empty?\n raise ArgumentError, \"No :load_balancer_name provided\" if options[:load_balancer_name].nil? || options[:load_balancer_name].empty?\n params = {}\n params.merge!(pathhashlist('Instances.member', options[:instances].flatten.collect{|e| {:instance_id => e}}, {:instance_id => 'InstanceId'}))\n params['LoadBalancerName'] = options[:load_balancer_name]\n return response_generator(:action => \"DeregisterInstancesFromLoadBalancer\", :params => params)\n end",
"title": ""
},
{
"docid": "7993cfe9cbbaf58c0139ebb93f107a5f",
"score": "0.57767546",
"text": "def availability_zones\n return [az_from_subnet] if @subnet\n\n az_info = @compute.describe_availability_zones.body[\"availabilityZoneInfo\"]\n az_info.select { |x| x['zoneState'] == 'available' }.map { |x| x['zoneName'] }.sort\n end",
"title": ""
},
{
"docid": "f9c4cff6b24fe35daba0812083226230",
"score": "0.5675495",
"text": "def availability_zones\n zones = []\n @alb.availability_zones.each do |inst|\n zones << inst.zone_name\n end\n zones\n end",
"title": ""
},
{
"docid": "b6666618c133e2d88602d5c0a21186ba",
"score": "0.5668785",
"text": "def list_load_balancers(options={})\n response = lbreq(\"GET\",lbmgmthost,\"#{lbmgmtpath}/loadbalancers\",lbmgmtport,lbmgmtscheme)\n CloudLB::Exception.raise_exception(response) unless response.code.to_s.match(/^20.$/)\n balancers = CloudLB.symbolize_keys(JSON.parse(response.body)[\"loadBalancers\"])\n return options[:show_deleted] == true ? balancers : balancers.select{|lb| lb[:status] != \"DELETED\"}\n end",
"title": ""
},
{
"docid": "8a1b178ef6c859893aa5ce636f5975b0",
"score": "0.5577424",
"text": "def deregister_instances_with_load_balancer(load_balancer_name, *instances)\n instances.flatten!\n request_hash = amazonize_list(\"Instances.member.?.InstanceId\", instances)\n request_hash.merge!( 'LoadBalancerName' => load_balancer_name )\n link = generate_request(\"DeregisterInstancesFromLoadBalancer\", request_hash)\n request_info(link, InstancesWithLoadBalancerParser.new(:logger => @logger))\n end",
"title": ""
},
{
"docid": "b35db7c081bcf3c7e00c9dd72c70be57",
"score": "0.55230945",
"text": "def enable_availability_zones_for_load_balancer( options = {} )\n raise ArgumentError, \"No :load_balancer_name provided\" if options[:load_balancer_name].nil? || options[:load_balancer_name].empty?\n raise ArgumentError, \"No :availability_zones provided\" if options[:availability_zones].nil? || options[:availability_zones].empty?\n\n params = {}\n\n params['LoadBalancerName'] = options[:load_balancer_name]\n params.merge!(pathlist('AvailabilityZones.member', [options[:availability_zones]].flatten))\n\n return response_generator(:action => \"EnableAvailabilityZonesForLoadBalancer\", :params => params)\n end",
"title": ""
},
{
"docid": "fae1315f1ad5ce6779682042f9a93b44",
"score": "0.5386904",
"text": "def remove_ips(zone_name, ips)\n data = {}\n data[\"zone\"] = zone_name\n data[\"ips\"] = ips\n request(:delete, \"/api/zone/ips\", Oj.dump(data, mode: :compat))\n end",
"title": ""
},
{
"docid": "f63e7e86013a1c62bf202f2760c96f00",
"score": "0.5363442",
"text": "def availability_zones\n use do\n @ec2.availability_zones\n end\n end",
"title": ""
},
{
"docid": "2b980e2b5cbb14ae05b61ac28fc8c9fd",
"score": "0.52245075",
"text": "def dettach(instance_ids)\n instance_ids = [instance_ids] if instance_ids.is_a? String\n\n AWSConnection.elb.deregister_instances_from_load_balancer(\n :instances => instance_ids,\n :load_balancer_name => self.LoadBalancerName)\n end",
"title": ""
},
{
"docid": "1206a1c5cc7dac924bba2cf4622d4ba7",
"score": "0.5217166",
"text": "def enable_availability_zones_for_load_balancer(load_balancer_name, *availability_zones)\n availability_zones.flatten!\n request_hash = amazonize_list(\"AvailabilityZones.member\", availability_zones)\n request_hash.merge!( 'LoadBalancerName' => load_balancer_name )\n link = generate_request(\"EnableAvailabilityZonesForLoadBalancer\", request_hash)\n request_info(link, AvailabilityZonesForLoadBalancerParser.new(:logger => @logger))\n end",
"title": ""
},
{
"docid": "2ff0669be149e300951966fcbf11fa0a",
"score": "0.51701415",
"text": "def subnets\n subnetIds = []\n @alb.availability_zones.each do |inst|\n subnetIds << inst.subnet_id\n end\n subnetIds\n end",
"title": ""
},
{
"docid": "6a69dd794e8a413a61f2c25039c9d3d1",
"score": "0.51642764",
"text": "def turn_off_zone(zone=1)\n send_code(\"40#{module_address_for_zone(zone)}4#{zone}\")\n end",
"title": ""
},
{
"docid": "e95b064aa0e50a12d0a9c0c4ee7b893e",
"score": "0.51633316",
"text": "def availability_zones\n @elb.availability_zones\n end",
"title": ""
},
{
"docid": "6309a59333c1972d4bec41d98ad6c5c3",
"score": "0.5088657",
"text": "def list_zones\n params = {\n 'command' => 'listZones',\n 'available' => 'true'\n }\n json = send_request(params)\n json['zone'] || []\n end",
"title": ""
},
{
"docid": "6309a59333c1972d4bec41d98ad6c5c3",
"score": "0.5088657",
"text": "def list_zones\n params = {\n 'command' => 'listZones',\n 'available' => 'true'\n }\n json = send_request(params)\n json['zone'] || []\n end",
"title": ""
},
{
"docid": "173635515722a08ce166c29cfb65eb8d",
"score": "0.5078114",
"text": "def read_availability_zones\n az = @options[:availability_zone]\n supported_az = ec2_client(region).describe_availability_zones.availability_zones\n alive_az = supported_az.select { |zone| zone.state == 'available' }\n az_list = alive_az.collect(&:zone_name).map { |n| [n.last.to_sym, n] }.to_h\n\n # use all zones, specific one, or fail if zone is not supported in given region\n if az == 'all'\n az_list\n elsif az.split(',').map(&:to_sym).all?{|x| az_list.include?(x)}\n az_list.select { |k, _| az.split(',').map(&:to_sym).include?(k) }\n else\n fail(\"Requested zone #{az} is not supported in #{region}, supported ones are #{az_list.keys.join(',')}\")\n end\n end",
"title": ""
},
{
"docid": "75e3ce36c295ec15ded1a980920c906b",
"score": "0.50632703",
"text": "def excluded_from_zone(restrict_to_zone)\n excluded = []\n self.zones.each_pair do |shortname, seats|\n excluded += seats unless shortname == restrict_to_zone\n end\n excluded.sort\n end",
"title": ""
},
{
"docid": "483730f3f768c684543b8a05a1f354e2",
"score": "0.5044694",
"text": "def availability_zones\n data[:availability_zones]\n end",
"title": ""
},
{
"docid": "483730f3f768c684543b8a05a1f354e2",
"score": "0.5044694",
"text": "def availability_zones\n data[:availability_zones]\n end",
"title": ""
},
{
"docid": "483730f3f768c684543b8a05a1f354e2",
"score": "0.5044694",
"text": "def availability_zones\n data[:availability_zones]\n end",
"title": ""
},
{
"docid": "3b2188327dc53d9c068adb12bd44fcf7",
"score": "0.50165975",
"text": "def disable_zone(zone)\n set_zone_enabled(false, zone)\n end",
"title": ""
},
{
"docid": "5b377656f409840917d5ddba42443c7a",
"score": "0.5001215",
"text": "def disable_pull_zone zone_id, options={}\n request :disable, \"/#{self.company_alias}/zones/pull.json/#{zone_id}\"\n end",
"title": ""
},
{
"docid": "3ea1fced9b63b80f5e390e33a401a9cc",
"score": "0.49815038",
"text": "def describe_availability_zones(params)\n response = ERB.new(File.read(@config[:views]+\"/describe_availability_zones.erb\"))\n return response.result(binding), 200\n end",
"title": ""
},
{
"docid": "7ccd89583e46b4821a87f66ef88ba66f",
"score": "0.49295765",
"text": "def aws_delete_elb(elbname)\n AWSELB.connect() do |sock|\n sock.delete_load_balancer(elbname)\n end\nend",
"title": ""
},
{
"docid": "0cc6f35eb8f1315440b2d3def3c6b11f",
"score": "0.49151668",
"text": "def elbs\n @elbs ||= client.load_balancers\n end",
"title": ""
},
{
"docid": "1557fc32cd3c0c4bb43743e928219875",
"score": "0.49036282",
"text": "def remove_servers(*args)\n # Flatten params array\n args = args.flatten.compact\n servers = java.util.HashSet.new\n args.each do |s|\n servers.add(org.apache.hadoop.hbase.net.Address.fromString(s))\n end\n @admin.removeServersFromRSGroup(servers)\n end",
"title": ""
},
{
"docid": "b01c0277a5eea63f60580e42866698b5",
"score": "0.48872572",
"text": "def delete_loadbalancer(name)\n\n exists = aws_connection_elb.describe_load_balancers({\n load_balancer_names: [ name ], \n })\n if !exists.nil?\n resp = aws_connection_elb.delete_load_balancer({\n load_balancer_name: name, \n })\n if !resp.nil?\n return \"load balancer deleted successfully\",true\n\t\t else\n return \"we encountered error while deleting loadbalancer\",false\n\t\t end\n else\n return \"cloud not find the loadbalancer which you are trying to delete\",false\n end\n\n end",
"title": ""
},
{
"docid": "e5bcf9bf306b6700a65cc11929fc0ab6",
"score": "0.48780504",
"text": "def aws_deregister_elb(elbname, instance_id)\n AWSELB.connect() do |sock|\n elbderegister = sock.deregister_instances_from_load_balancer(instance_id, elbname)\n p elbderegister\n end\nend",
"title": ""
},
{
"docid": "eda3729ab816c79f5cb5cbb4364263a5",
"score": "0.48757097",
"text": "def deregister_instance_from_elb(elb)\n resp = aws_api_connect('ELB_Client')\n resp.deregister_instances_from_load_balancer({\n load_balancer_name: elb['name'],\n instances: [\n {\n instance_id: elb['instance_id'],\n },\n ],\n })\n end",
"title": ""
},
{
"docid": "0b9cf64bf394026ef513c13696d4a433",
"score": "0.48655263",
"text": "def filter_ris_availability_zone(ris)\n ris.reject { |ri| ri.scope == 'Region' }\n end",
"title": ""
},
{
"docid": "1daab0dac8375a6539b5b6eba9893451",
"score": "0.48147586",
"text": "def list_zones(headers = {})\n get!(\"zones\", {}, headers)\n end",
"title": ""
},
{
"docid": "28924635261fb7f63311ab94b454f7f1",
"score": "0.47977403",
"text": "def zone_names\n return [] if !exists?\n @zones.map { |zone| zone.split('/').last }\n end",
"title": ""
},
{
"docid": "fca41161a63c6986ad0fd776029b629d",
"score": "0.4783607",
"text": "def list_loadbalancers(attributes = {}, headers = {})\n Validators::Loadbalancer.validate_attributes!(attributes, :list)\n get!(\"loadbalancers\", attributes, headers)\n end",
"title": ""
},
{
"docid": "343d01d3b76fcad293801ead6f6c43b1",
"score": "0.47755668",
"text": "def ec2_blacklist(*instance_ids)\n instance_ids.each do |instance_id|\n @catalog.delete(instance_id)\n @blacklist[:ec2].push instance_ids\n end\n end",
"title": ""
},
{
"docid": "312a1f8d2390c7f9ad1df5f5e78a534c",
"score": "0.4767648",
"text": "def delete_load_balancer( options = {} )\n raise ArgumentError, \"No :load_balancer_name provided\" if options[:load_balancer_name].nil? || options[:load_balancer_name].empty?\n params = { 'LoadBalancerName' => options[:load_balancer_name] }\n return response_generator(:action => \"DeleteLoadBalancer\", :params => params)\n end",
"title": ""
},
{
"docid": "d0d290328086c288e9ef3df44280ec49",
"score": "0.47614107",
"text": "def destroy_load_balancer(load_balancer_id)\n destroy_resource :load_balancer, load_balancer_id\n end",
"title": ""
},
{
"docid": "68084ae2925b52e487ff3522b238ee72",
"score": "0.47558978",
"text": "def volume_availability_zones\n availability_zones\n end",
"title": ""
},
{
"docid": "71a0edf1f18055e75f1a5e06d14ce0a0",
"score": "0.47535336",
"text": "def delete_load_balancer(lb_id)\n request({\n 'Action' => 'DeleteLoadBalancer',\n 'LoadBalancerArn' => lb_id,\n :parser => Fog::Parsers::AWS::ELBV2::Empty.new\n })\n end",
"title": ""
},
{
"docid": "e60927714bbb01853b7f9a62bfdd97de",
"score": "0.4747784",
"text": "def ref_application_subnets\n availability_zones.map { |suffix, _| ref(\"ApplicationSubnet#{suffix.upcase}\") }\n end",
"title": ""
},
{
"docid": "3cf5ba803b7115bfe1693637b47a0672",
"score": "0.47410408",
"text": "def disable_backup_schedule!\n response = @connection.csreq(\"DELETE\",@svrmgmthost,\"#{@svrmgmtpath}/servers/#{URI.encode(self.id.to_s)}/backup_schedule\",@svrmgmtport,@svrmgmtscheme)\n CloudServers::Exception.raise_exception(response) unless response.code.match(/^20.$/)\n true\n end",
"title": ""
},
{
"docid": "b9fc2dc1c8e3feb8c1bfe9f42ab752aa",
"score": "0.472234",
"text": "def zones\n zones = []\n self.list_zones.data[:body][\"items\"].each do |z|\n if z[\"status\"] == \"UP\"\n zones.push z[\"name\"]\n end\n end\n\n return zones\n end",
"title": ""
},
{
"docid": "c8b836902de5b55d86c961431b192390",
"score": "0.47211555",
"text": "def disable_segments(datasource_name)\n segments = list_segments(datasource_name)\n segments.each { |segment| disable_segment(datasource_name, segment) }\n end",
"title": ""
},
{
"docid": "6a57b75e00faffd3c585a2ddb3ab461a",
"score": "0.46953171",
"text": "def delete\n\n client.delete_load_balancer_listeners(\n :load_balancer_name => load_balancer.name,\n :load_balancer_ports => [port])\n\n nil\n\n end",
"title": ""
},
{
"docid": "51a9b26e18cf2857357809640338404c",
"score": "0.46902254",
"text": "def zone_names\n return [] if !defined?(@region.zones) || @region.zones.nil?\n @region.zones.map { |zone| zone.split('/').last }\n end",
"title": ""
},
{
"docid": "483169a13f6acf14632bb3a442c22bb7",
"score": "0.4687521",
"text": "def discard_change_set\n @dyn.delete(\"ZoneChanges/#{@zone}\")\n end",
"title": ""
},
{
"docid": "a9645306a5f48ec3bea52c0da1d99d95",
"score": "0.46853808",
"text": "def balancer_all(options={})\n result = request(\n :path => '/loadbalancers',\n :method => :get,\n :expects => 200\n )\n result.fetch(:body, 'loadBalancers', []).map do |lb|\n Balancer.new(\n self,\n :id => lb[:id],\n :name => lb[:name],\n :state => lb[:status] == 'ACTIVE' ? :active : :pending,\n :status => lb[:status],\n :created => lb.get(:created, :time),\n :updated => lb.get(:updated, :time),\n :public_addresses => lb['virtualIps'].map{|addr|\n if(addr[:type] == 'PUBLIC')\n Balancer::Address.new(\n :address => addr[:address],\n :version => addr['ipVersion'].sub('IPV', '').to_i\n )\n end\n }.compact,\n :private_addresses => lb['virtualIps'].map{|addr|\n if(addr[:type] != 'PUBLIC')\n Balancer::Address.new(\n :address => addr[:address],\n :version => addr['ipVersion'].sub('IPV', '').to_i\n )\n end\n }.compact\n ).valid_state\n end\n end",
"title": ""
},
{
"docid": "cb63abd4e1704a5401c3b26d5ab067a4",
"score": "0.46700293",
"text": "def remove_availability\n if params[:av_id].index('recur')\n @avail = GuruRecurringAvailability.find(params[:av_id].split('_')[1])\n else\n @avail = GuruScheduledAvailability.find(params[:av_id])\n end\n @avail.destroy\n render :json => 1\n end",
"title": ""
},
{
"docid": "803d635ede82c61fce2a1a24acf814b8",
"score": "0.46431535",
"text": "def delete_load_balancer(lb_name)\n request({\n 'Action' => 'DeleteLoadBalancer',\n 'LoadBalancerName' => lb_name,\n :parser => Fog::Parsers::AWS::ELB::DeleteLoadBalancer.new\n })\n end",
"title": ""
},
{
"docid": "9dc8e7314aeb3a1cc07f8331a4ebc04b",
"score": "0.46410638",
"text": "def load_balancers_to_add\n @local.load_balancers - @aws.load_balancer_names\n end",
"title": ""
},
{
"docid": "b89f24f61a88cbcc35db33e7743cfecb",
"score": "0.46384907",
"text": "def lb_unregister_instance(credentials, opts={})\n raise Deltacloud::BackendFeatureUnsupported.new('501',\n 'Unregistering instances from load balancer is not supported in GoGrid')\n end",
"title": ""
},
{
"docid": "b8809ea551357e2d20d99fb22c955eb6",
"score": "0.46314988",
"text": "def delete_load_balancer_listeners(lb_name, load_balancer_ports)\n params = Fog::AWS.indexed_param('LoadBalancerPorts.member.%d', load_balancer_ports)\n\n request({\n 'Action' => 'DeleteLoadBalancerListeners',\n 'LoadBalancerName' => lb_name,\n :parser => Fog::Parsers::AWS::ELB::Empty.new\n }.merge!(params))\n end",
"title": ""
},
{
"docid": "95f18c299800dba7aad745e69a5424a1",
"score": "0.46248037",
"text": "def destroy\n @admin_balancer.destroy\n respond_to do |format|\n format.html { redirect_to admin_balancers_path, notice: I18n.t('deleted') }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "bdf8c5ecaa0e46224030514258cc0685",
"score": "0.4622575",
"text": "def stop_load_instances(num_instances)\n load_instances = get_instances().select{ |i| i[:auto_scaling_type].eql? 'load' }\n\n if num_instances > load_instances.length\n raise \"Can't stop #{num_instances} instances because the layer only has #{load_instances.length} load-based instances configured.\"\n end\n\n ids = []\n load_instances.select{ |i| launched? i }.take(num_instances).each do |i|\n puts \"stopping #{i[:hostname]} #{i[:auto_scaling_type]}\" if @verbose\n @client.stop_instance({:instance_id => i[:instance_id]})\n ids.push(i[:instance_id])\n end\n ids\n end",
"title": ""
},
{
"docid": "8a6c4a281e14490704114f8799594a6e",
"score": "0.4609407",
"text": "def detach_elb(elb_name)\n puts \"Detaching #{elb_name} from #{nice_name}\" if @verbose\n @client.detach_elastic_load_balancer({\n :elastic_load_balancer_name => elb_name,\n :layer_id => layer_id\n })\n end",
"title": ""
},
{
"docid": "fc0f4f7e1c11a75cbda509fe8a13ff6e",
"score": "0.4608662",
"text": "def zones_delete zID: \n call_adglare_api 'zones_delete', {zID: zID}\n end",
"title": ""
},
{
"docid": "50f7e9a17925665d55e01ee875554e07",
"score": "0.4607627",
"text": "def zones\n client.list_zones(secrets['compartment_id']).data.map(&:name)\n end",
"title": ""
},
{
"docid": "8b14c8261297da038a6ed158f688979f",
"score": "0.45992756",
"text": "def get_resource_to_az_mapping\n cidr_blocks = (get_available_cidr_blocks - get_application_cidr_blocks).dup\n availability_zones.map do |suffix, az|\n cidr_block = (begin\n subnet_id = get_resource(current_stack, \"ResourceSubnet#{suffix.upcase}\")\n Aws::EC2::Subnet.new(id: subnet_id, region: region).cidr_block\n end rescue nil) if current_stack\n\n Struct::Subnet.new(az, suffix, cidr_block || cidr_blocks.shift)\n end\n end",
"title": ""
},
{
"docid": "6f0054f4f6370bcc419698ebe4f279e0",
"score": "0.4595026",
"text": "def zones\n unless @zones\n @zones = []\n @block.call(self) if @block\n @block = nil\n @zones.freeze\n end\n \n @zones\n end",
"title": ""
},
{
"docid": "3f0e63e7e8b7a2e72a05d742bedfa376",
"score": "0.4586889",
"text": "def list_zones(network_id)\n request(:get, 'api/1/zones', network_id: network_id).zones\n end",
"title": ""
},
{
"docid": "70ec79afb2fd5001206c0c0250e6c591",
"score": "0.45842287",
"text": "def load_balancer_names\n data[:load_balancer_names]\n end",
"title": ""
},
{
"docid": "aa422ac6bbf28eeadd6318087a9c7f71",
"score": "0.4580611",
"text": "def lbs\n lb = client.get(:loadbalancers)\n msg = \"Status: #{lb.status}\"\n raise Idcf::Cli::CliError, msg if !lb.success? || lb.status != 200\n\n lb.body\n end",
"title": ""
},
{
"docid": "a927f6343e8e0c7f3f4defdab2d099bf",
"score": "0.45737207",
"text": "def list_zones\n a = self.client.list_hosted_zones[:hosted_zones]\n end",
"title": ""
},
{
"docid": "a198bc1f74c390f43da71171d3798324",
"score": "0.45661855",
"text": "def removed_outbounds\n outbound_diffs.reject { |o| o.type == RuleChange::ADD }.map(&:aws)\n end",
"title": ""
},
{
"docid": "7eb9a940f1726809a46ba0dee6498982",
"score": "0.45651618",
"text": "def list(opts = {})\n call('domain.zone.list', opts)\n end",
"title": ""
},
{
"docid": "4eadcb0f67086b0bb2824f86b3489cf0",
"score": "0.4558278",
"text": "def find_availability_zones\n find_dependent Occi::InfrastructureExt::Mixins::AvailabilityZone.new\n end",
"title": ""
},
{
"docid": "75ed359709a85be35d23d5768bdda379",
"score": "0.45459908",
"text": "def get_application_to_az_mapping\n cidr_blocks = get_available_cidr_blocks.dup\n availability_zones.map do |suffix, az|\n cidr_block = (begin\n subnet_id = get_resource(current_stack, \"ApplicationSubnet#{suffix.upcase}\")\n Aws::EC2::Subnet.new(id: subnet_id, region: region).cidr_block\n end rescue nil) if current_stack\n\n Struct::Subnet.new(az, suffix, cidr_block || cidr_blocks.shift)\n end\n end",
"title": ""
},
{
"docid": "8161e051566168059f498df9084cbe93",
"score": "0.4543972",
"text": "def get_zones\n request(\n :expects => 200,\n :method => 'GET',\n :parser => Fog::Parsers::DNS::Bluebox::GetZones.new,\n :path => '/api/domains.xml'\n )\n end",
"title": ""
},
{
"docid": "190f3ebca765588f7264e5277bada540",
"score": "0.45377213",
"text": "def zones_list zID: nil, zgID: nil \n call_adglare_api 'zones_list', {zId: zID, zgID: zgID}\n end",
"title": ""
},
{
"docid": "5d9b9c640d438b7e3006b117227a2abb",
"score": "0.4527171",
"text": "def reverse_dns_zones\n ip_blocks_sorted = ip_blocks.sort do |a, b|\n a.version <=> b.version # IPv4 to appear before IPv6\n end\n\n ip_blocks_sorted.map do |ip_block|\n ip_block.cidr_obj.arpa.chomp('.')\n end\n end",
"title": ""
},
{
"docid": "05b1501c5213de631100c9aad190d525",
"score": "0.45097095",
"text": "def find_elbs\n @client.describe_elastic_load_balancers({:stack_id => stack_id})[:elastic_load_balancers]\n end",
"title": ""
},
{
"docid": "069ca42f96053656cf745e05f8671ae9",
"score": "0.4502898",
"text": "def zones\n Google::Compute::ListableResourceCollection.new(\n :resource_class => Google::Compute::Zone, :dispatcher=>@dispatcher)\n end",
"title": ""
},
{
"docid": "226f386eb79355af6998a3f4f4f1b32d",
"score": "0.45005262",
"text": "def get_removable_hosts\n return [] if hosts.length <= 1\n removable_hosts = []\n hosts.select{ |h| not h.is_load_balancer? }.each do |host_instance|\n removable = true\n host_instance.roles.each do |role|\n next if get_hosts_by_role(role).length > 1\n removable = false\n break\n end\n if removable\n removable_hosts << host_instance\n end\n end\n removable_hosts\n end",
"title": ""
},
{
"docid": "c40111added45b5b1539eba205bf51f5",
"score": "0.44960675",
"text": "def destroy\n if lb\n lb.instances.each do |i|\n ec2(i).destroy\n end \n else\n ec2(instance).destroy\n end\n \n end",
"title": ""
},
{
"docid": "daa973f0a7ed96985b13e78e863b3b56",
"score": "0.44919515",
"text": "def destroy_load_balancer(_action_handler, _lb_spec, _lb_options)\n fail \"'destroy_load_balancer' is not implemented\"\n end",
"title": ""
},
{
"docid": "6e95ca374f9b0243084f1299b1178da6",
"score": "0.44807515",
"text": "def zone_names\n return [] if !exists?\n @zones.map { |zone| zone.split('/').last }\nend",
"title": ""
},
{
"docid": "412ad32256d2dbf2ae25abac40fe0210",
"score": "0.44744983",
"text": "def remove_blacklisted( *addr )\n\t\treturn self.unsubscribe( *addr, section: 'deny' )\n\tend",
"title": ""
},
{
"docid": "b93227c5e644ba7d094b112a670ca634",
"score": "0.44699606",
"text": "def get_elb_dns(name)\n desc = elb.describe_load_balancers(load_balancer_names: [name]).load_balancer_descriptions[0]\n ['dualstack.' + desc.dns_name, desc.canonical_hosted_zone_name_id]\n end",
"title": ""
},
{
"docid": "705d33fc423d21af6e09d6f3c1e79631",
"score": "0.4468519",
"text": "def describe_load_balancers(options = {})\n unless options.is_a?(Hash)\n Fog::Logger.deprecation(\"describe_load_balancers with #{options.class} is deprecated, use all('LoadBalancerNames' => []) instead [light_black](#{caller.first})[/]\")\n options = { 'LoadBalancerNames' => [options].flatten }\n end\n\n if names = options.delete('LoadBalancerNames')\n options.update(Fog::AWS.indexed_param('LoadBalancerNames.member', [*names]))\n end\n\n request({\n 'Action' => 'DescribeLoadBalancers',\n :parser => Fog::Parsers::AWS::ELBV2::DescribeLoadBalancers.new\n }.merge!(options))\n end",
"title": ""
},
{
"docid": "f01f477a603a8f389a5cc700eb53e085",
"score": "0.4460325",
"text": "def RemoveAllowedBroadcast(needed_ports, zone)\n needed_ports = deep_copy(needed_ports)\n SetModified()\n\n allowed_ports = GetBroadcastAllowedPorts()\n list_ports_allowed = Ops.get(allowed_ports, zone, [])\n\n # ports to be allowed one by one\n Builtins.foreach(needed_ports) do |allow_this_port|\n # remove all aliases of ports yet mentioned in zone\n aliases_of_port = PortAliases.GetListOfServiceAliases(allow_this_port)\n list_ports_allowed = Builtins.filter(list_ports_allowed) do |just_allowed|\n !Builtins.contains(aliases_of_port, just_allowed)\n end\n end\n Ops.set(allowed_ports, zone, list_ports_allowed)\n\n # save it using function\n SetBroadcastAllowedPorts(allowed_ports)\n\n nil\n end",
"title": ""
},
{
"docid": "ba522cc29b976499b328dca30f0be1b2",
"score": "0.44537416",
"text": "def ref_resource_subnets\n availability_zones.map { |suffix, _| ref(\"ResourceSubnet#{suffix.upcase}\") }\n end",
"title": ""
},
{
"docid": "86a7b5936677161eba04f1be807d876e",
"score": "0.44504505",
"text": "def load_zones\n unless node.has_key? :dns and node[:dns].has_key? :zones and node[:dns][:zones].blank? != true \n return nil\n end\n\n @zones = Array.new\n node[:dns][:zones].each do |zone|\n bag_name = node[:dns][:bag_name] || \"dns_zones\" \n zones << data_bag_item(bag_name, Helpers::DataBags.escape_bagname(zone) ).to_hash\n end\n @zones\n end",
"title": ""
},
{
"docid": "4c8e82b315bd83c79e1251208291781f",
"score": "0.4447996",
"text": "def index\n @admin_balancers = Balancer.all\n end",
"title": ""
},
{
"docid": "3746fcf3d76e56f87e5ea6836a1f5926",
"score": "0.4447981",
"text": "def update_load_balancers(group, remove, add)\n @aws.detach_load_balancers({\n auto_scaling_group_name: group.name,\n load_balancer_names: remove\n })\n @aws.attach_load_balancers({\n auto_scaling_group_name: group.name,\n load_balancer_names: add\n })\n end",
"title": ""
},
{
"docid": "36c34e51dd2016b2b97cb45104a2745d",
"score": "0.44476292",
"text": "def RemoveOldAllowedServiceFromZone(old_service_def, zone)\n old_service_def = deep_copy(old_service_def)\n Builtins.y2milestone(\"Removing: %1 from zone %2\", old_service_def, zone)\n\n if Ops.get_list(old_service_def, \"tcp_ports\", []) != []\n Builtins.foreach(Ops.get_list(old_service_def, \"tcp_ports\", [])) do |one_service|\n RemoveService(one_service, \"TCP\", zone)\n end\n end\n\n if Ops.get_list(old_service_def, \"udp_ports\", []) != []\n Builtins.foreach(Ops.get_list(old_service_def, \"udp_ports\", [])) do |one_service|\n RemoveService(one_service, \"UDP\", zone)\n end\n end\n\n if Ops.get_list(old_service_def, \"rpc_ports\", []) != []\n Builtins.foreach(Ops.get_list(old_service_def, \"rpc_ports\", [])) do |one_service|\n RemoveService(one_service, \"RPC\", zone)\n end\n end\n\n if Ops.get_list(old_service_def, \"ip_protocols\", []) != []\n Builtins.foreach(Ops.get_list(old_service_def, \"ip_protocols\", [])) do |one_service|\n RemoveService(one_service, \"IP\", zone)\n end\n end\n\n if Ops.get_list(old_service_def, \"broadcast_ports\", []) != []\n broadcast = GetBroadcastAllowedPorts()\n\n Ops.set(broadcast, zone, Builtins.filter(Ops.get(broadcast, zone, [])) do |one_port|\n !Builtins.contains(\n Ops.get_list(old_service_def, \"broadcast_ports\", []),\n one_port\n )\n end)\n\n SetBroadcastAllowedPorts(broadcast)\n end\n\n nil\n end",
"title": ""
},
{
"docid": "3316b466474d3b005483d35a7454ac1b",
"score": "0.4445878",
"text": "def describe_load_balancers(options = {})\n unless options.is_a?(Hash)\n Fog::Logger.deprecation(\"describe_load_balancers with #{options.class} is deprecated, use all('LoadBalancerNames' => []) instead [light_black](#{caller.first})[/]\")\n options = { 'LoadBalancerNames' => [options].flatten }\n end\n\n if names = options.delete('LoadBalancerNames')\n options.update(Fog::AWS.indexed_param('LoadBalancerNames.member', [*names]))\n end\n\n request({\n 'Action' => 'DescribeLoadBalancers',\n :parser => Fog::Parsers::AWS::ELB::DescribeLoadBalancers.new\n }.merge!(options))\n end",
"title": ""
},
{
"docid": "345703c1b90800280023f97a92840c19",
"score": "0.44440112",
"text": "def cleanup_unused_ip_addresses\n fog_compute.addresses.each do |a|\n puts \"Deleting IP address #{a.public_ip}...\"\n a.destroy unless a.server\n end\n end",
"title": ""
},
{
"docid": "0e91018b96eab63d268008517617ca55",
"score": "0.44295213",
"text": "def public_subnets\n availability_zones.map { |suffix, _| get_resource(vpc_stack, \"PublicSubnet#{suffix.upcase}\") }\n end",
"title": ""
},
{
"docid": "71c005176d0ac9ac379d5d9d7f7d6571",
"score": "0.44285408",
"text": "def destroy!\n response = @connection.lbreq(\"DELETE\",@lbmgmthost,\"#{@lbmgmtpath}/loadbalancers/#{CloudLB.escape(@load_balancer.id.to_s)}/connectionthrottle\",@lbmgmtport,@lbmgmtscheme)\n CloudLB::Exception.raise_exception(response) unless response.code.to_s.match(/^20.$/)\n @enabled = false\n true\n end",
"title": ""
},
{
"docid": "9d738942e9c2566dce80e0744baaea43",
"score": "0.44216555",
"text": "def remove_banned_ip\n @banned_ip = BannedIp.find(params[:id]).destroy\n flash[:notice] = t(:ip_range_unbanned)\n redirect_back_or_default ban_ip_admin_users_path\n end",
"title": ""
},
{
"docid": "730d13e90cf6b78e5ed51b37af138c87",
"score": "0.44144133",
"text": "def delete_all_zones\n super\n end",
"title": ""
},
{
"docid": "24eed5e1f0ac8f2fcaad54a295443172",
"score": "0.44137156",
"text": "def loadSubnets\n self.clear\n logger.debug \"loading subnets for #{name}\"\n end",
"title": ""
},
{
"docid": "88281deb40a196131e7f0043777de9c9",
"score": "0.43972236",
"text": "def delete_load_balancer(load_balancer_name)\n link = generate_request(\"DeleteLoadBalancer\", 'LoadBalancerName' => load_balancer_name)\n request_info(link, DeleteLoadBalancerParser.new(:logger => @logger))\n end",
"title": ""
},
{
"docid": "2b8766a097511a4b5a9c28096e0695cb",
"score": "0.4394792",
"text": "def blacklist(address) \n send_req({a: :ban, key: address})\n end",
"title": ""
},
{
"docid": "e257ef1ebecc70a65a4b758717ed856a",
"score": "0.43914178",
"text": "def deactivate_boost(stateid)\n @act_boosts = [] if @act_boosts.nil?\n @act_boosts.delete(stateid)\n end",
"title": ""
},
{
"docid": "a0b40dbf62d5446a9f428325f74727be",
"score": "0.43805784",
"text": "def remove_policy\n\n client.set_load_balancer_policies_of_listener(\n :load_balancer_name => load_balancer.name,\n :load_balancer_port => port,\n :policy_names => [])\n\n nil\n\n end",
"title": ""
},
{
"docid": "284ecdd669e735800fbe9410e5ac5767",
"score": "0.43767366",
"text": "def removeBlockedMAC(macAddr)\n @blockedMACList.delete(macAddr)\n end",
"title": ""
},
{
"docid": "cd1eb4e70e2b829caa78958c9a86e125",
"score": "0.43538728",
"text": "def disable(backend = nil)\n if backend.nil?\n mybackends = backends.flatten\n else\n if has_backend?(backend)\n mybackends = [backend]\n else\n mybackends = []\n end\n end\n mybackends.each do |backen|\n @socket.execute \"disable server #{backen}/#{name}\", &@print_response\n end\n end",
"title": ""
}
] |
345b3effd08f2eabfff9e1221e450bfa | creates an option object | [
{
"docid": "2a14c8493951d29a9ab31c3e9b4fd030",
"score": "0.6776094",
"text": "def create_option(dichotomy, head = nil, key)\n Option.create(text: add_tool_tip_span(dichotomy), page: @href, head: head, key: key, child_obj:{})\n end",
"title": ""
}
] | [
{
"docid": "78ee74305978eebbaf3f877980dce552",
"score": "0.79122204",
"text": "def new\n @option = Option.new\n end",
"title": ""
},
{
"docid": "8ca3ba96a77502ef7bccdcae5ed70dcb",
"score": "0.7856267",
"text": "def option_from_object obj\n build_option obj, obj\n end",
"title": ""
},
{
"docid": "0979266443263d4a6e340599515bbf8d",
"score": "0.7818679",
"text": "def build_option(objects, &block); end",
"title": ""
},
{
"docid": "0979266443263d4a6e340599515bbf8d",
"score": "0.7818679",
"text": "def build_option(objects, &block); end",
"title": ""
},
{
"docid": "39639215789bfbcdb199bc645c8a9433",
"score": "0.76179534",
"text": "def build_option(name, options, scope); end",
"title": ""
},
{
"docid": "73f1aeb5f2628aaf5517468350407d55",
"score": "0.7451507",
"text": "def build_option(name, options, scope)\n scope[name] = Thor::Option.new(name, options[:desc], options[:required], options[:type],\n options[:default], options[:aliases], options[:group])\n end",
"title": ""
},
{
"docid": "1e372d120fa9b3ef37b38bea6531fb03",
"score": "0.74476224",
"text": "def option_from_object obj\n build_option obj.id, obj.to_label\n end",
"title": ""
},
{
"docid": "e94e99d098ab32f1e3b54e21048c7737",
"score": "0.73101586",
"text": "def opt(name, desc=\"\", settings={})\n options[name] = Option.new(name, desc, settings)\n end",
"title": ""
},
{
"docid": "a3e9ee1386edb56a4f2121230f54283e",
"score": "0.7185263",
"text": "def autocreate(flag, index, items)\n return if present? flag\n short, long = clean_options Array(flag)\n arg = (items[index + 1] && items[index + 1] !~ /\\A--?/)\n option = Option.new(self, short, long, nil, arg, {})\n option.count = 1\n @options << option\n end",
"title": ""
},
{
"docid": "b5c610aa007c197dbca0e2aa13fb1b7d",
"score": "0.71737945",
"text": "def _init_option( argv = nil )\n @option = Option.new( argv )\n end",
"title": ""
},
{
"docid": "6d846c221be9eb69fac08e0a64969569",
"score": "0.71722275",
"text": "def build_option(name, options, scope) #:nodoc:\n scope[name] = Foreman::Thor::Option.new(name, options)\n end",
"title": ""
},
{
"docid": "d2c2fb315bf73c7e599925755612ed45",
"score": "0.71702886",
"text": "def build_option(objects, &block)\n config = {}\n config[:argument] = true if @config[:arguments]\n config[:optional_argument] = true if @config[:optional_arguments]\n\n if objects.last.is_a?(Hash)\n config.merge!(objects.pop)\n end\n\n short = extract_short_flag(objects, config)\n long = extract_long_flag(objects, config)\n desc = objects.shift if objects[0].respond_to?(:to_str)\n\n Option.new(self, short, long, desc, config, &block)\n end",
"title": ""
},
{
"docid": "0509237190c41423650b66f973d8e0cd",
"score": "0.7059545",
"text": "def option(*args, &block)\n options = args.last.is_a?(Hash) ? args.pop : {}\n\n short, long, desc, arg, extras = clean_options args\n options.merge!(extras)\n option = Option.new self, short, long, desc, arg, options, &block\n @options << option\n\n option\n end",
"title": ""
},
{
"docid": "99ffb78fa85820c970e5de9c7a52b4b6",
"score": "0.70494515",
"text": "def option(*args, &block)\n options = args.pop if args.last.is_a?(Hash)\n options ||= {}\n\n option = Option.new(self, *clean_options(args), options, &block)\n @options << option\n\n option\n end",
"title": ""
},
{
"docid": "4b4c6360f0627344c8a1c40a78a66712",
"score": "0.70327306",
"text": "def new_option(opts = {})\n Survey::Option.new(option_attributes.merge(opts))\nend",
"title": ""
},
{
"docid": "4b4c6360f0627344c8a1c40a78a66712",
"score": "0.70327306",
"text": "def new_option(opts = {})\n Survey::Option.new(option_attributes.merge(opts))\nend",
"title": ""
},
{
"docid": "4b4c6360f0627344c8a1c40a78a66712",
"score": "0.70327306",
"text": "def new_option(opts = {})\n Survey::Option.new(option_attributes.merge(opts))\nend",
"title": ""
},
{
"docid": "dee4827d3f99e3278824675569d8bbff",
"score": "0.6997236",
"text": "def make_option type\n Slop.string_to_option_class(config[:type_config]).new([], '')\nend",
"title": ""
},
{
"docid": "a5dd23d7c86fcb4035d462902e81de66",
"score": "0.69949037",
"text": "def options(opt); end",
"title": ""
},
{
"docid": "a5dd23d7c86fcb4035d462902e81de66",
"score": "0.69949037",
"text": "def options(opt); end",
"title": ""
},
{
"docid": "a5dd23d7c86fcb4035d462902e81de66",
"score": "0.69949037",
"text": "def options(opt); end",
"title": ""
},
{
"docid": "5e85b483da498a090971fb4eeded8404",
"score": "0.69947964",
"text": "def set_option\n @option = Option.new(option_params)\n end",
"title": ""
},
{
"docid": "c5da441e05cd857e159871b4c21fc45c",
"score": "0.6987483",
"text": "def build_option(args={})\n options << Option.new(args.merge(group: self))\n options.last\n end",
"title": ""
},
{
"docid": "4c71202f4393e468cfbc52607e361b3e",
"score": "0.6966096",
"text": "def build_option(name, options, scope)\n option = Thor::Option.new(\n name,\n options.merge(:check_default_type => check_default_type?)\n )\n scope[option.name] = option\n end",
"title": ""
},
{
"docid": "d05bdb6a04875d5dda90cd86a9ffada1",
"score": "0.69583017",
"text": "def add_option(name, value); end",
"title": ""
},
{
"docid": "d05bdb6a04875d5dda90cd86a9ffada1",
"score": "0.69583017",
"text": "def add_option(name, value); end",
"title": ""
},
{
"docid": "d05bdb6a04875d5dda90cd86a9ffada1",
"score": "0.69583017",
"text": "def add_option(name, value); end",
"title": ""
},
{
"docid": "738f472d69cc105844a6c1d97dc805ef",
"score": "0.69420654",
"text": "def option\n make_command_line(@options)\n end",
"title": ""
},
{
"docid": "17d4ef95903ca62bba1dcd3472702ff0",
"score": "0.69092435",
"text": "def option(name, type, description)\n @option = {\n :name => name,\n :type => type,\n :description => description\n }\n end",
"title": ""
},
{
"docid": "6015e860becf82360dcc946ad5093068",
"score": "0.68474865",
"text": "def option(*args, &block)\n options = args.pop if args.last.is_a?(Hash)\n options ||= {}\n\n short, long, desc, arg = clean_options(args)\n option = Option.new(self, short, long, desc, arg, options, &block)\n @options << option\n\n option\n end",
"title": ""
},
{
"docid": "6015e860becf82360dcc946ad5093068",
"score": "0.68474865",
"text": "def option(*args, &block)\n options = args.pop if args.last.is_a?(Hash)\n options ||= {}\n\n short, long, desc, arg = clean_options(args)\n option = Option.new(self, short, long, desc, arg, options, &block)\n @options << option\n\n option\n end",
"title": ""
},
{
"docid": "792400bb0979f862aff8eb1acc2ce58d",
"score": "0.6808961",
"text": "def initialize\n @options = ''\n end",
"title": ""
},
{
"docid": "26d0b9575d8d200f761aa69cef8c3d9b",
"score": "0.6801588",
"text": "def build_option name, label\n { :name => name.to_s, :label => label, :sql => sql_from_value( name ) }\n end",
"title": ""
},
{
"docid": "65225dc37707f8858b2c03e75ef61d0d",
"score": "0.67993885",
"text": "def new(options={})\n return super unless self == Option\n\n case options[:type]\n when Integer\n klass = Option.subclasses[options[:type]]\n klass&.new(options)\n when String\n if DHCPv6.const_defined?(options[:type])\n klass = DHCPv6.const_get(options[:type])\n options.delete :type\n klass.new(options) if klass < Option\n end\n else\n super\n end\n end",
"title": ""
},
{
"docid": "e7e38a6bcd4575174b9d89015b181f02",
"score": "0.6776939",
"text": "def gen(&blk)\n instance_eval(&blk) if blk\n\n # Auto-set a long value?\n if @option.long.nil?\n long '--' + @option.name.to_s.\n gsub(/[^a-z\\-]/, '-').gsub(/-{2,}/, '-')\n end\n\n # Auto-set a short value?\n unless @set.include?(:short)\n short @option.long[1..2]\n end\n\n # Auto-set a cast value?\n if not @set.include?(:cast) and not @option.default.nil?\n cast @option.default.class\n end\n\n @option\n end",
"title": ""
},
{
"docid": "4457f5969be15bd671e4b10550ad05f0",
"score": "0.6773775",
"text": "def option(name, options = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "1a94a5b7131a56df82a4f1aed83fb7c8",
"score": "0.6751494",
"text": "def opts\n OpenStruct.new(options)\n end",
"title": ""
},
{
"docid": "23162670f23181ba7fc730ebcb32bad4",
"score": "0.67320937",
"text": "def option(name, type = nil, **options)\n options[:type] = type if type\n options[:option] = true\n @initializer_builder = initializer_builder.define(name, **options)\n initializer_builder.call(self)\n end",
"title": ""
},
{
"docid": "bfebfb475c1fae15d0565da49622887a",
"score": "0.66966176",
"text": "def initialize(options = {}, &block)\n # Here we store the definitions this option contains, to make to_a and\n # to_h easier.\n @choices = [] \n\n # If we got a block, eval it and set everything up.\n instance_eval(&block) if block_given? \n\n # Is this option required?\n @required = options[:required] || false\n @choices << 'required'\n end",
"title": ""
},
{
"docid": "206e2ad558be161e55eb5b412a124b7a",
"score": "0.6688527",
"text": "def initialize(options={})\n \t options = Malibu.options.merge(options)\n \t Configuration::VALID_OPTIONS_KEYS.each do |key|\n \t \tsend(\"#{key}=\", options[key])\n \t end\n \tend",
"title": ""
},
{
"docid": "495419ea568ab1c50e1d8023645231e6",
"score": "0.6685022",
"text": "def options() end",
"title": ""
},
{
"docid": "201d03d2c0b6ca3f6e34a7cffa58c8e1",
"score": "0.6674028",
"text": "def opt(*args, &block)\n self.opts.define(self, *args, &block)\n end",
"title": ""
},
{
"docid": "ae7fdd8e904c139ad645ab99bd8f89ec",
"score": "0.6673294",
"text": "def object_from_option_name option_name\n option_name\n end",
"title": ""
},
{
"docid": "bfdfbd9d7e1000dd96f2c015dba414e1",
"score": "0.6643368",
"text": "def create_options(options = [])\n if options.any?\n options.each do |option|\n Tadpoll::Option.new_option(option, self.id)\n end\n end\n end",
"title": ""
},
{
"docid": "02dcec8be9fb7e996d0d00d447376913",
"score": "0.6642198",
"text": "def new_option(argv, &block) # :nodoc:\n attributes = argv.last.kind_of?(Hash) ? argv.pop : {}\n argv.each do |arg|\n # split switch arguments... descriptions\n # still won't match as a switch even\n # after a split\n switch, arg_name = arg.kind_of?(String) ? arg.split(' ', 2) : arg\n \n # determine the kind of argument specified\n key = case switch\n when SHORT_OPTION then :short\n when LONG_OPTION then :long\n else :desc\n end\n \n # check for conflicts\n if attributes[key]\n raise ArgumentError, \"conflicting #{key} options: [#{attributes[key].inspect}, #{arg.inspect}]\"\n end\n \n # set the option attributes\n case key\n when :long, :short\n attributes[key] = switch\n attributes[:arg_name] = arg_name if arg_name\n else\n attributes[key] = arg\n end\n end\n \n # check if a switch-style option is specified\n klass = case\n when attributes[:long].to_s =~ /^--\\[no-\\](.*)$/ \n attributes[:long] = \"--#{$1}\"\n Switch\n else \n Option\n end\n \n klass.new(attributes, &block)\n end",
"title": ""
},
{
"docid": "240fd90c6b643e791d6431d6bc0cb650",
"score": "0.6638935",
"text": "def options(*) end",
"title": ""
},
{
"docid": "6c664479d05efbfab2454a612d1a95c7",
"score": "0.66331446",
"text": "def initialize(opt)\n opt = clean_options(opt)\n @options = opt\n super\n end",
"title": ""
},
{
"docid": "22c7e65c4f95dc44a544718133198363",
"score": "0.66272706",
"text": "def options=(_); end",
"title": ""
},
{
"docid": "22c7e65c4f95dc44a544718133198363",
"score": "0.66272706",
"text": "def options=(_); end",
"title": ""
},
{
"docid": "22c7e65c4f95dc44a544718133198363",
"score": "0.66272706",
"text": "def options=(_); end",
"title": ""
},
{
"docid": "22c7e65c4f95dc44a544718133198363",
"score": "0.66272706",
"text": "def options=(_); end",
"title": ""
},
{
"docid": "22c7e65c4f95dc44a544718133198363",
"score": "0.66272706",
"text": "def options=(_); end",
"title": ""
},
{
"docid": "a5229924bd0e0ddf1624b124127036f1",
"score": "0.6605475",
"text": "def options=(_arg0); end",
"title": ""
},
{
"docid": "a5229924bd0e0ddf1624b124127036f1",
"score": "0.6605475",
"text": "def options=(_arg0); end",
"title": ""
},
{
"docid": "a5229924bd0e0ddf1624b124127036f1",
"score": "0.6605475",
"text": "def options=(_arg0); end",
"title": ""
},
{
"docid": "a5229924bd0e0ddf1624b124127036f1",
"score": "0.6605475",
"text": "def options=(_arg0); end",
"title": ""
},
{
"docid": "a5229924bd0e0ddf1624b124127036f1",
"score": "0.6605475",
"text": "def options=(_arg0); end",
"title": ""
},
{
"docid": "a5229924bd0e0ddf1624b124127036f1",
"score": "0.6605475",
"text": "def options=(_arg0); end",
"title": ""
},
{
"docid": "a5229924bd0e0ddf1624b124127036f1",
"score": "0.6605475",
"text": "def options=(_arg0); end",
"title": ""
},
{
"docid": "a5229924bd0e0ddf1624b124127036f1",
"score": "0.6605475",
"text": "def options=(_arg0); end",
"title": ""
},
{
"docid": "a5229924bd0e0ddf1624b124127036f1",
"score": "0.6605475",
"text": "def options=(_arg0); end",
"title": ""
},
{
"docid": "a5229924bd0e0ddf1624b124127036f1",
"score": "0.6605475",
"text": "def options=(_arg0); end",
"title": ""
},
{
"docid": "a5229924bd0e0ddf1624b124127036f1",
"score": "0.6605475",
"text": "def options=(_arg0); end",
"title": ""
},
{
"docid": "a5229924bd0e0ddf1624b124127036f1",
"score": "0.6605475",
"text": "def options=(_arg0); end",
"title": ""
},
{
"docid": "a5229924bd0e0ddf1624b124127036f1",
"score": "0.6605475",
"text": "def options=(_arg0); end",
"title": ""
},
{
"docid": "a5229924bd0e0ddf1624b124127036f1",
"score": "0.6605475",
"text": "def options=(_arg0); end",
"title": ""
},
{
"docid": "a5229924bd0e0ddf1624b124127036f1",
"score": "0.6605475",
"text": "def options=(_arg0); end",
"title": ""
},
{
"docid": "a5229924bd0e0ddf1624b124127036f1",
"score": "0.6605475",
"text": "def options=(_arg0); end",
"title": ""
},
{
"docid": "a5229924bd0e0ddf1624b124127036f1",
"score": "0.6605475",
"text": "def options=(_arg0); end",
"title": ""
},
{
"docid": "a5229924bd0e0ddf1624b124127036f1",
"score": "0.6605475",
"text": "def options=(_arg0); end",
"title": ""
},
{
"docid": "a5229924bd0e0ddf1624b124127036f1",
"score": "0.6605475",
"text": "def options=(_arg0); end",
"title": ""
},
{
"docid": "a5229924bd0e0ddf1624b124127036f1",
"score": "0.6605475",
"text": "def options=(_arg0); end",
"title": ""
},
{
"docid": "a5229924bd0e0ddf1624b124127036f1",
"score": "0.6605475",
"text": "def options=(_arg0); end",
"title": ""
},
{
"docid": "a5229924bd0e0ddf1624b124127036f1",
"score": "0.6605475",
"text": "def options=(_arg0); end",
"title": ""
},
{
"docid": "a5229924bd0e0ddf1624b124127036f1",
"score": "0.6605475",
"text": "def options=(_arg0); end",
"title": ""
},
{
"docid": "a5229924bd0e0ddf1624b124127036f1",
"score": "0.6605475",
"text": "def options=(_arg0); end",
"title": ""
},
{
"docid": "a5229924bd0e0ddf1624b124127036f1",
"score": "0.6605475",
"text": "def options=(_arg0); end",
"title": ""
},
{
"docid": "a5229924bd0e0ddf1624b124127036f1",
"score": "0.6605475",
"text": "def options=(_arg0); end",
"title": ""
},
{
"docid": "a5229924bd0e0ddf1624b124127036f1",
"score": "0.6605475",
"text": "def options=(_arg0); end",
"title": ""
},
{
"docid": "a5229924bd0e0ddf1624b124127036f1",
"score": "0.6605475",
"text": "def options=(_arg0); end",
"title": ""
},
{
"docid": "45aa602eadcbea020d3155b1072b5e61",
"score": "0.6603415",
"text": "def options=(p0) end",
"title": ""
},
{
"docid": "45aa602eadcbea020d3155b1072b5e61",
"score": "0.6603415",
"text": "def options=(p0) end",
"title": ""
},
{
"docid": "aa767e04308c1d033921343241fe27ce",
"score": "0.6574425",
"text": "def initialize options = {}\n @options = normalize_options options \n end",
"title": ""
},
{
"docid": "37218ed8f007d19f5930d2a4c903444c",
"score": "0.65642387",
"text": "def opt(name, desc = \"\", opts = {}, &b)\n opts[:callback] ||= b if block_given?\n opts[:desc] ||= desc\n\n o = Option.create(name, desc, opts)\n\n raise ArgumentError, \"you already have an argument named '#{name}'\" if @specs.member? o.name\n o.long.names.each do |lng|\n raise ArgumentError, \"long option name #{lng.inspect} is already taken; please specify a (different) :long/:alt\" if @long[lng]\n @long[lng] = o.name\n end\n\n raise ArgumentError, \"permitted values for option #{o.long.long.inspect} must be either nil, Range, Regexp or an Array;\" unless o.permitted_type_valid?\n\n o.short.chars.each do |short|\n raise ArgumentError, \"short option name #{short.inspect} is already taken; please specify a (different) :short\" if @short[short]\n @short[short] = o.name\n end\n\n @specs[o.name] = o\n @order << [:opt, o.name]\n end",
"title": ""
},
{
"docid": "4bfa2b47e75768c92db6e9ecda9395e7",
"score": "0.65614724",
"text": "def initialize\n OPTIONS.each_pair do |key, value|\n self.send(\"#{key}=\", value)\n end\n end",
"title": ""
},
{
"docid": "b0ff2011d3c27a8edf7d1cb196dd2223",
"score": "0.6558551",
"text": "def class_option(name, options = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "b0ff2011d3c27a8edf7d1cb196dd2223",
"score": "0.6558551",
"text": "def class_option(name, options = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "10377aa4465ddc1ee4df4ace4f330f43",
"score": "0.65562665",
"text": "def initialize( opt = {} )\n\t\t@opt = { # set default\n\t\t\t:wikiname => true,\n\t\t\t:url => true,\n\t\t\t:plugin => true,\n\t\t\t:absolute => false,\n\t\t}\n\t\t@opt.update( opt )\n\tend",
"title": ""
},
{
"docid": "f247be0e24641aeb39f4db71e37e0288",
"score": "0.65326524",
"text": "def create_new_option(value)\n payload = { value: value }\n client.post(\"/customFields/#{id}/options\", payload)\n end",
"title": ""
},
{
"docid": "dbd7c2a43ed935adf9cad55c33b2e26e",
"score": "0.65297943",
"text": "def option(name)\n name = name.to_sym\n option = Option.new(name)\n yield option\n @options << option\n return option\n end",
"title": ""
},
{
"docid": "dca11e2fc4fa4ed2ab8f7b58c786d1cf",
"score": "0.6523993",
"text": "def initialize(key, desc, type:nil, required:false, allowed:{})\n @hint = nil\n @long = nil\n @short = nil\n @desc = desc\n @allowed = allowed || {}\n @required = required || false\n Log.die(\"allowed should be a hash of values to descriptions\") if allowed.class != Hash\n Log.die(\"required should be a boolean value\") if ![TrueClass, FalseClass].include?(required.class)\n\n # Parse the key into its components (short hand, long hand, and hint)\n #https://bneijt.nl/pr/ruby-regular-expressions/\n # Valid forms to look for with chars [a-zA-Z0-9-_=|]\n # --help, --help=HINT, -h|--help, -h|--help=HINT\n Log.die(\"invalid option key #{key}\") if key && (key.count('=') > 1 or key.count('|') > 1 or !key[/[^\\w\\-=|]/].nil? or\n key[/(^--[a-zA-Z0-9\\-_]+$)|(^--[a-zA-Z\\-_]+=\\w+$)|(^-[a-zA-Z]\\|--[a-zA-Z0-9\\-_]+$)|(^-[a-zA-Z]\\|--[a-zA-Z0-9\\-_]+=\\w+$)/].nil?)\n @key = key\n if key\n @hint = key[/.*=(.*)$/, 1]\n @short = key[/^(-\\w).*$/, 1]\n @long = key[/(--[\\w\\-]+)(=.+)*$/, 1]\n end\n\n # Convert true/false to TrueClass/FalseClass\n type = TrueClass if type.class == TrueClass\n type = FalseClass if type.class == FalseClass\n\n # Validate and set type, allow Flag defaults to be true or false\n Log.die(\"invalid option type #{type}\") if ![String, Integer, Array, TrueClass, FalseClass, nil].any?{|x| type == x}\n Log.die(\"option type must be set\") if @hint && !type\n @type = String if !key && !type\n @type = FalseClass if key and !type\n @type = type if type\n\n # Validate hint is given for non flags\n Log.die(\"option hint must be set\") if @key && !@hint && @type != FalseClass && @type != TrueClass\n\n # Validate allowed\n if @allowed.any?\n allowed_type = @allowed.first.first.class\n Log.die(\"mixed allowed types\") if @allowed.any?{|k,v| k.class != allowed_type}\n end\n end",
"title": ""
},
{
"docid": "31056345df9bca01797fb31e4a056c7d",
"score": "0.6521452",
"text": "def options\n @options ||= OpenStruct.new\n end",
"title": ""
},
{
"docid": "31056345df9bca01797fb31e4a056c7d",
"score": "0.6521452",
"text": "def options\n @options ||= OpenStruct.new\n end",
"title": ""
},
{
"docid": "31056345df9bca01797fb31e4a056c7d",
"score": "0.6521452",
"text": "def options\n @options ||= OpenStruct.new\n end",
"title": ""
},
{
"docid": "31056345df9bca01797fb31e4a056c7d",
"score": "0.6521452",
"text": "def options\n @options ||= OpenStruct.new\n end",
"title": ""
},
{
"docid": "31056345df9bca01797fb31e4a056c7d",
"score": "0.6521452",
"text": "def options\n @options ||= OpenStruct.new\n end",
"title": ""
},
{
"docid": "0467f65d8d9c817be96e4537b43110a2",
"score": "0.6518969",
"text": "def initialize( options = {} ); end",
"title": ""
},
{
"docid": "0467f65d8d9c817be96e4537b43110a2",
"score": "0.6518969",
"text": "def initialize( options = {} ); end",
"title": ""
},
{
"docid": "ebc79c1651badb7acdfd5d1c34e53b54",
"score": "0.6518816",
"text": "def options\n hash = super\n if hash\n OpenStruct.new(hash)\n else\n OpenStruct.new(available_options)\n end\n end",
"title": ""
},
{
"docid": "f5eb96987ebb75276ad01298a4196355",
"score": "0.6483395",
"text": "def initialize\n super\n\n @options = {}\n @short_option_index = {}\n end",
"title": ""
}
] |
ae3535f0fc9e85df54911383ab13253e | Simplified mechanism for loading data bag item with some reasonable error handling | [
{
"docid": "7aedc2e3e5b3d52018218cd85d03038c",
"score": "0.0",
"text": "def databag_path_prefix(databag_name, item_id)\n \"databag.#{databag_name}.#{item_id}\"\n end",
"title": ""
}
] | [
{
"docid": "207409e09cdecc45d8fb8199116d65b8",
"score": "0.6661904",
"text": "def load(data_bag, name, opts = {})\n data = {\n 'data_bag' => data_bag,\n 'id' => name\n }.merge(\n Chef::DataBagItem.load(data_bag, name).to_hash\n )\n item = from_hash(data, opts)\n item\n end",
"title": ""
},
{
"docid": "d14e5a76caea832d2790c89351a9d8d0",
"score": "0.66286844",
"text": "def fetch_item(data_bag, item)\n data = data_bag_item(data_bag, item)\n data.to_common_data\nrescue Net::HTTPServerException => e\n Chef::Log.warn \"#{self} could not find the environment named #{name}\"\n if ignore_missing then {}\n else raise\n end\nend",
"title": ""
},
{
"docid": "a7726b128509a3e07b140a1b5da8ab2d",
"score": "0.6456565",
"text": "def mo_data_bag_for_environment(bag, id)\n Chef::Log.info \"Loading data bag item [#{bag}/#{id}]\"\n data = data_bag_item(bag, id) rescue Hash.new\n if data[node.chef_environment]\n Chef::Log.info \"Using #{node.chef_environment} as the key\"\n data[node.chef_environment]\n elsif data['default']\n Chef::Log.error \"#{node.chef_environment} key does not exist, using `default`\"\n data['default']\n else\n Chef::Log.error \"Data bag #{bag}/#{id} does not exists. Returning empty Hash!\"\n Hash.new\n end\nend",
"title": ""
},
{
"docid": "fac794821f62e5f6e1107d2a35ae0f08",
"score": "0.64054394",
"text": "def get_databag_item(data_bag_name, item_name)\n databag_item = Chef::DataBagItem.load(data_bag_name, item_name) rescue databag_item = nil\n databag_item\n end",
"title": ""
},
{
"docid": "2faf5227ca83a8942fe267940d491582",
"score": "0.6211972",
"text": "def load_data_bag(data_bag, name)\n raw_hash = Chef::DataBagItem.load(data_bag, name)\n encrypted = raw_hash.detect do |key, value|\n if value.is_a?(Hash)\n value.has_key?(\"encrypted_data\")\n end\n end\n if encrypted\n secret = Chef::EncryptedDataBagItem.load_secret\n Chef::EncryptedDataBagItem.new(raw_hash, secret)\n else\n raw_hash\n end\n end",
"title": ""
},
{
"docid": "7ba7104aa1bacc13d93ddc93544d650e",
"score": "0.60171604",
"text": "def get_data_bag bag, item=nil\n Chef::Config[:solo] = true\n Chef::Config[:data_bag_path] = \"#{local_chef_cache_dir}/data_bags\"\n\n if item\n Chef::DataBagItem.load(bag, item.to_s).raw_data\n else\n Chef::DataBag.load(bag)\n end\nend",
"title": ""
},
{
"docid": "1377311c11b1aad223d68183135dba5f",
"score": "0.59957784",
"text": "def item_obtained(item_class); fail NotImplementedError; end",
"title": ""
},
{
"docid": "6b868c41b11332fbe8ade78cb539ab97",
"score": "0.5985602",
"text": "def attribute_file_load_failed(path, exception); end",
"title": ""
},
{
"docid": "a50e01b3124f4773846f703f054b3e60",
"score": "0.58592707",
"text": "def load(key)\n raise 'Not implemented'\n end",
"title": ""
},
{
"docid": "2c68545b60a4e0bf897afcd949f7a249",
"score": "0.57853955",
"text": "def data_bag_item(bag, item)\n data_bag(bag) unless ( !@solo_data_bags.nil? && @solo_data_bags[bag])\n @solo_data_bags[bag][item]\n end",
"title": ""
},
{
"docid": "75705e7599afe009bff9f651e7392a75",
"score": "0.5761652",
"text": "def load_item(item, load_state)\n ItemLoader.load(@parent, @id, item, load_state, @urls)\n end",
"title": ""
},
{
"docid": "fc8fa7eabc09d6619e47942a59417db5",
"score": "0.56877506",
"text": "def load_data\n raise NotImplementedError, 'Should be defined in subclass'\n end",
"title": ""
},
{
"docid": "37f7aba89711a5ae09f0708a1e3d833c",
"score": "0.5676332",
"text": "def deserialize_error?; end",
"title": ""
},
{
"docid": "b4086ef8aab77843646df66bae1d9239",
"score": "0.5670761",
"text": "def recipe_file_load_failed(path, exception, recipe); end",
"title": ""
},
{
"docid": "e1e1fe71dfe290b2dbb0c5fda7907cb0",
"score": "0.56288517",
"text": "def load_application_object_failed(err); end",
"title": ""
},
{
"docid": "a2a6678f83a8a963c5d2e03dc97f2db0",
"score": "0.56132376",
"text": "def load_data(filename)\n fail NotImplementedError\nend",
"title": ""
},
{
"docid": "d92725090de34f0c05e0a9fb3ff88158",
"score": "0.5594784",
"text": "def encrypted_data_bag_item(bag, id, secret = nil)\n Chef::Log.debug \"Loading encrypted data bag item #{bag}/#{id}\"\n\n if secret.nil? && Chef::Config[:encrypted_data_bag_secret].nil?\n raise EncryptedDataBagSecretNotGiven.new\n end\n\n secret ||= File.read(Chef::Config[:encrypted_data_bag_secret]).strip\n Chef::EncryptedDataBagItem.load(bag, id, secret)\n end",
"title": ""
},
{
"docid": "31db6d97fc33d74a1022658a259839b1",
"score": "0.5594679",
"text": "def load_item( model_or_id, inventory, reset = nil )\r\n model = (model_or_id.is_a?(Integer)) ? @item_models.dig(model_or_id) : model_or_id\r\n if !model.is_a?(ItemModel)\r\n log \"load_item [ITEM MODEL NOT FOUND] Model or ID: #{model_or_id}\"\r\n return nil\r\n end\r\n item_class = model.class.item_class\r\n item = item_class.new(model, inventory, reset)\r\n add_global_item(item)\r\n return item\r\n end",
"title": ""
},
{
"docid": "1b36c24beb47b5bb4476cb254f7cdb6d",
"score": "0.5582771",
"text": "def load(data); end",
"title": ""
},
{
"docid": "23c1c49cf554533154537a0a7a598b76",
"score": "0.5575097",
"text": "def load_itemable\n klass = [Container, Level, Compartment].detect { |c| params[\"#{c.name.underscore}_id\"] }\n @itemable = klass.find(params[\"#{klass.name.underscore}_id\"])\n end",
"title": ""
},
{
"docid": "f9439d50094940d942e8003a5870e980",
"score": "0.55565095",
"text": "def load_items\n return nil if thesis? || numismatics?\n mfhd_items = if @mfhd && serial?\n load_serial_items\n else\n # load_items_by_bib_id\n load_items_by_mfhd\n end\n mfhd_items.empty? ? nil : mfhd_items.with_indifferent_access\n end",
"title": ""
},
{
"docid": "2415ce73337a49d19fe3260278c7c561",
"score": "0.5547707",
"text": "def load_item_data\n log(\"Loading Item tables... \", false, 70)\n item_rows = @db[:items].to_hash(:id)\n # rows that are 1:1 with items (or nil)\n weapon_rows = @db[:item_weapons].to_hash(:item_id)\n container_rows = @db[:item_containers].to_hash(:item_id)\n portal_rows = @db[:item_portals].to_hash(:item_id)\n\n # rows with potentially many per item\n ability_rows = @db[:item_abilities].to_hash_groups(:item_id)\n item_modifier_rows = @db[:item_modifiers].to_hash_groups(:item_id)\n item_wear_locations = @db[:item_wear_locations].to_hash_groups(:item_id)\n item_affect_rows = @db[:item_affects].to_hash_groups(:item_id)\n\n item_rows.each do |id, row|\n row.merge!(weapon_rows[id]) if weapon_rows.dig(id)\n row.merge!(container_rows[id]) if container_rows.dig(id)\n row.merge!(portal_rows[id]) if portal_rows.dig(id)\n\n\n row[:modifiers] = {}\n if item_modifier_rows.dig(id)\n row[:modifiers] = item_modifier_rows[id].map { |row| [@stats[row[:stat_id]].to_stat, row[:value]] }.to_h\n end\n if item_wear_locations.dig(id)\n row[:wear_locations] = item_wear_locations[id].map { |row| @wear_locations.dig(row[:wear_location_id]) }\n end\n if item_affect_rows.dig(id)\n row[:affect_models] = item_affect_rows[id].map { |row| AffectModel.new(row) }\n end\n if ability_rows.dig(id)\n row[:ability_instances] = ability_rows[id].map { |row| [@abilities[row[:ability_id]], row[:level].to_i] }\n row[:ability_instances].reject! { |ability, level| ability.nil? }\n end\n\n @item_models[id] = @item_model_classes[row[:item_type_id]].new(id, row, false)\n end\n log( \"done.\" )\n end",
"title": ""
},
{
"docid": "8a6099715ebda2bc81f486168a645585",
"score": "0.5542501",
"text": "def load_data\n end",
"title": ""
},
{
"docid": "c17c683e0ac729931e948e66395bcac7",
"score": "0.5540965",
"text": "def load_items\n @items = Item.valid_items\n end",
"title": ""
},
{
"docid": "9d98059dfd120a4faea2633479852791",
"score": "0.5523678",
"text": "def from_item(data_bag_item, opts = {})\n data = data_bag_item.to_hash\n from_hash(data, opts)\n end",
"title": ""
},
{
"docid": "90aa08f43bdbb7305cacb1dd01d9ca4e",
"score": "0.5521569",
"text": "def load_item\n if read_from_cache(\"invoices\")\n @item = read_from_cache(\"invoices\").find(params[:id])\n else\n @item = Item.find(params[:id])\n end\n end",
"title": ""
},
{
"docid": "59df6dbe84f2a773423aa43850f71930",
"score": "0.55182254",
"text": "def validate_item(db, item)\n unless File.exist?(\"data_bags/#{db}/#{item}.json\")\n STDERR.puts \"ERROR: data bag '#{db}' item '#{item}' file 'data_bags/#{db}/#{item}.json' does not exist\"\n exit(-1)\n end\n f = File.read(\"data_bags/#{db}/#{item}.json\")\n begin\n itemfile = JSON.parse(f)\n rescue JSON::ParserError => e # invalid JSON\n STDERR.puts \"ERROR: data bag '#{db} item '#{item}' has JSON errors.\"\n STDERR.puts e.message\n exit(-1)\n end\n # validate the id matches the file name\n item = item.split(\"/\").last if item =~ /\\// # pull out directories\n\n return if item.eql?(itemfile[\"id\"])\n\n STDERR.puts \"ERROR: data bag '#{db}' item '#{item}' listed in the manifest does not match the id '#{itemfile['id']}' within the 'data_bags/#{db}/#{item}.json' file.\"\n exit(-1)\n end",
"title": ""
},
{
"docid": "a30f89dce03938fd29440e25e3b0872c",
"score": "0.5513482",
"text": "def load!\n get_data\n self\n end",
"title": ""
},
{
"docid": "e00a3a5f1c0c1c93d04283fb951252d4",
"score": "0.54947674",
"text": "def load(key)\n\t\t\t\t\tres = retrieve(key)\n\t\t\t\t\traise GreyGoo::Error, \"No such thing in db: #{key}\" if !res\n\t\t\t\t\tclassname = res.has_key?('_subtype') ? eval(res['_subtype']) : self\n return classname.new(res)\n end",
"title": ""
},
{
"docid": "08dbc157936532deaccc865474d32bc8",
"score": "0.54411405",
"text": "def load!\n load_data unless invalidated?\n @data || fetch_data\n end",
"title": ""
},
{
"docid": "0a5139ec297ae473e4997aa57b969b1c",
"score": "0.5412539",
"text": "def load_data(row:)\n raise \"#{__FILE__}:#{__LINE__} You must define it\"\n end",
"title": ""
},
{
"docid": "cbcb5db2956a0ce09344cfd35c8a8851",
"score": "0.53890514",
"text": "def load_data path\n\t\tsuper\n\n\t\t# load user_items hash into user_items_array\n\t\t@user_items.each do |key, value|\n\t\t\t@user_items_array.push({key => value})\n\t\tend\n\tend",
"title": ""
},
{
"docid": "f3ae97c2ab1cdbc93811cbbe20e4b0ca",
"score": "0.5388724",
"text": "def internal_load(typed_name)\n # avoid calling get_entry by looking it up\n te = @named_values[typed_name]\n return te unless te.nil? || te.value.nil?\n\n te = parent.load_typed(typed_name)\n return te unless te.nil? || te.value.nil?\n\n # Under some circumstances, the call to the parent loader will have resulted in files being\n # parsed that in turn contained references to the requested entity and hence, caused a\n # recursive call into this loader. This means that the entry might be present now, so a new\n # check must be made.\n te = @named_values[typed_name]\n te.nil? || te.value.nil? ? find(typed_name) : te\n end",
"title": ""
},
{
"docid": "6c42155037be8b4b6b0543a49d43948a",
"score": "0.5378036",
"text": "def load(&block); end",
"title": ""
},
{
"docid": "2fa63e63116e4dd12df465358a07339c",
"score": "0.5371572",
"text": "def load(id, *args, &blk); end",
"title": ""
},
{
"docid": "d2541f279bf6a894d7034a726156ec35",
"score": "0.5348205",
"text": "def load(env_name, item_name)\n add_upstream\n env = Chef::Environment.load(env_name)\n data_bag = Chef::Config[:jenkins][:data_bag_name] ? Chef::Config[:jenkins][:data_bag_name] : DATA_BAG_NAME\n\n begin\n item = Chef::DataBagItem.load(data_bag, item_name)\n rescue Net::HTTPServerException\n Chef::Log.info(\"DataBag or DataBagItem does not exists\")\n exit 0\n end\n\n new_cookbook_versions = item['cookbook_versions']\n env.default_attributes['env_version_tag'] = item_name\n env.cookbook_versions(new_cookbook_versions)\n env.save\n Chef::Log.info(\"Loaded DataBag: #{data_bag}/#{item_name} into Env: #{env_name}\")\n save_environment_file(env_name)\n push_to_upstream\n end",
"title": ""
},
{
"docid": "25121bf013588b6d6d271927b7d8099b",
"score": "0.53458154",
"text": "def loader\n @loader ||= Chef::Knife::Core::ObjectLoader.new(Chef::DataBagItem, ui)\n end",
"title": ""
},
{
"docid": "29e8a064c5687c8e3d6850ac9a5996b3",
"score": "0.533667",
"text": "def load\n begin\n data = XML.parse_item(@database, resource[@options].get)\n @exists = true\n rescue RestClient::ResourceNotFound\n @exists = false\n end\n @data.keys.each { |key| @data[key].set(@exists ? data[key] : @data[key].klass.new) }\n self\n end",
"title": ""
},
{
"docid": "3cd8b4c547668977967d034bf6c7e09e",
"score": "0.5316866",
"text": "def load\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "95d6289914a477631922f8ddb558b991",
"score": "0.53056914",
"text": "def library_file_load_failed(path, exception); end",
"title": ""
},
{
"docid": "108e233d2c1e6d0482f4f04956f15e49",
"score": "0.5303791",
"text": "def load(id)\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "9b487e5e0f38208fe8dd0bc809e59d26",
"score": "0.5290653",
"text": "def load_from_unloaded(unloaded); end",
"title": ""
},
{
"docid": "9b487e5e0f38208fe8dd0bc809e59d26",
"score": "0.5290653",
"text": "def load_from_unloaded(unloaded); end",
"title": ""
},
{
"docid": "08e973a228d7943e68995e9d82fe209f",
"score": "0.528408",
"text": "def load_nexus_dbi\n if Chef::Config[:solo]\n Chef::DataBagItem.load(DATA_BAG, NEXUS_DBI)\n else\n Chef::EncryptedDataBagItem.load(DATA_BAG, NEXUS_DBI)\n end\n rescue Net::HTTPServerException\n raise EncryptedDataBagNotFound.new(NEXUS_DBI)\n end",
"title": ""
},
{
"docid": "d9bd684792a02645c15db332e00badf2",
"score": "0.52756596",
"text": "def node_load_failed(node_name, exception, config); end",
"title": ""
},
{
"docid": "d9bd684792a02645c15db332e00badf2",
"score": "0.52756596",
"text": "def node_load_failed(node_name, exception, config); end",
"title": ""
},
{
"docid": "1995fb046c4a2ac2fa32c383ddbb7fee",
"score": "0.5275088",
"text": "def _load(str)\n raise TypeError, \"can't _load Pool #{self.class}\"\n end",
"title": ""
},
{
"docid": "bdf5a501f6ee6c17b795af0302916475",
"score": "0.52692026",
"text": "def load_item\n @object = @item = Content.find_by_id_and_type(params[:id], ['Audio', 'Music'])\n instance_variable_set \"@#{@item.to_str}\", @item\n raise ActionController::MethodNotAllowed unless @item.member == current_user\n end",
"title": ""
},
{
"docid": "87546bfb2651d1439651ceb518e30023",
"score": "0.5267092",
"text": "def load(bike)\n \t\t@broken_bikes << bike unless bike.working?\n \t\t@working_bikes << bike if bike.working?\n\t\t\n\tend",
"title": ""
},
{
"docid": "5d0e3b3bddf14beceeccb44d105e24f8",
"score": "0.5258349",
"text": "def load(item_name)\n\n validate_storage_folder\n raise KeyEntryNotFoundException.new unless exists?(item_name)\n\n json_body = File.read(item_file_path(item_name))\n return nil if json_body.nil?\n\n StorageItem.restore_from_json(item_name, json_body)\n\n end",
"title": ""
},
{
"docid": "3ec02eb60199c44745d236ce28c67a16",
"score": "0.52495086",
"text": "def load_or_index\n load rescue (index; dump)\n end",
"title": ""
},
{
"docid": "cbe62ab6faa317b71e471f8f014fd728",
"score": "0.5245497",
"text": "def load_raw_data(*args, &bl)\n raise NotImplementedError, \"#{self.class.name}#load_entity\"\n end",
"title": ""
},
{
"docid": "7179ae6e2f986351739cd9d1d53acf16",
"score": "0.5242797",
"text": "def try_load_object(name, cache_path); end",
"title": ""
},
{
"docid": "be4d8a03c31e72c5ebbdcd709f8321dc",
"score": "0.52313215",
"text": "def load_from_data(data)\n @id = data[:id]\n @type = data[:type]\n load_attributes(data[:attributes])\n load_relationships(data[:relationships])\n load_links(data[:links])\n end",
"title": ""
},
{
"docid": "9b89e7355c1d3d1cf226771d3fca2818",
"score": "0.5223211",
"text": "def load\n animals_file = File.open(@file).read\n data = JSON.parse animals_file, symbolize_names: true\n\n read_animals(data) if data\n rescue StandardError => e\n puts \"Data couldn't be loaded\"\n end",
"title": ""
},
{
"docid": "d11e3760e6f6b9d6c435bf66660cf963",
"score": "0.52102435",
"text": "def retrieve(obj)\n raise BBLib::AbstractError\n end",
"title": ""
},
{
"docid": "f006363d55e200e40e4b3e16b6cfac01",
"score": "0.5209355",
"text": "def chef_databag(model)\n begin\n Chef::DataBag.load model\n rescue\n nil\n end\n end",
"title": ""
},
{
"docid": "419cd4a079db25990e8f5f56cbdff194",
"score": "0.5200851",
"text": "def validate_item(data)\n items.each_value do |value|\n next if value.profile\n begin\n value.validate(data.get value.path)\n rescue => err\n raise \"Parse error while parsing data #{data.string_data.join(',')}: #{err}\"\n end\n end\n end",
"title": ""
},
{
"docid": "2f089771883be1c0a86b1f0942321ba3",
"score": "0.5197178",
"text": "def load_items_from_store\r\n\t\t\t\t\t\r\n\t\t\titemRowElements = xml_with_items.search('searchresponse/items/searchresults/results/row');\t\t\t\r\n\t\t\titemRowElements.each do | el |\r\n\t\t\t\t# constructor will take care of registering the thing with us\r\n\t\t\t\tHip3::Item.new(el, self)\r\n\t\t\tend\r\n\t\t\t# Tell all our copies they're loaded, so they won't try and load again\r\n\t\t\tcopies.each { |c| c.items_loaded = true }\r\n\t\t\t\r\n\t\tend",
"title": ""
},
{
"docid": "0e3a095dcce32fc9da94f954adef7744",
"score": "0.51951",
"text": "def load_collections_hash(collections_by_item)\n @collections = collections_by_item\n verify_collections\n end",
"title": ""
},
{
"docid": "70883ce2dbc47d2c7e4aea094eb3c155",
"score": "0.5191646",
"text": "def load \n raise \"Not implemented\"\n end",
"title": ""
},
{
"docid": "b499d2f9f19cf1d162e8c16843453f72",
"score": "0.51864696",
"text": "def loaded_data\n @loaded_data ||= data\n end",
"title": ""
},
{
"docid": "58d46527a587660ca4dd75b699a4e5b9",
"score": "0.5184127",
"text": "def load!\n self.data\n self\n end",
"title": ""
},
{
"docid": "3562e72a50840ae42ec546422c180c8c",
"score": "0.51811796",
"text": "def load_object(key)\n load_objects([key])[key]\n end",
"title": ""
},
{
"docid": "395dd55fcbb7e93b20e2601f09f7b01c",
"score": "0.5176903",
"text": "def load_bags\n @bags.values.each do |bag|\n version_family = VersionFamily.where(uuid: bag.uuid).first\n Bag.create!(uuid: bag.uuid,\n ingest_node: @this_node,\n admin_node: @this_node,\n local_id: bag.local_id,\n size: bag.size,\n version: bag.version,\n type: \"DataBag\",\n created_at: APRIL_01_2016,\n updated_at: APRIL_01_2016,\n version_family: version_family,\n member: self.test_member)\n end\n end",
"title": ""
},
{
"docid": "df8dbc73f46d0ef83b96307a5ed50375",
"score": "0.51679593",
"text": "def post_load(options={:mapping=>:_default})\n end",
"title": ""
},
{
"docid": "493edd717e7048957e0d46d8e8696b10",
"score": "0.51621044",
"text": "def test_load_file_empty\n @s00.load_file(\"test/schedule/empty/empty.dat\")\n assert_equal(0, @s00.plans.size)\n\n #context \"data containing error\" do it \"should interrupt with error line.\" do\n io = StringIO.new\n assert_raise(Sculd::Manager::LoadError){ @s00.load_file(\"test/schedule/error/error.dat\", io)}\n end",
"title": ""
},
{
"docid": "cf8fbf33582ef75caa13da660e122781",
"score": "0.51614606",
"text": "def lwrp_file_load_failed(path, exception); end",
"title": ""
},
{
"docid": "b3935a0bbb74d8d9f18a89c9d890e644",
"score": "0.51547414",
"text": "def parse_bm_data(collection)\n collection.each{|obj| next if obj.nil?; obj.load_extra_attr}\n end",
"title": ""
},
{
"docid": "86df9ef670cd955db78c76258de09136",
"score": "0.51520723",
"text": "def load!\n File.exists?(btree_key) ? load : save\n end",
"title": ""
},
{
"docid": "b1e061b3f31b88381857808995b29637",
"score": "0.51402366",
"text": "def load_error( message )\n raise \"Unable to load assignment: #{message}\"\n end",
"title": ""
},
{
"docid": "20a88b1e27c2052c755a18068372a5d5",
"score": "0.51380366",
"text": "def load\n raise NotImplementedError.new(\"#{self.class} must implement #load\")\n end",
"title": ""
},
{
"docid": "6951304322d7410dd46e9120c4317648",
"score": "0.5137161",
"text": "def load!\n # Check if there are records that have been added previously\n relations = SemanticRelation.find(:all, \n :conditions => { :subject_id => @assoc_source.id, :predicate_uri => @assoc_predicate.to_s }, \n :include => [:subject, :object])\n @items ||= []\n @loaded = true\n @items = (relations | @items)\n end",
"title": ""
},
{
"docid": "4e06817a5f8c35d0585f142ba6529709",
"score": "0.5133687",
"text": "def definition_file_load_failed(path, exception); end",
"title": ""
},
{
"docid": "de15c7e994f39d1dec93018d3cd9773f",
"score": "0.5120785",
"text": "def item\n case @kind\n when 1\n $data_items[data_id]\n when 2\n $data_weapons[data_id]\n when 3\n $data_armors[data_id]\n else\n nil\n end\n end",
"title": ""
},
{
"docid": "84e151a01f633379e33f2d06955499f2",
"score": "0.51190066",
"text": "def load_file\n file_data = Bag::load_file(keypfile)\n @meta = file_data[:meta]\n @data = file_data[:data]|| {}\n @file_hash = file_data[:file_hash]\n end",
"title": ""
},
{
"docid": "9b450a904a75fbcb51a3e76ac6dd9809",
"score": "0.5098754",
"text": "def load; end",
"title": ""
},
{
"docid": "9b450a904a75fbcb51a3e76ac6dd9809",
"score": "0.5098754",
"text": "def load; end",
"title": ""
},
{
"docid": "9b450a904a75fbcb51a3e76ac6dd9809",
"score": "0.5098754",
"text": "def load; end",
"title": ""
},
{
"docid": "9b450a904a75fbcb51a3e76ac6dd9809",
"score": "0.5098754",
"text": "def load; end",
"title": ""
},
{
"docid": "9b450a904a75fbcb51a3e76ac6dd9809",
"score": "0.5098754",
"text": "def load; end",
"title": ""
},
{
"docid": "9b450a904a75fbcb51a3e76ac6dd9809",
"score": "0.5098754",
"text": "def load; end",
"title": ""
},
{
"docid": "9b450a904a75fbcb51a3e76ac6dd9809",
"score": "0.5098754",
"text": "def load; end",
"title": ""
},
{
"docid": "9b450a904a75fbcb51a3e76ac6dd9809",
"score": "0.5098754",
"text": "def load; end",
"title": ""
},
{
"docid": "9b450a904a75fbcb51a3e76ac6dd9809",
"score": "0.5098754",
"text": "def load; end",
"title": ""
},
{
"docid": "6e955c2f0020cd2a89a23f11557aa660",
"score": "0.5097946",
"text": "def load_ordered_item\n @ordered_item = OrderedItem.find(params[:id])\n end",
"title": ""
},
{
"docid": "86e1d74c5cc7261a28b1439f66f3038c",
"score": "0.50897163",
"text": "def load_item(item)\n raise \"Item #{item} does not exist\" unless File.exist?(file_for_item(item))\n\n Item.new(file_for_item(item), @project)\n end",
"title": ""
},
{
"docid": "0345d60a155c4656a572a4022406fab6",
"score": "0.50720805",
"text": "def load\n if load_operation = self.class.load_operation\n @data = load_operation.call(resource:self, client:client)\n self\n else\n raise NotImplementedError, \"#load not defined for #{self.class.name}\"\n end\n end",
"title": ""
},
{
"docid": "cb1ef4588e51e12ada11878c9f0d6435",
"score": "0.506611",
"text": "def loading\n use\n yield\n ensure\n unuse\n end",
"title": ""
},
{
"docid": "627f17c27772218fc1b0dfec00dc9eab",
"score": "0.50524753",
"text": "def load_dos\n #first time out of the box:\nRails.logger.info \"\\t**** LOAD DOS ***\"\n ao = fetch_archival_object(params)\nRails.logger.info \"ao instances? #{!ao[\"instances\"].blank?}\" if ao\n if !ao['instances'].blank? \n digs = []\n ao['instances'].each {|instance| digs.append(ao) if instance.dig(\"digital_object\") != nil }\n unless digs.blank?\n# add thrown exception here!\n ao = nil\n end\n end\n# Rails.logger.info {ao.pretty_inspect}\n end",
"title": ""
},
{
"docid": "0b0b3c829d254ed81a89ce14c1a2e21a",
"score": "0.5047944",
"text": "def load_from_store\r\n\t\t\t\t\r\n\t\t\t# If we have serial copies, load those. We never should have both, but oh well. \r\n\t\t\tserialElements = bib_xml.search('searchresponse/subscriptionsummary/serial')\r\n\t\t\tself.copies = serialElements.collect do |serialElement|\r\n\t\t\t\tholding = Hip3::SerialCopy.new( self, serialElement )\t\t\t\t\r\n\t\t\t\r\n\t\t\t\tholding # collect holdings\r\n\t\t\tend\r\n\t\t\t@copies_loaded = true\r\n\t\t\t\t\t\t\r\n\t\t\t# If we didn't have copies, we might have items directly in this bib. \r\n\t\t\tif (self.copies.length == 0 &&\r\n\t\t\t\t!bib_xml.search('searchresponse/items/searchresults/results/row').nil?)\r\n\t\t\t\tself.xml_with_items = bib_xml\r\n\t\t\t\tload_items_from_store\r\n\t\t\tend\r\n\t\t\t@items_loaded = true\r\n\r\n\t\tend",
"title": ""
},
{
"docid": "7391b7af42836d1281404fa670e5683e",
"score": "0.50478476",
"text": "def handle_item_error\n begin\n raise UdaciListErrors::InvalidItemType, \"\\nAn Invalid Item Type was entered!\"\n rescue Exception => e\n puts e\n end\n end",
"title": ""
},
{
"docid": "2c17bce2cf43c486cb382b8438f4feb3",
"score": "0.504391",
"text": "def ssl_data_bag_item\n cert, key = gen_ssl_cert\n Chef::DataBagItem.from_hash(\n 'id' => 'snakeoil',\n 'cert' => cert.to_pem,\n 'key' => key.to_pem\n )\nend",
"title": ""
},
{
"docid": "53a00c614b4346400b18b5532448a50b",
"score": "0.5042876",
"text": "def call_load\n # logger.debug(\"CMB: db only = #{DB_ONLY}\")\n unless DB_ONLY\n s = \"#{self.class.to_s}:#{self.to_param}\"\n LoadStack.instance.push(s)\n begin\n load\n ensure\n LoadStack.instance.pop\n end\n end\n # logger.debug(\"CMB: #{@cached} marking @loaded as true\")\n @invalid_cache = false\n @loaded = true\n end",
"title": ""
},
{
"docid": "a0bafcd1fb6df3bc5fa924fe4949b334",
"score": "0.50427794",
"text": "def load(pk)\n # gmosx: leave the checks in this order (optimized)\n #if (key = ann(:self, :text_key)) && pk.to_i == 0 && (pk !~ /\\S{22}/)\n # # A string is passed as pk, try to use it as a\n # # text key too.\n # puts(\"find_by_#{key} == #{pk}\")\n # send(\"find_by_#{key}\", pk)\n #else\n # A valid pk is always > 0\n ogmanager.with_store do |s|\n s.load(pk, self)\n end\n #end\n end",
"title": ""
},
{
"docid": "a0040d847f3d9189cb1c2648d58da42f",
"score": "0.5030116",
"text": "def load _id\n raise \"Not implemented\"\n end",
"title": ""
},
{
"docid": "a0040d847f3d9189cb1c2648d58da42f",
"score": "0.5030116",
"text": "def load _id\n raise \"Not implemented\"\n end",
"title": ""
},
{
"docid": "477323608f2afca5274405133af4ea19",
"score": "0.50294584",
"text": "def load(key)\n\t\t\t\tself.set_from_hash(self.class.retrieve(key))\n\t\t\t\treturn true\n\t\t\tend",
"title": ""
},
{
"docid": "06dfea4dc8dc43e76c7febc8972e1b11",
"score": "0.50279725",
"text": "def raise_if_missing_key; end",
"title": ""
},
{
"docid": "71ec2a71d46664b48896d0f6cc6e6282",
"score": "0.50199634",
"text": "def load! ; end",
"title": ""
},
{
"docid": "b9d9bf7923a5065932c45a78f02b3f96",
"score": "0.501974",
"text": "def read_item_bag(type=:items)\n return @bag[:weapons] if type == :weapons\n return @bag[:armor] if type == :armor\n return @bag[:items] if type == :items\n end",
"title": ""
}
] |
b94b0c0671ebf189dac03a75405b0ec6 | action params to Hash example: class FooService < Sails::Service::Base def foo(name, age) you can use params in any instance methods puts params[:name] puts params[:age] end end | [
{
"docid": "f9e4fa2e6f273f78fe6955d4c368476d",
"score": "0.6112161",
"text": "def params\n @params ||= {}\n end",
"title": ""
}
] | [
{
"docid": "a9c7a26321aece97177c8759acb05ab5",
"score": "0.66856587",
"text": "def params() request.params end",
"title": ""
},
{
"docid": "943c3d582e4ec7f3b19ffb26483bf3da",
"score": "0.66654396",
"text": "def params_to_api_args(type)\n args = params.to_unsafe_h.symbolize_keys.except(:controller)\n args[:method] = request.method\n args[:action] = type\n args.delete(:format)\n args\n end",
"title": ""
},
{
"docid": "11aab8e9695616c3412a5a75cdcaf0f8",
"score": "0.66179115",
"text": "def request_params; end",
"title": ""
},
{
"docid": "468cb430ea90ce36670a65340681f2cd",
"score": "0.65906394",
"text": "def action_arguments\n\t\t\t\treturn @action_arguments if @action_arguments\n\t\t\t\t## Get all parameters (arguments) from method\n\t\t\t\t## Than collect and sort parameters into hash\n\t\t\t\t@ctrl.instance_method(@action).parameters\n\t\t\t\t\t.each_with_object(req: [], opt: []) do |param, hash|\n\t\t\t\t\t\t## Only required parameters must be in `:req`\n\t\t\t\t\t\thash[param[0]] << param[1]\n\t\t\t\t\tend\n\t\t\tend",
"title": ""
},
{
"docid": "4b24d225b0fb0b29e1d5ea09d6054da4",
"score": "0.6516675",
"text": "def action_arguments action\n raise Gin::NotFound,\n \"No action exists for: #{env[REQ_METHOD]} #{env[PATH_INFO]}\" unless action\n\n raise Gin::NotFound, \"No action #{self.class}##{action}\" unless\n self.class.actions.include?(action.to_sym)\n\n args = []\n temp = []\n prev_type = nil\n\n method(action).parameters.each do |(type, name)|\n val = params[name.to_s]\n\n raise Gin::BadRequest, BAD_REQ_MSG % name if type == :req && !val\n break if type == :rest || type == :block || name.nil?\n\n if type == :key\n # Ruby 2.0 hash keys arguments\n args.concat temp\n args << {} if prev_type != :key\n args.last[name] = val unless val.nil?\n\n elsif val.nil?\n temp << val\n\n else\n args.concat temp\n temp.clear\n args << val\n end\n\n prev_type = type\n end\n\n args\n end",
"title": ""
},
{
"docid": "faef866e441bbc227f1563b3bc8ca3b2",
"score": "0.64712465",
"text": "def params\n # Normal cases\n # raise @params.values.inspect\n # return @params.values.length.inspect\n if %w{ready accesses list_subscribe list_unsubscribe}.include?(@action)\n @params\n elsif @params.values.first.is_a? Hash\n {@params.keys.first => @params.values.first.select{|k,v| v.present? }}\n elsif @params.values.first.is_a? Array\n {@params.keys.first => @params.values.first.select(&:present?)} rescue {}\n end\n # rescue => e\n # {}\n end",
"title": ""
},
{
"docid": "7402112b5e653d343b91b6d38c203c59",
"score": "0.6387809",
"text": "def params; end",
"title": ""
},
{
"docid": "7402112b5e653d343b91b6d38c203c59",
"score": "0.6387809",
"text": "def params; end",
"title": ""
},
{
"docid": "7402112b5e653d343b91b6d38c203c59",
"score": "0.6387809",
"text": "def params; end",
"title": ""
},
{
"docid": "7402112b5e653d343b91b6d38c203c59",
"score": "0.6387809",
"text": "def params; end",
"title": ""
},
{
"docid": "7402112b5e653d343b91b6d38c203c59",
"score": "0.6387809",
"text": "def params; end",
"title": ""
},
{
"docid": "7402112b5e653d343b91b6d38c203c59",
"score": "0.6387809",
"text": "def params; end",
"title": ""
},
{
"docid": "7402112b5e653d343b91b6d38c203c59",
"score": "0.6387809",
"text": "def params; end",
"title": ""
},
{
"docid": "7402112b5e653d343b91b6d38c203c59",
"score": "0.6387809",
"text": "def params; end",
"title": ""
},
{
"docid": "7402112b5e653d343b91b6d38c203c59",
"score": "0.6387809",
"text": "def params; end",
"title": ""
},
{
"docid": "7402112b5e653d343b91b6d38c203c59",
"score": "0.6387809",
"text": "def params; end",
"title": ""
},
{
"docid": "7402112b5e653d343b91b6d38c203c59",
"score": "0.6387809",
"text": "def params; end",
"title": ""
},
{
"docid": "7402112b5e653d343b91b6d38c203c59",
"score": "0.6387809",
"text": "def params; end",
"title": ""
},
{
"docid": "7402112b5e653d343b91b6d38c203c59",
"score": "0.6387809",
"text": "def params; end",
"title": ""
},
{
"docid": "7402112b5e653d343b91b6d38c203c59",
"score": "0.6387809",
"text": "def params; end",
"title": ""
},
{
"docid": "7402112b5e653d343b91b6d38c203c59",
"score": "0.6387809",
"text": "def params; end",
"title": ""
},
{
"docid": "7402112b5e653d343b91b6d38c203c59",
"score": "0.6387809",
"text": "def params; end",
"title": ""
},
{
"docid": "7402112b5e653d343b91b6d38c203c59",
"score": "0.6387809",
"text": "def params; end",
"title": ""
},
{
"docid": "9bdb2c88126ccebf479384583b294f8e",
"score": "0.63800055",
"text": "def params\n\t if method == :post\n#\t\t @post_params.instance_variable_get(\"@hash\")\n\t\t @post_params\n\t else\n#\t\t @get_params.instance_variable_get(\"@hash\")\n\t\t @get_params\n\t end\n end",
"title": ""
},
{
"docid": "2e871913f0cdde170f35eaf45504bf2c",
"score": "0.6356248",
"text": "def params\n { :only => attrs, :methods => methds }\n end",
"title": ""
},
{
"docid": "113884d2c8b958811c1b03a6fd7c069d",
"score": "0.6350201",
"text": "def request_params( params = {} )\n params\n end",
"title": ""
},
{
"docid": "dfa77cd77b9064a9490af57bbe026cc2",
"score": "0.6337725",
"text": "def service_params\n params[:service]\n end",
"title": ""
},
{
"docid": "35953d3c00e8f4e2557cb4200866322c",
"score": "0.6330505",
"text": "def init_params(params)\n @client_id = params[:client_id]\n @user_id = params[:user_id]\n @action = params[:action]\n @action_timestamp = params[:action_timestamp]\n\n @admin_id = params[:admin_id]\n @case_id = params[:case_id]\n # NOTE: Called from two places, one time it's hash with indifferent access and another is normal hash\n # so following line is required and can't be changed. Talk to Sunil, before you touch it.\n @extra_data = params[:extra_data].present? ? params[:extra_data].deep_symbolize_keys : nil\n\n @client = Client.get_from_memcache(@client_id)\n @e_extra_data = nil\n end",
"title": ""
},
{
"docid": "ffcc59777f116f4565b74e47a297d4ad",
"score": "0.6282694",
"text": "def to_params(key = self.class.name.underscore.gsub('/', '_'))\n HashWithIndifferentAccess.new( key => to_param )\n end",
"title": ""
},
{
"docid": "6b3f419b60e482091795aa2846fd64ef",
"score": "0.6277382",
"text": "def action_parameters action\n method = self.instance_method(action)\n [method.parameters.freeze, EUtils.method_arity(method).freeze]\n end",
"title": ""
},
{
"docid": "7be54e0498668ea29679022ae4d0c9f1",
"score": "0.6267567",
"text": "def params\n @params ||= {}\n end",
"title": ""
},
{
"docid": "7be54e0498668ea29679022ae4d0c9f1",
"score": "0.6267567",
"text": "def params\n @params ||= {}\n end",
"title": ""
},
{
"docid": "661f957af0793f84c72c351191226dd1",
"score": "0.6260026",
"text": "def request_params(params = {})\n params\n end",
"title": ""
},
{
"docid": "992dcd17857d9d4f36175bdd9dae303d",
"score": "0.62410116",
"text": "def params\n controller.params\n end",
"title": ""
},
{
"docid": "c9030f5cbfca9b4fac5906b008cd2c09",
"score": "0.620513",
"text": "def params\n {}\n end",
"title": ""
},
{
"docid": "456ab6a58a5db533c40c1161a0f0dc56",
"score": "0.62045777",
"text": "def params\n self.class.const_get(\"REQUEST_PARAMETERS\").inject({}) do |parameters, parameter|\n parameters[parameter] = instance_variable_get(\"@#{parameter}\") unless instance_variable_get(\"@#{parameter}\").nil?\n parameters\n end\n end",
"title": ""
},
{
"docid": "aa71bbd5ed9b08df00f8892331d0d7af",
"score": "0.61864996",
"text": "def get(action)\n PARAMS.fetch(action, [])\n end",
"title": ""
},
{
"docid": "ecfb88067e56180f15d371d05dbeab18",
"score": "0.61745864",
"text": "def request_params(params = {})\n params\n end",
"title": ""
},
{
"docid": "9e77e461fb3306c344902306eea911d4",
"score": "0.61672384",
"text": "def http_params\n {}\n end",
"title": ""
},
{
"docid": "8fb64353b2d67de5cee0c256be2c5a6d",
"score": "0.6150376",
"text": "def parameters\n parameters = {}\n data[\"actions\"].each do |action|\n next unless action[\"parameters\"]\n action[\"parameters\"].each do |parameter|\n parameters[parameter[\"name\"]] = parameter[\"value\"]\n end\n end\n parameters\n end",
"title": ""
},
{
"docid": "84e64829010e27ae66a03488e7079585",
"score": "0.61309224",
"text": "def params\n { username: 'admin', password: 'admin' }\n end",
"title": ""
},
{
"docid": "33c3fac941aa2a715713b4fb0f75ccfc",
"score": "0.6123589",
"text": "def requestAction(controller,action,params={})\n controller.class_eval{\n def params=(params); @params = params end\n def params; @params end\n }\n c = controller.new\n c.request = @_request\n c.response = @_response\n c.params = params\n c.send(action)\n c.response.body\n end",
"title": ""
},
{
"docid": "fbb9f3d380a0c5c808032a4b81e39d3f",
"score": "0.6122196",
"text": "def params=(hash); end",
"title": ""
},
{
"docid": "fbb9f3d380a0c5c808032a4b81e39d3f",
"score": "0.6122196",
"text": "def params=(hash); end",
"title": ""
},
{
"docid": "37cd029d843c7ef2fcde49f1712dd75e",
"score": "0.61194843",
"text": "def action args = {}\n\t\tend",
"title": ""
},
{
"docid": "87044898a452301bcec126c011f5f0c5",
"score": "0.6117588",
"text": "def initialize(service_params={})\n service_klass = self.class.to_s\n service_params_list = ServicesBase.get_service_params(service_klass)\n\n # passing only the mandatory and optional params to a service\n permitted_params_list = ((service_params_list[:mandatory] || []) + (service_params_list[:optional] || [])) || []\n\n permitted_params = {}\n\n permitted_params_list.each do |pp|\n permitted_params[pp] = service_params[pp]\n end\n\n @params = HashWithIndifferentAccess.new(permitted_params)\n end",
"title": ""
},
{
"docid": "23f37e5cec4a67ba4521e71939c8714d",
"score": "0.61034024",
"text": "def attributes_for_api(action)\n ret = {}\n\n return ret if action.input_layout != :object\n\n action.input_params.each do |name, param|\n case param[:type]\n when 'Resource'\n ret[name] = @params[name][ param[:value_id].to_sym ]\n\n else\n ret[name] = @params[name]\n end\n end\n\n ret\n end",
"title": ""
},
{
"docid": "95ed4aeb237911471410f89e42d73599",
"score": "0.60811055",
"text": "def params\n @controller.params\n end",
"title": ""
},
{
"docid": "95ed4aeb237911471410f89e42d73599",
"score": "0.60811055",
"text": "def params\n @controller.params\n end",
"title": ""
},
{
"docid": "cae2150875e67626ee1919e045a2300b",
"score": "0.60792476",
"text": "def parameters\n h = {}\n keys.each { |k| h[k.to_sym] = Jeapie.instance_variable_get(\"@#{k}\") }\n h\n end",
"title": ""
},
{
"docid": "bae393a9bbdfa8a96a2a6983a62e40d2",
"score": "0.6070714",
"text": "def to_params\n params = self.to_hash.merge(\n 'Action' => action_name,\n 'AWSAccessKeyId' => AmazonFlexPay.access_key,\n 'Version' => AmazonFlexPay::API_VERSION,\n 'Timestamp' => format_value(Time.now)\n )\n\n params['SignatureVersion'] = 2\n params['SignatureMethod'] = 'HmacSHA256'\n params['Signature'] = AmazonFlexPay.signature(AmazonFlexPay.api_endpoint, params)\n\n params\n end",
"title": ""
},
{
"docid": "13375ecab781ad3c87e987814c5311ad",
"score": "0.60695815",
"text": "def request_parameters; end",
"title": ""
},
{
"docid": "51aa8875d47bde66f21c76086b885f6e",
"score": "0.60684556",
"text": "def params\n { :only => self.attrs, :methods => self.methds }\n end",
"title": ""
},
{
"docid": "3193797c332c0e09269ea132e4c7d54e",
"score": "0.6066669",
"text": "def params\n { :only => self.attrs, :methods => self.methds }\n end",
"title": ""
},
{
"docid": "67a53f58fc28680ed5515f61c5736ef0",
"score": "0.60562015",
"text": "def action_name\n self.class.name.gsub(/Parameters/, '').underscore.to_sym\n end",
"title": ""
},
{
"docid": "bdb010b7fb5903d8b59bf49d6656ab0e",
"score": "0.603948",
"text": "def to_params\n @params = send(\"to_params_#{@event}\")\n end",
"title": ""
},
{
"docid": "5c30506175614dd0892d0edbfef753b4",
"score": "0.60151774",
"text": "def query_params; end",
"title": ""
},
{
"docid": "6159cb98297ac23764408358cd49fac3",
"score": "0.6012125",
"text": "def initialize(action:, action_params:)\n @action = action\n @action_params = action_params\n end",
"title": ""
},
{
"docid": "0dd6d7a9bd0600af215325d8a95827e7",
"score": "0.60044014",
"text": "def actionKeys _args\n \"actionKeys _args;\" \n end",
"title": ""
},
{
"docid": "c690b2b78d352a4cf0120a5ec6122533",
"score": "0.59914553",
"text": "def params\n @@params\n end",
"title": ""
},
{
"docid": "2a92428bf38fd8857443ecdd97decb87",
"score": "0.59863627",
"text": "def format_params_for_fantastico\n params = @params.inject({}) do |result, (k, v)|\n result[k] = [v]\n result\n end\n {@action => {'accountHASH' => [FannyPack.account_hash]}.merge(params)}\n end",
"title": ""
},
{
"docid": "d99d6d67d0a22d04950370706596e585",
"score": "0.59797937",
"text": "def toParamMAP\r\n\t\t\t\t\trequestBody = Hash.new\r\n\t\t\t\t\t\r\n\t\t\t\t\tif name != nil\r\n\t\t\t\t\t\trequestBody[\"name\"] = name\r\n\t\t\t\t\tend\r\n\t\t\t\t\t\r\n\t\t\t\t\treturn requestBody\r\n\t\t\t\tend",
"title": ""
},
{
"docid": "68791e4a2718b345beb8d07d46be8af9",
"score": "0.59535193",
"text": "def toParamMAP\r\n\t\t\t\t\trequestBody = Hash.new\r\n\t\t\t\t\t\r\n\t\t\t\t\tif name != nil\r\n\t\t\t\t\t\trequestBody[\"name\"] = name\r\n\t\t\t\t\tend\r\n\r\n\t\t\t\t\treturn requestBody\r\n\t\t\t\tend",
"title": ""
},
{
"docid": "4f20d784611d82c07d49cf1cf0d6cb7e",
"score": "0.5951514",
"text": "def all_params; end",
"title": ""
},
{
"docid": "b61a27ecc60c9ca6275f5ebb91bbec5d",
"score": "0.5947164",
"text": "def params\n _params\n end",
"title": ""
},
{
"docid": "a8c89d4c02355616b4c52f81542f94e7",
"score": "0.5939138",
"text": "def parameters(params)\n params.each do |key, value|\n send(\"#{key}=\".to_sym, value) if self.respond_to?(key)\n end\n end",
"title": ""
},
{
"docid": "7f901512a4a7a30e9c0eee8f36a3a6d4",
"score": "0.5938379",
"text": "def controller_params\n @controller.params\n end",
"title": ""
},
{
"docid": "7846754e700f816c12167762fe755eeb",
"score": "0.5929279",
"text": "def initialize\n @params = {} # Mimics params hash available within controllers in rails app\n end",
"title": ""
},
{
"docid": "45d7bae01d030a1679c51d401abd22f1",
"score": "0.59287083",
"text": "def params\n {}\n end",
"title": ""
},
{
"docid": "8b2183bb74a409538718b0638a917635",
"score": "0.59199136",
"text": "def get_params()\n return self.params.keys\n end",
"title": ""
},
{
"docid": "71d29316c31709edf7813204db9ccb1d",
"score": "0.5909043",
"text": "def parse_parameters\n @action = param(:action)\n @type = param(:type)\n @command = param(:command).join(\" \")\n end",
"title": ""
},
{
"docid": "d59c8e8e881f2d9c10a26c9d412529b4",
"score": "0.59024173",
"text": "def url_params\n {}\n end",
"title": ""
},
{
"docid": "7a6fbcc670a51834f69842348595cc79",
"score": "0.59017503",
"text": "def get_params\n\t\treturn ActionController::Parameters.new(self.attributes).permit(\"account_id\", \"title\", \"category\", \"introduction\", \"tags\", \"segment_type\", \"visible\", \"status\", \"main_image\")\n\tend",
"title": ""
},
{
"docid": "db1f8816b821654c6a3014b94e7411c7",
"score": "0.5901549",
"text": "def parsed_params\n \n end",
"title": ""
},
{
"docid": "70dc239b2aec8d125dc787f9e11be8d3",
"score": "0.5898093",
"text": "def setup(params, action=nil)\n if params.is_a? Hash\n self.id = params[\"id\"]\n self.email = params[\"email\"]\n self.ssn = params[\"ssn\"]\n self.passport = params[\"passport\"]\n self.license_number = params[\"license_number\"]\n self.first_name = params[\"first_name\"]\n self.middle_name = params[\"middle_name\"]\n self.last_name = params[\"last_name\"]\n self.mother_last_name = params[\"mother_last_name\"]\n self.residency = params[\"residency\"]\n self.birth_date = params[\"birth_date\"]\n self.reason = params[\"reason\"]\n self.IP = params[\"IP\"]\n self.system_address = params[\"system_address\"]\n self.language = params[\"language\"]\n self.status = params[\"status\"]\n self.location = params[\"location\"]\n self.state = params[\"state\"]\n self.created_at = params[\"created_at\"]\n self.created_by = params[\"created_by\"]\n self.updated_at = params[\"updated_at\"]\n self.certificate_base64 = params[\"certificate_base64\"]\n self.analyst_fullname = params[\"analyst_fullname\"]\n self.analyst_id = params[\"analyst_id\"]\n self.analyst_approval_datetime = params[\"analyst_approval_datetime\"]\n self.analyst_transaction_id = params[\"analyst_transaction_id\"]\n self.analyst_internal_status_id = params[\"analyst_internal_status_id\"]\n self.decision_code = params[\"decision_code\"]\n self.identity_validated = params[\"identity_validated\"]\n self.emit_certificate_type = params[\"emit_certificate_type\"]\n self.certificate_path = params[\"certificate_path\"]\n self.error_count = params[\"error_count\"]\n self.rci_error_count = params[\"rci_error_count\"]\n self.rci_error_date = params[\"rci_error_date\"]\n self.email_error_count = params[\"email_error_count\"]\n self.email_error_date = params[\"email_error_date\"]\n self.last_error_type = params[\"last_error_type\"]\n self.last_error_date = params[\"last_error_date\"]\n self.numeric_id = params[\"numeric_id\"]\n end\n return self\n end",
"title": ""
},
{
"docid": "32ca9709c6df074ea5815c4bce9fdeb7",
"score": "0.5895172",
"text": "def params\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "c7386051d760980f91789845a634ec20",
"score": "0.58876604",
"text": "def params\n @params\n end",
"title": ""
},
{
"docid": "52ffcd43ef8354b0f37a0ba8b2a9406d",
"score": "0.5868374",
"text": "def action_params\n params.require(:action).permit(:name, :status, :user_id)\n end",
"title": ""
},
{
"docid": "d41e04e7ba6b70a014296830f7ec26fc",
"score": "0.5867799",
"text": "def my_foo_params\n params.fetch(:my_foo, {})\n end",
"title": ""
},
{
"docid": "8e70df44d74883e3ac169ef8576acff8",
"score": "0.58625966",
"text": "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",
"title": ""
},
{
"docid": "dc3cefbe31ff8f8cf1641d01e124910e",
"score": "0.5859702",
"text": "def register(action, valid_params)\n PARAMS[action.to_sym] = valid_params\n end",
"title": ""
},
{
"docid": "93c4ae4f8eebe4d7025b134abd1b1cb0",
"score": "0.58553064",
"text": "def params\n @symbolised_params ||= @rack_request.params.inject({}) { |p, (k,v)| p[k.to_sym] = v; p }\n end",
"title": ""
},
{
"docid": "44aab931cc608b84583d699fcf5530fb",
"score": "0.58474934",
"text": "def params\n @_params\n end",
"title": ""
},
{
"docid": "f22eeaa2bf784b54fd26a2f0bd66ce82",
"score": "0.5846371",
"text": "def serializer_args_hash\n result = {}\n #TODO: Should probably safety check these somewhere\n result[:entry_type] = params[:entry_type] if params[:entry_type].present? \n result[:section] = params[:section] if params[:section].present?\n return result\n end",
"title": ""
},
{
"docid": "30ab49e3db8d7b92cba7f8f861559db3",
"score": "0.5844003",
"text": "def eshop_params\n params.fetch(:eshop, {})\n end",
"title": ""
},
{
"docid": "ac1dbe3377d54b5745c81a0729f4d43f",
"score": "0.58420044",
"text": "def cast_to_hash(params); end",
"title": ""
},
{
"docid": "6dad1ea46193cc2b2150dfb8143fda94",
"score": "0.58321214",
"text": "def get_params\n params.fetch(:get, {})\n end",
"title": ""
},
{
"docid": "82558a5b9782070b3ebfd0fae98ebf19",
"score": "0.58318114",
"text": "def query ; @request.params ; end",
"title": ""
},
{
"docid": "dd6b9ca37193af9d18519f5cdf39f0ca",
"score": "0.58315456",
"text": "def __get_params(data)\n \n # If named arguments used, assigns keys as symbols\n # but keeps numeric arguments as integers\n \n if @params.kind_of? Hash\n @params = @params.dup\n @keyword_params = JsonRpcObjects::Utils::Hash.remove!(@params) do |k, v|\n not JsonRpcObjects::Utils::String.numeric? k\n end\n \n @params = @params.sort_by { |i| i[0].to_i }.map { |i| i[1] }\n else\n @keyword_params = { }\n end\n \n JsonRpcObjects::Utils::Hash.keys_to_sym! @keyword_params\n \n end",
"title": ""
},
{
"docid": "5ea6c9c6731af8dbe00c530ac0c7aa00",
"score": "0.58313715",
"text": "def params\n @opts[:params] || {}\n end",
"title": ""
},
{
"docid": "10e13a63399d786a070ceadd92ddd280",
"score": "0.58272815",
"text": "def create_params\n params = @params.clone\n params[:params] = params[:params].clone\n\n action_keys = params[:params].select {|key, val| key =~ /\\Aaction_.*/ }\n action_keys.each do |key, val|\n new_key = key.gsub(/\\Aaction_/, \"action_survey_\")\n params[:params][new_key] = val\n params[:params].delete(key)\n end\n\n params\n end",
"title": ""
},
{
"docid": "ac0c70e2ee96d7c92a759fb73c572888",
"score": "0.58237183",
"text": "def toParamMAP\r\n\t\t\t\t\trequestBody = Hash.new\r\n\t\t\t\t\t\r\n\t\t\t\t\tif name != nil\r\n\t\t\t\t\t\trequestBody[\"name\"] = name\r\n\t\t\t\t\tend\r\n\t\t\t\t\tif content != nil\r\n\t\t\t\t\t\trequestBody[\"content\"] = content\r\n\t\t\t\t\tend\r\n\t\t\t\t\tif categoryId != nil && categoryId.to_i > 0\r\n\t\t\t\t\t\trequestBody[\"category_id\"] = categoryId\r\n\t\t\t\t\tend\r\n\t\t\t\t\tif notify != nil\r\n\t\t\t\t\t\trequestBody[\"notify\"] = notify\r\n\t\t\t\t\tend\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\treturn requestBody\r\n\t\t\t\tend",
"title": ""
},
{
"docid": "2de34b605002ab3f7142827a49c9efbe",
"score": "0.5822551",
"text": "def query_params()\n ActionController::Parameters.new({ })\n end",
"title": ""
},
{
"docid": "4dca9d0e8d2b7ae7871144ff5c8c469c",
"score": "0.5821003",
"text": "def params=(_); end",
"title": ""
},
{
"docid": "ebd798b1dc6a4a3499d558f7acc8bce1",
"score": "0.5817153",
"text": "def params\n @request.params\n end",
"title": ""
},
{
"docid": "bb2873a6996d344f99a49f2af9be95dc",
"score": "0.58109426",
"text": "def load_params args\n\tparams = {}\n\targs.each_slice(2) do | key_value |\n\t\t# puts \"o #{key_value}\"\n\t\tparams[key_value[0][1..-1]] = key_value[1]\n\tend\n\tparams\nend",
"title": ""
},
{
"docid": "2415ac77671dde4e32551c776962dd7f",
"score": "0.58075",
"text": "def home_params\n end",
"title": ""
},
{
"docid": "44a54154ef846e896ffdb8bf830c7d83",
"score": "0.5802544",
"text": "def get_parameters; end",
"title": ""
},
{
"docid": "44a54154ef846e896ffdb8bf830c7d83",
"score": "0.5802544",
"text": "def get_parameters; end",
"title": ""
}
] |
5e00386e0eafed4c761d9ccb8a0d9114 | Sends photo consent email message using UserMailer. === Return [TrueClass|FalseClass] Email successfully sent? | [
{
"docid": "e8865deb081739d3bd3ae8ce34e2684b",
"score": "0.8319378",
"text": "def send_photo_consent_mail\n UserMailer.with(user: current_user).consent_email.deliver_now!\n return true\n rescue Exception\n return false\n end",
"title": ""
}
] | [
{
"docid": "26b0be696495e111f3eb16b77ad7c9e3",
"score": "0.67798066",
"text": "def send_admin_photo_email\n Mailer.admin_photo_email(user, business).deliver\n end",
"title": ""
},
{
"docid": "3f85887625148301107246419917a43f",
"score": "0.6744474",
"text": "def new_photo_email(user, business)\n @user = user\n @business = business\n mail(:to => @user.email, :subject => \"Your photo has been uploaded on CONSIGN.NYC\")\n end",
"title": ""
},
{
"docid": "3379dc1f095b9aeae2aafbaba727cedd",
"score": "0.6648561",
"text": "def send_thank_you_email(photo)\n @photo = photo\n mail(:to => @photo.from_email,\n :subject => 'Thanks for submitting the photo!' )\n end",
"title": ""
},
{
"docid": "c3d5fbd262d11e4b2e10d5bb6755baa3",
"score": "0.6647119",
"text": "def send_store_photo_email\n if (business.admin_email != nil && business.admin_email != \"\")\n Mailer.store_photo_email(user, business).deliver\n end\n end",
"title": ""
},
{
"docid": "49e034339f70251e056cdf38ef625bcd",
"score": "0.6620553",
"text": "def send_email\n true\n end",
"title": ""
},
{
"docid": "b744213bc5595c3a48a6b626949b5daa",
"score": "0.65272444",
"text": "def admin_photo_email(user, business)\n @user = user\n @business = business\n mail(:to => \"consigndotnyc@gmail.com\", :subject => \"New Photo on CONSIGN.NYC\")\n end",
"title": ""
},
{
"docid": "33f30c36b8434cb9483b295c3c23ff6b",
"score": "0.6436296",
"text": "def resume_confirm(email, username, filename)\n subject 'You have uploaded your resume to YouIntern'\n recipients email\n from 'support@youintern.com'\n sent_on Time.now\n \n body :username => username, :filename => filename\n end",
"title": ""
},
{
"docid": "58d93f0aea2535415db380bb172a7b59",
"score": "0.6425922",
"text": "def create\n #require 'debugger'\n #debugger\n @user = User.new(params[:user])\n if @user.profile_photo.path == nil then\n file = Tempfile.new([\"template_3\", '.jpg'], 'public/uploads', :encoding => 'ascii-8bit')\n snap = WebSnap::Snapper.new('http://www.facebook.com', :format => 'jpg')\n jpg = snap.to_bytes\n @user.profile_photo = file\n snap.to_file(@user.profile_photo.path)\n file.unlink\n end\n snap = WebSnap::Snapper.new('http://www.facebook.com', :format => 'jpg')\n jpg = snap.to_bytes\n snap.to_file(@user.profile_photo.path)\n \n respond_to do |format|\n if @user.save\n #Want to send email in this case\n UserMailer.signup_confirmation(@user).deliver\n format.html { redirect_to @user, notice: 'User was successfully created.' }\n format.json { render json: @user, status: :created, location: @user }\n else\n format.html { render action: \"new\" }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4544b1515b172e4002c499306b89c88a",
"score": "0.638757",
"text": "def acceptance_email ucr\n extract_variables ucr\n\n mail to: @user.email\n end",
"title": ""
},
{
"docid": "843eccffa4799c6f73ff4273be0847e0",
"score": "0.62905663",
"text": "def partner_subscription_confirmation(potential_partner)\n attachments.inline['passportfitnessdc.png'] = File.read('/Users/nathanhall/Desktop/PassportFitness/PassportFitnessDC/public/images/passportfitnessdc.png')\n @potential_partner = potential_partner\n mail to: \"#{potential_partner.studio_name} <#{potential_partner.email}>\", subject: \"Thank you for your interest in Passport Fitness D.C.\"\n end",
"title": ""
},
{
"docid": "ab96f61564f9d638c27893c2a771438f",
"score": "0.6276039",
"text": "def email_user\n Mailer.deliver_metadata_processed(dataset_id, user_id, @missing_variables, base_host) if EMAIL_ENABLED && User.find(user_id).person.send_notifications?\n end",
"title": ""
},
{
"docid": "378eeecf70c737c9e8f32a30d718619f",
"score": "0.62697804",
"text": "def store_photo_email(user, business)\n @user = user\n @business = business\n mail(:to => @business.admin_email, :subject => \"#{@business.name} has a new photo on CONSIGN.NYC\")\n end",
"title": ""
},
{
"docid": "14cf0b4e240359fda1d4819b4b235a12",
"score": "0.6224201",
"text": "def send_user\n UserProfileCertificationMailer.send_user\n end",
"title": ""
},
{
"docid": "d2f0223eeb766d643af96499c93d6b6b",
"score": "0.6137433",
"text": "def approve(user)\n set_attachments\n\n @user = user\n mail(to: @user.email, subject: \"Cuenta Activada @ Social Target - Its time to go social\")\n end",
"title": ""
},
{
"docid": "4d8bd5727be470ed2025f2887a480352",
"score": "0.6121669",
"text": "def rejected profile\n @profile = profile\n\n attachments.inline['welcome_email.jpg'] = File.read(\"#{Rails.root}/app/assets/images/welcome_email.jpg\")\n attachments.inline['fb.png'] = File.read(\"#{Rails.root}/app/assets/images/fb.png\")\n attachments.inline['tw.png'] = File.read(\"#{Rails.root}/app/assets/images/tw.png\")\n attachments.inline['in.png'] = File.read(\"#{Rails.root}/app/assets/images/in.png\")\n\n mail to: @profile.user.email, subject: 'Perfil Rechazado en Kiipet.com'\n end",
"title": ""
},
{
"docid": "7b408be1c5f56f03d5f0f14969f3024b",
"score": "0.6121393",
"text": "def awaiting_email_verification?\n return false if email_verified?\n\n pending_notices({ type: 'email', dispatched: true }).any?\n end",
"title": ""
},
{
"docid": "682f1e90bae41ccb09abe08854f0e7e8",
"score": "0.6106563",
"text": "def mailboxer_email(object)\n shouldSendEmail = true\n email if shouldSendEmail\n end",
"title": ""
},
{
"docid": "e4eb3860b41562b549b6e106e31f7c88",
"score": "0.61057514",
"text": "def send_acceptance_email\n # UserMailer.delay.send_accepted_email(user_id)\n end",
"title": ""
},
{
"docid": "0e96a28bbdf5cc7bd871855b87dcdc08",
"score": "0.61031437",
"text": "def splash_page_confirmation(useremail)\n @useremail = useremail\n @greeting = \"Hi\"\n\n mail(:to => useremail, :bcc => [\"alex.jordan.j@gmail.com, kme3p@virginia.edu\"], :subject => \"SpectaFresh - New Splash Page User\")\n end",
"title": ""
},
{
"docid": "7b659aa2a1989417c8f28f6895d27262",
"score": "0.60983014",
"text": "def email_user\n Mailer.deliver_nesstar_catalogs_processed(datasets, user_id, base_host) if EMAIL_ENABLED && User.find(user_id).person.send_notifications?\n end",
"title": ""
},
{
"docid": "791bf2943a19a857c14d3c202683517e",
"score": "0.6052923",
"text": "def send_email\r\n if User.exists? params[:id]\r\n @email_to_usr = User.find(params[:id])\r\n if params[:commit]\r\n if @sending_res = profile_mail_sending(params, @email_to_usr)\r\n return if @sending_res.kind_of? Hash\r\n redirecting(t(:email_redir), session[:last_page])\r\n else\r\n redirect_to_info_page t(:email_error)\r\n end\r\n return\r\n end\r\n else\r\n redirect_to_info_page\r\n end\r\n end",
"title": ""
},
{
"docid": "d764dd2a20d023791aecbc4d332e89d2",
"score": "0.60517347",
"text": "def notify\n ActionMailer::Base.mail(:from => \"edgar-garcia@northwestern.edu\", :to => \"digitalcollections@northwestern.edu\", :cc => \"edgar-garcia@northwestern.edu\", :subject => \"DIL Upload permission request - \" + current_user.uid, :body => \"User \"+ current_user.uid + \" has requested to be added to the uploaders list. Is this approved?\\n\\n Their email address is: \" + current_user.email + \"\\n\\nThis email was generated by DIL.\").deliver\n flash[:notice] = \"Your inquiry has been submitted. Please come back and check later, you will be notified within a day as well.\"\n redirect_to \"/uploads\"\n end",
"title": ""
},
{
"docid": "bc4b8dc6a096e2813f089ac98d3a365c",
"score": "0.6045481",
"text": "def upload_email(document_upload_email)\n consumer = document_upload_email.consumer\n @standard_document = document_upload_email.standard_document\n\n from_address = email_address_for(:notification)\n reply_to = document_upload_email.email\n consumer_email = document_upload_email.consumer_email\n subject = [\"Upload document\", @standard_document.name].join(\" - \")\n\n delivery_options = { user_name: ENV['SES_SMTP_USERNAME'],\n password: ENV['SES_SMTP_PASSWORD'],\n address: ENV['SES_SMTP_ADDRESS'] }\n\n @logo_asset_url = get_logo_asset_url\n\n mail(from: from_address, reply_to: reply_to, to: consumer_email, subject: subject, delivery_method_options: delivery_options) do |format|\n format.html\n end\n end",
"title": ""
},
{
"docid": "b335ec9475c22baecb51e332858761e5",
"score": "0.60448843",
"text": "def send_confirm_email\n settings.fetch('send_mail',{}).fetch('confirm_email', true)\n end",
"title": ""
},
{
"docid": "743080dfa28718264dc2ec9b2060b960",
"score": "0.60270566",
"text": "def sent_verification_mail()\n @user= User.find(params[:id]);\n TweetsMailer.verification(@user).deliver_now;\n flash[:success]=\"Mail to #{@user.email} has been sended!\";\n redirect_to(verification_user_url(@user));\n end",
"title": ""
},
{
"docid": "339f8a8ac4d8763a7a9cceb005d2cf8f",
"score": "0.6023323",
"text": "def signup_notification(recipient)\n @account = recipient\n\n #attachments['LogoMailingHallist_head.png'] = File.read(\"#{Rails.root}/assets/images/LogoMailingHallist_head.png\")\n #attachments['terms.pdf'] = {:content => generate_your_pdf_here() }\n\n mail(:to => recipient.email_address_with_name,\n :subject => \"New account information\") #do |format|\n #format.text { render :text => \"Welcome! #{recipient.name} go to #{customer_activation_url(:a => recipient.perishable_token )}\" }\n #format.html { render :text => \"<h1>Welcome to HALLIST!</h1> <p>Your account has been created for the following email address: <br> #{recipient.email}</p> <p>Please finish your registration process here: <a href='#{customer_activation_url(:a => recipient.perishable_token )}'>Click to Activate</a></p> <p>Sincerely, <br> The HALLIST team</p>\" }\n #end\n\n end",
"title": ""
},
{
"docid": "cc6f6827552fe334dfed2f6c84165e59",
"score": "0.599214",
"text": "def send_thx_email\n @user = User.where(:uid => self.uid).first\n if !@user.nil? && !@user.email.nil?\n Services::Mandrill.mail(@user.email, 'PicsforPets_2013_Reportback', 'How to get puppies adopted')\n end\n end",
"title": ""
},
{
"docid": "3502f9b07d480741432e5c4679b44a1c",
"score": "0.59618384",
"text": "def create\n @email = @autocrypt.prepare_outgoing(Email.new email_params)\n\n respond_to do |format|\n if @email.save\n format.html { redirect_to user_emails_path(@user), notice: 'Email was successfully send.' }\n format.json { render :show, status: :created, location: @email }\n else\n format.html { render :new }\n format.json { render json: @email.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ccee09b63950d5bcded76510fda43f26",
"score": "0.5958427",
"text": "def send_verify_email_link\n service_response = UserManagement::SendDoubleOptInLink.new(params).perform\n render_api_response(service_response)\n end",
"title": ""
},
{
"docid": "482b3b7665845a983cecb22ed925500d",
"score": "0.59501356",
"text": "def verification_letter(user)\n @user = user\n authorization = @user.authorizations.where(confirmed: false).first\n @url = \"http://localhost:3000/verifications/#{@user.id}/#{authorization.id}/#{authorization.checksum}/verify\"\n\n mail to: @user.email\n end",
"title": ""
},
{
"docid": "89e6422a1622b424a6f4198be465484f",
"score": "0.59437644",
"text": "def succesfull_submission(offer)\n @greeting = \"Χαίρετε\"\n @user = User.find(offer.user_id)\n @offer = offer\n @procurement = Procurement.find(offer.procurement_id)\n\n mail to: @user.email, subject: '[E-Proc] Tender Submitted Succesfully'\n end",
"title": ""
},
{
"docid": "9e6680ee63c74351a180d720d0567654",
"score": "0.5939589",
"text": "def seo_analysis(user)\n @user = user \n # current_site = user.find_by()\n attachments.inline['eclogo.png'] = File.read('app/assets/images/ec-logo.png')\n mail to: user.email, subject: \"SEO Results\"\n\n\n end",
"title": ""
},
{
"docid": "fad0254d86106366dac854dc6714cc35",
"score": "0.59389734",
"text": "def sendit\n #Email script\n options = { :address => \"smtp.gmail.com\",\n :port => 587,\n :domain => 'gmail.com',\n :user_name => 'cirrusmioat',\n :password => 'soserious',\n :authentication => 'plain',\n :enable_starttls_auto => true }\n\n #Apply options\n Mail.defaults do\n delivery_method :smtp, options\n end\n\n #Send the email with .gif attached\n Mail.deliver do\n to 'mtshro2@gmail.com, tyler.shipp@uky.edu, mcortt@gmail.com'\n from 'cirrusmioat@gmail.com'\n subject 'DoorWatcher'\n body 'Capture from DoorWatcher'\n attachments['DOORCAPTURE.gif'] = File.read('DOORCAPTURE.gif')\n\t\n end\n end",
"title": ""
},
{
"docid": "9516af6d69810ca2a62eafb95354d0bd",
"score": "0.59255093",
"text": "def starter_confirm(recipient)\n @starter = recipient\n @url = \"http://www.harpuun.com\"\n mail(:to => \"#{recipient.email}\", :subject => \"Thanks for Signing Up!\" )\n end",
"title": ""
},
{
"docid": "8a563d85cac5959f975acc55d5854d2b",
"score": "0.5925045",
"text": "def registration_confirmation(user)\n @user = user\n # attachments[\"rails.png\"] = File.read(\"#{Rails.root}/public/images/rails.png\")\n mail(:to => \"#{user.nickname} <#{user.email}>\", :subject => \"Registered\")\n end",
"title": ""
},
{
"docid": "f0eb66dc09afc9c98a66e6abcac75167",
"score": "0.59187806",
"text": "def send_signup_verify_email(email, user)\n @user = user\n mail( :to => email,\n :subject => 'Welcome to WatchIoT!!')\n end",
"title": ""
},
{
"docid": "6e53ca3e4a541185ba63e6a223c685ba",
"score": "0.5916641",
"text": "def question_answered(user, ig_media_id)\n @user = user\n @request = Request.where(:photo_id => Photo.where(:ig_media_id => ig_media_id).first.id).first\n #... send email to user telling him that his question was answered\n\n mail to: @user.email, subject: \"Your question on #{@request.photo.venue.name} has been answered\"\n end",
"title": ""
},
{
"docid": "7118f869f39a69c4048c2ddfeae64858",
"score": "0.59056246",
"text": "def activation_success_email(user)\n # TODO: Implement actual functionality -- Wed Jun 13 15:26:53 2012\n @greeting = \"Hi\"\n\n mail to: \"to@example.org\"\n end",
"title": ""
},
{
"docid": "4491d962fc469f553a7c5647544e0720",
"score": "0.5901299",
"text": "def send_signup_email(user)\n @user = user\n @appointment = Appointment.where(id: @user.appointment_id).first\n mail(\n :to => @user.email,\n :bcc => \"acecprsd@gmail.com\",\n :subject => \"Ace CPR SD Sign-Up Confirmation ##{@user.id}\"\n )\n end",
"title": ""
},
{
"docid": "75c1235571dc971d4fb171a02ddccacc",
"score": "0.5896722",
"text": "def send_account_notification\n @user = User.find_by_id(params[:id]) \n begin \n url = \"http://www.uncharted.net/account/activation/#{@user.activation_code}\" \n Emailer.deliver_admin_accountactivation(@user.email,url)\t\n end\n flash[:notice] = \"Email has been sent to #{@user.email} to active his account.\"\n redirect_to :action => 'index'\n end",
"title": ""
},
{
"docid": "f5420fdc668434753f429bb1682de066",
"score": "0.58846813",
"text": "def send_survey_completion_emails\n return unless EMAILS_ENABLED\n\n UserMailer.survey_completed(@sheet).deliver_now\n end",
"title": ""
},
{
"docid": "58b0179146654c632870188f01b5e088",
"score": "0.58842933",
"text": "def send_email(user, alert, template_name)\n @alert = alert \n @user = user\n \n render_name = :error\n email_subject = :error\n \n case template_name\n when :daily_digest\n render_name = 'daily_digest.html.erb'\n email_subject = 'Daily Digest'\n when :email_alert \n render_name = 'email_alert.html.erb'\n email_subject = 'Air Quality Alert'\n else\n render_name = 'error.html.erb'\n email_subject = 'Error Email'\n end\n \n attachments.inline[\"email_borderup.png\"] = \n File.read(\"#{Rails.root}/app/assets/images/email_borderup.png\")\n\n attachments.inline[\"bcba_logo.png\"] = \n File.read(\"#{Rails.root}/app/assets/images/bcba_logo.png\")\n \n \n mail to: @user.email, subject: email_subject, template_name: render_name \n end",
"title": ""
},
{
"docid": "fcea06db3426cf7289312e10a17b88d5",
"score": "0.58742857",
"text": "def send_approved_email_invoice\n settings.fetch('send_mail',{}).fetch('approved_email_attach_invoice', false)\n end",
"title": ""
},
{
"docid": "e1d67faddd9d70e317633b886e68f33f",
"score": "0.587307",
"text": "def send_verification_email\n update!(email_status: \"sent\", email_verification_token: SecureRandom.uuid)\n JobMailer.confirm_email(self).deliver!\n end",
"title": ""
},
{
"docid": "875f0d14723650997730286955a2f95e",
"score": "0.58679074",
"text": "def email_confirm\n end",
"title": ""
},
{
"docid": "0a67c3d2cf937982f1402eceba619d0c",
"score": "0.5863283",
"text": "def send_mail_to_associates\n user = self.matter_people.assignee\n if(@is_changed && user && User.current_user!=user)\n send_notification_to_responsible(user,self,User.current_user)\n @is_changed = false\n\n true\n end\n end",
"title": ""
},
{
"docid": "2de6f6c56a95724f268690ce460b81a4",
"score": "0.58543336",
"text": "def email_confirmation_link(member)\n @member = Member.find(member)\n @url = @member.confirm_email_link\n #attachments[\"rails.png\"] = File.read(\"#{Rails.root}/public/404.html\")\n #Se også inline attachments\n mail(to: @member.user.email, subject: t(:email_confirmation, :scope => [:business_messages, :email]) ) \n end",
"title": ""
},
{
"docid": "6e596e9acfb60ca9566b563d71ecc886",
"score": "0.58538234",
"text": "def participant_acceptance(participant,school)\n @participant = participant\n @school = school\n admin_user_ids = Participant.where(\"school_id = ? and role_id < ?\",@school.id,3).all.map(&:user_id)\n schooladmins = User.where(id: admin_user_ids).all.map(&:email)\n @applicant = User.find(@participant.user_id)\n applicant_email = \"#{@applicant.fullname} <#{@applicant.email}>\"\n \n mail to: applicant_email,\n reply_to: schooladmins,\n subject: \"Congratulations! You have been accepted to\" + @school.name + \" !\"\n end",
"title": ""
},
{
"docid": "87980a48b1187f119b433411659c7739",
"score": "0.58519834",
"text": "def activation_success_email(user)\n @user = user\n #@url = \"http://0.0.0.0:3000/login\"\n @url = \"http://kancrumer.herokuapp.com/login\"\n mail(:to => user.email, :subject => \"Your account is now activated\")\n end",
"title": ""
},
{
"docid": "9b0af2169834291b211e8511b09877c8",
"score": "0.58478403",
"text": "def send_mail_to_associates\n unless self.matter_people.blank?\n user = self.matter_people.assignee\n if(@is_changed && user && User.current_user!=user)\n send_notification_to_responsible(user,self,User.current_user)\n @is_changed = false\n\n true\n end\n end\n end",
"title": ""
},
{
"docid": "5415bd622203babd97a6884c51be41cf",
"score": "0.58450145",
"text": "def profile_completion_thankyou(user_id)\n @user = User.find(user_id)\n\n mail :to => recipient(@user.email), :subject => \"25c Profile Completed!\"\n end",
"title": ""
},
{
"docid": "16ce90d3f000bb4c369fee9915b4b75c",
"score": "0.5842966",
"text": "def notice_from_objective_auth\n\n @auth = User.find(params[:auth_id])\n user_mail = User.find(params[:user_id]).email\n @url = params[:url]\n mail(to: user_mail, subject:'承認されました。')\n \n end",
"title": ""
},
{
"docid": "3442286b6f26a0dee27ec44f4e8120df",
"score": "0.5840205",
"text": "def send_recover_needs_approval_email\n Users::SendNeedsApprovalEmailJob.perform_later(user_id: self.id, active: false)\n end",
"title": ""
},
{
"docid": "6a9f83503d52139ba65f4d3f4289ce8d",
"score": "0.5838243",
"text": "def welcome_email\n attachments['filename.jpg'] = File.read('/path/to/filename.jpg')\n # ...\n end",
"title": ""
},
{
"docid": "11a1136f98b13a25fe7368851f260806",
"score": "0.58368367",
"text": "def email\n return unless can_be_emailed\n\n OfferMailer.email_contract(@offer).deliver_now!\n\n if @offer.provisional?\n # If the assignment has not been sent before, set status to pending\n @offer.pending!\n else\n # If the assignment has been sent before, make sure the emailed date gets updated.\n @offer.emailed_date = Time.zone.now\n @offer.save!\n end\n render_success @offer\n end",
"title": ""
},
{
"docid": "463f835e10b102f20027dc37b4c2b042",
"score": "0.5835245",
"text": "def signup_notification(user)\n setup_email(user)\n @subject += I18n.t 'mailer.signup.subject'\n \n @body[:url] = \"http://www.dripplet.com/#{user.locale}/activate/#{user.activation_code}\"\n \n end",
"title": ""
},
{
"docid": "71042b5dfebc752f516ab0d5ebd7b4bc",
"score": "0.5834625",
"text": "def welcome_email(user)\n @user = user\n @signin_url = \"http://www.lacquerloveandlend.com/auth/facebook\"\n \n mail(to: @user.email, subject: 'Welcome to Lacquer Love&Lend!', bcc: \"lacquerloveandlend@gmail.com\")\n\n headers['X-MC-Track'] = \"opens, clicks_all\"\n end",
"title": ""
},
{
"docid": "880df0999df9ebb1e7bf9f9e43843671",
"score": "0.58299965",
"text": "def send_signup_notification\n deliver_activation_email(:signup, :subject => (MaSA[:activation_subject] || \"Please Activate Your Account\") )\n end",
"title": ""
},
{
"docid": "1ba7a867f986dbf8f07e670d85bae5c9",
"score": "0.5829967",
"text": "def invite_email(user, emails)\n @user = user\n @friend_url = \"http://www.lacquerloveandlend.com/friendships/new?friend_id=#{@user.id}\"\n\n mail(to: emails, subject: \"#{user.name} wants to share with you on Lacquer Love&Lend!\", bcc: \"lacquerloveandlend@gmail.com\")\n\n headers['X-MC-Track'] = \"opens, clicks_all\"\n end",
"title": ""
},
{
"docid": "18daeeb9953a6199aa5baffb7842c9b2",
"score": "0.58113",
"text": "def send_claim_email\n\n template = {\n :template => File.join('reviewer_invites', 'claim'),\n :locals => {\n :entity => self.entity,\n :claim_digest => self.claim_digest\n }\n }\n message = {\n :subject => \"Claim Your Invite\",\n :to => [ { :email => self.email } ],\n :merge_vars => [{\n \"rcpt\" => self.email,\n \"vars\" => [{ \"content\" => \"there\", \"name\" => \"name\" }]\n }]\n }\n Applyance::Lib::Emails::Sender::send_template(template, message)\n\n end",
"title": ""
},
{
"docid": "3ade39ea2216748f184556755c3cd8bd",
"score": "0.58086437",
"text": "def send_email\n \n if self.category == \"Success\"\n \n UserMailer.success_notification_email(c.user.perfil.emailadicional1,c.xml_file_name).deliver\n \n elsif self.category == \"Warning\"\n \n UserMailer.warning_notification_email(c.user.perfil.emailadicional1,c.xml_file_name).deliver\n \n elsif self.category == \"Error\"\n \n UserMailer.error_notification_email(c.user.perfil.emailadicional1,c.xml_file_name).deliver\n \n end\n \n end",
"title": ""
},
{
"docid": "af3c0094e76b80c33af440e9a866be20",
"score": "0.58075625",
"text": "def confirm_email(user)\n @user = user\n @confirm_url = \"http://www.yscalumni.org/confirm/\" + user.confirmation_code\n mail(:to => user.email, :subject => \"Welcome to yscalumni.org! Please confirm your email!\")\n end",
"title": ""
},
{
"docid": "109e252ea232a655e4b08bc962c581a9",
"score": "0.58026236",
"text": "def send_email_to_user(user)\n if user.email && user.unsubscribed == false\n Email.create(:user_id => user.id, :message_id => self.id).deliver\n end\n end",
"title": ""
},
{
"docid": "4f6db4901d0bc0126926498f054bad8d",
"score": "0.5799161",
"text": "def send_mail(answer)\n exe_file = Tempfile.new([\"#{File.basename(answer.user_file.name, '.rb')}\", \".rb\"])\n File.open(exe_file, \"ab\") {|f| f.write(answer.user_file.data) }\n\n attachments[\"#{answer.user_file.name}\"] = File.read(exe_file)\n\n @greeting = \"#{answer.user_name}様から、#{answer.question.title}の解答が届きました。\\n\n \\n\n #{answer.email}宛に、Feedbackを返して返してあげましょう!\n \"\n \n mail to: \"#{answer.question.email}\", subject: \"Codestから解答の送信です。\"\n end",
"title": ""
},
{
"docid": "93b492cb092975d39522fd2902c6fa3e",
"score": "0.57959086",
"text": "def activation_success_email(user)\n @user = user\n @url = \"#{get_domain}/login\"\n mail(to: user.email, subject: 'メールアドレスの認証が完了しました!')\n end",
"title": ""
},
{
"docid": "0ed3e6068a305c305caeeb97240f1825",
"score": "0.579483",
"text": "def activation_success_email user, application_id\n @user = User.find user\n @application = @user.used_applications.find application_id\n @url = application_url(@application)\n mail(:to => @user.email,\n :subject => \"You have been added to #{@application.application_name}\")\n end",
"title": ""
},
{
"docid": "2910325c9fb067152878d0a2e43f0792",
"score": "0.579289",
"text": "def send_emails_to_share\n @policy = current_user.accessible_policies.find(params[:id])\n @email = params[:share_policy_email]\n @validation_error = @policy.errors[:share_policy_email][0] if @policy.errors.present?\n ReminderMailer.registration_confirmationss(@email).deliver\n end",
"title": ""
},
{
"docid": "bab3a7fa09de4a0eb3f5556811117ed6",
"score": "0.5792181",
"text": "def donation_drive(message, email, event)\n @message = message\n @event = event\n\n user = User.where(email: email).first\n @message.user = user\n unless email.blank? || user.opt_out?\n mail(to: email, subject: @message.subject) do |format|\n format.html\n format.text\n end\n end\n end",
"title": ""
},
{
"docid": "7cdf249af56d46f617d4356fd9b7928c",
"score": "0.57913166",
"text": "def send_active_needs_approval_email\n Users::SendNeedsApprovalEmailJob.perform_later(user_id: self.id, active: true)\n end",
"title": ""
},
{
"docid": "629d79ae291af04273be9ddf8464e6a5",
"score": "0.57896763",
"text": "def activation_success_email(user)\n @user = user\n @url = \"http://lvh.me:3000/login\"\n mail(:to => user.email,\n :subject => \"Your account at Stackclown is now activated\")\n end",
"title": ""
},
{
"docid": "4ff49e1bf4163446209f93532ee05a6d",
"score": "0.5788081",
"text": "def send_email_if_needed\n \tif self.is_response\n \t\tlogger.info \"Send Email\"\n \t\tMessageMailer.reply_email( self ).deliver\n \tend\n end",
"title": ""
},
{
"docid": "a9a6605bdbf2fa7fe1e18da1bd3eb3cb",
"score": "0.57823855",
"text": "def email_sent\n @email = session[:owners_new_email]\n end",
"title": ""
},
{
"docid": "df608b27100997d843643ed67df74da4",
"score": "0.57811266",
"text": "def application_request\n\t\tPony.mail(to: params[:email], from: \"bradwflint@gmail.com\", subject: \"Email application\", body: \"Here is the rental application!\", :attachments => {\"rentalapp.pdf\" => File.read(Rails.root.to_s + \"/public/rentalapp.pdf\")} )\n\t # Pony.mail(to: \"bradwflint@gmail.com\", from: \"bradwflint@gmail.com\", subject: \"Email application\", body: \"Here is the rental application!\", :attachments => {\"rentalapp.pdf\" => File.read(Rails.root.to_s + \"/public/rentalapp.pdf\")} )\n\t\tredirect_to properties_apply_path\n\tend",
"title": ""
},
{
"docid": "8486c1b334e142a3b922cb0a753788bc",
"score": "0.57763463",
"text": "def send_by_email\n @title = t 'conclusion_draft_review.send_by_email'\n\n if @conclusion_draft_review.try(:review).try(:can_be_sended?)\n users = []\n export_options = params[:export_options] || {}\n\n if params[:conclusion_review]\n include_score_sheet =\n params[:conclusion_review][:include_score_sheet] == '1'\n include_global_score_sheet =\n params[:conclusion_review][:include_global_score_sheet] == '1'\n note = params[:conclusion_review][:email_note]\n review_type = params[:conclusion_review][:review_type]\n\n if review_type == 'brief'\n export_options[:brief] = '1'\n elsif review_type == 'without_score'\n export_options[:hide_score] = '1'\n end\n end\n\n @conclusion_draft_review.to_pdf(current_organization, export_options)\n\n if include_score_sheet\n @conclusion_draft_review.review.score_sheet current_organization, draft: true\n end\n\n if include_global_score_sheet\n @conclusion_draft_review.review.global_score_sheet(current_organization, draft: true)\n end\n\n (params[:user].try(:values).try(:reject, &:blank?) || []).each do |user_data|\n user = User.find_by(id: user_data[:id]) if user_data[:id]\n send_options = {\n note: note,\n include_score_sheet: include_score_sheet,\n include_global_score_sheet: include_global_score_sheet\n }\n\n if user && !users.include?(user)\n @conclusion_draft_review.send_by_email_to(user, send_options)\n\n users << user\n end\n end\n\n unless users.blank?\n flash.notice = t('conclusion_review.review_sended')\n\n redirect_to edit_conclusion_draft_review_url(\n @conclusion_draft_review)\n else\n render action: :compose_email\n end\n elsif @conclusion_draft_review.try(:review)\n flash.alert = t('conclusion_review.review_not_approved')\n render action: :compose_email\n else\n redirect_to conclusion_draft_reviews_url\n end\n end",
"title": ""
},
{
"docid": "e28d34969c38303ccdaeda5eeed215de",
"score": "0.5774298",
"text": "def approved_notification\n @user = params[:user]\n mail(to: @user.email, subject: 'Library Card Request Approved')\n end",
"title": ""
},
{
"docid": "41a28a05662c15728dc074aa0312be83",
"score": "0.57711595",
"text": "def signup_email\n MnoEnterprise::SystemNotificationMailer.registration_instructions(params.require(:user).require(:email)).deliver_later\n\n head :no_content\n end",
"title": ""
},
{
"docid": "89bdd1cb1052a5b37e7e2eeefb503814",
"score": "0.5771141",
"text": "def user_sign_up(user)\n @user = user\n\n set_attachments\n\n case APP_CONFIG['app_country']\n when 'AR'\n mail(to: 'sebastian@socialtarget.net', subject: \"Notificaciones @ Social Target - Nuevo usuario registrado\")\n when 'CO'\n mail(to: 'sebastian@socialtarget.net', subject: \"Notificaciones @ Social Target - Nuevo usuario registrado\")\n when 'MX'\n mail(to: 'sebastian@socialtarget.net', subject: \"Notificaciones @ Social Target - Nuevo usuario registrado\")\n end\n\n end",
"title": ""
},
{
"docid": "510902e5fcc783cb7865cdd8b1808e04",
"score": "0.5770884",
"text": "def send_approve_email\n 'send_approve_email'\n end",
"title": ""
},
{
"docid": "c65ec20b142785bef83b87290f3fda6b",
"score": "0.5769808",
"text": "def activate_account_email(user)\n @user = user\n @url = validate_account_url(@user.signup_token)\n mail(to: @user.email, subject: \"Welcome to Report It!\")\n end",
"title": ""
},
{
"docid": "90ef48aa393b7659787d921adcaaefe9",
"score": "0.5768787",
"text": "def invoice_is_ready invoice = Invoice.first\n @invoice = invoice\n mail(to: @invoice.user.email, subject: \"You Invoice is ready\") do |format|\n format.text\n format.mjml\n end\n end",
"title": ""
},
{
"docid": "b91d3be02334f1a7c363a459822f91d5",
"score": "0.5764165",
"text": "def influencer_converted_to_affiliate(user)\n set_attachments\n\n mail(to: user.email, subject: \"Notificaciones @ Social Target - Has sido recategorizado en Social Target\")\n end",
"title": ""
},
{
"docid": "dd9324746de59bd44c55a066f041a7e1",
"score": "0.5764119",
"text": "def activation_needed_email(user)\n @user = user\n @url = \"http://lvh.me:3000/users/#{user.activation_token}/activate\"\n mail(:to => user.email,\n :subject => \"Welcome to StackClown\")\n end",
"title": ""
},
{
"docid": "fb7dcb6e0574c3d813642823754e04b8",
"score": "0.57603824",
"text": "def sendEmailMessage(template_to_use)\n puts \"Sending Email Message to User\" if @debug_logging_enabled\n begin\n\n # Create SMTP Defaults hash\n smtp_defaults = {\n :address => @smtp_server,\n :port => @smtp_port,\n :authentication => @smtp_auth_type,\n :enable_starttls_auto => @smtp_tls\n }\n\n # Unless there was not a user specified\n unless @smtp_username.nil? || @smtp_username.empty?\n # Set the email authentication\n smtp_defaults[:user_name] = @smtp_username\n smtp_defaults[:password] = @smtp_password\n end\n\n Mail.defaults do\n delivery_method :smtp, smtp_defaults\n end\n\n # Send out Message VIA SMTP\n to = @recipient_json[\"smtpaddress\"]\n from = @smtp_from\n display_name = @smtp_from\n subject = template_to_use[\"Subject\"]\n htmlbody = template_to_use[\"HTML Content\"]\n textbody = template_to_use[\"Text Content\"]\n\n mail = Mail.new do\n from \"#{display_name} <#{from}>\"\n to \"#{to}\"\n subject \"#{subject}\"\n\n text_part do\n body \"#{textbody}\"\n end\n end\n \n\n # Embed linked images into the html body if present\n unless htmlbody.nil? || htmlbody.empty?\n # Initialize a hash of image links to embeded values\n embedded_images = {}\n\n # Iterate over the body and embed necessary images\n htmlbody.scan(/\"cid:(.*)\"/) do |match|\n # The match variable is an array of Regex groups (specified with\n # parentheses); in this case the first match is the url\n url = match.first\n # Unless we have already embedded this url\n unless embedded_images.has_key?(url)\n cid = embed_url(mail,url)\n embedded_images[url] = cid\n end\n end\n\n # Replace the image URLs with their embedded values\n embedded_images.each do |url, cid|\n htmlbody.gsub!(url, cid)\n end\n\n mail.html_part do\n content_type \"text/html; charset=UTF-8\"\n body \"#{htmlbody}\"\n end\n end\n \n if !template_to_use[\"Attachments\"].nil?\n mail = apply_attachments(mail, template_to_use[\"Attachments\"])\n end\n\n puts \"Delivering the mail\" if @debug_logging_enabled\n mail.deliver\n\n if !mail.bounced?\n puts \"Mail message: #{mail.inspect}\" if @debug_logging_enabled\n return { \"message_id\" => mail.message_id }\n else\n send_error = <<-LOGGING\nThere was an error sending the email message\n Bounced?: #{mail.bounced?}\n Final Recipient: #{mail.final_recipient}\n Action: #{mail.action}\n Error Status: #{mail.error_status}\n Diagnostic Code: #{mail.diagnostic_code}\n Retryable?: #{mail.retryable}\nLOGGING\n\n puts send_error if @debug_logging_enabled\n @error_message = @error_message + send_error\n return { \"message_id\" => nil }\n end\n rescue Exception => e\n if @error_handling == \"Raise Error\"\n raise\n else\n send_error = \"#{e.class.name} : #{e}\"\n puts send_error if @debug_logging_enabled\n @error_message = @error_message + send_error\n return { \"message_id\" => nil }\n end\n end\n end",
"title": ""
},
{
"docid": "469e966acf5e697b7db9834d364d6222",
"score": "0.57521075",
"text": "def export_finished_success_email(user, filename, opml)\n @user = user\n @url = read_url locale: user.locale\n attachments[filename] = opml\n I18n.with_locale user.locale do\n mail to: @user.email\n end\n end",
"title": ""
},
{
"docid": "e6a603789763a396b54d8fd69bee9636",
"score": "0.5752084",
"text": "def send_email\n return true unless RunLevel.is_normal?\n\n log_msg = \"SEND #{flavor} \" \\\n \"from=#{user&.login || \"nil\"} \" \\\n \"to=#{to_user&.login || \"nil\"} \" +\n queued_email_integers.map { |x|\n \"#{x.key}=#{x.value}\"\n }.join(\" \") +\n queued_email_strings.map do |x|\n \"#{x.key}=\\\"#{x.value}\\\"\"\n end.join(\" \")\n self.class.debug_log(log_msg)\n current_locale = I18n.locale\n result = false\n if user.present? && user == to_user\n unless Rails.env.test?\n raise(\"Skipping email with same sender and recipient: #{user.email}\\n\")\n end\n else\n result = deliver_email\n end\n I18n.locale = current_locale\n result\n rescue StandardError => e\n warn(\"ERROR CREATING EMAIL\")\n warn(log_msg)\n warn(e)\n warn(e.backtrace)\n I18n.locale = current_locale\n false\n end",
"title": ""
},
{
"docid": "30c7a04493ccc75cfed73bc0b0c8e13b",
"score": "0.57519436",
"text": "def send_welcome_email\n #if Rails.env.production?\n if email.present?\n if followed_by >= 0\n # to send emails in delayed jobs use\n # UserMailer.instauser_welcome_email(id).delay.deliver!\n UserMailer.instauser_welcome_email(self.id).deliver\n else\n UserMailer.instauser_reject_email(self.id).deliver!\n end\n end\n #end\n end",
"title": ""
},
{
"docid": "c3644b6b5e9c52657175ffc49407bef8",
"score": "0.57516205",
"text": "def user_sign_up_notification(user)\n @user = user\n\n mail(to: \"<#{user.email}>\", subject: \"Success! You did it.\")\n end",
"title": ""
},
{
"docid": "8ef4bb93d70880d78b429175ba817a7b",
"score": "0.57490337",
"text": "def confirm_from_email\n bookable_asset = BookableAsset.find_by_euid(params[:euid])\n booking_request = bookable_asset.booking_requests.find(params[:booking_request_id])\n redirect_path = current_user ? user_path(current_user) : login_path\n\n if bookable_asset.confirmed?\n flash[:warn] = \"You've already accepted this booking_request\"\n return redirect_to redirect_path\n end\n booking_request.accept!\n\n flash[:notice] = \"You've accepted this booking_request.\"\n redirect_to redirect_path\n end",
"title": ""
},
{
"docid": "3b94bf2315006645bfe34ae92a4e5a6d",
"score": "0.57440007",
"text": "def send_signature_complete_mail(document)\n DocumentMailer.with(email: document.user.email,\n document: document).signing_complete.deliver_later\n DocumentEvent.create!(document: document, message: \"Varsel om ferdig signering sendt til #{document.user.email} \")\n\n end",
"title": ""
},
{
"docid": "72750cbf6754284b8c551afea6bf0f44",
"score": "0.5738689",
"text": "def consent\n send_data(gen_pdf(params[:wedgetail]), :filename => \"consent.pdf\", :type => \"application/pdf\")\n end",
"title": ""
},
{
"docid": "fa82303987ad82a89c794a45a561f809",
"score": "0.573382",
"text": "def accepted(opportunity_id, profile_id)\n @opportunity = Opportunity.find(opportunity_id)\n @profile = Profile.find(profile_id)\n mail(to: [@opportunity.user.email, @profile.user.email], subject: 'A Candidate has accepted your invitation to participate in a MOBEEAS Opportunity')\n end",
"title": ""
},
{
"docid": "e63c6b447b4e407e94dad4c391f36250",
"score": "0.57307035",
"text": "def response_sent_advisee(user, message)\n @user = user\n @message = message\n mail to: @user.email, subject: \"New response message from Advisor\"\n end",
"title": ""
},
{
"docid": "0892ece6cfb0546f61ab13801ce0d0c5",
"score": "0.5727632",
"text": "def send_purchase_confirmation_email\n return if @user.blank?\n\n send_mail_response = pepo_campaign_obj.send_transactional_email(\n @user.email, GlobalConstant::PepoCampaigns.purchase_confirmation, {})\n\n send_purchase_confirmation_email_via_hooks if send_mail_response['error'].present?\n end",
"title": ""
},
{
"docid": "91707c4ca85209bba6f20d0195c43191",
"score": "0.57187825",
"text": "def activation_success_email(user)\n @user = user\n @subject = \"[#{SITE_NAME}] Account activated\"\n mail(bcc: @user.email, subject: @subject)\n end",
"title": ""
},
{
"docid": "0a60072d799b40bc35ae9ef577072310",
"score": "0.5716106",
"text": "def profile_completion_reminder(user_id)\n @user = User.find(user_id)\n\n mail :to => recipient(@user.email), :subject => \"25c Profile Completion Reminder\"\n end",
"title": ""
},
{
"docid": "88ee1f320b2fd393f1f27629372080ca",
"score": "0.57157403",
"text": "def profile_email(user)\n @user = user\n @url = 'http://localhost:3000'\n mail(to: @user.email, subject: 'Welcome to CloudTrendz')\n end",
"title": ""
},
{
"docid": "650996f2cbda8f7ca8f673e7fd49e883",
"score": "0.5715318",
"text": "def success(user, account)\n @greeting = \"Successfully retrieved data for your account - #{account.inspect}\"\n\n mail to: user.email\n end",
"title": ""
},
{
"docid": "391578c87daecf6184d4d2d9464ce8ad",
"score": "0.57145625",
"text": "def user_event_confirmed(user, event)\n @user = user\n @event = event\n meeting = user.meetings.find_by(event: event)\n attachments.inline['prenotazione.ics'] = meeting.ical.to_ical if meeting.confirmed?\n mail(to: @user.email, subject: t('user_event_modified', scope: 'message.email.subjects') + ' ' + (l event.date_on)) if user.email.present?\n end",
"title": ""
},
{
"docid": "264a0085d110eea2d346be5dbcc3c40a",
"score": "0.5712008",
"text": "def send_welcome_email(user)\n mail to: user.email, subject: \"Sign Up Confirmation - Welcome to NetworkMill\"\n Email.create(:user_id => user.id, :sent_to => user.email, :title => \"welcome_email\")\n end",
"title": ""
},
{
"docid": "ed1adcc24047431f0c133c57b5b0133f",
"score": "0.57036185",
"text": "def send_new_mail(document)\n recipient = Recipient.where(document: document, sent: false).first\n if recipient.present?\n DocumentMailer.with(user: document.user,\n email: recipient.email,\n document: document).signature_email.deliver_later\n recipient.update(sent: true)\n DocumentEvent.create!(document: document, message: \"E-post sendt til #{recipient.email} \")\n if document.status != 1\n document.update!(status: 1)\n end\n else\n document.update!(status: 2)\n send_signature_complete_mail(document)\n end\n end",
"title": ""
}
] |
d4a7fb87a7900f6f800e4fa066584e9e | DELETE /attachments/1 DELETE /attachments/1.json | [
{
"docid": "b2e052f06425905b12675f99faf17f85",
"score": "0.7016565",
"text": "def destroy\n @attachment.destroy\n redirect_to '/examples', notice: 'Attachment was successfully destroyed.'\n end",
"title": ""
}
] | [
{
"docid": "3bd44d013e292eb4ae4e001b644f288b",
"score": "0.7849054",
"text": "def destroy\n @attachment.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "447e3f5d7bd989c5e252406885a31c86",
"score": "0.7847585",
"text": "def destroy\n @attachment = Attachment.find(params[:id])\n @attachment.destroy\n\n respond_to do |format|\n format.html { redirect_to attachments_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "447e3f5d7bd989c5e252406885a31c86",
"score": "0.7847585",
"text": "def destroy\n @attachment = Attachment.find(params[:id])\n @attachment.destroy\n\n respond_to do |format|\n format.html { redirect_to attachments_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "df82938626b42ad8956fce8cce6605df",
"score": "0.77190214",
"text": "def destroy\n @item_attachment = ItemAttachment.find(params[:id])\n @item_attachment.destroy\n\n respond_to do |format|\n format.html { redirect_to item_attachments_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1b8440b96430a819cb8c8b1a5872f19f",
"score": "0.7714739",
"text": "def destroy\n @request_attachment = RequestAttachment.find(params[:id])\n @request_attachment.destroy\n\n respond_to do |format|\n format.html { redirect_to request_attachments_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "42554a586f3cb714910d6f06bcd6c2dd",
"score": "0.76728064",
"text": "def destroy\n if Attachment.find(params[:id]).destroy\n render :json => { :success => true }\n else\n render :json => { :success => false, :msg => I18n.t(\"backend.general.cantDelete\") }\n end\n end",
"title": ""
},
{
"docid": "9681069774c25ffd8e3885db0d8531b6",
"score": "0.7639124",
"text": "def destroy\n @item = Item.find(params[:id])\n @item.item_attachments.all.find(params[:attachment_id]).destroy\n end",
"title": ""
},
{
"docid": "5162753ce1dd7cbd096da65c137ba1a0",
"score": "0.763636",
"text": "def delete_attachment(args)\n query_str = build_attachment_query(args)\n \n @conn.query({url_path: query_str, method: :delete})\n end",
"title": ""
},
{
"docid": "c4b9e629fb5ebcc50adc385d3645f5ee",
"score": "0.7605892",
"text": "def delete id, options={}, headers={}\n @connection.delete \"pending_attachments/#{id}.json\", options, headers\n end",
"title": ""
},
{
"docid": "17961dc77ab22982c4121ac402e58739",
"score": "0.75817955",
"text": "def destroy\n @attachment.destroy\n respond_to do |format|\n format.html { redirect_to attachments_url, notice: t(\"controllers.attachment.success_destroyed\") }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "8605a21a07308219a55ec6021f47c90e",
"score": "0.75745857",
"text": "def destroy\n if @attachment.destroy \n render json: { message: \"File deleted from server\" }\n else\n render json: { message: @attachment.errors.full_messages.join(',') }\n end\n end",
"title": ""
},
{
"docid": "f4a9e3ef2c8191039efdca0fcb56303c",
"score": "0.7571439",
"text": "def destroy\n @attachment = Attachment.find(params[:id])\n @attachable = @attachment.attachable\n @attachment.destroy\n\n respond_to do |format|\n format.html { redirect_to @attachable }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "f4ce09a7a5a51ecfe79af346b31b6470",
"score": "0.7554992",
"text": "def destroy\n @attachment.destroy\n respond_to do |format|\n format.html { redirect_to :back }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "fc4127a729e7f41c20fc012dea8315ba",
"score": "0.7547968",
"text": "def destroy\n @attachment = Attachment.find(params[:id])\n @attachment.destroy\n\n redirect_to attachments_url\n end",
"title": ""
},
{
"docid": "bc2fe5e61194a4de74bb27aaf19a09db",
"score": "0.75340784",
"text": "def destroy\n id = @request_attachment.request_id\n @request_attachment.destroy\n flash[:success] = \"Attachment was successfully deleted.\"\n respond_to do |format|\n format.html { redirect_to controller: \"requests\", action: \"edit\", id: \"#{id}\"}\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "8750152bec070aa93c440d4f21f4e736",
"score": "0.7526424",
"text": "def destroy\n @attachment = Attachment.find(params[:id])\n @attachment.destroy\n\n respond_to do |format|\n format.html { redirect_to(attachments_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "24908ba4e0a626b949f0a00e7735869b",
"score": "0.7502998",
"text": "def destroy\n @attachment.destroy\n\n respond_to do |format|\n format.html { redirect_to attachments_url, notice: \"Attachment was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "5ddcbb79e07fb6152199b7a0461f292f",
"score": "0.7502131",
"text": "def destroy\n @attachment.destroy\n respond_to do |format|\n format.html { redirect_to attachments_url, notice: 'Attachment was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "5ddcbb79e07fb6152199b7a0461f292f",
"score": "0.7502131",
"text": "def destroy\n @attachment.destroy\n respond_to do |format|\n format.html { redirect_to attachments_url, notice: 'Attachment was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "5ddcbb79e07fb6152199b7a0461f292f",
"score": "0.7502131",
"text": "def destroy\n @attachment.destroy\n respond_to do |format|\n format.html { redirect_to attachments_url, notice: 'Attachment was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "5ddcbb79e07fb6152199b7a0461f292f",
"score": "0.7502131",
"text": "def destroy\n @attachment.destroy\n respond_to do |format|\n format.html { redirect_to attachments_url, notice: 'Attachment was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "5ddcbb79e07fb6152199b7a0461f292f",
"score": "0.7502131",
"text": "def destroy\n @attachment.destroy\n respond_to do |format|\n format.html { redirect_to attachments_url, notice: 'Attachment was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "5ddcbb79e07fb6152199b7a0461f292f",
"score": "0.7502131",
"text": "def destroy\n @attachment.destroy\n respond_to do |format|\n format.html { redirect_to attachments_url, notice: 'Attachment was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "5ddcbb79e07fb6152199b7a0461f292f",
"score": "0.7502131",
"text": "def destroy\n @attachment.destroy\n respond_to do |format|\n format.html { redirect_to attachments_url, notice: 'Attachment was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "5ddcbb79e07fb6152199b7a0461f292f",
"score": "0.7502131",
"text": "def destroy\n @attachment.destroy\n respond_to do |format|\n format.html { redirect_to attachments_url, notice: 'Attachment was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "5ddcbb79e07fb6152199b7a0461f292f",
"score": "0.7502131",
"text": "def destroy\n @attachment.destroy\n respond_to do |format|\n format.html { redirect_to attachments_url, notice: 'Attachment was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "b806a11c0b1f5be8b8dda5acb8010d14",
"score": "0.749864",
"text": "def destroy\n @attachment = Attachment.find(params[:id])\n @attachment.destroy\n\n respond_to do |format|\n format.html { redirect_to budget_attachments_url(@attachment.budget) }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "ab3c12d58b7f7b92b3cb57ade22afc82",
"score": "0.74971807",
"text": "def destroy\n\t\t@attachment.destroy\n\t\trespond_to do |format|\n\t\t\tformat.html { redirect_to attachments_url }\n\t\t\tformat.json { head :no_content }\n\t\tend\n\tend",
"title": ""
},
{
"docid": "5a53b19c796b6cd4ad460a3ab939a6e5",
"score": "0.7483441",
"text": "def destroy\n @attachment_file = AttachmentFile.find(params[:id])\n\tremove_file(@attachment_file)\n\t@attachment_file.destroy\n\n respond_to do |format|\n format.html { redirect_to :back }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "4d133a18f7fd87fa10c4cacd0dd004a9",
"score": "0.7467172",
"text": "def destroy\n @attachment.destroy\n respond_to do |format|\n format.html { redirect_to document_path(@document, anchor: 'attachments'), notice: 'El archivo fue eliminado con éxito.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "e1475f631e7b15c1524d10a4219a6898",
"score": "0.7462598",
"text": "def destroy\n @attachment = Attachment.find(params[:id])\n @attachment.destroy\n\n respond_to do |format|\n format.html { redirect_to(attachments_url) }\n format.xml { head :ok }\n format.json { render :json => 'removeParentTR(t);' }\n end\n end",
"title": ""
},
{
"docid": "b2a8ec521b7095688bdab199fab748e4",
"score": "0.74378055",
"text": "def remove_attachment\n attachment = Attachment.find(params[:id])\n attachment.delete\n end",
"title": ""
},
{
"docid": "0de965c554b958c0400743c9b5586186",
"score": "0.74230564",
"text": "def destroy\n \n @invoice_attachment = InvoiceAttachment.find(params[:id])\n @invoice_attachment.destroy\n\n respond_to do |format|\n format.html { redirect_to(\"/invoices/#{@invoice_attachment.invoice_id}\", :notice => 'Attachment successfully deleted.') }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "6ea0ff1a0005b48a13d63482774e8a2b",
"score": "0.741736",
"text": "def destroy\n @attachment = Attachment.find(params[:id])\n @attachment.destroy\n respond_with(@attachment)\n end",
"title": ""
},
{
"docid": "7b4292e056d5bc03cf78c61ea2a8b12b",
"score": "0.7386106",
"text": "def destroy\n @attach = Attach.find(params[:id])\n @attach.destroy\n\n respond_to do |format|\n format.html { redirect_to attaches_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "77e08b8819844f9dfb5cec4fbdc5c8d2",
"score": "0.73856115",
"text": "def destroy\n @offices_attachment = OfficesAttachment.find(params[:id])\n @offices_attachment.destroy\n\n respond_to do |format|\n format.html { redirect_to offices_attachments_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "010ace692523902ebe3f2297ad1cf2e1",
"score": "0.7379942",
"text": "def destroy\n @attachment = @parent.attachments.find(params[:id])\n @attachment.destroy\n respond_with(@parent, @attachment)\n end",
"title": ""
},
{
"docid": "b629d8e1cca737c870d49eff93d171e7",
"score": "0.7365819",
"text": "def destroy\n @subject_attachment.destroy\n respond_to do |format|\n format.html { redirect_to subject_attachments_url, notice: 'Subject attachment was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "28ec9f9dbd22ceed4a51d1fd056316cd",
"score": "0.7362662",
"text": "def destroy\n @attachment.destroy\n end",
"title": ""
},
{
"docid": "81e2eb00289247fdf59eac87e8a56cc5",
"score": "0.73391277",
"text": "def destroy\n @attachment.destroy\n respond_with { head :no_content }\n end",
"title": ""
},
{
"docid": "f5424c63834212face3876f8f193ef18",
"score": "0.732749",
"text": "def destroy\n @add_file_to_attachment.destroy\n respond_to do |format|\n format.html { redirect_to add_file_to_attachments_url, notice: 'Add file to attachment was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "02d5f84aefeea9228f7db7b94de6d66e",
"score": "0.7327461",
"text": "def destroy\n @attachment.destroy\n respond_to do |format|\n format.html { redirect_to @user, notice: 'Attachment was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "d0537ffbf8e25d0fca9b228915f4b91a",
"score": "0.73245674",
"text": "def destroy\n @link_attachment = LinkAttachment.find(params[:id])\n @link_attachment.destroy\n\n respond_to do |format|\n format.html { redirect_to link_attachments_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "60379309b0a8f0dce6d13d78b13621e6",
"score": "0.7324342",
"text": "def destroy\n @mail_attachment.destroy\n respond_to do |format|\n format.html { redirect_to mail_attachments_url, notice: 'Mail attachment was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "08f49029210aaefb03a0894b227c8570",
"score": "0.73166287",
"text": "def delete_attachment\n @item = Item.find(params[:id])\n if @item.attachments.exists?(params[:attachment_id])\n @item.attachments.find(params[:attachment_id]).destroy\n @item.touch\n redirect_to edit_item_path(@item), notice: 'Pièce jointe supprimée' \n else\n redirect_to edit_item_path(@item), alert: 'Erreur lors de la suppression de la pièce jointe' \n end\n end",
"title": ""
},
{
"docid": "9e54403a93f1c24aad37d2572e63c4cc",
"score": "0.73152685",
"text": "def destroy\n @post_attachment.destroy\n respond_to do |format|\n format.html { redirect_to post_attachments_url, notice: 'Post attachment was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1056edae04d1d10cb4f1b578e9f44df5",
"score": "0.73115635",
"text": "def destroy\n @attachment = Attachment.find(params[:id])\n @attachment.destroy\n\n respond_to do |format|\n format.xml { head :ok }\n format.js { head :ok }\n end\n end",
"title": ""
},
{
"docid": "8205b289cb7557b6c91b127e7c9952e3",
"score": "0.73030096",
"text": "def destroy\n @sequence_attachment.destroy\n respond_to do |format|\n format.html { redirect_to @sequence, notice: 'Sequence attachment was successfully deleted.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "4a41bd705cebdd994ac16dd1684c6036",
"score": "0.724123",
"text": "def destroy_attachments\n send_to_attachments(:destroy)\n end",
"title": ""
},
{
"docid": "d0c6a314d1d3d1de0cbfb80e47045d1c",
"score": "0.72220105",
"text": "def destroy\n @attached_file.destroy\n respond_to do |format|\n format.html { redirect_to attached_files_url, notice: 'Attached file was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "69549609b4384a3682afde960e1c2607",
"score": "0.72125727",
"text": "def destroy\n @attachments = Attachments.find(params[:id])\n @attachments.destroy\n\n respond_to do |format|\n flash[:notice] = 'Attachment was successfully deleted.'\n format.html { redirect_to graduate_applicant_attachments_path(@attachments.graduate_applicant) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "876b587deb47bb8d8e50ab2e063480be",
"score": "0.7199245",
"text": "def destroy\n the_name = @attachment.document\n @attachment.destroy\n respond_to do |format|\n format.html { redirect_to attachments_url, notice: \"[#{the_name}] was successfully deleted.\" }\n format.js { redirect_to attachments_url, notice: \"[#{the_name}] was successfully deleted.\" }\n end\n end",
"title": ""
},
{
"docid": "85cb42262029c0c0c42d9d8dbce98673",
"score": "0.71990806",
"text": "def destroy\n @section_attachment = SectionAttachment.find(params[:id])\n @section_attachment.destroy\n\n respond_to do |format|\n format.html { redirect_to section_attachments_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "986f3cca5b2a94347c9d1f5e446c62e7",
"score": "0.719463",
"text": "def destroy\n @attach_file.destroy\n respond_to do |format|\n format.html { redirect_to attach_files_url, notice: 'Attach file was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "2f50ffc24c963acb176a82f1392d3124",
"score": "0.71924746",
"text": "def destroy\n @notice_attachment.destroy\n respond_to do |format|\n format.html { redirect_to notice_attachments_url, notice: 'Notice attachment was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "9dcf228c43f030e48ba266ba602663d9",
"score": "0.7191356",
"text": "def mediaObjectDelete(id,attachto,path)\n\n\tend",
"title": ""
},
{
"docid": "4107c09caf8637b78d34db9abd590c09",
"score": "0.7190464",
"text": "def destroy\n @quote_attachment = QuoteAttachment.find(params[:id])\n @quote_attachment.destroy\n\n respond_to do |format|\n format.html { redirect_to quote_attachments_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a7d558f3ed60039c89bb4ef583db15e6",
"score": "0.71757317",
"text": "def destroy\n @attachment.destroy\n redirect_to attachments_path, notice: \"Successfully removed attachment.\"\n end",
"title": ""
},
{
"docid": "62c54a1c3d4a8c8049d17497d66f1d61",
"score": "0.71721566",
"text": "def destroy\n @purchase_attachment = PurchaseAttachment.find(params[:id])\n @purchase_attachment.destroy\n\n respond_to do |format|\n format.html { redirect_to(\"/purchases/#{@purchase_attachment.purchase_id}\", :notice => 'Attachment successfully deleted.') }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "f9336548a68635581eed4c967ee20f36",
"score": "0.7169465",
"text": "def destroy\n @p_attachment = PAttachment.find(params[:id])\n @p_attachment.destroy\n\n respond_to do |format|\n format.html { redirect_to(p_attachments_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "09cf37c3fd0fd457a3a5afd396ce771c",
"score": "0.7161309",
"text": "def destroy\n @newattachment.destroy\n respond_to do |format|\n format.html { redirect_to newattachments_url, notice: 'Newattachment was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1e2e1484771524c098005200cab7ce82",
"score": "0.7150505",
"text": "def destroy\n @attachment.destroy\n redirect_to attachments_url, notice: 'Attachment was successfully destroyed.'\n end",
"title": ""
},
{
"docid": "efb7c35d18aa3a70b02758da19a4f86f",
"score": "0.71502316",
"text": "def destroy\n @patient_attachment.destroy\n respond_to do |format|\n format.html { redirect_to patient_attachments_url, notice: 'Patient attachment was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "fd32f1cadd9b6d6bb34d21ff6228d216",
"score": "0.7143909",
"text": "def destroy\n @docattachment = Docattachment.find(params[:id])\n @docattachment.destroy\n\n respond_to do |format|\n format.html { redirect_to(docattachments_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "a6dcd87ef2b3943247430e9421ec9d91",
"score": "0.71416914",
"text": "def destroy\n @moodboard_attachment.destroy\n respond_to do |format|\n format.html { redirect_to moodboard_attachments_url, notice: 'Moodboard attachment was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "c64d1f70e089d14a970de3a2a7a4fc58",
"score": "0.713995",
"text": "def destroy\n @collection_note_attachment.destroy\n respond_to do |format|\n format.html { redirect_to collection_note_attachments_url, notice: 'Collection note attachment was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "363530400acf4eb1528871bc6fad9a8b",
"score": "0.7139159",
"text": "def destroy\n if @parent.attachments.find(params[:id]).destroy\n flash[:notice] = t('messages.attachment.success.delete')\n else\n flash[:alert] = t('messages.attachment.errors.delete')\n end\n\n redirect_to :back\n end",
"title": ""
},
{
"docid": "ae9a60902d343bf2f9352331663b17f5",
"score": "0.7138509",
"text": "def destroy\n @attachment.destroy\n respond_to do |format|\n format.js { render :destroy }\n end\n end",
"title": ""
},
{
"docid": "e86dfe957c3d4c844113a93abf4ce81c",
"score": "0.713107",
"text": "def destroy\n @kf_diary_attachment = Kf::DiaryAttachment.find(params[:id])\n @kf_diary_attachment.destroy\n\n respond_to do |format|\n format.html { redirect_to kf_diary_attachments_url({:page => params[:page]}) }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "6bdd30eb2d6d63754669e67cf4dc4904",
"score": "0.7126198",
"text": "def destroy\n @list_attachment.destroy\n respond_to do |format|\n format.html { redirect_to list_attachments_url, notice: 'List attachment was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a45321065cc9e0e3b3d157817476ca4f",
"score": "0.7124755",
"text": "def destroy\n logger.info(\"blaaaaaaaa\")\n @forum_attachment = ForumAttachment.find(params[:id])\n @forum_attachment.destroy\n\n respond_to do |format|\n format.html { redirect_to(forum_attachments_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "c77764c31098fa77d65e1a9ae7f3754e",
"score": "0.71194106",
"text": "def delete_attachment\n Log.add_info(request, params.inspect)\n\n raise(RequestPostOnlyException) unless request.post?\n\n begin\n attachment = MailAttachment.find(params[:attachment_id])\n @email = Email.find(params[:id])\n\n if attachment.email_id == @email.id\n attachment.destroy\n\n update_attrs = ActionController::Parameters.new({updated_at: Time.now})\n if @email.status == Email::STATUS_TEMPORARY\n update_attrs[:status] = Email::STATUS_DRAFT\n end\n @email.update_attributes(update_attrs.permit(Email::PERMIT_BASE))\n end\n rescue => evar\n Log.add_error(request, evar)\n end\n\n render(:partial => 'ajax_mail_attachments', :layout => false)\n end",
"title": ""
},
{
"docid": "fd771f7ada6d80a7fff1bd3490de2626",
"score": "0.7107471",
"text": "def destroy\n @newspost_attachment.destroy\n respond_to do |format|\n format.html { redirect_to newspost_attachments_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "cd85ae71b0f357b52ac6561903abf9f8",
"score": "0.71063465",
"text": "def destroy\n @attachment = @scope.find(params[:id])\n if can?(:destroy, @attachment)\n if @attachment.destroy\n @contact.index_keywords!\n end\n end\n render :json => \"OK\"\n end",
"title": ""
},
{
"docid": "a892ba439486433fbd70e2d8d68bbc2e",
"score": "0.7100005",
"text": "def destroy\n @level = Level.find(params[:level_id])\n @attachment = @level.attachments.find(params[:id])\n @attachment.destroy\n respond_to do |format|\n format.html { redirect_to level_attachments_url}\n flash[:success] = 'Attachment was successfully destroyed.' \n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "e27e42680cba8cba90fd36022c64bbc2",
"score": "0.70996714",
"text": "def destroy\n @class.attachments.destroy\n @class.destroy\n respond_to do |format|\n format.html { redirect_to dashboard_discipline_classes_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "951b97cc0f8d694bfc25f7459005c809",
"score": "0.7093068",
"text": "def destroy\n @id = @attachment.id\n @attachment.destroy\n respond_to do |format|\n format.html { redirect_to attachments_url, notice: 'Attachment was successfully destroyed.' }\n format.js\n end\n end",
"title": ""
},
{
"docid": "2bb7d4cb4f99f879206dd06a7d3516e8",
"score": "0.7091115",
"text": "def destroy\n @attachment.destroy\n respond_to do |format|\n format.html { redirect_to attachable, notice: 'Attachment was successfully destroyed.' }\n format.json { head :no_content }\n format.js\n end\n end",
"title": ""
},
{
"docid": "045972298bace7fbe947e3c26fd0400c",
"score": "0.7087885",
"text": "def destroy\n @attached_image = AttachedImage.find(params[:id])\n @attached_image.destroy\n\n respond_to do |format|\n format.html { redirect_to attached_images_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "46d1b5703dd1942ca654f5e32f1cf2cf",
"score": "0.7086799",
"text": "def destroy\n @attached.file = nil\n @attached.save\n @attached.destroy\n respond_to do |format|\n format.html { redirect_to request.referrer, notice: 'Attached was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "324579e141b7140fe5ef13c849b917bf",
"score": "0.7071877",
"text": "def destroy\n @media_attachment.destroy\n respond_to do |format|\n format.html { redirect_to media_attachments_url, notice: 'Media attachment was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "527d1406e3958a39603b5378a33a89c1",
"score": "0.7054195",
"text": "def delete(attrs = {}, user = @@default_user)\n attrs = { id: @id, project_token: @project_token }.merge(attrs)\n @attributes = send_request(\"attachments/#{attrs[:id]}\", :delete) do |req|\n req.body = {\n token: attrs[:project_token],\n auth_token: user.auth_token\n }\n end\n end",
"title": ""
},
{
"docid": "1fc5cda681381c9a459b5af299f7ac5e",
"score": "0.7039223",
"text": "def delete_attachment\n Log.add_info(request, params.inspect)\n\n raise(RequestPostOnlyException) unless request.post?\n\n begin\n attach = Attachment.find(params[:attachment_id])\n\n @item = Item.find(attach.item_id)\n\n unless @item.check_user_auth(@login_user, 'w', true)\n raise t('msg.need_to_be_owner')\n end\n\n attach.destroy\n\n @item.update_attribute(:updated_at, Time.now)\n\n rescue => evar\n Log.add_error(request, evar)\n end\n\n render(:partial => 'ajax_item_attachment', :layout => false)\n end",
"title": ""
},
{
"docid": "ed5b5492c62f9d75b485d8dd89152e19",
"score": "0.7033055",
"text": "def destroy\n @ticket_attachment.destroy\n respond_to do |format|\n format.html { redirect_to ticket_attachments_url, notice: 'Ticket attachment was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "153b4f348adeb3a0c92a659fb313a749",
"score": "0.70192003",
"text": "def destroy\n @admin_attach = Admin::Attach.find(params[:id])\n @admin_attach.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_attaches_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "ae9a6271e28d5e3aef09ed27a4540277",
"score": "0.7015806",
"text": "def destroy\n @nota_attachment.destroy\n respond_with @nota_attachment\n end",
"title": ""
},
{
"docid": "2b77713c1f884d7b84c91234c37ec6a7",
"score": "0.7008586",
"text": "def destroy\n @email_attachment.destroy\n end",
"title": ""
},
{
"docid": "ac875309771d4337239aef9651a83b16",
"score": "0.7003535",
"text": "def destroy\n @publication_attachment = PublicationAttachment.find(params[:id])\n @publication_attachment.destroy\n\n respond_to do |format|\n format.html { redirect_to publication_attachments_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "d4160d698d9dc6bb46db0447ce5a98b2",
"score": "0.6989905",
"text": "def destroy\n @document = Document.find(params[:id])\n @document.delete_attachment\n @document.destroy\n\n head :no_content\n end",
"title": ""
},
{
"docid": "7b8987ffd13a3083c094e407ec4760af",
"score": "0.6982867",
"text": "def destroy\n @attachment = Attachment.find(params[:id])\n @attachment.destroy\n @thema = Thema.find(params[:thema_id])\n\n respond_to do |format|\n format.html { redirect_to @thema }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "7b8987ffd13a3083c094e407ec4760af",
"score": "0.6982867",
"text": "def destroy\n @attachment = Attachment.find(params[:id])\n @attachment.destroy\n @thema = Thema.find(params[:thema_id])\n\n respond_to do |format|\n format.html { redirect_to @thema }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "594e34abbd6b113dbc88dc058a5bf8ac",
"score": "0.6975204",
"text": "def delete_attachment\n if params[:id]\n at = ListingAttachment.find(params[:id])\n if at.listing.author_id == @current_user.id\n at.delete\n at.save\n\n respond_to do |format|\n format.html { redirect_to :back }\n format.json { render :json => {status: \"success\"} }\n end\n return\n end\n end\n\n respond_to do |format|\n format.html { redirect_to :back }\n format.json { render :json => {status: \"error\"} }\n end\n end",
"title": ""
},
{
"docid": "3ad36797b7852a98e2b427376fd7df4d",
"score": "0.6972835",
"text": "def destroy\n @proof_attachment.destroy\n respond_to do |format|\n format.html { redirect_to proof_attachments_url, notice: 'Proof attachment was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "4b5d00c75ceb080b33681d89c2e8be32",
"score": "0.6970415",
"text": "def destroy\n @portal_attachment.destroy\n respond_to do |format|\n format.html { redirect_to portal_attachments_url, notice: 'Portal attachment was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "98aa9ba7f53181de70449fc7204f6c9e",
"score": "0.6969118",
"text": "def delete_attachment\n if @post.attachments.exists?(params[:attachment_id])\n @post.attachments.find(params[:attachment_id]).destroy\n @post.touch # Induit la purge du cache de ce post\n redirect_to edit_post_path(@post), notice: 'Pièce jointe supprimée' \n else\n redirect_to edit_post_path(@post), alert: 'Erreur lors de la suppression de la pièce jointe' \n end\n end",
"title": ""
},
{
"docid": "899e6fc0d507d49451f59e4da76c852b",
"score": "0.6966351",
"text": "def destroy\n @attachment = Attachment.find(params[:id])\n project_id = @attachment.post.project.id\n phase = @attachment.post.phase\n post_id = @attachment.post.id\n @attachment.destroy\n\n respond_to do |format|\n format.html { redirect_to project_url(:id => project_id, :page => 'post_view', :phase => phase, :post_id => post_id) }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "4fbc358da940bae28691550837f8afe4",
"score": "0.6966319",
"text": "def destroy\n @panel_attachment = PanelAttachment.find(params[:id])\n @panel_attachment.destroy\n\n respond_to do |format|\n format.html { redirect_to panel_attachments_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "b1a17c1ee1af05c79fe156622df44818",
"score": "0.69654757",
"text": "def delete(path)\n begin\n response = client[path].delete :accept => 'application/json'\n rescue Exception => e\n puts e.inspect\n end\n end",
"title": ""
},
{
"docid": "18919a03d9d58a67fc6ddfa8a9192c4a",
"score": "0.69552815",
"text": "def destroy\n @reimbursement_note_attachment = ReimbursementNoteAttachment.find(params[:id])\n @reimbursement_note_attachment.destroy\n\n respond_to do |format|\n format.html { redirect_to(\"/reimbursement_notes/#{@reimbursement_note_attachment.reimbursement_note_id}\", :notice => 'Attachment successfully deleted.') }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "3c3069700eb6aaa4fd475f338c280461",
"score": "0.6954262",
"text": "def destroy\n @vehicle_attachment.destroy\n respond_to do |format|\n format.html { redirect_to vehicle_attachments_url, notice: 'Vehicle attachment was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
}
] |
89d107d80fc29c5fdc8d1ad5de786c5d | Performs an absolute mouse move | [
{
"docid": "8b5cd61d74787bba081bf92dd223b3f3",
"score": "0.73486066",
"text": "def absolute(x, y)\n xdo do |xdo|\n Libxdo.xdo_mousemove(xdo, x, y, 0)\n Libxdo.xdo_mouse_wait_for_move_to(xdo, x, y)\n end\n end",
"title": ""
}
] | [
{
"docid": "a0dce69ff003b060d8f805b6ab0661ec",
"score": "0.75613564",
"text": "def mousemove_relative(x, y)\n @logger.info(\"mousemove not supported\")\n end",
"title": ""
},
{
"docid": "0c230786ffcac4a52c3d21715da9e432",
"score": "0.75371945",
"text": "def move_relative x,y\n\t\t\tcmd \"mousemove_relative --sync #{x} #{y}\"\n\t\tend",
"title": ""
},
{
"docid": "3f315ec7e855becc70be7bc09ed852a7",
"score": "0.7449492",
"text": "def mouse_moved(window, x,y)\n \n end",
"title": ""
},
{
"docid": "6643f3f39d83613df942e42f80e9956b",
"score": "0.74222463",
"text": "def mouse_moved(x,y)\n \n end",
"title": ""
},
{
"docid": "454f8a624bd6a09d61b87b1f49add644",
"score": "0.74100757",
"text": "def mouse_move(locator)\n do_command(\"mouseMove\", [locator,])\n end",
"title": ""
},
{
"docid": "932f0ee1a27fe1fac6ed0813affdeb2c",
"score": "0.740876",
"text": "def mouse_move\n @mouse_move_event\n end",
"title": ""
},
{
"docid": "0f5a1c83ec906596ad139e3483ec567c",
"score": "0.72961485",
"text": "def move x,y\n\t\t\tcmd \"mousemove --sync #{x} #{y}\"\n\t\tend",
"title": ""
},
{
"docid": "c62791dfea7f919cc55c9513bef3ae15",
"score": "0.70969677",
"text": "def mouse_move(x, y)\n RFormSpec::Mouse.move_to(x, y)\n end",
"title": ""
},
{
"docid": "8e951ccc36164a5fba2905fd99127537",
"score": "0.7066372",
"text": "def move_relative_async(dx, dy)\n XDo::FFILib.xdo_mousemove_relative @_xdo_pointer, dx, dy\n end",
"title": ""
},
{
"docid": "d37d4c12d2a3c55b17b691e658a0fb2c",
"score": "0.70482963",
"text": "def mouse_moved(x,y)\n\t\t# [\n\t\t# \t# @live_wrapper,\n\t\t# \t@input_test,\n\t\t# ].each do |dynamic_obj|\n\t\t# \tdynamic_obj.mouse_moved x,y\n\t\t# end\n\t\t\n\t\t@mouse = CP::Vec2.new(x,y)\n\t\t\n\t\tx = @mouse_history.shift\n\t\tx = @mouse\n\t\t@mouse_history.push x\n\tend",
"title": ""
},
{
"docid": "a5a46de6cb182e73dbf539cb8e0d07a2",
"score": "0.6993396",
"text": "def mouse_moved(x,y)\n # p \"mouse position: #{[x,y]}.inspect\"\n end",
"title": ""
},
{
"docid": "a5a46de6cb182e73dbf539cb8e0d07a2",
"score": "0.6993396",
"text": "def mouse_moved(x,y)\n # p \"mouse position: #{[x,y]}.inspect\"\n end",
"title": ""
},
{
"docid": "2d113fd6a80560d06ddae1024890b12f",
"score": "0.698754",
"text": "def relative(x, y)\n loc = location\n \n xdo do |xdo|\n Libxdo.xdo_mousemove_relative(xdo, x, y)\n Libxdo.xdo_mouse_wait_for_move_to(xdo, loc[0] + x, loc[1] + y)\n end\n end",
"title": ""
},
{
"docid": "f7b3f8f8cb234191ca9bcf2c57aa1e2e",
"score": "0.6968055",
"text": "def wait_for_move_from(x, y)\n XDo::FFILib.xdo_mouse_wait_for_move_from @_xdo_pointer, x, y\n end",
"title": ""
},
{
"docid": "4398a715a77d8c9be9ab36586bf6e648",
"score": "0.6960443",
"text": "def wait_for_move_to(x, y)\n XDo::FFILib.xdo_mouse_wait_for_move_to @_xdo_pointer, x, y\n end",
"title": ""
},
{
"docid": "bdc4d5e7a0045e74ac7f0af0538f3d1e",
"score": "0.69452506",
"text": "def moveTo(xp, yp)\r\n $window.mouse_x = xp\r\n $window.mouse_y = yp\r\n end",
"title": ""
},
{
"docid": "e00e2793381a3c25c5a92ea50082d16d",
"score": "0.68895185",
"text": "def move_async(x, y, screen)\n XDo::FFILib.xdo_mousemove @_xdo_pointer, x, y, screen\n end",
"title": ""
},
{
"docid": "2a91747e2f9e7d3dd6868afc8150d0c2",
"score": "0.6881545",
"text": "def set_mouse_position(x, y)\n end",
"title": ""
},
{
"docid": "e141be82473d7e576fa9f5c8e678348e",
"score": "0.6864023",
"text": "def on_mousemove(x, y)\n end",
"title": ""
},
{
"docid": "d946ad340b132a48436697380f433ae0",
"score": "0.6811589",
"text": "def do_move(view)\n return unless @last_mouse_position\n\n # Move entities the same distance mouse has moved since last move event.\n delta_move = @last_mouse_position.vector_to(@mouse_ip.position)\n @last_mouse_position = @mouse_ip.position\n\n view.model.active_entities.transform_entities(delta_move, @selection)\n end",
"title": ""
},
{
"docid": "40a5a5f27260c87dcaa4ba1b8c89024d",
"score": "0.6794725",
"text": "def update_mouse(_moved = false)\n update_mouse_ctrl_buttons(@ctrl, ACTIONS)\n end",
"title": ""
},
{
"docid": "0e94892e242ebed4a741952a82e95e87",
"score": "0.6769349",
"text": "def onMouseMove(&block)\n set_event_proc(:onMouseMove, block)\n end",
"title": ""
},
{
"docid": "76c85713057f4056881eecdf1fd29553",
"score": "0.6741987",
"text": "def moveto(x, y, mouse_jump = false)\n center(x, y)\n super(x,y)\n #if Mouse.on_screen? and mouse_jump\n # new_x = x * 32 - ($game_map.display_x/4) + 16\n # new_y = y * 32 - ($game_map.display_y/4) + 16\n # Mouse.pos_set(new_x,new_y)\n #end\n end",
"title": ""
},
{
"docid": "b7d91bc9b689264d243520a277e1ff18",
"score": "0.6729747",
"text": "def move_mouse(x, y, speed = 10)\n @functions[__method__] ||= AU3_Function.new(\"MouseMove\", 'LLL', 'L')\n @functions[__method__].call(x, y, speed)\n nil\n end",
"title": ""
},
{
"docid": "426b1373aa89fe5a12563deb7cfacc06",
"score": "0.6722175",
"text": "def move_mouse_to_position(x, y)\n @robot ||= Robot.new\n @robot.mouseMove(x.to_i, y.to_i)\n end",
"title": ""
},
{
"docid": "4c96af3633e531f2b788855cb5aa21fe",
"score": "0.67139626",
"text": "def mouse_moved(window, x,y)\n\t\t@p = [x,y]\n\tend",
"title": ""
},
{
"docid": "bc6ca72c0851993532d594ba0f8744d8",
"score": "0.6705146",
"text": "def moveMouseToOffset(y_horizontal,x_vertical)\n $driver.action.move_by(y_horizontal, x_vertical).perform\n end",
"title": ""
},
{
"docid": "4735f5adece538d8938afa634e3732a3",
"score": "0.6667978",
"text": "def move_cursor(x, y)\n end",
"title": ""
},
{
"docid": "4e4690bae6e5ba58cc1de1cd82c35417",
"score": "0.6629738",
"text": "def fire_events_for_mouse_movement\n mouse_movement_actions.each do |action|\n execute_block_for_target(&action)\n end\n end",
"title": ""
},
{
"docid": "987e4abdec1df37decb893c913cfb2ff",
"score": "0.66205156",
"text": "def mouse_moved(window, live, main, turn_number, x,y)\n\t\t@p = [x,y]\n\tend",
"title": ""
},
{
"docid": "c95cd35180c8f0e9877b902187023ced",
"score": "0.6601509",
"text": "def mouse_movement(message)\n vector = message.value\n @game_object.move(vector.location.x, vector.location.y)\n end",
"title": ""
},
{
"docid": "b263b9952c80fdcb020e5ba571c1293c",
"score": "0.6546506",
"text": "def move_to point, duration = 0.2\n animate KCGEventMouseMoved, KCGMouseButtonLeft, current_position, point, duration\n end",
"title": ""
},
{
"docid": "6ab17769e5b1d7f90add866ad915b42e",
"score": "0.65445006",
"text": "def translate_mouse_coords(mouse_x = Mouse.x, mouse_y = Mouse.y)\r\n @window.translate_mouse_coords(mouse_x, mouse_y)\r\n end",
"title": ""
},
{
"docid": "61dbd5e1c59c6167daba7828a6947cce",
"score": "0.652788",
"text": "def move\n @xCenter += @xDelta\n @yCenter += @yDelta\n end",
"title": ""
},
{
"docid": "94be11ee9cfd68da54867410f8670246",
"score": "0.64954996",
"text": "def move(x, y)\n wmove(@win, y, x)\n end",
"title": ""
},
{
"docid": "e61e77b73b6f6ec3e2ea1cdfec072d6a",
"score": "0.6469504",
"text": "def update_mouse(moved)\n unless @force_close\n return update_mouse_index if Mouse.wheel != 0\n return false if moved && update_mouse_list\n else \n @running = false\n end\n end",
"title": ""
},
{
"docid": "0a5792979c5b9cfff9b748ace0e84f3e",
"score": "0.64576256",
"text": "def on_mouse_movement(*args,&block)\n options = (args.last.is_a?(Hash) ? args.pop : {})\n @mouse_movement_actions << ( block || lambda { |instance| send(options[:do]) } )\n end",
"title": ""
},
{
"docid": "41c42c244d58a5fdac967c4e12dcf148",
"score": "0.6455541",
"text": "def mouse_pressed\n target.x = mouse_x\n target.y = mouse_y\nend",
"title": ""
},
{
"docid": "ff6d0b898e3485600954e03f93ae3e21",
"score": "0.6449762",
"text": "def onMouseMove(&block)\n set_proc(:onMouseMove, block)\n end",
"title": ""
},
{
"docid": "8dfb2a22f89572e0d15051af6048002e",
"score": "0.64318573",
"text": "def window_moved x,y\n end",
"title": ""
},
{
"docid": "63b29b28ffb054bf5d7c1fc7cc61cfa4",
"score": "0.64090765",
"text": "def update_mouse(moved)\n update_mouse_ctrl_buttons(@base_ui.ctrl, ACTIONS, true)\n if Mouse.trigger?(:LEFT)\n @shortcuts.each_with_index do |stack, index|\n use(index) if stack.simple_mouse_in?\n end\n end\n end",
"title": ""
},
{
"docid": "d36a6fa1b22f92ae1104ca9f0fc21c2e",
"score": "0.6403325",
"text": "def move\n dir = Point.new(0, 0)\n\n if args.inputs.keyboard.key_down.up\n dir.y = 1\n elsif args.inputs.keyboard.key_down.down\n dir.y = -1\n elsif args.inputs.keyboard.key_down.left\n dir.x = -1\n elsif args.inputs.keyboard.key_down.right\n dir.x = 1\n end\n\n unless dir.x == 0 && dir.y == 0\n args.state.dispatch.({\n type: :move,\n payload: {\n entity_id: id,\n cx: cx + dir.x,\n cy: cy + dir.y,\n }\n })\n end\n end",
"title": ""
},
{
"docid": "71a177b8b50c12388b5324566ddcbc6d",
"score": "0.64032394",
"text": "def cursor(dst_loc)\n automatically \"mousemove #{dst_loc[:x]} #{dst_loc[:y]}\"\n end",
"title": ""
},
{
"docid": "01b128139083aeabc128bc94a6164220",
"score": "0.635773",
"text": "def move_cursor\n render\n print \"Where would you like to move the cursor?\"\n @cursor.get_input\n # end_pos = @cursor.get_input\n # move_piece(start_pos, end_pos) # => whatever key you \"select\"\n # => Choose where you want to move the piece you selected\n end",
"title": ""
},
{
"docid": "15ca1da6ab9707b7a7e614b2f17694b9",
"score": "0.6355579",
"text": "def move(x, y, relative=false)\n relative ? relative(x, y) : absolute(x, y)\n end",
"title": ""
},
{
"docid": "096ca459f7b234ac08f027ef15507378",
"score": "0.63479817",
"text": "def update_mouse(moved)\n update_mouse_ctrl_buttons(@base_ui.ctrl, ACTIONS, true)\n return false\n end",
"title": ""
},
{
"docid": "6f6c1c0da41aec09a6303cc6dbad56e5",
"score": "0.63348055",
"text": "def execute_move(change_in_x, change_in_y)\n\t\t@x += change_in_x\n\t\t@y += change_in_y\n\tend",
"title": ""
},
{
"docid": "b182741d738bc185054a264be15c13ef",
"score": "0.63335526",
"text": "def mouse_x; mouseX; end",
"title": ""
},
{
"docid": "3e055a138ad8114fcb5f854c5053ecc6",
"score": "0.62958163",
"text": "def update_move\n update_last_coordinate\n super\n move_animation(diff_x, diff_y)\n end",
"title": ""
},
{
"docid": "3e055a138ad8114fcb5f854c5053ecc6",
"score": "0.62958163",
"text": "def update_move\n update_last_coordinate\n super\n move_animation(diff_x, diff_y)\n end",
"title": ""
},
{
"docid": "bb5f6b0d095ec30a031859786128c6d7",
"score": "0.6294172",
"text": "def mousePressed\n $target.location.x = mouseX\n $target.location.y = mouseY\n @recordtime = 1.0/0\nend",
"title": ""
},
{
"docid": "d008f0941d272a1ba4a3bf98fb797807",
"score": "0.62878704",
"text": "def on_mouse_move(event)\n @style.cursor = in_select_region?(event.page_x) ? '' : 'move'\n end",
"title": ""
},
{
"docid": "ed514e6041e534006251e8d31e6af735",
"score": "0.6287405",
"text": "def process_cursor_move\n change_category(1) if Input.trigger?(next_category_button)\n change_category(-1) if Input.trigger?(prev_category_button)\n return unless cursor_movable?\n last_index = @index\n cursor_down (Input.trigger?(:DOWN)) if Input.repeat?(:DOWN)\n cursor_up (Input.trigger?(:UP)) if Input.repeat?(:UP)\n cursor_pagedown if Input.trigger?(cursor_pagedown_button)\n cursor_pageup if Input.trigger?(cursor_pageup_button)\n Sound.play_cursor if @index != last_index\n end",
"title": ""
},
{
"docid": "f23fd97284e3506fdc29c5609bbfe6cc",
"score": "0.626273",
"text": "def move(offset_x, offset_y)\n # Your code goes here...\n end",
"title": ""
},
{
"docid": "fab29f39241a864bdc6ecccf5064193a",
"score": "0.62596405",
"text": "def update\n emit_mouse_move_event\n\n delta = Time.now - @last_update\n @last_update += delta\n\n # Emit an update event with the amount of time since the last one\n if @game_running\n emit(:update, delta * @speed_multiplier)\n @speed_multiplier += delta / 90.0\n end\n end",
"title": ""
},
{
"docid": "57d05a43e5e6f1c89e1cd4d19270f920",
"score": "0.6254012",
"text": "def mouse_move(motion_event)\n # There's nothing to do if we're not dragging\n return unless drag.dragging?\n\n # If dragging, add drag point\n drag.record_position(motion_event.x, motion_event.y) \n\n # Move the dragged element\n if @selection_handle\n @selection_handle.absolute_position = drag.current_position\n else\n @selection.absolute_position = drag.current_position\n end\n\n # Reproportion the element if required\n @selection.reproportion if @selection.respond_to?(:reproportion)\n\n # Redraw toolbox, providing one is linked to this canvas\n toolbox.draw_properties(@selection) unless toolbox.nil?\n \n # Trigger a GTK redraw of the canvas\n queue_draw\n end",
"title": ""
},
{
"docid": "32260ad5b852b80f6bcc6a39fe4c077f",
"score": "0.62502116",
"text": "def move\n x1, y1 = MOVE[@dir]\n @x = @x + x1\n @y = @y + y1\n end",
"title": ""
},
{
"docid": "62ed592aba542d7d0f8a36eff177a0ad",
"score": "0.62325174",
"text": "def mouse_pressed\n @target.location.x = mouse_x\n @target.location.y = mouse_y\n @recordtime = @lifetime\nend",
"title": ""
},
{
"docid": "62ed592aba542d7d0f8a36eff177a0ad",
"score": "0.62325174",
"text": "def mouse_pressed\n @target.location.x = mouse_x\n @target.location.y = mouse_y\n @recordtime = @lifetime\nend",
"title": ""
},
{
"docid": "624047e6290ccb321f1193ae0383e077",
"score": "0.622558",
"text": "def mouse\n r = SDL::Mouse.state\n r[1] = h-r[1]\n r\n end",
"title": ""
},
{
"docid": "e90823d453c21df8a0690f85ffab5dc4",
"score": "0.62154233",
"text": "def move\r\n @x += Gosu.offset_x(@direction,SPEED)\r\n @y += Gosu.offset_y(@direction,SPEED)\r\n end",
"title": ""
},
{
"docid": "ea0b7232f59f3d4bd2a9723cfd5630d9",
"score": "0.6212861",
"text": "def update()\n self.move()\n end",
"title": ""
},
{
"docid": "cd55a4ed6cc17e2736b461ebc6170d31",
"score": "0.62117505",
"text": "def move\n @x_position += 1 if east_move_allowed?\n @x_position -= 1 if west_move_allowed?\n @y_position += 1 if north_move_allowed?\n @y_position -= 1 if south_move_allowed?\n end",
"title": ""
},
{
"docid": "7f70164f2e26ebfdab951101ff19153b",
"score": "0.619972",
"text": "def mouse\n m = vec2($mx.quo(AS::SCREEN_W)*@w, (1.0 - $my.quo(AS::SCREEN_H))*@h)\n rot = @angle.deg2unit_vect\n return (m - vec2(@kx, @ky)).unrotate(rot)/@scale + @pos\n end",
"title": ""
},
{
"docid": "cf10800bc1756be10df9ab85f6cb5ca5",
"score": "0.619674",
"text": "def move(xplace, yplace, relative, refresh_flag)\n windows = [@win, @scrollbar_win, @shadow_win]\n self.move_specific(xplace, yplace, relative, refresh_flag,\n windows, [])\n end",
"title": ""
},
{
"docid": "ffb1c8aeeb3931d58af54edf8139c7b8",
"score": "0.6196183",
"text": "def update_mouse_move_button\n return if @index != 2\n @uis[2].skills.each_with_index do |skill, index|\n update_mouse_in_skill_button(skill, index)\n end\n end",
"title": ""
},
{
"docid": "8681c3b7a489c954839db1cbd482deb8",
"score": "0.61947024",
"text": "def mouse_over(element, x: 0, y: 0)\n Driver.driver.action.move_to(element.element, x, y).perform\n end",
"title": ""
},
{
"docid": "1c67de72bb97acb1f607a618cb0912e0",
"score": "0.6192188",
"text": "def follows_mouse\n Tk.execute_only(:tk_focusFollowsMouse)\n end",
"title": ""
},
{
"docid": "0bc890346c18a6db31ad5902e19bafc8",
"score": "0.619038",
"text": "def onMouseMove(flags, x, y, view)\r\n @ip.pick(view, x, y, @ip1)\r\n view.invalidate\r\n end",
"title": ""
},
{
"docid": "9a8a964fd59830b4f3c788664f45d4e6",
"score": "0.6188893",
"text": "def update_move\n return unless @cursor_move_count\n\n # Update cursor position\n @cursor.x = BitmapOffset + @map_worldmap.x + TileSize * @last_x + (@x - @last_x) *\n @cursor_move_count * TileSize / CursorMoveDuration\n @cursor.y = BitmapOffset + @map_worldmap.y + TileSize * @last_y + (@y - @last_y) *\n @cursor_move_count * TileSize / CursorMoveDuration\n # Update display coords\n update_display_origin\n # Update counter\n @cursor_move_count += 1\n @cursor_move_count = false if @cursor_move_count > CursorMoveDuration\n end",
"title": ""
},
{
"docid": "0201e8225c7358448565d7c02bec414e",
"score": "0.61887115",
"text": "def move(xplace, yplace, relative, refresh_flag)\n current_x = @win.getbegx\n current_y = @win.getbegy\n xpos = xplace\n ypos = yplace\n\n # If this is a relative move, then we will adjust where we want\n # to move to\n if relative\n xpos = @win.getbegx + xplace\n ypos = @win.getbegy + yplace\n end\n\n # Adjust the window if we need to.\n xtmp = [xpos]\n tymp = [ypos]\n CDK.alignxy(@screen.window, xtmp, ytmp, @box_width, @box_height)\n xpos = xtmp[0]\n ypos = ytmp[0]\n\n # Get the difference\n xdiff = current_x - xpos\n ydiff = current_y - ypos\n\n # Move the window to the new location.\n CDK.moveCursesWindow(@win, -xdiff, -ydiff)\n CDK.moveCursesWindow(@shadow_win, -xdiff, -ydiff)\n\n # Touch the windows so they 'move'.\n CDK::SCREEN.refreshCDKWindow(@screen.window)\n\n # Reraw the windowk if they asked for it\n if refresh_flag\n self.draw(@box)\n end\n end",
"title": ""
},
{
"docid": "0427f9172cb1f60d45f27d8d3607a87e",
"score": "0.61879134",
"text": "def process_cursor_move\n return unless cursor_movable?\n last_index = @index\n cursor_down(Input.trigger?(Input::Keys::DOWN)) if Input.repeat?(Input::Keys::DOWN)\n cursor_up(Input.trigger?(Input::Keys::UP)) if Input.repeat?(Input::Keys::UP)\n cursor_right(Input.trigger?(Input::Keys::RIGHT))if Input.repeat?(Input::Keys::RIGHT)\n cursor_left(Input.trigger?(Input::Keys::LEFT)) if Input.repeat?(Input::Keys::LEFT)\n Sound.play_cursor if @index != last_index\n end",
"title": ""
},
{
"docid": "0201e8225c7358448565d7c02bec414e",
"score": "0.6186083",
"text": "def move(xplace, yplace, relative, refresh_flag)\n current_x = @win.getbegx\n current_y = @win.getbegy\n xpos = xplace\n ypos = yplace\n\n # If this is a relative move, then we will adjust where we want\n # to move to\n if relative\n xpos = @win.getbegx + xplace\n ypos = @win.getbegy + yplace\n end\n\n # Adjust the window if we need to.\n xtmp = [xpos]\n tymp = [ypos]\n CDK.alignxy(@screen.window, xtmp, ytmp, @box_width, @box_height)\n xpos = xtmp[0]\n ypos = ytmp[0]\n\n # Get the difference\n xdiff = current_x - xpos\n ydiff = current_y - ypos\n\n # Move the window to the new location.\n CDK.moveCursesWindow(@win, -xdiff, -ydiff)\n CDK.moveCursesWindow(@shadow_win, -xdiff, -ydiff)\n\n # Touch the windows so they 'move'.\n CDK::SCREEN.refreshCDKWindow(@screen.window)\n\n # Reraw the windowk if they asked for it\n if refresh_flag\n self.draw(@box)\n end\n end",
"title": ""
},
{
"docid": "4b5df72d099fd1937ebe3dda2e6824e6",
"score": "0.6174067",
"text": "def update_move\n # get pixel movement rate and moving distance\n pix, distance = $BlizzABS.pixel, 2 ** @move_speed\n fx, fy = @x * 128 / pix, @y * 128 / pix\n # set new coordinates\n if fx < @real_x\n rx = @real_x - distance\n @real_x = (rx > fx ? rx : fx)\n elsif fx > @real_x\n rx = @real_x + distance\n @real_x = (rx < fx ? rx : fx)\n end\n if fy < @real_y\n ry = @real_y - distance\n @real_y = (ry > fy ? ry : fy)\n elsif fy > @real_y\n ry = @real_y + distance\n @real_y = (ry < fy ? ry : fy)\n end\n # if walking\n if @walk_anime\n # increase anime_count\n @anime_count += 1.5\n # if standing\n elsif @step_anime\n # increase anime_count\n @anime_count += 1\n end\n end",
"title": ""
},
{
"docid": "3a551cec227a6c5b5e98d9b425f34066",
"score": "0.6164441",
"text": "def move(xplace, yplace, relative, refresh_flag)\n current_x = @win.getbegx\n current_y = @win.getbegy\n xpos = xplace\n ypos = yplace\n\n # If this is a relative move, then we will adjust where we want\n # to move to.\n if relative\n xpos = @win.getbegx + xplace\n ypos = @win.getbegy + yplace\n end\n\n # Adjust the window if we need to.\n xtmp = [xpos]\n ytmp = [ypos]\n alignxy(@screen.window, xtmp, ytmp, @box_width, @box_height)\n xpos = xtmp[0]\n ypos = ytmp[0]\n\n # Get the difference\n xdiff = current_x - xpos\n ydiff = current_y - ypos\n\n # Move the window to the new location.\n CDK.moveCursesWindow(@win, -xdiff, -ydiff)\n CDK.moveCursesWindow(@shadow_win, -xdiff, -ydiff)\n\n # Thouch the windows so they 'move'.\n CDK::SCREEN.refreshCDKWindow(@screen.window)\n\n # Redraw the window, if they asked for it.\n if refresh_flag\n self.draw(@box)\n end\n end",
"title": ""
},
{
"docid": "69e939427d7fb082f609ac28ea75d564",
"score": "0.61495876",
"text": "def player_update_move\n # mouse_input = Input.kpress?(1)\n # Turn on itself system\n @wturn = 10 - @move_speed if @lastdir4 == 0 && !(Input.repeat?(:UP) || Input.repeat?(:DOWN) || \n Input.repeat?(:LEFT) || Input.repeat?(:RIGHT))\n\n @lastdir4 = Input.dir4 # (mouse_input ? mouse_dir4 : Input.dir4)\n swamp_detect = (@in_swamp and @in_swamp > 4)\n if bool = ((@wturn > 0) | swamp_detect)\n player_turn(swamp_detect)\n else\n player_move\n end\n\n player_update_move_bump(bool)\n player_update_move_common_events(bool)\n end",
"title": ""
},
{
"docid": "96438d922f2544cd635dc10be3c23958",
"score": "0.61356467",
"text": "def ul; move(@x-1, @y-1) end",
"title": ""
},
{
"docid": "43c5381fe6d3b73d73e56a26d14f6189",
"score": "0.6134188",
"text": "def move(x, y, steps: 1)\n from_x = @_x\n from_y = @_y\n @_x = x\n @_y = y\n steps.times do |i|\n client.command(\n Protocol::Input.dispatch_mouse_event(\n type: 'mouseMoved',\n button: @_button,\n x: from_x + (@_x - from_x) * ((i + 1).to_f / steps),\n y: from_y + (@_y - from_y) * ((i + 1).to_f / steps),\n modifiers: keyboard.modifiers\n )\n ).wait!\n end\n nil\n end",
"title": ""
},
{
"docid": "c13806ddc46116c1492fe59f075d1291",
"score": "0.6127018",
"text": "def move( args )\n return unless node.weakref_alive?\n args = Hash.symbolicate(args)\n if args[:x] && args[:y] && args[:duration]\n action = do_move(CGPoint.new(args[:x], args[:y]), args[:duration])\n node.runAction(action) unless action.nil?\n end\n end",
"title": ""
},
{
"docid": "79284f130f6c2a5216683fdb2c1b39d5",
"score": "0.6126862",
"text": "def update_mouse\r\n @my = Mouse.y\r\n if(Mouse.wheel != 0)\r\n Mouse.wheel > 0 ? update_cursor_up : update_cursor_down\r\n return Mouse.wheel = 0\r\n end\r\n return unless @window.simple_mouse_in?\r\n @texts.each_with_index do |text, i|\r\n if text.simple_mouse_in?\r\n if @index < i\r\n update_cursor_down while @index < i\r\n elsif @index > i\r\n update_cursor_up while @index > i\r\n end\r\n break\r\n end\r\n end\r\n end",
"title": ""
},
{
"docid": "6e3dcd14825f48d685ee89b23d2ff387",
"score": "0.6120699",
"text": "def comMove(x,y)\n sendCommand(\"(move %f %f)\" % [x,y]) ;\n end",
"title": ""
},
{
"docid": "7d124f797c8798c8d3e43a3a55d6a31f",
"score": "0.6102337",
"text": "def move\n `xdotool search --onlyvisible --class #{name} windowsize %@ #{w} #{h} windowmove #{x} #{y}`\n end",
"title": ""
},
{
"docid": "748b0aed259f5bfe1d5fe0072d3cc146",
"score": "0.60955536",
"text": "def left_click\n x, y = source_x_y(0)\n WindowsInput.move_mouse(x+2,y+2)\n WindowsInput.left_click\n end",
"title": ""
},
{
"docid": "a2a06fb60d949eee59b6dcf6034e41e2",
"score": "0.6091084",
"text": "def move_cursor move\n\t\tcoords = move_coords move\n\t\t\n\t\tclear_cursor #cursor will be moving; get rid of the old one\n\t\t\n\t\told_cursor = @cursor.clone #for later reference\n\t\t\n\t\t@cursor.merge!(coords) {|key, v1, v2| v1 + v2} #move cursor\n\t\t\n\t\tkeys = [:x, :y]\n\t\tkeys.each_with_index do |key, i|\n\t\t\tunless ['n', 's'].include? move\n\t\t\t\tif @cursor[key] == -1\n\t\t\t\t\t@cursor[key] = @size - 1\n\t\t\t\telsif @cursor[key] == @size\n\t\t\t\t\t@cursor[key] = 0\n\t\t\t\tend\n\t\t\telse\n\t\t\t\tif [@size, -1].include? @cursor[key]\n\t\t\t\t\tother_key = keys[(i+1)%2]\n\t\t\t\t\t@cursor[key] = old_cursor[other_key]\n\t\t\t\t\t@cursor[other_key] = old_cursor[key]\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\n\t\t@xcur = @cursor[:x]\n\t\t@ycur = @cursor[:y]\n\t\tdraw_cursor\n\tend",
"title": ""
},
{
"docid": "05d585e470c93323a0d4c9528135184c",
"score": "0.60843694",
"text": "def process_cursor_move\n return unless cursor_movable?\n last = @cursor.dup\n\n if Input.repeat?(:UP)\n cursor_up(@adapt_dir[:up])\n elsif Input.repeat?(:DOWN)\n cursor_down(@adapt_dir[:down])\n elsif Input.repeat?(:LEFT)\n cursor_left\n elsif Input.repeat?(:RIGHT)\n cursor_right\n end\n\n unless @cursor.eql?(last)\n @intersect = true\n Sound.play_grid_move\n cursor_deselect(get(*last))\n recalculate_area\n cursor_select(get(*@cursor))\n update_adaptive_cursor\n highlight_selected_unit_events\n end\n end",
"title": ""
},
{
"docid": "6bb76a843d273d0f722c6056401677f7",
"score": "0.60736746",
"text": "def move_by(right_by, down_by)\n right = [0, right_by].max.round\n down = [0, down_by].max.round\n location = Applitools::Base::Point.new(right, down)\n current_control = Applitools::Base::Region.new(0, 0, right, down)\n driver.user_inputs << Applitools::Base::MouseTrigger.new(:move, current_control, location)\n mouse.move_by(right_by, down_by)\n end",
"title": ""
},
{
"docid": "6118babc3fda6bd0c2f747a2222e0d12",
"score": "0.6054542",
"text": "def move(left, top)\n \n end",
"title": ""
},
{
"docid": "a79505a4696b7fb38a536d1ec5e9ff17",
"score": "0.60491025",
"text": "def update\n return unless @enabled and @visible\n\n mouse_over = Mouse.over? @x, @y, @w, @h\n mouse_press = Mouse.button_pressed? :left\n mouse_rel = Mouse.button_released? :left\n\n if @state == :up\n if mouse_over\n @img_index = 1\n @state = :over\n else\n @img_index = 0\n end\n elsif @state == :over\n if not mouse_over\n @img_index = 0\n @state = :up\n elsif mouse_press\n Mouse.add_click(@z_index || 0, lambda do\n @img_index = 2\n @state = :down\n end)\n else\n @img_index = 1\n end\n elsif @state == :down\n if not mouse_over\n @img_index = 0\n @state = :down_out\n elsif mouse_rel\n @img_index = 1\n @state = :over\n enqueue_action\n else\n @img_index = 2\n end\n else # :down_out\n if mouse_over\n @img_index = 2\n @state = :down\n elsif mouse_rel\n @img_index = 0\n @state = :up\n else\n @img_index = 0\n end\n end\n end",
"title": ""
},
{
"docid": "dd46adbe571b09a01c6fe9dd46271931",
"score": "0.6044988",
"text": "def move!(offset_x, offset_y)\n # Your code goes here...\n end",
"title": ""
},
{
"docid": "5fd9ba8879371e4ebf2b2c3c86482354",
"score": "0.6044272",
"text": "def mouse_over_element(element)\r\n @driver.action.move_to(element).perform\r\nend",
"title": ""
},
{
"docid": "96edb0a9844639f8ed38c9dcc2f41804",
"score": "0.6039254",
"text": "def move(mouse_pos)\n @tail_cards.keys.each_with_index do |card, i|\n card.pos = mouse_pos + @offset + [0, i*19]\n end\n end",
"title": ""
},
{
"docid": "ebc9554bf2bffd113d1ce23024bf1dc5",
"score": "0.6035773",
"text": "def update_mouse_selection\n return if Mouse.nil?\n return unless Mouse.moved?\n return unless @command_window.active?\n for i in 0...@commands.size\n sprite = @commands[i]\n if Mouse.collide_sprite?(sprite)\n Sound.play_cursor if @command_window.index != i\n @command_window.select(i)\n end\n end\n end",
"title": ""
},
{
"docid": "d0b5584ec8ab4fd6049bb0f2423c3305",
"score": "0.6026634",
"text": "def apply(&block)\r\n $window.translate(-@x.to_i, -@y.to_i, &block)\r\n end",
"title": ""
},
{
"docid": "b8d25e70811fbfc89d3ab8465f2c8dbf",
"score": "0.6026166",
"text": "def move_to(x, y)\n exec_driver_in_context do |driver|\n @driver.sc_window_move_to(x,y)\n end\n end",
"title": ""
},
{
"docid": "39f0fac6a65fd43cdde60c4601677094",
"score": "0.6023252",
"text": "def onMouseMove(_flags, x, y, view)\n @mouse_ip.pick(view, x, y, @mouse_ip)\n dof = @mouse_ip.degrees_of_freedom\n view.tooltip = @mouse_ip.tooltip if @mouse_ip.valid? && dof < 3\n view.invalidate\n end",
"title": ""
},
{
"docid": "38974015ce83a6bb77d07e37b61c994d",
"score": "0.6019395",
"text": "def move(xplace, yplace, relative, refresh_flag)\n windows = [@win, @scrollbar_win, @shadow_win]\n self.move_specific(xplace, yplace, relative, refresh_flag,\n windows, subwidgets)\n end",
"title": ""
},
{
"docid": "a4976ee0d230c7f4c4bbe8cdfc3e3d7a",
"score": "0.6017697",
"text": "def update_move\n # get pixel movement rate\n pix = BlizzABS.pixel\n # moving distance\n distance = 2 ** @move_speed\n # set new coordinates\n @real_y = [@real_y + distance, @y * 128/pix].min if @y * 128/pix > @real_y\n @real_x = [@real_x - distance, @x * 128/pix].max if @x * 128/pix < @real_x\n @real_x = [@real_x + distance, @x * 128/pix].min if @x * 128/pix > @real_x\n @real_y = [@real_y - distance, @y * 128/pix].max if @y * 128/pix < @real_y\n # if walking\n if @walk_anime\n # increase anime_count\n @anime_count += 1.5\n # if standing\n elsif @step_anime\n # increase anime_count\n @anime_count += 1\n end\n end",
"title": ""
},
{
"docid": "a4976ee0d230c7f4c4bbe8cdfc3e3d7a",
"score": "0.6017697",
"text": "def update_move\n # get pixel movement rate\n pix = BlizzABS.pixel\n # moving distance\n distance = 2 ** @move_speed\n # set new coordinates\n @real_y = [@real_y + distance, @y * 128/pix].min if @y * 128/pix > @real_y\n @real_x = [@real_x - distance, @x * 128/pix].max if @x * 128/pix < @real_x\n @real_x = [@real_x + distance, @x * 128/pix].min if @x * 128/pix > @real_x\n @real_y = [@real_y - distance, @y * 128/pix].max if @y * 128/pix < @real_y\n # if walking\n if @walk_anime\n # increase anime_count\n @anime_count += 1.5\n # if standing\n elsif @step_anime\n # increase anime_count\n @anime_count += 1\n end\n end",
"title": ""
},
{
"docid": "c25a09ea4aa5bf7cc8e3af96df5d317f",
"score": "0.60110784",
"text": "def click_left_mouse(x, y)\n ApiDefs.set_cursor_pos.call(x, y)\n ApiDefs.mouse_event.call(ApiDefs::MOUSEEVENTF_LEFTDOWN, x, y, 0, 0)\n sleep(0.05)\n ApiDefs.mouse_event.call(ApiDefs::MOUSEEVENTF_LEFTUP, x, y, 0, 0)\n end",
"title": ""
},
{
"docid": "271df29b3dc8ed693bbb2d3a037cfd04",
"score": "0.60104537",
"text": "def move x, y; @x += x; @y += y; end",
"title": ""
}
] |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "f0411b8732e0245c679bbd78f36b1d90",
"score": "0.0",
"text": "def set_resource\n @resource = Resource.find(params[:id])\n end",
"title": ""
}
] | [
{
"docid": "bd89022716e537628dd314fd23858181",
"score": "0.6163163",
"text": "def set_required_actions\n # TODO: check what fields change to asign required fields\n end",
"title": ""
},
{
"docid": "3db61e749c16d53a52f73ba0492108e9",
"score": "0.6045976",
"text": "def action_hook; end",
"title": ""
},
{
"docid": "b8b36fc1cfde36f9053fe0ab68d70e5b",
"score": "0.5946146",
"text": "def run_actions; end",
"title": ""
},
{
"docid": "3e521dbc644eda8f6b2574409e10a4f8",
"score": "0.591683",
"text": "def define_action_hook; end",
"title": ""
},
{
"docid": "801bc998964ea17eb98ed4c3e067b1df",
"score": "0.5890051",
"text": "def actions; end",
"title": ""
},
{
"docid": "bfb8386ef5554bfa3a1c00fa4e20652f",
"score": "0.58349305",
"text": "def define_action_helpers\n if super && action == :save\n @instance_helper_module.class_eval do\n define_method(:valid?) do |*args|\n self.class.state_machines.fire_event_attributes(self, :save, false) { super(*args) }\n end\n end\n end\n end",
"title": ""
},
{
"docid": "6c8e66d9523b9fed19975542132c6ee4",
"score": "0.5776858",
"text": "def add_actions; end",
"title": ""
},
{
"docid": "9c186951c13b270d232086de9c19c45b",
"score": "0.5703237",
"text": "def callbacks; end",
"title": ""
},
{
"docid": "9c186951c13b270d232086de9c19c45b",
"score": "0.5703237",
"text": "def callbacks; end",
"title": ""
},
{
"docid": "6ce8a8e8407572b4509bb78db9bf8450",
"score": "0.5652805",
"text": "def setup *actions, &proc\n (@setup_procs ||= []) << [proc, actions.size > 0 ? actions : [:*]]\n end",
"title": ""
},
{
"docid": "1964d48e8493eb37800b3353d25c0e57",
"score": "0.5621621",
"text": "def define_action_helpers; end",
"title": ""
},
{
"docid": "5df9f7ffd2cb4f23dd74aada87ad1882",
"score": "0.54210985",
"text": "def post_setup\n end",
"title": ""
},
{
"docid": "dbebed3aa889e8b91b949433e5260fb5",
"score": "0.5411113",
"text": "def action_methods; end",
"title": ""
},
{
"docid": "dbebed3aa889e8b91b949433e5260fb5",
"score": "0.5411113",
"text": "def action_methods; end",
"title": ""
},
{
"docid": "dbebed3aa889e8b91b949433e5260fb5",
"score": "0.5411113",
"text": "def action_methods; end",
"title": ""
},
{
"docid": "c5904f93614d08afa38cc3f05f0d2365",
"score": "0.5391541",
"text": "def before_setup; end",
"title": ""
},
{
"docid": "f099a8475f369ce73a38d665b6ee6877",
"score": "0.53794575",
"text": "def action_run\n end",
"title": ""
},
{
"docid": "2c4e5a90aa8efaaa3ed953818a9b30d2",
"score": "0.5357573",
"text": "def execute(setup)\n @action.call(setup)\n end",
"title": ""
},
{
"docid": "0464870c8688619d6c104d733d355b3b",
"score": "0.53402257",
"text": "def define_action_helpers?; end",
"title": ""
},
{
"docid": "0e7bdc54b0742aba847fd259af1e9f9e",
"score": "0.53394014",
"text": "def set_actions\n actions :all\n end",
"title": ""
},
{
"docid": "5510330550e34a3fd68b7cee18da9524",
"score": "0.53321576",
"text": "def action_done(action)\n dispatch = { :migrate => :done_migrating, :map => :done_mapping, :reduce =>\n :done_reducing, :finalize => :done_finalizing } \n self.send dispatch[action[:action]], action\n end",
"title": ""
},
{
"docid": "97c8901edfddc990da95704a065e87bc",
"score": "0.53124547",
"text": "def dependencies action, &block\n @actions.each do |other|\n if action[:requires].include? other[:provide]\n block.call other\n end\n end\n end",
"title": ""
},
{
"docid": "4f9a284723e2531f7d19898d6a6aa20c",
"score": "0.529654",
"text": "def setup!\n return unless @setup_procs\n http_actions = actions\n @setup_procs.each do |setup_proc|\n proc, actions = setup_proc\n @setup__actions = actions.map do |action|\n\n action.is_a?(Regexp) ?\n http_actions.select { |a| a.to_s =~ action } :\n action.is_a?(String) && action =~ /\\A\\./ ?\n http_actions.map { |a| a.to_s << action if format?(a).include?(action) }.compact :\n action\n\n end.flatten\n self.class_exec &proc\n @setup__actions = nil\n end\n @setup_procs = nil\n end",
"title": ""
},
{
"docid": "83684438c0a4d20b6ddd4560c7683115",
"score": "0.5296262",
"text": "def before_actions(*logic)\n self.before_actions = logic\n end",
"title": ""
},
{
"docid": "210e0392ceaad5fc0892f1335af7564b",
"score": "0.52952296",
"text": "def setup_handler\n end",
"title": ""
},
{
"docid": "a997ba805d12c5e7f7c4c286441fee18",
"score": "0.52600986",
"text": "def set_action(opts)\n opts = check_params(opts,[:actions])\n super(opts)\n end",
"title": ""
},
{
"docid": "1d50ec65c5bee536273da9d756a78d0d",
"score": "0.52442724",
"text": "def setup(action)\n @targets.clear\n unless action.item.target_filters.empty?\n @targets = SES::TargetManager.make_targets(action)\n else\n item = action.item\n if item.for_opponent?\n @targets = $game_troop.alive_members\n elsif item.for_dead_friend?\n @targets = $game_party.battle_members.select { |actor| actor.dead? }\n else\n $game_party.battle_members.select { |actor| actor.alive? }\n end\n end\n @item_max = @targets.size\n create_contents\n refresh\n show\n activate\n end",
"title": ""
},
{
"docid": "e6d7c691bed78fb0eeb9647503f4a244",
"score": "0.52385926",
"text": "def action; end",
"title": ""
},
{
"docid": "e6d7c691bed78fb0eeb9647503f4a244",
"score": "0.52385926",
"text": "def action; end",
"title": ""
},
{
"docid": "e6d7c691bed78fb0eeb9647503f4a244",
"score": "0.52385926",
"text": "def action; end",
"title": ""
},
{
"docid": "e6d7c691bed78fb0eeb9647503f4a244",
"score": "0.52385926",
"text": "def action; end",
"title": ""
},
{
"docid": "e6d7c691bed78fb0eeb9647503f4a244",
"score": "0.52385926",
"text": "def action; end",
"title": ""
},
{
"docid": "635288ac8dd59f85def0b1984cdafba0",
"score": "0.5232394",
"text": "def workflow\n end",
"title": ""
},
{
"docid": "e34cc2a25e8f735ccb7ed8361091c83e",
"score": "0.523231",
"text": "def revisable_shared_setup(args, block)\n class << self\n attr_accessor :revisable_options\n end\n options = args.extract_options!\n self.revisable_options = Options.new(options, &block)\n \n self.send(:include, Common)\n self.send(:extend, Validations) unless self.revisable_options.no_validation_scoping?\n self.send(:include, WithoutScope::QuotedColumnConditions)\n end",
"title": ""
},
{
"docid": "78b21be2632f285b0d40b87a65b9df8c",
"score": "0.5227454",
"text": "def setup\n @action = SampleActionAndroid.new(os_name: 'android',\n app_name: APP_PATH)\n end",
"title": ""
},
{
"docid": "6350959a62aa797b89a21eacb3200e75",
"score": "0.52226824",
"text": "def before(action)\n invoke_callbacks *self.class.send(action).before\n end",
"title": ""
},
{
"docid": "923ee705f0e7572feb2c1dd3c154b97c",
"score": "0.52201617",
"text": "def process_action(...)\n send_action(...)\n end",
"title": ""
},
{
"docid": "b89a3908eaa7712bb5706478192b624d",
"score": "0.5212327",
"text": "def before_dispatch(env); end",
"title": ""
},
{
"docid": "7115b468ae54de462141d62fc06b4190",
"score": "0.52079266",
"text": "def after_actions(*logic)\n self.after_actions = logic\n end",
"title": ""
},
{
"docid": "d89a3e408ab56bf20bfff96c63a238dc",
"score": "0.52050185",
"text": "def setup\n # override and do something appropriate\n end",
"title": ""
},
{
"docid": "62c402f0ea2e892a10469bb6e077fbf2",
"score": "0.51754695",
"text": "def setup(client)\n return unless @setup\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n actions.each do |action|\n action.execute(client)\n end\n self\n end",
"title": ""
},
{
"docid": "72ccb38e1bbd86cef2e17d9d64211e64",
"score": "0.51726824",
"text": "def setup(_context)\n end",
"title": ""
},
{
"docid": "b4f4e1d4dfd31919ab39aecccb9db1d0",
"score": "0.51710224",
"text": "def setup(resources) ; end",
"title": ""
},
{
"docid": "1fd817f354d6cb0ff1886ca0a2b6cce4",
"score": "0.5166172",
"text": "def validate_actions\n errors.add(:base, :should_give_at_least_one_action) if !manage? && !forecasting? && !read? && !api?\n end",
"title": ""
},
{
"docid": "5531df39ee7d732600af111cf1606a35",
"score": "0.5159343",
"text": "def setup\n @resource_config = {\n :callbacks => {\n :before_create => nil,\n :after_create => nil,\n :before_update => nil,\n :after_update => nil,\n :before_destroy => nil,\n :after_destroy => nil,\n },\n :child_assoc => nil,\n :model => nil,\n :parent => nil,\n :path => nil,\n :permission => {},\n :properties => {},\n :relation => {\n :create => nil,\n :delete => nil,\n },\n :roles => nil,\n }\n end",
"title": ""
},
{
"docid": "bb6aed740c15c11ca82f4980fe5a796a",
"score": "0.51578903",
"text": "def determine_valid_action\n\n end",
"title": ""
},
{
"docid": "b38f9d83c26fd04e46fe2c961022ff86",
"score": "0.51522785",
"text": "def process_shared\n handle_taxes\n handle_shippings\n create_adjustments_from_params\n handle_status\n handle_inventory_refunds\n handle_payment_transactions\n order.updater.update\n end",
"title": ""
},
{
"docid": "199fce4d90958e1396e72d961cdcd90b",
"score": "0.5152022",
"text": "def startcompany(action)\n @done = true\n action.setup\n end",
"title": ""
},
{
"docid": "994d9fe4eb9e2fc503d45c919547a327",
"score": "0.51518047",
"text": "def init_actions\n am = action_manager()\n am.add_action(Action.new(\"&Disable selection\") { @selection_mode = :none; unbind_key(32); bind_key(32, :scroll_forward); } )\n am.add_action(Action.new(\"&Edit Toggle\") { @edit_toggle = !@edit_toggle; $status_message.value = \"Edit toggle is #{@edit_toggle}\" })\n end",
"title": ""
},
{
"docid": "62fabe9dfa2ec2ff729b5a619afefcf0",
"score": "0.51456624",
"text": "def event_callbacks(event, metadata={})\n case event\n when :reset, :review\n if confirmed\n update_attributes(confirmed: false)\n end\n when :confirm\n confirm\n # trigger :order for all applicable items\n # NOTE: :order event is common to both physical and digital items\n items.each do |i|\n if i.event_permitted(:order)\n user_id = last_transition.user_id\n i.trigger!(:order, { order_id: id, user_id: user_id })\n end\n end\n when :complete_work\n request = metadata[:request]\n work_complete_notification(request)\n when :close\n close\n end\n if event != :close && !open\n reopen\n end\n end",
"title": ""
},
{
"docid": "faddd70d9fef5c9cd1f0d4e673e408b9",
"score": "0.51398855",
"text": "def setup_action\n return unless PONY::ERRNO::check_sequence(current_act)\n new_sequence = @action_sequence[@sequence_index+1...@action_sequence.size]\n @sequence_index = 0\n new_sequence = DND::SkillSequence::ACTS[@acts[1]] + new_sequence\n execute_sequence\n end",
"title": ""
},
{
"docid": "adb8115fce9b2b4cb9efc508a11e5990",
"score": "0.5133759",
"text": "def define_tasks\n define_weave_task\n connect_common_tasks\n end",
"title": ""
},
{
"docid": "e1dd18cf24d77434ec98d1e282420c84",
"score": "0.5112076",
"text": "def setup(&block)\n define_method(:setup, &block)\n end",
"title": ""
},
{
"docid": "3b4fb29fa45f95d436fd3a8987f12de7",
"score": "0.5111866",
"text": "def setup\n transition_to(:setup)\n end",
"title": ""
},
{
"docid": "3b4fb29fa45f95d436fd3a8987f12de7",
"score": "0.5111866",
"text": "def setup\n transition_to(:setup)\n end",
"title": ""
},
{
"docid": "975ecc8d218b62d480bbe0f6e46e72bb",
"score": "0.5110294",
"text": "def action\n end",
"title": ""
},
{
"docid": "f54964387b0ee805dbd5ad5c9a699016",
"score": "0.5106169",
"text": "def setup( *args )\n\t\t\tself.class.setupBlocks.each {|sblock|\n\t\t\t\tdebugMsg \"Calling setup block method #{sblock}\"\n\t\t\t\tself.send( sblock )\n\t\t\t}\n\t\t\tsuper( *args )\n\t\tend",
"title": ""
},
{
"docid": "35b302dd857a031b95bc0072e3daa707",
"score": "0.509231",
"text": "def config(action, *args); end",
"title": ""
},
{
"docid": "bc3cd61fa2e274f322b0b20e1a73acf8",
"score": "0.50873137",
"text": "def setup\n @setup_proc.call(self) if @setup_proc\n end",
"title": ""
},
{
"docid": "5c3cfcbb42097019c3ecd200acaf9e50",
"score": "0.5081088",
"text": "def before_action \n end",
"title": ""
},
{
"docid": "246840a409eb28800dc32d6f24cb1c5e",
"score": "0.508059",
"text": "def setup_callbacks\n defined_callbacks.each do |meth|\n unless respond_to?(\"call_#{meth}_callbacks\".to_sym)\n self.class.module_eval <<-EOE\n def call_#{meth}_callbacks(*args)\n plugin_store.each {|a| a.call_#{meth}_callbacks(*args) } if respond_to?(:plugin_store) && plugin_store\n self.send :#{meth}, *args if respond_to?(:#{meth})\n end\n EOE\n end\n end\n end",
"title": ""
},
{
"docid": "dfbcf4e73466003f1d1275cdf58a926a",
"score": "0.50677156",
"text": "def action\n end",
"title": ""
},
{
"docid": "36eb407a529f3fc2d8a54b5e7e9f3e50",
"score": "0.50562143",
"text": "def matt_custom_action_begin(label); end",
"title": ""
},
{
"docid": "b6c9787acd00c1b97aeb6e797a363364",
"score": "0.5050554",
"text": "def setup\n # override this if needed\n end",
"title": ""
},
{
"docid": "9fc229b5b48edba9a4842a503057d89a",
"score": "0.50474834",
"text": "def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend",
"title": ""
},
{
"docid": "9fc229b5b48edba9a4842a503057d89a",
"score": "0.50474834",
"text": "def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend",
"title": ""
},
{
"docid": "fd421350722a26f18a7aae4f5aa1fc59",
"score": "0.5036181",
"text": "def action(options,&callback)\n new_action = Action===options ? options : Action.new(options,&callback)\n # replace any with (shared name/alias or both default) + same arity\n @actions.delete_if do |existing_action|\n ((existing_action.names & new_action.names).size > 0 ||\n existing_action.default? && new_action.default?) &&\n existing_action.required.size == new_action.required.size &&\n existing_action.optional.size <= new_action.optional.size\n end\n @actions = (@actions + [new_action]).sort\n new_action\n end",
"title": ""
},
{
"docid": "d02030204e482cbe2a63268b94400e71",
"score": "0.5026331",
"text": "def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action\n end",
"title": ""
},
{
"docid": "4224d3231c27bf31ffc4ed81839f8315",
"score": "0.5022976",
"text": "def after(action)\n invoke_callbacks *options_for(action).after\n end",
"title": ""
},
{
"docid": "24506e3666fd6ff7c432e2c2c778d8d1",
"score": "0.5015441",
"text": "def pre_task\n end",
"title": ""
},
{
"docid": "0c16dc5c1875787dacf8dc3c0f871c53",
"score": "0.50121695",
"text": "def setup(server)\n server.on('beforeMethod', method(:before_method), 10)\n end",
"title": ""
},
{
"docid": "c99a12c5761b742ccb9c51c0e99ca58a",
"score": "0.5000944",
"text": "def add_actions\n attribute = machine.attribute\n name = self.name\n \n owner_class.class_eval do\n define_method(name) {self.class.state_machines[attribute].events[name].fire(self)}\n define_method(\"#{name}!\") {self.class.state_machines[attribute].events[name].fire!(self)}\n define_method(\"can_#{name}?\") {self.class.state_machines[attribute].events[name].can_fire?(self)}\n end\n end",
"title": ""
},
{
"docid": "0cff1d3b3041b56ce3773d6a8d6113f2",
"score": "0.5000019",
"text": "def init_actions\n @select_action = SelectAction.new\n @endpoint_mouse_action = EndpointMouseAction.new\n @move_action = MoveAction.new\n end",
"title": ""
},
{
"docid": "791f958815c2b2ac16a8ca749a7a822e",
"score": "0.4996878",
"text": "def setup_signals; end",
"title": ""
},
{
"docid": "6e44984b54e36973a8d7530d51a17b90",
"score": "0.4989888",
"text": "def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend",
"title": ""
},
{
"docid": "6e44984b54e36973a8d7530d51a17b90",
"score": "0.4989888",
"text": "def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend",
"title": ""
},
{
"docid": "5aa51b20183964c6b6f46d150b0ddd79",
"score": "0.49864885",
"text": "def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action.respond_to?('weak!') ? action.weak! : action\n end",
"title": ""
},
{
"docid": "7647b99591d6d687d05b46dc027fbf23",
"score": "0.49797225",
"text": "def initialize(*args)\n super\n @action = :set\nend",
"title": ""
},
{
"docid": "67e7767ce756766f7c807b9eaa85b98a",
"score": "0.49785787",
"text": "def after_set_callback; end",
"title": ""
},
{
"docid": "2a2b0a113a73bf29d5eeeda0443796ec",
"score": "0.4976161",
"text": "def setup\n #implement in subclass;\n end",
"title": ""
},
{
"docid": "63e628f34f3ff34de8679fb7307c171c",
"score": "0.49683493",
"text": "def lookup_action; end",
"title": ""
},
{
"docid": "a5294693c12090c7b374cfa0cabbcf95",
"score": "0.4965126",
"text": "def setup &block\n if block_given?\n @setup = block\n else\n @setup.call\n end\n end",
"title": ""
},
{
"docid": "57dbfad5e2a0e32466bd9eb0836da323",
"score": "0.4958034",
"text": "def setup_action\n return TSBS.error(@acts[0], 1, @used_sequence) if @acts.size < 2\n actions = TSBS::AnimLoop[@acts[1]]\n if actions.nil?\n show_action_error(@acts[1])\n end\n @sequence_stack.push(@acts[1])\n @used_sequence = @acts[1]\n actions.each do |acts|\n @acts = acts\n execute_sequence\n break if @break_action\n end\n @sequence_stack.pop\n @used_sequence = @sequence_stack[-1]\n end",
"title": ""
},
{
"docid": "5b6d613e86d3d68152f7fa047d38dabb",
"score": "0.49559742",
"text": "def release_actions; end",
"title": ""
},
{
"docid": "4aceccac5b1bcf7d22c049693b05f81c",
"score": "0.4954353",
"text": "def around_hooks; end",
"title": ""
},
{
"docid": "2318410efffb4fe5fcb97970a8700618",
"score": "0.49535993",
"text": "def save_action; end",
"title": ""
},
{
"docid": "64e0f1bb6561b13b482a3cc8c532cc37",
"score": "0.4952725",
"text": "def setup(easy)\n super\n easy.customrequest = @verb\n end",
"title": ""
},
{
"docid": "fbd0db2e787e754fdc383687a476d7ec",
"score": "0.49467874",
"text": "def action_target()\n \n end",
"title": ""
},
{
"docid": "b280d59db403306d7c0f575abb19a50f",
"score": "0.49423352",
"text": "def setup\n callback(:setup) do\n notify(:setup)\n migration_check.last_deployed_commit\n end\n end",
"title": ""
},
{
"docid": "9f7547d93941fc2fcc7608fdf0911643",
"score": "0.49325448",
"text": "def setup\n return unless @setup\n\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n run_actions_and_retry(actions)\n self\n end",
"title": ""
},
{
"docid": "da88436fe6470a2da723e0a1b09a0e80",
"score": "0.49282882",
"text": "def before_setup\n # do nothing by default\n end",
"title": ""
},
{
"docid": "17ffe00a5b6f44f2f2ce5623ac3a28cd",
"score": "0.49269363",
"text": "def my_actions(options)\n @setup = false\n get_template_part(\"custom_used\",\"action_users\",true)\n end",
"title": ""
},
{
"docid": "21d75f9f5765eb3eb36fcd6dc6dc2ec3",
"score": "0.49269104",
"text": "def default_action; end",
"title": ""
},
{
"docid": "3ba85f3cb794f951b05d5907f91bd8ad",
"score": "0.49252945",
"text": "def setup(&blk)\n @setup_block = blk\n end",
"title": ""
},
{
"docid": "80834fa3e08bdd7312fbc13c80f89d43",
"score": "0.4923091",
"text": "def callback_phase\n super\n end",
"title": ""
},
{
"docid": "f1da8d654daa2cd41cb51abc7ee7898f",
"score": "0.49194667",
"text": "def advice\n end",
"title": ""
},
{
"docid": "99a608ac5478592e9163d99652038e13",
"score": "0.49174926",
"text": "def _handle_action_missing(*args); end",
"title": ""
},
{
"docid": "9e264985e628b89f1f39d574fdd7b881",
"score": "0.49173003",
"text": "def duas1(action)\n action.call\n action.call\nend",
"title": ""
},
{
"docid": "399ad686f5f38385ff4783b91259dbd7",
"score": "0.49171105",
"text": "def shared_action(name, &block)\n @controller.shared_actions[name] = block\n end",
"title": ""
},
{
"docid": "0dccebcb0ecbb1c4dcbdddd4fb11bd8a",
"score": "0.4915879",
"text": "def before_action action, &block\n @audience[:before][action] ||= Set.new\n @audience[:before][action] << block\n end",
"title": ""
},
{
"docid": "6e0842ade69d031131bf72e9d2a8c389",
"score": "0.49155936",
"text": "def setup_initial_state\n\n state_a = State.new(\"a\", 0)\n state_b = State.new(\"b\", 0)\n state_c = State.new(\"c\", 10)\n\n move_to_b = Action.new(\"move_to_b\", 1, state_b)\n\n move_to_c = Action.new(\"move_to_c\", 1, state_c)\n\n state_a.actions = [move_to_b, move_to_c]\n\n return state_a\n \nend",
"title": ""
}
] |
88d7770c060861aaf9fb8894ce9a48d1 | PUT /resarch_carts/1 PUT /resarch_carts/1.json | [
{
"docid": "99ac3993a837c0ff6e13ae56d1deb023",
"score": "0.7475768",
"text": "def update\n @resarch_cart = ResarchCart.find(params[:id])\n\n respond_to do |format|\n if @resarch_cart.update_attributes(params[:resarch_cart])\n format.html { redirect_to @resarch_cart, notice: 'Resarch cart was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @resarch_cart.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] | [
{
"docid": "8fc0fcb59352fef95d83f7225fc25231",
"score": "0.6948961",
"text": "def update_cart\n @cart.add_item(params[:sku], 1) if params[:q] == \"add\"\n @cart.reduce_qty_of(params[:sku]) if params[:q] == \"reduce\"\n @cart.remove_item(params[:sku]) if params[:q] == \"remove\"\n\n respond_to do |format|\n format.json {\n render :json => update_cart_response\n }\n end\n end",
"title": ""
},
{
"docid": "57150fd796cd4ce789e7805b70dc8a1c",
"score": "0.69379866",
"text": "def update\n if @cart.update(cart_params)\n render json: @cart\n else\n render json: @cart.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "37fcb4a471383a85c11b888952b9ba3c",
"score": "0.6846941",
"text": "def create\n @resarch_cart = ResarchCart.new(params[:resarch_cart])\n\n respond_to do |format|\n if @resarch_cart.save\n format.html { redirect_to @resarch_cart, notice: 'Resarch cart was successfully created.' }\n format.json { render json: @resarch_cart, status: :created, location: @resarch_cart }\n else\n format.html { render action: \"new\" }\n format.json { render json: @resarch_cart.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "222a267ca25f4495cb89146d5f5e3b9d",
"score": "0.682868",
"text": "def update_cart(payload, params={})\n execute(method: :put, url: \"#{base_path}/cart\", params: params, payload: payload.to_json)\n end",
"title": ""
},
{
"docid": "53561b0f037704fa2e113f786fc787fc",
"score": "0.6777775",
"text": "def update_cart_item\n\t\t@persona = Persona.where(:screen_name => params[:persona_id]).first\n\t\t@cart = @persona.carts.find(params[:cart_id])\n\t\trespond_to do |format|\n\t\t\tif @cart.update_attributes(params[:cart]) then\n\t\t\t\tformat.json { respond_with_bip @cart }\n\t\t\telse\n\t\t\t\tformat.json { respond_with_bip @cart }\n\t\t\tend\n\t\tend\n\tend",
"title": ""
},
{
"docid": "0c611d018eb744945d8c2f44e0a7cc9c",
"score": "0.6754963",
"text": "def update\n cart = params[\"cart\"]\n SyncLog.create(additional_info: cart)\n render status: 200, json: cart.to_json\n end",
"title": ""
},
{
"docid": "1e9068928ebdb3216f737cf639719d5a",
"score": "0.66853625",
"text": "def update\n respond_to do |format|\n if @cart.update(cart_params)\n format.html { redirect_to carts_path, notice: 'Quantity updated.' }\n format.json { render :show, status: :ok, location: @cart }\n else\n format.html { render :edit }\n format.json { render json: @cart.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f5c67a00245dfd4aadaa0c258e6b32df",
"score": "0.66801476",
"text": "def update\n if @cart.update(cart_params)\n render json: {\n status: :ok,\n message: 'Updated cart successfully'\n }\n else\n render json: {\n status: :internal_server_error,\n message: 'Error updating cart'\n }\n end\n end",
"title": ""
},
{
"docid": "eb6bd4b517e8bb7b4dead3937d59e79a",
"score": "0.6606072",
"text": "def update\n respond_to do |format|\n if @cart.update(cart_params)\n format.html { redirect_to @cart }\n format.json { render :show, status: :ok, location: @cart }\n else\n format.html { render :edit }\n format.json { render json: @cart.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "bc6e5334e4018ea3e6925b5a3d4394ca",
"score": "0.6538625",
"text": "def update\n respond_to do |format|\n if @cart.update(cart_params)\n format.html { redirect_to @cart, notice: \"Cart was successfully updated.\" }\n format.json { render :show, status: :ok, location: @cart }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @cart.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5d12dedd561e674825d779a2cb6adf60",
"score": "0.6528167",
"text": "def add_to_cart\n render json: @cart.reload , serializer: CartSerializer\n end",
"title": ""
},
{
"docid": "b279e7a69c0b4779a61d9bb2ee7dd787",
"score": "0.6513863",
"text": "def update\n respond_to do |format|\n if @cart.update(cart_params)\n format.html { redirect_to @cart, notice: 'cart was successfully updated.' }\n format.json { render :show, status: :ok, location: @cart }\n else\n format.html { render :edit }\n format.json { render json: @cart.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "06e5c84fff1bc208ba6bed551bcb345e",
"score": "0.64852625",
"text": "def update\n respond_to do |format|\n if @cart.update(cart_params)\n format.html { redirect_to @cart, notice: 'Cart was successfully updated.' }\n format.json { render :show, status: :ok, location: @cart }\n else\n format.html { render :edit }\n format.json { render json: @cart.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "06e5c84fff1bc208ba6bed551bcb345e",
"score": "0.64852625",
"text": "def update\n respond_to do |format|\n if @cart.update(cart_params)\n format.html { redirect_to @cart, notice: 'Cart was successfully updated.' }\n format.json { render :show, status: :ok, location: @cart }\n else\n format.html { render :edit }\n format.json { render json: @cart.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "06e5c84fff1bc208ba6bed551bcb345e",
"score": "0.64852625",
"text": "def update\n respond_to do |format|\n if @cart.update(cart_params)\n format.html { redirect_to @cart, notice: 'Cart was successfully updated.' }\n format.json { render :show, status: :ok, location: @cart }\n else\n format.html { render :edit }\n format.json { render json: @cart.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "06e5c84fff1bc208ba6bed551bcb345e",
"score": "0.64852625",
"text": "def update\n respond_to do |format|\n if @cart.update(cart_params)\n format.html { redirect_to @cart, notice: 'Cart was successfully updated.' }\n format.json { render :show, status: :ok, location: @cart }\n else\n format.html { render :edit }\n format.json { render json: @cart.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "06e5c84fff1bc208ba6bed551bcb345e",
"score": "0.64852625",
"text": "def update\n respond_to do |format|\n if @cart.update(cart_params)\n format.html { redirect_to @cart, notice: 'Cart was successfully updated.' }\n format.json { render :show, status: :ok, location: @cart }\n else\n format.html { render :edit }\n format.json { render json: @cart.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "06e5c84fff1bc208ba6bed551bcb345e",
"score": "0.64852625",
"text": "def update\n respond_to do |format|\n if @cart.update(cart_params)\n format.html { redirect_to @cart, notice: 'Cart was successfully updated.' }\n format.json { render :show, status: :ok, location: @cart }\n else\n format.html { render :edit }\n format.json { render json: @cart.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "06e5c84fff1bc208ba6bed551bcb345e",
"score": "0.64852625",
"text": "def update\n respond_to do |format|\n if @cart.update(cart_params)\n format.html { redirect_to @cart, notice: 'Cart was successfully updated.' }\n format.json { render :show, status: :ok, location: @cart }\n else\n format.html { render :edit }\n format.json { render json: @cart.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "06e5c84fff1bc208ba6bed551bcb345e",
"score": "0.64852625",
"text": "def update\n respond_to do |format|\n if @cart.update(cart_params)\n format.html { redirect_to @cart, notice: 'Cart was successfully updated.' }\n format.json { render :show, status: :ok, location: @cart }\n else\n format.html { render :edit }\n format.json { render json: @cart.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "06e5c84fff1bc208ba6bed551bcb345e",
"score": "0.64852625",
"text": "def update\n respond_to do |format|\n if @cart.update(cart_params)\n format.html { redirect_to @cart, notice: 'Cart was successfully updated.' }\n format.json { render :show, status: :ok, location: @cart }\n else\n format.html { render :edit }\n format.json { render json: @cart.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "06e5c84fff1bc208ba6bed551bcb345e",
"score": "0.64852625",
"text": "def update\n respond_to do |format|\n if @cart.update(cart_params)\n format.html { redirect_to @cart, notice: 'Cart was successfully updated.' }\n format.json { render :show, status: :ok, location: @cart }\n else\n format.html { render :edit }\n format.json { render json: @cart.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "06e5c84fff1bc208ba6bed551bcb345e",
"score": "0.64852625",
"text": "def update\n respond_to do |format|\n if @cart.update(cart_params)\n format.html { redirect_to @cart, notice: 'Cart was successfully updated.' }\n format.json { render :show, status: :ok, location: @cart }\n else\n format.html { render :edit }\n format.json { render json: @cart.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "06e5c84fff1bc208ba6bed551bcb345e",
"score": "0.64852625",
"text": "def update\n respond_to do |format|\n if @cart.update(cart_params)\n format.html { redirect_to @cart, notice: 'Cart was successfully updated.' }\n format.json { render :show, status: :ok, location: @cart }\n else\n format.html { render :edit }\n format.json { render json: @cart.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "06e5c84fff1bc208ba6bed551bcb345e",
"score": "0.64852625",
"text": "def update\n respond_to do |format|\n if @cart.update(cart_params)\n format.html { redirect_to @cart, notice: 'Cart was successfully updated.' }\n format.json { render :show, status: :ok, location: @cart }\n else\n format.html { render :edit }\n format.json { render json: @cart.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "06e5c84fff1bc208ba6bed551bcb345e",
"score": "0.64852625",
"text": "def update\n respond_to do |format|\n if @cart.update(cart_params)\n format.html { redirect_to @cart, notice: 'Cart was successfully updated.' }\n format.json { render :show, status: :ok, location: @cart }\n else\n format.html { render :edit }\n format.json { render json: @cart.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "06e5c84fff1bc208ba6bed551bcb345e",
"score": "0.64852625",
"text": "def update\n respond_to do |format|\n if @cart.update(cart_params)\n format.html { redirect_to @cart, notice: 'Cart was successfully updated.' }\n format.json { render :show, status: :ok, location: @cart }\n else\n format.html { render :edit }\n format.json { render json: @cart.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "06e5c84fff1bc208ba6bed551bcb345e",
"score": "0.64852625",
"text": "def update\n respond_to do |format|\n if @cart.update(cart_params)\n format.html { redirect_to @cart, notice: 'Cart was successfully updated.' }\n format.json { render :show, status: :ok, location: @cart }\n else\n format.html { render :edit }\n format.json { render json: @cart.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "06e5c84fff1bc208ba6bed551bcb345e",
"score": "0.64852625",
"text": "def update\n respond_to do |format|\n if @cart.update(cart_params)\n format.html { redirect_to @cart, notice: 'Cart was successfully updated.' }\n format.json { render :show, status: :ok, location: @cart }\n else\n format.html { render :edit }\n format.json { render json: @cart.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2c7f0c8b009480b4e6d0e2d13e157595",
"score": "0.64680153",
"text": "def update\n respond_to do |format|\n if @cart_carry.update(cart_carry_params)\n format.html { redirect_to @cart_carry, notice: \"Cart carry was successfully updated.\" }\n format.json { render :show, status: :ok, location: @cart_carry }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @cart_carry.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "85d85959739a9c2d6c51c7b1b1ab235b",
"score": "0.6447879",
"text": "def update\n respond_to do |format|\n if @cart.update(cart_params)\n format.html { redirect_to user_carts_path(user_id: session[:login]), notice: 'Cart was successfully updated.' }\n format.json { render :show, status: :ok, location: @cart }\n else\n format.html { render :edit }\n format.json { render json: @cart.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "842e33eba4237b4b331a0794542fa05f",
"score": "0.6447694",
"text": "def set_carts_product\n @carts_product = CartsProduct.find(params[:id])\n end",
"title": ""
},
{
"docid": "863f5df3428757786003675f78aa608b",
"score": "0.6428853",
"text": "def update\n respond_to do |format|\n if @cart.update(cart_params)\n format.html { redirect_to :back, notice: 'Cart was successfully updated.' }\n format.json { render :show, status: :ok, location: @cart }\n else\n format.html { render :edit }\n format.json { render json: @cart.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e5ebcf7069d4cf267f7aa6686ffec126",
"score": "0.6421832",
"text": "def update\n respond_to do |format|\n if @cart.update(cart_params)\n format.html { redirect_to @cart, notice: 'Cart was successfully updated.' }\n format.json { render :show, status: :ok, location: @cart }\n else\n format.html { render :edit }\n format.json { render json: @cart.errors, status: :unprocessable_entity }\n end\n end\nend",
"title": ""
},
{
"docid": "9062e033762d027a6404bf534d55c2ff",
"score": "0.6396435",
"text": "def update_cart_item\n json_response({ message: \"NOT IMPLEMENTED\" })\n end",
"title": ""
},
{
"docid": "f0be375177ec48ce76e7e4f7098f9aa0",
"score": "0.63903904",
"text": "def update_cart_item\n json_response({ message: 'NOT IMPLEMENTED' })\n end",
"title": ""
},
{
"docid": "647a47822b2a55ae149beda1ad939001",
"score": "0.6386635",
"text": "def update\n \n \n respond_to do |format|\n if @cart.update(cart_params)\n format.html { redirect_to @cart, notice: 'Item was successfully updated.' }\n format.json { render :show, status: :ok, location: @cart }\n else\n format.html { render :edit }\n format.json { render json: @cart.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "94fb02654e184f5498eff4e03c0573f8",
"score": "0.6376341",
"text": "def update\n respond_to do |format|\n if @cart.update(cart_params)\n format.html { redirect_to @cart, greenNotice: 'Cart was successfully updated.' }\n format.json { render :show, status: :ok, location: @cart }\n else\n format.html { render :edit }\n format.json { render json: @cart.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "91135f252e471edfd0e0bee2b0146c53",
"score": "0.6374841",
"text": "def update\n if @cartitem.update(cartitem_params)\n render json: @cartitem\n else\n render json: @cartitem.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "9111b980ecfe1995443f1089b9a3848d",
"score": "0.6372455",
"text": "def update\n respond_to do |format|\n if @cart.update(cart_params)\n format.html { redirect_to @cart, notice: 'Cart was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @cart.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9111b980ecfe1995443f1089b9a3848d",
"score": "0.6372455",
"text": "def update\n respond_to do |format|\n if @cart.update(cart_params)\n format.html { redirect_to @cart, notice: 'Cart was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @cart.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9111b980ecfe1995443f1089b9a3848d",
"score": "0.6372455",
"text": "def update\n respond_to do |format|\n if @cart.update(cart_params)\n format.html { redirect_to @cart, notice: 'Cart was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @cart.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9111b980ecfe1995443f1089b9a3848d",
"score": "0.6372455",
"text": "def update\n respond_to do |format|\n if @cart.update(cart_params)\n format.html { redirect_to @cart, notice: 'Cart was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @cart.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9111b980ecfe1995443f1089b9a3848d",
"score": "0.6372455",
"text": "def update\n respond_to do |format|\n if @cart.update(cart_params)\n format.html { redirect_to @cart, notice: 'Cart was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @cart.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9111b980ecfe1995443f1089b9a3848d",
"score": "0.6372455",
"text": "def update\n respond_to do |format|\n if @cart.update(cart_params)\n format.html { redirect_to @cart, notice: 'Cart was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @cart.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9111b980ecfe1995443f1089b9a3848d",
"score": "0.6372455",
"text": "def update\n respond_to do |format|\n if @cart.update(cart_params)\n format.html { redirect_to @cart, notice: 'Cart was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @cart.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "fc993ac9b2971c33c527b5bdd9062497",
"score": "0.6371816",
"text": "def update\n respond_to do |format|\n if @cart.update(cart_params)\n format.html {redirect_to @cart, notice: 'Cart was successfully updated.'}\n format.json {render :show, status: :ok, location: @cart}\n else\n format.html {render :edit}\n format.json {render json: @cart.errors, status: :unprocessable_entity}\n end\n end\n end",
"title": ""
},
{
"docid": "d86c824ce2f0612d1c755ccefcba9ac5",
"score": "0.63444394",
"text": "def update\n # @reservation_cart = ReservationCart.find(params[:id])\n\n respond_to do |format|\n if @reservation_cart.update_attributes(params[:reservation_cart])\n format.html { redirect_to @reservation_cart, notice: 'Reservation cart was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @reservation_cart.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ad471d6e70ab977b1f39721d1477c6dd",
"score": "0.634119",
"text": "def update\n shoppingCartItem = ShoppingCartItem.find(params[:id])\n shoppingCartItem.update(shoppingCartItem_params)\n render json: shoppingCartItem, except: [:updated_at, :created_at]\n end",
"title": ""
},
{
"docid": "94aa615ef05478dac5ef65304c66ca58",
"score": "0.6309316",
"text": "def update\n respond_to do |format|\n if @cart.update(cart_params)\n format.html { redirect_to products_url(@cart.product), notice: 'Cart was successfully updated.' }\n format.json { render :show, status: :ok, location: @cart }\n else\n format.html { render :edit }\n format.json { render json: @cart.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "cb88402e2d986005ec254095d3deb56d",
"score": "0.6305718",
"text": "def update\n respond_to do |format|\n if @item_cart.update(item_cart_params)\n format.html { redirect_to catigories_path, notice: 'Item cart was successfully added to your cart.' }\n format.json { render :show, status: :ok, location: @item_cart }\n else\n format.html { render :edit }\n format.json { render json: @item_cart.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "99c5eb61a6b2b89669bbec790ce433bf",
"score": "0.6305072",
"text": "def show\n @resarch_cart = ResarchCart.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @resarch_cart }\n end\n end",
"title": ""
},
{
"docid": "933afd44d965ed2a9a414531b47cdf9a",
"score": "0.6301646",
"text": "def index\n update_cart_items\n end",
"title": ""
},
{
"docid": "040b8518276c72565b70b658586b3555",
"score": "0.62998176",
"text": "def update \r\n shoppingCart = ShoppingCart.find(params[:id])\r\n setTotalPrice\r\n if shoppingCart.update_attributes(shopping_cart_params)\r\n render json: {\r\n status: 'SUCCESS',\r\n message: 'Updated specific shopping cart',\r\n data: shoppingCart\r\n }, status: :ok\r\n else\r\n render json: {\r\n status: 'ERROR',\r\n message: 'Could not update specific shopping cart',\r\n data: shoppingCart.errors\r\n }, status: :unprocessable_entity\r\n end\r\n end",
"title": ""
},
{
"docid": "593f50d7ac25f8ab93ed95a960d242f8",
"score": "0.6283869",
"text": "def update\n @home_categories_products_indices_cart = Home::Categories::Products::Indices::Cart.find(params[:id])\n\n respond_to do |format|\n if @home_categories_products_indices_cart.update_attributes(params[:home_categories_products_indices_cart])\n format.html { redirect_to @home_categories_products_indices_cart, notice: 'Cart was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @home_categories_products_indices_cart.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "92b8b43d432322f190a30cbb9bd75c89",
"score": "0.6282745",
"text": "def update_cart\n self.cart.touch\n end",
"title": ""
},
{
"docid": "9b467f4a308ea8e3b5fabcbf477786b4",
"score": "0.6273526",
"text": "def update\n respond_to do |format|\n if @carts_product.update(carts_product_params)\n format.html { redirect_to carts_products_url, notice: 'Quantity was successfully updated.' }\n format.json { render :show, status: :ok, location: @carts_product }\n else\n format.html { render :edit }\n format.json { render json: @carts_product.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "61e6971ea5abbe4c1485d91a47ab4911",
"score": "0.627109",
"text": "def destroy\n @resarch_cart = ResarchCart.find(params[:id])\n @resarch_cart.destroy\n\n respond_to do |format|\n format.html { redirect_to resarch_carts_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "e48b550621ffa00306c34da3abc4290c",
"score": "0.62652504",
"text": "def update\n respond_to do |format|\n if @purchaser_cart.update(purchaser_cart_params)\n format.html { redirect_to @purchaser_cart, notice: 'Cart was successfully updated.' }\n format.json { render :show, status: :ok, location: @purchaser_cart }\n else\n format.html { render :edit }\n format.json { render json: @purchaser_cart.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3b5efdc6ecfbe8970f938ccfc3c99c7c",
"score": "0.62548256",
"text": "def update\n respond_to do |format|\n if @cart1.update(cart1_params)\n format.html { redirect_to @cart1, notice: 'Cart1 was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @cart1.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "bf144940928a5284d3c40a002a91f3c9",
"score": "0.6245346",
"text": "def update\n respond_to do |format|\n if @create_carts_product.update(create_carts_product_params)\n format.html { redirect_to @create_carts_product, notice: 'Create carts product was successfully updated.' }\n format.json { render :show, status: :ok, location: @create_carts_product }\n else\n format.html { render :edit }\n format.json { render json: @create_carts_product.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5afb20a8ef7719062713cb7316c6bf0a",
"score": "0.62426",
"text": "def update\n if @usercart.update(usercart_params)\n render json: @usercart\n else\n render json: @usercart.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "b061ea0432e4ae4183d2e9b1211311f7",
"score": "0.62408155",
"text": "def update\n @cart = Cart.find(params[:id])\n\n respond_to do |format|\n if @cart.update_attributes(cart_params)\n format.html { redirect_to @cart, notice: 'Cart was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @cart.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6a2989d77fb6a9bc2bba5527a5f6b67e",
"score": "0.6235278",
"text": "def update\n respond_to do |format|\n if @product_cart.update(product_cart_params)\n format.html { redirect_to @product_cart, notice: 'Product cart was successfully updated.' }\n format.json { render :show, status: :ok, location: @product_cart }\n else\n format.html { render :edit }\n format.json { render json: @product_cart.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6a2989d77fb6a9bc2bba5527a5f6b67e",
"score": "0.6235278",
"text": "def update\n respond_to do |format|\n if @product_cart.update(product_cart_params)\n format.html { redirect_to @product_cart, notice: 'Product cart was successfully updated.' }\n format.json { render :show, status: :ok, location: @product_cart }\n else\n format.html { render :edit }\n format.json { render json: @product_cart.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "93279e0700fb7d331333df3fdf1e0e37",
"score": "0.6232285",
"text": "def update\n @cart = Cart.find(params[:id])\n\n respond_to do |format|\n if @cart.update_attributes(params[:cart])\n format.html { redirect_to @cart, :notice => 'Cart was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @cart.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "93279e0700fb7d331333df3fdf1e0e37",
"score": "0.6232285",
"text": "def update\n @cart = Cart.find(params[:id])\n\n respond_to do |format|\n if @cart.update_attributes(params[:cart])\n format.html { redirect_to @cart, :notice => 'Cart was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @cart.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7ecbef9b208df8bc06a1c3826f725d01",
"score": "0.62188464",
"text": "def set_cart_carry\n @cart_carry = CartCarry.find(params[:id])\n end",
"title": ""
},
{
"docid": "37dea2be1a223afd8ed62d1ead85d4f6",
"score": "0.6216701",
"text": "def update\n @shop_cart = ShopCart.find(params[:id])\n\n respond_to do |format|\n if @shop_cart.update_attributes(shop_cart_params)\n format.html { redirect_to @shop_cart, notice: 'Shop cart was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @shop_cart.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "df4c26e75cc7831e533329a510eba5a6",
"score": "0.6212007",
"text": "def update\n @cart = Cart.find(params[:id])\n\n respond_to do |format|\n if @cart.update_attributes(params[:cart])\n format.html { redirect_to @cart, notice: 'Cart was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @cart.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "df4c26e75cc7831e533329a510eba5a6",
"score": "0.6212007",
"text": "def update\n @cart = Cart.find(params[:id])\n\n respond_to do |format|\n if @cart.update_attributes(params[:cart])\n format.html { redirect_to @cart, notice: 'Cart was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @cart.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "df4c26e75cc7831e533329a510eba5a6",
"score": "0.6212007",
"text": "def update\n @cart = Cart.find(params[:id])\n\n respond_to do |format|\n if @cart.update_attributes(params[:cart])\n format.html { redirect_to @cart, notice: 'Cart was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @cart.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "df4c26e75cc7831e533329a510eba5a6",
"score": "0.6212007",
"text": "def update\n @cart = Cart.find(params[:id])\n\n respond_to do |format|\n if @cart.update_attributes(params[:cart])\n format.html { redirect_to @cart, notice: 'Cart was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @cart.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "df4c26e75cc7831e533329a510eba5a6",
"score": "0.6212007",
"text": "def update\n @cart = Cart.find(params[:id])\n\n respond_to do |format|\n if @cart.update_attributes(params[:cart])\n format.html { redirect_to @cart, notice: 'Cart was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @cart.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "85e2d8344e8d84329c2dc7d89d2dbba0",
"score": "0.6209532",
"text": "def update_cart_with_http_info(cart, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: CheckoutApi.update_cart ...'\n end\n # verify the required parameter 'cart' is set\n if @api_client.config.client_side_validation && cart.nil?\n fail ArgumentError, \"Missing the required parameter 'cart' when calling CheckoutApi.update_cart\"\n end\n # resource path\n local_var_path = '/checkout/cart'\n\n # query parameters\n query_params = {}\n query_params[:'_expand'] = opts[:'_expand'] if !opts[:'_expand'].nil?\n\n # header parameters\n header_params = {}\n header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()\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(cart)\n auth_names = ['ultraCartBrowserApiKey', 'ultraCartOauth', 'ultraCartSimpleApiKey']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'CartResponse')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: CheckoutApi#update_cart\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "cae1a1667e7f817b0112aff35298ccec",
"score": "0.6206298",
"text": "def update\n @cart = Cart.find(params[:cart_id])\n @item = @cart.items.find(params[:id])\n @item.update(item_params)\n \n respond_to do |format|\n if @item.update(item_params)\n format.html { redirect_to @cart, notice: 'Товаров изменен.' }\n format.json { render :show, status: :created, location: @cart }\n else\n format.html { render :new }\n format.json { render json: @cart.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c1ec39f2dd8efc373f40e784b16b5781",
"score": "0.6198304",
"text": "def new\n @resarch_cart = ResarchCart.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @resarch_cart }\n end\n end",
"title": ""
},
{
"docid": "2268e5af05faed35487f3b1a9f56bdc3",
"score": "0.61843187",
"text": "def update\n @cart = Cart.find(params[:id])\n\n respond_to do |format|\n if @cart.update_attributes(params[:cart])\n format.html { redirect_to @cart, notice: 'Cart was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @cart.errors, status: :unprocessable_entity }\n end\n end\nend",
"title": ""
},
{
"docid": "2bc0ff0ba29b5d9bbc241556bad03f31",
"score": "0.61758906",
"text": "def update\n respond_to do |format|\n if @item_cart.update_attributes(item_cart_params)\n format.html { redirect_to @item_cart, notice: \"Item cart was successfully updated.\" }\n format.json { render :show, status: :ok, location: @item_cart }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @item_cart.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ca392278a6051881aaf9cfce68978192",
"score": "0.6167812",
"text": "def update\n respond_to do |format|\n if @cartsitem.update(cartsitem_params)\n format.html { redirect_to @cartsitem, notice: 'Cartsitem was successfully updated.' }\n format.json { render :show, status: :ok, location: @cartsitem }\n else\n format.html { render :edit }\n format.json { render json: @cartsitem.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "27242261b26dc28331a6d4f2b85dc765",
"score": "0.6163113",
"text": "def update\n respond_to do |format|\n if @admin_cart.update(admin_cart_params)\n format.html { redirect_to @admin_cart, notice: 'Cart was successfully updated.' }\n format.json { render :show, status: :ok, location: @admin_cart }\n else\n format.html { render :edit }\n format.json { render json: @admin_cart.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6d9e43244924af04aa8b257eda64409d",
"score": "0.6162093",
"text": "def update\r\n @cart = Cart.find(params[:id])\r\n\r\n respond_to do |format|\r\n if @cart.update_attributes(params[:cart])\r\n format.html { redirect_to @cart, notice: 'Cart 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: @cart.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end",
"title": ""
},
{
"docid": "0c1983768b866027660f82015726602c",
"score": "0.61350006",
"text": "def set_cart\n @cart = params[:cart]\n end",
"title": ""
},
{
"docid": "d909db7e8920446d7838cbd5b964f34a",
"score": "0.61155236",
"text": "def set_cart\n begin\n @cart = Cart.find(params[:id])\n rescue ActiveRecord::RecordNotFound\n render :json => { error: 'Record not found' }, status: :not_found\n end\n end",
"title": ""
},
{
"docid": "37cf8df76323a109d7fc5e1b63ab43e1",
"score": "0.61038333",
"text": "def update\n respond_to do |format|\n if @cart_with_item.update(cart_with_item_params)\n format.html { redirect_to @cart_with_item, notice: 'Cart with item was successfully updated.' }\n format.json { render :show, status: :ok, location: @cart_with_item }\n else\n format.html { render :edit }\n format.json { render json: @cart_with_item.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "cb62b3060392bd7861d0409c5145e6f0",
"score": "0.60823387",
"text": "def update\n respond_to do |format|\n if @items_in_cart.update(items_in_cart_params)\n format.html { redirect_to @items_in_cart, notice: 'Items was was successfully updated.' }\n format.json { render :show, status: :ok, location: @items_in_cart }\n else\n format.html { render :edit }\n format.json { render json: @items_in_cart.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e1fe262c603be3d85ea9206bc73cfcf7",
"score": "0.60759383",
"text": "def update\n respond_to do |format|\n if @cart_item.update(cart_item_params)\n format.html { redirect_to @cart_item }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @cart_item.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d1d2a18e470947cb118e73b6589e224b",
"score": "0.60657805",
"text": "def update\n respond_to do |format|\n if @cart_item.update(cart_item_params)\n format.html { redirect_to @cart_item, notice: \"Cart item was successfully updated.\" }\n format.json { render :show, status: :ok, location: @cart_item }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @cart_item.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d1d2a18e470947cb118e73b6589e224b",
"score": "0.60657805",
"text": "def update\n respond_to do |format|\n if @cart_item.update(cart_item_params)\n format.html { redirect_to @cart_item, notice: \"Cart item was successfully updated.\" }\n format.json { render :show, status: :ok, location: @cart_item }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @cart_item.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0403dd911b59ffa2703a205f7c3c0a30",
"score": "0.60490084",
"text": "def update\n respond_to do |format|\n if @shopping_cart.update(shopping_cart_params)\n format.html { redirect_to @shopping_cart, notice: \"Shopping cart was successfully updated.\" }\n format.json { render :show, status: :ok, location: @shopping_cart }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @shopping_cart.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "855fa644985c5a8ab98ec5252d5f033a",
"score": "0.60409814",
"text": "def update\n @cartt = Cartt.find(params[:id])\n\n respond_to do |format|\n if @cartt.update_attributes(params[:cartt])\n format.html { redirect_to @cartt, notice: 'Cartt was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @cartt.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ebeb41fa3fb731457283b9c74dde12bf",
"score": "0.60391307",
"text": "def update\n @rent_cart = RentCart.find(params[:id])\n\n respond_to do |format|\n if @rent_cart.update_attributes(params[:rent_cart])\n format.html { redirect_to(@rent_cart, :notice => 'RentCart was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @rent_cart.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "be6ee9957632aca2a3f951bb5d9ca186",
"score": "0.601899",
"text": "def update\n respond_to do |format|\n if @cart_item.update(cart_item_params)\n format.html { redirect_to @cart_item, notice: 'Cart item was successfully updated.' }\n format.json { render :show, status: :ok, location: @cart_item }\n else\n format.html { render :edit }\n format.json { render json: @cart_item.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "be6ee9957632aca2a3f951bb5d9ca186",
"score": "0.601899",
"text": "def update\n respond_to do |format|\n if @cart_item.update(cart_item_params)\n format.html { redirect_to @cart_item, notice: 'Cart item was successfully updated.' }\n format.json { render :show, status: :ok, location: @cart_item }\n else\n format.html { render :edit }\n format.json { render json: @cart_item.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "149ca2269bf28d98ca92f611f955e26c",
"score": "0.60176826",
"text": "def update\n find_cart\n item = @cart.cart_items.find(params[:cart_item_id])\n if item\n item.update_attributes(:quantity => params[:qty])\n end\n redirect_to cart_path\n end",
"title": ""
},
{
"docid": "94a7b084dd8feb7f5dc7b2bab57631ec",
"score": "0.60170746",
"text": "def update\n respond_to do |format|\n if @shopping_cart.update(shopping_cart_params)\n format.html { redirect_to @shopping_cart, notice: 'Shopping cart was successfully updated.' }\n format.json { render :show, status: :ok, location: @shopping_cart }\n else\n format.html { render :edit }\n format.json { render json: @shopping_cart.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "94a7b084dd8feb7f5dc7b2bab57631ec",
"score": "0.60170746",
"text": "def update\n respond_to do |format|\n if @shopping_cart.update(shopping_cart_params)\n format.html { redirect_to @shopping_cart, notice: 'Shopping cart was successfully updated.' }\n format.json { render :show, status: :ok, location: @shopping_cart }\n else\n format.html { render :edit }\n format.json { render json: @shopping_cart.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "94a7b084dd8feb7f5dc7b2bab57631ec",
"score": "0.60170746",
"text": "def update\n respond_to do |format|\n if @shopping_cart.update(shopping_cart_params)\n format.html { redirect_to @shopping_cart, notice: 'Shopping cart was successfully updated.' }\n format.json { render :show, status: :ok, location: @shopping_cart }\n else\n format.html { render :edit }\n format.json { render json: @shopping_cart.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "94a7b084dd8feb7f5dc7b2bab57631ec",
"score": "0.60170746",
"text": "def update\n respond_to do |format|\n if @shopping_cart.update(shopping_cart_params)\n format.html { redirect_to @shopping_cart, notice: 'Shopping cart was successfully updated.' }\n format.json { render :show, status: :ok, location: @shopping_cart }\n else\n format.html { render :edit }\n format.json { render json: @shopping_cart.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a809bcb66a3ecd190e1de67f88f9a34c",
"score": "0.60116094",
"text": "def update\n @cartitem = Cartitem.find(params[:id])\n\n respond_to do |format|\n if @cartitem.update_attributes(params[:cartitem])\n format.html { redirect_to cart_path }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @cartitem.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
bd4dd8e50e5a8a8617100ad7849fe6df | crossrecord checks assuming that each permission is >= 0, the sum of them must be > 0 or each would be 0 which would be a useless permissions record | [
{
"docid": "bd337eac5b338778717ab05c4f73d2e7",
"score": "0.63139886",
"text": "def minimum_permissions\n if( to_index + to_create + to_read + to_update + to_delete )== 0\n errors.add( :base, I18n.t( 'permission4_groups.msg.none_given' ))\n end\n end",
"title": ""
}
] | [
{
"docid": "2a0ba05dce9ba51eefcb19cba0671d33",
"score": "0.62183183",
"text": "def dc_user_can(permission, table=params[:table])\r\n if @permissions.nil?\r\n @permissions = {}\r\n add_permissions_for # default permission\r\n table_name = ''\r\n# permission can be set for table or object embedded in table. Read all possible values \r\n table.strip.downcase.split(';').each do |t|\r\n table_name << (table_name.size > 0 ? ';' : '') + t # table;embedded;another;...\r\n add_permissions_for table_name\r\n end\r\n end\r\n# Return true if any of the permissions user has is higher or equal to requested permission \r\n session[:user_roles].each {|r| return true if @permissions[r] and @permissions[r] >= permission }\r\n false\r\nend",
"title": ""
},
{
"docid": "f9cb668b0700a5fca71dbdaa0a9d0943",
"score": "0.6117516",
"text": "def permission_dependencies\n errors.add( :to_read, I18n.t( 'permission4_groups.msg.insuf_read_lvl' )) \\\n if to_read < to_update || to_read < to_create\n end",
"title": ""
},
{
"docid": "e9a96ef1c7073876f164e00cf717fba6",
"score": "0.5998486",
"text": "def check_accesses\n errors[:base] << I18n.t('messages.at_least_one_access') if access_profiles.find_all {|t| t.deleted == 0}.size == 0\n end",
"title": ""
},
{
"docid": "c4c5c76994b3aa598b90456059bfa6cc",
"score": "0.5987385",
"text": "def doesnt_have_permission?(*levels)\n if permissions - levels == permissions\n return true\n else\n return false\n end\n end",
"title": ""
},
{
"docid": "08cf0830eac84791a967cf0c5576c42d",
"score": "0.59818995",
"text": "def all_users_permissions user\n can :list, LimeSurvey #if user.role_aggregates.count > 0\n end",
"title": ""
},
{
"docid": "dfd7e3bac5b1f176dfc759f35c312aed",
"score": "0.5979851",
"text": "def check_permission(permissions,no_model_permission,action,subject_class,actions_list)\n \tcount = 0\n \tif permissions.present?\n \t\tpermissions.each do |permission|\n \t\t\tif no_model_permission==1\n \t\t\t\tif action==permission.action && subject_class==permission.subject_class\n \t\t\t\t\tcount = 1\n \t\t\t\t\tbreak\n \t\t\t\tend \t\t\t\t\t\n \t\t\telse \t\t\t\t\n \t\t\t\tif action==permission.action && permission.actions_list.include?(actions_list.to_sym)\n \t\t\t\t\tcount = 1\n \t\t\t\t\tbreak\n \t\t\t\tend\n \t\t\tend \t\t\n \t\tend \t\n \tend \t\n \tif count==1\n \t\ttrue\n \telse\n \t\tfalse\n \tend\n end",
"title": ""
},
{
"docid": "dc940c83a9fb68fe6f20f4fe5f2e7b9d",
"score": "0.5947769",
"text": "def test_fav_group_permissions_dont_get_used_if_individual_permissions_exist\n temp = sops(:sop_with_download_for_all_sysmo_users_policy).policy.use_allowlist\n assert !temp, \"policy for test SOP shouldn't use allowlist\"\n\n temp = sops(:sop_with_download_for_all_sysmo_users_policy).policy.use_denylist\n assert !temp, \"policy for test SOP shouldn't use denylist\"\n\n # download is allowed for all sysmo users..\n temp = temp_authorized_by_policy?(sops(:sop_with_download_for_all_sysmo_users_policy).policy, sops(:sop_with_download_for_all_sysmo_users_policy), 'download',\n users(:sysmo_user_who_wants_to_access_different_things), users(:sysmo_user_who_wants_to_access_different_things).person)\n assert temp, \"policy of the test SOP should have allowed 'download' of that asset\"\n\n # ..but editing is not allowed\n temp = temp_authorized_by_policy?(sops(:sop_with_download_for_all_sysmo_users_policy).policy, sops(:sop_with_download_for_all_sysmo_users_policy), 'edit',\n users(:sysmo_user_who_wants_to_access_different_things), users(:sysmo_user_who_wants_to_access_different_things).person)\n assert !temp, \"policy of the test SOP shouldn't have allowed 'edit' of that asset\"\n\n # verify that permissions for the user exist, but don't give enough access rights..\n permissions = temp_get_person_permissions(users(:sysmo_user_who_wants_to_access_different_things).person, sops(:sop_with_download_for_all_sysmo_users_policy).policy)\n assert permissions.length == 1, \"expected to have one permission in that policy for the test person, not #{permissions.length}\"\n assert permissions[0].access_type == Policy::VISIBLE, 'expected that the permission would give the test user viewing access to the test SOP, but no access for editing'\n\n # ..check that sharing with favourite group gives more access to this person..\n permissions = temp_get_person_access_rights_from_favourite_group_permissions(users(:sysmo_user_who_wants_to_access_different_things).person, sops(:sop_with_download_for_all_sysmo_users_policy).policy)\n assert permissions.length == 1, \"expected to have one permission from favourite groups in that policy for the test person, not #{permissions.length}\"\n assert permissions[0].access_type == Policy::EDITING, 'expected that the permission would give the test user access to the test SOP for editing'\n\n # ..and now verify that permissions from favourite groups won't get used, because individual permissions have precedence\n res = Seek::Permissions::Authorization.is_authorized?('edit', sops(:sop_with_download_for_all_sysmo_users_policy), users(:sysmo_user_who_wants_to_access_different_things))\n assert !res, \"test user should not have been allowed to 'edit' the SOP - individual permission should have denied the action\"\n\n res = Seek::Permissions::Authorization.is_authorized?('view', sops(:sop_with_download_for_all_sysmo_users_policy), users(:sysmo_user_who_wants_to_access_different_things))\n assert res, \"test user should have been allowed to 'view' the SOP - this is what individual permissions only allow\"\n end",
"title": ""
},
{
"docid": "b263d88926c2f96d326308d1aba16325",
"score": "0.5933802",
"text": "def access_permissions\n\n unless l_group_id.nil?\n unless l_owner_id.nil?\n errors.add( :l_owner_id, I18n.t( 'isr_interfaces.msg.no_access_4' )) \\\n unless l_owner.permission_to_access( FEATURE_ID_ISR_INTERFACES, :to_update, l_group_id )\n end\n unless l_deputy_id.nil?\n errors.add( :l_deputy_id, I18n.t( 'isr_interfaces.msg.no_access_4' )) \\\n unless l_deputy.permission_to_access( FEATURE_ID_ISR_INTERFACES, :to_update, l_group_id )\n end\n end\n\n unless p_group_id.nil?\n unless p_owner_id.nil?\n errors.add( :p_owner_id, I18n.t( 'isr_interfaces.msg.no_access_4' )) \\\n unless p_owner.permission_to_access( FEATURE_ID_ISR_INTERFACES, :to_update, p_group_id )\n end\n unless p_deputy_id.nil?\n errors.add( :p_deputy_id, I18n.t( 'isr_interfaces.msg.no_access_4' )) \\\n unless p_deputy.permission_to_access( FEATURE_ID_ISR_INTERFACES, :to_update, p_group_id )\n end\n end\n\n end",
"title": ""
},
{
"docid": "9ecfee8794f744c68acd46cc4beac7fe",
"score": "0.58859324",
"text": "def test_fav_group_permissions_dont_get_used_if_individual_permissions_exist\n temp = sops(:sop_with_download_for_all_sysmo_users_policy).policy.use_whitelist\n assert !temp, \"policy for test SOP shouldn't use whitelist\"\n \n temp = sops(:sop_with_download_for_all_sysmo_users_policy).policy.use_blacklist\n assert !temp, \"policy for test SOP shouldn't use blacklist\"\n \n # download is allowed for all sysmo users..\n temp = temp_authorized_by_policy?(sops(:sop_with_download_for_all_sysmo_users_policy).policy, sops(:sop_with_download_for_all_sysmo_users_policy), \"download\",\n users(:sysmo_user_who_wants_to_access_different_things), users(:sysmo_user_who_wants_to_access_different_things).person)\n assert temp, \"policy of the test SOP should have allowed 'download' of that asset\"\n \n # ..but editing is not allowed\n temp = temp_authorized_by_policy?(sops(:sop_with_download_for_all_sysmo_users_policy).policy, sops(:sop_with_download_for_all_sysmo_users_policy), \"edit\",\n users(:sysmo_user_who_wants_to_access_different_things), users(:sysmo_user_who_wants_to_access_different_things).person)\n assert !temp, \"policy of the test SOP shouldn't have allowed 'edit' of that asset\"\n\n # verify that permissions for the user exist, but don't give enough access rights..\n permissions = temp_get_person_permissions(users(:sysmo_user_who_wants_to_access_different_things).person, sops(:sop_with_download_for_all_sysmo_users_policy).policy)\n assert permissions.length == 1, \"expected to have one permission in that policy for the test person, not #{permissions.length}\"\n assert permissions[0].access_type == Policy::VISIBLE, \"expected that the permission would give the test user viewing access to the test SOP, but no access for editing\"\n \n # ..check that sharing with favourite group gives more access to this person..\n permissions = temp_get_person_access_rights_from_favourite_group_permissions(users(:sysmo_user_who_wants_to_access_different_things).person, sops(:sop_with_download_for_all_sysmo_users_policy).policy)\n assert permissions.length == 1, \"expected to have one permission from favourite groups in that policy for the test person, not #{permissions.length}\"\n assert permissions[0].access_type == Policy::EDITING, \"expected that the permission would give the test user access to the test SOP for editing\"\n \n # ..and now verify that permissions from favourite groups won't get used, because individual permissions have precedence\n res = Seek::Permissions::Authorization.is_authorized?(\"edit\", nil, sops(:sop_with_download_for_all_sysmo_users_policy), users(:sysmo_user_who_wants_to_access_different_things))\n assert !res, \"test user should not have been allowed to 'edit' the SOP - individual permission should have denied the action\"\n \n res = Seek::Permissions::Authorization.is_authorized?(\"download\", nil, sops(:sop_with_download_for_all_sysmo_users_policy), users(:sysmo_user_who_wants_to_access_different_things))\n assert !res, \"test user should not have been allowed to 'download' the SOP - individual permission should have denied the action (these limit it to less that public access)\"\n \n res = Seek::Permissions::Authorization.is_authorized?(\"view\", nil, sops(:sop_with_download_for_all_sysmo_users_policy), users(:sysmo_user_who_wants_to_access_different_things))\n assert res, \"test user should have been allowed to 'view' the SOP - this is what individual permissions only allow\"\n end",
"title": ""
},
{
"docid": "88fc699ea04daa62f22f18cf83b1104d",
"score": "0.5856854",
"text": "def check_permissions\n if role.in? ['Manager', 'Owner', 'Admin']\n PERMISSION_FLAGS.each { |flag| send(\"#{flag}=\", true) }\n end\n end",
"title": ""
},
{
"docid": "3f6c4ffc36ffed6f320bcb45adcd96ca",
"score": "0.58421767",
"text": "def check_permissions\n return if current_user&.any_roles?([:admin])\n\n case params[:controller]\n when 'identity_document_types', 'phone_types'\n reject_access\n when 'ensemble_levels', 'positions', 'statuses', 'musical_instruments'\n reject_access unless current_user.any_roles?(%i[main_leader])\n when 'ensembles', 'statistics'\n reject_access unless current_user.any_roles?(%i[leader main_leader])\n case params[:action]\n when 'new', 'create', 'destroy'\n reject_access unless current_user.any_roles?([:main_leader])\n when 'edit', 'update'\n unless current_user.any_roles?([:main_leader])\n ensemble_id = params[:id].to_i\n reject_access unless can_access_ensemble?(ensemble_id) && another_ensemble?(ensemble_id)\n end\n when 'show'\n unless current_user.any_roles?([:main_leader])\n ensemble_id = params[:id].to_i\n reject_access unless can_access_ensemble?(ensemble_id)\n end\n end\n when 'members'\n case params[:action]\n when 'index', 'new', 'create', 'new_upload', 'upload'\n reject_access unless current_user.any_roles?(%i[leader main_leader])\n when 'destroy', 'new_transfer'\n reject_access unless current_user.any_roles?(%i[leader main_leader]) && another_member?((params[:member_id] || params[:id]).to_i)\n when 'show', 'edit', 'update'\n if another_member?(params[:id].to_i)\n reject_access unless can_access_another_member?(params[:id])\n end\n end\n when 'memberships'\n case params[:action]\n when 'autocomplete'\n reject_access unless current_user.any_roles?(%i[leader main_leader])\n end\n end\n end",
"title": ""
},
{
"docid": "b3373b5752a6374dd9d1b5ca4bd43d64",
"score": "0.5840389",
"text": "def validate_counters\n raise 'user counter cannot be negative' if self.uploaded < 0 || self.downloaded < 0\n end",
"title": ""
},
{
"docid": "e52c1c617432ea166c284fc18fa6e9da",
"score": "0.5825039",
"text": "def test_blacklist_has_precedence_over_individual_permissions\n temp = sops(:sop_that_uses_whitelist_blacklist_and_custom_sharing).policy.use_blacklist\n assert temp, \"policy for test SOP should use blacklist\"\n \n\n # verify that test user is in the blacklist\n temp = Seek::Permissions::Authorization.is_person_in_blacklist?(users(:registered_user_with_no_projects).person, sops(:sop_that_uses_whitelist_blacklist_and_custom_sharing).contributor)\n assert temp, \"test person should have been in the blacklist of the sop owner\"\n \n # verify that test user has an individual permission, too\n # (this has to give more access than the general policy settings) \n permissions = temp_get_person_permissions(users(:registered_user_with_no_projects).person, sops(:sop_that_uses_whitelist_blacklist_and_custom_sharing).policy)\n assert permissions.length == 1, \"expected to have one permission in that policy for the test person, not #{permissions.length}\"\n assert permissions[0].access_type > sops(:sop_that_uses_whitelist_blacklist_and_custom_sharing).policy.access_type, \"expected that the permission would give the test user more access than general policy settings\"\n \n # verify that individual permission will not be used, because blacklist has precedence\n res = Seek::Permissions::Authorization.is_authorized?(\"download\", nil, sops(:sop_that_uses_whitelist_blacklist_and_custom_sharing), users(:registered_user_with_no_projects))\n assert !res, \"test user shouldn't have been allowed to 'download' the SOP even having the individual permission and use_custom_sharing is set to true - blacklist membership should have had precedence\"\n \n # in fact, even 'viewing' allowed by general policy settings shouldn't be allowed because of the blacklist\n res = Seek::Permissions::Authorization.is_authorized?(\"view\", nil, sops(:sop_that_uses_whitelist_blacklist_and_custom_sharing), users(:registered_user_with_no_projects))\n assert !res, \"test user shouldn't have been allowed to 'view' the SOP - blacklist membership should have denied this\"\n end",
"title": ""
},
{
"docid": "47bd90eec60fb34d14735c97b0c6acba",
"score": "0.5818905",
"text": "def check_user_privileges(requested_record)\n # allow admins to access all records\n if user_is_admin()\n return true\n\n # if the requested record does not belong to the current user\n # and is private, prevent the user from accessing the record\n elsif (requested_record.cas_user_name != session[:cas_user]) &&\n (requested_record.make_private == true) or\n (requested_record.cas_user_name != session[:cas_user] &&\n # check if record published 25 years or more ago\n Time.now - requested_record.created_at < (60 * 60 * 24 * 365 * 25))\n flash[:info] = \"<strong>ACCESS RESTRICTED</strong>\".html_safe + \": You do not have access to this page. Please contact your administrator about your permissions.\"\n redirect_to user_show_path\n end\n end",
"title": ""
},
{
"docid": "a248d3a2bc110c8a6a5ac9c0fd00415f",
"score": "0.5804222",
"text": "def can_access_record?(level, model, record)\n Right.where(role_id: roles)\n .where(\n 'organization_id IN (:ids) OR organization_id IS NULL',\n ids: record.top_level_organizations\n )\n .where(subject_type: model)\n .where('subject_id = :record_id OR subject_id IS NULL',\n record_id: record.id)\n .where('rights.level <= ?', level)\n .present?\n end",
"title": ""
},
{
"docid": "324937872898b779b06cd16c186e9266",
"score": "0.5797437",
"text": "def can!(methods, resources)\n \n # This method should return all of the new permissions that were created, so we build a \n # response array to return\n result_response = []\n \n # Load all permissions fresh so we can kill dupes.\n saved_permissions = lookup_permissions!([resources].flatten.collect{ |r| (r.respond_to? :base_class) ? r.base_class.to_s : r.class.base_class.to_s.classify }.uniq)\n saved_permissions = saved_permissions.all\n \n # Store new permissions in an array so we can squeeze into one transaction.\n permissions_to_add = []\n permissions_to_update = []\n \n [resources].flatten.uniq.each do |resource|\n \n # Kind of unecessary but since some methods allow you to specify a Classname directly, this just\n # safegaurds against trying to do the same here.\n next if resource.is_a?(Class)\n \n # Get the member identifier for this resource\n identifier = member_identifier(resource)\n \n [methods].flatten.each do |method|\n \n resource_type = (resource.respond_to?(:base_class) ? resource.base_class.to_s : resource.class.base_class.to_s)\n \n # Create a new permission for each member (once if its self, multiple times if its associated)\n [identifier[:member_id]].flatten.uniq.each do |member_id| \n perm = saved_permissions.detect{ |p| p.member_id == member_id && p.member_type == identifier[:member_type] && p.resource_id == resource.id && p.resource_type == resource_type } || Permission.new(:member_id => member_id, :member_type => identifier[:member_type])\n perm.permission_type = method.to_s.downcase\n perm.resource = resource if perm.new_record?\n \n if perm.new_record?\n puts \"NEW RECORD!!!!!\"\n permissions_to_add << perm.attributes\n else\n puts \"OLD RECORD!!!\"\n permissions_to_update << perm if perm.changed?\n end\n \n end\n end\n end\n \n \n unless permissions_to_add.empty?\n Permission.transaction do\n permissions_to_add.each do |attrs|\n perm = Permission.new(attrs)\n perm.save(:validate => false)\n end\n end\n end\n \n unless permissions_to_update.empty?\n types = permissions_to_update.collect{ |p| p.permission_type.to_s }.uniq\n types.each do |type|\n to_update = permissions_to_update.find_all{ |perm| perm.permission_type.to_s == type }\n Permission.update_all({ :permission_type => type }, { :id => to_update.collect{ |perm| perm.id }.uniq })\n end\n end\n \n end",
"title": ""
},
{
"docid": "ff719791387067077ba37bce6301b0d1",
"score": "0.57772774",
"text": "def physical_access?(rec, _ctx = {})\n checkfields = []\n rec.each_by_tag('999') { |f| checkfields << f if f.indicator1 == '9' && f.indicator2.to_i < 3}\n if checkfields.size > 0\n return true\n else\n return false\n end\n end",
"title": ""
},
{
"docid": "1400adaf7f3bed6d648937f47a66651f",
"score": "0.5772953",
"text": "def relationships_require_permission?\n c100_application.relationships.with_permission_data.one? do |relationship|\n next if can_apply_for?(\n ALL_ORDERS, relationship:, child_orders: []\n )\n\n # Following checks are based on the orders selected for this child\n child_orders = relationship.minor.child_order.orders\n\n next if can_apply_for?(\n CAO_ORDERS, relationship:, child_orders:\n )\n\n next if can_apply_for?(\n CAO_HOME_ORDERS, relationship:, child_orders:\n )\n\n # If we reach this point, permission is required no matter what for at\n # least one child, and there is no point looping through the rest\n break PERMISSION_REQUIRED\n end\n end",
"title": ""
},
{
"docid": "3c2bb5a174cd526bc0c6e8143a47193e",
"score": "0.5752183",
"text": "def verify_and_sort_permissions\n # DefaultPermissionSet is allowed to have blank permissions (private joinable), the other models need at least find and view\n self.permissions += [:find, :view] unless is_a?(DefaultPermissionSet)\n \n raise \"Invalid permissions: #{(permissions - allowed_permissions).inspect}. Must be one of #{allowed_permissions.inspect}\" unless permissions.all? {|permission| allowed_permissions.include? permission}\n \n self.permissions = permissions.uniq.sort_by { |permission| allowed_permissions.index(permission) }\n end",
"title": ""
},
{
"docid": "89cb1849101eaf5614248e8c9b6f3080",
"score": "0.57468295",
"text": "def permissions; end",
"title": ""
},
{
"docid": "04247f911ad986616a2bf545fe302417",
"score": "0.572095",
"text": "def permission_check\n raise ActiveRecord::RecordNotFound if !current_user.events_section?\n raise ApiAccessEvanta::PermissionDenied if !current_user.event_evaluations?\n end",
"title": ""
},
{
"docid": "2d561712bf5205840afdaed0cf4e4a52",
"score": "0.57120717",
"text": "def check_permission_list(l,first_entry)\n @user = User.current\n log_projects = Project.find(:all, :order => 'name',:conditions => Project.allowed_to_condition(@user, :log_time))\n\n members = []\n permissions = []\n log_projects.each { |rec| members << rec.member_principals.find_by_user_id(User.current.id) }\n members.flatten.each do |rec|\n rec.member_roles.each { |rec| permissions << rec.role.permissions } if rec.present?\n end\n\n if permissions.flatten.present? && (permissions.flatten.include?(l.to_sym) || permissions.flatten.include?(l.to_sym))\n return true\n else\n return false\n end\n\n p '----'\n\n end",
"title": ""
},
{
"docid": "5d906b4ee4367552b0ead6f27f44b070",
"score": "0.57082325",
"text": "def has_current_permission\n if self.current_permission.nil?\n current_perm = Permission.create! :organisation => Location.empty_organisation, :profile => Profile.guest\n self.permissions << current_perm\n self.current_permission_id = current_perm.id\n end\n\n# errors[:current_permission] << \"current perm id = #{current_perm.id}, user id = #{self.id}, perm user_id = #{current_perm.user_id}, user.current_permission_id = #{self.current_permission_id}/#{self.current_permission_id}, associated perm = #{self.permissions}\"\n # current perm id = 49, user id = , perm user_id = , user.current_permission_id = \n end",
"title": ""
},
{
"docid": "249ef45282b009ba3e156ce2c151c8a2",
"score": "0.57052684",
"text": "def sufficient_permissions(permissions)\n @has_permissions = true\n @permissions += permissions\n\n @preconditions << proc { |request| permissions.any? { |permission| current_user.can?(permission) } }\n\n self\n end",
"title": ""
},
{
"docid": "65aa8e5d6257dd12a17bb5455f2c0e92",
"score": "0.5702342",
"text": "def permission_table_for_milestone_access\n :public | :enabled | :enabled | :admin | true | 1\n :public | :enabled | :enabled | :admin | false | 1\n :public | :enabled | :enabled | :reporter | nil | 1\n :public | :enabled | :enabled | :guest | nil | 1\n :public | :enabled | :enabled | :non_member | nil | 1\n :public | :enabled | :enabled | :anonymous | nil | 1\n\n :public | :enabled | :private | :admin | true | 1\n :public | :enabled | :private | :admin | false | 1\n :public | :enabled | :private | :reporter | nil | 1\n :public | :enabled | :private | :guest | nil | 1\n :public | :enabled | :private | :non_member | nil | 1\n :public | :enabled | :private | :anonymous | nil | 1\n\n :public | :enabled | :disabled | :admin | true | 1\n :public | :enabled | :disabled | :admin | false | 1\n :public | :enabled | :disabled | :reporter | nil | 1\n :public | :enabled | :disabled | :guest | nil | 1\n :public | :enabled | :disabled | :non_member | nil | 1\n :public | :enabled | :disabled | :anonymous | nil | 1\n\n :public | :private | :enabled | :admin | true | 1\n :public | :private | :enabled | :admin | false | 1\n :public | :private | :enabled | :reporter | nil | 1\n :public | :private | :enabled | :guest | nil | 1\n :public | :private | :enabled | :non_member | nil | 1\n :public | :private | :enabled | :anonymous | nil | 1\n\n :public | :private | :private | :admin | true | 1\n :public | :private | :private | :admin | false | 0\n :public | :private | :private | :reporter | nil | 1\n :public | :private | :private | :guest | nil | 1\n :public | :private | :private | :non_member | nil | 0\n :public | :private | :private | :anonymous | nil | 0\n\n :public | :private | :disabled | :admin | true | 1\n :public | :private | :disabled | :admin | false | 0\n :public | :private | :disabled | :reporter | nil | 1\n :public | :private | :disabled | :guest | nil | 1\n :public | :private | :disabled | :non_member | nil | 0\n :public | :private | :disabled | :anonymous | nil | 0\n\n :public | :disabled | :enabled | :admin | true | 1\n :public | :disabled | :enabled | :admin | false | 1\n :public | :disabled | :enabled | :reporter | nil | 1\n :public | :disabled | :enabled | :guest | nil | 1\n :public | :disabled | :enabled | :non_member | nil | 1\n :public | :disabled | :enabled | :anonymous | nil | 1\n\n :public | :disabled | :private | :admin | true | 1\n :public | :disabled | :private | :admin | false | 0\n :public | :disabled | :private | :reporter | nil | 1\n :public | :disabled | :private | :guest | nil | 0\n :public | :disabled | :private | :non_member | nil | 0\n :public | :disabled | :private | :anonymous | nil | 0\n\n :public | :disabled | :disabled | :reporter | nil | 0\n :public | :disabled | :disabled | :guest | nil | 0\n :public | :disabled | :disabled | :non_member | nil | 0\n :public | :disabled | :disabled | :anonymous | nil | 0\n\n :internal | :enabled | :enabled | :admin | true | 1\n :internal | :enabled | :enabled | :admin | false | 1\n :internal | :enabled | :enabled | :reporter | nil | 1\n :internal | :enabled | :enabled | :guest | nil | 1\n :internal | :enabled | :enabled | :non_member | nil | 1\n :internal | :enabled | :enabled | :anonymous | nil | 0\n\n :internal | :enabled | :private | :admin | true | 1\n :internal | :enabled | :private | :admin | false | 1\n :internal | :enabled | :private | :reporter | nil | 1\n :internal | :enabled | :private | :guest | nil | 1\n :internal | :enabled | :private | :non_member | nil | 1\n :internal | :enabled | :private | :anonymous | nil | 0\n\n :internal | :enabled | :disabled | :admin | true | 1\n :internal | :enabled | :disabled | :admin | false | 1\n :internal | :enabled | :disabled | :reporter | nil | 1\n :internal | :enabled | :disabled | :guest | nil | 1\n :internal | :enabled | :disabled | :non_member | nil | 1\n :internal | :enabled | :disabled | :anonymous | nil | 0\n\n :internal | :private | :enabled | :admin | true | 1\n :internal | :private | :enabled | :admin | false | 1\n :internal | :private | :enabled | :reporter | nil | 1\n :internal | :private | :enabled | :guest | nil | 1\n :internal | :private | :enabled | :non_member | nil | 1\n :internal | :private | :enabled | :anonymous | nil | 0\n\n :internal | :private | :private | :admin | true | 1\n :internal | :private | :private | :admin | false | 0\n :internal | :private | :private | :reporter | nil | 1\n :internal | :private | :private | :guest | nil | 1\n :internal | :private | :private | :non_member | nil | 0\n :internal | :private | :private | :anonymous | nil | 0\n\n :internal | :private | :disabled | :admin | true | 1\n :internal | :private | :disabled | :admin | false | 0\n :internal | :private | :disabled | :reporter | nil | 1\n :internal | :private | :disabled | :guest | nil | 1\n :internal | :private | :disabled | :non_member | nil | 0\n :internal | :private | :disabled | :anonymous | nil | 0\n\n :internal | :disabled | :enabled | :admin | true | 1\n :internal | :disabled | :enabled | :admin | false | 1\n :internal | :disabled | :enabled | :reporter | nil | 1\n :internal | :disabled | :enabled | :guest | nil | 1\n :internal | :disabled | :enabled | :non_member | nil | 1\n :internal | :disabled | :enabled | :anonymous | nil | 0\n\n :internal | :disabled | :private | :admin | true | 1\n :internal | :disabled | :private | :admin | false | 0\n :internal | :disabled | :private | :reporter | nil | 1\n :internal | :disabled | :private | :guest | nil | 0\n :internal | :disabled | :private | :non_member | nil | 0\n :internal | :disabled | :private | :anonymous | nil | 0\n\n :internal | :disabled | :disabled | :reporter | nil | 0\n :internal | :disabled | :disabled | :guest | nil | 0\n :internal | :disabled | :disabled | :non_member | nil | 0\n :internal | :disabled | :disabled | :anonymous | nil | 0\n\n :private | :private | :private | :admin | true | 1\n :private | :private | :private | :admin | false | 0\n :private | :private | :private | :reporter | nil | 1\n :private | :private | :private | :guest | nil | 1\n :private | :private | :private | :non_member | nil | 0\n :private | :private | :private | :anonymous | nil | 0\n\n :private | :private | :disabled | :admin | true | 1\n :private | :private | :disabled | :admin | false | 0\n :private | :private | :disabled | :reporter | nil | 1\n :private | :private | :disabled | :guest | nil | 1\n :private | :private | :disabled | :non_member | nil | 0\n :private | :private | :disabled | :anonymous | nil | 0\n\n :private | :disabled | :private | :admin | true | 1\n :private | :disabled | :private | :admin | false | 0\n :private | :disabled | :private | :reporter | nil | 1\n :private | :disabled | :private | :guest | nil | 0\n :private | :disabled | :private | :non_member | nil | 0\n :private | :disabled | :private | :anonymous | nil | 0\n\n :private | :disabled | :disabled | :reporter | nil | 0\n :private | :disabled | :disabled | :guest | nil | 0\n :private | :disabled | :disabled | :non_member | nil | 0\n :private | :disabled | :disabled | :anonymous | nil | 0\n end",
"title": ""
},
{
"docid": "fcc2f8b89d1819fc8bc459e8231ae953",
"score": "0.5701989",
"text": "def authorize\n\t\t!@user_group_permissions.blank?\n\tend",
"title": ""
},
{
"docid": "a4f434a97b4bcd5d6f47112075244002",
"score": "0.5698762",
"text": "def permission_check\n raise ActiveRecord::RecordNotFound if !current_user.events_section?\n raise ApiAccessEvanta::PermissionDenied if !current_user.event_evaluations? || current_user.user_role != @event_evaluation.user_role\n end",
"title": ""
},
{
"docid": "c599110e9c142d4c3324746d59e5e4bc",
"score": "0.5695126",
"text": "def permissions_all_trackers?(permission)\n return false unless has_permission?(permission)\n\n permissions_all_trackers[permission.to_s].to_s != '0'\n end",
"title": ""
},
{
"docid": "70493df550ab75e4c417eeef61e50038",
"score": "0.5692801",
"text": "def grand_basic_permissions\n remove_permissions\n \n self.create_recording = true\n self.read_recording = true\n self.update_recording = true\n self.delete_recording = true\n \n self.create_recording_ipi = true \n self.read_recording_ipi = true \n self.update_recording_ipi = true \n self.delete_recording_ipi = true \n \n #self.create_common_work = true\n # self.read_common_work = true\n #self.update_common_work = true\n #self.delete_common_work = true\n \n self.create_common_work_ipi = true \n self.read_common_work_ipi = true \n self.update_common_work_ipi = true \n self.delete_common_work_ipi = true \n \n self.create_file = true \n self.read_file = true \n self.update_file = true \n self.delete_file = true \n \n self.create_playlist = true \n self.read_playlist = true \n self.update_playlist = true \n self.delete_playlist = true \n \n self.create_artwork = true\n self.read_artwork = true\n self.update_artwork = true \n self.delete_artwork = true \n \n #self.create_opportunity = true \n self.read_opportunity = true \n #self.update_opportunity = true \n #self.delete_opportunity = true\n \n #self.read_catalog = true\n #self.update_catalog = true\n \n self.save!\n \n end",
"title": ""
},
{
"docid": "8912a0f03f075865268193a47040cf3b",
"score": "0.568912",
"text": "def test_fav_groups_permissions\n temp = sops(:sop_with_download_for_all_sysmo_users_policy).policy.use_allowlist\n assert !temp, \"policy for test SOP shouldn't use allowlist\"\n\n temp = sops(:sop_with_download_for_all_sysmo_users_policy).policy.use_denylist\n assert !temp, \"policy for test SOP shouldn't use denylist\"\n\n # editing is not allowed by policy (only download is)\n temp = temp_authorized_by_policy?(sops(:sop_with_download_for_all_sysmo_users_policy).policy, sops(:sop_with_download_for_all_sysmo_users_policy), 'edit',\n users(:owner_of_my_first_sop), users(:owner_of_my_first_sop).person)\n assert !temp, \"policy of the test SOP shouldn't have allowed 'edit' of that asset\"\n\n # verify that no individual permissions for the user exist..\n permissions = temp_get_person_permissions(users(:owner_of_my_first_sop).person, sops(:sop_with_download_for_all_sysmo_users_policy).policy)\n assert permissions.length == 0, \"expected to have no permission in that policy for the test person, not #{permissions.length}\"\n\n # ..check that sharing with favourite group gives some access to this person..\n permissions = temp_get_person_access_rights_from_favourite_group_permissions(users(:owner_of_my_first_sop).person, sops(:sop_with_download_for_all_sysmo_users_policy).policy)\n assert permissions.length == 1, \"expected to have one permission from favourite groups in that policy for the test person, not #{permissions.length}\"\n assert permissions[0].access_type == Policy::EDITING, 'expected that the permission would give the test user access to the test SOP for editing'\n\n # ..and now verify that permissions from favourite groups are actually used\n res = Seek::Permissions::Authorization.is_authorized?('edit', sops(:sop_with_download_for_all_sysmo_users_policy), users(:owner_of_my_first_sop))\n assert res, \"test user should have been allowed to 'edit' the SOP - because of favourite group membership and permissions\"\n end",
"title": ""
},
{
"docid": "70ac3286bc6510fa62ee723788b636e7",
"score": "0.56759936",
"text": "def test_q14_d_all\n test_agreement = create_test_agreement\n params = HashWithIndifferentAccess.new\n params[:q14] = 'd'\n params[:q14_d_a] = \"true\"\n params[:q14_d_b] = \"true\"\n params[:q14_d_c] = \"true\"\n\n form_processor = Manuscripts.new\n form_processor.process_question(test_agreement.agreementid.to_i, '14', params, 'UNIT_TESTING')\n\n permissions = test_agreement.active_permissions\n\n # Check Permissions created\n assert_equal 3, permissions.length, \"Incorrect number of permissions created\"\n assert_equal 3, form_processor.permission_count, \"Incorrect count of permissions on form processor\"\n\n #Check Permissions match rules\n assert_equal 1, permissions.select{|p| p.rule==\"r31\"}.length, \"Incorrect rule created\"\n assert_equal 1, permissions.select{|p| p.rule==\"r32\"}.length, \"Incorrect rule created\"\n assert_equal 1, permissions.select{|p| p.rule==\"r33\"}.length, \"Incorrect rule created\"\n end",
"title": ""
},
{
"docid": "19e6d7bb57e25679da0ae19eaf651637",
"score": "0.5666199",
"text": "def test_general_policy_settings_action_allowed\n # check that no permissions will be used..\n temp = sops(:sop_with_fully_public_policy).policy.use_allowlist\n assert !temp, \"'use_allowlist' flag should be set to 'false' for this test\"\n\n temp = sops(:sop_with_fully_public_policy).policy.use_denylist\n assert !temp, \"'use_denylist' flag should be set to 'false' for this test\"\n\n group_permissions = temp_get_group_permissions(sops(:sop_with_fully_public_policy).policy)\n assert group_permissions.empty?, 'there should be no group permissions for this policy'\n\n person_permissions = temp_get_person_permissions(users(:owner_of_my_first_sop).person, sops(:sop_with_fully_public_policy).policy)\n assert person_permissions.empty?, 'there should be no person permissions for this policy'\n\n # ..all flags are checked to 'false'; only policy settings will be used\n res = Seek::Permissions::Authorization.is_authorized?('edit', sops(:sop_with_fully_public_policy), users(:sysmo_user_who_wants_to_access_different_things))\n assert res, \"test user should have been allowed to 'edit' the SOP - it uses fully public policy\"\n end",
"title": ""
},
{
"docid": "e3163702bb44885d57f5cb21954ed257",
"score": "0.5657837",
"text": "def check_permission_list(l,first_entry)\n @user = User.current\n log_projects = Project.find(:all, :order => 'name',:conditions => Project.allowed_to_condition(@user, :log_time))\n\n members = []\n permissions = []\n log_projects.each { |rec| members << rec.member_principals.find_by_user_id(User.current.id) }\n members.flatten.each do |rec|\n rec.member_roles.each { |rec| permissions << rec.role.permissions } if rec.present?\n end\n\n if permissions.flatten.present? && (permissions.flatten.include?(l.to_sym) || permissions.flatten.include?(l.to_sym))\n return true\n else\n return false\n end\n end",
"title": ""
},
{
"docid": "33f0cfc7a84e12b566b4d7a9c25fcdda",
"score": "0.5652303",
"text": "def can_perform( ctrl_name, action_name )\n row = AppParameter.where( \"code >= #{AppParameter::PARAM_BLACKLIST_ACCESS_START} and code <= #{AppParameter::PARAM_BLACKLIST_ACCESS_END} and controller_name='#{ctrl_name}' and action_name='#{action_name}'\" ).first\n if ( row )\n# DEBUG\n# puts \"=> [#{self.name}] can_perform( #{ctrl_name}, #{action_name} )? #{(self.authorization_level >= row.a_integer)}.\\r\\n\"\n return ( self.authorization_level >= row.a_integer )\n else\n# DEBUG\n# puts \"=> [#{self.name}] can_perform( #{ctrl_name}, #{action_name} )? No restrictions found.\\r\\n\"\n return true\n end\n end",
"title": ""
},
{
"docid": "7292c094db953dc9e1a6321d14e369a0",
"score": "0.56472653",
"text": "def check_resource_permissions( request, uuid=nil, metadata=nil ); end",
"title": ""
},
{
"docid": "0dd83a368b89bca5b74f61656b54d58b",
"score": "0.56370914",
"text": "def test_fav_groups_permissions\n temp = sops(:sop_with_download_for_all_sysmo_users_policy).policy.use_whitelist\n assert !temp, \"policy for test SOP shouldn't use whitelist\"\n \n temp = sops(:sop_with_download_for_all_sysmo_users_policy).policy.use_blacklist\n assert !temp, \"policy for test SOP shouldn't use blacklist\"\n \n # editing is not allowed by policy (only download is)\n temp = temp_authorized_by_policy?(sops(:sop_with_download_for_all_sysmo_users_policy).policy, sops(:sop_with_download_for_all_sysmo_users_policy), \"edit\",\n users(:owner_of_my_first_sop), users(:owner_of_my_first_sop).person)\n assert !temp, \"policy of the test SOP shouldn't have allowed 'edit' of that asset\"\n\n # verify that no individual permissions for the user exist..\n permissions = temp_get_person_permissions(users(:owner_of_my_first_sop).person, sops(:sop_with_download_for_all_sysmo_users_policy).policy)\n assert permissions.length == 0, \"expected to have no permission in that policy for the test person, not #{permissions.length}\"\n \n # ..check that sharing with favourite group gives some access to this person..\n permissions = temp_get_person_access_rights_from_favourite_group_permissions(users(:owner_of_my_first_sop).person, sops(:sop_with_download_for_all_sysmo_users_policy).policy)\n assert permissions.length == 1, \"expected to have one permission from favourite groups in that policy for the test person, not #{permissions.length}\"\n assert permissions[0].access_type == Policy::EDITING, \"expected that the permission would give the test user access to the test SOP for editing\"\n \n # ..and now verify that permissions from favourite groups are actually used\n res = Seek::Permissions::Authorization.is_authorized?(\"edit\", nil, sops(:sop_with_download_for_all_sysmo_users_policy), users(:owner_of_my_first_sop))\n assert res, \"test user should have been allowed to 'edit' the SOP - because of favourite group membership and permissions\"\n end",
"title": ""
},
{
"docid": "34db3b7a7c2ff3fdc06ab7c26f41893d",
"score": "0.5622524",
"text": "def core_controlPermission(permission)\n user = core_getCurrentUser\n user && user.permission >= permission\n end",
"title": ""
},
{
"docid": "318e326d0adfc63a010f68ec3119be8e",
"score": "0.56157124",
"text": "def permission_table_for_reporter_feature_access\n :public | :enabled | :admin | true | 1\n :public | :enabled | :admin | false | 1\n :public | :enabled | :reporter | nil | 1\n :public | :enabled | :guest | nil | 1\n :public | :enabled | :non_member | nil | 1\n :public | :enabled | :anonymous | nil | 1\n\n :public | :private | :admin | true | 1\n :public | :private | :admin | false | 0\n :public | :private | :reporter | nil | 1\n :public | :private | :guest | nil | 0\n :public | :private | :non_member | nil | 0\n :public | :private | :anonymous | nil | 0\n\n :public | :disabled | :reporter | nil | 0\n :public | :disabled | :guest | nil | 0\n :public | :disabled | :non_member | nil | 0\n :public | :disabled | :anonymous | nil | 0\n\n :internal | :enabled | :admin | true | 1\n :internal | :enabled | :admin | false | 1\n :internal | :enabled | :reporter | nil | 1\n :internal | :enabled | :guest | nil | 1\n :internal | :enabled | :non_member | nil | 1\n :internal | :enabled | :anonymous | nil | 0\n\n :internal | :private | :admin | true | 1\n :internal | :private | :admin | false | 0\n :internal | :private | :reporter | nil | 1\n :internal | :private | :guest | nil | 0\n :internal | :private | :non_member | nil | 0\n :internal | :private | :anonymous | nil | 0\n\n :internal | :disabled | :reporter | nil | 0\n :internal | :disabled | :guest | nil | 0\n :internal | :disabled | :non_member | nil | 0\n :internal | :disabled | :anonymous | nil | 0\n\n :private | :private | :admin | true | 1\n :private | :private | :admin | false | 0\n :private | :private | :reporter | nil | 1\n :private | :private | :guest | nil | 0\n :private | :private | :non_member | nil | 0\n :private | :private | :anonymous | nil | 0\n\n :private | :disabled | :reporter | nil | 0\n :private | :disabled | :guest | nil | 0\n :private | :disabled | :non_member | nil | 0\n :private | :disabled | :anonymous | nil | 0\n end",
"title": ""
},
{
"docid": "296517b6716066776cc30fe05a7bbf8b",
"score": "0.5615072",
"text": "def can_grant?(existing, perm_to_be_granted)\n existing = validate_perm(existing)\n\n return true if dependencies[perm_to_be_granted].empty?\n\n # required dependencies matchs with existing substracting returns empty array\n # ['view'] - ['view'] = [] Dependency is met\n # ['view'] - [] = ['view'] Dependency is not met\n # ['view', 'edit'] - ['view'] = ['edit'] Dependency is not met\n # ['view'] - ['view', 'edit'] = [] Dependency is met\n (dependencies[perm_to_be_granted] - existing).empty?\n end",
"title": ""
},
{
"docid": "105d2f24827ead157d226c84bc1b4d20",
"score": "0.56090754",
"text": "def permissions\n Permission.scoped(:joins => {:grants => {:role => {:privileges => :user}}}, :conditions => ['shell_users.User_ID = ?',id])\n end",
"title": ""
},
{
"docid": "63af8270f8d77dbf6ddb46a69ffc19d2",
"score": "0.56020993",
"text": "def test_q14_d_none\n test_agreement = create_test_agreement\n params = HashWithIndifferentAccess.new\n params[:q14] = 'd'\n\n form_processor = Manuscripts.new\n form_processor.process_question(test_agreement.agreementid.to_i, '14', params, 'UNIT_TESTING')\n\n permissions = test_agreement.active_permissions\n\n # Check Permissions created\n assert_equal 3, permissions.length, \"Incorrect number of permissions created\"\n assert_equal 3, form_processor.permission_count, \"Incorrect count of permissions on form processor\"\n\n #Check Permissions match rules\n assert_equal 1, permissions.select{|p| p.rule==\"r49\"}.length, \"Incorrect rule created\"\n assert_equal 1, permissions.select{|p| p.rule==\"r50\"}.length, \"Incorrect rule created\"\n assert_equal 1, permissions.select{|p| p.rule==\"r51\"}.length, \"Incorrect rule created\"\n end",
"title": ""
},
{
"docid": "8f1b2bb5b216529ff574a3c3af4adb41",
"score": "0.55936533",
"text": "def check_permissions!\n # Check if you are an admin\n vprint_status('Checking admin status...')\n admin_group = is_in_admin_group?\n\n if admin_group.nil?\n print_error('Either whoami is not there or failed to execute')\n print_error('Continuing under assumption you already checked...')\n else\n if admin_group\n print_good('Part of Administrators group! Continuing...')\n else\n fail_with(Failure::NoAccess, 'Not in admins group, cannot escalate with this module')\n end\n end\n\n if get_integrity_level == INTEGRITY_LEVEL_SID[:low]\n fail_with(Failure::NoAccess, 'Cannot BypassUAC from Low Integrity Level')\n end\n end",
"title": ""
},
{
"docid": "415e0c9b61b89807f44094e29427c4b7",
"score": "0.55824935",
"text": "def only_permission_to?(*levels)\n if permissions - levels == []\n return true\n else\n return false\n end\n end",
"title": ""
},
{
"docid": "c520bff0d936c530c58e65887aff6d1c",
"score": "0.5573691",
"text": "def test_general_policy_settings_action_allowed\n # check that no permissions will be used..\n temp = sops(:sop_with_fully_public_policy).policy.use_whitelist\n assert !temp, \"'use_whitelist' flag should be set to 'false' for this test\"\n \n temp = sops(:sop_with_fully_public_policy).policy.use_blacklist\n assert !temp, \"'use_blacklist' flag should be set to 'false' for this test\"\n \n group_permissions = temp_get_group_permissions(sops(:sop_with_fully_public_policy).policy)\n assert group_permissions.empty?, 'there should be no group permissions for this policy'\n\n person_permissions = temp_get_person_permissions(users(:owner_of_my_first_sop).person, sops(:sop_with_fully_public_policy).policy)\n assert person_permissions.empty?, 'there should be no person permissions for this policy'\n\n # ..all flags are checked to 'false'; only policy settings will be used\n res = Seek::Permissions::Authorization.is_authorized?(\"edit\", nil, sops(:sop_with_fully_public_policy), users(:sysmo_user_who_wants_to_access_different_things))\n assert res, \"test user should have been allowed to 'edit' the SOP - it uses fully public policy\"\n end",
"title": ""
},
{
"docid": "62876723826fe0e9a5e256790bc4d85f",
"score": "0.5571431",
"text": "def enforce_permissions\n controller_permissions.each do |permission|\n all_parameters = []\n permission.each do |p|\n check_format(p)\n parameter = {}\n parameter[:roles] = add_roles(p)\n parameter[:options] = (reformat_options(p[:options]) if p[:options]) || {}\n all_parameters << parameter\n end\n all_parameters.each{|param| self.require_role(param[:roles], param[:options]) \\\n if param[:roles]}\n end\n end",
"title": ""
},
{
"docid": "510821e161e8928c7792199fc74d0371",
"score": "0.5568594",
"text": "def grants_to_apply\n sort(requested_with_admin_flag - existing_with_admin_flag)\n end",
"title": ""
},
{
"docid": "65aab641eed4b5a251fee16e60623510",
"score": "0.55670244",
"text": "def make_datasets(category)\n accessLevelPresent = AccessLevel.make(category)\n accessLevelAbsent = AccessLevel.make(category)\n @user.permissions(category).create(:datasetID => accessLevelPresent.datasetID, :permissionvalue => 1)\n \n @user.permissions(category).where(:datasetID => accessLevelPresent.datasetID).should_not be_empty\n @user.permissions(category).where(:datasetID => accessLevelAbsent.datasetID).should be_empty\n\n {:present => accessLevelPresent, :absent => accessLevelAbsent}\n end",
"title": ""
},
{
"docid": "91c6afe901515f0ebd16f5115f73a21e",
"score": "0.55647624",
"text": "def test_q23_e_all\n test_agreement = create_test_agreement\n params = HashWithIndifferentAccess.new\n params[:q23] = 'e'\n params[:q23_e_a] = \"true\"\n params[:q23_e_b] = \"true\"\n params[:q23_e_c] = \"true\"\n\n form_processor = Multi.new\n form_processor.process_question(test_agreement.agreementid.to_i, '23', params, 'UNIT_TESTING')\n\n permissions = test_agreement.active_permissions\n\n # Check Permissions created\n assert_equal 3, permissions.length, \"Incorrect number of permissions created\"\n assert_equal 3, form_processor.permission_count, \"Incorrect count of permissions on form processor\"\n\n #Check Permissions match rules\n assert_equal 1, permissions.select{|p| p.rule==\"r31\"}.length, \"Incorrect rule created\"\n assert_equal 1, permissions.select{|p| p.rule==\"r32\"}.length, \"Incorrect rule created\"\n assert_equal 1, permissions.select{|p| p.rule==\"r33\"}.length, \"Incorrect rule created\"\n end",
"title": ""
},
{
"docid": "2315302d36e5c37f3411628c6438846e",
"score": "0.55613524",
"text": "def has_permission?(level)\n permissions.include? level.to_s\n end",
"title": ""
},
{
"docid": "bdd983955aa38f24b5e0b67eee4f806e",
"score": "0.55609936",
"text": "def permission_table_for_guest_feature_access_and_non_private_project_only\n :public | :enabled | :admin | true | 1\n :public | :enabled | :admin | false | 1\n :public | :enabled | :reporter | nil | 1\n :public | :enabled | :guest | nil | 1\n :public | :enabled | :non_member | nil | 1\n :public | :enabled | :anonymous | nil | 1\n\n :public | :private | :admin | true | 1\n :public | :private | :admin | false | 0\n :public | :private | :reporter | nil | 1\n :public | :private | :guest | nil | 1\n :public | :private | :non_member | nil | 0\n :public | :private | :anonymous | nil | 0\n\n :public | :disabled | :reporter | nil | 0\n :public | :disabled | :guest | nil | 0\n :public | :disabled | :non_member | nil | 0\n :public | :disabled | :anonymous | nil | 0\n\n :internal | :enabled | :admin | true | 1\n :internal | :enabled | :admin | false | 1\n :internal | :enabled | :reporter | nil | 1\n :internal | :enabled | :guest | nil | 1\n :internal | :enabled | :non_member | nil | 1\n :internal | :enabled | :anonymous | nil | 0\n\n :internal | :private | :admin | true | 1\n :internal | :private | :admin | false | 0\n :internal | :private | :reporter | nil | 1\n :internal | :private | :guest | nil | 1\n :internal | :private | :non_member | nil | 0\n :internal | :private | :anonymous | nil | 0\n\n :internal | :disabled | :reporter | nil | 0\n :internal | :disabled | :guest | nil | 0\n :internal | :disabled | :non_member | nil | 0\n :internal | :disabled | :anonymous | nil | 0\n\n :private | :private | :admin | true | 1\n :private | :private | :admin | false | 0\n :private | :private | :reporter | nil | 1\n :private | :private | :guest | nil | 0\n :private | :private | :non_member | nil | 0\n :private | :private | :anonymous | nil | 0\n\n :private | :disabled | :reporter | nil | 0\n :private | :disabled | :guest | nil | 0\n :private | :disabled | :non_member | nil | 0\n :private | :disabled | :anonymous | nil | 0\n end",
"title": ""
},
{
"docid": "257cfdc08592f3aa312ce7c485cfb98c",
"score": "0.55579245",
"text": "def test_q23_e_none\n test_agreement = create_test_agreement\n params = HashWithIndifferentAccess.new\n params[:q23] = 'e'\n\n form_processor = Multi.new\n form_processor.process_question(test_agreement.agreementid.to_i, '23', params, 'UNIT_TESTING')\n\n permissions = test_agreement.active_permissions\n\n # Check Permissions created\n assert_equal 3, permissions.length, \"Incorrect number of permissions created\"\n assert_equal 3, form_processor.permission_count, \"Incorrect count of permissions on form processor\"\n\n #Check Permissions match rules\n assert_equal 1, permissions.select{|p| p.rule==\"r49\"}.length, \"Incorrect rule created\"\n assert_equal 1, permissions.select{|p| p.rule==\"r50\"}.length, \"Incorrect rule created\"\n assert_equal 1, permissions.select{|p| p.rule==\"r51\"}.length, \"Incorrect rule created\"\n end",
"title": ""
},
{
"docid": "800550b6510a97eea4f19142d30535a3",
"score": "0.55575573",
"text": "def results_with_permissions_query\n # We're going to use the permissible_assignments_query above as a\n # sub-query so let's wrap it in an alias/reference\n permissible_assignments_as_table = reference_query_as_table(\n permissible_assignments_query,\n table[:permissible_assignments].name\n )\n\n ObjectsPermissibleByRequiredPermissionsQuery.new(\n klass: @klass,\n assignments_table: permissible_assignments_as_table,\n objects_query: objects_via_authorizations_query\n )\n end",
"title": ""
},
{
"docid": "44ce73db89c10ccfbc1ef2db579505c4",
"score": "0.5554549",
"text": "def permissions\n @permissions = (@item.id == 1) ?\n CustomizableAdmin::Settings::Permission.\n where(\"#{CustomizableAdmin::Settings::Permission.table_name}.id=1\") :\n CustomizableAdmin::Settings::Permission.\n where(\"#{CustomizableAdmin::Settings::Permission.table_name}.id!=1\")\n end",
"title": ""
},
{
"docid": "bf72e6ab5ab682df8cb9bac60b08e67c",
"score": "0.55445844",
"text": "def prevalidate\n valid_permission? && valid_data?\n errors\n end",
"title": ""
},
{
"docid": "acec7d01148fe5dc202957d8b16e1207",
"score": "0.55430543",
"text": "def permitted?(resource, permissions)\n allow = false\n permissions.each do |permission|\n if permission.deny\n # NOTE: permissions with higher sequence will override this, so deny permissions should have highest sequence\n allow = false if compare(resource, permission.resource)\n else\n allow ||= compare(resource, permission.resource)\n end\n end\n allow\n end",
"title": ""
},
{
"docid": "b63bf2505a4d86c9072152fa53bee62b",
"score": "0.5538519",
"text": "def ensure_rights_values_compatible\n if @rights.include?(:mask_specific) && rights.count != 1\n raise ArgumentError, \"In each ace, when specifying rights, if you include 'mask_specific', it should be without anything else e.g. rights => ['mask_specific']. Please decide whether 'mask_specific' or predetermined rights and correct the manifest. Reference: #{inspect}\" # rubocop:disable Layout/LineLength\n end\n\n if @rights.include?(:full) && rights.count != 1\n Puppet.warning(\"In each ace, when specifying rights, if you include 'full', it should be without anything else e.g. rights => ['full']. Please remove the extraneous rights from the manifest to remove this warning. Reference: #{inspect}\") # rubocop:disable Layout/LineLength\n @rights = [:full]\n end\n if @rights.include?(:modify) && rights.count != 1 # rubocop:disable Style/GuardClause Changing this to a guard clause makes the line long and unreadable\n Puppet.warning(\"In each ace, when specifying rights, if you include 'modify', it should be without anything else e.g. rights => ['modify']. Please remove the extraneous rights from the manifest to remove this warning. Reference: #{inspect}\") # rubocop:disable Layout/LineLength\n @rights = [:modify]\n end\n end",
"title": ""
},
{
"docid": "64112f61a0b6a1dd4bc2b2de0a9af803",
"score": "0.55334926",
"text": "def test_q14_d_ab\n test_agreement = create_test_agreement\n params = HashWithIndifferentAccess.new\n params[:q14] = 'd'\n params[:q14_d_a] = \"true\"\n params[:q14_d_b] = \"true\"\n\n form_processor = Manuscripts.new\n form_processor.process_question(test_agreement.agreementid.to_i, '14', params, 'UNIT_TESTING')\n\n permissions = test_agreement.active_permissions\n\n # Check Permissions created\n assert_equal 3, permissions.length, \"Incorrect number of permissions created\"\n assert_equal 3, form_processor.permission_count, \"Incorrect count of permissions on form processor\"\n\n #Check Permissions match rules\n assert_equal 1, permissions.select{|p| p.rule==\"r31\"}.length, \"Incorrect rule created\"\n assert_equal 1, permissions.select{|p| p.rule==\"r32\"}.length, \"Incorrect rule created\"\n assert_equal 1, permissions.select{|p| p.rule==\"r51\"}.length, \"Incorrect rule created\"\n end",
"title": ""
},
{
"docid": "bd9cc8f9a6e4b35d32b76f56583c9b10",
"score": "0.5531602",
"text": "def test_person_in_both_whitelist_and_blacklist\n # this is mainly to test that blacklist takes precedence over the whitelist\n \n temp = sops(:sop_with_all_sysmo_users_policy).policy.use_whitelist\n assert temp, \"'use_whitelist' flag should have been set to 'true' for this test\"\n \n temp = sops(:sop_with_all_sysmo_users_policy).policy.use_blacklist\n assert temp, \"'use_blacklist' flag should have been set to 'true' for this test\"\n \n temp = Seek::Permissions::Authorization.is_person_in_blacklist?(users(:sysmo_user_both_in_blacklist_and_whitelist).person, sops(:sop_with_all_sysmo_users_policy).contributor)\n assert temp, \"test person should have been in the blacklist of the sop owner\"\n \n temp = Seek::Permissions::Authorization.is_person_in_whitelist?(users(:sysmo_user_both_in_blacklist_and_whitelist).person, sops(:sop_with_all_sysmo_users_policy).contributor)\n assert temp, \"test person should have been in the whitelist of the sop owner\"\n \n temp = temp_authorized_by_policy?(sops(:sop_with_all_sysmo_users_policy).policy, sops(:sop_with_all_sysmo_users_policy), \"edit\", \n users(:sysmo_user_both_in_blacklist_and_whitelist), users(:sysmo_user_both_in_blacklist_and_whitelist).person)\n assert temp, \"test user is SysMO user and should have been authorized by policy\"\n \n res = Seek::Permissions::Authorization.is_authorized?(\"view\", nil, sops(:sop_with_all_sysmo_users_policy), users(:sysmo_user_both_in_blacklist_and_whitelist))\n end",
"title": ""
},
{
"docid": "a80ebe2b8984f1684aab7adf7ad7bd25",
"score": "0.55279934",
"text": "def dc_user_can(permission, table = params[:table])\r\n table = table.underscore\r\n cache_key = ['dc_permission', table, dc_get_site.id]\r\n permissions = DrgCms.cache_read(cache_key)\r\n if permissions.nil?\r\n permissions = DcPermission.permissions_for_table(table)\r\n DrgCms.cache_write(cache_key, permissions)\r\n end\r\n return false if session[:user_roles].nil?\r\n\r\n session[:user_roles].inject(false) { |r, rule| break true if permissions[rule] && permissions[rule] >= permission }\r\nend",
"title": ""
},
{
"docid": "855224f924d238db1878c50ec3ad705d",
"score": "0.5523714",
"text": "def permission_table_for_guest_feature_access\n :public | :enabled | :admin | true | 1\n :public | :enabled | :admin | false | 1\n :public | :enabled | :reporter | nil | 1\n :public | :enabled | :guest | nil | 1\n :public | :enabled | :non_member | nil | 1\n :public | :enabled | :anonymous | nil | 1\n\n :public | :private | :admin | true | 1\n :public | :private | :admin | false | 0\n :public | :private | :reporter | nil | 1\n :public | :private | :guest | nil | 1\n :public | :private | :non_member | nil | 0\n :public | :private | :anonymous | nil | 0\n\n :public | :disabled | :reporter | nil | 0\n :public | :disabled | :guest | nil | 0\n :public | :disabled | :non_member | nil | 0\n :public | :disabled | :anonymous | nil | 0\n\n :internal | :enabled | :admin | true | 1\n :internal | :enabled | :admin | false | 1\n :internal | :enabled | :reporter | nil | 1\n :internal | :enabled | :guest | nil | 1\n :internal | :enabled | :non_member | nil | 1\n :internal | :enabled | :anonymous | nil | 0\n\n :internal | :private | :admin | true | 1\n :internal | :private | :admin | false | 0\n :internal | :private | :reporter | nil | 1\n :internal | :private | :guest | nil | 1\n :internal | :private | :non_member | nil | 0\n :internal | :private | :anonymous | nil | 0\n\n :internal | :disabled | :reporter | nil | 0\n :internal | :disabled | :guest | nil | 0\n :internal | :disabled | :non_member | nil | 0\n :internal | :disabled | :anonymous | nil | 0\n\n :private | :private | :admin | true | 1\n :private | :private | :admin | false | 0\n :private | :private | :reporter | nil | 1\n :private | :private | :guest | nil | 1\n :private | :private | :non_member | nil | 0\n :private | :private | :anonymous | nil | 0\n\n :private | :disabled | :reporter | nil | 0\n :private | :disabled | :guest | nil | 0\n :private | :disabled | :non_member | nil | 0\n :private | :disabled | :anonymous | nil | 0\n end",
"title": ""
},
{
"docid": "3e26ad3b65e0540f7e7265a70477aed8",
"score": "0.55234903",
"text": "def create_permission_mask_for(permissions, operations)\n bits = 0\n return bits if permissions.nil?\n\n permissions.each do |permission|\n index = operations.index(permission.to_sym)\n puts \"#{permission} operation not found\" if index.nil?\n bits |= ( 1 << index ) unless index.nil?\n end\n return bits\nend",
"title": ""
},
{
"docid": "caa3b3ecd784fcbed6176fe87cccd08c",
"score": "0.5520392",
"text": "def authorization_permissions user=User.current_user\n @@expected_true_value ||= ActiveRecord::Base.connection.quoted_true.gsub(\"'\",\"\")\n permissions = AuthPermissions.new\n user_id = user.nil? ? 0 : user.id\n if Seek::Config.auth_lookup_enabled && self.class.lookup_table_consistent?(user_id)\n sql = \"SELECT can_view,can_edit,can_download,can_manage,can_delete FROM #{self.class.lookup_table_name} WHERE user_id=#{user_id} AND asset_id=#{self.id}\"\n res = ActiveRecord::Base.connection.select_one(sql)\n unless res.nil?\n permissions.can_view = res[\"can_view\"].to_s==@@expected_true_value && state_allows_manage?(user)\n permissions.can_download = res[\"can_download\"].to_s==@@expected_true_value && state_allows_manage?(user)\n permissions.can_edit = res[\"can_edit\"].to_s==@@expected_true_value && state_allows_manage?(user)\n permissions.can_manage = res[\"can_manage\"].to_s==@@expected_true_value && state_allows_manage?(user)\n permissions.can_delete = res[\"can_delete\"].to_s==@@expected_true_value && state_allows_manage?(user)\n else\n raise \"Expected to find record in auth lookup table\"\n end\n else\n permissions.can_view = self.can_view?\n permissions.can_download = self.can_download?\n permissions.can_edit = self.can_edit?\n permissions.can_manage = self.can_manage?\n permissions.can_delete = self.can_delete?\n end\n permissions\n end",
"title": ""
},
{
"docid": "1ef0bbf9f9dd4d9df9d0d27957d2bd47",
"score": "0.55159044",
"text": "def create_permission_mask_for(permissions, operations)\n bits = 0\n return bits if permissions.nil?\n\n permissions.each do |permission|\n index = operations.index(permission.to_sym)\n puts \"#{permission} operation not found\" if index.nil?\n bits |= ( 1 << index )\n end\n\n return bits\nend",
"title": ""
},
{
"docid": "f683c084cd7511bfeb5dbf1d8a772630",
"score": "0.55134183",
"text": "def check_permission\n\t\t@principles = @school.principles.find_by(id: current_principle.id)\n\t\tnot_found if @principles.blank?\n\tend",
"title": ""
},
{
"docid": "1a475f65acea9c959ecf6f8c392305b4",
"score": "0.5505452",
"text": "def test_q14_d_ac\n test_agreement = create_test_agreement\n params = HashWithIndifferentAccess.new\n params[:q14] = 'd'\n params[:q14_d_a] = \"true\"\n params[:q14_d_c] = \"true\"\n\n form_processor = Manuscripts.new\n form_processor.process_question(test_agreement.agreementid.to_i, '14', params, 'UNIT_TESTING')\n\n permissions = test_agreement.active_permissions\n\n # Check Permissions created\n assert_equal 3, permissions.length, \"Incorrect number of permissions created\"\n assert_equal 3, form_processor.permission_count, \"Incorrect count of permissions on form processor\"\n\n #Check Permissions match rules\n assert_equal 1, permissions.select{|p| p.rule==\"r31\"}.length, \"Incorrect rule created\"\n assert_equal 1, permissions.select{|p| p.rule==\"r33\"}.length, \"Incorrect rule created\"\n assert_equal 1, permissions.select{|p| p.rule==\"r50\"}.length, \"Incorrect rule created\"\n end",
"title": ""
},
{
"docid": "d0f62febacb010b97120ef28c345d057",
"score": "0.5497582",
"text": "def permissions_policy(&block); end",
"title": ""
},
{
"docid": "8898f2f9ee6c364aa79ccc0039782ab0",
"score": "0.5493669",
"text": "def test_edit_from_policy(object_pid)\n policy_pid = policy_pid_for(object_pid)\n return false if policy_pid.nil?\n Rails.logger.debug(\"[CANCAN] -policy- Does the POLICY #{policy_pid} provide EDIT permissions for #{current_user.user_key}?\")\n group_intersection = user_groups & edit_groups_from_policy( policy_pid )\n result = !group_intersection.empty? || edit_users_from_policy( policy_pid ).include?(current_user.user_key)\n Rails.logger.debug(\"[CANCAN] -policy- decision: #{result}\")\n result\n end",
"title": ""
},
{
"docid": "9798cd3d1321a00bd6f8069b6762f791",
"score": "0.5487561",
"text": "def check_access\n render_no_permission unless @sir_log.user_is_owner_or_deputy?( current_user.id )\n end",
"title": ""
},
{
"docid": "5742b5e8648797d722d3fbe56847d90b",
"score": "0.5487242",
"text": "def test_q23_e_ac\n test_agreement = create_test_agreement\n params = HashWithIndifferentAccess.new\n params[:q23] = 'e'\n params[:q23_e_a] = \"true\"\n params[:q23_e_c] = \"true\"\n\n form_processor = Multi.new\n form_processor.process_question(test_agreement.agreementid.to_i, '23', params, 'UNIT_TESTING')\n\n permissions = test_agreement.active_permissions\n\n # Check Permissions created\n assert_equal 3, permissions.length, \"Incorrect number of permissions created\"\n assert_equal 3, form_processor.permission_count, \"Incorrect count of permissions on form processor\"\n\n #Check Permissions match rules\n assert_equal 1, permissions.select{|p| p.rule==\"r31\"}.length, \"Incorrect rule created\"\n assert_equal 1, permissions.select{|p| p.rule==\"r33\"}.length, \"Incorrect rule created\"\n assert_equal 1, permissions.select{|p| p.rule==\"r50\"}.length, \"Incorrect rule created\"\n end",
"title": ""
},
{
"docid": "b0ace52f1c71deb148a6f92155477074",
"score": "0.54867494",
"text": "def integrity_of_applicant_objects\n\n applicants_in_application_group = self.applicants - [nil]\n\n # puts applicants_in_application_group.map(&:id).inspect\n\n tax_household_applicants_valid = are_arrays_of_applicants_same?(applicants_in_application_group.map(&:id), self.households.flat_map(&:tax_households).flat_map(&:tax_household_members).map(&:applicant_id))\n\n coverage_applicants_valid = are_arrays_of_applicants_same?(applicants_in_application_group.map(&:id), self.households.flat_map(&:coverage_households).flat_map(&:coverage_household_members).map(&:applicant_id))\n\n tax_household_applicants_valid && coverage_applicants_valid\n end",
"title": ""
},
{
"docid": "152f9f105fe140ff15fff34fb1f3095e",
"score": "0.5483991",
"text": "def test_privileges\n @acl.allow!(nil, nil, ['p1', 'p2', 'p3'])\n assert_equal true, @acl.allowed?(nil, nil, 'p1')\n assert_equal true, @acl.allowed?(nil, nil, 'p2')\n assert_equal true, @acl.allowed?(nil, nil, 'p3')\n assert_equal false, @acl.allowed?(nil, nil, 'p4')\n\n @acl.deny!(nil, nil, 'p1')\n assert_equal false, @acl.allowed?(nil, nil, 'p1')\n\n @acl.deny!(nil, nil, ['p2', 'p3'])\n assert_equal false, @acl.allowed?(nil, nil, 'p2')\n assert_equal false, @acl.allowed?(nil, nil, 'p3')\n end",
"title": ""
},
{
"docid": "251ac924d1a999b7a06011fbd6f03949",
"score": "0.54837006",
"text": "def has_advanced_permissions?\n if policy.sharing_scope==Policy::ALL_SYSMO_USERS\n !(policy.permissions.collect{|p| p.contributor} - projects).empty?\n else\n policy.permissions.count > 0\n end\n end",
"title": ""
},
{
"docid": "9902907b810b690d65bc4e57629e7ece",
"score": "0.54798204",
"text": "def user_has_permission?(all_permissions, examined_user_permission)\n user_permissions = all_permissions[1, 3].delete('-') # Example -rwxr-xr-- -> rwx\n user_permissions.include?(examined_user_permission)\n end",
"title": ""
},
{
"docid": "fffbb633cf1e0a231dac6ab23ae3e085",
"score": "0.5477414",
"text": "def add_permission_group_filters\n unless @ability.can? :read, lime_survey\n raise LsReportsHelper::AccessDenied\n end\n\n unless @ability.can? :read_unfiltered, lime_survey\n # Filters for comparison\n plg = user.permission_group.permission_ls_groups.where(:lime_survey_sid=>lime_survey.sid).first\n raise \"Permissions Error: User cannot access this survey\" unless plg.present?\n uexts = user.user_externals\n plg.permission_ls_group_filters.each do |plgk|\n fieldname = plgk.lime_question.my_column_name\n if plgk.restricted_val.present?\n filter_val = plgk.restricted_val\n else\n uex = plgk.user_externals.where(:user_id=>@user.id).first\n raise 'Permissions Error: UserExternal is missing' unless uex.present?\n filter_val = uex.filter_val\n end\n add_x_filters fieldname, filter_val, plgk.filter_all\n end\n end\n @hide_agg = true if role_aggregate.agg_fieldname.to_s.empty?\n end",
"title": ""
},
{
"docid": "44d4947d403b4699f64e1a0cbf62d181",
"score": "0.54716676",
"text": "def test_q14_d_a\n test_agreement = create_test_agreement\n params = HashWithIndifferentAccess.new\n params[:q14] = 'd'\n params[:q14_d_a] = \"true\"\n \n form_processor = Manuscripts.new\n form_processor.process_question(test_agreement.agreementid.to_i, '14', params, 'UNIT_TESTING')\n\n permissions = test_agreement.active_permissions\n\n # Check Permissions created\n assert_equal 3, permissions.length, \"Number of permissions created is incorrect\"\n assert_equal 3, form_processor.permission_count, \"Permission count on processor is incorrect\"\n\n #Check Permissions match rules \n assert_equal 1, permissions.select{|p| p.rule==\"r31\"}.length, \"Incorrect rule created\"\n assert_equal 1, permissions.select{|p| p.rule==\"r50\"}.length, \"Incorrect rule created\"\n assert_equal 1, permissions.select{|p| p.rule==\"r51\"}.length, \"Incorrect rule created\"\n end",
"title": ""
},
{
"docid": "3ae6b10833d3c8cb40b60a5e059b23f7",
"score": "0.54702556",
"text": "def others_has_permission?(all_permissions, examined_others_permission)\n others_permissions = all_permissions[7, 3].delete('-') # Example -rwxr-xr-- -> r\n others_permissions.include?(examined_others_permission)\n end",
"title": ""
},
{
"docid": "25594ff3b0eadfec91a34307425af1cf",
"score": "0.5467236",
"text": "def test_q23_e_ab\n test_agreement = create_test_agreement\n params = HashWithIndifferentAccess.new\n params[:q23] = 'e'\n params[:q23_e_a] = \"true\"\n params[:q23_e_b] = \"true\"\n\n form_processor = Multi.new\n form_processor.process_question(test_agreement.agreementid.to_i, '23', params, 'UNIT_TESTING')\n\n permissions = test_agreement.active_permissions\n\n # Check Permissions created\n assert_equal 3, permissions.length, \"Incorrect number of permissions created\"\n assert_equal 3, form_processor.permission_count, \"Incorrect count of permissions on form processor\"\n\n #Check Permissions match rules\n assert_equal 1, permissions.select{|p| p.rule==\"r31\"}.length, \"Incorrect rule created\"\n assert_equal 1, permissions.select{|p| p.rule==\"r32\"}.length, \"Incorrect rule created\"\n assert_equal 1, permissions.select{|p| p.rule==\"r51\"}.length, \"Incorrect rule created\"\n end",
"title": ""
},
{
"docid": "c6088c5529fb5d95892527ce3c64e145",
"score": "0.54602253",
"text": "def handle_user_permissions_for catalog_user\n #puts '+++++++++++++++++++++++ handle_user_permissions_for ++++++++++++++++++++++++++'\n #puts catalog_user.user.email\n #puts catalog_user.role\n \n # always edit account users\n return true if catalog_user.role == 'Account User'\n \n \n # newer edit the account owner\n return false if catalog_user.role == 'Account Owner'\n \n # never edit the administrator\n return false if catalog_user.role == 'Administrator'\n \n # never grand catalog users \n # access to the account\n return true if catalog_user.role == 'Catalog User'\n \n puts '+++++++++++++++++++++++++++++++++++++++++++++++++'\n puts 'ERROR: Unable assign edit permmision for catalog user'\n puts 'In CatalogUser#has_permisions'\n puts '+++++++++++++++++++++++++++++++++++++++++++++++++' \n false\n \n end",
"title": ""
},
{
"docid": "bb9c7a18b9db20d0328b58bf4417d12a",
"score": "0.54536015",
"text": "def apply_permissions\n @apply_permissions || false\n end",
"title": ""
},
{
"docid": "8a11b0b683d8a814f9d3f7dc1cac3950",
"score": "0.54496384",
"text": "def permissions_all_unique\n return unless (non_unique = find_non_unique(permissions))\n\n errors.add(\n :permissions,\n I18n.t(\n 'models.permission.errors.uniqueness',\n resource: non_unique[:resource],\n action: non_unique[:action]\n )\n )\n end",
"title": ""
},
{
"docid": "661727b8d0036dd60e1cc15cb94e429b",
"score": "0.5440102",
"text": "def choose_permissions\n @user = User.find(params[:user_id])\n @access_request = @user.access_requests.new\n # @resources_with_permissions = Resource.user_has_access(@user).all\n @resource_groups = ResourceGroup.accessible_by(@user).alphabetical.all\n end",
"title": ""
},
{
"docid": "e0b28d80928071c7b0d32505371e7193",
"score": "0.54379886",
"text": "def permissions_diff\n permissions = Ruolo::Models::Permission.all\n policy = permissions_from_policy\n\n remove = permissions.reject { |perm| policy.include?(perm.name) }\n add = policy.reject { |pol| permissions.map(&:name).include?(pol) }\n\n remove.each(&:destroy)\n\n add.each do |permission|\n Ruolo::Models::Permission.create(name: permission)\n end\n end",
"title": ""
},
{
"docid": "bf4be083378b9a19cba245234586997d",
"score": "0.5432196",
"text": "def validate_pmu\n\n availability_constraint = (self.max_people - self.users.size) >= 0\n\n if self.is_driving?\n if (self.cab_sharing == false and self.car_sharing == true and availability_constraint)\n return true\n else\n raise \"pmu attributes for car sharing are not correct. please check\"\n end\n\n elsif (self.is_cab_sharing? and self.cab_sharing == true and availability_constraint)\n return true\n\n elsif (self.is_uncommitted? and availability_constraint)\n return true\n end\n\n raise \"pmu attributes invalid; check your pmu attributes.\"\n end",
"title": ""
},
{
"docid": "4180bc6238d1ad8ae78d7a180397e2a1",
"score": "0.54297405",
"text": "def check(prin_name, priv_name, res_ob_type, res_ob_adr)\n res_ob_id = @res_obj.find_res_ob(res_ob_type, res_ob_adr)\n #creates the set of resOb (wanted resOb and all resOb from root to address, unsorted)\n @res_obs = @res_obj.find_res_ob_parents(res_ob_type, res_ob_adr) \n #adds resOb, which ends with /* + wanted resOb\n @res_obs = @res_obj.res_obs_grand2children(@res_obs) + [res_ob_id] \n \n if(is_owner?(prin_name, @res_obs))\n #puts \"owner\"\n return true #access allowed - owner can do everything\n end\n \n #creates the set of principals {wanted principal and all groups wanted principal is member of}\n prins = @prin.find_parents(prin_name) + [prin_name] \n @privs = @priv.find_parents(priv_name) + [priv_name] #same for privilege\n \n final_ace = nil\n for prin in prins\n #ask for principal with privilege or higher privileges and and resob or higher resob. \n query = prepare_query(prin, @privs, @res_obs) \n #puts query\n handle = @connector.execute_query(query)\n hits = @connector.get_hits(handle)\n #puts \"hits #{hits}\"\n if(hits > 0) \n temp_id = @connector.retrieve(handle, 0) #retrieve id of first Ace\n temp_ace = AceRule.new(temp_id, @ace, @connector)\n if(hits == 1)\n final_ace = compare(final_ace, temp_ace)\n else #there are more rules\n hits.times { |i|\n temp_id = @connector.retrieve(handle, i) #retrieve id of next Ace\n temp_ace.reload!(temp_id)\n final_ace = compare(final_ace, temp_ace)\n }\n end\n end\n end\n \n if(final_ace == nil) #Rule doesnt exist = access denied\n #puts \"nil\"\n puts \"Required rule \n(#{prin_name}, #{priv_name}, #{res_ob_type}, #{res_ob_adr}) does not exist. \nAccess denied.\" if @report\n return false\n else\n return decide(final_ace.acc_type)\n end\n rescue => e\n raise e\n #puts e.backtrace.join(\"\\n\")\n #raise RubyACLException.new(self.class.name, __method__, \"Failed to check ACE\", 3), caller\n end",
"title": ""
},
{
"docid": "d3beaea9ccca24471b20b27e2994b58f",
"score": "0.54284406",
"text": "def user_ids_can_control\n # This gives the list of company id's where permissions is 1\n company_ids = self.company_users.where(permissions: 1).map(&:company_id)\n\n # Find me all the user ids that belong to the companies\n user_ids = CompanyUser.where(company_id: company_ids).map(&:user_id)\n\n # Just to insure the user is seeing all their own videos\n return user_ids.append(self.id)\n end",
"title": ""
},
{
"docid": "6b3bbec417f8d617e42f9339e6e3056c",
"score": "0.5426896",
"text": "def add_permissions_for(table_name=nil) # :nodoc:\r\n perm = table_name.nil? ? DcPermission.find_by(is_default: true) : DcPermission.find_by(table_name: table_name, active: true)\r\n (perm.dc_policy_rules.each {|p1| @permissions[p1.dc_policy_role_id] = p1.permission }) if perm\r\nend",
"title": ""
},
{
"docid": "aa0db66c9fb87c7208154a9d1511c651",
"score": "0.54268676",
"text": "def test_edit_from_policy(object_id)\n policy_ids = active_policy_ids_for(object_id)\n return false if policy_ids.nil?\n Rails.logger.debug(\"[CANCAN] -policy- Do the POLICIES #{policy_ids} provide READ permissions for #{current_user.user_key}?\")\n results = policy_ids.collect do |policy_id|\n group_intersection = user_groups & edit_groups_from_policy( policy_id )\n result = !group_intersection.empty? || edit_users_from_policy( policy_id ).include?(current_user.user_key)\n result\n end\n result = results.any? {|result| !!result}\n Rails.logger.debug(\"[CANCAN] -policy- decision: #{result}\")\n result\n end",
"title": ""
},
{
"docid": "4274d6f4243ee8303129d4fd3e1ff474",
"score": "0.54242754",
"text": "def user_has_permissions_on_both?\n ood_user = OodSupport::User.new(user)\n required_permissions = [:r, :x]\n\n app_facl = nil\n dataset_facl = nil\n begin\n app_facl = OodSupport::ACLs::Nfs4ACL.get_facl(path: app)\n dataset_facl = OodSupport::ACLs::Nfs4ACL.get_facl(path: dataset)\n rescue OodSupport::InvalidPath, OodSupport::BadExitCode\n return false\n end\n\n for required_permission in required_permissions do\n return false unless app_facl.allow?(principle: ood_user, permission: required_permission)\n return false unless dataset_facl.allow?(principle: ood_user, permission: required_permission)\n end\n\n # Everything went well so return true\n return true\n end",
"title": ""
},
{
"docid": "f3ff85d9917c301a1a3681602c4220c4",
"score": "0.5422997",
"text": "def test_read_from_policy(object_id)\n policy_id = policy_id_for(object_id)\n return false if policy_id.nil?\n Rails.logger.debug(\"[CANCAN] -policy- Does the POLICY #{policy_id} provide READ permissions for #{current_user.user_key}?\")\n group_intersection = user_groups & read_groups_from_policy( policy_id )\n result = !group_intersection.empty? || read_users_from_policy( policy_id ).include?(current_user.user_key)\n Rails.logger.debug(\"[CANCAN] -policy- decision: #{result}\")\n result\n end",
"title": ""
},
{
"docid": "b8ed268c3549c8f14d9f33d38c28a7b8",
"score": "0.5421964",
"text": "def check_permissions(username,tablename, granting )\n # current user must have permisison to show a table\n # first check the forbiddens table to see if the user cannot access the table\n\n user = User.find_by_user( username )\n\n # check to see if this user is on the FORBIDDEN list for this table\n forbidden = Forbidden.find_by( user: username, relation: tablename, active: true )\n\n # users with role of 'SO' have permission to do anything\n if user.role == 'SO' && !forbidden.present?\n return true\n end\n\n if forbidden.present?\n return false\n else\n level = 0\n\n # perform a depdth-first search of the ASSIGNED, starting with username\n # and going backward in the graph to a user with a role of SO\n # activeUsers contains the list of users who may have permission\n activeUsers = [ username ]\n while !activeUsers.empty?\n username = activeUsers.shift\n\n # get array of users who have granted permission to username\n permitted = Assigned.where( grantee: username, relation: tablename )\n permitted.find_each do |permission|\n\n # check if the grantor in the chain has granted permission\n # and they are not in the FORBIDDENS table\n grantor = User.find_by_user( permission.grantor )\n forbidden = Forbidden.find_by( user: grantor.user, relation: tablename, active: true )\n if !forbidden.present?\n\n # the grantor is not FORBIDDEN\n # if the original user is granting privileges to someone else\n # we need to check whether everyon in the chain has the\n # GRANT privilege\n if granting\n if grantor.role == 'SO'\n if permission.can_grant\n return true # we are done\n else\n return false # but the SO did not grant privilege to GRANT\n end\n else\n # add the grantor to the list of users to check\n if permission.can_grant\n activeUsers << grantor.user\n end\n end\n else\n if permission.can_grant || level == 0\n if grantor.role == 'SO'\n return true\n else\n activeUsers << grantor.user\n end\n end\n end\n end\n end\n level = level + 1\n end\n end\n return false\n end",
"title": ""
},
{
"docid": "d0a8ef65da692f585b366eacd406bb0c",
"score": "0.54209644",
"text": "def cannot_for_everyone\n #todo: cannot manage para todas las entidades que son CONSTANT\n #ejemplo: cannot [:create, :update, :destroy], User\n\n\t\tcannot :update, KeyAnalytical, status: KeyAnalytical.status_array # no se puede editar cuando esta pendiente de revisar una afectacion\n\t\tcannot :update, NominaDocument # es para que no se vuelva a calcular el ejercido, es decir, le sume dinero al ejercido de cada proyecto\n\n\t\tunless @user.superuser?\n\t\t\tcannot [:create, :read, :update, :destroy], User, role_id: Role.find_by_name('superuser').id\n\t\t\tcannot [:create, :read, :update, :destroy], Role, id: Role.find_by_name('superuser').id\n\t\tend\n\tend",
"title": ""
},
{
"docid": "3207a66d703d47e5f47c374c37db0d1b",
"score": "0.54185647",
"text": "def test_q23_e_bc\n test_agreement = create_test_agreement\n params = HashWithIndifferentAccess.new\n params[:q23] = 'e'\n params[:q23_e_b] = \"true\"\n params[:q23_e_c] = \"true\"\n\n form_processor = Multi.new\n form_processor.process_question(test_agreement.agreementid.to_i, '23', params, 'UNIT_TESTING')\n\n permissions = test_agreement.active_permissions\n\n # Check Permissions created\n assert_equal 3, permissions.length, \"Incorrect number of permissions created\"\n assert_equal 3, form_processor.permission_count, \"Incorrect count of permissions on form processor\"\n\n #Check Permissions match rules\n assert_equal 1, permissions.select{|p| p.rule==\"r32\"}.length, \"Incorrect rule created\"\n assert_equal 1, permissions.select{|p| p.rule==\"r33\"}.length, \"Incorrect rule created\"\n assert_equal 1, permissions.select{|p| p.rule==\"r49\"}.length, \"Incorrect rule created\"\n end",
"title": ""
},
{
"docid": "fe6eb9b9959d2ed7b58ae7ebee8729d6",
"score": "0.5416926",
"text": "def group_has_permission?(all_permissions, examined_group_permission)\n group_permissions = all_permissions[4, 3].delete('-') # Example -rwxr-xr-- -> rx\n group_permissions.include?(examined_group_permission)\n end",
"title": ""
},
{
"docid": "5574ec2349b2995370203d6d7a184176",
"score": "0.5412193",
"text": "def test_read_from_policy(object_pid)\n policy_pid = policy_pid_for(object_pid)\n return false if policy_pid.nil?\n Rails.logger.debug(\"[CANCAN] -policy- Does the POLICY #{policy_pid} provide READ permissions for #{current_user.user_key}?\")\n group_intersection = user_groups & read_groups_from_policy( policy_pid )\n result = !group_intersection.empty? || read_users_from_policy( policy_pid ).include?(current_user.user_key)\n Rails.logger.debug(\"[CANCAN] -policy- decision: #{result}\")\n result\n end",
"title": ""
},
{
"docid": "29c6f375516d56074848feb7018dacbb",
"score": "0.54099953",
"text": "def test_person_in_blacklist_and_use_blacklist_set_to_true\n temp = sops(:sop_with_all_sysmo_users_policy).policy.use_blacklist\n assert temp, \"use_blacklist should have been set to 'true'\"\n\n temp = people(:person_for_sysmo_user_in_blacklist).member?\n assert temp, \"test person is associated with some SysMO projects, but was thought not to be associated with any\"\n\n temp = Seek::Permissions::Authorization.is_person_in_blacklist?(people(:person_for_sysmo_user_in_blacklist), sops(:sop_with_all_sysmo_users_policy).contributor)\n assert temp, \"test person should have been in the blacklist of the sop owner\"\n\n # \"view\" is used instead of \"show\" because that's a precondition for Authorization.access_type_allows_action?() helper - it assumes that\n # Authorization.categorize_action() was called on the action before - and that yields \"view\" for \"show\" action\n temp = temp_authorized_by_policy?(sops(:sop_with_all_sysmo_users_policy).policy, sops(:sop_with_all_sysmo_users_policy), \"view\",\n people(:person_for_sysmo_user_in_blacklist).user, people(:person_for_sysmo_user_in_blacklist))\n assert temp, \"test user is SysMO user and should have been authorized by policy\"\n\n res = Seek::Permissions::Authorization.is_authorized?(\"view\", nil, sops(:sop_with_all_sysmo_users_policy), people(:person_for_sysmo_user_in_blacklist).user)\n assert !res, \"test user is SysMO user, but is also in blacklist - should not have been authorized for viewing\"\n end",
"title": ""
},
{
"docid": "8552ae4fb11704939e77c77a9b4e738b",
"score": "0.54095215",
"text": "def granted_permissions\n if self.role != 'Gerente' && self.role != 'Admin'\n self.errors.add(:base, 'Admin Tiene que ser almenos administrador para poder guardar usuarios')\n false\n end\n end",
"title": ""
},
{
"docid": "7f6343316d41e79968c4387da166584f",
"score": "0.5405398",
"text": "def level1_rules\n can :manage, :all\n end",
"title": ""
},
{
"docid": "6e8235e68f38a7815d6c6cd3f4b3832a",
"score": "0.54037154",
"text": "def has_been_accepted?\n self.permissions.count == 2 && self.permissions.first.status == 'allowed' && self.permissions.last.status == 'allowed'\n end",
"title": ""
},
{
"docid": "c0f803eb1579f65994b1541531a6279f",
"score": "0.53995734",
"text": "def authorization_permissions(user = User.current_user)\n @@expected_true_value ||= ActiveRecord::Base.connection.quoted_true.delete(\"'\")\n permissions = AuthPermissions.new\n user_id = user.nil? ? 0 : user.id\n if Seek::Config.auth_lookup_enabled && self.class.lookup_table_consistent?(user_id)\n sql = \"SELECT can_view,can_edit,can_download,can_manage,can_delete FROM #{self.class.lookup_table_name} WHERE user_id=#{user_id} AND asset_id=#{id}\"\n res = ActiveRecord::Base.connection.select_one(sql)\n if res.nil?\n raise 'Expected to find record in auth lookup table'\n else\n permissions.can_view = res['can_view'].to_s == @@expected_true_value && state_allows_manage?(user)\n permissions.can_download = res['can_download'].to_s == @@expected_true_value && state_allows_manage?(user)\n permissions.can_edit = res['can_edit'].to_s == @@expected_true_value && state_allows_manage?(user)\n permissions.can_manage = res['can_manage'].to_s == @@expected_true_value && state_allows_manage?(user)\n permissions.can_delete = res['can_delete'].to_s == @@expected_true_value && state_allows_manage?(user)\n end\n else\n permissions.can_view = can_view?\n permissions.can_download = can_download?\n permissions.can_edit = can_edit?\n permissions.can_manage = can_manage?\n permissions.can_delete = can_delete?\n end\n permissions\n end",
"title": ""
},
{
"docid": "79e2b406da9e0d18aeb55048c965ebe7",
"score": "0.53995603",
"text": "def permission_table_for_project_snippet_access\n :public | :public | :enabled | :admin | true | 1\n :public | :public | :enabled | :admin | false | 1\n :public | :public | :enabled | :reporter | nil | 1\n :public | :public | :enabled | :guest | nil | 1\n :public | :public | :enabled | :non_member | nil | 1\n :public | :public | :enabled | :anonymous | nil | 1\n\n :public | :public | :private | :admin | true | 1\n :public | :public | :private | :admin | false | 0\n :public | :public | :private | :reporter | nil | 1\n :public | :public | :private | :guest | nil | 1\n :public | :public | :private | :non_member | nil | 0\n :public | :public | :private | :anonymous | nil | 0\n\n :public | :public | :disabled | :admin | true | 1\n :public | :public | :disabled | :admin | false | 0\n :public | :public | :disabled | :reporter | nil | 0\n :public | :public | :disabled | :guest | nil | 0\n :public | :public | :disabled | :non_member | nil | 0\n :public | :public | :disabled | :anonymous | nil | 0\n\n :public | :internal | :enabled | :admin | true | 1\n :public | :internal | :enabled | :admin | false | 1\n :public | :internal | :enabled | :reporter | nil | 1\n :public | :internal | :enabled | :guest | nil | 1\n :public | :internal | :enabled | :non_member | nil | 1\n :public | :internal | :enabled | :anonymous | nil | 0\n\n :public | :internal | :private | :admin | true | 1\n :public | :internal | :private | :admin | false | 0\n :public | :internal | :private | :reporter | nil | 1\n :public | :internal | :private | :guest | nil | 1\n :public | :internal | :private | :non_member | nil | 0\n :public | :internal | :private | :anonymous | nil | 0\n\n :public | :internal | :disabled | :admin | true | 1\n :public | :internal | :disabled | :admin | false | 0\n :public | :internal | :disabled | :reporter | nil | 0\n :public | :internal | :disabled | :guest | nil | 0\n :public | :internal | :disabled | :non_member | nil | 0\n :public | :internal | :disabled | :anonymous | nil | 0\n\n :public | :private | :private | :admin | true | 1\n :public | :private | :private | :admin | false | 0\n :public | :private | :private | :reporter | nil | 1\n :public | :private | :private | :guest | nil | 1\n :public | :private | :private | :non_member | nil | 0\n :public | :private | :private | :anonymous | nil | 0\n\n :public | :private | :disabled | :reporter | nil | 0\n :public | :private | :disabled | :guest | nil | 0\n :public | :private | :disabled | :non_member | nil | 0\n :public | :private | :disabled | :anonymous | nil | 0\n\n :internal | :public | :enabled | :admin | true | 1\n :internal | :public | :enabled | :admin | false | 1\n :internal | :public | :enabled | :reporter | nil | 1\n :internal | :public | :enabled | :guest | nil | 1\n :internal | :public | :enabled | :non_member | nil | 1\n :internal | :public | :enabled | :anonymous | nil | 0\n\n :internal | :public | :private | :admin | true | 1\n :internal | :public | :private | :admin | false | 0\n :internal | :public | :private | :reporter | nil | 1\n :internal | :public | :private | :guest | nil | 1\n :internal | :public | :private | :non_member | nil | 0\n :internal | :public | :private | :anonymous | nil | 0\n\n :internal | :public | :disabled | :admin | true | 1\n :internal | :public | :disabled | :admin | false | 0\n :internal | :public | :disabled | :reporter | nil | 0\n :internal | :public | :disabled | :guest | nil | 0\n :internal | :public | :disabled | :non_member | nil | 0\n :internal | :public | :disabled | :anonymous | nil | 0\n\n :internal | :internal | :enabled | :admin | true | 1\n :internal | :internal | :enabled | :admin | false | 1\n :internal | :internal | :enabled | :reporter | nil | 1\n :internal | :internal | :enabled | :guest | nil | 1\n :internal | :internal | :enabled | :non_member | nil | 1\n :internal | :internal | :enabled | :anonymous | nil | 0\n\n :internal | :internal | :private | :admin | true | 1\n :internal | :internal | :private | :admin | false | 0\n :internal | :internal | :private | :reporter | nil | 1\n :internal | :internal | :private | :guest | nil | 1\n :internal | :internal | :private | :non_member | nil | 0\n :internal | :internal | :private | :anonymous | nil | 0\n\n :internal | :internal | :disabled | :admin | true | 1\n :internal | :internal | :disabled | :admin | false | 0\n :internal | :internal | :disabled | :reporter | nil | 0\n :internal | :internal | :disabled | :guest | nil | 0\n :internal | :internal | :disabled | :non_member | nil | 0\n :internal | :internal | :disabled | :anonymous | nil | 0\n\n :internal | :private | :private | :admin | true | 1\n :internal | :private | :private | :admin | false | 0\n :internal | :private | :private | :reporter | nil | 1\n :internal | :private | :private | :guest | nil | 1\n :internal | :private | :private | :non_member | nil | 0\n :internal | :private | :private | :anonymous | nil | 0\n\n :internal | :private | :disabled | :admin | true | 1\n :internal | :private | :disabled | :admin | false | 0\n :internal | :private | :disabled | :reporter | nil | 0\n :internal | :private | :disabled | :guest | nil | 0\n :internal | :private | :disabled | :non_member | nil | 0\n :internal | :private | :disabled | :anonymous | nil | 0\n\n :private | :public | :enabled | :admin | true | 1\n :private | :public | :enabled | :admin | false | 0\n :private | :public | :enabled | :reporter | nil | 1\n :private | :public | :enabled | :guest | nil | 1\n :private | :public | :enabled | :non_member | nil | 0\n :private | :public | :enabled | :anonymous | nil | 0\n\n :private | :public | :private | :admin | true | 1\n :private | :public | :private | :admin | false | 0\n :private | :public | :private | :reporter | nil | 1\n :private | :public | :private | :guest | nil | 1\n :private | :public | :private | :non_member | nil | 0\n :private | :public | :private | :anonymous | nil | 0\n\n :private | :public | :disabled | :admin | true | 1\n :private | :public | :disabled | :admin | false | 0\n :private | :public | :disabled | :reporter | nil | 0\n :private | :public | :disabled | :guest | nil | 0\n :private | :public | :disabled | :non_member | nil | 0\n :private | :public | :disabled | :anonymous | nil | 0\n\n :private | :internal | :enabled | :admin | true | 1\n :private | :internal | :enabled | :admin | false | 0\n :private | :internal | :enabled | :reporter | nil | 1\n :private | :internal | :enabled | :guest | nil | 1\n :private | :internal | :enabled | :non_member | nil | 0\n :private | :internal | :enabled | :anonymous | nil | 0\n\n :private | :internal | :private | :admin | true | 1\n :private | :internal | :private | :admin | false | 0\n :private | :internal | :private | :reporter | nil | 1\n :private | :internal | :private | :guest | nil | 1\n :private | :internal | :private | :non_member | nil | 0\n :private | :internal | :private | :anonymous | nil | 0\n\n :private | :internal | :disabled | :admin | true | 1\n :private | :internal | :disabled | :admin | false | 0\n :private | :internal | :disabled | :reporter | nil | 0\n :private | :internal | :disabled | :guest | nil | 0\n :private | :internal | :disabled | :non_member | nil | 0\n :private | :internal | :disabled | :anonymous | nil | 0\n\n :private | :private | :private | :admin | true | 1\n :private | :private | :private | :admin | false | 0\n :private | :private | :private | :reporter | nil | 1\n :private | :private | :private | :guest | nil | 1\n :private | :private | :private | :non_member | nil | 0\n :private | :private | :private | :anonymous | nil | 0\n\n :private | :private | :disabled | :admin | true | 1\n :private | :private | :disabled | :admin | false | 0\n :private | :private | :disabled | :reporter | nil | 0\n :private | :private | :disabled | :guest | nil | 0\n :private | :private | :disabled | :non_member | nil | 0\n :private | :private | :disabled | :anonymous | nil | 0\n end",
"title": ""
}
] |
946f5d26121a47582a2c1b7f2e32dd45 | GET /recipe_lists/1 GET /recipe_lists/1.json | [
{
"docid": "a81945373733e4951b987de6ea99f9a1",
"score": "0.0",
"text": "def show\n end",
"title": ""
}
] | [
{
"docid": "f9976986d8bfeae0ed90bcbfcce4c437",
"score": "0.7564559",
"text": "def list\n \n recipes = Recipe.all\n render :json => recipes.to_json\n\n end",
"title": ""
},
{
"docid": "af89512af805c0c864dddb3d0c7f8f12",
"score": "0.7298504",
"text": "def index\n @recipe_lists = RecipeList.all\n end",
"title": ""
},
{
"docid": "284a2cb82d21bb2c835bb48a661aec03",
"score": "0.7089002",
"text": "def show\n response = Aws.list_recipe(params[:id])\n render :json => response\n end",
"title": ""
},
{
"docid": "b3f491d0df1efbc0376183320db9c922",
"score": "0.7037444",
"text": "def index\n recipes = Recipe.all\n render status: :ok, json: recipes\n end",
"title": ""
},
{
"docid": "13a2e37a52ed2e80136ff278ad239f26",
"score": "0.70359266",
"text": "def set_recipe_list\n @recipe_list = RecipeList.find(params[:id])\n end",
"title": ""
},
{
"docid": "d2b5c1571d30d242a6547c20553c08a1",
"score": "0.68544865",
"text": "def index\n @recipes = Recipe.all\n render json: @recipes\n end",
"title": ""
},
{
"docid": "f45e973e61c52bbdcdf2e876e44ad0b9",
"score": "0.68273413",
"text": "def index\n @recipes = Recipe.all\n respond_to do |format|\n format.html {}\n format.json { render json: @recipes }\n end\n end",
"title": ""
},
{
"docid": "2e309cd1826f323d1973d711d8333431",
"score": "0.6797012",
"text": "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",
"title": ""
},
{
"docid": "62948a3cdb270e98b54040a5a7da6b57",
"score": "0.6771924",
"text": "def index\n @recipe_list = Recipe.where(category_id: params[:category_id])\n # Looks in recipe where the key, category_id is equal to the endpoint\n\n if @recipe_list.empty?\n render :json => {\n :error => 'Oops, no recipes yet! Add some now.'\n }\n else\n render :json => {\n :response => \"successful\",\n :data => @recipe_list\n }\n end\n end",
"title": ""
},
{
"docid": "ab1cdf627110d80bb793c82084da77f3",
"score": "0.6743191",
"text": "def index\n recipes = current_user.recipes\n render json: { recipes: recipes}.to_json, status: :ok\n end",
"title": ""
},
{
"docid": "47ba73e3c6df29602a9f5456fd249886",
"score": "0.67237383",
"text": "def list\n display_recipes\n end",
"title": ""
},
{
"docid": "4d64e2d693b959cc6ccbdba5e1269336",
"score": "0.66945404",
"text": "def get_list(list_id)\n rest(\"get\", \"lists/#{list_id}\")\n end",
"title": ""
},
{
"docid": "eefad2e7a86f42096b9e1d3bf5a79491",
"score": "0.66419065",
"text": "def show\n recipe = Recipe.find(params[:id])\n # recipes = Recipe.find_by(params[:id])\n # render json: recipe\n render json: recipe\n end",
"title": ""
},
{
"docid": "60528cd7ab53148df76a39e37b8f70e9",
"score": "0.6584642",
"text": "def index\n info = Aws.get_recipes_from_db\n render :json => info\n end",
"title": ""
},
{
"docid": "c1220f0c83a8ebc8f3e02f09c7467579",
"score": "0.6582333",
"text": "def index\n recipe_items = current_user.recipes.includes(recipe_items: :ingredient).find(params[:recipe_id]).recipe_items\n render json: { recipe_items: recipe_items}.to_json(include: :ingredient), status: :ok\n end",
"title": ""
},
{
"docid": "af6ec53ba13a068dc8155bbc36de0ced",
"score": "0.65536284",
"text": "def recipes # /v1/user/:id/recipes (GET)\n recipes = ::Recipe.all\n render json: recipes, :each_serializer => RecipeSmallSerializer, root: false, status: 200\n end",
"title": ""
},
{
"docid": "079a46e457f8a4ecf53a6c2baff2b658",
"score": "0.6541943",
"text": "def ingredients_by_recipe\n recipe = Recipe.find(params[:id])\n render json: recipe.ingredients\n end",
"title": ""
},
{
"docid": "d60e6e6a31a6dab4042354641e5d7bdc",
"score": "0.65346754",
"text": "def index\n render json: Recipe.all\n end",
"title": ""
},
{
"docid": "6ef6c5ef5810b276dc78b363b53a29a3",
"score": "0.6513751",
"text": "def getRecipeByIngredientsList\n begin\n ingredientsList = params[:ingredients].split(\",\")\n\n @recipe = []\n ingredientsList.each do |ingredient|\n @recipe.push(Recipe.where('ingredients ILIKE ?', '%'+ingredient+'%').all)\n end\n \n if !@recipe.empty?\n render json: { status: 'SUCCESS', message: 'Loaded recipe!', data: @recipe }, status: :ok\n else\n render json: { status: 'SUCCESS', message: 'No recipe found', data: {} }, status: :not_found\n end\n rescue\n render json: { status: 'ERROR', message: 'Error loading recipe', data: {} }, status: :not_found\n end\n end",
"title": ""
},
{
"docid": "7829af1fadb230f238c96a6c2e6ac949",
"score": "0.6491976",
"text": "def index\n @list_product_recipes = ListProductRecipe.all\n end",
"title": ""
},
{
"docid": "ec43ef4ef16f8fc1218db7b752d8f30d",
"score": "0.6424299",
"text": "def index\n # @recipes = Recipe.all\n end",
"title": ""
},
{
"docid": "5e2970b93d7c17fd01bc1617ac79a374",
"score": "0.641315",
"text": "def show\n\n recipe = Recipe.find(params[:id])\n render :json => recipe.to_json\n\n end",
"title": ""
},
{
"docid": "e8f896014b373ca98fd9abb15856ad75",
"score": "0.6412844",
"text": "def list_ingredients\n rid = params[:id]\n items = Aws.get_ingredients_from_db(rid)\n render :json => items\n end",
"title": ""
},
{
"docid": "b792a8666a17bf77cbeaf090ea1321df",
"score": "0.6410879",
"text": "def show\n # accept the params\n # go to the db and get the correct recipe for that param\n p params[:id]\n @recipe = Recipe.find_by(id: params[:id])\n @ingredients = @recipe.ingredients.split(\", \").map {|ingredient| ingredient.capitalize}\n # send this to the view\n # show that data to the user\n render 'show.json.jb'\n end",
"title": ""
},
{
"docid": "6590c4138c7db6f97e1bbc4f47e02437",
"score": "0.63541096",
"text": "def show\n render json: @recipe\n end",
"title": ""
},
{
"docid": "f4a215c1b3448997dda855569f73a530",
"score": "0.6352993",
"text": "def index\n @recipe_items = RecipeItem.all\n end",
"title": ""
},
{
"docid": "880c750b15bbc8284f3e24dff5304d9f",
"score": "0.63528556",
"text": "def index\n @recipes = Recipe.all\n end",
"title": ""
},
{
"docid": "880c750b15bbc8284f3e24dff5304d9f",
"score": "0.63528556",
"text": "def index\n @recipes = Recipe.all\n end",
"title": ""
},
{
"docid": "880c750b15bbc8284f3e24dff5304d9f",
"score": "0.63528556",
"text": "def index\n @recipes = Recipe.all\n end",
"title": ""
},
{
"docid": "880c750b15bbc8284f3e24dff5304d9f",
"score": "0.63528556",
"text": "def index\n @recipes = Recipe.all\n end",
"title": ""
},
{
"docid": "880c750b15bbc8284f3e24dff5304d9f",
"score": "0.63528556",
"text": "def index\n @recipes = Recipe.all\n end",
"title": ""
},
{
"docid": "880c750b15bbc8284f3e24dff5304d9f",
"score": "0.63528556",
"text": "def index\n @recipes = Recipe.all\n end",
"title": ""
},
{
"docid": "880c750b15bbc8284f3e24dff5304d9f",
"score": "0.63528556",
"text": "def index\n @recipes = Recipe.all\n end",
"title": ""
},
{
"docid": "880c750b15bbc8284f3e24dff5304d9f",
"score": "0.63528556",
"text": "def index\n @recipes = Recipe.all\n end",
"title": ""
},
{
"docid": "880c750b15bbc8284f3e24dff5304d9f",
"score": "0.63528556",
"text": "def index\n @recipes = Recipe.all\n end",
"title": ""
},
{
"docid": "880c750b15bbc8284f3e24dff5304d9f",
"score": "0.63528556",
"text": "def index\n @recipes = Recipe.all\n end",
"title": ""
},
{
"docid": "880c750b15bbc8284f3e24dff5304d9f",
"score": "0.63528556",
"text": "def index\n @recipes = Recipe.all\n end",
"title": ""
},
{
"docid": "880c750b15bbc8284f3e24dff5304d9f",
"score": "0.63528556",
"text": "def index\n @recipes = Recipe.all\n end",
"title": ""
},
{
"docid": "880c750b15bbc8284f3e24dff5304d9f",
"score": "0.63528556",
"text": "def index\n @recipes = Recipe.all\n end",
"title": ""
},
{
"docid": "880c750b15bbc8284f3e24dff5304d9f",
"score": "0.63528556",
"text": "def index\n @recipes = Recipe.all\n end",
"title": ""
},
{
"docid": "880c750b15bbc8284f3e24dff5304d9f",
"score": "0.63528556",
"text": "def index\n @recipes = Recipe.all\n end",
"title": ""
},
{
"docid": "72a8c9c2a13bcea9a5f6017791e2bee4",
"score": "0.6332351",
"text": "def list\n recipes = @cookbook.all\n # byebug\n @view.display_recipes(recipes)\n end",
"title": ""
},
{
"docid": "e273c3b5032c800821811a6f60ed22a2",
"score": "0.6326043",
"text": "def create\n @recipe_list = RecipeList.new(recipe_list_params)\n\n respond_to do |format|\n if @recipe_list.save\n format.html { redirect_to @recipe_list, notice: 'Recipe list was successfully created.' }\n format.json { render :show, status: :created, location: @recipe_list }\n else\n format.html { render :new }\n format.json { render json: @recipe_list.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0dd1bb712db03478cabcad3b29442a04",
"score": "0.6322343",
"text": "def index\n @list_items = List.find(params[:list_id]).list_items\n\n render json: @list_items\n end",
"title": ""
},
{
"docid": "885a28f5a3298d403fcbba28be0db854",
"score": "0.6316795",
"text": "def show\n @recipe_all = RecipeAll.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @recipe_all }\n end\n end",
"title": ""
},
{
"docid": "4a02d06fbf3cb4366c483460cba3cf13",
"score": "0.62836784",
"text": "def show\n @data = @recipe.read(params[:id])\n render json: @data\n end",
"title": ""
},
{
"docid": "0bb060056c186e0a76174889d5aff4ae",
"score": "0.6223661",
"text": "def show\n @ingredient = Ingredient.find_by_url_slug(params[:id])\n @ingredient = Ingredient.find(params[:id]) if @ingredient.nil?\n @recipes = @ingredient.recipes.order('created_at DESC')\n logger.debug @recipes.inspect\n respond_to do |format|\n format.html {render :layout => 'wall'}\n format.json { render json: @ingredient }\n end\n end",
"title": ""
},
{
"docid": "7d28fd8575a61ea14078417474ec69e4",
"score": "0.6211639",
"text": "def show(id) \n response = request(:get, \"/recipes/#{id}.json\")\n response.first[1]\n end",
"title": ""
},
{
"docid": "838794a652384ddeb91a0d09e2b7b669",
"score": "0.6197052",
"text": "def show\n respond_to do |format|\n format.html {}\n format.json { render json: @recipe }\n end\n end",
"title": ""
},
{
"docid": "e31f74c09da175e2778ae5390d24ecea",
"score": "0.61519927",
"text": "def index\n\t\t@recipes = Recipe.where(user_id: session[:user_id])\n\t\tif @recipes\n\t\t\trender json: @recipes.to_json(:include => [:inventories])\n\t\telse\n\t\t\tflash[:error] = \"You haven't saved any recipes yet! Search now :)\"\n\t\t\trender status: 400, nothing: true\n\t\tend\n\tend",
"title": ""
},
{
"docid": "20ba0394f1b34f73fc93353dd65b8d6b",
"score": "0.614909",
"text": "def show\n @recipe = Recipe.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @recipe }\n end\n end",
"title": ""
},
{
"docid": "3cdf4278565f56fb3e2e275244f907a8",
"score": "0.6148493",
"text": "def index\n @recipes = Recipe.render_all\n end",
"title": ""
},
{
"docid": "1945beaddb620a261e38e5fe028b0c90",
"score": "0.6146605",
"text": "def index \n recipes = Recipe.all\n #render will return the object back in json format so that it can be used by the frontend\n render json: recipes, except: [:created_at, :updated_at]\n end",
"title": ""
},
{
"docid": "1802e39da715680193f5274312d817ef",
"score": "0.6132741",
"text": "def index\n @recipes = RecipeCacheService.list(per_page: per_page_param, page: page_param)\n end",
"title": ""
},
{
"docid": "cedc7b40c74f1f71c396c95ad02a1e81",
"score": "0.6131157",
"text": "def recipe_list_params\n params.require(:recipe_list).permit(:recipe_id, :meal_id, :id)\n end",
"title": ""
},
{
"docid": "f0aae0fd14109bef818768a751486672",
"score": "0.61251277",
"text": "def show\n\t\t@recipe = Recipe.find(params[:id])\n\t\tif @recipe \n\t\t\trender json: @recipe.to_json(:include => [:inventories])\n\t\telse\n\t\t\trender status: 400, nothing: true\n\t\tend\n\tend",
"title": ""
},
{
"docid": "32ab00e640dfa903dfbbcf345580e550",
"score": "0.61216277",
"text": "def index\n @recipes = (!params[:recipe].blank?)? Recipe.where(\"id in (\" + params[:recipe] + \")\") : Recipe.all\n @recipes_json = Recipe.where(\"title ilike ?\", \"%#{params[:q]}%\")\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: custom_json_for(@recipes_json)}\n end\n end",
"title": ""
},
{
"docid": "4f9c06cb38718b9667e827ef95e51362",
"score": "0.6117008",
"text": "def show\n authenticate\n list = List.find(params[:id])\n items = list.items\n render json: {\n items: items,\n id: list.id\n }\n end",
"title": ""
},
{
"docid": "80bcaa3d4abecacb0d8d0c265c35da05",
"score": "0.6107594",
"text": "def index \n recipeIngredients = RecipeIngredient.all\n #render will return the object back in json format so that it can be used by the frontend\n render json: recipeIngredients\n end",
"title": ""
},
{
"docid": "52c51c3493ea28eb6657ebfdec50994e",
"score": "0.61045456",
"text": "def show\n @list = List.find(params[:list_id])\n @list_items = @list.list_items.find(params[:list_id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @list_item }\n end\n end",
"title": ""
},
{
"docid": "032cea2afcebbd2aafa3c3342a568829",
"score": "0.6095638",
"text": "def show\n @get_restaurant_list = GetRestaurantList.find(params[:id])\n\n render json: @get_restaurant_list\n end",
"title": ""
},
{
"docid": "e68588403412144502e230106ec60d92",
"score": "0.60949284",
"text": "def get_list(user, list)\n get(\"/#{user}/lists/#{list}.json\")\n end",
"title": ""
},
{
"docid": "46107e3c37c87055007669cf488519dd",
"score": "0.6089066",
"text": "def index\n # byebug\n if current_user\n recipes = Recipe.all \n render json: recipes\n else \n render json: { errors: [\"Not Authorized\"] }, status: :unauthorized\n end\n end",
"title": ""
},
{
"docid": "1df25172eaa1592ad16f259766af745f",
"score": "0.60714895",
"text": "def show\n @recipe = Recipe.find(params[:id])\n @recipeIngredients = RecipeIngredient.where(:recipeId => params[:id])\n @ingredients = Ingredient.where(:id => @recipeIngredients.select(:ingredientId))\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @recipe }\n end\n end",
"title": ""
},
{
"docid": "b4edc2f30f5eb8f49b5e16e50c3cfae6",
"score": "0.60585934",
"text": "def index\n @potluck_recipes = PotluckRecipe.all\n end",
"title": ""
},
{
"docid": "a0620cde0914c1323e156d412785b028",
"score": "0.60358113",
"text": "def index\n @ingredient_recipes = IngredientRecipe.all\n end",
"title": ""
},
{
"docid": "9165dbb7d5c6b91cd003808b540cbbee",
"score": "0.60257846",
"text": "def index\n if params[:book_id]\n @book = Book.find(params[:book_id])\n recipes = @book.recipes\n render json: RecipeSerializer.new(recipes).to_serialized_json\n else \n recipes = Recipe.all.order(:name)\n render json: RecipeSerializer.new(recipes).to_serialized_json\n end\n end",
"title": ""
},
{
"docid": "8d711436d4b08f80777b8bc33ad6db79",
"score": "0.6010386",
"text": "def update\n respond_to do |format|\n if @recipe_list.update(recipe_list_params)\n format.html { redirect_to @recipe_list, notice: 'Recipe list was successfully updated.' }\n format.json { render :show, status: :ok, location: @recipe_list }\n else\n format.html { render :edit }\n format.json { render json: @recipe_list.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "308a30ab8ed531445b238dd5e91890e3",
"score": "0.5987682",
"text": "def list\n url = prefix + \"list\"\n return response(url)\n end",
"title": ""
},
{
"docid": "bab6829437161c121ac5ffd07af1c298",
"score": "0.59689885",
"text": "def get_question_list\n json= RestClient.get(\"http://localhost:3000/questions\")\n JSON.parse(json)\n end",
"title": ""
},
{
"docid": "ea0f550d7b0b6f4d15058878a52f4f50",
"score": "0.5963026",
"text": "def show\n @food_recipe = FoodRecipe.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @food_recipe }\n end\n end",
"title": ""
},
{
"docid": "e26162a0077dd677f292ca9915380cba",
"score": "0.5956777",
"text": "def index\n @recipeingredients = Recipeingredient.all\n end",
"title": ""
},
{
"docid": "9d17ae8c85d58a234a0401cc55d66bc3",
"score": "0.595565",
"text": "def show\n @list = List.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @list }\n end\n end",
"title": ""
},
{
"docid": "9d17ae8c85d58a234a0401cc55d66bc3",
"score": "0.595565",
"text": "def show\n @list = List.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @list }\n end\n end",
"title": ""
},
{
"docid": "9d17ae8c85d58a234a0401cc55d66bc3",
"score": "0.595565",
"text": "def show\n @list = List.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @list }\n end\n end",
"title": ""
},
{
"docid": "9d17ae8c85d58a234a0401cc55d66bc3",
"score": "0.595565",
"text": "def show\n @list = List.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @list }\n end\n end",
"title": ""
},
{
"docid": "a3e5b915894b3b0aabd1cab4729ebf50",
"score": "0.5953333",
"text": "def index\n @meal_recipes = MealRecipe.all\n end",
"title": ""
},
{
"docid": "ad86d1501b4db5300a0f587994969ffe",
"score": "0.5950608",
"text": "def show\n respond_with Recipe.find(params[\"id\"])\n end",
"title": ""
},
{
"docid": "6d7a5db86fe692eb2d01be16e5821180",
"score": "0.5949618",
"text": "def listRestaurants\n _restaurants = Restaurant.all\n render json: _restaurants\n end",
"title": ""
},
{
"docid": "a70c466b7cf7038cc51dd0307ad0f87f",
"score": "0.59477293",
"text": "def get_recipe_titles(user_ingredients)\n \n search_params = 'http://www.recipepuppy.com/api/?i=' + user_ingredients.join(\",\")\n \n\n recipes = []\n search_string = RestClient.get(search_params)\n search_hash = JSON.parse(search_string)\n relevant_recipes = search_hash[\"results\"]\n relevant_recipes.collect do |recipe|\n recipes << recipe[\"title\"].strip\n end\n \n recipes\nend",
"title": ""
},
{
"docid": "adee02debb3859ee97a5d9c17d3b85d9",
"score": "0.594274",
"text": "def index\n @ingredient_lists = IngredientList.all\n end",
"title": ""
},
{
"docid": "26687ac0ffafddc5cebdce708ad3367a",
"score": "0.59307075",
"text": "def show\n @recipe = Recipe.find(params[:id])\n @nutrition_info = NutritionInfo.where( \"recipe_id = ?\", @recipe.id ).first\n @inventory_items = []\n @recipe.inventory_items.each do |inventory_item|\n @inventory_items << inventory_item\n end\n\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @recipe }\n end\n end",
"title": ""
},
{
"docid": "c66bfbe6027845b3fb0871e1624fc1fe",
"score": "0.5929498",
"text": "def index\n @list = List.find(params[:list_id])\n @items = @list.items\n\n respond_with @items\n end",
"title": ""
},
{
"docid": "a613e78a0d073a9657da1ffa1e567685",
"score": "0.5918418",
"text": "def index\n @recipe_ingredients = RecipeIngredient.all\n end",
"title": ""
},
{
"docid": "f38f3ae2a8a4ce9c405e21a9c9bf8779",
"score": "0.59054875",
"text": "def set_list_product_recipe\n @list_product_recipe = ListProductRecipe.find(params[:id])\n end",
"title": ""
},
{
"docid": "3a1c029350547f4b8427808a5e1ac7d5",
"score": "0.59020185",
"text": "def findrecipes\n\t\t@hide_menu = true\n puts \"In Find Recipes\"\n #this is where the data for the searching of recipes gets routed into\n input = params['query'].inspect\n\n ingreds = input.split(',')\n\n input = ingreds.join(\"%2C\")\n #this is the api \n url = \"https://spoonacular-recipe-food-nutrition-v1.p.mashape.com/recipes/findByIngredients?fillIngredients=false&ingredients=\" + input + \"&limitLicense=false&number=5&ranking=1\"\n\n res = Unirest.get url,\n headers:{\n \"X-Mashape-Key\" => \"UpZLcnOR83mshtXvuIOPFXBkfhn5p1UWi1ejsnsTLWoVXrOppm\",\n \"Accept\" => \"application/json\"\n }\n\n recipes = res.body\n #for each recipe that gets returned, the following information is routed into the recipe results page\n recipes.each do |recipe|\n url2 = url2 = \"https://spoonacular-recipe-food-nutrition-v1.p.mashape.com/recipes/\" + recipe['id'].to_s + \"/information?includeNutrition=false\"\n\n res2 = Unirest.get url2,\n headers:{\n \"X-Mashape-Key\" => \"UpZLcnOR83mshtXvuIOPFXBkfhn5p1UWi1ejsnsTLWoVXrOppm\",\n \"Accept\" => \"application/json\"\n }\n\n price = (\"$\" + (0.01 * res2.body['pricePerServing']).to_s)[0..5]\n\n recipe['price'] = price\n #this is the price of a recipe per serving\n\n end\n\n @recipeData = recipes\n render template: \"recipes/data\"\n end",
"title": ""
},
{
"docid": "a3ddfa7b84a8d639e7c14a1f4c73e71b",
"score": "0.5901494",
"text": "def show\r\n\r\n url = URI(\"https://spoonacular-recipe-food-nutrition-v1.p.rapidapi.com/recipes/#{params[:id]}/information\")\r\n\r\n http = Net::HTTP.new(url.host, url.port)\r\n http.use_ssl = true\r\n http.verify_mode = OpenSSL::SSL::VERIFY_NONE\r\n\r\n request = Net::HTTP::Get.new(url)\r\n request[\"x-rapidapi-key\"] = ENV[\"SPOONACULAR_API_KEY\"] # hidden API key\r\n request[\"x-rapidapi-host\"] = 'spoonacular-recipe-food-nutrition-v1.p.rapidapi.com'\r\n\r\n response = http.request(request)\r\n @recipe = JSON.parse response.read_body # gets the recipe\r\n\r\n p url_ingredients = URI(\"https://spoonacular-recipe-food-nutrition-v1.p.rapidapi.com/recipes/#{params[:id]}/ingredientWidget.json\")\r\n\r\n http_ingredients = Net::HTTP.new(url_ingredients.host, url_ingredients.port)\r\n http_ingredients.use_ssl = true\r\n http_ingredients.verify_mode = OpenSSL::SSL::VERIFY_NONE\r\n\r\n request_ingredients = Net::HTTP::Get.new(url_ingredients)\r\n request_ingredients[\"x-rapidapi-key\"] = ENV[\"SPOONACULAR_API_KEY\"]\r\n request[\"x-rapidapi-host\"] = 'spoonacular-recipe-food-nutrition-v1.p.rapidapi.com'\r\n\r\n response_ingredients = http.request(request_ingredients)\r\n # puts response_ingredients.read_body\r\n @ingredients = JSON.parse # data is a string (which looks like a hash -> convert to hash) response_ingredients.read_body\r\n p \"RECIPES\"\r\n # p @recipe\r\n p \"INGREDIENTS\"\r\n p @ingredients\r\n\r\n end",
"title": ""
},
{
"docid": "0419c5331fd547eea82c1fb942f16dd8",
"score": "0.5900807",
"text": "def index\n @lists = List.all\n render json: @lists\n end",
"title": ""
},
{
"docid": "683f7414855eb6919c5cec8a846d589b",
"score": "0.58986664",
"text": "def index\n @cooking_recipes = CookingRecipe.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @cooking_recipes }\n end\n end",
"title": ""
},
{
"docid": "2d59818669eb9cb408fff1c1222eb77f",
"score": "0.58932906",
"text": "def index\n @lists = List.all\n @list = List.new\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @lists }\n end\n end",
"title": ""
},
{
"docid": "c051faa4ff4a7cacbd9e04c188f6546e",
"score": "0.58664244",
"text": "def recipes\n Array fetch(:run_list)\n end",
"title": ""
},
{
"docid": "64921cbd89a18866a9c26903b386d60e",
"score": "0.58627504",
"text": "def index\n render 'recipes/index'\n end",
"title": ""
},
{
"docid": "bd2fc892d94f0aa0f1e19ebd7e73211b",
"score": "0.58603",
"text": "def show\n if recipe\n render json: recipe\n else \n render json: {message: 'Recipe not found'}\n end\n end",
"title": ""
},
{
"docid": "bfce376a61e1b4e082e6f1f14b44b044",
"score": "0.5858179",
"text": "def show\n \n @all_listing_requsts = Request.where(listing_id: params[:id])\n render json: @all_listing_requsts\n end",
"title": ""
},
{
"docid": "e0186a471b17ad80a541ba33084d2ee3",
"score": "0.5847924",
"text": "def generate_recipes_list\n recipes = YARD::Registry.all(:recipe).uniq.sort_by {|recipe| recipe.Name.to_s}\n generate_full_list(recipes, 'Recipe', 'recipes')\nend",
"title": ""
},
{
"docid": "86ffd703cfa6339e1f36ee074f47bb38",
"score": "0.5844277",
"text": "def list\n url = prefix + \"list\"\n return response(url)\n end",
"title": ""
},
{
"docid": "769a6e0ea07292cb5714e6a90826d9da",
"score": "0.5844246",
"text": "def list\n get('/')\n end",
"title": ""
},
{
"docid": "f8607571aa06377d107662a78bef50b6",
"score": "0.5836423",
"text": "def index\n @fridge_item_ids = FridgeItem.pluck(:ingredient_id)\n @available_recipes = find_available_recipes\n @recipes = Recipe.paginate(page: params[:page])\n end",
"title": ""
},
{
"docid": "1bdb7492a80bca8632b2cb22c9110647",
"score": "0.5828688",
"text": "def get_list(id)\n record \"/todos/list/#{id}\"\n end",
"title": ""
},
{
"docid": "54b3552bb9bf16158b077a066da51789",
"score": "0.58267576",
"text": "def show\n @recipe_ingredient = Recipe_ingredient.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @recipe_ingredient }\n end\n end",
"title": ""
},
{
"docid": "0897a138237e6f6d67de06dbe80af3fa",
"score": "0.5814455",
"text": "def index\n @favourites_recipes = FavouritesRecipe.all\n end",
"title": ""
}
] |
dafb7a3fd352432619df1227f6e2500d | Select all user's edges with the relationships required ====== Params: +user_id+:: +Integer+ to find to get edges +relationships+:: +Array+ relationships required to select edges Returns Edges selected | [
{
"docid": "488787e1bfc375dccd1b8e2c57d62df7",
"score": "0.8355454",
"text": "def get_edges(user_id, relationships)\n user = get_user user_id\n return [] if user.nil? \n\n user.edges.select do |e|\n id = (e.origin.id == user.id) ? e.destiny.id : e.origin.id\n\n condiction_to_string = (relationships.class == String and (relationships == \"all\" or e.label == relationships))\n condiction_to_array = (relationships.class == Array and relationships.include? e.label)\n\n e.active and not @network.include? @elements_factory.create_vertex(id, user.class) and (condiction_to_string or condiction_to_array)\n end\n end",
"title": ""
}
] | [
{
"docid": "25d7b9250ddb9f4fc21e091964fc9ff2",
"score": "0.56615156",
"text": "def relationships\n ['user']\n end",
"title": ""
},
{
"docid": "62182d29d8a57aadec47899c2d7c2259",
"score": "0.55388105",
"text": "def target_relationships\n relationships.select { |rel| rel.target.id == id }\n end",
"title": ""
},
{
"docid": "3106eb061183f9dc7d0fd7c9ac4f49bf",
"score": "0.54672545",
"text": "def find_any_relationship_with(user)\n friendship = Relationship.where(:user_id => self.id, :friend_id => user.id).first\n if friendship.nil?\n friendship = Relationship.where(:user_id => user.id, :friend_id => self.id).first\n end\n friendship\n end",
"title": ""
},
{
"docid": "7459c02c3cf50c66398b912e46c0801b",
"score": "0.5367394",
"text": "def get_relationships(params)\n check_params params\n\n params = params.load_params\n\n RequestBuilder.new(@user_key, @alternate_url + RELATIONSHIPS_ENDPOINT,\n @http_client, BINDING_VERSION, params, @url_parameters)\n .send_post_request\n end",
"title": ""
},
{
"docid": "cff03ab09ffddf14d24227a5dfcf8bd8",
"score": "0.53373283",
"text": "def requested_relationships(fields)\n @_relationships\n end",
"title": ""
},
{
"docid": "ad1a0988f6bba53da2710e00b661cc6e",
"score": "0.52935195",
"text": "def get_user_group_relationship(_user_group_id)\n group_user_relationships.where(groupable_id: _user_group_id).take\n end",
"title": ""
},
{
"docid": "5d13c8bf959a46d186aeae693de56085",
"score": "0.5278762",
"text": "def relationships(type = nil)\n if type\n array = []\n records = self.user_relationships.where(relationship_type: type).joins(:user)\n records.each do |record|\n array << record.user\n end\n else\n self.users\n end\n end",
"title": ""
},
{
"docid": "292eed5863b0c36359cd9c4b7e854a13",
"score": "0.5264962",
"text": "def all_related_nodes\n edges = uniq_edges\n Node.where(id: (edges.map(&:from_node_id) + edges.map(&:to_node_id) + self.nodes.map(&:id)).uniq)\n end",
"title": ""
},
{
"docid": "1bdd7d9ee76d1904c8ba8ba4674aa83f",
"score": "0.5247956",
"text": "def get_relationship(user1, user2)\n return Relationship.where(\"follower_id = :follower_id and followed_id = :followed_id or follower_id = :followed_id and followed_id = :follower_id\", {followed_id: user1.id, follower_id: user2.id})\n end",
"title": ""
},
{
"docid": "b473eac91e6c7b0ff980a66cee1fed85",
"score": "0.52124447",
"text": "def index\n @relationships = Relationship.where('user_id = ?' , current_user.id)\n end",
"title": ""
},
{
"docid": "070b4cb63a1a1112724e5e55af22e0e7",
"score": "0.51752627",
"text": "def friends\n return [] if !has_friends?\n # and array of friend relationships NOT actual nodes\n array_of_hashes = neo_con.get_node_relationships(self.my_node, \"out\", FRIENDS_REL)\n # objects = array_of_hashes.map{|m| OpenStruct.new(m)}\n # even better, just get the full user objects\n # puts \"array_of_hashes.collect{|x| x['data'']['id']}::#{array_of_hashes.collect{|x| x['data']['id']}} \"\n # puts \"array_of_hashes.collect{ |x| neo_node_id(x) }::#{array_of_hashes.collect{ |x| neo_node_id(x) }} \"\n\n User.where(:node_id => array_of_hashes.collect{ |x| neo_end_node_id(x) })\n end",
"title": ""
},
{
"docid": "373f7d9f42a3e2f61a0d5ebaf4ed51c4",
"score": "0.5173928",
"text": "def relation_with(user)\n user.relationships.find_by_follower_id(id)\n end",
"title": ""
},
{
"docid": "9cb6b5a07ceae2e2730da4c68f06ccbd",
"score": "0.5160575",
"text": "def relatives\n self.class.where(\"id in (#{approved_relationships}) OR id in (#{approved_inverse_relationships})\")\n end",
"title": ""
},
{
"docid": "5d7fc73afe794e61644311f35603e400",
"score": "0.5154833",
"text": "def following(user_id)\n\n relationships = Relationship.where(follower_id: user_id)\n followed_users = relationships.map { |relationship| User.find(relationship.followed_id) }\n return followed_users\n\n end",
"title": ""
},
{
"docid": "20a8b6b163b39bf1d74352dbb654f910",
"score": "0.51514417",
"text": "def relationships_follower\n followed_users = Relationship.where(followed_id: params[:id])\n @my_users = Array.new\n for user in followed_users do\n @my_users.push(User.find_by(id: user.follower_id))\n end\n end",
"title": ""
},
{
"docid": "f1dec85770b097775313ddcc8e566738",
"score": "0.5147545",
"text": "def get_user_relationship(user_id_arr)\n\tuser_id_arr.each{ |user|\n\t\tbegin\n\t\t\trelationship = $client.user_relationship(user)\n\t\t\tif relationship.target_user_is_private == true || relationship.incoming_status == \"followed by\" || relationship.outgoing_status == \"follows\"\n\t\t\t\tuser_id_arr.delete(user)\n\t\t\tend\n\t\trescue Exception => e\n\t\t\tputs e.message\n\t\t\tputs e.backtrace.inspect\n\t\tend #raises exception for relationships\n\t}\n\tpp user_id_arr.count\n\treturn user_id_arr\nend",
"title": ""
},
{
"docid": "28e3a25369d88e182948c308be770080",
"score": "0.5140426",
"text": "def get_user_relationships(opts = {})\n data, _status_code, _headers = get_user_relationships_with_http_info(opts)\n return data\n end",
"title": ""
},
{
"docid": "d59add5d8f1a2de9a42f9abe455afcfd",
"score": "0.5136624",
"text": "def relationships_following\n following_users = Relationship.where(follower_id: params[:id])\n @my_users = Array.new\n for user in following_users do\n @my_users.push(User.find_by(id: user.followed_id))\n end\n end",
"title": ""
},
{
"docid": "2f91a963d295c027061d01e5d075582f",
"score": "0.51097184",
"text": "def set_relationships\n @relationships = Relationships.find(params[:id])\n end",
"title": ""
},
{
"docid": "e91a8bb9df53633e9ece3c06e402b686",
"score": "0.5104436",
"text": "def delete_relationships\r\n Relationship.delete_all [\"user_id=? or related_user_id=?\", self.id, self.id]\r\n end",
"title": ""
},
{
"docid": "6ab32669bf8c43d2243ade7dbba4b875",
"score": "0.50946695",
"text": "def followers(user_id)\n\n relationships = Relationship.where(followed_id: user_id)\n followers = relationships.map { |relationship| User.find(relationship.follower_id) }\n return followers\n\n end",
"title": ""
},
{
"docid": "be93cc000447fbaeef0982e607669d5d",
"score": "0.5083855",
"text": "def v2_application_user_variable_relationships_get(opts = {})\n data, _status_code, _headers = v2_application_user_variable_relationships_get_with_http_info(opts)\n return data\n end",
"title": ""
},
{
"docid": "1c6427388f0fcb45c2ffa0147384940c",
"score": "0.5083359",
"text": "def source_relationships\n relationships.select { |rel| rel.source.id == id }\n end",
"title": ""
},
{
"docid": "e05595c6330414f5d100c8bd6f99a690",
"score": "0.5081691",
"text": "def select_nodes\n @requestee_node = UserNode.find_by(user_id: params[:user_id])\n @requester_node = UserNode.find_by(user_id: current_user.id)\n end",
"title": ""
},
{
"docid": "df65546969f26ad7181d93324d338c81",
"score": "0.50187635",
"text": "def feed\n following_ids = \"SELECT followed_id FROM relationships\n WHERE follower_id = :user_id\"\n Product.where(\"user_id IN (#{following_ids})\n OR user_id = :user_id\", user_id: id)\n end",
"title": ""
},
{
"docid": "c5d1bab258cff5deabc9be7ff3910fda",
"score": "0.5017748",
"text": "def all_relations\n FeatureRelation.where(['child_node_id = ? OR parent_node_id = ?', id, id])\n end",
"title": ""
},
{
"docid": "c5d1bab258cff5deabc9be7ff3910fda",
"score": "0.5017748",
"text": "def all_relations\n FeatureRelation.where(['child_node_id = ? OR parent_node_id = ?', id, id])\n end",
"title": ""
},
{
"docid": "3bed2087266fe6706a3b44465fe6e190",
"score": "0.500568",
"text": "def feed\n following_ids = \"SELECT followed_id FROM relationships\n WHERE follower_id = :user_id\"\n Event.where(\"user_id IN (#{following_ids})\n OR user_id = :user_id\", user_id: id)\n end",
"title": ""
},
{
"docid": "0dd399eb7e4f7240647f091a8d507b53",
"score": "0.49600825",
"text": "def set_graph\r\n @graph = Graph.find(params[:id])\r\n # @user_roles = UserRole.where(role_id: 2)\r\n #@specialists = User.joins(:user_roles)\r\n end",
"title": ""
},
{
"docid": "a4c7fe327951edde4f1129b4ee3e31f5",
"score": "0.49433953",
"text": "def relationships\n @relationships ||= {}\n end",
"title": ""
},
{
"docid": "62d2be18e9b886f29c4c91bd98c3571a",
"score": "0.49433255",
"text": "def relationships\n params[:data][:relationships]\n end",
"title": ""
},
{
"docid": "957fdedb197108202fa653b6dbb90c6b",
"score": "0.49418253",
"text": "def user_relationship\n if request.xhr?\n organization_id = params[\"organization_id\"]\n per_page = params[:iDisplayLength] || Settings.per_page\n page = params[:iDisplayStart] ? ((params[:iDisplayStart].to_i/per_page.to_i) + 1) : 1\n params[:iSortCol_0] = 1 if params[:iSortCol_0].blank?\n sort_field = SORT_MAP_RELATIONSHIP[params[:iSortCol_0].to_i]\n # @users = User.get_all_users_except_id(current_user.id, page, per_page, params[:sSearch], sort_field + \" \" + params[:sSortDir_0],organization_id)\n @users = User.get_user_to_relationship(page, per_page, params[:sSearch], sort_field + \" \" + params[:sSortDir_0])\n render :json => @users\n return\n end\n end",
"title": ""
},
{
"docid": "387623a1a503145c14ff9f7e3dbbb2a0",
"score": "0.49354345",
"text": "def user_assignments(user_id, query_params = nil)\n get_user_children(user_id, __method__, query_params)\n end",
"title": ""
},
{
"docid": "56e1bceb58be4adc8817eaaefa8dbc2f",
"score": "0.49319753",
"text": "def set_user_relationship\n @user_relationship = UserRelationship.find(params[:id])\n end",
"title": ""
},
{
"docid": "0fbc7197152b01bef71403e8f7222119",
"score": "0.49199668",
"text": "def all_user_groups\n UserGroup.joins(:user_relationships).uniq.where(\"user_relationships.user_id = ? or user_groups.parent_id IN (?)\", id, admin_user_groups.pluck(:id))\n end",
"title": ""
},
{
"docid": "bb848eed85ed9d9af4cdd8f6fbd7b321",
"score": "0.49134213",
"text": "def relationships\n \n if @relationships && @relationships != {}\n \n @relationships \n else\n \n initialize_relationships\n \n return @relationships\n end\n end",
"title": ""
},
{
"docid": "cc8e8f93a7615d28600ff8f989f0085e",
"score": "0.49081483",
"text": "def is_connected?(user_id)\n relationship = Connection.find_by(\n '(connecter_id = ? AND connecting_id = ?) OR (connecting_id = ? AND connecter_id = ?)',\n user_id, id, user_id, id\n )\n return relationship\n end",
"title": ""
},
{
"docid": "8699570bad66934c1f6037d5c43ce79b",
"score": "0.48954806",
"text": "def in_edges(filter=nil, &block)\n r = self.collect {|v| v.in_edges(filter, &block) }\n EdgeSet.new(r).flatten.uniq\n end",
"title": ""
},
{
"docid": "1c35af4bc96dc63aed3073c3e3ffba4f",
"score": "0.4886207",
"text": "def requested_relationships\n Relationship.all_requested_relationships_for(self)\n end",
"title": ""
},
{
"docid": "54ec830d04737098f35ed6801ae4481d",
"score": "0.4884482",
"text": "def invite(user)\n return false if user == self || find_any_relationship_with(user)\n Relationship.new { |r| r.user = self ; r.relative = user }.save\n end",
"title": ""
},
{
"docid": "912f14ba46434ab4b82ff200daf67ac5",
"score": "0.4878658",
"text": "def process_follower_list(id, edges = [], depth = 0, max_depth = 2)\n return edges unless @user_store.has_key? id\n\n user = @user_store[id]\n\n # Skip edges from users who don't follow anyone or have less than 10 followers themselves\n return edges if user.friends.nil? || user.weight < 10\n\n user.friends.each do |follower_id|\n next unless @user_store.has_key? follower_id\n\n following = @user_store[follower_id]\n\n # Skip edges to users with 10k users and more, we don't need the famous people\n next if following.weight > 9999\n\n edges << [user, following]\n\n if depth + 1 < max_depth\n process_follower_list(follower_id, edges, depth + 1, max_depth)\n end\n end\n\n return edges\n end",
"title": ""
},
{
"docid": "def988a3f87a290f16f0ca330aa63dc9",
"score": "0.48719892",
"text": "def relationships\n users = User.all\n user = users.first\n followeds = users[2..50]\n followers = users[3..40]\n followeds.each { |followed| user.follow!(followed) }\n followers.each { |follower| follower.follow!(user) }\nend",
"title": ""
},
{
"docid": "dfb2be3b9727088fc7ebc953ea872d05",
"score": "0.48685965",
"text": "def relationships_following_private\n following_users = Relationship.where(follower_id: @current_user.id)\n @my_users = Array.new\n for user in following_users do\n @my_users.push(User.find_by(id: user.followed_id))\n end\n end",
"title": ""
},
{
"docid": "71694067a50086b47a38aa5f7d7c2871",
"score": "0.48665047",
"text": "def relationships\n @relationships ||= Relationship.from_associations(self, associations)\n end",
"title": ""
},
{
"docid": "4154b944af64d4ae53669aa72201767a",
"score": "0.48575813",
"text": "def all_relationship_rels types\n type_query = type_query_for types\n\n user\n .query_as(:user)\n .match(\"user-[rel:#{type_query}]->(recipe:Recipe)\")\n end",
"title": ""
},
{
"docid": "be9ae8a079d122c04f9af33b29b22df1",
"score": "0.48484525",
"text": "def friend_ids\n directedusertouseredges.map(&:friend_user_id)\n end",
"title": ""
},
{
"docid": "7417dff393ad421d9f904c98999c8b09",
"score": "0.48458695",
"text": "def feed\n\t following_ids = \"SELECT followed_id FROM relationships\n WHERE follower_id = :user_id\"\n\t Match.where(\"user_id IN (#{following_ids})\n\t OR user_id = :user_id\", user_id: id)\n\t end",
"title": ""
},
{
"docid": "fdf29c1fde0aac039a5f00fe8514a837",
"score": "0.4840599",
"text": "def relationships_follower_private\n followed_users = Relationship.where(followed_id: @current_user.id)\n @my_users = Array.new\n for user in followed_users do\n @my_users.push(User.find_by(id: user.follower_id))\n end\n end",
"title": ""
},
{
"docid": "678b2bc4ea1a61c5d8ce942085bd8e04",
"score": "0.48391747",
"text": "def relationships\n []\n end",
"title": ""
},
{
"docid": "f5a1a3a5046b1b52937e9f1bd16c9c20",
"score": "0.4830299",
"text": "def old_friend_edge_list(u)\r\n edge_list = FriendEdgeList.new\r\n \r\n query(\"SELECT name FROM is_friend_of LEFT JOIN user ON b = user.id WHERE a = '#{u}'\") do |result|\r\n edge_list.outbound = result.fetch_all\r\n end\r\n query(\"SELECT name FROM is_friend_of LEFT JOIN user ON a = user.id WHERE b = '#{u}'\") do |result|\r\n edge_list.inbound = result.fetch_all\r\n end\r\n \r\n edge_list\r\n end",
"title": ""
},
{
"docid": "8cb61144cb1e5e9c71f72b3a8b6d3ee4",
"score": "0.48286834",
"text": "def get_user_relationships_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: UsersRelationshipsApi.get_user_relationships ...\"\n end\n # resource path\n local_var_path = \"/users/relationships\"\n\n # query parameters\n query_params = {}\n query_params[:'size'] = opts[:'size'] if !opts[:'size'].nil?\n query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?\n query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['oauth2_client_credentials_grant', 'oauth2_password_grant']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'PageResourceUserRelationshipResource')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: UsersRelationshipsApi#get_user_relationships\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "6b6463a1e5b50583e92721a1f20e2d52",
"score": "0.48199773",
"text": "def user_variable_relationships_get(opts = {})\n if Configuration.debugging\n Configuration.logger.debug \"Calling API: UserVariableRelationshipApi#user_variable_relationships_get ...\"\n end\n \n # resource path\n path = \"/userVariableRelationships\".sub('{format}','json')\n\n # query parameters\n query_params = {}\n query_params[:'access_token'] = opts[:'access_token'] if opts[:'access_token']\n query_params[:'id'] = opts[:'id'] if opts[:'id']\n query_params[:'confidence_level'] = opts[:'confidence_level'] if opts[:'confidence_level']\n query_params[:'confidence_score'] = opts[:'confidence_score'] if opts[:'confidence_score']\n query_params[:'direction'] = opts[:'direction'] if opts[:'direction']\n query_params[:'duration_of_action'] = opts[:'duration_of_action'] if opts[:'duration_of_action']\n query_params[:'error_message'] = opts[:'error_message'] if opts[:'error_message']\n query_params[:'onset_delay'] = opts[:'onset_delay'] if opts[:'onset_delay']\n query_params[:'outcome_variable_id'] = opts[:'outcome_variable_id'] if opts[:'outcome_variable_id']\n query_params[:'predictor_variable_id'] = opts[:'predictor_variable_id'] if opts[:'predictor_variable_id']\n query_params[:'predictor_unit_id'] = opts[:'predictor_unit_id'] if opts[:'predictor_unit_id']\n query_params[:'sinn_rank'] = opts[:'sinn_rank'] if opts[:'sinn_rank']\n query_params[:'strength_level'] = opts[:'strength_level'] if opts[:'strength_level']\n query_params[:'strength_score'] = opts[:'strength_score'] if opts[:'strength_score']\n query_params[:'user_id'] = opts[:'user_id'] if opts[:'user_id']\n query_params[:'vote'] = opts[:'vote'] if opts[:'vote']\n query_params[:'value_predicting_high_outcome'] = opts[:'value_predicting_high_outcome'] if opts[:'value_predicting_high_outcome']\n query_params[:'value_predicting_low_outcome'] = opts[:'value_predicting_low_outcome'] if opts[:'value_predicting_low_outcome']\n query_params[:'limit'] = opts[:'limit'] if opts[:'limit']\n query_params[:'offset'] = opts[:'offset'] if opts[:'offset']\n query_params[:'sort'] = opts[:'sort'] if opts[:'sort']\n\n # header parameters\n header_params = {}\n\n # HTTP header 'Accept' (if needed)\n _header_accept = ['application/json']\n _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result\n\n # HTTP header 'Content-Type'\n _header_content_type = ['application/json']\n header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n \n\n auth_names = ['quantimodo_oauth2']\n result = @api_client.call_api(:GET, path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'inline_response_200_23')\n if Configuration.debugging\n Configuration.logger.debug \"API called: UserVariableRelationshipApi#user_variable_relationships_get. Result: #{result.inspect}\"\n end\n return result\n end",
"title": ""
},
{
"docid": "b0314b73caf3235c3b04679d6390b23d",
"score": "0.4814432",
"text": "def edges\r\n fail_if_invalid()\r\n @edgeuses.map { |edgeuse| edgeuse.edge }\r\n end",
"title": ""
},
{
"docid": "29a5dfb8bc0ccd733c285b99c3f67820",
"score": "0.47974572",
"text": "def recognitions_received_by(user_ids)\n recognition_query_with_flattened_recipients do |query|\n query = yield(query) if block_given?\n query.where(recognition_recipients: { user_id: user_ids })\n end\n end",
"title": ""
},
{
"docid": "8280d031cd7ec9a393fdeff2e8a5ec3e",
"score": "0.4791424",
"text": "def friends(graph)\n friends = User.where(:id => friend_ids(graph))\n end",
"title": ""
},
{
"docid": "fc76221bed3c2c3f194b897ccf60b5ef",
"score": "0.4782169",
"text": "def edges\n found_edges = []\n # Process class relationships\n relationships = @klass.relationships\n# p ['relationships', relationships]\n# if @options.inheritance && ! @options.transitive\n# if @klass.superclass.respond_to?'relationships'\n# superclass_relationships = @klass.superclass.relationships\n# relationships = relationships.select{|k,a| superclass_relationships[k].nil?}\n# end\n# end\n remove_joins(relationships).each do |k, a|\n found_edges << process_relationship(@klass.name, a)\n end\n# p ['found_edges', found_edges]\n found_edges.compact\n end",
"title": ""
},
{
"docid": "80876e017d2733e6ad5cda7906fce476",
"score": "0.4779778",
"text": "def build_object_graph\n @relationships ||= []\n Array(self.class.relationships).each do |relationship|\n included = includes.include?(relationship.name)\n rel = relationship.build_resources({parent_resource: self, included: included})\n @relationships << rel\n end\n end",
"title": ""
},
{
"docid": "214fa9fad2658d792b6a4a1bd960defc",
"score": "0.47760472",
"text": "def relationship_params\n params.require(:relationship).permit(:user_id)\n end",
"title": ""
},
{
"docid": "da97612da7ec053a6ebe71d1751e8456",
"score": "0.47688678",
"text": "def related_entities\n edges = Edge.find(:all, :conditions => [\"end1 = :uuid OR end2 = :uuid\", {:uuid => self.uuid} ] ).collect {|edge| edge.end1 == self.uuid ? edge.end2 : edge.end1 }.uniq\n puts \"Edges are #{edges.inspect}\"\n Entity.find edges\n end",
"title": ""
},
{
"docid": "339c171ba050c7da345569b21e9bc157",
"score": "0.47686246",
"text": "def relationship\n Relationship.find(:first, :conditions => {:user_id => self.inviter_id, :related_user_id => self.user_id, :related_entity_id => self.id, :relationshiptype_id => self.circle_id})\n end",
"title": ""
},
{
"docid": "098520a52e71da300d09a4e3fd15a41c",
"score": "0.47672316",
"text": "def eager_graph_association(ds, model, ta, requirements, r, *associations)\n klass = r.associated_class\n assoc_name = r[:name]\n assoc_table_alias = ds.eager_unique_table_alias(ds, assoc_name)\n join_type = r[:graph_join_type]\n conditions = r[:graph_conditions]\n ds = case assoc_type = r[:type]\n when :many_to_one\n ds.graph(klass, [[klass.primary_key, :\"#{ta}__#{r[:key]}\"]] + conditions, :table_alias=>assoc_table_alias, :join_type=>join_type)\n when :one_to_many\n ds = ds.graph(klass, [[r[:key], :\"#{ta}__#{model.primary_key}\"]] + conditions, :table_alias=>assoc_table_alias, :join_type=>join_type)\n # We only load reciprocals for one_to_many associations, as other reciprocals don't make sense\n ds.opts[:eager_graph][:reciprocals][assoc_table_alias] = r.reciprocal\n ds\n when :many_to_many\n ds = ds.graph(r[:join_table], [[r[:left_key], :\"#{ta}__#{model.primary_key}\"]] + r[:graph_join_table_conditions], :select=>false, :table_alias=>ds.eager_unique_table_alias(ds, r[:join_table]), :join_type=>join_type)\n ds.graph(klass, [[klass.primary_key, r[:right_key]]] + conditions, :table_alias=>assoc_table_alias, :join_type=>join_type)\n end\n eager_graph = ds.opts[:eager_graph]\n eager_graph[:requirements][assoc_table_alias] = requirements.dup\n eager_graph[:alias_association_name_map][assoc_table_alias] = assoc_name\n eager_graph[:alias_association_type_map][assoc_table_alias] = assoc_type\n ds = ds.eager_graph_associations(ds, klass, assoc_table_alias, requirements + [assoc_table_alias], *associations) unless associations.empty?\n ds\n end",
"title": ""
},
{
"docid": "cba9bb0df27b6f1547605e90f6dbca73",
"score": "0.47431034",
"text": "def set_relationship\n @relationship = current_user.relationships.find(params[:id])\n end",
"title": ""
},
{
"docid": "d6d8a8653e5caf1dfa217297af241735",
"score": "0.4736856",
"text": "def set_relationship\n @outgoing_relationship = Relationship.where(:requesting_user_id => current_user.id, :receiving_user_id => params[:id])\n @incoming_relationship = Relationship.where(:requesting_user_id => params[:id], :receiving_user_id => current_user.id)\n end",
"title": ""
},
{
"docid": "6dfac17b3b66454839570a54cad67242",
"score": "0.473345",
"text": "def accept\n @user_relationship = current_user.user_relationships.find(params[:id])\n if @user_relationship.accept! \n \n flash[:notice] = \"You are now part of #{@user_relationship.relation.first_name}'s network.\"\n else\n flash[:error] = \"Cannot be accepted.\"\n end\n redirect_to user_relationships_path\n end",
"title": ""
},
{
"docid": "2fec60a31dc23dfe8ed3be9c65b47c70",
"score": "0.47242165",
"text": "def edges(start_node:, direction: nil)\n db.edges collection: self, start_node: start_node, direction: direction\n end",
"title": ""
},
{
"docid": "6bd58a52e8e4fdefadba6e136e4929b5",
"score": "0.4723122",
"text": "def feed\n following_ids = \"SELECT followed_id FROM relationships\n WHERE follower_id = :user_id\"\n Home.where(\"user_id IN (#{following_ids})\n OR user_id = :user_id\", user_id: id)\n end",
"title": ""
},
{
"docid": "d0a2f7c5b07d7356cfdc70fb90910a7d",
"score": "0.4722642",
"text": "def e(*ids)\n ids = ids.flatten\n\n return @edges.find_by_id(ids[0]) if ids.size == 1\n\n new_edges = Rgraphum::Edges.new\n ids.each do |id|\n new_edges << @edges.find_by_id(id)\n end\n\n new_edges\n end",
"title": ""
},
{
"docid": "3c7023107e688935f1106e65581311d2",
"score": "0.4721755",
"text": "def feed\n following_ids = \"SELECT followed_id FROM relationships\n WHERE follower_id = :user_id\"\n Pic.where(\"user_id IN (#{following_ids})\n OR user_id = :user_id\", user_id: id)\n end",
"title": ""
},
{
"docid": "15081147f68d14164d5d6552de861fe2",
"score": "0.47206086",
"text": "def eager_graph(*associations)\n model = check_model\n table_name = model.table_name\n ds = if @opts[:eager_graph]\n self\n else\n # Each of the following have a symbol key for the table alias, with the following values: \n # :reciprocals - the reciprocal instance variable to use for this association\n # :requirements - array of requirements for this association\n # :alias_association_type_map - the type of association for this association\n # :alias_association_name_map - the name of the association for this association\n clone(:eager_graph=>{:requirements=>{}, :master=>model.table_name, :alias_association_type_map=>{}, :alias_association_name_map=>{}, :reciprocals=>{}})\n end\n ds.eager_graph_associations(ds, model, table_name, [], *associations)\n end",
"title": ""
},
{
"docid": "c563e9e93b1cb3555da8f970570bfabd",
"score": "0.47160274",
"text": "def feed\r\n following_ids = \"SELECT followed_id FROM relationships\r\n WHERE follower_id = :user_id\"\r\n Post.where(\"user_id IN (#{following_ids})\r\n OR user_id = :user_id\", user_id: id)\r\n end",
"title": ""
},
{
"docid": "4576c3258ec19890a75f706c10a406f0",
"score": "0.47143367",
"text": "def user_attributes_for_user(user)\n #Don't use this kind of query plan in a for-production adapter.\n find_all_of_type_user_attribute.select do |user_attribute|\n connected?(user, user_attribute)\n end\n end",
"title": ""
},
{
"docid": "f58be2e452d16231572f31ebdbc19770",
"score": "0.47092792",
"text": "def friend_edge_list(u)\n friends_url = \"/misc/fdata.bml?user=#{u}\"\n edge_list = FriendEdgeList.new\n\n lj_get(friends_url) do |body|\n StringIO.new(body).each_line do |line|\n case line\n when /> ([a-z0-9_]{1,16})/ # -- i.e. u is-friend-of $1\n edge_list.outbound << $1\n when /< ([a-z0-9_]{1,16})/ # -- i.e. $1 is-friend-of u\n edge_list.inbound << $1\n end\n end\n end\n\n edge_list\n end",
"title": ""
},
{
"docid": "9f5f8ccfa4153a29a99bf312d09d06f6",
"score": "0.47033814",
"text": "def edges(filter=nil, &block)\n @edges.filter(filter, &block)\n end",
"title": ""
},
{
"docid": "aea0aea8bad43b94bb7478d1209f0708",
"score": "0.47020116",
"text": "def feed\n following_ids = \"SELECT followed_id\n FROM relationships\n WHERE follower_id = :user_id\"\n Activity.where(\"user_id IN (#{following_ids})\", user_id: id)\n end",
"title": ""
},
{
"docid": "128c4a410bb18d555f59e1206ed492db",
"score": "0.47001925",
"text": "def friend_requests\n ids = inverse_friendships.where(is_relationship_established: false).pluck(:user_id)\n User.find(ids)\n end",
"title": ""
},
{
"docid": "1c23f7349e20ddaf9f07134220d991c5",
"score": "0.46979344",
"text": "def make_relationships\n users = User.where admin:false\n user = users.first\n puts \"Creating relationships for user #{user.name} ...\"\n followed_users = users[1..50]\n followers = users[3..40]\n followed_users.each { |followed| user.follow!(followed) }\n followers.each { |follower| follower.follow!(user) }\nend",
"title": ""
},
{
"docid": "793ef491aaa82233d75cf0afcac9f75f",
"score": "0.4692958",
"text": "def get_edges\n getEdges.iterator.to_route(:graph => self, :element_type => :edge)\n end",
"title": ""
},
{
"docid": "a3a5d951ea0ea746d99ee38d21358464",
"score": "0.46807015",
"text": "def feed\n following_ids = \"SELECT followed_id FROM relationships\n WHERE follower_id = :user_id\"\n Meeting.where(\"user_id IN (#{following_ids})\n OR user_id = :user_id\", user_id: id)\n end",
"title": ""
},
{
"docid": "42c56d282bf3b51b94f4124c9293feaa",
"score": "0.46706298",
"text": "def relationships\n links = Link.all_from_active_record(self)\n @relationships ||= Relationship.all_from_links(links)\n end",
"title": ""
},
{
"docid": "e3eb3d97857e51e95780f878e9d4a860",
"score": "0.46571985",
"text": "def edges\n edges_array = []\n vertices.each do |vertex|\n adj_table[vertex.id].each do |node|\n edges_array << _create_edge(vertex.id, node.vertex.id, weight: node.weight)\n end\n end\n edges_array\n end",
"title": ""
},
{
"docid": "78ac84ad3ec466862521e77411f425e0",
"score": "0.4656683",
"text": "def create_relationships(user1)\n users = User.all\n puts '--------------------------------------------'\n puts \"creating relationships for #{user1.username}\"\n following = users[4..50]\n followers = users[5..40]\n following.each { |followed| user1.follow(followed) }\n followers.each { |follower| follower.follow(user1) }\nend",
"title": ""
},
{
"docid": "c8d9e2d0c2e6b9fbaef607154ce48783",
"score": "0.46543583",
"text": "def user_routeditems(user_id, query_params = nil)\n get_user_children(user_id, __method__, query_params)\n end",
"title": ""
},
{
"docid": "2d43c060d28cc067cd21cb52ad06c853",
"score": "0.46522883",
"text": "def relationships\n return [] if empty?\n\n map(&:relationship)\n end",
"title": ""
},
{
"docid": "98326e726936fdb20bb0d46a5196edf8",
"score": "0.4646649",
"text": "def find_edges\n @edges = vertices.map(&:edges).flatten.uniq\n end",
"title": ""
},
{
"docid": "2435320337904e276268c5494fdbf14d",
"score": "0.464408",
"text": "def get_events(user_id)\n user = get_user user_id\n return [] if user.nil?\n\n event_class = ModelFabric.get_class(SocialFramework.event_class)\n\n unless user_id == @root.id\n query = \"social_framework_participant_events.schedule_id = ? AND \" +\n \"social_framework_participant_events.confirmed = ? AND \" +\n \"social_framework_events.particular = ?\"\n event_class.joins(:participant_events).where(query, user.schedule.id,\n true, false).order(start: :desc)\n else\n query = \"social_framework_participant_events.schedule_id = ? AND \" +\n \"social_framework_participant_events.confirmed = ?\"\n event_class.joins(:participant_events).where(query, user.schedule.id,\n true).order(start: :desc)\n end\n end",
"title": ""
},
{
"docid": "6c9de6bef6cd47ecf8ba700949f0d60f",
"score": "0.46327132",
"text": "def descendants(depth_options = {})\n super #.includes(:user)\n end",
"title": ""
},
{
"docid": "8f4b6720374fb290fe803438bb5c17e9",
"score": "0.46312594",
"text": "def user_attributes_for_user(user)\n find_all_of_type_user_attribute.select do |user_attribute|\n connected?(user, user_attribute)\n end\n end",
"title": ""
},
{
"docid": "1358e0c7de22f853461bfd33805df231",
"score": "0.46310204",
"text": "def feed_messages\n following_ids = \"SELECT follow_id FROM relationships WHERE user_id = :user_id\"\n Message.where(\"from_id IN (#{following_ids}) OR from_id = :user_id OR to_id = :user_id\", user_id: id)\n end",
"title": ""
},
{
"docid": "a25e495c3764e397eaeedda39cfb3535",
"score": "0.4630708",
"text": "def feed\n following_ids = \"SELECT followed_id FROM relationships\n WHERE follower_id = :user_id\"\n\n Post.where(\"user_id IN (#{following_ids})\n OR user_id = :user_id\", user_id: id)\n end",
"title": ""
},
{
"docid": "33a798528741dae8024e979f5f73bd20",
"score": "0.46268955",
"text": "def index\n @tag = current_user.tags.find(params[:tag_id]);\n @relationships = @tag.relationships;\n end",
"title": ""
},
{
"docid": "4d6f938ca82744be3ea7b3c7dc06e4f2",
"score": "0.46262568",
"text": "def get_relationships(rel, filter, offset, limit) \n related_entities = []\n if rel == 'resources'\n related_entities << self.work_meta\n end\n related_entities.each do | rel |\n rel.via = self\n end \n related_entities\n end",
"title": ""
},
{
"docid": "f3adde85efb1a1a15eb8ee5e8799c73e",
"score": "0.462529",
"text": "def all_edges\n edge_t = %i[Link Jump Containment Path]\n edges = edge_t.flat_map { |t| records[t].set } if edges.nil?\n end",
"title": ""
},
{
"docid": "249f9b897810a29a2ebff905dda0dca5",
"score": "0.4620525",
"text": "def index\n @relationships = @user.relationships\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @relationships }\n end\n end",
"title": ""
},
{
"docid": "006e81105bb7edb719e890f439d179ad",
"score": "0.46170777",
"text": "def feed\n following_ids = \"SELECT followed_id FROM relationships\n WHERE follower_id = :user_id\"\n Post.where(\"user_id IN (#{following_ids})\n OR user_id = :user_id\", user_id: id)\n end",
"title": ""
},
{
"docid": "006e81105bb7edb719e890f439d179ad",
"score": "0.46170777",
"text": "def feed\n following_ids = \"SELECT followed_id FROM relationships\n WHERE follower_id = :user_id\"\n Post.where(\"user_id IN (#{following_ids})\n OR user_id = :user_id\", user_id: id)\n end",
"title": ""
},
{
"docid": "60213570d6c545b07ff658c18e044bd6",
"score": "0.46059996",
"text": "def graph_to(another_user, opts={:context=>:live, :me_as=>:friend, :him_as=>:friend})\n Graph.where(:context=>opts[:context], :sender_id=>self.id, :sender_role=>opts[:me_as], :recipient_id=>another_user, :recipient_role=>[:him_as]).first ||\n graphs.new( :context=>opts[:context], :sender_role=>opts[:me_as], :recipient_id=>another_user.id, :recipient_role=>opts[:him_as])\n end",
"title": ""
},
{
"docid": "c5d87099d026e2c9184337879a9ec866",
"score": "0.46003285",
"text": "def feed\n follow_ids = \"SELECT followed_id FROM relationships\n WHERE follower_id = :user_id\"\n Post.where(\"user_id IN (#{follow_ids})\n OR user_id = :user_id\", user_id: id)\n end",
"title": ""
},
{
"docid": "32b9ae2493615c3f18742905fb796d36",
"score": "0.4599533",
"text": "def feed\n following_ids = \"SELECT followed_id FROM relationships WHERE follower_id = :user_id\"\n Note.where(\"user_id IN (#{following_ids}) OR user_id = :user_id\", user_id: id)\n end",
"title": ""
},
{
"docid": "60b58be95a64eff54d0657cf25f491b2",
"score": "0.45985556",
"text": "def index\n @relationships = Relationship.where('user1_id = ? AND status = ?', session[:current_user_id], \"Accept\")\n @relationshipsP = Relationship.where('user2_id = ? AND status = ?', session[:current_user_id], \"Pending\")\n end",
"title": ""
},
{
"docid": "d51a4b7d3c860dfdfc4a113f8780b2e8",
"score": "0.45960286",
"text": "def relationships(end_node_id)\n @relationship_map.get(end_node_id) || add_list(end_node_id)\n end",
"title": ""
}
] |
f5db90e31ee3c96fad4b78afdab991d2 | we will insert in database all the subclasses of `mainclass` and possible next matching keys | [
{
"docid": "7523e5ff26c0ff659f7ab9c3add22473",
"score": "0.6651704",
"text": "def insert_subclasses(mainclass)\n subclasses(mainclass).each do |subclass|\n class_instance = instance(subclass)\n request_key = class_instance.request\n breakpoints.insert(request_key, subclass)\n end\n end",
"title": ""
}
] | [
{
"docid": "a0279ee6deae7f9aebb100d1cf2d0ff9",
"score": "0.59751487",
"text": "def sti_subclass_added(key)\n if sti_key_array\n key_array = Array(key)\n Sequel.synchronize{sti_key_array.push(*key_array)}\n superclass.sti_subclass_added(key)\n end\n end",
"title": ""
},
{
"docid": "8cf31cbec8eb5b72f520b73295e24eda",
"score": "0.57833624",
"text": "def classify_subtype(main_feature, sub_feature)\n # First argument identifies Main Feature, the rest sub-features\n feature_con = DB::Mongohandler.new(@dbname, main_feature, @bulk_limit, @host, @port)\n feature_con.use_connection(@connection)\n \n @collection.find({\"tags.\" << main_feature => sub_feature}).each do |doc|\n feature_con.bulk_insert(doc)\n end\n return feature_con.collection.size\n end",
"title": ""
},
{
"docid": "6040712b775bd26a698759b6afa7edda",
"score": "0.5653562",
"text": "def push_to_db\n records.each_key { |klass| write_class(klass) }\n has_and_belongs_to_tables.each_key { |klass| write_habtm(klass) }\n end",
"title": ""
},
{
"docid": "70ab82517ee28d1f0a67f589ecaa4dd0",
"score": "0.56367373",
"text": "def process_subcls(cls)\n cls.getSubClasses(@ontology).each do |subCls|\n @assays << subCls\n process_subcls(subCls)\n end\nend",
"title": ""
},
{
"docid": "179426aa9d97c69fe7b0ef9103a03809",
"score": "0.5622397",
"text": "def update_fields(klass=nil)\n select_class(klass).each do |subclass|\n Page.find(:all, :include => :fields, :conditions => {:class_name => name_for(subclass)}).each do |page|\n existing = lambda { |s| page.fields.detect { |p| s.name.downcase == p.name.downcase } }\n page.fields.create subclass.fields.reject(&existing).map(&:attributes)\n end\n end\n end",
"title": ""
},
{
"docid": "ac608318e577efc81a81c8c593bf25ae",
"score": "0.54814434",
"text": "def update_parts(klass=nil)\n select_class(klass).each do |subclass|\n Page.find(:all, :include => :parts, :conditions => {:class_name => name_for(subclass)}).each do |page|\n existing = lambda { |s| page.parts.detect { |p| s.name.downcase == p.name.downcase } }\n page.parts.create subclass.parts.reject(&existing).map(&:attributes)\n end\n end\n end",
"title": ""
},
{
"docid": "e4c5b94716a2cce57bbd763a5d8e3f1c",
"score": "0.54469264",
"text": "def generate_new_classes\n\t\t\texp = []\n\t\t\t@types.sort_by { |k, v| k.to_s }.each do |key, value|\n\t\t\t\tif value[:obj] && value[:obj].kind_of?(WIN32OLE)\n\t\t\t\t\texp << generate_class(value[:obj], key) \n\t\t\t\tend\n\t\t\tend\n\t\t\texp.join(\"\\n\")\n\t\tend",
"title": ""
},
{
"docid": "5f81d11cdd4ed431f4f0e2cf0b87ab5b",
"score": "0.54428166",
"text": "def prepare_training_documents_by_class\n classes.each_with_object({}) do |klass, training_documents_by_class|\n training_documents_by_class[klass] = training_documents.select { |d| d.klass == klass }\n end\n end",
"title": ""
},
{
"docid": "ee53024116c1456df4cce216563eff6e",
"score": "0.54378504",
"text": "def synchronizeDatabase\n\n # Clean up the database\n Disease.delete_all\n Symptom.delete_all\n Factor.delete_all\n DiseaseSymptom.delete_all\n DiseaseFactor.delete_all\n\n # Load file into a Nokogiri object for parsing\n f = File.open(OWL_FILE)\n doc = Nokogiri::XML(f)\n\n # First register all of the subclasses into the system\n subclasses = doc.css(\"SubClassOf\")\n numRegistered = 0\n numLastRegistered = -1\n while (numLastRegistered < numRegistered)\n numLastRegistered = numRegistered\n subclasses.each do |subclass|\n\n classes = subclass.css(\"Class\")\n if classes.length == 2\n first = classes[0].attr(\"IRI\")[1..-1]\n second = classes[1].attr(\"IRI\")[1..-1]\n end\n\n # If the subclass registers an ObjectProperty, only register something if the respective classes exist\n objectProperties = subclass.css(\"ObjectAllValuesFrom\")\n if objectProperties.length > 0\n # The first should be a disease, the second could be a symptom or risk factor\n disease = Disease.find_by_name(first)\n symptom = Symptom.find_by_name(second)\n factor = Factor.find_by_name(second)\n if disease\n if symptom and DiseaseSymptom.where(:disease_id => disease.id, :symptom_id => symptom.id).empty?\n DiseaseSymptom.create(:disease_id => disease.id, :symptom_id => symptom.id)\n numRegistered += 1\n elsif factor and DiseaseFactor.where(:disease_id => disease.id, :factor_id => factor.id).empty?\n DiseaseFactor.create(:disease_id => disease.id, :factor_id => factor.id)\n numRegistered += 1\n end\n end\n next\n end\n\n # If there are two Class child objects, then the first is a subclass of the second\n child = first\n parent = second\n\n # Checks for existence\n has_created = false\n if [\"Disease\", \"Symptom\", \"Risk_factor\"].include?(parent)\n # The first three cases are for parents, the next three are for nested classes\n baseParams = {:parent => nil, :name => child}\n nestedParams = {:parent => parent, :name => child}\n case parent\n when \"Disease\"\n has_created = Disease.where(baseParams).exists?\n when \"Symptom\"\n has_created = Symptom.where(baseParams).exists?\n when \"Risk_factor\"\n has_created = Factor.where(baseParams).exists?\n else\n has_created_disease = Disease.where(nestedParams).exists?\n has_created_symptom = Symptom.where(nestedParams).exists?\n has_created_factor = Factor.where(nestedParams).exists?\n end\n has_created = (has_created || has_created_disease || has_created_symptom || has_created_factor)\n end\n\n # We have three registered Class objects\n if !has_created\n case parent\n when \"Disease\"\n Disease.create(:name => child)\n numRegistered += 1\n when \"Symptom\"\n Symptom.create(:name => child)\n numRegistered += 1\n when \"Risk_factor\"\n Factor.create(:name => child)\n numRegistered += 1\n else\n # Checks to see if its parent is a disease\n potentialDisease = Disease.find_by_name(parent)\n if potentialDisease and potentialDisease.name != child\n if !Disease.find_by_name(child)\n Disease.create(:name => child, :parent_id => potentialDisease.id)\n numRegistered += 1\n end\n end\n # Checks to see if its parent is a symptom\n potentialSymptom = Symptom.find_by_name(parent)\n if potentialSymptom and potentialSymptom.name != child\n if !Symptom.find_by_name(child)\n Symptom.create(:name => child, :parent_id => potentialSymptom.id, :severity => 1)\n numRegistered += 1\n end\n end\n # Checks to see if its parent is a risk factor\n potentialFactor = Factor.find_by_name(parent)\n if potentialFactor and potentialFactor.name != child\n if !Factor.find_by_name(child)\n Factor.create(:name => child, :parent_id => potentialFactor.id)\n numRegistered += 1\n end\n end\n end\n end\n end\n end\n\n # Apply all of the annotations\n annotations = doc.css(\"AnnotationAssertion\")\n annotations.each do |annotation|\n symptom = Symptom.find_by_name(annotation.css(\"IRI\").text[1..-1])\n question = annotation.css(\"Literal\").text\n if (question == \"major\")\n symptom.severity = 10\n elsif (question == \"minor\")\n symptom.severity = 1.5\n else\n symptom.question = question\n symptom.save\n end\n end\n\n puts \"Diseases: #{Disease.all.count}\\tSymptoms: #{Symptom.all.count}\\tRisk_factors: #{Factor.all.count}\\n\"\n\n # Clean-up\n f.close\nend",
"title": ""
},
{
"docid": "79dd67a7e4c72f9e3a638fb20c58aee9",
"score": "0.5436393",
"text": "def inherited(subclass)\n super\n Sequel.synchronize{subclasses << subclass}\n subclass.instance_variable_set(:@subclasses, [])\n end",
"title": ""
},
{
"docid": "f38e762f0f2978c878d4ae1d4380b0eb",
"score": "0.54077744",
"text": "def assign_class_generalizations\n\n # Iterate through each generalizations and try to\n # assign the #superclass attribute of the specific Class\n @generalizations.each do |generalization|\n generalization.try_assign_superclass(@classes)\n end\n end",
"title": ""
},
{
"docid": "eb59faab6ff109bf3966680c84076be3",
"score": "0.54035807",
"text": "def insert_all; end",
"title": ""
},
{
"docid": "67b0d0690b4108efbbef85ba8b351bd4",
"score": "0.5372377",
"text": "def _insert\n return super if model == model.cti_base_model\n iid = @values[primary_key] \n m = model\n m.cti_tables.each do |table|\n h = {}\n h[m.primary_key] ||= iid if iid\n m.cti_columns[table].each{|c| h[c] = @values[c] if @values.include?(c)}\n nid = m.db.from(table).insert(h)\n iid ||= nid\n end\n @values[primary_key] = iid\n end",
"title": ""
},
{
"docid": "63d0b05b9af46df2ea607a9f4354b07b",
"score": "0.5283238",
"text": "def save_my_vars\n\t #25Feb2013-copy value of subclassX to variable sub_class_val----\n\t if main_class == '1'#sub_class != nil\n\t\t sub_class_val = sub_class \n\t elsif main_class == '2'\n\t\t sub_class_val = sub_class2 \n\t elsif main_class == '3'\n\t\t sub_class_val = sub_class3 \n\t elsif main_class == '4'\n\t\t sub_class_val = sub_class4 \n\t elsif main_class == '5'\n\t\t sub_class_val = sub_class5 \n\t elsif main_class == '6'\t\n\t\t sub_class_val = main_class \t\t#sub_classX not exist\n\t elsif main_class == '8'\n\t\t sub_class_val = main_class \t\t#sub_classX not exist\n\t elsif main_class == '9'\n\t\t sub_class_val = main_class \t\t#sub_classX not exist\n\t end\n\t #25Feb2013-copy value of subclassX to variable sub_class_val----\n\t \n\t if cofile_code == nil\t #===========24Feb2013-if NEW file (cofile_code not yet saved in db)- assign values\n\t\t unless sub_class_val == nil \n\t\t\t self.classification = sub_class_val.to_i\t\t#23Feb2013-changed from sub_class to sub_class_val\n\t\t\t self.cofile_code = (suggested_serial_no(sub_class_val)).to_s\n\t\t end\n\t else\t#===========25Feb2013-if EDIT file\n\t \n\t classification_db = Cofile.find(id).classification.to_s #read classification in db\n\t \n\t\t if classification_db != sub_class_val.to_s ##*********26Feb2013 - if previously saved classification data differ from currently selected by user, make changes to db \n\t\t self.classification = sub_class_val.to_i\t\t#23Feb2013-changed from sub_class to sub_class_val\n \t\t\t self.cofile_code = (suggested_serial_no(sub_class_val)).to_s\n \t\telse ##26Feb2013********* - else don't make any changes to db \n \t\t #ignores - do nothing - cofile_code & classification in db remains unchanged\n\t\t end \n\t\t \n\t end\n end",
"title": ""
},
{
"docid": "8a6fe74089c045ef64e8e82ba11d575c",
"score": "0.5267872",
"text": "def apply_inserts\n @adds.each do |key|\n data = @seen[key]\n if keyfield\n @catalog.catalog.insert_one(\n @domainkey => domain,\n idfield => key,\n keyfield => data\n )\n else\n # top-level extension\n @catalog.catalog.insert_one(\n data.merge(\n @domainkey => domain,\n idfield => key\n )\n )\n end\n end\n end",
"title": ""
},
{
"docid": "d1eafe38e34a1558694aa2c0c9bbca8f",
"score": "0.5261251",
"text": "def insert_data\n column_names = results.fields\n table_name = @new_layer_table_name # here for scope issues with dynamic class...\n row = Class.new(ActiveRecord::Base) do\n set_table_name table_name\n end\n results.each do |result| \n r = row.new\n result.each_with_index do |value, column_index|\n r[column_names[column_index].downcase] = value \n end\n r.save\n end\n end",
"title": ""
},
{
"docid": "0ddd44d71fa334f08fefe91f6cc7e042",
"score": "0.5260768",
"text": "def create_classes\n user = self.create_user\n self.classes.each do |classroom|\n room = Classroom.find_or_create_by(class_name: classroom[:className], class_id: classroom[:class_id])\n if !user.classrooms.include? room\n room.users << user\n room.save\n self.create_roster(room, classroom)\n end\n end\n ##\n user.save\n user\n end",
"title": ""
},
{
"docid": "f6b919ffd1562a035a7fc9bb2ad06b31",
"score": "0.52555084",
"text": "def load_mobile_classes\n log(\"Loading Class tables... \", false, 70)\n\n class_rows = @db[:classes].to_hash(:id)\n affect_rows = @db[:class_affects].all\n genre_rows = @db[:class_genres].all\n equip_slot_rows = @db[:class_equipment_slots].all\n skill_rows = @db[:class_skills].all\n spell_rows = @db[:class_spells].all\n stat_rows = @db[:class_stats].all\n\n class_rows.each do |id, row|\n @mobile_classes[id] = MobileClass.new(row)\n end\n genre_rows.each do |genre_row|\n genre = @genres[genre_row[:genre_id]]\n if genre\n @mobile_classes[genre_row[:class_id]].genres << genre\n end\n end\n equip_slot_rows.each do |eq_slot_row|\n eq_slot_info = @equip_slot_infos[eq_slot_row[:equip_slot_id]]\n if eq_slot_info\n @mobile_classes[eq_slot_row[:class_id]].equip_slot_infos << eq_slot_info\n end\n end\n affect_rows.each do |aff_row|\n @mobile_classes[aff_row[:class_id]].affect_models << AffectModel.new(aff_row)\n end\n skill_rows.each do |skill_row|\n skill = @skills.find { |skill| skill.id == skill_row[:skill_id] }\n if skill\n @mobile_classes[skill_row[:class_id]].skills << skill\n end\n end\n spell_rows.each do |spell_row|\n spell = @spells.find { |spell| spell.id == spell_row[:spell_id] }\n if spell\n @mobile_classes[spell_row[:class_id]].spells << spell\n end\n end\n stat_rows.each do |stat_row|\n stat = @stats[stat_row[:stat_id]]\n if stat\n @mobile_classes[stat_row[:class_id]].add_stat(stat, stat_row[:value])\n end\n end\n log( \"done.\" )\n end",
"title": ""
},
{
"docid": "387eaa697ffe616b09069e03af956a46",
"score": "0.52450454",
"text": "def create_activerecord_class(table_name)\r\n\t\t\t\tprimary_keys = []\r\n\r\n\t\t\t\t# Loop through the columns to get the primary key - we won't know this\r\n\t\t\t\t# and although we could have the user input this data, it might be more\r\n\t\t\t\t# helpful to just retrieve it ourselves.\r\n\t\t\t\tActiveRecord::Base.connection.columns(table_name).each do |col_obj|\r\n\t\t\t\t\tcase @configuration[:datastore][:type]\r\n\t\t\t\t\twhen 'sqlserver'\r\n\t\t\t\t\t\tprimary_keys.push(col_obj.instance_variable_get(\"@name\")) if col_obj.instance_variable_get(\"@sqlserver_options\")[:is_primary] == true\r\n\t\t\t\t\tend\r\n\t\t\t\tend\r\n\r\n\t\t\t\tputs \"There is/are #{primary_keys.length} primary key(s).\"\r\n\t\t\t\t# puts \"#{primary_keys[0].to_sym}\" if primary_keys.length == 1\r\n\t\t\t\t# abort(\"#{primary_keys.map! { |val| val.to_sym }.join(\", \")}\")\r\n\r\n\t\t\t\t# Now return the class with the table name and primary keys set\r\n\t\t\t\tClass.new(ActiveRecord::Base) do\r\n\t\t\t\t\tself.table_name = table_name\r\n\r\n\t\t\t\t\tif primary_keys.length == 1\r\n\t\t\t\t\t\tself.primary_key = primary_keys[0]\t# Set the primary key if there is only 1\r\n\t\t\t\t\telsif primary_keys.length > 1\r\n\t\t\t\t\t\t# Otherwise use the composite_primary_keys gem to set the primary keys\r\n\t\t\t\t\t\t# It uses symbols joined with a comma as the parameters\r\n\t\t\t\t\t\tself.primary_keys = primary_keys.map! { |val| val.to_sym }.join(\", \")\r\n\t\t\t\t\tend\r\n\t\t\t\tend\r\n\r\n\t\t\t\t# Create a public class write_attr to access the private write_attribute method\r\n\t\t\t\t# klass.send :define_method, :write_attr do |attr_name = nil, attr_value = nil|\r\n\t\t\t\t# \t# In order to call the private method, we have to use .send which accesses ALL of the methods in the class\r\n\t\t\t\t# \tself.send :write_attribute, attr_name.to_sym, attr_value\r\n\t\t\t\t# end\r\n\r\n\t\t\t\t# klass\r\n\t\t\tend",
"title": ""
},
{
"docid": "c2db1e2f0b58a96bc47b38c8f55b41ee",
"score": "0.52330697",
"text": "def init_classes\r\n @class_names = list_classes.sort.reject { |n| n =~ /package-info\\.class$/ }.collect { |cl| JavaClassFileName.new(cl) } \r\n pairs = @class_names.map { |name| [name.file_name, 1] }.flatten\r\n @class_lookup = Hash[ *pairs ] # file_name (String) => anything\r\n end",
"title": ""
},
{
"docid": "e7b4fee6ecc1342c971f0c471b12bbd2",
"score": "0.5214144",
"text": "def generate_classes(module_instance)\n special_names = special_classes.map{|k| k.name}\n special_names << \"Rod\"\n superclasses = {}\n @metadata.reject{|k,o| special_names.include?(k)}.each do |k,o|\n superclasses[k] = o[:superclass]\n end\n superclass_tree = {}\n superclasses.each do |klass,superclass|\n superclass_tree[klass] = []\n current_superclass = superclass\n loop do\n break if current_superclass.nil?\n superclass_tree[klass] << current_superclass\n break if current_superclass == \"Rod::Model\"\n current_superclass = superclasses[current_superclass]\n end\n end\n superclasses.keys.sort do |klass1,klass2|\n if superclass_tree[klass1].include?(klass2)\n 1\n elsif superclass_tree[klass2].include?(klass1)\n -1\n else\n klass1 <=> klass2\n end\n end.each do |klass_name|\n metadata = @metadata[klass_name]\n original_name = klass_name\n if module_instance != Object\n prefix = module_instance.name + \"::\"\n if superclasses.keys.include?(metadata[:superclass])\n metadata[:superclass] = prefix + metadata[:superclass]\n end\n [:fields,:has_one,:has_many].each do |property_type|\n next if metadata[property_type].nil?\n metadata[property_type].each do |property,options|\n if superclasses.keys.include?(options[:options][:class_name])\n metadata[property_type][property][:options][:class_name] =\n prefix + options[:options][:class_name]\n end\n end\n end\n # klass name\n klass_name = prefix + klass_name\n @metadata.delete(original_name)\n @metadata[klass_name] = metadata\n end\n klass = Model.generate_class(klass_name,metadata)\n klass.model_path = Model.struct_name_for(original_name)\n @classes << klass\n klass.database_class(self.class)\n end\n end",
"title": ""
},
{
"docid": "c7c598d860bdd970d2da1a73c7d040d6",
"score": "0.5204627",
"text": "def add_class_search_index(index)\n debug_msg \" generating class search index\"\n \n @classes.select { |klass| \n klass.document_self_or_methods\n }.sort.each do |klass|\n index[:searchIndex].push( search_string(klass.name) )\n index[:longSearchIndex].push( search_string(klass.parent.name) )\n index[:info].push([\n klass.name, \n klass.parent.full_name, \n klass.path, \n klass.module? ? '' : (klass.superclass ? \" < #{String === klass.superclass ? klass.superclass : klass.superclass.full_name}\" : ''), \n snippet(klass.comment),\n TYPE_CLASS\n ])\n end\n end",
"title": ""
},
{
"docid": "7d36593a6263c7ea2dcad22bdf3cee10",
"score": "0.5195605",
"text": "def init_classes\r\n @class_names = list_classes.\r\n reject { |n| n =~ /package-info\\.class$/ }.\r\n find_all { |n| valid_java_name?(n) }.\r\n sort.\r\n collect { |cl| JavaClassFileName.new(cl) } \r\n pairs = @class_names.map { |name| [name.file_name, 1] }.flatten\r\n @class_lookup = Hash[ *pairs ] # file_name (String) => anything\r\n end",
"title": ""
},
{
"docid": "f689ac59e1cf7a48ef02de9deaeeb8d7",
"score": "0.5184714",
"text": "def get_subclass(genome, ag_class, cl_class, subclass_type)\n f_genome = self.where(:genome => genome)\n ag_eval = ag_class == \"All antigens\" && subclass_type == \"ag\"\n cl_eval = cl_class == \"All cell types\" && subclass_type == \"cl\"\n if ag_eval || cl_eval\n {}\n else\n f_ag = ag_class == \"All antigens\" ? f_genome : f_genome.where(:agClass => ag_class)\n f_cl = cl_class == \"All cell types\" ? f_ag : f_ag.where(:clClass => cl_class)\n h = { \"ag\" => :agSubClass, \"cl\" => :clSubClass }\n filtered = f_cl.map{|r| r.send(h[subclass_type]) }\n index = {}\n filtered.each do |subclass|\n index[subclass] ||= 0\n index[subclass] += 1\n end\n index\n end\n end",
"title": ""
},
{
"docid": "f689ac59e1cf7a48ef02de9deaeeb8d7",
"score": "0.5184714",
"text": "def get_subclass(genome, ag_class, cl_class, subclass_type)\n f_genome = self.where(:genome => genome)\n ag_eval = ag_class == \"All antigens\" && subclass_type == \"ag\"\n cl_eval = cl_class == \"All cell types\" && subclass_type == \"cl\"\n if ag_eval || cl_eval\n {}\n else\n f_ag = ag_class == \"All antigens\" ? f_genome : f_genome.where(:agClass => ag_class)\n f_cl = cl_class == \"All cell types\" ? f_ag : f_ag.where(:clClass => cl_class)\n h = { \"ag\" => :agSubClass, \"cl\" => :clSubClass }\n filtered = f_cl.map{|r| r.send(h[subclass_type]) }\n index = {}\n filtered.each do |subclass|\n index[subclass] ||= 0\n index[subclass] += 1\n end\n index\n end\n end",
"title": ""
},
{
"docid": "4c20e0407613e55ab14f7359cf6846e6",
"score": "0.51810884",
"text": "def sort_classes(timetable, classes)\n classes.each do |c|\n if !(cmodule = timetable.module_for_code(c.code))\n cmodule = Tableau::Module.new(c.code)\n timetable.push_module(cmodule)\n end\n\n cmodule.add_class(c)\n end\n end",
"title": ""
},
{
"docid": "e97c955fbfd72828999d57ee49360864",
"score": "0.5175694",
"text": "def populate_classes_from_search(classes, ontology_acronyms=nil)\n class_ids = []\n acronyms = (ontology_acronyms.nil?) ? [] : ontology_acronyms\n classes.each {|c| class_ids << c.id.to_s; acronyms << c.submission.ontology.acronym.to_s unless ontology_acronyms}\n acronyms.uniq!\n old_classes_hash = Hash[classes.map {|cls| [cls.submission.ontology.id.to_s + cls.id.to_s, cls]}]\n params = {\"ontology_acronyms\" => acronyms}\n\n # Use a fake phrase because we want a normal wildcard query, not the suggest.\n # Replace this with a wildcard below.\n get_term_search_query(\"avoid_search_mangling\", params)\n params.delete(\"ontology_acronyms\")\n params.delete(\"q\")\n params[\"qf\"] = \"resource_id\"\n params[\"fq\"] << \" AND #{get_quoted_field_query_param(class_ids, \"OR\", \"resource_id\")}\"\n params[\"rows\"] = 99999\n # Replace fake query with wildcard\n resp = LinkedData::Models::Class.search(\"*:*\", params)\n\n classes_hash = {}\n resp[\"response\"][\"docs\"].each do |doc|\n doc = doc.symbolize_keys\n resource_id = doc[:resource_id]\n doc.delete :resource_id\n doc[:id] = resource_id\n ontology_uri = doc[:ontologyId].sub(/\\/submissions\\/.*/, \"\")\n ont_uri_class_uri = ontology_uri + resource_id\n old_class = old_classes_hash[ont_uri_class_uri]\n next unless old_class\n doc[:submission] = old_class.submission\n doc[:properties] = MultiJson.load(doc.delete(:propertyRaw)) if include_param_contains?(:properties)\n instance = LinkedData::Models::Class.read_only(doc)\n classes_hash[ont_uri_class_uri] = instance\n end\n\n classes_hash\n end",
"title": ""
},
{
"docid": "e7323b2ebe6c81ce24bcb5187b9f1e0b",
"score": "0.5171979",
"text": "def get_classes\n\n doc = File.open(@arg[:conf]) { |f| Nokogiri::XML(f) }\n\n doc.xpath(\"//class\").each do |c|\n\n obj_table = {}\n obj_table[:collections] = []\n obj_table[:attributes] = []\n obj_table[:references] = []\n\n # get attributes of object\n c.attribute_nodes.each do |att|\n key = att.name.to_s.gsub(\"-\",\"_\")\n if key == \"extends\"\n obj_table[key.to_sym] = []\n att.value.to_s.split(\" \").each do |c|\n obj_table[key.to_sym] << c\n end\n else\n obj_table[key.to_sym] = att.value.to_s\n end\n end\n\n obj_table[:processed] = false\n\n # get collections for object\n c.children.each do |elem|\n\n if elem.name == \"collection\"\n collection = {}\n elem.attribute_nodes.each do |att|\n key = att.name.to_s.gsub(\"-\",\"_\")\n collection[key.to_sym] = att.value\n end\n obj_table[:collections] << collection if (! collection.empty? and obj_table[:name] != collection[:referenced_type])\n elsif elem.name == \"attribute\"\n elem.attribute_nodes.each do |att|\n if att.name == \"name\"\n obj_table[:attributes] << att.value\n end\n end\n elsif elem.name == \"reference\"\n reference = {}\n elem.attribute_nodes.each do |att|\n key = att.name.to_s.gsub(\"-\",\"_\")\n reference[key.to_sym] = att.value\n end\n obj_table[:references] << reference\n end\n\n end\n\n # get reference for object, what is a reference ??\n # adding object to all objects\n if ! @all_obj.has_key? obj_table[:name]\n @all_obj[obj_table[:name]] = obj_table\n else\n obj_table[:collections].each do |collection_it|\n have_collection = false\n have_collection = @all_obj[obj_table[:name]][:collections].any? { |h| h[:name] == collection_it[:name]}\n if ! have_collection\n @all_obj[obj_table[:name]][:collections] << collection_it\n end\n end\n\n end\n\n end\n\nend",
"title": ""
},
{
"docid": "a553762980010dddcde8e49de7b98264",
"score": "0.51674265",
"text": "def start_class(class_node)\n @last_klazz = class_node.class_name.to_s\n @models << @last_klazz\n end",
"title": ""
},
{
"docid": "d57287ccb62ce5ddace517e1f8dc41c2",
"score": "0.5163162",
"text": "def inherited(subclass)\n super\n\n subclass.class_attribute(:auxiliary_statements_list)\n subclass.auxiliary_statements_list = Hash.new\n record_class = ActiveRecord::Relation._record_class_attribute\n\n # Define helper methods to return the class of the given records\n subclass.auxiliary_statement record_class do |cte|\n pg_class = ::Arel::Table.new('pg_class')\n arel_query = ::Arel::SelectManager.new(pg_class)\n arel_query.project(pg_class['oid'], pg_class['relname'].as(record_class.to_s))\n\n cte.query 'pg_class', arel_query.to_sql\n cte.attributes col(record_class) => record_class\n cte.join tableoid: :oid\n end\n\n # Define the dynamic attribute that returns the same information as\n # the one provided by the auxiliary statement\n subclass.dynamic_attribute(record_class) do\n next self.class.table_name unless self.class.physically_inheritances?\n\n pg_class = ::Arel::Table.new('pg_class')\n source = ::Arel::Table.new(subclass.table_name, as: 'source')\n quoted_id = ::Arel::Nodes::Quoted.new(self.class.connection.quote(id))\n\n query = ::Arel::SelectManager.new(pg_class)\n query.join(source).on(pg_class['oid'].eq(source['tableoid']))\n query.where(source[subclass.primary_key].eq(quoted_id))\n query.project(pg_class['relname'])\n\n self.class.connection.select_value(query)\n end\n end",
"title": ""
},
{
"docid": "2be053930e925a1e7e919f0d7100aeea",
"score": "0.5157565",
"text": "def set_main_class(main_class)\n @@main_class[self] = main_class.to_s\n end",
"title": ""
},
{
"docid": "8cabb25317846bbeee00dc53cfeed191",
"score": "0.51352453",
"text": "def subclasses\n @subclasses ||= {}\n end",
"title": ""
},
{
"docid": "0a512a742501da8d983726ab42ed0e79",
"score": "0.5133732",
"text": "def subclass_param_ids\n subclasses.map {|k| \"#{k.name.downcase}_id\"}.map(&:to_sym)\n end",
"title": ""
},
{
"docid": "0a512a742501da8d983726ab42ed0e79",
"score": "0.5133732",
"text": "def subclass_param_ids\n subclasses.map {|k| \"#{k.name.downcase}_id\"}.map(&:to_sym)\n end",
"title": ""
},
{
"docid": "8efa2e9e22badd46f3e8036ee2a72915",
"score": "0.51187736",
"text": "def build_all(klass)\n load_all(collection_name(klass)).map { |hash| klass.new(hash) }\n end",
"title": ""
},
{
"docid": "0cebe1e86690f01206f3b8ff9b358ad9",
"score": "0.5111583",
"text": "def self_and_subclasses\n subclasses.insert(0, self)\n end",
"title": ""
},
{
"docid": "8bbb6df692319d6d7c28b2f48e752dea",
"score": "0.51115155",
"text": "def transform_class(id)\n picked_class = PickableClass.find(id)\n self.rpg_class = picked_class.name\n self.save\n end",
"title": ""
},
{
"docid": "5c20ac8769f0275d6adf261fc8b7cb8d",
"score": "0.50936496",
"text": "def inherited(subclass)\n super\n Sequel.synchronize{subclasses << subclass}\n on_subclass.call(subclass) if on_subclass\n end",
"title": ""
},
{
"docid": "d06541429d6c72e53d20974ccea7f479",
"score": "0.5075077",
"text": "def instantiate_subclasses(klass)\n klass.descendants.sort.map do |c|\n c.new(config)\n end\n end",
"title": ""
},
{
"docid": "37f2f901906cfef7122d475dc4ba5de6",
"score": "0.5058864",
"text": "def manage_classes(*classes)\n classes.flatten!\n classes.compact!\n\n if classes.empty?\n mc = self.class.managed_classes\n\n classes = manageable_classes.flatten\n classes = classes.reject { |c| mc.member?(c) || !manageable?(c) }\n end\n\n classes.each { |c| Relation.resolve_targets(c) }\n\n # The polymorpic resolution step creates more manageable classes.\n classes += classes.map { |c| Relation.resolve_polymorphic_relations(c) }\n\n classes.flatten!\n\n# classes = classes.reject { |c| !c or self.class.managed?(c) }\n\n sc = @store_class.allocate\n\n if Og.use_uuid_primary_keys\n begin\n Og.require \"model/uuid\"\n rescue LoadError\n error \"Please install the uuidtools gem\"\n end\n classes.each { |c| c.include UUIDPrimaryKey }\n else\n sc = @store_class.allocate\n classes.each { |c| sc.force_primary_key(c) }\n end\n\n classes.each { |c| Relation.resolve_targets(c) }\n classes.each { |c| Relation.resolve_names(c) }\n\n debug \"Og manageable classes: #{classes.inspect}\" if $DBG\n\n classes.each { |c| manage(c) }\n end",
"title": ""
},
{
"docid": "3adc09c490c574a292c295f174844230",
"score": "0.50419813",
"text": "def add_class_search_index(index)\n debug_msg \"generating class search index\"\n\n classes.select { |klass| klass.document_self_or_methods }.sort.each do |klass|\n modulename = klass.module? ? '' : (klass.superclass ? (String === klass.superclass ? klass.superclass : klass.superclass.full_name) : '')\n index[:searchIndex].push( search_string(klass.name) )\n index[:longSearchIndex].push( search_string(klass.parent.full_name) )\n index[:info].push([\n klass.name,\n klass.parent.full_name,\n klass.path,\n modulename ? \" < #{modulename}\" : '',\n snippet(klass.comment),\n TYPE_CLASS\n ])\n end\n end",
"title": ""
},
{
"docid": "bd286831b4b49e88db0d3ea69ab2d642",
"score": "0.5040515",
"text": "def add_class_search_index(index)\n debug_msg \" generating class search index\"\n @classes.uniq.select { |klass|\n klass.document_self_or_methods\n }.sort.each do |klass|\n modulename = klass.module? ? '' : (klass.superclass ? (String === klass.superclass ? klass.superclass : klass.superclass.full_name) : '')\n debug_msg \" #{klass.parent.full_name}::#{klass.name}\"\n index[:searchIndex].push( search_string(klass.name) )\n index[:longSearchIndex].push( search_string(klass.parent.full_name) )\n files = klass.in_files.map{ |file| file.absolute_name }\n index[:info].push([\n klass.name,\n files.include?(klass.parent.full_name) ? files.first : klass.parent.full_name,\n klass.path,\n modulename ? \" < #{modulename}\" : '',\n snippet(klass.comment),\n TYPE_CLASS\n ])\n end\n end",
"title": ""
},
{
"docid": "d7b82237ec309f81d386ba8ba679ad8a",
"score": "0.50215185",
"text": "def register_as(*names)\n names.each do |n|\n fail 'Subclass key already taken - please use another one because all subclass keys are shared' if @@subclasses.key?(n)\n @@subclasses[n] = self\n log.debug \"registered instance for #{self.class.name} under #{n}\"\n end\n end",
"title": ""
},
{
"docid": "8998e2e54afb8ef2e24baca65ca4877f",
"score": "0.50201607",
"text": "def refine_classes\n\n # Try to fit Classes into Packages, add Attributes to Classes\n @classes.each do |current_class|\n current_class.try_match_package(@packages)\n current_class.try_add_attribute(@attributes)\n end\n\n # Link Classes together\n @associations.each do |current_association|\n current_association.try_link(@classes)\n end\n\n # Empty collections and dereference\n remove_array_instance_var(\"attributes\")\n remove_array_instance_var(\"associations\")\n end",
"title": ""
},
{
"docid": "c994a647079aafc607bbf852b1af98c5",
"score": "0.50200015",
"text": "def inherited(subclass)\n super\n key = Array(sti_key_map[subclass]).dup\n sti_subclass_added(key)\n rp = dataset.row_proc\n subclass.set_dataset(sti_subclass_dataset(key), :inherited=>true)\n subclass.instance_eval do\n @dataset = @dataset.with_row_proc(rp)\n @sti_key_array = key\n self.simple_table = nil\n end\n end",
"title": ""
},
{
"docid": "17a6bd96c36880112241fffb75a2ee1c",
"score": "0.5009196",
"text": "def rescue_from(error_class, error_handler)\n subclasses_handlers = {}\n this_level_subclasses = []\n # During this traversal, do two things:\n # - Identify any already-registered subclasses of this error class\n # and gather them up to be inserted _under_ this class\n # - Find the point in the index where this handler should be inserted\n # (That is, _under_ any superclasses, or at top-level, if there are no superclasses registered)\n handlers = @handlers[:subclass_handlers]\n while (handlers) do\n this_level_subclasses.clear\n # First, identify already-loaded handlers that belong\n # _under_ this one. (That is, they're handlers\n # for subclasses of `error_class`.)\n handlers.each do |err_class, handler|\n if err_class < error_class\n subclasses_handlers[err_class] = handler\n this_level_subclasses << err_class\n end\n end\n # Any handlers that we'll be moving, delete them from this point in the index\n this_level_subclasses.each do |err_class|\n handlers.delete(err_class)\n end\n\n # See if any keys in this hash are superclasses of this new class:\n next_index_point = handlers.find { |err_class, handler| error_class < err_class }\n if next_index_point\n handlers = next_index_point[1][:subclass_handlers]\n else\n # this new handler doesn't belong to any sub-handlers,\n # so insert it in the current set of `handlers`\n break\n end\n end\n # Having found the point at which to insert this handler,\n # register it and merge any subclass handlers back in at this point.\n this_class_handlers = handlers[error_class]\n this_class_handlers[:handler] = error_handler\n this_class_handlers[:subclass_handlers].merge!(subclasses_handlers)\n nil\n end",
"title": ""
},
{
"docid": "25b99e85ad382d78720f8df72cd15bba",
"score": "0.5000009",
"text": "def parse_classes(confdata)\n regex = /^class\\s+([A-Za-z0-9_-]+)\\s+\\{(.*?)\\}/m\n \n classes = Hash.new\n confdata.scan(regex) do |m|\n classes[m[0]] = m[1]\n end\n \n classes\n end",
"title": ""
},
{
"docid": "9cb05a850c90bdde6491e0c0611c8618",
"score": "0.49965662",
"text": "def store_new\n @new.each do |klass, models|\n models.delete_if { |model| model.blank? }\n size = models.size\n @process.info \"Storing #{size} #{klass.name.pluralize} (#{@progress}/#{@line_of_diff}/#{@diff_size})\"\n # Grouping them might not be necssary, but it sure makes debugging easier...\n group_size = 2000\n if models.empty?\n @process.warn \"No models to import, skipping!\"\n next\n end\n models.in_groups_of(group_size, false) do |group|\n begin\n klass.import! group.compact, validate: false\n rescue => e\n if e.message =~ /row (\\d+)\\b/\n row = Regexp.last_match(1).to_i\n # NOT a good idea to find and skip the row in question because of referential integrity; if you skip a node,\n # you'll end up with media and names with a \"parent\" that's missing, which will cause errors. :\\ You should\n # instead figure out what the problem was and add a filter for the offending chracter(s) to the harvesting\n # code where appropriate.\n raise \"#{e.class} while parsing something around here: #{group[row-1..row+1].to_json}\"\n else\n group.each_with_index do |instance, index|\n begin\n klass.import! [instance], validate: false # Let it fail on the single row that had a problem!\n rescue => e\n @process.warn \"Failed to import instance #{index}: #{instance}\"\n @process.warn \"group around it: #{group[index-1..index+1].pretty_inspect}\"\n raise e\n end\n end\n end\n end\n end\n end\n end",
"title": ""
},
{
"docid": "d42a05b2b1f0600036814ae9a6d292ed",
"score": "0.49942538",
"text": "def try_assign_superclass(p_classes)\n\n # When both attributes present,\n if (@general_class != nil) && (@specific_class != nil)\n\n # Iterate through all proposed Classes, trying to match\n # both the generic as well as the specific Class ID to\n # a given instance of a #Klass\n p_classes.each do |current_class|\n @general_class = current_class if current_class.is_my_id?(@general_class)\n @specific_class = current_class if current_class.is_my_id?(@specific_class)\n end\n\n # If both Classes were found, assign #superclass of the specific class\n if (@general_class.is_a?(Klass)) && (@specific_class.is_a?(Klass))\n @specific_class.superclass = @general_class\n end\n\n end\n end",
"title": ""
},
{
"docid": "1e7e03283c449ddeec3e909c6b5c5c89",
"score": "0.4988925",
"text": "def sti_subclass_dataset(key)\n sti_dataset.where(SQL::QualifiedIdentifier.new(sti_dataset.first_source_alias, sti_key)=>Sequel.delay{Sequel.synchronize{key}})\n end",
"title": ""
},
{
"docid": "fb37bda1ebd6ae84113bdd304cd54fef",
"score": "0.49857277",
"text": "def add_values_and_associations(dictionary)\n dictionary.keys.each do |model_class|\n model = dictionary[model_class]\n next unless model.new_record?\n @new_model = model\n common_model_values(model)\n get_all_associations(model_class).each do |assoc|\n name = get_association_name(assoc)\n case\n when name == :authable then set_authable(model)\n when name == :ownerable then set_ownerable(model)\n when is_polymorphic_association?(assoc)\n set_polymorphic_model(model, name)\n else\n next if is_through_association?(assoc)\n klass = get_association_model_class(assoc)\n next if klass.blank?\n assoc_model = dictionary[klass]\n if assoc_model.present?\n if is_has_many?(model_class, name)\n model.send \"#{name}=\", [assoc_model]\n else\n model.send \"#{name}=\", assoc_model\n end\n else\n next unless model_classes_in_same_namespace?(model_class, klass)\n @new_model = new_model = klass.new\n common_model_values(new_model)\n set_authable(new_model)\n set_ownerable(new_model)\n poly_assocs = get_belongs_to_associations(klass).select {|a| is_polymorphic_association?(a)}\n poly_names = poly_assocs.map {|a| get_association_name(a)} - [:authable, :ownerable]\n poly_names.each do |name|\n set_polymorphic_model(new_model, name)\n end\n name = get_model_association_method(new_model, model_class.name)\n if is_has_many?(klass, name)\n new_model.send \"#{name}=\", [model]\n else\n new_model.send \"#{name}=\", model\n end\n dictionary[klass] = new_model\n end\n end\n end\n end\n end",
"title": ""
},
{
"docid": "518d63458e152adbdba71d70b39f2e46",
"score": "0.49839106",
"text": "def inserts; end",
"title": ""
},
{
"docid": "fc3eddd948d7f33cc498ddc5a63f9e50",
"score": "0.49813768",
"text": "def build_connection_classes(database_keys_to_use=database_keys_for_auto_build)\n database_keys_to_use.each do |key|\n build_connection_class(connection_class_name(key),key.to_sym)\n end\n end",
"title": ""
},
{
"docid": "4463e27691cfdddf51827deebf546268",
"score": "0.49798205",
"text": "def do_classes\n\n # look for class renames like\n # %rename(Solvable) _Solvable;\n # typedef struct _Solvable {} XSolvable; /* expose XSolvable as 'Solvable' */\n\n extends = Hash.new\n @body.scan(/^%rename\\s*\\(([^\\\"\\)]+)\\)\\s+([_\\w]+);/) do |class_name, struct_name|\n#\tputs \"rename #{class_name} -> #{struct_name}\"\n\textend_name = struct_name.to_s\n\t@body.scan(/typedef\\s+struct\\s+#{struct_name}\\s*\\{[^}]*\\}\\s*(\\w+);/) do |ename|\n\t extend_name = ename.to_s\n\tend\n\t\n#\tputs \"extend #{extend_name}, class #{class_name}, struct #{struct_name}\"\n\t# find the corresponding '%extend' directive\n\t@body.scan(/^%extend\\s+(#{extend_name}|#{struct_name})\\s*\\{(.*)\\}/mx) do |name,content|\n\t # now check if we have multiple %extend, the regexp above is greedy and will match all of them\n\t while content.to_s =~ /^%extend/\n\t content = $` # discard %extend and everything behind\n\t end\n\t extends[name] = true\n\t cn = class_name.to_s\n\t cn.capitalize! unless cn[0,1] =~ /[A-Z_]/\n\t swig_class = handle_class_module(\"class\", cn, :parent => \"rb_cObject\", :content => content.to_s, :extend_name => name)\n\tend\n end\n @body.scan(/^%extend\\s*(\\w+)\\s*\\{(.*)\\}/mx) do |class_name,content|\n\tcn = class_name.to_s\n\tunless extends[cn]\n#\t puts \"Class #{cn}\"\n\t cn.capitalize! unless cn[0,1] =~ /[A-Z_]/\n\t swig_class = handle_class_module(\"class\", cn, :parent => \"rb_cObject\", :content => content)\n\t extends[cn] = true\n\tend\n end\n end",
"title": ""
},
{
"docid": "9725d4d49dcbc8cd29b5f716da7e7c9c",
"score": "0.49789068",
"text": "def _insert\n return super if model.cti_models[0] == model\n model.cti_models.each do |m|\n v = {}\n m.cti_table_columns.each{|c| v[c] = @values[c] if @values.include?(c)}\n ds = use_server(m.cti_instance_dataset)\n if ds.supports_insert_select? && (h = ds.insert_select(v))\n @values.merge!(h)\n else\n nid = ds.insert(v)\n @values[primary_key] ||= nid\n end\n end\n db.dataset.supports_insert_select? ? nil : @values[primary_key]\n end",
"title": ""
},
{
"docid": "6fdd98261e9d76227ad39c5de32fe9d6",
"score": "0.49724758",
"text": "def preload_sti\n #ap \"BLARGH4\"\n types_in_db = base_class\n .unscoped\n .select(inheritance_column)\n .distinct\n .pluck(inheritance_column)\n .compact\n #ap types_in_db\n types_in_db.each do |type|\n logger.debug(\"Preloading STI type #{type}\")\n type.constantize\n end\n\n self.preloaded = true\n end",
"title": ""
},
{
"docid": "123b8f7196c86b0ccea4124aead33069",
"score": "0.49704885",
"text": "def class_types\n class_methods_that_should_match.each_with_object Hash.new do |name, hash|\n surrogate_type, actual_type = class_types_for name\n next if surrogate_type == actual_type || name == :clone # ugh :(\n hash[name] = { surrogate: surrogate_type, actual: actual_type }\n end\n end",
"title": ""
},
{
"docid": "2acde72f3a2c114096ef65ff916cfbbc",
"score": "0.49701825",
"text": "def save_timetable_classtimings_on_split(current_timetable)\n batches = Batch.active.all(:conditions=>[\"batches.start_date <= ? and batches.end_date >= ?\", self.end_date,self.start_date]).collect(&:id)\n current_time_table_class_timings=current_timetable.time_table_class_timings\n current_time_table_class_timings.each do |class_timings|\n wkdays = timetable_weekdays\n current_timetable_class_timing_sets=class_timings.time_table_class_timing_sets.select {|time_table_class_timing| (wkdays.include? time_table_class_timing.weekday_id) }\n if batches.include? class_timings.batch_id and current_timetable_class_timing_sets.present?\n ttct=self.time_table_class_timings.build(:batch_id => class_timings.batch_id)\n current_timetable_class_timing_sets.each do |ttcts|\n ttct.time_table_class_timing_sets.build(:batch_id=>class_timings.batch_id,:class_timing_set_id=>ttcts.class_timing_set_id,:weekday_id=>ttcts.weekday_id)\n end\n end\n end\n current_timetable.update_attribute(:timetable_summary_status, 1) # mark timetable summary for updation\n end",
"title": ""
},
{
"docid": "e438f6e942c3d42f48a64e4bbd198247",
"score": "0.4970136",
"text": "def relate_classes\n associated_classes.each do |rclass|\n oids = rclass.where(user_id: owner_id).pluck(:id)\n assignment_method = rclass.to_s.underscore + \"_ids=\"\n self.send(assignment_method, oids) if oids.present?\n end\n end",
"title": ""
},
{
"docid": "fed3dff5e162f51b0a7778cc181d0962",
"score": "0.49637437",
"text": "def subclasses; end",
"title": ""
},
{
"docid": "fed3dff5e162f51b0a7778cc181d0962",
"score": "0.49637437",
"text": "def subclasses; end",
"title": ""
},
{
"docid": "5db708f025e750605e4942cdf6bb0d0f",
"score": "0.496226",
"text": "def duplicate(klass, replacements={}, *additional_replacements, &block)\n klass = define_class(klass) unless klass.is_a?(Class)\n\n plural = plural(klass)\n\n automatic_replacements = [replacements] + additional_replacements\n raise(ArgumentError, \"Each group of replacements must be given as a Hash\") unless automatic_replacements.all? { |x| x.is_a?(Hash) }\n\n sti_klasses = []\n set_temporary_vetted_attributes(klass, automatic_replacements)\n\n # If we aren't guaranteed to fail on vetting\n if block_given? || !block_required?(klass)\n # If we have potential duplication to do\n if force || !already_duplicated?(klass)\n # Connect to the source database\n with_source do\n # Grab a quick count to see if there is anything we need to do.\n estimated_total = klass.count\n if estimated_total > 0\n inform(test ? \"Extracting first 1,000 #{plural} for testing\" : \"Extracting all #{plural}\")\n # Pull in all records. Perhaps later we can enhance this to do it in batches.\n unless singleton?(klass)\n records = test ? klass.find(:all, :limit => 1000) : klass.find(:all)\n else\n records = [klass.instance]\n end\n\n # Handle any single table inheritance that may have shown up\n records.map(&:class).uniq.each { |k| sti_klasses << k if k != klass }\n sti_klasses.each { |k| set_temporary_vetted_attributes(k, automatic_replacements) }\n\n # Record the size so we can give some progress indication.\n inform \"#{records.size} #{plural} read\"\n\n transfer(klass, records, automatic_replacements, &block)\n else\n inform \"Skipping #{plural}. No records exist.\"\n end\n end\n else\n inform \"Skipping #{plural}. Records already exist.\"\n end\n else\n inform \"Skipping #{plural}. The following field(s) were not checked: #{klass.unvetted_attributes.join(', ')}\"\n end\n\n # Clean things up for the next bit of code that might use this class.\n klass.clear_temporary_safe_attributes\n sti_klasses.each { |k| k.clear_temporary_safe_attributes }\n end",
"title": ""
},
{
"docid": "ba818caf224dbcb462f53bd94f0d0aa6",
"score": "0.49465784",
"text": "def model_new_objects(new_objs, mapping)\n if new_objs\n new_objs.rest.each do |new_obj|\n mapping[new_obj] = @graph_builder.next_key(:os)\n @local_table.abstract_objects << mapping[new_obj]\n @local_table.assure_existence(mapping[new_obj],\n ConnectionGraph::ObjectNode, :arg_escape)\n end\n end\n end",
"title": ""
},
{
"docid": "bdde4cad05b647919afd9a6637bac7f5",
"score": "0.49390918",
"text": "def set_classes (mapping)\n\t@classes.merge! mapping\n\tself\n end",
"title": ""
},
{
"docid": "446c1c47a337b00315d43c5320bc15a4",
"score": "0.49295008",
"text": "def each_subclass(&block)\n subclasses.each(&block)\n end",
"title": ""
},
{
"docid": "248c2985c5beb7181dc13a051d50565b",
"score": "0.49187925",
"text": "def run(*migration_classes); end",
"title": ""
},
{
"docid": "236d1c276ae7b97c312cd25a5b21636d",
"score": "0.4916929",
"text": "def write_habtm(klass)\n has_and_belongs_to_tables[klass].each do |habtm_record|\n foreign_keys_that_exist = habtm_record[:foreign_keys] & habtm_record[:foreign_klass].ids\n\n unless foreign_keys_that_exist.empty?\n klass.find(habtm_record[:id]).association(habtm_record[:foreign_name]).ids_writer(foreign_keys_that_exist)\n end\n end\n end",
"title": ""
},
{
"docid": "8dd9a3eb486ff741723876595cea07bc",
"score": "0.49157396",
"text": "def sync_parts!(klass=nil)\n select_class(klass).each do |subclass|\n Page.find(:all, :include => :parts, :conditions => {:class_name => name_for(subclass)}).each do |page|\n unsynced = lambda { |p| subclass.parts.detect { |s| s.name.downcase == p.name.downcase and s.class != p.class } }\n unsynced_parts = page.parts.select(&unsynced)\n page.parts.destroy unsynced_parts\n needs_update = lambda { |s| unsynced_parts.map(&:name).include? s.name }\n page.parts.create subclass.parts.select(&needs_update).map &:attributes\n end\n end\n end",
"title": ""
},
{
"docid": "4509debf364c2a905bca78a339bf4663",
"score": "0.4913107",
"text": "def subClassOf row, child_obj, parent_obj\n\n fields = row.to_s.chomp.gsub(/^#{child_obj}: /,\"\").split(\",\\t\")\n fields.each { |f| f.strip! }\n id_index = nil\n id_index = fields.index { |x| x =~ /^id=/ }\n return if id_index == nil\n\n id = fields[id_index].split(\"=\")[1]\n # id_sha256 = Digest::SHA256.hexdigest(id.split(\"=\")[1])[-20..-1]\n\n # object inherit from parent object ??\n # TODO find another predicate here\n\n # if loosely coupled create link between objects\n if @arg[:lcoupled] == 1\n File.open(\"#{@arg[:output]}/#{parent_obj}.nq\", \"a\") do |fout|\n qd = RDF::Graph.new()\n s = @arg[:uri] + \"/#{@db_name}_#{child_obj.downcase}:#{id}\"\n p = @ontologies[\"rdfs\"]+\"subClassOf\"\n o = @arg[:uri] + \"/#{@db_name}_#{parent_obj.downcase}:#{id}\"\n qd = serialize_quad([s, p ,o], false)\n fout.write(qd.dump(:nquads))\n end\n end\n\n # class subClassOf parent class\n File.open(\"#{@arg[:output]}/Classes.nq\", \"a\") do |fout|\n qd = RDF::Graph.new()\n s = @arg[:uri] + \"/resource/#{@db_name}_#{child_obj}\"\n p = @ontologies[\"rdfs\"]+\"subClassOf\"\n o = @arg[:uri] + \"/resource/#{@db_name}_#{parent_obj}\"\n qd = serialize_quad([s, p ,o], false)\n fout.write(qd.dump(:nquads))\n end\n\nend",
"title": ""
},
{
"docid": "b056756941e81ffa1dbf6db63cc1fd0c",
"score": "0.4905398",
"text": "def inherited(subclass)\n super\n\n subclass.class_attribute(:auxiliary_statements_list)\n subclass.auxiliary_statements_list = {}\n\n record_class = ActiveRecord::Relation._record_class_attribute\n\n # Define the dynamic attribute that returns the same information as\n # the one provided by the auxiliary statement\n subclass.dynamic_attribute(record_class) do\n klass = self.class\n next klass.table_name unless klass.physically_inheritances?\n\n query = klass.unscoped.where(subclass.primary_key => id)\n query.pluck(klass.arel_table['tableoid'].cast('regclass')).first\n end\n end",
"title": ""
},
{
"docid": "b3d1e65d182a0da26cd1e9d7abe47511",
"score": "0.4904772",
"text": "def record_classes\n [\n @championship.klass,\n @match.klass,\n @ranking.klass,\n @round.klass,\n @team.klass\n ]\n end",
"title": ""
},
{
"docid": "ac5174cfbacdb4db17717883cd6a91b6",
"score": "0.490036",
"text": "def all_from_generalizations (application)\n classes = application.klasses.map(&:cls).compact\n classes.reject(&:descends_from_active_record?).map do |cls|\n source = application.klass_by_name(cls.superclass.name)\n target = application.klass_by_name(cls.name)\n new(application, nil, source, target, :generalization)\n end\n end",
"title": ""
},
{
"docid": "650e98cd021acb2a54f1667e0194b940",
"score": "0.4894917",
"text": "def findClassifications(keywords)\n sql_string = ([\"name LIKE ?\"]*(keywords.length)).join(\" OR \")\n sql_query = [sql_string] + keywords.collect { |k| \"%#{k}%\"}\n \n vineyards = Vineyard.find(:all, :conditions => sql_query)\n subregions = Subregion.find(:all, :conditions => sql_query)\n regions = Region.find(:all, :conditions => sql_query)\n countries = Country.find(:all, :conditions => sql_query)\n\n # { my_id => [my_name, my_other_id], ... }\n v_lookup = Hash[Vineyard.all.collect { |v| [f_attr(v, \"id\"), [f_attr(v, \"name\"), f_attr(v, \"subregion_id\")]] } ]\n s_lookup = Hash[Subregion.all.collect { |v| [f_attr(v, \"id\"), [f_attr(v, \"name\"), f_attr(v, \"region_id\")]] } ]\n r_lookup = Hash[Region.all.collect { |v| [f_attr(v, \"id\"), [f_attr(v, \"name\"), f_attr(v, \"country_id\")]] } ]\n c_lookup = Hash[Country.all.collect { |v| [f_attr(v, \"id\"), [f_attr(v, \"name\")]] } ]\n \n tuples = []\n [vineyards, subregions, regions, countries].flatten.each do |elem|\n v = v_lookup[elem.id] if elem.class == Vineyard\n s = s_lookup[elem.id] if elem.class == Subregion\n r = r_lookup[elem.id] if elem.class == Region\n c = c_lookup[elem.id] if elem.class == Country\n \n v ||= [\"\"]\n s ||= (v != [\"\"] ? s_lookup[v[1]] : [\"\"])\n r ||= (s != [\"\"] ? r_lookup[s[1]] : [\"\"])\n c ||= (r ? c_lookup[r[1]] : [\"\"])\n \n tuples.append([v[0], s[0], r[0], c[0]])\n end\n\n \treturn tuples\n end",
"title": ""
},
{
"docid": "344b85c3dbadb84985d87bb16f11178b",
"score": "0.4891543",
"text": "def write_class(klass)\n recs = records[klass].dup.keep_if(&:new_record?)\n return if recs.empty?\n\n recs.delete_if { |record| klass.find_by(id: record.id)&.update_columns(record.attributes) }\n klass.import recs.map(&:attributes), validate: false\n end",
"title": ""
},
{
"docid": "3793de416fae4d34265db2807a617236",
"score": "0.48892206",
"text": "def load_classes(hash)\n full_hash = hash.with_indifferent_access\n full_hash.each do |key, vals|\n save_models(key.constantize, vals)\n end\n if @options[:crash_on_errors] && self.errors.any?\n raise ImportError.new(\"Errors occurred during load - please see 'errors' method for more details\")\n end\n end",
"title": ""
},
{
"docid": "3f60661320f67b60b04fa0eb094bafc5",
"score": "0.48891726",
"text": "def add_class(cls, vid, trans=true)\n id = AllGems.db[:classes].filter(:class => cls).first\n unless(id)\n if(trans)\n AllGems.db.transaction do\n id = AllGems.db[:classes] << {:class => cls}\n AllGems.db[:classes_gems] << {:class_id => id, :version_id => vid}\n end\n else\n id = AllGems.db[:classes] << {:class => cls}\n AllGems.db[:classes_gems] << {:class_id => id, :version_id => vid}\n end\n else\n id = id[:id]\n end\n id\n end",
"title": ""
},
{
"docid": "18645d8b98f58c92190a59e786bbb35c",
"score": "0.48875746",
"text": "def collect_nodes_with_class(classname)\n if using_inventory?\n Puppet.debug('Using Inventory for collect_nodes_with_class()')\n # Key names are downcased in Inventory.\n class_name_in_inventory = classname.downcase\n @nodes_with_class[classname] = @inventory::classes[class_name_in_inventory].to_a\n else\n Puppet.debug('Using PuppetDB for collect_nodes_with_class()')\n # Key names are capitalized in PuppetDB.\n class_name_in_puppetdb = classname.split('::').map(&:capitalize).join('::')\n @nodes_with_class[classname] = @query::infra_nodes_with_class(class_name_in_puppetdb)\n output_error_and_exit _('Unable to query infra_nodes_with_class()') if @nodes_with_class[classname].nil?\n end\n end",
"title": ""
},
{
"docid": "8739157132c9029188a0e33fac1b4ed3",
"score": "0.48862824",
"text": "def classify\n table_name = self.table_name # scope limitations\n class_name = self.name.split(\" \").join(\"_\").camelcase.capitalize\n # this eval statement prevents the dynamically created class from becoming an anonymous class\n eval \"Class.new ActiveRecord::Base do\n set_table_name table_name\n acts_as_spatial\n extend Pagination\n end\"\n end",
"title": ""
},
{
"docid": "cc0ef4b96766373d8f9883c9f0d1e14c",
"score": "0.4884932",
"text": "def populate_mapping_classes(mappings)\n return mappings if includes_param.empty?\n\n # Move include param to special param so it only applies to classes\n params[\"include_for_class\"] = includes_param\n params.delete(\"display\")\n params.delete(\"include\")\n env[\"rack.request.query_hash\"] = params\n\n orig_classes = mappings.map {|m| m.classes}.flatten.uniq\n acronyms = orig_classes.map {|c| c.submission.ontology.acronym}.uniq\n classes_hash = populate_classes_from_search(orig_classes, acronyms)\n replace_empty_classes(mappings, classes_hash)\n\n mappings\n end",
"title": ""
},
{
"docid": "dde1a08d5027a426ed6b7b470df00f0c",
"score": "0.48802736",
"text": "def preload_sti\n types_in_db = \\\n base_class.\n unscoped.\n select(inheritance_column).\n distinct.\n pluck(inheritance_column).\n compact\n\n types_in_db.each do |type|\n logger.debug(\"Preloading STI type #{type}\")\n type.constantize\n end\n\n self.preloaded = true\n end",
"title": ""
},
{
"docid": "6c7bf66ad67d06cd58b730447449e05c",
"score": "0.48731342",
"text": "def initialize classes = []\n @accepted_classes = DbArray.new classes\n end",
"title": ""
},
{
"docid": "bf070a53a0a3973d90a401d181d788ba",
"score": "0.4870541",
"text": "def thor_classes_in(klass); end",
"title": ""
},
{
"docid": "e3b4bfc07f3b4d98ac19430ef6fec9b2",
"score": "0.4868622",
"text": "def insert_after(oldklass, newklass, *args)\n i = entries.index { |entry| entry.klass == newklass }\n new_entry = i.nil? ? Entry.new(newklass, *args) : entries.delete_at(i)\n i = entries.index { |entry| entry.klass == oldklass } || (entries.count - 1)\n entries.insert(i + 1, new_entry)\n end",
"title": ""
},
{
"docid": "3245af5ae17b71550ff5edff1a244b9f",
"score": "0.48670644",
"text": "def create_member_classes\n riigiasutus = MemberClass.create!(:code => \"GOV\",\n :description => \"Riigiasutuse klassi kirjeldus\")\n ettevote = MemberClass.create!(:code => \"ettevote\",\n :description => \"Ettevotte klassi kirjeldus\")\n eraisik = MemberClass.create!(:code => \"eraisik\",\n :description => \"Eraisiku klassi kirjeldus\")\n\n [riigiasutus, ettevote, eraisik]\nend",
"title": ""
},
{
"docid": "c3dde45fd206a9fdd2698c1424d5ed50",
"score": "0.48664466",
"text": "def subclass(obj, data_class)\n output = []\n output << data_class.new(obj) if obj.is_a? Hash\n obj.each {|o| output << data_class.new(o)} if obj.is_a? Array\n output\n end",
"title": ""
},
{
"docid": "6671175fcb35724fdc8b7a4585905587",
"score": "0.48588243",
"text": "def subclass_id\n Subclass.first(name: @subclass).db_id\n end",
"title": ""
},
{
"docid": "b6e2ab45c45cf41646964678a073e159",
"score": "0.4845323",
"text": "def create_types\n @@types.each do |type|\n create_type(type) unless Type.where(name: type['name']).first\n end\n end",
"title": ""
},
{
"docid": "cca4bbdf499a0c021bb254518770a6c7",
"score": "0.4844304",
"text": "def set_classes\n if not @panclasses\n #p '=== types='+types.inspect\n @panclasses = []\n @types.strip!\n if (types.is_a? String) and (types.size>0)\n drop_prefix = 0\n if (@types[0, 10].downcase=='panhashes(')\n drop_prefix = 10\n elsif (@types[0, 8].downcase=='panhash(')\n drop_prefix = 8\n end\n if drop_prefix>0\n @types = @types[drop_prefix..-2]\n @types.strip!\n @types = @types.split(',')\n @types.each do |ptype|\n ptype.strip!\n if PandoraModel.const_defined?(ptype)\n @panclasses << PandoraModel.const_get(ptype)\n end\n end\n end\n end\n if @panclasses.size==0\n @types = nil\n kind_list = PandoraModel.get_kind_list\n kind_list.each do |rec|\n ptype = rec[1]\n ptype.strip!\n #p '---ptype='+ptype.inspect\n if PandoraModel.const_defined?(ptype)\n @panclasses << PandoraModel.const_get(ptype)\n end\n if @panclasses.size>MaxPanhashTabs\n break\n end\n end\n end\n #p '====panclasses='+panclasses.inspect\n end\n end",
"title": ""
},
{
"docid": "3d1c84c2e1d4fe3e8a2d73f5aef2c8d5",
"score": "0.48407453",
"text": "def insert(klass, inserts)\n next_oid = nil\n\n if !inserts[klass.primary_key] || inserts[klass.primary_key] == \"NULL\"\n if seq = klass.ann(klass.primary_key, :sequence)\n next_oid = Integer(query(\"SELECT nextval('#{seq}')\").first_value)\n inserts[klass.primary_key] = write_attr(next_oid, :class => Integer)\n end\n end\n super\n\n return next_oid\n end",
"title": ""
},
{
"docid": "6e1fdaa2dd9d1d60aa6fb82c8472e564",
"score": "0.48355862",
"text": "def add_objectclass!(_objectclass = 'top')\n @list_objectclass = @list_objectclass.concat(get_objectclass_list(self.dn_ldap, self.host_ldap, self.port_ldap, self.rootdn_ldap, self.passdn_ldap))\n @list_objectclass.push(_objectclass).uniq!\n @list_attributs_type = get_attributs_list(self.list_objectclass, self.host_ldap, self.port_ldap, self.rootdn_ldap, self.passdn_ldap)\n @list_attributs = map_record(self.dn_ldap, self.host_ldap, self.port_ldap, self.rootdn_ldap, self.passdn_ldap)\n if not @list_attributs.nil? or @list_attributs.empty? then\n @list_attributs.each{|_key,_value|\n @list_attributs_type.each{|_attr,_trash|\n\t @list_prov = get_alias(_key,self.host_ldap, self.port_ldap, self.rootdn_ldap, self.passdn_ldap) \n if @list_prov then\n if @list_prov.include?(_attr) then\n @list_attributs.delete(_key)\n @list_attributs[_attr] = _value\n end\t\n end\n }\n }\n end\n @list_attributs[\"objectClass\"] = @list_objectclass\n @list_attributs_type.each_key {|_key|\n eval(\"\n def #{_key.downcase}\n return @list_attributs['#{_key}']\n end\n def #{_key.downcase}=(_value)\n @list_attributs['#{_key}'] = _value\n end\n \")\n }\n end",
"title": ""
},
{
"docid": "0514b4cb5fb8db2f2de3ae7086495511",
"score": "0.4822555",
"text": "def test_classes\n assert( Class.public_method_defined?( :isAbstract) )\n assert( Class.superclass== Type)\n # check derivative methods\n assert( MixedData.public_method_defined?( :isAbstract), \"derivative gets generalization's methods\")\n # check derivation \n assert( Class.public_method_defined?( :superClass) )\n # TODO 2012-11-06 Tuesday not sure now what this tests? \n base1, base2, deriv= Class.new, Class.new, Class.new\n deriv.superClass= [base1, base2]\n assert( deriv.superClass.size==2, \"Class can have multiple superclasses.\")\n # of course superClass can be any type (but this will fail when I implement type checking)\n errs= deriv.__complete\n deriv.superClass= 4\n assert( errs.select{|e|e[:error]== :type}.length, \"can't use an integer as a superclass\");\n #\n prop1, prop2, *props= multiples 10, Property\n link nil, :property, [prop1], :opposite, [prop2]\n link nil, :property, [prop2], :opposite, [prop1]\n prop1.isID=[FALSE];\n prop1.default=[String.new]\n errs= prop1.__complete\n assert( 0==errs.length, errs.inspect);\n # super\n class1, *more_classed= multiples 10, Class\n link nil, nil, [class1], :superClass, more_classed\n assert_equal( more_classed, class1.superClass)\n errs= [];\n more_classed.each{|c|errs.concat c.__complete}\n #assert( errs.select{|e|e[:error]== :cardinality}.length ==more_classed.length, \"superClass has no reciprocal attribute\")\n \n link nil, nil, [class1], :superClass, []\n assert_equal( [], class1.superClass, \"no supers\")\n #\n link nil, :class, [class1], :ownedAttribute, props\n #\n ops= multiples 10, Operation\n link nil, :class, [class1], :ownedOperation, ops\n assert_equal(ops, class1.ownedOperation)\n link nil, :class, [], :ownedOperation, ops\n assert_equal( [], ops.inject([]){|a,o| a|o.class})\n # this will 'break; the relationship with class, which should be null but isn't\n # because the owned-end relationships \n assert_not_equal([], class1.ownedOperation)\n end",
"title": ""
},
{
"docid": "f8414d59c4e626e92251eaa01121ff13",
"score": "0.4819395",
"text": "def collect_search_classes_for_select\n collection = [[\"Cases\".t, 'Kase'], [\"People\".t, 'Person'], [\"Communities\".t, 'Tier']]\n\n if kase_class = Kase.self_and_subclasses.find {|c| c.controller_name == controller.controller_name}\n collection.insert(0, [kase_class.human_name(:count => 2).titleize, kase_class.name]) unless collection.find {|c| c[1] == kase_class.name}\n elsif tier_class = Tier.self_and_subclasses.find {|c| c.controller_name == controller.controller_name}\n collection.insert(0, [tier_class.human_name(:count => 2).titleize, tier_class.name]) unless collection.find {|c| c[1] == tier_class.name}\n elsif topic_class = Topic.self_and_subclasses.find {|c| c.controller_name == controller.controller_name}\n collection.insert(0, [topic_class.human_name(:count => 2).titleize, topic_class.name]) unless collection.find {|c| c[1] == topic_class.name}\n end\n \n collection\n end",
"title": ""
},
{
"docid": "ccf4ebcdb17c868e85ef44df64463eee",
"score": "0.48184395",
"text": "def bulk_insert_model(klass, data, table_name=nil, custom_fields={})\n table_name = table_name || format_table_name(klass)\n delete_table(table_name)\n create_table(table_name, klass, custom_fields)\n table = @dataset.table table_name\n insert_async(table, data)\n end",
"title": ""
},
{
"docid": "8def51ab18fa7e412620b7d32ecb559f",
"score": "0.48165286",
"text": "def load_classification_table\n File.open(File.join(File.dirname(__FILE__),\"data\",\"plankton_types.txt\"), \"r\") do |f|\n f.each_line do |line|\n @plankton_types.push line.chomp\n end\n end\n\n @plankton_types.each do |line|\n plankton_class = line.split(\"_\")[0].to_sym\n @lu_plankton_class[plankton_class].push line\n end\n @lu_plankton_class\n end",
"title": ""
},
{
"docid": "44517991e26d26d76d5853f2d90f07f7",
"score": "0.481568",
"text": "def test_initial_population_of_all_classes\r\n oc = XfOOrth::XfOOrthClass.object_class\r\n cc = XfOOrth::XfOOrthClass.class_class\r\n all = $all_classes\r\n \r\n assert_equal(oc, all['Object'])\r\n assert_equal(cc, all['Class'])\r\n end",
"title": ""
},
{
"docid": "da9697339d9267f08f7fdc3daac8bb93",
"score": "0.4805039",
"text": "def mti_class(primary_table = nil)\n raise(EmptyEye::AlreadyExtended, \"MTI class method already invoked\") if mti_class?\n self.primary_key = \"id\"\n @shard_wrangler = EmptyEye::ShardWrangler.create(self, primary_table)\n self.table_name = @shard_wrangler.compute_view_name\n before_yield = reflect_on_multiple_associations(:has_one)\n yield nil if block_given?\n mti_ancestors = reflect_on_multiple_associations(:has_one) - before_yield\n @shard_wrangler.wrangle_shards(mti_ancestors)\n true\n end",
"title": ""
},
{
"docid": "7e8814802e463bf139f35c37357b0fab",
"score": "0.48009336",
"text": "def insert_after(oldklass, newklass, *args); end",
"title": ""
},
{
"docid": "7e8814802e463bf139f35c37357b0fab",
"score": "0.48009336",
"text": "def insert_after(oldklass, newklass, *args); end",
"title": ""
},
{
"docid": "c755b46f5af3f42cd24e692ba6ead8a3",
"score": "0.4794884",
"text": "def update_dominant_class\n @dominant_class_id = @class_levels.max_by{| k,v| v}[0]\n end",
"title": ""
},
{
"docid": "59f6cde1a26cd40268139e19b31ce7ae",
"score": "0.47919577",
"text": "def cram\n table_name = class_to_table\n if @id != nil and @id.is_a?(Integer)\n self.save(table_name)\n elsif @id.is_a?(String)\n self.delete\n else\n self.insert(table_name) if @id == nil\n end\n \n end",
"title": ""
}
] |
2389d96397bc35941bcc39971c989c3c | Assigns a connection to the supplied thread, if one is available. The calling code should already have the mutex when calling this. | [
{
"docid": "5e67b54c938147af81f91d0c6d796d03",
"score": "0.7354313",
"text": "def _acquire(thread)\n if conn = available\n @allocated[thread] = conn\n end\n end",
"title": ""
}
] | [
{
"docid": "57fd8fb8a50c2b5a49710bbd48adcf5e",
"score": "0.75386924",
"text": "def assign_connection(thread)\n # Thread safe as instance variable is only assigned to local variable\n # and not operated on outside mutex.\n allocated = @allocated\n do_make_new = false\n to_disconnect = nil\n\n sync do\n if conn = next_available\n return(allocated[thread] = conn)\n end\n\n if (n = _size) >= (max = @max_size)\n allocated.keys.each do |t|\n unless t.alive?\n (to_disconnect ||= []) << allocated.delete(t)\n end\n end\n n = nil\n end\n\n if (n || _size) < max\n do_make_new = allocated[thread] = true\n end\n end\n\n if to_disconnect\n to_disconnect.each{|dconn| disconnect_connection(dconn)}\n end\n\n # Connect to the database outside of the connection pool mutex,\n # as that can take a long time and the connection pool mutex\n # shouldn't be locked while the connection takes place.\n if do_make_new\n begin\n conn = make_new(:default)\n sync{allocated[thread] = conn}\n ensure\n unless conn\n sync{allocated.delete(thread)}\n end\n end\n end\n\n conn\n end",
"title": ""
},
{
"docid": "eae5ba279b1394db051dd5d1d541cf8e",
"score": "0.7164868",
"text": "def acquire(thread, server)\n sync do\n if conn = available(server)\n allocated(server)[thread] = conn\n end\n end\n end",
"title": ""
},
{
"docid": "3e6518033f4fe7e78974d08f27d0d452",
"score": "0.69184184",
"text": "def acquire(thread)\n if conn = assign_connection(thread)\n return conn\n end\n\n timeout = @timeout\n timer = Sequel.start_timer\n\n sync do\n @waiter.wait(@mutex, timeout)\n if conn = next_available\n return(@allocated[thread] = conn)\n end\n end\n\n until conn = assign_connection(thread)\n elapsed = Sequel.elapsed_seconds_since(timer)\n # :nocov:\n raise_pool_timeout(elapsed) if elapsed > timeout\n\n # It's difficult to get to this point, it can only happen if there is a race condition\n # where a connection cannot be acquired even after the thread is signalled by the condition variable\n sync do\n @waiter.wait(@mutex, timeout - elapsed)\n if conn = next_available\n return(@allocated[thread] = conn)\n end\n end\n # :nocov:\n end\n\n conn\n end",
"title": ""
},
{
"docid": "3420351ee7b72014edb80a3ae904c2fe",
"score": "0.64647204",
"text": "def acquire(thread)\n if conn = @queue.pop(timeout: 0) || try_make_new || @queue.pop(timeout: @timeout)\n sync{@allocated[thread] = conn}\n else\n name = db.opts[:name]\n raise ::Sequel::PoolTimeout, \"timeout: #{@timeout}#{\", database name: #{name}\" if name}\"\n end\n end",
"title": ""
},
{
"docid": "e46795bc7cd48f8e56787a6dc46c94bd",
"score": "0.6380469",
"text": "def owned_connection(thread)\n sync{@allocated[thread]}\n end",
"title": ""
},
{
"docid": "e46795bc7cd48f8e56787a6dc46c94bd",
"score": "0.6380469",
"text": "def owned_connection(thread)\n sync{@allocated[thread]}\n end",
"title": ""
},
{
"docid": "e46795bc7cd48f8e56787a6dc46c94bd",
"score": "0.6380469",
"text": "def owned_connection(thread)\n sync{@allocated[thread]}\n end",
"title": ""
},
{
"docid": "6f52f9d3d3652df92faeda767ec73166",
"score": "0.62796205",
"text": "def __bind_to_thread(thread = nil)\n thread ||= Thread.current\n raise ArgumentError, \"Must provide thread\" unless thread.is_a?(Thread)\n raise BindingError, \"Object is already bound\" if __bound?\n __check_bindability\n @bound_thread_id = thread.__id__\n self\n end",
"title": ""
},
{
"docid": "1ed2acbad483be852cc0676a950897d5",
"score": "0.6208299",
"text": "def owned_connection(thread, server)\n sync{@allocated[server][thread]}\n end",
"title": ""
},
{
"docid": "58c7a1c2a2efa475190388b04b7cffe6",
"score": "0.6174889",
"text": "def establish_connection(conn_key, spec, th = nil, &block)\n # either uses a stack, or change the thread specific connection\n if block_given?\n push_connection(conn_key, spec, th)\n ret = yield\n pop_connection(th)\n ret\n elsif in_stack?\n raise \"Can not modify thread-based connection when in stack\"\n else\n use_connection(conn_key, spec, th)\n end\n end",
"title": ""
},
{
"docid": "f3d328d547498c5e18f6a4a7aad351d3",
"score": "0.6070368",
"text": "def _thread(release: false)\n Thread.new do\n yield\n rescue => e\n lex(e, 'Error in thread')\n nil\n ensure\n release_connection if release\n end\nrescue => e\n lex(e, 'Threading failed')\n nil\nend",
"title": ""
},
{
"docid": "9fc2e1d70b7b5704b6f387dbe07fc940",
"score": "0.59879273",
"text": "def release(thread)\n conn = @allocated.delete(thread)\n\n if @connection_handling == :disconnect\n disconnect_connection(conn)\n else\n checkin_connection(conn)\n end\n end",
"title": ""
},
{
"docid": "ef1fb32f8c53f8dbece715eb685a82c6",
"score": "0.59138256",
"text": "def release(thread)\n conn = @allocated.delete(thread)\n\n unless @connection_handling == :disconnect\n checkin_connection(conn)\n end\n\n @waiter.signal\n \n # Ensure that after signalling the condition, some other thread is given the\n # opportunity to acquire the mutex.\n # See <https://github.com/socketry/async/issues/99> for more context.\n sleep(0)\n \n nil\n end",
"title": ""
},
{
"docid": "1308f2b114bc2dfd25e1c8b30d4c4966",
"score": "0.5736955",
"text": "def connection #:nodoc:\n Thread.current['connection'] ||= retrieve_connection\n Thread.current['connection']\n end",
"title": ""
},
{
"docid": "3270455fa9a9c20b8394c9dddba81140",
"score": "0.5641717",
"text": "def release(thread)\n checkin_connection(sync{@allocated.delete(thread)})\n nil\n end",
"title": ""
},
{
"docid": "09a41841390698c9289a252d6ddc5acd",
"score": "0.5542817",
"text": "def connect\r\n if @opts[:threadsafe]\r\n @conns = Knj::Threadhandler.new\r\n \r\n @conns.on_spawn_new do\r\n self.spawn\r\n end\r\n \r\n @conns.on_inactive do |data|\r\n data[:obj].close\r\n end\r\n \r\n @conns.on_activate do |data|\r\n data[:obj].reconnect\r\n end\r\n else\r\n @conn = self.spawn\r\n end\r\n end",
"title": ""
},
{
"docid": "9b92173833224f71c8611a0dff47c56d",
"score": "0.55265516",
"text": "def release(thread, conn, server)\n if @connections_to_remove.include?(conn)\n remove(thread, conn, server)\n else\n available_connections(server) << allocated(server).delete(thread)\n end\n end",
"title": ""
},
{
"docid": "4b4a85d3e7220e6876d345ac90b31e74",
"score": "0.550448",
"text": "def put_connection(conn)\n conn.close if !active?\n @connections.offer(conn)\n end",
"title": ""
},
{
"docid": "741358bf58013e6640b119a395798c2e",
"score": "0.54805434",
"text": "def attempt_connection\n @connection_future = Concurrent::Future.new do\n connection_method.call\n end\n connection_future.execute\n end",
"title": ""
},
{
"docid": "a8a1ffc64f4a4f20f11d4950302d46d3",
"score": "0.5471174",
"text": "def establish_connection_to(server, failures=nil)\n current_thread = Thread.current\n Thread.new { safely_establish_connection_to(server, current_thread, failures) }\n end",
"title": ""
},
{
"docid": "d7c353cc9ba438148cfec66ea3a58e8b",
"score": "0.5453433",
"text": "def connection\n # this is correctly done double-checked locking\n # (ThreadSafe::Cache's lookups have volatile semantics)\n @reserved_connections[current_connection_id] || synchronize do\n @reserved_connections[current_connection_id] ||= checkout\n end\n end",
"title": ""
},
{
"docid": "211c6d6891e7b08d7a30db422d214772",
"score": "0.5414647",
"text": "def lease\n if in_use?\n msg = +\"Cannot lease connection, \"\n if @owner == Thread.current\n msg << \"it is already leased by the current thread.\"\n else\n msg << \"it is already in use by a different thread: #{@owner}. \" \\\n \"Current thread: #{Thread.current}.\"\n end\n raise ActiveRecordError, msg\n end\n\n @owner = Thread.current\n end",
"title": ""
},
{
"docid": "4d7c79611fba86404802b93c52235dc5",
"score": "0.5386049",
"text": "def set_connection(connection)\n @connection = connection || raise(ArgumentError, 'missing connection')\n self.class.contexts_by_connection[connection] = self\n self.class.no_connection_contexts.delete self\n schedule\n self\n end",
"title": ""
},
{
"docid": "74daab891ecf879ffe907b6ce804d440",
"score": "0.5329922",
"text": "def checkin_connection(conn)\n @available_connections << conn\n if USE_WAITER\n @waiter.signal\n Thread.pass\n end\n conn\n end",
"title": ""
},
{
"docid": "5cf32b0d8ed3f4ea0854c292bc964f45",
"score": "0.53049505",
"text": "def start_monitoring_connection\n @connection_monitor_thread ||= Thread.new{monitor_connection}\n @connection_monitor_thread.abort_on_exception = true\n end",
"title": ""
},
{
"docid": "65a4406e20dc974eb76b8306d0414ae5",
"score": "0.5287703",
"text": "def steal! # :nodoc:\n if in_use?\n if @owner != Thread.current\n pool.send :remove_connection_from_thread_cache, self, @owner\n\n @owner = Thread.current\n end\n else\n raise ActiveRecordError, \"Cannot steal connection, it is not currently leased.\"\n end\n end",
"title": ""
},
{
"docid": "a2b5fc3a4e6d83f788999f7d0e47d044",
"score": "0.52205473",
"text": "def connect_using conn\n @connection = conn\n end",
"title": ""
},
{
"docid": "0d78bf0ff71b679afe60e336b0f8519a",
"score": "0.5220086",
"text": "def aquire_connection\n conn = if @connection_pool\n @connection_pool.aquire_connection\n else\n @connection\n end\n @status = nil unless conn.connected?\n conn\n end",
"title": ""
},
{
"docid": "5b03096ac88878afd556543dfbcce452",
"score": "0.51899177",
"text": "def with_reserved_connection(&block)\n @connection.acquire\n yield\n ensure\n @connection.release\n end",
"title": ""
},
{
"docid": "222a78ed1a55616d8b6f8bf09564b8d6",
"score": "0.5180001",
"text": "def acquire(*a)\n conn = nil\n\n 1.times do\n if (conn = super) &&\n (timer = sync{@connection_timestamps.delete(conn)}) &&\n Sequel.elapsed_seconds_since(timer) > @connection_validation_timeout &&\n !db.valid_connection?(conn)\n\n case pool_type\n when :sharded_threaded, :sharded_timed_queue\n sync{@allocated[a.last].delete(Sequel.current)}\n else\n sync{@allocated.delete(Sequel.current)}\n end\n\n disconnect_connection(conn)\n redo\n end\n end\n\n conn\n end",
"title": ""
},
{
"docid": "e6dbbf3c516b22535a159c3547f4ec55",
"score": "0.5126624",
"text": "def connection\n @connections[Thread.current] or begin\n c = @possibilities[rand @possibilities.size]\n @connections[Thread.current] = c.dup\n end\n end",
"title": ""
},
{
"docid": "124307773ede65a80ec67ebca1e395cd",
"score": "0.5098873",
"text": "def port_lock\n Thread.new do\n begin\n server = TCPServer.new('127.0.0.1', 17553)\n server.accept\n rescue\n raise(\"Someone's already bound to our port. We're outta here.\")\n end\n end\n sleep(1) # Give it a second to attempt the accept\nend",
"title": ""
},
{
"docid": "1b2bf1e984e157f82820564a95930436",
"score": "0.5091823",
"text": "def connect(&block)\n @socket ||= TCPSocket.new(@host, @port)\n update_thread(&block)\n rescue StandardError => e\n puts e\n end",
"title": ""
},
{
"docid": "1135fd35f233653b827fc5fbf73467a4",
"score": "0.5090626",
"text": "def conn= x\n @conn_owned = false\n @conn = x\n end",
"title": ""
},
{
"docid": "7872155e55558531f4b844b81456c944",
"score": "0.5087266",
"text": "def lease\n if in_use?\n msg = +\"Cannot lease connection, \"\n if @owner == ActiveSupport::IsolatedExecutionState.context\n msg << \"it is already leased by the current thread.\"\n else\n msg << \"it is already in use by a different thread: #{@owner}. \" \\\n \"Current thread: #{ActiveSupport::IsolatedExecutionState.context}.\"\n end\n raise ActiveRecordError, msg\n end\n\n @owner = ActiveSupport::IsolatedExecutionState.context\n end",
"title": ""
},
{
"docid": "3183a7eee9b38e1da3a4ea6478886b57",
"score": "0.50510293",
"text": "def checkin_connection(conn)\n @queue.push(conn)\n conn\n end",
"title": ""
},
{
"docid": "fde9623132b3fa4611f2cea8674000e0",
"score": "0.50252867",
"text": "def connect_if_connection_initialized\n connection.connect if connection.initialized?\n end",
"title": ""
},
{
"docid": "0774167bb71186639700e33a740108b1",
"score": "0.50095606",
"text": "def get_and_register_thread\r\n raise \"KnjDB-object is not in threadding mode.\" if !@conns\r\n \r\n thread_cur = Thread.current\r\n tid = self.__id__\r\n thread_cur[:knjdb] = {} if !thread_cur[:knjdb]\r\n \r\n if thread_cur[:knjdb][tid]\r\n #An object has already been spawned - free that first to avoid endless \"used\" objects.\r\n self.free_thread\r\n end\r\n \r\n thread_cur[:knjdb][tid] = @conns.get_and_lock if !thread_cur[:knjdb][tid]\r\n \r\n #If block given then be ensure to free thread after yielding.\r\n if block_given?\r\n begin\r\n yield\r\n ensure\r\n self.free_thread\r\n end\r\n end\r\n end",
"title": ""
},
{
"docid": "035d49e649ae582b11bfd3e409c033da",
"score": "0.4986397",
"text": "def checkin_connection(conn)\n @available_connections << conn\n conn\n end",
"title": ""
},
{
"docid": "4858f779deee21f4949e2c3a48b4f98c",
"score": "0.49785438",
"text": "def use(conn = nil)\n conn_given = !!conn\n conn = conn_given ? conn : @pool.checkout\n begin\n yield Thread.current[:squirm_connection] = conn\n ensure\n Thread.current[:squirm_connection] = nil\n @pool.checkin conn unless conn_given\n end\n end",
"title": ""
},
{
"docid": "9fa564ce29a693332012b18ac4639cc5",
"score": "0.49401444",
"text": "def connection=(spec) #:nodoc:\n raise ConnectionNotEstablished unless spec\n @@connection = spec\n end",
"title": ""
},
{
"docid": "9d34b3fa59837be0106ffa8d8412c846",
"score": "0.49250054",
"text": "def checkin(conn)\n synchronize do\n release conn\n @available.add conn\n end\n end",
"title": ""
},
{
"docid": "51a79d337766befa6488438443abc36f",
"score": "0.49235043",
"text": "def set(*args)\n options = args.last.is_a?(Hash) ? args.pop : {}\n thread = args.first\n options.merge!(:thread => thread) if ([:ident, :link] & options.keys).empty?\n response = get('threads/set', options)\n end",
"title": ""
},
{
"docid": "da7f5c59f3191e39dc2e21d347f1762d",
"score": "0.49205878",
"text": "def connection=(val)\n @@connection = val\n end",
"title": ""
},
{
"docid": "749e6ed3c4f8018c55ca2b05933aeaf4",
"score": "0.49149424",
"text": "def thread\n @primary_server ? @primary_server.thread : nil\n end",
"title": ""
},
{
"docid": "e85748a1588caf48e6c121f0379127ab",
"score": "0.4877428",
"text": "def connection\n connection_id = current_connection_id\n unless conn = @reserved_connections.fetch(connection_id, nil)\n synchronize do\n conn = ( @reserved_connections[connection_id] ||= checkout )\n end\n end\n conn\n end",
"title": ""
},
{
"docid": "0f48f54acd69961a58847a1cc8b1646d",
"score": "0.48732853",
"text": "def connection\n if conn = @reserved_connections[current_connection_id]\n conn\n else\n @reserved_connections[current_connection_id] = checkout\n end\n end",
"title": ""
},
{
"docid": "24368a37e7787d9ee9e85b6e42ae5f72",
"score": "0.48642242",
"text": "def set_user_thread(user_id, user_thread)\n user_threads_lock.synchronize do\n user_threads[user_id] = user_thread\n end\n end",
"title": ""
},
{
"docid": "a57e58ec2f50a50e9e78b35ff7d14543",
"score": "0.48622075",
"text": "def join_thread\n @thread&.join\n end",
"title": ""
},
{
"docid": "a823b5417bf42dccb7cd31aaf89820ee",
"score": "0.48450887",
"text": "def set_connection\n @connection = Connection.find(params[:id])\n end",
"title": ""
},
{
"docid": "a823b5417bf42dccb7cd31aaf89820ee",
"score": "0.48450887",
"text": "def set_connection\n @connection = Connection.find(params[:id])\n end",
"title": ""
},
{
"docid": "a823b5417bf42dccb7cd31aaf89820ee",
"score": "0.48450887",
"text": "def set_connection\n @connection = Connection.find(params[:id])\n end",
"title": ""
},
{
"docid": "2a8477e2ddc0a58c95445ab2a100bce4",
"score": "0.48450032",
"text": "def connection\n @connection = create_connection! unless connected?\n @connection\n end",
"title": ""
},
{
"docid": "86ccc26889d6e85dcc20c363a58f6df8",
"score": "0.48263973",
"text": "def connect\n @connection_pool.get_connection\n end",
"title": ""
},
{
"docid": "896fbf8071ed4420cccfaa4982fd4d78",
"score": "0.48219377",
"text": "def steal! # :nodoc:\n if in_use?\n if @owner != ActiveSupport::IsolatedExecutionState.context\n pool.send :remove_connection_from_thread_cache, self, @owner\n\n @owner = ActiveSupport::IsolatedExecutionState.context\n end\n else\n raise ActiveRecordError, \"Cannot steal connection, it is not currently leased.\"\n end\n end",
"title": ""
},
{
"docid": "7c306436dc5e4a084d22dd363ef26357",
"score": "0.481528",
"text": "def connect( &block )\n conn = @conn_pool.get_conn\n yield conn\n ensure\n @conn_pool.release_conn( conn )\n end",
"title": ""
},
{
"docid": "3aa9710ab91900f87b6c2c83f9ae87e7",
"score": "0.48141342",
"text": "def reuse_connection\n logger.debug(\"[SSH] reusing existing connection #{@connection}\")\n yield @connection if block_given?\n @connection\n end",
"title": ""
},
{
"docid": "b65a9ceb3f299e62fb1579a69190b905",
"score": "0.4810775",
"text": "def reuse_connection\n logger.debug(\"[SSH] reusing existing connection #{@connection}\")\n yield @connection if block_given?\n @connection\n end",
"title": ""
},
{
"docid": "2db934807f7f4907674b011838f55ec2",
"score": "0.47988883",
"text": "def start_thread #does this need to be its own thread?\n @@thread = Thread.new do\n self.run\n end\n end",
"title": ""
},
{
"docid": "6371829cfa6bef0c7340693704b94fca",
"score": "0.47946084",
"text": "def connect\n connection.tap do |c|\n c.start\n end\n end",
"title": ""
},
{
"docid": "0d8283c6552002db3530183a206e887e",
"score": "0.4784763",
"text": "def connect(username, password)\n @username, @password = username, password\n\n @read_thread = self.class.start_read_thread(helper, @socket.getInputStream)\n @write_thread = self.class.start_write_thread(helper, @socket.getOutputStream)\n @write_thread.send_cmd CMD00_ConnectRequest.new\n end",
"title": ""
},
{
"docid": "5bcec7193cec74bcaa9c219b294a8a47",
"score": "0.47790658",
"text": "def initialize(obj, thread = :unbound)\n super(obj)\n __bind_to_thread(thread) if thread != :unbound\n end",
"title": ""
},
{
"docid": "92bcb750f3c23f53cb5668a9e99261ec",
"score": "0.47691506",
"text": "def connect (host, port)\n\t\tclose\n\n\t\tbegin\n\t\t\t@socket = TCPSocket.new host, port\n\t\trescue Exception => e\n\t\t\temit :error, e\n\t\tend\n\n\t\tthreads\n\tend",
"title": ""
},
{
"docid": "f22da23cf0964fac3f254b4290ff5581",
"score": "0.47571096",
"text": "def set_thread_object\n @thread_object = ThreadObject.find(params[:id])\n end",
"title": ""
},
{
"docid": "d9268ef7cf01b571ea3de83fc97165c4",
"score": "0.4755004",
"text": "def set_thread\n @thread = Threads.find(params[:id])\n end",
"title": ""
},
{
"docid": "ff7d695d0bca712d6673ba7bfb571b67",
"score": "0.47432062",
"text": "def connect(t = -1)\n # If we already have a connection and we aren't pipelining, close it.\n if (self.conn)\n if !pipelining?\n close\n else\n return self.conn\n end\n end\n\n timeout = (t.nil? or t == -1) ? 0 : t\n\n self.conn = Rex::Socket::Tcp.create(\n 'PeerHost' => self.hostname,\n 'PeerPort' => self.port.to_i,\n 'LocalHost' => self.local_host,\n 'LocalPort' => self.local_port,\n 'Context' => self.context,\n 'SSL' => self.ssl,\n 'SSLVersion' => self.ssl_version,\n 'Proxies' => self.proxies,\n 'Timeout' => timeout\n )\n end",
"title": ""
},
{
"docid": "85c31d97e0ea98b317cc4d2888110c3c",
"score": "0.47332138",
"text": "def activate_ssh_loop symbol\n @connections[symbol][:thread] = Thread.new(@connections[symbol]) {|c| c.loop {true}}\n end",
"title": ""
},
{
"docid": "3e3fdcc1b3b8554213b25469f2fa3b2b",
"score": "0.4732928",
"text": "def connection\n @connection ||= make_connection\n end",
"title": ""
},
{
"docid": "fa8422c3e1312ec011f2caa2f1cee162",
"score": "0.47306576",
"text": "def thread_safe=(value)\n @lock = value ? Mutex.new : PlaceboLock.new\n end",
"title": ""
},
{
"docid": "a9ecc9ca41305bc6fb8a234a773a17bf",
"score": "0.47277254",
"text": "def allow_concurrency=(threaded) #:nodoc:\n logger.debug \"allow_concurrency=#{threaded}\" if logger\n return if @@allow_concurrency == threaded\n clear_all_cached_connections!\n @@allow_concurrency = threaded\n method_prefix = threaded ? \"thread_safe\" : \"single_threaded\"\n sing = (class << self; self; end)\n [:active_connections, :scoped_methods].each do |method|\n sing.send(:alias_method, method, \"#{method_prefix}_#{method}\")\n end\n log_connections if logger\n end",
"title": ""
},
{
"docid": "b8de924b4bcd01893bbf39ccabe6683a",
"score": "0.47031188",
"text": "def acquire(fiber)\n\t\t\t\tif !@connections.empty?\n\t\t\t\t\t@busy_connections[fiber] = @connections.shift\n\t\t\t\telsif (@connections.length + @busy_connections.length) < @size\n\t\t\t\t\tconn = @connection_proc.call\n\t\t\t\t\t@busy_connections[fiber] = conn\n\t\t\t\telse\n\t\t\t\t\tFiber.yield @queue << fiber\n\t\t\t\tend\n\t\t\tend",
"title": ""
},
{
"docid": "7434a6740ca94f30ff3b1ba254e79387",
"score": "0.46953914",
"text": "def with_connection\n connection_id = current_connection_id\n fresh_connection = true unless active_connection?\n yield connection\n ensure\n release_connection(connection_id) if fresh_connection\n end",
"title": ""
},
{
"docid": "397d1efa2e76a16a8e54b12344adf658",
"score": "0.46918398",
"text": "def put(thread)\n @mutex.synchronize do\n thread.busy = false\n if idle_size + 1 >= @max_idle\n thread[:celluloid_queue] << nil\n @busy_size -= 1\n @group.delete(thread)\n else\n @idle_threads.push thread\n @busy_size -= 1\n @idle_size = @idle_threads.length\n clean_thread_locals(thread)\n end\n end\n end",
"title": ""
},
{
"docid": "f96768b4570e059377896510dadde813",
"score": "0.46867386",
"text": "def thread=(_arg0); end",
"title": ""
},
{
"docid": "859adfbf717aaa351a7468ded7b3cff1",
"score": "0.46865916",
"text": "def use_connection(conn_key, spec, th = nil)\n # remove connection first\n de_conn(th)\n\n conns = tconf(th).connections\n n_conn = new_conn(conn_key, spec)\n conns.unshift(n_conn)\n n_conn\n end",
"title": ""
},
{
"docid": "f442f324945278e3ae3fc37701892097",
"score": "0.46772847",
"text": "def remove(thread, conn, server)\n @connections_to_remove.delete(conn)\n allocated(server).delete(thread) if @servers.include?(server)\n @disconnection_proc.call(conn) if @disconnection_proc\n end",
"title": ""
},
{
"docid": "a529efa31accea14b1fb94ddb7846cd2",
"score": "0.4674373",
"text": "def init_mutex\n @mutex = Mutex.new\n end",
"title": ""
},
{
"docid": "4c7b0189f4f10acc21f018467528431d",
"score": "0.4650972",
"text": "def checkin(conn, released = nil)\n synchronize do\n _run_checkin_callbacks(conn)\n\n release conn, conn.owner unless released\n\n @available.add conn\n end\n end",
"title": ""
},
{
"docid": "66007b611b190e04c7e9d7013a511e99",
"score": "0.46464586",
"text": "def connect!\n # Keep existing connections\n return unless @backend.nil?\n\n @backend = train_connection.connection\n @backend.wait_until_ready\n\n # When the testing function `mock_instance` is used, it will set\n # this instance variable to false and handle this function call\n # after the platform data is mocked; this will allow binding\n # of mixin functions based on the mocked platform.\n mix_in_target_platform! unless @mocked_connection\n rescue Train::UserError => e\n raise ConnectionFailure.new(e, config)\n rescue Train::Error => e\n # These are typically wrapper errors for other problems,\n # so we'll prefer to use e.cause over e if available.\n raise ConnectionFailure.new(e.cause || e, config)\n end",
"title": ""
},
{
"docid": "b98b5bb1ef5b99eebdd1a0d82a576567",
"score": "0.46375212",
"text": "def update_thread\n # Kill thread if it exists\n thread && @thread.kill\n @thread = Thread.new do\n loop do\n message = recv\n @state[message.command] = message.value\n yield(message) if block_given?\n end\n end\n end",
"title": ""
},
{
"docid": "a5a4fc794ce6ee5e5d01b7762e57ad4b",
"score": "0.46370515",
"text": "def set_thread_subscription(thread_id, options = {})\n put \"notifications/threads/#{thread_id}/subscription\", options\n end",
"title": ""
},
{
"docid": "27489921181fb41d03620205ae89195c",
"score": "0.46345106",
"text": "def with_connection\n connection_id = current_connection_id\n fresh_connection = true unless active_connection?\n yield connection\n ensure\n release_connection(connection_id) if fresh_connection\n end",
"title": ""
},
{
"docid": "27489921181fb41d03620205ae89195c",
"score": "0.46345106",
"text": "def with_connection\n connection_id = current_connection_id\n fresh_connection = true unless active_connection?\n yield connection\n ensure\n release_connection(connection_id) if fresh_connection\n end",
"title": ""
},
{
"docid": "680658a6667a2cbb421d8b96e95be23a",
"score": "0.4630728",
"text": "def init\n # Open a socket for the server to connect on.\n @sock = TCPSocket.new(@address , @server.port)\n @sock.setsockopt(Socket::SOL_SOCKET, Socket::SO_REUSEADDR, true)\n @sock.setsockopt(Socket::SOL_SOCKET, Socket::SO_LINGER, false)\n unless RUBY_PLATFORM =~ /win32/\n @sock.fcntl(Fcntl::F_SETFL, Fcntl::O_NONBLOCK)\n end\n c = Connection.new(@server, @sock)\n if c.init\n log.info \"(#{c.object_id}) Connection made.\"\n publish(c)\n true\n else\n false\n end\n rescue Exception\n log.error \"Connector#init\"\n log.error $!\n false\n end",
"title": ""
},
{
"docid": "6725f4640c87452563beac40039b5b59",
"score": "0.46305364",
"text": "def connection\n if defined?(@active_connection_name) && (conn = active_connections[@active_connection_name])\n conn\n else\n # retrieve_connection sets the cache key.\n conn = retrieve_connection\n active_connections[@active_connection_name] = conn\n end\n end",
"title": ""
},
{
"docid": "9b978b5ab2498d5face3cf661ea476e0",
"score": "0.4625795",
"text": "def connection\n #N Without this check, we would get a new connection even though we already have a new one\n if @connection == nil\n #N Without this, we don't get feedback about an SSH connection being opened\n puts \"Opening SSH connection to #{user}@#{host} ...\"\n #N Without this, we won't actually connect to the SSH host\n @connection = Net::SSH.start(host, user)\n end\n return @connection\n end",
"title": ""
},
{
"docid": "ea0808eb809004d9e02bda38c236c261",
"score": "0.46233183",
"text": "def establish_connection\n if @socket.nil?\n @socket = TCPSocket.new(@host, @port)\n end\n end",
"title": ""
},
{
"docid": "ea0808eb809004d9e02bda38c236c261",
"score": "0.46233183",
"text": "def establish_connection\n if @socket.nil?\n @socket = TCPSocket.new(@host, @port)\n end\n end",
"title": ""
},
{
"docid": "803bd0fa87a8640a2c340f08f112e47c",
"score": "0.4617344",
"text": "def connecting?\n\t\treturn @connection_thread\n\tend",
"title": ""
},
{
"docid": "ca77784ddeecadd264bd6b6a4744d52b",
"score": "0.46150434",
"text": "def release_connection\n conn = @reserved_connections.delete(current_connection_id)\n checkin conn if conn\n end",
"title": ""
},
{
"docid": "3125287925105144827a424da24f3165",
"score": "0.46142524",
"text": "def connect_connection(connection)\n begin\n connection.connect!\n rescue Exception\n connection.disconnect!(reason: :error)\n raise\n end\n end",
"title": ""
},
{
"docid": "fa917596be874be6594d6d982a4ba864",
"score": "0.46109453",
"text": "def using_connection(connection_or_class, label: nil, &block)\n if connection_or_class.is_a?(Class) && connection_or_class < ActiveRecord::Base\n label ||= connection_or_class.name\n connection_or_class.connection_pool.with_connection do |connection|\n switch_connection_in_block(connection, label: label, &block)\n end\n else\n switch_connection_in_block(connection_or_class, label: label, &block)\n end\n end",
"title": ""
},
{
"docid": "b9ff3a7454f39c284ab4699b9c080e19",
"score": "0.4605921",
"text": "def connection\n if @connection.nil? || @connection.disconnected?\n options = connection_args.first\n @connection = Net::IMAP.new(options[:host], options[:port], options[:use_ssl])\n @connection.login options[:user], options[:password]\n end\n @connection\n end",
"title": ""
},
{
"docid": "88fe8eb06fb716f9fed43501070cbf08",
"score": "0.46051973",
"text": "def use_connection(connection)\n @connection = connection\n @collection = (@connection[@dbname])\n end",
"title": ""
},
{
"docid": "25e6485e90575af872d8d9b04812d511",
"score": "0.45992234",
"text": "def reuse_connection\n logger.debug(\"[Dokken] reusing existing connection #{@connection}\")\n yield @connection if block_given?\n @connection\n end",
"title": ""
},
{
"docid": "680220dd60dd2f1d573f1b411c6283a5",
"score": "0.45964968",
"text": "def initialize(addy, p, nic, usr, pass=nil)\n @reading = nil\n @address = addy\n @port = p\n @nick = nic\n @user = usr\n @password = pass\n #@sock = TCPSocket.open(@address, @port)\n \n addr = Socket.getaddrinfo(@address, nil)\n @sock = Socket.new(Socket.const_get(addr[0][0]), Socket::SOCK_STREAM, 0)\n #setup our timeout\n @@TIMEOUT = 20\n secs = Integer(@@TIMEOUT)\n usecs = Integer((@@TIMEOUT-secs)*1_000_000)\n optval = [secs, usecs].pack(\"l_2\")\n @sock.setsockopt Socket::SOL_SOCKET, Socket::SO_RCVTIMEO, optval\n @sock.setsockopt Socket::SOL_SOCKET, Socket::SO_SNDTIMEO, optval\n\n tryagain = true \n while(tryagain)\n begin\n @sock.connect(Socket.pack_sockaddr_in(port, addr[0][3]))\n tryagain = false\n rescue\n puts \"Connection failed, trying in a few seconds...\"\n sleep(5)\n tryagain = true\n end\n end\n\n write \"USER #{@user} . . :#{@nick}\"\n write \"NICK #{@nick}\"\n if(pass)\n write \"PASS #{@password}\"\n end\n @mutex = Mutex.new\n end",
"title": ""
},
{
"docid": "f55f3d4d6077ff379c2f62ce70881c51",
"score": "0.45911932",
"text": "def connection\n @connection ||= build_connection\n end",
"title": ""
},
{
"docid": "292d0c485f5fa1b5bb8095a220e10ba8",
"score": "0.45865583",
"text": "def reuse_connection\n logger.debug(\"[WinRM] reusing existing connection #{@connection}\")\n yield @connection if block_given?\n @connection\n end",
"title": ""
},
{
"docid": "4532656bbdd8bd0617c64c9f39580399",
"score": "0.45728427",
"text": "def connect_vm_to_thread\r\n #Check for duplicates.\r\n current = Thread.current\r\n error \"F91: Only one virtual machine allowed per thread\" if current[:vm]\r\n\r\n #This virtual machine is associated with this thread.\r\n current[:vm] = self\r\n @start_time = Time.now\r\n\r\n self\r\n end",
"title": ""
},
{
"docid": "d31652e65206ad941107ea4b1f76c3e3",
"score": "0.456737",
"text": "def update_thread\n self.update_attribute(:thread, self.id) unless self.thread\n end",
"title": ""
}
] |
9b8eb8e83bb856e261354f0106add676 | d. Create a method to set ranking, given a ranking value. | [
{
"docid": "b14b45e00d06cdfa38f4dd411e4e3404",
"score": "0.77894044",
"text": "def set_ranking(new_ranking)\n @ranking = new_ranking\n\nend",
"title": ""
}
] | [
{
"docid": "97feea48badd7f499485c79446319571",
"score": "0.81363577",
"text": "def set_rank\n end",
"title": ""
},
{
"docid": "b91bec7185d4c28643d742756a958cbd",
"score": "0.80104357",
"text": "def ranking(rank)\n @ranking = rank\n end",
"title": ""
},
{
"docid": "6783f255f84fe15de823f9cc14b99a8c",
"score": "0.79725605",
"text": "def set_ranking(ranking)\n @ranking = ranking \n end",
"title": ""
},
{
"docid": "9f6b3d7eae5eafbf3b5560041c6c2c96",
"score": "0.79706585",
"text": "def ranking(value)\n @ranking = value\n end",
"title": ""
},
{
"docid": "47523dc4000e9bb78427e02ea4609c4d",
"score": "0.79512936",
"text": "def set_ranking(rank)\n @ranking = rank\n end",
"title": ""
},
{
"docid": "31f28499be5437ccb7d7c90a07e37b61",
"score": "0.79319113",
"text": "def set_rank(rank_number, value)\n rank_index = rank_index(rank_number) \n @ranks[rank_index] = value\n end",
"title": ""
},
{
"docid": "1a9d5a6c068aa087f7af11b93df8d570",
"score": "0.7720844",
"text": "def rank=(value)\n @rank = value\n end",
"title": ""
},
{
"docid": "73de08505b749ed09b6cd5be71ac5ba4",
"score": "0.76150054",
"text": "def set_ranking(ranking, num_rank)\n\t\t @ranking = num_rank\n\t\tend",
"title": ""
},
{
"docid": "be7b9f4abd5abdd6d80c79cf3ae8c76d",
"score": "0.74765056",
"text": "def set_ranking(school, ranking_value)\n school[:ranking] = ranking_value\nend",
"title": ""
},
{
"docid": "9e854916070f2d9106f3d4d432e8274f",
"score": "0.7465339",
"text": "def set_Rank(value)\n set_input(\"Rank\", value)\n end",
"title": ""
},
{
"docid": "583ad6b83453615cfc33a4b2b0749d65",
"score": "0.7382036",
"text": "def set_rank\n @rank = Rank.find(params[:id])\n end",
"title": ""
},
{
"docid": "583ad6b83453615cfc33a4b2b0749d65",
"score": "0.7382036",
"text": "def set_rank\n @rank = Rank.find(params[:id])\n end",
"title": ""
},
{
"docid": "583ad6b83453615cfc33a4b2b0749d65",
"score": "0.7382036",
"text": "def set_rank\n @rank = Rank.find(params[:id])\n end",
"title": ""
},
{
"docid": "2e8c844e0c5b8ebc7ab05f996702e10b",
"score": "0.7335561",
"text": "def rank=(params)\n @rank = GreatSchools::Rank.new(params)\n end",
"title": ""
},
{
"docid": "6654f89f2e26db024b07b4b1253b3191",
"score": "0.7242729",
"text": "def rank(value)\n _rank(value) or fail ArgumentError, \"Unknown value for rank: #{value}\"\n end",
"title": ""
},
{
"docid": "b082b6d4e780bc930e0e0a2efc93a2ef",
"score": "0.72386163",
"text": "def ranking=(reindeer_ranking)\n\t\t@reindeer_ranking = reindeer_ranking\n\tend",
"title": ""
},
{
"docid": "30cd21dd1502a6a895c2c861326beb38",
"score": "0.72336125",
"text": "def set_ranking\n if @ranking = Ranking.find(params[:id])\n else \n record_not_found(error)\n end\n end",
"title": ""
},
{
"docid": "7e66aa145e119377be3e6ad9cbd417ec",
"score": "0.7177548",
"text": "def set_ranking\n @ranking = Ranking.find(params[:id])\n end",
"title": ""
},
{
"docid": "7e66aa145e119377be3e6ad9cbd417ec",
"score": "0.7177548",
"text": "def set_ranking\n @ranking = Ranking.find(params[:id])\n end",
"title": ""
},
{
"docid": "7e66aa145e119377be3e6ad9cbd417ec",
"score": "0.7177548",
"text": "def set_ranking\n @ranking = Ranking.find(params[:id])\n end",
"title": ""
},
{
"docid": "7e66aa145e119377be3e6ad9cbd417ec",
"score": "0.7177548",
"text": "def set_ranking\n @ranking = Ranking.find(params[:id])\n end",
"title": ""
},
{
"docid": "974323e3c47336e178e3d195521bce5c",
"score": "0.70943767",
"text": "def set_rank_criterium\n @rank_criterium = RankCriterium.find(params[:id])\n end",
"title": ""
},
{
"docid": "69bc5084fa261dec53922cb4153db78f",
"score": "0.7033936",
"text": "def set_RankBy(value)\n set_input(\"RankBy\", value)\n end",
"title": ""
},
{
"docid": "7cdf1489497857ef3148e4b867f5f893",
"score": "0.7032997",
"text": "def rank() @rank end",
"title": ""
},
{
"docid": "db8584d2a77be2d38e759d6cf75a6aa1",
"score": "0.69210106",
"text": "def rank\n\nend",
"title": ""
},
{
"docid": "b626620f485f9d42a2db7de240141c4b",
"score": "0.6899604",
"text": "def set_rank\n\t\tself.update(:rank => self.game.players_remaining.count)\n\t\t# to be defined: how to rank player who has won game\n\tend",
"title": ""
},
{
"docid": "b22935b212459c50b201071a6f5e6e83",
"score": "0.6895502",
"text": "def set_rank\n ranks = self.moves.collect{ |x| x.rank }\n if self.state == 'max'\n self.rank = ranks.max\n elsif self.state == 'min'\n self.rank = ranks.min\n end\n end",
"title": ""
},
{
"docid": "255fa0b4b0e08bd6ae7e895c458b50b3",
"score": "0.68267435",
"text": "def set_set_rank\n @set_rank = SetRank.find(params[:id])\n end",
"title": ""
},
{
"docid": "e96b1ad050ef0f09049d3d21623238cf",
"score": "0.6822056",
"text": "def rank(r = false)\n return @rank if r == false\n @rank = r\n end",
"title": ""
},
{
"docid": "96b877f5ad5a8ca33e990904a1a91c0b",
"score": "0.6787766",
"text": "def rank # This type of method is called an \"accessor\" method;\n # it can only access the instance variable \"rank\"--the getter. If we don't do this\n # the instance variable is not accessible to things outside their own class.\n @rank\n end",
"title": ""
},
{
"docid": "f476dad76b4230e168c1c8b018b46e47",
"score": "0.6764178",
"text": "def set_player_rank\n @player_rank = PlayerRank.find(params[:id])\n end",
"title": ""
},
{
"docid": "9b81c374f8410fcf0581f0de8ab4f44c",
"score": "0.67465913",
"text": "def student_at_rank(rank)\n end",
"title": ""
},
{
"docid": "a701f836f9fc69bde44b6e9f90738ab5",
"score": "0.6728452",
"text": "def bw_set_rank(rank)\n @bw_rank = rank\n self\n end",
"title": ""
},
{
"docid": "0decf45d6897f7135f3af1c790e06252",
"score": "0.67233354",
"text": "def rank; end",
"title": ""
},
{
"docid": "0decf45d6897f7135f3af1c790e06252",
"score": "0.67233354",
"text": "def rank; end",
"title": ""
},
{
"docid": "0decf45d6897f7135f3af1c790e06252",
"score": "0.67233354",
"text": "def rank; end",
"title": ""
},
{
"docid": "d07258ef08ab57c23f29154b9b7acde6",
"score": "0.6636185",
"text": "def rank\n raise \"NOT IMPLEMENTED\"\n end",
"title": ""
},
{
"docid": "f7b6954ddd818b74aac0f10fc54d6489",
"score": "0.6618348",
"text": "def update_rank\n self.rank = self.upvotes - self.downvotes\n self.save\n end",
"title": ""
},
{
"docid": "ba62943c4ed585d39e59c3008fdc991a",
"score": "0.6587048",
"text": "def set_rank\n @score = find_or_build_score_for(params[:competitor_id])\n authorize @score, :create?\n if set_competitor_rank_score(@score, params[:rank].to_i - 1)\n flash[:notice] = \"Ok\"\n end\n @street_scores = @judge.reload.scores.sort_by(&:val_1)\n respond_to do |format|\n format.js\n end\n end",
"title": ""
},
{
"docid": "fe705bece23ce0c2921aac60d97c16b0",
"score": "0.6570597",
"text": "def add_rank_expression(expression_name, value)\n @rank_expressions['rank-'+expression_name] = value\n end",
"title": ""
},
{
"docid": "1fb15f6857ff8af9a8facf4b71e043fc",
"score": "0.6566264",
"text": "def set_initial_rank\n self.rank = 0\n end",
"title": ""
},
{
"docid": "f0dfa1be02c88d1872133140628a4c5e",
"score": "0.6564339",
"text": "def initialize(rank_number)\n\t\t\tif rank_number > 12\n\t\t\t\traise RuntimeError, \"Invalid rank number : #{rank_number}.\"\n\t\t\tend\n\t\t\t@value = rank_number + 2\n\t\tend",
"title": ""
},
{
"docid": "be19292574e94f0aae2d437c3d667444",
"score": "0.6537062",
"text": "def set_dummyrank\r\n @dummyrank = Dummyrank.find(params[:id])\r\n end",
"title": ""
},
{
"docid": "341a975da0191cf5f505060e3a751171",
"score": "0.65211725",
"text": "def set_researcher_ranking\n @researcher_ranking = ResearcherRanking.find(params[:id])\n end",
"title": ""
},
{
"docid": "c68c2328d93de3ab1e768964a1b69207",
"score": "0.6516456",
"text": "def rank\n puts 'RANK'\n puts self\n puts current_value\n value_idx = Card.possible_ranks.index(current_value)\n ranks[value_idx]\n end",
"title": ""
},
{
"docid": "0c1245e888608c411d65644cf31d827d",
"score": "0.65088415",
"text": "def rank(key)\n end",
"title": ""
},
{
"docid": "7d74bf65dd356ea7df9325fad4a96148",
"score": "0.64954615",
"text": "def set_page_rank\n @page_rank = PageRank.find(params[:id])\n end",
"title": ""
},
{
"docid": "ac1771e1b54ed27c9f289fdfcd9ef3df",
"score": "0.6486435",
"text": "def update_rank\n age = (created_at - Time.new(1970,1,1)) / (60 * 60 * 24) # 1 day in seconds\n new_rank = points + age\n\n update_attribute(:rank, new_rank)\n end",
"title": ""
},
{
"docid": "6355a6eedf29bc57ef1c32fd06b91647",
"score": "0.64288914",
"text": "def initialize(rank, suit)\n @rank = rank\n @suit = suit\n @value = case rank\n when :A then 11\n when :K then 10\n when :Q then 10\n when :J then 10 ## yuck\n else @rank\n end\n end",
"title": ""
},
{
"docid": "aa0ef656531485ad032362a9110b8d27",
"score": "0.6422926",
"text": "def update_rank\n age = (self.created_at - Time.new(1970,1,1)) / 86400\n new_rank = points + age\n\n self.update_attribute(:rank, new_rank)\n end",
"title": ""
},
{
"docid": "85746f7d5903dfe17b19da6766b8e4b8",
"score": "0.6407926",
"text": "def rank\n icut = icu_tournament\n icut.rerank\n players.each do |player|\n icup = icut.player(player.id)\n player.update_column_if_changed(:rank, icup.rank)\n end\n end",
"title": ""
},
{
"docid": "2301b25d30a0fd32c7d4f94d6abe8212",
"score": "0.64004284",
"text": "def set_rank\n self.rank ||= (form.try(:max_rank) || 0) + 1\n return true\n end",
"title": ""
},
{
"docid": "2301b25d30a0fd32c7d4f94d6abe8212",
"score": "0.64004284",
"text": "def set_rank\n self.rank ||= (form.try(:max_rank) || 0) + 1\n return true\n end",
"title": ""
},
{
"docid": "10f9abe50d2c9ace3ce1649d47fa0ffb",
"score": "0.6385183",
"text": "def rank\n rank = params[:rank].to_i if params[:rank]\n return render :status => 500 if rank and (rank < 0 or rank > 5)\n s = StaffRank.find_or_create_by_user_id_and_staff_id(@user[:id], params[:id])\n\n s.update_attributes :rank => rank if rank\n s.update_attributes :comment => params[:comment] if params[:comment]\n\n redirect_to \"/rank/\" + params[:id]\n end",
"title": ""
},
{
"docid": "303084500a87af4232e438ad8a84039e",
"score": "0.6378331",
"text": "def position= position\n rank position\n end",
"title": ""
},
{
"docid": "e52628cd0542e5668ea658f0fe4c2f25",
"score": "0.6356062",
"text": "def SetRankingMode(ranker)\n ranker = Lib.const_get(\"SPH_RANK_#{ranker.to_s.upcase}\") if ranker.is_a? Symbol\n Lib.sphinx_set_ranking_mode(@sphinx, ranker)\n end",
"title": ""
},
{
"docid": "fa083c3cc19adb55540d43f3b47462d7",
"score": "0.6341019",
"text": "def set_ranking2017\n @ranking2017 = Ranking2017.find(params[:id])\n end",
"title": ""
},
{
"docid": "c113484f29e0eedcf9ba98e60f9ba910",
"score": "0.6330272",
"text": "def rank_for_student(name)\n end",
"title": ""
},
{
"docid": "725592ab0eda3f8a098576a8c352094c",
"score": "0.6329463",
"text": "def rank_for node, value = nil\n raise ArgumentError, \"Graph does not contain #{node}\" unless @nodes[node]\n\n return @nodes[node][:rank] ||= 0 unless value\n\n raise ArgumentError, \"Value is not a non-negative integer\" unless\n value.respond_to? :to_i and value.to_i >= 0\n\n old = @nodes[node][:rank]\n @nodes[node][:rank] = value.to_i\n\n old\n end",
"title": ""
},
{
"docid": "efc6944d500762669596c163d5663e35",
"score": "0.63219947",
"text": "def rank_e; end",
"title": ""
},
{
"docid": "6006672d2ca0a8254bd18099d44d91f6",
"score": "0.63105506",
"text": "def set_relative_rank\n ranked_week_calculations_for_season = PlayerCalculation.for_user(self.user_id).for_season(self.season).rank_by_weekly_load\n i = ranked_week_calculations_for_season.length\n ranked_week_calculations_for_season.each do |calc|\n calc.update(season_rank: i)\n calc.save!\n i = i - 1\n end\n return\n end",
"title": ""
},
{
"docid": "5675cedfdf1bbb4907f69acf33a38471",
"score": "0.63045",
"text": "def update_rank\n age_in_days = (created_at - Time.new(1970,1,1)) / 1.day.seconds\n new_rank = points + age_in_days\n update_attribute(:rank, new_rank)\n end",
"title": ""
},
{
"docid": "d5c6bf82c8f452599bd0fbd34a19a210",
"score": "0.62870646",
"text": "def update_ranking\n\t\t\t@log.error(\"Plase implement update_ranking on nalserver \")\n\t\tend",
"title": ""
},
{
"docid": "c621df562d897bbac03150ac4e2a26f8",
"score": "0.6282264",
"text": "def set_track_rank\n @track_rank = TrackRank.find(params[:id])\n end",
"title": ""
},
{
"docid": "2891779df0d7ae15b39a91d8a43437d2",
"score": "0.6281322",
"text": "def set_initial_rank\n self.rank = 0\n end",
"title": ""
},
{
"docid": "2891779df0d7ae15b39a91d8a43437d2",
"score": "0.6281322",
"text": "def set_initial_rank\n self.rank = 0\n end",
"title": ""
},
{
"docid": "618f3ad8b41f9bc1e1a26052e9f8fcb1",
"score": "0.628055",
"text": "def settingrank\n @course = Course.shod(params[:id])\n @rank_lev = RankingLevel.new\n @rank_levels ||= @course.ranking_levels\n @rank_lev1 = @course.ranking_levels.build\n authorize! :create, @rank_lev\n end",
"title": ""
},
{
"docid": "d8565da218d3f140e824578002c6c158",
"score": "0.62711793",
"text": "def create_rank_with_ranking_function(rank_func, klass)\n rank = FactoryGirl.create(:ranking, :ranked_type_call => rank_func, :ranked_type => klass)\n # Calculate all the ranking values\n rank.calculate\n rank\nend",
"title": ""
},
{
"docid": "87c27b113b12a2b214253dbeed5590ab",
"score": "0.62319434",
"text": "def set_rank_params\n params.require(:set_rank).permit(:code, :name, :display)\n end",
"title": ""
},
{
"docid": "87cd1643d4e4006c1f4595a1606c0a73",
"score": "0.62316567",
"text": "def initialize(rank=0,suit= :\"?\" )\n rank == 1 ? (rank = 14) : rank\n @rank = rank\n @suit = suit.to_sym\n end",
"title": ""
},
{
"docid": "421a1f04c2967cace6367158ddc594a7",
"score": "0.61852854",
"text": "def rank(i, r = @root)\n rank_helper(i, r)\n end",
"title": ""
},
{
"docid": "41a37a2b190cd4a4f9f5fb69a1c35000",
"score": "0.6173816",
"text": "def update_ranks(mode = 'hs', player_id = nil)\n return -1 if !['hs', 'sr'].include?(mode)\n rank = -1\n board = leaderboard(mode, true, truncate: 0, pluck: false)\n tied_score = board[0][\"score_#{mode}\"]\n tied_rank = 0\n board.each_with_index{ |s, i|\n rank = i if !player_id.nil? && s.player_id == player_id\n score = mode == 'hs' ? s.score_hs : s.score_sr\n if mode == 'hs' ? score < tied_score : score > tied_score\n tied_rank = i\n tied_score = score\n end\n s.update(\"rank_#{mode}\".to_sym => i, \"tied_rank_#{mode}\".to_sym => tied_rank)\n }\n rank\n end",
"title": ""
},
{
"docid": "e8b988a634d70606be7aabeb8c2f5b88",
"score": "0.6148627",
"text": "def update_rank(goals_for, goals_against)\n self.rank += (goals_for - goals_against)\n end",
"title": ""
},
{
"docid": "46fe4e0b8a28504507605909fc688578",
"score": "0.6147008",
"text": "def renumber(criterion = :rank)\n if (criterion.class == Hash)\n # Undocumentted feature - supply your own hash.\n map = criterion\n else\n # Official way of reordering.\n map = Hash.new\n\n # Renumber by rank only if possible.\n criterion = criterion.to_s.downcase\n if criterion == 'rank'\n begin check_ranks rescue criterion = 'name' end\n end\n\n # Decide how to renumber.\n if criterion == 'rank'\n # Renumber by rank.\n @player.values.each{ |p| map[p.num] = p.rank }\n elsif criterion == 'order'\n # Just keep the existing numbers in order.\n @player.values.sort_by{ |p| p.num }.each_with_index{ |p, i| map[p.num] = i + 1 }\n else\n # Renumber by name alphabetically.\n @player.values.sort_by{ |p| p.name }.each_with_index{ |p, i| map[p.num] = i + 1 }\n end\n end\n\n # Apply renumbering.\n @teams.each{ |t| t.renumber(map) }\n @player = @player.values.inject({}) do |hash, player|\n player.renumber(map)\n hash[player.num] = player\n hash\n end\n\n # Return self for chaining.\n self\n end",
"title": ""
},
{
"docid": "9a371d2b3b311f79281aff2cebec8b11",
"score": "0.61330765",
"text": "def initialize(rank, suit, color)\n @rank = rank\n @suit = suit\n @color = color\n @value = rank.to_i\n if rank == 'J' || rank == 'Q' || rank == 'K'\n @value = 10\n elsif rank == \"A\"\n @value = 11\n @alt_value = 1\n end\n end",
"title": ""
},
{
"docid": "75c929157cd49e5e9e86bffd738c9928",
"score": "0.6132189",
"text": "def set_military_rank\n @military_rank = MilitaryRank.find(params[:id])\n end",
"title": ""
},
{
"docid": "fdc1cde5f1326bb43240f29fea959618",
"score": "0.6127765",
"text": "def set_ranking2016\n @ranking2016 = Ranking2016.find(params[:id])\n end",
"title": ""
},
{
"docid": "d519790c196bd0e17c98bdefb5f397cf",
"score": "0.61235553",
"text": "def sort_rank\n @sort_rank ||= company.rank_by_properties(self)\n end",
"title": ""
},
{
"docid": "eb0b8deba2a73050faee5cd4d9aa20c4",
"score": "0.6119368",
"text": "def set_player_rankings_rb\n @player_rankings_rb = PlayerRankingsRb.find(params[:id])\n end",
"title": ""
},
{
"docid": "23407bb6555e63144b09c6ecb83b2550",
"score": "0.6117656",
"text": "def initialize(rank, suit, color)\n @rank = rank\n @suit = suit\n @color = color\n @value = rank\n if rank == 'K' || rank == 'Q' || rank == 'J'\n @value = 10\n elsif rank == 'A'\n @value = 11\n end\n\n\nend",
"title": ""
},
{
"docid": "84877edb749f62db5aecce8e7c54cfb7",
"score": "0.6108503",
"text": "def set_ninja_rank \n if elo == 2800 \n self.rank = \"Kage\"\n elsif elo == (2400..2799)\n self.rank = \"Jonin\"\n elsif elo == (2100..2399)\n self.rank = \"Chūnin\"\n elsif elo == (1700..2099)\n self.rank = \"Genin\"\n else \n self.rank = \"Young grasshopper\"\n end\n end",
"title": ""
},
{
"docid": "7c150128b638850f6cf0e7a1a529b110",
"score": "0.6102892",
"text": "def set_members_rank\n @members_rank = MembersRank.find(params[:id])\n end",
"title": ""
},
{
"docid": "a421e4974ffaf26d2e644cb581af491e",
"score": "0.60957694",
"text": "def set_food_rank\n @food_rank = FoodRank.find(params[:id])\n end",
"title": ""
},
{
"docid": "24ce8500963aa80e5052779104a8a31d",
"score": "0.60813487",
"text": "def rank\n r = self.attributes['rank']\n r ? r.to_sym : r\n end",
"title": ""
},
{
"docid": "0eb7cd6f37856e413514a7e30c826e5a",
"score": "0.6080843",
"text": "def rank\n return @rank\n end",
"title": ""
},
{
"docid": "2eea124699e0e9be2a9bddebf668481d",
"score": "0.6077023",
"text": "def rank_number(player_number)\n if player_number == 1\n 8 - @y\n else\n @y + 1\n end\n end",
"title": ""
},
{
"docid": "e6a831485c8c7d0b299a5f24bdbb2fd7",
"score": "0.60722834",
"text": "def initialize ranker\n raise \"RankRoulette: invalid Ranking object\" unless ranker.kind_of? Ranking \n @ranker = ranker\n @roulette = Roulette.new :proportion\n @population = nil \n @ranked = nil\n end",
"title": ""
},
{
"docid": "dc99ad01e8a7c990de4ea0d6905bc231",
"score": "0.60644126",
"text": "def update_rank\n age = (self.created_at - Time.new(1970,1,1)) / 86400\n new_rank = points + age\n\n self.update_attribute(:rank, new_rank)\nend",
"title": ""
},
{
"docid": "a3e1bebb7e5f8e31dfc1a6ccdd737c61",
"score": "0.60491484",
"text": "def calculate_rank\n 0\n end",
"title": ""
},
{
"docid": "2c4749e833891f0df3c627baca3bbfbb",
"score": "0.60311335",
"text": "def initialize(rank, value, suit)\n @rank = rank\n @value = value\n @suit = suit\n end",
"title": ""
},
{
"docid": "2c4749e833891f0df3c627baca3bbfbb",
"score": "0.60292554",
"text": "def initialize(rank, value, suit)\n @rank = rank\n @value = value\n @suit = suit\n end",
"title": ""
},
{
"docid": "40a22cb66cfc48bc232ec939dda7ca74",
"score": "0.60270995",
"text": "def true_value\n if self.value ==='A'\n self.update(rank: 11)\n elsif self.value == 'K' || self.value == 'Q' || self.value == 'J'\n self.update(rank: 10)\n else \n self.update(rank: self.value.to_i)\n end \n end",
"title": ""
},
{
"docid": "b81984b1ef87520362f347c968320bd2",
"score": "0.6013978",
"text": "def update_ranks(frequency)\n PortfolioStat.all(:conditions => { :frequency => frequency },\n :order => 'net_worth DESC, portfolio_id DESC').\n each_with_index do |stat, i|\n stat.update_attributes! :rank => i + 1\n end\n record_stats_update frequency \n end",
"title": ""
},
{
"docid": "da544c891256bb393d49f44a0e22586c",
"score": "0.60115343",
"text": "def rank\n case self.total_score \n when 0..1999\n \"Slave\"\n when 2000..3999\n \"Labourer\"\n when 4000..5999\n \"Servant\"\n when 6000..7999\n \"Artisan\"\n when 8000..9999\n \"Merchant\"\n when 10000..11999\n \"Military Officer\"\n when 12000..13999\n \"Palace Official\"\n when 14000..15999\n \"Architect\"\n when 16000..17999\n \"Temple Priest\"\n when 18000..19999\n \"King\"\n else\n \"Nimrod\" #top_rank - Nimrod, leader of the Babylonians :-)\n end\n end",
"title": ""
},
{
"docid": "3afcf448bd1d08d3c43717d5f958aea1",
"score": "0.6006723",
"text": "def normalized_rank\n\t\tself.rank / 10\n\tend",
"title": ""
},
{
"docid": "c2b397179cfd8b9c967fd5c7e66037a1",
"score": "0.59844315",
"text": "def update_ranks\n rank = 0\n ncon = nil\n Contributor.all_with_ncontributions.each do |contributor|\n if contributor.ncontributions != ncon\n rank += 1\n ncon = contributor.ncontributions\n end\n contributor.update_attribute(:rank, rank) if contributor.rank != rank\n end\n end",
"title": ""
},
{
"docid": "50654a7b30d136965c5a254413ee302c",
"score": "0.59784317",
"text": "def candidate(rank); end",
"title": ""
},
{
"docid": "3b546c5bdfe53d009a3817834cca4c5b",
"score": "0.59733474",
"text": "def ranking\n # self[\"score\"] + ( subreddit_subscribers(self[\"subreddit\"]) + self[\"num_comments\"] )\n self['ranking'] = score + self['num_comments']\n end",
"title": ""
},
{
"docid": "3b546c5bdfe53d009a3817834cca4c5b",
"score": "0.59733474",
"text": "def ranking\n # self[\"score\"] + ( subreddit_subscribers(self[\"subreddit\"]) + self[\"num_comments\"] )\n self['ranking'] = score + self['num_comments']\n end",
"title": ""
},
{
"docid": "f9ccae99c3dd70473cbf0d722b6979eb",
"score": "0.5957702",
"text": "def set_fund_ranking\n @fund_ranking = FundRanking.find(params[:id])\n end",
"title": ""
}
] |
2fe419bc74305f3ba280f67655e851be | Basic list with symbol to retrieve field, label and value | [
{
"docid": "f21f0598be9371627654f7d7191364de",
"score": "0.0",
"text": "def test_filter_with_meth\n html = filter %w(a b b c e e f), :to_s\n assert_equal %q{<select class=\"filter_select\" id=\"filter-to_s\" name=\"filter[to_s]\" onchange=\";if($('filter_button')) $('filter_button').disabled = false;\"><option value=\":all\">All</option>\n<option value=\"a\">a</option>\n<option value=\"b\">b</option>\n<option value=\"c\">c</option>\n<option value=\"e\">e</option>\n<option value=\"f\">f</option></select>}, html\n end",
"title": ""
}
] | [
{
"docid": "8cd018e364902fd63e3085571b29402e",
"score": "0.67728025",
"text": "def values_label_fields\r\n labels = []\r\n (1..5).each do |i|\r\n labels << @browser.label(id: \"lbl_val_#{i}\")\r\n end\r\n end",
"title": ""
},
{
"docid": "5f9c297ad8a07e2c7440dd9871aa106e",
"score": "0.67121625",
"text": "def field_names\n label_fields.to_h\n end",
"title": ""
},
{
"docid": "3589418a04eec035fe2b38ebfac4fcea",
"score": "0.64533263",
"text": "def fields\n [:field, :value]\n end",
"title": ""
},
{
"docid": "1dc7d16aa4ff3436aadf992770130ac4",
"score": "0.6407453",
"text": "def field_list\n fields.keys\n end",
"title": ""
},
{
"docid": "fae075d0731f174dc77a8fa1a2f8f206",
"score": "0.63899064",
"text": "def inspect\n type_ann = typed? ? \"<#{type.name.split(\"::\").last}>\" : \"\"\n \"List#{type_ann}#{value.inspect}\"\n end",
"title": ""
},
{
"docid": "de045c644c16af4ccfa4b22c7accbf35",
"score": "0.6328486",
"text": "def label_list\n @label_list || labels.map(&:name).join(\", \")\n end",
"title": ""
},
{
"docid": "a2ca0ae1dbda6f9522f69989c43a5e54",
"score": "0.62579244",
"text": "def field_list\n self.field_list_raw.split(',')\n end",
"title": ""
},
{
"docid": "0987b297c38b402d6fbea9afedd8429c",
"score": "0.6206564",
"text": "def get_field_list_rtpl\n field_string = '{%=' + @model_name + '[:' + @name + ']%}'\n field_string\n end",
"title": ""
},
{
"docid": "d9dc39bac826edff2c18c0a1dade9940",
"score": "0.6199773",
"text": "def new_label_list\n fields = all_fields(visible:true).map{|f| {f: f, pos: f.top_left} }\n list_of_lists = fields.map{ |i| i[:pos] }\n sorted_list = list_of_lists.sort {|item1, item2| item2[1]<=>item1[1]}\n labels_list = Array.new\n sorted_list.each do |item|\n label = fields.find { |h| h[:pos] == item }[:f]\n labels_list.push(label) \n end\n labels_list\n end",
"title": ""
},
{
"docid": "e25dbb6f7b3012788d4a2db1be46fb40",
"score": "0.6192185",
"text": "def term_list(field, show_all_fields = true)\n returned_values = {}\n keys = field.keys\n\n keys.each do |key|\n key_sym = key.to_sym\n\n if key_sym == :term\n returned_values[:label] = field[:term]\n else\n returned_values[key_sym] = field[key_sym]\n end\n end\n\n returned_values[:active] = field.fetch(:active, true) if show_all_fields\n\n returned_values\n end",
"title": ""
},
{
"docid": "53766d9f5e561a6c54b4bdd1b2506dd7",
"score": "0.6147972",
"text": "def fedora_field_label(ds,fields,label)\n label\nend",
"title": ""
},
{
"docid": "53766d9f5e561a6c54b4bdd1b2506dd7",
"score": "0.6147972",
"text": "def fedora_field_label(ds,fields,label)\n label\nend",
"title": ""
},
{
"docid": "eabb410b643f144b0bee4a6f65860c3a",
"score": "0.6145519",
"text": "def generate_list\n Field::FIELD_NAMES.each do |name|\n f = get name\n if f.is_a? Array\n f.each do |multi_field|\n add_to_list(multi_field)\n end\n else\n add_to_list(f)\n end\n end\n end",
"title": ""
},
{
"docid": "547e796b44c2aa4e5d2bf79bf4c29aaa",
"score": "0.6140269",
"text": "def values\n fields.map(&:value)\n end",
"title": ""
},
{
"docid": "55e90896fb474eb38b4ebf9056988aaf",
"score": "0.6135914",
"text": "def picklist_values(sobject, record_type_id, field)\n describe_layout(sobject, record_type_id).record_type_mappings.picklists_for_record_type\n .select { |p| p.picklist_name == field }.first.picklist_values\n .select { |p| p.active }.collect { |p| [ p.label, p.value ] }\n end",
"title": ""
},
{
"docid": "a90e6072cf6d1be46466bcaa6e7c1c6e",
"score": "0.61294734",
"text": "def field_values( field )\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "df82774b697c18544e29645a77c0dc3e",
"score": "0.61261725",
"text": "def get_fields\n FIELD_DESCS\n end",
"title": ""
},
{
"docid": "cf402f49c2030916b085ae2c38b0973c",
"score": "0.6116081",
"text": "def list\n @calc_field_collection.keys\n end",
"title": ""
},
{
"docid": "77a91cc2632a66467fd96a89881d5294",
"score": "0.60759956",
"text": "def value\n (@subfields.map { |s| s.value }.join \"\")\n end",
"title": ""
},
{
"docid": "8fcadd5ac294c0024cba7d6749ea3f0d",
"score": "0.60719913",
"text": "def rendering_fields\n list = []\n instance_variables.each do |iv|\n name = iv.to_s.sub('@','')\n next if name.start_with?('_')\n list << name\n end\n list\n end",
"title": ""
},
{
"docid": "478ac4c00dffda0800ada0cb474eb1bb",
"score": "0.6063606",
"text": "def view_attribute_list\n field_list_array\n end",
"title": ""
},
{
"docid": "cd64817f7752b9cf3dafa9ca8cbb9f0b",
"score": "0.6063251",
"text": "def getValueEntries()\r\n ids = [ \"lbl_val_1\", \"lbl_val_2\", \"lbl_val_3\", \"lbl_val_4\", \"lbl_val_5\" ]\r\n return getTextsOfLIs(ids)\r\n end",
"title": ""
},
{
"docid": "8ecd4ff665e16cf6abcd2da0b1d9b9db",
"score": "0.60143363",
"text": "def FieldList\n @_FieldList ||= OLEProperty.new(@ole, 4, [VT_BSTR], [VT_BSTR, VT_BSTR])\n end",
"title": ""
},
{
"docid": "5bf2dddd783a4901d4303d5867ecb9c8",
"score": "0.6006641",
"text": "def field_list(fields)\n case fields\n when Array:\n if fields.empty?\n WILDCARD\n else\n fields.map {|i| field_name(i)}.join(COMMA_SEPARATOR)\n end\n when Symbol:\n fields.to_field_name\n else\n fields\n end\n end",
"title": ""
},
{
"docid": "5a5c75a94b78386241c9912f77e0f71e",
"score": "0.5990362",
"text": "def fields\n @fields ||= Asset::FIELD_NAMES.inject([]) do |list,fn|\n value = liquidate(source.send(fn))\n value.blank? ? list : list << { 'name' => fn.to_s, 'value' => value }\n end\n end",
"title": ""
},
{
"docid": "70399d19513f3868230e6c0464f48efa",
"score": "0.5983792",
"text": "def FieldList\n @_FieldList ||= OLEProperty.new(self, 4, [VT_BSTR], [VT_BSTR, VT_BSTR])\n end",
"title": ""
},
{
"docid": "26e74021745ba7e35319496533d1cca9",
"score": "0.59695876",
"text": "def to_list\n @fields.to_a.map {|a| [a[0].to_s.downcase, a[1]]}\n end",
"title": ""
},
{
"docid": "630033d087d02aad77d9a094ccac4c87",
"score": "0.5967971",
"text": "def fields_for_display\n self.properties_with_names.reject{ |key,value,label|\n EXCLUDE_FIELDS_FROM_DISPLAY.include? key}.map{ |key,value,label|\n [label, value] }\n end",
"title": ""
},
{
"docid": "630033d087d02aad77d9a094ccac4c87",
"score": "0.5967971",
"text": "def fields_for_display\n self.properties_with_names.reject{ |key,value,label|\n EXCLUDE_FIELDS_FROM_DISPLAY.include? key}.map{ |key,value,label|\n [label, value] }\n end",
"title": ""
},
{
"docid": "f1145e5fd4b3d4d20c7af30bd6b91fe1",
"score": "0.5946042",
"text": "def fields\n components.fetch(:fields).map { |field| field.to_s }\n end",
"title": ""
},
{
"docid": "1f885aeed92926e24fcc482c0f50d748",
"score": "0.59202796",
"text": "def labels\n\t\t@data.keys\n\tend",
"title": ""
},
{
"docid": "eaf9e0c14f1be8f0b5e7666518744f32",
"score": "0.59113187",
"text": "def text_value_for(list, label )\t\t\t\r\n\t\t\ti = index_for(label)\r\n\t\t\treturn nil if i.nil?\r\n\t\t\t\t\r\n\t\t\tif ( list.kind_of?(Hpricot::Node) )\r\n\t\t\t\t# Assume they passed in a HIP 'row' element, turn it\r\n\t\t\t\t# into a nice array of strings. Can't figure out how\r\n\t\t\t\t# to test if it really is a 'row' element!\r\n \t\t\t\tlist = list.search('/cell/data/text').collect {|e| e.inner_text}\r\n\t\t\tend\r\n\t\t\t\r\n\t\t\treturn list.at( i )\r\n\t\t\t\t\r\n\t\tend",
"title": ""
},
{
"docid": "00f64d3a084f287616f0f02159419fde",
"score": "0.5889687",
"text": "def labels\n map { |e| e.get_label }\n end",
"title": ""
},
{
"docid": "d3d33a6f9a675a0988dcd47b49f4b33a",
"score": "0.5880687",
"text": "def list_fields fields, viewer_id=nil\n viewer_id ||= User.super_id\n fields.collect { |field|\n if field.is_a? Array\n field, label = field[0], field[1]\n else\n label = present_field_label field\n end\n [ label, present_field(field) ]\n }\n end",
"title": ""
},
{
"docid": "cedec1619b344a05b146ed33f398298a",
"score": "0.58762574",
"text": "def field_names; @field_names; end",
"title": ""
},
{
"docid": "737930977cbd3a58ed001eb242cbe379",
"score": "0.584971",
"text": "def getvalue\n @list\n end",
"title": ""
},
{
"docid": "7acaca3fca0691528c72df070671c464",
"score": "0.58386236",
"text": "def label\n []\n end",
"title": ""
},
{
"docid": "ffd2bec0451e59f9b7b164e2518723cf",
"score": "0.58333886",
"text": "def list\n map do |name,| name end\n end",
"title": ""
},
{
"docid": "fd7331cae6bbefb6dcf33357ae3ef874",
"score": "0.5832558",
"text": "def label_fields\n @label_fields ||= LabelFields.new do |lf|\n labels.each { |label| lf.add(label) }\n end\n end",
"title": ""
},
{
"docid": "36ceda01d30785d57f6f567f79eb1078",
"score": "0.58295405",
"text": "def d_lbls; end",
"title": ""
},
{
"docid": "7929befaaa85ac10150286c7747999cf",
"score": "0.582899",
"text": "def render_field(field_symbol)\n value = send(field_symbol)\n if value.is_a?(Array)\n value.join(\", \")\n else\n value\n end\n end",
"title": ""
},
{
"docid": "8b81de675854464f7085494cf062f6bb",
"score": "0.58146375",
"text": "def special_fields\n []\n end",
"title": ""
},
{
"docid": "a197d10724dab4bf819116f3293586e4",
"score": "0.58140385",
"text": "def labelled_values\n if labels.empty?\n values\n else\n lv = []\n self.values.each_with_index do |v,i|\n if labels[i] && !v.is_a?(Hash)\n lv << {\"value\" => v, \"label\" => labels[i].to_s}\n else\n lv << v\n end\n end\n lv\n end\n end",
"title": ""
},
{
"docid": "f12d992ac75d531789defe48f9cdf455",
"score": "0.5812006",
"text": "def labels\n keys\n end",
"title": ""
},
{
"docid": "371aef7187252056f4dd48d3115c29ca",
"score": "0.58098894",
"text": "def olist\n @olist ||= raw_field.blank? ? [] : raw_field.map { |h| decode(h) }\n end",
"title": ""
},
{
"docid": "1d2a6a42bd78fa262bcebd9d60aaac0d",
"score": "0.5790852",
"text": "def contact_field_list\n @contact_field_list ||= Contact::FIELDS.map do |f|\n [I18n.t(f.singularize, scope: [:values, :contacts]), f]\n end\n end",
"title": ""
},
{
"docid": "d01a414417c0e39a0fe3197a7860b8a7",
"score": "0.5780465",
"text": "def inspect\n \"#<#{self.class.to_s} name=#{@bit_magic_name} field_list=#{@field_list.inspect}>\"\n end",
"title": ""
},
{
"docid": "61ea21765570a31b7dfae564760b2178",
"score": "0.5771947",
"text": "def names\n\n get_list['list'].map { |re, pa| re }\n end",
"title": ""
},
{
"docid": "df12d9127c76a5d3776622bba0eb2ef7",
"score": "0.5769645",
"text": "def tags\n retval = []\n optional_fieldnames.each do |of|\n retval << [of, get_datatype(of), get(of)]\n end\n return retval\n end",
"title": ""
},
{
"docid": "4b12afca3d7e20ecb4c8891ecee6b86e",
"score": "0.5768372",
"text": "def label\n \"#{symbol} [#{name}]\"\n end",
"title": ""
},
{
"docid": "9e534e545f227e884c4d53bd995bcd32",
"score": "0.57606375",
"text": "def [](field_name); end",
"title": ""
},
{
"docid": "27b7c0ac9550087c6fb8b91ebaf006f4",
"score": "0.5755761",
"text": "def mailchimp_list_fields\n Field.where(as: 'mailchimp_list')\n end",
"title": ""
},
{
"docid": "61760aab18d52d7fa3945fb061cf38d3",
"score": "0.57425743",
"text": "def fields(list_name)\n get \"#{base_url}/lists/#{list_name}/fields\"\n end",
"title": ""
},
{
"docid": "3c905f1e69f74776900b76517c2b06a5",
"score": "0.5737243",
"text": "def label_details; end",
"title": ""
},
{
"docid": "1dabf837e96c23b65621265f4b44e7cc",
"score": "0.5731095",
"text": "def labeled_field(label, value)\n (\"<dt>#{label}</dt> <dd>#{value}</dd>\").html_safe\n end",
"title": ""
},
{
"docid": "5e10a2fde1ab590232a5aed0bcbf4d35",
"score": "0.57222384",
"text": "def getListField(listId, field)\n\tlist = RestClient.get(\"https://api.trello.com/1/lists/\"+listId+\"/\"+field+\"?key=\"+$key+\"&token=\"+$token)\n\tlist = JSON.parse(list)\t\nend",
"title": ""
},
{
"docid": "678921e7ff95a990bbd856902f8e1e83",
"score": "0.5720317",
"text": "def field_list\n [ self.department && self.department.name,\n self.category_list_of_job,\n self.course_list_of_job,\n self.proglang_list_of_job,\n ('credit' if self.credit?),\n ('paid' if self.pay?)\n ].compact.reject(&:blank?)\n end",
"title": ""
},
{
"docid": "a63cbac919f885b8a703a0e0530b9344",
"score": "0.57147896",
"text": "def signature\n [@field.name, @field.type]\n end",
"title": ""
},
{
"docid": "ebb144e148066e67aaed99e728cf7f49",
"score": "0.5714108",
"text": "def field_list_command(table, field)\n synchronize do\n reset\n write [COM_FIELD_LIST, table, 0, field].pack(\"Ca*Ca*\")\n fields = []\n until self.class.eof_packet?(data = read)\n fields.push Field.new(FieldPacket.parse(data))\n end\n return fields\n end\n end",
"title": ""
},
{
"docid": "ebb144e148066e67aaed99e728cf7f49",
"score": "0.5714108",
"text": "def field_list_command(table, field)\n synchronize do\n reset\n write [COM_FIELD_LIST, table, 0, field].pack(\"Ca*Ca*\")\n fields = []\n until self.class.eof_packet?(data = read)\n fields.push Field.new(FieldPacket.parse(data))\n end\n return fields\n end\n end",
"title": ""
},
{
"docid": "585040dcdb17f44d084374e27ed91ef7",
"score": "0.57132316",
"text": "def display_field(document, field_name, label, opts = {})\n values = get_array_from_solr document, field_name\n \n if opts[:dedupe]\n if :personal_names == opts[:dedupe]\n values.uniq! { |s| s.gsub(/\\s?--\\s*$/, '').gsub(/^(.*),\\s([A-Z]).*\\z/, '\\2 \\1').gsub(/^([a-zA-Z]).*\\s([a-zA-z]*)[,\\(-\\z]/, '\\1 \\2') }\n end\n end\n\n\treturn array_to_html_for_display values, label, opts\n end",
"title": ""
},
{
"docid": "7c6cf1d22e6fa6cfc8745631a5ce6141",
"score": "0.5711285",
"text": "def list_tag\n custom_field.field_group.tag\n end",
"title": ""
},
{
"docid": "5a2c7d13c1bc09bcf0453986b88c2390",
"score": "0.57100785",
"text": "def fields\n FIELDS\n end",
"title": ""
},
{
"docid": "104acb3704d6374dbec6dc63b2093960",
"score": "0.570929",
"text": "def get_field(list, field_name)\n list.each do |item|\n return item[\"fieldValue\"] if item[\"fieldName\"] == field_name\n end\n nil\n end",
"title": ""
},
{
"docid": "c9d4bf9efded2d03a911918faaca3464",
"score": "0.57073116",
"text": "def display_fields\n [\"name\", \"assignment_name\", \"description\", \"where_stored\"]\n end",
"title": ""
},
{
"docid": "715a95cf42d3679809a9b6beab27b5ca",
"score": "0.5706983",
"text": "def add(label)\n labels[label.name] = label.field_names\n end",
"title": ""
},
{
"docid": "a1e8af839784f8696025722f5d6a8c7f",
"score": "0.5693146",
"text": "def list_display_name(val_ary)\n '[' + opts_str_for(val_ary) + ']'\n end",
"title": ""
},
{
"docid": "eccda7fb02a5bfd4d2a3383a79fcd641",
"score": "0.56839764",
"text": "def collection_field\n safe_const_get(:LIST_FIELD)\n end",
"title": ""
},
{
"docid": "a521eac725d0682516b27537e53037dd",
"score": "0.5676003",
"text": "def lookup_fields(name)\n lookup(name).lookup_field_map.values.collect{ |v| v.to_s }\n end",
"title": ""
},
{
"docid": "87eee548218a4dcad3df38c7b57666e3",
"score": "0.5670823",
"text": "def option_elems(label_method, value_method)\n # Ruby 3 requires us to be explicit about keyword arguments, so creating a\n # hash of potential keyword arguments to double splat in the method call\n label_options = label_method.is_a?(Array) ? label_method[1] : {}\n label_symbol = label_method.is_a?(Array) ? label_method[0] : label_method\n\n collection.map do |i|\n [\n i.public_send(label_symbol, **label_options),\n i.public_send(*value_method),\n data_for_item(i),\n ]\n end\n end",
"title": ""
},
{
"docid": "bed7073ddf0c15608628aedbc923ec27",
"score": "0.56693625",
"text": "def pull_field(obj, opts = {})\n opts = {field:\"label\", default: nil}.merge(opts)\n val = case obj.class.to_s\n when \"String\" then obj\n when \"Hash\" then pull_field(obj[opts[:field]], opts) \n when \"Array\"\n temp = obj.collect{|a| pull_field(a,opts)}.compact\n opts[:only_first] ? temp.first : temp.join(\", \")\n else nil \n end \n val ||= \"<span class='blank_label'>#{opts[:default]}</span>\" if opts[:default]\n val\n end",
"title": ""
},
{
"docid": "713645efaa3016219095d862834f0bb0",
"score": "0.56682116",
"text": "def list(*values)\n RDF::List[*values.map {|v| expand_pname(v) rescue RDF::Literal(v)}]\n end",
"title": ""
},
{
"docid": "a0ae8a63a3d4bb775c82175c591f13e9",
"score": "0.56665736",
"text": "def hash\n @label\n end",
"title": ""
},
{
"docid": "b303a82d5395a828caa360d232c53824",
"score": "0.56510115",
"text": "def labels; end",
"title": ""
},
{
"docid": "b303a82d5395a828caa360d232c53824",
"score": "0.56510115",
"text": "def labels; end",
"title": ""
},
{
"docid": "b303a82d5395a828caa360d232c53824",
"score": "0.56510115",
"text": "def labels; end",
"title": ""
},
{
"docid": "b303a82d5395a828caa360d232c53824",
"score": "0.56510115",
"text": "def labels; end",
"title": ""
},
{
"docid": "b303a82d5395a828caa360d232c53824",
"score": "0.56510115",
"text": "def labels; end",
"title": ""
},
{
"docid": "d06732dbd14aa8a8573360dc7be8f693",
"score": "0.56509376",
"text": "def [](sym)\n move_raw_value_to_field(sym)\n @fields[sym]\n end",
"title": ""
},
{
"docid": "09fed8db0ebd1b74ebec3c92ef0879a5",
"score": "0.5648644",
"text": "def label\n attribute :label\n end",
"title": ""
},
{
"docid": "e3650e56852d7cb81b579fb5c9ff8bdf",
"score": "0.5639488",
"text": "def label_descrs(row)\n label = Label.descr_by_name('G_CODE')\n result = [label]\n unless row.nil?\n if self.custom_field.is_a?(CustomFields::OptionCombindedReference) \n source_field = Field.find(self.value[:field_id].to_i)\n actual_row = Field.row_by_field(source_field, row)\n screen_cell = actual_row.cell(source_field.custom_field_id) unless actual_row.nil?\n screen_descrs = CustomFields::ScreenCombindedReference.cell_screen_group_descr(screen_cell.value) unless screen_cell.nil?\n result += screen_descrs.to_s\n end\n end\n result\n end",
"title": ""
},
{
"docid": "e47f7281c224f3d53415c48e13a9f76b",
"score": "0.56343794",
"text": "def values\n @strings.collect { |s| s.name }\n end",
"title": ""
},
{
"docid": "618c84374f504a9e54dac34a23e76228",
"score": "0.56279945",
"text": "def item\n @list[@index][:symbol];\n end",
"title": ""
},
{
"docid": "aea1893ce2c48e9ef4f6dd53433d56d4",
"score": "0.5627796",
"text": "def label_key\n label_field_code\n end",
"title": ""
},
{
"docid": "c507325f7035dcd95b0b54a610aabe1d",
"score": "0.5625334",
"text": "def fields(item)\n\n fields = []\n\n @field_classes.each_pair do |element, value|\n\n value.each_pair do |label, klass|\n\n if element == 'title' and label == 'english'\n\n fields << klass.new(item, element, label, \"[#{@prefix}#{\"%04d\" % item.number}] \")\n else\n \n fields << klass.new(item, element, label)\n end\n end\n end\n\n fields\n end",
"title": ""
},
{
"docid": "304a2110f48acb438d3039f897c40a9b",
"score": "0.5624527",
"text": "def field_name; end",
"title": ""
},
{
"docid": "304a2110f48acb438d3039f897c40a9b",
"score": "0.5624527",
"text": "def field_name; end",
"title": ""
},
{
"docid": "5c829b27e9ac341cadce2e24a234bbe5",
"score": "0.56229377",
"text": "def fields\n []\n end",
"title": ""
},
{
"docid": "5c829b27e9ac341cadce2e24a234bbe5",
"score": "0.56229377",
"text": "def fields\n []\n end",
"title": ""
},
{
"docid": "9609466b41d41a968b1eca697e28d309",
"score": "0.5622016",
"text": "def tags\n retval = []\n optional_fieldnames.each do |of|\n value = get(of)\n if value.kind_of?(RGFA::FieldArray)\n value.each do |elem|\n retval << [of, value.datatype, elem]\n end\n else\n retval << [of, get_datatype(of), value]\n end\n end\n return retval\n end",
"title": ""
},
{
"docid": "7d415523b32884e56647f8ecb5428138",
"score": "0.5621304",
"text": "def label\n name\n end",
"title": ""
},
{
"docid": "53ae94a5e5a5c968b8f9db88718e2021",
"score": "0.562018",
"text": "def display_values\n values.collect { |el| el[:displayValue] }\n end",
"title": ""
},
{
"docid": "c2ac0c5a6a60c256866846ea522b31a5",
"score": "0.5619982",
"text": "def label\n @label.to_sym\n end",
"title": ""
},
{
"docid": "521aafbcf3d01d792024dd830eff24b9",
"score": "0.5609367",
"text": "def all_list_view_fields\n all_fields.select(&:display_in_list)\n end",
"title": ""
},
{
"docid": "26a741eba937e44cb28305918b9f9d2b",
"score": "0.55943483",
"text": "def fields\n []\n end",
"title": ""
},
{
"docid": "d79e595d9f1506e160c31535898ec395",
"score": "0.55863655",
"text": "def labels\n\tlabels = []\n\t(imap.list('', \"*\")||[]).each { |e|\n\t\tunless e.attr.include?(:Noselect)\n\t\t labels << e.name\n\t\tend\n\t}\n\tlabels\n end",
"title": ""
},
{
"docid": "67574f3e3476026890b08279d6e26224",
"score": "0.5579132",
"text": "def field_location(symbol)\n result = []\n self.item_class.embedded.each_pair do |key, value|\n next unless value.include?(symbol)\n result << key\n break\n end\n result << symbol\n end",
"title": ""
},
{
"docid": "aaa0ded83ed9f90fb6ecd83b488f24c7",
"score": "0.5576959",
"text": "def labels\r\n Set.new(@values.select{|x| x.has_label?}.map{|x| x.label})\r\n end",
"title": ""
},
{
"docid": "bd2eb779093eda851872d00c32c82b09",
"score": "0.5576402",
"text": "def list_item_number_label(**)\n end",
"title": ""
},
{
"docid": "bf252c54185c4e0eb2e0de13c03d13d3",
"score": "0.55730927",
"text": "def label\n @label ? as_(@label) : as_(:config_list_model, :model => @core.label(:count => 1))\n end",
"title": ""
},
{
"docid": "f0339f5c966506218ede7b0d15083528",
"score": "0.5571318",
"text": "def fields\n @fld_hash.values\n end",
"title": ""
}
] |
2c2c446a3acf38675eed928e1cd68856 | Add result type +:mytaxa_scan+ at +base+ (no +_opts+ supported). | [
{
"docid": "ff2c9b897f94cf8274b71b1bca01dc11",
"score": "0.819279",
"text": "def add_result_mytaxa_scan(base, _opts)\n if is_nonmulti?\n return nil unless\n result_files_exist?(base, %w[.pdf .wintax .mytaxa .reg]) or\n result_files_exist?(base, \".nomytaxa.txt\")\n r = MiGA::Result.new(\"#{base}.json\")\n add_files_to_ds_result(r, name, mytaxa:\".mytaxa\", wintax:\".wintax\",\n blast:\".blast\", mytaxain:\".mytaxain\", report:\".pdf\", regions:\".reg\",\n gene_ids:\".wintax.genes\", region_ids:\".wintax.regions\",\n nomytaxa:\".nomytaxa.txt\")\n else\n MiGA::Result.new(\"#{base}.json\")\n end\n end",
"title": ""
}
] | [
{
"docid": "7fbd2b63a6db746aef8c5e3570d78509",
"score": "0.7138686",
"text": "def add_result_mytaxa(base, _opts)\n if is_multi?\n return nil unless result_files_exist?(base, \".mytaxa\") or\n result_files_exist?(base, \".nomytaxa.txt\")\n r = MiGA::Result.new(\"#{base}.json\")\n add_files_to_ds_result(r, name, mytaxa:\".mytaxa\", blast:\".blast\",\n mytaxain:\".mytaxain\", nomytaxa:\".nomytaxa.txt\",\n species:\".mytaxa.Species.txt\", genus:\".mytaxa.Genus.txt\",\n phylum:\".mytaxa.Phylum.txt\", innominate:\".mytaxa.innominate\",\n kronain:\".mytaxa.krona\", krona:\".html\")\n else\n MiGA::Result.new(\"#{base}.json\")\n end\n end",
"title": ""
},
{
"docid": "de10030ee4794a7ab7c599f0daad20d8",
"score": "0.66969126",
"text": "def add_result_taxonomy(base, _opts)\n add_result_distances_nonref(base)\n end",
"title": ""
},
{
"docid": "039e07f6da68de99009ace1a6eb43647",
"score": "0.6102273",
"text": "def add_result_stats(base, _opts)\n MiGA::Result.new(\"#{base}.json\")\n end",
"title": ""
},
{
"docid": "5f449ecbc70ad2233bc3b70d13f43266",
"score": "0.6064245",
"text": "def run_mytaxa_scan!\n return if run_mytaxa_scan?\n miga.metadata[:run_mytaxa_scan] = true\n miga.save\n update_attribute(:complete, false) if complete\n update_attribute(:complete_new, false) if complete_new\n end",
"title": ""
},
{
"docid": "5f449ecbc70ad2233bc3b70d13f43266",
"score": "0.6064245",
"text": "def run_mytaxa_scan!\n return if run_mytaxa_scan?\n miga.metadata[:run_mytaxa_scan] = true\n miga.save\n update_attribute(:complete, false) if complete\n update_attribute(:complete_new, false) if complete_new\n end",
"title": ""
},
{
"docid": "58cf88f4ed3cf4360fe93f56a9bf132c",
"score": "0.59326524",
"text": "def run_mytaxa_scan\n @query_dataset.run_mytaxa_scan!\n redirect_to(@query_dataset)\n end",
"title": ""
},
{
"docid": "58cf88f4ed3cf4360fe93f56a9bf132c",
"score": "0.59326524",
"text": "def run_mytaxa_scan\n @query_dataset.run_mytaxa_scan!\n redirect_to(@query_dataset)\n end",
"title": ""
},
{
"docid": "2937a514478bc1fd2058b44f9c85b7db",
"score": "0.58637774",
"text": "def add_result_raw_reads(base, _opts)\n return nil unless result_files_exist?(base, \".1.fastq\")\n r = MiGA::Result.new(\"#{base}.json\")\n add_files_to_ds_result(r, name,\n ( result_files_exist?(base, \".2.fastq\") ?\n {pair1:\".1.fastq\", pair2:\".2.fastq\"} :\n {single:\".1.fastq\"} ))\n end",
"title": ""
},
{
"docid": "2ac6d94c6d863799a303aa1b22088953",
"score": "0.5713484",
"text": "def add_result_trimmed_fasta(base, _opts)\n return nil unless\n result_files_exist?(base, \".CoupledReads.fa\") or\n result_files_exist?(base, \".SingleReads.fa\") or\n result_files_exist?(base, %w[.1.fasta .2.fasta])\n r = MiGA::Result.new(\"#{base}.json\")\n r = add_files_to_ds_result(r, name, coupled:\".CoupledReads.fa\",\n single:\".SingleReads.fa\", pair1:\".1.fasta\", pair2:\".2.fasta\")\n add_result(:raw_reads) #-> Post gzip\n r\n end",
"title": ""
},
{
"docid": "5f25c724d4a14a90a3831d41cae31c0e",
"score": "0.55487084",
"text": "def run_mytaxa_scan?\n return false if miga.nil?\n return false if miga.is_multi?\n !!(miga.metadata[:run_mytaxa_scan] || !miga.result(:mytaxa_scan).nil?)\n end",
"title": ""
},
{
"docid": "5f25c724d4a14a90a3831d41cae31c0e",
"score": "0.55487084",
"text": "def run_mytaxa_scan?\n return false if miga.nil?\n return false if miga.is_multi?\n !!(miga.metadata[:run_mytaxa_scan] || !miga.result(:mytaxa_scan).nil?)\n end",
"title": ""
},
{
"docid": "f95841e8c64da6db2193f32e24b2be6b",
"score": "0.5536352",
"text": "def add_result_assembly(base, opts)\n return nil unless result_files_exist?(base, \".LargeContigs.fna\")\n r = MiGA::Result.new(\"#{base}.json\")\n r = add_files_to_ds_result(r, name, largecontigs:\".LargeContigs.fna\",\n allcontigs:\".AllContigs.fna\", assembly_data:\"\")\n opts[:is_clean] ||= false\n r.clean! if opts[:is_clean]\n unless r.clean?\n MiGA::MiGA.clean_fasta_file(r.file_path :largecontigs)\n r.clean!\n end\n add_result(:trimmed_fasta) #-> Post interposing\n r\n end",
"title": ""
},
{
"docid": "28cc1629a2628a0fd2f3e26239cfb511",
"score": "0.5477555",
"text": "def add_result_distances_multi(base)\n MiGA::Result.new(\"#{base}.json\")\n end",
"title": ""
},
{
"docid": "a88efbc9bd64efa391827e7a1d1571e4",
"score": "0.5317432",
"text": "def add_result_read_quality(base, _opts)\n return nil unless result_files_exist?(base, %w[.solexaqa .fastqc])\n r = MiGA::Result.new(\"#{base}.json\")\n r = add_files_to_ds_result(r, name,\n solexaqa:\".solexaqa\", fastqc:\".fastqc\")\n add_result(:trimmed_reads) #-> Post cleaning\n r\n end",
"title": ""
},
{
"docid": "1d5811c334605afa11528e53180c3135",
"score": "0.5243522",
"text": "def add_result_ssu(base, opts)\n return MiGA::Result.new(\"#{base}.json\") if result(:assembly).nil?\n return nil unless result_files_exist?(base, \".ssu.fa\")\n r = MiGA::Result.new(\"#{base}.json\")\n r = add_files_to_ds_result(r, name, longest_ssu_gene:\".ssu.fa\",\n gff:\".ssu.gff\", all_ssu_genes:\".ssu.all.fa\")\n opts[:is_clean] ||= false\n r.clean! if opts[:is_clean]\n unless r.clean?\n MiGA::MiGA.clean_fasta_file(r.file_path :longest_ssu_gene)\n r.clean!\n end\n r\n end",
"title": ""
},
{
"docid": "10328f2fc6675db83e60d97a6e29c7ea",
"score": "0.52196896",
"text": "def add_result_distances_nonref(base)\n return nil unless\n result_files_exist?(base, %w[.aai-medoids.tsv .aai.db]) or\n result_files_exist?(base, %w[.ani-medoids.tsv .ani.db])\n r = MiGA::Result.new(\"#{base}.json\")\n add_files_to_ds_result(r, name, aai_medoids:\".aai-medoids.tsv\",\n haai_db:\".haai.db\", aai_db:\".aai.db\", ani_medoids:\".ani-medoids.tsv\",\n ani_db:\".ani.db\", ref_tree:\".nwk\", ref_tree_pdf:\".nwk.pdf\",\n intax_test:\".intax.txt\")\n end",
"title": ""
},
{
"docid": "304cd2c77e25bab8255e9c43b17479fb",
"score": "0.51224333",
"text": "def included(base)\n base.extend SingleForwardable\n base.def_delegators :'::Drudge::Parsers::Types', *::Drudge::Parsers::Types::TYPE_HANDLING_METHODS\n base.singleton_class.send :include, Parsers::ParseResults\n end",
"title": ""
},
{
"docid": "27752607703874da0c8ab2936691e32d",
"score": "0.5091511",
"text": "def add(scan)\n unless scan.kind_of? Metascan::Scan\n raise TypeError, \"Must pass a Scan object to Batch.add\"\n end\n @scans = @scans.merge({ scan.filename => scan })\n @hydra.queue scan.request\n end",
"title": ""
},
{
"docid": "cf8af70c04e1a445b3b0269cd6d03170",
"score": "0.5060999",
"text": "def total_search(query, opts={})\n item_type = opts.delete(:type)\n limit = opts[:limit] ? opts.delete(:limit) : 10000\n res = invoke(\"search 0 #{limit} term:#{query}\", false)\n return nil unless res\n \n hash = {:counts => {}}\n # Get counts\n res.scan(/((\\w+_)?count_?%3A(\\d+))/).each do |count|\n key = count[1].nil? ? 'count' : count[1].gsub(/_/,'')\n hash[:counts][key.to_sym] = count.last.to_i\n end \n \n raise \"Invalid item_type passed: #{item_type}\" if !item_type.nil? and ![:track, :artist, :album, :genre, :year].include?(item_type)\n \n # Group each individual type of each result into a hash\n %w(album track contributor genre).each do |type|\n next unless item_type.nil? or item_type != type\n key = type == 'contributor' ? :artist : type.to_sym\n hash[key] = Hash[*res.scan(/(#{type}_id%3A\\w+ #{type}%3A[\\w%\\d]+)/).flatten.collect{ |r| \n arr = r.split(/\\s/).collect{|a| \n a.gsub(/#{type}.*%3A/, '').urldecode\n } \n Object.const_get(item_type.to_s.classify).new(:id => arr.first, :name => arr[1])\n }.flatten]\n \n end\n hash\n end",
"title": ""
},
{
"docid": "391924ca457287e9494f00ba93533df2",
"score": "0.5014741",
"text": "def scan\n raise NotImplementedError, 'Subclass must implement #scan'\n end",
"title": ""
},
{
"docid": "6030697958ce1bae09cb5bae38778199",
"score": "0.49880314",
"text": "def add_result_distances(base, _opts)\n if is_nonmulti?\n if is_ref?\n add_result_distances_ref(base)\n else\n add_result_distances_nonref(base)\n end\n else\n add_result_distances_multi(base)\n end\n end",
"title": ""
},
{
"docid": "fd0c35eee9fe88e73f09e742251fc913",
"score": "0.49370718",
"text": "def add_result_trimmed_reads(base, _opts)\n return nil unless result_files_exist?(base, \".1.clipped.fastq\")\n r = MiGA::Result.new(\"#{base}.json\")\n if result_files_exist?(base, \".2.clipped.fastq\")\n r = add_files_to_ds_result(r, name,\n pair1:\".1.clipped.fastq\", pair2:\".2.clipped.fastq\",\n single:\".1.clipped.single.fastq\")\n else\n r = add_files_to_ds_result(r, name, single:\".1.clipped.fastq\")\n end\n r.add_file(:trimming_sumary, \"#{name}.1.fastq.trimmed.summary.txt\")\n add_result(:raw_reads) #-> Post gunzip\n r\n end",
"title": ""
},
{
"docid": "c92797b86448944bd7f41ffe249b33ab",
"score": "0.49358386",
"text": "def add_result_cds(base, opts)\n return nil unless result_files_exist?(base, %w[.faa .fna])\n r = MiGA::Result.new(\"#{base}.json\")\n r = add_files_to_ds_result(r, name, proteins:\".faa\", genes:\".fna\",\n gff2:\".gff2\", gff3:\".gff3\", tab:\".tab\")\n opts[:is_clean] ||= false\n r.clean! if opts[:is_clean]\n unless r.clean?\n MiGA::MiGA.clean_fasta_file(r.file_path :proteins)\n MiGA::MiGA.clean_fasta_file(r.file_path :genes)\n r.clean!\n end\n r\n end",
"title": ""
},
{
"docid": "82f54b30c56fadd978ed6e954569ef9a",
"score": "0.49298838",
"text": "def add_result_essential_genes(base, _opts)\n return nil unless result_files_exist?(base, %w[.ess.faa .ess .ess/log])\n r = MiGA::Result.new(\"#{base}.json\")\n add_files_to_ds_result(r, name, ess_genes:\".ess.faa\",\n collection:\".ess\", report:\".ess/log\")\n end",
"title": ""
},
{
"docid": "983276d440cbea6c79444c220b4a0050",
"score": "0.48489162",
"text": "def add_bases_to_army base_name\n\t@army.add_base(base_name)\n\t\nend",
"title": ""
},
{
"docid": "ec60d0215e0e9045eca3674cc3c6be64",
"score": "0.48365667",
"text": "def call\n add_fields(undetermined_taxi: true)\n end",
"title": ""
},
{
"docid": "1b2f51acc0e94a174472172230394a09",
"score": "0.48267177",
"text": "def scan\n\t\t\tvalues = { :Type => @type, :Opcode => 'SCAN', :Value => 0.0 }\n\t\t\t@bot.send(\"SET #{values.to_usar}\")\n\t\tend",
"title": ""
},
{
"docid": "d9fc25af75268734a28f9fac128a9d1b",
"score": "0.48202434",
"text": "def scan(options); end",
"title": ""
},
{
"docid": "a1a4459ec434ad998d47028b3b6bb79d",
"score": "0.47943467",
"text": "def add_result_distances_ref(base)\n pref = File.dirname(base)\n return nil unless\n File.exist?(\"#{pref}/01.haai/#{name}.db\")\n r = MiGA::Result.new(\"#{base}.json\")\n r.add_files(haai_db:\"01.haai/#{name}.db\", aai_db:\"02.aai/#{name}.db\",\n ani_db:\"03.ani/#{name}.db\")\n r\n end",
"title": ""
},
{
"docid": "99c55d03564ea384195ffb0a8b77dad5",
"score": "0.47848988",
"text": "def base=(base)\n @base = base\n @options[:base] = base\n end",
"title": ""
},
{
"docid": "d698d3fafb62bd17f299e017beb9916f",
"score": "0.47798723",
"text": "def result_type(result_type=\"mixed\")\n @query[:result_type] = result_type\n self\n end",
"title": ""
},
{
"docid": "833641845924ee3334a709e774fa4579",
"score": "0.47618815",
"text": "def scan\n\t\t\tvalues = { :Type => @type, :Name => @name, :Opcode => 'SCAN', :Value => 0.0 }\n\t\t\t@bot.send(\"SET #{values.to_usar}\")\n\t\tend",
"title": ""
},
{
"docid": "3987b9c61d100798744d5f83e2901348",
"score": "0.47415188",
"text": "def run_scan\n\t\t\tscan.scan\n\t\tend",
"title": ""
},
{
"docid": "0b5afbabb2c2274e8f451f3092287fe1",
"score": "0.47356257",
"text": "def search\n @qparams = params\n @page = params[:page] || 1\n if params[:q]\n @taxa = Taxon.search(params[:q], \n :include => [:taxon_names, :flickr_photos, :iconic_taxon],\n :page => @page, :per_page => params[:per_page])\n end\n \n # Do external lookups\n if params[:include_external] && logged_in?\n logger.info(\"DEBUG: Making an external lookup...\")\n begin\n @external_taxa = []\n # I'm not really sure what's better memory-wise, instatiating a new\n # Ratatosk with each request and letting it get garbage collected, or\n # keeping one in memory and run the risk of it accumulating all kinds\n # of cruft.\n ratatosk = Ratatosk::Ratatosk.new\n ratatosk.find(params[:q]).each do |ext_name|\n existing_taxon = ratatosk.find_existing_taxon(ext_name.taxon)\n ext_name.taxon = existing_taxon if existing_taxon\n if ext_name.save\n @external_taxa << ext_name.taxon\n end\n end\n @taxa += @external_taxa\n \n # graft in the background at a lower priority than the parent proc\n unless @external_taxa.empty?\n spawn(:nice => 7) do\n @external_taxa.each do |taxon|\n ratatosk.graft(taxon) unless taxon.grafted?\n end\n end\n end\n rescue Timeout::Error => e\n # No love\n end\n end\n \n respond_to do |format|\n format.html\n format.xml { render :xml => @taxa.to_xml(:include => :taxon_names) }\n format.json do\n render :json => @taxa.to_json(\n :include => [:iconic_taxon, :taxon_names, :flickr_photos],\n :methods => [:common_name, :image_url, :default_name])\n end\n end\n end",
"title": ""
},
{
"docid": "fe5107867ab23eab6e26b0e0a0309142",
"score": "0.47274318",
"text": "def scan(cursor, match: nil, count: nil, type: nil)\n\t\t\t\t\targuments = [cursor]\n\t\t\t\t\t\n\t\t\t\t\tif match\n\t\t\t\t\t\targuments.append(\"MATCH\", match)\n\t\t\t\t\tend\n\t\t\t\t\t\n\t\t\t\t\tif count\n\t\t\t\t\t\targuments.append(\"COUNT\", count)\n\t\t\t\t\tend\n\t\t\t\t\t\n\t\t\t\t\tif type\n\t\t\t\t\t\targuments.append(\"TYPE\", type)\n\t\t\t\t\tend\n\t\t\t\t\t\n\t\t\t\t\tcall(\"SCAN\", *arguments)\n\t\t\t\tend",
"title": ""
},
{
"docid": "b8a4230fb84492e5ec43e197171ea11f",
"score": "0.471381",
"text": "def get_result(result_type) ; add_result(result_type, false) ; end",
"title": ""
},
{
"docid": "3c75c4ae0313ffaaddf48f27e2f01409",
"score": "0.46848553",
"text": "def register(base)\n include(base).tap{@definitions = nil}\n end",
"title": ""
},
{
"docid": "53cdb3647b5e76ca6e9ffc5ffc4aedcb",
"score": "0.46824",
"text": "def adapt_coverage_result; end",
"title": ""
},
{
"docid": "9290dd91ba47242b7626f68f06997cc3",
"score": "0.46455568",
"text": "def scan_by_upload\n @opts['samples'].each do |sample|\n vt = VirusTotal.new({'api_key' => @opts['api_key'], 'sample' => sample})\n print_status(\"Please wait while I upload #{sample}...\")\n res = vt.scan_sample\n print_status(\"VirusTotal: #{res['verbose_msg']}\")\n show_hashes(res)\n res = wait_report(vt, res, @opts['delay'])\n generate_report(res, sample) if res\n\n puts\n end\n end",
"title": ""
},
{
"docid": "6373883ddc2896f8a0f09f3c2232ce5e",
"score": "0.46342307",
"text": "def search_base(*params)\n apply_timeout_multiplier(params, 6) if @query_counter == 0\n result = super(*params)\n @query_counter += 1\n result\n end",
"title": ""
},
{
"docid": "2a3e9c9ac6ca3e06ec452ca53f4d09ca",
"score": "0.46333128",
"text": "def query_telemetry_scan_with_http_info(telemetry_druid_scan_request, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: TelemetryApi.query_telemetry_scan ...'\n end\n # verify the required parameter 'telemetry_druid_scan_request' is set\n if @api_client.config.client_side_validation && telemetry_druid_scan_request.nil?\n fail ArgumentError, \"Missing the required parameter 'telemetry_druid_scan_request' when calling TelemetryApi.query_telemetry_scan\"\n end\n # resource path\n local_var_path = '/api/v1/telemetry/Scans'\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n content_type = @api_client.select_header_content_type(['application/json'])\n if !content_type.nil?\n header_params['Content-Type'] = content_type\n end\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body] || @api_client.object_to_http_body(telemetry_druid_scan_request)\n\n # return_type\n return_type = opts[:debug_return_type] || 'Array<TelemetryDruidScanResult>'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['cookieAuth', 'http_signature', 'oAuth2', 'oAuth2']\n\n new_options = opts.merge(\n :operation => :\"TelemetryApi.query_telemetry_scan\",\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: TelemetryApi#query_telemetry_scan\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "34a088a01ce2113a9dad837914e350be",
"score": "0.46228486",
"text": "def gather_results( result )\n\n\tend",
"title": ""
},
{
"docid": "10d53878e50fcd7259a3cfe6ea87b2d3",
"score": "0.46135134",
"text": "def addSavBase(base)\n @savBaseList.push(base) ;\n @savBaseTable[base.name] = base ;\n return base ;\n end",
"title": ""
},
{
"docid": "2fd081092593dffc50bfa8d61f2c4ef1",
"score": "0.46116212",
"text": "def scan(options = {}, previous_response = nil)\n response = @client.scan(options.merge(table_name: name))\n deserialize_response(response, previous_response)\n end",
"title": ""
},
{
"docid": "2fd081092593dffc50bfa8d61f2c4ef1",
"score": "0.46116212",
"text": "def scan(options = {}, previous_response = nil)\n response = @client.scan(options.merge(table_name: name))\n deserialize_response(response, previous_response)\n end",
"title": ""
},
{
"docid": "1d64a47aea77e5b5b96d248869327e89",
"score": "0.4598142",
"text": "def add_tax\n \n end",
"title": ""
},
{
"docid": "3734a0f45ec7cdbfb533d944e093ffa3",
"score": "0.4577546",
"text": "def extend_resultmap(name, base, fields) # :nodoc:\n resultmaps[name] = base.extend(fields)\n end",
"title": ""
},
{
"docid": "900bcb9e1f95d44342abb63bcb9b417a",
"score": "0.45704913",
"text": "def add_result(r)\n @results << r\n end",
"title": ""
},
{
"docid": "fdd44ea571243975b686116c149e01e1",
"score": "0.456405",
"text": "def tax_total_base\n conv_tax\n end",
"title": ""
},
{
"docid": "edaa628cb3f2f7600d24e1d8ea51277a",
"score": "0.4562067",
"text": "def add_result(result_type, save=true, opts={})\n dir = @@RESULT_DIRS[result_type]\n return nil if dir.nil?\n base = File.expand_path(\"data/#{dir}/#{name}\", project.path)\n unless opts[:force]\n r_pre = MiGA::Result.load(\"#{base}.json\")\n return r_pre if (r_pre.nil? and not save) or not r_pre.nil?\n end\n r = File.exist?(\"#{base}.done\") ?\n self.send(\"add_result_#{result_type}\", base, opts) : nil\n r.save unless r.nil?\n r\n end",
"title": ""
},
{
"docid": "0ebb364ea37848d2114e9fdc14cbae54",
"score": "0.4544896",
"text": "def add_results(t)\n results.each do |r|\n t.add_result(r.round, r.player_id, r.opponent_id, r.result) if r.rateable\n end\n end",
"title": ""
},
{
"docid": "796c9e27f8c7c5d58cabd328091b9e8f",
"score": "0.45399058",
"text": "def run\n case @options.scan_type\n when :directory\n scan_dirs\n parse_files\n report\n excel_report\n ms_vuln_report\n when :file\n @scan_files = Array.new\n @scan_files << @options.scan_file\n parse_files\n report\n excel_report\n ms_vuln_report\n end\n end",
"title": ""
},
{
"docid": "188817ad3fdc0b8b7e870af8d08f173c",
"score": "0.45358336",
"text": "def parse\n\t\t\trs = Result::Set.new(options = {:config => config})\n\t\t\t\n\t\t\twarn \"* parsing search results ...\"\n\t\t\ttransferred = 0\n\t\t\tpb = ProgressBar.new(\"Progress\", 100)\n\t\t\tstep = 1/length\n\t\t\teach_value do |search|\n\t\t\t\tcase search.taxon.type\n\t\t\t\twhen 'spp'\n\t\t\t\t\tfile = config.dir_result + \"genome/search\" + search.ortholog.name + (search.id + \".txt\")\n\t\t\t\t\t\n\t\t\t\t\trp = Result::HmmerParser.new(options = {:tool => 'hmmsearch', :config => config})\n\t\t\t\t\trp.file = file\n\t\t\t\t\trp.result_id = search.id\n\t\t\t\t\trp.type = search.type.name\n\t\t\t\t\trp.config = config # this makes sense in this case since HmmerParse is not using Config, but passing it to the Result.\n\t\t\t\t\tr = rp.parse\n\t\t\t\t\tr.taxon = search.taxon\n\t\t\t\t\tr.ortholog = search.ortholog\n\t\t\t\t\tr.type = search.type\n\t\t\t\t\trs << r\n\t\t\t\twhen 'clade'\n\t\t\t\t\tfile = config.dir_result + \"isolate/search\" + search.ortholog.name + (search.id + \".txt\")\n\t\t\t\t\t\n\t\t\t\t\trp = Result::BlastParser.new(options = {:tool => 'psitblastn', :config => config})\n\t\t\t\t\trp.file = file\n\t\t\t\t\trp.result_id = search.id\n\t\t\t\t\trp.type = search.type.name\n\t\t\t\t\trp.config = config\n\t\t\t\t\tr = rp.parse\n\t\t\t\t\tr.taxon = search.taxon\n\t\t\t\t\tr.ortholog = search.ortholog\n\t\t\t\t\tr.type = search.type\n\t\t\t\t\trs << r\n\t\t\t\tend\n\t\t\t\t#transferred += 1\n\t\t\t\t#percent_finished = 100 * (transferred.to_f / length.to_f)\n\t\t\t\t#pb.set(percent_finished)\n\t\t\t\tpb.inc(step)\n\t\t\tend\n\t\t\tpb.finish\n\t\t\t\n\t\t\trs\n\t\tend",
"title": ""
},
{
"docid": "d63fe3053a845768236646f452930ebe",
"score": "0.45323962",
"text": "def add_analyzer(result)\n analyzer = Analyzer.new\n analyzer.name(result[:name])\n analyzer.tables(result[:tables])\n analyzer.logger(result[:logger])\n analyzer.setup\n\n @options[:analyzers] << analyzer\n analyzer\n end",
"title": ""
},
{
"docid": "f04d6de26638ce9c8d2a64b44ecf39f6",
"score": "0.45275044",
"text": "def scan_file_advanced_with_http_info(input_file, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: ScanApi.scan_file_advanced ...'\n end\n # verify the required parameter 'input_file' is set\n if @api_client.config.client_side_validation && input_file.nil?\n fail ArgumentError, \"Missing the required parameter 'input_file' when calling ScanApi.scan_file_advanced\"\n end\n # resource path\n local_var_path = '/virus/scan/file/advanced'\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', 'text/json', 'application/xml', 'text/xml'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])\n header_params[:'allowExecutables'] = opts[:'allow_executables'] if !opts[:'allow_executables'].nil?\n header_params[:'allowInvalidFiles'] = opts[:'allow_invalid_files'] if !opts[:'allow_invalid_files'].nil?\n header_params[:'allowScripts'] = opts[:'allow_scripts'] if !opts[:'allow_scripts'].nil?\n header_params[:'allowPasswordProtectedFiles'] = opts[:'allow_password_protected_files'] if !opts[:'allow_password_protected_files'].nil?\n header_params[:'allowMacros'] = opts[:'allow_macros'] if !opts[:'allow_macros'].nil?\n header_params[:'allowXmlExternalEntities'] = opts[:'allow_xml_external_entities'] if !opts[:'allow_xml_external_entities'].nil?\n header_params[:'allowInsecureDeserialization'] = opts[:'allow_insecure_deserialization'] if !opts[:'allow_insecure_deserialization'].nil?\n header_params[:'allowHtml'] = opts[:'allow_html'] if !opts[:'allow_html'].nil?\n header_params[:'allowUnsafeArchives'] = opts[:'allow_unsafe_archives'] if !opts[:'allow_unsafe_archives'].nil?\n header_params[:'restrictFileTypes'] = opts[:'restrict_file_types'] if !opts[:'restrict_file_types'].nil?\n\n # form parameters\n form_params = {}\n form_params['inputFile'] = input_file\n\n # http body (model)\n post_body = nil\n auth_names = ['Apikey']\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 => 'VirusScanAdvancedResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ScanApi#scan_file_advanced\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "5e93499ded6a442cd6295e9c4b6b795d",
"score": "0.4520105",
"text": "def adapt_result(result); end",
"title": ""
},
{
"docid": "b5bcfb14d9261118b2e0067b516ea676",
"score": "0.45179906",
"text": "def scanSub()\n end",
"title": ""
},
{
"docid": "3e058fb415bc5f152f4f7adb92194fae",
"score": "0.451465",
"text": "def generate_report(res, sample)\n if res['response_code'] != 1\n print_status(\"VirusTotal: #{res['verbose_msg']}\")\n return\n end\n\n short_filename = File.basename(sample)\n tbl = Rex::Text::Table.new(\n 'Header' => \"Analysis Report: #{short_filename} (#{res['positives']} / #{res['total']}): #{res['sha256']}\",\n 'Indent' => 1,\n 'Columns' => ['Antivirus', 'Detected', 'Version', 'Result', 'Update']\n )\n\n (res['scans'] || []).each do |result|\n product = result[0]\n detected = result[1]['detected'].to_s\n version = result[1]['version'] || ''\n sig_name = result[1]['result'] || ''\n timestamp = result[1]['update'] || ''\n\n tbl << [product, detected, version, sig_name, timestamp]\n end\n\n print_status tbl.to_s\n end",
"title": ""
},
{
"docid": "45784033c49fd8a350bac8ebb5fa0874",
"score": "0.45074683",
"text": "def combine( base, extracted_information )\n raise \"#{self.class.name} should override the combine method.\"\n end",
"title": ""
},
{
"docid": "cff6aa3f2652b21a92529f6184bcb578",
"score": "0.44964054",
"text": "def tax_for(base_price)\n\t\ttax = 0.09 * base_price\n\t\ttax\n\tend",
"title": ""
},
{
"docid": "9517f49014bc6f1902ea0b78ff4d9756",
"score": "0.4490829",
"text": "def add_result(res)\n @recs << res\n add_query(res.answer,'pending')\n add_query(res.query,'pending')\n end",
"title": ""
},
{
"docid": "739c01013d2f1ffc88a5b197e692e1e5",
"score": "0.44881386",
"text": "def scan_sample\n opts = {\n 'boundary' => 'THEREAREMANYLIKEITBUTTHISISMYDATA',\n 'api_key' => @api_key,\n 'filename' => @sample_info['filename'],\n 'data' => @sample_info['data']\n }\n\n _execute_request({\n 'uri' => '/vtapi/v2/file/scan',\n 'method' => 'POST',\n 'vhost' => 'www.virustotal.com',\n 'ctype' => \"multipart/form-data; boundary=#{opts['boundary']}\",\n 'data' => _create_upload_data(opts)\n })\n end",
"title": ""
},
{
"docid": "aa9ad327241d6c4eb234731933c6ec42",
"score": "0.44646576",
"text": "def execute(input_set = nil)\n resp = super(input_set)\n results = GetAnalyticsByTypeResultSet.new(resp)\n return results\n end",
"title": ""
},
{
"docid": "8aa9d1e9150f04f0a9fedb5759fbd807",
"score": "0.44594732",
"text": "def analyze()\n res = 0\n\n res = analyze_with_index_type(0, TagSet::TAG_TYPE_ALL)\n\n if (res > 0) then\n puts \"ananyzed\"\n return res;\n else\n puts \"ananyzed\"\n return analyze_unknown();\n end\n end",
"title": ""
},
{
"docid": "cfac412fd045efaa942c5b2fe949cfd2",
"score": "0.4455329",
"text": "def inherited(subclass)\n subclass.returns(return_type)\n\n options.each do |name, parameter|\n subclass.option(name, type: parameter.type)\n end\n end",
"title": ""
},
{
"docid": "3a42bd240d9aea02d543fffb97325726",
"score": "0.44449437",
"text": "def scan(options = {})\n response = @client.scan(options.merge(table_name: name))\n deserialize_response(response)\n end",
"title": ""
},
{
"docid": "74ef88e7efdd5f0442242b263babfc9b",
"score": "0.4443691",
"text": "def run\n case @options.scan_type\n when :directory\n scan_dirs\n parse_files\n excel_report\n when :file\n @scan_files = Array.new\n @scan_files << @options.scan_file\n parse_files\n excel_report\n end\n end",
"title": ""
},
{
"docid": "7a9bfe562082f4c96865805a70feee7a",
"score": "0.44424406",
"text": "def adv_solr_data_by_type(searchterm, start, rows, sort, username, fq, parent_url, requrl = '', type, show_all)\n puts \"---------TYPE INFORMATION GOES HERE-----------#{type}----\"\n url = URI.parse(APP_CONFIG[:solr_server])\n connection = Net::HTTP.new(url.host, url.port)\n follower = Follower.followings(username,1) << username\n followerstr = follower.join(\" \")\n\n followers_boost = follower.collect { |f|\n \"(id:person-#{f})^20\"\n }\n\n #usertags = Usertags.top_tags(username)\n usertags = []\n\n followers_boost = followers_boost + usertags.collect do |t|\n t[0] = t[0].gsub(\"&\", \"\")\n \"(tags:#{t[0]})^#{t[1]}\"\n end\n\n usertags_params = ''\n\n strsort = ''\n if(sort == 'ctd')\n strsort = 'createdtime desc'\n elsif(sort == 'cta')\n strsort = 'createdtime asc'\n elsif(sort == 'cba')\n strsort = 'createdby asc'\n end\n\n if true\n #always include external links description for now\n queryterm = searchterm\n qfstr = \"id^10 maintext^10 linkdesc^1.0 attachmentcontent^1.0 tags^7.5 description^5.0\"\n else\n queryterm = searchterm\n qfstr = \"id^10 maintext^10 linkdesc^1.0 attachmentcontent^1.0 tags^7.5 description^5.0\"\n end\n\n parenturl = ''\n if parent_url.present?\n parenturl = \"url:#{parent_url}/*\"\n end\n\n logger.info 'query term...........' + queryterm.inspect\n row_str = rows.present? ? \"&rows=\"+rows.to_s : '&rows=10000'\n begin\n addtype = removetype = createdByType = additionalInCondition = \"\"\n\n if fq.present?\n\n fq = URI.unescape(fq)\n #requrl = URI.unescape(requrl.sub(/q=([^&]*)&/, \"\"))\n requrl = URI.unescape(requrl.sub(\"&q=#{searchterm}\", \"\"))\n\n puts \"--ALL THE REFINE SEARCH PARAMETER GOES HERE---#{requrl.inspect}\"\n if type.present?\n if type == \"others\"\n additionalCondition = \" OR (type:(file person training)) \"\n else\n addtype = \"(type:#{type}#{additionalInCondition})\"\n end\n end\n\n if(parenturl.present?)\n addtype = addtype.present? ? (\"#{addtype} AND #{parenturl}\") : parenturl\n end\n strsort = 'createdtime desc' if fq == 'type:training' && sort == ''\n queryterm = queryterm.gsub('%3A',':').gsub('%2B',' ').gsub('%2A','*')\n minusresults = \"#{addtype} -((type:(buzz event question_answer meeting) AND -createdby:(\" + followerstr.to_s + \")) #{additionalCondition} OR (type:file AND (location:workflow OR location:expired OR location:publish_deleted)) OR (type:folder AND location:publish_deleted))\"\n\n strparams = URI.escape(\"qf=\" + qfstr + \"&bq=\" + followers_boost.join(',') + \"&omitHeader=true&version=2.2&start=\"+start.to_s+row_str+\"&wt=ruby&indent=on&sort=\"+strsort+\"&q=\" + queryterm + \"&\" + requrl + \"&fq=\"+ minusresults).gsub(\"__x__\", \"%2B\")\n\n logger.info \"path1......#{addtype.inspect}.....\" + url.path + \"/select?\" + strparams\n\n result = connection.post(url.path + \"/select\", strparams)\n else\n if type.present?\n if type == \"others\"\n additionalCondition = \" OR (type:(file person training)) \"\n else\n addtype = \"type:#{type}#{additionalInCondition}\"\n end\n end\n puts \"------QUERY TERM-------------------------#{queryterm}\"\n queryterm = queryterm.gsub('%3A',':').gsub('%2B',' ').gsub('%2A','*')\n puts \"------QUERY TERM NEW-------------------------#{queryterm}\"\n minusresults = \"#{addtype} -((type:(buzz event question_answer meeting) AND -createdby:(\" + followerstr.to_s + \")) #{additionalCondition} OR (type:file AND (location:workflow OR location:expired OR location:publish_deleted)) OR (type:folder AND location:publish_deleted))\"\n strparams = URI.escape(\"bq=\" + followers_boost.join(',') + \"&omitHeader=true&version=2.2&start=\"+start.to_s+row_str+\"&wt=ruby&indent=on&sort=\"+strsort+\"&q=\" + queryterm + \"&fq=\" + minusresults).gsub(\"__x__\", \"%2B\")\n result = connection.post(url.path + \"/select\", strparams)\n end\n solr_url = \"#{url.path}/select?#{strparams}\"\n puts \"***SOLR URL*****************#{solr_url}**********\"\n unless result.code.to_s == '200'\n SolrException.create(:solr_url => solr_url, :status_code => result.code.to_s, :solr_exception => result.body.to_s)\n end\n data = eval(result.body)\n raise \"Bad Request\" if result.class.to_s == \"Net::HTTPBadRequest\"\n rescue => e\n puts \"*****EXCEPTION*****************************************#{e.inspect}\"\n data = Hash.new\n end\n return data\n end",
"title": ""
},
{
"docid": "f4ac6ccc0b556f9a2ef4055c184abd1c",
"score": "0.4438453",
"text": "def scan_by_hash\n @opts['samples'].each do |sample|\n vt = VirusTotal.new({'api_key' => @opts['api_key'], 'sample' => sample})\n print_status(\"Please wait I look for a report for #{sample}...\")\n res = vt.retrieve_report\n show_hashes(res)\n generate_report(res, sample) if res\n\n puts\n end\n end",
"title": ""
},
{
"docid": "d1c05ab153f055dcedacf1dfb070ba1b",
"score": "0.44366452",
"text": "def scanAll\n query = %{\n unit(id: $unit) {\n items(tags:[\"source:oa_harvester\"], include:[PUBLISHED,EMBARGOED], order:ADDED_ASC, more: $more) {\n total\n more\n nodes {\n id\n title\n added\n grants\n localIDs {\n scheme\n id\n }\n }\n }\n }\n }\n\n ['lbnl', 'rgpo'].each { |unit|\n more = nil\n nDone = 0\n loop do\n data = accessAPIQuery(query, { unit: ['ID!', unit], more: ['String', more] }).dig('unit', 'items')\n total ||= data['total']\n nDone == 0 and puts \"Scanning #{total} pubs for #{unit}.\"\n data['nodes'].each { |item|\n scanPub(unit, item)\n nDone += 1\n }\n puts \"Scanned #{nDone} of #{total} pubs for #{unit}.\"\n more = data['more']\n break if !more\n end\n }\n\n puts \"All done.\"\nend",
"title": ""
},
{
"docid": "df1c7543215ec8a6597684043a48b1c0",
"score": "0.4431128",
"text": "def add_result(result)\n @query_results << result\n end",
"title": ""
},
{
"docid": "25ab20078c901097990564875e868d2b",
"score": "0.44292983",
"text": "def run\n super\n\n ###\n ### TODO SECURITY - more sanity checking on to_scan\n ###\n\n # Get range, or host\n to_scan = [_get_entity_name]\n _log \"Scan list is: #{to_scan}\"\n\n to_scan.each do |scan_item|\n\n # Create a tempfile to store results\n temp_file = \"#{Dir::tmpdir}/nmap_scan_#{rand(100000000)}.xml\"\n\n # Check for IPv6\n nmap_options = \"\"\n nmap_options << \"-6\" if scan_item =~ /:/\n\n # construct port list\n port_list = \"-p \"\n port_list << _get_option(\"tcp_ports\") if _get_option(\"tcp_ports\").split(\",\").count > 0\n port_list << \",\" if _get_option(\"udp_ports\").split(\",\").count > 0\n port_list << _get_option(\"udp_ports\").split(\",\").map{|p| \"U:#{p}\" }.join(\",\")\n\n # shell out to nmap and run the scan\n _log \"Scanning #{scan_item} and storing in #{temp_file}\"\n _log \"NMap options: #{nmap_options}\"\n\n # shell out to nmap and run the scan\n nmap_string = \"nmap #{scan_item} #{nmap_options} -sSUV -P0 -T5 \"\n \n # Top ports\n top_ports = _get_option(\"top_ports\").to_i\n if top_ports > 0\n _log \"Using top ports: #{top_ports}\"\n nmap_string << \"--top-ports #{top_ports}\"\n else \n _log \"Using port list: #{port_list}\"\n nmap_string << \" #{port_list}\" \n end\n \n nmap_string << \" -O --max-os-tries 1 -oX #{temp_file}\"\n nmap_string = \"sudo #{nmap_string}\" unless Process.uid == 0\n\n _log \"Starting Scan: #{nmap_string}\"\n output = _unsafe_system(nmap_string)\n _log \"Nmap Output:\\n#{output}\"\n\n # Gather the XML and parse\n _log \"Parsing #{temp_file}\"\n\n parser = Nmap::XML.new(temp_file)\n\n # Create entities for each discovered service\n parser.each_host do |host|\n\n _log \"Handling nmap data for #{host.ip}\"\n _log \"Total ports: #{host.ports.count}\"\n _log \"Total open ports: #{host.each_port.select{|p| p.state == :open}.count}\"\n\n # Handle the case of a netblock or domain\n if @entity.type_string == \"NetBlock\" ||\n @entity.type_string == \"DnsRecord\" ||\n @entity.type_string == \"Domain\"\n # Only create if we've got ports to report.\n ip_entity = _create_entity(\"IpAddress\", { \"name\" => host.ip } )\n else\n ip_entity = @entity\n end\n\n # either way, set os details from nmap\n ip_entity.set_detail(\"os\", host.os.matches) if host.os\n\n # create an array to save all port details for this host\n host_details = []\n\n # iterate through all open ports\n host.open_ports.each do |port|\n\n # construct a hash of details for this port\n port_details = nmap_details_for_port(port)\n\n # create a network service entity\n _create_network_service_entity(\n ip_entity,\n port.number,\n \"#{port.protocol}\",\n { \"nmap\" => port_details})\n\n # save off the port details for later\n host_details << port_details\n\n end # end ports\n\n # set the details\n ip_entity.set_detail(\"nmap\", host_details)\n host_details = nil\n\n end # end parser\n\n # Clean up!\n parser = nil\n\n begin\n File.delete(temp_file)\n rescue Errno::EPERM\n _log_error \"Unable to delete file\"\n end\n\n end\n end",
"title": ""
},
{
"docid": "094cc088223a7642068e3bbadf1f2b93",
"score": "0.44271696",
"text": "def scan_into_index\n repos = scan_bases\n Index.new(repos,@base_dirs)\n end",
"title": ""
},
{
"docid": "094cc088223a7642068e3bbadf1f2b93",
"score": "0.44271696",
"text": "def scan_into_index\n repos = scan_bases\n Index.new(repos,@base_dirs)\n end",
"title": ""
},
{
"docid": "00bb992e6915b9638def4c963ee1c8bc",
"score": "0.44269845",
"text": "def analyze\n #puts @results\n count = 0\n\n @results.each do |result|\n begin\n puts \"Processing SONATYPE IQ Finding: #{count}\"\n count = count + 1\n\n #puts result\n\n report_finding! result\n rescue StandardError => e\n log_error(e)\n end\n end\n \n # contrast ingests a report\n # dynamic is the DSL for generic tools\n\n end",
"title": ""
},
{
"docid": "30b8fecba05d9d1c77bca89b02e42189",
"score": "0.44183207",
"text": "def add_result(result)\n @results << result if result\n end",
"title": ""
},
{
"docid": "a1d4e60b7a5ce7cb0e7247fae3d09848",
"score": "0.44157252",
"text": "def execute(input_set = nil)\n resp = super(input_set)\n results = SearchByTypeResultSet.new(resp)\n return results\n end",
"title": ""
},
{
"docid": "96cfeaf494cba11ab0c7c0622b9880f0",
"score": "0.44119728",
"text": "def scan(output_file, options, type)\n Scan.new(@image, output_file, options, type).scan_img\n end",
"title": ""
},
{
"docid": "b9340b2a29346a41ae6537fa8361e285",
"score": "0.4411306",
"text": "def scan_rest; end",
"title": ""
},
{
"docid": "b6e792e6e6cdf19a60377d8ec8a947ee",
"score": "0.44090152",
"text": "def scan_types() # :yields: scantype\n\t\ttypes = []\n\n\t\t@scaninfo.each do |info|\n\t\t\ttypes << info.type\n\t\t\tyield info.type if block_given?\n\t\tend\n\n\t\ttypes\n\tend",
"title": ""
},
{
"docid": "d99b6c97ff44a294146f8e59aa5969e7",
"score": "0.4405137",
"text": "def base_query\n DataServicesApi::QueryGenerator.new\n end",
"title": ""
},
{
"docid": "d99b6c97ff44a294146f8e59aa5969e7",
"score": "0.4405137",
"text": "def base_query\n DataServicesApi::QueryGenerator.new\n end",
"title": ""
},
{
"docid": "290e8ae1a29e1c17ad7970e344fc8854",
"score": "0.43996036",
"text": "def add_result(res)\n puts \"adding result: #{res.to_s}\" if @debug\n curtime = Time.now().to_f\n @sqlitedbh.execute(\"insert into results values ('#{res.query}','#{res.answer}','#{res.rrtype}','#{res.ttl}','#{res.firstseen}','#{res.lastseen}',#{curtime})\")\n\n add_query(res.answer,'pending')\n add_query(res.query,'pending')\n end",
"title": ""
},
{
"docid": "f1ad20b58c3313bed5336b06665c8c33",
"score": "0.4395429",
"text": "def custom_analyze\n end",
"title": ""
},
{
"docid": "bbe1392702adbe62fbe2d058e1297b93",
"score": "0.4387089",
"text": "def report\n super\n io.puts unless verbose? # finish the dots\n io.puts ['', aggregated_results, summary, ''].compact.join(\"\\n\")\n end",
"title": ""
},
{
"docid": "186cecfc2aa93e1b528ff690352c2b26",
"score": "0.4372316",
"text": "def scan_file_with_http_info(input_file, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: ScanApi.scan_file ...'\n end\n # verify the required parameter 'input_file' is set\n if @api_client.config.client_side_validation && input_file.nil?\n fail ArgumentError, \"Missing the required parameter 'input_file' when calling ScanApi.scan_file\"\n end\n # resource path\n local_var_path = '/virus/scan/file'\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', 'text/json', 'application/xml', 'text/xml'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])\n\n # form parameters\n form_params = {}\n form_params['inputFile'] = input_file\n\n # http body (model)\n post_body = nil\n auth_names = ['Apikey']\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 => 'VirusScanResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ScanApi#scan_file\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "4097180963f631745a6d867ff47ee956",
"score": "0.43670052",
"text": "def test_structs_are_inherited\n deploy_app(SearchApp.new.\n sd(selfdir + 'concretedocs/base.sd').\n sd(selfdir + 'concretedocs/usebase.sd'))\n start\n feed(:file => selfdir + 'docs.json')\n vespa.adminserver.execute('vespa-visit')\n assert_hitcount('query=sddocname:usebase', 1)\n end",
"title": ""
},
{
"docid": "cbf87a28a90846690c89a39a0739298d",
"score": "0.43620992",
"text": "def scan(table_name, query, opts, total = 0)\n\n # Limit is fake. No request to be done.\n if !opts[:limit].nil? && opts[:limit].to_i <= 0\n return []\n end\n\n # Count the number of items that match the current conditions. If count is 0 then return [].\n count = scan(table_name, query, opts.merge({:count => true}).reject{|k, v| v if k.to_s == 'limit'}) if opts[:count].nil?\n return [] if count == 0 && !count.nil?\n\n r = {}\n\n # Table name.\n r[:table_name] = table_name.to_s\n\n # Ask for as many items as we care about. TODO reconsider\n # r[:limit] = opts[:limit] - total if opts[:limit]\n\n # Set exclusive start key if there is one.\n r[:exclusive_start_key] = opts[:last_evaluated_key] unless opts[:last_evaluated_key].nil?\n if opts[:next_token]\n r[:exclusive_start_key] = {}\n opts[:next_token].each do |k, e|\n r[:exclusive_start_key][k.to_s] = {e[:type] => e[:value]}\n end\n\n opts.delete(:next_token)\n end\n\n # Selected attrs.\n r[:attributes_to_get] = opts[:select] if opts[:select] and opts[:count].nil?\n r[:select] = 'SPECIFIC_ATTRIBUTES' if opts[:select] and opts[:count].nil?\n\n # Set scan filter\n r[:scan_filter] = {} unless query.empty?\n\n query.each do |key, value|\n attr = {}\n attr[:attribute_value_list] = []\n if value.is_a?(Array)\n value.each do |e|\n attr[:attribute_value_list].push({e[:type] => e[:value]})\n end\n else\n attr[:attribute_value_list].push({value[:type] => value[:value]})\n end\n attr[:comparison_operator] = field_comparison(key.to_s)\n\n r[:scan_filter][field_from_comparison(key.to_s)] = attr\n end\n\n r[:select] = \"COUNT\" if opts[:count]\n\n # Do scan request.\n response = @@client.scan(r)\n\n # Return the number of items if there was a COUNT request.\n return response[:count] if opts[:count]\n\n # Check if we have enough items so far\n if !opts[:limit].nil? && total + response[:count] >= opts[:limit]\n return response[:member].map{|item| item.inject({}){|e,(k, v)| e[k.to_sym] = value_from_response(v); e}}[0..(opts[:limit] - total - 1)]\n else\n if response[:last_evaluated_key]\n more_results = scan(table_name, query, opts.merge({:last_evaluated_key => response[:last_evaluated_key]}), total + response[:count])\n else\n more_results = []\n end\n\n if opts[:limit].nil?\n return response[:member].map{|item| item.inject({}){|e,(k, v)| e[k.to_sym] = value_from_response(v); e}}.concat(more_results)\n else\n return response[:member].map{|item| item.inject({}){|e,(k, v)| e[k.to_sym] = value_from_response(v); e}}.concat(more_results[0..(opts[:limit] - total - 1)])\n end\n end\n end",
"title": ""
},
{
"docid": "629540c459e9c77f4a2629ffbaed0d3e",
"score": "0.43610242",
"text": "def scan(options={})\n options[:return_consumed_capacity] ||= :none # \"NONE\" # || \"TOTAL\"\n # Default if not already set\n options[:select] ||= :all # :all, :projected, :count, []\n\n scan_request = {\n :table_name => options[:table_name] || self.table_name,\n :return_consumed_capacity => RETURNED_CONSUMED_CAPACITY[options[:return_consumed_capacity]]\n }\n\n scan_request.merge!({ :limit => options[:limit].to_i }) if options.has_key?(:limit)\n scan_request.merge!({ :exclusive_start_key => options[:exclusive_start_key] }) if options[:exclusive_start_key]\n\n if options[:select].is_a?(Array)\n attrs_to_select = [options[:select].map(&:to_s)].flatten\n attrs_to_select << @hash_key[:attribute_name]\n attrs_to_select << @primary_range_key[:attribute_name] if @primary_range_key\n scan_request.merge!({\n :select => QUERY_SELECT[:specific],\n :attributes_to_get => attrs_to_select.uniq\n })\n else\n scan_request.merge!({ :select => QUERY_SELECT[options[:select]] })\n end\n\n # :scan_filter => { :name.begins_with => \"a\" }\n scan_filter = {}\n if options[:scan_filter].present?\n options[:scan_filter].each_pair.each do |k,v|\n # Hard to validate attribute types here, so infer by type sent and assume the user knows their own attrs\n key_name, comparison_operator = k.split(\".\")\n raise ArgumentError, \"Comparison operator must be one of (#{COMPARISON_OPERATOR.keys.join(\", \")})\" unless COMPARISON_OPERATOR.keys.include?(comparison_operator.to_sym)\n raise ArgumentError, \"scan_filter value must be a Range if using the operator BETWEEN\" if comparison_operator == \"between\" && !v.is_a?(Range)\n raise ArgumentError, \"scan_filter value must be a Array if using the operator IN\" if comparison_operator == \"in\" && !v.is_a?(Array)\n\n attribute_value_list = []\n if comparison_operator == \"in\"\n v.each do |in_v|\n attribute_value_list << attr_with_type(key_name, in_v).values.last\n end\n elsif comparison_operator == \"between\"\n attribute_value_list << attr_with_type(key_name, range_value.min).values.last\n attribute_value_list << attr_with_type(key_name, range_value.max).values.last\n else\n attribute_value_list << attr_with_type(key_name, v).values.last\n end\n scan_filter.merge!({\n key_name => {\n :comparison_operator => COMPARISON_OPERATOR[comparison_operator.to_sym],\n :attribute_value_list => attribute_value_list\n }\n })\n end\n scan_request.merge!(:scan_filter => scan_filter)\n end\n\n scan_request.merge!({ :segment => options[:segment].to_i }) if options[:segment].present?\n scan_request.merge!({ :total_segments => options[:total_segments].to_i }) if options[:total_segments].present?\n\n @client.scan(scan_request)\n end",
"title": ""
},
{
"docid": "310d0ed28410b67c8af79894d57ac24b",
"score": "0.43607304",
"text": "def register_results( results )\n framework.plugins.register_results( self, results )\n end",
"title": ""
},
{
"docid": "a3f0e44a0cfd14897b90814233bb2c35",
"score": "0.43589702",
"text": "def transfer_taxonomy(tax)\n $stderr.puts 'Transferring taxonomy'\n return if tax.nil?\n\n pval = project.option(:tax_pvalue)\n tax_a = tax\n .select { |i| i[1] != '?' && i[2] <= pval }\n .map { |i| i[0, 2].join(':') }\n dataset.metadata[:tax] = MiGA::Taxonomy.new(tax_a)\n $stderr.puts \" > #{dataset.metadata[:tax]}\"\n dataset.save\n end",
"title": ""
},
{
"docid": "e2254a6f83ed6db70cb7328befd6e156",
"score": "0.4357309",
"text": "def search_results\n self.options ||= {}\n search_opts = self.options\n search_text = generate_search_text\n include_facets = self.faceted\n \n response = Bookmark.tire.search(page: search_opts[:page], per_page: ArchiveConfig.ITEMS_PER_PAGE) do\n query do\n boolean do\n must { string search_text, default_operator: \"AND\" } if search_text.present?\n \n must { term :private, 'F' } unless search_opts[:show_private]\n must { term :hidden_by_admin, 'F' }\n must { term :rec, 'T' } if %w(1 true).include?(search_opts[:rec].to_s)\n must { term :with_notes, 'T' } if %w(1 true).include?(search_opts[:with_notes].to_s)\n\n must { term :bookmarkable_posted, 'T' }\n must { term :bookmarkable_hidden, 'F' }\n must { term :bookmarkable_restricted, 'F' } unless search_opts[:show_restricted]\n must { term :bookmarkable_complete, 'T' } if %w(1 true).include?(search_opts[:complete].to_s)\n must { term :bookmarkable_language_id, search_opts[:language_id].to_i } if search_opts[:language_id].present?\n must { term :bookmarkable_type, search_opts[:bookmarkable_type].gsub(\" \", \"\").downcase} if search_opts[:bookmarkable_type].present?\n \n if search_opts[:pseud_ids].present?\n must { terms :pseud_id, search_opts[:pseud_ids] }\n end\n \n [:rating_ids, :warning_ids, :category_ids, :fandom_ids, :character_ids, :relationship_ids, :freeform_ids].each do |id_list|\n if search_opts[id_list].present?\n search_opts[:filter_ids] ||= []\n search_opts[:filter_ids] += search_opts[id_list]\n end\n end\n \n [:filter_ids, :tag_ids, :collection_ids, :bookmarkable_collection_ids].each do |id_list|\n if search_opts[id_list].present?\n search_opts[id_list].each do |id|\n must { term id_list, id }\n end\n end\n end\n end\n end\n \n [:bookmarkable_word_count, :date, :bookmarkable_date].each do |countable|\n if search_opts[countable].present?\n key = (countable == :date) ? :created_at : countable\n filter :range, key => Search.range_to_search(search_opts[countable])\n end\n end\n \n if search_opts[:sort_column].present?\n sort { by search_opts[:sort_column], search_opts[:sort_direction] }\n end\n\n if include_facets\n %w(tag rating warning category fandom character relationship freeform).each do |facet_type|\n facet facet_type do\n terms \"#{facet_type}_ids\".to_sym\n end\n end\n end\n end\n SearchResult.new('Bookmark', response)\n end",
"title": ""
},
{
"docid": "5f489da06cdec30a801ac096a5eeb2dc",
"score": "0.43569806",
"text": "def get_scans_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: ScanApi.get_scans ...'\n end\n # resource path\n local_var_path = '/api/3/scans'\n\n # query parameters\n query_params = {}\n query_params[:'active'] = opts[:'active'] if !opts[:'active'].nil?\n query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?\n query_params[:'size'] = opts[:'size'] if !opts[:'size'].nil?\n query_params[:'sort'] = @api_client.build_collection_param(opts[:'sort'], :multi) if !opts[:'sort'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json;charset=UTF-8'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = []\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'PageOfGlobalScan')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ScanApi#get_scans\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "78320519d526c9a2bc6582936aaa56ab",
"score": "0.43448284",
"text": "def add_scanner(scanner_class_name, scanner_opts = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "625a3e700feb9a2a9c86b3b05ed04652",
"score": "0.4336538",
"text": "def suggest query, type = 'metrics'\n response = @client.get \"/suggest?q=#{query}&type=#{type}\"\n JSON.parse response.body\n end",
"title": ""
},
{
"docid": "3b94aeb5539868e3057ddfd0c5c77264",
"score": "0.43364283",
"text": "def custom\n scaf_sess = session['as:report/testables']\n\n if scaf_sess.nil?\n redirect_to :action => 'index'\n return\n end\n\n report_params = scaf_sess[:search]\n if not report_params.has_key?(:datatype) or report_params[:datatype].blank?\n flash[:error] = \"Please select a test type\"\n redirect_to :action => 'index', :controller => '/report/testables'\n return\n else\n conds = Latrs::Search::Parser.new(report_params)\n tests = Testable.all(:conditions => \"#{conds.parse}\", :joins => :testableitems)\n if tests.count < 1\n flash[:error] = \"No matching tests found\"\n redirect_to :action => 'index', :controller => '/report/testables'\n return\n end\n\n rule = \"SELECT testables.* FROM testables INNER JOIN testableitems ON testableitems.testable_id = testables.id WHERE #{conds.parse}\"\n\n\n @report_data = generate_report(tests)\n @report_data[:rule] = pretty_rule(rule)\n render :layout => \"raw-report\"\n end\n end",
"title": ""
},
{
"docid": "ec13a0127e7dc79f95fd93eac33504f6",
"score": "0.43361786",
"text": "def add_base(options)\n options.each do |key, value|\n @body.tag!(key, value)\n end\n \n @base = options\n end",
"title": ""
},
{
"docid": "983df7d49297b502e4009dd538ccf83f",
"score": "0.43341678",
"text": "def add(klass)\n klass.add_to_analyzer(self)\n end",
"title": ""
},
{
"docid": "d12020f3197d973e6b569e1d48c6a015",
"score": "0.4330099",
"text": "def base(_base)\n raise BaseDefentitionError unless valid_selector? _base\n\n @_base = _base.to_a.flatten\n end",
"title": ""
},
{
"docid": "f621dc6bd4d9ccda8dc451a48ac65fe1",
"score": "0.43217254",
"text": "def query_results\n @query_results ||= Stretchy::Results::Base.new(base)\n end",
"title": ""
}
] |
2b3dd39cae08415ada6842451c68d506 | Get the page number that the object belongs to | [
{
"docid": "7ed10b3b871e038ae3fd0db70d0ce11a",
"score": "0.63752264",
"text": "def page(order = :id)\n ((self.class.order(order => :desc)\n .pluck(order).index(send(order)) + 1)\n .to_f / self.class.default_per_page).ceil\n end",
"title": ""
}
] | [
{
"docid": "c565283bf5d68a4fae6752ca3a3e77c5",
"score": "0.8130441",
"text": "def PageNo()\n\t\t#Get current page number\n\t\treturn @page;\n\tend",
"title": ""
},
{
"docid": "849515379c7b2ac2018acc5ec0b31f12",
"score": "0.76175594",
"text": "def page\r\n @page || 1\r\n end",
"title": ""
},
{
"docid": "8a55ab938cc65072a0562632a34d5df5",
"score": "0.7590083",
"text": "def __page\n @_page || 1\n end",
"title": ""
},
{
"docid": "faddf8a8350b46074ea47ff807e324dc",
"score": "0.75767946",
"text": "def page_number\n (params[:page] || 1).to_i\n end",
"title": ""
},
{
"docid": "f4a9b3da72c302c62ee36755d8293944",
"score": "0.74460495",
"text": "def current_page_number\n @pageset.size\n end",
"title": ""
},
{
"docid": "e0dc707635a0cf6acd881f41a6be3bd4",
"score": "0.7347171",
"text": "def page\n Integer(parsed_body['Meta']['Parameters']['page'] || 1)\n end",
"title": ""
},
{
"docid": "d327792985bc0fdcb98fee9b9050f9a3",
"score": "0.7332259",
"text": "def page_number\n raise NotImplemented\n end",
"title": ""
},
{
"docid": "a4c10699497f5dc0bda67ce65ab8f8e1",
"score": "0.7286417",
"text": "def page_number\n query_params&.dig(:page)\n end",
"title": ""
},
{
"docid": "a4c10699497f5dc0bda67ce65ab8f8e1",
"score": "0.7286417",
"text": "def page_number\n query_params&.dig(:page)\n end",
"title": ""
},
{
"docid": "cceb030fbcf6adc0e74d514b0b9d0721",
"score": "0.71974564",
"text": "def next_page_number\n self.pages.count + 1\n end",
"title": ""
},
{
"docid": "97d2ea1b895c91163dadb81a9ab60547",
"score": "0.719678",
"text": "def page_object\n @page\n end",
"title": ""
},
{
"docid": "97d2ea1b895c91163dadb81a9ab60547",
"score": "0.719678",
"text": "def page_object\n @page\n end",
"title": ""
},
{
"docid": "e96494b6b0e9f00294918b1e5174b92c",
"score": "0.7188538",
"text": "def page\n if !@page || @page < 1\n 1\n elsif @page > total_pages\n total_pages\n else\n @page\n end\n end",
"title": ""
},
{
"docid": "3d6d0f3441ebea0a490d9bbb20b93f6a",
"score": "0.7168529",
"text": "def page_number\n\t\t\t\treturn 0 if @total_results == 0\n\t\t\t\t@offset + 1\n\t\t\tend",
"title": ""
},
{
"docid": "3868feb43ca3c12b44162d5435a5718a",
"score": "0.71549016",
"text": "def first_page_number\n 1\n end",
"title": ""
},
{
"docid": "185266d484b3e941117a123d0f06f219",
"score": "0.7146831",
"text": "def last_page_number\n number_of_pages\n end",
"title": ""
},
{
"docid": "3d4772dc98425962454cab450c755340",
"score": "0.7133309",
"text": "def page\n @request.params[:page] ? @request.params[:page].to_i : 1\n end",
"title": ""
},
{
"docid": "f1f54ddd22ef2a4002a045bdb84d1a79",
"score": "0.7128295",
"text": "def current_page_number\n (previous_page_number.to_i + 1).to_s\n end",
"title": ""
},
{
"docid": "a849d850aedb17372d6e4842f58b4f13",
"score": "0.7091888",
"text": "def page\n _page = params[:page].to_i\n return (_page == 0) ? 1 : _page\n end",
"title": ""
},
{
"docid": "9ac910f140c3fff57e24dbf82d4519f8",
"score": "0.7047296",
"text": "def get_page_number\n # this is the normal case; masterfile and unit share same metadata record\n # so page number will match the numbering sequence of the filename\n page = filename.split(\"_\")[1].split(\".\")[0].to_i\n # if metadata_id == unit.metadata_id\n if is_clone?\n mf_id = original_mf_id\n page = MasterFile.find(mf_id).filename.split(\"_\")[1].split(\".\")[0].to_i\n end\n # else\n # # this master file has been assigned to a separate metadata record. the\n # # page number in the filename does not reflect the actual page num. Count\n # # masterfiles owned by metadata record to determine\n # page = 1\n # metadata.master_files.each do |mf|\n # if mf.id == id\n # break\n # else\n # page += 1\n # end\n # end\n # end\n return page\n end",
"title": ""
},
{
"docid": "8b19760ccd3a98261f522ee8a8de705f",
"score": "0.7043689",
"text": "def object_id_for_page(k)\n k -= 1 if k > 0\n flat_page_ids = get_page_objects(pages).flatten\n flat_page_ids[k]\n end",
"title": ""
},
{
"docid": "545eb55ff682d4ab94a9b67c18e04610",
"score": "0.70401037",
"text": "def page\n Integer(params[:page] || 1)\n end",
"title": ""
},
{
"docid": "e7e7004191a46d5964a0d16fd5721437",
"score": "0.70268303",
"text": "def page_count\n @page_counter\n end",
"title": ""
},
{
"docid": "fd001c33c54d70c74283c8cc9043fb5f",
"score": "0.69649273",
"text": "def page\r\n\t\t\t\tparams[:page].to_i || 1\r\n\t\t\tend",
"title": ""
},
{
"docid": "6233f913e6feca60937bfc7458b22fe5",
"score": "0.69395024",
"text": "def page_count\n 1\n end",
"title": ""
},
{
"docid": "b78e00b77fc27aa57e69c0083234eee0",
"score": "0.6874863",
"text": "def pagination_page\n @pagination_page\n end",
"title": ""
},
{
"docid": "df6c2792209f4d0c971ed72a9291ec1b",
"score": "0.68650275",
"text": "def current_page\n self.page ||= 0\n self.page + 1\n end",
"title": ""
},
{
"docid": "67425976dbd45bc551291ed4849d51cb",
"score": "0.6863659",
"text": "def page_count\n @page_count\n end",
"title": ""
},
{
"docid": "3897aeac332019f013e59a850e4983f1",
"score": "0.68626034",
"text": "def page_index(item_index)\n return -1 if item_index < 0 || item_index > item_count-1 \n item_index/@per_page \n end",
"title": ""
},
{
"docid": "43de7cd75c90c93fe5e238a187978d07",
"score": "0.68601847",
"text": "def last_page_number\n Hash(last_page_params).fetch('page', {}).fetch('number', nil)\n end",
"title": ""
},
{
"docid": "6ed7a6d7ea3ea63e19f703bbb51282ce",
"score": "0.6835664",
"text": "def next_page_number\n Hash(next_page_params).fetch('page', {}).fetch('number', nil)\n end",
"title": ""
},
{
"docid": "874f5bb996f2eeb426b7045ed1ac3fde",
"score": "0.6827393",
"text": "def page(req)\n req.params.fetch('page', default='1').to_i\n end",
"title": ""
},
{
"docid": "0fe4f8b2e0403c4a85fe5bca3b18d929",
"score": "0.6813814",
"text": "def page_count\n pages.last\n end",
"title": ""
},
{
"docid": "a774ec0dbb8457437e5be4c7f2b10c17",
"score": "0.68029416",
"text": "def next_page_number\n last_page? ? nil : current_page_number + 1\n end",
"title": ""
},
{
"docid": "9a136a5ff4f5b249a3735314f4ca392e",
"score": "0.6779484",
"text": "def page\n\t\tindex = self.topic.posts.index(self) + 1\n\t\t(index / Post.per_page.to_f).ceil\n\tend",
"title": ""
},
{
"docid": "b1a56aa80d00d7c5ee865b578fed40b7",
"score": "0.6772036",
"text": "def last_page_index\n num_pages() - 1\n end",
"title": ""
},
{
"docid": "8282f3cb0938ffa55a5f21bb031a043b",
"score": "0.67689127",
"text": "def current_page\n @options[:page].blank? ? 1 : @options[:page].to_i\n end",
"title": ""
},
{
"docid": "e2c8683ba119531a7c7cc72ac99fac22",
"score": "0.671367",
"text": "def get_page_number\n if page_parameters_defined?\n @query_params[:page] = params[:document_counter].to_i==1 ? 1 : ((params[:document_counter].to_f-1)/current_per_page).ceil\n end\n end",
"title": ""
},
{
"docid": "fc5c8e241ed1bea00a67d0b160a8504f",
"score": "0.67126936",
"text": "def page_index(item_index)\n if (item_index >= item_count || item_index < 0)\n -1\n elsif item_count == item_index - 1\n page_count - 1\n else\n (item_index / page_size)\n end\n end",
"title": ""
},
{
"docid": "d2be4f4692feda5d154b29e8c19a9934",
"score": "0.67045504",
"text": "def page_index(item_index)\n return -1 if item_index < 0 || item_index >= self.item_count\n location = item_index.divmod @items_per_page\n location[0]\n end",
"title": ""
},
{
"docid": "b027f9a1e1657e442af7f856d08637b3",
"score": "0.6703056",
"text": "def presentation_page n\n pages[n-1][:resource]\n end",
"title": ""
},
{
"docid": "a3254569936bc4901bc1bac036527247",
"score": "0.6677617",
"text": "def total_pages\n -1\n end",
"title": ""
},
{
"docid": "7de3139703a3c05cacf5f3e6d9ddefe5",
"score": "0.6676917",
"text": "def number_of_pages\n return @number_of_pages\n end",
"title": ""
},
{
"docid": "5d3259f7b2d89c0067a1900eea4414eb",
"score": "0.6674271",
"text": "def page\n obj\n end",
"title": ""
},
{
"docid": "28672dca06d0f7e3d24d61365cd2c84a",
"score": "0.66575885",
"text": "def get_num_pages\n record_count = @model_class.count\n if record_count % @items_per_page == 0\n (record_count / @items_per_page)\n else\n (record_count / @items_per_page) + 1\n end\n end",
"title": ""
},
{
"docid": "f0a3684e084aeca45000918bda77b590",
"score": "0.6650492",
"text": "def get_page_number_for(mushaf:)\n mushaf_pages_mapping[mushaf.to_s]\n end",
"title": ""
},
{
"docid": "f1f32ee24f2728423695e05606b6f66f",
"score": "0.66490376",
"text": "def current_page\n first(@raw_page['records'].size)\n end",
"title": ""
},
{
"docid": "1d07c4ab80ea2f4340d7c9dbb24fb958",
"score": "0.66423845",
"text": "def page_count\n @collection.max + 1\n end",
"title": ""
},
{
"docid": "5efbc09cbd3cf3a9af8755ff2886a265",
"score": "0.6639351",
"text": "def page\n position = Post.where('created_at <= ? AND\n postable_id = ? AND\n postable_type = ?',\n created_at,\n postable.id,\n postable.class).size\n (position.to_f / Post.default_per_page).ceil\n end",
"title": ""
},
{
"docid": "c078967c8578eed8ba7c055c8065c0f6",
"score": "0.6607788",
"text": "def page num\n raise ArgumentError.new 'Survey pages are one-indexed' if num < 1\n pages[num - 1]\n end",
"title": ""
},
{
"docid": "a9a763aa6f13b5c8b4eb34f1e3fd6831",
"score": "0.65797526",
"text": "def page\n params[:iDisplayStart].to_i / per_page + 1\n end",
"title": ""
},
{
"docid": "b5b0786ea18d537e65cb2fe434b15949",
"score": "0.65735424",
"text": "def current_page\n return 0 if current_limit.blank? || current_limit.zero?\n (current_offset / current_limit) + 1\n end",
"title": ""
},
{
"docid": "96361d9e2fb707c4ea3284bd4f5e8745",
"score": "0.65617156",
"text": "def page\n @page ||= params[:page] || 1\n end",
"title": ""
},
{
"docid": "ec2ea930592ee448d6d7f43b6487d27c",
"score": "0.65536577",
"text": "def page_param\n if params[:page].is_a? ActionController::Parameters\n params[:page][:number]\n else\n params[:page]\n end\n end",
"title": ""
},
{
"docid": "8768e5a9c3c62c574a4cb5f13b777461",
"score": "0.65507853",
"text": "def first_page_id\n # Some PageTurners use integers, others use GUIDs etc., \n # but page numbers are most common, so default to 1.\n 1\n end",
"title": ""
},
{
"docid": "40d16ecfbc2215bd048fef0ddbe187d5",
"score": "0.6520173",
"text": "def item_page\n @item_page ||= ApiBucket::Base::Element.get(@doc, \"//ItemPage\").to_i\n end",
"title": ""
},
{
"docid": "299033833516df0b8d8c6b8796423596",
"score": "0.6520081",
"text": "def pageid\n\t\t\t@data[\"pageid\"]\n\t\tend",
"title": ""
},
{
"docid": "0e03b39da1d22ec49a025fe413ac0706",
"score": "0.65198797",
"text": "def page\n self.class.page\n end",
"title": ""
},
{
"docid": "e61eb174be41ec4c1b9de53e0e2003d4",
"score": "0.65140903",
"text": "def page\n @page ||= revision.try(:page)\n end",
"title": ""
},
{
"docid": "40da5b775731a524bc14befeb384b4b7",
"score": "0.6500626",
"text": "def last_page\n return nil if total_pages < 1\n return total_pages\n end",
"title": ""
},
{
"docid": "725aaa08888ed9ea92034b39bd285200",
"score": "0.6497977",
"text": "def current_page\n params[:page] && params[:page].match(/\\d+/) ? params[:page].to_i : 1\n end",
"title": ""
},
{
"docid": "17e9dd22e7c724b4e6b4bbb55d71db54",
"score": "0.64940375",
"text": "def current_page\n @page\n end",
"title": ""
},
{
"docid": "09730ec2c7d603054ced98da08eda431",
"score": "0.6485927",
"text": "def page_count\n @total_pages\n end",
"title": ""
},
{
"docid": "7e84cc7f9938356989505cce206ce7f4",
"score": "0.64754134",
"text": "def current_page\n (params[:page].blank? ? 1 : params[:page]).to_i\n end",
"title": ""
},
{
"docid": "e41be2b01a6d3786c43e9e8b9a65c903",
"score": "0.64667183",
"text": "def next\n return @page + 1\n end",
"title": ""
},
{
"docid": "469cd5973f88e8a73902e6584ac61e6e",
"score": "0.6462194",
"text": "def first_in_page\n ((current_page - 1) * per_page) + 1\n end",
"title": ""
},
{
"docid": "2a390211e7951c12490e78b55ec63a4f",
"score": "0.64615107",
"text": "def page_count\n @page_count ||= get_page_count\n end",
"title": ""
},
{
"docid": "55e621d8c451be8891d2751410c0ecc2",
"score": "0.6460756",
"text": "def page_item_count(page_index)\n if (page_index + 1 < page_count)\n page_size\n elsif page_index + 1 > page_count\n -1\n else\n item_count % page_size\n end\n end",
"title": ""
},
{
"docid": "840bc7a204e210392d396e379685c131",
"score": "0.6453887",
"text": "def page_item_count(page_index)\n return -1 if page_index < 0 || page_index >= self.page_count\n @pages[page_index].count\n end",
"title": ""
},
{
"docid": "5a7b6690feb7b4be0211a5d96c1a7bb6",
"score": "0.6451985",
"text": "def page\n params[:iDisplayStart].to_i/per_page + 1\n end",
"title": ""
},
{
"docid": "f6fffa3d6e6b429af163829f63fdb23e",
"score": "0.6447101",
"text": "def page_start_for(page_num)\n page_size * (page_num - 1) + 1\n end",
"title": ""
},
{
"docid": "6c1b39803fe4ef2fa7d27a709626c54a",
"score": "0.6438068",
"text": "def page\n # extract :page from defaults? no need using default page?\n @params[:page].to_i > 0 ? @params[:page] : @cfg[:default][:page]\n end",
"title": ""
},
{
"docid": "90584271a189ac2cc7a72298a5d29a80",
"score": "0.6430697",
"text": "def page\n\t\tparams[:iDisplayStart].to_i/per_page + 1\n\tend",
"title": ""
},
{
"docid": "703f10a589071b3232eb22fd36cc9cf5",
"score": "0.6425899",
"text": "def id\n read_attribute(:pg_page_id)\n end",
"title": ""
},
{
"docid": "d433633d0aba62ee697ff56b72e1cc08",
"score": "0.64181703",
"text": "def page_index(item_index) \n return -1 if !(item_index < item_count) || item_index < 0\n @collection[item_index]\n end",
"title": ""
},
{
"docid": "6e13b2e2dbcf85bd0fac568ba00ab943",
"score": "0.64124316",
"text": "def prev_page\n num = current_page - 1\n num if num.positive?\n end",
"title": ""
},
{
"docid": "3f35831c4cd2d02676f6c7dafc98bd60",
"score": "0.6397676",
"text": "def page_count\n @pages.count\n end",
"title": ""
},
{
"docid": "dbfef1d4e46a96d74acb70dd48f6df68",
"score": "0.6385703",
"text": "def page_count; pages.count; end",
"title": ""
},
{
"docid": "8297ca49bd037192abc75f5b51e8b692",
"score": "0.63821304",
"text": "def page(num)\n @current_page = num.to_i\n @size ||= DEFAULT_PAGE_SIZE\n self\n end",
"title": ""
},
{
"docid": "83b352a70a273136cd2ec7f276296ffa",
"score": "0.6381242",
"text": "def page_index(item_index)\n return -1 if item_index < 0\n return -1 if item_index >= item_count\n item_index / @items_per_page\n end",
"title": ""
},
{
"docid": "7814eb224d67f947bf4b8a638b259d78",
"score": "0.63800454",
"text": "def page_count\n # Integer arithmetic is simpler and faster.\n @page_count ||= item_count > 0 ? (item_count - 1) / items_per_page + 1 : 1\n end",
"title": ""
},
{
"docid": "3cedf3b54f84c5d602abadb99b1c1a35",
"score": "0.63724554",
"text": "def page_num_getter\n\t\t##Nokogiri\n\t\t# doc = Nokogiri::HTML(open(@page_name))\n\t\t# puts doc.css('result custom-right-inner')\n\t\t##Mechanize\n\t\t##new agent\n\t\t@agent = Mechanize.new\n\t\tstr = @agent.get(@page_name).search('span.custom-right-inner')[0].text\n\t\t@total_page = str.scan(/\\d+/)[0].to_i\n\tend",
"title": ""
},
{
"docid": "33fd8a11f97aa30eee713a282f8d9202",
"score": "0.6368655",
"text": "def begin; pager.offset page; end",
"title": ""
},
{
"docid": "1d5d7a29965e5ee2d0a1710ac1cef5af",
"score": "0.63663703",
"text": "def current_page\n return 1 if start < 1\n per_page_normalized = per_page < 1 ? 1 : per_page\n @current_page ||= (start / per_page_normalized).ceil + 1\n end",
"title": ""
},
{
"docid": "4d9d7dba5418918e33cc1e1198e4ecda",
"score": "0.6364329",
"text": "def start_index(page)\n (page - 1) * @count + 1\n end",
"title": ""
},
{
"docid": "2f2e3ac9fbd41fec61ebf99c979b6d57",
"score": "0.635397",
"text": "def start_result_number\n ((page - 1) * per_page) + 1\n end",
"title": ""
},
{
"docid": "098eacbb9ba342fbdf193427c7552d0e",
"score": "0.6348632",
"text": "def leading\n (@total_pages > 0) ? 1 : nil\n end",
"title": ""
},
{
"docid": "5bc87030e1b87f3fd6592dd344407e83",
"score": "0.63439",
"text": "def page\n @page ||= retrieve_page\n end",
"title": ""
},
{
"docid": "5bc87030e1b87f3fd6592dd344407e83",
"score": "0.63439",
"text": "def page\n @page ||= retrieve_page\n end",
"title": ""
},
{
"docid": "b78299140d17e5a9acfa3810488da2b2",
"score": "0.63423246",
"text": "def previous_page_number\n Hash(previous_page_params).fetch('page', {}).fetch('number', nil)\n end",
"title": ""
},
{
"docid": "4dbd278d81d7821f5ba52914020c0d4c",
"score": "0.6335253",
"text": "def page_from_params\n page_num = params[:page].to_i\n\n page_num.zero? ? DEFAULT_PAGE : page_num\n end",
"title": ""
},
{
"docid": "892ef04f11e456657d6d663df0bf5ab5",
"score": "0.63125986",
"text": "def current_page\n [(params[:page] || @default_page || 1).to_i, 1].max # ensure positive integer\n end",
"title": ""
},
{
"docid": "92dd687d61fa7ff2032a0c691d466c6d",
"score": "0.63101816",
"text": "def next_page\n return nil if total_pages == -1\n return nil if page == total_pages\n return page + 1\n end",
"title": ""
},
{
"docid": "2b8b6c55791cd07931cb75183e72f585",
"score": "0.6301717",
"text": "def offset\n (page - 1) * PER_PAGE\n end",
"title": ""
},
{
"docid": "0cd6e18e196202e48af9f07f7ea3479f",
"score": "0.63007385",
"text": "def total_pages; end",
"title": ""
},
{
"docid": "75333fbb27e8ec9910dd8e760fba60f4",
"score": "0.62982017",
"text": "def number_of_pages\n document.at(\"[@itemprop='numberOfPages']\").innerHTML.scan(/\\d+/).first.to_i rescue nil\n end",
"title": ""
},
{
"docid": "5a4fd0e074ccdf1c1f30c7b3579b104b",
"score": "0.62970734",
"text": "def prev_page_number\n [page_number - 1, first_page_number].max\n end",
"title": ""
},
{
"docid": "29117fed60d10a66e380638181390671",
"score": "0.62968695",
"text": "def current_page\n unless @page\n @page = params[:page].to_i\n @page = 1 unless @page\n @page = 1 if @page < 1\n end\n return @page\n end",
"title": ""
},
{
"docid": "9f4646d2481f5053475ce046dcd2e912",
"score": "0.6292905",
"text": "def num_pages\n 26\n end",
"title": ""
},
{
"docid": "50a327723de4372e6c4d4553071adeeb",
"score": "0.6292239",
"text": "def which_page_number(page_num, scheme = 0)\n return nil unless @page_numbering\n\n num = nil\n start = start_num = 1\n\n @page_numbering[scheme].each do |kk, vv|\n if kk <= page_num\n if vv.kind_of?(Hash)\n unless vv[:starting].nil?\n start = vv[:starting]\n start_num = kk\n num = page_num - start_num + start\n end\n else\n num = nil\n end\n end\n end\n num\n end",
"title": ""
}
] |
7df0520e4470814658672fc03ebe09a1 | GET /neckalace_energized_bor_x_transformers/1 GET /neckalace_energized_bor_x_transformers/1.json | [
{
"docid": "a81945373733e4951b987de6ea99f9a1",
"score": "0.0",
"text": "def show\n end",
"title": ""
}
] | [
{
"docid": "560052aba1af4b996d303bcbb9c380be",
"score": "0.7560918",
"text": "def index\n @neckalace_energized_bor_x_transformers = NeckalaceEnergizedBorXTransformer.all\n end",
"title": ""
},
{
"docid": "e991a645fdd59f7b367bb3760c0f7245",
"score": "0.717579",
"text": "def index\n @neckalace_energized_bor_h_transformers = NeckalaceEnergizedBorHTransformer.all\n end",
"title": ""
},
{
"docid": "4bb7a5d1260e1460dcf27959cc101fea",
"score": "0.65383106",
"text": "def set_neckalace_energized_bor_x_transformer\n @neckalace_energized_bor_x_transformer = NeckalaceEnergizedBorXTransformer.find(params[:id])\n end",
"title": ""
},
{
"docid": "dd1cd823ea3b15abb2ab2615aae682b9",
"score": "0.6104058",
"text": "def index\n @transformers = Transformer.all\n end",
"title": ""
},
{
"docid": "d9d235169f596bbf23d3d10cfcad1904",
"score": "0.6065408",
"text": "def set_neckalace_energized_bor_h_transformer\n @neckalace_energized_bor_h_transformer = NeckalaceEnergizedBorHTransformer.find(params[:id])\n end",
"title": ""
},
{
"docid": "807953e7c07e7aa7fab2e36c77249f20",
"score": "0.5999444",
"text": "def create\n @neckalace_energized_bor_x_transformer = NeckalaceEnergizedBorXTransformer.new(neckalace_energized_bor_x_transformer_params)\n\n respond_to do |format|\n if @neckalace_energized_bor_x_transformer.save\n format.html { redirect_to @neckalace_energized_bor_x_transformer, notice: 'Neckalace energized bor x transformer was successfully created.' }\n format.json { render :show, status: :created, location: @neckalace_energized_bor_x_transformer }\n else\n format.html { render :new }\n format.json { render json: @neckalace_energized_bor_x_transformer.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e371ecb079051352257c6506208c6295",
"score": "0.58667564",
"text": "def index\n @transformation_ratio_transfromers = TransformationRatioTransfromer.all\n end",
"title": ""
},
{
"docid": "96759b3cb90dd666c7e9b47068de1817",
"score": "0.5776699",
"text": "def index\n @insulation_resistence_transformers = InsulationResistenceTransformer.all\n end",
"title": ""
},
{
"docid": "01ff8b9efb78add5291abbe4094c13b2",
"score": "0.5649392",
"text": "def transformer_objects\n transformers.values\n end",
"title": ""
},
{
"docid": "fb2cd4fcadff9fb499ed719775543200",
"score": "0.56007737",
"text": "def test_get_transformers()\n @socket.write(ACTIVITIES[:get_transformers])\n\n # choose shape to select\n n, expectfail = choose_shape()\n @socket.write(n.chr())\n\n # handle result\n if not expectfail\n # expect success\n assert(RESULT_RES, @socket.read(1))\n data = self.recv_blob()\n assert(@images[@selected].shapes[n].xformers.length, data[0].ord)\n else\n # expect failure\n assert(RESULT_FAL, @socket.read(1))\n end\n end",
"title": ""
},
{
"docid": "ca2d008f9dbbc755809e7611a148bec1",
"score": "0.55249107",
"text": "def transformers\n []\n end",
"title": ""
},
{
"docid": "5cb8ab5a0429810ba8da0f2cb896a3a8",
"score": "0.5478801",
"text": "def index\n @transforms = Transform.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @transforms }\n end\n end",
"title": ""
},
{
"docid": "ce3e39383b95c2705a0b45b93f8d9321",
"score": "0.546383",
"text": "def create\n @neckalace_energized_bor_h_transformer = NeckalaceEnergizedBorHTransformer.new(neckalace_energized_bor_h_transformer_params)\n\n respond_to do |format|\n if @neckalace_energized_bor_h_transformer.save\n format.html { redirect_to @neckalace_energized_bor_h_transformer, notice: 'Neckalace energized bor h transformer was successfully created.' }\n format.json { render :show, status: :created, location: @neckalace_energized_bor_h_transformer }\n else\n format.html { render :new }\n format.json { render json: @neckalace_energized_bor_h_transformer.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e8b3d2e8c7486cb2d93089f49e4582d2",
"score": "0.54219294",
"text": "def show\n authorize! :show, :transform\n @results = TransformResult.order(timestamp: :desc).page(params[:page])\n render formats: :json\n end",
"title": ""
},
{
"docid": "bd9616552769f14766b7cdcb9c23a7aa",
"score": "0.5408787",
"text": "def index\n respond_with(transformations)\n end",
"title": ""
},
{
"docid": "fdf9d87a82708f107a95faf371500ca5",
"score": "0.52867407",
"text": "def base_transformers(explicit)\n return [] if explicit\n\n [Realize::Transformers.make(type: RESOLVE_TYPE, key: key)]\n end",
"title": ""
},
{
"docid": "816862d3a518816a14c950b38f666850",
"score": "0.5284127",
"text": "def update\n respond_to do |format|\n if @neckalace_energized_bor_x_transformer.update(neckalace_energized_bor_x_transformer_params)\n format.html { redirect_to @neckalace_energized_bor_x_transformer, notice: 'Neckalace energized bor x transformer was successfully updated.' }\n format.json { render :show, status: :ok, location: @neckalace_energized_bor_x_transformer }\n else\n format.html { render :edit }\n format.json { render json: @neckalace_energized_bor_x_transformer.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3f7759675ff39124315cd166cf7edaca",
"score": "0.52467793",
"text": "def index\n @transformations = Transformation.all\n end",
"title": ""
},
{
"docid": "dc6e8a9566337bdc36b0ce3d6e95ac51",
"score": "0.5203793",
"text": "def champion_rotations\n DynamicModel.new perform_request api_url('champion-rotations')\n end",
"title": ""
},
{
"docid": "cb191c1dad3c955439be2ef2553b1fdc",
"score": "0.5130658",
"text": "def transform(x)\n x = ::Rumale::Validation.check_convert_sample_array(x)\n\n n_samples = x.shape[0]\n n_components = @output_size.values.sum\n z = Numo::DFloat.zeros(n_samples, n_components)\n f_start = 0\n @estimators.each_key do |name|\n f_last = f_start + @output_size[name]\n f_position = @output_size[name] == 1 ? f_start : f_start...f_last\n z[true, f_position] = @estimators[name].predict(x)\n f_start = f_last\n end\n z = Numo::NArray.hstack([z, x]) if @params[:passthrough]\n z\n end",
"title": ""
},
{
"docid": "d27af05675b2b48ad1700b22d57cecc4",
"score": "0.505954",
"text": "def test_get_transformer()\n @socket.write(ACTIVITIES[:get_transformer])\n\n # choose shape to select\n n, m, expectfail = choose_xformer()\n @socket.write(n.chr())\n @socket.write(m.chr())\n\n # handle result\n if not expectfail\n # expect success\n assert(RESULT_RES, @socket.read(1))\n data = self.recv_blob()\n assert(\"#{@images[@selected].shapes[n].xformers[m].type.chr}#{@images[@selected].shapes[n].xformers[m].serialize}\", data, fuzzy: true)\n else\n # expect failure\n assert(RESULT_FAL, @socket.read(1))\n end\n end",
"title": ""
},
{
"docid": "96bb707063383f83c2141b7ef73e032e",
"score": "0.50479764",
"text": "def destroy\n @neckalace_energized_bor_x_transformer.destroy\n respond_to do |format|\n format.html { redirect_to neckalace_energized_bor_x_transformers_url, notice: 'Neckalace energized bor x transformer was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "2e0ddc32a1a993a867e712cf8cb959d9",
"score": "0.50017136",
"text": "def show\n @transformer = Transformer.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @transformer }\n end\n end",
"title": ""
},
{
"docid": "e5b0e459b119654a8b6fbf5c0afe2022",
"score": "0.4974924",
"text": "def transformer\n @transformer\n end",
"title": ""
},
{
"docid": "26603ffef780dd7dc8f11bdd9c37fc80",
"score": "0.49380913",
"text": "def index\n @nodes = Node.all\n respond_to do |format|\n format.html # index.html.erb\n format.json do \n data = {}\n @nodes.each do |n|\n loss_5_min = n.loss_5_min\n rtt_5_min = n.rtt_5_min \n data[n.id] = {id_hex: n.node_id, \n loss_5_min: (loss_5_min.nil? || loss_5_min.nan?) ? 1.0 : loss_5_min, \n rtt_5_min: (rtt_5_min.nil? || rtt_5_min.nan?) ? nil : rtt_5_min}\n end\n render json: data\n end\n end\n end",
"title": ""
},
{
"docid": "6ff546e629ba975472cdf78592a914d4",
"score": "0.4917191",
"text": "def transformers\n [embed_transformer]\n end",
"title": ""
},
{
"docid": "8a19beb413c7de1b57bbc0b54225c6ed",
"score": "0.4910623",
"text": "def transform(x)\n x = ::Rumale::Validation.check_convert_sample_array(x)\n\n n_samples = x.shape[0]\n n_components = @output_size.values.sum\n z = Numo::DFloat.zeros(n_samples, n_components)\n f_start = 0\n @estimators.each_key do |name|\n f_last = f_start + @output_size[name]\n f_position = @output_size[name] == 1 ? f_start : f_start...f_last\n z[true, f_position] = @estimators[name].public_send(@stack_method[name], x)\n f_start = f_last\n end\n z = Numo::NArray.hstack([z, x]) if @params[:passthrough]\n z\n end",
"title": ""
},
{
"docid": "b5d6c08ce6ece23d7f1d89a587bd0691",
"score": "0.4866943",
"text": "def index\n @aggressors = Aggressor.all\n end",
"title": ""
},
{
"docid": "5e1be10b1248fa732549fa55d85c0e0b",
"score": "0.4865086",
"text": "def index\n @racers = Racer.all\n\n render json: @racers\n end",
"title": ""
},
{
"docid": "967cebc415ad9560dff8672bf968dfdd",
"score": "0.48617077",
"text": "def eta\n @origin = params[:origin]\n @destination = params[:destination]\n @key = ENV['MAPS_KEY']\n response = HTTParty.get('https://maps.googleapis.com/maps/api/distancematrix/json?origins=New+York&destinations=San+Francisco&mode=bicycling&language=en-EN&key='+@key)\n parsed_response = JSON.parse(response.body) \n render json: response\n end",
"title": ""
},
{
"docid": "258d55fabccc11a3ca4ca61aa1553e94",
"score": "0.4853704",
"text": "def index\n \tCongress.key = '0ef8e130fe124b69a2388d253fd05e63'\n \t@all_representatives = Congress.legislators(chamber: \"house\", per_page: \"all\")[\"results\"]\n end",
"title": ""
},
{
"docid": "f53478c78bfb65847a5452ef55a4e8ef",
"score": "0.48484224",
"text": "def transforms; end",
"title": ""
},
{
"docid": "15198e56e55b288a5f9e8a30943cc6a2",
"score": "0.48324797",
"text": "def show\n @transform = Transform.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @transform }\n end\n end",
"title": ""
},
{
"docid": "532c7af137953527ea0b643bb96696e9",
"score": "0.4814049",
"text": "def index\n\n @bookings = Booking.where(user_id: current_user.id)\n respond_to do |format|\n format.html \n format.json { render json: @bookings.map{|booking| booking.transform}}\n end\n end",
"title": ""
},
{
"docid": "ea2dd890cc2e0520dd1205f3cf8f46a5",
"score": "0.4813188",
"text": "def neckalace_energized_bor_x_transformer_params\n params.require(:neckalace_energized_bor_x_transformer).permit(:number, :mide, :mode_proof, :lost_mv)\n end",
"title": ""
},
{
"docid": "f7dc3c537bc4e9bc7e5c68d3a1431853",
"score": "0.4790204",
"text": "def index\n @transformer_items = TransformerItem.all\n end",
"title": ""
},
{
"docid": "4c773ef125dae3c1ac0d0e5441e66fb7",
"score": "0.47742116",
"text": "def index\n\t\t@title = \"Главная\"\n\t\t@flowers = Flower.all\n\n\t\t@parsed_data = {}\n\t\t@flowers.each do |flower|\n\t\t\tpoints = take_data(flower.cosmId)\n\t\t\t@parsed_data[flower.cosmId] = get_points(points)\n\t\tend\n\n\t\trespond_to do |format|\n\t\t\tformat.html # index.html.erb\n\t\t\tformat.json { render json: @flowers }\n\t\tend\n\tend",
"title": ""
},
{
"docid": "950285207e9cf7341e8f8880cf59f811",
"score": "0.4769936",
"text": "def index\n @cylinder_compressions = CylinderCompression.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @cylinder_compressions }\n end\n end",
"title": ""
},
{
"docid": "033cdc49a0b1f37c2b0c0c449f263a89",
"score": "0.47460616",
"text": "def index\n @birst_extract_groups = BirstExtractGroup.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @birst_extract_groups }\n end\n end",
"title": ""
},
{
"docid": "33ac7b7dc5ce1347c6ab27f74e166f57",
"score": "0.4743179",
"text": "def index\n @ezii_geminators = EziiGeminator.all\n end",
"title": ""
},
{
"docid": "9beb7be53eb5305c63284a0f0a9521ea",
"score": "0.4733811",
"text": "def transform\n end",
"title": ""
},
{
"docid": "3fe16723cfe073a33d3a2398f331e395",
"score": "0.4717523",
"text": "def transformations; end",
"title": ""
},
{
"docid": "3fe16723cfe073a33d3a2398f331e395",
"score": "0.4717523",
"text": "def transformations; end",
"title": ""
},
{
"docid": "adeaac99d298af1401254911c342cc8a",
"score": "0.4706582",
"text": "def get_outputs;\n\t\tfeed_forward\n\t\t@output.map{|o| o.calculate_output}\n\tend",
"title": ""
},
{
"docid": "f4ca0547452ce7a57641af4180ce5afe",
"score": "0.46606022",
"text": "def index #regular web request method\n @genomes = Genome.all\n @genomes.each do |gen|\n # gen.meta ? gen.meta = JSON::parse(\"#{gen.meta}\") : nil\n end\n respond @genomes\n end",
"title": ""
},
{
"docid": "e00d6543f7ef0f3b3a4286c4d0bb5482",
"score": "0.46591973",
"text": "def index\n @walkers = Walker.all\n\n render json: @walkers\n end",
"title": ""
},
{
"docid": "4a0b86af842083364d17d7895995e75d",
"score": "0.4657827",
"text": "def show\n @allele = Allele.find(\n params[:id],\n :include => [\n :genbank_file,\n { :targeting_vectors => :pipeline },\n { :es_cells => [ :pipeline, :es_cell_qc_conflicts ] }\n ]\n )\n @es_cells = @allele.es_cells.sort{ |a,b| a.name <=> b.name }\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @allele }\n format.json { render :json => @allele }\n end\n end",
"title": ""
},
{
"docid": "2c9f25e7c511393f6cff47d9f6fdd936",
"score": "0.46545568",
"text": "def index\n @nitrogens = Nitrogen.all\n render json: @nitrogens\n end",
"title": ""
},
{
"docid": "b6e57174cb69cb6659e2e5bb315caadc",
"score": "0.46531546",
"text": "def index\n beers = @beer.get_beers(beer_params.to_h, @current_user)\n\n render json: {\n status: beers[:status],\n beers: beers[:beers],\n errors: beers[:errors]\n }\n end",
"title": ""
},
{
"docid": "620145c671f37c091e2072f538599adc",
"score": "0.46527457",
"text": "def redeem_tokens\n @pie = Pie.find(params[:id])\n \n snap = YAML::load(@pie.uma_snapshot)\n \n snap[:net_collateral_adjustment] += params[:amount].to_i * MIN_COLLATERALIZATION\n @pie.update_attribute(:uma_snapshot, YAML::dump(snap))\n \n @collateralization, @progress_class, @total_value = @pie.compute_uma_collateralization\n \n respond_to do |format| \n format.js do\n render :json => {:collateralization => @collateralization,\n :progress_class => @progress_class,\n :adjustments => snap[:net_collateral_adjustment],\n :total_value => @total_value}\n end\n format.html { redirect_to root_path } \n end \n end",
"title": ""
},
{
"docid": "15c4b73e78c6bd54b29111b8a665450d",
"score": "0.46485117",
"text": "def converter_results; end",
"title": ""
},
{
"docid": "db7714abb849ebf9169b304663835d4d",
"score": "0.464644",
"text": "def transformation\n end",
"title": ""
},
{
"docid": "db7714abb849ebf9169b304663835d4d",
"score": "0.464644",
"text": "def transformation\n end",
"title": ""
},
{
"docid": "db7714abb849ebf9169b304663835d4d",
"score": "0.464644",
"text": "def transformation\n end",
"title": ""
},
{
"docid": "fd36ba09d2fc5364116454cc8bedc912",
"score": "0.46402568",
"text": "def index\n @mallet_runs = MalletRun.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @mallet_runs }\n end\n end",
"title": ""
},
{
"docid": "f02356041330b0d9f3a29c282921c7ba",
"score": "0.46385655",
"text": "def index\n @preprocess_algorithms = PreprocessAlgorithm.all\n end",
"title": ""
},
{
"docid": "c189c2e6e775c6b16e7d1ff5615bc477",
"score": "0.46352983",
"text": "def index\n @filberts = Filbert.all\n gon.gezuntas_sum = Filbert.sums_to_json\n end",
"title": ""
},
{
"docid": "fc5525c0bea7601c85adfaef7ea87c16",
"score": "0.4633775",
"text": "def index\n @convertors = Convertor.all\n end",
"title": ""
},
{
"docid": "04cbb3ea396a942a7ba551d364cd2783",
"score": "0.46189314",
"text": "def index\n @converters = Converter.all\n\n render json: @converters\n end",
"title": ""
},
{
"docid": "a15a58c34adcb3339818b116afdaf53f",
"score": "0.46130973",
"text": "def pipeline_by_stages\n render json: pipeline_by_stages_deals\n end",
"title": ""
},
{
"docid": "0bf1ee44778ff68e63fd48de498da4e9",
"score": "0.4602402",
"text": "def index\n @gunzerkers = Gunzerker.all\n end",
"title": ""
},
{
"docid": "21fbb37fe985be909935b8653532bf3d",
"score": "0.4595039",
"text": "def index\n @transport_canada_registrations = TransportCanadaRegistration.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @transport_canada_registrations }\n end\n end",
"title": ""
},
{
"docid": "fb1d422efac65334f05fff74cf4100cf",
"score": "0.45915028",
"text": "def index\n filters = params.merge(permitted_ensembles_only).slice(:permitted_ensembles_only, :search)\n @ensembles = Ensemble.filter(filters)\n .order('id, foundation_date')\n .includes(:ensemble_parent)\n .paginate(page: params[:page], per_page: 15)\n end",
"title": ""
},
{
"docid": "32c1ce24e89c3e09ba5944705d644653",
"score": "0.45829245",
"text": "def distribution\n respond_to do |format|\n format.json do\n @cached_map_type = params[:cached_map_type] || 'CachedMapItem::WebLevel1'\n @quicker_cached_map = @otu.quicker_cached_map(@cached_map_type)\n\n render json: { error: 'no map available'}, status: :not_found unless @quicker_cached_map.present? and return\n end\n\n format.geojson do\n end\n end\n end",
"title": ""
},
{
"docid": "74dfd66739d440d87ebb4cfe9f622695",
"score": "0.45826572",
"text": "def caverne\n self.class.get('/monstre_caverne.json')\n end",
"title": ""
},
{
"docid": "8d28a216218da3659458a0ca84ac44f6",
"score": "0.4579674",
"text": "def index\n respond_to do |format|\n format.html # index.html.erb\n format.xml # index.xml.builder\n format.json { render :json => ServiceCatalographer::Api::Json.index(\"agents\", json_api_params, @agents).to_json }\n end\n end",
"title": ""
},
{
"docid": "75e73f9b56d94b17da4cbdc510b485ae",
"score": "0.45795667",
"text": "def transform(transformation)\n end",
"title": ""
},
{
"docid": "9edbf6e4a934c68a6de08a9cc061ec2b",
"score": "0.45788652",
"text": "def index\n render json: Converter.all\n end",
"title": ""
},
{
"docid": "4006fa08304d12bd8567b97e3074a7e2",
"score": "0.45748395",
"text": "def index\n respond_to do |format|\n format.html { render 'application/cube_trainer' }\n format.json { render json: ModeType::ALL.map(&:to_simple) }\n end\n end",
"title": ""
},
{
"docid": "1ba7ac4d5283f45e70f1fd9a88983923",
"score": "0.457005",
"text": "def beers\n @brewery = Brewery.from_param params[:id]\n @beers = @brewery.beers\n\n respond_to do |format|\n format.json { render_for_api :brewery, :json => @beers }\n format.xml { render_for_api :brewery, :xml => @beers }\n end\n end",
"title": ""
},
{
"docid": "b45ff5fa3b9e0fb081019615b0632f5e",
"score": "0.45614144",
"text": "def update\n respond_to do |format|\n if @neckalace_energized_bor_h_transformer.update(neckalace_energized_bor_h_transformer_params)\n format.html { redirect_to @neckalace_energized_bor_h_transformer, notice: 'Neckalace energized bor h transformer was successfully updated.' }\n format.json { render :show, status: :ok, location: @neckalace_energized_bor_h_transformer }\n else\n format.html { render :edit }\n format.json { render json: @neckalace_energized_bor_h_transformer.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c0bd0a70ddb450acdfad1b139685e082",
"score": "0.45606652",
"text": "def destroy\n @neckalace_energized_bor_h_transformer.destroy\n respond_to do |format|\n format.html { redirect_to neckalace_energized_bor_h_transformers_url, notice: 'Neckalace energized bor h transformer was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "5cf3cd046c02c939a50d74956220622c",
"score": "0.45601267",
"text": "def transform(x)\n fit_transform(x)\n end",
"title": ""
},
{
"docid": "59ea932f4989f0e6076fde3a7dfc7423",
"score": "0.45553303",
"text": "def index\n @extractor_responses = ExtractorResponse.all\n end",
"title": ""
},
{
"docid": "bd73be884fd4c5fe3c1dcc45edc53118",
"score": "0.45426413",
"text": "def index\n @components_rear_brakes = Components::RearBrake.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @components_rear_brakes }\n end\n end",
"title": ""
},
{
"docid": "98b6061b9b0d4742c3216427581a510e",
"score": "0.45390403",
"text": "def index\n params[:page] ||= 1\n allele_params = setup_allele_search(params)\n @alleles = Allele.search( allele_params ).paginate(\n :page => params[:page],\n :select => \"distinct alleles.*\",\n :include => [ { :targeting_vectors => :pipeline }, { :es_cells => :pipeline } ]\n )\n mutational_drop_downs\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @alleles }\n format.json { render :json => @alleles }\n end\n end",
"title": ""
},
{
"docid": "beb5a0d08f4ec0992da309a31b7630d5",
"score": "0.45285577",
"text": "def index\n @renderers = Renderer.all\n end",
"title": ""
},
{
"docid": "beb5a0d08f4ec0992da309a31b7630d5",
"score": "0.45285577",
"text": "def index\n @renderers = Renderer.all\n end",
"title": ""
},
{
"docid": "8d191fc8fca089db7db9a6f1267e87be",
"score": "0.4527498",
"text": "def index\n @evaluators = Evaluator.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @evaluators }\n end\n end",
"title": ""
},
{
"docid": "658feef13794c2f290a70fb54984a528",
"score": "0.45250365",
"text": "def show\n\n render json: @racer\n end",
"title": ""
},
{
"docid": "3d8319bb320b79d4459043871b6cfc2d",
"score": "0.45242456",
"text": "def show\n @bone_marrow_transplantation = BoneMarrowTransplantation.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @bone_marrow_transplantation }\n end\n end",
"title": ""
},
{
"docid": "1c0ec9465e7eedd8a73bc73552455edb",
"score": "0.45218435",
"text": "def index\n @legs = Leg.all\n\n render json: @legs\n end",
"title": ""
},
{
"docid": "e176bbf807f993f7678b5b8a30f4c64e",
"score": "0.45209444",
"text": "def get_algorithm_subscripts\n algorithm = Algorithm.find(params[:id])\n jsonOutput = algorithm.subscripts.each_with_object([]) { |script, array| array << script.buildJSONNode }\n \n respond_to do |format|\n format.json { render json: jsonOutput }\n end\n end",
"title": ""
},
{
"docid": "39a5b86659efbd0dc8172162956ae572",
"score": "0.45171148",
"text": "def index\n allow :get\n expires_in 60.seconds\n\n nodes = @kavlan.nodes\n result = format_nodes(nodes)\n\n render_result(result)\n end",
"title": ""
},
{
"docid": "48356a2937f984bd1ec2e7fe7bc53a8e",
"score": "0.45152676",
"text": "def index\n @indexers = Indexer.all\n\n render json: @indexers\n end",
"title": ""
},
{
"docid": "464743ea476775f5341e2166615d8228",
"score": "0.45145106",
"text": "def index\n @q = Reserve.ransack(params[:q].try(:merge, m: params[:combinator]))\n @reserves = @q.result(distinct: true).page(params[:page]).per(16).order(id: :desc)\n respond_to do |format|\n format.html\n format.pdf do\n render pdf: \"reserves\",\n layout: 'pdf'\n end\n end\n end",
"title": ""
},
{
"docid": "b4671e182695b487ca3530758c8a7785",
"score": "0.45125753",
"text": "def source; @transformation.source; end",
"title": ""
},
{
"docid": "3653e73d2f1c499b4e2cc752dcc93e5a",
"score": "0.45029324",
"text": "def index\n @tranvia = Tranvium.all\n render :json => @tranvia\n end",
"title": ""
},
{
"docid": "59088fce8e4020bf1be4e8fce2a8117d",
"score": "0.44998953",
"text": "def index\n @birst_extract_group_collections = BirstExtractGroupCollection.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @birst_extract_group_collections }\n end\n end",
"title": ""
},
{
"docid": "df23fdfaf929b29ed2c3cb05f60e90a5",
"score": "0.44996604",
"text": "def index\n @generations = Generation.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @generations }\n end\n end",
"title": ""
},
{
"docid": "c0ef7fbf1dc95574d7a5d87b26ddbd8e",
"score": "0.44989562",
"text": "def index\n if params[:format].nil? or params[:format] == 'html'\n @iteration = params[:iteration][/\\d+/] rescue 1\n @ensembles = Ensemble.sorted_order(\"#{sort_column} #{sort_direction}\").search(params[:search]).paginate :page => params[:page]\n else\n @ensembles = Ensemble.api_search(params)\n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.js\n format.xml { render :xml => @ensembles }\n format.csv { render :csv => @ensembles }\n format.json { render :json => @ensembles }\n end\n end",
"title": ""
},
{
"docid": "a4f9290c37a61ecf8105b42660bd6368",
"score": "0.44987333",
"text": "def transform\n presets = NewsScraper.configuration.scrape_patterns['presets']\n transformed_response = presets.each_with_object({}) do |(data_type, preset_options), response|\n response[data_type] = preset_options.each_with_object({}) do |(option, scrape_details), data_type_options|\n data = parsed_data(scrape_details['method'].to_sym, scrape_details['pattern'])\n data_type_options[option] = scrape_details.merge('data' => data)\n end\n end\n transformed_response.merge('url' => @url, 'root_domain' => @root_domain)\n end",
"title": ""
},
{
"docid": "ecf067fe4f454bfafbf0b4585742c67d",
"score": "0.44963747",
"text": "def transient_es_heat_flux_amplification_vs_ky_graphkit\nend",
"title": ""
},
{
"docid": "2b569184b9b50b46e2ae0935da6dfd36",
"score": "0.449632",
"text": "def index\n respond_to do |format|\n format.html\n format.json\n format.json_api { render({ json: @nodes }.merge(api_collection_properties)) }\n end\n end",
"title": ""
},
{
"docid": "392919e0960363af9796218c7fb433fe",
"score": "0.44955686",
"text": "def get_taxon_assemblies\n @assemblies = []\n taxon = Taxon.find(params[:taxon])\n if taxon.present?\n @assemblies = taxon.genome_assemblies.map {|assembly| [assembly.name, assembly.id.to_s]}\n end\n render json: @assemblies\n end",
"title": ""
},
{
"docid": "392919e0960363af9796218c7fb433fe",
"score": "0.44955686",
"text": "def get_taxon_assemblies\n @assemblies = []\n taxon = Taxon.find(params[:taxon])\n if taxon.present?\n @assemblies = taxon.genome_assemblies.map {|assembly| [assembly.name, assembly.id.to_s]}\n end\n render json: @assemblies\n end",
"title": ""
},
{
"docid": "d98f638ea276403e83a0444433328761",
"score": "0.44952986",
"text": "def index\n @kardexes = Kardex.all\n end",
"title": ""
},
{
"docid": "d0916256ecd4b43a75a9523619491c93",
"score": "0.44934404",
"text": "def index\n @merk_cameras = MerkCamera.all\n end",
"title": ""
},
{
"docid": "e6d8a5a180d8a68d30616472d8a0535a",
"score": "0.44898143",
"text": "def index\n comptas = FactureVersement.all\n render json:{\n comptas:comptas\n }\n end",
"title": ""
},
{
"docid": "eb3b656a34b49912015887676977fd71",
"score": "0.44884637",
"text": "def transformations\n @transformations ||= []\n end",
"title": ""
},
{
"docid": "e5e7d6d5f101dbacf6cda666c18cc831",
"score": "0.4488148",
"text": "def index\n @nodes = Node.all\n\n respond_with ActiveModel::ArraySerializer.new(@nodes, each_serializer: NodeSerializer)\n end",
"title": ""
}
] |
87e212cc6bc6f9ccd2e270a7671a2e03 | match ip address prefixlist pre1 pre2 | [
{
"docid": "caa8df55923d7c857f6af75112443dcf",
"score": "0.66533726",
"text": "def match_ipv4_addr_prefix_list\n str = config_get('route_map', 'match_ipv4_addr_prefix_list', @get_args)\n str.empty? ? default_match_ipv4_addr_prefix_list : str.split\n end",
"title": ""
}
] | [
{
"docid": "d3a191a924ae398cf74224bc62cabf9d",
"score": "0.67726487",
"text": "def ip_match_func(*args)\n ip_match(args[0], args[1])\n end",
"title": ""
},
{
"docid": "d95439ad72b96d17a0fadee0e1d6f578",
"score": "0.6273555",
"text": "def match_ipv4_route_src_prefix_list\n str = config_get('route_map', 'match_ipv4_route_src_prefix_list',\n @get_args)\n str.empty? ? default_match_ipv4_route_src_prefix_list : str.split\n end",
"title": ""
},
{
"docid": "cd4cdea0dd84377764bc4431de8afebe",
"score": "0.62582976",
"text": "def ip_match(ip1, ip2)\n ip = IPAddr.new(ip1)\n network = IPAddr.new(ip2)\n network.include?(ip)\n rescue IPAddr::InvalidAddressError\n ip1 == ip2\n end",
"title": ""
},
{
"docid": "44fbc5b7acd151f499da9f648a852a46",
"score": "0.6181639",
"text": "def match_hostnames(mask, host)\n mask_pieces = (mask || '').split('.').reverse\n host_pieces = (host || '').split('.').reverse\n return 1 if mask && host && mask_pieces==host_pieces\n return 0 if match_pieces(mask_pieces, host_pieces, :ignore_depth => false)\n nil\n end",
"title": ""
},
{
"docid": "1074ae2c171a9a33df8ab0e23c6f3b69",
"score": "0.6147604",
"text": "def ip_prefix\n\t\t\t\t\t@ip && (@ip.to_s + (@prefix ? \"/#{@prefix}\" : \"\"))\n\t\t\t\tend",
"title": ""
},
{
"docid": "3e08f8bd4afcc78153d6fdfc5848a6d4",
"score": "0.6142884",
"text": "def match_ipv4_next_hop_prefix_list\n str = config_get('route_map', 'match_ipv4_next_hop_prefix_list',\n @get_args)\n str.empty? ? default_match_ipv4_next_hop_prefix_list : str.split\n end",
"title": ""
},
{
"docid": "28b31ef8869ba6440441b68a3a612af0",
"score": "0.6048945",
"text": "def scan_match_ipaddr\n if @ss.scan(/(\\d+\\.\\d+\\.\\d+\\.\\d+)\\s/)\n ## IP Address\n @line_queue.push [:IPV4_ADDR, @ss[1]]\n elsif @ss.scan(%r{(\\d+\\.\\d+\\.\\d+\\.\\d+)(/)(\\d+)\\s})\n ## IP Address of 'ip/mask' notation\n @line_queue.push [:IPV4_ADDR, @ss[1]]\n @line_queue.push ['/', @ss[2]]\n @line_queue.push [:NUMBER, @ss[3].to_i]\n end\n @ss.matched?\n end",
"title": ""
},
{
"docid": "52173c09d5d36dc354c4c1f20774a3b9",
"score": "0.5955251",
"text": "def server_prefix\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 11 )\n\n\n return_value = ServerPrefixReturnValue.new\n\n # $rule.start = the first token seen before matching\n return_value.start = @input.look\n\n\n root_0 = nil\n\n set39 = nil\n __IDENT40__ = nil\n\n\n tree_for_set39 = nil\n tree_for_IDENT40 = nil\n\n begin\n root_0 = @adaptor.create_flat_list\n\n\n # at line 114:17: ( 'ServerPrefix' | 'serverprefix' ) IDENT\n set39 = @input.look\n\n if @input.peek(1) == T__76 || @input.peek(1) == T__118\n @input.consume\n @adaptor.add_child( root_0, @adaptor.create_with_payload( set39 ) )\n\n @state.error_recovery = false\n\n else\n mse = MismatchedSet( nil )\n raise mse\n\n end\n\n\n __IDENT40__ = match( IDENT, TOKENS_FOLLOWING_IDENT_IN_server_prefix_332 )\n tree_for_IDENT40 = @adaptor.create_with_payload( __IDENT40__ )\n @adaptor.add_child( root_0, tree_for_IDENT40 )\n\n\n\n # - - - - - - - rule clean up - - - - - - - -\n return_value.stop = @input.look( -1 )\n\n\n return_value.tree = @adaptor.rule_post_processing( root_0 )\n @adaptor.set_token_boundaries( return_value.tree, return_value.start, return_value.stop )\n\n\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n return_value.tree = @adaptor.create_error_node( @input, return_value.start, @input.look(-1), re )\n\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 11 )\n\n\n end\n\n return return_value\n end",
"title": ""
},
{
"docid": "7edccb5628aa9903929580296f7bbbf3",
"score": "0.587837",
"text": "def find_good_ip_addr list\n list.each do |addr|\n triplets = addr.split('.')\n if not triplets[0].to_i == 255 and not triplets[2].to_i == 255\n return addr\n end\n end\n nil\nend",
"title": ""
},
{
"docid": "4853b27666075718198f3818801e1618",
"score": "0.58504415",
"text": "def url_ip_match(url_argument)\n ip_table = []\n n = 0\n until n == @data.length\n ip_table.push(@data[n + 1]) if url_argument == @data[n]\n n += 2\n end\n ip_table\n end",
"title": ""
},
{
"docid": "cbd551039a181da2018d333bf54e8095",
"score": "0.57975",
"text": "def match_prefix(word)\n #puts 'match_prefix'\n #p word\n prefixes = @prefixes.select{|prefix| prefix.first == word}\n return nil if prefixes.empty?\n prefixes = prefixes.map{|prefix| prefix.drop(1)}\n stage = prefixes.find{|prefix| prefix.empty?} ? :can_prefix : :on_prefix\n syn = self.clone(stage)\n syn.prefixes = Set.new(prefixes.select{|prefix| !prefix.empty?})\n syn.prefix_matched << word\n return syn\n end",
"title": ""
},
{
"docid": "aeebf20e8f53dff2e0e49efaa83c51a3",
"score": "0.573182",
"text": "def match_prefix(prefix, max_records = -1)\n req = [\n KT::KV.new(\"prefix\", prefix),\n KT::KV.new(\"max\", max_records.to_s)\n ]\n\n status, body = do_rpc(\"/rpc/match_prefix\", req)\n\n if status != 200\n raise_error(body)\n end\n\n res = []\n\n body.each do |kv|\n if kv.key.start_with?('_')\n res << kv.key[1, kv.key.size - 1]\n end\n end\n\n return res\n end",
"title": ""
},
{
"docid": "7c2042583f689177f492e3d127aed5ff",
"score": "0.5716689",
"text": "def supernet(new_prefix)\n if (new_prefix >= @prefix.num)\n return nil\n end\n\n if new_prefix < 0\n new_prefix = 0\n end\n\n # new_ip = @host_address.clone()\n # for _ in new_prefix..@prefix.num {\n # new_ip = new_ip << 1\n # }\n return from(@host_address, @prefix.from(new_prefix)).network()\n end",
"title": ""
},
{
"docid": "12d4627122eb3c1d61d5e843d299bfe9",
"score": "0.5708077",
"text": "def _prefix_eq(str1, str2)\n return nil, nil if str1.empty? || str2.empty?\n prefixes1 = @pdic.prefixes(str1)\n prefixes1.each {|p1| p2 = @dic[p1]; return p1, p2 if str2.start_with?(p2)}\n return str1[0], str2[0] if (str1[0] == str2[0])\n return nil, nil\n end",
"title": ""
},
{
"docid": "a0d38fbb7192a6c29e534fea7968502a",
"score": "0.56973845",
"text": "def prefix_match(buf)\n each_pair do | field, pattern |\n suffix_map = pattern.suffix_map\n pattern.prefix.each do | prefix_pattern |\n yield( field, prefix_pattern, suffix_map[prefix_pattern] ) if Pattern.prefix_match( prefix_pattern, buf )\n end\n end\n return self\n end",
"title": ""
},
{
"docid": "28c2ac996b12be9ef9d08da47308e9ae",
"score": "0.56754255",
"text": "def matches(address,target) \n count = 0\n i = j = 0\n while i < target.size and j < address.size\n if target[i] == address[j]\n count += 1 unless target[i] == '.'\n i += 1\n j += 1\n elsif target[i] == '.'\n i += 1\n elsif address[j] == '.'\n j += 1\n else\n break\n end\n end\n count\n end",
"title": ""
},
{
"docid": "eaff5d3eb26f2abb64936c06b7150459",
"score": "0.5647721",
"text": "def match(argv1)\n return nil unless argv1\n regex = %r{(?>\n access[ ]denied[.][ ]IP[ ]name[ ]lookup[ ]failed\n |access[ ]from[ ]ip[ ]address[ ].+[ ]blocked\n |all[ ]mail[ ]servers[ ]must[ ]have[ ]a[ ]PTR[ ]record[ ]with[ ]a[ ]valid[ ]Reverse[ ]DNS[ ]entry\n |blacklisted[ ]by\n |Blocked[ ]-[ ]see[ ]https://support[.]proofpoint[.]com/dnsbl-lookup[.]cgi[?]ip=.+\n |can[']t[ ]determine[ ]Purported[ ]Responsible[ ]Address\n |cannot[ ]resolve[ ]your[ ]address\n |client[ ]host[ ].+[ ]blocked[ ]using\n |client[ ]host[ ]rejected:[ ](?:\n Abus[ ]detecte[ ]GU_EIB_0[24] # SFR\n |cannot[ ]find[ ]your[ ]hostname # Yahoo!\n |may[ ]not[ ]be[ ]mail[ ]exchanger\n |was[ ]not[ ]authenticated # Microsoft\n )\n |confirm[ ]this[ ]mail[ ]server\n |connection[ ](?:\n dropped\n |refused[ ]by\n |reset[ ]by[ ]peer\n |was[ ]dropped[ ]by[ ]remote[ ]host\n )\n |Connections[ ](?:\n not[ ]accepted[ ]from[ ]IP[ ]addresses[ ]on[ ]Spamhaus[ ]XBL\n |will[ ]not[ ]be[ ]accepted[ ]from[ ].+because[ ]the[ ]ip[ ]is[ ]in[ ]Spamhaus's[ ]list\n )\n |domain[ ]does[ ]not[ ]exist:\n |domain[ ].+[ ]mismatches[ ]client[ ]ip\n |dns[ ]lookup[ ]failure:[ ].+[ ]try[ ]again[ ]later\n |DNSBL:ATTRBL\n |Dynamic/zombied/spam[ ]IPs[ ]blocked\n |Email[ ]blocked[ ]by[ ](?:\n .+[.]barracudacentral[.]org\n |SPAMHAUS\n )\n |Fix[ ]reverse[ ]DNS[ ]for[ ].+\n |Go[ ]away\n |hosts[ ]with[ ]dynamic[ ]ip\n |IP[ ]\\d{1,3}[.]\\d{1,3}[.]\\d{1,3}[.]\\d{1,3}[ ]is[ ]blocked[ ]by[ ]EarthLink # Earthlink\n |IP[/]domain[ ]reputation[ ]problems\n |is[ ](?:\n in[ ]a[ ]black[ ]list[ ]at[ ].+[.]spamhaus[.]org\n |not[ ]allowed[ ]to[ ]send[ ]mail[ ]from\n )\n |mail[ ]server[ ]at[ ].+[ ]is[ ]blocked\n |Messages[ ]from[ ].+[ ]temporarily[ ]deferred[ ]due[ ]to[ ]user[ ]complaints # Yahoo!\n |no[ ]access[ ]from[ ]mail[ ]server\n |No[ ]PTR[ ]Record[ ]found[.]\n |Not[ ]currently[ ]accepting[ ]mail[ ]from[ ]your[ ]ip # Microsoft\n |part[ ]of[ ]their[ ]network[ ]is[ ]on[ ]our[ ]block[ ]list\n |Please[ ]get[ ]a[ ]custom[ ]reverse[ ]DNS[ ]name[ ]from[ ]your[ ]ISP[ ]for[ ]your[ ]host\n |please[ ]use[ ]the[ ]smtp[ ]server[ ]of[ ]your[ ]ISP\n |Rejecting[ ]open[ ]proxy # Sendmail(srvrsmtp.c)\n |Reverse[ ]DNS[ ](?:failed|required)\n |Reverse[ ]DNS[ ]lookup[ ]for[ ]host[ ].+[ ]failed[ ]permanently\n |Server[ ]access[ ](?:\n .+[ ]forbidden[ ]by[ ]invalid[ ]RDNS[ ]record[ ]of[ ]your[ ]mail[ ]server\n |forbidden[ ]by[ ]your[ ]IP[ ]\n )\n |service[ ]permits[ ]\\d+[ ]unverifyable[ ]sending[ ]IPs\n |SMTP[ ]error[ ]from[ ]remote[ ]mail[ ]server[ ]after[ ]initial[ ]connection: # Exim\n |sorry,[ ](?:\n that[ ]domain[ ]isn'?t[ ]in[ ]my[ ]list[ ]of[ ]allowed[ ]rcpthosts\n |your[ ]remotehost[ ]looks[ ]suspiciously[ ]like[ ]spammer\n )\n |SPF[ ]record\n |SPF:[ ].+[ ]is[ ]not[ ]allowed[ ]to[ ]send[ ]mail.+[A-Z]{3}.+401\n |the[ ](?:email|domain|ip).+[ ]is[ ]blacklisted\n |This[ ]system[ ]will[ ]not[ ]accept[ ]messages[ ]from[ ]servers[/]devices[ ]with[ ]no[ ]reverse[ ]DNS\n |Too[ ]many[ ]spams[ ]from[ ]your[ ]IP # free.fr\n |unresolvable[ ]relay[ ]host[ ]name\n |Veuillez[ ]essayer[ ]plus[ ]tard.+[A-Z]{3}.+(?:103|510)\n |your[ ](?:\n network[ ]is[ ]temporary[ ]blacklisted\n |sender's[ ]IP[ ]address[ ]is[ ]listed[ ]at[ ].+[.]abuseat[.]org\n |server[ ]requires[ ]confirmation\n )\n |was[ ]blocked[ ]by[ ].+\n |we[ ]do[ ]not[ ]accept[ ]mail[ ]from[ ](?: # @mail.ru\n hosts[ ]with[ ]dynamic[ ]IP[ ]or[ ]generic[ ]dns[ ]PTR-records\n |dynamic[ ]ips\n )\n |http://www[.]spamcop[.]net/bl[.]\n )\n }xi\n\n return true if argv1 =~ regex\n return false\n end",
"title": ""
},
{
"docid": "aeb44b61170a937b76eee47331661ef3",
"score": "0.5615577",
"text": "def in_addresses(source_IP,dest_IP)\n addresses = [\"192.168.0.1\", \"192.168.0.2\", \"192.168.0.3\"]\n return addresses.include?(dest_IP.to_s) && addresses.include?(source_IP.to_s)\n end",
"title": ""
},
{
"docid": "ad8bcc417dde4c71b0f1a879f58a607d",
"score": "0.5603534",
"text": "def starts_with(prefix)\n ptr = @trie\n prefix.each_char do |char|\n ptr[char] ? ptr = ptr[char] : (return false)\n end\n true\n end",
"title": ""
},
{
"docid": "6adf7fb636363e14d107305eb325d65e",
"score": "0.5591381",
"text": "def prefix_regex( prefix, key_separator )\n /\\A(?<prefix>#{prefix}[#{key_separator}]*)(?<rest>.*)\\Z/i\n end",
"title": ""
},
{
"docid": "e2a7e8ea13725047011b2fbacb265b1e",
"score": "0.5574526",
"text": "def starts_with(prefix)\n \n end",
"title": ""
},
{
"docid": "1fcef693383b47d05b40056852e6e879",
"score": "0.5566539",
"text": "def key_starts_with(prefix); end",
"title": ""
},
{
"docid": "734d3df559f82659ecca3aad21a39cd9",
"score": "0.55579096",
"text": "def compile_start_with_re(prefixes)\n if prefixes.blank?\n /\\Z\\A/ # match nothing\n else\n /^(?:#{prefixes.map { |p| Regexp.escape(p) }.join('|')})/\n end\n end",
"title": ""
},
{
"docid": "15f5637b7b177aa57b8c5c771cb8d5e5",
"score": "0.55462134",
"text": "def match(argv1)\n return nil unless argv1\n regex = %r{(?>\n access[ ]denied[.][ ]IP[ ]name[ ]lookup[ ]failed\n |access[ ]from[ ]ip[ ]address[ ].+[ ]blocked\n |blacklisted[ ]by\n |Blocked[ ]-[ ]see[ ]https://support[.]proofpoint[.]com/dnsbl-lookup[.]cgi[?]ip=.+\n |can[']t[ ]determine[ ]Purported[ ]Responsible[ ]Address\n |cannot[ ]resolve[ ]your[ ]address\n |client[ ]host[ ].+[ ]blocked[ ]using\n |client[ ]host[ ]rejected:[ ](?:\n may[ ]not[ ]be[ ]mail[ ]exchanger\n |cannot[ ]find[ ]your[ ]hostname # Yahoo!\n |was[ ]not[ ]authenticated # Microsoft\n )\n |confirm[ ]this[ ]mail[ ]server\n |connection[ ](?:\n dropped\n |refused[ ]by\n |reset[ ]by[ ]peer\n |was[ ]dropped[ ]by[ ]remote[ ]host\n )\n |domain[ ]does[ ]not[ ]exist:\n |domain[ ].+[ ]mismatches[ ]client[ ]ip\n |dns[ ]lookup[ ]failure:[ ].+[ ]try[ ]again[ ]later\n |DNSBL:ATTRBL\n |Go[ ]away\n |hosts[ ]with[ ]dynamic[ ]ip\n |IP[ ]\\d{1,3}[.]\\d{1,3}[.]\\d{1,3}[.]\\d{1,3}[ ]is[ ]blocked[ ]by[ ]EarthLink # Earthlink\n |IP[/]domain[ ]reputation[ ]problems\n |is[ ]not[ ]allowed[ ]to[ ]send[ ]mail[ ]from\n |mail[ ]server[ ]at[ ].+[ ]is[ ]blocked\n |Messages[ ]from[ ].+[ ]temporarily[ ]deferred[ ]due[ ]to[ ]user[ ]complaints # Yahoo!\n |no[ ]access[ ]from[ ]mail[ ]server\n |Not[ ]currently[ ]accepting[ ]mail[ ]from[ ]your[ ]ip # Microsoft\n |Please[ ]get[ ]a[ ]custom[ ]reverse[ ]DNS[ ]name[ ]from[ ]your[ ]ISP[ ]for[ ]your[ ]host\n |please[ ]use[ ]the[ ]smtp[ ]server[ ]of[ ]your[ ]ISP\n |Rejecting[ ]open[ ]proxy # Sendmail(srvrsmtp.c)\n |sorry,[ ](?:\n that[ ]domain[ ]isn'?t[ ]in[ ]my[ ]list[ ]of[ ]allowed[ ]rcpthosts\n |your[ ]remotehost[ ]looks[ ]suspiciously[ ]like[ ]spammer\n )\n |SPF[ ]record\n |the[ ](?:email|domain|ip).+[ ]is[ ]blacklisted\n |unresolvable[ ]relay[ ]host[ ]name\n |your[ ](?:\n network[ ]is[ ]temporary[ ]blacklisted\n |server[ ]requires[ ]confirmation\n )\n |was[ ]blocked[ ]by[ ].+\n |we[ ]do[ ]not[ ]accept[ ]mail[ ]from[ ](?: # @mail.ru\n hosts[ ]with[ ]dynamic[ ]IP[ ]or[ ]generic[ ]dns[ ]PTR-records\n |dynamic[ ]ips\n )\n |http://www[.]spamcop[.]net/bl[.]\n )\n }xi\n\n return true if argv1 =~ regex\n return false\n end",
"title": ""
},
{
"docid": "41a2efd0554d5c1a9b4d6aba96b31371",
"score": "0.5545071",
"text": "def protocol_and_address\n self =~ AddressRegexp ? [$1, $2] : ['', self]\n end",
"title": ""
},
{
"docid": "f127c437b2209026bb1a94be7b5585fb",
"score": "0.554032",
"text": "def get_net_by_prefix(prefix,net_file)\n net = Array.new\n if prefix[0].split('/')[-1].to_i == 24\n net.push([prefix[0],prefix[1]])\n return net\n end\n hash_data = Hash.new\n \n files = Dir[net_file].sort\n\tfiles.each do |file|\n ipprefix = IPAddr.new(prefix[0])\n File.open(file).each_line do |line|\n # SKIP TO NEXT IF CORRUPT LINE OR COMMENT...\n \t\tnext if line =~ /#/ or line.size < 5\n \t\tdata = line.split(', ')\n \t\ttmp_net = IPAddr.new(data[1])\n \t\tif ipprefix.include?(tmp_net)\n \t\t hash_data[data[1]] = data[3].to_i\n \t end\n end\n end\n \n i=0\n data_sorted = hash_data.sort {|a,b| -1*(a[1]<=>b[1])}\t \n data_sorted.each do |prefix, severity|\n if i < 5\n\t net.push([prefix, severity])\n end\n i=i+1\n end\n return net\nend",
"title": ""
},
{
"docid": "0bc564697850b32776796d27e8d4a66e",
"score": "0.553456",
"text": "def starts_with(prefix)\n p = @trie\n prefix.each_char do |c|\n if p.include? c\n p = p[c]\n else\n return false\n end\n end\n true\n end",
"title": ""
},
{
"docid": "3af985ad8abdb89ba49e33c74304d36f",
"score": "0.5528714",
"text": "def prefix?(x, y)\n x.each_char.with_index do |char, index|\n return false unless char == y[index]\n end\n\n true\nend",
"title": ""
},
{
"docid": "9f9a51c6dafc78d5902b6f8360001ce5",
"score": "0.5522236",
"text": "def same_url_starter(string1, string2)\n n = 6 \n a = string1[0.. (string1.length-n)]\n b = string2[0.. (string2.length-n)]\n status = a.start_with?(b)\n return status\n end",
"title": ""
},
{
"docid": "6054b646e5ce8c09c8ad9fa729a010f4",
"score": "0.54967374",
"text": "def valid_ip_prefixes=(value)\n @children['valid-ip-prefixes'][:value] = value\n end",
"title": ""
},
{
"docid": "6054b646e5ce8c09c8ad9fa729a010f4",
"score": "0.54967374",
"text": "def valid_ip_prefixes=(value)\n @children['valid-ip-prefixes'][:value] = value\n end",
"title": ""
},
{
"docid": "bd27577e8f9f6e808520c586a77a6f6d",
"score": "0.5466351",
"text": "def starts_with(prefix)\n curr = @root\n prefix.each_char.all? do |char|\n curr = curr[char]\n end\n end",
"title": ""
},
{
"docid": "c5db915cf462789e21a4b221154d0fb3",
"score": "0.54582095",
"text": "def s2ip_with_prefix(ip)\n # Only works on buster and newer. In older debian-versions\n # there is no prefix-method for IPv4-addresses.\n addr = IPAddr.new(ip)\n \"#{addr}/#{addr.prefix}\"\n rescue IPAddr::InvalidAddressError\n ip\n end",
"title": ""
},
{
"docid": "718cf4e68083334d43ea4dc300ee4ecc",
"score": "0.5428782",
"text": "def prefix_regexp\n /^#{command_prefix}/\n end",
"title": ""
},
{
"docid": "9d3ef3acd6864db3c553610ff4dfce25",
"score": "0.5418491",
"text": "def starts_with(prefix)\r\n \r\n end",
"title": ""
},
{
"docid": "9a7b040acb24efff40e1d20e89db269c",
"score": "0.5416945",
"text": "def starts_with(s1, s2)\n if s1[0] == s2\n return true\n else\n return false\n end\nend",
"title": ""
},
{
"docid": "17c3205d34da4c692149ffc014901aba",
"score": "0.53800815",
"text": "def ips\n lines = read_file(\"/proc/net/fib_trie\")\n result = []\n previous_line = \"\"\n lines.each_line do |line|\n if line.include?(\"/32 host LOCAL\")\n previous_line = previous_line.split(\"-- \")[1].strip()\n if not result.include? previous_line\n result.insert(-1, previous_line)\n end\n end\n previous_line = line\n end\n return result\n end",
"title": ""
},
{
"docid": "31821edc724bedbf0ee5f5b27df14852",
"score": "0.5377613",
"text": "def prefixes; end",
"title": ""
},
{
"docid": "f465935128acdeb6fd3dfd576e4a8316",
"score": "0.5377471",
"text": "def prefix_parameters\n @prefix_parameters ||= prefix_source.scan(/:\\w+/).map { |key| key[1..-1].to_sym }.to_set\n end",
"title": ""
},
{
"docid": "f465935128acdeb6fd3dfd576e4a8316",
"score": "0.5377471",
"text": "def prefix_parameters\n @prefix_parameters ||= prefix_source.scan(/:\\w+/).map { |key| key[1..-1].to_sym }.to_set\n end",
"title": ""
},
{
"docid": "57dee27976eb55b9ec01247b02c10dff",
"score": "0.53752077",
"text": "def key_for(ip)\n [prefix, ip].join\n end",
"title": ""
},
{
"docid": "94cae0384c290be88098dea809872a7e",
"score": "0.53738743",
"text": "def ip_filter; end",
"title": ""
},
{
"docid": "a8eba0423e9e97d7d2bd55597be958de",
"score": "0.5370466",
"text": "def wildcard(ip)\n version = 4\n\n # do operations per version of address\n if (ip =~ /\\./ && ip !~ /:/)\n octets = []\n mask = 0\n\n ip.split('.').each do |x|\n if (x =~ /\\*/)\n break\n end\n octets.push(x)\n end\n\n octets.length.times do\n mask = mask << 8\n mask = mask | 0xff\n end\n\n until (octets.length == 4)\n octets.push('0')\n mask = mask << 8\n end\n ip = octets.join('.')\n\n elsif (ip =~ /:/)\n version = 6\n fields = []\n mask = 0\n\n raise ArgumentError, \"IPv6 encoded IPv4 addresses are unsupported.\" if (ip =~ /\\./)\n raise ArgumentError, \"Shorthand IPv6 addresses are unsupported.\" if (ip =~ /::/)\n\n ip.split(':').each do |x|\n if (x =~ /\\*/)\n break\n end\n fields.push(x)\n end\n\n fields.length.times do\n mask = mask << 16\n mask = mask | 0xffff\n end\n\n until (fields.length == 8)\n fields.push('0')\n mask = mask << 16\n end\n ip = fields.join(':')\n end\n\n # make & return cidr\n cidr = cidr_build( version, ip_str_to_int(ip,version), mask )\n\n return(cidr)\nend",
"title": ""
},
{
"docid": "575ed8e46d9cd3995b8aa7a19e3039f9",
"score": "0.5350507",
"text": "def pre_match; end",
"title": ""
},
{
"docid": "da48718b7955459e04b60fb52297d2a7",
"score": "0.53392196",
"text": "def _match_address(field, val, addresses)\n case val\n when String\n addresses.any?{|a| address_match?(a, val)}\n when Array\n overlap = []\n addresses.each do |a|\n val.each do |v|\n if address_match?(a, v)\n overlap << a \n end\n end\n end\n\n unless overlap.empty?\n @captures.concat(overlap)\n end\n when Regexp\n matched = false\n addresses.each do |v|\n if md = val.match(v)\n matched = true\n @captures.concat(md.captures)\n end\n end\n matched\n else\n unsupported_matcher(:field=>val)\n end\n end",
"title": ""
},
{
"docid": "dcd0115f35dc61a96a5165acb3253612",
"score": "0.5338736",
"text": "def ip_range2?(host)\n range2 = /^\\s*(?<start_ip_d1_3>#{Service.ip4_d1_3_regexp})\n (?<start_ip_d4>#{Service.ip4_d4_regexp})-\n (?<end_ip_d4>#{Service.ip4_d4_regexp})\n \\s*$/x\n .match(host)\n if range2\n range2[:start_ip_d4].to_i < range2[:end_ip_d4].to_i ? :valid : :invalid\n else\n false\n end\n end",
"title": ""
},
{
"docid": "1a7059cd9bcc442a53f6f1a56c51d41b",
"score": "0.5332701",
"text": "def subnet(subprefix)\n if (subprefix < @prefix.num || @ip_bits.bits < subprefix)\n return nil\n end\n\n ret = []\n net = network()\n net.prefix = net.prefix.from(subprefix)\n (1 << (subprefix - @prefix.num)).times do\n ret.push(net.clone())\n net = net.from(net.host_address, net.prefix)\n size = net.size()\n net.host_address = net.host_address.add(size)\n end\n\n return ret\n end",
"title": ""
},
{
"docid": "aefeaf1f1915970aade0f4f9fe99e653",
"score": "0.53299516",
"text": "def ip_range2_3?(host)\n range2_3 = /^\\s*(?<start_ip_d1_2>#{Service.ip4_d_regexp}).\n (?<start_ip_d2>#{Service.ip4_d_regexp})-\n (?<end_ip_d2>#{Service.ip4_d_regexp}).\n (?<start_ip_d3>#{Service.ip4_d_regexp})-\n (?<end_ip_d3>#{Service.ip4_d_regexp}).\n (?<start_ip_d4>#{Service.ip4_d4_regexp})-\n (?<end_ip_d4>#{Service.ip4_d4_regexp})\n \\s*$/x\n .match(host)\n if range2_3\n if range2_3[:start_ip_d4].to_i > range2_3[:end_ip_d4].to_i\n :invalid\n elsif range2_3[:start_ip_d3].to_i > range2_3[:end_ip_d3].to_i\n :invalid\n elsif range2_3[:start_ip_d2].to_i > range2_3[:end_ip_d2].to_i\n :invalid\n else\n :valid\n end\n else\n false\n end\n end",
"title": ""
},
{
"docid": "d9a08cae2b728e31ac08361da1ddadec",
"score": "0.5324527",
"text": "def starts_with(prefix)\n !!@trie.dig(*prefix.chars)\n end",
"title": ""
},
{
"docid": "1c29e88a411b267f5903a262eacff1b8",
"score": "0.53222805",
"text": "def valid_lookups\n street_lookups + ip_lookups\n end",
"title": ""
},
{
"docid": "7f1e4efdc2f55fa0bd7507807daeda0b",
"score": "0.53207874",
"text": "def common_prefix_search(word)\n word += @terminal.chr\n res = []\n base, check = @base[1], 1\n word.split('').each_with_index do |char, i|\n i, t = base+char[0], base+@terminal\n res << [-@base[t], i+1] if check == @check[t]\n break if !@base[i] || (@check[i] != check)\n \tbase, check = @base[i], i\n end\n res\n end",
"title": ""
},
{
"docid": "d23910467585d712f135b462d1e3f143",
"score": "0.5316384",
"text": "def route_regex(network, nat_server_ip)\n raise NotImplemented\n end",
"title": ""
},
{
"docid": "d23910467585d712f135b462d1e3f143",
"score": "0.5316384",
"text": "def route_regex(network, nat_server_ip)\n raise NotImplemented\n end",
"title": ""
},
{
"docid": "3d6ef964f495800776f2da8bb01bcfc1",
"score": "0.53143257",
"text": "def matches?(node)\n segments.empty? ||\n segments.any? do |s|\n if ipaddress?(s)\n s == node.public_ipv4\n elsif r = iprange(s)\n r.include?(node.public_ipv4)\n # elsif regex?(s)\n else\n s == node.public_hostname || s == node.public_hostname.sub(/\\..*/,'')\n end\n end\n end",
"title": ""
},
{
"docid": "21a5f3f2cb05e96ae5bcfb83176f8d1d",
"score": "0.5311389",
"text": "def _find_prefix(sock)\n\tend",
"title": ""
},
{
"docid": "adbf3e3ade67d25c38d78ff576f40b80",
"score": "0.53076476",
"text": "def custom_start_with_refined_v2(string, substring)\n string[0, substring.length] == substring ? true : false\nend",
"title": ""
},
{
"docid": "3a0159101f3be29b18d58d85c9708b3b",
"score": "0.5302867",
"text": "def ip2mac(prefix, str_ip)\n\t@mac=prefix\n\tstr_ip.split('.').each do |k|\n\t\tk=\"%02x\" % k\n\t\t@mac=@mac+\":\"+k.to_s\n\tend\n\treturn @mac\nend",
"title": ""
},
{
"docid": "3a0159101f3be29b18d58d85c9708b3b",
"score": "0.5302867",
"text": "def ip2mac(prefix, str_ip)\n\t@mac=prefix\n\tstr_ip.split('.').each do |k|\n\t\tk=\"%02x\" % k\n\t\t@mac=@mac+\":\"+k.to_s\n\tend\n\treturn @mac\nend",
"title": ""
},
{
"docid": "3a0159101f3be29b18d58d85c9708b3b",
"score": "0.5302867",
"text": "def ip2mac(prefix, str_ip)\n\t@mac=prefix\n\tstr_ip.split('.').each do |k|\n\t\tk=\"%02x\" % k\n\t\t@mac=@mac+\":\"+k.to_s\n\tend\n\treturn @mac\nend",
"title": ""
},
{
"docid": "8fe84078e2fa40f0580d62c60406ccfb",
"score": "0.5294322",
"text": "def nip_test(a_ip, b_ip)\n 0.upto(3) { |x| return false if (a_ip[x] != b_ip[x]) }\n true\n end",
"title": ""
},
{
"docid": "a1af249076bfec83bccb27320509509a",
"score": "0.52857995",
"text": "def dot_separated_ip_address?(input_string)\n if input_string.split('.', 4).last.include?('.')\n return false\n elsif input_string.count('.') < 3\n return false\n elsif input_string.split('.').join.to_i.to_s == input_string.split('.').join\n return true\n else\n return false\n end\n end",
"title": ""
},
{
"docid": "b8b52ccf9be6d129c660fd2bdeca2a2a",
"score": "0.5279779",
"text": "def parse_addr(range)\n\t\tif File.file? range and range[-4,4].eql? \".xml\"\n\t\t\ttemp_range = []\n\t\t\tNmap::XML.new(range) do |xml|\n\t\t\t\txml.each_host do |host|\n\t\t\t\t\t# Add hosts to array if 139 or 445 is open\n\t\t\t\t\tports_array = host.ports.map! {|port| port.to_i}\n\t\t\t\t\ttemp_range << host.to_s unless (ports_array & [139, 445]).empty?\n\t\t\t\tend\n\t\t\tend\n\t\t\t# No need to continue parsing, return array of hosts\n\t\t\treturn temp_range\n\t\telsif File.file? range\n\t\t\tcontents = File.read(range)\n\t\t\trange = contents.gsub(/\\n/, ' ')\n\t\tend\n\n\t\taddrs = Array.new\n\t\tbegin\n\t\t\trange.split(' ').each { |e| \n\t\t\t\te = e.chomp(',')\n\t\t\t\t# If CIDR\n\t\t\t\tif e =~ /\\/\\d{1,2}$/\n\t\t\t\t\tNetAddr::CIDR.create(e).enumerate.each {|i| addrs << i}\n\t\t\t\t# If 1.1.1.1-2.2.2.2\n\t\t\t\telsif e =~ /^([0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3})-([0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3})$/\n\t\t\t\t\tstart, fin = NetAddr::CIDR.create($1), NetAddr::CIDR.create($2)\n\t\t\t\t\t# Sanity check to make sure first address comes first\n\t\t\t\t\treturn nil if NetAddr.ip_to_i(start.to_s.chomp('/32')) > NetAddr.ip_to_i(fin.to_s.chomp('/32'))\n\t\t\t\t\t(start..fin).entries.each {|i| addrs << i.to_s.chomp('/32')}\n\t\t\t\t# If normal IP\n\t\t\t\telsif e =~ /^([0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3})$/\n\t\t\t\t\taddrs << e\n\t\t\t\telse\n\t\t\t\t# If nmap style\n\t\t\t\t\t# Add in combine for IP addresses\n\t\t\t\t\t# Enter target network range [192.168.0.0/24] : 1,2-3.1.1.1-5\n\t\t\t\t\t# [[\"1\", \"2\", \"3\"], [\"1\"], [\"1\"], [\"1\", \"2\", \"3\", \"4\", \"5\"]]\n\t\t\t\t\t# To list of IPs\n\t\t\t\t\tip_split = e.split('.')\n\t\t\t\t\treturn nil if ip_split.length != 4\n\n\t\t\t\t\t# Create arry of array, sub array contains all octet variants\n\t\t\t\t\tip_split.map! { |octet|\n\t\t\t\t\t\toctet = octet.split(',') \n\t\t\t\t\t\t# Remap octets to arraies of possible values\n\t\t\t\t\t\toctet.map! { |suboctet|\n\t\t\t\t\t\t\t# Transform any wildcards to numerical\n\t\t\t\t\t\t\tif suboctet.include?('*')\n\t\t\t\t\t\t\t\tsuboctet = '0-255'\n\t\t\t\t\t\t\tend\n\t\t\t\t\t\t\t# If octet contains a range\n\t\t\t\t\t\t\tif suboctet.include?('-')\n\t\t\t\t\t\t\t\t# Split and check if two numbers were given or implicit 0/255 given\n\t\t\t\t\t\t\t\tfirst, second = suboctet.split('-')\n\t\t\t\t\t\t\t\tfirst = 0 unless first\n\t\t\t\t\t\t\t\tsecond = 255 unless second\n\t\t\t\t\t\t\t\tfirst, second = first.to_i, second.to_i\n\t\t\t\t\t\t\t\t# Sanity check to make sure valid octet\n\t\t\t\t\t\t\t\treturn nil if first > second or not first.between?(0,255) or not second.between?(0,255)\n\t\t\t\t\t\t\t\tsuboctet = []\n\t\t\t\t\t\t\t\t# Create a range for octet possible values and add them to array\n\t\t\t\t\t\t\t\t(first..second).entries.each {|g| suboctet << g.to_s}\n\t\t\t\t\t\t\t\tsuboctet\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t# Hack to make it an array of 1 element\n\t\t\t\t\t\t\t\ttemp = suboctet\n\t\t\t\t\t\t\t\tsuboctet = []\n\t\t\t\t\t\t\t\tsuboctet << temp\n\t\t\t\t\t\t\tend\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t# Flatten any third level arrays to only array or array\n\t\t\t\t\tip_split.map! {|octet|\n\t\t\t\t\t\toctet.flatten!\n\t\t\t\t\t}\n\n\t\t\t\t\t# Create an address for each variant of octet\n\t\t\t\t\tip_split[0].each {|a|\n\t\t\t\t\t\tip_split[1].each {|b|\n\t\t\t\t\t\t\tip_split[2].each {|c|\n\t\t\t\t\t\t\t\tip_split[3].each {|d|\n\t\t\t\t\t\t\t\t\taddrs << \"#{a}.#{b}.#{c}.#{d}\"\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\tend\n\t\t\t}\n\t\trescue => e\n\t\t\tputs e\n\t\tend\n\t\treturn addrs\n\tend",
"title": ""
},
{
"docid": "853b239229a9309e8c3a4908a42386a6",
"score": "0.5276522",
"text": "def prefix\n return(0) if (@mask_addr == 0)\n length=32\n if (ipv6?)\n length=128\n end\n\n mask = nil\n netmask_int = @mask_addr\n if (netmask_int < 2**length)\n mask = length\n else\n mask = 128\n end\n\n mask.times do\n if ((netmask_int & 1) == 1)\n break\n end\n netmask_int = netmask_int >> 1\n mask = mask - 1\n end\n return(mask)\n end",
"title": ""
},
{
"docid": "10b462d10dda2b9e75f372fa391487a9",
"score": "0.52749926",
"text": "def nmap_scan?(payload)\n # case insensitive scan for any packet\n # payload containing signature \"Nmap...\"\n return payload.scan(/Nmap/).length > 0\nend",
"title": ""
},
{
"docid": "2c7e1f1427ec6df8d2de528cce7bea9f",
"score": "0.52591175",
"text": "def find_matches(prefix)\n \tlist = []\n\t@basicFoods.each {|food|\n\t\tif (food.name =~ /#{prefix}/) == 0\n\t\t\tlist.push(food)\n\t\tend }\n\t@recipes.each {|recipe|\n\t\tif (recipe.name =~ /#{prefix}/) == 0\n\t\t\tlist.push(recipe)\n\t\tend }\n\treturn list\n\t\n end",
"title": ""
},
{
"docid": "2d53e25ba857d3349f5711fd8b05963e",
"score": "0.525851",
"text": "def str_starts_with(str, prefix)\n prefix = prefix.to_s\n str[0, prefix.length] == prefix\n end",
"title": ""
},
{
"docid": "5458f7fe68e5a504dc8e0b6c6278608c",
"score": "0.5257912",
"text": "def network_contains_address(address_to_match, ipaddress, iface)\n if ( peer = network[\"interfaces\"][iface][\"addresses\"][ipaddress.to_s][:peer] )\n IPAddress(peer) == IPAddress(address_to_match)\n else\n ipaddress.include? IPAddress(address_to_match)\n end\n end",
"title": ""
},
{
"docid": "664dba7106bb9ff00fd408e688d6a268",
"score": "0.5248788",
"text": "def extract_prefix(name)\n return unless name and name.size > 1 and @prefix.nil? and @first.nil?\n Patterns::PREFIX.each_pair do |pretty, regex|\n if name.first =~ regex\n @prefix = pretty\n name.delete(name.first)\n return\n end\n end\n end",
"title": ""
},
{
"docid": "0a10dc97a805557efa3aad6af95989bd",
"score": "0.5244243",
"text": "def prefixes(str, length)\n result = []\n str_len = str.length\n str = str[0..length-1]\n\n raise Exception.new(\"match table length cannot exceeds string length\") if length > str_len\n\n (1..length-1).each do |len|\n result.push str[0..len-1]\n end\n\n result\nend",
"title": ""
},
{
"docid": "55e2ca6b358e15dc0f4fb4fcfc06ba99",
"score": "0.524",
"text": "def custom_start_with?(s,sbs)\n s[0, sbs.length] == sbs\nend",
"title": ""
},
{
"docid": "43193b5b4170c4c8ef70f186e6b4f995",
"score": "0.5237803",
"text": "def is_prefix astr, bstr\n return false if astr.nil? || bstr.nil? || astr.empty? || bstr.empty?\n astr == bstr.slice(0...astr.size)\nend",
"title": ""
},
{
"docid": "43193b5b4170c4c8ef70f186e6b4f995",
"score": "0.5237803",
"text": "def is_prefix astr, bstr\n return false if astr.nil? || bstr.nil? || astr.empty? || bstr.empty?\n astr == bstr.slice(0...astr.size)\nend",
"title": ""
},
{
"docid": "f3cef576c99a16e25d44b81c063535a8",
"score": "0.52337545",
"text": "def include?(oth)\n @prefix <= oth.prefix and network_u128 == self.class.new(oth.address+\"/#@prefix\").network_u128\n end",
"title": ""
},
{
"docid": "94a02dd5392630099dbb5679a345c3ec",
"score": "0.5231593",
"text": "def customer_ips\n a = (@ip_addr || IPAddr.new(\"#{address}/#{mask}\")).to_range\n if a.to_a.size <= 2 then\n return [a.first]\n end\n \n ar = a.to_a\n \n ar - [ar[0], ar[-1], ar[1]] # network-descr, broadcast and first ip\n end",
"title": ""
},
{
"docid": "76ebabbaaec07a2ee2ae09807d025c50",
"score": "0.52185255",
"text": "def test_prefix\n assert Exhibit.prefix(\"12\", 2, \"0\") == \"12\"\n assert Exhibit.prefix(\"12\", 3, \"0\") == \"012\"\n assert Exhibit.prefix(\"0\", 3, \"n\") == \"nn0\"\n end",
"title": ""
},
{
"docid": "81a914b845e6150a78e4b641708d478f",
"score": "0.521365",
"text": "def isIPv4Address(inputString)\n array = inputString.split(\".\")\n \n if array.count != 4\n return false\n end\n \n array.each do |word|\n if (\"0\"..\"255\").to_a.include?(word)\n else\n return false\n end\n end\n \n true\nend",
"title": ""
},
{
"docid": "7efbb2012800e1aa8d2f0446d75de503",
"score": "0.5205774",
"text": "def ipsBetween(start, ending)\n end_ip = calc_items(ending.split\".\")\n start_ip = calc_items(start.split\".\")\n end_ip.inject(:+) - start_ip.inject(:+)\nend",
"title": ""
},
{
"docid": "cf0ace74b4b149901df4ff72eebd9655",
"score": "0.520533",
"text": "def test_filter\n ip = '202.119.34.2'\n\n node1 = Model::Node.new\n addr1 = Model::NodeAddress.new\n addr1.public_ip = '202.119.25.12'\n node1.address = addr1\n\n node2 = Model::Node.new\n addr2 = Model::NodeAddress.new\n addr2.public_ip = '202.120.23.32'\n node2.address = addr2\n\n node3 = Model::Node.new\n addr3 = Model::NodeAddress.new\n addr3.public_ip = '56.119.34.111'\n node3.address = addr3\n\n node4 = Model::Node.new\n addr4 = Model::NodeAddress.new\n addr4.public_ip = '205.76.0.111'\n node4.address = addr4\n\n node5 = Model::Node.new\n addr5 = Model::NodeAddress.new\n addr5.public_ip = '215.108.92.111'\n node5.address = addr5\n\n nodes = [node1,node2,node3,node4,node5]\n nodes_sorted = [node1,node2,node4,node5,node3]\n\n strategy = Routing::IPPrefixStrategy.new\n nodes_ret = strategy.filter(ip,nodes,2)\n for i in 0...2\n assert_equal(nodes_sorted[i],nodes_ret[i])\n end\n\n nodes_ret = strategy.filter(ip,nodes,4)\n for i in 0...4\n assert_equal(nodes_sorted[i],nodes_ret[i])\n end\n end",
"title": ""
},
{
"docid": "83a5a7849d2e1f2f77b45dc418a4dd70",
"score": "0.5199426",
"text": "def match_ip_address(val)\n regexp = /^(\\d+)\\.(\\d+)\\.(\\d+)\\.(\\d+)$/\n match = regexp.match(val)\n error = false\n if match\n 1.upto(4) do |i|\n error = true unless (match[i].to_i >= 0 && match[i].to_i <= 255)\n end\n else\n error = true\n end\n error ? nil : match[0]\n end",
"title": ""
},
{
"docid": "d0f1507ca32bea10ecce36f9417bb1ed",
"score": "0.5198618",
"text": "def starts_with(prefix)\n search_word(prefix, true)\n end",
"title": ""
},
{
"docid": "35a3465e6dec010fbc898945dfa40b45",
"score": "0.5196893",
"text": "def starts_with(prefix)\n @trie.keys.each do |k|\n return true if k[0..prefix.length-1] == prefix\n end\n return false\n end",
"title": ""
},
{
"docid": "fb642f27b7f524d73176b483c86780a7",
"score": "0.51881444",
"text": "def user_prefix\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 12 )\n\n\n return_value = UserPrefixReturnValue.new\n\n # $rule.start = the first token seen before matching\n return_value.start = @input.look\n\n\n root_0 = nil\n\n set41 = nil\n __IDENT42__ = nil\n\n\n tree_for_set41 = nil\n tree_for_IDENT42 = nil\n\n begin\n root_0 = @adaptor.create_flat_list\n\n\n # at line 115:15: ( 'UserPrefix' | 'userprefix' ) IDENT\n set41 = @input.look\n\n if @input.peek(1) == T__78 || @input.peek(1) == T__131\n @input.consume\n @adaptor.add_child( root_0, @adaptor.create_with_payload( set41 ) )\n\n @state.error_recovery = false\n\n else\n mse = MismatchedSet( nil )\n raise mse\n\n end\n\n\n __IDENT42__ = match( IDENT, TOKENS_FOLLOWING_IDENT_IN_user_prefix_349 )\n tree_for_IDENT42 = @adaptor.create_with_payload( __IDENT42__ )\n @adaptor.add_child( root_0, tree_for_IDENT42 )\n\n\n\n # - - - - - - - rule clean up - - - - - - - -\n return_value.stop = @input.look( -1 )\n\n\n return_value.tree = @adaptor.rule_post_processing( root_0 )\n @adaptor.set_token_boundaries( return_value.tree, return_value.start, return_value.stop )\n\n\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n return_value.tree = @adaptor.create_error_node( @input, return_value.start, @input.look(-1), re )\n\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 12 )\n\n\n end\n\n return return_value\n end",
"title": ""
},
{
"docid": "0843378a840234b16bd7c00634d41ffe",
"score": "0.5184563",
"text": "def expand_nmap(arg)\n # Can't really do anything with IPv6\n return if arg.include?(\":\")\n\n # nmap calls these errors, but it's hard to catch them with our\n # splitting below, so short-cut them here\n return if arg.include?(\",-\") or arg.include?(\"-,\")\n\n bytes = []\n sections = arg.split('.')\n return unless sections.length == 4 # Too many or not enough dots\n\n sections.each { |section|\n if section.empty?\n # pretty sure this is an unintentional artifact of the C\n # functions that turn strings into ints, but it sort of makes\n # sense, so why not\n # \"10...1\" => \"10.0.0.1\"\n section = \"0\"\n end\n\n if section == \"*\"\n # I think this ought to be 1-254, but this is how nmap does it.\n section = \"0-255\"\n elsif section.include?(\"*\")\n return\n end\n\n # Break down the sections into ranges like so\n # \"1-3,5-7\" => [\"1-3\", \"5-7\"]\n ranges = section.split(',', -1)\n sets = []\n ranges.each { |r|\n bounds = []\n if r.include?('-')\n # Then it's an actual range, break it down into start,stop\n # pairs:\n # \"1-3\" => [ 1, 3 ]\n # if the lower bound is empty, start at 0\n # if the upper bound is empty, stop at 255\n #\n bounds = r.split('-', -1)\n return if (bounds.length > 2)\n\n bounds[0] = 0 if bounds[0].nil? or bounds[0].empty?\n bounds[1] = 255 if bounds[1].nil? or bounds[1].empty?\n bounds.map!{|b| b.to_i}\n return if bounds[0] > bounds[1]\n else\n # Then it's a single value\n bounds[0] = r.to_i\n end\n return if bounds[0] > 255 or (bounds[1] and bounds[1] > 255)\n return if bounds[1] and bounds[0] > bounds[1]\n if bounds[1]\n bounds[0].upto(bounds[1]) do |i|\n sets.push(i)\n end\n elsif bounds[0]\n sets.push(bounds[0])\n end\n }\n bytes.push(sets.sort.uniq)\n }\n\n #\n # Combinitorically squish all of the quads together into a big list of\n # ip addresses, stored as ints\n #\n # e.g.:\n # [[1],[1],[1,2],[1,2]]\n # =>\n # [atoi(\"1.1.1.1\"),atoi(\"1.1.1.2\"),atoi(\"1.1.2.1\"),atoi(\"1.1.2.2\")]\n addrs = []\n for a in bytes[0]\n for b in bytes[1]\n for c in bytes[2]\n for d in bytes[3]\n ip = (a << 24) + (b << 16) + (c << 8) + d\n addrs.push ip\n end\n end\n end\n end\n\n addrs.sort!\n addrs.uniq!\n\n rng = Range.new\n rng.options = { :ipv6 => false }\n rng.start = addrs[0]\n\n ranges = []\n 1.upto(addrs.length - 1) do |idx|\n if addrs[idx - 1] + 1 == addrs[idx]\n # Then this address is contained in the current range\n next\n else\n # Then this address is the upper bound for the current range\n rng.stop = addrs[idx - 1]\n ranges.push(rng.dup)\n rng.start = addrs[idx]\n end\n end\n rng.stop = addrs[addrs.length - 1]\n ranges.push(rng.dup)\n return ranges\n end",
"title": ""
},
{
"docid": "58a4a35796f22318ef529766e8a28444",
"score": "0.5166109",
"text": "def dot_separated_ip_address?(input_string)\n dot_separated_words = input_string.split(\".\")\n dot_separated_words.each do |word| # checks that each word is an ip number\n return false if is_an_ip_number?(word) != true\n end\n dot_separated_words.size == 4 ? true : false # checks that the address has 4 nums\nend",
"title": ""
},
{
"docid": "d9ccf3ca971827d08063d12e443eb0d1",
"score": "0.5155105",
"text": "def shorten(addr)\n\n # is this a string?\n if (!addr.kind_of? String)\n raise ArgumentError, \"Expected String, but #{addr.class} provided.\"\n end\n\n validate_ip_addr(:IP => addr, :Version => 6)\n\n # make sure this isnt already shorthand\n if (addr =~ /::/)\n return(addr)\n end\n\n # split into fields\n fields = addr.split(\":\")\n \n # check last field for ipv4-mapped addr\n if (fields.last() =~ /\\./ )\n ipv4_mapped = fields.pop()\n end\n \n # look for most consecutive '0' fields\n start_field,end_field = nil,nil\n start_end = []\n consecutive,longest = 0,0\n \n (0..(fields.length-1)).each do |x|\n fields[x] = fields[x].to_i(16)\n\n if (fields[x] == 0)\n if (!start_field)\n start_field = x\n end_field = x\n else\n end_field = x\n end\n consecutive += 1\n else\n if (start_field)\n if (consecutive > longest)\n longest = consecutive\n start_end = [start_field,end_field]\n start_field,end_field = nil,nil \n end\n consecutive = 0\n end\n end\n\n fields[x] = fields[x].to_s(16)\n end\n \n # if our longest set of 0's is at the end, then start & end fields\n # are already set. if not, then make start & end fields the ones we've\n # stored away in start_end\n if (consecutive > longest) \n longest = consecutive\n else\n start_field = start_end[0]\n end_field = start_end[1]\n end\n\n if (longest > 1) \n fields[start_field] = ''\n start_field += 1\n fields.slice!(start_field..end_field)\n end \n fields.push(ipv4_mapped) if (ipv4_mapped) \n short = fields.join(':') \n short << ':' if (short =~ /:$/)\n \n return(short)\nend",
"title": ""
},
{
"docid": "b316848cccb5cf190912ce3c925fd8bb",
"score": "0.51513135",
"text": "def next_addresses(start, how_many, ip2host)\n how_many = how_many.to_i\n ip = ip_addr\n raise \"Start IP (#{start}) out of range #{ip.inspect}\" unless ip.include?(start)\n start_ip = IPAddr.new(start)\n addresses = {}\n ip.to_range.each do |a|\n s = a.to_s\n addresses[s] = ip2host[s] unless a < start_ip or addresses.size >= how_many\n end\n addresses\n end",
"title": ""
},
{
"docid": "9ef24cb654a536d29bb6e0cd60e0f0fa",
"score": "0.5150744",
"text": "def ip_range2_2?(host)\n range2_2 = /^\\s*(?<start_ip_d1_2>#{Service.ip4_d1_2_regexp})\n (?<start_ip_d3>#{Service.ip4_d_regexp})-\n (?<end_ip_d3>#{Service.ip4_d_regexp}).\n (?<start_ip_d4>#{Service.ip4_d4_regexp})-\n (?<end_ip_d4>#{Service.ip4_d4_regexp})\n \\s*$/x\n .match(host)\n if range2_2\n if range2_2[:start_ip_d4].to_i > range2_2[:end_ip_d4].to_i\n :invalid\n elsif range2_2[:start_ip_d3].to_i > range2_2[:end_ip_d3].to_i\n :invalid\n else\n :valid\n end\n else\n false\n end\n end",
"title": ""
},
{
"docid": "3f959924f47c4ca1514cde2d2f32d506",
"score": "0.5150542",
"text": "def starts_with? prefix\n self[0...prefix.length] == prefix\n end",
"title": ""
},
{
"docid": "72e07a096e41af4b928eadcb5a5bf5dc",
"score": "0.5150337",
"text": "def prefix_lines(prefix)\n gsub(/^/) { prefix }\n end",
"title": ""
},
{
"docid": "ee8e60b63210af543803c899e21a6ee5",
"score": "0.5146304",
"text": "def extract_prefix(name)\n return unless name && name.size > 1 && @prefix.nil? && @first.nil?\n Nameable::Latin::Patterns::PREFIX.each do |pretty, regex|\n next unless name.first =~ regex\n @prefix = pretty\n name.delete(name.first)\n break\n end\n end",
"title": ""
},
{
"docid": "782733ec7bdff8992c775adf2a25007a",
"score": "0.5143751",
"text": "def dot_separated_ip_address?(input_string)\n dot_separated_words = input_string.split(\".\")\n return false unless dot_separated_words.size == 4\n x = 0\n while dot_separated_words.size > 0 do\n word = dot_separated_words.pop\n break unless is_an_ip_number?(word)\n x += 1\n end\n x == 4\nend",
"title": ""
},
{
"docid": "a5d32d0fea4c1a587685a759dea0d804",
"score": "0.5143651",
"text": "def starts_with(prefix)\n node = root\n prefix.chars.each do |char|\n if node[char]\n node = node[char]\n else\n return false\n end\n end\n true\n end",
"title": ""
},
{
"docid": "bbff94834d4e6c4fb8b949d16ec43c5a",
"score": "0.5142261",
"text": "def get_ip(log_entry)\n ip = /[0-255]{0.3}\\.[0-255]{0,3}\\.[0-255]{0,3}/\n return ip \nend",
"title": ""
},
{
"docid": "8b662974226d5da0b4d689a08ec831a2",
"score": "0.513814",
"text": "def dot_separated_ip_address?(input_string)\n dot_separated_words = input_string.split(\".\")\n return false if dot_separated_words.size != 4\n dot_separated_words.each do |num|\n return false if is_an_ip_number(num) == false\n end \n true\nend",
"title": ""
},
{
"docid": "3028eb9cf785b26e4c6de0d50f68c5c7",
"score": "0.5138083",
"text": "def pair_prefix pair\n lhs, rhs = pair.split('|')\n return '|' if lhs.length < 2\n lhs[0..(lhs.length - 2)] + '|' + rhs[0..rhs.length - 2]\nend",
"title": ""
},
{
"docid": "3999b9f0a2293381718734b09a35b5f5",
"score": "0.51340413",
"text": "def scan_spf(input)\n $ips.push(input.scan /(ip4:([^\\s]*))/)\n $ips.push(input.scan /(ip6:([^\\s]*))/)\n\n includes = input.scan /include:([^\\s]*)/\n includes.each do | incl |\n incl = incl[0].delete '\"'\n record = `dig TXT #{incl} +short`\n\n puts '-------------------'\n puts \"dig TXT #{incl} +short\"\n puts record\n\n scan_spf(record)\n end\nend",
"title": ""
},
{
"docid": "0bdc19343b63cee88f45e93934c3c8d6",
"score": "0.5128461",
"text": "def checkPrefixes(input, where)\n result = ''\n foundPrefixes = Props.select{ |item| item['name'] == where && item['prefixes'] }[0]\n if foundPrefixes\n foundPrefixes['prefixes'].each do |prefix|\n result << input.gsub(/(\\s*)(.+)/, $indent + prefix +'\\2') + \"\\n\"\n end\n result += $indent\n result.sub!(/^\\s+/,'')\n end\n result = input if result == ''\n return result\nend",
"title": ""
},
{
"docid": "65a36b186f0bb020df2a6c1e74724378",
"score": "0.5123771",
"text": "def include?(oth)\n @prefix <= oth.prefix and network_u32 == (oth.to_u32 & @prefix.to_u32)\n end",
"title": ""
},
{
"docid": "9e93dce72ad7142d739b976a0dab140a",
"score": "0.51215595",
"text": "def regexp\n @regexp ||= /(?<address>#{address_class.regexp})#{Regexp.escape(SEPARATOR)}(?<prefix_length>\\d+)/\n end",
"title": ""
},
{
"docid": "4647a372d5211103669c9c8df11c7fed",
"score": "0.5112713",
"text": "def dot_separated_ip_address?(input_string)\n dot_separated_words = input.string.split(\".\")\n return false unless dot_separated_words.length == 4\n\n for word in dot_separated_words\n return false unless is_an_ip_number?(word)\n end\n true\nend",
"title": ""
}
] |
b33e8ba043dc6a77b4423b3af67ae194 | Builds the object from hash | [
{
"docid": "6af36c72c40af81ba5386079e2148e16",
"score": "0.0",
"text": "def build_from_hash(attributes)\n return nil unless attributes.is_a?(Hash)\n self.class.swagger_types.each_pair do |key, type|\n if type =~ /\\AArray<(.*)>/i\n # check to ensure the input is an array given that the the attribute\n # is documented as an array but the input is not\n if attributes[self.class.attribute_map[key]].is_a?(Array)\n self.send(\"#{key}=\", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })\n end\n elsif !attributes[self.class.attribute_map[key]].nil?\n self.send(\"#{key}=\", _deserialize(type, attributes[self.class.attribute_map[key]]))\n end # or else data not found in attributes(hash), not an issue as the data can be optional\n end\n\n self\n end",
"title": ""
}
] | [
{
"docid": "da5b02ceb9bf503ea3a6f61c2d096a77",
"score": "0.80110514",
"text": "def build(hash)\n obj = new\n hash.each_pair do |k,v|\n obj[k] = v if variables[k]\n end\n return obj\n end",
"title": ""
},
{
"docid": "795e2d6be19d924e231b866fbebec323",
"score": "0.747102",
"text": "def build_from_hash(attributes)\n\n end",
"title": ""
},
{
"docid": "642a75510491269bb6bb2c0f3c018645",
"score": "0.74582314",
"text": "def build_from_hash(hash)\n instance = self.new\n\n # Add the instance attributes dynamically from the hash. If the attribute\n # does not already exist, then don't re-add the attribute class and\n # variable, just set it with the value from the hash\n hash.keys.each do |key|\n class_eval { attr_accessor key } unless instance.methods.include?(key.to_sym)\n instance.instance_variable_set \"@#{key}\", hash[key]\n end\n\n instance\n end",
"title": ""
},
{
"docid": "4148d6d2f35e17cd5e2402c995c65fbb",
"score": "0.72573453",
"text": "def build(hash, track_changes = true)\n resource = fields.each_with_object(new) do |field, r|\n value = hash.fetch(field.to_s, hash[field.to_sym])\n r.send(\"#{field}=\", value)\n end\n resource.clear_changes! unless track_changes\n resource\n end",
"title": ""
},
{
"docid": "e0bba473e844acb24bc2cbf33db7abd2",
"score": "0.7244652",
"text": "def initialize hash\n @hash = hash\n end",
"title": ""
},
{
"docid": "9e8acb0e990b4e8eeaec7fe39bf33f29",
"score": "0.700489",
"text": "def build(params)\n return new(params) if params.is_a?(Hash)\n raise(\"unexpected parameter, expected Hash, received #{params.class}\")\n end",
"title": ""
},
{
"docid": "35f6ab0bce4a46f7d106ed3b110d11f6",
"score": "0.69724077",
"text": "def initialize( hash )\n\t\t\t@hash = hash.dup\n\t\t\t@dirty = false\n\t\tend",
"title": ""
},
{
"docid": "93f5d97d6eb319a146f5bc65cdbf8c31",
"score": "0.6954805",
"text": "def initialize(a_hash)\n from_h(a_hash)\n end",
"title": ""
},
{
"docid": "308069d412c19a19caffcf9d49fe6012",
"score": "0.69449294",
"text": "def initialize\n\t\t\t@hash = {}\n\t\tend",
"title": ""
},
{
"docid": "edf630cffe3ac8cbc7e65c639930af3c",
"score": "0.6939366",
"text": "def initialize(hash)\n @hash = hash\n @converted = {}\n end",
"title": ""
},
{
"docid": "ffcc5a1dd10918a28449788c7474f49d",
"score": "0.69362134",
"text": "def initialize(hash)\n @short_code = hash[\"short_code\"]\n @name = hash[\"name\"]\n @id = hash[\"id\"]\n end",
"title": ""
},
{
"docid": "86f968aae1839618b4af728b3e7d1113",
"score": "0.69168746",
"text": "def initialize(hash)\n super(hash)\n end",
"title": ""
},
{
"docid": "3b886cdaee4a2c7f8867bada69cc6eb8",
"score": "0.68717015",
"text": "def initialize\n @h = new_hash\n end",
"title": ""
},
{
"docid": "b4db400cc8db7093f003c63b328146ad",
"score": "0.6796588",
"text": "def new_from_hash(hash)\n if hash == nil\n self.class.new.assign(self)\n else\n hash_obj = hash\n if hash.instance_of?(Hash)\n hash_obj = self.class.new\n merge_hash_into_object(hash, hash_obj)\n end\n instance = self.class.new\n object_assign(instance, hash_obj)\n end\n end",
"title": ""
},
{
"docid": "e2226d59fc661c90960b7919b761d425",
"score": "0.67824435",
"text": "def initialize(hash={})\n @hash = hash\n end",
"title": ""
},
{
"docid": "b76a2216b0f3a7876d85b3302e77976f",
"score": "0.675638",
"text": "def initialize\n @hash = {}\n end",
"title": ""
},
{
"docid": "b76a2216b0f3a7876d85b3302e77976f",
"score": "0.675638",
"text": "def initialize\n @hash = {}\n end",
"title": ""
},
{
"docid": "dcb273ed88575af7b0f0308f89b44a9b",
"score": "0.675574",
"text": "def initialize(hash)\r\n hash.each { |k, v|\r\n # Create getters and setters\r\n self.class.attr_accessor(k)\r\n # Set value for created variable\r\n self.send(\"#{k}=\", v)\r\n }\r\n self.class.all.push(self)\r\n end",
"title": ""
},
{
"docid": "8b3ee9b6195ae2997a954974736e1e99",
"score": "0.67515033",
"text": "def build!(hash)\n hash.must(::Hash) { raise ArgumentError, \"#{self} expects Hash, but got #{hash.class}\" }\n\n if hash.size != variables.size\n keys1 = variables.keys\n keys2 = hash.keys.map(&:to_s)\n minus = (keys1 - keys2).map{|i| \"-#{i}\"}\n plus = (keys2 - keys1).map{|i| \"+#{i}\"}\n \n msg = \"#{self} expects #{variables.size}, but got #{hash.size} (%s)\" % (minus + plus).join(\",\")\n raise Typed::SizeMismatch, msg\n end\n\n # 'build' just ignore unknown fields, but 'build!' raise errors\n obj = new\n hash.each_pair do |k,v|\n obj[k] = v\n end\n return obj\n end",
"title": ""
},
{
"docid": "1de2ef1e16610e7a67a1fe87c220dc4e",
"score": "0.6713604",
"text": "def initialize(hash)\n @cw_id = hash[\"cw_id\"]\n @cik = hash[\"cik\"]\n @name = hash[\"company_name\"]\n @irs_number = hash[\"irs_number\"]\n @sic_code = hash[\"sic_code\"]\n @industry = hash[\"industry_name\"]\n @sic_sector = hash[\"sic_sector\"]\n @sector_name = hash[\"sector_name\"]\n @source_type = hash[\"source_type\"]\n @address = hash[\"raw_address\"]\n @country = hash[\"country_code\"]\n @state = hash[\"subdiv_code\"]\n @top_parent_id = hash[\"top_parent_id\"]\n @num_parents = hash[\"num_parents\"]\n @num_children = hash[\"num_children\"]\n @max_year = hash[\"max_year\"]\n @min_year = hash[\"min_year\"]\n end",
"title": ""
},
{
"docid": "594b7fbcfa65b73a20a32891cd38b894",
"score": "0.6667577",
"text": "def from_hash(hash)\n instance = allocate\n instance.instance_variable_set :@attributes, hash.freeze\n instance\n end",
"title": ""
},
{
"docid": "deac5dc6fa5c5e7b80b0b5b6ce57dd7d",
"score": "0.6625414",
"text": "def from_hash(hash)\n hash = DEFAULTS.merge(hash)\n hash['spdx_id'] = hash.delete('spdx-id')\n ordered_array = hash.values_at(*members.map(&:to_s))\n new(*ordered_array)\n end",
"title": ""
},
{
"docid": "36d3df4818e3cb26ce3bf3bf3ce12847",
"score": "0.66123044",
"text": "def from_hash(hash)\n hash.each_pair do |key, value|\n\n # We need to catch hashes representing child objects\n # If the hash key:value is a of a Hash/BSON:Ordered hash\n if hash[key].class == Hash || hash[key].class == BSON::OrderedHash\n # If we have a classname we know we need to return to an object\n if hash[key][\"@classname\"]\n self.instance_variable_set(key, ::Object::full_const_get(hash[key][\"@classname\"]).new(hash[key])) unless key.to_s.start_with?(\"_\")\n else\n self.instance_variable_set(key, value) unless key.to_s.start_with?(\"_\")\n end\n else\n self.instance_variable_set(key, value) unless key.to_s.start_with?(\"_\")\n end\n end\n end",
"title": ""
},
{
"docid": "36d3df4818e3cb26ce3bf3bf3ce12847",
"score": "0.66123044",
"text": "def from_hash(hash)\n hash.each_pair do |key, value|\n\n # We need to catch hashes representing child objects\n # If the hash key:value is a of a Hash/BSON:Ordered hash\n if hash[key].class == Hash || hash[key].class == BSON::OrderedHash\n # If we have a classname we know we need to return to an object\n if hash[key][\"@classname\"]\n self.instance_variable_set(key, ::Object::full_const_get(hash[key][\"@classname\"]).new(hash[key])) unless key.to_s.start_with?(\"_\")\n else\n self.instance_variable_set(key, value) unless key.to_s.start_with?(\"_\")\n end\n else\n self.instance_variable_set(key, value) unless key.to_s.start_with?(\"_\")\n end\n end\n end",
"title": ""
},
{
"docid": "2b24002b0d44a166a61c44a7ab761c82",
"score": "0.6611738",
"text": "def initialize(hash=nil)\n @table = HashWithIndifferentAccess.new\n\n for k,v in hash\n @table[k] = v\n new_ostruct_member(k)\n end if hash\n end",
"title": ""
},
{
"docid": "08214ecc30b85c1c815edc660af833d9",
"score": "0.65913576",
"text": "def initialize(hash)\n @hash = hash\n @data = resourcify_data\n end",
"title": ""
},
{
"docid": "9f657d681695658b6684a535d474cade",
"score": "0.65719134",
"text": "def from_hash hash\n @id= hash['id']\n\n @admin= hash['admin']\n @username= hash['username']\n @timezone= hash['timezone']\n @email_address= hash['email_address']\n\n @password = nil\n\n @created_at= DateTime.parse(hash['created_at'])\n @updated_at= DateTime.parse(hash['updated_at'])\n end",
"title": ""
},
{
"docid": "2471c2f681ad433f0bf38237c07e2a84",
"score": "0.6547369",
"text": "def hash_to_obj hash\n OpenStruct.new(hash) rescue raise ConfigError, \"Can't convert setup to object\"\n end",
"title": ""
},
{
"docid": "8e1b037a73b6a889292b5bc368ad4016",
"score": "0.65255874",
"text": "def from_hash( h)\n\t\th.each { |name,attributes|\n\t\t\tklass = Klass.new\n\t\t\tklass.from_hash( { name => attributes } )\n\t\t\tself.add_class( klass)\n\t\t}\n\n\t\t# this is an experiment in handling \"through\" attributes\n\t\t# i.e. enriching the model with the join classes\n\tend",
"title": ""
},
{
"docid": "19fc6d45916d96b8cad2b820314d272d",
"score": "0.652408",
"text": "def initialize(hash)\n load_hash(hash)\n end",
"title": ""
},
{
"docid": "0901c4843702588e5a1a8eca17740d4c",
"score": "0.65129685",
"text": "def initialize(*args)\n super\n # hash = {}\n end",
"title": ""
},
{
"docid": "65d2b6277a5876655eea62a1f4301be1",
"score": "0.6503244",
"text": "def build_object(resp)\n return resp unless resp.respond_to?(:merge)\n @build_object ||= final_object_class.new(resp.merge(additional_hash_to_serialize_after_response))\n end",
"title": ""
},
{
"docid": "daa8820df279d3f92cca9812da39e13e",
"score": "0.6499963",
"text": "def from_hash(hash)\n ordered_array = hash.values_at(*members.map(&:to_s))\n new(*ordered_array)\n end",
"title": ""
},
{
"docid": "26d5d55a721fd89571c297041fa445b2",
"score": "0.6486435",
"text": "def __convert hash #:nodoc:\n instance = self.class.new\n hash.each do |k, v|\n k = k.to_s if !k.respond_to?(:to_sym) && k.respond_to?(:to_s)\n instance.new_ostruct_member k\n if v.is_a?(Hash)\n v = v[\"type\"] == \"hash\" ? v[\"contents\"] : __convert(v)\n elsif v.is_a?(Array)\n v = v.map{|e| e.instance_of?(Hash) ? __convert(e) : e}\n end\n instance.send \"#{k}=\".to_sym, v\n end\n instance\n end",
"title": ""
},
{
"docid": "72a6cde0b55bbf4f6b79487afde63087",
"score": "0.64839774",
"text": "def initialize(hash)\n\t\t@id = hash['id']\n\t\t@first_name = hash['first_name']\n\t\t@last_name = hash['last_name']\n\t\t@mentor = hash['mentor']\n\tend",
"title": ""
},
{
"docid": "63a0a7ebe5b5f250d4cc1419f4bb1905",
"score": "0.6476235",
"text": "def initialize(hash={})\n @name = validate_name(hash[:name])\n @description = hash[:description]\n @snmp_opts = hash[:snmp_opts]\n\n save # Save a copy of self to Redis on creation\n end",
"title": ""
},
{
"docid": "35a104299102ee5b6b6b98658a29cd95",
"score": "0.6458513",
"text": "def initialize\n @hash_dict = {}\n end",
"title": ""
},
{
"docid": "b44736e11832a0f3fdf5cab95150e785",
"score": "0.6454093",
"text": "def initialize(hash=nil)\n @attributes = hash\n @attributes ||= {}\n end",
"title": ""
},
{
"docid": "055c5e523a3b240421e2baebd56722c7",
"score": "0.6440544",
"text": "def initialize(hash={})\n self.init_attrs_from_hash(hash)\n end",
"title": ""
},
{
"docid": "7bcdba868bcd3e4865033e3aa494f83d",
"score": "0.64357966",
"text": "def from_hash(hash)\n apply_nested_hash(hash)\n end",
"title": ""
},
{
"docid": "6c57291c1cd1c90c23932a350c446f37",
"score": "0.64014035",
"text": "def initialize(hash)\n # @id = hash[\"id\"]\n # @street_address = hash[\"street_address\"]\n # @city = hash[\"city\"]\n # @state = hash[\"state\"]\n # @zipcode = hash[\"zipcode\"]\n # @country = hash[\"country\"]\n\n #add in correct details\n end",
"title": ""
},
{
"docid": "6a61e4c029093290c6921947b86de03f",
"score": "0.63992244",
"text": "def from_hash(hash)\n @data_object.user_acc_name = hash['user_acc_name']\n @data_object.user_affiliate = hash['user_affiliate']\n @user_over_13 = hash['user_over_13']\n\n contact.from_hash(hash)\n end",
"title": ""
},
{
"docid": "9a6a5b3931101985e9048b75b48cd65d",
"score": "0.6398281",
"text": "def initialize(hash)\n @name = hash[\"campaign\"] #decided to change it to \"name\" since this is the campaign class\n date_elements = hash[\"date\"].split(\"/\") #date is being passed in as a string, need this array to create the Date object in the next line\n @date = Date.new(date_elements[2].to_i + 2000, date_elements[0].to_i, date_elements[1].to_i) #added 2000 to year since the program was considering it as the year 15; this creates the date object\n @spend = hash[\"spend\"].to_f #use .to_f to make sure spend comes in as a float instead of a string\n @impressions = hash[\"impressions\"].to_i #need it as an integer for counting purposes later\n @actions = JSON.parse(hash[\"actions\"])#ensures that each action comes in as an array instead of a string\n @@all << self #shovels it into the all array\n end",
"title": ""
},
{
"docid": "49db2f1c927dc53551a32f83f627f1ca",
"score": "0.6391487",
"text": "def initialize(hash)\n hash.each do |k, v|\n self.send(\"#{k}=\", v) if self.respond_to?(\"#{k}=\")\n end\n @id = hash[\"id\"]\n end",
"title": ""
},
{
"docid": "d722d681bda6b668af187f65a4f666f8",
"score": "0.6371857",
"text": "def initialize (hash)\n hash.each {|key, value|\n self.class.attr_accessor(key)\n self.send((\"#{key}=\"), value)\n }\n @@all << self\n end",
"title": ""
},
{
"docid": "7ad0d039665d31c9492cf1212f38e5ed",
"score": "0.63622516",
"text": "def initialize(hash={})\n @data = Hash.new\n hash.each do |key, value|\n self[key] = value\n end\n end",
"title": ""
},
{
"docid": "cb6101270f632a546f16cc674f5cdb17",
"score": "0.6359784",
"text": "def create_from_hash(hash, opts={})\n create_opts = update_or_create_options(hash, opts)\n create { |instance| instance.set(create_opts) }\n end",
"title": ""
},
{
"docid": "161bf6ca7532ffaeb65f5b63a412020e",
"score": "0.63139087",
"text": "def initialize(hash={})\n # assign the attributes here (???)\n hash.each do |k, v| # name = id, name, etc.\n self.send(\"#{k}=\", v)\n # self.k = v # there's no '.k' method\n #binding.pry\n end\n end",
"title": ""
},
{
"docid": "9156d5fcefc85096d0aa315e35cb2001",
"score": "0.62966144",
"text": "def initialize(hash) #.new\n @name = hash[:name][0]\n @region = hash[:region]\n @population = hash[:population]\n @capital = hash[:capital]\n @flag_link = hash[:flag_link]\n @@all << self\n #binding.pry\n end",
"title": ""
},
{
"docid": "09860b52c433829ca8309ec7833567ed",
"score": "0.62927383",
"text": "def initialize( hash )\n\t\t@object_classes = self.parse_objectclasses( hash['objectClasses'] || [] )\n\t\t@attribute_types = self.parse_attribute_types( hash['attributeTypes'] || [] )\n\t\t@ldap_syntaxes = self.parse_ldap_syntaxes( hash['ldapSyntaxes'] || [] )\n\t\t@matching_rules = self.parse_matching_rules( hash['matchingRules'] || [] )\n\t\t@matching_rule_uses = self.parse_matching_rule_uses( hash['matchingRuleUse'] || [] )\n\tend",
"title": ""
},
{
"docid": "ba3414ed212977fb66cd2feeb262a974",
"score": "0.62926394",
"text": "def initialize(hash = {})\n super(hash)\n\n @action = extract_value(hash, :action)\n @clientId = extract_value(hash, :clientId)\n @clientIdAlias = extract_value(hash, :clientIdAlias)\n @clientIdAliasUsed = extract_boolean_value(hash, :clientIdAliasUsed)\n @expiresAt = extract_integer_value(hash, :expiresAt)\n @subject = extract_value(hash, :subject)\n @scopes = extract_value(hash, :scopes)\n @existent = extract_boolean_value(hash, :existent)\n @usable = extract_boolean_value(hash, :usable)\n @sufficient = extract_boolean_value(hash, :sufficient)\n @refreshable = extract_boolean_value(hash, :refreshable)\n @responseContent = extract_value(hash, :responseContent)\n @properties = extract_array_value(hash, :scopes) do |element|\n Authlete::Model::Property.parse(element)\n end\n end",
"title": ""
},
{
"docid": "2d868b9116b417ddced7cc594ce1dfb2",
"score": "0.6270927",
"text": "def objects_from_serialized_hash(hash) # :nodoc:\n klass, attributes = Helpers.to_class_and_attributes(hash)\n klass.from_seedable_attributes(attributes)\n end",
"title": ""
},
{
"docid": "40b3012826d289181b2141d02465f39f",
"score": "0.6269716",
"text": "def from_hash(hash)\n super(hash)\n verify\n end",
"title": ""
},
{
"docid": "cfbe692b72a53c8d6b2fcf846579e0a7",
"score": "0.6262924",
"text": "def initialize (hash)\n @name = hash [:name]\n @color = hash [:color]\n @robots = hash [:robots]\n @moon_count = hash [:moon_count]\n @cats = hash [:cats]\n #@solar_rotation = solar_rotation .....I dont really understand what a solar rotation is.... it's confusing.....\n @distance_from_the_sun = hash [:distance_from_the_sun]\n end",
"title": ""
},
{
"docid": "c49797348a5e101a0b5a8e14ead454ed",
"score": "0.62509763",
"text": "def initialize(hash = nil)\n @arguments = 0\n return if hash.nil?\n @name = hash['name']\n @arguments = hash['arguments']\n end",
"title": ""
},
{
"docid": "e86730cd710f9e0c56289c7a0147b005",
"score": "0.6250451",
"text": "def _from_hash(hsh)\n hsh.each do |k, v|\n v = restore_hash(v)\n v = v.map { |iv| restore_hash(iv) } if v.is_a?(Array)\n send(:\"#{k}=\", v)\n end\n self\n end",
"title": ""
},
{
"docid": "c7b36c4cf47254ff691242b0282d62e8",
"score": "0.6243596",
"text": "def from_hash(hash)\n struct = SparkleStruct.new\n struct._camel_keys_set(:auto_discovery)\n struct._load(hash)\n struct._camel_keys_set(nil)\n struct\n end",
"title": ""
},
{
"docid": "c7b36c4cf47254ff691242b0282d62e8",
"score": "0.6243596",
"text": "def from_hash(hash)\n struct = SparkleStruct.new\n struct._camel_keys_set(:auto_discovery)\n struct._load(hash)\n struct._camel_keys_set(nil)\n struct\n end",
"title": ""
},
{
"docid": "3df64a5d51ac9c929160272bb7d46e93",
"score": "0.6242702",
"text": "def initialize(hash={})\n self.attributes = hash\n end",
"title": ""
},
{
"docid": "a11999f644ca8a89d15495da1fd3a443",
"score": "0.62396324",
"text": "def initialize(raw_hash)\n if valid_hash?(raw_hash)\n self.replace(raw_hash)\n @version, @cost, @salt, @checksum = split_hash(self)\n else\n raise Errors::InvalidHash.new(\"invalid hash\")\n end\n end",
"title": ""
},
{
"docid": "a11999f644ca8a89d15495da1fd3a443",
"score": "0.6239517",
"text": "def initialize(raw_hash)\n if valid_hash?(raw_hash)\n self.replace(raw_hash)\n @version, @cost, @salt, @checksum = split_hash(self)\n else\n raise Errors::InvalidHash.new(\"invalid hash\")\n end\n end",
"title": ""
},
{
"docid": "d4206889cdb0f039d675f84b547fa2cd",
"score": "0.62316185",
"text": "def build(base, object, type = nil, selected_fields = nil)\n return object unless object.is_a?(Hash)\n if _loading?\n Factory.from_db(klass, object, nil, selected_fields)\n else\n Factory.build(klass, object)\n end\n end",
"title": ""
},
{
"docid": "f421b9de34cc3fb996287175c40f5087",
"score": "0.6229461",
"text": "def instantiate hash, extra_attributes={}\n return hash unless hash.kind_of? Hash\n# init = hash.values_at(*@singulars).compact.first\n init = hash[@singular]\n inits = hash[@plural]\n if init\n new init.merge extra_attributes\n elsif inits\n inits.map {|each| new each.merge extra_attributes}\n else\n hash\n end\n end",
"title": ""
},
{
"docid": "a6743ed42b1db4326117fc823a16e0e6",
"score": "0.62281525",
"text": "def initialize(hash)\n super(hash)\n @size = hash[\"size\"]\n end",
"title": ""
},
{
"docid": "8d05dffd521269f152f5c27f09a7d980",
"score": "0.6227675",
"text": "def initialize(raw_hash)\n if valid_hash?(raw_hash)\n self.replace(raw_hash)\n @cost, @salt, @digest = split_hash(self.to_s)\n else\n raise Errors::InvalidHash.new(\"invalid hash\")\n end\n end",
"title": ""
},
{
"docid": "6bf4c1077e210738bccaccb013f4b4d5",
"score": "0.6225517",
"text": "def from_hash(values)\n @data_object.team_challenge = values['team_challenge']\n @data_object.team_level = values['team_level']\n @data_object.team_name = values['team_name']\n\n# @mgr_email = values['mgr_email']\n\n names = values['tm_name']\n\n TeamMember::MEMBERS_PER_TEAM.times do |i|\n if names[i].empty?\n @members[i].clear\n else\n @members[i].tm_name = names[i]\n @members[i].tm_grade = values['tm_grade'][i].to_i\n @members[i].tm_dob_mon = values['tm_dob_mon'][i]\n @members[i].tm_dob_day = values['tm_dob_day'][i]\n @members[i].tm_dob_year = values['tm_dob_year'][i]\n @members[i].tm_sex = values['tm_sex'][i]\n end\n end\n end",
"title": ""
},
{
"docid": "05f465bb6a994caab702ea28df69e032",
"score": "0.6218999",
"text": "def hash\n { hash: @hash, hashType: @hash_type }\n end",
"title": ""
},
{
"docid": "62074474ab76d39a7e3abcc0fb96d2a8",
"score": "0.6217176",
"text": "def initialize(raw_hash)\n raise Errors::InvalidHash, 'invalid hash' unless valid_hash?(raw_hash)\n\n replace(raw_hash)\n\n @cost, @salt, @digest = split_hash(to_s)\n end",
"title": ""
},
{
"docid": "6be88f8fdb4bbefffbacfa0d68c0929a",
"score": "0.62103456",
"text": "def initialize( confighash={} )\n\t\tihash = internify_keys( untaint_values(confighash) )\n\t\tmergedhash = DEFAULTS.merge( ihash, &HashMergeFunction )\n\n\t\t@struct = ConfigStruct.new( mergedhash )\n\t\t@create_time = Time.now\n\t\t@name = nil\n\t\t@loader = nil\n\n\t\tsuper()\n\tend",
"title": ""
},
{
"docid": "d01eb7dde8298c18c7ec8f21423f29e0",
"score": "0.6208195",
"text": "def initialize(*args)\n @hash = HashWithIndifferentAccess.new(*args)\n end",
"title": ""
},
{
"docid": "0b4d8674627e2e321d3541de5dead033",
"score": "0.6203548",
"text": "def from_hash(hash:, klass:)\n validate_class_kit(klass)\n\n @hash_helper.indifferent!(hash)\n entity = klass.new\n attributes = @attribute_helper.get_attributes(klass)\n attributes.each do |attribute|\n key = attribute[:name]\n type = attribute[:type]\n\n #if the hash value is nil skip it\n next if hash[key].nil?\n\n value = if is_class_kit?(type)\n from_hash(hash: hash[key], klass: type)\n elsif type == Array\n hash[key].map do |array_element|\n if attribute[:collection_type].nil?\n array_element\n else\n if is_class_kit?(attribute[:collection_type])\n from_hash(hash: array_element, klass: attribute[:collection_type])\n else\n @value_helper.parse(type: attribute[:collection_type], value: array_element)\n end\n end\n end\n else\n hash[key]\n end\n\n entity.public_send(:\"#{key}=\", value)\n end\n\n entity\n end",
"title": ""
},
{
"docid": "c223280b1644aa166050ae79fa14d611",
"score": "0.62022763",
"text": "def create(hash={})\n model = self.new(hash)\n model.save\n model\n end",
"title": ""
},
{
"docid": "4dc9a09db883989922685244d8ae90d1",
"score": "0.61792797",
"text": "def from_h(hash, converter = nil)\n instance = new\n\n hash.each do |k, v|\n v = convert(v, k, converter) if converter\n instance.instance_variable_set(:\"@#{k}\", v)\n end\n\n instance\n end",
"title": ""
},
{
"docid": "948462c405e1284cbd4992ab34725625",
"score": "0.61663735",
"text": "def initialize(hash_that_represents_json)\n\t\t@data = hash_that_represents_json\n\tend",
"title": ""
},
{
"docid": "91b2f04d405c2ab87deea0910214fed5",
"score": "0.6160318",
"text": "def hash_for_merging(hash)\n new_hash = { id: hash['message_id'].to_i,\n date: Time.at(hash['date'].to_i),\n from: User.new(hash['from'], @bot),\n chat: Chat.new(hash['chat'], @bot) }\n\n type = TYPES.find { |t| hash[t.to_s] }\n new_hash[type] = hash[type.to_s] # TODO: fail if type not found\n\n new_hash\n end",
"title": ""
},
{
"docid": "1d9d592cd852629d8445b27281e1b834",
"score": "0.6139025",
"text": "def initialize(hash)\n @header = Msg::Header.new(hash)\n @body = Msg::Body.new(content_is_json?, hash)\n end",
"title": ""
},
{
"docid": "d32ca861779f404d12645e66598e61f0",
"score": "0.61276037",
"text": "def build_resource(hash = {})\n self.resource = resource_class.new(hash)\n end",
"title": ""
},
{
"docid": "f03257da25dc677d9fa4cff5f2724b89",
"score": "0.6114485",
"text": "def initialize()\n @hash = {}\n @values = []\n end",
"title": ""
},
{
"docid": "bf70827451a1dce765c010a7a7b33603",
"score": "0.6104965",
"text": "def build\n fail \"Please provide a value for key, currently: #{key}\" if key.nil?\n\n if in_key\n { in_key.to_sym => { key => data } }\n else\n process_data\n transform_to_hash\n end\n end",
"title": ""
},
{
"docid": "b131f69e018718787cd8ad0e485c54f7",
"score": "0.6097899",
"text": "def new_from_hash_marketplace(h)\n self.url = h\n h=h.split('/')\n h=h[h.size-2]\n self.original_id = h\n return self\n end",
"title": ""
},
{
"docid": "738373d48fb8eb82e5c09953fa47b44b",
"score": "0.60962373",
"text": "def initialize(build)\n @build = build\n @hash = {}\n @already_run = []\n end",
"title": ""
},
{
"docid": "efaaa5c24fc205ae0e1c83bb14b1de91",
"score": "0.60902405",
"text": "def initialize(hash, type, dump)\n self.hash = hash\n self.type = type.to_sym\n self.dump = dump\n end",
"title": ""
},
{
"docid": "be742141acb4726eee1db27f71f44e7f",
"score": "0.60629267",
"text": "def initialize(hash_data, opts: {})\n @hsh = hash_data\n @opts = opts\n\n @title = @hsh[:title]\n @body = @hsh[:body_hash]\n end",
"title": ""
},
{
"docid": "2b1fa688effb69a7ecfb1dfc90ee04db",
"score": "0.60617083",
"text": "def initialize(hash)\n @color = hash[:color]\n @scent = hash[:scent]\n end",
"title": ""
},
{
"docid": "4246d1d0f726fc73a117e053d0ffad09",
"score": "0.6059323",
"text": "def initialize(hash = nil)\n hash.each { |key, value| self[key] = value } if !hash.nil? && hash.is_a?(Hash)\n end",
"title": ""
},
{
"docid": "b2bc59ad23ad829fb37642ade3ab5754",
"score": "0.6057858",
"text": "def create(hash)\n NotImplementedError\n end",
"title": ""
},
{
"docid": "fefc3a7c0498cbbd595ac525100a3896",
"score": "0.6042505",
"text": "def from_h(hash, converter = nil)\n instance = new\n\n hash.each do |k, v|\n v = instance.convert(v, k, converter) if converter\n instance.send(:\"#{k}=\", v)\n end\n\n instance\n end",
"title": ""
},
{
"docid": "e9043339467b472af8c390b5bad5c665",
"score": "0.6039827",
"text": "def init_jaxb_json_hash(_o)\n super _o\n @id = String.from_json(_o['id']) unless _o['id'].nil?\n @version = String.from_json(_o['version']) unless _o['version'].nil?\n @description = String.from_json(_o['description']) unless _o['description'].nil?\n @url = String.from_json(_o['url']) unless _o['url'].nil?\n @name = String.from_json(_o['name']) unless _o['name'].nil?\n @organization = Org::Apache::Archiva::Metadata::Model::Organization.from_json(_o['organization']) unless _o['organization'].nil?\n @issueManagement = Org::Apache::Archiva::Metadata::Model::IssueManagement.from_json(_o['issueManagement']) unless _o['issueManagement'].nil?\n @scm = Org::Apache::Archiva::Metadata::Model::Scm.from_json(_o['scm']) unless _o['scm'].nil?\n @ciManagement = Org::Apache::Archiva::Metadata::Model::CiManagement.from_json(_o['ciManagement']) unless _o['ciManagement'].nil?\n if !_o['licenses'].nil?\n @licenses = Array.new\n _oa = _o['licenses']\n _oa.each { | _item | @licenses.push Org::Apache::Archiva::Metadata::Model::License.from_json(_item) }\n end\n if !_o['mailingLists'].nil?\n @mailingLists = Array.new\n _oa = _o['mailingLists']\n _oa.each { | _item | @mailingLists.push Org::Apache::Archiva::Metadata::Model::MailingList.from_json(_item) }\n end\n if !_o['dependencies'].nil?\n @dependencies = Array.new\n _oa = _o['dependencies']\n _oa.each { | _item | @dependencies.push Org::Apache::Archiva::Metadata::Model::Dependency.from_json(_item) }\n end\n @incomplete = Boolean.from_json(_o['incomplete']) unless _o['incomplete'].nil?\n end",
"title": ""
},
{
"docid": "be41322c5cfee02e86920b463c601957",
"score": "0.6035125",
"text": "def create_from_hash hash\n values = values_from_hash hash\n unless obj = find(:first, :conditions => values)\n return nil if values[:id]\n obj = create!(values)\n raise ArgumentError, \"#{obj.errors.to_s}\" unless obj.errors.empty?\n end\n obj\n end",
"title": ""
},
{
"docid": "ae4e1ab318c36238f44c6e25a054f8ff",
"score": "0.6035124",
"text": "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",
"title": ""
},
{
"docid": "83814efedaf863c51e51f7944edae6bd",
"score": "0.60301274",
"text": "def initialize result_hash={}\n @result_hash = result_hash\n end",
"title": ""
},
{
"docid": "41b09dd3a9b74b25bc4e57bcfc2db550",
"score": "0.60207087",
"text": "def create_hash(&block); end",
"title": ""
},
{
"docid": "41b09dd3a9b74b25bc4e57bcfc2db550",
"score": "0.60207087",
"text": "def create_hash(&block); end",
"title": ""
},
{
"docid": "7edd400a3d068783e8d8333427a4672e",
"score": "0.6017269",
"text": "def initialize(attrs={})\n from_hash(attrs)\n end",
"title": ""
},
{
"docid": "21eced573e2cd665e01a184c3bd85a38",
"score": "0.6015103",
"text": "def init_jaxb_json_hash(_o)\n @groupId = String.from_json(_o['groupId']) unless _o['groupId'].nil?\n @artifactId = String.from_json(_o['artifactId']) unless _o['artifactId'].nil?\n @version = String.from_json(_o['version']) unless _o['version'].nil?\n @packaging = String.from_json(_o['packaging']) unless _o['packaging'].nil?\n @className = String.from_json(_o['className']) unless _o['className'].nil?\n if !_o['repositories'].nil?\n @repositories = Array.new\n _oa = _o['repositories']\n _oa.each { | _item | @repositories.push String.from_json(_item) }\n end\n @bundleVersion = String.from_json(_o['bundleVersion']) unless _o['bundleVersion'].nil?\n @bundleSymbolicName = String.from_json(_o['bundleSymbolicName']) unless _o['bundleSymbolicName'].nil?\n @bundleExportPackage = String.from_json(_o['bundleExportPackage']) unless _o['bundleExportPackage'].nil?\n @bundleExportService = String.from_json(_o['bundleExportService']) unless _o['bundleExportService'].nil?\n @classifier = String.from_json(_o['classifier']) unless _o['classifier'].nil?\n @includePomArtifacts = Boolean.from_json(_o['includePomArtifacts']) unless _o['includePomArtifacts'].nil?\n @queryTerms = String.from_json(_o['queryTerms']) unless _o['queryTerms'].nil?\n @bundleImportPackage = String.from_json(_o['bundleImportPackage']) unless _o['bundleImportPackage'].nil?\n @bundleRequireBundle = String.from_json(_o['bundleRequireBundle']) unless _o['bundleRequireBundle'].nil?\n @pageSize = Fixnum.from_json(_o['pageSize']) unless _o['pageSize'].nil?\n @selectedPage = Fixnum.from_json(_o['selectedPage']) unless _o['selectedPage'].nil?\n end",
"title": ""
},
{
"docid": "311b85827b2c27fc7afe1e50a3512922",
"score": "0.6014436",
"text": "def build_request_data(hash)\n {\n :attributes! => {\n addressinfo: { \"xsi:type\" => \"ns2:Map\" },\n },\n username: @username,\n password: @password,\n addressinfo: {\n item: [\n { key: 'name', value: hash[:name] },\n { key: 'address1', value: hash[:address1] },\n { key: 'address2', value: hash[:address2] },\n { key: 'city', value: hash[:city] },\n { key: 'state', value: hash[:state] },\n { key: 'zip', value: hash[:zip] },\n { key: 'fflno', value: hash[:fflno] },\n { key: 'fflexp', value: hash[:fflexp] }\n ]\n },\n testing: @testing\n }\n end",
"title": ""
},
{
"docid": "e2797b9bb1f210b43530919bf60bd590",
"score": "0.6008681",
"text": "def initialize(order_hash)\n @id = order_hash['id']\n @number = order_hash['number']\n @special_instructions = order_hash['special_instructions']\n @total = order_hash['total']\n @total_quantity = order_hash['total_quantity']\n @created_at = order_hash['created_at']\n @updated_at = order_hash['updated_at']\n end",
"title": ""
},
{
"docid": "dbe8e8a723008579f6c9b98a83703c9d",
"score": "0.60038275",
"text": "def from_db_hash *args\n from_hash *args\n end",
"title": ""
},
{
"docid": "96d84704c2ead6d2326e6a56f16dd129",
"score": "0.6002642",
"text": "def build_from_hash(attributes)\n return nil unless attributes.is_a?(Hash)\n self.class.swagger_types.each_pair do |key, type|\n if type =~ /^Array<(.*)>/i\n if attributes[self.class.attribute_map[key]].is_a?(Array)\n self.send(\"#{key}=\", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )\n else\n #TODO show warning in debug mode\n end\n elsif !attributes[self.class.attribute_map[key]].nil?\n self.send(\"#{key}=\", _deserialize(type, attributes[self.class.attribute_map[key]]))\n else\n # data not found in attributes(hash), not an issue as the data can be optional\n end\n end\n\n self\n end",
"title": ""
},
{
"docid": "96d84704c2ead6d2326e6a56f16dd129",
"score": "0.6002642",
"text": "def build_from_hash(attributes)\n return nil unless attributes.is_a?(Hash)\n self.class.swagger_types.each_pair do |key, type|\n if type =~ /^Array<(.*)>/i\n if attributes[self.class.attribute_map[key]].is_a?(Array)\n self.send(\"#{key}=\", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )\n else\n #TODO show warning in debug mode\n end\n elsif !attributes[self.class.attribute_map[key]].nil?\n self.send(\"#{key}=\", _deserialize(type, attributes[self.class.attribute_map[key]]))\n else\n # data not found in attributes(hash), not an issue as the data can be optional\n end\n end\n\n self\n end",
"title": ""
},
{
"docid": "96d84704c2ead6d2326e6a56f16dd129",
"score": "0.6002642",
"text": "def build_from_hash(attributes)\n return nil unless attributes.is_a?(Hash)\n self.class.swagger_types.each_pair do |key, type|\n if type =~ /^Array<(.*)>/i\n if attributes[self.class.attribute_map[key]].is_a?(Array)\n self.send(\"#{key}=\", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )\n else\n #TODO show warning in debug mode\n end\n elsif !attributes[self.class.attribute_map[key]].nil?\n self.send(\"#{key}=\", _deserialize(type, attributes[self.class.attribute_map[key]]))\n else\n # data not found in attributes(hash), not an issue as the data can be optional\n end\n end\n\n self\n end",
"title": ""
}
] |
1e8943998199ff13b2ecece9d92ebc76 | Discard all commands issued after MULTI. Only call this method when `multi` was called without a block. | [
{
"docid": "432a772c6502878f50c8039955347de1",
"score": "0.5161621",
"text": "def discard; end",
"title": ""
}
] | [
{
"docid": "40d20d0e3d843ae701feabe4bf881025",
"score": "0.634083",
"text": "def cancel\n @multi.cancel!\n end",
"title": ""
},
{
"docid": "44ab25b0f8321c60c39ce63c9d12ab6b",
"score": "0.6199845",
"text": "def discard\n send_command([:discard])\n end",
"title": ""
},
{
"docid": "8b279e84dd0ee4994a5aaa2708fa62ee",
"score": "0.5986999",
"text": "def discard\n @args = nil\n @block = nil\n end",
"title": ""
},
{
"docid": "671d4de1182a12c419a550968e9ddd4c",
"score": "0.5935096",
"text": "def discard\n\t\t@cc.execution_queues.sync_synchronize(:EX) do\n\t\t\t@cc.execution_queues.delete(@id)\n\t\tend\n\t\t@queue.clear\n\t\t@queue = []\n\tend",
"title": ""
},
{
"docid": "3584283c80be3ef5c7be88a7899a4743",
"score": "0.593254",
"text": "def clear\n synchronize do\n @ignore.clear\n @process.clear\n end\n end",
"title": ""
},
{
"docid": "028f9161b8cde191373a6e5cd19d71f5",
"score": "0.59002",
"text": "def clear\n registered_commands.each(&:terminate)\n registered_commands.clear\n\n self\n end",
"title": ""
},
{
"docid": "26cc5d15904564a44d3200a497858f51",
"score": "0.588875",
"text": "def process_command_queue\n Rails.logger.silence(WARN) do\n PlayerCommand.flush_queue.each { |c| process_command c }\n end\n end",
"title": ""
},
{
"docid": "a4711ba007f2dac7c84200f4fbd0cb66",
"score": "0.5879227",
"text": "def unblock_command(cmd)\n self.blocked || return\n self.blocked.delete(cmd)\n end",
"title": ""
},
{
"docid": "17349e860c1518e8ee8af15fba1dbfd1",
"score": "0.5801799",
"text": "def quietly(*command)\n if buffer_stack == 0\n clear_buffer\n end\n set_buffer_stack buffer_stack + 1\n self.perform *command\n set_buffer_stack buffer_stack - 1\n buffer\n end",
"title": ""
},
{
"docid": "3704868906fb17df653c2c976dbb7268",
"score": "0.5725229",
"text": "def unblock_command(cmd)\n\t\tself.blocked || return\n\t\tself.blocked.delete(cmd)\n\tend",
"title": ""
},
{
"docid": "6b28c1dd2cb00b5ba7e309ec6497425f",
"score": "0.57203126",
"text": "def cleanup\n keys = redis.keys(raw_data_key('*')) + redis.keys(data_key('*'))\n multi do\n keys.each{|key| redis.del(key)}\n end\n super\n end",
"title": ""
},
{
"docid": "c32639906b58ea91aa0dcabc26173bf2",
"score": "0.5684683",
"text": "def no_commands\n @no_commands = true\n yield\n ensure\n @no_commands = false\n end",
"title": ""
},
{
"docid": "a300cd57c9c5d882a00d19672f8381f1",
"score": "0.568411",
"text": "def discard\n redis.discard\n end",
"title": ""
},
{
"docid": "91c325da3a803fb6a1e6b0f36538513b",
"score": "0.568214",
"text": "def discard_results\n self.current.discard = true if current\n end",
"title": ""
},
{
"docid": "91c325da3a803fb6a1e6b0f36538513b",
"score": "0.568214",
"text": "def discard_results\n self.current.discard = true if current\n end",
"title": ""
},
{
"docid": "522f3db31555e1409178379754c01863",
"score": "0.5651933",
"text": "def unexecute\n end",
"title": ""
},
{
"docid": "b4a034a879d6e4a1f2d6c36c9048415f",
"score": "0.56362534",
"text": "def cleanup_command #:nodoc:\n noop\n end",
"title": ""
},
{
"docid": "b4a034a879d6e4a1f2d6c36c9048415f",
"score": "0.56362534",
"text": "def cleanup_command #:nodoc:\n noop\n end",
"title": ""
},
{
"docid": "7fbcccb5b02ebef6785630b33f0c7734",
"score": "0.56307477",
"text": "def removeAll()\n if @stmt.nil?\n raise CliError, \"ResultSet was aleady closed\"\n end\n if @stmt.con.nil? \n raise CliError, \"Statement was closed\"\n end\n if !@stmt.for_update\n raise CliError, \"Updates not allowed\"\n end\n @stmt.con.sendReceiveCommand(Connection::CliCmdRemove, @stmt.stmt_id)\n end",
"title": ""
},
{
"docid": "281534a28fd488ea4ab87e988ea8b1d2",
"score": "0.562124",
"text": "def cleanup_command\n noop\n end",
"title": ""
},
{
"docid": "f1686b2abc5ab3637103324d056648a5",
"score": "0.56105304",
"text": "def clearCommands\n @commands = nil\n end",
"title": ""
},
{
"docid": "b0f52cda89254bde93430771f036a292",
"score": "0.5596163",
"text": "def safe_multi(&block)\n safe { redis.multi(&block) }\n end",
"title": ""
},
{
"docid": "47378b663843e74aa1cdf3f9c050e3e6",
"score": "0.55797726",
"text": "def clear_batch\n check_closed\n\n if @bstmt\n @bstmt.clear_batch\n @spool.give @bstmt\n @bstmt = nil\n end\n\n @pstmts.each do |stmt|\n stmt.clear_batch\n end\n end",
"title": ""
},
{
"docid": "e6672e24111f509d32e35d2178a50eaa",
"score": "0.55751747",
"text": "def no_commands(&block); end",
"title": ""
},
{
"docid": "c90d2b17c100c8af182f7389eb5799ea",
"score": "0.55402994",
"text": "def no_commands\n @no_commands = true\n yield\n ensure\n @no_commands = false\n end",
"title": ""
},
{
"docid": "dd19170d7b9bf02842416cdcc3cbadb7",
"score": "0.55366033",
"text": "def stop_all_processors\n @consumers&.each(&:signal_stop)\n @consumers&.each(&:stop)\n @consumers = nil\n @reply_consumer&.stop\n @reply_consumer = nil\n end",
"title": ""
},
{
"docid": "cd9cb9df89eddd941b975ee52d4d3e3c",
"score": "0.5494103",
"text": "def clear\n @commands.clear\n nil\n end",
"title": ""
},
{
"docid": "9934f5d984462c4df220f0ee9f3dc387",
"score": "0.5488282",
"text": "def discard\n end",
"title": ""
},
{
"docid": "53ccea34429e0096dc795c1bb1e7937c",
"score": "0.5486333",
"text": "def de_queue()\n \n end",
"title": ""
},
{
"docid": "cdb91694931204bfa5ba0b3cb947dd1a",
"score": "0.5450181",
"text": "def make_unprocessed\n self.plays.destroy_all\n self.messages.destroy_all\n self.update_attribute(:processing_state, Processable::NOT_PROCESSED)\n end",
"title": ""
},
{
"docid": "075c98428f4144cf8d6d9f17e848f653",
"score": "0.54210323",
"text": "def silent_clear\n @client.job.list(\"^#{job_prefix}\").each do |full_job_name|\n @client.job.delete(full_job_name)\n end\n end",
"title": ""
},
{
"docid": "14d4e9be8b1a97bf7e1c23477cc88bab",
"score": "0.53803194",
"text": "def clear_last_command!\n @last_command = nil\n end",
"title": ""
},
{
"docid": "99ed5a76714e61911c17c6d2217565a3",
"score": "0.5372014",
"text": "def reset(&block)\n old_commands = commands\n @commands = CommandSet.new\n old_commands.join(&block)\n end",
"title": ""
},
{
"docid": "e6b1e90ba9ba69cdbd21a160d3c2b8db",
"score": "0.5370035",
"text": "def clear\n @result = \"\"\n queue.clear\n pipeline.pause\n end",
"title": ""
},
{
"docid": "d33f2a8159822cc01e6d7bc9df64a40e",
"score": "0.5369786",
"text": "def cleanup_commands\n @cleanup_commands ||= []\n end",
"title": ""
},
{
"docid": "953e167df1aadd89c32db0aa5fe28050",
"score": "0.53528404",
"text": "def clear\r\n @commands.clear\r\n nil\r\n end",
"title": ""
},
{
"docid": "a4cd0c2ee52eaae36623bd3f4523ef54",
"score": "0.5346142",
"text": "def stop\n @commands_and_opts.unshift COMMANDS[:stop]\n include_multiple_commands?\n self\n end",
"title": ""
},
{
"docid": "29b013c647bb22466756661419058d47",
"score": "0.533819",
"text": "def discard_transaction!\n transactions.dup.each(&:discard_transaction!)\n discard_transaction\n end",
"title": ""
},
{
"docid": "af7d57451005f6336acf7a07264ce6dc",
"score": "0.5335238",
"text": "def prune!\n part = self.queue.slice!(0, 10)\n ::Jimson::Client.batch(client) do |batch_client|\n part.each do |element|\n element.perform!(batch_client)\n end\n end.collect { |response| self.responses << response }\n end",
"title": ""
},
{
"docid": "07af9a0808960fe2be39292257df90e7",
"score": "0.53250074",
"text": "def clear\n @cmds.clear\n end",
"title": ""
},
{
"docid": "5440e12ea3440ace4a547a535a640250",
"score": "0.53203905",
"text": "def clear\n redis.multi do\n redis.del(@key)\n redis.rpush(@key, '*')\n end\n end",
"title": ""
},
{
"docid": "54a7160c90f3d64236e0f87c22691d59",
"score": "0.53197986",
"text": "def blocking_receive\n @messages.pop\n end",
"title": ""
},
{
"docid": "cdb9ed4d35e9ef07dbbed4a779595464",
"score": "0.53193647",
"text": "def cancel_all\n @queries.each do |query|\n cancel_query(query)\n end\n @queries.clear\n end",
"title": ""
},
{
"docid": "afd14f3af699f5fd8e2eff4a0c28394f",
"score": "0.53085864",
"text": "def clear\n client.tubes.watch!(self.name)\n %w(delayed buried ready).each do |state|\n while job = self.peek(state.to_sym)\n begin\n job.delete\n rescue Beaneater::UnexpectedResponse, Beaneater::NotFoundError\n # swallow any issues\n end\n end\n end\n client.tubes.ignore(name)\n rescue Beaneater::NotIgnoredError\n # swallow any issues\n end",
"title": ""
},
{
"docid": "c110ece10853b897ac0b0c2b424f3a73",
"score": "0.5304897",
"text": "def discard\n @mode = :discard\n self\n end",
"title": ""
},
{
"docid": "b6bb47b5cd35519972ee08501b8dabf2",
"score": "0.52836025",
"text": "def discard\n worker.discard if !configuration.disabled\n end",
"title": ""
},
{
"docid": "834bab8ce1966ceb626268837119dceb",
"score": "0.5275184",
"text": "def discard_after_delete\n @discard_after_delete\n end",
"title": ""
},
{
"docid": "4fbf640616d2243936d96ec0e33a2354",
"score": "0.52632385",
"text": "def multi(&block)\n if block_given?\n deprecation_displayed = false\n if block&.arity == 0\n Pipeline.deprecation_warning(\"multi\", Kernel.caller_locations(1, 5))\n deprecation_displayed = true\n end\n\n synchronize do |prior_client|\n begin\n pipeline = Pipeline::Multi.new(prior_client)\n @client = deprecation_displayed ? pipeline : DeprecatedMulti.new(pipeline)\n pipelined_connection = PipelinedConnection.new(pipeline)\n yield pipelined_connection\n prior_client.call_pipeline(pipeline)\n ensure\n @client = prior_client\n end\n end\n else\n send_command([:multi])\n end\n end",
"title": ""
},
{
"docid": "b80e497c8f073c874dd3f86f3b842a93",
"score": "0.5250914",
"text": "def haltall\n command(\"#:Q#\")\n end",
"title": ""
},
{
"docid": "b80e497c8f073c874dd3f86f3b842a93",
"score": "0.5250914",
"text": "def haltall\n command(\"#:Q#\")\n end",
"title": ""
},
{
"docid": "8f03bbb899f9f4c3531c0bdb1dfdef51",
"score": "0.52475846",
"text": "def kill_em_all!\n all.each { |p| p.delete }\n end",
"title": ""
},
{
"docid": "9d62a328ce31d554cf8f1934dbd5d712",
"score": "0.5247234",
"text": "def clear_commands\n @@command_options = nil\n @@commands = HELP_COMMAND.dup\n end",
"title": ""
},
{
"docid": "e89d6033292d83f1720dcd413104ded2",
"score": "0.5240257",
"text": "def cleanup\n @options = {}\n @command = true\n end",
"title": ""
},
{
"docid": "8939a39797669141fb15ab6894d8af02",
"score": "0.522402",
"text": "def discard!\r\n @buffer.clear\r\n end",
"title": ""
},
{
"docid": "a7c40f26e565902b58fe05b752d02e3a",
"score": "0.52195543",
"text": "def clear_command_buffer\n @command_buffer.clear\n end",
"title": ""
},
{
"docid": "ce0478debeb838236b3666d050cfdc7f",
"score": "0.5216798",
"text": "def drop\r\n fail \"Invalid action: Cannot drop all buffers.\" if merged?\r\n @buffers = @buffers[1..-1]\r\n end",
"title": ""
},
{
"docid": "c4ae69a1584f1fe61514a924c595aeaa",
"score": "0.52091223",
"text": "def remove_command(*names)\n options = names.last.is_a?(Hash) ? names.pop : {}\n\n names.each do |name|\n commands.delete(name.to_s)\n all_commands.delete(name.to_s)\n undef_method name if options[:undefine]\n end\n end",
"title": ""
},
{
"docid": "15c6967f60902e5bc39ba6f3843d22d0",
"score": "0.5202352",
"text": "def discard_transaction!\n transactions.each do |trsc|\n trsc.discard_transaction!\n end\n discard_transaction\n end",
"title": ""
},
{
"docid": "f562b848e7e852c82499165268e6ce2a",
"score": "0.52014506",
"text": "def clear()\n @commandsHash = { commands: [] }\n end",
"title": ""
},
{
"docid": "2ae5eaf6ee4adc6fe34207856c2f260a",
"score": "0.51970834",
"text": "def none\n spawn.none!\n end",
"title": ""
},
{
"docid": "2de4cb2758deb0ea3b52cee18ea70ff2",
"score": "0.5191001",
"text": "def grid_command_remove\n if @acts[1] == :center\n @target_grid -= [@center_grid]\n return\n elsif @acts[1] == Grid::COMMAND_REMSAVED\n @target_grid -= @target_grid_backup\n return\n end\n @target_grid -= make_grid\n record_target\n end",
"title": ""
},
{
"docid": "e968d9b6a43348178b1afbbd394094a1",
"score": "0.51858383",
"text": "def pop(non_block = false)\n @messages.pop non_block\n end",
"title": ""
},
{
"docid": "898dafacfa702522c4595e9d352aed04",
"score": "0.517518",
"text": "def after_discard(&blk)\n self.after_discard_procs += [blk]\n end",
"title": ""
},
{
"docid": "c9a527728206677e554b56e0f56a9371",
"score": "0.5172325",
"text": "def remove_command(*names)\n options = names.last.is_a?(Hash) ? names.pop : {}\n\n names.each do |name|\n commands.delete(name.to_s)\n all_commands.delete(name.to_s)\n undef_method name if options[:undefine]\n end\n end",
"title": ""
},
{
"docid": "164e78ab9693ba935bf88d470f7ce1de",
"score": "0.5171945",
"text": "def process_leftovers\n #puts \"Processing leftovers\"\n\n @context.storage.get_many('msgs').each do |msg|\n #puts \"Processing #{msg.inspect}\"\n\n process msg\n end\n\n #puts \"Finished processing leftovers\"\n end",
"title": ""
},
{
"docid": "dbac0540be99deafdfb8d90081efc538",
"score": "0.51686484",
"text": "def clear_statements\n send_delete_request('')\n end",
"title": ""
},
{
"docid": "e8ae0cfd67bbe6325563a43754da11bb",
"score": "0.51532954",
"text": "def clear\n @data_parts.clear(execution_id)\n @client.del(@queue_name)\n @client.del(\"#{redis_key_prefix}#{KEY_SUFFIXES[:ACTIVE_EXECUTION]}\")\n end",
"title": ""
},
{
"docid": "23dafd48320a02e4d6704811445e65a6",
"score": "0.5152968",
"text": "def reset\n @allow_custom_commands = false\n nil\n end",
"title": ""
},
{
"docid": "af8376de5dcfa966945d19e562cf7487",
"score": "0.51372355",
"text": "def reset!\n [@queue, @processing_set, @counter].each { |k| @redis.del k }\n end",
"title": ""
},
{
"docid": "af8e5d5601161d29b23f91caf587b8ae",
"score": "0.5133925",
"text": "def discard!; end",
"title": ""
},
{
"docid": "af8e5d5601161d29b23f91caf587b8ae",
"score": "0.5133925",
"text": "def discard!; end",
"title": ""
},
{
"docid": "71d41919338c7fb28e10362dfb3a73a0",
"score": "0.5130103",
"text": "def remove_all\n @input_queue.clear\n mark_changed\n true\n end",
"title": ""
},
{
"docid": "3f637757c56cd124fe85f50dfc95ba33",
"score": "0.5129739",
"text": "def clear\n @queue.clear\n @history.clear\n @failures.clear\n return self\n end",
"title": ""
},
{
"docid": "b8fe3729706d0af17a71dc0626ee3a36",
"score": "0.51273096",
"text": "def discard!\n update!(discarded: true)\n end",
"title": ""
},
{
"docid": "c3dbc0f3c04348ae5ac32a5fe161c77e",
"score": "0.5109003",
"text": "def reset\n @commands = @command = @global_command = @errors = nil\n end",
"title": ""
},
{
"docid": "10c751c08166a62c0d1aef04e1ec9270",
"score": "0.51077896",
"text": "def flush!\n 0.upto(blocks.length) { blocks.pop }\n end",
"title": ""
},
{
"docid": "2eb78611dee54ef7c0cdf433b55a7be3",
"score": "0.5102965",
"text": "def without_undo(&block)\n undo_manager.without_undo(&block)\n end",
"title": ""
},
{
"docid": "a1752d9a8bf5c5190a9a9c89b2c68814",
"score": "0.51020265",
"text": "def send_batch\n receipients.flatten.each do |rcpt|\n user, password = split_password(rcpt[:user])\n if rcpt[:type] == :user\n send_message(user)\n elsif rcpt[:type] == :group\n send_muc_message(user, password)\n end\n Log.logger.debug(\"Removing item %p from queue\" % rcpt)\n receipients.delete(rcpt)\n end\n end",
"title": ""
},
{
"docid": "edd5393f8b6663e4ccd17fb64f0b734b",
"score": "0.5086471",
"text": "def stop_command_handler \n @command_handler.stop\n @command_handler = nil\n end",
"title": ""
},
{
"docid": "b9db64723e8a7889db22ac252409b0ab",
"score": "0.5085688",
"text": "def unbufferred(&block)\n bufferring = output.sync\n # Immediately flush output\n output.sync = true\n block[] if block_given?\n ensure\n output.sync = bufferring\n end",
"title": ""
},
{
"docid": "cf20a704555bb145f204dd6ec106b651",
"score": "0.50834763",
"text": "def unreceive message, headers={}\n message.transaction[:qm].abort(message.transaction[:tid])\n LOG.debug \"[A] Aborted transaction #{message.transaction[:tid]}\"\n end",
"title": ""
},
{
"docid": "3f57a097b7fde08558d98240f7b3aca2",
"score": "0.50817585",
"text": "def multi_exec!(commands)\n if !multi_exec(commands)\n puts red \"Command failed. Aborting.\"\n exit 1\n end\n return true\nend",
"title": ""
},
{
"docid": "c0fb8e7b75ea13e41f115a987bd20420",
"score": "0.50782156",
"text": "def clear\n @client.del(\"#{@queue_name}_processing_status\")\n @client.del(@queue_name)\n end",
"title": ""
},
{
"docid": "bd773dae53ddc34c7ad0a970789385e1",
"score": "0.5076561",
"text": "def pop_discard_buffer\r\n raise Shells::NotRunning unless running?\r\n # a standard pop discarding current data and retrieving the history.\r\n debug 'Discarding buffer <<'\r\n sync do\r\n hist_stdout, hist_stderr, hist_output = (output_stack.pop || [])\r\n self.stdout = hist_stdout || ''\r\n self.stderr = hist_stderr || ''\r\n self.output = hist_output || ''\r\n end\r\n end",
"title": ""
},
{
"docid": "a7badf6b25aa870d1329e9d66d7abbb6",
"score": "0.50704587",
"text": "def queue_some_for_delete\n nil\n end",
"title": ""
},
{
"docid": "92e5f34762560ede281c62202e2d5e58",
"score": "0.5065684",
"text": "def close_open_block_commands\n return unless stack.size > 1\n until stack.size == 1\n cmd = stack.pop\n stack.last << cmd\n end\n end",
"title": ""
},
{
"docid": "aa8065debc51e064d8c439141e0e0ca7",
"score": "0.50624466",
"text": "def unblock()\n merge(unblock: 'true')\n end",
"title": ""
},
{
"docid": "b5381543cab5fd0f8a942a18d21fee73",
"score": "0.50481725",
"text": "def reset!\n [@queue, @processing_set, @counter, @jobs, @user_jobs, @job_types].each { |k| @redis.del k }\n end",
"title": ""
},
{
"docid": "6b079148ecc22d6c730ab352c43d1fbd",
"score": "0.50464517",
"text": "def discard\n FileUtils.rm options.output\n end",
"title": ""
},
{
"docid": "c48e94d8c30bdb33fb2f13b244085bdb",
"score": "0.50430024",
"text": "def stop_all_processors\n raise \"Method #stop_all_processors() is not implemented by #{self.class}\"\n end",
"title": ""
},
{
"docid": "459dfb2944794f653e07d840ac2bffa2",
"score": "0.5041469",
"text": "def delete_all\n each { |msg| delete(msg) }\n clear\n end",
"title": ""
},
{
"docid": "6a622936ecaeebd93e70ca11f85c5b89",
"score": "0.5034583",
"text": "def at_removal(*args, &block)\n connections.each do |connection|\n if connection.strategy.respond_to? :execute_at_clean\n connection.strategy.execute_at_clean block, :call, *args\n end\n end\n end",
"title": ""
},
{
"docid": "34f4a33f31db48e7779c896826456441",
"score": "0.5028695",
"text": "def unregister_commands\n # Register defined commands\n self.class.commands.each do |command|\n meth, context = command\n warn \"Unregistering #{meth} for #{self.class.name} for event #{context}\"\n \n # This allows 'auto' for commands to work in channel and private\n if context == :auto\n contexts = [:channel, :private] \n else\n contexts = [context]\n end\n contexts.each do |c|\n #Register with global $bot\n @bot.off(c.to_sym, /^\\s*!#{self.class.get_token.to_s}\\s+#{meth.to_s}\\s?(.*)$/i)\n end\n end\n # Register default command\n if (self.class.get_default_command_context == :auto) then\n contexts = [:channel, :private] \n else\n contexts = [self.class.get_default_command_context]\n end\n contexts.each do |c|\n @bot.off(c.to_sym, /^\\s*!#{self.class.get_token.to_s}(.*)$/i)\n end\n # Unregister Token\n @@global_tokens_catalog.delete(self.class.get_token)\n end",
"title": ""
},
{
"docid": "8e8cf80b91d4e7524cb3ab1aa2bb1070",
"score": "0.502761",
"text": "def unignore\n @ignored = false\n end",
"title": ""
},
{
"docid": "b24724527fada7ce73b273a859668ce3",
"score": "0.50243783",
"text": "def clear\n processes.clear\n\n self\n end",
"title": ""
},
{
"docid": "b9bd668c92befedc278e5cf3bc7a39dc",
"score": "0.50225365",
"text": "def pop(blocking = false)\n @native.delete_min_return_key\n end",
"title": ""
},
{
"docid": "b9bd668c92befedc278e5cf3bc7a39dc",
"score": "0.50225365",
"text": "def pop(blocking = false)\n @native.delete_min_return_key\n end",
"title": ""
},
{
"docid": "9b2c08a5fab182ab31527b19c864b409",
"score": "0.49921757",
"text": "def dequeue_all\n queued_jobs.map(&:delete)\n end",
"title": ""
}
] |
bf1bd5c2f746576786a39e8eb0c2f39b | get a particular address component. Generally :street1, :street2, :city, :state, :zip, :country are supported. This method will return the address as one line if h1 is nil. This is needed to support geocoder geolocation encoding (geocoder will call address, expecting a street address) | [
{
"docid": "44c3a9b24a0f8a693eb310d535435182",
"score": "0.0",
"text": "def [](key)\n self.address_hash[key]\n end",
"title": ""
}
] | [
{
"docid": "e66bc7281d6cf9d3834f48548f31a09f",
"score": "0.71283144",
"text": "def address_one_line\n \"%s, %s, %s %s\" % [self.address_line_1, self.city, self.state_abbr, self.zipcode]\n end",
"title": ""
},
{
"docid": "a348a1d2c27e561b69e5464eddbff719",
"score": "0.6988867",
"text": "def address\n unless addresses.empty?\n addresses.first\n else\n nil\n end\n end",
"title": ""
},
{
"docid": "98e05203f23df16eb58cb263c0fb8ba4",
"score": "0.69609517",
"text": "def full_street_address\n \"#{self.address}, #{self.city}, #{self.state.try(:alpha_code)} #{self.zipcode} US\"\n end",
"title": ""
},
{
"docid": "e01d95ee987f0720c2208b057c53c11d",
"score": "0.69578403",
"text": "def get_street_address(results)\n results = results.last\n result = results.first\n if result\n return result[:street_address]\n else\n return nil\n end\n end",
"title": ""
},
{
"docid": "f5068db39ef2ae040b977426ecba2ead",
"score": "0.6836974",
"text": "def address\n\t\t\taddress = [self.address_1, self.try(:address_2), \"#{self.city} #{self.try(:state)}\", \"#{self.try(:zip)}\"].compact\n\t\t\taddress.delete(\"\")\n\t\t\taddress.join(\"<br/>\")\n\t\tend",
"title": ""
},
{
"docid": "d2c310c49921b8845fb895251b6ea338",
"score": "0.6802959",
"text": "def full_address\n addr = []\n addr << country.try(:name) if show_country\n addr << (state.try(:name).presence || state_name) if show_state\n addr << address1\n addr.compact.join(', ')\n end",
"title": ""
},
{
"docid": "7846852b359f18f5271a80b214787024",
"score": "0.6753793",
"text": "def full_address\n \"#{region}, #{district}, #{street_type} #{street_name}, д. #{house_number} кв. #{apartment}\"\n end",
"title": ""
},
{
"docid": "8fc65a9c264d3dd94b689aec0e508105",
"score": "0.6727524",
"text": "def full_address\n \"#{address1} #{address2} #{city},#{state} #{postal_code} #{country}\"\n end",
"title": ""
},
{
"docid": "da67a3e97d0987fa1257cc36ae2516c6",
"score": "0.66635",
"text": "def address_street\n address.street\n end",
"title": ""
},
{
"docid": "2167238ba02c64447bcbf91667767cf0",
"score": "0.66571623",
"text": "def full_street_address\n if self.city_id || self.city\n \n city = City.find(:first,:conditions => {:city => self.city_id}) || self.city\n \"#{self.street_address},#{self.postal_code},#{city.city},#{city.region.code},#{city.region.country.name}\" || \"\"\n else\n \"\"\n end\n end",
"title": ""
},
{
"docid": "fd1fb10dd51d25938ff5d0c08fd80331",
"score": "0.66391176",
"text": "def full_address(include_country = false, include_secondary = false)\n address = \"#{street_address(include_secondary)} #{postal_code} #{city}\"\n address = \"#{address} POLOGNE\" if include_country\n address\n end",
"title": ""
},
{
"docid": "ea310ce8fa94dfb9e231c37f35e51760",
"score": "0.66380113",
"text": "def street_address\n search('.mapaddress').children.first.text.chop rescue nil\n end",
"title": ""
},
{
"docid": "aee74564209dab2dace23674b779025c",
"score": "0.6623093",
"text": "def address\n return poi.address unless poi.nil?\n return place.address unless place.nil?\n addr = get_address\n return addr.blank? ? raw_address : addr\n end",
"title": ""
},
{
"docid": "74abbcde7ee6e9127714cdb6cdd02419",
"score": "0.661612",
"text": "def full_street_address\n return \"#{bAddress1}, #{bCity}, #{bState}\"\n end",
"title": ""
},
{
"docid": "434ed7ea8e9e035e69d1a0eead832ea1",
"score": "0.6599743",
"text": "def full_address\n if has_full_address?\n \"#{street_address}, #{locality} #{region} #{postal_code} #{country}\"\n end\n end",
"title": ""
},
{
"docid": "8c4ba0255a6c6f883e2b9113ef3df712",
"score": "0.6590359",
"text": "def full_street_address\n postcode_only_address\n end",
"title": ""
},
{
"docid": "a0c41aef0ee7759cdbe78815b2ea40cc",
"score": "0.65842694",
"text": "def address\n # match Geocoder::Result::Google#formatted_address\n \"#{street}, #{city}, #{state} #{zip}, #{country}\"\n end",
"title": ""
},
{
"docid": "1f23f7bf518f0291f6620b1714033e81",
"score": "0.65789217",
"text": "def full_address\n address.presence || [street_number, routes, locality, administrative_area_level_1, country].compact.reject(&:blank?).join(', ')\n end",
"title": ""
},
{
"docid": "d6fc167d0a906f13036281813e3b3c20",
"score": "0.6560283",
"text": "def full_street_address #Take all location fields, remove nil elements with .compact, then return a string for Geocoder\n [address_1, address_2, city, country, z_post_code].compact.join(', ')\n end",
"title": ""
},
{
"docid": "97dda084c64ca5ee81f4283e165f7867",
"score": "0.6547405",
"text": "def full_address\n\t\t\"#{street}, #{postal_code}, #{city}, #{country}\"\n\tend",
"title": ""
},
{
"docid": "1bea02704be8331dbcd519291a6c6014",
"score": "0.6507933",
"text": "def full_address\n \"#{address}, #{city}, #{state}, #{zip}\"\n end",
"title": ""
},
{
"docid": "eb37afde4edaee6b530492159027779c",
"score": "0.6497305",
"text": "def full_address_for(address)\n \"#{street_address_for(address)}, #{address.city}, #{address.state_province} \" \\\n \"#{address.postal_code}\"\n end",
"title": ""
},
{
"docid": "989d21a3bb9043cd8d16f1b739856902",
"score": "0.64613384",
"text": "def full_address\n return \"#{@address}, #{@apart} #{@city} #{@state}, 60611\"\n end",
"title": ""
},
{
"docid": "5c4cc2c0c13146d137c2bfe272c76e2a",
"score": "0.64482296",
"text": "def get_full_address\n [\n (address.empty? ? nil : address),\n (self.le_city.nil? ? nil : self.le_city.get_full_name)\n ].compact.join(\", \")\n end",
"title": ""
},
{
"docid": "5c4cc2c0c13146d137c2bfe272c76e2a",
"score": "0.6448078",
"text": "def get_full_address\n [\n (address.empty? ? nil : address),\n (self.le_city.nil? ? nil : self.le_city.get_full_name)\n ].compact.join(\", \")\n end",
"title": ""
},
{
"docid": "fc8143fb5a56e196a2edb899d46e6010",
"score": "0.6440932",
"text": "def get_address\n @address\n end",
"title": ""
},
{
"docid": "9bc319e9e765afb7a444f320c4a52a74",
"score": "0.64074165",
"text": "def full_street_address\n\t\treturn \"#{self.street}, #{self.city}, #{self.state}, #{self.zip}\"\n\tend",
"title": ""
},
{
"docid": "f12c8a466609b84ff11208b3e1d06ae0",
"score": "0.6405073",
"text": "def address_detail\n \"#{province.try :name}#{city.try :name}#{district.try :name}#{address}\"\n end",
"title": ""
},
{
"docid": "d808e4f875bfd0c02fe827fe3ca44c2b",
"score": "0.63776714",
"text": "def address\n '310 S Harrington'\n end",
"title": ""
},
{
"docid": "2b3cd5deba7219365d0a18b189a5328c",
"score": "0.63772213",
"text": "def address\n [street, [postal_code, l].join(' ')].join(\"\\n\")\n end",
"title": ""
},
{
"docid": "6af472ad056ece516c494b0b9263860f",
"score": "0.6376645",
"text": "def getaddress(name)\n addresses = getaddresses(name)\n if addresses.empty?\n raise ResolvError.new(\"no address for #{name}\")\n else\n addresses.first\n end\n end",
"title": ""
},
{
"docid": "8da7d63f3b99d34263c541abffe4f9d5",
"score": "0.6363047",
"text": "def full_address\n \"#{address}, #{suburb}, #{state}, #{postcode}\"\n end",
"title": ""
},
{
"docid": "d17771e2c938585ea7cf4032bfeaa93f",
"score": "0.6356064",
"text": "def address\n\t\taddress_str = \"\"\n\t\taddress_str += \"#{address_street}\\n\" unless address_street.blank?\n\t\taddress_str += \"#{address_city}, \" unless address_city.blank?\n\t\taddress_str += \"#{address_state} \" unless address_state.blank?\n\t\taddress_str += \"#{address_zip}\" unless address_zip.blank?\n\t\taddress_str\n\tend",
"title": ""
},
{
"docid": "b99234332cf3d3488415ee351507f264",
"score": "0.6351888",
"text": "def full_hq_address\n part_1 = hq_address\n part_2 = [hq_zip_code, hq_city].reject(&:blank?).join(' ')\n part_3 = hq_country.present? ? hq_country : \"France\"\n [part_1, part_2, part_3].reject(&:blank?).join(', ')\n end",
"title": ""
},
{
"docid": "bff708a3380d413bed7e93bba563d6c5",
"score": "0.63483965",
"text": "def address(latitude, longitude)\n return nil if latitude.blank? || longitude.blank?\n return nil unless doc = search(\"#{latitude},#{longitude}\", true)\n # blindly use first result (assume it is most accurate)\n doc['results'].first['formatted_address']\n end",
"title": ""
},
{
"docid": "4a01be29b484c42e796139260ae18d95",
"score": "0.63435346",
"text": "def full_address\n return\"#{self.client},#{self.rep_address_one} #{self.rep_address_two},#{self.city},#{self.state},#{self.zipcode}\"\n end",
"title": ""
},
{
"docid": "d6965e678fa42708b4e8e7dab7a4067a",
"score": "0.6327769",
"text": "def full_street_address\n [address, city, state, country].compact.join(', ')\n end",
"title": ""
},
{
"docid": "149c6d8c73e2c39012d5a26ce9d48891",
"score": "0.6321253",
"text": "def full_street_address\n \"#{street_address}, #{city}, #{state}\"\n end",
"title": ""
},
{
"docid": "f7288d5f493e4cf3c15cc356bbe02e33",
"score": "0.63147056",
"text": "def build_address(address)\n {\n id: address&.id,\n address_line1: address&.address_line1,\n address_line2: address&.address_line2,\n city: address&.city,\n state: address&.state,\n country: address&.country,\n }\n end",
"title": ""
},
{
"docid": "19c8aa5047edfc44ff8c95efdb1a0c5b",
"score": "0.6310703",
"text": "def main_address\n addresses.first\n end",
"title": ""
},
{
"docid": "434edec7b5352da471a1c8f7f1fcef39",
"score": "0.6306409",
"text": "def address\n \"#{self.building} #{return_data_format(self.street)} #{self.zipcode}\"\n end",
"title": ""
},
{
"docid": "88a1607d87daa99b2260ef0bf4aaf57a",
"score": "0.6302302",
"text": "def get_address(street_number:, street:, city:, state:, zip:)\n response = RestClient.get \"https://geocoding.geo.census.gov/geocoder/locations/onelineaddress?address=#{street_number}+#{street}%2C+#{city}%2C+#{state}+#{zip}&benchmark=9&format=json\"\n json = JSON.parse(response.body)\n end",
"title": ""
},
{
"docid": "4f3e2e0762a619495d7d333bc8213468",
"score": "0.6285616",
"text": "def full_address\n\t\t[\"#{self.street}\", self.city, self.country].compact.join(', ')\n\tend",
"title": ""
},
{
"docid": "b7f1b1e30383c67c2545bc1f5a561a0a",
"score": "0.62833226",
"text": "def get_address(addr)\n Address.get(@id, addr.to_s)\n end",
"title": ""
},
{
"docid": "b8d0b376a9fd5cd649299028dfc13baf",
"score": "0.6282576",
"text": "def address\n get_value :address\n end",
"title": ""
},
{
"docid": "69fecc512e477b08703ad602617ec4cb",
"score": "0.6277824",
"text": "def address\n return \"\" unless [city, state, state_code].all?(&:present?)\n \"#{city}, #{state}(#{state_code})\"\n end",
"title": ""
},
{
"docid": "55db350cbf0c03b9749a1a8ff8cf4f88",
"score": "0.62737066",
"text": "def full_street_address\n location + \"New York City, NY, USA\"\n end",
"title": ""
},
{
"docid": "0abc2cd9cbf81ce0dd1e6f04d0062c84",
"score": "0.62654454",
"text": "def full(address)\n \"#{address[:type]} #{address[:description]}, #{address[:neighborhood]}, #{address[:city]}-#{address[:state]}, Brasil.\"\n end",
"title": ""
},
{
"docid": "e66e93f8540292842aaee4bd5561e8d5",
"score": "0.6262006",
"text": "def address_1_field\n $tracer.trace(format_method(__method__))\n return ToolTag.new(@tag.find.input.id(\"/textAddressLine1$/\"), format_method(__method__))\n end",
"title": ""
},
{
"docid": "40c24f9f6f2848294f05c1ef76499784",
"score": "0.6257355",
"text": "def address\n fields = %w[address_line_1 address_line_2 address_line_3 city state zip country]\n Hash[fields.collect { |field| [field.to_sym, send(field)] }]\n end",
"title": ""
},
{
"docid": "62f2ed43e6a706f59be52767dff4f488",
"score": "0.62562305",
"text": "def get_address\n address = {}\n begin\n address[:line_one] = @rand.rand(1000).to_s + \" \" + DataUtility.select_random_from_options(@rand, BaseEntity.demographics['street'])\n address[:city] = BaseEntity.demographics['city']\n address[:state] = BaseEntity.demographics['state']\n address[:postal_code] = BaseEntity.demographics['postalCode']\n rescue NameError\n # occurs when @@d in BaseEntity hasn't been initialized (will happen during testing)\n return nil\n end\n address\n end",
"title": ""
},
{
"docid": "020e9d5339a70bc6603030bb02d09323",
"score": "0.6244496",
"text": "def street_address\n [\n house_number, \n street_predirection, \n street_name, \n street_type, \n street_postdirection, \n unit_type, \n unit_number\n ].compact.delete_if(&:empty?).join(' ')\n end",
"title": ""
},
{
"docid": "0a64b244d01788edabfd39e93eff74e2",
"score": "0.62375987",
"text": "def address\n \"%s %s %s %s\"%([self.prefecture_code,self.address_city,self.address_street,self.address_building])\n end",
"title": ""
},
{
"docid": "9678d3049d1403a04e555d2ab14f667d",
"score": "0.622144",
"text": "def full_address\n \"#{street_address}, #{city}, #{ISO3166::Country.new(country_code.upcase).name}\"\n end",
"title": ""
},
{
"docid": "bfe292213487a775f35663cdb981b8f0",
"score": "0.62112796",
"text": "def address\n {\n street: @data[:ulica].to_s,\n number: @data.values_at(:nr_domu, :nr_lokalu).compact.join('/'),\n code: @data[:pna].to_s,\n town: @data[:miejscowosc].to_s\n }\n end",
"title": ""
},
{
"docid": "2268ae04802b1b371d0de4051fea85c3",
"score": "0.6205567",
"text": "def full_address\n return \"#{address}, #{city}, #{state}, #{zip}\"\nend",
"title": ""
},
{
"docid": "4e91805d4077c3dd4ca689defdaa8961",
"score": "0.6198974",
"text": "def create_full_address\n \"#{address_line1}, #{city}, #{state} #{zip}\"\n end",
"title": ""
},
{
"docid": "f67d61172c271ed5f18300af63c455ad",
"score": "0.6197436",
"text": "def address_full\n \"#{self.address.titleize}, Toronto, ON\"\n end",
"title": ""
},
{
"docid": "046421769d082b444aaf80447bdda5d0",
"score": "0.61960924",
"text": "def address\n @address ||= best_guess_address(name)\n end",
"title": ""
},
{
"docid": "c31ee1127fd947a30dc0b81a49e242ef",
"score": "0.61950874",
"text": "def full_address\n\t\t[address1, address2, city, state, zipcode].join(', ')\n\tend",
"title": ""
},
{
"docid": "75ed6d807f5558e19f2635df9bfba374",
"score": "0.61936474",
"text": "def get_address\n return @m_address\n end",
"title": ""
},
{
"docid": "82ace01e11feb2291fe75c5805853465",
"score": "0.61919034",
"text": "def getToolsFormatAddress( address, country)\n params = Hash.new\n params['address'] = address\n params['country'] = country\n return doCurl(\"get\",\"/tools/format/address\",params)\n end",
"title": ""
},
{
"docid": "314688485038ca5fb2e4b52e58b3298d",
"score": "0.6183184",
"text": "def address_line\n [address_line1, address_line2].join(' ')\n end",
"title": ""
},
{
"docid": "e047287e818488ddd935cb3fa5770def",
"score": "0.6171618",
"text": "def full_address\n city.present? ? city_delim = city + \",\" : city_delim = city\n [address_1, address_2, city_delim, state, zip].reject(&:nil? || empty?).join(' ')\n end",
"title": ""
},
{
"docid": "a9181dfbdf3b589f79caa540bee198b9",
"score": "0.6160809",
"text": "def full_address\n [ address, city, state, zipcode, country ].compact.join(', ')\n end",
"title": ""
},
{
"docid": "13a302d39ed14a3efe39561ec45563a0",
"score": "0.61581475",
"text": "def full_address\n \"#{address1}, #{address2}, #{city}, #{state}, #{zipcode}\"\nend",
"title": ""
},
{
"docid": "535853bca188bb6c1888d269e061ec21",
"score": "0.6157725",
"text": "def define_address_line1\n @address_line1 = Faker::Address.street_address\n @address_line1 = '' unless @set_blank == false\n end",
"title": ""
},
{
"docid": "15f88de8697c90d99f1cc6e99d828527",
"score": "0.6156728",
"text": "def full_address\n part_1 = address\n part_2 = [zip_code, city].reject(&:blank?).join(' ')\n part_3 = \"France\"\n [part_1, part_2, part_3].reject(&:blank?).join(', ')\n end",
"title": ""
},
{
"docid": "f23f6e3e5cca5575ed2fde53b04bd123",
"score": "0.6116729",
"text": "def full_address\n [address, city, state].join(' ')\n end",
"title": ""
},
{
"docid": "d0f66804373ea9e2a01264a0082c6d0b",
"score": "0.6099201",
"text": "def address\n @address ||=\n if address_attributes.present?\n GeocodedAddress.new(station.build_address(address_attributes))\n else\n NullAddress.new\n end\n end",
"title": ""
},
{
"docid": "43581d69920a715a22299a076b93e5eb",
"score": "0.60963196",
"text": "def get_common_address\n service = EVSS::PCIUAddress::Service.new(user)\n response = service.get_address\n case response.address\n when EVSS::PCIUAddress::DomesticAddress\n prefill_domestic_address(response.address)\n when EVSS::PCIUAddress::InternationalAddress\n prefill_international_address(response.address)\n when EVSS::PCIUAddress::MilitaryAddress\n prefill_military_address(response.address)\n else\n {}\n end\n rescue\n {}\n end",
"title": ""
},
{
"docid": "aa603a4c101809bd6ee5aa7943d8efb0",
"score": "0.6083558",
"text": "def full_address\n [address, city, state, zipcode, country].compact.join(\", \")\n end",
"title": ""
},
{
"docid": "26659f9c6c9abc71fa15718bd83180de",
"score": "0.60607237",
"text": "def full_address\n [landmark_name, city, country].compact.join(', ')\n end",
"title": ""
},
{
"docid": "2d32c2003e56d153034057efef7f014f",
"score": "0.6051146",
"text": "def address\n [address1, city, state, country, zip].compact.join(', ')\n end",
"title": ""
},
{
"docid": "707cfe1bd42c093b5b3ff0a593fb0eec",
"score": "0.6039742",
"text": "def street_address(include_secondary=false)\n Faker::Address.street_address(include_secondary)\n end",
"title": ""
},
{
"docid": "7e5f2f664c8c3d4edaf48f77b0d583d3",
"score": "0.6026645",
"text": "def address\n @address\n end",
"title": ""
},
{
"docid": "55e473b56727d9ed118bebcfece215bb",
"score": "0.6023889",
"text": "def address_as_string(type)\n ad = address(type)\n begin\n ad.nil? ? nil : \"#{ad.country.name}, #{ad.city.name}, #{ad.street1}, #{ad.street2}\"\n rescue\n \"sorry, bad address\"\n end\n end",
"title": ""
},
{
"docid": "74af8ae119ce63204083334e41850c9f",
"score": "0.6015746",
"text": "def full_address\n full_address = \"\"\n unless self.address.blank?\n full_address += self.address\n end\n unless self.city.blank?\n full_address += \", \" + self.city\n end\n unless self.province.blank?\n full_address += \", \" + self.province\n end\n unless self.country.blank?\n full_address += \", \" + self.country\n end\n unless self.postal.blank?\n full_address += \", \" + self.postal\n end\n return full_address\n end",
"title": ""
},
{
"docid": "ced842089561e8c621384089a59e58cd",
"score": "0.601511",
"text": "def full_address\r\n [street, city, state, zip_code].delete_if{ |content| content.blank? }.join(\", \")\r\n end",
"title": ""
},
{
"docid": "8f062b620629a3ecef7284b8db4127e5",
"score": "0.6011498",
"text": "def address\n @address\n end",
"title": ""
},
{
"docid": "ad36c50bd17e65928999fdcb49cc90c5",
"score": "0.6010674",
"text": "def build_address(address)\n {\n route: address.address1,\n neighborhood: address.address2,\n locality: address.address3,\n postalCode: address.postal_code,\n subLocality: address.city,\n state: address.city,\n country: address.country.name\n }.\n # INFO: equivalent of .compact\n select { |_, value| !value.nil? }\n end",
"title": ""
},
{
"docid": "a1c27cb0a180a8bfcaa36ae763e99f6b",
"score": "0.6004933",
"text": "def geocode_address\n full_address or address\n end",
"title": ""
},
{
"docid": "f45785929309f8f8a46e7885014438b8",
"score": "0.59935117",
"text": "def full_order_to_address\n ship_address.address1 + ' ' + ship_address.address2\n end",
"title": ""
},
{
"docid": "03d00d5b53ad70df2b6c4e1b49b3dfa0",
"score": "0.59876275",
"text": "def name\n street_address\n end",
"title": ""
},
{
"docid": "c8506c5f06bc4a2ab48b3663d1ecb553",
"score": "0.5986709",
"text": "def to_s\n \"\\nAddress:\\n#{line_one}\\n#{line_two}\\n#{city} #{state} #{zip}\"\n end",
"title": ""
},
{
"docid": "dd35975f0fb65bca095c3796595d82dd",
"score": "0.5983334",
"text": "def address\n [address_line_1, address_line_2, town_city, county, postcode].join(\", \")\n end",
"title": ""
},
{
"docid": "087a7d26ffa5bc4cd3db2e781bff11e6",
"score": "0.5981808",
"text": "def address\n return @address\n end",
"title": ""
},
{
"docid": "087a7d26ffa5bc4cd3db2e781bff11e6",
"score": "0.5981808",
"text": "def address\n return @address\n end",
"title": ""
},
{
"docid": "fcd13071157b0fb5cdf6df4aa2de5a4a",
"score": "0.5981444",
"text": "def address_html(item)\n html = \"\"\n \thtml += \"#{item[:address1]}<br />\"\n \tif item[:address2].present?\n \t\thtml += \"#{item[:address2]}<br />\"\n \tend\n \tif item[:address3].present?\n \t\thtml += \"#{item[:address3]}<br />\"\n \tend\n \thtml += \"#{item[:city]} \"\n \tif item[:state].present?\n \t\thtml += \" #{item[:state]} \"\n \tend\n \thtml += \"#{item[:postal]}<br />\"\n \thtml += country_name(item[:country])\n end",
"title": ""
},
{
"docid": "d22689469290af3c9342a11129addf46",
"score": "0.5970559",
"text": "def full_address\n [address, city].compact.join(', ')\n end",
"title": ""
},
{
"docid": "f65a3800b59b34b65baf771cf8de9315",
"score": "0.59607595",
"text": "def gmaps4rails_address\n addr = if state and state.name.present?\n \"#{address_1}, #{city}, #{state.name} #{zip_code}\"\n elsif (address_1)\n \"#{address_1}, #{raw_seed}\"\n else\n \"1856 Stevenson Ave, Clearwater, Florida 33755\"\n end\n puts \"gmap input:#{addr}\"\n addr\n end",
"title": ""
},
{
"docid": "1b519e1fdb8a4d19f0893ea7abb23dd1",
"score": "0.59590065",
"text": "def street\n return @street\n end",
"title": ""
},
{
"docid": "1f9fcf9fb34432d5f4bc16aeda94f309",
"score": "0.5926573",
"text": "def street_address(include_secondary=false)\n Faker::Address.street_address(include_secondary: include_secondary)\n end",
"title": ""
},
{
"docid": "f8a2e6d590c58a9b6ccf460a20ac8f65",
"score": "0.592136",
"text": "def full_address\n [self.address, \"Madrid\", \"Spain\"].compact.join(\", \") if self.address\n end",
"title": ""
},
{
"docid": "e049a409e0befed5a4c4698275172c7e",
"score": "0.59169495",
"text": "def full_address\n [area, city, country].compact.join(', ')\n end",
"title": ""
},
{
"docid": "93df726b0a7ccc66963650b1d4b897e7",
"score": "0.5909427",
"text": "def full_address\n [address, town, state, zipcode].compact.join(', ')\n end",
"title": ""
},
{
"docid": "03e0f9479e0ec7a4b327fa8394051550",
"score": "0.59001786",
"text": "def address_line1_field\n # unit_test_no_generate: address_line1_field, input.className(create_ats_regex_string(\"ats-addrline1field\"))\n $tracer.trace(__method__)\n return ToolTag.new(input.className(create_ats_regex_string(\"ats-addrline1field\")), __method__)\n end",
"title": ""
},
{
"docid": "f8dd5e01a357feae0bcdf16c48bb3111",
"score": "0.5896802",
"text": "def full_address\n [address, city, state_code, zip].compact.uniq.join ' '\n end",
"title": ""
},
{
"docid": "636d25f9ab602c0839dcb0d815a8ece3",
"score": "0.58915746",
"text": "def primary_address\n primary_contacts(addresses, :address_rank_code, &:first)\n end",
"title": ""
},
{
"docid": "d67b11a2073fe811e1a5377b1488729b",
"score": "0.587883",
"text": "def full_address; end",
"title": ""
},
{
"docid": "894b4b2fb8377912018c84e670c96651",
"score": "0.5878213",
"text": "def full_address\n merchant.street + \", \" + merchant.city + \", \" + merchant.state + \" \" + merchant.zip\n end",
"title": ""
}
] |
1df62c0d078e1853bf680b566495fe6b | Determine whether the single address provided is a replica set member. | [
{
"docid": "0897a3afd5a0133e6b6c950b740cdab4",
"score": "0.7807794",
"text": "def single_rs_member?\n ClusterConfig.instance.single_server? && ClusterConfig.instance.replica_set_name\nend",
"title": ""
}
] | [
{
"docid": "f7bd6ae61e47299d62d2ecfc6a922172",
"score": "0.8017018",
"text": "def replica_set_member?\n ok? && !(standalone? || mongos?)\n end",
"title": ""
},
{
"docid": "1ce9b5bf2cc952f837fbc8a6eaf7b43e",
"score": "0.78459996",
"text": "def replicaset?\n replicaset.is_a?(String) || nodes.length > 1\n end",
"title": ""
},
{
"docid": "c825d64a5240f92c74eac57f68303d09",
"score": "0.77916783",
"text": "def replicaset_member_valid?(member)\n return false unless member && member['_id']\n return false unless member['host'] =~ /^[\\w\\.\\-]+:\\d+/\n\n true\n end",
"title": ""
},
{
"docid": "bab35aac2a1707bd3d29102ca73fd460",
"score": "0.74135315",
"text": "def replica_set?\n type == Mongo::Cluster::Topology::ReplicaSet\n end",
"title": ""
},
{
"docid": "a954e6dace2c69ae9aa5868bdef93f28",
"score": "0.7393936",
"text": "def single_rs_member?\n $mongo_client ||= initialize_scanned_client!\n $single_rs_member ||= (single_seed? &&\n $mongo_client.cluster.servers.first.replica_set_name)\nend",
"title": ""
},
{
"docid": "a683103f8e7f80cfbc87135f93128f19",
"score": "0.7153832",
"text": "def replica?\n configuration_hash[:replica]\n end",
"title": ""
},
{
"docid": "66ee25500fb5513342cd924212f9a00c",
"score": "0.69613546",
"text": "def replicaset_config_valid?(config)\n return false unless config && config['_id']\n return false unless config['members'].respond_to?(:each) && config['members'].any?\n\n config['members'].each do |member|\n return false unless replicaset_member_valid?(member)\n end\n\n true\n end",
"title": ""
},
{
"docid": "552d6e426eca47ab428c7bdd2baf096a",
"score": "0.67912245",
"text": "def replicaset_writeable_member?(member)\n replicaset_member_valid?(member) &&\n !member['arbiteronly'] &&\n !member['hidden'] &&\n !(member['votes'] && member['votes'].zero?) &&\n !(member['slaveDelay'] && !member['slaveDelay'].zero?)\n end",
"title": ""
},
{
"docid": "cb55d5e103a1db6d7a1f34de9c9b7036",
"score": "0.6456163",
"text": "def check_set_membership(config)\n if !config.has_key?('hosts')\n message = \"Will not connect to #{host_string} because it's not a member \" +\n \"of a replica set.\"\n raise ConnectionFailure, message\n elsif config['hosts'].length == 1 && !config['ismaster'] &&\n !config['secondary']\n message = \"Attempting to connect to an unhealthy, single-node replica set.\"\n raise ConnectionFailure, message\n end\n end",
"title": ""
},
{
"docid": "9e5c881976bc6758c1a689e1376bf48e",
"score": "0.6444671",
"text": "def replica_set?\n $mongo_client ||= initialize_scanned_client!\n $replica_set ||= $mongo_client.cluster.replica_set?\nend",
"title": ""
},
{
"docid": "9e5c881976bc6758c1a689e1376bf48e",
"score": "0.6444671",
"text": "def replica_set?\n $mongo_client ||= initialize_scanned_client!\n $replica_set ||= $mongo_client.cluster.replica_set?\nend",
"title": ""
},
{
"docid": "58fc20f400748c62fadc9f828698fe67",
"score": "0.64273083",
"text": "def check_set_name(config, socket)\n if @replica_set\n config = self['admin'].command({:replSetGetStatus => 1},\n :socket => socket, :check_response => false)\n\n if !Mongo::Support.ok?(config)\n raise ReplicaSetConnectionError, config['errmsg']\n elsif config['set'] != @replica_set\n raise ReplicaSetConnectionError,\n \"Attempting to connect to replica set '#{config['set']}' but expected '#{@replica_set}'\"\n end\n end\n end",
"title": ""
},
{
"docid": "9bb5559c33c273bcf2102fa553687651",
"score": "0.63199997",
"text": "def replica_set?; false; end",
"title": ""
},
{
"docid": "9bb5559c33c273bcf2102fa553687651",
"score": "0.63199997",
"text": "def replica_set?; false; end",
"title": ""
},
{
"docid": "b248e690871df72e9c92fc5dc86525f3",
"score": "0.6314458",
"text": "def check_set_name(config)\n if @client.replica_set_name\n if !config['setName']\n @client.log(:warn, \"Could not verify replica set name for member #{host_string} \" +\n \"because ismaster does not return name in this version of MongoDB\")\n elsif @client.replica_set_name != config['setName']\n message = \"Attempting to connect to replica set '#{config['setName']}' on member #{host_string} \" +\n \"but expected '#{@client.replica_set_name}'\"\n raise ReplicaSetConnectionError, message\n end\n end\n end",
"title": ""
},
{
"docid": "94c0da581f5e1645b7c2c8f77971aeec",
"score": "0.6245301",
"text": "def replicated?\n defined?(@replication_connections)\n end",
"title": ""
},
{
"docid": "788d9460a71d1544bd4f7dedf0b448d1",
"score": "0.6223678",
"text": "def direct?\n !replicaset?\n end",
"title": ""
},
{
"docid": "5aed85e47ae72012f15b2d41dbfd2a64",
"score": "0.61704767",
"text": "def member?\n has_role?('Member')\n end",
"title": ""
},
{
"docid": "7ffcc993c05d11eefa54289c52d9a87d",
"score": "0.6123405",
"text": "def single_member_household?\n current_application.members_count == 1\n end",
"title": ""
},
{
"docid": "d0047608d479101da8e3525597f28d7e",
"score": "0.61006546",
"text": "def member?\n role == 'member'\n end",
"title": ""
},
{
"docid": "942ad22efcbe477c2acef3b3313b30e4",
"score": "0.605075",
"text": "def master?\n member? && nodename == options[:master_nodename]\n end",
"title": ""
},
{
"docid": "2d1b3b3195d9bd78b7fb40809ecef23a",
"score": "0.6037673",
"text": "def locally_administered?\n (@addr & 0x020000000000) == 0\n end",
"title": ""
},
{
"docid": "d77c56ef5cbe26b3604d2b1a38e77ece",
"score": "0.6034744",
"text": "def member?\n type == 'Member'\n end",
"title": ""
},
{
"docid": "8061583a7b556e56566988def31ae9c7",
"score": "0.6023409",
"text": "def member?\n role == 'member' ? true : false\n end",
"title": ""
},
{
"docid": "c525283c533a102022bf03ad0991de94",
"score": "0.6020897",
"text": "def locally_administered?\n (@addr & 0x0200000000000000) == 0\n end",
"title": ""
},
{
"docid": "40638cc10d9bad6b4358f80acc2b4928",
"score": "0.60088605",
"text": "def zone_master?(zone)\n have_ip? master\n end",
"title": ""
},
{
"docid": "d712f512423aa4bcf9a3bb83be1291f1",
"score": "0.60083854",
"text": "def member?\n admin? || is?(:member)\n end",
"title": ""
},
{
"docid": "77cc8fec5fed31722cfc3d06304ce241",
"score": "0.5969807",
"text": "def meta_address?\n ip_address == '0.0.0.0'\n end",
"title": ""
},
{
"docid": "e14309af8b302a587ff91eee29a2c327",
"score": "0.59690154",
"text": "def slave_of?(p1)\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "4e7e4bd80eeed5b227e14b3c67598443",
"score": "0.59674",
"text": "def member?\n mit_ips.include?(request.remote_ip)\n end",
"title": ""
},
{
"docid": "4e7e4bd80eeed5b227e14b3c67598443",
"score": "0.59674",
"text": "def member?\n mit_ips.include?(request.remote_ip)\n end",
"title": ""
},
{
"docid": "da3ae3d6da618e46df98112dd42725b8",
"score": "0.5961372",
"text": "def is_server?(server)\n address == server.address\n end",
"title": ""
},
{
"docid": "bb78afcfd8fa4f39f36d2c8f7dd31ece",
"score": "0.59380835",
"text": "def is_member?(user_entry)\n member_names.include?(user_entry.dn) ||\n members.detect {|entry| entry.dn == user_entry.dn}\n end",
"title": ""
},
{
"docid": "4286542ac9d05ea848731a30cea3575e",
"score": "0.5936896",
"text": "def is_member?(user_dn)\n members.detect {|entry| entry.dn == user_dn}\n end",
"title": ""
},
{
"docid": "f80f7d2eac32bf1aed077fe428061910",
"score": "0.5931489",
"text": "def properly_configured?\n !@replica_configs.empty?\n end",
"title": ""
},
{
"docid": "03e923891e136f8832ba0c10893b39e1",
"score": "0.59257036",
"text": "def member?\n end",
"title": ""
},
{
"docid": "fe034a9ecde46bfe355ca1ed41ebf6f4",
"score": "0.59247136",
"text": "def member?(user)\n membership_for(user).present?\n end",
"title": ""
},
{
"docid": "e6035fc17c088fe6a631be3e8b2af2b3",
"score": "0.59201986",
"text": "def single_ip?\n return true if to_ip.blank? and netmask.blank?\n end",
"title": ""
},
{
"docid": "23fd0fc26ad4c552243a419dc6d23f9a",
"score": "0.58904016",
"text": "def has_writable_server?(cluster); true; end",
"title": ""
},
{
"docid": "23fd0fc26ad4c552243a419dc6d23f9a",
"score": "0.58904016",
"text": "def has_writable_server?(cluster); true; end",
"title": ""
},
{
"docid": "40edf6be36de30a989d378e60b64637a",
"score": "0.5882158",
"text": "def slave?\n type == 'SLAVE'\n end",
"title": ""
},
{
"docid": "c65917df9512f629d8f6e335ec08591a",
"score": "0.5876009",
"text": "def member?(user)\n members.include?(user)\n end",
"title": ""
},
{
"docid": "6ab00131dccb9a14d14088c92a3bf046",
"score": "0.5860572",
"text": "def member?(user)\n @members.member? user\n end",
"title": ""
},
{
"docid": "3c28003f2cd2b8f8c88c98310cdeca44",
"score": "0.58475864",
"text": "def check_if_has_primary\n unless topology.replica_set?\n raise ArgumentError, \"check_if_has_primary should only be called when topology is replica set, but it is #{topology.class.name.sub(/.*::/, '')}\"\n end\n\n primary = servers_list.detect do |server|\n # A primary with the wrong set name is not a primary\n server.primary? && server.description.replica_set_name == topology.replica_set_name\n end\n unless primary\n @topology = Topology::ReplicaSetNoPrimary.new(\n topology.options, topology.monitoring, self)\n end\n end",
"title": ""
},
{
"docid": "462b9196a5001ed98074509805d9fa11",
"score": "0.58183485",
"text": "def member?(user)\n users.each do |member|\n return true if member.id == user.id\n end\n false\n end",
"title": ""
},
{
"docid": "c4bc8146ac56d5e3afb7ea878142de2e",
"score": "0.5794854",
"text": "def alone_in_container?\n peers.size == 1\n end",
"title": ""
},
{
"docid": "803c38d4961eafc1c03ccfff52cfc5b5",
"score": "0.5787014",
"text": "def member?\n @attrs[:member] || permissions.member? rescue nil\n end",
"title": ""
},
{
"docid": "c26be404cd8a98122745a356c8e8b475",
"score": "0.57823294",
"text": "def is_owner? member\n if self.member\n return self.member == member\n else\n return false\n end\n end",
"title": ""
},
{
"docid": "a45f4b9310b7dbd1d366b7a03ea8d938",
"score": "0.5780204",
"text": "def replica?; end",
"title": ""
},
{
"docid": "e0d850e3df29b78c10af7a9b3b406009",
"score": "0.5779632",
"text": "def is_member?(user)\r\n false\r\n end",
"title": ""
},
{
"docid": "b3ab00327daf8b75e32d1dd076b3693b",
"score": "0.5774561",
"text": "def member?\n !id.nil?\n end",
"title": ""
},
{
"docid": "b3ab00327daf8b75e32d1dd076b3693b",
"score": "0.5774561",
"text": "def member?\n !id.nil?\n end",
"title": ""
},
{
"docid": "7713bb1b52bfa579a35b634cd0fc8c3d",
"score": "0.57650924",
"text": "def is_member?(uwnetids)\n uwnetids = uwnetids.join(\",\") if uwnetids.is_a?(Array)\n return connection.get(constructed_path + \"/member/#{uwnetids}\") ? true : false\n end",
"title": ""
},
{
"docid": "7749b55f1d0859e1debcab76c322da74",
"score": "0.57543886",
"text": "def is_node?\n if list_arbitrary_node(self.dn_ldap, self.host_ldap, self.port_ldap, self.rootdn_ldap, self.passdn_ldap).length > 1 then\n return true\n else\n return false\n end\n end",
"title": ""
},
{
"docid": "ac42d7b62dcd9698b31ebc3658cfcb8d",
"score": "0.57527",
"text": "def member?(user)\n user.has_role? :member, self\n end",
"title": ""
},
{
"docid": "633ab4ac950d4836098d73abec5bbbb1",
"score": "0.5739921",
"text": "def server?(server_ip)\n get_server_or_servers server_ip\n end",
"title": ""
},
{
"docid": "633ab4ac950d4836098d73abec5bbbb1",
"score": "0.5739921",
"text": "def server?(server_ip)\n get_server_or_servers server_ip\n end",
"title": ""
},
{
"docid": "cebe2d12b56c0c4e1bc961c2f4923f0c",
"score": "0.5732361",
"text": "def replicaset_status\n status = get_mongo_doc('replSetGetStatus' => 1)\n return nil if status.nil?\n return status\n rescue StandardError => e\n if @debug\n puts 'Error checking replSetGetStatus: ' + e.message\n puts e.backtrace.inspect\n end\n end",
"title": ""
},
{
"docid": "cebe2d12b56c0c4e1bc961c2f4923f0c",
"score": "0.5732361",
"text": "def replicaset_status\n status = get_mongo_doc('replSetGetStatus' => 1)\n return nil if status.nil?\n return status\n rescue StandardError => e\n if @debug\n puts 'Error checking replSetGetStatus: ' + e.message\n puts e.backtrace.inspect\n end\n end",
"title": ""
},
{
"docid": "f19888cfa43952d3f600216fbaf9e560",
"score": "0.5728439",
"text": "def standalone?\n ok? &&\n config['msg'] != 'isdbgrid' &&\n config['setName'].nil? &&\n config['isreplicaset'] != true\n end",
"title": ""
},
{
"docid": "47f68e9fd758ee5ba5221dc46e36d046",
"score": "0.5728307",
"text": "def configure_replicaset(config)\n raise \"Invalid config #{config}\" unless replicaset_config_valid?(config)\n\n address = replicaset_writeable_members(config['members']).first['host']\n\n with_mongodb_connection([address], database: 'admin', connect: :direct) do |client|\n client.command(replSetInitiate: config)\n end\n end",
"title": ""
},
{
"docid": "50dce077b1b4aab75ae7fcc94ce798f3",
"score": "0.5727812",
"text": "def contains?(addr)\n t(addr).contains?(addr)\n end",
"title": ""
},
{
"docid": "6808422a32a7b603dc0810c2dd64c83d",
"score": "0.5725817",
"text": "def member?\n client.organization_member? org_id, github_user.login\n end",
"title": ""
},
{
"docid": "fa85b654bb46161f87c9bde2db01d83f",
"score": "0.5725674",
"text": "def check_member_in?(leaderboard_name, member)\n !@redis_connection.zscore(leaderboard_name, member).nil?\n end",
"title": ""
},
{
"docid": "c2d5898ae65c0d137afe749eab5031e0",
"score": "0.57208586",
"text": "def is_member?\n @user && @user.member?\n end",
"title": ""
},
{
"docid": "688308503f12745214885db5fc1911ec",
"score": "0.57167137",
"text": "def member?(clus_name, serv_name, serv_node, bin_directory = new_resource.bin_dir)\n # Get all server members from the cluster\n cookbook_file \"#{bin_directory}/cluster_member_exists.py\" do\n cookbook 'websphere'\n source 'cluster_member_exists.py'\n mode '0755'\n action :create\n end\n Chef::Log.info(\"Checking for: #{clus_name} #{serv_node} #{serv_name}\")\n cmd = \"-f #{bin_directory}/cluster_member_exists.py #{clus_name} #{serv_node} #{serv_name}\"\n mycmd = wsadmin_returns(cmd)\n return false if mycmd.error?\n Chef::Log.debug(\"Result from member query #{mycmd.stdout}\")\n return true if mycmd.stdout.include?('===1===')\n false\n end",
"title": ""
},
{
"docid": "ee462ba41e95a713109caf3724613859",
"score": "0.5702162",
"text": "def standalone?\n $mongo_client ||= initialize_scanned_client!\n $standalone ||= $mongo_client.cluster.servers.first.standalone?\nend",
"title": ""
},
{
"docid": "ee462ba41e95a713109caf3724613859",
"score": "0.5702162",
"text": "def standalone?\n $mongo_client ||= initialize_scanned_client!\n $standalone ||= $mongo_client.cluster.servers.first.standalone?\nend",
"title": ""
},
{
"docid": "b72013eb4306e46a3b9da1d7833ce502",
"score": "0.56933856",
"text": "def slave?\n self.type == 'SLAVE'\n end",
"title": ""
},
{
"docid": "b72013eb4306e46a3b9da1d7833ce502",
"score": "0.56933856",
"text": "def slave?\n self.type == 'SLAVE'\n end",
"title": ""
},
{
"docid": "b72013eb4306e46a3b9da1d7833ce502",
"score": "0.56933856",
"text": "def slave?\n self.type == 'SLAVE'\n end",
"title": ""
},
{
"docid": "476a760ba880f561ffbecee46c02c6ee",
"score": "0.5679284",
"text": "def has_member?(user)\n\t\t\tuser.member_of?(self)\n\t\tend",
"title": ""
},
{
"docid": "7a1a4e806fc0cdba66ed6309c877a038",
"score": "0.56777716",
"text": "def owned_by?(member)\n return true if self.member.eql? member\n false\n end",
"title": ""
},
{
"docid": "29e98aff7b2a5e7a40f5611b4be3eda1",
"score": "0.5674846",
"text": "def member?(arg0)\n end",
"title": ""
},
{
"docid": "29e98aff7b2a5e7a40f5611b4be3eda1",
"score": "0.5674846",
"text": "def member?(arg0)\n end",
"title": ""
},
{
"docid": "7bb8523b788fe407735c68e46c8f1a4d",
"score": "0.56653893",
"text": "def check_member?(member)\n check_member_in?(@leaderboard_name, member)\n end",
"title": ""
},
{
"docid": "e9a2e538f2f3e979503bd3d958207607",
"score": "0.56650454",
"text": "def single_mongos?\n ClusterConfig.instance.single_server? && ClusterConfig.instance.mongos?\nend",
"title": ""
},
{
"docid": "321be82f4abfecfed1a2c38cb7c4de68",
"score": "0.56529695",
"text": "def check_rs_cluster(w = nil, c = nil, i)\n if replica_set?\n primary = 0\n arbiter = 0\n secondary = 0\n rsstats['members'].each do |m|\n case m['state']\n when 1\n primary += 1\n when 7\n arbiter += 1\n when 2\n secondary += 1\n end\n end\n message = ''\n severity = ''\n if primary > 0 && secondary > 0 && arbiter > 0\n message = \"Replicate Set OK: primary: #{primary}, secondary: #{secondary}, arbiter: #{arbiter}\"\n else\n message = \"Replicate Set Not OK: primary: #{primary}, secondary: #{secondary}, arbiter: #{arbiter}\"\n severity = 'CRITICAL'\n end\n assemble_message(message, nil, nil, nil, nil, severity)\n\n else\n message = 'Node is not configured with Replica Set'\n assemble_message(message, value, w, c, i, severity)\n end\n end",
"title": ""
},
{
"docid": "542a669e3cbb304c529ef80d79ad42a5",
"score": "0.56448454",
"text": "def instance_member?\n @instance_member\n end",
"title": ""
},
{
"docid": "872a3582e0fd90ff6b09780fde3c38b2",
"score": "0.56439936",
"text": "def owner_iam_member? identity\n lookup_access_role_scope_value :owner, :iam_member, identity\n end",
"title": ""
},
{
"docid": "6a94eb95681b725398062b9cc94cd017",
"score": "0.56366515",
"text": "def person_is_member?(person)\n person && relation_for_owner(person).try(:member?)\n end",
"title": ""
},
{
"docid": "1876059f49281157521c3121886d38f7",
"score": "0.563311",
"text": "def replica_set_name\n options[:replica_set_name]\n end",
"title": ""
},
{
"docid": "c804148cd05fe78a16e36f7ca7c5eaf1",
"score": "0.5631173",
"text": "def same_host_as?(db)\n @ip == db.ip\n end",
"title": ""
},
{
"docid": "bacce59f783160e332a9f5505c334b6d",
"score": "0.562989",
"text": "def slave_status(master, slave)\n return true if $client_addr =~ /#{slave}/\n end",
"title": ""
},
{
"docid": "1c82959d0f4e0ef88761df2f12fdb221",
"score": "0.5623816",
"text": "def is_master_master?\n if mc = self.master_connection then\n mstat = mc.stat\n mslave_host = manager.ip_of(mstat['mhost'])\n mslave_port = mstat['mport']\n\n mslave_conn_string = \"#{mslave_host}:#{mslave_port}\"\n\n my_host = manager.ip_of( configuration.host )\n my_conn_string = \"#{my_host}:#{configuration.port}\"\n logger.debug \"#is_master_master? -> my_conn_string = #{my_conn_string} mslave_conn_string = #{mslave_conn_string}\"\n\n return (my_conn_string == mslave_conn_string)\n end\n return false\n end",
"title": ""
},
{
"docid": "1da11ce496387c4571ec29f2f792429e",
"score": "0.562301",
"text": "def member_of_account?\n current_member.present?\n end",
"title": ""
},
{
"docid": "db4b691da20451e08505e5741be8da5c",
"score": "0.5617081",
"text": "def dnssec_elegible?\n return false if slave?\n\n true\n end",
"title": ""
},
{
"docid": "eaf06f25f33fb4e63dbafac68833bcd0",
"score": "0.5617022",
"text": "def is_member?(applicant)\n # TODO: check if applicant is a NUCATS member\n # using more than simply the nu domain information\n nucats_members = query_nucats_membership(netid: applicant.username)\n nucats_members = query_nucats_membership(email: applicant.email) if nucats_members.blank? && !applicant.email.blank?\n return %w(enrolled netid_verified).include? nucats_members.first['state'] if nucats_members.count == 1\n false\n end",
"title": ""
},
{
"docid": "9a9ebffec1253e69bfd82fb4284104da",
"score": "0.5616726",
"text": "def center_has_member?(user)\r\n self.center.all_users.include? user\r\n end",
"title": ""
},
{
"docid": "3b25bd9d70e64b247543e137ca903bb4",
"score": "0.5609831",
"text": "def ipaddr?\n @ipaddr ? true : false\n end",
"title": ""
},
{
"docid": "d245b5341b98f17b57ff8ee879f81119",
"score": "0.5606975",
"text": "def has_readable_server?(cluster, server_selector = nil); true; end",
"title": ""
},
{
"docid": "d245b5341b98f17b57ff8ee879f81119",
"score": "0.5606975",
"text": "def has_readable_server?(cluster, server_selector = nil); true; end",
"title": ""
},
{
"docid": "f8b17f6544e3175461f32bf595c6edb7",
"score": "0.56001395",
"text": "def is_owner? member\n self.member == member\n end",
"title": ""
},
{
"docid": "aaf2905c2fa69f5ddf09325dcd5fffa1",
"score": "0.5589924",
"text": "def server_defined?\n !!server\n end",
"title": ""
},
{
"docid": "30d665e2552a9784cb7f2479f6b009e0",
"score": "0.55750775",
"text": "def self_reference_or_admin?\n\t\t\tis_admin? or current_user.id == set_user.id\n\t\tend",
"title": ""
},
{
"docid": "9c57f647f3149bf92ccb5b8e093848be",
"score": "0.5574677",
"text": "def slave_of?(master)\n current_master == master\n end",
"title": ""
},
{
"docid": "ab4d028f2b660f159d941a537008b7c8",
"score": "0.5573053",
"text": "def single_nick?\n @nick != '*' && @nick !~ /^!/\n end",
"title": ""
},
{
"docid": "ab4d028f2b660f159d941a537008b7c8",
"score": "0.5573053",
"text": "def single_nick?\n @nick != '*' && @nick !~ /^!/\n end",
"title": ""
},
{
"docid": "3bb45613ccf10c83c3342aba6579db83",
"score": "0.5568288",
"text": "def machine_has_address?(machine)\n !!(machine and AutoNetwork.active_pool_manager.address_for(machine))\n end",
"title": ""
},
{
"docid": "ac0ebcf69a5c81bea8159f09a66551c3",
"score": "0.55651546",
"text": "def config_member?\n self.role.is_a? ConfigRole\n end",
"title": ""
}
] |
dfaf5fd92ac09fe229ec86946f313e0f | Runs block between paused/resumed on onboard speaker | [
{
"docid": "593da23ae7a047d9d035d12b2d0facd5",
"score": "0.0",
"text": "def priority t=nil, &b\n p DS: default_sink\n default_sink.pause\n b.call\n default_sink.resume\n end",
"title": ""
}
] | [
{
"docid": "aaf21804900a805ca25572c3cc931309",
"score": "0.7253818",
"text": "def pause_inscription\n @paused = true\n end",
"title": ""
},
{
"docid": "4308faa816fadf142955a950ed9646aa",
"score": "0.697977",
"text": "def paused?; end",
"title": ""
},
{
"docid": "4308faa816fadf142955a950ed9646aa",
"score": "0.697977",
"text": "def paused?; end",
"title": ""
},
{
"docid": "7ec5728a1b5ff3e692ada6b11a9a2231",
"score": "0.69040745",
"text": "def run\n @paused = false\n end",
"title": ""
},
{
"docid": "cba02b481f35f684da9b7761b03e4dda",
"score": "0.6891809",
"text": "def onPause(&block)\n set_event_proc(:onPause, block)\n end",
"title": ""
},
{
"docid": "96dfe425968e3ca1fa9f60bc377598bb",
"score": "0.6857333",
"text": "def on_pause\n\t\treturn nil # no-op\n\tend",
"title": ""
},
{
"docid": "62a2282efef89a33c6a5d19c2192adc0",
"score": "0.67696476",
"text": "def onPause(&block)\n set_proc(:onPause, block)\n end",
"title": ""
},
{
"docid": "2fda710543d0d039e450fb81841d92a1",
"score": "0.672905",
"text": "def accompaniment_program_paused\n end",
"title": ""
},
{
"docid": "6a8bd8044f183385f3f6ce2dc01142fb",
"score": "0.6661999",
"text": "def continue\n @paused = false\n end",
"title": ""
},
{
"docid": "727201d4875575fb549c493d5eecb8ed",
"score": "0.6653914",
"text": "def resume!\n _raise Error, \"not in run!\" unless @in_run\n @paused = false\n end",
"title": ""
},
{
"docid": "643369e94017bc3d129992d2dea73b47",
"score": "0.6621718",
"text": "def pause\n #\n end",
"title": ""
},
{
"docid": "e6725518bb14e6b294ee2403456f24e9",
"score": "0.65972775",
"text": "def pause\n end",
"title": ""
},
{
"docid": "e6725518bb14e6b294ee2403456f24e9",
"score": "0.65972775",
"text": "def pause\n end",
"title": ""
},
{
"docid": "e6725518bb14e6b294ee2403456f24e9",
"score": "0.65972775",
"text": "def pause\n end",
"title": ""
},
{
"docid": "e6725518bb14e6b294ee2403456f24e9",
"score": "0.65972775",
"text": "def pause\n end",
"title": ""
},
{
"docid": "e7edea019312821e4182c08fa4cc74ee",
"score": "0.65940505",
"text": "def pause()\r\n # nothing here\r\n end",
"title": ""
},
{
"docid": "c3fba1850d67e5073969dd9028501eda",
"score": "0.6588718",
"text": "def pause_resume\n self.paused = paused == 1 ? 0 : 1\n self.save\n self.set_status\n end",
"title": ""
},
{
"docid": "6328ded0c3ba0fd5662023dd056b7357",
"score": "0.6548762",
"text": "def before_pause(&block)\n block ? register_hook(:before_pause, block) : hooks(:before_pause)\n end",
"title": ""
},
{
"docid": "3de4d59de00b7581ef55e74f238d3dbb",
"score": "0.6546841",
"text": "def state_paused; end",
"title": ""
},
{
"docid": "77f47edbe04e22756cef4c93c3044d3d",
"score": "0.6542997",
"text": "def pause; end",
"title": ""
},
{
"docid": "77f47edbe04e22756cef4c93c3044d3d",
"score": "0.6542997",
"text": "def pause; end",
"title": ""
},
{
"docid": "77f47edbe04e22756cef4c93c3044d3d",
"score": "0.6542997",
"text": "def pause; end",
"title": ""
},
{
"docid": "77f47edbe04e22756cef4c93c3044d3d",
"score": "0.6542997",
"text": "def pause; end",
"title": ""
},
{
"docid": "77f47edbe04e22756cef4c93c3044d3d",
"score": "0.6542997",
"text": "def pause; end",
"title": ""
},
{
"docid": "2f9ef465bf4e9e6fb54d6f15e4d0c121",
"score": "0.654271",
"text": "def resume\n end",
"title": ""
},
{
"docid": "2f9ef465bf4e9e6fb54d6f15e4d0c121",
"score": "0.654271",
"text": "def resume\n end",
"title": ""
},
{
"docid": "2f9ef465bf4e9e6fb54d6f15e4d0c121",
"score": "0.654271",
"text": "def resume\n end",
"title": ""
},
{
"docid": "2f9ef465bf4e9e6fb54d6f15e4d0c121",
"score": "0.654271",
"text": "def resume\n end",
"title": ""
},
{
"docid": "4eedd536f465e745ff5a0916ec158652",
"score": "0.65023243",
"text": "def pause\n @paused = true\n end",
"title": ""
},
{
"docid": "4eedd536f465e745ff5a0916ec158652",
"score": "0.65023243",
"text": "def pause\n @paused = true\n end",
"title": ""
},
{
"docid": "adfb5c9fd9a4be6c385ce1ae59d455ab",
"score": "0.64836806",
"text": "def resume\n end",
"title": ""
},
{
"docid": "e119ac98ba562c5b064422766999be0b",
"score": "0.64823896",
"text": "def start_paused\n @start_paused\n end",
"title": ""
},
{
"docid": "e119ac98ba562c5b064422766999be0b",
"score": "0.64823896",
"text": "def start_paused\n @start_paused\n end",
"title": ""
},
{
"docid": "90a86ee208585f350198f13cd3c7a0b3",
"score": "0.6482356",
"text": "def resume; end",
"title": ""
},
{
"docid": "90a86ee208585f350198f13cd3c7a0b3",
"score": "0.6482356",
"text": "def resume; end",
"title": ""
},
{
"docid": "90a86ee208585f350198f13cd3c7a0b3",
"score": "0.6482356",
"text": "def resume; end",
"title": ""
},
{
"docid": "90a86ee208585f350198f13cd3c7a0b3",
"score": "0.6482356",
"text": "def resume; end",
"title": ""
},
{
"docid": "e119ac98ba562c5b064422766999be0b",
"score": "0.64812607",
"text": "def start_paused\n @start_paused\n end",
"title": ""
},
{
"docid": "e119ac98ba562c5b064422766999be0b",
"score": "0.64812607",
"text": "def start_paused\n @start_paused\n end",
"title": ""
},
{
"docid": "e119ac98ba562c5b064422766999be0b",
"score": "0.64812607",
"text": "def start_paused\n @start_paused\n end",
"title": ""
},
{
"docid": "d9070202f237875d841e318ee2b8645f",
"score": "0.6444102",
"text": "def resume\n #\n end",
"title": ""
},
{
"docid": "d27178cef68b7a7a959db967642ee4b6",
"score": "0.6436104",
"text": "def pause\n @paused += 1\n end",
"title": ""
},
{
"docid": "832481a13ec0462a79d56dc0b150aae6",
"score": "0.642552",
"text": "def onPause\n super\n end",
"title": ""
},
{
"docid": "0dfb4ecb01f2776392101df477bd2856",
"score": "0.6409658",
"text": "def run!\n manage! unless paused?\n end",
"title": ""
},
{
"docid": "3081e47cb2a44baf90f03171339ca6c5",
"score": "0.64095014",
"text": "def resume\n # TODO\n end",
"title": ""
},
{
"docid": "549f87ce0795391a15e351a1a90fb8c8",
"score": "0.6409069",
"text": "def before_pause(&block)\n block ? register_hook(:before_pause, block) : hooks(:before_pause)\n end",
"title": ""
},
{
"docid": "5684b297a1f8276d18eca1b6d3aa1e58",
"score": "0.6398846",
"text": "def pause!\n _raise Error, \"not in run!\" unless @in_run\n @paused = true\n end",
"title": ""
},
{
"docid": "54f6600dec28f99e24a7f7aec136933b",
"score": "0.6385124",
"text": "def before_pause=(block)\n register_hook(:before_pause, block)\n end",
"title": ""
},
{
"docid": "5555c5337c4ffff28f7f0d0e3cedb595",
"score": "0.6364276",
"text": "def after_pause(&block)\n block ? register_hook(:after_pause, block) : hooks(:after_pause)\n end",
"title": ""
},
{
"docid": "3a26a65e39086a45fd0ff8261212d62e",
"score": "0.6309266",
"text": "def pause\n unless @state == :pausing || @state == :paused\n @state = :pausing\n @timers[:run].each do |timer|\n timer.cancel\n end\n @timers[:run].clear\n unsubscribe\n resign_as_leader\n @state = :paused\n end\n end",
"title": ""
},
{
"docid": "ca1a52f2051ac3b252ccdfefaec07a41",
"score": "0.62931013",
"text": "def resume!\n # TODO: implement resume\n end",
"title": ""
},
{
"docid": "b1de175b29b92425ab5313118160a20e",
"score": "0.6288683",
"text": "def pause\n unless paused?\n play_or_pause\n end\n end",
"title": ""
},
{
"docid": "2bb315fb3c23b4dafea7a93addaeaac8",
"score": "0.62714654",
"text": "def pause\n return if @pause\n log_debug 'pause read'\n @pause = true\n @was_paused = true\n nil\n end",
"title": ""
},
{
"docid": "b0aa0f4fa977449f727fc18ce2339ffc",
"score": "0.62696934",
"text": "def resume\n synchronize do\n @done = false\n @stopped = false\n @paused = false\n end\n end",
"title": ""
},
{
"docid": "52ab191993fea399e055e5aa0d8722ac",
"score": "0.62687373",
"text": "def running\n\t \t @pause\n\t end",
"title": ""
},
{
"docid": "9d215e28074e5a8a755e17b508089cc1",
"score": "0.625696",
"text": "def resume\n end",
"title": ""
},
{
"docid": "d89f326faa9f0b91279a578875d1056f",
"score": "0.62522805",
"text": "def pause\n raise ArgumentError, 'around_transition callbacks cannot be called in multiple execution contexts in java implementations of Ruby. Use before/after_transitions instead.' unless self.class.pause_supported?\n\n unless @resume_block\n require 'continuation' unless defined?(callcc)\n callcc do |block|\n @paused_block = block\n throw :halt, true\n end\n end\n end",
"title": ""
},
{
"docid": "515709ea42708c0edc6d407da408e510",
"score": "0.6237355",
"text": "def before_pause=(block)\n register_hook(:before_pause, block)\n end",
"title": ""
},
{
"docid": "5d45f8dd0c1aafb200e3e7d78b865a82",
"score": "0.6221189",
"text": "def after_pause=(block)\n register_hook(:after_pause, block)\n end",
"title": ""
},
{
"docid": "02d8133dc2082cf6b5108d8110d462e1",
"score": "0.62061787",
"text": "def paused?\n false\n end",
"title": ""
},
{
"docid": "67fbf982de97088942f52eb4221d4914",
"score": "0.62060213",
"text": "def playPause\n curstate = ITC.getStatusText\n ITC.playPause\n ITCMonitor.start if curstate == 'Stopped'\n updateStatus\n end",
"title": ""
},
{
"docid": "14af5957415021d2952288a72f1f75b5",
"score": "0.6200164",
"text": "def playpause\n paused? ? play : pause\n end",
"title": ""
},
{
"docid": "1f0837c3afd10cc70dcd29c2abc45f16",
"score": "0.6199559",
"text": "def after_pause(&block)\n block ? register_hook(:after_pause, block) : hooks(:after_pause)\n end",
"title": ""
},
{
"docid": "13c7fcdffbbd485bf039b5b629f03c0d",
"score": "0.6193944",
"text": "def pause\n sleep 1\n end",
"title": ""
},
{
"docid": "011b614d0146490dd7fd2217354eb335",
"score": "0.6191821",
"text": "def pause\n @state = :paused\n end",
"title": ""
},
{
"docid": "3c4a1dae282093204acbb580faba4796",
"score": "0.61879975",
"text": "def service_resume\n #TODO: implement pause and resume\n end",
"title": ""
},
{
"docid": "c6bb6812c871703d7e3712ef19ea1bb1",
"score": "0.61784923",
"text": "def pause\n send_command('Pause')\n @paused = !@paused\n end",
"title": ""
},
{
"docid": "29c00db68658265b987c2f420d94db72",
"score": "0.6173766",
"text": "def resume\n if @status == :paused\n @status = :playing\n DhunExt.resume\n notify mp3_tag(@current),:sticky => false\n return true\n end\n return false\n end",
"title": ""
},
{
"docid": "55f303d63bc14ae89e82754e844929be",
"score": "0.61735195",
"text": "def on_resume\n\t\treturn nil # no-op\n\tend",
"title": ""
},
{
"docid": "7408eb96f1700b8a431afe2564134e9e",
"score": "0.61659414",
"text": "def resume\n return unless paused?\n\n @thread.wakeup if @thread\n end",
"title": ""
},
{
"docid": "ae9c444855780dd4038de9b2763552ce",
"score": "0.6163525",
"text": "def resume\n send_signal('CONT')\n end",
"title": ""
},
{
"docid": "41a1acea1d21fc9e2aa14a8bf200a9b7",
"score": "0.6152164",
"text": "def pause()\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "c745e893f104fd30ab9d512666be2fea",
"score": "0.6149513",
"text": "def mettreEnPause()\n top()\n @pause = true\n end",
"title": ""
},
{
"docid": "7f1bdda414332bb1bd3b274576e7f4e9",
"score": "0.6135017",
"text": "def pause_in_player\n toggle_pause\n end",
"title": ""
},
{
"docid": "2b8b9a362b9fc5f90af600ffb5b8afd8",
"score": "0.61249596",
"text": "def unpause_inscription\n @paused = false\n inscribe_tarot\n end",
"title": ""
},
{
"docid": "8c4a598c83a8423c995b495c9349bd3a",
"score": "0.6122514",
"text": "def pause\n\t\t\tself\n\t\tend",
"title": ""
},
{
"docid": "b8832460ea080fd4c450633b3bf4837e",
"score": "0.6105866",
"text": "def onPlay(&block)\n set_event_proc(:onPlay, block)\n end",
"title": ""
},
{
"docid": "c9103c97582127c682da237df25e1bda",
"score": "0.6103343",
"text": "def resume(*_); end",
"title": ""
},
{
"docid": "c9103c97582127c682da237df25e1bda",
"score": "0.6103343",
"text": "def resume(*_); end",
"title": ""
},
{
"docid": "a89926f85657ccc55154f0eb220be696",
"score": "0.60940313",
"text": "def resume aCallback\n @@userRun.enq aCallback\n attach\n end",
"title": ""
},
{
"docid": "74b14c1d5f5e4acc509c077b94dacba4",
"score": "0.60845697",
"text": "def pause( &block )\n @framework.pause( &block )\n end",
"title": ""
},
{
"docid": "d485c32d619120055c9ecb15a741cf79",
"score": "0.60761046",
"text": "def trigger_resumed\n resume_callbacks.each(&:call)\n end",
"title": ""
},
{
"docid": "9c9bf1dbdea920b51446caf56f5bfc2d",
"score": "0.60673344",
"text": "def part_1\n use_synth :hollow\n 2.times do\n 3.times do\n play:E4, amp: 4; sleep 0.5\n end\n sleep 0.5\n end\nend",
"title": ""
},
{
"docid": "d626c14347041b11e0f1d7a147f90373",
"score": "0.6061368",
"text": "def resume\n start\n end",
"title": ""
},
{
"docid": "0c18f3e5d4bcfe15b8ea72592ad77f15",
"score": "0.6057874",
"text": "def resume_in_player\n if paused?\n toggle_pause\n else\n play_in_player current_song\n end\n end",
"title": ""
},
{
"docid": "66efdaafc3e3ed4ab6b5a41646246be6",
"score": "0.6044587",
"text": "def onPlay(&block)\n set_proc(:onPlay, block)\n end",
"title": ""
},
{
"docid": "6f69b6a0b880ef86e399a181de297968",
"score": "0.6044102",
"text": "def service_pause\n #TODO: implement pause and resume\n end",
"title": ""
},
{
"docid": "e6da8b1113a13c82d953f2302eca397c",
"score": "0.6039548",
"text": "def after_pause=(block)\n register_hook(:after_pause, block)\n end",
"title": ""
},
{
"docid": "7c775e7a30796516bf73227644771127",
"score": "0.6028855",
"text": "def pause_processing\n log_with_severity :info, \"USR2 received; pausing job processing\"\n run_hook :before_pause, self\n @paused = true\n end",
"title": ""
},
{
"docid": "9a95017b947068dd273877cc7d854128",
"score": "0.60249925",
"text": "def resume\n if @isPaused == true\n @status_details =\"Resumed at #{DateTime.now}\"\n @isPaused = false\n report_progress(Action::STATUS_INPROGRESS, @status_details)\n end\n return true\n end",
"title": ""
},
{
"docid": "accbad8fbd13adfe571cf6e3bc41af78",
"score": "0.60173756",
"text": "def pause\n @active = false\n end",
"title": ""
},
{
"docid": "773f7dfc06faec1989037c126037b005",
"score": "0.60102856",
"text": "def pause_processing\n logger.info \"USR2 received; pausing job processing\"\n @paused = true\n end",
"title": ""
},
{
"docid": "bb31156949eb3bdee29e41103fced1fe",
"score": "0.60057855",
"text": "def pause\n @pause\n end",
"title": ""
},
{
"docid": "279c8bdd47eb380a7b934b3a795e141d",
"score": "0.6001875",
"text": "def suspend\n end",
"title": ""
},
{
"docid": "38dce45537f3351ebf4f62b143eab7bb",
"score": "0.59887093",
"text": "def pause\n @ctl.yield nil\n end",
"title": ""
},
{
"docid": "c757cbba23febaaae428935ab556f2a8",
"score": "0.59868777",
"text": "def handle_television\n\t\tstart = get_offset\n\t\t\n\t\t# Check offset again 1 second later\n\t\tjob_id =\n Rufus::Scheduler.singleton.in '1s' do\n \tfinish = get_offset\n\n \t# If the offsets are different, pause whatever is playing\n if start != finish\n \tresponse = Net::HTTP.get(URI(\"http://68.65.171.134:8080/remote/processKey?key=pause\"))\n\t\t \t#response = Net::HTTP.get(URI(\"http://10.19.188.238:8080/remote/processKey?key=pause\"))\n\t\t end\n end\n\n\tend",
"title": ""
},
{
"docid": "0befafb6413e9a0da5f52e353005326f",
"score": "0.5972974",
"text": "def pause\n send_transport_message('Pause')\n end",
"title": ""
},
{
"docid": "59f4f9f1efd178b813a782a8823c9850",
"score": "0.5971464",
"text": "def resume\n SDL::Mixer.Resume(@channel)\n self\n end",
"title": ""
},
{
"docid": "9f109d7fc0313ee40e656a5a97e92923",
"score": "0.59686804",
"text": "def state_resumed; end",
"title": ""
},
{
"docid": "c21dbb6f45e91945b1e6913fcfd29a5c",
"score": "0.5954729",
"text": "def service_pause\n end",
"title": ""
},
{
"docid": "1dbd5ce8f9ff6d602ff8227d6d32d601",
"score": "0.5951737",
"text": "def block\n begin\n while active?\n sleep(0.001)\n end\n while FFI::PortAudio::API.Pa_IsStreamActive(@stream.read_pointer) != :paNoError\n sleep(0.1)\n end\n rescue SystemExit, Interrupt\n # Control-C\n @is_playing = false\n exit\n end\n @is_playing = false\n true\n end",
"title": ""
}
] |
c050839e26c108c991d74b16c98382dc | DELETE /projects/1 DELETE /projects/1.json | [
{
"docid": "eb9b0e31953ee63fcb043ee6a331e345",
"score": "0.75030017",
"text": "def destroy\n authorize! :destroy, @project\n @project.destroy\n\n head :no_content\n end",
"title": ""
}
] | [
{
"docid": "2395db8e8b2d56dc1e97347626464cb3",
"score": "0.78940606",
"text": "def destroy\n @project.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "5d7a1cc2cfd84c0e660f50d58157424f",
"score": "0.78581154",
"text": "def destroy\n project.destroy\n\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a47abe0c56db0252b5cea44b812102e1",
"score": "0.7776677",
"text": "def destroy\n @project = Project.find(params[:id])\n \n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "b00b11cfd92068de530607a465131bcf",
"score": "0.7770321",
"text": "def destroy\n # @project = Project.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "fdc52965e988d8402545fdd9098ddd13",
"score": "0.77572984",
"text": "def destroy\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "7ba4889a15628c4629b9f8f695ce054b",
"score": "0.7729462",
"text": "def destroy\n @project.destroy\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "7ba4889a15628c4629b9f8f695ce054b",
"score": "0.77290845",
"text": "def destroy\n @project.destroy\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "7ba4889a15628c4629b9f8f695ce054b",
"score": "0.77290845",
"text": "def destroy\n @project.destroy\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "7ba4889a15628c4629b9f8f695ce054b",
"score": "0.77290845",
"text": "def destroy\n @project.destroy\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "7ba4889a15628c4629b9f8f695ce054b",
"score": "0.77290845",
"text": "def destroy\n @project.destroy\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "7ba4889a15628c4629b9f8f695ce054b",
"score": "0.77290845",
"text": "def destroy\n @project.destroy\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "6374d4b5cd3097253cc2d14168ad3fd1",
"score": "0.77231294",
"text": "def destroy\n @project = Project.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to(projects_url) }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "2ac6b4927ecbaed24200999b5cce8d6d",
"score": "0.7717094",
"text": "def destroy\n @project = Project.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "2ac6b4927ecbaed24200999b5cce8d6d",
"score": "0.7717094",
"text": "def destroy\n @project = Project.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "2ac6b4927ecbaed24200999b5cce8d6d",
"score": "0.7717094",
"text": "def destroy\n @project = Project.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "2ac6b4927ecbaed24200999b5cce8d6d",
"score": "0.7717094",
"text": "def destroy\n @project = Project.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "618ad030d6807471ea395c40c8ea7f36",
"score": "0.7703387",
"text": "def destroy\n @project = Project.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "618ad030d6807471ea395c40c8ea7f36",
"score": "0.7703387",
"text": "def destroy\n @project = Project.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "618ad030d6807471ea395c40c8ea7f36",
"score": "0.7703387",
"text": "def destroy\n @project = Project.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "618ad030d6807471ea395c40c8ea7f36",
"score": "0.7703387",
"text": "def destroy\n @project = Project.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "618ad030d6807471ea395c40c8ea7f36",
"score": "0.7703387",
"text": "def destroy\n @project = Project.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "618ad030d6807471ea395c40c8ea7f36",
"score": "0.7703387",
"text": "def destroy\n @project = Project.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "618ad030d6807471ea395c40c8ea7f36",
"score": "0.7703387",
"text": "def destroy\n @project = Project.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "618ad030d6807471ea395c40c8ea7f36",
"score": "0.7703387",
"text": "def destroy\n @project = Project.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "618ad030d6807471ea395c40c8ea7f36",
"score": "0.7703387",
"text": "def destroy\n @project = Project.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "618ad030d6807471ea395c40c8ea7f36",
"score": "0.7703387",
"text": "def destroy\n @project = Project.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "618ad030d6807471ea395c40c8ea7f36",
"score": "0.7703387",
"text": "def destroy\n @project = Project.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "618ad030d6807471ea395c40c8ea7f36",
"score": "0.7703387",
"text": "def destroy\n @project = Project.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "618ad030d6807471ea395c40c8ea7f36",
"score": "0.7703387",
"text": "def destroy\n @project = Project.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "618ad030d6807471ea395c40c8ea7f36",
"score": "0.7703387",
"text": "def destroy\n @project = Project.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "618ad030d6807471ea395c40c8ea7f36",
"score": "0.7703387",
"text": "def destroy\n @project = Project.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "618ad030d6807471ea395c40c8ea7f36",
"score": "0.7703387",
"text": "def destroy\n @project = Project.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "618ad030d6807471ea395c40c8ea7f36",
"score": "0.7703387",
"text": "def destroy\n @project = Project.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "618ad030d6807471ea395c40c8ea7f36",
"score": "0.7703387",
"text": "def destroy\n @project = Project.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "618ad030d6807471ea395c40c8ea7f36",
"score": "0.7703387",
"text": "def destroy\n @project = Project.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "618ad030d6807471ea395c40c8ea7f36",
"score": "0.7703387",
"text": "def destroy\n @project = Project.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "618ad030d6807471ea395c40c8ea7f36",
"score": "0.7703387",
"text": "def destroy\n @project = Project.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "618ad030d6807471ea395c40c8ea7f36",
"score": "0.7703387",
"text": "def destroy\n @project = Project.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "778df94167282524df4d90c21af0c391",
"score": "0.7698941",
"text": "def destroy\n @project = Project.find(params[:id])\n @project.delete\n\n respond_to do |format|\n format.html { redirect_to request.referer }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "f3c9f4d4f912d286cbd3eab674e0d57a",
"score": "0.76982206",
"text": "def destroy\n @project = Project.find(params[:id])\n @project.status = 'deleted'\n @project.save!\n\n respond_to do |format|\n format.json { render :json => \"success\" }\n end\n end",
"title": ""
},
{
"docid": "4e932036a81274043b4f0c707be13811",
"score": "0.76815325",
"text": "def delete\n @project = Project.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_path }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "61888fc404da4fc58e46fc18cbf0dd9e",
"score": "0.76681346",
"text": "def destroy\n project = Project.find(params[:id])\n project.destroy\n\n respond_to do |format|\n format.html { redirect_to root_path }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "af6c7ba2d5c9f3e83cb5f368c5ce8263",
"score": "0.76585567",
"text": "def destroy\n name = @project.name\n @project.destroy\n render json: [\"You have successfullly deleted '#{name}''\"], status: 200\n end",
"title": ""
},
{
"docid": "0e872a94eca56a40b8dea1f757b6f0db",
"score": "0.7648158",
"text": "def destroy\n @project.destroy\n respond_to do |format|\n format.html { redirect_to admin_projects_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "b06bec4b1a6838d81314a1c18a2278de",
"score": "0.7648096",
"text": "def destroy\r\n @project.destroy\r\n respond_to do |format|\r\n format.html { redirect_to projects_url }\r\n format.json { head :no_content }\r\n end\r\n end",
"title": ""
},
{
"docid": "2382712963bdb9e913642944cd00935c",
"score": "0.7640224",
"text": "def delete(projects)\n project_ids = projects.collect { |project| project.id } \n args = {ids: project_ids.to_json}\n return @client.api_helper.command(args, \"project_delete\")\n end",
"title": ""
},
{
"docid": "e819f70224e5199aadf5908044ae51f8",
"score": "0.7631921",
"text": "def delete\r\n\t\t\trender json: Project.delete_by_id(params[:id])\r\n\t\tend",
"title": ""
},
{
"docid": "9d40a05051fdfc5a20fcad7982623b42",
"score": "0.76140106",
"text": "def destroy\n\t\t@project.destroy\n\t\trespond_to do |format|\n\t\t\tformat.json { head :no_content }\n\t\tend\n\tend",
"title": ""
},
{
"docid": "2ff2dbd3b40ee8ce8dc2e3b2aea93ed4",
"score": "0.76132286",
"text": "def destroy\n @project = Project.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to administration_projects_path }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "aefbafae6d2dbcadb00be1af8dac3eaf",
"score": "0.7609349",
"text": "def destroy\n @project = current_user.projects.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "e24bbe69bcfee425ac9c37a42f503642",
"score": "0.7605296",
"text": "def destroy\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { render :json => {:message=>\"OK\",:id=>@project.id}, :staus=>:ok}\n end\n end",
"title": ""
},
{
"docid": "4206ca5875e3425c409df0ce9ab8d00b",
"score": "0.7603482",
"text": "def destroy\n @project = Project.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_projects_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "b84dafe8a21fbeede16bb95bf32aabc9",
"score": "0.7597622",
"text": "def destroy\n @project.destroy\n head :no_content\n end",
"title": ""
},
{
"docid": "09c8a4ad5c55837f19ab1d27ec9e1d89",
"score": "0.7597122",
"text": "def destroy\t\t\n @project.destroy\n respond_to do |format|\n format.html { redirect_to projects_url, notice: 'Successfully deleted project.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "7be196fd8e692cfaea51e3aec8cbb00e",
"score": "0.7592255",
"text": "def destroy\n @project.destroy\n respond_to do |format|\n format.html { redirect_to projects_url, notice: t('models.project.destroy') }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a4eba79b4cf10996f2226d5d72e2f2f1",
"score": "0.7589832",
"text": "def destroy\n @project = @client.projects.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to @client }\n end\n end",
"title": ""
},
{
"docid": "f75e39df6ff0f92d23c70305b2b81a37",
"score": "0.7588337",
"text": "def destroy\n @project.destroy\n\n head :no_content\n end",
"title": ""
},
{
"docid": "592add135cc158eff66b7cbe9b29a685",
"score": "0.7570942",
"text": "def destroy\n authorize @project\n @project.destroy\n render json: [\"Deleted successfully.\"], status: :ok\n end",
"title": ""
},
{
"docid": "44b4c5c102710e4d6cd96b233f8820c5",
"score": "0.7570288",
"text": "def destroy\n @ourproject = Ourproject.find(params[:id])\n @ourproject.destroy\n\n respond_to do |format|\n format.html { redirect_to ourprojects_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "3e9a30d597c9b44304179107a6bf0615",
"score": "0.75601155",
"text": "def destroy\n @project.destroy_all\n respond_to do |format|\n format.html { redirect_to projects_url, notice: 'The project was successfully removed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "4f0efbc87cc9e1649e64eef16f4ebe2a",
"score": "0.75423044",
"text": "def delete_project(project)\n handle_action_exceptions(__method__) do\n cmd_line = [\"deleteproject '#{project}'\"]\n cmd_line << 'json' if @json\n\n handle_return(@toolshck_ether.cmd(cmd_line.join(' ')))\n end\n end",
"title": ""
},
{
"docid": "c22ed520cf7d495f618485d74aacdd06",
"score": "0.7536747",
"text": "def destroy\n @project = Project.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { render :json => {:valid => true} }\n end\n end",
"title": ""
},
{
"docid": "eb4a17a1251e990430f0a48709fec9e8",
"score": "0.7531406",
"text": "def destroy\n @api_project.destroy\n respond_to do |format|\n format.html { redirect_to api_projects_url, notice: 'Project was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "f4869e21d1bb296ee026bb009d74fc79",
"score": "0.75286824",
"text": "def destroy\n @project.destroy\n respond_to do |format|\n format.html { redirect_to projects_path, notice: 'Project was successfully deleted.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1728caee8cec87138df5d168e62e4059",
"score": "0.7522198",
"text": "def destroy\n @project.destroy\n respond_to do |format|\n format.html { redirect_to projects_url, notice: 'Project was successfully deleted.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1728caee8cec87138df5d168e62e4059",
"score": "0.7522198",
"text": "def destroy\n @project.destroy\n respond_to do |format|\n format.html { redirect_to projects_url, notice: 'Project was successfully deleted.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "c389268bd145431d052acdc258034621",
"score": "0.7517804",
"text": "def destroy\n @project = Project.find_by_permalink(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "71be43d5d6ce2fd6f3dcbcfd49346412",
"score": "0.75062335",
"text": "def delproject(project)\n post('delproject.json', project: project)\n end",
"title": ""
},
{
"docid": "6c7a15b273f2efa825f30de834811245",
"score": "0.7498333",
"text": "def destroy\n @project = Project.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_back(fallback_location: root_path) }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "3d99ed55d0aa35ab32fe3731b428ac20",
"score": "0.74932957",
"text": "def destroy\n Rails.logger.info \"We are deleting project\"\n @todo_project.destroy\n respond_to do |format|\n format.html { redirect_to todo_projects_url, notice: 'Project was successfully deleted.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "ad3ea3d647b2a1a2fd9fbf2917e42354",
"score": "0.7485569",
"text": "def destroy\n @project = @projectable.projects.find(params[:id])\n @project.destroy\n track_activity @project\n\n respond_to do |format|\n format.html { redirect_to [@projectable, :projects] }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "6f6257bb04aaa3298d7549d0ac54895d",
"score": "0.7480241",
"text": "def destroy\n @project = Project.find(params[:id])\n @project.destroy\n @project.users.delete_all\n\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "eafeea8cbe10c51a55bfdfa6c1258203",
"score": "0.74765617",
"text": "def destroy\n \t@project = Project.find(params[:id])\n \t#ap @project\n \t#abort\n \n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to :back }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "11209486da3684e2ebe0c5ee2041ebc6",
"score": "0.74679726",
"text": "def destroy\n authenticate_user!\n @project = Project.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to(projects_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "3ea0a073926d352f667b7c51b7a3bf6b",
"score": "0.74640846",
"text": "def destroy\n @project.destroy\n render json: {message: 'Projeto Excluido'}, status: :ok\n end",
"title": ""
},
{
"docid": "354ec1fa021bfec715249203358655ed",
"score": "0.74595547",
"text": "def destroy\n @project.destroy\n respond_to do |format|\n format.html { redirect_to root_url, notice: 'Project was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "354ec1fa021bfec715249203358655ed",
"score": "0.74595547",
"text": "def destroy\n @project.destroy\n respond_to do |format|\n format.html { redirect_to root_url, notice: 'Project was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "c74d70bd4826bfb0d550af49598a8328",
"score": "0.7451286",
"text": "def destroy\n @project = Project.find_by_slug(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "43046718ea25d8cd4654595a8123a7e7",
"score": "0.7447009",
"text": "def destroy\n\n @project.destroy\n respond_to do |format|\n format.html { redirect_to projects_url, notice: \"Project was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "642c6455020ad1a140a3578a2521b18b",
"score": "0.7445036",
"text": "def destroy\n @project.destroy\n respond_to do |format|\n format.html { redirect_to projects_url, notice: \"#{I18n.t 'project.project_destoy'}\"}\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "b816f516510be8efcdaf8005af347b98",
"score": "0.74432665",
"text": "def destroy\n @project = Admin::Project.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_projects_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "49fa0cea2fc82cf906bc13180c57090c",
"score": "0.7440854",
"text": "def delete_project(optional={})\n\t\targs = self.class.new_params\n\t\targs[:method] = 'DELETE'\n\t\targs[:pattern] = '/projects/[ProjectName]'\n\t\targs[:query]['Action'] = 'DeleteProject'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\targs[:scheme] = 'http'\n\t\tif optional.key? :project_name\n\t\t\targs[:path]['ProjectName'] = optional[:project_name]\n\t\tend\n\t\tself.run(args)\n\tend",
"title": ""
},
{
"docid": "36827ad73400026782359c722b04571d",
"score": "0.7439673",
"text": "def destroy\n @project = current_user.active_projects.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "c990588e89cea955f41f63b1de1daec4",
"score": "0.7436044",
"text": "def destroy\n standard_destroy(Project, params[:id])\n end",
"title": ""
},
{
"docid": "7ee7c9ed97f59638713eee9e89f55016",
"score": "0.7435683",
"text": "def destroy\n authorize! :delete, @project\n @project.destroy\n respond_to do |format|\n format.html { redirect_to projects_url, notice: 'Project was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "8a4afaf0e8d25fb45b6c7c5b286e34df",
"score": "0.7435003",
"text": "def destroy\n @project.destroy\n respond_to do |format|\n format.html { redirect_to projects_url, notice: \"Project was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "8a4afaf0e8d25fb45b6c7c5b286e34df",
"score": "0.7435003",
"text": "def destroy\n @project.destroy\n respond_to do |format|\n format.html { redirect_to projects_url, notice: \"Project was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "8a4afaf0e8d25fb45b6c7c5b286e34df",
"score": "0.7435003",
"text": "def destroy\n @project.destroy\n respond_to do |format|\n format.html { redirect_to projects_url, notice: \"Project was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "e4eabccf3254c09325b990a2565f4cb9",
"score": "0.7434698",
"text": "def destroy\n @project.destroy\n respond_to do |format|\n format.html { redirect_to projects_url, notice: 'Project was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "e4eabccf3254c09325b990a2565f4cb9",
"score": "0.7434698",
"text": "def destroy\n @project.destroy\n respond_to do |format|\n format.html { redirect_to projects_url, notice: 'Project was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "e4eabccf3254c09325b990a2565f4cb9",
"score": "0.7434698",
"text": "def destroy\n @project.destroy\n respond_to do |format|\n format.html { redirect_to projects_url, notice: 'Project was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "e4eabccf3254c09325b990a2565f4cb9",
"score": "0.7434698",
"text": "def destroy\n @project.destroy\n respond_to do |format|\n format.html { redirect_to projects_url, notice: 'Project was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "e4eabccf3254c09325b990a2565f4cb9",
"score": "0.7434698",
"text": "def destroy\n @project.destroy\n respond_to do |format|\n format.html { redirect_to projects_url, notice: 'Project was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "e4eabccf3254c09325b990a2565f4cb9",
"score": "0.7434698",
"text": "def destroy\n @project.destroy\n respond_to do |format|\n format.html { redirect_to projects_url, notice: 'Project was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "e4eabccf3254c09325b990a2565f4cb9",
"score": "0.7434698",
"text": "def destroy\n @project.destroy\n respond_to do |format|\n format.html { redirect_to projects_url, notice: 'Project was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "e4eabccf3254c09325b990a2565f4cb9",
"score": "0.7434698",
"text": "def destroy\n @project.destroy\n respond_to do |format|\n format.html { redirect_to projects_url, notice: 'Project was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "e4eabccf3254c09325b990a2565f4cb9",
"score": "0.7434698",
"text": "def destroy\n @project.destroy\n respond_to do |format|\n format.html { redirect_to projects_url, notice: 'Project was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "e4eabccf3254c09325b990a2565f4cb9",
"score": "0.7434698",
"text": "def destroy\n @project.destroy\n respond_to do |format|\n format.html { redirect_to projects_url, notice: 'Project was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "e4eabccf3254c09325b990a2565f4cb9",
"score": "0.7434698",
"text": "def destroy\n @project.destroy\n respond_to do |format|\n format.html { redirect_to projects_url, notice: 'Project was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "e4eabccf3254c09325b990a2565f4cb9",
"score": "0.7434698",
"text": "def destroy\n @project.destroy\n respond_to do |format|\n format.html { redirect_to projects_url, notice: 'Project was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
}
] |
209a425f52666dc7dc71723e40fd3110 | Freeze the app (set using run) and all middleware instances when building the application in to_app. | [
{
"docid": "1f5b1e167accba4e7090accf9220ff31",
"score": "0.790372",
"text": "def freeze_app\n @freeze_app = true\n end",
"title": ""
}
] | [
{
"docid": "0cd24be91688edc87a3ab3a9313c503d",
"score": "0.7904983",
"text": "def freeze_app\n @freeze_app = true\n end",
"title": ""
},
{
"docid": "95401199c6f52ec97ae6ce5116e7d879",
"score": "0.7803469",
"text": "def freeze_app; end",
"title": ""
},
{
"docid": "95401199c6f52ec97ae6ce5116e7d879",
"score": "0.7803469",
"text": "def freeze_app; end",
"title": ""
},
{
"docid": "95401199c6f52ec97ae6ce5116e7d879",
"score": "0.7803469",
"text": "def freeze_app; end",
"title": ""
},
{
"docid": "0c62f3ec277e2e6269ad2f43c2fedfc5",
"score": "0.7344122",
"text": "def build_rack_app\n app = base_rack_app_callable(use_new_dispatch_api?)\n\n @middleware.reverse_each do |args, bl|\n mid, *args = args\n app = mid.new(app, *args, &bl)\n app.freeze if opts[:freeze_middleware]\n end\n\n @app = app\n end",
"title": ""
},
{
"docid": "d6ff72e59f2af35113c7045ef09b295d",
"score": "0.6708374",
"text": "def app\n @app ||= begin\n builder.lock!\n builder.to_app(lambda { |env|\n # the inner app that creates and returns the Response object\n response = Response.new\n response.finish(env) unless env[:parallel_manager]\n env[:response] = response\n })\n end\n end",
"title": ""
},
{
"docid": "d6ff72e59f2af35113c7045ef09b295d",
"score": "0.6708374",
"text": "def app\n @app ||= begin\n builder.lock!\n builder.to_app(lambda { |env|\n # the inner app that creates and returns the Response object\n response = Response.new\n response.finish(env) unless env[:parallel_manager]\n env[:response] = response\n })\n end\n end",
"title": ""
},
{
"docid": "fea0d8267ac8812d7ec3438d950577e6",
"score": "0.6586067",
"text": "def freeze\n return self if frozen?\n\n unless opts[:subclassed]\n # If the _roda_run_main_route instance method has not been overridden,\n # make it an alias to _roda_main_route for performance\n if instance_method(:_roda_run_main_route).owner == InstanceMethods\n class_eval(\"alias _roda_run_main_route _roda_main_route\")\n end\n self::RodaResponse.class_eval do\n if instance_method(:set_default_headers).owner == ResponseMethods &&\n instance_method(:default_headers).owner == ResponseMethods\n\n def set_default_headers\n @headers['Content-Type'] ||= 'text/html'\n end\n end\n end\n\n if @middleware.empty? && use_new_dispatch_api?\n plugin :direct_call\n end\n end\n\n build_rack_app\n @opts.freeze\n @middleware.freeze\n\n super\n end",
"title": ""
},
{
"docid": "fcc76dd3ded74024da5a8a8b1cc0a75f",
"score": "0.6513473",
"text": "def to_app(env)\n # Start with a duplicate of ourself which can\n # be modified\n builder = self.dup\n\n # Apply all dynamic modifications of the stack. This\n # will generate dynamic hooks for all actions within\n # the stack, load any triggers for action classes, and\n # apply them to the builder's stack\n builder.apply_dynamic_updates(env)\n\n # Now that the stack is fully expanded, apply any\n # action hooks that may be defined so they are on\n # the outermost locations of the stack\n builder.apply_action_name(env)\n\n # Wrap the middleware stack with the Warden to provide a consistent\n # and predictable behavior upon exceptions.\n Warden.new(builder.stack.dup, env)\n end",
"title": ""
},
{
"docid": "b98262b70044d3de24b142c982df2346",
"score": "0.6499886",
"text": "def load\n @app ||= begin\n onload[:before].each { |block| block.call(self) }\n setup_session_middleware\n setup_body_parser_middleware\n middleware.each { |m, args, block| builder.use m, *args, &block }\n setup_routers\n builder.run self.new\n onload[:after].each { |block| block.call(self) }\n builder\n end\n end",
"title": ""
},
{
"docid": "87dbd41402644848b66933d7a58f22a0",
"score": "0.63028765",
"text": "def app\n @app || @app_build_lock.synchronize {\n @app ||= begin\n stack = default_middleware_stack\n config.middleware = build_middleware.merge_into(stack)\n config.middleware.build(endpoint)\n end\n }\n end",
"title": ""
},
{
"docid": "f2276e1966a7cc424ef228d8707d5953",
"score": "0.6265304",
"text": "def application=(app); end",
"title": ""
},
{
"docid": "72aa1d302df52935bc141d185b4c6c42",
"score": "0.62108076",
"text": "def freeze!\n root.freeze_to(@session)\n end",
"title": ""
},
{
"docid": "99cf47bd27b73581264e1d6a262fe70c",
"score": "0.61918557",
"text": "def _app_for_rendering\n ivar_cache do\n Mack::Utils::Server.build_app\n end\n end",
"title": ""
},
{
"docid": "3f7435eeee04e823a072053ba7f475ab",
"score": "0.6191498",
"text": "def to_app\n app = Rack::Builder.new\n app.run(self)\n app\n end",
"title": ""
},
{
"docid": "6b3fa0f06482072f0dc658afb9d1ae74",
"score": "0.61693716",
"text": "def to_rack_app(&block)\n inner_app = inst(&block)\n \n (@middleware || []).each do |m|\n app.use(m[0], *m[1], &m[2])\n end\n \n app.map(\"/\") { run inner_app }\n \n (@mappings || []).each do |m|\n app.map(m[0], &m[1])\n end\n \n app\n end",
"title": ""
},
{
"docid": "e50d58297daefef6600e064cb1d38973",
"score": "0.61089593",
"text": "def call(env)\n @reloader.execute_if_updated if machined.environment.development?\n @app.call(env)\n end",
"title": ""
},
{
"docid": "a3acab7a60558c448a60f49eb93510af",
"score": "0.6104172",
"text": "def prepare_application\n new(STDOUT).reload_application\n end",
"title": ""
},
{
"docid": "d2bbf0e45b3a799084bd7b92de36c873",
"score": "0.6101507",
"text": "def app\n @app || @@spawn_mutex.synchronize do\n @app ||= begin\n Racker.logger.debug(\"Building Rack app at #{config_path}\")\n Rack::Builder.parse_file(config_path).first\n end\n end\n end",
"title": ""
},
{
"docid": "76b4aaa23062a3ffd46b7857a5e346c3",
"score": "0.6087546",
"text": "def rack_app &blk\n App.new(self, &blk)\n end",
"title": ""
},
{
"docid": "5e8b8820290b970a6f50f8448c460407",
"score": "0.6084969",
"text": "def to_app\n app = @map ? generate_map(@run, @map) : @run\n fail \"missing run or map statement\" unless app\n app = translator.translate.reverse.inject(app) do |application, middleware|\n middleware[application]\n end\n @warmup.call(app) if @warmup\n app\n end",
"title": ""
},
{
"docid": "8cce4ff0a1c6a1ad1c096901203652a4",
"score": "0.608297",
"text": "def app\n driver = self\n Rack::Builder.app do\n use Rack::ShowExceptions\n use Rack::Lint\n use Rack::ContentType\n use Rack::ContentLength\n use Rack::Session::Pool, :expire_after => 2592000\n use Middleware, driver\n run Application.new\n end\n end",
"title": ""
},
{
"docid": "1f57794f59010dd1a396541bf8ad173e",
"score": "0.60578775",
"text": "def app\n @middleware.reduce(self) do |app, (klass, args)|\n klass.new(app, *args)\n end\n end",
"title": ""
},
{
"docid": "b659cac130b0b60833f7b95bc0feeff4",
"score": "0.6056719",
"text": "def rackup(app)\n @app = app\n end",
"title": ""
},
{
"docid": "6c98a237919864bb0dbef649649cc61b",
"score": "0.6026066",
"text": "def app\n app = Rack::Builder.new\n\n # Handle websocket connections\n app.use WebsocketHandler\n\n can_fork = Process.respond_to?(:fork)\n\n unless can_fork\n Volt.logger.warn('Code reloading in Volt currently depends on `fork`. Your environment does not support `fork`. We\\'re working on adding more reloading strategies. For now though you\\'ll need to restart the server manually on changes, which sucks. Feel free to complain to the devs, we really let you down here. :-)')\n end\n\n # Only run ForkingServer if fork is supported in this env.\n # NO_FORKING can be used to specify that you don't want to use the forking\n # server.\n if !can_fork || Volt.env.production? || Volt.env.test? || ENV['NO_FORKING']\n # In production/test, we boot the app and run the server\n #\n # Sometimes the app is already booted, so we can skip if it is\n boot_volt unless @volt_app\n\n # Setup the dispatcher (it stays this class during its run)\n SocketConnectionHandler.dispatcher = Dispatcher.new(@volt_app)\n app.run(new_server)\n else\n # In developer\n app.run ForkingServer.new(self)\n end\n\n app\n end",
"title": ""
},
{
"docid": "7c40cad16fb59cab3558a1309f7d0b92",
"score": "0.60248333",
"text": "def to_app\n routes, controller = @_routes, self\n\n # We're using Usher as a router for this project. To\n # simplify things, we just used the rack interface to\n # router and it's DSL.\n app = Usher::Interface.for(:rack) do\n routes.each do |route|\n conditions = {:request_method => route[:method]}\n add(route[:uri], :conditions => conditions.merge(route[:options])).\n to(controller.action(route[:action]))\n end\n end\n\n if @_sessions\n # If we are using sessions, then wrap the application with the\n # session cookie store middleware.\n app = ActionDispatch::Session::CookieStore.new(app, {:key => \"_secret_key\",\n :secret => Digest::SHA2.hexdigest(Time.now.to_s + rand(100).to_s)})\n end\n\n app\n end",
"title": ""
},
{
"docid": "0ca74e6614788055bf31c595fa92edc2",
"score": "0.60214037",
"text": "def run(application)\n # add middleware to a middleware stack\n @app___ = application\n self\n end",
"title": ""
},
{
"docid": "1913636d5ab9c77f7a78fe956b3ab692",
"score": "0.6010479",
"text": "def retain_middleware_names\n next_middleware = config[:application]\n raise MissingApplicationError unless next_middleware\n\n while next_middleware\n if next_middleware.respond_to?(:call)\n next_middleware.singleton_class.class_eval do\n alias_method :__call, :call\n\n def call(env)\n env['RESPONSE_MIDDLEWARE'] = self.class.to_s\n __call(env)\n end\n end\n end\n\n next_middleware = next_middleware.instance_variable_defined?('@app') &&\n next_middleware.instance_variable_get('@app')\n end\n end",
"title": ""
},
{
"docid": "38cdd518cf63b8743b893dcadd37db5a",
"score": "0.5980874",
"text": "def attach!(app)\n if ::Rails.application.config.action_controller.perform_caching\n app.config.middleware.insert_after 'Rack::Cache', 'Dragonfly::Middleware', :refinery_resources\n else\n app.config.middleware.use 'Dragonfly::Middleware', :refinery_resources\n end\n end",
"title": ""
},
{
"docid": "670bc8f40cb106b954af9aa5abf5011a",
"score": "0.5958716",
"text": "def app\n # Setup the rack server and adaptor\n RackServerAdaptor.load\n\n app = Rack::Builder.new\n\n # Handle websocket connections\n app.use WebsocketHandler\n\n can_fork = Process.respond_to?(:fork)\n\n unless can_fork\n Volt.logger.warn('Code reloading in Volt currently depends on `fork`. Your environment does not support `fork`. We\\'re working on adding more reloading strategies. For now though you\\'ll need to restart the server manually on changes, which sucks. Feel free to complain to the devs, we really let you down here. :-)')\n end\n\n # Only run ForkingServer if fork is supported in this env.\n # NO_FORKING can be used to specify that you don't want to use the forking\n # server.\n if !can_fork || Volt.env.production? || Volt.env.test? || ENV['NO_FORKING']\n # In production/test, we boot the app and run the server\n #\n # Sometimes the app is already booted, so we can skip if it is\n boot_volt unless @volt_app\n\n # Setup the dispatcher (it stays this class during its run)\n SocketConnectionHandler.dispatcher = Dispatcher.new(@volt_app)\n app.run(@volt_app.middleware)\n else\n # In developer\n app.run ForkingServer.new(self)\n end\n\n app\n end",
"title": ""
},
{
"docid": "f558e41bc666db1c783d1ec5999f639d",
"score": "0.59483117",
"text": "def load_app\n inner_app, _options = RackRabbit.load_rack_app(config.rack_file)\n @app = Rack::Builder.new do\n use RackRabbit::Middleware::ProgramName\n run inner_app\n end.to_app\n logger.info \"LOADED #{inner_app.name if inner_app.respond_to?(:name)} FROM #{config.rack_file}\"\n @app\n end",
"title": ""
},
{
"docid": "f573133d9c8a2a82c9e0e2edfc4c8954",
"score": "0.59399176",
"text": "def app\n @app ||= Rack::Builder.app do\n use Rack::Deflater\n\n use Rack::SSL if ENV['RACK_ENV'] == 'production'\n\n use Rack::Session::Cookie, key: '_shipr_session'\n\n map '/pusher/auth' do\n run Hooks::Pusher\n end\n\n map '/api' do\n run API\n end\n\n map '/' do\n run Web\n end\n end\n end",
"title": ""
},
{
"docid": "b96a8aa0c0cc08b6aec51026208974c7",
"score": "0.5918394",
"text": "def reload!\n @mutex ||= Mutex.new\n\n @mutex.synchronize do\n self.class.erase! [self.class.source_file],\n [self.class.name.split(\"::\").last],\n self.class.namespace\n\n self.class.erase_dependencies!\n require self.class.source_file\n @app = self.class.source_class.new @rack_app, @logger\n end\n end",
"title": ""
},
{
"docid": "9e27fff8ab57c03881c7024cc691b42a",
"score": "0.591717",
"text": "def to_app # :nodoc:\n Rack::Builder.new.tap do |app|\n app.use Middleware::Static, machined.output_path\n app.use Middleware::RootIndex\n app.run Rack::URLMap.new(sprockets_map)\n end\n end",
"title": ""
},
{
"docid": "06c3c46dec7776fe0110ee77ab8cfa5d",
"score": "0.59058243",
"text": "def app\n found = options[:app] || load_rackup\n\n if @options[:log_requests]\n require_relative 'commonlogger'\n logger = @options[:logger]\n found = CommonLogger.new(found, logger)\n end\n\n ConfigMiddleware.new(self, found)\n end",
"title": ""
},
{
"docid": "eaf21669a816726508daba2b1e00c159",
"score": "0.5905047",
"text": "def app\n @app ||= Rack::Builder.new do\n map \"/\" do\n run ::Rails.application\n end\n end.to_app\n end",
"title": ""
},
{
"docid": "df563a0859a5afbd4e37ad186733a6af",
"score": "0.58914834",
"text": "def use(*args, &block)\n @middleware << [args, block].freeze\n @app = nil\n end",
"title": ""
},
{
"docid": "a6afea2a562735d7a0a7edc102d6fa43",
"score": "0.58834153",
"text": "def call(env)\n @app.call(env)\n ensure\n ResetCurrentThread.all!\n end",
"title": ""
},
{
"docid": "ec505710291d31eb4f8d0a0b3419dad4",
"score": "0.58543736",
"text": "def application\n return @app if @app\n\n @stack.run Rack::Roger.new(project, @application_options || {})\n\n @app = @stack\n end",
"title": ""
},
{
"docid": "8d7ada78adcfa66fa95605582da09c91",
"score": "0.5852676",
"text": "def app\n @app ||= build_app(settings)\n end",
"title": ""
},
{
"docid": "1d779b86c020fa00b8c25b4112cd0cac",
"score": "0.5850956",
"text": "def call(env)\n Application.new(settings, &application_block).call(env)\n end",
"title": ""
},
{
"docid": "b5605415473bd3301f8630a35beef1c6",
"score": "0.58431846",
"text": "def new(app)\n if app && app != call_method\n puts \"Plezi #{ Plezi::VERSION } as Middleware\"\n @app = app\n end\n Plezi.app\n end",
"title": ""
},
{
"docid": "7bcff7df441d24c3f4af7d4647608786",
"score": "0.5841999",
"text": "def application\n return @app if @app\n \n @stack.use Rack::HtmlValidator if self.options[:validate]\n @stack.run Rack::HtmlMockup.new(self.project)\n \n @app = @stack\n end",
"title": ""
},
{
"docid": "863cdc0b98ebdfaae4e808e06f13766e",
"score": "0.58419895",
"text": "def build_app\n create_objects\n middleware = Struct.new(:app, :parser, :manifest) {\n def inspect\n \"#<Middleware for test environment (defined in: #{__FILE__.inspect})>\"\n end\n\n attr_accessor :next_eval_in_response\n def call(env)\n env['json_parser'] = parser\n env['manifest'] = manifest\n app.call(env.merge 'eval_in' => mock_eval_in)\n end\n\n def mock_eval_in\n EvalIn::Mock.new(on_call: lambda { |code, options|\n next_eval_in_response ||\n raise(\"Need to set an eval_in response before calling it!\")\n })\n end\n }\n middleware.new(MiniatureOctoIronman, json_parser, manifest)\n end",
"title": ""
},
{
"docid": "c8c81eab186fa954e817511a79346af5",
"score": "0.5838158",
"text": "def call env\n app.call env\n end",
"title": ""
},
{
"docid": "2d8fbd47ef7db2dc060a78239479ef25",
"score": "0.58347094",
"text": "def to_app_with_tingyun_deferred_dependency_detection\n unless ::Rack::Builder._nr_deferred_detection_ran\n TingYun::Agent.logger.info \"Doing deferred library-detection before Rack startup\"\n TingYun::Support::LibraryDetection.detect!\n ::Rack::Builder._nr_deferred_detection_ran = true\n end\n to_app_without_tingyun\n end",
"title": ""
},
{
"docid": "464b8c3bdfed9199b0ea1ac35796725f",
"score": "0.5798019",
"text": "def to_app_with_newrelic_deferred_dependency_detection\n unless self.class._nr_deferred_detection_ran\n NewRelic::Agent.logger.info \"Doing deferred dependency-detection before Rack startup\"\n DependencyDetection.detect!\n self.class._nr_deferred_detection_ran = true\n end\n\n result = to_app_without_newrelic\n ::NewRelic::Agent::Instrumentation::RackHelpers.check_for_late_instrumentation(result)\n\n result\n end",
"title": ""
},
{
"docid": "1ec22f3fe7b7051dc134769f00cc7f81",
"score": "0.57927793",
"text": "def in_app\n previous_app = Thread.current['volt_app']\n Thread.current['volt_app'] = self\n\n begin\n yield\n ensure\n Thread.current['volt_app'] = previous_app\n end\n end",
"title": ""
},
{
"docid": "89d3425522519fba80e320f7a3cbef23",
"score": "0.5774665",
"text": "def build\n @builder = Rack::Builder.new\n\n @middlewares.each do |middleware|\n if middleware[0] == :map\n @builder.map(middleware[1], &middleware[2])\n else\n @builder.use(*middleware[0], &middleware[1])\n end\n end\n\n @builder.run(@app)\n end",
"title": ""
},
{
"docid": "f80beb0bb0faf953a5356608a1a17491",
"score": "0.576711",
"text": "def build(app)\n builder = Rack::Builder.new\n setup_default_middleware builder\n setup_middleware builder\n builder.run app\n builder\n end",
"title": ""
},
{
"docid": "f80beb0bb0faf953a5356608a1a17491",
"score": "0.576711",
"text": "def build(app)\n builder = Rack::Builder.new\n setup_default_middleware builder\n setup_middleware builder\n builder.run app\n builder\n end",
"title": ""
},
{
"docid": "69800d0d2e175354f2556227aa17ed75",
"score": "0.57668734",
"text": "def set_app!(identity_options = {})\n identity_options = {:model => MockIdentity}.merge(identity_options)\n old_app = self.app\n self.app = Rack::Builder.app do\n use Rack::Session::Cookie, secret: '1234567890qwertyuiop'\n use OmniAuth::Strategies::Identity, identity_options\n run lambda{|env| [404, {'env' => env}, [\"HELLO!\"]]}\n end\n if block_given?\n yield\n self.app = old_app\n end\n self.app\n end",
"title": ""
},
{
"docid": "3dcdbd90e1421060ffdf9b2dc60cf910",
"score": "0.5765207",
"text": "def set_app!(identity_options = {})\n old_app = app\n self.app = Rack::Builder.app do\n use Rack::Session::Cookie, secret: '1234567890qwertyuiop'\n use OmniAuth::Strategies::Identity, identity_options\n run ->(env) { [404, { 'env' => env }, ['HELLO!']] }\n end\n if block_given?\n yield\n self.app = old_app\n end\n app\n end",
"title": ""
},
{
"docid": "63e6fcf2a34d536960f67e1e151598b0",
"score": "0.5749696",
"text": "def app_middleware; end",
"title": ""
},
{
"docid": "d9d64c71515dc99975e601b558e0ecc1",
"score": "0.57414937",
"text": "def pass(env = @request.env)\n @app.call(env)\n end",
"title": ""
},
{
"docid": "6cbadcaaa069dcca936c1bf2daf5dbb4",
"score": "0.574055",
"text": "def prepare_after_stack\n @after_stack ||= MiddlewareStack.new do |middleware|\n self.class.middles.each do |mw|\n if can_use_middleware?(mw)\n mw.send(:include, RackParentApp)\n middleware.use(mw)\n end\n end\n end\n @app = @after_stack.build(lambda { |env| s,h,r = self._call(env) })\n end",
"title": ""
},
{
"docid": "889e770b0bac9c6d403795cf0be18675",
"score": "0.57319903",
"text": "def app\n @app ||= Rack::Builder.new\n end",
"title": ""
},
{
"docid": "b8df2a7ab24186b405e4e7d0f416b80a",
"score": "0.57213837",
"text": "def call(parcel)\n freezer.deep_freeze parcel\n app.call parcel\n end",
"title": ""
},
{
"docid": "0d0dbf0ce808302bea8fbe5b5c02fae9",
"score": "0.57162946",
"text": "def call(env)\n delegate = case\n when @options[:disable_rack_assets] then @app # ignore all asset middleware\n when @options[:precache] then @manifester # use manifest middleware only\n else \n reset! if stale? \n @provider # use provider + manifest middleware\n end\n \n delegate.call(env)\n end",
"title": ""
},
{
"docid": "d321b9b38bf1fae06597241d5422c5dd",
"score": "0.5714474",
"text": "def call env\n try_autoreload(env)\n\n if @app.route!(env)\n @app.call!(env)\n\n elsif @app.static!(env)\n @app.call_static(env)\n\n elsif @rack_app\n @rack_app.call(env)\n\n else\n @app.call!(env)\n end\n end",
"title": ""
},
{
"docid": "c6510c43bf6d635f583e298d492e5688",
"score": "0.57091695",
"text": "def load_apps\n @requires.each do |path|\n $LOADED_FEATURES.delete(path)\n end\n\n all_requires = $LOADED_FEATURES.dup\n all_apps = Camping::Apps.dup\n \n begin\n load(@file)\n rescue Exception => e\n puts \"!! Error loading #{@file}:\"\n puts \"#{e.class}: #{e.message}\"\n puts e.backtrace\n puts \"!! Error loading #{@file}, see backtrace above\"\n end\n \n @requires = ($LOADED_FEATURES - all_requires).map do |req|\n full = full_path(req)\n full if full == @file or full.index(@extras) == 0\n end\n \n @mtime = mtime\n \n new_apps = (Camping::Apps - all_apps)\n old_apps = @apps.dup\n \n @apps = new_apps.inject({}) do |hash, app|\n key = app.name.to_sym\n hash[key] = app\n \n if !old_apps.include?(key)\n @callback.call(app) if @callback\n app.create if app.respond_to?(:create)\n end\n hash\n end\n \n self\n end",
"title": ""
},
{
"docid": "d29272bc7923579a00b046b7fa1806cb",
"score": "0.5707318",
"text": "def reset_rails_configuration!\n Rails.class_variable_set(:@@application, nil)\n Rails::Application.class_variable_set(:@@instance, nil)\n if Rails::Railtie::Configuration.class_variable_defined?(:@@app_middleware)\n Rails::Railtie::Configuration.class_variable_set(:@@app_middleware, Rails::Configuration::MiddlewareStackProxy.new)\n end\n Rails::Railtie::Configuration.class_variable_set(:@@app_generators, nil)\n Rails::Railtie::Configuration.class_variable_set(:@@to_prepare_blocks, nil)\n end",
"title": ""
},
{
"docid": "d29272bc7923579a00b046b7fa1806cb",
"score": "0.5707318",
"text": "def reset_rails_configuration!\n Rails.class_variable_set(:@@application, nil)\n Rails::Application.class_variable_set(:@@instance, nil)\n if Rails::Railtie::Configuration.class_variable_defined?(:@@app_middleware)\n Rails::Railtie::Configuration.class_variable_set(:@@app_middleware, Rails::Configuration::MiddlewareStackProxy.new)\n end\n Rails::Railtie::Configuration.class_variable_set(:@@app_generators, nil)\n Rails::Railtie::Configuration.class_variable_set(:@@to_prepare_blocks, nil)\n end",
"title": ""
},
{
"docid": "d57ed8a023ffa82a265e6a0388c38672",
"score": "0.56853664",
"text": "def rack_app\n # primary app\n main = pico_app\n main = Rack::Lint.new(main)\n\n # static directories\n static_map = {}\n static_dirs.each {|uri,path| static_map[uri] = Rack::File.new(path) }\n\n # uri mappings\n app = Rack::URLMap.new({ '/' => main }.merge(static_map))\n\n # authentication\n if conf.authentication == :basic\n app = Rack::Auth::Basic.new(app, &conf.authenticator)\n app.realm = 'Pico'\n end\n\n # common middleware\n app = Rack::CommonLogger.new(app, logger)\n app = Rack::ShowExceptions.new(app) if conf.prettify_exceptions\n\n app\n end",
"title": ""
},
{
"docid": "570bf666620d3ba800707357df3a8958",
"score": "0.5682201",
"text": "def app_middleware\n @@app_middleware ||= Rails::Configuration::MiddlewareStackProxy.new\n end",
"title": ""
},
{
"docid": "570bf666620d3ba800707357df3a8958",
"score": "0.5682201",
"text": "def app_middleware\n @@app_middleware ||= Rails::Configuration::MiddlewareStackProxy.new\n end",
"title": ""
},
{
"docid": "670e7320fb48bcdeb7869a3428da1036",
"score": "0.5681621",
"text": "def reload\n @app = to_app\n end",
"title": ""
},
{
"docid": "73b7f1280b0e882662c8b249089caacc",
"score": "0.56797373",
"text": "def setup\n application.prepare!\n yield(application)\n end",
"title": ""
},
{
"docid": "0d153b8357b73ff46ec0aaff9b55b65d",
"score": "0.5679428",
"text": "def route(&block)\n @middleware.each{|a, b| @builder.use(*a, &b)}\n @builder.run lambda{|env| new.call(env, &block)}\n @app = @builder.to_app\n end",
"title": ""
},
{
"docid": "4f4114b956e3fb105eda50c92b0e3d6a",
"score": "0.565634",
"text": "def freeze\n unless frozen?\n rehash\n flush!\n @routes.each { |route| route.freeze }\n @routes.freeze\n end\n\n super\n end",
"title": ""
},
{
"docid": "55e0ed1204966d9264b578e2509703c1",
"score": "0.56559026",
"text": "def app\n defined?(@app) ? @app : build_app\n end",
"title": ""
},
{
"docid": "0a0007eb0b59b8723b419f7a694628b7",
"score": "0.5649059",
"text": "def freeze\n unless frozen?\n rehash\n stubbed_request_class\n\n @recognition_key_analyzer = nil\n @generation_route_keys = nil\n @valid_conditions = nil\n\n @routes.each { |route| route.freeze }\n @routes.freeze\n end\n\n super\n end",
"title": ""
},
{
"docid": "f22b5797b68139fcdf27e626c8cab726",
"score": "0.56289953",
"text": "def to_app\n @application = lambda do |env|\n return [501, {}, ['Sorry, but I am websocket app.']] unless is_websocket?(env)\n connection(env) do |c|\n WEBSOCKET_STANDARD_EVENTS.each(®ister_handler(c, env))\n end\n end\n # This is needed for Puma so we can log the requests to WebSockets\n @application.class.instance_eval {\n define_method(:log) { |message| Socker::App.log(message) }\n }\n # Prevent any modification of events or application itself at this point.\n @events.freeze\n @application.freeze\n @application\n end",
"title": ""
},
{
"docid": "c84582591df07c533a0465e33fb2b343",
"score": "0.5625769",
"text": "def call(env={})\n to_app.call(env)\n end",
"title": ""
},
{
"docid": "7e1e5f42bbfe121427ba600a61b79cb2",
"score": "0.56130916",
"text": "def build_stack___\n raise \"Application object missing!\" unless @app___\n @stack___ << @app___\n app = @stack___.pop\n tmp = nil\n while((tmp = @stack___.pop))\n if tmp[3]\n app = tmp[0].new(app, *tmp[1], &tmp[2])\n else\n app = tmp[0].new(app, *tmp[1])\n end\n end\n @app___ = app\n @stack_post___.reverse!\n @warmup___.call(@app___) if @warmup___\n [@stack_pre___, @app___, @stack_post___]\n end",
"title": ""
},
{
"docid": "c43c76e2a7c06845c1488910da4353ef",
"score": "0.5604318",
"text": "def reset_application\n super\n end",
"title": ""
},
{
"docid": "9a924118c1794aacb1af9a4b2e245731",
"score": "0.56036305",
"text": "def app\n App.new\nend",
"title": ""
},
{
"docid": "175a2adfc8043ff075f55e54e1d509e4",
"score": "0.5599161",
"text": "def stack_middlewares\n middleware_stack.each_cons(2){ |(previous, this)| previous.app = this }\n # Provide a blank Proc as the last element in the Middleware stack to\n # avoid errors where the last Middleware `fires` an event upward.\n middleware_stack.last.app = Proc.new{}\n end",
"title": ""
},
{
"docid": "5b55e621a67996466e110d7ea75ed197",
"score": "0.55890584",
"text": "def forward\n raise 'downstream app not set' unless @app.respond_to? :call\n\n status, headers, body = @app.call env\n @response.status = status\n @response.body = body\n @response.headers.merge! headers\n nil\n end",
"title": ""
},
{
"docid": "34d294645038d8e30fd6708270134f85",
"score": "0.5586078",
"text": "def preload_app!(answer=true)\n @options[:preload_app] = answer\n end",
"title": ""
},
{
"docid": "1126e60127137e5dcdce98d98316070a",
"score": "0.55771875",
"text": "def run(app)\n _halt app.call(env)\n end",
"title": ""
},
{
"docid": "c33d62e6581546eef5ea21b3861a1a14",
"score": "0.55747867",
"text": "def build(app = nil, &block)\n app ||= block\n raise \"MiddlewareStack#build requires an app\" unless app\n reverse.inject(RackTimer.new(app)) { |a, e| e.build(a) }\n end",
"title": ""
},
{
"docid": "5fd009af1fd1f4ce3dd5c3f838241c29",
"score": "0.5566283",
"text": "def freeze\n super\n # Nothing to do here\n extend Freezer\n self\n end",
"title": ""
},
{
"docid": "d610d6415622034da10af62b4ae431e9",
"score": "0.5557301",
"text": "def forward\n fail \"downstream app not set\" unless @app.respond_to? :call\n status, headers, body = @app.call env\n @response.status = status\n @response.body = body\n @response.headers.merge! headers\n nil\n end",
"title": ""
},
{
"docid": "58ba930dba1471436066042919d96c15",
"score": "0.5550124",
"text": "def build(app)\n builder = Rack::Builder.new\n builder.use Rack::Head\n middleware.each { |mw, a, b| builder.use(mw, *a, &b) }\n builder.run app\n builder\n end",
"title": ""
},
{
"docid": "9a336392c49144522d99a8c89b82a396",
"score": "0.554813",
"text": "def wipe_out_current_app!\n app = $app\n return unless app\n app.no_loop\n # Wait for the animation thread to finish rendering\n sleep 0.075\n app.close\n constant_names = app.class.to_s.split(/::/)\n app_class_name = constant_names.pop\n obj = constant_names.inject(Object) {|o, name| o.send(:const_get, name) }\n obj.send(:remove_const, app_class_name) \n end",
"title": ""
},
{
"docid": "1fec034ae4d4448eb3b5b504ab5f2f16",
"score": "0.55474305",
"text": "def build(app = nil, &block)\n app ||= block\n raise \"MiddlewareStack#build requires an app\" unless app\n middlewares.reverse.inject(RackTimer.new(app)) { |a, e| e.build(a) }\n end",
"title": ""
},
{
"docid": "d686d1f82007769e2c2ed10ee166fa20",
"score": "0.5537788",
"text": "def use(middleware, *args)\n @app = middleware.new(@app, *args)\n end",
"title": ""
},
{
"docid": "d686d1f82007769e2c2ed10ee166fa20",
"score": "0.5537788",
"text": "def use(middleware, *args)\n @app = middleware.new(@app, *args)\n end",
"title": ""
},
{
"docid": "6c8d3ce51065579af7251588681f178b",
"score": "0.5534641",
"text": "def use ware, *args, &block\n middleware << proc { |app| ware.new(app, *args, &block) }\n end",
"title": ""
},
{
"docid": "a8757f52ced6ba5f2591132149e2a655",
"score": "0.5529107",
"text": "def freeze\n unless frozen?\n rehash\n @routes.each { |route| route.freeze }\n @routes.freeze\n end\n\n super\n end",
"title": ""
},
{
"docid": "61157743755ba76a9be7358a8651986d",
"score": "0.55216706",
"text": "def set_app!(dice_options = {})\n dice_options = {:model => MockDice}.merge(dice_options)\n old_app = self.app\n self.app = Rack::Builder.app do\n use Rack::Session::Cookie, :secret => '1337geeks'\n use RackSessionAccess::Middleware\n use OmniAuth::Strategies::Dice, dice_options\n run lambda{|env| [404, {'env' => env}, [\"HELLO!\"]]}\n end\n if block_given?\n yield\n self.app = old_app\n end\n self.app\n end",
"title": ""
},
{
"docid": "d464161418c8716988f5001e810c8c6b",
"score": "0.5520018",
"text": "def call(env)\n setup(env)\n @app.call(env)\n end",
"title": ""
},
{
"docid": "2161fddbf7e54a8e023ffb10f8f64434",
"score": "0.55103815",
"text": "def initialize_app_class\n puts \"RW RackWardenClassMethods.initialize_app_class self #{self}\" if !production?\n initialize_logging\n logger.debug \"RW RackWardenClassMethods.initialize_app_class environment: #{environment}, process: #{$0}, self: #{self}\"\n initialize_config_files\n initialize_logging # again, in case log settings changed in config files.\n \n RackWarden::Rom.setup_database(settings)\n \n use Rack::MethodOverride\n \n use Rack::Cookies\n \n # Moved... see below.\n #use(Warden::Manager){ |config| config.replace WardenConfig }\n \n helpers RackWardenHelpers\n \n register Sinatra::RespondWith\n respond_to :xml, :json, :js, :txt, :html, :yaml\n \n end",
"title": ""
},
{
"docid": "b53e46f55d33e6000f408acc625b857f",
"score": "0.550479",
"text": "def middleware_for(project)\n apps = []\n\n # setup some conditional items...\n config = project.config\n\n # serve files out of the public directory if serve_public is\n # configures && the public directory exists\n if config[:serve_public]\n pubdir = File.join(project.project_root, 'public')\n apps << ::Rack::File.new(pubdir) if File.directory?(pubdir)\n end\n\n if self.filesystem\n apps << SC::Rack::Filesystem.new(project)\n end\n\n #if config.serve_test_runner\n apps << SC::Rack::Dev.new(project)\n #end\n\n # Add builder for the project itself\n apps << SC::Rack::Builder.new(project)\n\n if project.buildfile.proxies.size > 0\n apps << SC::Rack::Proxy.new(project)\n end\n\n # Wrap'em in a cascade if needed. This will return the first\n # app that does not return nil\n app = apps.size == 1 ? apps.first : ::Rack::Cascade.new(apps)\n\n # Add show exceptions handler if enabled\n app = ::Rack::ShowExceptions.new(app) if config[:serve_exceptions]\n\n return app # done!\n end",
"title": ""
},
{
"docid": "f8ba12329e7c2b2eacc53cdfc391bbfc",
"score": "0.55017954",
"text": "def run_application\n if Backdat::Config[:daemonize]\n Backdat::Config[:server] = true\n Backdat::Daemon.daemonize(\"backdat\")\n end\n @app.run\n end",
"title": ""
},
{
"docid": "fc18a1f8dd11c7a4e12b038dfd198565",
"score": "0.5498129",
"text": "def prepare_application\r\n ActionController::Routing::Routes.reload if Dependencies.load?\r\n #prepare_breakpoint\r\n require_dependency('application.rb') unless Object.const_defined?(:ApplicationController)\r\n ActiveRecord::Base.verify_active_connections!\r\n end",
"title": ""
},
{
"docid": "ca59566ba8be21ff60cec4fbccf955c7",
"score": "0.54945225",
"text": "def freeze\n super\n\n config.freeze_recursively\n\n items.freeze\n items.each { |i| i.freeze }\n\n layouts.freeze\n layouts.each { |l| l.freeze }\n\n code_snippets.freeze\n code_snippets.each { |cs| cs.freeze }\n end",
"title": ""
},
{
"docid": "9269f03c44e9cfe6cc3f75764ce2db6d",
"score": "0.5493476",
"text": "def setup_application\n original_dir = Dir.pwd\n Backdat::Daemon.change_privilege\n Backdat::Config[:server] = true if Backdat::Config[:daemonize]\n if Backdat::Config[:server]\n @app = Backdat::Server.new\n else\n @app = Backdat::Client.new(@commands, original_dir)\n end\n end",
"title": ""
},
{
"docid": "fd7fc050349542fb40813464039d89d9",
"score": "0.5493015",
"text": "def call(env)\n if @cooldown && Time.now > @last + @cooldown\n Thread.list.size > 1 ? Thread.exclusive { Padrino.reload! } : Padrino.reload!\n @last = Time.now\n end\n @app.call(env)\n end",
"title": ""
}
] |
801ef02c41743b2ed3390f7b6b20ef20 | Normalize deadline to the end of the day if a date or string is given | [
{
"docid": "e94c03a80ff210e40ed462e6162c30bd",
"score": "0.6637091",
"text": "def deadline=(day_or_time)\n if day_or_time.is_a?(Date) || day_or_time.is_a?(String)\n day_or_time = Time.zone.parse(day_or_time) if day_or_time.is_a?(String)\n day_or_time = day_or_time.end_of_day\n end\n self[:deadline] = day_or_time\n end",
"title": ""
}
] | [
{
"docid": "ce35ca124e1d332b6f4f31e4aa30ee8c",
"score": "0.66233164",
"text": "def format_date date\n begin\n DateTime.parse(job_params[:deadline])\n rescue ArgumentError\n nil\n end\n end",
"title": ""
},
{
"docid": "6700d793cd7380d181f0309c1f99953e",
"score": "0.65731615",
"text": "def deadline\n \"July 4, 2014\"\n end",
"title": ""
},
{
"docid": "d25da6ec9ae964eeb9314094e692dc1a",
"score": "0.64787704",
"text": "def deadline_cannot_be_in_the_past\n errors.add(:deadline, \"can't be in the past\") if\n deadline < Date.today\n end",
"title": ""
},
{
"docid": "5cdf2ddf649d521b864a7312baa959af",
"score": "0.64764154",
"text": "def deadline=(new_deadline)\n @deadline = new_deadline if Item.valid_date?(new_deadline)\n end",
"title": ""
},
{
"docid": "642d18fc45c9b5275c2ce37d3fa60b7c",
"score": "0.64569944",
"text": "def deadline_at\n super.localtime unless super.blank?\n end",
"title": ""
},
{
"docid": "743c29364fca4b59c6a3c496c4dfaea0",
"score": "0.634806",
"text": "def set_deadline\n self.deadline ||= self.created_at.advance(years: 1)\n end",
"title": ""
},
{
"docid": "7d9b5840b2e9bc1ba75147f996a40d29",
"score": "0.63389874",
"text": "def deadline_as_words\n\t\ttoday = Time.now.localtime.to_date\n\t\tcase self.deadline\n\t\twhen nil\n\t\t\t'indefinido'\n\t\twhen today\n\t\t\t'hoy'\n\t\twhen today + 1\n\t\t\t'mañana'\n\t\telse\n\t\t\tself.deadline\n\t\tend\n\tend",
"title": ""
},
{
"docid": "9990d6123802ac5c83dabadfa419fec3",
"score": "0.6338593",
"text": "def deadline (rest)\n id_string, datedl = rest.split(/ /,2)\n id = id_string.to_i\n #checking id the deadline entered is a valid date\n begin\n dl = Date.strptime(datedl, \"%m/%d/%Y\")\n #code using date goes here\n task = @tasks.collect { |project_name, project_tasks|\n project_tasks.find { |t| t.id == id }\n }.reject(&:nil?).first\n\n if task.nil?\n @output.printf(\"Could not find a task with an ID of %d.\\n\", id)\n return\n end\n task.deadline = dl\n #checking if the deadline is not a valid date\n rescue ArgumentError\n #code dealing with an invalid date goes here\n @output.printf('The deadline entered is not a valid date!!')\n end\n #adding the deadline to the same task(same description)if it exists in more than one project!\n @tasks.each { |project_name, project_tasks|\n project_tasks.each { |task|\n if task.id == id\n @tasks.each do |project_name, project_tasks|\n project_tasks.each do |t|\n if t.description == task.description\n t.deadline = task.deadline\n end\n end\n end\n end\n }\n\n }\n end",
"title": ""
},
{
"docid": "53b1ebba891628f6de9bccac4d025b07",
"score": "0.6199734",
"text": "def deadline\n weekly ? self.created_at.sunday.beginning_of_day : self.created_at.end_of_day\n end",
"title": ""
},
{
"docid": "15ee3e31058372f5fcf591f2afca0605",
"score": "0.6147535",
"text": "def max_allowed_deadline_date\n @deadline_calculator.max_allowed_deadline_date(max_time_limit)\n end",
"title": ""
},
{
"docid": "a178918e03b4b6c2e717867b71be68a6",
"score": "0.6066348",
"text": "def deadline_pretty\n self.deadline.strftime \"%A, %B %d, %Y at %I:%M %p\"\n end",
"title": ""
},
{
"docid": "f4e548949a4e1a9b8e039d8ea5a90afc",
"score": "0.60389584",
"text": "def deadline_valid?\n return if self.deadline.nil?\n\n \tif self.deadline < Date.today then\n \t\terrors.add(:deadline, \"Deadline cannot be before today\");\n \tend\n end",
"title": ""
},
{
"docid": "60a9361f46c8e1d1046e31266ac04dbf",
"score": "0.5992698",
"text": "def pledge_deadline\n @pledge_deadline ||= begin\n date = node.css('.project-stats li').last.inner_html.to_s\n if date =~ /Funded/\n Date.parse date.split('<strong>Funded</strong>').last.strip\n elsif date =~ /hours left/\n future = Time.now + date.match(/\\d+/)[0].to_i * 60*60\n Date.parse(future.to_s)\n elsif date =~ /days left/\n Date.parse(Time.now.to_s) + date.match(/\\d+/)[0].to_i\n end\n end\n end",
"title": ""
},
{
"docid": "ec3acd388620d43cce88f9ccf1984037",
"score": "0.5950623",
"text": "def direction\n date_deadline < Date::today ? :past : :future\n end",
"title": ""
},
{
"docid": "0b5c3bcb2331ffe18db5d407d37221b7",
"score": "0.5872555",
"text": "def get_deadline_days_left\n\t\tif deadline.present?\n\t\t\t(deadline - Date.today).to_i\n\t\telse\n\t\t\t0\n\t\tend\n\tend",
"title": ""
},
{
"docid": "ea46772b8f1acca83d35dc6b9d3abe61",
"score": "0.58630764",
"text": "def change_deadline(actor, new_deadline)\n old_deadline = deadline\n Event.create(\n actor_id: actor.id,\n todo_id: id,\n project_id: project.id,\n old_deadline: old_deadline,\n new_deadline: new_deadline,\n event_type: Event::TYPE_TODO_CHANGE_DEADLINE\n ) if update(deadline: new_deadline)\n\n self\n end",
"title": ""
},
{
"docid": "953f13a0cb46593e58647f4102581611",
"score": "0.585091",
"text": "def calculate_deadline(interval,date_string)\n \tdate = Date.parse date_string.to_s\n \ttime = Time.parse date_string.to_s\n\n \tif is_in_current_working_day date_string\n \t rem = time_remaining interval,date_string\n \t if rem > interval\n \t \t# End condition\n \t \tprint_me time + interval\n \t else\n \t \tinterval -= rem\n \t \ttime = next_business_day date+1\n \t \tcalculate_deadline interval,time\n \t end\n \telse\n \t\ttime = next_business_day date_string\n \t\tcalculate_deadline interval,time\n \tend\n end",
"title": ""
},
{
"docid": "89e30c305e69a0b331c047bae73e3c12",
"score": "0.5844819",
"text": "def pledge_deadline\n if node\n @pledge_deadline ||= begin\n date = node.css('.project-stats li').last.inner_html.to_s\n if date =~ /Funded/\n Date.parse date.split('<strong>Funded</strong>').last.strip\n elsif date =~ /hours? left/\n future = Time.now + date.match(/\\d+/)[0].to_i * 60*60\n Date.parse(future.to_s)\n elsif date =~ /days left/\n Date.parse(Time.now.to_s) + date.match(/\\d+/)[0].to_i\n elsif date =~ /minutes? left/\n future = Time.now + date.match(/\\d+/)[0].to_i * 60\n Date.parse(future.to_s)\n end\n end\n else\n @pledge_deadline ||= exact_pledge_deadline.to_date\n end\n end",
"title": ""
},
{
"docid": "11925babe16c1cd46cc3cf4b6cfdc51f",
"score": "0.57935095",
"text": "def check_deadline\n true\n end",
"title": ""
},
{
"docid": "3d67e57397bd47b78203b19c06c3bb0c",
"score": "0.57821673",
"text": "def deadline?\n @options[:deadline].present?\n end",
"title": ""
},
{
"docid": "7b716618233e7ad2617bb1cd3beb4f5b",
"score": "0.5764985",
"text": "def cfp_deadline_in\n deadline = last_cfp_date\n return nil if deadline.nil? or Date.today > deadline\n (deadline - Date.today).to_i\n end",
"title": ""
},
{
"docid": "a9c5c1f900ac65efbcfe562665ad14c2",
"score": "0.57489514",
"text": "def accept_deadline\n start_time + ((end_time - start_time) * 0.1)\n end",
"title": ""
},
{
"docid": "a72863aad73162beadf99cc0841f275d",
"score": "0.5715586",
"text": "def DueDate # rubocop:disable Style/MethodName\n Time.strptime(@attrs[:DueDate], '%m/%d/%Y %l:%M %p').utc unless @attrs[:DueDate].nil?\n end",
"title": ""
},
{
"docid": "1c2c765fb682b0c932a3f429de200237",
"score": "0.56704324",
"text": "def booking_deadline_has_passed?\n Date.current > deadline\n end",
"title": ""
},
{
"docid": "90183b539eb2d565c96c5bbdd545ebfc",
"score": "0.56634253",
"text": "def set_termination_date\n if effective_date and approved_details.try(:duration) and (effective_date_changed? or approved_details_id_changed?)\n self.termination_date = Date.new(\n effective_date.year + approved_details.duration,\n effective_date.month,\n effective_date.day )\n end\n end",
"title": ""
},
{
"docid": "a9db41ab966b7fdb3c14a0d78792e90a",
"score": "0.5658087",
"text": "def update_nil_dd_deadline_name(due_date_all)\n due_date_all.each do |dd|\n dd.deadline_name ||= ''\n end\n due_date_all\n end",
"title": ""
},
{
"docid": "adea2c01714cfe62d9cebd2b51e634b8",
"score": "0.5641023",
"text": "def due_date\n if @lease.grace_period.present? && @lease.grace_period >= 0\n @date + @lease.grace_period.day\n else\n @date\n end\n end",
"title": ""
},
{
"docid": "98e745aaa206e5339a35a7cd087d92b7",
"score": "0.56365865",
"text": "def deadline_params\n params.require(:deadline).permit(:date, :description, :listing_id)\n end",
"title": ""
},
{
"docid": "3a9cf50193d28acc679185090966e2d8",
"score": "0.5581744",
"text": "def resolve_valid_until(resource)\n debug \"resolve_valid_until: resource: #{resource}\"\n return resource[:valid_until] = Time.parse(resource[:valid_until]).utc if resource[:valid_until]\n if duration = resource.delete(:duration)\n resource[:valid_until] = (resource[:valid_from] + duration).utc\n else\n resource[:valid_until] = (resource[:valid_from] + DEFAULT_DURATION).utc\n end\n end",
"title": ""
},
{
"docid": "e1b92243ed647139bfb3c78a827d2521",
"score": "0.5575715",
"text": "def past_deadline?\n self.deadline < Time.now\n end",
"title": ""
},
{
"docid": "69fdbba5bff7087ab087c5a16136dc68",
"score": "0.5570735",
"text": "def effective_end_date_has_passed\n if effective_end_date.present? && (effective_end_date > Time.zone.now)\n errors.add(:effective_end_date, 'must be in the past')\n end\n end",
"title": ""
},
{
"docid": "5ac0e3750b4d6adfb3f00ad6981bf64c",
"score": "0.5531949",
"text": "def within_deadline?\n deadline = init_deadline Time.now.getlocal(\"+08:00\")\n self < deadline && self >= (deadline - SECONDS_DAY)\n end",
"title": ""
},
{
"docid": "68d9bc4aa283ae23879d57f5df9d58f5",
"score": "0.5519911",
"text": "def get_deadline_date(params)\n params[:domain] = host_from_url(params[:domain])\n uri = @base_uri+'deadline_date'\n uri.query = \"domain=#{params[:domain]}&publication_date=#{params[:publication_date]}&production_days=#{params[:production_days]}\"\n result = content_from(uri)\n return Date.parse(result['deadline']) if result['deadline']\n result \n end",
"title": ""
},
{
"docid": "24cf4d9c675c1d74f14d41b1aa8fdbde",
"score": "0.54845697",
"text": "def check_end_date\n # if self.category.eql?(\"appointment\")\n unless self.start_date.nil? or self.end_date.nil?\n if (self.end_date < self.start_date)\n self.category.eql?(\"appointment\")? self.errors.add(' ', 'End Date can\\'t be before Start Date') : self.errors.add(' ', 'Due Date can\\'t be before Start Date')\n end\n if self.end_date == self.start_date\n self.errors.add(' ', 'End Time can not be before start time') if (self.end_date.to_time < self.start_date.to_time)\n end\n end\n # end\n end",
"title": ""
},
{
"docid": "80a847d010917b7f77659fe111d58e5b",
"score": "0.547431",
"text": "def adjust_user_time(text)\n\t\treturn text unless Time.parse(text).future?\n\t\tDate.parse text\n\t\ttext\n\trescue\n\t\t\"#{Date.yesterday.to_s} #{text}\"\n\tend",
"title": ""
},
{
"docid": "4cacd0e28020ca32817103dda0962a5d",
"score": "0.5472091",
"text": "def end_date\n return (start and duration_days and duration_hours) ? (start + duration_days.days + duration_hours.hours) : nil\n end",
"title": ""
},
{
"docid": "5c9ea0b14f2e2519d012829b650cb913",
"score": "0.544214",
"text": "def missed_deadline?\n if self.closeDate.nil?\n self.dueDate.to_date < Date.today\n else\n self.dueDate.to_date < self.closeDate.to_date\n end\n end",
"title": ""
},
{
"docid": "91954ababdc77c37025579289c7fb9f9",
"score": "0.54334843",
"text": "def valid_lottery_date\n begin\n USDateParse(self.lottery_deadline)\n rescue\n errors.add(:lottery_deadline, 'The lottery deadline could not be parsed.')\n end\n end",
"title": ""
},
{
"docid": "b074880e239b041681768abce0821925",
"score": "0.54324865",
"text": "def estimated_end_date\n Date.today + remaining_days\n end",
"title": ""
},
{
"docid": "605f3b47c86c9feeb0b82126704f7324",
"score": "0.5406765",
"text": "def expected_end\n val = super\n val = DatelessTime.new val unless val.blank?\n val\n end",
"title": ""
},
{
"docid": "09a3f84d53d46756dc7b7a57e185970d",
"score": "0.5400312",
"text": "def due\n date = Chronic.parse(text.scan(DATE_REGEX).flatten[2])\n date.nil? ? nil : date.to_date\n end",
"title": ""
},
{
"docid": "86e3b4d796f60c3f4d8a779805507929",
"score": "0.5381538",
"text": "def default_due_date\n #Date.parse(future_date($default_due).to_s[0..10]) # => converts to a Date object\n Date.today + $default_due\n end",
"title": ""
},
{
"docid": "7c852b71c8c8ff47e21e9680f73567d6",
"score": "0.53702664",
"text": "def update_due_dates(attributes, user)\n return false unless attributes\n\n attributes.each do |due_date|\n next if due_date[:due_at].blank?\n\n # parse the dd and convert it to utc before saving it to db\n # eg. 2015-06-22 12:05:00 -0400\n current_local_time = Time.parse(due_date[:due_at][0..15])\n tz = ActiveSupport::TimeZone[user.timezonepref].tzinfo\n utc_time = tz.local_to_utc(Time.local(current_local_time.year,\n current_local_time.month,\n current_local_time.day,\n current_local_time.strftime('%H').to_i,\n current_local_time.strftime('%M').to_i,\n current_local_time.strftime('%S').to_i))\n due_date[:due_at] = utc_time\n if due_date[:id].nil? || due_date[:id].blank?\n dd = AssignmentDueDate.new(due_date)\n @has_errors = true unless dd.save\n else\n dd = AssignmentDueDate.find(due_date[:id])\n # get deadline for review\n @has_errors = true unless dd.update_attributes(due_date)\n end\n @errors += @assignment.errors.to_s if @has_errors\n end\n end",
"title": ""
},
{
"docid": "ba59045640a6cac3100c3fee4671257e",
"score": "0.5369447",
"text": "def date_verify\n if end_date && start_date.nil?\n errors.add(:end_date, \"cannot only specify end date\")\n elsif all_day && start_date.nil?\n errors.add(:all_day, \"cannot specify without date\")\n elsif (start_date && end_date) && (start_date > end_date)\n errors.add(:start_date, \"cannot larger than end date\")\n end\n end",
"title": ""
},
{
"docid": "7e1fff369974fbec87789964821833c2",
"score": "0.5350405",
"text": "def appt_date_val # Time.zone.parse (appt_start) #DateTime.strptime(appt_start, \"%y/%m/%d %H:%M\")\n errors.add(:appt_start, \"Must be in the future\") unless (appt_start > Time.now)\n errors.add(:appt_end, \"Must be after Appt Start\") unless (appt_end > appt_start)\n end",
"title": ""
},
{
"docid": "ea88e59483c39a237e1e8fda978199f3",
"score": "0.5348791",
"text": "def remove_due_date\n self.due_at = nil\n \tif ! self.reminder_at.nil?\n\t self.reminder_at = nil\n end\n end",
"title": ""
},
{
"docid": "1fb6e19f1298be3fbcd5701400eb39cb",
"score": "0.5347393",
"text": "def dispatch_deadline\n @dispatch_deadline || DEFAULT_DISPATCH_DEADLINE\n end",
"title": ""
},
{
"docid": "508e82e6768e0a2319675b20b96f962b",
"score": "0.5344829",
"text": "def set_deadline\n @deadline = Deadline.find(params[:id])\n end",
"title": ""
},
{
"docid": "8c362086645da16b44866bd8858fe466",
"score": "0.5341292",
"text": "def end_date_is_bigger?\n return if [endDate.blank?, startDate.blank?].any?\n\n errors.add(:base, 'The end time must be later than the start time') if endDate < startDate\n end",
"title": ""
},
{
"docid": "cb2bf44149907a6bd76a61ca0cac1d78",
"score": "0.5339981",
"text": "def end_date\n Time.parse(@end_date) if @end_date\n end",
"title": ""
},
{
"docid": "cb2bf44149907a6bd76a61ca0cac1d78",
"score": "0.5339981",
"text": "def end_date\n Time.parse(@end_date) if @end_date\n end",
"title": ""
},
{
"docid": "f4c646ad7fa0ddd0239eafaf8c431489",
"score": "0.53397393",
"text": "def palindrome_date_after ( starting_date )\n if not starting_date.valid?\n print \"ERROR: \\\"#{starting_date}\\\" is not a valid date\\n\"\n return\n end\n\n # cut the year into the first two and last two digits\n starting_date_year_beginning = starting_date.year[0..1]\n starting_date_year_ending = starting_date.year[2..3]\n\nend",
"title": ""
},
{
"docid": "917124146fbbc5b2d5a71f9d7fc3dee2",
"score": "0.5318737",
"text": "def end_date_after_start_date\n return if duration_start.blank? || duration_end.blank?\n\n if duration_end < duration_start\n errors.add(:end_date, \"must be after the start date\")\n end\n end",
"title": ""
},
{
"docid": "39022402711b465f942ea7afea1ff15c",
"score": "0.53046346",
"text": "def date_restrictable_must_be_chronological\n\n # bounce unless we have both dates\n return if valid_from.blank? or valid_until.blank?\n\n # otherwise…\n unless valid_until.to_date >= valid_from.to_date\n\n field_name = self.class.human_attribute_name( :valid_from )\n errors.add( :valid_until, :must_be_on_or_after, { field: field_name })\n\n end\n\n end",
"title": ""
},
{
"docid": "2f94404e2e5fa00bc3b618bd634c5ab7",
"score": "0.5294504",
"text": "def burn_after_in_future\n if burn_after_date and burn_after_date < Time.now\n errors.add(:burn_after_date, \n \"#{burn_after_date} cannot be in the past, but you can destroy it now.\")\n end\n end",
"title": ""
},
{
"docid": "7259d6fe0be1cb4fef6fd17fab0fe0f7",
"score": "0.52453613",
"text": "def check_dates\r\n self.start_time -= 8.hours\r\n self.end_time -= 8.hours\r\n end",
"title": ""
},
{
"docid": "2b6e14b0abbaefd08b329a064f0c1385",
"score": "0.524156",
"text": "def change_due_date(date)\n @due_date = Date.parse(date)\n end",
"title": ""
},
{
"docid": "3e36f3981269099559bc1361f8bbad00",
"score": "0.52276516",
"text": "def dueDate\n Date.parse(@dueDate)\n end",
"title": ""
},
{
"docid": "a36dc2b1d66fddcf8b8de68f04e1b67b",
"score": "0.52273875",
"text": "def parse_end_date(params, options={})\n options[:default_end_date] ||= Date.today\n params[:end_date].nil? ? (options[:default_end_date]) : Date.parse(params[:end_date])\n rescue\n options[:default_end_date]\n end",
"title": ""
},
{
"docid": "ff394a4f74fe0b1e21015542de1fd9c7",
"score": "0.5218001",
"text": "def created_before_proposal_deadline\n errors.add(:base, \"The proposal deadline has passed.\") if\n DateTime.now > Quarter.active_quarter.project_proposal_deadline\n end",
"title": ""
},
{
"docid": "bcd1b42935739a164e628e9e542cc462",
"score": "0.5212888",
"text": "def completion_date_to_time\n Chronic.parse(\"#{completion_date_value} #{completion_date} ago\")\n end",
"title": ""
},
{
"docid": "accb856ee4f93cb642e6376d76fe32c6",
"score": "0.5209882",
"text": "def validate_end_date\n start = Date.parse(start_date.to_s)\n last = Date.parse(end_date.to_s)\n puts \"is date #{last} before #{start}\"\n errors.add(:end_date, \"can't be before the start date\") if last < start\n end",
"title": ""
},
{
"docid": "859da0c43f4e86b6635e537860f8b428",
"score": "0.519052",
"text": "def fix_closed_completed_bug(clsd_comp_date, irb_status, exp_date)\n # closed statuses\n cs = [\"Closed/Terminated\", \"Expired\", \"Completed\"]\n if cs.include?(irb_status) and exp_date < Time.now\n clsd_comp_date\n else\n nil\n end\n end",
"title": ""
},
{
"docid": "8efaffb81090bbb2c1f75ff5f5edf807",
"score": "0.51678336",
"text": "def changeDueDate(date)\n @dueDate = Date.parse(date)\n return @dueDate\n end",
"title": ""
},
{
"docid": "5ec55d24b587a4ef3541787938782edf",
"score": "0.51520586",
"text": "def update_due_date\n @due_date_all.each do |dd|\n update_due_date_nameurl(dd)\n adjust_due_date_for_timezone(dd)\n break if validate_due_date\n end\n end",
"title": ""
},
{
"docid": "60fc9ebedcab475816b77cc5a952a476",
"score": "0.5142118",
"text": "def normalize(age_str, unit_str=nil)\n\t\t\t\n\t\t\t# resolve the unit string to\n\t\t\t# a regular string that we\n\t\t\t# can pass to chronic\n\t\t\tfirst = unit_str.to_s[0,1]\n\t\t\tif first == \"\" then unit = @options[:default_unit]\n\t\t\telsif first == \"y\" then unit = \"year\"\n\t\t\telsif first == \"m\" then unit = \"month\"\n\t\t\telsif first == \"d\" then unit = \"day\"\n\t\t\tend\n\t\t\t\n\t\t\t# pass a nice string like \"2 years ago\" to chronic,\n\t\t\t# so it will return a Time containing all\n\t\t\t# of the days that the DOB could have been\n\t\t\tbegin\n\t\t\t\tChronic.parse(\"#{age_str} #{unit}s ago\")\n\t\t\t\n\t\t\t# something went wrong (it's not really important\n\t\t\t# what), so return nil, to be caught by the _accept?_\n\t\t\t# method, which will cancel the match\n\t\t\trescue StandardError\n\t\t\t\tnil\n\t\t\tend\n\t\tend",
"title": ""
},
{
"docid": "b60555f1a8975116f315694c5960e606",
"score": "0.512658",
"text": "def get_app_deadline(page)\n page.css(WebScraper::JOB_INFO_SELECTOR)[WebScraper::JOB_DEADLINE_POS].content.strip\n end",
"title": ""
},
{
"docid": "2fe72f06379d96702239962a1471e264",
"score": "0.51225394",
"text": "def applydate(candidate)\n unless candidate[:date_applied] >= 15.days.ago.to_date\n raise StandardError, 'candidate applied too long ago'\n end\nend",
"title": ""
},
{
"docid": "f4e299e3b4dbd9240b520a18ec6cb3af",
"score": "0.5112133",
"text": "def set_valid_until_time\n if valid_until\n self.valid_until = valid_until.utc + (23-valid_until.hour).hours + (59-valid_until.min).minutes + (59-valid_until.sec).seconds unless category && category.name.eql?(\"rideshare\")\n end \n end",
"title": ""
},
{
"docid": "2be8708c3b124281cda3e5085ca97b2c",
"score": "0.51091814",
"text": "def check_child_task_end_date\n parent = self.parent if self.category.eql?('todo') && assoc_as == \"1\"\n if !parent.blank? and parent.category.eql?('todo')\n unless self.end_date.blank?\n self.errors.add(' ', 'Child task cannot have end date after parent-tasks end date' ) if self.end_date > parent.end_date\n else \n self.errors.add(' ', 'Child task end date cannot be blank' )\n end\n end\n end",
"title": ""
},
{
"docid": "c33aab31a023f9265d313e9718057d31",
"score": "0.510882",
"text": "def is_late\n Time.current > object.deadline if object.deadline.present?\n end",
"title": ""
},
{
"docid": "8369d3d2e1fb38a13d9876f8dcec3161",
"score": "0.5102338",
"text": "def dt_end\n return nil unless valid\n\n @current_date + @event_duration\n end",
"title": ""
},
{
"docid": "28008d94f53be1976bbf8242c83e329e",
"score": "0.5098027",
"text": "def check_end_date\n if end_date < Date.today\n \n errors.add(:end_date, \"End Date can only be later than today\")\n end\n end",
"title": ""
},
{
"docid": "0cfd5a3e129194c79a66090b792ffd0a",
"score": "0.5096547",
"text": "def deadline_over?(risk_register)\n return date_difference(Date.today, risk_register.target_date) < 0\n end",
"title": ""
},
{
"docid": "c697afb9b3e16bef82f8ca2865e9f7f8",
"score": "0.5093819",
"text": "def due_to_cannot_be_in_the_past\n if dueTo.present? && dueTo < Date.today\n errors.add(:dueTo, \"can't be in the past\")\n end\n end",
"title": ""
},
{
"docid": "4f116f9d3e5e1c4b7bd4a92ce1d38972",
"score": "0.5093801",
"text": "def assignment_due(type, time, round, review_allowed_id = 3)\n create(:assignment_due_date,\n deadline_type: DeadlineType.where(name: type).first,\n due_at: time,\n round: round,\n review_allowed_id: review_allowed_id)\n end",
"title": ""
},
{
"docid": "4748669f7cb7d77ac8335aca8caab56d",
"score": "0.50923324",
"text": "def due_date\n if @values[:due_date] != nil && @values[:due_date] != \"\"\n @date_due_date ||= Date.parse(@values[:due_date])\n end\n end",
"title": ""
},
{
"docid": "bdee05101962163cab00a8e8b7558bbe",
"score": "0.508422",
"text": "def end_date\n @end_date ||= respond_to?(:parliamentPeriodEndDate) ? DateTime.parse(parliamentPeriodEndDate) : nil\n end",
"title": ""
},
{
"docid": "28f0237e153b2c6ed76f9e3dd2236c4e",
"score": "0.5081232",
"text": "def effective_end_datetime\n end_date + 1.day + roster.switchover.minutes\n end",
"title": ""
},
{
"docid": "f80576f17b4aeb3485b015580d8dc734",
"score": "0.5080548",
"text": "def completed_date\n nil\n end",
"title": ""
},
{
"docid": "f506363ffc51bc3ad1a765c7e6504798",
"score": "0.5066308",
"text": "def update\n respond_to do |format|\n if @deadline.update(deadline_params)\n format.html { redirect_to @deadline, notice: 'Deadline was successfully updated.' }\n format.json { render :show, status: :ok, location: @deadline }\n else\n format.html { redirect_to edit_listing_path(@deadline.listing) }\n format.json { render json: @deadline.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ab802d1d38ee2a5337a42ff34eb09ad3",
"score": "0.5065246",
"text": "def date_of_birth_cannot_be_in_the_future\n # stretch\n if self.date_of_birth.present? && self.date_of_birth > DateTime.now\n errors.add(:date_of_birth, \"can't be in the future\")\n end\n end",
"title": ""
},
{
"docid": "09f9994350bab90110c9da08a48a4fd1",
"score": "0.50519323",
"text": "def human_friendly_time(time_string)\n # if the time is within the last two days, from now, specify the time in hours\n # ago, otherwise present the information as as a date string\n\n # require 'active_support/time'\n # two_days_ago = DateTime.current.advance :days => -2\n #\n # if DateTime.parse(time_string) - two_days_ago > 0\n # DateTime.parse(time_string) - two_days_ago\n # end\n\n time_string\n\nrescue\n log.debug \"Failed to generate a human friendly time from #{time_string}\"\n time_string\nend",
"title": ""
},
{
"docid": "734d0794875055ff68712d9a75d82cdc",
"score": "0.5045356",
"text": "def remaining_days_in_words(due_date, start_date = nil)\n if due_date&.past?\n content_tag(:strong, 'Past due')\n elsif start_date&.future?\n content_tag(:strong, 'Upcoming')\n elsif due_date\n is_upcoming = (due_date - Date.today).to_i > 0\n time_ago = time_ago_in_words(due_date)\n\n # https://gitlab.com/gitlab-org/gitlab-ce/issues/49440\n #\n # Need to improve the i18n here and do a full translation\n # of the string instead of piecewise translations.\n content = time_ago\n .gsub(/\\d+/) { |match| \"<strong>#{match}</strong>\" }\n .remove(\"about \")\n remaining_or_ago = is_upcoming ? _(\"remaining\") : _(\"ago\")\n\n \"#{content} #{remaining_or_ago}\".html_safe\n elsif start_date&.past?\n days = (Date.today - start_date).to_i\n \"#{content_tag(:strong, days)} #{'day'.pluralize(days)} elapsed\".html_safe\n end\n end",
"title": ""
},
{
"docid": "eb7b74ab89938798bc4970b2bada893b",
"score": "0.5044583",
"text": "def final_due_date\n del = self.deliverables\n return nil unless del.size > 0\n\n dates = del.collect(&:due).delete_if { |d| d.blank?}\n \n return dates.sort[-1] \n end",
"title": ""
},
{
"docid": "29bae92ec41d5438d768539b5da01d1c",
"score": "0.50416327",
"text": "def complete_max_date(date_str)\n unless date_str && date_str =~ /(\\d\\d\\d?\\d?)(?:-(\\d\\d))?(?:-(\\d\\d))?/\n return nil # malformed date\n end\n\n year = $1\n month = $2\n day = $3\n\n if year.length == 2 # century\n Date.iso8601(\"#{date_str}99-12-31\")\n elsif year.length == 3 #decade\n Date.iso8601(\"#{date_str}9-12-31\")\n elsif day.nil?\n month ||= \"12\" # maybe we don't have month either\n\n # have to auto-complete to last day in month, which\n # we can have date class figure out for us this way:\n Date.iso8601(\"#{year}-#{month}-01\").next_month.prev_day\n else\n Date.iso8601(\"#{year}-#{month}-#{day}\")\n end\n rescue Date::Error\n nil\n end",
"title": ""
},
{
"docid": "88ffa8818fadf823496c6964fcecf98b",
"score": "0.5041197",
"text": "def valid_end_date\n errors.add(:end_date, 'The end date cannot be parsed.') unless end_date_is_valid?\n end",
"title": ""
},
{
"docid": "504ed5f2cbcd66fc52ca7443f80f7543",
"score": "0.50356966",
"text": "def normalize_end_time(time)\n time.midnight + 1.day - 1.minute\n end",
"title": ""
},
{
"docid": "8a1769b6f674f06caa3cc13158c3b4ab",
"score": "0.5025755",
"text": "def correct_completion_status_date\n if self.is_complete? && self.completed_at.blank?\n # if task is marked complete without a completion time, update completion time to now & allow confirmation\n self.completed_at = DateTime.now\n return true\n elsif !self.is_complete? && !self.completed_at.blank?\n # if task is marked incomplete, but there is a completion time entered, update completion time to blank & allow confirmation\n self.completed_at = nil\n return true\n else\n return false\n end\n end",
"title": ""
},
{
"docid": "bdd3ebe70517121c1fc5721d93f792fb",
"score": "0.50198185",
"text": "def due\n DateTime.parse(value_for('due'))\n end",
"title": ""
},
{
"docid": "a9140a1b89745ced9cf6930f3969b718",
"score": "0.5014899",
"text": "def ask_due_date old=nil\n days = $default_due\n today = Date.today\n start = Date.parse($g_row['start_date'].to_s) || today\n ask(\"Enter due date? (>= #{start}) \", Date) { \n |q| q.default = (today + days).to_s;\n q.validate = lambda { |p| Date.parse(p) >= start }; \n q.responses[:not_valid] = \"Enter a date >= than #{start}\"\n }\n end",
"title": ""
},
{
"docid": "b4a52fd0912ab89df335a39bc820ca29",
"score": "0.5012324",
"text": "def valid_end_date\n self.end_date - self.start_date > 0 ? true : false\n end",
"title": ""
},
{
"docid": "0fd4677cbc2a670f9a4c3996c776d484",
"score": "0.5008088",
"text": "def validate_start_date\n start = Date.parse(start_date.to_s)\n last = Date.parse(end_date.to_s)\n puts \"is date #{start} after #{last}\"\n errors.add(:start_date, \"can't be after the end date\") if start > last\n end",
"title": ""
},
{
"docid": "81f54c3a2e636aa13b97c4503c0719c6",
"score": "0.499669",
"text": "def target_response_time\n now = Time.now\n if Time.before_business_hours?(now)\n next_business_day = now.midnight\n else\n next_business_day = 1.business_day.after(now).midnight\n end\n due_date = 5.business_hour.after(next_business_day)\n end",
"title": ""
},
{
"docid": "9eea6898d7a2c700b4552f56cd089f04",
"score": "0.4995281",
"text": "def valid_effective_end_date?\n\n if effective_end_date.present?\n if effective_end_date < Date.civil(1900, 1, 1)\n errors[:base] << \"End date must be after 1900.\"\n return false\n else\n # Rule: Employment Master End date should be greater than current date.\n # Employment data entry is needed to know if client is currently working or not, so End date should be null or if entered it should be greater than current date.\n if effective_end_date > Date.today\n return true\n else\n errors[:base] << \"Currently working employment should have future end date\"\n end\n\n end\n else\n return true\n end\n end",
"title": ""
},
{
"docid": "c5f10fe3ceee957d66aea9aa88903958",
"score": "0.49855417",
"text": "def date_cannot_be_in_the_past\n if end_time.present? && end_time < Time.zone.today\n errors.add(:end_time, \"end_date can't be in the past\")\n elsif start_time.present? && start_time < Time.zone.today\n errors.add(:start_time, \"start_date can't be in the past\")\n end\n end",
"title": ""
},
{
"docid": "e74001f6706a0d6fb77281cdd65d5ea8",
"score": "0.49851137",
"text": "def start_date_cannot_be_in_the_past\n if self.start_date && self.start_date < DateTime.now\n errors.add(:date, \"invalid. Start date can't be in the past\")\n end\nend",
"title": ""
},
{
"docid": "68ef6fbfbc4df5f7915e731018188e43",
"score": "0.49849445",
"text": "def validDate\n if (Date.parse(last_reminder.to_s) rescue ArgumentError) == ArgumentError\n errors.add(:last_reminder, 'must be a valid date')\n end\n end",
"title": ""
},
{
"docid": "c4903ebd879b8f8715da7206c3e6fe34",
"score": "0.49832407",
"text": "def due\n if read_attribute(:due) && read_attribute(:due) > 0\n Time.at(read_attribute(:due)).to_date\n else\n nil\n end\n end",
"title": ""
},
{
"docid": "249f2002fd08668e47fc919452c8b017",
"score": "0.49813807",
"text": "def due_date\n if assignment.section_due_dates_type\n a_due_date = assignment.assessment_section_properties\n .find_by(section_id: inviter&.section)&.due_date || assignment.due_date\n else\n a_due_date = assignment.due_date\n end\n extension_time = (extension&.time_delta || 0)\n return a_due_date + extension_time if !assignment.is_timed || start_time.nil?\n\n start_time + extension_time + assignment.duration\n end",
"title": ""
}
] |
8074cdc18b22dacc1c9ddf012fb83221 | PUT /relationships/organization_users/1 PUT /relationships/organization_users/1.json | [
{
"docid": "1375b2668eac4514ef43b0b1cf98455f",
"score": "0.6972928",
"text": "def update\n @relationships_organization_user = Relationships::OrganizationUser.find(params[:id])\n\n authorize! :update, @relationships_organization_user\n\n respond_to do |format|\n if @relationships_organization_user.update_attributes(permitted_params)\n format.html { redirect_to @relationships_organization_user, notice: 'Organization user was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @relationships_organization_user.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] | [
{
"docid": "33994b54501b573a293b5a604e476742",
"score": "0.734488",
"text": "def update_user\n validate_params :id, :user\n @user = User.find(params[:id])\n org = params[:user].delete(:own_organization_attributes)\n @user.update_attributes(params[:user])\n @user.own_organization.update_attributes(org) if org\n if @user.save\n render :text => {:status => 'ok', :id => @user.id}.to_json\n else\n render :text => {:status => 'fail', :errors => @user.errors}.to_json, :status => :bad_request\n end\n end",
"title": ""
},
{
"docid": "c3d28e18b0aa5728d104942b895222b6",
"score": "0.7017772",
"text": "def update\n @user_organization = UserOrganization.find(params[:id])\n\n if @user_organization.update(user_organization_params)\n head :no_content\n else\n render json: @user_organization.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "a4fcec248357c464da8669728754c4bd",
"score": "0.6792533",
"text": "def update(attrs, user = @@default_user)\n attrs = { id: @id }.merge(attrs)\n @attributes = send_request(\"organizations/#{attrs[:id]}\", :put) do |req|\n req.body = {\n organization: attrs.except(:id),\n auth_token: user.auth_token\n }\n end\n end",
"title": ""
},
{
"docid": "c7e6edabd946dca1afb2973025a4a11a",
"score": "0.669722",
"text": "def update\n @organization_user = OrganizationUser.find(params[:id])\n\n respond_to do |format|\n if @organization_user.update_attributes(params[:organization_user])\n flash[:notice] = 'OrganizationUser was successfully updated.'\n format.html { redirect_to(@organization_user) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @organization_user.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "220e54d3070f39fb9e4588862d5d1e77",
"score": "0.6687099",
"text": "def update\n user = User.find(update_params[:user_id])\n\n @organization.users.delete(user) if user\n\n head :no_content\n end",
"title": ""
},
{
"docid": "472c0cd26fe86f3c4b6d23d4c1d473f6",
"score": "0.66697365",
"text": "def update\n respond_to do |format|\n if @organization_user.update(organization_user_params)\n format.html { redirect_to @organization_user, notice: 'Organization user was successfully updated.' }\n format.json { render :show, status: :ok, location: @organization_user }\n else\n format.html { render :edit }\n format.json { render json: @organization_user.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d4482d81c92037a01304012b783581cd",
"score": "0.66448766",
"text": "def set_user_organization\n @user_organization = UserOrganization.find(params[:id])\n end",
"title": ""
},
{
"docid": "616ba0631674166c2ba1154dc0b870a6",
"score": "0.6618386",
"text": "def set_organization_user\n @organization_user = OrganizationUser.find(params[:id])\n end",
"title": ""
},
{
"docid": "d13703821d788e4370b67a96c4f1553e",
"score": "0.66070116",
"text": "def set_organization_user\n @organization_user = OrganizationUser.find(params[:id])\n end",
"title": ""
},
{
"docid": "6830229db1678450707969491a14cc34",
"score": "0.65713614",
"text": "def update\n user = User.find_by_id(params[:id])\n UserOrganizationClaimer.new(self, user, current_user).call(params[:organization_id])\n end",
"title": ""
},
{
"docid": "0ad993161d55f1ad909fbc1f01d513b4",
"score": "0.65136296",
"text": "def update\n @user_org = UserOrg.find(params[:id])\n\n if @user_org.update(user_org_params)\n head :no_content\n else\n render json: @user_org.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "bfb87b934c2e9989583dc2d08e46bb8a",
"score": "0.64082515",
"text": "def update\n @organization = User::Organization.find(params[:id])\n\n respond_to do |format|\n if @organization.update_attributes(params[:organization])\n flash[:notice] = 'User::Organization was successfully updated.'\n format.html { redirect_to(@organization) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @organization.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "bd230d60c3aebe873863c8feb0e4c0bd",
"score": "0.6300599",
"text": "def update\n @organization = Organization.find(params[:id])\n @organization.update_attributes(params[:organization])\n \n respond_with(@organization, :location => admin_organizations_path)\n end",
"title": ""
},
{
"docid": "7a5c1def12ecb8da8a002b35c9acc6c3",
"score": "0.6280491",
"text": "def update_organization_membership(org, options = {})\n options = options.dup\n if user = options.delete(:user)\n options.delete(:state)\n put \"#{Organization.path(org)}/memberships/#{user}\", options\n else\n options.delete(:role)\n patch \"user/memberships/orgs/#{org}\", options\n end\n end",
"title": ""
},
{
"docid": "0eaeebeac0ba1319f7e6a72f26261626",
"score": "0.62686485",
"text": "def update\n @organization = Organization.find_by_id(current_user.organization_id)\n\n respond_to do |format|\n if @organization.update_attributes(params[:organization])\n format.html { redirect_to dashboard_path, notice: 'Organization was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @organization.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7191a513e7cc20d59b2cf450168b0b38",
"score": "0.6244027",
"text": "def set_organization\n @organization = Organization.find(params[:id])\n @new_user_link = new_organization_user_path(@organization)\n end",
"title": ""
},
{
"docid": "fdf77406c86479d4b177b1a8b70c9954",
"score": "0.6237562",
"text": "def update\n respond_to do |format|\n if @org_user.update(org_user_params)\n format.html { redirect_to @org_user, notice: 'Org user was successfully updated.' }\n format.json { render :show, status: :ok, location: @org_user }\n else\n format.html { render :edit }\n format.json { render json: @org_user.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "57c0dc8a6feb7795c1d6a66c79cdfecd",
"score": "0.6162445",
"text": "def update\n @organization.update(organization_params)\n respond_with(@organization)\n end",
"title": ""
},
{
"docid": "254f2363a34db15395248a6d2ccc5335",
"score": "0.6151426",
"text": "def set_organization_of(user)\n @organization = user.organization rescue nil\n end",
"title": ""
},
{
"docid": "f6bad825433977b97a36840d97bdaf71",
"score": "0.61412233",
"text": "def update\n @organization = Organization.find(params[:id])\n if @organization.update_attributes(organization_params)\n flash[:success] = \"Profile updated\"\n redirect_to @organization\n else\n render 'edit'\n end\n end",
"title": ""
},
{
"docid": "b046591cc451759a68e3a7e3073beb27",
"score": "0.61316234",
"text": "def update\n if @organization.update(organization_params)\n render_json_object(@organization)\n else\n implement_status(\"create\",\"error\")\n end\n end",
"title": ""
},
{
"docid": "24a4d60e954b29e836f7fbcf61a01420",
"score": "0.6131449",
"text": "def organization_user_params\n params.require(:organization_user).permit(:user_id, :organization_id, :role_id)\n end",
"title": ""
},
{
"docid": "24a4d60e954b29e836f7fbcf61a01420",
"score": "0.6131449",
"text": "def organization_user_params\n params.require(:organization_user).permit(:user_id, :organization_id, :role_id)\n end",
"title": ""
},
{
"docid": "8d2f4e7e9ebe0f2647bd569d2a5e9009",
"score": "0.61262196",
"text": "def user_organization_params\n params.require(:user_organization).permit(:user_id, :organization_id, :invite_link)\n end",
"title": ""
},
{
"docid": "1282ccae06af502827430028a9f5ae95",
"score": "0.6121753",
"text": "def update\n @organization.social_link = @social_link\n @organization.feature = @feature\n @organization.organization_theme = @organization_theme\n render json: @organization.errors unless @organization.update(filtered_org_params)\n end",
"title": ""
},
{
"docid": "d6ca9adf0409595136245648297f7249",
"score": "0.60698175",
"text": "def organization_user_params\n params.require(:organization_user).permit(:org_id, :user_id, :role, :title)\n end",
"title": ""
},
{
"docid": "01ddf7f0ea7f5f3ae1210a7d777179c8",
"score": "0.6056126",
"text": "def create\n @user_organization = UserOrganization.new(user_organization_params)\n\n if @user_organization.save\n render json: @user_organization, status: :created, location: @user_organization\n else\n render json: @user_organization.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "dd6ddb9156acbb59199d2af00efe9b23",
"score": "0.6055528",
"text": "def update\n @hDisplay = true\n @orgUser = true\n @org_id = params[:id]\n @Neworganization = Organization.find(params[:id])\n @userC = session[:user]\n @organization = Organization.find(params[:id])\n allorganizations = Organization.find(:all)\n @organizations = Hash.new\n \n \n @partner_id = Partner.find_by_sql [\"SELECT * FROM partners where organization_id = ?\",@id]\n @partnerNames = []\n for currentPartner in @partner_id\n partnerID = currentPartner.partner_org_id \n @partnerOrganization = Organization.find(partnerID)\n @partnerNames.push @partnerOrganization.name\n end\n \n for organization in allorganizations do\n if(organization.visible== true)\n @organizations.merge!({organization.name => organization.id})\n end\n end\n users = []\n users = User.find_by_sql [\"SELECT * FROM users where affiliateOrg =?\",@Neworganization.name];\n if @Neworganization.update_attributes(params[:organization])\n flash[:notice] = 'Organization was successfully updated.'\n for user in users\n user.update_attribute(:affiliateOrg,@Neworganization.name)\n end\n redirect_to(@Neworganization)\n else\n render :action => \"edit\" \n \n end\n \n end",
"title": ""
},
{
"docid": "d31d6e51e921cb8d06fbe486168d71b7",
"score": "0.60460883",
"text": "def set_organization\n @organization = authed_user.organizations.find_by_permalink(params[:organization_id])\n raise ActiveRecord::RecordNotFound unless @organization\n end",
"title": ""
},
{
"docid": "9ffbb2a46d5b3ce00e9edd0e38ca5fbb",
"score": "0.60443306",
"text": "def update\n @organization = Organization.find(params[:id])\n\n respond_to do |format|\n if @organization.update_attributes(params[:organization]).put\n format.html { redirect_to @organization, notice: 'Organization was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @organization.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3310a6600886b05f26255cc1df18bc20",
"score": "0.5999135",
"text": "def update\n @breadcrumb = 'update'\n @organization = Organization.find(params[:id])\n @organization.updated_by = current_user.id if !current_user.nil?\n \n respond_to do |format|\n if @organization.update_attributes(params[:organization])\n format.html { redirect_to @organization,\n notice: (crud_notice('updated', @organization) + \"#{undo_link(@organization)}\").html_safe }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @organization.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8d298fe1f25a64b7add436cb9484718f",
"score": "0.59952915",
"text": "def update\n if @current_organization.update(organization_params)\n render json: @current_organization, serializer: OrganizationSerializer\n else\n render json: @current_organization.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "285e8290b5b55f8d301842bb91bfd578",
"score": "0.5976963",
"text": "def set_user\n @user = Organization.find(params[:id])\n end",
"title": ""
},
{
"docid": "781d3b77d93afa54b15114eb0702933b",
"score": "0.5974771",
"text": "def update\n @organization = Organization.find(params[:id])\n\n respond_to do |format|\n if @organization.update_attributes(params[:organization])\n format.html { redirect_to @organization, notice: 'Organization was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @organization.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "781d3b77d93afa54b15114eb0702933b",
"score": "0.5974771",
"text": "def update\n @organization = Organization.find(params[:id])\n\n respond_to do |format|\n if @organization.update_attributes(params[:organization])\n format.html { redirect_to @organization, notice: 'Organization was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @organization.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f1013f03e1d9fcb9124d992d70d9492f",
"score": "0.5964857",
"text": "def set_organization\n @user = current_user\n @organization = @user.organization\n end",
"title": ""
},
{
"docid": "783845ff89d6658afae9d9c5fe3a3a29",
"score": "0.595685",
"text": "def update\n if @organization.update(organization_params)\n render json: @organization.as_json\n else\n render json: {\n errors: Stitches::Errors.from_active_record_object(@organization)\n }, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "1b2e364a0262296fb3fccef8dd209fac",
"score": "0.59444785",
"text": "def update\n @organization = Organization.find(params[:id])\n \n if (user_signed_in? && current_user.admin?) || (!current_organization_account.nil? && @organization.id == current_organization_account.organization_id)\n respond_to do |format|\n if @organization.update_attributes(params[:organization])\n if @organization.url[0..3] != \"http\"\n @organization.url = \"http://\"+@organization.url\n @organization.save!\n end\n format.html { redirect_to @organization }\n format.json { respond_with_bip(@organization) }\n else\n format.html { render :action => \"show\" }\n format.json { respond_with_bip(@organization) } \n end\n end\n else\n redirect_to root_path\n end\n end",
"title": ""
},
{
"docid": "207dfdd3fea85f028ea1e55b601b2bdb",
"score": "0.5940013",
"text": "def destroy\n if @organization.users.present?\n @organization.users.each do |user|\n user.destroy\n end\n @organization.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_organizations_path,\n notice: I18n.t('flash.organization.successfully_deleted') }\n format.json { head :no_content }\n end\n end\n end",
"title": ""
},
{
"docid": "f11ec7c9d7feb68bee2c4ad1ca6f5bbf",
"score": "0.5933396",
"text": "def setup_organization_user_schema\n reset_user_schema_permissions\n reset_schema_owner\n set_user_privileges_at_db\n set_user_as_organization_member\n rebuild_quota_trigger\n\n # INFO: organization privileges are set for org_member_role, which is assigned to each org user\n if @user.organization_owner?\n setup_organization_owner\n end\n end",
"title": ""
},
{
"docid": "8af317773c8e0976c2a4325c03792493",
"score": "0.5925947",
"text": "def set_org_user\n @org_user = OrgUser.find(params[:id])\n end",
"title": ""
},
{
"docid": "6616bef843b1b15ce74789929ca79e31",
"score": "0.5919109",
"text": "def update\n @organization = Organization.find(params[:id])\n\n respond_to do |format|\n if @organization.update_attributes(params[:organization])\n format.html { redirect_to @organization, notice: 'Organization was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @organization.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6616bef843b1b15ce74789929ca79e31",
"score": "0.5919109",
"text": "def update\n @organization = Organization.find(params[:id])\n\n respond_to do |format|\n if @organization.update_attributes(params[:organization])\n format.html { redirect_to @organization, notice: 'Organization was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @organization.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6616bef843b1b15ce74789929ca79e31",
"score": "0.5919109",
"text": "def update\n @organization = Organization.find(params[:id])\n\n respond_to do |format|\n if @organization.update_attributes(params[:organization])\n format.html { redirect_to @organization, notice: 'Organization was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @organization.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6616bef843b1b15ce74789929ca79e31",
"score": "0.5919109",
"text": "def update\n @organization = Organization.find(params[:id])\n\n respond_to do |format|\n if @organization.update_attributes(params[:organization])\n format.html { redirect_to @organization, notice: 'Organization was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @organization.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "39e74b257350648abddbc8da4a58887a",
"score": "0.59162664",
"text": "def update\n @organization = Organization.find(params[:id])\n\n respond_to do |format|\n if @organization.update_attributes(params[:organization])\n format.html { redirect_to organizations_path, notice: 'Organization was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @organization.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "298db0bb4ccd8e1d9c9f2cc9f910ad32",
"score": "0.5893102",
"text": "def update\n flash[:notice] = 'The organization was successfully updated.' if organization.update_attributes(params[:organization])\n respond_with(organization)\n end",
"title": ""
},
{
"docid": "602ed86f3be1eaef4608d24cc4c7f868",
"score": "0.58813787",
"text": "def update\n respond_to do |format|\n if @organization.update(organization_params)\n format.html { redirect_to @organization, notice: \"Organization was successfully updated.\" }\n format.json { render :show, status: :ok, location: @organization }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @organization.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "235507b44a389c0f2150e72c11b69286",
"score": "0.5879095",
"text": "def update\n respond_to do |format|\n professor_user = User.find_by(id: params[:professor][:id]) if params[:professor][:id].present?\n student_user = User.find_by(id: params[:student][:id]) if params[:student][:id].present?\n if @organization.update(organization_params) && professor_user.update(professor_params) && student_user.update(student_params)\n format.html { redirect_to admin_organizations_path,\n notice: I18n.t('flash.organization.successfully_updated') }\n else\n format.html { render :edit }\n end\n end\n end",
"title": ""
},
{
"docid": "40db7e4c65519462d15edc094a5977d8",
"score": "0.5878352",
"text": "def update\n @user = user_scope.find(params[:id])\n company_users_options\n if params[\"user\"][\"company_users_attributes\"].present?\n @user.company_users.where(\"id NOT IN (?)\", params[\"user\"][\"company_users_attributes\"].values().pluck(:id).select{|a| !a.blank?}).each{|d| d.destroy}\n elsif\n @user.company_users.each{|d| d.destroy}\n end\n respond_to do |format|\n if @user.update_attributes(user_params)\n format.html {\n redirect_to (session['members.back_path'] || members_path), notice: I18n.t('commons.successfully_updated')\n }\n format.json { head :no_content }\n else\n flash[:error] = @user.errors.full_messages.join(', ').html_safe\n format.html { render action: \"edit\" }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "064d7e002f4db5e9e4881d0ce37efb09",
"score": "0.5876275",
"text": "def update(organization_name, body)\n @client.organization.update(organization_name, body)\n end",
"title": ""
},
{
"docid": "257d075a6cf47dd0d4e563e22083d9da",
"score": "0.5874549",
"text": "def update\n @organization = Organization.find(params[:id])\n params[:organization][:admin_email_to_add] = params[:organization_admin_email_to_add] if params[:organization]\n unless current_user.try(:can_edit?,@organization)\n flash[:notice] = \"You don't have permission\"\n redirect_to organization_path(params[:id]) and return false\n end\n respond_to do |format|\n if @organization.update_attributes_with_admin(params[:organization])\n format.html { redirect_to @organization, notice: 'Organization was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @organization.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0ed9edf74dfac47ee56db5679bc439c8",
"score": "0.5872465",
"text": "def update\n respond_to do |format|\n if @organization.update(organization_params)\n format.html { redirect_to @organization, notice: 'Organization was successfully updated.' }\n format.json { render :show, status: :ok, location: @organization }\n else\n format.html { render :edit }\n format.json { render json: @organization.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0ed9edf74dfac47ee56db5679bc439c8",
"score": "0.5872465",
"text": "def update\n respond_to do |format|\n if @organization.update(organization_params)\n format.html { redirect_to @organization, notice: 'Organization was successfully updated.' }\n format.json { render :show, status: :ok, location: @organization }\n else\n format.html { render :edit }\n format.json { render json: @organization.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0ed9edf74dfac47ee56db5679bc439c8",
"score": "0.5872465",
"text": "def update\n respond_to do |format|\n if @organization.update(organization_params)\n format.html { redirect_to @organization, notice: 'Organization was successfully updated.' }\n format.json { render :show, status: :ok, location: @organization }\n else\n format.html { render :edit }\n format.json { render json: @organization.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0ed9edf74dfac47ee56db5679bc439c8",
"score": "0.5872465",
"text": "def update\n respond_to do |format|\n if @organization.update(organization_params)\n format.html { redirect_to @organization, notice: 'Organization was successfully updated.' }\n format.json { render :show, status: :ok, location: @organization }\n else\n format.html { render :edit }\n format.json { render json: @organization.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0ed9edf74dfac47ee56db5679bc439c8",
"score": "0.5872465",
"text": "def update\n respond_to do |format|\n if @organization.update(organization_params)\n format.html { redirect_to @organization, notice: 'Organization was successfully updated.' }\n format.json { render :show, status: :ok, location: @organization }\n else\n format.html { render :edit }\n format.json { render json: @organization.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0ed9edf74dfac47ee56db5679bc439c8",
"score": "0.5872465",
"text": "def update\n respond_to do |format|\n if @organization.update(organization_params)\n format.html { redirect_to @organization, notice: 'Organization was successfully updated.' }\n format.json { render :show, status: :ok, location: @organization }\n else\n format.html { render :edit }\n format.json { render json: @organization.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0ed9edf74dfac47ee56db5679bc439c8",
"score": "0.5872465",
"text": "def update\n respond_to do |format|\n if @organization.update(organization_params)\n format.html { redirect_to @organization, notice: 'Organization was successfully updated.' }\n format.json { render :show, status: :ok, location: @organization }\n else\n format.html { render :edit }\n format.json { render json: @organization.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0ed9edf74dfac47ee56db5679bc439c8",
"score": "0.5872465",
"text": "def update\n respond_to do |format|\n if @organization.update(organization_params)\n format.html { redirect_to @organization, notice: 'Organization was successfully updated.' }\n format.json { render :show, status: :ok, location: @organization }\n else\n format.html { render :edit }\n format.json { render json: @organization.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0ed9edf74dfac47ee56db5679bc439c8",
"score": "0.5872465",
"text": "def update\n respond_to do |format|\n if @organization.update(organization_params)\n format.html { redirect_to @organization, notice: 'Organization was successfully updated.' }\n format.json { render :show, status: :ok, location: @organization }\n else\n format.html { render :edit }\n format.json { render json: @organization.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0ed9edf74dfac47ee56db5679bc439c8",
"score": "0.5872465",
"text": "def update\n respond_to do |format|\n if @organization.update(organization_params)\n format.html { redirect_to @organization, notice: 'Organization was successfully updated.' }\n format.json { render :show, status: :ok, location: @organization }\n else\n format.html { render :edit }\n format.json { render json: @organization.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0ed9edf74dfac47ee56db5679bc439c8",
"score": "0.5872465",
"text": "def update\n respond_to do |format|\n if @organization.update(organization_params)\n format.html { redirect_to @organization, notice: 'Organization was successfully updated.' }\n format.json { render :show, status: :ok, location: @organization }\n else\n format.html { render :edit }\n format.json { render json: @organization.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0ed9edf74dfac47ee56db5679bc439c8",
"score": "0.5872465",
"text": "def update\n respond_to do |format|\n if @organization.update(organization_params)\n format.html { redirect_to @organization, notice: 'Organization was successfully updated.' }\n format.json { render :show, status: :ok, location: @organization }\n else\n format.html { render :edit }\n format.json { render json: @organization.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0ed9edf74dfac47ee56db5679bc439c8",
"score": "0.5872465",
"text": "def update\n respond_to do |format|\n if @organization.update(organization_params)\n format.html { redirect_to @organization, notice: 'Organization was successfully updated.' }\n format.json { render :show, status: :ok, location: @organization }\n else\n format.html { render :edit }\n format.json { render json: @organization.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "928c1228a124a99ef274deb601987c02",
"score": "0.5871295",
"text": "def add_to_org(org, username)\n username.split(\",\").each do |name|\n @client.update_organization_membership(org, {:user => name})\n puts \"#{name} added to #{org}.\"\n end\nend",
"title": ""
},
{
"docid": "575056ccda2d6337b2c4b9b8372a1949",
"score": "0.58637846",
"text": "def update\n respond_to do |format|\n if @organization.update(organization_params)\n format.html { redirect_to @organization, notice: \"Organization was successfully updated.\" }\n format.json { render :show, status: :ok, location: @organization }\n else\n format.html { render :edit }\n format.json { render json: @organization.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4f51ac1f60d95b6a35bd39cf958bf01d",
"score": "0.5862206",
"text": "def update\n @organization = Organization.find(params[:id])\n\n respond_to do |format|\n if @organization.update_attributes(params[:organization])\n flash[:notice] = 'Organization was successfully updated.'\n format.html { redirect_to orgadmin_organization_url(@organization) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @organization.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a78951412ca4a227c0f7ae8f86c16a16",
"score": "0.5856209",
"text": "def update\n respond_to do |format|\n if @organization.update(organization_params)\n format.html { redirect_to root_path, notice: 'Organization was successfully updated.' }\n format.json { render :show, status: :ok, location: @organization }\n else\n format.html { render :edit }\n format.json { render json: @organization.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "92bcec959da69d1a4c041c0d056eb1df",
"score": "0.58559436",
"text": "def create\n @organization = Organization.new(params[:organization])\n \n respond_to do |format|\n if @organization.save\n # Sets Organization's first user to admin.\n @organization.users.first.update_attribute('admin', true)\n \n # Auto logs in Organization's first user upon creation.\n auto_login(@organization.users.first)\n \n format.html { redirect_to dashboard_path, notice: 'Organization was successfully created.' }\n format.json { render json: @organization, status: :created, location: @organization }\n else\n format.html { render action: \"new\" }\n format.json { render json: @organization.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f3da8df04560e8359cfe0cb3e6071640",
"score": "0.5855937",
"text": "def update\n respond_to do |format|\n if @org.update(org_params)\n format.html { redirect_to [:admin, @org], notice: 'Organization was successfully updated.' }\n format.json { render :show, status: :ok, location: [:admin, @org] }\n else\n format.html { render :edit }\n format.json { render json: @org.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ffb4523035f4db7609e4bb1f8d7a50ad",
"score": "0.5850168",
"text": "def update\n\t\t@organization = Organization.find(params[:id])\n\n\t\t@organization.modified_by = 1\n\n\t\tif @organization.update_attributes(params[:organization])\n\t\t\t\tflash[:notice] = 'Organizaiton Updated Sucessfully.'\n\t\t\t\tredirect_to :action => 'show', :id => @organization\n\t\telse\n\t\t\t\trender :action => 'edit'\n\t\tend\n\tend",
"title": ""
},
{
"docid": "13f3ef25a4eccc13fd1541eb3b0ae182",
"score": "0.58467954",
"text": "def update\n respond_to do |format|\n if @organization.update_attributes(params[:organization])\n format.html { redirect_to @organization, notice: 'Organization was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @organization.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "dfe3bcf2af161c7f799558f6712f0503",
"score": "0.5842097",
"text": "def update\n\t\trespond_to do |format|\n\t\t\tif @organization.update(organization_params)\n\t\t\t\tflash[:success] = \"Organization was successfully updated\" \n\t\t\t\tformat.html { redirect_to @organization}\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: @organization.errors, status: :unprocessable_entity }\n\t\t\tend\n\t\tend\n\tend",
"title": ""
},
{
"docid": "42ce8219f85e05cd3bfa848d37fbfd48",
"score": "0.58396876",
"text": "def approve_all_users_organization org_email\n org = Organization.find_by_email org_email\n if org.present?\n org.users.update_all(:is_active => true)\n end\n end",
"title": ""
},
{
"docid": "b9836cf5525307914eaf693e60ae6d91",
"score": "0.58304375",
"text": "def set_organization_profile\n @organization_profile = OrganizationProfile.find(params[:id])\n end",
"title": ""
},
{
"docid": "f0d5807785ac61b40b1803ca5bac8a7e",
"score": "0.58266205",
"text": "def update\n usr = User.find_by_id UserParams.build(params).fetch(:id)\n UserOrganisationClaimer.new(self, usr, usr).call(UserParams.build(params).fetch(:pending_organisation_id))\n end",
"title": ""
},
{
"docid": "c0dbcba7a1ee031164b55bb2ed18baf7",
"score": "0.58261245",
"text": "def set_organization\n # debugger\n @user = Organization.find(current_user.id)\n end",
"title": ""
},
{
"docid": "d0e07da49af88fa694addf1f4d842675",
"score": "0.5815996",
"text": "def set_organization\n @organization = Organization.find(params[:id])\n end",
"title": ""
},
{
"docid": "d0e07da49af88fa694addf1f4d842675",
"score": "0.5815996",
"text": "def set_organization\n @organization = Organization.find(params[:id])\n end",
"title": ""
},
{
"docid": "d0e07da49af88fa694addf1f4d842675",
"score": "0.5815996",
"text": "def set_organization\n @organization = Organization.find(params[:id])\n end",
"title": ""
},
{
"docid": "d0e07da49af88fa694addf1f4d842675",
"score": "0.5815996",
"text": "def set_organization\n @organization = Organization.find(params[:id])\n end",
"title": ""
},
{
"docid": "d0e07da49af88fa694addf1f4d842675",
"score": "0.5815996",
"text": "def set_organization\n @organization = Organization.find(params[:id])\n end",
"title": ""
},
{
"docid": "d0e07da49af88fa694addf1f4d842675",
"score": "0.5815996",
"text": "def set_organization\n @organization = Organization.find(params[:id])\n end",
"title": ""
},
{
"docid": "d0e07da49af88fa694addf1f4d842675",
"score": "0.5815996",
"text": "def set_organization\n @organization = Organization.find(params[:id])\n end",
"title": ""
},
{
"docid": "6551bcf42f1ce20d81c0e56bd3eb3b67",
"score": "0.58090305",
"text": "def org_modify(name, args)\n # Create the organization object\n org = {}\n\n # Add the owner email address if one was supplied\n org['owner_email'] = args[:owner_email] \\\n if args.key? :owner_email and args[:owner_email]\n\n # Add the list of members if it was supplied\n org['users'] = args[:members] \\\n if args.key? :members and args[:members]\n\n @logger.debug org\n\n # Sign & send the request\n uri = server_uri(\"/organizations/#{name}\")\n res_data = api_json_put(uri, org)\n @logger.debug res_data\n\n return res_data\n end",
"title": ""
},
{
"docid": "e6c1195e8d02c5719826b6af91236a64",
"score": "0.58062375",
"text": "def set_organization\n @organization = @namespace.ownerable\n end",
"title": ""
},
{
"docid": "ac3c23a7c48e3b7f7208c8fbfb8a878c",
"score": "0.58038443",
"text": "def update\n @admin_organization = Admin::Organization.find(params[:id])\n\n respond_to do |format|\n if @admin_organization.update_attributes(params[:admin_organization])\n format.html { redirect_to admin_organizations_url, notice: 'Organização atualizada com sucesso' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @admin_organization.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6caff4189c59eff580d09f5b23414efc",
"score": "0.580142",
"text": "def update\n @organization = Organization.find(params[:id])\n @organization.update_attributes(params[:organization])\n respond_to do |format|\n if @organization.save\n format.html { redirect_to @organization, notice: 'Organization was successfully updated..' }\n format.json { respond_with_bip(@organization) }\n else\n format.html { render action: \"new\" }\n format.json { respond_with_bip(@organization) }\n end\n end\n end",
"title": ""
},
{
"docid": "3fec4f8aa57ae7e1cd080fffafaeb764",
"score": "0.57973194",
"text": "def set_organization_account\n @organization_account = OrganizationAccount.find(params[:id])\n end",
"title": ""
},
{
"docid": "3fec4f8aa57ae7e1cd080fffafaeb764",
"score": "0.57973194",
"text": "def set_organization_account\n @organization_account = OrganizationAccount.find(params[:id])\n end",
"title": ""
},
{
"docid": "6a165357ad6b2819d5e980d6169ff296",
"score": "0.5793286",
"text": "def set_organization\n @organization = Organization.find(params[:organization_id])\n end",
"title": ""
},
{
"docid": "6a165357ad6b2819d5e980d6169ff296",
"score": "0.5793286",
"text": "def set_organization\n @organization = Organization.find(params[:organization_id])\n end",
"title": ""
},
{
"docid": "637a51191e5b5438e070dd7a857b7e1a",
"score": "0.57902825",
"text": "def set_organization\n @organization = Organization.find(params[:id])\n end",
"title": ""
},
{
"docid": "637a51191e5b5438e070dd7a857b7e1a",
"score": "0.57902825",
"text": "def set_organization\n @organization = Organization.find(params[:id])\n end",
"title": ""
},
{
"docid": "637a51191e5b5438e070dd7a857b7e1a",
"score": "0.57902825",
"text": "def set_organization\n @organization = Organization.find(params[:id])\n end",
"title": ""
},
{
"docid": "637a51191e5b5438e070dd7a857b7e1a",
"score": "0.57902825",
"text": "def set_organization\n @organization = Organization.find(params[:id])\n end",
"title": ""
},
{
"docid": "637a51191e5b5438e070dd7a857b7e1a",
"score": "0.57902825",
"text": "def set_organization\n @organization = Organization.find(params[:id])\n end",
"title": ""
},
{
"docid": "637a51191e5b5438e070dd7a857b7e1a",
"score": "0.57902825",
"text": "def set_organization\n @organization = Organization.find(params[:id])\n end",
"title": ""
},
{
"docid": "637a51191e5b5438e070dd7a857b7e1a",
"score": "0.57902825",
"text": "def set_organization\n @organization = Organization.find(params[:id])\n end",
"title": ""
}
] |
af630984682f1a0b5a68e6092af0d102 | Update properties of this object | [
{
"docid": "daaa7e38ee3de917dfe82be8f03e6685",
"score": "0.0",
"text": "def update!(**args)\n @options = args[:options] if args.key?(:options)\n end",
"title": ""
}
] | [
{
"docid": "184b1b1ed771473d3eb9f338c0734c38",
"score": "0.73066413",
"text": "def update *args\n opts = args.extract_options!\n fill_properties opts\n self.save\n end",
"title": ""
},
{
"docid": "5076c5a88404ae72986f958710f5687a",
"score": "0.72631145",
"text": "def update(properties)\n @__hash__.update(properties)\n end",
"title": ""
},
{
"docid": "60506d5995c168a570c84bcbafd6d01b",
"score": "0.7164913",
"text": "def update props\n # not an alias because doc\n put props\n end",
"title": ""
},
{
"docid": "ec25850e7b3d73876b69868b5e566a7a",
"score": "0.71243227",
"text": "def update_properties(hash)\n hash.each do |key, value|\n self.send(\"#{key}=\", value)\n end\n end",
"title": ""
},
{
"docid": "22938231f10efd60d4530259d1ab7161",
"score": "0.7061904",
"text": "def update_props(properties)\n fail 'not implemented'\n end",
"title": ""
},
{
"docid": "22938231f10efd60d4530259d1ab7161",
"score": "0.7061904",
"text": "def update_props(properties)\n fail 'not implemented'\n end",
"title": ""
},
{
"docid": "150fa2bdc1fc43d28ac45e2278a1f797",
"score": "0.7012263",
"text": "def update_properties(hash)\n hash.each do |key, value|\n setter_method = \"#{key}=\"\n if self.respond_to?(setter_method)\n self.send(setter_method, value)\n end\n end\n end",
"title": ""
},
{
"docid": "b46342a57789464175130c5171865a4f",
"score": "0.69842774",
"text": "def update_properties(props)\n load_properties(force: true)\n\n deep_merge = proc do |_, old_value, new_value|\n if old_value.is_a?(Hash) && new_value.is_a?(Hash)\n old_value.merge(new_value, &deep_merge)\n else\n new_value\n end\n end\n\n props = properties.merge(props || {}, &deep_merge)\n save_properties(properties.merge(props || {}))\n self\n end",
"title": ""
},
{
"docid": "e72f78e0e269f94de07625d4972f0298",
"score": "0.69181895",
"text": "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"title": ""
},
{
"docid": "e72f78e0e269f94de07625d4972f0298",
"score": "0.69181895",
"text": "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"title": ""
},
{
"docid": "e72f78e0e269f94de07625d4972f0298",
"score": "0.69181895",
"text": "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"title": ""
},
{
"docid": "e72f78e0e269f94de07625d4972f0298",
"score": "0.69181895",
"text": "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"title": ""
},
{
"docid": "e72f78e0e269f94de07625d4972f0298",
"score": "0.69181895",
"text": "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"title": ""
},
{
"docid": "e72f78e0e269f94de07625d4972f0298",
"score": "0.69181895",
"text": "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"title": ""
},
{
"docid": "e72f78e0e269f94de07625d4972f0298",
"score": "0.69181895",
"text": "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"title": ""
},
{
"docid": "e72f78e0e269f94de07625d4972f0298",
"score": "0.69181895",
"text": "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"title": ""
},
{
"docid": "e72f78e0e269f94de07625d4972f0298",
"score": "0.69181895",
"text": "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"title": ""
},
{
"docid": "e72f78e0e269f94de07625d4972f0298",
"score": "0.69181895",
"text": "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"title": ""
},
{
"docid": "e72f78e0e269f94de07625d4972f0298",
"score": "0.69181895",
"text": "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"title": ""
},
{
"docid": "e72f78e0e269f94de07625d4972f0298",
"score": "0.69181895",
"text": "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"title": ""
},
{
"docid": "e72f78e0e269f94de07625d4972f0298",
"score": "0.69181895",
"text": "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"title": ""
},
{
"docid": "e72f78e0e269f94de07625d4972f0298",
"score": "0.69181895",
"text": "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"title": ""
},
{
"docid": "e72f78e0e269f94de07625d4972f0298",
"score": "0.69181895",
"text": "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"title": ""
},
{
"docid": "e72f78e0e269f94de07625d4972f0298",
"score": "0.69181895",
"text": "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"title": ""
},
{
"docid": "4aa62f56c7ec71b9c7d914558501001b",
"score": "0.67206186",
"text": "def update\n update_obj\n end",
"title": ""
},
{
"docid": "10e41ec39ba2af73495ccece21c2d8a3",
"score": "0.6709326",
"text": "def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\n end",
"title": ""
},
{
"docid": "b0508d605628b9b1ec78fe5f0697a746",
"score": "0.67057854",
"text": "def update_properties(hash)\n hash.each_pair do |k, v|\n self.set_property_value(k.to_s, v)\n end\n end",
"title": ""
},
{
"docid": "092b765ad7cf3ce4b6bf4e7d8a2e6af7",
"score": "0.6696149",
"text": "def update(attrs)\n super(attrs)\n end",
"title": ""
},
{
"docid": "092b765ad7cf3ce4b6bf4e7d8a2e6af7",
"score": "0.6696149",
"text": "def update(attrs)\n super(attrs)\n end",
"title": ""
},
{
"docid": "092b765ad7cf3ce4b6bf4e7d8a2e6af7",
"score": "0.6696149",
"text": "def update(attrs)\n super(attrs)\n end",
"title": ""
},
{
"docid": "092b765ad7cf3ce4b6bf4e7d8a2e6af7",
"score": "0.6696149",
"text": "def update(attrs)\n super(attrs)\n end",
"title": ""
},
{
"docid": "092b765ad7cf3ce4b6bf4e7d8a2e6af7",
"score": "0.6696149",
"text": "def update(attrs)\n super(attrs)\n end",
"title": ""
},
{
"docid": "092b765ad7cf3ce4b6bf4e7d8a2e6af7",
"score": "0.6696149",
"text": "def update(attrs)\n super(attrs)\n end",
"title": ""
},
{
"docid": "092b765ad7cf3ce4b6bf4e7d8a2e6af7",
"score": "0.6696149",
"text": "def update(attrs)\n super(attrs)\n end",
"title": ""
},
{
"docid": "d9b090f93fdffad34c5489c4c437c6f3",
"score": "0.6662612",
"text": "def update_properties(properties_element)\n end",
"title": ""
},
{
"docid": "b7ed68c679d7eaccf546a282fab6e985",
"score": "0.66259164",
"text": "def apply\n update_keys\n update_columns\n update_properties\n end",
"title": ""
},
{
"docid": "769b77b7f7f9f82ae847f5968eb201dc",
"score": "0.6571848",
"text": "def update_self obj\n obj.each do |k,v|\n instance_variable_set(\"@#{k}\", v) if v\n end\n end",
"title": ""
},
{
"docid": "769b77b7f7f9f82ae847f5968eb201dc",
"score": "0.6571848",
"text": "def update_self obj\n obj.each do |k,v|\n instance_variable_set(\"@#{k}\", v) if v\n end\n end",
"title": ""
},
{
"docid": "137759bf2b87f1ca55eb78e668747d15",
"score": "0.6539236",
"text": "def update!(**args)\n @property = args[:property] if args.key?(:property)\n end",
"title": ""
},
{
"docid": "137759bf2b87f1ca55eb78e668747d15",
"score": "0.6539236",
"text": "def update!(**args)\n @property = args[:property] if args.key?(:property)\n end",
"title": ""
},
{
"docid": "137759bf2b87f1ca55eb78e668747d15",
"score": "0.6539236",
"text": "def update!(**args)\n @property = args[:property] if args.key?(:property)\n end",
"title": ""
},
{
"docid": "137759bf2b87f1ca55eb78e668747d15",
"score": "0.6539236",
"text": "def update!(**args)\n @property = args[:property] if args.key?(:property)\n end",
"title": ""
},
{
"docid": "137759bf2b87f1ca55eb78e668747d15",
"score": "0.6539236",
"text": "def update!(**args)\n @property = args[:property] if args.key?(:property)\n end",
"title": ""
},
{
"docid": "137759bf2b87f1ca55eb78e668747d15",
"score": "0.6539236",
"text": "def update!(**args)\n @property = args[:property] if args.key?(:property)\n end",
"title": ""
},
{
"docid": "862f7aa179e3e1751693f78772c09a99",
"score": "0.65159345",
"text": "def assign_properties(properties); end",
"title": ""
},
{
"docid": "328c68b6c30673dac05ca930f5da533c",
"score": "0.6458067",
"text": "def update_attributes(attrs)\n self.update(attrs)\n end",
"title": ""
},
{
"docid": "328c68b6c30673dac05ca930f5da533c",
"score": "0.6458067",
"text": "def update_attributes(attrs)\n self.update(attrs)\n end",
"title": ""
},
{
"docid": "d8b3bf9ec121e23dad3af2edca6e6094",
"score": "0.6421526",
"text": "def update(attributes); end",
"title": ""
},
{
"docid": "63cce5e99d8dc677403b00708afc27c9",
"score": "0.641709",
"text": "def update\n @prop.update_attributes(prop_params)\n respond_with @prop, location: backstage_scene_props_path\n end",
"title": ""
},
{
"docid": "3dc790e8b6e9e65eb288c97798a4c7f2",
"score": "0.64154994",
"text": "def set_properties inst\n model.properties.find_all { |p| model.updatable?(p.name) }.each do |p|\n inst.send(\"#{p.name}=\".to_sym, params[p.name.to_s]) if params.has_key?(p.name.to_s)\n end\n inst\n end",
"title": ""
},
{
"docid": "9373755ebb61f1f274f6c8504a5acace",
"score": "0.64146614",
"text": "def reload(props = {})\n reset_changes\n super\n assign_attributes(props)\n self\n end",
"title": ""
},
{
"docid": "fb68247cb1373a6c71a42a2aa69f1dcb",
"score": "0.64143723",
"text": "def update(attrs)\n @attrs = attrs\n self\n end",
"title": ""
},
{
"docid": "fb68247cb1373a6c71a42a2aa69f1dcb",
"score": "0.64143723",
"text": "def update(attrs)\n @attrs = attrs\n self\n end",
"title": ""
},
{
"docid": "23eb6f5fbeae4bf9f56ac93a4126b4b5",
"score": "0.6389745",
"text": "def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end",
"title": ""
},
{
"docid": "71d6a0160cffce28db4d0a25d6dbda13",
"score": "0.6385747",
"text": "def update!(**args)\n @count = args[:count] if args.key?(:count)\n @properties = args[:properties] if args.key?(:properties)\n end",
"title": ""
},
{
"docid": "9b95f8bc66f32e7ebbe7e63224d1ebaf",
"score": "0.6364864",
"text": "def update(attributes)\n attributes.each do |name, value|\n self[name] = value\n end\n end",
"title": ""
},
{
"docid": "575f3d0c94f466263e302883e13868a6",
"score": "0.6330631",
"text": "def _update\n update!\n end",
"title": ""
},
{
"docid": "7c6d5966289f9347f75aa7b24903a328",
"score": "0.6327251",
"text": "def _update!\n self.class.properties.each do |property, predicate|\n if dirty?(property)\n self.class.repository_or_fail.delete([subject, predicate[:predicate], nil])\n if self.class.is_list?(property)\n repo = RDF::Repository.new\n attribute_get(property).each do |value|\n repo << RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(value, self.class.properties[property][:type]))\n end\n self.class.repository_or_fail.insert(*repo)\n else\n self.class.repository_or_fail.insert(RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(attribute_get(property), self.class.properties[property][:type]))) unless attribute_get(property).nil?\n end\n end\n @attributes[:original][property] = attribute_get(property)\n @dirty[property] = nil\n @attributes[:copied][property] = NOT_SET\n end\n self.class.repository_or_fail.insert(RDF::Statement.new(@subject, RDF.type, type)) unless type.nil?\n end",
"title": ""
},
{
"docid": "210886bcfd68fae88847f8b3464d4058",
"score": "0.6325362",
"text": "def update_properties!(scraper)\n log \"Updating assets for #{self.slug}\"\n# only update active properties\n Property.where(source_id: self.id, status: 1).find_each do |prop|\n begin\n scraper.update_property(prop)\n rescue Exception => e\n log \"there was a connection error #{e.message} - #{e.class}\"\n end\n end\n end",
"title": ""
},
{
"docid": "da63345424fc9aecef032928485bd149",
"score": "0.6319025",
"text": "def update\n \n end",
"title": ""
},
{
"docid": "749afa4ff068e21c7d78bbad94c19d6c",
"score": "0.6313444",
"text": "def update!(attributes); end",
"title": ""
},
{
"docid": "e8639be61ed6393bc612a8aef27789d3",
"score": "0.6312355",
"text": "def update!(**args)\n @border = args[:border] if args.key?(:border)\n @fields = args[:fields] if args.key?(:fields)\n @object_id_prop = args[:object_id_prop] if args.key?(:object_id_prop)\n end",
"title": ""
},
{
"docid": "6284f332cbe8c998b16d5e816c5d21ed",
"score": "0.6291622",
"text": "def update!(**args)\n @display_name = args[:display_name] if args.key?(:display_name)\n @parent = args[:parent] if args.key?(:parent)\n @property = args[:property] if args.key?(:property)\n @property_type = args[:property_type] if args.key?(:property_type)\n end",
"title": ""
},
{
"docid": "6284f332cbe8c998b16d5e816c5d21ed",
"score": "0.6291622",
"text": "def update!(**args)\n @display_name = args[:display_name] if args.key?(:display_name)\n @parent = args[:parent] if args.key?(:parent)\n @property = args[:property] if args.key?(:property)\n @property_type = args[:property_type] if args.key?(:property_type)\n end",
"title": ""
},
{
"docid": "5a8e82caac01cee661bc875a5b0cf723",
"score": "0.6283673",
"text": "def refresh\n set_attributes\n end",
"title": ""
},
{
"docid": "9e076ce17f1607b2a6248469b63b9c05",
"score": "0.62797445",
"text": "def training_updated_properties=(value)\n @training_updated_properties = value\n end",
"title": ""
},
{
"docid": "309d8f89c45737b781ca7c15a61b00a5",
"score": "0.6273536",
"text": "def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @size_bytes = args[:size_bytes] if args.key?(:size_bytes)\n end",
"title": ""
},
{
"docid": "309d8f89c45737b781ca7c15a61b00a5",
"score": "0.6273536",
"text": "def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @size_bytes = args[:size_bytes] if args.key?(:size_bytes)\n end",
"title": ""
},
{
"docid": "60d8c4f58de490a0d7cdd918c16a2cce",
"score": "0.6269463",
"text": "def update(attrs)\n @attrs.update(attrs)\n self\n end",
"title": ""
},
{
"docid": "60d8c4f58de490a0d7cdd918c16a2cce",
"score": "0.6269463",
"text": "def update(attrs)\n @attrs.update(attrs)\n self\n end",
"title": ""
},
{
"docid": "60d8c4f58de490a0d7cdd918c16a2cce",
"score": "0.6269463",
"text": "def update(attrs)\n @attrs.update(attrs)\n self\n end",
"title": ""
},
{
"docid": "60d8c4f58de490a0d7cdd918c16a2cce",
"score": "0.6269463",
"text": "def update(attrs)\n @attrs.update(attrs)\n self\n end",
"title": ""
},
{
"docid": "7a41bc9d5a07220fb8626d1fa90d2d79",
"score": "0.62639254",
"text": "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @source = args[:source] if args.key?(:source)\n end",
"title": ""
},
{
"docid": "f88ac8dac0e7b4769636f755e65a14ba",
"score": "0.6261997",
"text": "def update!(**args)\n @fields = args[:fields] if args.key?(:fields)\n @properties = args[:properties] if args.key?(:properties)\n end",
"title": ""
},
{
"docid": "f88ac8dac0e7b4769636f755e65a14ba",
"score": "0.6261997",
"text": "def update!(**args)\n @fields = args[:fields] if args.key?(:fields)\n @properties = args[:properties] if args.key?(:properties)\n end",
"title": ""
},
{
"docid": "f88ac8dac0e7b4769636f755e65a14ba",
"score": "0.6261997",
"text": "def update!(**args)\n @fields = args[:fields] if args.key?(:fields)\n @properties = args[:properties] if args.key?(:properties)\n end",
"title": ""
},
{
"docid": "f88ac8dac0e7b4769636f755e65a14ba",
"score": "0.6261997",
"text": "def update!(**args)\n @fields = args[:fields] if args.key?(:fields)\n @properties = args[:properties] if args.key?(:properties)\n end",
"title": ""
},
{
"docid": "f88ac8dac0e7b4769636f755e65a14ba",
"score": "0.6261997",
"text": "def update!(**args)\n @fields = args[:fields] if args.key?(:fields)\n @properties = args[:properties] if args.key?(:properties)\n end",
"title": ""
},
{
"docid": "f88ac8dac0e7b4769636f755e65a14ba",
"score": "0.6261997",
"text": "def update!(**args)\n @fields = args[:fields] if args.key?(:fields)\n @properties = args[:properties] if args.key?(:properties)\n end",
"title": ""
},
{
"docid": "afd53a32bf51a2ff3c438cbf011b1ee6",
"score": "0.6261246",
"text": "def update!\n saved = false\n retries = RETRIES\n while !saved\n begin\n res = Persistence::Setup.db.save_doc(@properties)\n @properties = Persistence::Setup.db.get(res['id'])\n saved = true\n rescue Exception => ex\n raise ex if ex.http_code != 409\n if(retries > 0)\n @new_properties = Persistence::Setup.db.get(@properties['_id'])\n @properties.each_pair do |k,v|\n if k != \"_rev\" && k != \"_id\"\n @new_properties[k] = v\n end\n end\n @properties = @new_properties\n else\n raise ex\n end\n end\n end\n :ok\n end",
"title": ""
},
{
"docid": "118090da310d688caa13dea348732f3c",
"score": "0.62579167",
"text": "def update(attributes={})\n self.class.update(self, attributes)\n end",
"title": ""
},
{
"docid": "91dc386ff8fa066852510a5d62b13078",
"score": "0.62170374",
"text": "def update(attrs)\n @attrs ||= {}\n @attrs.update(attrs)\n self\n end",
"title": ""
},
{
"docid": "91dc386ff8fa066852510a5d62b13078",
"score": "0.62170374",
"text": "def update(attrs)\n @attrs ||= {}\n @attrs.update(attrs)\n self\n end",
"title": ""
},
{
"docid": "6249943d1eeff63f8f611fcf73254058",
"score": "0.62152076",
"text": "def update\n \n end",
"title": ""
},
{
"docid": "1c12f310aca206a2cefff8c291007668",
"score": "0.6210263",
"text": "def update!(**args)\n @property = args[:property] if args.key?(:property)\n @schema = args[:schema] if args.key?(:schema)\n end",
"title": ""
},
{
"docid": "3dfb66c3e13f181393bb4510e9fcd51f",
"score": "0.62083745",
"text": "def set_update(attrs = {})\n @movement.attributes = attrs.slice(*attributes_for_update)\n set_details\n\n @movement.balance = get_updated_balance\n @movement.gross_total = original_total\n @movement.set_state_by_balance!\n @movement.discounted = ( discount > 0 )\n\n @movement.balance_inventory = balance_inventory\n @movement.delivered = @movement.details.all? {|v| v.balance <= 0}\n\n @errors.new(movement).set_errors\n end",
"title": ""
},
{
"docid": "1c0316f22c6db917fa4719767b5326a9",
"score": "0.6204041",
"text": "def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"title": ""
},
{
"docid": "5d229ea224b1dfa7ac9ce6808ca63fc4",
"score": "0.62017816",
"text": "def update(attributes = {})\n super(attributes)\n retrieve!\n self\n end",
"title": ""
},
{
"docid": "6992c0833b982296b329ec1d8c7289de",
"score": "0.6201711",
"text": "def update(attributes = {})\n self.attributes = attributes\n _update\n end",
"title": ""
},
{
"docid": "2beb42793217599eea1dac4b91640e41",
"score": "0.6196084",
"text": "def update_attributes\n server_update_data.each_pair do |key, value|\n instance_variable_set(\"@#{key}\", value)\n end\n end",
"title": ""
},
{
"docid": "67f76e6622d1021031437ad609613c63",
"score": "0.6192824",
"text": "def update(obj)\n obj.each_pair do |key, value|\n send(\"#{key}=\", value)\n end\n self\n end",
"title": ""
},
{
"docid": "30aa07725af2114280d6e8f916ab079f",
"score": "0.6183338",
"text": "def update!\n\t\t\tconstruct!(self, &@update)\n\t\t\t@update = nil\n\t\t\t\n\t\t\treturn self\n\t\tend",
"title": ""
},
{
"docid": "f1f71f298690a3bd1f5832b15038d8bb",
"score": "0.6174291",
"text": "def updated_properties\n @updated_properties ||= ActiveSupport::HashWithIndifferentAccess.new\n end",
"title": ""
},
{
"docid": "e1f766468b11768b786daa133483b157",
"score": "0.61730784",
"text": "def update\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "ed1b58af16fd466e308ffc9229115e36",
"score": "0.6145399",
"text": "def update_attributes(params)\n raise(RHapi::AttributeError, \"The params must be a hash.\") unless params.is_a?(Hash)\n params.each do |name, value|\n self.properties.send(name.to_s + '=', value)\n end\n save # only call API once rather than repeatedly saving with update_attribute calls\n end",
"title": ""
},
{
"docid": "ed1b58af16fd466e308ffc9229115e36",
"score": "0.6145399",
"text": "def update_attributes(params)\n raise(RHapi::AttributeError, \"The params must be a hash.\") unless params.is_a?(Hash)\n params.each do |name, value|\n self.properties.send(name.to_s + '=', value)\n end\n save # only call API once rather than repeatedly saving with update_attribute calls\n end",
"title": ""
},
{
"docid": "147d62c4df79ff1ca86cbd477112bf7f",
"score": "0.61445665",
"text": "def update\n end",
"title": ""
},
{
"docid": "147d62c4df79ff1ca86cbd477112bf7f",
"score": "0.61445665",
"text": "def update\n end",
"title": ""
},
{
"docid": "147d62c4df79ff1ca86cbd477112bf7f",
"score": "0.61445665",
"text": "def update\n end",
"title": ""
},
{
"docid": "7f11aed7030229ef429116ccba78c00f",
"score": "0.61400205",
"text": "def update_properties\n # t_init = 0, t_mod = 0, t_formula = 0, t_formula_mod = 0, t_post_init = 0\n # t_update_properties = Benchmark.measure do\n # Reset values for everything except formulas\n # t_init = Benchmark.measure do\n character_properties.reject { |p| p.is_a?(CharacterFormula) }.each do |p|\n p.init(self)\n end\n # end\n\n # Apply modifiers to attributes, skills and resistances (formulas later)\n mods = []\n # t_mod = Benchmark.measure do\n mods << race.property_modifiers if race\n mods << birthsign.property_modifiers if birthsign\n mods.flatten!\n mods.reject { |m| m.property.is_a?(Formula) }.each(&method(:apply_modifier))\n # end\n\n # Now start to process formulas\n # t_formula = Benchmark.measure do\n character_properties.select { |p| p.is_a?(CharacterFormula) }.each do |f|\n f.init(self)\n end\n # end\n\n # Apply modifiers to formulas\n # t_formula_mod = Benchmark.measure do\n mods.select { |m| m.property.is_a?(Formula) }.each(&method(:apply_modifier))\n # end\n\n # t_post_init = Benchmark.measure do\n character_properties.each do |prop|\n prop.post_init(self)\n end\n # end\n # end\n\n # logger.warn(\"## Init: #{(t_init.real*1000).to_i}ms\")\n # logger.warn(\"## Mofifiers: #{(t_mod.real*1000).to_i}ms\")\n # logger.warn(\"## Formula: #{(t_formula.real*1000).to_i}ms\")\n # logger.warn(\"## Formula Modifiers: #{(t_formula_mod.real*1000).to_i}ms\")\n # logger.warn(\"## Post Init: #{(t_post_init.real*1000).to_i}ms\")\n # logger.warn(\"### Update Properties: #{(t_update_properties.real*1000).to_i}ms\")\n end",
"title": ""
},
{
"docid": "22a21a1959eeb926dfe475d8878239d7",
"score": "0.6127356",
"text": "def update\n connection.put(singleton_path(prefix_options), encode, self.class.headers).tap do |response|\n load_attributes_from_response(response)\n end\n end",
"title": ""
}
] |
f359aaa5e3ec03111e0e3c0fac9e8909 | Get a path to the given daybased calendar page, based on the +day_link+ blog setting. | [
{
"docid": "38cd08c12d3af93ba356b578f9fe6f45",
"score": "0.8353715",
"text": "def blog_day_path(year, month, day, blog_name = nil)\n build_url blog_controller(blog_name).calendar_pages.link(year, month, day)\n end",
"title": ""
}
] | [
{
"docid": "908684589e56b885eba42b5a3f5092cc",
"score": "0.8194394",
"text": "def blog_day_path(year, month, day, key=nil)\n sitemap.find_resource_by_path(::Middleman::Blog::CalendarPages.link(blog_controller(key).options, year, month, day)).try(:url)\n end",
"title": ""
},
{
"docid": "c8800da24885625466a2a3977d9d88c2",
"score": "0.75757575",
"text": "def day_link(day)\r\n\t\tlink = []\r\n\t\tif Event.day_count(day) > 0\r\n\t\t\tlink << \"/daily\"\r\n\t\t\tlink << \"/\"\r\n\t\t\tlink << day.to_date.to_s\r\n\t\tend\r\n\t\tlink.empty? ? nil : link.join(\"\")\r\n\tend",
"title": ""
},
{
"docid": "fc7b757021c74cb526cabcc7416ab9f2",
"score": "0.6952977",
"text": "def day_url\n base_url + day_path\n end",
"title": ""
},
{
"docid": "ec816478a791c3d51c09271bb8341dcf",
"score": "0.66755664",
"text": "def day_view(week, day)\n if day_inside_calendar?(week, day)\n response = %(<a href=\"#\">#{current_day}</a>)\n self.current_day = current_day.succ\n else\n response = \"\"\n end\n return response\n end",
"title": ""
},
{
"docid": "780824f1a7ea65c804b33a51e0fa813b",
"score": "0.65405697",
"text": "def day_url(year, month, day)\n url(:day, {:year => year, :month => ::Feather::Padding::pad_single_digit(month), :day => ::Feather::Padding::pad_single_digit(day)})\n end",
"title": ""
},
{
"docid": "98c82c70d90e927919ea1c285d080c80",
"score": "0.65230167",
"text": "def link_path\n mon = self.timestamp.mon\n\n if mon < 10\n mon = \"0\" + mon.to_s\n end\n\n return [\n (Verblog::Config.blog_path||Verblog::Engine.mounted_path),\n self.timestamp.year,\n mon,\n self.id.to_s + '-' + self.url_string\n ].join('/').gsub(/\\/+/,\"/\")\n end",
"title": ""
},
{
"docid": "3e64311a4547bca7c6ce3f354a2493bf",
"score": "0.64762104",
"text": "def day_link(text, date, day_action)\n link_to(text, params.merge(:action => day_action, :day => date.day), :class => 'ec-day-link')\n end",
"title": ""
},
{
"docid": "3e64311a4547bca7c6ce3f354a2493bf",
"score": "0.64762104",
"text": "def day_link(text, date, day_action)\n link_to(text, params.merge(:action => day_action, :day => date.day), :class => 'ec-day-link')\n end",
"title": ""
},
{
"docid": "9091e21985f9413bb029d56d3dcdbfd8",
"score": "0.64523643",
"text": "def day_url(year, month, day)\n url(:day, {:year => year, :month => Padding::pad_single_digit(month), :day => Padding::pad_single_digit(day)})\n end",
"title": ""
},
{
"docid": "06a22dbffe0d7b65db4adacce6c3de69",
"score": "0.6205157",
"text": "def simple_calendar_path\n request.fullpath.split('?').first\n end",
"title": ""
},
{
"docid": "06c93f426aacffdef6ae4ad1de6f86d8",
"score": "0.6196751",
"text": "def day_link(page=nil, options={})\n h.link_to_unless_current('24小时内热评', {action: :index, controller: :articles, group_id: object.id, hottest_by: 'day', page: page}, options)\n end",
"title": ""
},
{
"docid": "b9b6f96cec528dd406cdde9c86bb84a7",
"score": "0.6158823",
"text": "def blog_month_path(year, month, blog_name = nil)\n build_url blog_controller(blog_name).calendar_pages.link(year, month)\n end",
"title": ""
},
{
"docid": "ba27555822036a303783f5db3eb1d73a",
"score": "0.6116412",
"text": "def blog_month_path(year, month, key=nil)\n sitemap.find_resource_by_path(::Middleman::Blog::CalendarPages.link(blog_controller(key).options, year, month)).try(:url)\n end",
"title": ""
},
{
"docid": "5e97b68a67fa758c700a5512851d7e6c",
"score": "0.6093024",
"text": "def blog_year_path(year, key=nil)\n sitemap.find_resource_by_path(::Middleman::Blog::CalendarPages.link(blog_controller(key).options, year)).try(:url)\n end",
"title": ""
},
{
"docid": "797ee6759b5614ab767b1f6ecb9d27c1",
"score": "0.60508776",
"text": "def blog_year_path(year, blog_name = nil)\n build_url blog_controller(blog_name).calendar_pages.link(year)\n end",
"title": ""
},
{
"docid": "aa2f398f112de523acbb4657ba8d38c8",
"score": "0.6032114",
"text": "def other_day_path day, direction\n other_day = case direction\n when :previous\n day - 1.day\n when :next\n day + 1.day\n end\n day_path(other_day.day, other_day.month, other_day.year)\n end",
"title": ""
},
{
"docid": "32c4285b24364d5c527b71231e98fa42",
"score": "0.6000092",
"text": "def week_for_day_url(team, year, month, day)\n date = Date.parse(\"#{year}-#{month}-#{day}\")\n week = Date.week_num(date)\n\n week_url(team, year, week)\n end",
"title": ""
},
{
"docid": "988888f4aaa8c544c48b90d8f6305173",
"score": "0.59759325",
"text": "def simple_day_view_for_calendar(display_time, day_time, day_schedule, day_cell_tags)\n day_html = (day_time.day < 10 ? \" \" : \"\") + day_time.day.to_s\n day_html = \" \" if day_time.month != display_time.month\n day_name = \" \" + day_html + \" \" \n day_link = link_to day_name, schedules_path(:menu_name1=>\"コミュニケーション : スケジュール\",\n :schedule_span => SchedulesController::DAY,\n :date => day_time.to_s(:db))\n day_cell_tags ? i_content_tag(day_cell_tags[:day_name_tag], day_link) : day_link\n end",
"title": ""
},
{
"docid": "b19aa83c5d44538acbd5ed1c68fc6389",
"score": "0.593206",
"text": "def page_design_path_by_site_and_folder(site, folder, options = {})\n url_for(options.merge({\n :controller => :page_design,\n :action => \n if options[:action].blank? \n 'update'\n else \n options[:action] \n end,\n :site => if site.respond_to?(:name);site.name;else;site.to_s;end,\n :folder => \n if folder\n if folder.respond_to?(:name);folder.name;else;folder.to_s;end\n else\n nil\n end\n }\n ))\n end",
"title": ""
},
{
"docid": "fb33cc4ddc2028123df5157ef5cfca7e",
"score": "0.58925164",
"text": "def get_calendar_url date=Date.today\n\t\t[@base_url, \"%04d\" % date.year, \"%02d\" % date.month]\n\t\t\t\t.join('/')\n\tend",
"title": ""
},
{
"docid": "858da7ba941305dda74a87c4adfbbefe",
"score": "0.587357",
"text": "def find_calendar_page(area_page)\n\t\tcalendar_page = area_page.link_with(:href => /MonthlyCalendar/)\n\t\tcalendar_page = calendar_page.click\n\tend",
"title": ""
},
{
"docid": "98dd0239ef8636337b6ee27a7e7faa98",
"score": "0.5863736",
"text": "def link_today()\n \n raw_formatted_filepath = File.join(@dir, path(@d-1), 'formatted.xml')\n\n return unless File.exists? raw_formatted_filepath\n\n doc = Rexle.new File.read(raw_formatted_filepath) \n doc.root.element('summary/next_day').text = static_urlpath()\n File.write raw_formatted_filepath, doc.xml(pretty: true)\n \n render_html doc, @d-1\n \n end",
"title": ""
},
{
"docid": "1fc0cc118b95b88d6f9cd9b57742539c",
"score": "0.5858303",
"text": "def permanent_url\n day.permanent_url\n end",
"title": ""
},
{
"docid": "c71b398692ca7e264765a28d5639dd91",
"score": "0.5832466",
"text": "def get_day\n params[:entry][:day] ? params[:entry][:day] : @entry.day\n end",
"title": ""
},
{
"docid": "bd2971719cbc4e5be2f74b8ed130db56",
"score": "0.58152694",
"text": "def calendar_icon(day=Time.now.day)\n image_path(\"calendar-#{ day }.png\")\n end",
"title": ""
},
{
"docid": "cc12c624bdaca9a32469689a9c4557c0",
"score": "0.5794724",
"text": "def url\n @url ||= \"/#{date.year}/#{\"%02d\" % date.month}/#{\"%02d\" % date.day}/#{permalink}\"\n end",
"title": ""
},
{
"docid": "ffccb4eb9200546cf72d6736a064f7a8",
"score": "0.57050616",
"text": "def calendar\n @dr.a(:xpath,'//*[@id=\"page-wrap\"]/ul/li[1]/a')\n end",
"title": ""
},
{
"docid": "f273b417384e0fb74dacea2ab824a9c6",
"score": "0.56969714",
"text": "def path_for_url_alias(node)\n \"#{node.publication_start_date.year}/#{node.publication_start_date.month}/#{node.publication_start_date.day}/#{self.title}\"\n end",
"title": ""
},
{
"docid": "271eaf8908de821df0b07516a2d1731f",
"score": "0.56725204",
"text": "def path_for_url_alias(node)\n \"#{node.publication_start_date.year}/#{node.publication_start_date.month}/#{node.publication_start_date.day}/#{title}\"\n end",
"title": ""
},
{
"docid": "b58e8a879058c2680bced25a9fd4cadc",
"score": "0.5665657",
"text": "def permalink\n link = self.file_name.gsub(/\\.article$|\\.markdown$|\\.md$|\\.mdown$|\\.mkd$|\\.mkdn$/, '')\n \"#{Aerial.config.articles.dir}/#{publish_date.year}/#{publish_date.month}/#{publish_date.day}/#{escape(link)}\"\n end",
"title": ""
},
{
"docid": "b60c0f572f2f7071776ae0f2dc76180d",
"score": "0.5632788",
"text": "def link\n \"#{blog.meta['blog_url']}/#{path}.html\"\n end",
"title": ""
},
{
"docid": "b67df3dbacbc7cd566c7f4927bb89f1e",
"score": "0.56073785",
"text": "def page_design_url_by_site_and_folder(site, folder, options = {})\n page_design_path_by_site_and_folder(site, folder, options.merge({:only_path => false}))\n end",
"title": ""
},
{
"docid": "5356000ad03abfecc109c6f0960fa9fd",
"score": "0.56021094",
"text": "def by_day\n # get all the posts from this month\n @posts = Post.find_by_day(params[:day], params[:month], params[:year])\n # we didn't find a post... send them packin'!\n if @posts.length < 1\n redirect_to '/'\n return\n end\n # set the page title\n $page_title = 'Daily archive: ' + Time.parse(\"#{params[:month]}/#{params[:day]}/#{params[:year]}\").strftime('%d %B, %Y')\n render :template => 'archives/daily'\n end",
"title": ""
},
{
"docid": "808fa87ef441995670b45d501a3e9fcb",
"score": "0.557181",
"text": "def get_event_url(morea_page, site)\n if (morea_page.data['morea_type'] == 'module')\n url = \"#{site.baseurl}/modules/#{morea_page.data['morea_id']}\"\n else # otherwise the baseurl is included. Weird.\n url = \"#{morea_page.data['morea_url']}\"\n end\n return url\n end",
"title": ""
},
{
"docid": "d51efa5e525571d94ed5788781711cd2",
"score": "0.55710995",
"text": "def week_url\n base_url + week_path\n end",
"title": ""
},
{
"docid": "ee8a0fac60d89b4318c834ef0a0b075e",
"score": "0.556406",
"text": "def render_day(r, date)\n if current_month?(date)\n selected_day?(date) ? render_selected_day(r, date) : render_month_day(r, date)\n else\n render_other_day(r, date)\n end\n end",
"title": ""
},
{
"docid": "93e711b6c96f2d8fd074afce0baa9109",
"score": "0.5563629",
"text": "def advent_of_code_url\n \"http://adventofcode.com/#{year}/day/#{day}\"\n end",
"title": ""
},
{
"docid": "e7337353bc5e6057687f3edbe31ff129",
"score": "0.5532472",
"text": "def eventbrite_ical_find(page)\n @event_id = find_event_id(page)\n\n #Number below is the only thing that needs to be changed. It's the event id\n @url = 'http://www.eventbrite.com/calendar.ics?eid=' + @event_id + '&calendar=' + 'ical'\n return @url\n end",
"title": ""
},
{
"docid": "f2f1785999a285df9aec4c3517d88ed8",
"score": "0.5527786",
"text": "def getDay\n array = Rule.DAYS\n\n case array[day].to_s\n when \"Montag\"\n :monday\n when \"Dienstag\"\n :tuesday\n when \"Mittwoch\"\n :wednesday\n when \"Donnerstag\"\n :thursday\n when \"Freitag\"\n :friday\n when \"Samstag\"\n :saturday\n when \"Sonntag\"\n :sunday\n end\n end",
"title": ""
},
{
"docid": "b3595d498211dd114cceaed13dc6bd0b",
"score": "0.5510362",
"text": "def calendar_url_for(contexts_to_link_to = nil, options={})\n options[:query] ||= {}\n contexts_to_link_to = Array(contexts_to_link_to)\n if event = options.delete(:event)\n options[:query][:event_id] = event.id\n end\n options[:query][:include_contexts] = contexts_to_link_to.map{|c| c.asset_string}.join(\",\") unless contexts_to_link_to.empty?\n calendar_url(options[:query])\n end",
"title": ""
},
{
"docid": "700a3741d3f528c395736849a3e18e84",
"score": "0.5485521",
"text": "def get_day(day_name)\n return @specials[day_name]\n end",
"title": ""
},
{
"docid": "90420b407869c8bbd89bc7d726e93b2e",
"score": "0.5483402",
"text": "def get_month_links(params)\n today = Date.new(params[:year].to_i,params[:month].to_i,1)\n enday = today.end_of_month\n tparams = params\n tparams[:day] = 1\n result = {}\n while today <= enday\n if duty_day?(today.wday)\n result[today.mday] = render_day_link(tparams)\n end \n today += 1\n tparams[:day] = today.mday\n tparams[:wday] = today.wday\n end\n result\nend",
"title": ""
},
{
"docid": "16fea4cee0adfba9a578fd8c86e43bd4",
"score": "0.5474033",
"text": "def link\n Rails.application.routes.url_helpers.business_path(self)\n end",
"title": ""
},
{
"docid": "da3dc90ddd45e05d4ede303468ae7d40",
"score": "0.5441162",
"text": "def next_release_path(date)\n next_date = date + 7.days\n release_date_path(next_date)\n end",
"title": ""
},
{
"docid": "3640e78738551ced3f6c496218afe036",
"score": "0.5436148",
"text": "def next_date_path\n date_path(@date + 1)\n end",
"title": ""
},
{
"docid": "c574868b10044d739aa1823911ee7df6",
"score": "0.5422997",
"text": "def schedule_url_for(schedule)\n # \"#{schedules_url}?utf8=✓&q=#{schedule.day.to_s}\"\n \"#{schedules_url}?q=#{schedule.day.to_s}\"\n end",
"title": ""
},
{
"docid": "2bc61cbe7baf3fe8a226a2a855c221a8",
"score": "0.5420491",
"text": "def render_navigation_link(duration,year,month,project)\n res = ''\n if Schedule.check_day(year: year, month: month, day: 1)\n if duration == \"next\"\n d = Date.new(year.to_i, month.to_i, 1).next_month\n res = link_to t('next_month'), schedules_path(:project_id => project, :year => d.year, :month => d.month), :class => 'navlink'\n else\n d = Date.new(year.to_i, month.to_i, 1).prev_month\n res = link_to t('previous_month'), schedules_path(:project_id => project, :year=> d.year, :month => d.month), :class => 'navlink'\n end\n return res\n end\nend",
"title": ""
},
{
"docid": "54d42e887cc4cc0643208934d386609c",
"score": "0.54147166",
"text": "def date_link(date)\n link_to(simple_date(date), {:day => date.day, :month => date.month, :year => date.year})\n end",
"title": ""
},
{
"docid": "b1c55bc506b7234ba44ae9fd83222257",
"score": "0.5405465",
"text": "def link\n \"/pages/#{id}\"\n end",
"title": ""
},
{
"docid": "c88b34d7faa855e84982340dc02ff8c0",
"score": "0.54044116",
"text": "def shift_calendar_link(cal, direction, opts = {})\n options = opts.merge(start_date: cal.start_date, direction: direction)\n if direction == :back\n class_name = \"week_link icon-chevron-left\"\n id_name = \"week_prev\"\n else\n class_name = \"week_link icon-chevron-right\"\n id_name = \"week_next\"\n end\n link_to '',\n shift_calendar_track_timings_path(options),\n method: :post,\n class: class_name,\n id: id_name\n end",
"title": ""
},
{
"docid": "442ef01cf3882d66d7cafc070bf824b0",
"score": "0.5394349",
"text": "def path_to_date(date)\n raise NotImplementedError, 'should return path to view including the given date'\n end",
"title": ""
},
{
"docid": "b46468de4a2747fb090817f3a357c3bd",
"score": "0.53862965",
"text": "def homepage_path\n type = Authorizer.new(@educator).homepage_type\n if type == :districtwide\n url_helpers.educators_districtwide_path\n elsif type == :school\n url_helpers.school_path(@educator.school)\n elsif type == :section\n url_helpers.section_path(@educator.default_section)\n elsif type == :homeroom\n url_helpers.homeroom_path(@educator.default_homeroom)\n elsif type == :nothing\n url_helpers.no_default_page_path\n else\n url_helpers.no_default_page_path\n end\n end",
"title": ""
},
{
"docid": "2510cbb0025a11d83005efecda0ba7b6",
"score": "0.53828335",
"text": "def path\n date_path(@date)\n end",
"title": ""
},
{
"docid": "ea16ba804e004d30ba5dbca1896fe030",
"score": "0.5367503",
"text": "def path_for page_id\n # Find page\n target_page = @pages.select { |page| page.path.gsub(/^\\//,\"\").gsub(/\\/$/,\"\").gsub(\".#{page.extension}\",\"\") == page_id.to_s }.first\n if target_page.nil?\n return \"#\"\n else\n return target_page.path\n end\nend",
"title": ""
},
{
"docid": "8cd20b5324803f109c2611d82c9ad14f",
"score": "0.53645104",
"text": "def get_workshops_day1\n get_workshops_schedule WORKSHOPS_DAY_1_URL\nend",
"title": ""
},
{
"docid": "5cda4e121285c84439f6d042faaaaee7",
"score": "0.53640914",
"text": "def dir\n if permalink\n permalink.to_s.split(\"/\")[0..-2].join(\"/\")\n else\n prefix = self.categories.empty? ? '' : '/' + self.categories.join('/')\n prefix + date.strftime(\"/%Y/%m/%d/\")\n end\n end",
"title": ""
},
{
"docid": "cc3ae67e7c04214f278760b4e638c331",
"score": "0.5359389",
"text": "def article_path(article = current_page)\n prefix = article.blog_data.options.prefix.gsub(/\\//, '')\n \"#{prefix}/#{article.slug}/\"\n end",
"title": ""
},
{
"docid": "eb221c3e30ae114a2597c8ea35e51e86",
"score": "0.53590065",
"text": "def url_for_date(date)\n url_for(url_parts({\n :mday => date.mday,\n :month => month_name(date.month).downcase,\n :year => date.year\n }))\n end",
"title": ""
},
{
"docid": "1f98c4c1f6206b15fc83cd0963eb51a8",
"score": "0.53117365",
"text": "def event_link(event)\n if event.rg_url.empty?\n event_path(event.slug)\n else\n event.rg_url\n end\n end",
"title": ""
},
{
"docid": "f035a4417f625f3faab238b6ac780587",
"score": "0.5311583",
"text": "def get_event_page(event_page_link)\n link_path = event_page_link.css(\"a.msl_event_name\").first['href']\n link_path = @union_url + link_path unless /\\/\\//.match link_path\n @agent.get(link_path)\nend",
"title": ""
},
{
"docid": "753ed534139e148a8463496d96d21130",
"score": "0.53105867",
"text": "def path\n send(\"#{@article.page}_path\")\n end",
"title": ""
},
{
"docid": "4a9673bf1541f6ed2c8aaa2adbaf5f98",
"score": "0.5309452",
"text": "def get_day\n index()\n render 'index'\n end",
"title": ""
},
{
"docid": "915787975278fae140eee490d9fdf4ac",
"score": "0.5306096",
"text": "def schedule_link()\n\t\treturn $test_driver.find_element(:link_text, \"Schedule an appointment\")\n\tend",
"title": ""
},
{
"docid": "420ee1a0558e9fa13737f60d65afd358",
"score": "0.5275132",
"text": "def page_path page = 1\n page_folder = File.dirname(@page.path)\n subfolder_perma = File.dirname(page_permalink.gsub(\":page\", page.to_s))\n\n if page == 1\n if page_folder == \".\"\n path = File.basename(@page.path)\n else\n path = File.join(page_folder, File.basename(@page.path))\n end\n else\n page_folder = File.join(page_folder, subfolder_perma) if (subfolder_perma != \".\")\n if page_folder == \".\"\n path = page_filename(page)\n else\n path = File.join(page_folder, page_filename(page))\n end\n end\n return path\n end",
"title": ""
},
{
"docid": "b0d0a14387a922d32fa47aacf6aa72cd",
"score": "0.52710015",
"text": "def path\n \"/\" + self.permalink\n end",
"title": ""
},
{
"docid": "efa01f4e0bf3d5a02f32215562a7ca95",
"score": "0.52655506",
"text": "def problem_url(year:, day:)\n \"http://adventofcode.com/#{year}/day/#{day}/input\"\n end",
"title": ""
},
{
"docid": "22e88ccf5c4473ec5e96e0de492a1935",
"score": "0.52647376",
"text": "def other_week_path beginning_of_week_day, direction\n other_week = case direction\n when :previous\n beginning_of_week_day - 1.week\n when :next\n beginning_of_week_day + 1.week\n end\n week_path(other_week.day, other_week.month, other_week.year)\n end",
"title": ""
},
{
"docid": "cca33a64392fefcdb850dd3239645d0e",
"score": "0.5250287",
"text": "def saveNextDayPage(daySortedPosts)\n monthDay = dateToFriendlyDate(daySortedPosts[0][0])\n postsToUse = daySortedPosts.shift()[1]\n dayUsed = Date.new(monthDay[2].to_i, monthDay[3].to_i, monthDay[1].to_i)\n if (postsToUse.length == 1)\n # Only one post, so don't make a new page for it.\n return [dayUsed, \"../\" + PostsDir + postsToUse[0]['linkId'].to_s + '.html', postsToUse.length]\n else\n baseFileName = CalendarDir + monthDay[2].to_s + \"-\" + monthDay[3].to_s + \"-\" + monthDay[1].to_s + \".html\"\n fileName = @targetDir + baseFileName\n File.open(fileName, 'w') do |aFile|\n aFile.write(\"<!DOCTYPE html PUBLIC \\\"-//W3C//DTD HTML 4.01//EN\\\" \\\"http://www.w3.org/TR/html4/strict.dtd\\\">\\n\")\n aFile.write(\"<html><head><meta http-equiv=\\\"Content-Type\\\" content=\\\"text/html; charset=utf-8\\\"><meta http-equiv=\\\"Content-Style-Type\\\" content=\\\"text/css\\\">\\n\")\n aFile.write(\"<style>\" + LJPollCSS + \"</style>\\n\")\n aFile.write(\"<title>Posts on #{ monthDay[0] } #{ monthDay[1] }, #{ monthDay[2] }</title></head>\")\n aFile.write(\"<body>\\n\")\n aFile.write(\"<p style=\\\"background-color: lightgray\\\">Posts on #{ monthDay[0] } #{ monthDay[1] }, #{ monthDay[2] }</p>\\n\")\n postsToUse.each do |postInfo|\n writePostMain(aFile, postInfo, '../', true)\n end\n aFile.write(\"<p>This backup was done by <a href=\\\"http://gregstoll.dyndns.org/secure/ljbackup\\\">LJBackup</a>.</p>\")\n aFile.write(\"</body></html>\")\n end \n return [dayUsed, \"../\" + baseFileName, postsToUse.length]\n end\nend",
"title": ""
},
{
"docid": "eb6fae8e13fcb39ffead5991e0d45552",
"score": "0.52363896",
"text": "def meetup_ical_find(page)\n @in = page.to_s\n @start_array = @in.index(\"Atom</a>\")\n @end_array = @in.index(\"iCal</a>\")\n @out = 'http://' + @in[@start_array+36..@end_array-4]\n\n\n # @event_name = find_event_name(page)\n # @download_link = \"http://www.meetup.com/events/ical/\" + @event_name\n # @feed = page.to_s\n\n return @out\n end",
"title": ""
},
{
"docid": "21b64a641c90da48ee95a05178fb0f3f",
"score": "0.5232162",
"text": "def show\n @link_finder = LinkFinder.find(params[:id])\n @calendar_url = @link_finder.url + 'events/calendar'\n \n\n if @link_finder.service_selection == 1\n @page = Nokogiri::HTML(open(@calendar_url))\n @link = meetup_ical_find(@page)\n elsif @link_finder.service_selection = 2\n @page = Nokogiri::HTML(open(@link_finder.url))\n #@event_id = find_event_id(@page)\n @link = eventbrite_ical_find(@page)\n else\n @link = 'This is an error'\n end\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @link_finder }\n end\n end",
"title": ""
},
{
"docid": "0bdbfd21727b20dadd4c53e7f54891b2",
"score": "0.5230248",
"text": "def blog_link\n @blog_link ||= get_blog_link\n end",
"title": ""
},
{
"docid": "1cef4f1050f7b6c519c7928b5f49be2e",
"score": "0.5228093",
"text": "def cycle_gfolder(cycle)\n \"CMS/#{cycle.slug}\"\n end",
"title": ""
},
{
"docid": "b02ec06fdb34a58404603c22f0693556",
"score": "0.5225391",
"text": "def friendly_post_path(post = nil)\n return nil unless post.is_a? Post\n\n post.published? ? friendly_post_show_path(post.created_at.year,\n \"%02d\" % post.published_at.month,\n \"#{post.friendly_id}\") :\n post_path(post)\n end",
"title": ""
},
{
"docid": "10698318df7359f5b02b5b28bfc63d9d",
"score": "0.52157897",
"text": "def ten_day_paid_sales_report_link\n $tracer.trace(__method__)\n return ToolTag.new(div.className(\"page\").id(\"main\").ul.a.href(\"/Reports/GITenDaySales/\"), __method__)\n end",
"title": ""
},
{
"docid": "de066252c643eb5d505689a564eeff93",
"score": "0.5214131",
"text": "def generate_path\n unless home?\n File.join(parent.path, permalink)\n else\n '/'\n end\n end",
"title": ""
},
{
"docid": "a1f0048043d40f1759775720a29f79cc",
"score": "0.51985794",
"text": "def calendar_url\n \"https://fly.hawaiianairlines.com/reservations/1/default.aspx?\" +\n \"qrys=qres\" +\n \"&source=\" +\n \"&Trip=RT\" +\n \"&departure=#{origin}\" +\n \"&destination=#{destination}\" +\n \"&out_day=#{departure_date.day}\" +\n \"&out_month=#{departure_date.month}\" +\n \"&return_day=#{return_date.day}\" +\n \"&return_month=#{return_date.month}\" +\n \"&adult_no=#{travelers}\" +\n \"&lang=us\"\n end",
"title": ""
},
{
"docid": "06e45aa9cbb4beaf2d3257684eefb909",
"score": "0.5197349",
"text": "def date_path(date)\n \"/\" + date.to_date.to_s\n end",
"title": ""
},
{
"docid": "2bc2b418f632d463e828aebfacf375ab",
"score": "0.5196228",
"text": "def get_next_day(day)\n days = [\"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\", \"Sunday\"]\n if day == \"Sunday\"\n return \"Monday\"\n else\n return days[days.index(day) + 1]\n end\nend",
"title": ""
},
{
"docid": "ab74a8d07baeeeb5dfb9e8658d251b2a",
"score": "0.51874584",
"text": "def post_path(post)\n full_path = \"#{Archangel.config.posts_path}/#{post.path}\"\n\n archangel.frontend_page_path(full_path)\n end",
"title": ""
},
{
"docid": "8967cb32eda66028ec69c07a68011709",
"score": "0.5184252",
"text": "def find_by_permalink(year, month, day, slug, options = {}) \n begin\n day = Time.parse([year, month, day].collect(&:to_i).join(\"-\")).midnight\n post = find_all_by_slug(slug, options).detect do |post|\n [:year, :month, :day].all? { |time|\n post.published_at.send(time) == day.send(time)\n }\n end\n rescue ArgumentError # Invalid time\n post = nil \n end \n post || raise(ActiveRecord::RecordNotFound)\n end",
"title": ""
},
{
"docid": "b9b96701859f655ed8c9c12d3934ee63",
"score": "0.518123",
"text": "def week_day(day)\n DayWeek.find(day+1).description\n end",
"title": ""
},
{
"docid": "05bd159381f3d82663e9c25ba8b01f8e",
"score": "0.5180251",
"text": "def path\n \"/\" + self.permalink\nend",
"title": ""
},
{
"docid": "8cfe121ce198a06c63f3694f1b7582b7",
"score": "0.5174158",
"text": "def relative_path\n @rel_path ||= begin \n date_array = id.split(\"-\")[0..2]\n date_path = date_array.join(\"/\")\n article_id = begin\n str = id.gsub date_array.join(\"-\"), ''\n if str[0] == \"-\"\n str[1..-1] \n else\n str\n end\n end\n \"#{category}/#{date_path}/#{article_id}\"\n end\n end",
"title": ""
},
{
"docid": "ecb2ae3de68e273f01c385261aecc989",
"score": "0.51658773",
"text": "def day_setup\n @page_title = _('Day_setup')\n @page_icon = \"date.png\"\n @help_link = \"http://wiki.kolmisoft.com/index.php/Day_setup\"\n\n @days = Day.find(:all, :order => \"date ASC\")\n\n end",
"title": ""
},
{
"docid": "1f5d407b3b21c56bcb5c161e0c360b73",
"score": "0.5163166",
"text": "def current\n day = Time.zone.now.day\n redirect_to folder_path(day)\n end",
"title": ""
},
{
"docid": "1fa4ee2d5dce44885f088bbb6b0373e8",
"score": "0.5160724",
"text": "def dtime_href_for(my_env, rel)\n Addressable::Template.new(settings.api_links[my_env][rel]['href'])\nend",
"title": ""
},
{
"docid": "5e606ce32c5172749ae434bf4f3cbde9",
"score": "0.5160585",
"text": "def week_description date, links = false\n if links\n start_of_week = date.strftime(\"%d\")\n start_of_week += \" #{link_to(date.strftime(\"%B\"), month_path(date.month), :class => \"\")}\"\n start_of_week += \" #{link_to(date.year, year_path(date.year), :class => \"\")}\"\n end_of_week = date.end_of_week.strftime(\"%d\")\n end_of_week += \" #{link_to(date.end_of_week.strftime(\"%B\"), month_path(date.end_of_week.month), :class => \"\")}\"\n end_of_week += \" #{link_to(date.end_of_week.year, year_path(date.end_of_week.year), :class => \"\")}\"\n else\n start_of_week = date.strftime(\"#{date.day.ordinalize}\")\n end_of_week = date.end_of_week.strftime(\"#{date.end_of_week.day.ordinalize}\")\n end\n \"#{start_of_week} to #{end_of_week}\".html_safe\n end",
"title": ""
},
{
"docid": "0689984cd9e363ee231f7fc3715b639b",
"score": "0.51585793",
"text": "def calendar_header_days\n html = calendar_header_day(l('date.day_names')[@refdate.cwday % 7])\n html.html_safe\n return html\n end",
"title": ""
},
{
"docid": "a243e037df4a4c83ab58f0da26567cb8",
"score": "0.51582605",
"text": "def project_path\n paths = [sprintf(\"day-%02i\", day), \"day-#{day}\", ].map { |day| File.join(year, day) }\n existing_path = paths.find { |dir| !Dir[dir].empty? }\n existing_path || paths.first\n end",
"title": ""
},
{
"docid": "b3e1589dceaad4448e602e9e2ae46516",
"score": "0.5156742",
"text": "def determinate_next_page_by_period\n if vehicle_details('weekly_possible')\n select_period_dates_path(id: transaction_id)\n else\n daily_charge_dates_path(id: transaction_id)\n end\n end",
"title": ""
},
{
"docid": "89bed5222f427a313ba79b5a932008f0",
"score": "0.51421136",
"text": "def published_path\n # TODO I18n doit prendre la langue du about\n language = about.respond_to?(:language) ? about.language : website.default_language\n p = \"\"\n p += \"/#{language.iso_code}\" if website.languages.many?\n p += pattern\n substitutions.each do |key, value|\n p.gsub! \":#{key}\", \"#{value}\"\n end\n p\n end",
"title": ""
},
{
"docid": "fa71932ebd0d1c8356d021fc8def5fa1",
"score": "0.5122406",
"text": "def url(atom=false)\r\n self.published_at? && !new_record? ? self.published_at.strftime(\"/blog/%Y/%m/%d/#{self.id}#{atom ? '.atom' : ''}\") : \"\"\r\n end",
"title": ""
},
{
"docid": "47f61dab4196af9f57d85690f2082cba",
"score": "0.5116451",
"text": "def path_for page_id\n # Find page\n split = page_id.split('#')\n if split.size > 1 && split.first.size != 0\n name = split.first.to_s\n tail = split.last.to_s\n else\n name = page_id\n end\n \n target_page = @pages.select { |page| page.path.gsub(/^\\//,\"\").gsub(/\\/$/,\"\").gsub(\".#{page.extension}\",\"\") == name }.first\n if target_page.nil?\n unless name.include? 'http://'\n name = get_rel(name)\n end\n return name\n else\n if split.size > 1\n full = target_page.path + '#' + tail\n else\n full = target_page.path \n end\n return get_rel(full)\n end\n end",
"title": ""
},
{
"docid": "40278f7bffc5d98e40bad848b1e0f83c",
"score": "0.5110963",
"text": "def dinner_find_day_for_feed()\n day = Time.new.wday\n if day == 1\n return \"ma=on\"\n elsif day == 2\n return \"ti=on\"\n elsif day == 3\n return \"on=on\"\n elsif day == 4\n return \"to=on\"\n elsif day == 5\n return \"fr=on\"\n else\n return \"-1\"\n end\n end",
"title": ""
},
{
"docid": "32b7f9dba24eccc56a62290f3c882573",
"score": "0.5107239",
"text": "def generate_date_id(weekday) \n if weekday < 3\n \"cphBody_gvWeek_lblgvDay1_#{weekday}\"\n else\n \"cphBody_gvWeek_lblgvDay2_#{weekday - 3}\"\n end\nend",
"title": ""
},
{
"docid": "bcdb2f9868e58b5744c4edb4538eb6e4",
"score": "0.51063144",
"text": "def default_link\n\n if items.empty?\n return []\n elsif items.member?(\"Dashboard\")\n return link_for(\"Dashboard\")\n else\n return link_for(items.keys.first)\n end\n\n end",
"title": ""
},
{
"docid": "d42e5166971d17e790271054c70639de",
"score": "0.5098948",
"text": "def day_name(day)\n if self.replace_saturday && day == 7\n self.ashkenaz ? 'Shabbos' : 'Shabbat'\n else\n Date::DAYNAMES[day - 1]\n end\n end",
"title": ""
},
{
"docid": "e2e52df2d0a44517a0fa1293c27b7cc8",
"score": "0.50953835",
"text": "def th_id(day, calendar_id)\n return th_id(Date::DAYNAMES[day.wday], calendar_id) if day.is_a?(Date)\n \"#{calendar_id}-#{day[0..2].downcase}\"\n end",
"title": ""
},
{
"docid": "e2e52df2d0a44517a0fa1293c27b7cc8",
"score": "0.50953835",
"text": "def th_id(day, calendar_id)\n return th_id(Date::DAYNAMES[day.wday], calendar_id) if day.is_a?(Date)\n \"#{calendar_id}-#{day[0..2].downcase}\"\n end",
"title": ""
},
{
"docid": "8c5480b49e92fbbefbb99d0c9afc337c",
"score": "0.50880563",
"text": "def make_downloadlink(link,wanted,venue)\n begin\n #FIXME get_port doesnt work\n #old: \"http://\" + request.host + get_port + \"/file/\" + link + \"/\" + bool_to_str(venue) + \"/\" + wanted.join(\"/\") + \"/\" +@@link.sub(\"/\",\"_\") +\".ics\"\n\t\toptions.base_url = request.host if options.base_url == ''\n \"http://\" + options.base_url + \"/file/\" + link + \"/\" + bool_to_str(venue) + \"/\" + wanted.join(\"/\") + \"/\" + link.sub(\"/\",\"_\") +\".ics\"\n rescue Exception => e\n @e = throw_error session['error'] = e.to_s + \"<br />(Es ist ein Fehler aufgetreten. Bitte sende mir die Fehlermeldung per Mail.)\"\n erb :error\n end\nend",
"title": ""
}
] |
bd59375a43e1a4aa0245eb6e1fff8819 | PATCH/PUT /assets/1 PATCH/PUT /assets/1.json | [
{
"docid": "a2d876b6bba2b351a34f71635a771bcf",
"score": "0.66845167",
"text": "def update\n authorize! :update, @asset\n\n respond_to do |format|\n if @asset.update(asset_params)\n format.html { redirect_to @asset, notice: 'Asset was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @asset.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] | [
{
"docid": "b38c8323f10dfd3ed64147cbe3d89ddb",
"score": "0.71421367",
"text": "def update\n @asset = Asset.find(params[:id])\n if @asset.update_attributes(asset_params)\n head :no_content\n else\n render json: @asset.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "00347a81973473ec7c110428666182ea",
"score": "0.7113096",
"text": "def update\n @asset = Asset.find(params[:id])\n\n if @asset.update(asset_params)\n head :no_content\n else\n render json: @asset.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "487f795db103be0ba02fcff785f088d0",
"score": "0.6982161",
"text": "def update\n @asset = Asset.find(params[:id])\n\n respond_to do |format|\n if @asset.update_attributes(params[:asset])\n format.html { redirect_to @asset, :notice => 'Asset was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @asset.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ac1f2af050d966e02007c063f3b7b62d",
"score": "0.6968127",
"text": "def update\n @asset = Asset.find(params[:id])\n\n respond_to do |format|\n if @asset.update_attributes(params[:asset])\n format.html { redirect_to @asset, notice: 'Asset was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @asset.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ac1f2af050d966e02007c063f3b7b62d",
"score": "0.6968127",
"text": "def update\n @asset = Asset.find(params[:id])\n\n respond_to do |format|\n if @asset.update_attributes(params[:asset])\n format.html { redirect_to @asset, notice: 'Asset was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @asset.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ac1f2af050d966e02007c063f3b7b62d",
"score": "0.6968127",
"text": "def update\n @asset = Asset.find(params[:id])\n\n respond_to do |format|\n if @asset.update_attributes(params[:asset])\n format.html { redirect_to @asset, notice: 'Asset was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @asset.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0dabd20a6be438b103d9775f4cf3bc0e",
"score": "0.6887598",
"text": "def update!(**args)\n @allow_missing = args[:allow_missing] if args.key?(:allow_missing)\n @assets = args[:assets] if args.key?(:assets)\n @request_id = args[:request_id] if args.key?(:request_id)\n end",
"title": ""
},
{
"docid": "24667a90ea837de6ed0cb065a06a0d6f",
"score": "0.6858513",
"text": "def update!(**args)\n @assets = args[:assets] if args.key?(:assets)\n end",
"title": ""
},
{
"docid": "dc3db4a413c62a893011afd8c9a10429",
"score": "0.68471235",
"text": "def update\n @assets = Assets.find(params[:id])\n\n respond_to do |format|\n if @assets.update_attributes(params[:assets])\n flash[:notice] = 'Assets was successfully updated.'\n format.html { redirect_to(@assets) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @assets.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a936adcf82ac4b6df6183237fea402b1",
"score": "0.6752219",
"text": "def update\n @asset = current_user.assets.find(params[:id])\n\n respond_to do |format|\n if @asset.update_attributes(params[:asset])\n format.html { redirect_to @asset, notice: 'Asset was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @asset.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a96b91d084fa2823592ea7a9cf251f36",
"score": "0.6748748",
"text": "def update\n respond_to do |format|\n if @asset.update(asset_params)\n format.html { redirect_to @asset, notice: 'Asset was successfully updated.' }\n format.json { render :show, status: :ok, location: @asset }\n else\n format.html { render :edit }\n format.json { render json: @asset.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a96b91d084fa2823592ea7a9cf251f36",
"score": "0.6748748",
"text": "def update\n respond_to do |format|\n if @asset.update(asset_params)\n format.html { redirect_to @asset, notice: 'Asset was successfully updated.' }\n format.json { render :show, status: :ok, location: @asset }\n else\n format.html { render :edit }\n format.json { render json: @asset.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a96b91d084fa2823592ea7a9cf251f36",
"score": "0.6748748",
"text": "def update\n respond_to do |format|\n if @asset.update(asset_params)\n format.html { redirect_to @asset, notice: 'Asset was successfully updated.' }\n format.json { render :show, status: :ok, location: @asset }\n else\n format.html { render :edit }\n format.json { render json: @asset.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "182af7b3c9583f5152f9baf0c25eb0a7",
"score": "0.6731255",
"text": "def update!(**args)\n @asset = args[:asset] if args.key?(:asset)\n @request_id = args[:request_id] if args.key?(:request_id)\n @update_mask = args[:update_mask] if args.key?(:update_mask)\n end",
"title": ""
},
{
"docid": "6ed8c03ad41eb782ed6e1aae2aa97c3f",
"score": "0.67209613",
"text": "def update\n respond_to do |format|\n if @asset.update(asset_params)\n format.html { redirect_to @asset, notice: \"Asset was successfully updated.\" }\n format.json { render :show, status: :ok, location: @asset }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @asset.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f0a61a236b9c3b4e3885a331f884733f",
"score": "0.6709304",
"text": "def update\n if @asset.update(asset_params)\n render :show, status: :ok, location: @asset\n else\n render json: @asset.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "db95fe589079fd64afc18efed01f3018",
"score": "0.66995037",
"text": "def update\n respond_to do |format|\n if @asset.update_attributes(asset_params)\n format.html { redirect_to user_assets_path }\n format.json { render :show, status: :ok, location: @asset }\n else\n format.html { render :edit }\n format.json { render json: @asset.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "029ced26abb7556e56bb839e4b29b246",
"score": "0.6693102",
"text": "def update\n @asset = Asset.find(params[:id])\n\n #Nur Administratoren können die Bildversionen neu erstellen. \n #Das aber dann automatisch durch einmaliges editieren und wieder speichern.\n #if can? :manage, @asset\n #@asset.assetfile.recreate_versions!\n #end\n\n respond_to do |format|\n if @asset.update_attributes(params[:asset])\n # if fotograf do track_activity @issue, 'took a foto'\n format.html { redirect_to @asset, notice: 'Asset was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render layout: \"form\", action: \"edit\" }\n format.json { render json: @asset.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "bff7c13c2aa79b6a0660ff66f8a422dd",
"score": "0.6683952",
"text": "def update(id, params = {})\n # self.class.put(\n # \"/content_assets/#{id}.json\",\n # :query => { :auth_token => self.auth_token, :content_asset => params }\n # )\n end",
"title": ""
},
{
"docid": "929dfc56ea1767bb5ee599f3afc8a7dc",
"score": "0.66470116",
"text": "def update!(**args)\n @allow_existing = args[:allow_existing] if args.key?(:allow_existing)\n @assets = args[:assets] if args.key?(:assets)\n @request_id = args[:request_id] if args.key?(:request_id)\n end",
"title": ""
},
{
"docid": "791dd12aeb12431b59228486f5b5a862",
"score": "0.6592361",
"text": "def update\n @asset.update_attributes(asset_params)\n end",
"title": ""
},
{
"docid": "8c91aec946d7de6b1e8e7e8509d0cf8b",
"score": "0.65825355",
"text": "def update!(**args)\n @asset = args[:asset] if args.key?(:asset)\n end",
"title": ""
},
{
"docid": "4e9f3c2c05e4c382803278cacefc7e34",
"score": "0.6572961",
"text": "def update\n @asset = @user.assets.find(params[:id])\n\n respond_to do |format|\n if @asset.update_attributes(params[:asset])\n format.html { redirect_to(@asset, :notice => 'Asset was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @asset.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "565b67193f47f997d428daac88f1f436",
"score": "0.6572897",
"text": "def update\n path = params[:path]\n full_path = \"#{BASE_PATH}/#{path}\"\n @asset = Asset.new(\n :filename => File.basename(path), \n :path => path,\n :full_path => full_path, \n :parent_path => path.gsub(/\\/([^\\/]*)\\.([^\\/]*)/, ''),\n :content_type => MIME.check(full_path).to_s,\n :created_at => File.atime(\"#{BASE_PATH}/#{path}\")) \n File.open(full_path,\"w\"){|file| file.puts params[:body]}\n @body = IO.read(full_path)\n \n respond_to do |format|\n flash[:notice] = 'Asset was successfully updated.'\n format.html { render :template => 'admin/assets/edit' }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "37ed27f524c9e94608e1501c62866ee6",
"score": "0.6551793",
"text": "def update\n\n respond_to do |format|\n if @asset.update_attributes(params[:asset])\n format.html { redirect_to(@asset, :notice => \"#{@asset} was successfully updated\") }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @asset.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "457b4f033c78483f2fac4638b448b284",
"score": "0.65448916",
"text": "def update\n @eve_asset = EveAsset.find(params[:id])\n\n respond_to do |format|\n if @eve_asset.update_attributes(params[:eve_asset])\n format.html { redirect_to @eve_asset, notice: 'Eve asset was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @eve_asset.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "94ae472920d94fb87746fd508e6da67b",
"score": "0.6539309",
"text": "def update\n respond_to do |format|\n if @it_asset.update(it_asset_params)\n format.html { redirect_to @it_asset, notice: 'It asset was successfully updated.' }\n format.json { render :show, status: :ok, location: @it_asset }\n else\n format.html { render :edit }\n format.json { render json: @it_asset.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "20958657e0fafa6604e49560391c9af2",
"score": "0.65288764",
"text": "def update\n @asset = Asset.find(params[:id])\n respond_to do |format|\n if @asset.update_attributes(params[:asset])\n format.html { redirect_to(@asset, :notice => 'Asset was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @asset.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c1b02b6357d879d0b2f1d7ebef6f975d",
"score": "0.6513643",
"text": "def update\n respond_to do |format|\n if @asset.update_attributes(params[:asset])\n flash[:notice] = 'Asset was successfully updated.'\n format.html { redirect_to asset_url(@asset) }\n else\n format.html { render :action => \"edit\" }\n end\n end\n end",
"title": ""
},
{
"docid": "0b0b5ee187b4541f2979aa515b665b91",
"score": "0.6493943",
"text": "def update\n @note = Note.find(params[:id])\n if @note.update(note_params.except(:assets_attributes))\n render json: @note, status: :ok, location: api_v2_note_url(@note)\n else\n puts @note.errors.to_json\n render json: @note.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "a0361de3ddc1c256c2d927172eb252de",
"score": "0.6488705",
"text": "def update\n respond_to do |format|\n if @image_asset.update(image_asset_params)\n format.html { redirect_to @image_asset, notice: 'Image asset was successfully updated.' }\n format.json { render :show, status: :ok, location: @image_asset }\n else\n format.html { render :edit }\n format.json { render json: @image_asset.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d5f78d24b94a4909acdb6562797e875a",
"score": "0.6467308",
"text": "def edit(*args)\n arguments(args, required: [:owner, :repo, :id]) do\n permit VALID_ASSET_PARAM_NAMES\n end\n\n patch_request(\"/repos/#{arguments.owner}/#{arguments.repo}/releases/assets/#{arguments.id}\", arguments.params)\n end",
"title": ""
},
{
"docid": "8e30a08a6321ea1127e941d2f7bd71ca",
"score": "0.64586234",
"text": "def update\n if @asset.update(asset_params)\n respond_with @asset, notice: 'Asset was successfully updated.'\n else \n render :edit\n end\n end",
"title": ""
},
{
"docid": "e9bf0067f6673144bb4ee4769ccc22c5",
"score": "0.64440364",
"text": "def update\n @asset = Asset.find(params[:id])\n\n respond_to do |format|\n if @asset.update_attributes(params[:asset])\n flash[:notice] = 'Asset was successfully updated.'\n format.html { redirect_to(@asset) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @asset.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b3453ef519f120f8a02aa20750e86446",
"score": "0.64244366",
"text": "def update_asset\n @asset = Asset.shod(params[:id])\n @asset.update(asset_params)\n @assets ||= Asset.all\n flash[:notice] = t('asset_update')\n end",
"title": ""
},
{
"docid": "05810d217e2095d714f7b0ca09d6781e",
"score": "0.6385846",
"text": "def update\n if content_asset_params[:content].present?\n file_name_array = content_asset_params[:name].split('.')\n file = Tempfile.new([file_name_array.first, \".#{file_name_array.last}\"])\n file.write(content_asset_params[:content])\n file.rewind\n file.read\n @asset.attachment = File.open(file.path)\n @asset.save\n file.close\n file.unlink\n end\n @asset.update(asset_params)\n render json: { name: @asset.name, content: @asset.attachment.file&.read || '', id: @asset.id }\n end",
"title": ""
},
{
"docid": "8807670db4fdec61bfea68bc73c3cd96",
"score": "0.6353793",
"text": "def update\n respond_to do |format|\n if @personal_asset.update(personal_asset_params)\n format.html { redirect_to @personal_asset, notice: 'Personal asset was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @personal_asset.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "461e035313c5ca2628ec44a4311db684",
"score": "0.6323804",
"text": "def update\n @asset = Asset.find(params[:id])\n\n respond_to do |format|\n if @asset.update_attributes(params[:asset])\n if params[:remove_photo]\n @asset.photo = nil\n @asset.save\n end\n format.html { redirect_to @asset, notice: 'Asset was successfully updated.' }\n format.json { head :no_content }\n else\n @owners = @users = Member.all\n @categories = Category.all\n format.html { render action: \"edit\" }\n format.json { render json: @asset.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3300fe411d170dd9bdf890058d7695b5",
"score": "0.6309061",
"text": "def update\n if @asset_class.update(asset_class_params)\n head :no_content\n else\n render json: @asset_class.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "5e02138bcb0dff3b0ae194d82e65917b",
"score": "0.63042516",
"text": "def update!(**args)\n @asset = args[:asset] if args.key?(:asset)\n @compression_format = args[:compression_format] if args.key?(:compression_format)\n @data_format = args[:data_format] if args.key?(:data_format)\n @project_id = args[:project_id] if args.key?(:project_id)\n end",
"title": ""
},
{
"docid": "c49588e052b02b6592fcba9b3b355acc",
"score": "0.63011396",
"text": "def update\n if @asset.update(file: asset_params[:file].first)\n respond_modal_with [@app, @asset], location: app_assets_url\n else\n @asset.errors.add(:base, :unprocessable_entity)\n respond_modal_with @asset\n end\n end",
"title": ""
},
{
"docid": "5fe29ed9a1eee2f7648405d8a8b45798",
"score": "0.62879336",
"text": "def update!(**args)\n @asset_ids = args[:asset_ids] if args.key?(:asset_ids)\n end",
"title": ""
},
{
"docid": "62e7333a132e06f2949649782c8f03dc",
"score": "0.62794465",
"text": "def update\n @asset = Asset.find(params[:id])\n\n respond_to do |format|\n if @asset.update_attributes(params[:asset])\n flash[:notice] = t('asset.title')+\" \"+t('updated')\n format.html { redirect_to(@asset) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @asset.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "79aa1481accede061c600119808d905f",
"score": "0.6275997",
"text": "def save\n Resource.client.update_asset(self)\n end",
"title": ""
},
{
"docid": "04dbd46c6cc7be362c37e9d5ffb83642",
"score": "0.6273556",
"text": "def update\n if !has_right?(:edit)\n redirect_to :unauthorized\n return\n end\n @asset = Asset.find(params[:id])\n\n respond_to do |format|\n if @asset.update_attributes(params[:asset])\n flash[:notice] = 'Asset was successfully updated.'\n format.html { redirect_to asset_url(@asset) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @asset.errors.to_xml }\n end\n end\n end",
"title": ""
},
{
"docid": "ceee085b75a2bc843d41125bc193faad",
"score": "0.6257776",
"text": "def update\n @physical_asset = PhysicalAsset.find(params[:id])\n\n respond_to do |format|\n if @physical_asset.update_attributes(params[:physical_asset])\n format.html { redirect_to @physical_asset, notice: 'Physical asset was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @physical_asset.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "193aa1cbf1d0e0e3abe490fe7e115296",
"score": "0.6247934",
"text": "def update\n @jsonfile = Jsonfile.find(params[:id])\n\n respond_to do |format|\n if @jsonfile.update_attributes(params[:jsonfile])\n format.html { redirect_to(@jsonfile, :notice => 'Jsonfile was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @jsonfile.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "554cb6981663caaefc6f06087d88ba21",
"score": "0.62246776",
"text": "def update_asset asset, key, spec\n collins_client.set_attribute! asset, key, spec.to_json\n end",
"title": ""
},
{
"docid": "c1a2408dcfee7a07d3a0df98985b0e5e",
"score": "0.62231016",
"text": "def update\n respond_to do |format|\n if @asset_scrapping.update(asset_scrapping_params)\n format.html { redirect_to @asset_scrapping, notice: 'Asset scrapping was successfully updated.' }\n format.json { render :show, status: :ok, location: @asset_scrapping }\n else\n format.html { render :edit }\n format.json { render json: @asset_scrapping.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ab974f7cf19b54665fdff54954cbdbf5",
"score": "0.6220958",
"text": "def update\n respond_to do |format|\n if @asset.update_attributes(params[:asset])\n flash[:notice] = 'Asset was successfully updated.'\n format.html { redirect_to user_user_asset_url(:user_id => @user, :id => @asset) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @asset.errors.to_xml }\n end\n end\n end",
"title": ""
},
{
"docid": "dafea09093876f618f3adff7b67fd1be",
"score": "0.6207667",
"text": "def update\n respond_to do |format|\n if @cassette.update(cassette_params)\n format.html { redirect_to @cassette, notice: 'Cassette was successfully updated.' }\n format.json { render :show, status: :ok, location: @cassette }\n else\n format.html { render :edit }\n format.json { render json: @cassette.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "47abb2cddfa1a665018f717cdaaa4164",
"score": "0.620465",
"text": "def update!(params)\n res = @client.put(path, {}, params, \"Content-Type\" => \"application/json\")\n\n @attributes = res.json if res.status == 201\n end",
"title": ""
},
{
"docid": "dc6267b7f6bc9146c1321f7325997900",
"score": "0.6203658",
"text": "def update(attributes)\n self.title = attributes[:title] if attributes[:title]\n self.description = attributes[:description] if attributes[:description]\n self.file = attributes[:file] if attributes[:file]\n request = Request.new(\n \"/#{ space.id }/assets/#{ id }\",\n {fields: fields_for_query},\n id = nil,\n version: sys[:version]\n )\n response = request.put\n result = ResourceBuilder.new(response, {}, {}).run\n refresh_data(result)\n end",
"title": ""
},
{
"docid": "5655b98df6460a73de7b81851d822c78",
"score": "0.6202226",
"text": "def update\n @bundle = Bundle.find(params[:id])\n\n\n respond_to do |format|\n params[:bundle][:category] = params[:bundle][:category].strip.downcase\n params[:bundle][:style] = params[:bundle][:style].strip.downcase\n params[:bundle][:color] = params[:bundle][:color].strip.downcase\n params[:bundle][:brand] = params[:bundle][:brand].strip.downcase\n params[:bundle][:make] = params[:bundle][:make].strip.downcase\n params[:bundle][:location] = params[:bundle][:location].strip.downcase\n\n if @bundle.update_attributes(params[:bundle])\n format.html { redirect_to @bundle, notice: 'Bundle was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @bundle.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "77463972366d4f3c094b7e670ccb1989",
"score": "0.6171541",
"text": "def update\n\n respond_to do |format|\n if @content_asset.update_attributes(params[:content_asset])\n format.html { redirect_to([@client, @content_asset], :notice => 'Content asset was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @content_asset.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "90342910bc97cefb379aeb92a7a17613",
"score": "0.6160557",
"text": "def update!(**args)\n @asset = args[:asset] if args.key?(:asset)\n @change_type = args[:change_type] if args.key?(:change_type)\n end",
"title": ""
},
{
"docid": "90342910bc97cefb379aeb92a7a17613",
"score": "0.6160557",
"text": "def update!(**args)\n @asset = args[:asset] if args.key?(:asset)\n @change_type = args[:change_type] if args.key?(:change_type)\n end",
"title": ""
},
{
"docid": "f2e1a2d92615dec6db1ba3446adbeaf7",
"score": "0.61578184",
"text": "def update\n respond_to do |format|\n if @asset_proced.update(asset_proced_params)\n format.html { redirect_to @asset_proced, notice: 'Asset proced was successfully updated.' }\n format.json { render :show, status: :ok, location: @asset_proced }\n else\n format.html { render :edit }\n format.json { render json: @asset_proced.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c4db50ea89cd1fe8027abde60a731792",
"score": "0.6153483",
"text": "def update!(**args)\n @default_asset_id = args[:default_asset_id] if args.key?(:default_asset_id)\n @rules = args[:rules] if args.key?(:rules)\n end",
"title": ""
},
{
"docid": "77ae59f10b7b010287312a837805da9c",
"score": "0.6139176",
"text": "def update\n @asset_type = AssetType.find(params[:id])\n\n respond_to do |format|\n if @asset_type.update_attributes(params[:asset_type])\n format.html { redirect_to @asset_type, notice: 'Asset type was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @asset_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b1fbcf1637258054c24bd3dbff067a85",
"score": "0.61348486",
"text": "def update\n respond_to do |format|\n if @user_asset.update(user_asset_params)\n format.html { redirect_to @user_asset, notice: 'User asset was successfully updated.' }\n format.json { render :show, status: :ok, location: @user_asset }\n else\n format.html { render :edit }\n format.json { render json: @user_asset.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "76aef80aaf72b78544e3a9b7e0a910be",
"score": "0.6134436",
"text": "def update\n @remote_asset = RemoteAsset.find(params[:id])\n\n respond_to do |format|\n if @remote_asset.update_attributes(params[:remote_asset])\n format.html { redirect_to(@remote_asset, :notice => 'RemoteAsset was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @remote_asset.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "bf10e48141fcc9fbbe63d71d0f38879a",
"score": "0.6129506",
"text": "def update\n @asset = Asset.find(params[:id])\n\n respond_to do |format|\n if @asset.update_attributes(params[:asset])\n flash[:notice] = 'Asset was successfully updated.'\n format.html { redirect_to(admin_asset_path(@asset)) }\n format.xml { head :ok }\n else\n assign_lovs\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @asset.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "882c8317370987b86425c0adbf5bfe8c",
"score": "0.61172575",
"text": "def update_aos_version(args = {}) \n put(\"/aosversions.json/#{args[:aosVersionId]}\", args)\nend",
"title": ""
},
{
"docid": "e93e1500f20938bf167c99ce225254ec",
"score": "0.6115557",
"text": "def update\n respond_to do |format|\n if @secondary_asset.update(secondary_asset_params)\n format.html { redirect_to @secondary_asset, notice: 'Secondary asset was successfully updated.' }\n format.json { render :show, status: :ok, location: @secondary_asset }\n else\n format.html { render :edit }\n format.json { render json: @secondary_asset.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0e1e1fe0b715529ae0a3932da2f582f1",
"score": "0.6108951",
"text": "def update!(**args)\n @child_asset_id = args[:child_asset_id] if args.key?(:child_asset_id)\n @id = args[:id] if args.key?(:id)\n @kind = args[:kind] if args.key?(:kind)\n @parent_asset_id = args[:parent_asset_id] if args.key?(:parent_asset_id)\n end",
"title": ""
},
{
"docid": "e71ec155c55e7d9007bd8ad77d806642",
"score": "0.61062163",
"text": "def update\n if @asset.update(asset_params)\n redirect_to user_assets_url, notice: 'Asset was successfully updated!'\n else\n render action: 'edit'\n end\n end",
"title": ""
},
{
"docid": "1672475d7ba8467055df2694ed66ed78",
"score": "0.60897803",
"text": "def update\n render json: Image.update(params[\"id\"], params[\"image\"])\n end",
"title": ""
},
{
"docid": "038e0b23f4bb5ca7ba4b2d4885005d7e",
"score": "0.60595816",
"text": "def update\n respond_to do |format|\n if @media_asset.update(media_asset_params)\n format.html { redirect_to @media_asset, notice: 'Media asset was successfully updated.' }\n format.json { render json: @media_asset }\n else\n format.html { render :edit }\n format.json { render json: @media_asset.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "86731243c8c752ea87ff25de66eba534",
"score": "0.6057931",
"text": "def update\n @bundle = Bundle.find(params[:id])\n @bundle.update_attributes(:title => params[:bundlename]) if !params[:bundlename].blank?\n @bundle.update_attributes(:description => params[:bundlescription]) if !params[:bundlescription].blank?\n r_ids_array = []\n params[:resources].split(\",\").slice!(1..-1).each do |resource|\n r_ids_array << resource.slice!(9..-1)\n end\n r_ids_array.each do |resource_id|\n resource = Resource.find(resource_id)\n if !@bundle.resources.include?(resource)\n @bundle.resources << resource\n end\n end\n\n\n respond_to do |format|\n # if @bundle.resources.update_attributes(params[:])\n format.html { redirect_to bundle_path(@bundle), notice: 'Bundle was successfully updated.' }\n format.json { head :no_content }\n # else\n # format.html { render action: \"edit\" }\n # format.json { render json: @bundle.errors, status: :unprocessable_entity }\n # end\n end\n end",
"title": ""
},
{
"docid": "0a33eec71fa158cf8d5f5c7da1c9410c",
"score": "0.6047363",
"text": "def update\n respond_to do |format|\n if @company_asset.update(company_asset_params)\n format.html { redirect_to @company_asset, notice: 'Company asset was successfully updated.' }\n format.json { render :show, status: :ok, location: @company_asset }\n else\n format.html { render :edit }\n format.json { render json: @company_asset.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "79c52daa44aef311a72d7c2f105f02d7",
"score": "0.60466987",
"text": "def update\n @purple_asset = PurpleAsset.find(params[:id])\n\n respond_to do |format|\n if @purple_asset.update_attributes(params[:purple_asset])\n format.html { redirect_to(@purple_asset, :notice => 'Purple asset was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @purple_asset.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "419ea589bb5469199fc4655a5043b410",
"score": "0.60452557",
"text": "def update\n\n respond_to do |format|\n if @listing.update_attributes(params[:listing])\n if params[:assets]\n params[:assets].each { |asset|\n @listing.assets.create(asset: asset)\n }\n end\n\n format.html { redirect_to @listing }\n format.json { head :no_content }\n format.js { render :js => \"window.location.href = ('#{listing_path(@listing)}');\"}\n else\n format.html { render action: \"edit\" }\n format.json { render json: @listing.errors, status: :unprocessable_entity }\n format.js \n end\n end\n end",
"title": ""
},
{
"docid": "251e77e4ce473decdc9b10f66cef845e",
"score": "0.60415286",
"text": "def update\n respond_to do |format|\n if @asset_name.update(asset_name_params)\n format.html { redirect_to asset_names_url, notice: 'Éxito al guardar.' }\n format.json { render :show, status: :ok, location: @asset_name }\n else\n format.html { render :edit }\n format.json { render json: @asset_name.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "bb446fad7b85e754f6095adaf5c29f57",
"score": "0.6020776",
"text": "def update\n @manifest = Manifest.find(params[:id])\n authorize! :update, @manifest\n data = params[:manifest].clone\n @manifest[:updated_at] = Time.now.getutc\n data[:manifest_json] = JSON.parse(data[:manifest_json]) if data[:manifest_json].is_a? String\n respond_to do |format|\n if @manifest.update_attributes(data)\n Canvas.update_canvases_for_manifest(@manifest)\n format.html { redirect_to @manifest, notice: 'Manifest was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @manifest.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "64b4c5a540fab3ffd7d37f4c1ef60285",
"score": "0.6020659",
"text": "def update\n @game_asset = GameAsset.find(params[:id])\n\n respond_to do |format|\n if @game_asset.update_attributes(params[:game_asset])\n format.html { redirect_to character_path(@game_asset.character), notice: 'Game asset was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @game_asset.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "17e5a0d6aea0476a9de9b142494d7b1e",
"score": "0.6015926",
"text": "def update \n @versioned_file = VersionedFile.find(params[:id])\n puts @versioned_file.id\n if @versioned_file.update(versioned_file_params)\n head :no_content\n else\n render json: @versioned_file.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "22469b71dd5e38754d367d3c9f7ad606",
"score": "0.60138786",
"text": "def update\n respond_to do |format|\n if @asset_activity.update(asset_activity_params)\n format.html { redirect_to @asset_activity, notice: 'Asset activity was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @asset_activity.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c901dfeaeaccde01151eba4358a6ee94",
"score": "0.6009362",
"text": "def update\n respond_to do |format|\n if @file_name.update(file_name_params)\n format.html { redirect_to root_path }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @file_name.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "638b98a56193492e173a261fd6a301fc",
"score": "0.6002081",
"text": "def update!(**args)\n @asset = args[:asset] if args.key?(:asset)\n @state = args[:state] if args.key?(:state)\n end",
"title": ""
},
{
"docid": "e27f4b60f8d52b5f305290b4f8a19019",
"score": "0.59972876",
"text": "def update\n respond_to do |format|\n if @fixedasset.update(fixedasset_params)\n format.html { redirect_to @fixedasset, notice: '更新しました' }\n format.json { render :show, status: :ok, location: @fixedasset }\n else\n format.html { render :edit }\n format.json { render json: @fixedasset.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "dd3e5c138c3b47cb3de57cd1be49aebd",
"score": "0.59956086",
"text": "def update\n respond_to do |format|\n if @af_asset.update(af_asset_params)\n format.html { redirect_to @af_asset, notice: 'Éxito al guardar.' }\n format.json { render :show, status: :ok, location: @af_asset }\n else\n format.html { render :edit }\n format.json { render json: @af_asset.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7fa212750f963271626f2e74d348141e",
"score": "0.59914607",
"text": "def update\n respond_to do |format|\n if @asset_tag.update(asset_tag_params)\n format.html { redirect_to @asset_tag, notice: 'Asset tag was successfully updated.' }\n format.json { render :show, status: :ok, location: @asset_tag }\n else\n format.html { render :edit }\n format.json { render json: @asset_tag.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "768551b9da9f81e8323fb282843c3c6f",
"score": "0.59887636",
"text": "def update\n @json = Json.find(params[:id])\n\n if @json.update(json_params)\n head :no_content\n else\n render json: @json.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "4832faae4b73e8fa8cecd75f130fe926",
"score": "0.5988285",
"text": "def update!(**args)\n @source_asset = args[:source_asset] if args.key?(:source_asset)\n end",
"title": ""
},
{
"docid": "15824dc82d9a6e98c313939aa4d606dd",
"score": "0.5977031",
"text": "def update\n # CarrierWave attrs->filename hack\n @collectible.assign_attributes(collectible_params.except(:collectible_file, :json_file))\n @collectible.assign_attributes(collectible_params.slice(:collectible_file, :json_file))\n\n respond_to do |format|\n if @collectible.save\n format.html { redirect_to @collectible, notice: 'Collectible was successfully updated.' }\n format.json { render :show, status: :ok, location: @collectible }\n else\n format.html { render :edit }\n format.json { render json: @collectible.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1817fae5dc2bf69b4cdf7b097a1a9e40",
"score": "0.5975818",
"text": "def update!(**args)\n @asset = args[:asset] if args.key?(:asset)\n @create_time = args[:create_time] if args.key?(:create_time)\n @description = args[:description] if args.key?(:description)\n @name = args[:name] if args.key?(:name)\n @update_time = args[:update_time] if args.key?(:update_time)\n end",
"title": ""
},
{
"docid": "6f326814936c3a93c7848a1fd185f499",
"score": "0.5974011",
"text": "def update\n respond_to do |format|\n if @ip_asset.update(ip_asset_params)\n format.html { redirect_to @ip_asset, notice: 'Ip asset was successfully updated.' }\n format.json { render :show, status: :ok, location: @ip_asset }\n else\n format.html { render :edit }\n format.json { render json: @ip_asset.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6f326814936c3a93c7848a1fd185f499",
"score": "0.5974011",
"text": "def update\n respond_to do |format|\n if @ip_asset.update(ip_asset_params)\n format.html { redirect_to @ip_asset, notice: 'Ip asset was successfully updated.' }\n format.json { render :show, status: :ok, location: @ip_asset }\n else\n format.html { render :edit }\n format.json { render json: @ip_asset.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8d6d5e8612dd2644f8c945fbde8f4cac",
"score": "0.5955006",
"text": "def update\n respond_to do |format|\n if @asset_type.update(asset_type_params)\n format.html { redirect_to @asset_type, notice: 'Asset type was successfully updated.' }\n format.json { render :show, status: :ok, location: @asset_type }\n else\n format.html { render :edit }\n format.json { render json: @asset_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9a48954c2eb6d586fe593edff1bc76a5",
"score": "0.59542227",
"text": "def update\n respond_to do |format|\n if @media_asset.update(media_asset_params)\n format.html { redirect_to @media_asset, notice: 'Media asset was successfully updated.' }\n format.json { render :show, status: :ok, location: @media_asset }\n else\n format.html { render :edit }\n format.json { render json: @media_asset.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d653e8ae8318f69a06eef424a34acbae",
"score": "0.5951178",
"text": "def update\n @badge = Badge.find(params[:id])\n if @badge.update_attributes(params[:badge])\n if @badge.asset\n @badge.asset.update_attributes({:asset => params[:asset][:file], :attachable_id => @badge.id, :attachable_type => \"badge\"})\n else\n @asset = Asset.new({:asset => params[:asset][:file], :user_id => current_user.id, :attachable_id => @badge.id, :attachable_type => \"badge\"})\n @asset.save\n end\n flash[:notice] = \"Successfully updated badge.\"\n redirect_to admin_badges_path(current_user)\n else\n render :action => 'edit'\n end\n end",
"title": ""
},
{
"docid": "0185d8d3afcc60ab1032a6d58dac0fad",
"score": "0.59309703",
"text": "def update_resource(uri, options)\n JSON.parse(options[:json]) rescue (return status_422)\n resource = CloudKit::Resource.first(\n options.excluding(:json, :etag).merge(:uri => uri.string))\n return status_404 unless (resource && (resource.remote_user == options[:remote_user]))\n return etag_required unless options[:etag]\n return status_412 unless options[:etag] == resource.etag\n resource.update(options[:json])\n return json_meta_response(200, uri.string, resource.etag, resource.last_modified)\n end",
"title": ""
},
{
"docid": "91a2c7a46bf89359e222627ff72615a8",
"score": "0.5926737",
"text": "def api_assets_batch_edit_patch_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: DefaultApi.api_assets_batch_edit_patch ...'\n end\n # resource path\n local_var_path = '/api/assets/batch/edit'\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['Basic']\n data, status_code, headers = @api_client.call_api(:PATCH, 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: DefaultApi#api_assets_batch_edit_patch\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "af79cfa4fbe40d293b9cd639a82dca19",
"score": "0.5922621",
"text": "def edit_asset\n @asset = Asset.shod(params[:id])\n authorize! :update, @asset\n end",
"title": ""
},
{
"docid": "24e17eed53699503b707ad89871e519d",
"score": "0.5917294",
"text": "def update_release_asset(repo, asset_id, options = {})\n patch \"#{Repository.path repo}/releases/assets/#{asset_id}\", options\n end",
"title": ""
},
{
"docid": "24e17eed53699503b707ad89871e519d",
"score": "0.5917294",
"text": "def update_release_asset(repo, asset_id, options = {})\n patch \"#{Repository.path repo}/releases/assets/#{asset_id}\", options\n end",
"title": ""
},
{
"docid": "e4d2044f27158fcdeacca246635ed1dd",
"score": "0.5915758",
"text": "def update\n respond_to do |format|\n if @assettype.update(assettype_params)\n format.html { redirect_to @assettype, notice: '修改成功!' }\n format.json { render :show, status: :ok, location: @assettype }\n else\n format.html { render :edit }\n format.json { render json: @assettype.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "77ce27989a6eb1263af612ecffa00850",
"score": "0.5905672",
"text": "def update\n update! do |success, failure|\n success.json { render :json => resource }\n end\n end",
"title": ""
},
{
"docid": "c58de386412f7d736dfdc5cb157d9141",
"score": "0.5903083",
"text": "def update!(**args)\n @asset_id = args[:asset_id] if args.key?(:asset_id)\n @asset_import_id = args[:asset_import_id] if args.key?(:asset_import_id)\n @asset_import_messages = args[:asset_import_messages] if args.key?(:asset_import_messages)\n @publish_url = args[:publish_url] if args.key?(:publish_url)\n end",
"title": ""
}
] |
a482d436f39babc3db7f16575f6265f7 | CE play with dst, json parsing | [
{
"docid": "e6cfa6e213c62c11990b2adad2342224",
"score": "0.57219124",
"text": "def dstParse (num, arr)\n\t\t\trawDst = JSON.parse(arr[num])\n\t\t\tspringDate = rawDst['springForward'].split(\"-\")\n\t\t\tfallDate = rawDst['fallBack'].split(\"-\")\n\t\t\tdstArr = []\n\t\t\tdstArr[0] = springDate[1].to_i\n\t\t\tdstArr[1] = springDate[2].to_i\n\t\t\tdstArr[2] = fallDate[1].to_i\n\t\t\tdstArr[3] = fallDate[2].to_i\n\t\t\treturn dstArr\n\t\tend",
"title": ""
}
] | [
{
"docid": "35e5a12cd285c0900f90bc69f7f9bd00",
"score": "0.59836185",
"text": "def setup\n a = '{\n \"content\": {\n \"class\": \"batatas\",\n \"assetId\": \"e473a2f7-dc12-42d3-9933-fd5bd67a32e0\",\n \"totalLicenses\": 10,\n \"type\": \"EST\",\n \"offerId\": \"51d4f5d9-ba88-427a-b430-274e9663980c\",\n \"purchaseDate\": \"2015-07-07T09:23:17.49Z\",\n \"ownerId\": \"6ecb8629-374a-4063-81da-c329f29b405d\",\n \"ownership\": \"UserOwnership\",\n \"canPlay\": true,\n \"playbackRules\": {},\n \"canSendToStb\": false,\n \"canSendSpecs\": {},\n \"content\": {\n \"asset\": {\n \"duration\":1\n },\n \"resume\": {},\n \"contents\": [\n {\n \"asset\": {\n \"title\": \"Back to the Future\",\n \"altTitle\": \"Back to the Future - Season\",\n \"slug\": \"back-to-the-future\",\n \"shortSynopsis\": \"A high school student is accidentally sent 30 years into the past in a time-traveling sports car invented by his friend, Dr. Emmett Brown, and must make sure his high-school-age parents unite in order to save his own existence.\",\n \"duration\": 0,\n \"number\": 1,\n \"year\": 0,\n \"rel\": \"asset\",\n \"lastUpdateDate\": \"2015-03-24T13:52:02Z\",\n \"assetType\": \"Season\",\n \"catalogSection\": \"Movies\",\n \"id\": \"11eb97d3-c8ee-4502-a9dd-410c8b4dd66a\",\n \"links\": [\n {\n \"rel\": \"self\",\n \"href\": \"https://qa.skystore.com/api/webP3/v2/catalog/assets/11eb97d3-c8ee-4502-a9dd-410c8b4dd66a/back-to-the-future\",\n \"needsAuthentication\": false\n },\n {\n \"rel\": \"image\",\n \"href\": \"http://qa.skystore.com/api/img/asset/en/F80DF38A-D09C-41C9-A419-81C6CF8582F3_3E1EE8E3-D376-4687-8C57-CC57475DE4FE_2015-6-22-T11-11-30.jpg?s={{w}}x{{h}}\",\n \"needsAuthentication\": false\n }\n ]\n },\n \"resume\": {\n \"asset\": {\n \"title\": \"Back to the Future\",\n \"altTitle\": \"Back to the Future - Movie\",\n \"slug\": \"back-to-the-future\",\n \"shortSynopsis\": \"A high school student is accidentally sent 30 years into the past in a time-traveling sports car invented by his friend, Dr. Emmett Brown, and must make sure his high-school-age parents unite in order to save his own existence.\",\n \"duration\": 116,\n \"year\": 1985,\n \"rel\": \"asset\",\n \"lastUpdateDate\": \"2015-01-09T11:36:08Z\",\n \"assetType\": \"Programme\",\n \"catalogSection\": \"Movies\",\n \"id\": \"86b39480-87e6-4a99-891a-563fb780871b\",\n \"links\": [\n {\n \"rel\": \"self\",\n \"href\": \"https://qa.skystore.com/api/webP3/v2/catalog/assets/86b39480-87e6-4a99-891a-563fb780871b/back-to-the-future\",\n \"needsAuthentication\": false\n },\n {\n \"rel\": \"image\",\n \"href\": \"http://qa.skystore.com/api/img/asset/en/F80DF38A-D09C-41C9-A419-81C6CF8582F3_72C3E254-7095-45BB-BF83-3055E08CC204_2015-6-22-T11-12-46.jpg?s={{w}}x{{h}}\",\n \"needsAuthentication\": false\n }\n ]\n },\n \"video\": {\n \"playbackPositionInSeconds\": 0,\n \"progressPercent\": 0,\n \"links\": [\n {\n \"rel\": \"videoOptions\",\n \"href\": \"https://qa.skystore.com/api/webP3/v2/user/entitlements/fa879cad-8753-4040-8702-fd0937eeb7f4/86b39480-87e6-4a99-891a-563fb780871b/video/options\",\n \"needsAuthentication\": true\n }\n ]\n }\n },\n \"links\": [\n {\n \"rel\": \"self\",\n \"href\": \"https://qa.skystore.com/api/webP3/v2/user/entitlements/fa879cad-8753-4040-8702-fd0937eeb7f4/11eb97d3-c8ee-4502-a9dd-410c8b4dd66a\",\n \"needsAuthentication\": true\n }\n ]\n },\n{\n \"asset\": {\n \"title\": \"Back to the Future FAKE \",\n \"altTitle\": \"Back to the Future - Season\",\n \"slug\": \"back-to-the-future\",\n \"shortSynopsis\": \"A high school student is accidentally sent 30 years into the past in a time-traveling sports car invented by his friend, Dr. Emmett Brown, and must make sure his high-school-age parents unite in order to save his own existence.\",\n \"duration\": 0,\n \"number\": 1,\n \"year\": 0,\n \"rel\": \"asset\",\n \"lastUpdateDate\": \"2015-03-24T13:52:02Z\",\n \"assetType\": \"Season\",\n \"catalogSection\": \"Movies\",\n \"id\": \"11eb97d3-c8ee-4502-a9dd-410c8b4dd66a\",\n \"links\": [\n {\n \"rel\": \"self\",\n \"href\": \"https://qa.skystore.com/api/webP3/v2/catalog/assets/11eb97d3-c8ee-4502-a9dd-410c8b4dd66a/back-to-the-future\",\n \"needsAuthentication\": false\n },\n {\n \"rel\": \"image\",\n \"href\": \"http://qa.skystore.com/api/img/asset/en/F80DF38A-D09C-41C9-A419-81C6CF8582F3_3E1EE8E3-D376-4687-8C57-CC57475DE4FE_2015-6-22-T11-11-30.jpg?s={{w}}x{{h}}\",\n \"needsAuthentication\": false\n }\n ]\n },\n \"resume\": {\n \"asset\": {\n \"title\": \"Back to the Future\",\n \"altTitle\": \"Back to the Future - Movie\",\n \"slug\": \"back-to-the-future\",\n \"shortSynopsis\": \"A high school student is accidentally sent 30 years into the past in a time-traveling sports car invented by his friend, Dr. Emmett Brown, and must make sure his high-school-age parents unite in order to save his own existence.\",\n \"duration\": 116,\n \"year\": 1985,\n \"rel\": \"asset\",\n \"lastUpdateDate\": \"2015-01-09T11:36:08Z\",\n \"assetType\": \"Programme\",\n \"catalogSection\": \"Movies\",\n \"id\": \"86b39480-87e6-4a99-891a-563fb780871b\",\n \"links\": [\n {\n \"rel\": \"self\",\n \"href\": \"https://qa.skystore.com/api/webP3/v2/catalog/assets/86b39480-87e6-4a99-891a-563fb780871b/back-to-the-future\",\n \"needsAuthentication\": false\n },\n {\n \"rel\": \"image\",\n \"href\": \"http://qa.skystore.com/api/img/asset/en/F80DF38A-D09C-41C9-A419-81C6CF8582F3_72C3E254-7095-45BB-BF83-3055E08CC204_2015-6-22-T11-12-46.jpg?s={{w}}x{{h}}\",\n \"needsAuthentication\": false\n }\n ]\n },\n \"video\": {\n \"playbackPositionInSeconds\": 0,\n \"progressPercent\": 0,\n \"links\": [\n {\n \"rel\": \"videoOptions\",\n \"href\": \"https://qa.skystore.com/api/webP3/v2/user/entitlements/fa879cad-8753-4040-8702-fd0937eeb7f4/86b39480-87e6-4a99-891a-563fb780871b/video/options\",\n \"needsAuthentication\": true\n }\n ]\n }\n },\n \"links\": [\n {\n \"rel\": \"self\",\n \"href\": \"https://qa.skystore.com/api/webP3/v2/user/entitlements/fa879cad-8753-4040-8702-fd0937eeb7f4/11eb97d3-c8ee-4502-a9dd-410c8b4dd66a\",\n \"needsAuthentication\": true\n }\n ]\n }\n ]\n },\n \"id\": \"fa879cad-8753-4040-8702-fd0937eeb7f4\",\n \"links\": [\n {\n \"rel\": \"deviceStatus\",\n \"href\": \"https://qa.skystore.com/api/webP3/v2/user/devices/status\",\n \"needsAuthentication\": true\n }\n ]\n },\n \"meta\": {\n \"httpCode\": 200\n }\n }'\n\n\n\n @hash = JSON.parse a\n @a = A.new\n @a.convert_and_define hash\n end",
"title": ""
},
{
"docid": "aa2696c09309b124e68f289582cb34c2",
"score": "0.5973215",
"text": "def getJson(file)\r\n\r\n end",
"title": ""
},
{
"docid": "db7a211fd862f114b669b2b9323721ba",
"score": "0.5933076",
"text": "def parse()\n if !File.exist?(\"./lib/command-food-app/#{@mod}/#{@path}\")\n puts \"Error: ./lib/command-food-app/#{@mod}/#{@path} does not exist\"\n return {}\n end\n\n \t\tfile = File.open(\"./lib/command-food-app/#{@mod}/#{@path}\", \"rb\")\n\t\t contents = file.read\n\t\t file.close\n\t\t contents = JSON.parse(contents)\n\n\t return contents\n end",
"title": ""
},
{
"docid": "47b9e957398d9827d38ecab51a571e88",
"score": "0.59182465",
"text": "def load_json; end",
"title": ""
},
{
"docid": "87b718022cee0a689ce8359e90352710",
"score": "0.5886923",
"text": "def from_json(filename); end",
"title": ""
},
{
"docid": "73a5476cc39d464a1e5316ed7e834dfb",
"score": "0.5879131",
"text": "def test_get_canvas_json_data_todolms\n file_name = \"studenta\"\n file_name = IO.read(\"#{@@testFileDir}/todolms/canvas/#{file_name}.json\")\n refute_nil file_name, \"find test file\"\n jsonA = JSON.parse(file_name)\n refute_nil jsonA, \"check that file contents are understood as json\"\n end",
"title": ""
},
{
"docid": "d048d03b67db95184a14157c359bdb8a",
"score": "0.5872451",
"text": "def scanJson(json)\n @sourceJson = JSON::Parser.new(json).parse ;\n scanRoadJson(@sourceJson) ;\n scanPoIJson(@sourceJson) ;\n setCenterOrigin() ;\n end",
"title": ""
},
{
"docid": "48f29ee4531d2f2025b60a5895a568d8",
"score": "0.5840732",
"text": "def transform\n dest = File.open(ARGV[1], 'w')\n f = File.read(ARGV[0], :external_encoding=>'utf-8')\n data = JSON.parse(f)\n if data['artifacts']\n data['artifacts'].each do |k,v|\n dest.puts v.to_json.gsub('-','_')\n end\n end\n dest.close\nend",
"title": ""
},
{
"docid": "6dd71000fc8d61e35200487a78259b75",
"score": "0.5812148",
"text": "def parse_json! json\n @start_time = Time.at(json['start']).to_datetime\n @stop_time = Time.at(json['stop']).to_datetime\n @url = json['url'] if json.key?('url')\n @channel_id = json['channelId'] if json.key?('channelId')\n @category = json['category'] if json.key?('category')\n @description = json['desc'] if json.key?('desc')\n @production_year = json['prodYear'] if json.key?('prodYear')\n @production_country = json['prodCountry'] if json.key?('prodCountry')\n @teaser = json['teaser'] if json.key?('teaser')\n @series_id = json['series_id'] if json.key?('seriesId')\n @series_info = json['series'] if json.key?('series')\n end",
"title": ""
},
{
"docid": "794e2199a9adb3275f048638e9331020",
"score": "0.57881695",
"text": "def convert_from_json_compatible(json_object)\n json_game_info = json_object[:game_info]\n @game_info = jsonToGameInfo(json_game_info)\n\n json_toys = json_object[:toys]\n toys = []\n json_toys.each do |json_toy|\n toys << jsonToToy(json_toy)\n end\n # then we can do the scenes as well\n @toys = toys\n\n json_scenes = json_object[:scenes]\n scenes = []\n if json_scenes\n json_scenes.each do |json_scene|\n scenes << jsonToScene(json_scene)\n end\n end\n @scenes = scenes\n @currentscene = 0 #scenes.length - 1\n end",
"title": ""
},
{
"docid": "c655524295ede7505abfe4c30df3dd61",
"score": "0.5776014",
"text": "def videos_json(file)\r\n\tbegin\r\n\t\tJSON.parse(get_youtube_videos(file), object_class:OpenStruct)\r\n\trescue Exception => e\r\n\t\tif e.inspect.include? \"751\" then puts \"The JSON object seems to be wrong\" else puts e.message end\r\n\tend\t\r\nend",
"title": ""
},
{
"docid": "5c1d82a3259940a9fdaac8b87c361d4c",
"score": "0.57696325",
"text": "def parse_json(filename)\n debug_trace(\"Parsing JSON #{filename}.json\")\n data = JSON.load(IO.read(\"#{$source_dir}#{filename}.json\"))\n new_data = {\"version\": 3}\n\n if !data[\"version\"] || data[\"version\"] < 2\n abort_msg(\"Outdated JSON file #{filename}.json\", nil)\n end\n\n if data[\"version\"] >= 3\n error_msg(\"File #{filename}.json has already been processed.\", nil)\n $skipped_json_filenames.push(filename)\n return nil\n end\n\n if data[\"points\"] && !data[\"points\"].empty?\n abort_msg(\"#{filename}.json should not have POI\", nil)\n end\n\n if data[\"parks\"]\n new_data[\"parks\"] = data[\"parks\"]\n end\n\n if data[\"trails\"]\n new_data[\"trails\"] = {}\n data[\"trails\"].each do |trail_id, trail|\n trail.delete(\"trailheads\")\n new_data[\"trails\"][trail_id] = trail\n end\n end\n\n return new_data\nend",
"title": ""
},
{
"docid": "43d3c1aa617fddc3404ec6737c968d8e",
"score": "0.5749893",
"text": "def prepare_json; end",
"title": ""
},
{
"docid": "a7b1acb7988d3f8fd2f154ce91352e58",
"score": "0.57448727",
"text": "def get_object\n json_obj = JSON.parse(@parse_result.json, @json_option)\n parsed_object = {\n \"regex\" => json_obj,\n \"source\" => @options[:reg_source]\n }\n TstLog(\"JSON param:\\n\" + JSON.pretty_generate(parsed_object, @json_option))\n parsed_object\n end",
"title": ""
},
{
"docid": "e808e2b7a7714f9147d8310e882f2a5d",
"score": "0.56869346",
"text": "def process_json_data jd\n\tjd.each do |gk, hash|\n\t\thash['subproducts'].each do |prod|\n\t\t\troot = get_root prod['machine_name']\n\t\t\tprod['downloads'].each do |dd|\n\t\t\t\ttype = dd['platform']\n\t\t\t\tsavepath = File.join(root, type)\n\t\t\t\t$dirs << savepath\n\t\t\t\tdd['download_struct'].each do |ds|\n\t\t\t\t\tsha1 = ds['sha1']\n\t\t\t\t\tmd5 = ds['md5']\n\t\t\t\t\tts = ds['timestamp']\n\t\t\t\t\tif ds['url']\n\t\t\t\t\t\tlink = ds['url']['web']\n\t\t\t\t\t\tbtlink = ds['url']['bittorrent']\n\t\t\t\t\t\tbtlink = nil if btlink and btlink.empty?\n\t\t\t\t\t\tdl = true\n\t\t\t\t\telsif (link = ds['external_link'])\n\t\t\t\t\t\t# TODO only announce once per external link\n\t\t\t\t\t\tSTDERR.puts \"# No automatic downloads for #{savepath}, go to #{link}\"\n\t\t\t\t\t\tdl = false\n\t\t\t\t\tend\n\t\t\t\t\tif dl\n\t\t\t\t\t\tfname = File.basename(link).sub(/\\?(key|ttl)=.*/,'')\n\t\t\t\t\t\tfkey = fname.intern\n\t\t\t\t\t\t# TODO use sha1\n\t\t\t\t\t\t$files[fkey] << Game.new(fname, md5, savepath, link, btlink)#, ts)\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\tend\nend",
"title": ""
},
{
"docid": "aa3321ce1e3d141b610ea23a02dd119b",
"score": "0.56587744",
"text": "def process_json_data jd\n\tjd.each do |gk, hash|\n\t\thash['subproducts'].each do |prod|\n\t\t\troot = get_root prod['machine_name']\n\t\t\tprod['downloads'].each do |dd|\n\t\t\t\ttype = dd['platform']\n\t\t\t\tsavepath = File.join(root, type)\n\t\t\t\t$dirs << savepath\n\t\t\t\tdd['download_struct'].each do |ds|\n\t\t\t\t\tsha1 = ds['sha1']\n\t\t\t\t\tmd5 = ds['md5']\n\t\t\t\t\tts = ds['timestamp']\n\t\t\t\t\tif ds['url']\n\t\t\t\t\t\tlink = ds['url']['web']\n\t\t\t\t\t\tbtlink = ds['url']['bittorrent']\n\t\t\t\t\t\tbtlink = nil if btlink and btlink.empty?\n\t\t\t\t\t\tdl = true\n\t\t\t\t\telsif (link = ds['external_link'])\n\t\t\t\t\t\t# TODO only announce once per external link\n\t\t\t\t\t\tSTDERR.puts \"# No automatic downloads for #{savepath} (#{ds['name']}), go to #{link}\"\n\t\t\t\t\t\tdl = false\n\t\t\t\t\tend\n\t\t\t\t\tif dl\n\t\t\t\t\t\tfname = get_filename link\n\t\t\t\t\t\tfkey = fname.intern\n\t\t\t\t\t\t# TODO use sha1\n\t\t\t\t\t\t$files[fkey] << Game.new(fname, md5, savepath, link, btlink)#, ts)\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\tend\nend",
"title": ""
},
{
"docid": "fea953fdefb83265b090d79a0c77350b",
"score": "0.55798393",
"text": "def processJSON(source, json)\n # Grab the array from dc:collection\n dcCollection = json['dc:collection']\n # Grab the skos block\n skosCollection = json['skos:ConceptScheme']['skos:Collection']\n # Convert that array to an array of strings\n data = dcCollection.collect { |dict|\n \" score: #{dict['primal:contentScore']}\\n\" +\n \" title: #{dict['dc:title']}\\n\" +\n \" subjects: #{getSubjectTags(dict, skosCollection)}\\n\" +\n \" link: #{dict['dc:identifier']}\\n\\n\"\n }\n puts \"From #{source}:\"\n puts data\n # Return the top scoring item's first subject\n if dcCollection.first['dc:subject']\n dcCollection.first['dc:subject'].first\n else\n \"\"\n end\nend",
"title": ""
},
{
"docid": "9d3a79ea2b087690082cd6898f76fdfa",
"score": "0.55439484",
"text": "def load_from_json(filename); end",
"title": ""
},
{
"docid": "ed4e80851c6b0e0638de61fd79717635",
"score": "0.55246025",
"text": "def load_json(filename); end",
"title": ""
},
{
"docid": "7c961f4292ff45b2de3f00cd4edbf5cc",
"score": "0.550435",
"text": "def copy_records\n File.read(\"data/copy.json\")\n end",
"title": ""
},
{
"docid": "ba4385af5decf30c07ba10cea06bc1e8",
"score": "0.54979783",
"text": "def parse_json\n matchers = JSON_PATTERN.match(script_content)\n return unless matchers\n\n matchers[:obj].scan(JSON_GROUP_PATTERN).each do |group|\n @data[json_key_alias(group.first)] = eval_json_value(group.last)\n end\n end",
"title": ""
},
{
"docid": "536e8861eaeff70f7b0230e29fced540",
"score": "0.548256",
"text": "def parse_json(filename)\n debug_trace(\"Parsing JSON #{filename}.json\")\n data = JSON.load(IO.read(\"#{$source_dir}#{filename}.json\"))\n\n if !data[\"version\"] || data[\"version\"] < ($data_version - 1)\n abort_msg(\"Outdated JSON file #{filename}.json\", nil)\n end\n\n if data[\"version\"] >= $data_version\n error_msg(\"File #{filename}.json has already been processed.\", nil)\n $skipped_json_filenames.push(filename)\n return nil\n end\n\n data[\"version\"] = $data_version\n return data\nend",
"title": ""
},
{
"docid": "4357c6ee484dbdd7459bececa2db90a5",
"score": "0.5479747",
"text": "def sim_receive_bridge_to(json)\r\n\r\n end",
"title": ""
},
{
"docid": "3f33d2a06215ea8bf39b9ab4c1dfb744",
"score": "0.54753613",
"text": "def initialize\n @destinations = JSON.parse(read_destination)\n new_destinations\n end",
"title": ""
},
{
"docid": "ee1741480d47262b98c49d5b2d5b6411",
"score": "0.5472199",
"text": "def test_Json_to_file\n b = Basquet.new\n b.add( 'Aalistair')\n b.add( 'Alistai')\n FlatFileAdapter.new.push_to_file(JsonProducer.new.to_json(b.gimmeAll))\n end",
"title": ""
},
{
"docid": "4c1184ae6979475c9ccf4ef8fdecc18c",
"score": "0.5462614",
"text": "def parse_json(con, json, dt, forg, frepo)\n h = JSON.parse json\n f = 0\n e = 0\n full_name = h['repo']['name']\n if repo_hit(full_name, forg, frepo)\n eid = h['id']\n if $json_out\n prt = JSON.pretty_generate(h)\n ofn = \"jsons/#{dt.to_i}_#{eid}.json\"\n File.write ofn, prt\n end\n if $db_out\n $ev[Thread.current.object_id] = h\n e = write_to_pg(con, h)\n $ev.delete(Thread.current.object_id)\n end\n puts \"Processed: '#{dt}' event: #{eid}\" if $debug >= 1\n f = 1\n end\n [f, e]\nend",
"title": ""
},
{
"docid": "aa80c0879af9850eed4cc8e58142cb8c",
"score": "0.5459683",
"text": "def parse_clip(clip)\n download_clip(\n clip['url'],\n \"downloads/#{slug(clip['game'].to_s.strip)}/#{clip['views']}-#{clip['curator']['display_name']}-#{clip['slug']}\"\n ) if DOWNLOAD\n\n FileUtils.mkdir_p \"downloads/#{slug(clip['game'].to_s.strip)}\"\n File.write(\"downloads/#{slug(clip['game'].to_s.strip)}/#{clip['views']}-#{clip['curator']['display_name']}-#{clip['slug']}.json\", clip.to_json)\nend",
"title": ""
},
{
"docid": "a0a13106ed5b2b7c12a2ebd593f28fd8",
"score": "0.5453451",
"text": "def entry\n JSON.parse(@output.string)\n end",
"title": ""
},
{
"docid": "24726e1c9c30efbc1920305940fe1b3b",
"score": "0.54516405",
"text": "def json_data; end",
"title": ""
},
{
"docid": "c64127c6f3122533cc28fed136406fec",
"score": "0.5445574",
"text": "def postprocessing\n # change the resulting @json object here\n end",
"title": ""
},
{
"docid": "579db41594fc16a2208fbd63930628b9",
"score": "0.5438921",
"text": "def dump\n @dump = params\n s = Setting.where(:use => true).first\n # curl -o sampledump1090data.json http://piaware.local:8080/dump1090/data.json\n# curl -X POST -d @sampledump1090data.json -H \"Content-type: application/json\" --user user:secret http://localhost:3000/dump1090hook.json\n #json sample {\"hex\":\"a82903\",\"squawk\":\"6634\",\"flight\":\"\",\"lat\":0.0,\"lon\":0.0,\"validposition\":0,\"altitude\":10550,\"vert_rate\":0,\"track\":0,\"validtrack\":0,\"speed\":0,\"messages\":181,\"seen\":0,\"mlat\":false}\n planedata = p params[\"_json\"]\n\n Airplane.delete_all\n\n planedata.each do |a|\n if a['validposition'] == 1\n if a['seen'] < 60\n\n na = Airplane.new\n logger.info a[\"hex\"]\n na.hex = a[\"hex\"]\n na.sqawk = a[\"squak\"]\n na.flight = a[\"flight\"]\n na.lat= a[\"lat\"]\n na.lon = a[\"lon\"]\n na.validposition = a[\"validposition\"]\n na.altitude = a[\"altitude\"]\n na.vert_rate = a[\"vert_rate\"]\n na.track = a[\"track\"]\n na.validtrack = a[\"validtrack\"]\n na.speed = a[\"speed\"]\n na.messages = a[\"messages\"]\n na.seen = a[\"seen\"]\n na.mlat = a[\"mlat\"]\n\n distance = Haversine.distance(na.lat, na.lon, s.originlat, s.originlon)\n\n na.range = distance.to_miles\n na.save\n\n na.save\n\n #record if plan is in view\n na.is_inview = na.inview\n na.save\n\n end\n end\n end\n\n\n render json: @dump\n end",
"title": ""
},
{
"docid": "39e61204f929eb01c0f2f7784e8888b5",
"score": "0.54379934",
"text": "def read_har(fname)\n JSON.parse File.read(fname)\nend",
"title": ""
},
{
"docid": "82087fd15a5df8847b49a21ecc925b79",
"score": "0.5430034",
"text": "def getdata filename\n JSON.parse(File.read(filename))\nend",
"title": ""
},
{
"docid": "affa37d628a9720378d7f216cb9bbbb0",
"score": "0.54164714",
"text": "def read_fourup_json\n JSON.parse(File.read(File.join(Rails.root,'app','assets','4ups','4up2.json')))\n end",
"title": ""
},
{
"docid": "d6a57b9b6992b0f62b7c61e6ff498795",
"score": "0.5413926",
"text": "def json(url)\n @driver.goto url\n source = @driver.page_source\n md = source.match(%r{<pre.*?>(.*)<\\/pre>})\n json = md[1]\n data = Yajl::Parser.new.parse(json)\nend",
"title": ""
},
{
"docid": "fbaabd9cec75741dd2bfc4512c73a570",
"score": "0.5401338",
"text": "def processJSON(json)\n # Grab the array from dc:collection\n dcCollection = json['dc:collection']\n # Grab the skos block\n skosCollection = json['skos:ConceptScheme']['skos:Collection']\n # Convert the JSON into an array of dictionaries that we can present to\n # the user\n dcCollection.collect { |dict|\n {\n :score => dict['primal:contentScore'],\n :title => dict['dc:title'],\n :link => dict['dc:relation'],\n :subjects => getSubjectTags(dict, skosCollection)\n }\n }.reverse # orders it by reverse score so that the best stuff is at the\n # bottom. It'll look better for the user so that they don't have to\n # scroll up\nend",
"title": ""
},
{
"docid": "f1c8dad88312c5302515d47868276d41",
"score": "0.53963065",
"text": "def extract_datas_from_json(path)\n file = File.read(path)\n data_details = JSON.parse(file)\n return data_details\nend",
"title": ""
},
{
"docid": "f1c8dad88312c5302515d47868276d41",
"score": "0.53963065",
"text": "def extract_datas_from_json(path)\n file = File.read(path)\n data_details = JSON.parse(file)\n return data_details\nend",
"title": ""
},
{
"docid": "f1c8dad88312c5302515d47868276d41",
"score": "0.53963065",
"text": "def extract_datas_from_json(path)\n file = File.read(path)\n data_details = JSON.parse(file)\n return data_details\nend",
"title": ""
},
{
"docid": "1a3deb71360af24cb18b18f37c540998",
"score": "0.53931993",
"text": "def copy_to_file\n # Write data to the file.\n unless File.directory?(file_directory)\n FileUtils.mkdir_p(file_directory)\n end\n\n if !json.blank?\n\n tmp = JSON.parse(json)\n logger.fatal \"THIS IS THE JSON COMING IN \"\n logger.fatal tmp.inspect \n logger.fatal tmp.class \n\n\n xpdl = XmlSimple.xml_out tmp, {'RootName' => 'Package'}\n end\n File.open(file_name, 'w') { |file| file.write( xpdl ) }\n end",
"title": ""
},
{
"docid": "90b81192d61a5f48cfc32e0db4b1293e",
"score": "0.5387072",
"text": "def process_json_args(args = {})\n @tmp_json_file = Tempfile.new('razor_json')\n json = args.to_pson\n @tmp_json_file.write(json)\n @tmp_json_file.close\n \"--json #{@tmp_json_file.path}\"\n end",
"title": ""
},
{
"docid": "90b81192d61a5f48cfc32e0db4b1293e",
"score": "0.5387072",
"text": "def process_json_args(args = {})\n @tmp_json_file = Tempfile.new('razor_json')\n json = args.to_pson\n @tmp_json_file.write(json)\n @tmp_json_file.close\n \"--json #{@tmp_json_file.path}\"\n end",
"title": ""
},
{
"docid": "b7af3296fc64c68807bde3146c70c257",
"score": "0.5381162",
"text": "def from_json(string)\n\tdata = JSON.parse(string)\n\t@target = data[\"target\"]\n\t@used_letters = data[\"used_letters\"]\n\t@turn_count = data[\"turn_count\"]\n\t@current_display = data[\"current_display\"]\nend",
"title": ""
},
{
"docid": "a5666c039cfd68fa31363317f4dcdf5d",
"score": "0.53754336",
"text": "def test_load_and_dump_json\n assert_load_and_dump( :json ) \n end",
"title": ""
},
{
"docid": "3e700391b98cee7b146114eebe1ff9d9",
"score": "0.53682244",
"text": "def make_json(events, json_fname, query_str, from_jd, to_jd, cover_img_url)\n # Make nice looking main frame for the timeline\n # Drop the tokens begining with '@'\n headline_str = query_str.split.delete_if {|t| t[0] == '@'}.join(' ')\n headline = ActiveSupport::JSON.encode(headline_str.titlecase)\n if (from_jd.nil? or to_jd.nil?)\n text = \" \"\n else\n text = \"Events from \" + Date.jd(from_jd).strftime(\"%d %b %Y\") + \" - \" +\n Date.jd(to_jd).strftime(\"%d %b %Y\")\n end\n \n title_img_url = nil;\n if !cover_img_url.nil? && !cover_img_url.blank?\n title_img_url = URI::encode(cover_img_url)\n end\n\n header_json = <<END\n{\"timeline\":\n {\n \"headline\":#{headline},\n \"headImgUrl\":\"#{title_img_url}\",\n \"type\":\"default\",\n \"startDate\":\"2011,9,1\",\n \"text\":\"#{text}\",\n \"date\": [\nEND\n\n date_json_array = []\n events.each do |e|\n d = Date.jd(e.jd).strftime(\"%m/%d/%Y\")\n text = e.desc.blank? ? \" \" : e.desc\n text = ActiveSupport::JSON.encode(text)\n title = ActiveSupport::JSON.encode(e.title)\n media_url = e.url\n media_caption = e.url\n cur_imgurl = nil\n if !e.imgurl.nil? && !e.imgurl.blank?\n cur_imgurl = URI::encode(e.imgurl)\n end\n\n date_json = <<END\n {\n \"startDate\":\"#{d}\",\n \"headline\":#{title},\n \"text\":#{text},\n \"id\":\"#{e.id}\",\n \"importance\":\"#{e.importance}\",\n \"imgurl\":\"#{cur_imgurl}\",\n \"asset\":\n {\n \"media\":\"#{media_url}\",\n \"credit\":\"\",\n \"caption\":\"#{media_caption}\"\n }\n }\nEND\n date_json_array.push(date_json)\n end\n all_date_json = date_json_array.join(\",\\n\")\n \n footer_json = <<END\n ]\n }\n}\nEND\n \n File.open(json_fname, \"w\") do |f|\n f.puts(header_json)\n f.puts(all_date_json)\n f.puts(footer_json)\n end\n end",
"title": ""
},
{
"docid": "f49490b89bfa9797367dfd2bde0f9c09",
"score": "0.5363918",
"text": "def loadJsonDataAreaScanning(inputname)\n #need to check filename if it was json file\n filename = File.join(Rails.root, 'public','uploads', 'scores','areascanning','origin', inputname) \n f=File.read(filename) \n f_hash = JSON.parse(f) \n\t\td_hash=calculateMaxDistance(f_hash)\n done=generateJsonFile(d_hash)\n return done\n end",
"title": ""
},
{
"docid": "907689e74a56b477cb28f5cc385c6d01",
"score": "0.535669",
"text": "def test_activities\n get '/resume/activities'\n assert last_response.ok?\n source = YAML.load(File.open('resume.yml'))['extra-curricular']\n resp = JSON.load(last_response.body)\n assert_equal source, resp\n end",
"title": ""
},
{
"docid": "77e798a9e82fd9e97faa8c3d569daee6",
"score": "0.53413266",
"text": "def from_json(json, save_cache = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "ebb8e895d9e2c86bb9960a7cf1dcae6a",
"score": "0.53347576",
"text": "def parse(json)\n JsonW::Parser.new.parse(json)\n end",
"title": ""
},
{
"docid": "2a2e60d9073f1a9a44dabe8a5a93bc88",
"score": "0.53319496",
"text": "def get_results(response)\n File.write(\"new_videos.json\",response.to_json)\n puts response.to_json\nend",
"title": ""
},
{
"docid": "f7bd45b7d02c67bdfd3cf2b29bc593c6",
"score": "0.5328127",
"text": "def from_json(json)\n timeline = Timeline.new\n last_was_direct = false\n if json.is_a? String\n data = JSON.parse(json, {symbolize_names: true})\n elsif json.is_a? Hash\n data = json\n else\n raise \"I don't know what!\"\n end\n data[:period].each do |period|\n p = Period.new(\"\",period)\n if last_was_direct \n timeline.insert_direct(p)\n else\n timeline.insert(p)\n end\n begin\n last_was_direct = period[:direct_transfer].to_bool\n rescue => e\n puts \"-----\"\n puts e\n puts \"--\"\n puts period\n puts \" ----- \"\n end\n end\n return self.extract(timeline.provenance) \n end",
"title": ""
},
{
"docid": "99aa72f4dcb7c9290533d859e1be9d00",
"score": "0.53215915",
"text": "def convert_json(path, suffix=\"\", allow_dupe_keys=false)\n dst = path.gsub(\".txt\", suffix + \".json\")\n\n contents = IO.read(path)\n VDF_PATCHES.each do |re, repl|\n contents.gsub!(re, repl)\n end\n\n # Allow duplicate keys in items_game.txt, disallow them in others\n vdf = VDF.new(contents, allow_dupe_keys)\n\n json = JSON.pretty_generate(vdf.kvs)\n File.open(dst, \"w\") {|f| f.write(json) }\nrescue => ex\n puts \"Unable to convert #{path} to JSON: #{ex}\"\nend",
"title": ""
},
{
"docid": "59980dbc8f9db0d09b53b295a658fd97",
"score": "0.5305535",
"text": "def convert_json\n File.open(\"./db/townhall.json\",\"w\") do |f|\n f.write(@result.to_json)\n end\n puts \"Le scrapping est dans le json\"\n end",
"title": ""
},
{
"docid": "39916789dfb82cf303c197d444124808",
"score": "0.53052706",
"text": "def parse(json)\n ret = []\n json['trips'].each do |trip| \n trip['trip']['legs'].each do |leg|\n current_trip = {}\n current_trip[:name] = leg['points'][0]['name'] \n current_trip[:time] = leg['points'][0]['dateTime']['time']\n current_trip[:line] = leg['mode']['name']\n current_trip[:dest] = \"#{leg['points'][1]['name']} -> #{leg['mode']['destination']}\"\n ret << current_trip\n end\n #puts JSON.pretty_generate(trip['trip']['legs'][0]['mode'])\n end\n return ret\n end",
"title": ""
},
{
"docid": "5b0fd334e05786a6f022d023660f3b07",
"score": "0.5304987",
"text": "def decode file,opts={}\n check file\n str = DECODER\n # not for now .. maybe find solution to avoid decoding all before \n ##str += \" --allowed=#{@records_allowed.join(',')} \" unless @records_allowed.empty?\n str += \"\\\"#{file.full_path}\\\"\"\n puts \"Command : #{str}\" if opts[:v]\n out = exec_cmd(str) \n out2json(out)\n end",
"title": ""
},
{
"docid": "3ab9b2d640ec941e0ffa9cdf39d3861e",
"score": "0.53033465",
"text": "def home\n @result = JSON.parse(open())\n end",
"title": ""
},
{
"docid": "9704ba931f6b61cb6bc3ff83ab502ba5",
"score": "0.5298772",
"text": "def extractJson(tag, time, record)\n\n message = record[\"message\"];\n\n begin\n json = JSON.parse(message);\n rescue\n return record; # Looks like the message isn't JSON after all.\n end\n \n record[\"json\"] = message; # Persist the original structured JSON\n\n if json.key?(\"message\")\n record[\"message\"] = json[\"message\"];\n elsif json.key?(\"msg\")\n record[\"message\"] = json[\"msg\"];\n end\n\n if json.key?(\"level\")\n record[\"level\"] = normalizeLevel(json[\"level\"]);\n else\n record[\"level\"] = \"other\";\n end\n\n # Handle timestamps\n\n begin\n\n date = nil;\n if json.key?(\"@timestamp\")\n date = json[\"@timestamp\"];\n elsif json.key?(\"timestamp\")\n date = json[\"timestamp\"];\n elsif json.key?(\"ts\")\n date = json[\"ts\"]\n end\n\n if !date.nil?\n if isNumeric(date)\n record[\"@timestamp\"] = formatTimestamp(Time.at(date.to_f));\n else\n record[\"@timestamp\"] = formatTimestamp(Time.parse(date));\n end\n else\n # Use the Fluentd injestion time.\n record[\"@timestamp\"] = formatTimestamp(Time.at(time));\n end\n \n return record;\n\n rescue\n\n # Handle any parsing errors by recording the Fluentd injestion time.\n\n record[\"@timestamp\"] = formatTimestamp(Time.at(time));\n return record;\n end\n end",
"title": ""
},
{
"docid": "fdec35f67f98ac31285d7ec6d9f3edfd",
"score": "0.52946156",
"text": "def on_postbuild(src_topdir, dst_tree, converter)\n search_topdir = dst_tree.pathname / SEARCH_ASSET_DIRNAME\n\n # store the JSON file\n serialize_section_index(search_topdir, search_topdir)\n end",
"title": ""
},
{
"docid": "5d1fea4a637cae3dfd171ea9f1997be7",
"score": "0.5288418",
"text": "def parse_content\n self.data = self.raw_json[\"TestableSummaries\"].collect do |testable_summary|\n summary_row = {\n project_path: testable_summary[\"ProjectPath\"],\n target_name: testable_summary[\"TargetName\"],\n test_name: testable_summary[\"TestName\"],\n duration: testable_summary[\"Tests\"].map { |current_test| current_test[\"Duration\"] }.inject(:+),\n tests: unfold_tests(testable_summary[\"Tests\"]).collect do |current_test|\n current_row = {\n identifier: current_test[\"TestIdentifier\"],\n test_group: current_test[\"TestIdentifier\"].split(\"/\")[0..-2].join(\".\"),\n name: current_test[\"TestName\"],\n object_class: current_test[\"TestObjectClass\"],\n status: current_test[\"TestStatus\"],\n guid: current_test[\"TestSummaryGUID\"],\n duration: current_test[\"Duration\"]\n }\n if current_test[\"FailureSummaries\"]\n current_row[:failures] = current_test[\"FailureSummaries\"].collect do |current_failure|\n {\n file_name: current_failure['FileName'],\n line_number: current_failure['LineNumber'],\n message: current_failure['Message'],\n performance_failure: current_failure['PerformanceFailure'],\n failure_message: \"#{current_failure['Message']} (#{current_failure['FileName']}:#{current_failure['LineNumber']})\"\n }\n end\n end\n current_row\n end\n }\n summary_row[:number_of_tests] = summary_row[:tests].count\n summary_row[:number_of_failures] = summary_row[:tests].find_all { |a| (a[:failures] || []).count > 0 }.count\n summary_row\n end\n self.data.first[:run_destination_name] = self.raw_json[\"RunDestination\"][\"Name\"]\n return self.data\n end",
"title": ""
},
{
"docid": "e4f8e6ede6857924ad767c52b967fcdf",
"score": "0.5274632",
"text": "def parse_ytemp (oy)\n\t\tJSON.parse(oy)\n\tend",
"title": ""
},
{
"docid": "904b528c3f77e0d0469c1a54e49bcb41",
"score": "0.5269969",
"text": "def as_json\n {\n\t #sir trevor's default field names for video block must be used\n type: :video,\n data:\n {\n source: source,\n remote_id: video_id,\n url: direct_url\n }\n }\n end",
"title": ""
},
{
"docid": "cb3e93e1fbeb69895441fdf53b0836f2",
"score": "0.52651954",
"text": "def push_url(url, result) # <- live out\n out = {}\n result.each_with_index.map do |v,i|\n field = @cpfs[ v[:field_id] ]\n\n if !field[:setting].nil? && field[:setting][:download] == \"true\"\n str = \"https://pbender.ru\" + v[:result_text]\n else\n str = v[:result_text]\n end\n\n case field[:otype]\n when \"text\"\n out[field[:name]] = str\n when \"html\"\n out[field[:name]] = str\n when \"attr\"\n out[field[:name]] = str\n when \"array\"\n out[field[:name]] = v[:result_arr ]\n when \"array_attr\"\n out[field[:name]] = v[:result_arr ]\n else\n #out << \"-\" \n end\n end\n\n body = false\n begin\n body = HTTParty.post(\n \"#{setting_field('url')}\", \n body: {\n key: setting_field('key'),\n url: url,\n fields: out\n }\n ).body\n\n json = JSON.parse(body)\n rescue Exception => e\n puts e.message.colorize(:red)\n if !body\n body = 'Pre initialize HTTParty'\n end\n end\n\n #dev!\n \n if json.nil?\n puts body.colorize(:red)\n elsif !json.nil? && json['success'] == false\n puts json.to_json.colorize(:yellow)\n elsif !json.nil? && json['success'] == true\n puts json.to_json.colorize(:green)\n else\n puts json.to_json.colorize(:red)\n #не может быть\n end\n\n\n\n end",
"title": ""
},
{
"docid": "d3289d48b0128d3f41a521971a21def5",
"score": "0.5264932",
"text": "def convert_json_to_yaml(json) #:nodoc:\r\n scanner, quoting, marks, pos, times = StringScanner.new(json), false, [], nil, []\r\n while scanner.scan_until(/(\\\\['\"]|['\":,\\\\]|\\\\.)/)\r\n case char = scanner[1]\r\n when '\"', \"'\"\r\n if !quoting\r\n quoting = char\r\n pos = scanner.pos\r\n elsif quoting == char\r\n if json[pos..scanner.pos-2] =~ DATE_REGEX\r\n # found a date, track the exact positions of the quotes so we can remove them later.\r\n # oh, and increment them for each current mark, each one is an extra padded space that bumps\r\n # the position in the final YAML output\r\n total_marks = marks.size\r\n times << pos+total_marks << scanner.pos+total_marks\r\n end\r\n quoting = false\r\n end\r\n when \":\",\",\"\r\n marks << scanner.pos - 1 unless quoting\r\n end\r\n end\r\n\r\n if marks.empty?\r\n json.gsub(/\\\\([\\\\\\/]|u[[:xdigit:]]{4})/) do\r\n ustr = $1\r\n if ustr.starts_with?('u')\r\n [ustr[1..-1].to_i(16)].pack(\"U\")\r\n elsif ustr == '\\\\'\r\n '\\\\\\\\'\r\n else\r\n ustr\r\n end\r\n end\r\n else\r\n left_pos = [-1].push(*marks)\r\n right_pos = marks << scanner.pos + scanner.rest_size\r\n output = []\r\n left_pos.each_with_index do |left, i|\r\n scanner.pos = left.succ\r\n output << scanner.peek(right_pos[i] - scanner.pos + 1).gsub(/\\\\([\\\\\\/]|u[[:xdigit:]]{4})/) do\r\n ustr = $1\r\n if ustr.starts_with?('u')\r\n [ustr[1..-1].to_i(16)].pack(\"U\")\r\n elsif ustr == '\\\\'\r\n '\\\\\\\\'\r\n else\r\n ustr\r\n end\r\n end\r\n end\r\n output = output * \" \"\r\n \r\n times.each { |i| output[i-1] = ' ' }\r\n output.gsub!(/\\\\\\//, '/')\r\n output\r\n end\r\n end",
"title": ""
},
{
"docid": "cf9f077200c5e7624c442ad28969b23e",
"score": "0.52638745",
"text": "def pass\r\n\r\n file = params[:file]\r\n file_name = file.original_filename\r\n puts \"filename = #{file_name}\"\r\n\r\n perms = ['.json']\r\n\r\n if !perms.include?(File.extname(file_name).downcase)\r\n result = 'only can use json file'\r\n puts \"#{result}\"\r\n else\r\n file_data = File.read(file.tempfile)\r\n File.open(\"public/docs/json/#{file_name}\",'wb') { |f| f.write(file.read) }\r\n con=Convert.new\r\n csp_data = con.convert(file_data)\r\n puts \"success convert \"\r\n csp_place = \"public/docs/csp/#{File.basename(file_name,\".json\")}.csp\"\r\n File.open(\"#{csp_place}\",'wb') { |f| f.write(csp_data) }\r\n\r\n #test\r\n\t p \"domain => #{csp_data[:vars].dup[:_16]}\"\r\n\r\n\t #testend\r\n\r\n puts \"test4\"\r\n #puts \"src= #{SRC.class}\"\r\n\r\n solver = SolverPass.new\r\n puts \"src= #{solver.class}\"\r\n #csp_place = \"../../public/docs/csp/ise2_1.csp\"\r\n solver.pass(csp_place)\r\n puts \"test5\"\r\n #load (Rails.root + 'app/controllers/test.rb').to_s\r\n result = 'ok!'\r\n puts \"#{result}\"\r\n\r\n end\r\n\r\n end",
"title": ""
},
{
"docid": "57205ad3de5f239d136085d6f956dd3f",
"score": "0.5263553",
"text": "def validate\n Epic::Validator::JSON.new.validate(destination_path)\n end",
"title": ""
},
{
"docid": "57205ad3de5f239d136085d6f956dd3f",
"score": "0.5263553",
"text": "def validate\n Epic::Validator::JSON.new.validate(destination_path)\n end",
"title": ""
},
{
"docid": "41bc56286e760280138329dab4e3d7c5",
"score": "0.5257218",
"text": "def load(context, filename)\n www_directory = context.dashboard_config['www-directory']\n\n path=\"#{www_directory}/json-data/#{filename}.json\"\n\n if(File.exists?(path))\n txt=File.read(path)\n return JSON.parse(txt)\n else\n return nil\n end\nend",
"title": ""
},
{
"docid": "2bf264e663aa259b7a5eb16a13a3cf65",
"score": "0.5239579",
"text": "def swapi_fetch(url)\n JSON.parse(URI.open(url).read)\nend",
"title": ""
},
{
"docid": "2bf264e663aa259b7a5eb16a13a3cf65",
"score": "0.5239579",
"text": "def swapi_fetch(url)\n JSON.parse(URI.open(url).read)\nend",
"title": ""
},
{
"docid": "e885db8d3115c2ebb2adb462be5568ea",
"score": "0.5235928",
"text": "def jsondata\n json = File.read('/home/ubuntu/workspace/test/models/data.json').to_s\n obj = JSON.parse(json)\n #puts obj.to_json\n puts obj['Cuisine']\n \n end",
"title": ""
},
{
"docid": "04d6858dd1f8c99f8791e829d01a714d",
"score": "0.521753",
"text": "def test\n\n @url_data_model = UrlDataModel.find(params[:id])\n temp = PdfDataModelSerializer.new(@url_data_model).serialized_json\n temp.strip!\n temp[temp.size() - 2] = \"]\"\n temp.gsub!(\"address\", \"url\")\n temp.gsub!(\"\\\"nil\\\"\", \"null\")\n temp = removeAllBackslashesFromString(temp)\n temp = addInfo(temp)\n temp = removeDataAndID(temp)\n temp.gsub!(\"\\\":\", \"\\\": \")\n temp = addNewlineAndCarriageReturn(temp)\n temp.gsub!(\"producer\", \"Producer\")\n temp.gsub!(\"title\", \"Title\")\n temp.strip!\n temp[temp.size() - 2] = \"\"\n @json_string = temp\n\n end",
"title": ""
},
{
"docid": "c8c693bacdc237111510f3fd4893b450",
"score": "0.5212235",
"text": "def get_gha_json(dt, forg, frepo)\n con = conn\n fn = dt.strftime('http://data.githubarchive.org/%Y-%m-%d-%k.json.gz').sub(' ', '')\n puts \"Working on: #{fn}\"\n n = f = e = 0\n $dts[Thread.current.object_id] = dt\n open(fn, 'rb') do |json_tmp_file|\n puts \"Opened: #{fn}\"\n jsons = Zlib::GzipReader.new(json_tmp_file).read\n puts \"Decompressed: #{fn}\"\n jsons = jsons.split(\"\\n\")\n puts \"Splitted: #{fn}\"\n jsons.each do |json|\n r = parse_json(con, json, dt, forg, frepo)\n n += 1\n f += r[0]\n e += r[1]\n end\n end\n $dts.delete(Thread.current.object_id)\n puts \"Parsed: #{fn}: #{n} JSONs, found #{f} matching, events #{e}\"\nrescue OpenURI::HTTPError => e\n puts \"No data yet for #{dt}\"\nrescue Zlib::GzipFile::Error, Zlib::DataError => e\n puts 'Gzip decompression exception:'\n puts e.message\n p \"Date: #{dt}\"\nrescue => e\n puts 'General exception:'\n puts e.message\n p \"Date: #{dt}\"\n p $dts\n raise e\nensure\n con&.close\nend",
"title": ""
},
{
"docid": "666b4499933875c6088ef5db14a09bdf",
"score": "0.5210446",
"text": "def route8\n json_data = params[:key]\n # Test the different ways the options hash can be passed\n options = { allow_blank: true, mode: :rails }\n object1 = Oj.load json_data, options\n object2 = Oj.load json_data, mode: :strict\n object3 = Oj.load json_data, :allow_blank => true, :mode => :compat\n\n # TODO: false positive; we aren't detecting flow from `:json` to the call argument.\n more_options = { allow_blank: true }\n more_options[:mode] = :json\n object4 = Oj.load json_data, more_options\n end",
"title": ""
},
{
"docid": "60e878926104b5b76ef02ae229646652",
"score": "0.5208424",
"text": "def decode(job)\n JSON.parse(job)\n end",
"title": ""
},
{
"docid": "45067bb7614e604f8d6709ff6ad05866",
"score": "0.52030945",
"text": "def json\n @input ||= JSON.parse File.read(file_path)\n end",
"title": ""
},
{
"docid": "6464bff73c8be64d8f98f5132f0faf6c",
"score": "0.51991683",
"text": "def decode json\n Yajl::Parser.parse json\n end",
"title": ""
},
{
"docid": "16b08b438f0157abd2d28f1bb764d73b",
"score": "0.51968503",
"text": "def processJSON(json)\n # Extract the dc:collection array\n dcCollection = json['dc:collection']\n \n # Extract the skos:Collection dictionary\n skosCollection = json['skos:ConceptScheme']['skos:Collection']\n \n data = dcCollection.collect { |dict|\n # Extract our needed information from the dictionary\n score = dict['primal:contentScore']\n title = dict['dc:title']\n link = dict['dc:relation']\n \n # Generated a list of tag names that matched the content\n tagNames = getSubjectTags(dict, skosCollection)\n \n # Grab the identifier links as well so that we can ask the\n # data service for more information about these subjects\n tagLinks = dict['dc:subject'].collect { |link|\n \" #{link}\"\n }.join(\"\\n\")\n \n # Create the string to be returned to 'data'\n \"#{title}\\n\" +\n \" Relevancy score: #{score}\\n\" +\n \" Link to source: #{link}\\n\" +\n \" Matched topics: #{tagNames}\\n\" +\n \" Matched topic links:\\n#{tagLinks}\\n\\n\"\n }\n \n puts data\nend",
"title": ""
},
{
"docid": "ca2de99f8cc46b3a45b52cf324700182",
"score": "0.5194788",
"text": "def merge (from, to, out)\r\n begin\r\n srcFile = open(from)\r\n destFile = open(to)\r\n srcJson = JSON.parse(srcFile.read)\r\n destJson = JSON.parse(destFile.read)\r\n outFile = File.new(out, 'w')\r\n\r\n\r\n srcJson.each do |feature|\r\n destJson.each do |destFeature|\r\n if feature['uri'].eql? destFeature['uri']\r\n feature['elements'].each do |scenario|\r\n counter = 0\r\n destFeature['elements'].each do |destScenario|\r\n if scenario['line'] == destScenario['line']\r\n\r\n # copy rerun result to result_merge only if rerun pass\r\n rerun_pass = true\r\n if scenario.has_key?('steps')\r\n scenario['steps'].each do |step|\r\n if step['result']['status'] == 'failed'\r\n rerun_pass = false\r\n break\r\n end\r\n end\r\n end\r\n\r\n destFeature['elements'][counter] = scenario if rerun_pass\r\n\r\n end\r\n counter += 1\r\n end\r\n end\r\n end\r\n end\r\n end\r\n\r\n outFile.puts JSON.dump destJson\r\n\r\n rescue\r\n ensure\r\n srcFile.close if !srcFile.nil?\r\n destFile.close if !destFile.nil?\r\n outFile.close if !outFile.nil?\r\n end\r\n\r\n\r\nend",
"title": ""
},
{
"docid": "56db0e229ac951e57b4e9e01ac17ba38",
"score": "0.5194501",
"text": "def swapi_fetch(url)\n JSON.parse(URI(url).read)\nend",
"title": ""
},
{
"docid": "47d9fffe36a4f2b53319f4f6f6c910e1",
"score": "0.51911813",
"text": "def prepare_json\n dna = config[:attributes].merge(:run_list => config[:run_list])\n\n info(\"Preparing dna.json\")\n debug(\"Creating dna.json from #{dna.inspect}\")\n\n File.open(File.join(sandbox_path, \"dna.json\"), \"wb\") do |file|\n file.write(dna.to_json)\n end\n end",
"title": ""
},
{
"docid": "eb5530950cc2677bea7f304ca4981bfa",
"score": "0.5188376",
"text": "def json_struct(filename)\n JSON.parse json_string(filename)\n end",
"title": ""
},
{
"docid": "7e25fbcb986ad200c5b40635bfabf202",
"score": "0.51862496",
"text": "def from_json(json)\n end",
"title": ""
},
{
"docid": "3f82f231792087b2e8cc2f9d54a853fd",
"score": "0.5179508",
"text": "def index_entry_as_json\n {\n :audio => audio_as_json,\n :id => basename,\n :json => json_path,\n :metadata => @metadata,\n :sheets => @sheets.map { |sheet| sheet[:metadata] },\n :sync => {\n :bpms => @bpms,\n :breaks => @breaks \n }\n }\n end",
"title": ""
},
{
"docid": "b4fd133f09417b6e3ac4f6765096c73e",
"score": "0.5179075",
"text": "def from_json(json_data)\n\t\th_temp = JSON.parse(json_data)\n\t\t@basePath = h_temp['basePath']\n\t\t@infoList = h_temp['infoList'].map { |fi|\n\t\t\t{\n\t\t\t\t:status => fi['status'],\n\t\t\t\t:action => fi['action'],\n\t\t\t\t:filename => fi['filename'],\n\t\t\t\t:path => fi['path'],\n\t\t\t\t:size => fi['size'],\n\t\t\t\t:checksum => fi['checksum']\n\t\t\t}\n\t\t}\n\tend",
"title": ""
},
{
"docid": "4d6b621faace8c0b0cd04be27074e2a2",
"score": "0.5178288",
"text": "def create\n #@model_datum = ModelDatum.new(model_datum_params)\n \n # フォームからファイルを受取り、my_dataフォルダ内に一時保存、\n # JSONファイルにコンバートした後、文字列を抜き出してDBに保存する。\n # ToDo:主要な処理をServiceオブジェクトへ移動する\n \n \n # アップロードされたファイルをmodel/my_dataに一時的に保存する\n file = params['model_datum']['file']# 指定されたファイルにアクセス\n defPath = \"/var/www/html/RailsTest/model/my_data/\"\n p(defPath + file.original_filename)\n \n of = File.open(defPath + file.original_filename, 'w')\n of.write(file.read)\n of.close\n \n # JSON形式に変換\n p(\"json export result : \")\n value = %x(python2.6 my_data/convert_to_threejs.py my_data/#{file.original_filename} my_data/#{file.original_filename}.js 2>&1)\n p(value)\n \n # 元ファイル削除\n p(\"deleting org file...\")\n value = %x(rm -f #{defPath}#{file.original_filename})\n p(value)\n \n # DBに文字列としてJSONファイルの内容を格納(JSONファイルに変換した後であることをよく確認)\n #file = open(defPath + params[:model_datum][:fileName])#old\n jsfile = open(defPath + file.original_filename + \".js\")\n @jsonstring = \"\"\n while line = jsfile.gets\n @jsonstring += line\n end\n \n @model_datum = ModelDatum.new(:modeldata => @jsonstring, :title => params[:model_datum][:title])\n \n p(\"form data:\")\n p(params[:model_datum][:texture])\n \n if params[:model_datum][:texture] != nil\n #@textures = Texture.new(:data => params.require(:model_datum).permit(:texture))\n #@textures = Texture.new(:data => params[:file])# みたいな形式でいいらしい\n #@textures = Texture.new(:data => params[:model_datum][:texture])\n #Paperclip::AdapterRegistry::NoHandlerError in ModelDataController#create\n @textures = Texture.new(:data => params[:model_datum][:texture]['data'])\n \n #@model_datum.textures.build\n @model_datum.textures << @textures\n p(\"variable @model_datum : \")\n #p(params[:model_datum][:texture])#in\n p(@model_datum.textures)\n end\n \n # saveしてDBへ保存\n respond_to do |format|\n #if @model_datum.save && @textures.save\n if @model_datum.save!\n format.html { redirect_to @model_datum, notice: 'Model datum was successfully created.' }\n format.json { render action: 'show', status: :created, location: @model_datum }\n else\n format.html { render action: 'new' }\n format.json { render json: @model_datum.errors, status: :unprocessable_entity }\n end\n end\n \n # JSON(.js)ファイル削除\n p(file)\n p(file.original_filename+\".js\")\n value = %x(rm -f #{defPath}#{file.original_filename}.js)\n p(\"deleting .js file...\")\n p(value)\n end",
"title": ""
},
{
"docid": "ea656c0abe696ed65458f6a9e0378e73",
"score": "0.5171526",
"text": "def get_json(value)\n \t source = \"lib/inputs/#{value}/#{value}.json\"\n file_read = File.read(source)\n \t@file = ActiveSupport::JSON.decode(file_read)[\"#{value}\"][\"array_preguntas\"][\"pregunta\"]\n init_trees(value)\n end",
"title": ""
},
{
"docid": "b14db91e2ce712fd9c384eed1ab87cf4",
"score": "0.51660347",
"text": "def media_as_json(media)\r\n\t\t@media_json = media.to_json({\r\n\t\t\t:include => {\r\n\t\t\t\t:formats => {\r\n\t\t\t\t\t:include => {\r\n\t\t\t\t\t\t:accepts_file => {:only => :mime}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t#:only => :id\r\n\t\t\t\t},\r\n\t\t\t\t:plugin => {\r\n\t\t\t\t\t:only => [:can_play_to_end, :requires_data, :file_path]\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t})\r\n\tend",
"title": ""
},
{
"docid": "09b535bd055774852b5589869f9d928f",
"score": "0.5163185",
"text": "def parse_json(json)\n MosEisley::S3PO.parse_json(json)\n end",
"title": ""
},
{
"docid": "5c4f9696594014f3d338cad1d43a48a9",
"score": "0.51569843",
"text": "def extract_json(src)\n result = ([] if src.blank?)\n result ||= (src unless src.is_a?(Hash))\n result ||= src[ERROR_TAG].presence\n result ||=\n Array.wrap(src['messages']).map { |msg|\n msg = msg.to_s.strip\n if msg =~ /^[a-z0-9_]+=/i\n next unless msg.delete_prefix!(\"#{ERROR_TAG}=\")\n end\n msg.remove(/\\\\\"/)\n }.compact_blank.presence\n result ||= src['message'].presence\n result ||= src.values.flat_map { |v| v if v.is_a?(Array) }\n Array.wrap(result || src).compact\n end",
"title": ""
},
{
"docid": "d334b5489aa2981d35b98b45310fd756",
"score": "0.5150308",
"text": "def parse_api(link)\n drink_data ={}\n drink_url_link = RestClient.get(link)\n drink_data = JSON.parse(drink_url_link)\n # binding.pry\nend",
"title": ""
},
{
"docid": "73eefc830787cacbe2fdc19130d9b378",
"score": "0.51418084",
"text": "def load_deck\n JSON.parse(File.read('cards.json'))\nend",
"title": ""
},
{
"docid": "22a39a1b52bfa8ed38a473afd1f1be21",
"score": "0.51395637",
"text": "def as_json(options = nil)\n {:id => id,\n :title => title,\n :description => description,\n :author => author.name,\n :poster => file(:poster).to_s,\n :sources => [ { :type => Mime::WEBM.to_s, :src => file(:webm).to_s },\n { :type => Mime::MP4.to_s, :src => file(:mp4).to_s },\n { :type => Mime::FLV.to_s, :src => file(:flv).to_s }\n ]\n }\n end",
"title": ""
},
{
"docid": "b79471db6901f867ca40c3b46dab44e3",
"score": "0.51387006",
"text": "def from_json json\n 'Implement Me!'\n end",
"title": ""
},
{
"docid": "d622dac52d9f73fbcef2932383cb1560",
"score": "0.5137507",
"text": "def parse_tapj_output\n @tapj_files.each do |f|\n File.open(f) do |io|\n io.each_line do |line|\n event = JSON.parse(line)\n case event[TAPJ_TYPE]\n when TAPJ_SUITE_TYPE, TAPJ_CASE_TYPE, TAPJ_TEST_TYPE\n yield event\n end\n end\n end\n end\n end",
"title": ""
},
{
"docid": "5285a36c7787417c5f1dc50508078f56",
"score": "0.5129727",
"text": "def read_json; read.from_json; end",
"title": ""
},
{
"docid": "93b604065caabde2a4c5348e8d913f15",
"score": "0.512757",
"text": "def save_json(cards: 1, data: {}, to: 'data/data.json')\n ''\nend",
"title": ""
},
{
"docid": "20de9a7b546e21a8916f925acb042499",
"score": "0.5125644",
"text": "def themoviedb_movie_search_parse_json(json_data)\n log(\"themoviedb_movie_search: json_data\") if $opt[\"debug\"]\n ap json_data if $opt[\"debug\"]\n return true, \"The Earth is caught in the middle of an intergalactic war between two races of robots,objects, including cars, trucks, planes and other technological creations.\"\nend",
"title": ""
},
{
"docid": "93f535e4bfa1f8d10b5e6902a004d2e0",
"score": "0.5121764",
"text": "def parse(resume)\n JSON.recurse_proc(resume, &decode_and_fetch_assets)\n end",
"title": ""
},
{
"docid": "506e64f92a7308b1ee19676412e183f0",
"score": "0.5120521",
"text": "def initialize(json)\n @json = JSON.parse(json).to_hash\n @url = @json['file_url']\n end",
"title": ""
},
{
"docid": "a4676b667282e286614deee583712c7f",
"score": "0.5119154",
"text": "def parse(json)\n raw_project = super(json)\n @project.name = raw_project[\"name\"]\n @project.body = raw_project[\"body\"]\n @project.body_show = raw_project[\"body_show\"]\n @project\n end",
"title": ""
}
] |
1f94ca749460a1a1b42e8bb4d4218ae7 | Saves the spec for the given pod into the spec repo. pod repo push REPO_NAME SPEC_NAME.podspec | [
{
"docid": "560b5aad3f72f9d01bafc689c2809293",
"score": "0.85310274",
"text": "def save_spec(pod)\n file_name = \"#{pod.name}.podspec.json\"\n File.open(file_name, 'w') { |file| file.write(\"#{pod.spec}\") }\n system(\"pod repo push #{$pod_repo_name} #{file_name}\")\n\n # Cleanup spec file\n FileUtils.rm(file_name)\nend",
"title": ""
}
] | [
{
"docid": "072bf14b0480c2c7f3cbe9d495c49c55",
"score": "0.65763843",
"text": "def store_podspec(name, podspec, _external_source = false, json = false)\n file_name = json ? \"#{name}.podspec.json\" : \"#{name}.podspec\"\n output_path = specifications_root + file_name\n\n spec =\n case podspec\n when String\n Sandbox.update_changed_file(output_path, podspec)\n Specification.from_file(output_path)\n when Pathname\n unless podspec.exist?\n raise Informative, \"No podspec found for `#{name}` in #{podspec}\"\n end\n FileUtils.copy(podspec, output_path)\n Specification.from_file(podspec)\n when Specification\n raise ArgumentError, 'can only store Specification objects as json' unless json\n Sandbox.update_changed_file(output_path, podspec.to_pretty_json)\n podspec.dup\n else\n raise ArgumentError, \"Unknown type for podspec: #{podspec.inspect}\"\n end\n\n # we force the file to be the file in the sandbox, so specs that have been serialized to\n # json maintain a consistent checksum.\n # this is safe to do because `spec` is always a clean instance\n spec.defined_in_file = output_path\n\n unless spec.name == name\n raise Informative, \"The name of the given podspec `#{spec.name}` doesn't match the expected one `#{name}`\"\n end\n @stored_podspecs[spec.name] = spec\n end",
"title": ""
},
{
"docid": "ed7b4d83b0193f4ff63ee677b13b98e4",
"score": "0.6426106",
"text": "def store_podspec(options = nil)\n if options\n unless options.keys.all? { |key| [:name, :path].include?(key) }\n raise StandardError, 'Unrecognized options for the podspec ' \\\n \"method `#{options}`\"\n end\n get_hash_value('podspecs', []) << options\n else\n get_hash_value('podspecs', []) << { :autodetect => true }\n end\n end",
"title": ""
},
{
"docid": "f8207af38fb5cadd85d39295d86febb2",
"score": "0.6393205",
"text": "def update_spec_to(gem)\n in_repo do\n spec.update_to(gem)\n File.write(spec_file, spec.to_string)\n end\n end",
"title": ""
},
{
"docid": "3d82b3ced80cc7e1fdb0b085e037bfab",
"score": "0.631352",
"text": "def update_spec_to(gem)\n in_repo do\n spec.update_to(gem)\n File.write(spec_file, spec.to_string)\n @dirty_spec = true\n end\n end",
"title": ""
},
{
"docid": "3d9a91bf124e11e78e812fa7b1f8b43a",
"score": "0.62066156",
"text": "def update_specs_repo\n repo = File.join($active_folder, $cocoadocs_specs_name)\n unless File.exists? repo\n vputs \"Creating Specs Repo for #{$specs_repo}\"\n unless repo.include? \"://\"\n command \"git clone git://github.com/#{$specs_repo}.git \\\"#{repo}\\\"\"\n else\n command \"git clone \\\"#{$specs_repo}\\\" \\\"#{repo}\\\"\"\n end\n else\n if $fetch_specs\n vputs \"Updating Specs Repo\"\n run_git_command_in_specs \"pull origin master\"\n `pod repo update`\n end\n end\n end",
"title": ""
},
{
"docid": "f73ace87a780b7a2d6fdf3b52a832835",
"score": "0.60879785",
"text": "def update_spec_to(gem, update_args={})\n in_repo do\n spec.update_to(gem, update_args)\n File.write(spec_file, spec.to_string)\n @dirty_spec = true\n end\n end",
"title": ""
},
{
"docid": "cf76c71bcc06ebcf2fe40b2e5cd79574",
"score": "0.60124713",
"text": "def fetch_spec(pod)\n base_url = 'https://raw.githubusercontent.com/CocoaPods/Specs/master/Specs/'\n url = URI.parse(\"#{base_url}#{pod.name}/#{pod.version}/#{pod.name}.podspec.json\")\n puts url.to_s\n response = Net::HTTP.get_response(url)\n pod.spec = response.body\nend",
"title": ""
},
{
"docid": "d0e003e9be51bcadec451cd264d2a8cf",
"score": "0.60119706",
"text": "def handle_added spec_hash, pod, commit_sha, committer_email\n # Do we have it?\n #\n if commit = Commit.find(:sha => commit_sha)\n # Is it related to the pod?\n #\n unless commit.pod_version.pod == pod\n # TODO It's not. Log as error?\n #\n end\n else\n # No? We should create it and connect it to the pod.\n #\n # TODO What if the version does not exist yet? Should we add one?\n #\n handle_modified spec_hash, pod, commit_sha, committer_email\n end\n end",
"title": ""
},
{
"docid": "b39c4adc330b385bca25b92f0c32aa82",
"score": "0.5972083",
"text": "def push\n puts \"If this is your first time running this command, it's going to take a while.\"\n puts \"Go for a 🚶 or take a ☕️ break.\"\n puts \"\"\n puts \"Pushing the following podspecs to #{\"`trunk`\".bold.magenta}: \"\\\n \"#{PODSPECS.map { |s| s.underline }.join(\" \")}\"\n\n PODSPECS.each do |podspec|\n system \"pod trunk push #{podspec} --synchronous\"\n end\nend",
"title": ""
},
{
"docid": "e1636867af351fa592b05aea229be58f",
"score": "0.59185416",
"text": "def work(release_project_name)\n Dir.chdir '../Deploy' do\n sh(\"pod trunk push #{release_project_name}.podspec --allow-warnings --verbose\")\n end\n end",
"title": ""
},
{
"docid": "6264f66ec3ab156db63086436cd8af30",
"score": "0.5902532",
"text": "def handle_modified spec_hash, pod, commit_sha, committer_email\n version = PodVersion.find(:pod => pod, :name => spec_hash['version'])\n \n # We ignore any new pod versions coming in through a manual merge.\n #\n if version\n # Add a new commit to the existing version.\n #\n version.add_commit(\n :sha => commit_sha,\n :specification_data => JSON.pretty_generate(spec_hash),\n :committer => pod.owners_dataset.first(:email => committer_email) || Owner.unclaimed,\n )\n end\n end",
"title": ""
},
{
"docid": "008388a3ff2d08cd63446b2d3a8d0edf",
"score": "0.58702475",
"text": "def write_spec(spec, spec_path)\n rubycode = spec.to_ruby\n File.open(File.join(spec_path, spec.full_name+\".gemspec\"), \"w\") do |file|\n file.puts rubycode\n end\n end",
"title": ""
},
{
"docid": "1c24b0eb7fb6522c9eec941f1bd089d4",
"score": "0.58663714",
"text": "def doc\n update_specs_repo\n\n @params.each do |param|\n next if param.start_with?('--')\n\n name = param\n if name.end_with? \".podspec.json\"\n document_spec_at_path(name)\n else\n document_spec_with_name(name)\n end\n end\n end",
"title": ""
},
{
"docid": "52b208fccd42e53acff4839253d4bd69",
"score": "0.5850688",
"text": "def handle_with_existing_spec(type, spec, pod, committer, commit_sha)\n send(:\"handle_#{type}\", spec, pod, committer, commit_sha)\n end",
"title": ""
},
{
"docid": "0579b0227a6e0e6fd942545cb9b4f85e",
"score": "0.5842325",
"text": "def write_gemspec\n Jeweler::Commands::WriteGemspec.build_for(self).run\n end",
"title": ""
},
{
"docid": "854eb718b23745eccfdc5472e32a3732",
"score": "0.58328474",
"text": "def pod_release\n raise \"CocoaPod repo is not set, aborting cocoapod_release task.\" unless @configuration.pod_repo != nil\n raise \"Spec file is not set, aborting cocoapod_release task.\" unless @configuration.podspec_file != nil\n\n # make a dry run first\n pod_dry_run\n\n # tag source as needed\n if @configuration.release_strategy != nil then\n @configuration.release_strategy.tag_current_version\n end\n\n # and push pod pod\n push_pod\n\n # ask release strategy to bump the release number\n if @configuration.release_strategy != nil then\n @configuration.release_strategy.prepare_for_next_pod_release\n end\n puts \"Pod successfully released\"\n end",
"title": ""
},
{
"docid": "854eb718b23745eccfdc5472e32a3732",
"score": "0.58328474",
"text": "def pod_release\n raise \"CocoaPod repo is not set, aborting cocoapod_release task.\" unless @configuration.pod_repo != nil\n raise \"Spec file is not set, aborting cocoapod_release task.\" unless @configuration.podspec_file != nil\n\n # make a dry run first\n pod_dry_run\n\n # tag source as needed\n if @configuration.release_strategy != nil then\n @configuration.release_strategy.tag_current_version\n end\n\n # and push pod pod\n push_pod\n\n # ask release strategy to bump the release number\n if @configuration.release_strategy != nil then\n @configuration.release_strategy.prepare_for_next_pod_release\n end\n puts \"Pod successfully released\"\n end",
"title": ""
},
{
"docid": "55c24137d2eb17f005c23e2aa9738b2d",
"score": "0.58269083",
"text": "def submit(filespec, io)\n raise NotImplementedError.new \"This repository does not respond to #submit\"\n end",
"title": ""
},
{
"docid": "a7e1fc0e5c6380c7e7a93b5feba8fcf5",
"score": "0.5803366",
"text": "def write_gemspec\n build_command(Jeweler::Commands::WriteGemspec).run\n end",
"title": ""
},
{
"docid": "322d6036feba4cce9707e8dcce0eb08c",
"score": "0.5765438",
"text": "def push_gem\n run_command 'gem build .gemspec'\n run_command \"gem push #{@gemspec[:name]}-#{@gemspec[:version]}.gem\"\n end",
"title": ""
},
{
"docid": "156cdf8a215bdf4e093f9d0cf46ffc9a",
"score": "0.57642126",
"text": "def spec_with_url(url)\n name = url.split('/').last\n name = name.chomp(\".git\") if name.end_with?(\".git\")\n \n target_dir = PLAY_TMP_DIR + name\n target_dir.rmtree if target_dir.exist?\n \n downloader = Pod::Downloader.for_target(target_dir, { :git => url })\n downloader.download\n \n spec_file = target_dir + \"#{name}.podspec\"\n Pod::Specification.from_file(spec_file)\n end",
"title": ""
},
{
"docid": "987ae19e797f39d259d9d1070fc67fa3",
"score": "0.57586247",
"text": "def write_gemspec\n Bueller::Commands::WriteGemspec.run_for self\n end",
"title": ""
},
{
"docid": "29c4e44d22b7973fc428803953e16a15",
"score": "0.57387173",
"text": "def write_gemspec\n self.refresh_version\n\n helper = gemspec_helper do |s|\n s.version = self.version\n s.date = Time.now\n end\n\n helper.write\n\n puts \"Generated: #{helper.path}\"\n end",
"title": ""
},
{
"docid": "f36f75ad32f16d4a9d29693ddb949833",
"score": "0.5736751",
"text": "def handle_modified(spec, pod, committer, commit_sha)\n version = PodVersion.find_or_create(:pod => pod, :name => spec.version.to_s)\n if version.was_created?\n message = if pod.was_created?\n \"Pod `#{pod.name}' and version `#{version.name}' created via Github hook.\"\n else\n \"Version `#{version.description}' created via Github hook.\"\n end\n log_github_hook_call(version, message, committer)\n end\n\n commit = first_or_add_commit(version, commit_sha, spec, committer)\n version.update(:deleted => false)\n\n # TODO: add test for returning commit\n commit\n end",
"title": ""
},
{
"docid": "2a6ed70b948dc32993fb903e1fdddf6b",
"score": "0.57233757",
"text": "def store_pod(name, *requirements)\n return if parse_subspecs(name, requirements) # This parse method must be called first\n parse_inhibit_warnings(name, requirements)\n parse_modular_headers(name, requirements)\n parse_configuration_whitelist(name, requirements)\n\n if requirements && !requirements.empty?\n pod = { name => requirements }\n else\n pod = name\n end\n\n get_hash_value('dependencies', []) << pod\n nil\n end",
"title": ""
},
{
"docid": "b27fbd79ca232edc5c417d9a85991185",
"score": "0.57124823",
"text": "def add_specification(spec)\n raise Informative, \"[Local Pod] Attempt to add a specification from another pod\" unless spec.top_level_parent == top_specification\n spec.activate_platform(platform)\n @specifications << spec unless @specifications.include?(spec)\n end",
"title": ""
},
{
"docid": "dce914aea41f499f18fdeb3853f20ba0",
"score": "0.561101",
"text": "def make_temp_spec_repo\n make_spec_repo_output = `#{$SCRIPT_DIR}/make_temp_spec_repo.sh`\n make_spec_repo_status=$?.exitstatus\n\n unless make_spec_repo_status == 0\n die \"Unable to create pod spec repo.\"\n end\n\n temp_spec_dir = make_spec_repo_output.lines.last.strip\n info \"Sucessfully created podspec repo at \\`#{temp_spec_dir}\\`\"\n return temp_spec_dir\nend",
"title": ""
},
{
"docid": "149ba3ef933b3918f099604830ba4657",
"score": "0.5594124",
"text": "def write_spec(spec, path)\n path.dirname.mkpath\n Cache.write_lock(path) do\n path.open('w') { |f| f.write spec.to_pretty_json }\n end\n end",
"title": ""
},
{
"docid": "0c333574d9b71cb279f254be8b3eddf5",
"score": "0.55784035",
"text": "def install!\n puts \"==> Installing: #{self}\" unless config.silent?\n config.project_pods_root.mkpath\n require 'fileutils'\n FileUtils.cp(@defined_in_file, config.project_pods_root)\n\n # In case this spec is part of another pod's source, we need to dowload\n # the other pod's source.\n (part_of_specification || self).download_if_necessary!\n end",
"title": ""
},
{
"docid": "1f04917f23bc6638816a88129feb1c66",
"score": "0.5569784",
"text": "def generate_gemspec(spec)\n File.open(\"#{spec.name}.gemspec\", \"w\") do |file|\n file.puts spec.to_ruby\n end\nend",
"title": ""
},
{
"docid": "de28d45d94a4329544f0fd01a57f8297",
"score": "0.55363363",
"text": "def store_downloaded_pod(name)\n root_name = Specification.root_name(name)\n downloaded_pods << root_name\n end",
"title": ""
},
{
"docid": "33974135133b5cb78705cd06494cc8d7",
"score": "0.55301726",
"text": "def podfile_from_spec(path, spec_name, platform_name, deployment_target, subspecs)\n Pod::Podfile.new do\n platform(platform_name, deployment_target)\n if path\n if subspecs\n subspecs.each do |subspec|\n pod spec_name + '/' + subspec, :path => path\n end\n else\n pod spec_name, :path => path\n end\n else\n if subspecs\n subspecs.each do |subspec|\n pod spec_name + '/' + subspec, :path => '.'\n end\n else\n pod spec_name, :path => '.'\n end\n end\n end\n end",
"title": ""
},
{
"docid": "75c6c011db71c8810f442079b7d6bb4d",
"score": "0.54553825",
"text": "def add_owner(ownerEmail)\n all_pods_in_repo.each do |pod|\n puts \"Adding #{ownerEmail.magenta} to #{pod.magenta} owners.\"\n system \"pod trunk add-owner #{pod} #{ownerEmail}\"\n end\nend",
"title": ""
},
{
"docid": "cf0a61a84d267f58329699699e2b65fe",
"score": "0.544516",
"text": "def commit\n # git add spec, git commit w/ message\n `#{GIT_CMD} add #{spec} sources .gitignore`\n #`git add #{gem_name}-#{version}.gem`\n `#{GIT_CMD} commit -m 'updated to #{self.version}'`\n end",
"title": ""
},
{
"docid": "ca1f809172fbdd96cf6f821b13985a39",
"score": "0.54243726",
"text": "def deploy_rubygems(spec, plugin)\n `gem build #{ plugin }.gemspec`\n `gem push #{ spec.full_name }.gem`\nend",
"title": ""
},
{
"docid": "418fd57c3d9e49e6806449a29c0dc114",
"score": "0.5381103",
"text": "def handle_added(spec, pod, committer, commit_sha)\n version = pod.versions_dataset.first(:name => spec.version.to_s)\n unless version && version.commits_dataset.first(:sha => commit_sha)\n handle_modified(spec, pod, committer, commit_sha)\n end\n end",
"title": ""
},
{
"docid": "280b20e2a8196dbd7cdf7c0e29e69081",
"score": "0.53255177",
"text": "def write_gemspec\n gemspec = File.join(Dir.pwd, '.gemspec')\n\n File.open gemspec, 'w+' do |f|\n f.write \"# coding: utf-8\\n\"\n f.write \"Gem::Specification.new do |s|\\n\"\n f.write @gemspec_string\n f.write \"end\\n\"\n end\n end",
"title": ""
},
{
"docid": "11fb7674c3b2ebf8bf3c3d5f20516617",
"score": "0.5321818",
"text": "def get_commit_refs pod_path\n\n \n begin \n spec = eval( File.open(pod_path).read )\n # if spec.version.version.to_s \n if spec.source[:commit] && spec.source[:git] && (spec.version.to_s != \"0.0.1\")\n puts \"adding #{spec.name}\"\n @emails << spec.authors\n @spec_metadata << { :v => spec.version.to_s, :name => spec.name, :commit => spec.source[:commit] }\n end\n \n rescue Exception => e\n# p e\n end\nend",
"title": ""
},
{
"docid": "1c52162ade1676cad489a356942d4602",
"score": "0.52764255",
"text": "def update_to(gem)\n # TODO use Polisher::RPMSpec to update spec\n `#{SED_CMD} -i \"s/Version.*/Version: #{gem.version}/\" #{spec}`\n `#{SED_CMD} -i \"s/Release:.*/Release: 1%{?dist}/\" #{spec}`\n `#{MD5SUM_CMD} #{gem.name}-#{gem.version}.gem > sources`\n File.open(\".gitignore\", \"w\") { |f| f.write \"#{gem.name}-#{gem.version}.gem\" }\n end",
"title": ""
},
{
"docid": "3dad53fbb1b3842cecfa97532019ed6d",
"score": "0.52318305",
"text": "def add_spec(gem_spec, name = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "6167292192d542c6c5a247652a12c4ec",
"score": "0.5227158",
"text": "def create_github_release(spec, plugin)\n `curl -H \"Authorization: token #{ ENV['GITHUB_TOKEN'] }\" -d '{ \"tag_name\": \"#{ spec.version }\", \"target_commitish\": \"#{ ENV['CI_COMMIT_ID'] }\", \"name\": \"#{ spec.version }\", \"body\": \"#{ ENV['CI_MESSAGE'] }\", \"draft\": \"#{ spec.metadata['release_draft']}\", \"prerelease\": \"#{ spec.metadata['release_prerelease']}\" }' https://api.github.com/repos/sensu-plugins/#{ plugin }/releases` # rubocop:disable all\nend",
"title": ""
},
{
"docid": "c2f88706313541b4512ea48b55e8d160",
"score": "0.5214399",
"text": "def install_pod(spec, sandbox)\n specs = { :ios => spec, :osx => spec }\n installer = Installer::PodSourceInstaller.new(sandbox, specs)\n installer.aggressive_cache = config.aggressive_cache?\n installer.install!\n sandbox.root + spec.name\n end",
"title": ""
},
{
"docid": "6920bf5b01aabd771083bb664617eef9",
"score": "0.52100074",
"text": "def save(spec, data)\n begin\n vid = AllGems.db[:versions].select(:versions__id.as(:version_id)).join(:gems, :id => :gem_id)\n vid = vid.filter(:name => spec.name, :version => spec.version.to_s)\n raise \"I don't know what spec I am\" if vid.first.nil?\n AllGems.logger.debug(\"Version information for this save is: #{vid.first}\")\n vid = vid.first[:version_id]\n AllGems.logger.debug(\"Version for this save is ID: #{vid}\")\n data[:modclass].each{|c| self.add_class(c, vid)}\n AllGems.db.transaction do\n data[:methods].each do |mc|\n cid = self.add_class(mc[:location], vid, false)\n mid = self.add_method(mc[:method], false)\n begin\n AllGems.db[:classes_methods] << {:class_id => cid, :method_id => mid, :version_id => vid}\n rescue\n #ignore duplicates#\n end\n end\n end\n rescue StandardError => boom\n AllGems.logger.error(\"SAVE FAIL: #{boom}\\n#{boom.backtrace.join(\"\\n\")}\")\n end\n end",
"title": ""
},
{
"docid": "491873ed87cb4bfa487d476f86776db3",
"score": "0.5180266",
"text": "def write_spec_to_git(repo, logger, version_release_id)\n # git clone or fetch\n repo_url = repo['repo_url'] # ssh://gerritroot@19.9.0.152:29418/android_mtk_m_6755_c66_mp/master\n git_repo = GitHelper.parse_url(repo_url)\n\n repo_branch = git_repo[:repo_branch]\n project_spec_name = repo['project_spec_name'] # 02_B\n project_name = repo['project_name'] # GBL7553A\n spec_file_dir = project_name[0 .. 6] # GBL7553\n spec_file_name = \"#{project_name.to_s.include?('_TASTE') ? project_name[0..7] : project_name}#{project_spec_name}.yml\" # GBL7553A02_B.yml\n git_repo[:repo_uri] = git_repo[:repo_uri].gsub('/gn_project', '') if project_name.to_s.start_with?('BJ') || repo_branch.eql?(\"vm4_gionee_local\")\n\n if project_name.to_s.start_with?('BJ')\n uri = File.join(git_repo[:repo_uri], \"config\", spec_file_dir, spec_file_name) # ssh://USER@19.9.0.152:29418/android_mtk_m_6755_c66_mp/gn_project/config/GBL7553/GBL7553A02_B.yml\n elsif project_name.to_s.start_with?(\"SW17G15\")\n git_repo[:repo_uri] = git_repo[:repo_uri].gsub('gn_project', 'SW17G15_gionee')\n git_repo[:repo_name] += \"/SW17G15_gionee\"\n repo_branch = \"master\"\n uri = File.join(git_repo[:repo_uri], \"gn_project\", spec_file_dir, spec_file_name) # ssh://USER@19.9.0.152:29418/android_qc_n_qrd8920_cs/SW17G15_gionee/gn_project/SW17G15/SW17G15A01_A.yml\n else\n uri = File.join(git_repo[:repo_uri], spec_file_dir, spec_file_name) # ssh://USER@19.9.0.152:29418/android_mtk_m_6755_c66_mp/gn_project/GBL7553/GBL7553A02_B.yml\n end\n\n # ssh://gerritroot@19.9.0.151:29418/android_qc_n_qrd8920_cs/branch_sw17g15_master\n if repo_url.to_s.end_with?(\"android_qc_n_qrd8920_cs/branch_sw17g15_master\") || repo_url.to_s.end_with?(\"android_qc_n_qrd8920_cs/branch_sw17g15_gionee_master\") ||\n repo_url.to_s.end_with?(\"android_mtk_n_6739_mp/branch_sw17g18_gionee_master\") || repo_url.to_s.end_with?(\"android_mtk_n_6739_mp/branch_sw17g18_master\")\n if repo_url.to_s.end_with?(\"branch_sw17g15_gionee_master\")\n git_repo[:repo_uri] = git_repo[:repo_uri].gsub('gn_project', 'SW17G15_gionee')\n git_repo[:repo_name] += \"/SW17G15_gionee\"\n elsif repo_url.to_s.end_with?(\"branch_sw17g15_master\")\n git_repo[:repo_uri] = git_repo[:repo_uri].gsub('gn_project', 'SW17G15')\n git_repo[:repo_name] += \"/SW17G15\"\n elsif repo_url.to_s.end_with?(\"branch_sw17g18_gionee_master\")\n git_repo[:repo_uri] = git_repo[:repo_uri].gsub('gn_project', 'SW17G18_gionee')\n git_repo[:repo_name] += \"/SW17G18_gionee\"\n elsif repo_url.to_s.end_with?(\"branch_sw17g18_master\")\n git_repo[:repo_uri] = git_repo[:repo_uri].gsub('gn_project', 'SW17G18')\n git_repo[:repo_name] += \"/SW17G18\"\n end\n uri = File.join(git_repo[:repo_uri], \"gn_project\", spec_file_dir, spec_file_name) # ssh://auto_rom_release@19.9.0.151:29418/android_qc_n_qrd8920_cs/SW17G15/gn_project/SW17G17/SW17G17Z50_A.yml\n repo_branch = \"master\"\n end\n\n if repo_branch.eql?(\"vm4_gionee_local\")\n uri = File.join(git_repo[:repo_uri], \"mt6763o/gn_project\", spec_file_dir, spec_file_name)\n end\n\n status = 1\n begin\n git = GitHelper.clone(git_repo[:repo_uri], git_repo[:repo_name], repo_branch)\n GitHelper.clear(git, repo_branch)\n GitHelper.pull_rebase(git, repo_branch)\n rescue => e\n logger.error(\"Git option failed, #{e}\")\n status = 0\n end\n logger.info(\"Working dir #{git.dir.to_s}\")\n\n # write spec.yml\n project_spec_id = repo['project_spec_id']\n production_name = repo['production_name'] # Amigo_GameHall\n production_spec_name = repo['production_spec_name'] # 01\n production_version_id = repo['production_version_id']\n production_version_name = repo['production_version_name'] # V1.0.0.a\n production_full_version = \"#{production_spec_name}_#{production_version_name}\" # 01_V1.0.0.a\n\n if project_name.to_s.start_with?('BJ')\n spec_file = File.join(git.dir.to_s, \"config\", spec_file_dir, spec_file_name) # android_mtk_m_6755_c66_mp/master/GBL7553/GBL7553A02_B.yml\n elsif project_name.to_s.start_with?(\"SW17G15\")\n spec_file = File.join(git.dir.to_s, \"gn_project\", spec_file_dir, spec_file_name) # android_mtk_m_6755_c66_mp/master/gn_project/GBL7553/GBL7553A02_B.yml\n else\n spec_file = File.join(git.dir.to_s, spec_file_dir, spec_file_name) # android_mtk_m_6755_c66_mp/master/GBL7553/GBL7553A02_B.yml\n end\n\n if repo_url.to_s.end_with?(\"android_qc_n_qrd8920_cs/branch_sw17g15_master\") || repo_url.to_s.end_with?(\"android_qc_n_qrd8920_cs/branch_sw17g15_gionee_master\") ||\n repo_url.to_s.end_with?(\"android_mtk_n_6739_mp/branch_sw17g18_gionee_master\") || repo_url.to_s.end_with?(\"android_mtk_n_6739_mp/branch_sw17g18_master\")\n spec_file = File.join(git.dir.to_s, 'gn_project', spec_file_dir, spec_file_name)\n end\n\n if repo_branch.eql?(\"vm4_gionee_local\")\n spec_file = File.join(git.dir.to_s, 'mt6763o/gn_project', spec_file_dir, spec_file_name)\n end\n\n md5_old = Digest::MD5.file(spec_file).hexdigest if File.exist?(spec_file)\n logger.info(\"Start write apps to #{spec_file}\")\n msg = write_spec_yml(spec_file, project_spec_id, production_version_id, production_name, production_full_version)\n logger.info(\"End write apps to #{spec_file}\")\n md5_new = Digest::MD5.file(spec_file).hexdigest\n\n # git push\n if project_name.to_s.start_with?('BJ')\n spec_file_git_path = File.join(\"config\", spec_file_dir, spec_file_name) # GBL7553/GBL7553A02_B.yml\n elsif project_name.to_s.start_with?(\"SW17G15\")\n spec_file_git_path = File.join(\"gn_project\", spec_file_dir, spec_file_name) # gn_project/GBL7553/GBL7553A02_B.yml\n else\n spec_file_git_path = File.join(spec_file_dir, spec_file_name) # GBL7553/GBL7553A02_B.yml\n end\n\n if repo_url.to_s.end_with?(\"android_qc_n_qrd8920_cs/branch_sw17g15_master\") || repo_url.to_s.end_with?(\"android_qc_n_qrd8920_cs/branch_sw17g15_gionee_master\") ||\n repo_url.to_s.end_with?(\"android_mtk_n_6739_mp/branch_sw17g18_gionee_master\") || repo_url.to_s.end_with?(\"android_mtk_n_6739_mp/branch_sw17g18_master\")\n spec_file_git_path = File.join('gn_project', spec_file_dir, spec_file_name)\n end\n\n if repo_branch.eql?(\"vm4_gionee_local\")\n spec_file_git_path = File.join('mt6763o/gn_project', spec_file_dir, spec_file_name)\n end\n\n gst = git.status[spec_file_git_path]\n logger.info(\"Git status: #{gst.type} #{gst.path}, md5[#{md5_old} -> #{md5_new}]\") if gst != nil\n\n if md5_new != md5_old # changed gst != nil and gst.type != nil and\n for i in 0..3 # retry 3 times when meet exception\n begin\n sleep(i * 3)\n logger.info(\"Updating spec.yml NO:#{i}: #{gst.type} #{gst.path}\") # M GBL7553/GBL7553A02_B.yml\n git.add(spec_file)\n logger.info(\"Git add files '#{spec_file}' to #{git.dir.to_s}\")\n git.commit(\"#{msg} to #{spec_file_name}(#{version_release_id})\")\n logger.info(\"Git commit #{msg} to #{spec_file_name}\")\n GitHelper.pull_rebase(git, repo_branch)\n logger.info(\"Git fetch and rebase from #{repo_branch}\")\n git.push('origin', repo_branch)\n logger.info(\"Git push to #{repo_branch}\")\n status = 1\n break\n rescue => e\n logger.error(\"Updating spec.yml NO:#{i} failed, #{e}\")\n status = 0\n end\n end\n end\n {:uri => uri, :status => status, :msg => msg}\n end",
"title": ""
},
{
"docid": "9f2ad761bf1533b4d7db3416b47e01fe",
"score": "0.5166395",
"text": "def update(specFile)\n specFile = Pathname.new(specFile) unless specFile.kind_of? Pathname\n\n uri = endPoint('/definition')\n request = Net::HTTP::Post.new(uri)\n ret = nil\n\n specFile.open do |io|\n request.body_stream = io\n request.content_length = specFile.size\n set_def_headers(request)\n request.content_type = 'text/yaml'\n ret = workit(request)\n end\n ret\n end",
"title": ""
},
{
"docid": "0f037bbf7cc4396d2dc0ef4d656cb1ec",
"score": "0.5130122",
"text": "def new_spec_for(type,name)\n usage = \"USAGE : new_spec_for [:model|controller], [name_of_spec]\" \n return usage if type.nil? || [\"model\",\"controller\"].include?(type.to_s)\n if type.to_s == \"model\"\n spec_path = \"test/unit\"\n elsif type.to_s == \"controller\" \n spec_path = \"test/functional\"\n end\n spec_file_path = \"#{spec_path}/#{name}_spec.yml\"\n File.open(spec_file_path, \"w+\")\n system(\"mate #{spec_file_path}\")\n return \"Spec File : #{spec_file_path} has been created!\"\n end",
"title": ""
},
{
"docid": "7b7e0b21cf20f0e244ad7d9f1e4bb878",
"score": "0.51197803",
"text": "def validate_podspec\n UI.puts 'Validating podspec'.yellow\n\n validator = Validator.new(spec, %w(https://github.com/CocoaPods/Specs.git))\n validator.allow_warnings = @allow_warnings\n validator.use_frameworks = @use_frameworks\n validator.swift_version = @swift_version if Validator.method_defined?(:swift_version=)\n validator.skip_import_validation = @skip_import_validation\n validator.skip_tests = @skip_tests\n validator.validate\n unless validator.validated?\n raise Informative, \"The spec did not pass validation, due to #{validator.failure_reason}.\"\n end\n\n # Let the validator's logic for the swift version\n # set the value for the trunk JSON uploader\n @swift_version = validator.respond_to?(:used_swift_version) && validator.used_swift_version\n end",
"title": ""
},
{
"docid": "ed3bc45bffcc6b3011e7bc8bddd8670c",
"score": "0.5116595",
"text": "def soft_update(path, url)\n downloader = Pod::Downloader::Http.new(\"#{path}\", \"#{url}/index/fetchIndex\", :type => 'tgz', :indexDownload => true)\n downloader.download\n UTIL.cleanup_index_download(\"#{path}\")\n UTIL.del_redundant_spec_dir(\"#{path}/Specs/Specs\")\n system \"cd '#{path}' && git add . && git commit -m 'Artifactory repo update specs'\"\n end",
"title": ""
},
{
"docid": "efb544e4bd74c4d413ba96ee91bbd527",
"score": "0.5115231",
"text": "def create_ruby_gemspec!\n log(:debug, \"Creating gem spec file `#{ruby_gemspec_file}'\")\n File.open(ruby_gemspec_file, 'w') { |f| f << @gem_spec.to_ruby }\n end",
"title": ""
},
{
"docid": "1f2873b1acf84f09f10faf8b1cf09458",
"score": "0.5099701",
"text": "def save_yaml(spec_dir = @spec_dir)\n save_data = {\n \"inv_data\": @file_inv,\n \"new_data\": @new_files,\n \"edited_data\": @edited_files,\n \"del_data\": @del_files\n }\n begin\n # If it doesnt exist, Errno::ENOENT is cast\n File.read(spec_dir + \"/data/data.yaml\")\n # Write vars to data.yaml\n File.open(spec_dir + \"/data/data.yaml\", \"w\") { |file| file.write(save_data.to_yaml) }\n rescue Errno::ENOENT => e\n puts e\n puts \"No such file: #{spec_dir}!\"\n return false\n end\n return true\n end",
"title": ""
},
{
"docid": "4bba7ee1d06c84341fd5db0330ee8b14",
"score": "0.50920266",
"text": "def clean_pod(name, pod_dir)\n pod_dir.rmtree if pod_dir&.exist?\n podspec_path = specification_path(name)\n podspec_path.rmtree if podspec_path&.exist?\n pod_target_project_path = pod_target_project_path(name)\n pod_target_project_path.rmtree if pod_target_project_path&.exist?\n end",
"title": ""
},
{
"docid": "eeea75f5ae32c2142883778310e63eca",
"score": "0.5083421",
"text": "def feature_pods\n ### ONLY FOR DEVELOP PURPOSES ###\n feature_branch = \"develop\" # <- HERE: Change this line to setup ALL the pods repository from another branch WHEN pods_environment = \"develop\"\n ### ONLY FOR DEVELOP PURPOSES ###\n\n color(32) { puts \"Installing Develop Pods from branch: #{feature_branch}\" }\n pod 'BasicCommons', :git => 'git@github.com:kevinOlivet/BasicCommons.git', :branch => \"#{feature_branch}\"\n pod 'BasicUIElements', :git => 'git@github.com:kevinOlivet/BasicUIElements.git', :branch => \"#{feature_branch}\"\nend",
"title": ""
},
{
"docid": "4e23bf26d04884498aa7a7c7e0496fc9",
"score": "0.5083327",
"text": "def shared_pods\n pod 'gobelieve', :path => './dev.podspec'\nend",
"title": ""
},
{
"docid": "2c247a8e2a2ebb9a287f9322386a7563",
"score": "0.508313",
"text": "def pod_params\n params.require(:pod).permit(:title, :body, :image)\n end",
"title": ""
},
{
"docid": "0807e60fd5603531e3fdef0366ea70c8",
"score": "0.50779754",
"text": "def create_spec(spec_dir, cookbook, recipe)\n unless File.exists?(File.join(spec_dir, \"#{recipe}_spec.rb\"))\n open(File.join(spec_dir, \"#{recipe}_spec.rb\"), \"w\") do |file|\n file.puts spec_file_content(cookbook, recipe)\n end\n end\n end",
"title": ""
},
{
"docid": "08197ff53e6bb9cbb5820bd67a8b180f",
"score": "0.5071199",
"text": "def pod_params\n params.require(:pod).permit(:title, :description)\n end",
"title": ""
},
{
"docid": "2ec3300b81e3fad1b167faec48172f36",
"score": "0.50678504",
"text": "def push\n @repo.git.git.push({}, @name)\n end",
"title": ""
},
{
"docid": "73b80842de254a1a36435919cf35720b",
"score": "0.5063938",
"text": "def check_specs_repo_installed\n success = system(\"pod repo list | grep #{$pod_repo_name}\")\n return true if success\n\n # Install this git repo as a pod repo\n remote_url = `git remote -v | awk '{print $2}' | head -n 1`\n success = system(\"pod repo add #{$pod_repo_name} #{remote_url}\")\n\n puts \"Unable to install #{$pod_repo_name} as a pod repo\" unless success\n\n return success\nend",
"title": ""
},
{
"docid": "bc1a2c881733b6255afced46976f2b77",
"score": "0.50635815",
"text": "def save\n overwrite @api.put(\"/projects/#{shortcode_url}.json\", 'name' => name)\n end",
"title": ""
},
{
"docid": "f0fd1872e0218015eee57c2f05e59abc",
"score": "0.50632095",
"text": "def specification\n @specification ||= begin\n if @external_spec_source\n config = Config.instance\n pod_root = config.project_pods_root + @name\n spec = nil\n if @external_spec_source[:podspec]\n config.project_pods_root.mkpath\n spec = config.project_pods_root + \"#{@name}.podspec\"\n source = @external_spec_source[:podspec]\n # can be http, file, etc\n require 'open-uri'\n puts \" * Fetching podspec for `#{@name}' from: #{source}\" unless config.silent?\n open(source) do |io|\n spec.open('w') { |f| f << io.read }\n end\n else\n puts \" * Pre-downloading: `#{@name}'\" unless config.silent?\n Downloader.for_source(pod_root, @external_spec_source).download\n spec = pod_root + \"#{@name}.podspec\"\n end\n Specification.from_file(spec)\n end\n end\n end",
"title": ""
},
{
"docid": "e60bce32ec8a462ccfcc04fc53f76b1b",
"score": "0.50574523",
"text": "def document_spec(spec)\n state = \"failed\"\n\n begin\n download_location = $active_folder + \"/download/#{spec.name}/#{spec.version}/#{spec.name}\"\n docset_location = $active_folder + \"/docsets/#{spec.name}/#{spec.version}/\"\n readme_location = $active_folder + \"/readme/#{spec.name}/#{spec.version}/index.html\"\n changelog_location = $active_folder + \"/changelog/#{spec.name}/#{spec.version}/index.html\"\n pod_root_location = $active_folder + \"/docsets/#{spec.name}/\"\n templates_location = $active_folder + \"/template/#{spec.name}/\"\n\n unless $skip_source_download\n downloader = SourceDownloader.new ({ :spec => spec, :download_location => download_location, :overwrite => $overwrite_existing_source_files })\n FileUtils.rm_r download_location if File.directory?(download_location)\n downloader.download_pod_source_files\n end\n\n settings = CocoaDocsSettings.settings_at_location download_location\n jazzy_config = CocoaDocsSettings.jazzy_config_at_location download_location\n\n readme = ReadmeGenerator.new ({ :spec => spec, :readme_location => readme_location, :changelog_location => changelog_location, :settings => settings })\n readme.create_readme\n readme.create_changelog\n\n cloc = ClocStatsGenerator.new(:spec => spec, :source_download_location => download_location)\n cloc_results = cloc.generate\n\n version_metadata = SpecMetadataGenerator.new(:spec => spec, :docset_path => docset_location)\n versions = version_metadata.generate\n\n fixer = DocsetFixer.new({ :docset_path => docset_location, :readme_path => readme_location, :changelog_path => changelog_location, :pod_root => pod_root_location, :spec => spec, :versions => versions })\n\n documented = false\n\n swift = cloc_results.find { |r| r[:language] == 'Swift' }\n header = cloc_results.find { |r| r[:language] == 'C/C++ Header' }\n\n if swift\n puts \"Using jazzy to document Swift pod\"\n\n download_spec_path = download_location + \"/#{spec.name}.podspec.json\"\n File.open(download_spec_path, 'w') { |f| f.write spec.to_json }\n podspec = Pod::Specification.from_file(download_spec_path)\n\n if podspec.dependencies && podspec.dependencies.length\n puts \"Updating the global CocoaPods specs repos, as this spec has dependencies.\"\n `bundle exec pod repo update`\n end\n\n config = Jazzy::Config.new.tap do |c|\n c.config_file = Pathname(jazzy_config) if jazzy_config\n begin\n c.parse_config_file\n rescue => e\n puts \"Setting up jazzy config failed: #{e.message.red} - continuing\"\n end\n\n c.podspec = podspec\n c.podspec_configured = true\n\n # Either use the version submitted to trunk, or try with 3.0\n trunk_swift_version = c.podspec.attributes_hash[\"pushed_with_swift_version\"]\n c.swift_version = (trunk_swift_version && trunk_swift_version.strip) || \"3.0\"\n\n c.output = Pathname(docset_location)\n c.min_acl = Jazzy::SourceDeclaration::AccessControlLevel.public\n c.docset_icon = Pathname(__FILE__).parent + 'resources/docset_icon.png'\n c.docset_path = \"com.cocoadocs.#{spec.name.downcase}.#{spec.name}.docset\"\n c.readme_path = Pathname(readme_location)\n c.source_directory = Pathname(download_location)\n c.module_name = spec.module_name\n c.clean = true\n c.dash_url = \"#{$website_home}docsets/#{spec.name}/#{spec.name}.xml\"\n end\n\n begin\n Jazzy::DocBuilder.build(Jazzy::Config.instance = config)\n fixer.readme_path = docset_location + '/index.html'\n fixer.fix_for_jazzy\n documented = true\n rescue => e\n puts \"Jazzy failed: #{e.message.red}\"\n vputs \"\\n#{e.backtrace.inspect.red}\"\n log_error(spec, e) if spec != nil\n end\n end\n\n unless documented\n appledoc_template = AppledocTemplateGenerator.new({ :spec => spec, :appledoc_templates_path => templates_location, :source_download_location => download_location, :versions => versions, :library_settings => settings })\n appledoc_template.generate\n\n generator = DocsetGenerator.new({ :spec => spec, :to => docset_location, :from => download_location, :readme_location => readme_location, :appledoc_templates_path => templates_location, :source_download_location => download_location, :library_settings => settings })\n generator.create_docset\n\n fixer.fix\n end\n\n version_metadata.save\n\n fixer.add_index_redirect_to_latest_to_pod(version_metadata.latest_version)\n fixer.add_docset_redirects(version_metadata.latest_version) if $upload_redirects_for_docsets\n\n if version_metadata.latest_version?\n # These are things that are specific to the pod\n # not the version, so it only works if it's latest\n tester = TestingIdealist.new(:spec => spec, :download_location => download_location)\n testing_estimate = tester.testimate\n\n SocialImageGenerator.new(:spec => spec, :output_folder => docset_location, :doc_percent => 80, :testing_estimate => testing_estimate, :language => cloc.get_top_cloc(cloc_results)[:language]).generate\n end\n\n $generator = WebsiteGenerator.new(:generate_json => $generate_docset_json, :spec => spec)\n $generator.upload_docset if $upload_docsets_to_s3\n\n if $delete_source_after_docset_creation\n vputs \"Deleting source files\"\n command \"rm -rf \\\"#{download_location}\\\"\"\n command \"rm -rf \\\"#{docset_location}\\\"\" if $upload_site_to_s3\n end\n\n state = \"success\"\n\n rescue Exception => e\n log_error(spec, e) if spec != nil\n\n open('error_log.txt', 'a') { |f|\n f.puts \"\\n\\n\\n --------------#{spec.defined_in_file}-------------\"\n f.puts e.message\n f.puts \"------\"\n f.puts e.backtrace.inspect\n }\n\n puts \"--------------#{spec.defined_in_file}-------------\".red\n puts e.message.red\n puts \"------\"\n puts e.backtrace.inspect.red\n end\n\n HistoryLogger.new(:spec => spec, :download_location => docset_location, :source_download_location => download_location).append_state state\n\n puts \"* [docs] - \" + $website_home + \"docsets/\" + spec.name + \"/\" + spec.version.to_s + \"/\"\n end",
"title": ""
},
{
"docid": "a9742b02081737175db8136a715bb6c3",
"score": "0.5048302",
"text": "def specification_path(name)\n name = Specification.root_name(name)\n path = specifications_root + \"#{name}.podspec\"\n if path.exist?\n path\n else\n path = specifications_root + \"#{name}.podspec.json\"\n if path.exist?\n path\n end\n end\n end",
"title": ""
},
{
"docid": "d293b8a2ec19451c9a7479e58e46cb15",
"score": "0.5045134",
"text": "def import(commit_sha, type, files)\n files.each do |file|\n next unless file =~ PODSPEC_FILE_EXT_REGEX\n\n pod_name, version_name = extract_name_and_version file\n\n pod = Pod.find_or_create(:name => pod_name)\n\n committer = find_or_create_committer\n\n if type == :removed\n handle_removed(pod, version_name, committer, commit_sha)\n else\n spec = fetch_spec(commit_sha, file)\n\n next unless spec\n\n pod.add_owner(committer) if pod.was_created?\n\n handle_with_existing_spec(type, spec, pod, committer, commit_sha)\n end\n end\n end",
"title": ""
},
{
"docid": "24563ca972ca2703feac0a8c2b8cfba2",
"score": "0.50419575",
"text": "def install_release_fixture(name)\n release_fixture(name)\n FileUtils.cp_r(release_fixture(name), name)\nend",
"title": ""
},
{
"docid": "97db542eb4941772203b5020c108c11c",
"score": "0.503948",
"text": "def save_spec_data(args)\n args = [args] unless args.is_a?(Array)\n AllGems.db.transaction do\n args.each do |info|\n AllGems.logger.info(\"Saving data about gem: #{info[:spec].full_name}\")\n gid = AllGems.db[:gems].filter(:name => info[:spec].name).first\n gid = gid.nil? ? AllGems.db[:gems].insert(:name => info[:spec].name) : gid[:id]\n if(AllGems.db[:versions].filter(:gem_id => gid, :version => info[:spec].version.version).count == 0)\n vid = AllGems.db[:versions] << {:version => info[:spec].version.version, :gem_id => gid, :release => info[:spec].date}\n AllGems.db[:specs] << {:version_id => vid, :spec => [Marshal.dump(info[:spec])].pack('m'), :uri => info[:source], :full_name => info[:spec].full_name}\n #TODO: only update to latest version\n AllGems.db[:gems].filter(:id => gid).update(:summary => info[:spec].summary)\n AllGems.db[:gems].filter(:id => gid).update(:description => info[:spec].description)\n end\n end\n end\n true\n end",
"title": ""
},
{
"docid": "a64e9e6f112c16f6f697f50b1e8f53bd",
"score": "0.50173014",
"text": "def upload_pack!\n exec_in_repo! \"git-upload-pack\", path.to_s\n end",
"title": ""
},
{
"docid": "4590c95360a80474acca518f6870259a",
"score": "0.5009904",
"text": "def build_gem\n `gem build #{spec.name}.gemspec`\n `mkdir -p pkg`\n `mv #{gem} pkg/#{gem}`\n yay \"Gem built.\"\nend",
"title": ""
},
{
"docid": "80869f5d497eaf5a417726477a343bd5",
"score": "0.5000842",
"text": "def create\n @myspec = Myspec.new(params[:myspec])\n\n respond_to do |format|\n if @myspec.save\n format.html { redirect_to @myspec, notice: 'Myspec was successfully created.' }\n format.json { render json: @myspec, status: :created, location: @myspec }\n else\n format.html { render action: \"new\" }\n format.json { render json: @myspec.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ca6b6ec17ea9ed4a2e846388af97d178",
"score": "0.49924722",
"text": "def save\n raise 'Could not find repo' if !@repo\n save_config\n save_chapters\n git_add_all\n git_commit_all \"Saved book\"\n end",
"title": ""
},
{
"docid": "7470f9c9e00758d2bfd57ac617c833dd",
"score": "0.49834085",
"text": "def write\n setup_paths\n\n generate_stub_files\n add_resources\n add_pods\n add_frameworks\n\n project.save\n end",
"title": ""
},
{
"docid": "4dcc1c5f51ade958d51152d73dc6bc7d",
"score": "0.49817508",
"text": "def save(username, repository, issues)\n if !File.directory?(app_path)\n Dir.mkdir(app_path)\n end\n user_folder = File.join(app_path, username)\n Dir.mkdir(user_folder) if !File.directory?(user_folder)\n File.open(File.join(user_folder, \"#{repository}.yaml\"), \"w\") do |handle|\n handle.write(issues.to_yaml)\n end\n end",
"title": ""
},
{
"docid": "89f2e21fc8ef98a8a1d4fe9b73bd8ae0",
"score": "0.49783152",
"text": "def process(podspec_file, cmake_file, *req_subspecs)\n root_dir = Pathname.new(__FILE__).expand_path().dirname().dirname()\n path_list = Pod::Sandbox::PathList.new(root_dir)\n\n spec = Pod::Spec.from_file(podspec_file)\n\n writer = Writer.new()\n writer.append <<~EOF\n # This file was generated by #{File.basename(__FILE__)}\n # from #{File.basename(podspec_file)}.\n # Do not edit!\n EOF\n\n cmake_binary_dir = File.expand_path(File.dirname(cmake_file))\n\n gen = CMakeGenerator.new(spec, path_list, cmake_binary_dir)\n gen.add_framework(spec)\n\n req_subspecs = normalize_requested_subspecs(spec, req_subspecs)\n req_subspecs = resolve_subspec_deps(spec, req_subspecs)\n\n spec.subspecs.each do |subspec|\n if req_subspecs.include?(subspec.name)\n gen.add_framework(subspec)\n end\n end\n\n gen.target.commands.each do |command|\n writer.write(command)\n end\n\n File.open(cmake_file, 'w') do |fd|\n fd.write(writer.result)\n end\nend",
"title": ""
},
{
"docid": "bfd8d127b27e98949109716c1a4a3643",
"score": "0.49739096",
"text": "def remove_local_podspec(name)\n local_podspec = specification_path(name)\n FileUtils.rm(local_podspec) if local_podspec\n end",
"title": ""
},
{
"docid": "da22eaf92135e5bb2d61b166a7d830e5",
"score": "0.49616793",
"text": "def updatejob\n client = Etcd.client(host: 'etcd', port: '4001')\n @controlrepo = client.get('/configuration/puppetcontrolrepourl').value\n data = YAML.load(File.open('controlrepo.yaml'))\n data[0]['job']['scm'][0]['git']['url'] = @controlrepo\n\n File.open(\"controlrepo.yaml\", 'w') { |f| YAML.dump(data, f) }\nend",
"title": ""
},
{
"docid": "487c013cf51111b10a877c7d807751d1",
"score": "0.49595773",
"text": "def create\n @spec = Spec.new(spec_params)\n\n if @spec.save\n render json: @spec, status: :created, location: @spec\n else\n render json: @spec.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "58aafa5372a3185f0119e36c71aaec9d",
"score": "0.49367455",
"text": "def write_version(major, minor, patch, options = {})\n options = version_writing_options(options)\n\n @version.update_to major, minor, patch\n @version.write\n\n @gemspec.version = @version.to_s\n\n commit_version if options[:commit]\n end",
"title": ""
},
{
"docid": "83df21e8b8c9702f66dc5f867852695f",
"score": "0.493125",
"text": "def publish(payload)\n allow_pullreview_webmock\n allow_pullreview_vcr\n response = post(payload)\n \"#{response.code} : #{response.body}\"\n end",
"title": ""
},
{
"docid": "0e0061122409c25eadbbc80571d5684a",
"score": "0.49274683",
"text": "def save_as(pathname)\n pathname.open('w') do |source|\n source.puts \"// WARNING: This feature of CocoaPods is present for discussion purposes and might be discontinued or changed in future\"\n source.puts \"#define __COCOA_PODS\"\n source.puts\n specs.each do |specs|\n source.puts \"#define __POD_#{specs.name.gsub(/[^\\w]/,'_')}\"\n end\n end\n end",
"title": ""
},
{
"docid": "2b4dea0d32a6932c76fec1f11647645d",
"score": "0.49264595",
"text": "def git_push(repo_set_spec, remote_spec = 'origin')\n compute_repo_paths(repo_set_spec).each { |repo_path|\n cmd = %(cd #{ repo_path } && git push #{ remote_spec })\n Open3.popen3(cmd) do |stdin, stdout, stderr, wait_thr|\n exit_status = wait_thr.value\n if exit_status.success?\n puts \" - Pushed #{ repo_path }\"\n else\n msg = %(Could not push #{ repo_path }:\\n\\n).color(:red)\n puts(msg + stderr.read)\n end\n end\n }\n end",
"title": ""
},
{
"docid": "9a94fb3a0a856e4df06acc2ea9a92933",
"score": "0.49250618",
"text": "def raise_pr(namespace)\n branch = \"update-rds-module-#{namespace}\"\n message = \"Update RDS module for #{namespace}\"\n execute \"git checkout -b #{branch}\"\n execute \"git add #{tfdir(namespace)}\"\n execute %(git commit -m \"#{message}\")\n execute %(git push origin #{branch})\n execute %(hub pull-request -m \"#{message}\")\nend",
"title": ""
},
{
"docid": "3fadf4fbf18631a5523adda40248b0a1",
"score": "0.4918191",
"text": "def set(pod_name)\n Specification::Set.new(pod_name, self)\n end",
"title": ""
},
{
"docid": "aee1d1ff188912831fe2920f03f8a817",
"score": "0.4891782",
"text": "def save\n params = { name: @name }\n self.metadata.each { |key, value| params[key] = value }\n @bookalope.http_post(@url, params)\n end",
"title": ""
},
{
"docid": "667ad9a37c0fac8d5debcc205756643c",
"score": "0.48904303",
"text": "def add_pods_to_unity \n ios_project_path = File.join(BuildPath, \"ios\", \"Unity-iPhone.xcodeproj\")\n proj = ::Xcodeproj::Project.open(ios_project_path)\n\n pods_project_path = File.join(BuildPath, \"ios\", \"Pods\", \"Pods.xcodeproj\")\n proj.new_file(pods_project_path)\n\n proj.save\n end",
"title": ""
},
{
"docid": "d54f4107d6c4a2380616654808e74a2d",
"score": "0.48895666",
"text": "def update!(**args)\n @spec = args[:spec] if args.key?(:spec)\n end",
"title": ""
},
{
"docid": "faacbaafb48251b3e588d5a623f34f8f",
"score": "0.48795158",
"text": "def save\n cmd = \"aptly repo edit\"\n cmd += \" -distribution=#{@dist.quote}\"\n cmd += \" -comment=#{@comment.quote}\"\n cmd += \" -component=#{@component.quote}\"\n cmd += \" #{@name.quote}\"\n\n Aptly::runcmd cmd\n end",
"title": ""
},
{
"docid": "c1c6d180557db5eb0ab70a108befc677",
"score": "0.48739925",
"text": "def write_spec(url, output = './spec/features/pages_spec.rb', force_write = false, dry_run = false)\n if force_write && File.exist?(output)\n append_to_existing_spec(url, output, dry_run)\n else\n create_new_spec(url, output, dry_run)\n end\n end",
"title": ""
},
{
"docid": "c58a3e4e809cd9b9be3f0e1f074f0aab",
"score": "0.48739502",
"text": "def sync\n @repo.sync(@ref)\n end",
"title": ""
},
{
"docid": "e21e8222ccee36bd951c55b7b9098982",
"score": "0.4871606",
"text": "def save(update = nil)\n update = self.to_hash.to_xml(:root => \"ticket\") unless update\n Unfuddler.put(\"projects/#{self.project_id}/tickets/#{self.id}\", update)\n end",
"title": ""
},
{
"docid": "7ed474817c4008e6ae2b4cc55a65f681",
"score": "0.4864559",
"text": "def test_with_cocoapods\n skip('by default')\n\n # clone and set default branch\n project_name = \"project/test.examples\" # To avoid nested bundler\n # https://github.com/KazuCocoa/test.example\n g = ::Anticuado::GitHub.new \"KazuCocoa/test.examples\", enterprise: false\n g.clone_or_open_to project_name\n\n # update\n update_libraries_list = ['EarlGrey', 'Firebase/Core']\n bundler = ::Anticuado::IOS::CocoaPods.new project_name\n bundler.update_lock update_libraries_list\n\n # create a PR\n Dir.chdir(project_name) do\n g.create_a_new_pull_request base_branch: 'master', head_branch: \"update-#{Time.now.strftime '%Y%m%d-%H%M%S'}\", update_libraries: update_libraries_list\n end\n end",
"title": ""
},
{
"docid": "b337f4cc65fa38c2f4fb776d748c213b",
"score": "0.4864266",
"text": "def publish_gem(gem_dir, key)\n gemspec = gem_dir.glob(\"*.gemspec\").first\n name, version = gem_info(gem_dir)\n\n tmp_build_gem = Pathname.new(ENV[\"GEM_BUILD_DIR\"]) + \"tmp.gem\"\n tmp_build_gem.unlink if tmp_build_gem.exist?\n return STDERR.puts \"FAILED TO DELETE OLD TMP GEM\".red if tmp_build_gem.exist?\n\n Dir.chdir(gem_dir) do\n annotated_command([\"gem\", \"build\", \"-o\", tmp_build_gem.to_s, gemspec.to_s].shelljoin) { \"GEM BUILD\" }\n end\n return STDERR.puts \"FAILED TO BUILD #{gemspec}\".red unless tmp_build_gem.exist?\n\n annotated_command(\n {\"GEM_HOST_API_KEY\" => key},\n [\"gem\", \"push\", \"--host\", server_address, tmp_build_gem.to_s].shelljoin\n ) { \"GEM PUSH\" }\n\n completion_message = \"Gem pushed successfully\"\n completed_result = gem_version_exists(name, version) ? \"#{name} (#{version})\".green : \"no\".red\n STDERR.puts \"#{completion_message.yellow}: #{completed_result}\"\nrescue Exception => e\n STDERR.puts \"publish_gem(#{gem_dir}) FAILED: #{e}\".red\nend",
"title": ""
},
{
"docid": "7a27b422697618c3151b856190f3ba58",
"score": "0.48574102",
"text": "def save_new\n base.in_branch do |wd|\n base.logger.info \"saving #{ticket_name}\"\n \n Dir.mkdir(ticket_name)\n Dir.chdir(ticket_name) do\n base.new_file('TICKET_ID', ticket_name)\n base.new_file('ASSIGNED_' + email, email)\n base.new_file('STATE_' + state, state)\n base.new_file('TICKET_TITLE',self.title)\n base.new_file('TICKET_DESCRIPTION',self.description) if self.description\n\n # add initial comment\n #COMMENT_080315060503045__schacon_at_gmail\n base.new_file(comment_name(email), opts[:comment]) if opts[:comment]\n\n # add initial tags\n if opts[:tags] && opts[:tags].size > 0\n opts[:tags] = opts[:tags].map { |t| t.strip }.compact\n opts[:tags].each do |tag|\n if tag.size > 0\n tag_filename = 'TAG_' + Ticket.clean_string(tag)\n if !File.exists?(tag_filename)\n base.new_file(tag_filename, tag_filename)\n end\n end\n end\n end \n end\n\t \n base.git.add\n base.git.commit(\"added ticket #{ticket_name}\")\n end\n # ticket_id\n end",
"title": ""
},
{
"docid": "27dfa15d7c7428d22e2f6624c37829fd",
"score": "0.48543644",
"text": "def pod_params\n params.require(:pod).permit(:name, :body, :url, :image_id, :pod_type, :gallery_id, :video_url, page_ids:[])\n end",
"title": ""
},
{
"docid": "ab49fde924603e71b842ba62b9f8b24f",
"score": "0.48346364",
"text": "def github_update_file(repo, path, message, contents, sha)\n contents = Base64.encode64 contents\n body = { \n \"message\" => message, \n \"commiter\" => { \"name\" => \"Scott Chamberlain\", \"email\" => \"myrmecocystus@gmail.com\" },\n \"content\" => contents,\n \"sha\" => sha\n }\n url_path = '/repos/%s/contents/%s' % [repo, path]\n res = $github_conn.put url_path, MultiJson.dump(body)\n res.github_raise\n MultiJson.load(res.body)\nend",
"title": ""
},
{
"docid": "54729a23ef0dfff80cb9b7364454d16d",
"score": "0.4834519",
"text": "def save(gem_object)\n @mongo[:gems].find_and_modify(query: {name: gem_object['name']}, update: gem_object)\n end",
"title": ""
},
{
"docid": "7c09ae710c55cddb4d1f2f13593bb43f",
"score": "0.48293966",
"text": "def process(spec)\n AllGems.logger.info \"Processing gem: #{spec.full_name}\"\n basedir = \"#{AllGems.data_directory}/#{spec.name}/#{spec.version.version}\"\n FileUtils.mkdir_p basedir\n AllGems.logger.info \"Created new directory: #{basedir}\"\n gempath = fetch(spec, \"#{basedir}/#{spec.full_name}.gem\")\n unpack(gempath, basedir)\n generate_documentation(spec, basedir)\n end",
"title": ""
},
{
"docid": "bfd6bb5461de55f6ed02e39e3beb594f",
"score": "0.48259524",
"text": "def create\n @pod = Pod.new(pod_params)\n\n respond_to do |format|\n if @pod.save\n format.html { redirect_to @pod, notice: 'Pod was successfully created.' }\n format.json { render :show, status: :created, location: @pod }\n else\n format.html { render :new }\n format.json { render json: @pod.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8e0d648dafbc1ccb4b7fef721c564017",
"score": "0.4805774",
"text": "def upload_profile(config, owner, profile_name, path)\n Compliance::API.upload(config, owner, profile_name, path)\nend",
"title": ""
},
{
"docid": "3c5b0203bffc21cacc32b1f0891f6ff8",
"score": "0.4794655",
"text": "def spec_params\n params.require(:spec).permit(:description, :spec_type_id, :parent_id, :project_id)\n end",
"title": ""
},
{
"docid": "3c5b0203bffc21cacc32b1f0891f6ff8",
"score": "0.4794655",
"text": "def spec_params\n params.require(:spec).permit(:description, :spec_type_id, :parent_id, :project_id)\n end",
"title": ""
},
{
"docid": "98484bb5cdd81befd07fdb9460fa0309",
"score": "0.47943333",
"text": "def register(patch)\n q = @db[:tdp_patch].where(name: patch.name)\n if q.empty?\n @db[:tdp_patch].insert(\n name: patch.name,\n signature: patch.signature\n )\n else\n q.update(signature: patch.signature)\n end\n end",
"title": ""
}
] |
56d6abf27c64d7ee646fdc38e9fa894f | POST /beginners POST /beginners.json | [
{
"docid": "5bbe039ebc71506f27bbfe33cc9edefc",
"score": "0.7478115",
"text": "def create\n @beginner = current_user.beginners.new(beginner_params)\n\n respond_to do |format|\n if @beginner.save\n format.html { redirect_to @beginner, notice: 'Beginner was successfully created.' }\n format.json { render :show, status: :created, location: @beginner }\n else\n format.html { render :new }\n format.json { render json: @beginner.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] | [
{
"docid": "651f7db17a92fc25fbccf6f99ab7327d",
"score": "0.7196667",
"text": "def create\n @beginner = Beginner.new(params[:beginner])\n\n respond_to do |format|\n if @beginner.save\n format.html { redirect_to @beginner, notice: 'Beginner was successfully created.' }\n format.json { render json: @beginner, status: :created, location: @beginner }\n else\n format.html { render action: \"new\" }\n format.json { render json: @beginner.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a068dc541a2b79d303a7db9d5060db41",
"score": "0.66852134",
"text": "def new\n @beginner = Beginner.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @beginner }\n end\n end",
"title": ""
},
{
"docid": "2befafcc6f076a73b42fca9ccbe2e9dc",
"score": "0.6170454",
"text": "def create\n require 'net/http'\n require 'json'\n\n student = Student.new(student_params)\n\n uri = URI('http://localhost:3000/students.json')\n\n request = Net::HTTP::Post.new uri, { 'Content-Type' => 'application/json' }\n # Appending the data to the request.\n request.body = student.to_json\n\n # Hitting the endpoint.\n response = Net::HTTP.start uri.hostname, uri.port do |http|\n http.request request\n end\n\n # If successful.\n if response.code == '200'\n redirect_to students_path, notice: 'Student was successfully created.'\n else\n render :new\n end\n end",
"title": ""
},
{
"docid": "a0d84d8925a786fa2d039501c6d6d607",
"score": "0.6065022",
"text": "def index\n @beginners = Beginner.all\n end",
"title": ""
},
{
"docid": "7ccc90b20fd5f754957e481fa9ad4c80",
"score": "0.6016724",
"text": "def new_user_and_participant\n @participant = Participant.new\n\n respond_to do |format|\n format.html # new_user_and_participant.html.erb\n format.json { render json: @participant }\n end\n end",
"title": ""
},
{
"docid": "4979a2f816eebceee5cc90841cc88904",
"score": "0.60015476",
"text": "def create\n @team_leader = @client.team_leaders.create(team_leader_params)\n\n respond_to do |format|\n if @team_leader.save\n format.html { redirect_to @team_leader, notice: 'Team leader was successfully created.' }\n format.json { render action: 'show', status: :created, location: @team_leader }\n else\n format.html { render action: 'new' }\n format.json { render json: @team_leader.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ff7cdfd521c9d571de441ddb67f5aa72",
"score": "0.5977822",
"text": "def create_students\n students_url = \"http://104.131.73.180/api/v1/cohorts/#{self.id}/students\"\n students = HTTParty.get(students_url)\n students[\"students\"].each do |student|\n new_student = Student.create(\n id: student[\"id\"],\n name: student[\"data\"][\"first\"] + \" \" + student[\"data\"][\"last\"],\n email: student[\"contact\"][\"email\"],\n cohort_id: self.id,\n phone_number: student[\"contact\"][\"phone\"],\n password: \"12345\"\n )\n # Pony.mail(:to => new_student.email, :from => 'me@ga.co', :subject => 'New Account for GA Attendance created', :body => \"Hello there, #{new_student.name}! We have created an account for you to track your attendance at GA. Your temporary password is 12345. Please log in soon to change it!\")\n end\n end",
"title": ""
},
{
"docid": "cb876061e05a0ac8239844c88105df7f",
"score": "0.594618",
"text": "def create\n @interviewee = Interviewee.new(interviewee_params)\n\n respond_to do |format|\n if @interviewee.save\n format.html { redirect_to @interviewee, notice: 'Interviewee was successfully created.' }\n format.json { render :show, status: :created, location: @interviewee }\n else\n format.html { render :new }\n format.json { render json: @interviewee.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4dae5bffafa98da4d6846fa897e239db",
"score": "0.59461683",
"text": "def create_user\n url = Addressable::URI.new(\n scheme: 'http',\n host: 'localhost',\n port: 3000,\n path: '/users.json'\n ).to_s\n\n puts RestClient.post(\n url,\n { user: { username: \"Gizmo\"} }\n )\nend",
"title": ""
},
{
"docid": "61f88b59363d2317df84b49f028dde0e",
"score": "0.593667",
"text": "def create\n respond_to do |format|\n if @practice.save\n format.json { render json: @practice, status: :created}\n else\n format.json { render json: @practice.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "bf2aa1721c8e42e01ffcb85db5a12179",
"score": "0.593622",
"text": "def create\n @thief_talent = ThiefTalent.new(thief_talent_params)\n\n if @thief_talent.save\n render json: @thief_talent, status: :created, location: @thief_talent\n else\n render json: @thief_talent.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "3134c9ba4dfd00a7cc0153cdfde4c7d4",
"score": "0.59360266",
"text": "def create\n @leader = Leader.new(leader_params)\n\n if @leader.save\n render json: @leader, status: :created, location: @leader\n else\n render json: @leader.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "80287ff9b1504c5d805fc6b318f01293",
"score": "0.5905708",
"text": "def create\n @teacher = Teacher.new(teacher_params)\n if @teacher.save\n render json: @teacher, status: :created\n else\n render json: @teacher.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "dc3409c17ee6363f3c63b18ddfd2d6e8",
"score": "0.5903778",
"text": "def create\n firstname = params[:firstname]\n lastname = params[:lastname]\n gender = params[:gender]\n description = params[:description]\n email = params[:email]\n phone = params[:phone]\n url = params[:url]\n results = {result: false}\n\n @trainer = Trainer.new(firstname: firstname, lastname: lastname, gender: gender, description: description, email: email, phone: phone, url: url)\n\n if @trainer.save\n results[:result] = true\n results[:id] = trainer.id\n end\n results.to_json\n end",
"title": ""
},
{
"docid": "02d67a12a9793b93333f9f8d4bfb7285",
"score": "0.58895653",
"text": "def show\n @beginner = Beginner.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @beginner }\n end\n end",
"title": ""
},
{
"docid": "eb6d3a1642e45c979f2527af047e616d",
"score": "0.5885377",
"text": "def create\n @p = Participant.create(params.permit(:name, :email, :imei))\n render json: @p.id\n end",
"title": ""
},
{
"docid": "131e47a0ad39ba8a66ccdedd2f92e021",
"score": "0.58798486",
"text": "def create\n @learner = Learner.new(params[:learner])\n\n respond_to do |format|\n if @learner.save\n format.html { redirect_to @learner, notice: 'Learner was successfully created.' }\n format.json { render json: @learner, status: :created, location: @learner }\n else\n format.html { render action: \"new\" }\n format.json { render json: @learner.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f1ca74cb8263d6906d32e4e1a931224d",
"score": "0.5869527",
"text": "def create\n @participant = Participant.new(params[:participant])\n\n respond_to do |format|\n if @participant.save\n format.html { redirect_to @participant, notice: 'Participant was successfully created.' }\n format.json { render json: @participant, status: :created, location: @participant }\n else\n format.html { render action: \"new\" }\n format.json { render json: @participant.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f1ca74cb8263d6906d32e4e1a931224d",
"score": "0.5869527",
"text": "def create\n @participant = Participant.new(params[:participant])\n\n respond_to do |format|\n if @participant.save\n format.html { redirect_to @participant, notice: 'Participant was successfully created.' }\n format.json { render json: @participant, status: :created, location: @participant }\n else\n format.html { render action: \"new\" }\n format.json { render json: @participant.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f1ca74cb8263d6906d32e4e1a931224d",
"score": "0.5869527",
"text": "def create\n @participant = Participant.new(params[:participant])\n\n respond_to do |format|\n if @participant.save\n format.html { redirect_to @participant, notice: 'Participant was successfully created.' }\n format.json { render json: @participant, status: :created, location: @participant }\n else\n format.html { render action: \"new\" }\n format.json { render json: @participant.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "505f5dbd7eebd671e4353cb73f57881e",
"score": "0.5844645",
"text": "def create\n @instructor = Instructor.new(params[:instructor])\n\n respond_to do |format|\n if @instructor.save\n format.json { render json: @instructor, status: :created, location: @instructor }\n else\n format.json { render json: @instructor.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4887f72eed28b73b9e5ae9c9274d8fab",
"score": "0.58275384",
"text": "def create\n client = Client.create!(\n name: params[:name],\n last_name: params[:last_name],\n email: params[:email],\n cpf: params[:cpf],\n phone: params[:phone],\n birth_date: params[:birth_date],\n sex: params[:sex],\n profession: params[:profession],\n marital_status: params[:marital_status],\n children: params[:children],\n number_children: params[:number_children],\n zip_code: params[:zip_code],\n street: params[:street],\n number: params[:number],\n neighbohood: params[:neighbohood],\n complement: params[:complement],\n city: params[:city],\n state: params[:state],\n name_emergency: params[:name_emergency],\n phone_emergency: params[:phone_emergency],\n doctor: params[:doctor],\n phone_doctor: params[:phone_doctor],\n agreement: params[:agreement],\n number_agreement: params[:number_agreement],\n hospital: params[:hospital]\n )\n render status: :created, json: client\n end",
"title": ""
},
{
"docid": "a3e8031aa60263d2219e1aa075736898",
"score": "0.5817635",
"text": "def create\n unless current_user.student\n render :nothing => true, :status => :unauthorized\n end\n\n team_project = TeamProject.where(id: params[:team_project_id]).first\n puts current_user.student.first\n puts params\n survey = Survey.create(team_project: team_project,written_by: current_user.student)\n params[:completed_survey].each do |item|\n written_for = Student.where(id: item[:student_id]).first\n Comment.create(text: item[:comment],survey: survey,written_for: written_for)\n Score.create(value: item[:score],survey: survey,written_for: written_for)\n end\n\n render json: { success: true }\n end",
"title": ""
},
{
"docid": "92008bad042579793da1bda239d95223",
"score": "0.5808361",
"text": "def create\n api.post('', nil, 'application/json')\n end",
"title": ""
},
{
"docid": "09d615506e43277865611dffbe6e7b27",
"score": "0.5805706",
"text": "def create\n params[:human_resource][:question].each do |k, v|\n answer = Answer.new\n answer.user_id = params[:human_resource][:user_id]\n answer.question_id = k;\n answer.answer = v;\n answer.save\n end\n respond_to do |format|\n format.html { redirect_to answers_path, notice: 'Questionário criado com sucesso.' }\n format.json { render :index, status: :created, location: @answer }\n end\n end",
"title": ""
},
{
"docid": "f8bf60bc45063d45deed0186101156df",
"score": "0.5789342",
"text": "def create\n @rock_party = RockParty.new(params[:rock_party].merge(user: current_user))\n\n # Add attendees to rock party\n if params[:attendees]\n params[:attendees].each do |user_id|\n user = User.find(user_id)\n @rock_party.users << user\n end\n end\n\n respond_to do |format|\n if @rock_party.save\n format.html { redirect_to @rock_party, notice: 'Rock party was successfully created.' }\n format.json { render json: @rock_party, status: :created, location: @rock_party }\n else\n format.html { render action: \"new\" }\n format.json { render json: @rock_party.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "96b80d4bb211af936f3f03673c95a05e",
"score": "0.577708",
"text": "def create\n unless current_user.instructor\n render :nothing => true, :status => :unauthorized\n end\n \n # create project\n due_date = DateTime.parse(params[:due_date]) + 4/24.0\n project = Project.create(name: params[:project_name], due: due_date, course: $selected_course)\n\n # add teams to project\n team_ids = params[:team_ids]\n team_ids.each do |team_id|\n TeamProject.create(team_id: team_id, project: project)\n end\n\n render json: { success: true }\n end",
"title": ""
},
{
"docid": "843344d8f02a38417148c1400c7ce4a0",
"score": "0.57630557",
"text": "def create\n @team = Team.new(team_params)\n @team.client = current_client if current_client\n respond_to do |format|\n if @team.save\n format.json { render action: 'index', status: :created, locals: {teams: current_client.teams} }\n else\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a8b94a6ec5459cb30b0a6cc76f8fd144",
"score": "0.5758458",
"text": "def create\n @participant = Participant.new(participant_params)\n\n respond_to do |format|\n if @participant.save\n format.html { redirect_to @participant, notice: 'Participant was successfully created.' }\n format.json { render :show, status: :created, location: @participant }\n else\n format.html { render :new }\n format.json { render json: @participant.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a8b94a6ec5459cb30b0a6cc76f8fd144",
"score": "0.5758458",
"text": "def create\n @participant = Participant.new(participant_params)\n\n respond_to do |format|\n if @participant.save\n format.html { redirect_to @participant, notice: 'Participant was successfully created.' }\n format.json { render :show, status: :created, location: @participant }\n else\n format.html { render :new }\n format.json { render json: @participant.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a8b94a6ec5459cb30b0a6cc76f8fd144",
"score": "0.5758458",
"text": "def create\n @participant = Participant.new(participant_params)\n\n respond_to do |format|\n if @participant.save\n format.html { redirect_to @participant, notice: 'Participant was successfully created.' }\n format.json { render :show, status: :created, location: @participant }\n else\n format.html { render :new }\n format.json { render json: @participant.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a8b94a6ec5459cb30b0a6cc76f8fd144",
"score": "0.5758458",
"text": "def create\n @participant = Participant.new(participant_params)\n\n respond_to do |format|\n if @participant.save\n format.html { redirect_to @participant, notice: 'Participant was successfully created.' }\n format.json { render :show, status: :created, location: @participant }\n else\n format.html { render :new }\n format.json { render json: @participant.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "797f38d823622e8f4242eab317825618",
"score": "0.57495624",
"text": "def create\n @participant = Participant.new(participant_params)\n @participant.user = current_user\n\n respond_to do |format|\n if @participant.save\n format.html { redirect_to @participant, notice: 'Participant was successfully created.' }\n format.json { render action: 'show', status: :created, location: @participant }\n else\n format.html { render action: 'new' }\n format.json { render json: @participant.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "927919fdcdb62fd5d2e603696fd9c4b7",
"score": "0.5745216",
"text": "def create\n @participant = Participant.new(participant_params)\n\n if @participant.save\n render :show, status: :created, location: @participant\n else\n render json: @participant.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "441605434946969f687e834b54bf9e78",
"score": "0.57435024",
"text": "def test_create\n g = guides(:no_contests)\n assert g.contests.empty?\n xhr :post, :new, :contest => { :name => 'test create candidate contest', :guide_id => guides(:no_contests).id }\n assert_response :redirect\n assert_redirected_to :controller => 'account', :action => 'signup'\n\n num_candidate_contests = Candidate.count\n login_as :quentin\n xhr :post, :new, :contest => { :name => 'test create candidate contest', :guide_id => guides(:no_contests).id }\n assert_response :success\n assert_equal Candidate.count, num_candidate_contests + 1\n @guide = Guide.find(guides(:no_contests).id)\n assert_equal @guide.contests.first.name, 'test create candidate contest'\n assert_equal @guide.contests.count, 1\n end",
"title": ""
},
{
"docid": "f8b74ce5e7583a7055a41dc7d5960397",
"score": "0.5737285",
"text": "def create\n @club_leader = ClubLeader.new(club_leader_params)\n\n @club = @club_leader.club\n\n respond_to do |format|\n if @club_leader.save\n format.html { redirect_to leadership_url(@club), notice: 'Club leader was successfully created.' }\n format.json { render :show, status: :created, location: @club_leader }\n else\n format.html { render :new }\n format.json { render json: @club_leader.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ab6ac6e2f280dbe8d58347fa70894ccf",
"score": "0.5736754",
"text": "def beginner_params\n params.require(:beginner).permit(:title, :element, :author)\n end",
"title": ""
},
{
"docid": "b8f98bb2d83fbfb5c1124100304e341f",
"score": "0.57348233",
"text": "def create\n render json: Team.create(params[\"team\"])\n end",
"title": ""
},
{
"docid": "b98a0e245c8022292ae9dd8db78b7cc2",
"score": "0.5732515",
"text": "def create\n @research_participant = ResearchParticipant.new(research_participant_params)\n\n respond_to do |format|\n if @research_participant.save\n format.html { redirect_to @research_participant, notice: 'Research participant was successfully created.' }\n format.json { render :show, status: :created, location: @research_participant }\n else\n format.html { render :new }\n format.json { render json: @research_participant.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d9dfd68ebe7cb658a99d77f7624386a3",
"score": "0.57322514",
"text": "def add_participant(name, seed, tournament_id)\n puts \"Adding player\"\n response = RestClient::Request.execute({\n method: :post,\n url: participant_get(tournament_id),\n payload: {\n api_key: API_KEY,\n participant: {\n :name => name,\n :seed => seed\n }\n }\n })\n rescue RestClient::ExceptionWithResponse => e\n puts e.response\n puts response\n puts \"Finished\"\n return response\n end",
"title": ""
},
{
"docid": "0d5ce21b6e22a10eaefe7a9dc91a570e",
"score": "0.57278776",
"text": "def create\n @greeting = Greeting.new(params[:greeting])\n @greeting.users_id = current_user.id\n respond_to do |format|\n if @greeting.save\n format.html { redirect_to @greeting, notice: 'Greeting was successfully created.' }\n format.json { render json: @greeting, status: :created, location: @greeting }\n else\n format.html { render action: \"new\" }\n format.json { render json: @greeting.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b9083b41b6ab16a27b62005fed10027e",
"score": "0.57260317",
"text": "def create\n club = Club.new(club_params)\n if club.save\n render json: club, status: 201, location: [:api, club]\n else\n failed_to_create(club, \"club\")\n end\n end",
"title": ""
},
{
"docid": "49d3fa43cc27183c86858e281f0f4c07",
"score": "0.5713241",
"text": "def create\n participant = Participant.create!(participant_params)\n if participant\n render json: { status: 'SUCCESS', message: 'Invite sent', data: participant }, status: :ok\n else\n render json: { status: 'ERROR', message: 'Invite not sent' }, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "d942ad9fe01239d3a7192441ef564147",
"score": "0.5696909",
"text": "def create\n @instructor = Instructor.new(instructor_params)\n if @instructor.save\n render json: @instructor, status: :created, location: @instructor\n else\n render json: @instructor.errors, status: :unprocessable_entity\n \n end\n end",
"title": ""
},
{
"docid": "3bc89e33c6594eceb134dff7bc04fad7",
"score": "0.5687528",
"text": "def create\n @fellow = Fellow.new(fellow_params)\n\n if @fellow.save\n render json: @fellow, status: :created, location: @fellow\n else\n render json: @fellow.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "22201f22e629399ac67e583badeab894",
"score": "0.56862277",
"text": "def post_users_json payload\n\tJSON.parse ( rest_client_request :post, HF_URL, payload ).body\nend",
"title": ""
},
{
"docid": "ebaecad855707e6bd7b89873d59c4a6f",
"score": "0.5683562",
"text": "def create\n @participant = Participant.new(meeting_id: @meeting.id,\n name: params[:participant][:name])\n\n respond_to do |format|\n if @participant.save\n format.html { redirect_to @participant, notice: 'Participant was successfully created.' }\n format.json { render json: @participant, status: :created, location: @participant }\n else\n format.html { render action: \"new\" }\n format.json { render json: @participant.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0167967283e1d7891cd1e9f253fe9f55",
"score": "0.56806535",
"text": "def create\n @greet = Greet.new(params[:greet])\n\n respond_to do |format|\n if @greet.save\n format.html { redirect_to @greet, notice: 'Greet was successfully created.' }\n format.json { render json: @greet, status: :created, location: @greet }\n else\n format.html { render action: \"new\" }\n format.json { render json: @greet.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "fd8649cf6e70890b9e55e75b327f8bea",
"score": "0.56800145",
"text": "def create\n @participant = Participant.new(participant_params)\n\n respond_to do |format|\n if @participant.save\n format.html { redirect_to @participant, notice: \"Participant was successfully created.\" }\n format.json { render :show, status: :created, location: @participant }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @participant.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5f94b99f223aafa2b98ee37c61dda0d6",
"score": "0.5679887",
"text": "def create\n @training = Training.new(training_params)\n\n if @training.save\n render json: @training, status: :created, location: @training\n else\n render json: @training.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "d3a7943a46fb55cc59a8c0d6d3229bad",
"score": "0.56786656",
"text": "def create\n @partner = Partner.new(params[:partner])\n\n respond_to do |format|\n if @partner.save\n format.html { redirect_to partners_url, notice: \"Partner was successfully created.\" }\n format.json { render json: @partner, status: :created, :location => @partner }\n else\n format.html { render action: \"new\" }\n format.json { render json: @partner.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0f3e160a7fc6d99c0246a355550496ff",
"score": "0.56728876",
"text": "def create\n @participant = Participant.new(params[:participant])\n person = Person.find(params[:person_id])\n\n respond_to do |format|\n if @participant.save\n @participant.person = person\n @participant.save!\n format.html { redirect_to(participants_path, :notice => 'Participant was successfully created.') }\n format.json { render :json => @participant }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @participant.errors }\n end\n end\n end",
"title": ""
},
{
"docid": "0e3b2c089c2831b8d3a511a021f9d3ba",
"score": "0.5670038",
"text": "def create\n @trainer = Trainer.new(params[:trainer])\n\n respond_to do |format|\n if @trainer.save\n format.html { redirect_to @trainer, :notice => 'Trainer was successfully created.' }\n format.json { render :json => @trainer, :status => :created, :location => @trainer }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @trainer.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2a65332e0f3de0626dc273b0f5913421",
"score": "0.5668297",
"text": "def create\n @twentyfife = Twentyfive.new(twentyfife_params)\n\n respond_to do |format|\n if @twentyfife.save\n format.html { redirect_to @twentyfife, notice: 'Twentyfive was successfully created.' }\n format.json { render action: 'show', status: :created, location: @twentyfife }\n else\n format.html { render action: 'new' }\n format.json { render json: @twentyfife.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "cfd43faa58fd4062400b6dd84e2d2920",
"score": "0.5666669",
"text": "def create\n @vocabulary_test = VocabularyTest.generate(current_user)\n respond_to do |format|\n format.html { redirect_to @vocabulary_test, notice: 'Vocabulary test was successfully created.' }\n format.json { render :show, status: :created, location: @vocabulary_test }\n end\n end",
"title": ""
},
{
"docid": "35d9868b3b05afaf8b03b928148d70c7",
"score": "0.5664697",
"text": "def create\n @besteacher = Besteacher.new(besteacher_params)\n\n respond_to do |format|\n if @besteacher.save\n format.html { redirect_to @besteacher, notice: 'Best Teacher was successfully created.' }\n format.json { render :show, status: :created, location: @besteacher }\n else\n format.html { render :new }\n format.json { render json: @besteacher.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d7526d0b95bc7e25dd9004346d9f6a9d",
"score": "0.5659402",
"text": "def new\n @learner = Learner.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @learner }\n end\n end",
"title": ""
},
{
"docid": "02abca95cc48e5aebfd552203edd91f6",
"score": "0.5658119",
"text": "def create_user\n url = Addressable::URI.new(\n scheme: 'http',\n host: 'localhost',\n port: 3000,\n path: '/users.json'\n ).to_s\n\n begin\n puts RestClient.post(\n url,\n { user: { name: \"Gizmo\", email: 'cat@cat.com' } }\n )\n rescue RestClient::Exception => e\n puts e.message\n end\n\nend",
"title": ""
},
{
"docid": "92c7f693cfa257ede7ec2a8fe34bd6ee",
"score": "0.5657432",
"text": "def create\n @fitness = current_user.fitnesses.new(fitness_params)\n @fitness.author = current_user.name + \" \" + current_user.surname\n\n exercises = \"\"\n params[:exercises].each do |exercise|\n exercises = exercises + exercise + \"|\"\n end\n exercises = exercises + \"a\"\n @fitness.exercises = exercises\n\n respond_to do |format|\n if @fitness.save\n format.html { redirect_to @fitness, notice: 'Fitness was successfully created.' }\n format.json { render :show, status: :created, location: @fitness }\n else\n format.html { render :new }\n format.json { render json: @fitness.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a46d38bc375ac96a6c3f3e9401b8ad7c",
"score": "0.565352",
"text": "def create\n @partner = Partner.new(params[:partner])\n\n respond_to do |format|\n if @partner.save\n format.html { redirect_to @partner, notice: 'Partner was successfully created.' }\n format.json { render json: @partner, status: :created, location: @partner }\n else\n format.html { render action: \"new\" }\n format.json { render json: @partner.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6414ef383f00ef8b8fc33ed68133eee8",
"score": "0.5640884",
"text": "def create\n @tutorial = @framework.tutorials.build(tutorial_params)\n\n if @tutorial.save\n render :show, status: :created\n else\n render json: @tutorial.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "d3333408afc728df99066515e5f03e7c",
"score": "0.5636812",
"text": "def create\n @juice = Juice.new(juice_params)\n\n respond_to do |format|\n if @juice.save\n format.html { redirect_to @juice, notice: 'Juice was successfully created.' }\n format.json { render :show, status: :created, location: @juice }\n else\n format.html { render :new }\n format.json { render json: @juice.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e68ef333075979faa0d4f875455959a5",
"score": "0.5628538",
"text": "def create\n params[:competitiveness][:question].each do |k, v|\n answer = Answer.new\n answer.user_id = params[:competitiveness][:user_id]\n answer.question_id = k;\n answer.answer = v;\n answer.save\n end\n respond_to do |format|\n format.html { redirect_to answers_path, notice: 'Questionário criado com sucesso.' }\n format.json { render :index, status: :created, location: @answer }\n end\n end",
"title": ""
},
{
"docid": "1b963c737c256f2f7ea55ed0b1e5ce3a",
"score": "0.5626167",
"text": "def create\n @research_partner = ResearchPartner.new(research_partner_params)\n\n respond_to do |format|\n if @research_partner.save\n format.html { redirect_to @research_partner, notice: 'Research partner was successfully created.' }\n format.json { render :show, status: :created, location: @research_partner }\n else\n format.html { render :new }\n format.json { render json: @research_partner.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9bc07ea84c0a9cfc028ccc46bdf66fdf",
"score": "0.5624809",
"text": "def create\n @partner = Partner.new(partner_params)\n\n respond_to do |format|\n if @partner.save\n format.html { redirect_to partners_path, notice: 'Partner was successfully created.' }\n format.json { render :index, status: :created, location: partners_path }\n else\n format.html { render :new }\n format.json { render json: @partner.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "582a966a6cd7f56bab6e4c5fde48cc62",
"score": "0.56231683",
"text": "def set_beginner\n @beginner = Beginner.find(params[:id])\n end",
"title": ""
},
{
"docid": "4a037d0773e2d552745c77082759bcca",
"score": "0.5620334",
"text": "def create\n @enjoy = Enjoy.new(params[:enjoy])\n\n respond_to do |format|\n if @enjoy.save\n format.html { redirect_to @enjoy, :notice => 'Enjoy was successfully created.' }\n format.json { render json: @enjoy, :status => :created, location: @enjoy }\n else\n format.html { render action: \"new\" }\n format.json { render json: @enjoy.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "773e3d385784fc5d59afccbb0b3e056a",
"score": "0.56098974",
"text": "def create\n @student_testimony = StudentTestimony.new(student_testimony_params)\n\n if @student_testimony.save\n render :show, status: :created, location: @student_testimony\n else\n render json: @student_testimony.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "977c7a9d02c7f419c5b36cdbe5ea23fa",
"score": "0.56058925",
"text": "def create\n @participator = Participator.new(participator_params)\n\n respond_to do |format|\n if @participator.save\n format.html { redirect_to @participator, notice: 'Participator was successfully created.' }\n format.json { render action: 'show', status: :created, location: @participator }\n else\n format.html { render action: 'new' }\n format.json { render json: @participator.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "92a308b02d4bbab3fb5226cb04ebd854",
"score": "0.5597876",
"text": "def create\n @guest_lecturer = GuestLecturer.new(guest_lecturer_params)\n\n respond_to do |format|\n if @guest_lecturer.save\n format.html { redirect_to @guest_lecturer, notice: 'Guest lecturer was successfully created.' }\n format.json { render :show, status: :created, location: @guest_lecturer }\n else\n format.html { render :new }\n format.json { render json: @guest_lecturer.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6d609c69cc44a44c47ed6ca6078069f6",
"score": "0.5597219",
"text": "def index\n @teachers = Teacher.all\n render json: @teachers\n end",
"title": ""
},
{
"docid": "db0b663adbb49b055e5f0690873d439c",
"score": "0.5596568",
"text": "def create\n\n @talk.contestant_id = current_user.id\n\n respond_to do |format|\n if @talk.save\n format.html { redirect_to @talk, notice: 'Talk was successfully created.' }\n format.json { render json: @talk, status: :created, location: @talk }\n else\n format.html { render action: \"new\" }\n format.json { render json: @talk.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9ffbbbf6c58001f509a932d594c2e067",
"score": "0.5594651",
"text": "def index\n @partners = Partner.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @partners }\n end\n end",
"title": ""
},
{
"docid": "abe4638d33dcb5aa5cf92d5d96e99c41",
"score": "0.5590179",
"text": "def create\n\t\t@tut = Tutorial.new(tut_params)\n\t\tif @tut.save\n\t\t\trender json: @tut, status: :created\n\t\telse\n\t\t\t render json: @tut.errors, status: :unprocessable_entity\n\t\tend \n\tend",
"title": ""
},
{
"docid": "423610b421c88265e7611c1894b4c92a",
"score": "0.5587211",
"text": "def create\n hero, success = jsonapi_create.to_a\n\n if success\n render_jsonapi(hero, scope: false)\n else\n render_errors_for(hero)\n end\n end",
"title": ""
},
{
"docid": "4b9ebc80ff2e67a2fcf17267f61dd039",
"score": "0.5584173",
"text": "def create\n render json: current_user.questions.create!(question_params_with_tag), status: :ok\n end",
"title": ""
},
{
"docid": "aea8dae9a737d99c3508fc5abc681756",
"score": "0.55799174",
"text": "def create\n @wife = Wife.new(wife_params)\n\n respond_to do |format|\n if @wife.save\n format.html { redirect_to @wife, notice: 'Wife was successfully created.' }\n format.json { render :show, status: :created, location: @wife }\n else\n format.html { render :new }\n format.json { render json: @wife.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "425ec961567670a79db8058c41e117d8",
"score": "0.55775833",
"text": "def create\n @academy_tutorial = Academy::Tutorial.new(academy_tutorial_params)\n\n respond_to do |format|\n if @academy_tutorial.save\n flash[:notice] = \"Tutorial criado com sucesso.\"\n format.html { redirect_to @academy_tutorial, notice: 'Tutorial criado com sucesso created' }\n format.json { render action: 'show', status: :created, location: @academy_tutorial }\n else\n format.html { render action: 'new' }\n format.json { render json: @academy_tutorial.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "378e0f9b6e7e73d948bafca23c6148bb",
"score": "0.5577274",
"text": "def create\n @online_quiz = OnlineQuiz.new(params[:online_quiz])\n\n respond_to do |format|\n if @online_quiz.save\n format.html { redirect_to @online_quiz, notice: 'Online quiz was successfully created.' }\n format.json { render json: @online_quiz, status: :created, location: @online_quiz }\n else\n format.html { render action: \"new\" }\n format.json { render json: @online_quiz.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "70f997a9f3cbc0196b3d41a5cb0b0951",
"score": "0.557699",
"text": "def create\n @teacher = Teacher.new(params[:teacher])\n\n respond_to do |format|\n if @teacher.save\n format.html { redirect_to @teacher, notice: 'Teacher was successfully created.' }\n format.json { render json: @teacher, status: :created, location: @teacher }\n else\n format.html { render action: \"new\" }\n format.json { render json: @teacher.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "70f997a9f3cbc0196b3d41a5cb0b0951",
"score": "0.557699",
"text": "def create\n @teacher = Teacher.new(params[:teacher])\n\n respond_to do |format|\n if @teacher.save\n format.html { redirect_to @teacher, notice: 'Teacher was successfully created.' }\n format.json { render json: @teacher, status: :created, location: @teacher }\n else\n format.html { render action: \"new\" }\n format.json { render json: @teacher.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "70f997a9f3cbc0196b3d41a5cb0b0951",
"score": "0.557699",
"text": "def create\n @teacher = Teacher.new(params[:teacher])\n\n respond_to do |format|\n if @teacher.save\n format.html { redirect_to @teacher, notice: 'Teacher was successfully created.' }\n format.json { render json: @teacher, status: :created, location: @teacher }\n else\n format.html { render action: \"new\" }\n format.json { render json: @teacher.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "621b3e5531c3c09b908883912b96a7d5",
"score": "0.55742764",
"text": "def index\n @partners = Partner.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @partners }\n end\n end",
"title": ""
},
{
"docid": "9381d4ec1ecda33fc17d8796c362f00b",
"score": "0.5573632",
"text": "def destroy\n @beginner.destroy\n respond_to do |format|\n format.html { redirect_to beginners_url, notice: 'Beginner was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "7d263b87f19e4f6cd1ad9dd5f03073d0",
"score": "0.55718374",
"text": "def create\n @partner = Partner.new(partner_params)\n\n respond_to do |format|\n if @partner.save\n format.html { redirect_to '/users/sign_up', notice: 'Partner was successfully created.' }\n format.json { render :show, status: :created, location: @partner }\n else\n format.html { render :new }\n format.json { render json: @partner.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "660733276d25492a55236ddab1cb84ba",
"score": "0.5569577",
"text": "def create\n @interviewee = Interviewee.new(params[:interviewee])\n @nav_active = 'new'\n respond_to do |format|\n if @interviewee.save\n format.html { redirect_to @interviewee, notice: 'Interviewee was successfully created.' }\n format.json { render json: @interviewee, status: :created, location: @interviewee }\n else\n format.html { render action: \"new\" }\n format.json { render json: @interviewee.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b37bf2140c3612f5063019568f7a493b",
"score": "0.55691594",
"text": "def create\n @leader = Leader.new(leader_params)\n\n respond_to do |format|\n if @leader.save\n format.html { redirect_to @leader, notice: 'Leader was successfully created.' }\n format.json { render :show, status: :created, location: @leader }\n else\n format.html { render :new }\n format.json { render json: @leader.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "cce2498ec265089ef9d20cdfd735a80e",
"score": "0.5569003",
"text": "def new\n @request = current_user.practice.requests.build\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @request }\n end\n end",
"title": ""
},
{
"docid": "63c60b703eabc17d5928133f80d817c5",
"score": "0.55684525",
"text": "def destroy\n @beginner = Beginner.find(params[:id])\n @beginner.destroy\n\n respond_to do |format|\n format.html { redirect_to beginners_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "38d273a7672d722a4809a69dd59a35c2",
"score": "0.5563954",
"text": "def create\n @nice_person = NicePerson.new(nice_person_params)\n\n respond_to do |format|\n if @nice_person.save\n format.html { redirect_to @nice_person, notice: 'Nice person was successfully created.' }\n format.json { render :show, status: :created, location: @nice_person }\n else\n format.html { render :new }\n format.json { render json: @nice_person.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ced318a06f04ba1743e3f184a44c3487",
"score": "0.5563823",
"text": "def create\n @api_v1_initiative_invitee = Api::V1::InitiativeInvitee.new(api_v1_initiative_invitee_params)\n\n respond_to do |format|\n if @api_v1_initiative_invitee.save\n format.html { redirect_to @api_v1_initiative_invitee, notice: 'Initiative invitee was successfully created.' }\n format.json { render :show, status: :created, location: @api_v1_initiative_invitee }\n else\n format.html { render :new }\n format.json { render json: @api_v1_initiative_invitee.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3099bd81baf2ff49d0593f5c656f5f3c",
"score": "0.55598235",
"text": "def create\n @girl = Girl.new(params[:girl])\n\n respond_to do |format|\n if @girl.save\n format.html { redirect_to @girl, notice: 'Girl was successfully created.' }\n format.json { render json: @girl, status: :created, location: @girl }\n else\n format.html { render action: \"new\" }\n format.json { render json: @girl.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3099bd81baf2ff49d0593f5c656f5f3c",
"score": "0.55598235",
"text": "def create\n @girl = Girl.new(params[:girl])\n\n respond_to do |format|\n if @girl.save\n format.html { redirect_to @girl, notice: 'Girl was successfully created.' }\n format.json { render json: @girl, status: :created, location: @girl }\n else\n format.html { render action: \"new\" }\n format.json { render json: @girl.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5621541d807d8aa968629aa6a38f4077",
"score": "0.5557591",
"text": "def create\n @techy = Techie.new(params[:techy])\n\n respond_to do |format|\n if @techy.save\n format.html { redirect_to @techy, notice: 'Techie was successfully created.' }\n format.json { render json: @techy, status: :created, location: @techy }\n else\n format.html { render action: \"new\" }\n format.json { render json: @techy.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "699e394d7c2ce1c410c1931576fdc871",
"score": "0.55530787",
"text": "def new\n @participant = Participant.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @participant }\n end\n end",
"title": ""
},
{
"docid": "699e394d7c2ce1c410c1931576fdc871",
"score": "0.55530787",
"text": "def new\n @participant = Participant.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @participant }\n end\n end",
"title": ""
},
{
"docid": "699e394d7c2ce1c410c1931576fdc871",
"score": "0.55530787",
"text": "def new\n @participant = Participant.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @participant }\n end\n end",
"title": ""
},
{
"docid": "f9b3731773d2dfc3f43a3f4e5a7afe8a",
"score": "0.55441695",
"text": "def create\n render json: Developer.create(params[\"developer\"])\n end",
"title": ""
},
{
"docid": "b493ef60fa8c5098b730bd0383412e35",
"score": "0.5541143",
"text": "def create\n @exams = Exam.new(exam_params)\n laboratorys = params[:laboratory_id]\n\n if @exams.save\n laboratorys.each do |laboratory|\n LaboratoryExam.create(laboratory_id: laboratory, exam_id: @exams.id)\n end\n @exams\n else\n render json: @exams.errors.full_messages.join(''), status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "77f1b19f744de66de60cb7837c0f479f",
"score": "0.55370575",
"text": "def create_contact \n url = Addressable::URI.new(\n scheme: 'http',\n host: 'localhost',\n port: 3000,\n path: '/contacts.json'\n ).to_s\n\n puts RestClient.post(\n url,\n { Contact: { name: \"Contact 1\", email: \"contact 1 email\", user_id: 2} }\n # { user: { name: \"Gizmo\", email: \"gizmo@gizmo.gizmo\" } }\n )\nend",
"title": ""
}
] |
578621215ea66306155633d41bfb5f93 | def check_permutation(str1,str2) return false if str1.gsub(/[^azAZ]/,"").chars.sort != str2.gsub(/[^azAZ]/,"").chars.sort true end Check Permutation: Given two strings,write a method to decide if one is a permutation of the other. | [
{
"docid": "c1b754899703300567cb18fb106beba9",
"score": "0.84882283",
"text": "def check_permutation(str1,str2)\n hash = Hash.new 0\n str1.chars.each do |let|\n hash[let] += 1\n end\n str2.chars.each do |let|\n hash[let] -= 1\n return false if hash[let] < 0\n end\n true\nend",
"title": ""
}
] | [
{
"docid": "cb6a14a661bde8bf6a5fbb89004f6faf",
"score": "0.8917887",
"text": "def check_permutation_brute_force?(str_1, str_2)\n str_1.chars.sort == str_2.chars.sort\nend",
"title": ""
},
{
"docid": "5a20d8b8a69bfc26d248151eaa4227c6",
"score": "0.8898815",
"text": "def is_permutation(string1, string2)\n\t\tstring1.chars.sort.join == string2.chars.sort.join\n\tend",
"title": ""
},
{
"docid": "2a7ee8e7ddc06de448878315dd2df1f6",
"score": "0.8788487",
"text": "def is_permutation1?(string1, string2)\n string1.downcase.chars.sort == string2.downcase.chars.sort\nend",
"title": ""
},
{
"docid": "b02944c82609ee04e62376d8630f6274",
"score": "0.875561",
"text": "def permutation?(str1, str2)\n\treturn str1.chars.sort == str2.chars.sort\nend",
"title": ""
},
{
"docid": "9b6ebc4e28afbd7dab4a59f1d65b24b0",
"score": "0.86909604",
"text": "def is_permutation?(str1, str2)\n str1.split(\"\").sort == str2.split(\"\").sort\nend",
"title": ""
},
{
"docid": "01dd538463777110c392db195578e8e1",
"score": "0.8681237",
"text": "def checkPermutation? string0, string1 \n \n # Edge case checks.\n if string0.length != string1.length\n return false\n end\n\n # Sort strings, makes checking permutation efficient.\n sortedString0 = string0.chars.sort.join\n sortedString1 = string1.chars.sort.join\n \n # Compare strings, if not equal, not permutations of one another.\n if sortedString0.eql? sortedString1 \n return true\n end \n\n # Strings not equal.\n return false\n\nend",
"title": ""
},
{
"docid": "3901aaf5813162430219c77eb5088875",
"score": "0.85936",
"text": "def is_permutation?(str1, str2)\n hash1 = build_char_map(str)\n hash2 = build_char_map(str2)\n hash1 == hash2\nend",
"title": ""
},
{
"docid": "23baa7e34f0672ea95501429d95f0c4a",
"score": "0.8571704",
"text": "def permutations?(str1, str2)\n str1.chars.sort == str2.chars.sort\nend",
"title": ""
},
{
"docid": "1e32e6fe76606f04a810035c879ccb62",
"score": "0.8549156",
"text": "def check_permutation(str1, str2)\n return false if str1.length != str2.length\n\n counts1 = Hash.new { |k, v| k[v] = 0 }\n\n str1.each_char { |char| counts1[char] += 1 }\n\n str2.each_char do |char|\n return false if counts1[char] == nil || counts1[char] == -1\n counts1[char] -= 1\n end\n\n counts1.keys.all? { |k| counts1[k] == 0 }\nend",
"title": ""
},
{
"docid": "ac3513426349808714ec0ed11f2bd85a",
"score": "0.85432035",
"text": "def is_Permutation(string, string2)\n firstString = string.chars.sort.join\n secondString = string2.chars.sort.join\n if firstString == secondString\n return true\n else\n return false\n end\nend",
"title": ""
},
{
"docid": "6f8416660ae114375ce8462e8f902203",
"score": "0.8525494",
"text": "def permutations?(str1, str2)\n return false if str1.length != str2.length\n str1.chars.sort == str2.chars.sort\nend",
"title": ""
},
{
"docid": "3e2e4466132d8e4b2c123af40477c665",
"score": "0.85250384",
"text": "def isPermutation2?(str1, str2)\n return false if str1.length != str2.length\n letters = Array.new(128)\n str1.each_char do |ch|\n index = ch.ord\n if letters[index]\n letters[index] += 1\n else\n letters[index] = 1\n end\n end\n\n str2.each_char do |ch|\n index = ch.ord\n if letters[index]\n letters[index] -= 1\n if letters[index] < 0\n return false\n end\n else\n return false\n end\n end\n\n true\nend",
"title": ""
},
{
"docid": "af861e61cab2c1e76122c9cc27f3c51f",
"score": "0.85063756",
"text": "def permutation?(str_1, str_2)\n str_1.chars.sort.join == str_2.chars.sort.join\nend",
"title": ""
},
{
"docid": "5faae80d26c090c1b8d98b44ea391560",
"score": "0.8491253",
"text": "def check_permutation(str1, str2)\n return false if str1.length != str2.length\n # put str1 into a hash -- O(n)\n hash = {}\n str1.each_char do |el|\n hash[el] = true\n end \n\n # check if str2 has all the same charaters as str1 using the hash\n # O(n)\n str2.each_char do |el|\n return false if !hash[el]\n end \n true\nend",
"title": ""
},
{
"docid": "de694fe33cdca89e10e623aa25a0df7a",
"score": "0.8489316",
"text": "def is_permutation?(string1, string2)\n string1_hash = Hash.new(0)\n string2_hash = Hash.new(0)\n\n return false if string1.length != string2.length\n\n string1.length.times do |i|\n string1_hash[string1[i]] += 1\n end\n\n string2.length.times do |i|\n string2_hash[string2[i]] += 1\n end\n\n string2_hash.each do |k, v|\n return false if string1_hash[k] != v\n end\n\n return true\nend",
"title": ""
},
{
"docid": "4e5d56236d0eb158bb86e76f6275af9e",
"score": "0.8485723",
"text": "def is_permutation?(s1, s2)\r\n return false if s1.length != s2.length\r\n s1.split(\"\").sort == s2.split(\"\").sort\r\nend",
"title": ""
},
{
"docid": "5ab908c6f33dbbc8ff4889d44d209235",
"score": "0.847394",
"text": "def is_perm?(string1, string2)\n return false if string1.length != string2.length\n \n char_hash = {}\n \n string1.each_char do |char|\n char = char.downcase\n if char_hash[char]\n char_hash[char] += 1\n else\n char_hash[char] = 1\n end\n end\n \n string2.each_char do |char|\n char = char.downcase\n if !char_hash[char]\n return false\n elsif char_hash[char] > 1\n char_hash[char] -= 1\n elsif char_hash[char] == 1\n char_hash.delete(char)\n end\n end\n \n return char_hash.empty?\nend",
"title": ""
},
{
"docid": "8aec1a0b964c60ba7f40280ef6023305",
"score": "0.8471888",
"text": "def is_permutation?(str1, str2)\n hash = Hash.new(0)\n str1.each_char { |chr| hash[chr] += 1 }\n str2.each_char { |chr| hash[chr] -= 1 }\n hash.each { |k , v| return false if v != 0 }\n true\n # O(n) complexity\nend",
"title": ""
},
{
"docid": "cade07f6d8c4370071e5a1ca6f2dfe21",
"score": "0.8470953",
"text": "def isPermutation1?(str1, str2)\n return false if str1.length != str2.length\n str1.chars.sort.join == str2.chars.sort.join\nend",
"title": ""
},
{
"docid": "a01180b3e04d1db042614224821e7b61",
"score": "0.84615105",
"text": "def permutation_of_string(string_1, string_2)\n no_spaces_string_1 = string_1.gsub(/\\s+/, '')\n no_spaces_string_2 = string_2.gsub(/\\s+/, '')\n sort_1 = no_spaces_string_1.split('').sort\n sort_2 = no_spaces_string_2.split('').sort\n if sort_1 != sort_2\n false\n else\n true\n end\nend",
"title": ""
},
{
"docid": "3323648da2dc7b55f1794d7c189b2d04",
"score": "0.84540355",
"text": "def permutation?(string_a, string_b)\n return false if string_a.length != string_b.length\n\n letters = Array.new(128, 0)\n idx = 0\n while idx < string_a.length\n letters[string_a[idx].ord] += 1\n idx += 1\n end\n\n idx = 0\n while idx < string_b.length\n letters[string_b[idx].ord] -= 1\n return false if letters[string_b[idx].ord] < 0\n idx += 1\n end\n\n true\nend",
"title": ""
},
{
"docid": "82f51703df6ee7720e454254b05ed997",
"score": "0.8436844",
"text": "def permutation_1?(str1, str2)\n # Sorted permutations are the same\n str1.split('').sort == str2.split('').sort\nend",
"title": ""
},
{
"docid": "8e0f8500896a883dde162a46d366dc4e",
"score": "0.83888173",
"text": "def is_permutation str1, str2\n mp1, mp2 = {}, {}\n str1.each_char do |c|\n if mp1.has_key? c\n mp1[c] += 1\n else\n mp1[c] = 1\n end\n end\n str2.each_char do |c|\n if mp2.has_key? c\n mp2[c] += 1\n else\n mp2[c] = 1\n end\n end\n\n return mp1 == mp2\nend",
"title": ""
},
{
"docid": "71cffe104c4dd286804ad9f4afbb9344",
"score": "0.8376802",
"text": "def permutation_2?(str1, str2)\n return false if str1.length != str2.length\n visited_chars = Hash.new { |h, k| h[k] = 0 }\n # Add 1 for each char in str1\n str1.each_char { |char| visited_chars[char] += 1 }\n # Subtract 1 for each char in str1\n str2.each_char { |char| visited_chars[char] -= 1 }\n # All numbers are zero if these strings have the same characters\n visited_chars.values.all?(&:zero?)\nend",
"title": ""
},
{
"docid": "abd5852d6bd07f3fb7a6571ff408ca7d",
"score": "0.8356842",
"text": "def isPermutation(s1, s2)\n # Convert each string to list of characters.\n s1, s2 = s1.split(''), s2.split('')\n # Sort each list and compare whether they are equal\n return s1.sort! == s2.sort!\nend",
"title": ""
},
{
"docid": "cb2e758d86a8076863632257019a86df",
"score": "0.83557355",
"text": "def permutaion?(str1, str2)\n str1.chars.sort == str2.chars.sort\nend",
"title": ""
},
{
"docid": "a2d802a3f2be3a474b07fb0f71679a45",
"score": "0.8326102",
"text": "def is_permutation?(s1, s2)\n return false if s1.length != s2.length\n sort(s1) == sort(s2)\nend",
"title": ""
},
{
"docid": "18ceaa81f123fb284d411cfdf0cfe93d",
"score": "0.82702607",
"text": "def permutation(str1, str2)\n str1.split('').sort == str2.split('').sort\nend",
"title": ""
},
{
"docid": "b65dafe8d844e8607ba63e25f5d94507",
"score": "0.82528126",
"text": "def permutations(string1, string2)\n\n\tpermutation=false\n\tarray=string2.split('')\n\n\tarrayPermutations=array.permutation.map &:join \n\n\tfor i in 0..arrayPermutations.length\n\t\tif string1.eql? arrayPermutations[i]\n\t\t\tpermutation=true\n\t\tend\n\tend\n\tp permutation\n end",
"title": ""
},
{
"docid": "268caf2d30c6df7f67f5843b2e51fccd",
"score": "0.8244668",
"text": "def permutation?(string_1, string_2)\n # return false if string_1.length != string_2.length\n\n hash = Hash.new(0)\n\n string_1.split(\"\").each {|letter| hash[letter] += 1}\n\n string_2.split(\"\").each do |char|\n hash[char] -= 1\n return false if hash[char] < 0\n end\n\n hash.each_value {|value| return false if value != 0}\n true\nend",
"title": ""
},
{
"docid": "97f57f7b7fd9042d81206622968389c5",
"score": "0.82428956",
"text": "def permutations?(string1, string2)\n # take two strings as arguments and returns true if one string is a permutation of the other\n \n inventory_hash = {}\n string1.split(\"\").each do |char|\n if inventory_hash[char]\n inventory_hash[char] += 1\n else\n inventory_hash[char] = 1\n end\n end\n \n string2.split(\"\").each do |char|\n if ! inventory_hash[char]\n return false\n elsif inventory_hash[char] == 1\n inventory_hash[char] = nil\n elsif inventory_hash[char] > 1\n inventory_hash[char] -= 1\n end\n end\n \n inventory_hash.values.each do |value|\n return false if value\n end\n \n return true\nend",
"title": ""
},
{
"docid": "5ed185086752b0a477e326d1f96d5a51",
"score": "0.81874144",
"text": "def permutations?(string1, string2)\n hash_check = {}\n string1.chars.each do |letter|\n hash_check[letter] = true\n end \n \n result = []\n string2.chars.each do |i|\n if hash_check[i] == true\n result << 1 \n end\n end \n \n if result.length == string1.length\n return true\n else\n return false\n end \nend",
"title": ""
},
{
"docid": "c99dfc7af8a3054c1a0ff713498a9e39",
"score": "0.81621224",
"text": "def permutations?(string1, string2)\n hash = {}\n\n string1.chars.each do |letter|\n hash.has_key?(letter) ? hash[letter] += 1 : hash[letter] = 1\n end\n\n string2.chars.each do |letter|\n return false unless hash.has_key?(letter) && hash[letter] > 0 #quickly catch obvious fail cases \n hash[letter] -= 1\n end\n\n return !(hash.any? {|key, value| value > 0})\nend",
"title": ""
},
{
"docid": "04505587af9d2a8762a32ab4f0fa6dad",
"score": "0.8158386",
"text": "def permutations?(string1, string2)\n return false if string1.length != string2.length\n \n hash = Hash.new\n\n string1.chars.each do |char|\n hash[char] = 1\n end\n\n string2.chars.each do |char|\n if hash.key? char\n hash.delete (char)\n end\n end\n\n return hash.empty?\nend",
"title": ""
},
{
"docid": "8c3f5c95e0173a3628030cdf4da66969",
"score": "0.8156296",
"text": "def isPermutation3?(str1, str2)\n return false if str1.length != str2.length\n letters = Hash.new(0)\n str1.each_char do |ch|\n letters[ch] += 1\n end\n\n str2.each_char do |ch2|\n letters[ch2] -=1\n return false if letters[ch2] < 0\n end\n true\nend",
"title": ""
},
{
"docid": "d4ef792432b439e8f50a4fefc6c39999",
"score": "0.81338173",
"text": "def check_permutation_by_char_count?(str_1, str_2)\n str_1_char_count = count_chars(str_1)\n str_2_char_count = count_chars(str_2)\n return false if str_1_char_count.to_a.size != str_2_char_count.to_a.size\n\n str_1_char_count.each do |k, v|\n return false if str_2_char_count[k] != v\n end\nend",
"title": ""
},
{
"docid": "952d8bd2feb279b1c9916771064308f1",
"score": "0.81274354",
"text": "def permutations?(string1, string2)\n # edge case\n return false if string1.length != string2.length\n\n hash = {} \n\n string1.each_char do |char|\n hash[char] ? hash[char] += 1 : hash[char] = 1 \n end \n\n string2.each_char do |char|\n hash[char] ? hash[char] -= 1 : false \n end \n\n\n hash.values.find { |num| num != 0 } ? false : true\nend",
"title": ""
},
{
"docid": "b9186fc4518d4cef158e1e62d6fab0ec",
"score": "0.81231",
"text": "def are_permutations?(str_one, str_two)\n return false if str_one.length != str_two.length\n str_one_chars = {}\n str_two_chars = {}\n str_one.each_char do |char|\n if str_one_chars[char]\n str_one_chars[char] += 1\n else\n str_one_chars[char] = 1\n end\n end\n str_two.each_char do |char|\n if str_two_chars[char]\n str_two_chars[char] += 1\n else\n str_two_chars[char] = 1\n end\n end\n str_one_chars == str_two_chars\nend",
"title": ""
},
{
"docid": "aeaa39463ae93c603b22bee8d122bfc0",
"score": "0.8118524",
"text": "def permutations?(string1, string2)\n if string1 == \"\" && string2 == \"\"\n return true\n elsif string1.length != string2.length\n return false\n end\n \n letters_hash = {}\n index = 0\n length = string1.length\n \n length.times do |i|\n if letters_hash[string1[i]].nil?\n letters_hash[string1[i]] = 1\n i += 1\n else\n letters_hash[string1[i]] += 1\n i += 1\n end\n end\n \n i = 0\n \n length.times do |i|\n if letters_hash[string2[i]].nil?\n return false\n elsif letters_hash[string2[i]] != 0\n letters_hash[string2[i]] -= 1\n i += 1\n else\n return false\n end\n end\n \n return true\nend",
"title": ""
},
{
"docid": "c3a2b27f5a8c4adf88327befead3df5e",
"score": "0.8096993",
"text": "def is_permutation?(a,b)\n return false if a.length != b.length\n counter = Hash.new(0)\n a.each_char{|c| counter[c] += 1}\n b.each_char{|c| counter[c] -= 1}\n counter.each{|k,v| return false if v != 0}\n true\n end",
"title": ""
},
{
"docid": "1cceb03ec54d9901158ccaa23eb9cefa",
"score": "0.8093325",
"text": "def permutations?(string1, string2)\n # return false for different size strings\n return false if string1.length != string2.length\n # true for empty strings\n return true if string1.empty? && string2.empty?\n\n # hash first string\n hash = {}\n string1.each_char do |char|\n # track number of same char in string\n if hash.has_key?(char)\n hash[char] += 1\n else\n hash[char] = 1\n end\n end\n\n # use second string to \"countdown\"\n string2.each_char do |char|\n if hash.has_key?(char)\n if hash[char] == 0 # number of this char depleted in first string, not equal\n return false\n end\n hash[char] -= 1 # else decrement\n else\n return false\n end\n end\n\n return true # same character set if both true\nend",
"title": ""
},
{
"docid": "90ad2aade0d6044bf12d1e861040bb03",
"score": "0.80854666",
"text": "def is_permutation?(a,b)\n a_chars, b_chars = Hash.new(), Hash.new()\n\n return false if a.length != b.length\n\n a.length.times do |i|\n a_chars[a[i]] = true\n b_chars[b[i]] = true\n end\n\n a_chars.each do |x, y|\n return false if y != b_chars[x]\n end\n\n return true\nend",
"title": ""
},
{
"docid": "ffd5232ae3768af75bffda25e5d58362",
"score": "0.8053123",
"text": "def check_permutations?(str1, str2)\n return false if str1.length != str2.length\n\n count1 = Hash.new(0)\n count2 = Hash.new(0)\n\n str1.each_char do |ch|\n count1[ch] += 1\n end\n\n str2.each_char do |ch|\n return false if count1[ch] == 0\n count2[ch] += 1\n end\n\n count1 == count2\nend",
"title": ""
},
{
"docid": "a8b7766ce8444e80053a127889c6e330",
"score": "0.80513555",
"text": "def first_anagram_2(str1,str2)\n permutations = []\n letters_1 = str1.split(\"\")\n letters_2 = str2.split(\"\")\n\n permutations = letters_1.permutation.to_a \n if permutations.include?(letters_2)\n true\n else \n false\n end\n\nend",
"title": ""
},
{
"docid": "a8596d1efd86e4257aa8a070ddcbf8d1",
"score": "0.80499685",
"text": "def permutations?(string1, string2)\n return false if string1.length != string2.length\n string1_hash = {}\n \n #Add each char in string1 to a hash, {char => # of occurrences}\n string1.each_char do |char|\n if string1_hash[char]\n string1_hash[char] += 1 \n else \n string1_hash[char] = 1\n end \n end \n \n #Check whether each char of string2 exists in string1_hash, decrement hash values accordingly.\n string2.each_char do |char|\n if string1_hash[char].nil?\n return false\n elsif string1_hash[char] > 1\n string1_hash[char] -= 1 \n else \n string1_hash.delete(char)\n end \n end \n \n #if string1_hash is empty, the strings are palindromes\n return string1_hash.empty? ? true : false \nend",
"title": ""
},
{
"docid": "c646e803a0a17d99988d938debbd45bf",
"score": "0.80487114",
"text": "def permutation?(s1, s2)\n if s1.length != s2.length\n return false\n end\n\n h = Hash.new(0)\n s1.each_char do |char|\n h[char] += 1\n end\n\n s2.each_char do |char|\n h[char] -= 1\n if h[char] < 0\n return false\n end\n end\n\n return true\nend",
"title": ""
},
{
"docid": "7d377aaf5f6c03e2c61f8a990df6bd9f",
"score": "0.802793",
"text": "def permutation_of_other?(str1,str2)\n if str1.length > str2.length\n smaller_string = str2\n longer_string = str1\n else\n smaller_string = str1\n longer_string = str2\n end\n count = 0\n string_hash = Hash.new(0)\n i = 0\n while i < smaller_string.length\n string_hash[smaller_string[i]] += 1\n i += 1\n end\n j = 0\n while j < longer_string.length\n if count == 0\n test_hash = Hash.new(0)\n end\n if string_hash[longer_string[j]] > 0 && test_hash[longer_string[j]] < string_hash[longer_string[j]]\n count += 1\n test_hash[longer_string[j]] += 1\n else\n count = 0\n end\n return true if count == smaller_string.length\n j += 1\n end\n false\nend",
"title": ""
},
{
"docid": "3d5764d8941ba157a6fd9a3a81e819b0",
"score": "0.8006218",
"text": "def is_perm?(str1,str2)\n my_hash = Hash.new(0)\n str1.each_char do |chr|\n my_hash[chr] += 1\n end\n str2.each_char do |chr|\n my_hash[chr] -= 1\n end\n my_hash.each do |_, value|\n return false if value != 0\n end\n true\nend",
"title": ""
},
{
"docid": "5852d683f5702b857b23718a79bbd204",
"score": "0.8005369",
"text": "def permutations?(string1, string2)\n # create a hash\n hash = {}\n # set output to true\n output = true\n \n # for each string1 character,\n string1.each_char do |char1|\n # make it a key in the hash\n # and set its value to the number of times it appears\n if hash.has_key?(char1)\n hash[char1] += 1\n else\n hash[char1] = 1\n end\n end\n \n # for each string2 character,\n string2.each_char do |char2|\n # check if it's a key in the hash\n # and that it has a value greater than none\n if hash.has_key?(char2) && hash[char2] > 0\n # if it is, remove one from that hash value\n hash[char2] -= 1\n else\n # otherwise, make output false\n # b/c there is a not-shared letter\n output = false\n end\n end\n \n # for each string1 character\n string1.each_char do |char3|\n # if there is a value in the hash\n # for this character\n if hash.has_key?(char3) && hash[char3] > 0\n # set output to false\n # b/c this char occurred more\n # in string1 than string2\n output = false\n end\n end\n \n # return output boolean\n return output\nend",
"title": ""
},
{
"docid": "8c721f354255e2acbe2d82a2c3aef5b1",
"score": "0.8001921",
"text": "def check_perm(str1, str2)\n if str1.length != str2.length\n return false\n end\n\n hash1 = Hash.new(0)\n hash2 = Hash.new(0)\n\n str1.each_char do |char|\n hash1[char] += 1\n end\n\n str2.each_char do |char|\n hash2[char] += 1\n end\n\n hash1.each do |key, value| \n if(hash1[key] != hash2[key])\n return false\n end\n end\n\n return true;\nend",
"title": ""
},
{
"docid": "53ad0e005bd83af5a311275a550507c9",
"score": "0.7990866",
"text": "def permutations?(a,b)\n\tif a.split(\"\").sort == b.split(\"\").sort\n\t\tputs \"true\"\n\telse\n\t\tputs \"false\"\n\tend\nend",
"title": ""
},
{
"docid": "fbfb812e8ae201ce5e5bca6c0bbf84f7",
"score": "0.79592484",
"text": "def permutations?(string1, string2)\n if string1.length != string2.length\n return false\n end\n\n hash = {}\n\n string1.split('').each do |char|\n if hash[char]\n hash[char] += 1\n else\n hash[char] = 1\n end\n end\n\n string2.split('').each do |char|\n if hash[char]\n hash[char] -= 1\n else\n return false\n end\n end\n\n values = hash.values\n\n if values.sum == 0\n return true\n else\n return false\n end\n\nend",
"title": ""
},
{
"docid": "6f6b064934e17090cf0c14733eb95e45",
"score": "0.7893652",
"text": "def check_permutation (a, b)\n a_char_count = count_chars(a)\n b_char_count = count_chars(b)\n return false if a_char_count.to_a.size != b_char_count.to_a.size\n a_char_count.each do |key, value|\n return false if b_char_count[k] != value\n end\nend",
"title": ""
},
{
"docid": "e8f3ed8cbf4fbebded8d34ea01e98c86",
"score": "0.78516454",
"text": "def string_rotation(str1, str2)\n\n check = is_permutation?(str1, str2)\n\n if check\n curr = str2.chars\n\n str2.length.times do\n curr << curr.shift\n return true if curr.join == str1 \n end\n end\n false\nend",
"title": ""
},
{
"docid": "6b4988498906d139decdb9dfce467380",
"score": "0.777298",
"text": "def permutation?(s1, s2)\n return false if s1.length != s2.length\n\n # loop through the first string, and inside that loop,\n # loop through the second and see if that element was found only once\n # but this would O(n^2) time. I think we could do better.\n # we could iterate through each, and count the characters, then see if those\n # character counts match\n dict1 = {}\n dict2 = {}\n \n (0..s1.length-1).each do |i|\n char = s1[i]\n\n dict1[char] = dict1[char].to_i + 1\n end\n\n (0..s2.length-1).each do |i|\n char = s2[i]\n\n dict2[char] = dict2[char].to_i + 1\n end\n\n dict1 == dict2\nend",
"title": ""
},
{
"docid": "441651aeb49b8e5ae5f4692c6148d26b",
"score": "0.77711135",
"text": "def anagram?(str1, str2)\n str1.split(\"\").permutation.to_a.any? { |perm| perm.join == str2} \nend",
"title": ""
},
{
"docid": "a79db8e54f6a0f3dac213748522aa609",
"score": "0.77678347",
"text": "def perm?(a, b)\n a.to_s.chars.sort == b.to_s.chars.sort\nend",
"title": ""
},
{
"docid": "ae726b6e53630fc409feef506a038403",
"score": "0.7752616",
"text": "def permutation(s1, s2)\n return false unless s1.length == s2.length\n snew = s1 + s2\n snew.each_char do |c|\n return false unless ((snew.count c) % 2).zero?\n end\n true\nend",
"title": ""
},
{
"docid": "74aac6c664711441e1b8368ae31a49f7",
"score": "0.77419287",
"text": "def permutation? other\r\n return (self.to_s.split(\"\").sort.join(\"\")) == (other.to_s.split(\"\").sort.join(\"\"))\r\n end",
"title": ""
},
{
"docid": "da6307bf603fa721f2e48eb692c94efb",
"score": "0.7704969",
"text": "def bad_ana(str1,str2)\n str1.split(\"\").permutation.to_a.index(str2.split(\"\"))!=nil \nend",
"title": ""
},
{
"docid": "880c59eb99b911e080096755a9978afc",
"score": "0.76903194",
"text": "def anagram?(str_1,str_2)\r\n str_1.split(\"\").permutation.to_a.each do |anags| # [ ['g','i','z'],['g','i'],['g','i','z','m','o'] ]\r\n return true if str_2 == anags.join(\"\")\r\n end\r\n false\r\nend",
"title": ""
},
{
"docid": "76ea172533451d49ed9d9577c2455efa",
"score": "0.7684135",
"text": "def anagram?(str1, str2)\n perms = str1.chars.permutation.to_a\n perms.map! { |perm| perm.join }\n perms.include?(str2)\nend",
"title": ""
},
{
"docid": "51fcbb6966a0731f8bc381022fd5666d",
"score": "0.7682812",
"text": "def first_anagram?(str_1, str_2)\n str_1.split(\"\").permutation.to_a.each do |permute|\n return true if str_2 == permute.join(\"\")\n end\n false\nend",
"title": ""
},
{
"docid": "2ebc6dd599a2303277ce1d14129dc306",
"score": "0.7672089",
"text": "def permutation_long(s1, s2)\n return false unless s1.length == s2.length\n n = s1.length\n perm = true\n n.times do |i|\n perm = false if s1.chars.sort[i] != s2.chars.sort[i]\n break unless perm\n return false\n end\n perm if perm == true\nend",
"title": ""
},
{
"docid": "25ceee48b0ea8aa9f416c47f00b95051",
"score": "0.76270425",
"text": "def permutation_c?(s1, s2)\n if s1.size != s2.size\n return false\n end\n\n sort!(s1) == sort!(s2)\nend",
"title": ""
},
{
"docid": "c355c2847eb0ff752807feb034121c97",
"score": "0.7626498",
"text": "def perm_a?(first, second)\n first.split('').sort == second.split('').sort\nend",
"title": ""
},
{
"docid": "094ffd950e0b2cb888d6ad4d440a0ec5",
"score": "0.7626217",
"text": "def permutation_b?(s1, s2)\n if s1.size != s2.size\n return false\n end\n\n h1 = Hash.new { |hash, key| hash[key] = 0 }\n h2 = Hash.new { |hash, key| hash[key] = 0 }\n\n s1.each_char { |c| h1[c] += 1 }\n s2.each_char { |c| h2[c] += 1 }\n\n h1.each do |k, v|\n if h2[k] != v\n return false\n end\n end\n\n true\nend",
"title": ""
},
{
"docid": "083d4a890832207c6d7aebbae6032ad5",
"score": "0.7610468",
"text": "def first_anagram?(str, str_2) #str = \"abc\" str2 = \"cab\" \n variations = str.split(\"\").permutation.to_a\n variations.include?(str_2.split(\"\"))\n end",
"title": ""
},
{
"docid": "730a03584d8bbe258ed1127b60cffb8b",
"score": "0.7588762",
"text": "def scramble(str1, str2)\n str2_chars = str2.chars\n str2_chars.each do |char2|\n return false if str2.count(char2) > str1.count(char2)\n end\n true\nend",
"title": ""
},
{
"docid": "08b7e9af840b2d90a9b9c7c099a08728",
"score": "0.7575851",
"text": "def perm(s1, s2)\n\t\ts1.sort!\n\t\ts2.sort!\n\t\tif s1 == s2\n\t\t\ttrue\n\t\telse\n\t\t\tfalse\n\t\tend\n\tend",
"title": ""
},
{
"docid": "6741d7aac39c6d42ef78aaa395a6bd8c",
"score": "0.75623345",
"text": "def first_anagram?(str1, str2)\n letters = str1.split(\"\")\n perms = letters.permutation.to_a.map {|el| el.join(\"\")}\n return true if perms.include?(str2)\n false\nend",
"title": ""
},
{
"docid": "cb9768f10c9fe1aa716e35d5b7b88392",
"score": "0.7556719",
"text": "def first_anagram?(str1, str2)\n permutations = str1.chars.permutation.to_a\n permutations.include?(str2.chars)\nend",
"title": ""
},
{
"docid": "d69fce2b7122f92df3f14fe8aaf233bc",
"score": "0.75531745",
"text": "def first_anagram?(str1, str2)\n possible = str1.chars.permutation.to_a\n possible.include?(str2.chars)\n\nend",
"title": ""
},
{
"docid": "5e1d56b187aeffe1de16fecda67069eb",
"score": "0.7552994",
"text": "def first_anagram?(str_1, str_2)\n str_1.split(\"\").permutation.to_a.each do |anagrams|\n return true if str_2 == anagrams.join(\"\")\n end\n false\nend",
"title": ""
},
{
"docid": "5f245bf2fe42ada3b3e7db3a77f0eb6e",
"score": "0.7550111",
"text": "def check_permutations(a,b)\n counter = Hash.new(0)\n a.each_char{|c| counter[c] += 1}\n b.each_char{|c| counter[c] -= 1}\n counter.each{|k,v| return false if !v.zero?}\n true\nend",
"title": ""
},
{
"docid": "4c9a26da685c9a2643b7c387ad575ec8",
"score": "0.75315017",
"text": "def StringScramble(str1,str2)\n string1fix = str1.chars.sort.join #get the strings in alphabetical order\n string2fix = str2.chars.sort.join\n if string1fix === string2fix # then see if they are the same\n return true\n else\n return false\n end\nend",
"title": ""
},
{
"docid": "38cf20a57c529fc45abf8c91dc8388a1",
"score": "0.75227064",
"text": "def first_anagram?(string1, string2)\r\n possible_arr = string1.chars.permutation.to_a\r\n possible_arr.include?(string2.chars) ? true : false\r\nend",
"title": ""
},
{
"docid": "918bdca9f4c70f07e9b566119ff098a1",
"score": "0.75175124",
"text": "def first_anagram?(str1, str2)\n perms = str1.chars.permutation.to_a\n perms.include?(str2.chars)\nend",
"title": ""
},
{
"docid": "558116ce925683125edb9cd0cc5e4f29",
"score": "0.75161654",
"text": "def anagram?(str1, str2)\n anagrams = str1.split('').permutation.to_a\n anagrams.include?(str2.split(''))\nend",
"title": ""
},
{
"docid": "7ce2f136b71835a0cac93967970842a5",
"score": "0.7505545",
"text": "def StringScramble(str1,str2)\n validate_strings = str1.split(//) + str2.split(//)\n validate_strings.uniq.size == str2.size ? puts(\"true\") : puts(\"false\")\nend",
"title": ""
},
{
"docid": "7467480702ef4f691e6ea1130d849acf",
"score": "0.7503282",
"text": "def is_perm(p1, p2)\n p1.to_s.split(\"\").map(&:to_i).sort.join == p2.to_s.split(\"\").map(&:to_i).sort.join\nend",
"title": ""
},
{
"docid": "bcac7068de2aef42cf15ec27f5859008",
"score": "0.74732345",
"text": "def first_anagram?(str1, str2)\r\n str1.split(\"\").permutation.map{|ele|ele.join(\"\")}.include?(str2)\r\nend",
"title": ""
},
{
"docid": "8fdbce17172b8769d632c080ec3caa3a",
"score": "0.74642015",
"text": "def first_anagram?(str1, str2) #O(n!)\n arr1 = str1.split(\"\")\n arr2 = str2.split(\"\")\n arr1.permutation.to_a.include?(arr2)\nend",
"title": ""
},
{
"docid": "c6ff6c3de7a95b9856d6eee11183131a",
"score": "0.746209",
"text": "def first_anagram?(str_1, str_2)\n perms = str_1.chars.permutation.to_a\n perms.map! { |perm| perm.join(\"\") }\n perms.include?(str_2)\nend",
"title": ""
},
{
"docid": "6b955f636974e5fd1e6698a9f509e7ab",
"score": "0.7453643",
"text": "def first_anagram?(str1, str2)\n all_combo = str1.split('').permutation.to_a\n all_combo.include?(str2.split(\"\"))\nend",
"title": ""
},
{
"docid": "a1d5cb785d1ac298cbbac9bc45db65a6",
"score": "0.74443704",
"text": "def first_anagram?(str_1, str_2)\n letters = str_1.split(\"\")\n permutations = letters.permutation.to_a(str_1.length)\n joined = permutations.map { |perm| perm.join(\"\") }\n joined\n joined.include?(str_2)\nend",
"title": ""
},
{
"docid": "60ab18acaf41c3c54385e6d34b185d7d",
"score": "0.7443356",
"text": "def first_anagram?(str1, str2)\n perms = []\n\n perms = str1.chars.permutation.to_a\n perms.map!(&:join)\n\n perms.include?(str2)\nend",
"title": ""
},
{
"docid": "02678d089519399088cf61a7327098a0",
"score": "0.74268264",
"text": "def first_anagram?(str1, str2)\n new_str1= str1. split(\"\")\n new_str1.permutation.to_a.map {|sub|sub.join}.include?(str2)\n\nend",
"title": ""
},
{
"docid": "4ba65b51ac9e083d0a703dd0a2c1ca2e",
"score": "0.7415128",
"text": "def string_scramble(str1, str2)\n str2.each_char do |char|\n return false if str2.count(char) > str1.count(char)\n end\n true\nend",
"title": ""
},
{
"docid": "ad90c4bcebdf5c2ab37f4ff7ab9519ab",
"score": "0.7415121",
"text": "def first_anagram?(str1,str2)\n chars = str1.split(\"\")\n arr= chars.permutation.to_a\n arr.include?(str1.str2(\"\"))\n end",
"title": ""
},
{
"docid": "8ab0e29b3230f3766cbeb91845524d29",
"score": "0.7393432",
"text": "def first_anagram?(str1, str2)\n str1.chars.permutation(str1.length).map(&:join).include?(str2)\nend",
"title": ""
},
{
"docid": "11ad89d9a6a8bc1a2191400cbfbeed2c",
"score": "0.73773754",
"text": "def first_anagram?(string1, string2) #=> O(n!)\n permutation1 = string1.chars.permutation.to_a\n arr_str2 = string2.chars\n permutation1.include?(arr_str2)\nend",
"title": ""
},
{
"docid": "981917a890e36f2e31a0db71892b0763",
"score": "0.73675394",
"text": "def first_anagram?(str1, str2)\n chars = str1.chars.permutation.to_a\n chars.each do |subchar|\n return true if str2 == subchar.join\n end\n false\n\nend",
"title": ""
},
{
"docid": "039f357663584fda55ed93ea3524bf6e",
"score": "0.7362161",
"text": "def permulation2?(s1, s2)\n s1.charts.sort == s2.chars.sort\nend",
"title": ""
},
{
"docid": "101076c991406bb96e57cf402508ed27",
"score": "0.73619294",
"text": "def first_anagram?(str1, str2)\n array = str1.split(\"\")\n perms = permutation(array)\n return perms.include?(str2.split(\"\"))\nend",
"title": ""
},
{
"docid": "8eaca67b9fe0b20baef14b25f9ec3c3e",
"score": "0.73561585",
"text": "def StringScramble(str1,str2)\n str2.each_char do |i|\n if str1.count(i) < str2.count(i)\n return false\n end\n end\n\n true\nend",
"title": ""
},
{
"docid": "3cf131a97dec1acac0a7023d39c4f6b6",
"score": "0.7347811",
"text": "def anagrams_3(string1 , string2)\n return true if string1.chars.sort == string2.chars.sort\nend",
"title": ""
},
{
"docid": "c77c4a51cf0d5535bb13ba5ab8cd3d55",
"score": "0.73434335",
"text": "def first_anagram?(string1, string2)\n string1.chars.permutation(string1.length).to_a.each do |word|\n if word.join(\"\") == string2\n return true\n end\n end\n false\nend",
"title": ""
},
{
"docid": "ea220b5b52bd852e61fe2af3ae8ab76c",
"score": "0.73333865",
"text": "def second_anagramm?(str1, str2)\n chars1 = str1.chars\n chars11 = chars1.dup\n chars2 = str2.chars\n\n until chars11.empty?\n el = chars11.pop\n if chars2.include?(el)\n chars1.delete_at(chars1.index(el))\n chars2.delete_at(chars2.index(el))\n end\n end\n\n return true if chars1.empty? && chars2.empty?\n false\nend",
"title": ""
},
{
"docid": "09d9a3858fc4e14786fcc2d31937bbc4",
"score": "0.73276466",
"text": "def first_anagram?(str_1, str_2)\n\n lttr_arr_1 = str_1.split(\"\") # str1 --> n\n # lttr_arr_2 = str_2.split\n \n p possible_anagrams = lttr_arr_1.permutation.to_a.map { |subArr| subArr.join(\"\") } # n! * n\n\n possible_anagrams.include?(str_2) # n!\n\nend",
"title": ""
}
] |
8cd0ffaa006c14dd573763f64b744f8a | GET /career_specialties/new GET /career_specialties/new.json | [
{
"docid": "f9b03c96ed73b02bd8fdb0b84a37c74c",
"score": "0.77558345",
"text": "def new\n @career_specialty = CareerSpecialty.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @career_specialty }\n end\n end",
"title": ""
}
] | [
{
"docid": "ad5a9f7045c71ff5ea9272a5be9ddcbc",
"score": "0.728732",
"text": "def new\n @speciality = Speciality.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @speciality }\n end\n end",
"title": ""
},
{
"docid": "b4a12b5e23b9ec8ac94750c0fa52a732",
"score": "0.71006536",
"text": "def create\n @career_specialty = CareerSpecialty.new(params[:career_specialty])\n\n respond_to do |format|\n if @career_specialty.save\n format.html { redirect_to @career_specialty, notice: 'Career specialty was successfully created.' }\n format.json { render json: @career_specialty, status: :created, location: @career_specialty }\n else\n format.html { render action: \"new\" }\n format.json { render json: @career_specialty.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2b6bc2377b0bf66afec1e353968d8390",
"score": "0.7016421",
"text": "def new\n @career = Career.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @career }\n end\n end",
"title": ""
},
{
"docid": "48cb13451b858bc599b45220e6989f5e",
"score": "0.695977",
"text": "def create\n @specialty = Specialty.new(specialty_params)\n\n if @specialty.save\n render json: @specialty, status: :created, location: @specialty\n else\n render json: @specialty.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "ab1b4aac2a3266556000188e66f7cf1b",
"score": "0.6856614",
"text": "def new\n @county = County.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @county }\n end\n end",
"title": ""
},
{
"docid": "fb886e8091293b910ba1869c43c98270",
"score": "0.68367225",
"text": "def new\n @charity = CharityOfTheMonth.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @charity }\n end\n end",
"title": ""
},
{
"docid": "70575d81b90f2290565c3118d12651a7",
"score": "0.68269724",
"text": "def new\n @icome = Icome.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @icome }\n end\n end",
"title": ""
},
{
"docid": "c618e2aa033f4c231fcd145174dda0e3",
"score": "0.6758988",
"text": "def create\n @speciality = Speciality.new(params[:speciality])\n\n respond_to do |format|\n if @speciality.save\n format.html { redirect_to @speciality, :notice => 'Специальность создана.' }\n format.json { render :json => @speciality, :status => :created, :location => @speciality }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @speciality.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a0d1ee986b6f27ad8b642b76569d042e",
"score": "0.67515075",
"text": "def new\n @interesting = Interesting.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @interesting }\n end\n end",
"title": ""
},
{
"docid": "5b8c8fc7bea1f45db055e7006a8c31a3",
"score": "0.6745854",
"text": "def new\n @borrow = Borrow.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @borrow }\n end\n end",
"title": ""
},
{
"docid": "bbe3ac7932be5b99a75568a7eed07c44",
"score": "0.67339504",
"text": "def new\n @critic = Critic.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @critic }\n end\n end",
"title": ""
},
{
"docid": "5065045e99b0a7f1169aef16d2b84a54",
"score": "0.67336935",
"text": "def new\n authorize! :index, @user, :message => 'Not authorized as an administrator.'\n @specialist = Specialist.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @specialist }\n end\n end",
"title": ""
},
{
"docid": "5a9cd5512125b0484014a2f95b707ed0",
"score": "0.6733575",
"text": "def new\n @borrower = Borrower.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @borrower }\n end\n end",
"title": ""
},
{
"docid": "5a9cd5512125b0484014a2f95b707ed0",
"score": "0.6733575",
"text": "def new\n @borrower = Borrower.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @borrower }\n end\n end",
"title": ""
},
{
"docid": "5dcb25c33aada7a3a37b7b3849e26e23",
"score": "0.6729712",
"text": "def new\n @qualification = Qualification.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @qualification }\n end\n end",
"title": ""
},
{
"docid": "5444a59dece822bdfeac9db3a2f3a631",
"score": "0.6725376",
"text": "def new\n @what = What.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @what }\n end\n end",
"title": ""
},
{
"docid": "55654739817e9852d526e557514916a0",
"score": "0.6725209",
"text": "def new\n @patent = Patent.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @patent }\n end\n end",
"title": ""
},
{
"docid": "49d993cee7fdacd789fc202542ac800d",
"score": "0.67199636",
"text": "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",
"title": ""
},
{
"docid": "43509fab4df08cdbdd57987eff550d10",
"score": "0.67094344",
"text": "def new\n @my_ministry = MyMinistry.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @my_ministry }\n end\n end",
"title": ""
},
{
"docid": "065b639851e57252738775d7d943f87c",
"score": "0.6706741",
"text": "def new\n @title = 'New Clinical Specialty'\n @description = 'Add a new clinical specialty'\n @clinicalsection = Clinicalsection.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @clinicalsection }\n end\n end",
"title": ""
},
{
"docid": "b3bf77aadb81b6a813ce9bf50b81d079",
"score": "0.6705563",
"text": "def new\n @research = Research.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @research }\n end\n end",
"title": ""
},
{
"docid": "9ebbf2424e406ed75ac4ac116c9077eb",
"score": "0.66860825",
"text": "def create\n @specialty = Specialty.new(specialty_params)\n\n respond_to do |format|\n if @specialty.save\n format.html { redirect_to @specialty, notice: 'Specialty was successfully created.' }\n format.json { render :show, status: :created, location: @specialty }\n else\n format.html { render :new }\n format.json { render json: @specialty.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f111ca39b18acf2773307c1413450be1",
"score": "0.66786355",
"text": "def new\n @stuff = Stuff.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @stuff }\n end\n end",
"title": ""
},
{
"docid": "6f699da4e973150aa4e35f0a356c57e4",
"score": "0.6677423",
"text": "def new\n @early_pregnancy = EarlyPregnancy.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @early_pregnancy }\n end\n end",
"title": ""
},
{
"docid": "e4e2f0df213a8b75729f781e1edefb42",
"score": "0.6674602",
"text": "def new\n @person = Person.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @person }\n end\n end",
"title": ""
},
{
"docid": "3625b179d5b7501c54f42b9a7c39b8ec",
"score": "0.66696554",
"text": "def new\n @precinct = Precinct.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @precinct }\n end\n end",
"title": ""
},
{
"docid": "4063fa5f070167510d5c36a14ee0b4c5",
"score": "0.66625315",
"text": "def new\n @girltype = Girltype.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @girltype }\n end\n end",
"title": ""
},
{
"docid": "d422a078a5797052290f74c75a61ee50",
"score": "0.66571563",
"text": "def new\n @pageType = \"new\"\n @patient = Patient.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @patient }\n end\n end",
"title": ""
},
{
"docid": "f4f8a90f4d50280ae3ac02a1153897b1",
"score": "0.6647248",
"text": "def new\n @crime = Crime.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @crime }\n end\n end",
"title": ""
},
{
"docid": "6b1c2d1df0b1550039b71b69b3fea555",
"score": "0.6645173",
"text": "def new\n @part_company = PartCompany.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @part_company }\n end\n end",
"title": ""
},
{
"docid": "c73390fe915d61946c7396e5d674eff8",
"score": "0.6641069",
"text": "def new\n @special_needs_type = SpecialNeedsType.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @special_needs_type }\n end\n end",
"title": ""
},
{
"docid": "6591334d64f5ace8500a624da05f811a",
"score": "0.663452",
"text": "def new\n @person = people_type.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @person }\n end\n end",
"title": ""
},
{
"docid": "0420ae29feb256e907eba525b6183af6",
"score": "0.6628094",
"text": "def new\n @apprenticeship_type = ApprenticeshipType.new\n @careers = Career.all\n @subjects = Subject.all\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @apprenticeship_type }\n end\n end",
"title": ""
},
{
"docid": "0fe1068c25d571fdb16ce58b73b385b1",
"score": "0.66224253",
"text": "def new\n @personnage = Personnage.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @personnage }\n end\n end",
"title": ""
},
{
"docid": "6293cc2cd87b3a16a9bd34a5c37cf5ca",
"score": "0.66220456",
"text": "def new\n @company = Company.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @company }\n end\n end",
"title": ""
},
{
"docid": "6293cc2cd87b3a16a9bd34a5c37cf5ca",
"score": "0.66220456",
"text": "def new\n @company = Company.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @company }\n end\n end",
"title": ""
},
{
"docid": "6293cc2cd87b3a16a9bd34a5c37cf5ca",
"score": "0.66220456",
"text": "def new\n @company = Company.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @company }\n end\n end",
"title": ""
},
{
"docid": "6293cc2cd87b3a16a9bd34a5c37cf5ca",
"score": "0.66220456",
"text": "def new\n @company = Company.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @company }\n end\n end",
"title": ""
},
{
"docid": "6293cc2cd87b3a16a9bd34a5c37cf5ca",
"score": "0.66220456",
"text": "def new\n @company = Company.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @company }\n end\n end",
"title": ""
},
{
"docid": "6293cc2cd87b3a16a9bd34a5c37cf5ca",
"score": "0.66220456",
"text": "def new\n @company = Company.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @company }\n end\n end",
"title": ""
},
{
"docid": "6293cc2cd87b3a16a9bd34a5c37cf5ca",
"score": "0.66220456",
"text": "def new\n @company = Company.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @company }\n end\n end",
"title": ""
},
{
"docid": "6293cc2cd87b3a16a9bd34a5c37cf5ca",
"score": "0.66220456",
"text": "def new\n @company = Company.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @company }\n end\n end",
"title": ""
},
{
"docid": "6293cc2cd87b3a16a9bd34a5c37cf5ca",
"score": "0.66220456",
"text": "def new\n @company = Company.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @company }\n end\n end",
"title": ""
},
{
"docid": "6293cc2cd87b3a16a9bd34a5c37cf5ca",
"score": "0.66220456",
"text": "def new\n @company = Company.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @company }\n end\n end",
"title": ""
},
{
"docid": "1664ad03be960fd4fad11b817761039a",
"score": "0.6620348",
"text": "def new\n @thing = Thing.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @thing }\n end\n end",
"title": ""
},
{
"docid": "56a43762ff422c5b2b90931355021bbc",
"score": "0.66156036",
"text": "def new\n @candy = Candy.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @candy }\n end\n end",
"title": ""
},
{
"docid": "edab9199a74b9108b66478818dbc9bb7",
"score": "0.66148204",
"text": "def new\n @person = Person.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @person }\n end\n end",
"title": ""
},
{
"docid": "edab9199a74b9108b66478818dbc9bb7",
"score": "0.66148204",
"text": "def new\n @person = Person.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @person }\n end\n end",
"title": ""
},
{
"docid": "edab9199a74b9108b66478818dbc9bb7",
"score": "0.66148204",
"text": "def new\n @person = Person.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @person }\n end\n end",
"title": ""
},
{
"docid": "edab9199a74b9108b66478818dbc9bb7",
"score": "0.66148204",
"text": "def new\n @person = Person.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @person }\n end\n end",
"title": ""
},
{
"docid": "edab9199a74b9108b66478818dbc9bb7",
"score": "0.66148204",
"text": "def new\n @person = Person.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @person }\n end\n end",
"title": ""
},
{
"docid": "edab9199a74b9108b66478818dbc9bb7",
"score": "0.66148204",
"text": "def new\n @person = Person.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @person }\n end\n end",
"title": ""
},
{
"docid": "edab9199a74b9108b66478818dbc9bb7",
"score": "0.66148204",
"text": "def new\n @person = Person.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @person }\n end\n end",
"title": ""
},
{
"docid": "ae57387626ab068f4ef7562621f28a7a",
"score": "0.661083",
"text": "def new\n @party = Party.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @party }\n end\n end",
"title": ""
},
{
"docid": "19d28aeba5459ae268d7fa6cfad99ef6",
"score": "0.6607958",
"text": "def new\n @news_site_specialty_option = NewsSiteSpecialtyOption.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @news_site_specialty_option }\n end\n end",
"title": ""
},
{
"docid": "c0f697563b3e2cba43aed8a2872596f6",
"score": "0.6602734",
"text": "def new\n @fiction = Fiction.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @fiction }\n end\n end",
"title": ""
},
{
"docid": "56e7da8aa3835aadd3f1c355c33a8c37",
"score": "0.6595165",
"text": "def new\n @air_crew = AirCrew.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @air_crew }\n end\n end",
"title": ""
},
{
"docid": "7c2aa7f9a2f48edd14927d52c99b13d6",
"score": "0.65940857",
"text": "def new\n @apprentice = Apprentice.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @apprentice }\n end\n end",
"title": ""
},
{
"docid": "06a1c04cf97d46bdab02b3b8f65a441d",
"score": "0.65922415",
"text": "def new\n @borrow_request = BorrowRequest.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @borrow_request }\n end\n end",
"title": ""
},
{
"docid": "709571cb6fb5901e384f835cd9d7b164",
"score": "0.6591291",
"text": "def new\n @teach = Teach.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @teach }\n end\n end",
"title": ""
},
{
"docid": "bc22eecd6553d45ab4d71d437ec1c2fb",
"score": "0.65896",
"text": "def new\n @goat = Goat.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @goat }\n end\n end",
"title": ""
},
{
"docid": "e9665909bdeab6a6a6cb670e77108219",
"score": "0.6585432",
"text": "def new\n @interested = Interested.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @interested }\n end\n end",
"title": ""
},
{
"docid": "c835c56030b099b7f40edae299aac086",
"score": "0.657575",
"text": "def new\n @research_item = ResearchItem.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @research_item }\n end\n end",
"title": ""
},
{
"docid": "bbb7d0896d349eb8424fdc344357b3e7",
"score": "0.65753585",
"text": "def new\n @person_interest = PersonInterest.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @person_interest }\n end\n end",
"title": ""
},
{
"docid": "6104385c1ed182a508e509629d7a16dd",
"score": "0.6566733",
"text": "def new\n @something = Something.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @something }\n end\n end",
"title": ""
},
{
"docid": "0e1e48365c8b98cda5bc8d6c56c23ba6",
"score": "0.655946",
"text": "def new\n @occupant = Occupant.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @occupant }\n end\n end",
"title": ""
},
{
"docid": "09db796f4d6a08c2a9d9fac7265fda1a",
"score": "0.65587646",
"text": "def new\n @carpool = Carpool.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @carpool }\n end\n end",
"title": ""
},
{
"docid": "d6bd53d1111450c48b1ae5dd6f19ae68",
"score": "0.6551661",
"text": "def new\n @thing = Thing.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @thing }\n end\n end",
"title": ""
},
{
"docid": "d8fb9b786bb8d23b266231ea1a95ebc3",
"score": "0.6544493",
"text": "def new\n @pony = Pony.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @pony }\n end\n end",
"title": ""
},
{
"docid": "ff1f0f5287e1659e1df2c981fd9d3612",
"score": "0.65419334",
"text": "def new\n @title = t('view.firms.new_title')\n @firm = Firm.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @firm }\n end\n end",
"title": ""
},
{
"docid": "b995fd73bbc56508f8194de9938192f6",
"score": "0.6540801",
"text": "def new\n @firm = Firm.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @firm }\n end\n end",
"title": ""
},
{
"docid": "3212c0c4321812858ab73794431d599b",
"score": "0.65386945",
"text": "def new\n @researcher = Researcher.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @researcher }\n end\n end",
"title": ""
},
{
"docid": "e4b58ecbfbaba048674a627a7f073042",
"score": "0.6536788",
"text": "def new\n @company = Company.new(:name => 'default')\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @company }\n end\n end",
"title": ""
},
{
"docid": "88e40ae49fb80c4158174f57fba55a84",
"score": "0.6536643",
"text": "def new\n @dependent_relationship = DependentRelationship.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @dependent_relationship }\n end\n end",
"title": ""
},
{
"docid": "633e931974a5e92fd2b633f125080ea1",
"score": "0.65332735",
"text": "def new\n @recipe = Recipe.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @recipe }\n end\n end",
"title": ""
},
{
"docid": "633e931974a5e92fd2b633f125080ea1",
"score": "0.65332735",
"text": "def new\n @recipe = Recipe.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @recipe }\n end\n end",
"title": ""
},
{
"docid": "633e931974a5e92fd2b633f125080ea1",
"score": "0.65332735",
"text": "def new\n @recipe = Recipe.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @recipe }\n end\n end",
"title": ""
},
{
"docid": "633e931974a5e92fd2b633f125080ea1",
"score": "0.65332735",
"text": "def new\n @recipe = Recipe.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @recipe }\n end\n end",
"title": ""
},
{
"docid": "633e931974a5e92fd2b633f125080ea1",
"score": "0.65332735",
"text": "def new\n @recipe = Recipe.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @recipe }\n end\n end",
"title": ""
},
{
"docid": "cac0a8deb8b4ba7c5585be52c0c2033f",
"score": "0.6532694",
"text": "def new\n @patient = Patient.find(params[:patient_id])\n set_patient_session @patient.id, @patient.patient_name \n @managed_care = @patient.managed_cares.new\n @managed_care.patient_id = params[:patient_id]\n @subscriber = @patient.subscribers.all\n @title = \"New Managed Care Information\"\n @providers = @patient.providers\n @groups = @patient.groups \n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @managed_care }\n end\n end",
"title": ""
},
{
"docid": "05ee5dca724060b5b3bab0171531249a",
"score": "0.65319777",
"text": "def new\n @relation = Relation.new\n @personnages = Personnage.all\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @relation }\n end\n end",
"title": ""
},
{
"docid": "8a40d91657a32466527ba0bab5a66d6c",
"score": "0.65302396",
"text": "def new\n @whoarewe = Whoarewe.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @whoarewe }\n end\n end",
"title": ""
},
{
"docid": "b2c7ec4e84f480d2a137d7ddba3b0982",
"score": "0.6528025",
"text": "def new\n @believer = Believer.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @believer }\n end\n end",
"title": ""
},
{
"docid": "62eb4b6654a568a871abcadf492f143d",
"score": "0.6519003",
"text": "def new\n @family_crest = FamilyCrest.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @family_crest }\n end\n end",
"title": ""
},
{
"docid": "8636dc9ee0d8588206c5f9177c03f7e8",
"score": "0.6518973",
"text": "def new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @alley }\n end\n end",
"title": ""
},
{
"docid": "e740695686f0410da53726d14eec7195",
"score": "0.6517036",
"text": "def new\n @court = Court.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @court }\n end\n end",
"title": ""
},
{
"docid": "02f27b9b7abf1f5b43f2c093ff9c0aa0",
"score": "0.6516555",
"text": "def new\n @boat = Boat.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json {render json: @boat}\n end\n end",
"title": ""
},
{
"docid": "315b0642d50e20714d6b7336d8b3465d",
"score": "0.65142566",
"text": "def new\n @taxon = Taxon.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @taxon }\n end\n end",
"title": ""
},
{
"docid": "315b0642d50e20714d6b7336d8b3465d",
"score": "0.65142566",
"text": "def new\n @taxon = Taxon.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @taxon }\n end\n end",
"title": ""
},
{
"docid": "0ce5f32cdc37e7ac6a7e11a7e2210b1e",
"score": "0.65134",
"text": "def new\n @monkey = Monkey.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @monkey }\n end\n end",
"title": ""
},
{
"docid": "ceaa56c877e75b5a60bba5843aa3468b",
"score": "0.6511601",
"text": "def new\n @chair = Chair.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @chair }\n end\n end",
"title": ""
},
{
"docid": "ceaa56c877e75b5a60bba5843aa3468b",
"score": "0.6511601",
"text": "def new\n @chair = Chair.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @chair }\n end\n end",
"title": ""
},
{
"docid": "c283bb3ed6c31f1e9020584e7e7f4dd9",
"score": "0.6510088",
"text": "def new\n @foodhamper = Foodhamper.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @foodhamper }\n end\n end",
"title": ""
},
{
"docid": "3d8ee53891cf461923d55eac10bf5e38",
"score": "0.6507326",
"text": "def new\n @trenton = Trenton.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @trenton }\n end\n end",
"title": ""
},
{
"docid": "cd091ea3e69dc2751702c898443960d4",
"score": "0.6499156",
"text": "def new\n @taxinomy = Taxinomy.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @taxinomy }\n end\n end",
"title": ""
},
{
"docid": "2c30f016f57b0bbe8f0a2654e173a017",
"score": "0.64956546",
"text": "def new\n @tool_specialty_option = ToolSpecialtyOption.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @tool_specialty_option }\n end\n end",
"title": ""
},
{
"docid": "577d6314e134136cc2e8cb48616bf229",
"score": "0.64924353",
"text": "def new\n @clothing_article = ClothingArticle.new\n @categories = get_categories\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @clothing_article }\n end\n end",
"title": ""
},
{
"docid": "0267a06315196486a9bb52cebf97628d",
"score": "0.6491904",
"text": "def create\n @chef_specialty = ChefSpecialty.new(chef_specialty_params)\n\n respond_to do |format|\n if @chef_specialty.save\n format.html { redirect_to @chef_specialty, notice: 'Chef specialty was successfully created.' }\n format.json { render :show, status: :created, location: @chef_specialty }\n else\n format.html { render :new }\n format.json { render json: @chef_specialty.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6a90c1bf2e41ffaca4d8176840b76c98",
"score": "0.6488586",
"text": "def new\n @medicine_patient_relationship = MedicinePatientRelationship.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @medicine_patient_relationship }\n end\n end",
"title": ""
},
{
"docid": "922eefbb3ab06385c06b9c148346f1cf",
"score": "0.64873695",
"text": "def new\n @lookup = Lookup.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @lookup }\n end\n end",
"title": ""
}
] |
6885a3d4d92d4bed0ed0d648f79379d2 | click on people tab | [
{
"docid": "236e893b53d737b278ba00027c20fcae",
"score": "0.65973777",
"text": "def clickPeopleLink()\n sleep(5)\n @driver.find_element(:xpath, \"//*[@id='main-content']/nav/div[2]/div/a[3]\").click\n wait = Selenium::WebDriver::Wait.new(:timeout => 10)\n wait.until { @driver.find_element(:id => \"attendees\").displayed? }\n end",
"title": ""
}
] | [
{
"docid": "14221d4110ca5e6e5ece54119f0f5bfa",
"score": "0.74167734",
"text": "def click_tab(tab_name)\n tab(tab_name).click\n end",
"title": ""
},
{
"docid": "0d0db9cb84ea2cf02157c3505c24edb7",
"score": "0.6933186",
"text": "def click_on_tab(text)\n find('.app-body .ui-tabs').find('a', text: text).click\nend",
"title": ""
},
{
"docid": "34b30fe256d5db7c5631606aa6aa508a",
"score": "0.6788279",
"text": "def contacts_tab()\n wait = Selenium::WebDriver::Wait.new(:timeout => 5)\n wait.until {@driver.find_element(CUSTOMER_CONTACTS_TAB).displayed?}\n contacts_tab = @driver.find_element(CUSTOMER_CONTACTS_TAB)\n contacts_tab.click\n end",
"title": ""
},
{
"docid": "fc845c17bf730e01486c41a130672f78",
"score": "0.6712091",
"text": "def profile\n self.profilelink.click\n end",
"title": ""
},
{
"docid": "43f8537ab94738171c3f014bdab665bd",
"score": "0.666752",
"text": "def click_on_profile_by_name(name = get_random_profile_name)\n click(css: \"h4>a[class='freelancer-tile-name'][title='#{name}']\")\n Log.step \"Clicked on random profile, profile selected: '#{name}'\"\n end",
"title": ""
},
{
"docid": "8fadc43d8fd19fb5f2f27917427066fa",
"score": "0.65838647",
"text": "def tab_sprint\n @ole.open\n @ole.browser.link(:text => 'Admin').when_present.click\n @ole.browser.link(:text => 'Maintenance').when_present.click\n @ole.browser.link(:text => 'Select/Acquire').when_present.click\n @ole.browser.link(:text => 'Describe').when_present.click\n @ole.browser.link(:text => 'Deliver').when_present.click\n end",
"title": ""
},
{
"docid": "8c4b58d075015b8f83a50deaff3838a9",
"score": "0.6521983",
"text": "def activities_tab()\n wait = Selenium::WebDriver::Wait.new(:timeout => 5)\n wait.until {@driver.find_element(ACTIVITIES_TAB).displayed?}\n activities_tab = @driver.find_element(ACTIVITIES_TAB)\n activities_tab.click\n end",
"title": ""
},
{
"docid": "8c4b58d075015b8f83a50deaff3838a9",
"score": "0.6521983",
"text": "def activities_tab()\n wait = Selenium::WebDriver::Wait.new(:timeout => 5)\n wait.until {@driver.find_element(ACTIVITIES_TAB).displayed?}\n activities_tab = @driver.find_element(ACTIVITIES_TAB)\n activities_tab.click\n end",
"title": ""
},
{
"docid": "fd30cdfa0a6a1441af28763370c53c8d",
"score": "0.65172327",
"text": "def click_dept_tab_link_element(dept)\n logger.debug \"Click '#{dept.name}' tab in 'Users' section\"\n wait_for_load_and_click(dept_tab_link_element dept)\n end",
"title": ""
},
{
"docid": "94863baf09ae79462bd546379da406e1",
"score": "0.6510453",
"text": "def activate_tab_with_click\n click\n \n # No event yet so just cheat and sleep\n sleep(0.1);\n end",
"title": ""
},
{
"docid": "8d12ced65fae0e52684da5e90e122040",
"score": "0.6501167",
"text": "def contact_info_tab()\n wait = Selenium::WebDriver::Wait.new(:timeout => 5)\n wait.until {@driver.find_element(CONTACT_INFO_TAB).displayed?}\n contact_info_tab = @driver.find_element(CONTACT_INFO_TAB)\n contact_info_tab.click\n end",
"title": ""
},
{
"docid": "9c433ccd2bdf3fcbb7bf9540f8aeb4d8",
"score": "0.64261425",
"text": "def click_new_profile\n click_link('Create a profile')\n end",
"title": ""
},
{
"docid": "538c95fea5cdb6ef564af3e92d2ea84d",
"score": "0.6422404",
"text": "def link_account_click\n link_account_button.click\n end",
"title": ""
},
{
"docid": "7747a2e3e1572be0d4293686abe3ebf4",
"score": "0.6358949",
"text": "def click\n @mech.click self\n end",
"title": ""
},
{
"docid": "a06b6013878d8614cd6cefed066583e6",
"score": "0.6358942",
"text": "def click_primary_record_tab\n logger.info 'Clicking the primary record tab'\n wait_for_element_and_click primary_tab\n end",
"title": ""
},
{
"docid": "92982d0d52efa5dfe64063045d25589e",
"score": "0.63565993",
"text": "def click_tab(id, timeout=nil)\r\n tab = find_by_id_and_class(id, \"gwt-TabLayoutPanelTab\", timeout)\r\n tab.click\r\n end",
"title": ""
},
{
"docid": "451f5ab3db430f73be00c0642e740b53",
"score": "0.63421524",
"text": "def activate_tab_with_click\n wait_start\n click \n wait_for_window_activated(\"Document Window\")\n end",
"title": ""
},
{
"docid": "02e0667c615ff2f13bf701ab6ba76a5e",
"score": "0.6316586",
"text": "def click(link); end",
"title": ""
},
{
"docid": "0369e386c7b1fb8eb34c0b07a1924a4a",
"score": "0.63144433",
"text": "def open_ui_tab(target)\n tab = @driver.find_element(:id, \"#{target}-nav\")\n tab.click\n @wait.until {@driver.find_element(:id, target).displayed?}\n end",
"title": ""
},
{
"docid": "7d4bc99887a523426bf2c3b9f6f1bc22",
"score": "0.63123304",
"text": "def open_section(label)\n find(:xpath, %Q(//.[@role=\"tab\"][contains(., \"#{label}\")])).click\n end",
"title": ""
},
{
"docid": "77d117795f719a0ca107fef8ac997b60",
"score": "0.628832",
"text": "def click_become_a_member\n add_new = $browser.element(@selector).link(text: 'Become a Member')\n add_new.click\n end",
"title": ""
},
{
"docid": "d0b144ce06b8490da158ba4db477b194",
"score": "0.621931",
"text": "def click_on_freelancer_profile\n puts \"Step 9: Click on Freelancer Profile\"\n $freelancer.find_elements(css: \"a.freelancer-tile-name\").last.click\n puts \"Freelancer Profile clicked successfully\"\n\n end",
"title": ""
},
{
"docid": "f34e796b85e8fefb3f033749b85c581f",
"score": "0.6165584",
"text": "def click; end",
"title": ""
},
{
"docid": "f34e796b85e8fefb3f033749b85c581f",
"score": "0.6165584",
"text": "def click; end",
"title": ""
},
{
"docid": "f34e796b85e8fefb3f033749b85c581f",
"score": "0.6165584",
"text": "def click; end",
"title": ""
},
{
"docid": "44d012dbd43ffadb7398010c73b3f175",
"score": "0.6153229",
"text": "def select_tab\n select find_by_id(handles.selected.tab_id)\n end",
"title": ""
},
{
"docid": "6e3348784d2bc127eb6ef5d9b74e933e",
"score": "0.6130133",
"text": "def set_selected_tab\n end",
"title": ""
},
{
"docid": "7e45b4d18c8a745df7d8504049b43c31",
"score": "0.6127012",
"text": "def view_person(name)\n name_link(name).click\n wait_for_ajax\n ViewPerson.new @browser\n end",
"title": ""
},
{
"docid": "5b76d9607a19b5463980d72a236b898b",
"score": "0.61183465",
"text": "def estimates_tab()\n wait = Selenium::WebDriver::Wait.new(:timeout => 5)\n wait.until {@driver.find_element(ESTIMATES_TAB).displayed?}\n estimates_tab = @driver.find_element(ESTIMATES_TAB)\n estimates_tab.click\n end",
"title": ""
},
{
"docid": "65c0d927b3eb0567e5f984f2432f3aeb",
"score": "0.6085622",
"text": "def view_person(name)\n name_link(name).click\n sleep 3\n self.wait_for_ajax\n ViewPerson.new @browser\n end",
"title": ""
},
{
"docid": "1a1b23305d43f7f5e0d45b85e4968ce3",
"score": "0.6053181",
"text": "def go_to_helpdesk_page\n edit_user_link.click\n helpdesk_link.click\n end",
"title": ""
},
{
"docid": "e557c42e3ebbfbed2dd58c10b3ade47c",
"score": "0.602262",
"text": "def SwitchTab\n page.driver.browser.switch_to.window (page.driver.browser.window_handles.last)\n end",
"title": ""
},
{
"docid": "c956824ac78230bf2e757c7b59fcf2b4",
"score": "0.59935033",
"text": "def go_to_preferences\n page.find('.account').trigger(:mouseover)\n click_link \"preferences\"\n page.should have_content(\"Edit Introductory Email\")\n end",
"title": ""
},
{
"docid": "95b004865d9d2291f3a1baea59c53c54",
"score": "0.5954781",
"text": "def jobs_tab()\n wait = Selenium::WebDriver::Wait.new(:timeout => 5)\n wait.until {@driver.find_element(JOBS_TAB).displayed?}\n jobs_tab = @driver.find_element(JOBS_TAB)\n jobs_tab.click\n end",
"title": ""
},
{
"docid": "95b004865d9d2291f3a1baea59c53c54",
"score": "0.5954781",
"text": "def jobs_tab()\n wait = Selenium::WebDriver::Wait.new(:timeout => 5)\n wait.until {@driver.find_element(JOBS_TAB).displayed?}\n jobs_tab = @driver.find_element(JOBS_TAB)\n jobs_tab.click\n end",
"title": ""
},
{
"docid": "d81bc0f5e77b1a3b0a9fe20707d923ca",
"score": "0.59395814",
"text": "def click_view_everyone_cohorts\n sleep 2\n wait_for_load_and_click view_everyone_cohorts_link_element\n wait_for_title 'All Cohorts'\n end",
"title": ""
},
{
"docid": "2f4a882101e5bd897a8e3c5bcde062cd",
"score": "0.59336317",
"text": "def clickUserProfile(items, itemNumber)\n items[itemNumber].find_element(NAMEOFTHEFREELANCER).click\n return UserProfilePage.new(@driver)\n end",
"title": ""
},
{
"docid": "71fd37a667c3368f54ebbe1de44f0c6e",
"score": "0.5926404",
"text": "def item_was_clicked(sender)\n # Find the selected Link instance via the array controller and get its url attribute\n url_string = array_controller.selectedObjects.first.url\n if url_string\n # convert the url into a NSURL instance and open it in the browser.\n url = NSURL.URLWithString(url_string)\n NSWorkspace.sharedWorkspace.openURL(url)\n end\n end",
"title": ""
},
{
"docid": "9066793d795e14e34d5d454fbb38178d",
"score": "0.59260297",
"text": "def open_profile_menu\n id(\"profile_menu_btn\").wait_until(&:present?)\n id(\"profile_menu_btn\").click\n @browser.nav(css: \".drop_menu_nav.active\").wait_until(&:present?)\n sleep 1\n end",
"title": ""
},
{
"docid": "e59308b013c72a5a246a2ab789b17a76",
"score": "0.5896444",
"text": "def click_on_a_specific_fanzone_within_join_fanzone_panel(fanzoneSelector)\n\n find(fanzoneSelector).click\n\n end",
"title": ""
},
{
"docid": "cef66c5ccc028de371d7d6eebd12327f",
"score": "0.58898515",
"text": "def open_random_profile(candidates, candidate_number)\n puts \"\\nOpening random profile: #{candidates[candidate_number][:name]}\"\n click(link_text: candidates[candidate_number][:name])\n end",
"title": ""
},
{
"docid": "fff84f4b455506060c1a063b32ed77ff",
"score": "0.58889717",
"text": "def select_puppy(name = 'Hanna')\n index = index_for(name)\n view_detail_elements[index].click\n end",
"title": ""
},
{
"docid": "9a6eea060650e5adbd137ec689305c8d",
"score": "0.5888567",
"text": "def click_view_website\n view_website_link.click\n end",
"title": ""
},
{
"docid": "59fe6ed46487c23ec382c8efa1c4c395",
"score": "0.58826834",
"text": "def exibir_lojas()\n lojas.click\n end",
"title": ""
},
{
"docid": "922ac1f96cc6d772f353b5927afe6c30",
"score": "0.5872302",
"text": "def clickCompanyProfile(items, itemNumber)\n items[itemNumber].find_element(NAMEOFTHEFREELANCER).click\n return CompanyProfilePage.new(@driver)\n end",
"title": ""
},
{
"docid": "240c6ee489e4eea6557e144da12362fa",
"score": "0.5860266",
"text": "def on_click\n\t\tend",
"title": ""
},
{
"docid": "1d4026f8871c954d4eed4d5c843deb67",
"score": "0.58532256",
"text": "def switch_tab(tab, title)\n append_to_script \"switch_tab \\\"#{tab}\\\" , \\\"#{title}\\\"\"\n end",
"title": ""
},
{
"docid": "c5d487a83642e483ad4c63db7cd4bbe8",
"score": "0.58487314",
"text": "def on_tab_select(sender, selector, e)\n select_tab(@tabs.current)\n end",
"title": ""
},
{
"docid": "0d3f3b857f1e62c084435d443e1c04cb",
"score": "0.58227414",
"text": "def click\n p [ :app_click ]\n view.click\n end",
"title": ""
},
{
"docid": "17f204b42e1ba45a0adaebed79d48fc9",
"score": "0.58226794",
"text": "def select_freelancer(item)\n select_random_profile(item).click\n end",
"title": ""
},
{
"docid": "46959cb064bce4077de7994d6ff101f9",
"score": "0.5821442",
"text": "def navigate_to_a_fanzone(fanzoneSelector)\n\n find(fanzoneSelector).click\n\n end",
"title": ""
},
{
"docid": "3ca54a1698a6fdcf627a3df3f9fb7173",
"score": "0.5816729",
"text": "def click\n @sign_in.click\n end",
"title": ""
},
{
"docid": "0a2277ab93e2ace4e013b3c369593046",
"score": "0.5814137",
"text": "def view_owner_of(name)\n name_li(name).link(:class=>/s3d-regular-light-links (mylibrary_item_|searchcontent_result_)username/).click\n self.div(:id=>\"entity_name\").wait_until_present\n ViewPerson.new @browser\n end",
"title": ""
},
{
"docid": "71eb597079107ba88414abd03cdeae5b",
"score": "0.5806563",
"text": "def show_tab(name)\n @log.debug \" show_tab: Waiting up to #{DEFAULT_TIMEOUT} seconds to find_element(:xpath, \\\"//input[@title='open #{name}']\\\")...\"\n wait = Selenium::WebDriver::Wait.new(:timeout => DEFAULT_TIMEOUT)\n wait.until { driver.find_element(:xpath, \"//input[@title='open #{name}']\") }\n @driver.find_element(:xpath, \"//input[@title='open #{name}']\").click\n pause\n end",
"title": ""
},
{
"docid": "863c561036a6eeca2dbbc524fcd6223e",
"score": "0.58055973",
"text": "def access_myaccount\n button_myaccount.click\n end",
"title": ""
},
{
"docid": "80eae29192a8a5dcde9268e5b9555d7a",
"score": "0.57956755",
"text": "def click_approach_link\n click APPROACH_LINK\n end",
"title": ""
},
{
"docid": "b814da7bb654b0e41815f3edd058a0f4",
"score": "0.5795135",
"text": "def test01_LI2_view_contributor\n\t\t$browser.goto($patch_login)\n\t\tloginDirectory\n\t\t$browser.goto($patch_directory_listing)\n\t\t$directory_top.fire_event(\"onclick\")\n\t\t\n\t\tsleep 5\n\t\tbegin\n\t\tassert assert $browser.text.include? \"Recent Activity\"\n\t\trescue => e\n\t\t\tputs e\n\t\tputs \"LI2_view_contributor: FAILED! Unable to view top contributor profile.\"\n\t\tend\n\tend",
"title": ""
},
{
"docid": "971f4b359289936a44ed9a7e8f7363f1",
"score": "0.578602",
"text": "def open_page(name)\n name_link(name).click\n self.wait_for_ajax\n self.window(:title=>\"rSmart | Content Profile\").use\n ContentDetailsPage.new @browser\n end",
"title": ""
},
{
"docid": "50618bdc6e40ab7f850179c101766729",
"score": "0.5784261",
"text": "def open_page(name)\n name_link(name).click \n wait_for_ajax\n self.window(:title=>\"rSmart | Content Profile\").use\n ContentDetailsPage.new @browser\n end",
"title": ""
},
{
"docid": "48f456e162050b177239312c4af30840",
"score": "0.5775587",
"text": "def scheduling_tab()\n wait = Selenium::WebDriver::Wait.new(:timeout => 5)\n wait.until {@driver.find_element(SCHEDULING_TAB).displayed?}\n scheduling_tab = @driver.find_element(SCHEDULING_TAB)\n scheduling_tab.click\n end",
"title": ""
},
{
"docid": "d573263564dd8deeceb55fdc172bd3d8",
"score": "0.5765188",
"text": "def tap_action_sheet(label)\n choose = self.action_sheet.send(:_viewByName, label)\n tap(choose)\n end",
"title": ""
},
{
"docid": "2a2942aca5c18522b8f7c7a2687ec4ee",
"score": "0.57521594",
"text": "def click_groups\n @dashboard.select_link('Groups')\n end",
"title": ""
},
{
"docid": "c5ca3b76926c53d30bd0b44d9fb5c958",
"score": "0.5751293",
"text": "def switch(target = nil)\n if target\n # Switch to a specific tab\n @tabs.switch_to_label target\n else\n # Switch to the next tab\n @tabs.scroll\n end\n end",
"title": ""
},
{
"docid": "2c99809cf797842327619341755de3ad",
"score": "0.573521",
"text": "def test_int_page\n open_new_tab(Constants::INT_PAGE)\n sleep 5\n button_click(LOCATOR['RWDS_TAB'])\n switch_frame\n button_click(LOCATOR['ERN_PTS'])\n p text_displayed?(LOCATOR['ACT_NM'], 'Account Creation')\n switch_back\n @driver.close\n end",
"title": ""
},
{
"docid": "44036e2af226c782c3532964643e5a82",
"score": "0.5700638",
"text": "def show_other_sites\n frm.link(:text=>\"Show other sites\").click\n end",
"title": ""
},
{
"docid": "177ff97e1f9fc5875a86be2c1c7aac20",
"score": "0.5688262",
"text": "def select_puppy(name = 'Brook')\n\t\tindex = index_for(name)\n\t\tbutton_element(value: 'View Details', index: index).click\n\t\t# view_detail_elements[index].click\n\tend",
"title": ""
},
{
"docid": "861a9295247243f01c5a0adf8655903d",
"score": "0.5677449",
"text": "def tab(&block)\n cur_page.tab(&block)\n end",
"title": ""
},
{
"docid": "1594190ff5471abd21952de96b0032d7",
"score": "0.5674492",
"text": "def clicked;end",
"title": ""
},
{
"docid": "be4476fd042feb04cc815a106f1db08d",
"score": "0.5671986",
"text": "def sub_navigate\n page(FeedDetailsPage).touch_row\n page(MorePage).page_handler(\"Submission\")\n end",
"title": ""
},
{
"docid": "e88162b80e40e4d0a96c612d3c073122",
"score": "0.56661457",
"text": "def action\n trigger :click\n end",
"title": ""
},
{
"docid": "f23517093f683d13d157cd3c90260987",
"score": "0.56603754",
"text": "def switch_to_tab(name)\n raise(\"Method not implemented for this class: #{@klass}\")\n end",
"title": ""
},
{
"docid": "c84bff5e7abf711e7a37dc30a3769467",
"score": "0.564363",
"text": "def go_to_where_you_belong\n \n end",
"title": ""
},
{
"docid": "bfb12ea9e387dc659f58135525d0044b",
"score": "0.5624281",
"text": "def click_act_as_link\n act_as_link.click\n sleep(10)\n end",
"title": ""
},
{
"docid": "a2e11bb8752a7ae4e020ff42e177d12b",
"score": "0.5624007",
"text": "def login_as(person)\n visit \"/person_session/new\" unless current_path == \"/person_session/new\"\n assert_selector \"#person_session_login\"\n fill_in \"person_session_login\", with: person.login\n fill_in \"person_session_password\", with: \"secret\"\n click_button \"login_button\"\n end",
"title": ""
},
{
"docid": "959c98137ff4a5929cce686ba3bd817e",
"score": "0.5619139",
"text": "def notes_tab()\n wait = Selenium::WebDriver::Wait.new(:timeout => 5)\n wait.until {@driver.find_element(NOTES_TAB).displayed?}\n notes_tab = @driver.find_element(NOTES_TAB)\n notes_tab.click\n end",
"title": ""
},
{
"docid": "3cbf5afcd8f540b8243ac1ff45d22777",
"score": "0.5613782",
"text": "def click_edit(the_name)\n response.should contain the_name\n click_link_within \"div[id*=\\\"\"+to_html_tag(the_name)+\"\\\"]\", \"Edit\"\n end",
"title": ""
},
{
"docid": "3cbf5afcd8f540b8243ac1ff45d22777",
"score": "0.5613312",
"text": "def click_edit(the_name)\n response.should contain the_name\n click_link_within \"div[id*=\\\"\"+to_html_tag(the_name)+\"\\\"]\", \"Edit\"\n end",
"title": ""
},
{
"docid": "58d5bcbadc04151a41d4dfca554f1c1b",
"score": "0.5594088",
"text": "def click_sections\n find(\"#header-sections\").click\n end",
"title": ""
},
{
"docid": "abea961e6ce02ae19892639098a1c381",
"score": "0.55920595",
"text": "def click_first_loan_link\n find(:xpath, ta(@first_loan_ta, @first_loan_il)).click\n end",
"title": ""
},
{
"docid": "18bcfc546e7246be8308a9aa7642dc6b",
"score": "0.55903715",
"text": "def go_to_admin_page\n user_name.click\n admin_link.click\n end",
"title": ""
},
{
"docid": "a4e272f7c48df1b620510deeb8fd0308",
"score": "0.55854964",
"text": "def comp_signin_link\n click_link 'Sign in'\n end",
"title": ""
},
{
"docid": "45effb25eafdfa47c54a77468335dbc5",
"score": "0.55825716",
"text": "def sub_view\n page(NavTabBarPage).select_storytab(\"Action\")\n page(NavTabBarPage).flag_handler(\"Cancel\")\n page(NavTabBarPage).select_storytab(\"Action\")\n page(NavTabBarPage).sub_handler\n page(SubmissionPage).verify_page_elements\n page(SubmissionPage).select_action(\"Submissions\")\n page(SubmissionPage).select_action(\"Comments\")\n page(MorePage).backpage\n end",
"title": ""
},
{
"docid": "455aef0dcd2180208c8d9efcaed3d0b1",
"score": "0.558073",
"text": "def click_on_a_button(selector)\n\n click_button(selector)\n\n end",
"title": ""
},
{
"docid": "c28095802ef7815028f5735e8308fd75",
"score": "0.55760056",
"text": "def click_settings\n settings.click\n end",
"title": ""
},
{
"docid": "c4bcb6c5b505dda1f8b5d2a0c5b929fc",
"score": "0.5571426",
"text": "def tab_to(*args)\n name = args[0]\n url_options = args[1] || {}\n html_options = args[2]\n url = url_for(url_options)\n\n link = link_to(name, url, html_options)\n\n if request.path == url\n raw \"<li class ='selected'>\" + link + \"</li>\"\n else\n raw \"<li>\" + link + \"</li>\"\n end\n end",
"title": ""
},
{
"docid": "1f3716efddb3aace7927f3f2995d7b5d",
"score": "0.55622935",
"text": "def go_home\n self.homelink.click\n end",
"title": ""
},
{
"docid": "27af9045312dc97fdee52419294b3840",
"score": "0.55618876",
"text": "def click_on_link(selector)\n\n click_link(selector)\n\n end",
"title": ""
},
{
"docid": "3bcd2d2ed0e38b435317c4fa31453194",
"score": "0.55511713",
"text": "def clicked\n router.navigated\n end",
"title": ""
},
{
"docid": "fefd3c713af576d49d1e3c3af3602842",
"score": "0.5550718",
"text": "def homeandnewuser(driver)\n #Open page\n loggEr(\"Log: Open page #{URL_HOME}\")\n driver.get(URL_HOME)\n matchUrl(URL_HOME, driver)\n\n #Choose create a new user button and\n loggEr(\"Log: Click on the Create a new user button\")\n driver.find_element(:link, \"Create a new user\").click\nend",
"title": ""
},
{
"docid": "185e24ffdb4129eccf6d8616f882d8ea",
"score": "0.55504775",
"text": "def click_sign_in_button\n\t\tsign_in_button.click\n\tend",
"title": ""
},
{
"docid": "86d1355d9cbc78ef55dcce66a62b7d46",
"score": "0.5540649",
"text": "def clickManageTour()\n EnziUIUtility.wait(@driver, :name, \"lightning_manage_tours\", @timeSettingMap['Wait']['Environment']['Lightening']['Max'])\n @driver.find_element(:name, \"lightning_manage_tours\").click\n EnziUIUtility.switchToWindow(@driver, @driver.current_url())\n end",
"title": ""
},
{
"docid": "f14d3ca1b912344abcd796dab58a68d0",
"score": "0.5540424",
"text": "def click\r\n start_point = screen.find ident\r\n click_x = start_point.x + offset_x\r\n click_y = start_point.y + offset_y\r\n\r\n screen.click click_x, click_y\r\n end",
"title": ""
},
{
"docid": "0c722f0283697ca09a8e7ec9e432c15f",
"score": "0.553607",
"text": "def open_tab(name, &block)\n create_tab(name, 'Default Session', &block)\n end",
"title": ""
},
{
"docid": "dc8ab8869797ae204f2fce7f347560ac",
"score": "0.5534782",
"text": "def redirectToAvailability\n EnziUIUtility.wait(@driver, :id, 'MoreTabs_Tab', 100)\n @driver.find_element(id: 'MoreTabs_Tab').click\n @driver.find_element(:link, 'Reservable').click\n #sleep(10)\n end",
"title": ""
},
{
"docid": "0d3fb82b83ac6dc91b04f5a2f5328602",
"score": "0.55308944",
"text": "def verifyInformationScreen()\n clickOnMoreTab()\n clickOnInformation()\n verifyMeeting()\n end",
"title": ""
},
{
"docid": "c968b0d1bbd03dbceb23ec736d068f4a",
"score": "0.5527564",
"text": "def open_research(name)\n name_link(name).click\n sleep 1\n self.wait_for_ajax\n self.execute_script(\"$('#joinrequestbuttons_widget').css({display: 'block'})\")\n ResearchIntro.new @browser\n end",
"title": ""
},
{
"docid": "35529f3e884c41c4cca9dc11702bf207",
"score": "0.55190396",
"text": "def login_as(person)\n visit \"/person_session/new\"\n wait_for \"#person_session_login\"\n fill_in \"person_session_login\", :with => person.login\n fill_in \"person_session_password\", :with => \"secret\"\n click_button \"login_button\"\n end",
"title": ""
},
{
"docid": "e4ee88db571efaf86cf70e3370808f47",
"score": "0.5514304",
"text": "def open_research(name)\n name_link(name).click\n sleep 1\n wait_for_ajax\n self.execute_script(\"$('#joinrequestbuttons_widget').css({display: 'block'})\")\n ResearchIntro.new @browser\n end",
"title": ""
},
{
"docid": "1d68f71ca7047c85ca2d61612dfb2d2f",
"score": "0.55136067",
"text": "def tab a_tab\n content_for :tab, a_tab\n end",
"title": ""
},
{
"docid": "0a9964edddcff05f8fd63a35323f6712",
"score": "0.55071527",
"text": "def navigate_into\n title_element.when_present.click\n end",
"title": ""
}
] |
8f2727d2d463887bc7d7d4131d9d273b | =begin Push element x to the back of queue. :type x: Integer :rtype: Void =end | [
{
"docid": "bed0ad1864f8f1544d38b1551f2b8b43",
"score": "0.6981006",
"text": "def push(x)\n old_last = @last\n @last = Node.new(x)\n if(@first == nil)\n @first = @last\n else\n old_last.next = @last\n end\n @size += 1\n end",
"title": ""
}
] | [
{
"docid": "6efe0d99f91c8bd3898e2cc31b0f8270",
"score": "0.8498538",
"text": "def push(x)\n @queue.push(x)\n i = 0 \n while i < @size\n @queue.push(@queue.shift)\n i += 1\n end\n \n @size += 1\n return\n end",
"title": ""
},
{
"docid": "fd5f43c411eaa6c007defa2ea7267f9a",
"score": "0.8425931",
"text": "def push(x)\n @queue.push(x)\n nil\n end",
"title": ""
},
{
"docid": "b323a3a47465a443f8693b0f4fe9829c",
"score": "0.81800866",
"text": "def push(x)\n @size += 1\n @queue_in.push(x)\n end",
"title": ""
},
{
"docid": "b5df86a47b93a6649da0b693f6562874",
"score": "0.8133064",
"text": "def push(x) \n @queue.insert(x)\n self\n end",
"title": ""
},
{
"docid": "bc377e31fe81a8a72d5702e107692ec8",
"score": "0.8065127",
"text": "def push(x)\n @size += 1\n @queue_in.push(x)\n end",
"title": ""
},
{
"docid": "cf5f4f0f192cdb86876e09165aeb764e",
"score": "0.79809034",
"text": "def push(x)\n @queue << x\n end",
"title": ""
},
{
"docid": "e0c604e1ce6a847c2225ba3ccc6d95e7",
"score": "0.78667563",
"text": "def push(x)\n @q1 << x\n @count += 1\n end",
"title": ""
},
{
"docid": "a05e9b33d1afd721529788e219ac06e0",
"score": "0.78014183",
"text": "def push(x)\n p = @stack.unshift(x)\n @q.insert(p)\n self\n end",
"title": ""
},
{
"docid": "96fe9d233b4856fcdff284151d4e6f17",
"score": "0.77440417",
"text": "def push(x)\n @push_queue.push(x)\n pipe()\n swap()\n end",
"title": ""
},
{
"docid": "ad4f8602cb155287e65e9b2b3e861fca",
"score": "0.7533468",
"text": "def push(x)\n @q << x \n end",
"title": ""
},
{
"docid": "cb8e5cce2179bb380856889e916218cd",
"score": "0.75075644",
"text": "def push(x)\n @q1.push x\n end",
"title": ""
},
{
"docid": "995ef6b70a18fe428eccbcacf76c677f",
"score": "0.74957323",
"text": "def push(x)\n @store.unshift(x)\n end",
"title": ""
},
{
"docid": "520c3fe0a41832ded6ab39789de29127",
"score": "0.7353548",
"text": "def push(x)\n @stack.unshift(x)\n end",
"title": ""
},
{
"docid": "96c1ea3b5cb2d9d21581b9be08cbc654",
"score": "0.7267176",
"text": "def push(x)\n q = @queue1.empty? ? @queue2 : @queue1\n q.push x\n end",
"title": ""
},
{
"docid": "083cea923aa261c7901d908a3b6cf11d",
"score": "0.7199184",
"text": "def push(x)\n \n end",
"title": ""
},
{
"docid": "083cea923aa261c7901d908a3b6cf11d",
"score": "0.7199184",
"text": "def push(x)\n \n end",
"title": ""
},
{
"docid": "13eb668bbb2212d50125de75133667ba",
"score": "0.7119176",
"text": "def push(x)\n @stack.push(x)\n end",
"title": ""
},
{
"docid": "91747bb45a9e8b352241195e3ae333b2",
"score": "0.704959",
"text": "def push(x)\n @stack.push(x)\n end",
"title": ""
},
{
"docid": "4b5c615d514ebc684cc8f104021a52a6",
"score": "0.704481",
"text": "def push(x)\n @stack.push(x)\n @min_stack.push(x) if @min_stack.empty? || @min_stack[-1] >= x\n end",
"title": ""
},
{
"docid": "4dbea8c8cbff1bb433b7b0ea4bad36cc",
"score": "0.7032005",
"text": "def push(x)\n end",
"title": ""
},
{
"docid": "63fca6f15511012e6b1735311e7f5f4f",
"score": "0.7029582",
"text": "def push(x)\n min = @array.empty? ? x : [@array[-1][1], x].min\n @array.push([x, min])\n nil\n end",
"title": ""
},
{
"docid": "de37dbd0564ab334c5fd3832aa89847c",
"score": "0.702516",
"text": "def push(x)\n @head = Item.new(x, @head)\n end",
"title": ""
},
{
"docid": "6903b45b4733e8eb0fe5d18e09be037e",
"score": "0.7013516",
"text": "def push(x)\n @stack.push(x)\n end",
"title": ""
},
{
"docid": "d93bdc5dc2be816ecaf1d9f152f2a828",
"score": "0.69890183",
"text": "def push(x)\n @stack << x \n end",
"title": ""
},
{
"docid": "1e6acc75cb1b8a1f2780f6e199936363",
"score": "0.69686145",
"text": "def push(x)\n @stack << x\n end",
"title": ""
},
{
"docid": "116cc96c3c8d59fba2d780f2be10657c",
"score": "0.69546914",
"text": "def push(x)\n max = @max_stack.empty? ? x : [x, @max_stack[-1]].max\n @max_stack.push(max)\n @stack.push(x)\n end",
"title": ""
},
{
"docid": "7d118c93dcd2d0ccde042e923099d167",
"score": "0.6934014",
"text": "def push(x)\n @stack.push(x)\n @min_stack.push(x) if @min_stack.empty? || @min_stack[-1] >= x\n end",
"title": ""
},
{
"docid": "8cd93d8624ec6ed1651275401e2518e2",
"score": "0.69062835",
"text": "def push(x)\n @stack1.push(x)\n end",
"title": ""
},
{
"docid": "1088b44065500ba07bcf3492a4b31d0b",
"score": "0.69029796",
"text": "def push(x)\n @stack << x\n end",
"title": ""
},
{
"docid": "436eb0994705e94c75855db20b773d2b",
"score": "0.6850802",
"text": "def push(x)\n @stack1 << x\n end",
"title": ""
},
{
"docid": "db95a1cf540da4693a7c747f9a22bf79",
"score": "0.6839796",
"text": "def push(x)\n @store << x\n end",
"title": ""
},
{
"docid": "0a868381ca1002587f359a48519bddf7",
"score": "0.68383455",
"text": "def push(x)\n stack.push(x)\n end",
"title": ""
},
{
"docid": "1c19239ed6dec001a21f30d8c82d2691",
"score": "0.6834446",
"text": "def rcv(x)\n if queue.any?\n @waiting = false\n @registers[x] = queue.shift\n else\n @waiting = true\n end\n end",
"title": ""
},
{
"docid": "27c57c91a1ffc2f043b3b8074923f761",
"score": "0.6817631",
"text": "def queue(a)\n p \"Before: #{a}\"\n a.push(6)\n a.shift(1)\n p \"After: #{a}\"\nend",
"title": ""
},
{
"docid": "d08fa5c92a5bb7103e7b7f0ce364a35f",
"score": "0.6795186",
"text": "def push(x)\n @store << x\n \n end",
"title": ""
},
{
"docid": "882324d9da49e77625a354d4c2d20da3",
"score": "0.67729586",
"text": "def pop()\n @size -= 1 \n @queue.shift\n end",
"title": ""
},
{
"docid": "8ef36423b39e60acfff441c932f0c117",
"score": "0.67515856",
"text": "def push(x)\n new_min = x\n if self.min_stack.length > 0 \n last_min= self.min_stack[-1]\n new_min = [x, last_min].min\n end\n self.min_stack.append(new_min)\n return self.stack.append(x)\n end",
"title": ""
},
{
"docid": "6349f4c4d2f9189df81b0820d136c40d",
"score": "0.6733706",
"text": "def push(x)\n if @stack.length == 0 or x <= @min\n @stack.push @min\n @min = x\n end\n @stack.push x\n \n end",
"title": ""
},
{
"docid": "c46c47b54dd222920381e1ff30cfc848",
"score": "0.67287964",
"text": "def enqueue(element)\n # check if queue is full \n raise ArgumentError, \"Queue is full\" if (@back + 1) % MAX_BUFFER == @front \n # check if queue is empty\n # empty queue\n if @front < 0\n @front = @back = 0\n # overflow to wrap around\n elsif @back == MAX_BUFFER - 1 # raise block will check for a full queue\n @back = 0\n @store[@back] = element\n # okay to just add\n else \n @back += 1\n end \n @store[@back] = element\n end",
"title": ""
},
{
"docid": "a19051fe085d04b6c43fedd5339f1133",
"score": "0.6714151",
"text": "def push(v)\n @que << v\n reheap(@que.size-1)\n self\n end",
"title": ""
},
{
"docid": "a4adb2a721b7eae7686bf51bb605c433",
"score": "0.6701383",
"text": "def push(x)\n @stack.push(x)\n max_val = peek_max\n if max_val\n max_val = [max_val, x].max\n else\n max_val = x\n end\n @max_stack.push(max_val)\n x\n end",
"title": ""
},
{
"docid": "634476ef87ae61e5d006c9c66df73d02",
"score": "0.66929555",
"text": "def push(x)\n @freqency[x] += 1\n @max_freq = [@max_freq, @freqency[x]].max\n\n @stack[@freqency[x]] = [] unless @stack[@freqency[x]]\n @stack[@freqency[x]] << x\n end",
"title": ""
},
{
"docid": "f4570a7112e5129f69d6b353f61b97be",
"score": "0.66714483",
"text": "def push(x)\n\t\tif(@adaptee.size == 0)\n\t\t\t@adaptee.insert(x)\n\t\t\t@auxiliar.unshift(x)\n\t\telse\n\t\t\t@auxiliar.each{|a| @adaptee.remove}\n\t\t\t@auxiliar.unshift(x)\n\t\t\t@auxiliar.each{|a| @adaptee.insert(a)}\n\t\tend\n\t\tself\n\tend",
"title": ""
},
{
"docid": "c8eb18f9b64399c27648377392dc357a",
"score": "0.66554546",
"text": "def push(x)\n @data.push(x) \n end",
"title": ""
},
{
"docid": "f24821b6d38ab239576a4c2c64084b10",
"score": "0.65847754",
"text": "def shift\n @lock.synchronize do\n @queue.shift\n end\n end",
"title": ""
},
{
"docid": "b23358871a235da232cb67df221ac52a",
"score": "0.6571324",
"text": "def snoc(x)\n queue(@front, @front_len, exec1(@front_schedule),\n Stream.cons(->{x}, ->{@rear}), @rear_len + 1,\n exec1(@rear_schedule))\n end",
"title": ""
},
{
"docid": "f228aad52146d8a4315ffb1ec3e49c06",
"score": "0.65702164",
"text": "def push(x)\n \n node = ListNode.new(x)\n \n if @head.nil?\n @head = node\n else\n current = @head\n \n until current.next_node.nil?\n current = current.next_node\n end\n \n current.next_node = node\n end\n end",
"title": ""
},
{
"docid": "8213dc3e9ef6382aeedffb31b948ef92",
"score": "0.6539524",
"text": "def pop()\n @queue.shift\n end",
"title": ""
},
{
"docid": "fe94e4c7ef9ab042588514a6187f2ab2",
"score": "0.65299755",
"text": "def push(x)\n self << x\nend",
"title": ""
},
{
"docid": "bfacd0158be4e0897c5b5cb999e1114d",
"score": "0.65284395",
"text": "def push(x)\n @in << x\n end",
"title": ""
},
{
"docid": "a338ee8311df499c448b390e7b3b7ce0",
"score": "0.65066147",
"text": "def push(val)\n resize! if self.length == self.capacity\n self.length += 1 \n self[length - 1] = val \n nil \n end",
"title": ""
},
{
"docid": "7a88eccb0b4d94de2e6daeeede8bf94a",
"score": "0.6490451",
"text": "def push(x)\n @input.push x\n end",
"title": ""
},
{
"docid": "720d58bffa465e580aa91c086e2d5174",
"score": "0.64770234",
"text": "def push(x)\n raise(OverflowError, \"Stack is already full\") if store.length == max\n store.push(x)\n return \"Stack is full\" if store.length == max\n # Don't expose the array\n # we're using for internal storage.\n return self\n end",
"title": ""
},
{
"docid": "df00e71b8b9ab54a0d6bfec36519cb37",
"score": "0.64648414",
"text": "def push(value)\n @count += 1\n new_element = RubyDS::StackQueue::Element.new(value)\n if @head.nil?\n @head = new_element\n else\n new_element.next = @head\n @head = new_element\n end\n end",
"title": ""
},
{
"docid": "b135b35ceb12cbdfa095cad07ca8bd50",
"score": "0.6460884",
"text": "def push(x)\n @s1 << x\n end",
"title": ""
},
{
"docid": "584e4c4bb37b8a639aee798c275d0fe3",
"score": "0.6436542",
"text": "def addToList(x)\n if @first.nil? # Queue empty? new node is both first and last\n @first = @last = Node.new_x x\n else\n @last.next = Node.new_x x # Otherwise insert at back and update @last\n @last = @last.next\n end\n @size += 1 # Update @size\n self # Return receiver to enable cascading of enqueue calls\n end",
"title": ""
},
{
"docid": "44488b24e6ff6da40f0f5d558cb7df70",
"score": "0.6432356",
"text": "def queue(&b)\n @queue << b\n end",
"title": ""
},
{
"docid": "36b7c05c937374c2b3bef5da9a4ccad5",
"score": "0.64288926",
"text": "def push(val)\n @store << val\n idx = count - 1\n @store = BinaryMinHeap.heapify_up(@store, idx, &prc)\n end",
"title": ""
},
{
"docid": "12289422a73c752b0677530b01a7a47c",
"score": "0.6427683",
"text": "def dequeue\n\t\t@queue.shift\n\tend",
"title": ""
},
{
"docid": "c6999c0844791fb7354bd5f78e75a29f",
"score": "0.6409252",
"text": "def move_higher_in_queue\n return unless higher_item_in_queue\n\n acts_as_queue_class.transaction do\n higher_item_in_queue.increment_queue_position\n decrement_queue_position\n end\n end",
"title": ""
},
{
"docid": "87755b9d9ff45ce7995925c01baaba39",
"score": "0.63802195",
"text": "def enqueue(el)\n @maxqueue.push(el) if @maxqueue.length.zero?\n\n @store.push(el)\n while @maxqueue[0] < el\n @maxqueue.pop\n break if @maxqueue.length.zero?\n end\n @maxqueue.push(el)\n end",
"title": ""
},
{
"docid": "2e7a1e2649746827b24d26b55e9f6fb4",
"score": "0.6372862",
"text": "def push(element)\t\t\n\t\twhile !@q1.empty? do\n\t\t\t@q2.enq(@q1.pop) # Dequeue element from queue q1 and enque the same to q2\n\t\tend\n\t\t@q1.enq(element)\n\t\twhile !@q2.empty? do\n\t\t\t@q1.enq(@q2.pop) # Dequeue element from queue q2 and enque the same to q1\n\t\tend\t\n\tend",
"title": ""
},
{
"docid": "fc86955d01850e2e483546c7e3f6dfa3",
"score": "0.63482165",
"text": "def append! x\n\t\t\tcurrent << x\n\t\t\tx\n\t\tend",
"title": ""
},
{
"docid": "2a6743b3ceb98dc46cd716f78ee8b883",
"score": "0.634614",
"text": "def enqueue(element)\n # raise NotImplementedError, \"Not yet implemented\"\n #check if front is empty\n if @front == -1\n #then rear is 1 and front is now 0\n @rear = 1\n @front = 0\n #access the element in the store array\n @store[@front] = element\n #otherwise if front IS the rear, then the queue is full\n elsif @front == @rear \n raise Error,\"Tis Full\"\n #not empty\n #calculate new rear then set it as the element\n #set original rear to new rear\n else\n new_rear = (@rear + 1) % queue_size\n @store[@rear] = element\n @rear = new_rear\n end\n end",
"title": ""
},
{
"docid": "a3d00ca24fcce34a942f27e24dbfeda6",
"score": "0.63356566",
"text": "def dequeue\n @queue.shift\n end",
"title": ""
},
{
"docid": "a66cf0b944ace99058ab83c02a1de136",
"score": "0.63214624",
"text": "def push(val)\n resize! if @length == @capacity\n self.length += 1\n self[length - 1] = val\n\n nil\n end",
"title": ""
},
{
"docid": "2d13cb0c748890b7a0f38df7c66dd6f4",
"score": "0.63149375",
"text": "def _\n push -pop\n end",
"title": ""
},
{
"docid": "50507d45e7b0abe9e7729f1fdc785ed0",
"score": "0.6298081",
"text": "def push(x)\n @arr1.push(x)\n end",
"title": ""
},
{
"docid": "fc9aa102852cd2f7385fd9b992d64964",
"score": "0.62776154",
"text": "def dequeue\n last_el = self.queue_var[-1]\n self.queue_var = self.queue_var[0...-1]\n last_el \n end",
"title": ""
},
{
"docid": "eceec50189603b1f7952127767bce41a",
"score": "0.6269884",
"text": "def dequeue\n @q.shift\n end",
"title": ""
},
{
"docid": "dd4ab6c18806ec7a03741bb89c1e2ad6",
"score": "0.62598026",
"text": "def push(val)\n resize! if length == capacity\n self.length += 1\n self[length - 1] = val\n end",
"title": ""
},
{
"docid": "0f8b6e2e34bebe1fec32608cfa9b8a2f",
"score": "0.6253824",
"text": "def enqueue(value)\n @count += 1\n new_element = RubyDS::StackQueue::Element.new(value)\n\n # If this is the first element, just assign the head and tail.\n if @head.nil?\n @head = new_element\n @tail = @head\n\n # Add the element as a new tail.\n else\n @tail.next = new_element\n @tail = @tail.next \n end\n end",
"title": ""
},
{
"docid": "b7befe1cda3783ff5396beeeee627dc0",
"score": "0.62510705",
"text": "def pop()\n @q.shift\n end",
"title": ""
},
{
"docid": "22646a954a3724d5712b91f2c76ecfc8",
"score": "0.6207922",
"text": "def enqueue(element)\n if element.class.name == \"RealQueue\"\n require 'pry'\n binding.pry\n end\n @store.unshift(element)\n self\n end",
"title": ""
},
{
"docid": "7b79d1ff8596dd0d0794dd61c89dd89f",
"score": "0.6194652",
"text": "def queue notification\n @notification_queue.unshift notification\n end",
"title": ""
},
{
"docid": "ab3f78fa0d919ee68b6a0975e75f5299",
"score": "0.61874014",
"text": "def shift!\n shifted = @queue.shift\n\n return nil if shifted.nil?\n shifted[0]\n end",
"title": ""
},
{
"docid": "328693dd2cf2c7b0b15e8e41442db8a8",
"score": "0.6174387",
"text": "def dequeue; @queue.pop end",
"title": ""
},
{
"docid": "6c864da20ecd4af0ac0d881b96b0742d",
"score": "0.61682945",
"text": "def enqueue(element)\n @queue.insert(@queue.length, element)\n @head = @queue.first\n @tail = @queue.last\n end",
"title": ""
},
{
"docid": "d681b908b3ce1ed09a092ca5c4f7f9e0",
"score": "0.6163689",
"text": "def dequeue\n @data.shift\n end",
"title": ""
},
{
"docid": "d9297ef6dc8c0639bde6a02fe71898bd",
"score": "0.6157744",
"text": "def push(element)\n @store.push(element)\n @top += 1\n end",
"title": ""
},
{
"docid": "e3e08719ed84fb75f122ee7e0c4570ed",
"score": "0.6131151",
"text": "def push &put\n #Thread.pass while self.full?\n sleep 0.01 while self.full?\n self.push! &put\n end",
"title": ""
},
{
"docid": "5c16eb047e5ef90b1f06ed3aa651f6be",
"score": "0.61296594",
"text": "def push(val)\n self.concat([val])\n shift if size > @max_size\n end",
"title": ""
},
{
"docid": "81fe30cfd6e068a38cc88003863d820d",
"score": "0.6123731",
"text": "def queue(_); end",
"title": ""
},
{
"docid": "81fe30cfd6e068a38cc88003863d820d",
"score": "0.6123731",
"text": "def queue(_); end",
"title": ""
},
{
"docid": "7333e9212f8f21e41bd87fa905d226d7",
"score": "0.6101462",
"text": "def dequeue\n @items.shift\n end",
"title": ""
},
{
"docid": "0c6877380cf4a8c7e13899ee8a983487",
"score": "0.61009896",
"text": "def remove\n @queue.shift\n end",
"title": ""
},
{
"docid": "273d1fbbacddf204f7d43eea345be37a",
"score": "0.6095962",
"text": "def dequeue\n @store.shift\n end",
"title": ""
},
{
"docid": "7221a60bcfe3f090603deba48220f495",
"score": "0.6084602",
"text": "def push(element)\n #if the stack is already full or the element is nil, do nothing\n if full? or element.nil?\n nil\n else\n #Add 1 to the value of @top\n @top = @top.succ\n #sets the value at the top of the stack to element\n @store[@top] = element\n #returns it self\n self\n end\n end",
"title": ""
},
{
"docid": "a799c1027e0bd473b9e38d24a93378aa",
"score": "0.6084353",
"text": "def cons(x)\n queue(Stream.cons(->{x}, ->{@front}), @front_len + 1,\n exec1(@front_schedule),\n @rear, @rear_len, exec1(@rear_schedule))\n end",
"title": ""
},
{
"docid": "f10e6b0483cb1c6c7ba6f72ef2816f89",
"score": "0.6081535",
"text": "def enqueue(new_element)\n if is_empty?\n @front = @rear = 0\n elsif is_full\n puts \"Queue is full or create another array and copy queue\" \n return\n else\n @rear = (@rear + 1) % @size_of_array\n end\n @queue_array[@rear] = new_element\t\n end",
"title": ""
},
{
"docid": "808ff8365765bee4d785dd98acde2935",
"score": "0.6075783",
"text": "def enqueue(el)\n self.queue_var = [el] + self.queue_var \n end",
"title": ""
},
{
"docid": "8a5ffc66153b5206b9ac1bd7315e54ba",
"score": "0.6071551",
"text": "def pop\n if @queue.empty?\n nil\n else\n tempArr = []\n while @queue.size > 1\n tempArr.push(@queue.remove)\n end\n tempItem = @queue.remove\n while !tempArr.empty?\n @queue.insert(tempArr.pop)\n end\n tempItem\n end\n end",
"title": ""
},
{
"docid": "8331e3953c4a1a509f6c7d6edebe6a2a",
"score": "0.6070699",
"text": "def remove\n @queue.shift\n end",
"title": ""
},
{
"docid": "93148299d2511d4e6bec5e5614cfc5e8",
"score": "0.60609317",
"text": "def push(item)\n @items.push(item)\n if @max_stack.empty?\n @max_stack.push(item)\n else\n @max_stack.push(item) if @max_stack.last < item\n end\n end",
"title": ""
},
{
"docid": "f2d92bf27cfa73fea3607228440df88d",
"score": "0.60583323",
"text": "def insert_front(value)\n if @queue.size < @size\n @queue.unshift(value)\n true\n else\n false\n end\n end",
"title": ""
},
{
"docid": "035197b3d432533f6707ce5eac11e4e9",
"score": "0.60510486",
"text": "def enqueue(element)\n # if queue is full or the element you're trying to add = nil, item cannot be added to the queue\n if full? or element.nil?\n nil\n else\n # 1 subtracted from @tail because the queue is going to be one item longer now\n @tail = @tail.pred\n # last element in the queue is set equal to the element you passed in as an argument\n @store[@tail] = element\n # returns the Queue\n self\n end\n end",
"title": ""
},
{
"docid": "23f39861df6b2b105ffd99ee30012716",
"score": "0.6040018",
"text": "def push(val)\n resize! if @length >= @store.length\n @store[@length] = val\n @length += 1\n val\n end",
"title": ""
},
{
"docid": "9faf461b56133adf81369a52ee9530e4",
"score": "0.60389113",
"text": "def push_back(data)\n insert(data, @size)\n end",
"title": ""
},
{
"docid": "1032eeac9f5046725c5074871941f7df",
"score": "0.60388005",
"text": "def enqueue(ele)\n @push_stack.push(ele)\n end",
"title": ""
},
{
"docid": "00383430273ef1f849c66e96f3275600",
"score": "0.60368073",
"text": "def pop\n _exchange\n end",
"title": ""
}
] |
50f9f185a7e0a4b735aeced6110bd841 | Calculates hash code according to all attributes. | [
{
"docid": "e972597a5d989c54934ccd1abc622413",
"score": "0.0",
"text": "def hash\n [id, start_time, end_time, connected_time, name, user_uri, user_id, external_contact_id, external_organization_id, queue_id, group_id, team_id, queue_name, purpose, participant_type, consult_participant_id, address, ani, ani_name, dnis, locale, wrapup_required, wrapup_prompt, wrapup_timeout_ms, wrapup_skipped, wrapup, conversation_routing_data, alerting_timeout_ms, monitored_participant_id, attributes, calls, callbacks, chats, cobrowsesessions, emails, messages, screenshares, social_expressions, videos, evaluations, screen_recording_state, flagged_reason, start_acw_time, end_acw_time].hash\n end",
"title": ""
}
] | [
{
"docid": "08105588814074a5aed46dbb236c8d02",
"score": "0.791457",
"text": "def hash_code; Digest::SHA256.hexdigest(@attributes.values.join); end",
"title": ""
},
{
"docid": "706cbdb4c78e6b67e29589df0a4b1b5c",
"score": "0.73099273",
"text": "def attr_hash\n md5 = Digest::MD5.new\n # just hash it by name\n md5.update @name\n #\n # @attributes.each do |k,v|\n # md5.update \"#{k}:#{v.attr_hash}\"\n # end\n md5.hexdigest\n end",
"title": ""
},
{
"docid": "8ad8f536b4be5ea83ec2a972ee3d5592",
"score": "0.72587657",
"text": "def hash\n total = 17\n each_field do |fid, field_info|\n name = field_info[:name]\n value = self.send(name)\n total = (total * 37 + value.hash) & 0xffffffff\n end\n total\n end",
"title": ""
},
{
"docid": "ec68e4db3228ce9d9ce089f2401aef90",
"score": "0.7206873",
"text": "def attr_hash\n md5 = Digest::MD5.new\n @attributes.each do |k,v|\n md5.update \"#{k}:#{v.attr_hash}\"\n end\n md5.hexdigest\n end",
"title": ""
},
{
"docid": "44b88bc56b0ea48f2ab73e2f3d712526",
"score": "0.70994294",
"text": "def attr_hash\n md5 = Digest::MD5.new\n @ruby_types.each do |k,typ|\n md5.update typ.attr_hash\n end\n md5.hexdigest\n end",
"title": ""
},
{
"docid": "95ed967547f1ab19a41a714a9972a2c5",
"score": "0.70697373",
"text": "def hash\n strs = FIELDS.collect {|f| \"#{f}:#{send(f).inspect}\"}\n Digest::SHA256.hexdigest(strs.join(' '))\n end",
"title": ""
},
{
"docid": "55481f97eb0ef93fcebc191faf81107c",
"score": "0.6987905",
"text": "def hash\n h = 5381\n h = h * 33 + self.length\n each do |c|\n h = h * 33 + c.hash\n end\n h\n end",
"title": ""
},
{
"docid": "6938cc34537e4457ae5dd123375a97d6",
"score": "0.68441796",
"text": "def hash\n hash = 17\n hash = 37 * hash + @prob.hash\n hash = 37 * hash + @alias.hash\n hash = 37 * hash + @values.hash\n hash\n end",
"title": ""
},
{
"docid": "6babdb9869ffd11bc160cce305fb1d48",
"score": "0.67915756",
"text": "def hash\n hash_val = size\n return _attrs.size if Thread.detect_outermost_recursion self do\n _attrs.each { |var| hash_val ^= instance_variable_get(:\"@#{var}\").hash }\n end\n return hash_val\n end",
"title": ""
},
{
"docid": "b78a8c3fbbda0dc6b3ed59f810316f24",
"score": "0.67847186",
"text": "def hash(*) end",
"title": ""
},
{
"docid": "15ab111544bfee6d598c82c6a202f376",
"score": "0.6759885",
"text": "def hashfunc; end",
"title": ""
},
{
"docid": "48081c7ec008e749812e1497a2130418",
"score": "0.6707762",
"text": "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",
"title": ""
},
{
"docid": "8d4aa21615eed2c9554deb6528b13ede",
"score": "0.67051935",
"text": "def hash\n attrs = attributes.dup\n attrs.delete_if {|key, value| [:created_at, :updated_at, :id].include?(key)}\n attrs.delete_if {|key, value| value.kind_of?(Base) }\n keys = attrs.keys.map{|sym| sym.to_s}.sort.join ''\n values = attrs.values.map{|sym| sym.to_s}.sort.join ''\n Digest::MD5.hexdigest(keys + values)\n end",
"title": ""
},
{
"docid": "d256edb415273d5591949554543bf11b",
"score": "0.6701888",
"text": "def hash\n attributes.values.reduce { |a, e| a.to_s + e.to_s }.hash\n end",
"title": ""
},
{
"docid": "c71589222d9983d1465d977cf7f0a818",
"score": "0.6669352",
"text": "def hash\n value = 0\n for row in @rows\n for e in row\n value ^= e.hash\n end\n end\n return value\n end",
"title": ""
},
{
"docid": "fff1d340d09abfeab4e4d4deafe3b442",
"score": "0.65652955",
"text": "def hash() ajd.hash end",
"title": ""
},
{
"docid": "a0723003eee4af505775c3ea17ef5f3b",
"score": "0.65597206",
"text": "def hash() @ajd.hash end",
"title": ""
},
{
"docid": "677fd2d39e8c45f7dfc6d65134122cb7",
"score": "0.6548127",
"text": "def hash\n\t\t\t\t[code, guid].hash\n\t\t\tend",
"title": ""
},
{
"docid": "a63c91b2e4a24e55caeec10e42dc422b",
"score": "0.6536589",
"text": "def hash\n return __hash__opal__ if RUBY_ENGINE == 'opal'\n class_hash = self.class.hash\n indexed_values = to_a.each_with_index\n value_hashes = indexed_values.map do |value, i|\n value_hash = value.equal?(self) ? class_hash : value.hash\n i+1 * value_hash\n end\n class_hash + value_hashes.sum\n end",
"title": ""
},
{
"docid": "9c5b5bb0c4bf1cad3aebbec2dda8bcc1",
"score": "0.650851",
"text": "def calc_hash(hashed_obj)\n Digest::SHA256.base64digest hashed_obj.to_s\n end",
"title": ""
},
{
"docid": "3401dd23feadd2dca281026caf05c8cc",
"score": "0.65080184",
"text": "def hash\n raise 'Score has zero value, there is no hash' if @suffixes.empty?\n @suffixes.reduce(prefix) do |pfx, suffix|\n OpenSSL::Digest.new('SHA256', \"#{pfx} #{suffix}\").hexdigest\n end\n end",
"title": ""
},
{
"docid": "b57595534585581dcad80e28672bbf0f",
"score": "0.6470199",
"text": "def hash\n @digest.hexdigest\n end",
"title": ""
},
{
"docid": "69a9eb2e2353c88799859edcad3ee8a0",
"score": "0.6462376",
"text": "def hash\n @hash ||= begin\n result = 17\n result = 31 * result + self.class.hash\n result = 31 * result + ord\n result.is_a?(Fixnum) ? result : result.hash\n end\n end",
"title": ""
},
{
"docid": "b02b0d102072c068a4ac051857d275d8",
"score": "0.643492",
"text": "def hash\n result = 0\n self.keys.each do |key|\n result += ALPHA.index(key).hash.abs + self[key].hash.abs\n end\n result\n end",
"title": ""
},
{
"docid": "8f97e73317cd71f4efbc229f285343ba",
"score": "0.64101475",
"text": "def hash_function\n @hash_function ||= 'sha256'\n end",
"title": ""
},
{
"docid": "a4e02373e766881204a59e8498b5ad36",
"score": "0.6401857",
"text": "def calc_hash( data )\n sha = Digest::SHA256.new\n sha.update( data )\n sha.hexdigest\nend",
"title": ""
},
{
"docid": "37409f9e9e269906d68ec00b11296a21",
"score": "0.63848263",
"text": "def hash\n HASH_CONSTANT * @x.hash * @y.hash\n end",
"title": ""
},
{
"docid": "226867762a59c5f604e4958d3c1a974d",
"score": "0.63827044",
"text": "def hash_value\n result = 0\n for i in 0..8 do\n result *= 3\n result += @state[i]\n end\n result\n end",
"title": ""
},
{
"docid": "f354d6cbab80376975c548c0d8495c25",
"score": "0.6369635",
"text": "def hash\n @digest = Digest::SHA256.new\n @digest.update @submitter\n @digest.update @period\n @digest.update @random\n return @digest.hexdigest\n end",
"title": ""
},
{
"docid": "57e30279992402331ca956276e706c28",
"score": "0.6361055",
"text": "def hash\n Util.irccase(self).hash\n end",
"title": ""
},
{
"docid": "39b15da071a5d18e77c7674f9a946414",
"score": "0.635671",
"text": "def hash\n @hash || calculate_hash!\n end",
"title": ""
},
{
"docid": "a6d4ffe0852cc4b4e0c9fa0baf0f841f",
"score": "0.6343274",
"text": "def hash\n self.inject(37){|memo,str| memo + 17*str.hash}\n end",
"title": ""
},
{
"docid": "0efc33cf18bcedff4c20f96e9d5d65c5",
"score": "0.633713",
"text": "def _calc_hash(value)\n value.hash\nend",
"title": ""
},
{
"docid": "97e18e1269b7aa0f008ee37a6d87004f",
"score": "0.6319418",
"text": "def hash # :nodoc:\n return (57 + @name.hash) * @type.hash\n end",
"title": ""
},
{
"docid": "34b2818d9e702b288a108c6515e67dbe",
"score": "0.62999785",
"text": "def hash\n super +\n @architecture.hash +\n @codename.hash +\n @distribution.hash +\n @family.hash +\n @kernel.hash +\n @version.hash\n end",
"title": ""
},
{
"docid": "dcd2d2a7b8b5351f882af58dc9101795",
"score": "0.62864375",
"text": "def hash\n @hash ||= _calculate_hash\n end",
"title": ""
},
{
"docid": "d57cbacd52ef2e4534221858d84aeadd",
"score": "0.628516",
"text": "def hash\n value = self.length\n self.each do |item|\n value = (value << 1) | (value < 0 ? 1 : 0)\n value ^= item.hash\n end\n\n return value\n end",
"title": ""
},
{
"docid": "dc2f70c0a194bb29adc02d10d4d74ce3",
"score": "0.62700063",
"text": "def calculate_hash(source_path)\n self.md5 = Digest::MD5.file(source_path).hexdigest\n end",
"title": ""
},
{
"docid": "1481881c7503fc92b7c4350f0f8f7814",
"score": "0.6260006",
"text": "def hash\n if not defined?(@cached_hash)\n # this is really a specialized version of the hash\n # builder. Code duplication? Yes. That big a deal? Not really.\n current_hash = 269\n @optional.each {\n |k,t|\n current_hash += 503 * ((431 + k.hash * 443) + t.hash * 443)\n }\n @require.each {\n |k,t|\n current_hash += 503 * ((497 + k.hash * 419) + t.hash * 419)\n }\n @cached_hash = current_hash\n end\n @cached_hash\n end",
"title": ""
},
{
"docid": "c74b013b64475e002799e6faa18e3841",
"score": "0.62559605",
"text": "def hash\n @bits.hash\n end",
"title": ""
},
{
"docid": "e08db0e8d8f06175397c0e3356ceab0f",
"score": "0.6252866",
"text": "def hash\n (self.x*self.y + self.z).abs.ceil\n end",
"title": ""
},
{
"docid": "4c33c11e43a05ec129d793d8921f5247",
"score": "0.62406325",
"text": "def define_hash\n define_method(:hash) do\n klass = self.class\n attrs = klass.comparison_attrs\n ([klass] + attrs.map { |attr| send(attr) }).hash\n end\n end",
"title": ""
},
{
"docid": "74913f0bfd7bc361489471b34f9ec8c0",
"score": "0.622862",
"text": "def hashes(name)\n digits = Digest::SHA1.hexdigest(name)\n \n (0..6).map do |i| \n digits[i*5,5].to_i(16) % FILTER_SIZE\n end\n end",
"title": ""
},
{
"docid": "ff7f2a6fa6dca9d9a76baf55582b7135",
"score": "0.62266326",
"text": "def build_hash_for(body)\n hasher = OpenSSL::Digest.new('sha256')\n hasher.hexdigest(body)\n end",
"title": ""
},
{
"docid": "694bd3f40ca7d40964f0fe7e5cb02bdf",
"score": "0.6221287",
"text": "def hash\n strs = []\n @data.each do |key, val|\n strs << \"#{key}:#{val}\"\n end\n \n return Digest::MD5.hexdigest(strs.join(\",\"))\n end",
"title": ""
},
{
"docid": "26fab0c477fbf1eaa413cec435e785b2",
"score": "0.62165993",
"text": "def hash\n 0\n end",
"title": ""
},
{
"docid": "a30d0436e65ea417acde925ec116bd81",
"score": "0.6200459",
"text": "def hash\n \"#{r}#{g}#{b}\".to_i\n end",
"title": ""
},
{
"docid": "818dfb991535496155f05f3aaf2ee71f",
"score": "0.61953914",
"text": "def hashes(data)\n m = @ba.size\n h = Digest::MD5.hexdigest(data.to_s).to_i(16)\n x = h % m\n h /= m\n y = h % m\n h /= m\n z = h % m\n [x] + 1.upto(@k - 1).collect do |i|\n x = (x + y) % m\n y = (y + z) % m\n x\n end\n end",
"title": ""
},
{
"docid": "0dbe2a68299399de67be9d62005975d7",
"score": "0.6193397",
"text": "def hash;0;end",
"title": ""
},
{
"docid": "da1ef4e12a36ac4c4dea1abaaaa01442",
"score": "0.6186627",
"text": "def hash\n (@w_cons.hash << 1) ^ (@l_cons.hash)\n end",
"title": ""
},
{
"docid": "40428d126b392ffa63fb6211fa8a7abe",
"score": "0.61641985",
"text": "def hash\n self.name.hash ^ self.quantity.hash\n end",
"title": ""
},
{
"docid": "ade7252bb75472492457acf34246a627",
"score": "0.6163741",
"text": "def hash\n p, q = 17, 37\n p = q * p + @type.hash\n p = q * p + @text.hash\n p = q * p + @scope.hash \n \n # bound the hash function by the TABLE_SIZE\n return (p % SymbolTable::TABLE_SIZE).to_i\n end",
"title": ""
},
{
"docid": "8a4c399d2f850a7a4f0b6b49022b5306",
"score": "0.6162648",
"text": "def hash\n @hash ||= attributes.hash\n end",
"title": ""
},
{
"docid": "27a979a095ad4d2ea547e0f70ee523b8",
"score": "0.6153602",
"text": "def hash(data)\n return @cryptoHlpr.hash(data);\n end",
"title": ""
},
{
"docid": "49ba1a71890db2ece4fc2f5b8fa7bfbd",
"score": "0.6148932",
"text": "def hash\n a = 0\n x = self\n while (x.is_a? Nydp::Pair)\n a = a + x.car.hash\n x = x.cdr\n end\n\n a + x.hash\n end",
"title": ""
},
{
"docid": "d0a318e82023fcd123ae6ecb01c98e5c",
"score": "0.61458766",
"text": "def hash\n [amount, currency_code].hash\n end",
"title": ""
},
{
"docid": "9df0e4212c3e7e4044bfc5a0b7827159",
"score": "0.6135497",
"text": "def hash\n fields.inject(0) do |hash, field|\n val = send(field.reader)\n hash ^= val.hash\n end\n end",
"title": ""
},
{
"docid": "ca9094ed78366cf05f9ee1f8157cf241",
"score": "0.61315036",
"text": "def calculate_hash(path)\n self.sha256 = Base64.urlsafe_encode64(Digest::SHA256.file(path).digest)\n end",
"title": ""
},
{
"docid": "c2d27642e27bfca3ffe38549f6aa7bad",
"score": "0.6122738",
"text": "def hash(obj)\n\th = Array.new(5){0};\n\n\tS.length.times do |i|\n\t\ttmp = 0\n\t\tmd5 = Digest::MD5.hexdigest(obj.to_s + S[i].to_s).unpack(\"B*\")\n\n\t\tmd5.to_s.each_char.with_index { |c, i|\n\t\t\tif c.to_i == 1 then\n\t\t\t \ttmp+=1\n\t\t\tend\n\t\t}\n\t\th[i] = (tmp + S[i]) % SIZE\n\tend\n\n\treturn h\nend",
"title": ""
},
{
"docid": "2d961b6e2140d06cbea083872286cb3a",
"score": "0.6106011",
"text": "def hash\n [c, cn, l, o, ou, st, alt_name].hash\n end",
"title": ""
},
{
"docid": "553adb68c66b5fd53bb111803a1522e7",
"score": "0.6105505",
"text": "def hash\n if @hash_value.nil?\n @hash_value = (name.hash * 53) ^ version.hash\n end\n @hash_value\n end",
"title": ""
},
{
"docid": "7928efc376f0faf1242c515eff8726be",
"score": "0.6101513",
"text": "def hash\n\t\treturn @hash if @hash && @frozen\n\t\t@hash = Digest::SHA2.digest(\"#{prev_hash}#{to_applied}\")[0,20]\n\tend",
"title": ""
},
{
"docid": "cfc6dc417597a326869f0520d2b7a33d",
"score": "0.60965824",
"text": "def hash\n id.hash ^ name.hash\n end",
"title": ""
},
{
"docid": "727b40f9aeaf16679278f4e7e7c6a588",
"score": "0.60937095",
"text": "def hash()\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "727b40f9aeaf16679278f4e7e7c6a588",
"score": "0.60937095",
"text": "def hash()\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "727b40f9aeaf16679278f4e7e7c6a588",
"score": "0.60922396",
"text": "def hash()\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "66e7ebdc345bf94c9569cd44ad395546",
"score": "0.60905766",
"text": "def hash expr, algo = 'sha1'\n Expression.new(\"digest(#{expr}, '#{algo}')\", MM::DataType::TYPE_Binary, expr.is_mandatory, expr.is_array)\n end",
"title": ""
},
{
"docid": "ae1a628dcfbcd0df0510d0ce3bf0cde6",
"score": "0.60818595",
"text": "def hash=(_arg0); end",
"title": ""
},
{
"docid": "ae1a628dcfbcd0df0510d0ce3bf0cde6",
"score": "0.60818595",
"text": "def hash=(_arg0); end",
"title": ""
},
{
"docid": "ae1a628dcfbcd0df0510d0ce3bf0cde6",
"score": "0.60818595",
"text": "def hash=(_arg0); end",
"title": ""
},
{
"docid": "894795fad3b32518cf0703a24124af92",
"score": "0.6075113",
"text": "def hash(obj)\n obj = normalise(obj)\n indices = [Digest::SHA1, Digest::MD5].map do |hasher|\n hasher.digest(obj).unpack(\"N*\").reduce {|accum, n| (accum+n)%filter.length}\n end\n indices << Zlib::crc32(obj)\n pattern = empty_pattern(filter.length)\n indices.each {|index| pattern[index % filter.length ] = 1}\n pattern\n end",
"title": ""
},
{
"docid": "76bae4e708d6438223c6d05d0887eca4",
"score": "0.6067453",
"text": "def hash\n 1\n end",
"title": ""
},
{
"docid": "e5385afbbea601f0341f59fb5f186955",
"score": "0.6067202",
"text": "def hash(c: false)\n hashes = episodes.map{ |e| e.levels.map{ |l| l.hash(c: c) } }.flatten.compact\n return nil if hashes.size < 25\n work = 0.chr * 20\n 25.times.each{ |i|\n work = sha1(work + hashes[i], c: c)\n }\n work\n end",
"title": ""
},
{
"docid": "70e8e8129b7ac0d085db6fc9f1c925d8",
"score": "0.6062212",
"text": "def hash\n source.hash ^ (target.hash + 1)\n end",
"title": ""
},
{
"docid": "42c30805486259c5db0a4edf05c3e8d7",
"score": "0.6059452",
"text": "def hash\n result = 0\n @grid.each_with_index do |row, index|\n result += row.hash*((index+1))\n end\n result\n end",
"title": ""
},
{
"docid": "e45bf72e93ff7e4918f38aadaea715a8",
"score": "0.6053564",
"text": "def hash\n @cards.hash ^ @validator.hash\n end",
"title": ""
},
{
"docid": "8a12e998720d493bacf70b3981cb1e68",
"score": "0.60494065",
"text": "def calc_hash(line)\n string_hash = 0\n\n # convert each character to its UTF-8 value\n line.each_char do |x|\n string_hash += @stored_chars[x]\n end\n\n string_hash = string_hash % 65_536 # mod the string_hash for the final hash value\n string_hash.to_s(16) # convert line hash value to hex\n end",
"title": ""
},
{
"docid": "66d444cffb5f56cef1be39ac88b62b15",
"score": "0.6024324",
"text": "def hash\n self.class.identifying_role_names.map{|role_name|\n instance_variable_get(\"@#{role_name}\")\n }.inject(0) { |h,v|\n h ^= v.hash\n h\n }\n end",
"title": ""
},
{
"docid": "ef200ff818c310e9a179653879c9f2f1",
"score": "0.6020012",
"text": "def hash; end",
"title": ""
},
{
"docid": "ef200ff818c310e9a179653879c9f2f1",
"score": "0.6020012",
"text": "def hash; end",
"title": ""
},
{
"docid": "ef200ff818c310e9a179653879c9f2f1",
"score": "0.6020012",
"text": "def hash; end",
"title": ""
},
{
"docid": "ef200ff818c310e9a179653879c9f2f1",
"score": "0.6020012",
"text": "def hash; end",
"title": ""
},
{
"docid": "ef200ff818c310e9a179653879c9f2f1",
"score": "0.6020012",
"text": "def hash; end",
"title": ""
},
{
"docid": "ef200ff818c310e9a179653879c9f2f1",
"score": "0.6020012",
"text": "def hash; end",
"title": ""
},
{
"docid": "ef200ff818c310e9a179653879c9f2f1",
"score": "0.6020012",
"text": "def hash; end",
"title": ""
},
{
"docid": "ef200ff818c310e9a179653879c9f2f1",
"score": "0.6020012",
"text": "def hash; end",
"title": ""
},
{
"docid": "ef200ff818c310e9a179653879c9f2f1",
"score": "0.6020012",
"text": "def hash; end",
"title": ""
},
{
"docid": "ef200ff818c310e9a179653879c9f2f1",
"score": "0.6020012",
"text": "def hash; end",
"title": ""
},
{
"docid": "ef200ff818c310e9a179653879c9f2f1",
"score": "0.6020012",
"text": "def hash; end",
"title": ""
},
{
"docid": "ef200ff818c310e9a179653879c9f2f1",
"score": "0.6020012",
"text": "def hash; end",
"title": ""
},
{
"docid": "ef200ff818c310e9a179653879c9f2f1",
"score": "0.6020012",
"text": "def hash; end",
"title": ""
},
{
"docid": "ef200ff818c310e9a179653879c9f2f1",
"score": "0.6020012",
"text": "def hash; end",
"title": ""
},
{
"docid": "ef200ff818c310e9a179653879c9f2f1",
"score": "0.6020012",
"text": "def hash; end",
"title": ""
},
{
"docid": "ef200ff818c310e9a179653879c9f2f1",
"score": "0.6020012",
"text": "def hash; end",
"title": ""
},
{
"docid": "ef200ff818c310e9a179653879c9f2f1",
"score": "0.6020012",
"text": "def hash; end",
"title": ""
},
{
"docid": "ef200ff818c310e9a179653879c9f2f1",
"score": "0.6020012",
"text": "def hash; end",
"title": ""
},
{
"docid": "ef200ff818c310e9a179653879c9f2f1",
"score": "0.6020012",
"text": "def hash; end",
"title": ""
},
{
"docid": "ef200ff818c310e9a179653879c9f2f1",
"score": "0.6020012",
"text": "def hash; end",
"title": ""
},
{
"docid": "ef200ff818c310e9a179653879c9f2f1",
"score": "0.6020012",
"text": "def hash; end",
"title": ""
},
{
"docid": "ef200ff818c310e9a179653879c9f2f1",
"score": "0.6020012",
"text": "def hash; end",
"title": ""
},
{
"docid": "ef200ff818c310e9a179653879c9f2f1",
"score": "0.6020012",
"text": "def hash; end",
"title": ""
}
] |
dfc70532da76ddc60610e672485f7dee | Pour mettre dans le rescue des scripts (cf. manuel) | [
{
"docid": "0eff95a6b0648bc595db52f900616272",
"score": "0.0",
"text": "def error e\n log(\"ERREUR: #{e.message}\")\n log(\"BACKTRACE ERREUR: #{e.backtrace.join(RC)}\")\n self << {error: e.message, backtrace: e.backtrace}\n end",
"title": ""
}
] | [
{
"docid": "a11eb7d0088b221901dbf6d963545574",
"score": "0.77387714",
"text": "def rescueing; end",
"title": ""
},
{
"docid": "8f58b306a8219da794fe3b7854794cd1",
"score": "0.71422637",
"text": "def on_rescue(exceptions, variable, statements, consequent); end",
"title": ""
},
{
"docid": "f9f63f0feef20da2f05a1af1f886985d",
"score": "0.6958483",
"text": "def rescueing=(_arg0); end",
"title": ""
},
{
"docid": "da7042bb861324b2d1e6dc9d3703c539",
"score": "0.6850114",
"text": "def RescueEx(exceptions, variable); end",
"title": ""
},
{
"docid": "3dd49bf89ca13eba8cb278cfe6edcd89",
"score": "0.68387073",
"text": "def rescue_result; end",
"title": ""
},
{
"docid": "fe4579a8b911d5f578c266d6a8013be2",
"score": "0.67508745",
"text": "def exceptions; end",
"title": ""
},
{
"docid": "fe4579a8b911d5f578c266d6a8013be2",
"score": "0.67508745",
"text": "def exceptions; end",
"title": ""
},
{
"docid": "fe4579a8b911d5f578c266d6a8013be2",
"score": "0.67508745",
"text": "def exceptions; end",
"title": ""
},
{
"docid": "fe4579a8b911d5f578c266d6a8013be2",
"score": "0.67508745",
"text": "def exceptions; end",
"title": ""
},
{
"docid": "fe4579a8b911d5f578c266d6a8013be2",
"score": "0.67508745",
"text": "def exceptions; end",
"title": ""
},
{
"docid": "50b9df1efaa66e71ab7061d9bfd92d83",
"score": "0.67508525",
"text": "def rescue_clause; end",
"title": ""
},
{
"docid": "d3c2cb94d5d312ece40455dfdf0f6313",
"score": "0.6750741",
"text": "def display_game_exception(message)\r\n puts message\r\n puts format('Error type : %<class>s', class: $!.class)\r\n puts format('Error message : %<message>s', message: $!.message)\r\n puts $!.backtrace\r\n Audio.bgm_stop rescue nil\r\n Audio.bgs_stop rescue nil\r\n Audio.me_stop rescue nil\r\n Audio.se_stop rescue nil\r\n FMOD::System.close rescue nil\r\n exit!\r\nend",
"title": ""
},
{
"docid": "a91eae2aed50c4975ce023de87718581",
"score": "0.66539866",
"text": "def exception_executions; end",
"title": ""
},
{
"docid": "3b1d96d83bf86b81bf8a9e69c20dc6e8",
"score": "0.66344124",
"text": "def run_script\n begin\n yield\n rescue Exception => x\n print \"Content-type: text/plain\\r\\n\\r\\n\"\n print \"Exception: \" + x.message + \"\\r\\n\\r\\n\"\n puts x.backtrace\n end\nend",
"title": ""
},
{
"docid": "8d626201739043924256ad0497446b5d",
"score": "0.6628551",
"text": "def rescue(&block); end",
"title": ""
},
{
"docid": "8d626201739043924256ad0497446b5d",
"score": "0.6628551",
"text": "def rescue(&block); end",
"title": ""
},
{
"docid": "49560b3ade41bfbe4a3b9d6b401dd517",
"score": "0.66115415",
"text": "def exc; end",
"title": ""
},
{
"docid": "bc278dd23a8f741724982bfba5e804fe",
"score": "0.65301347",
"text": "def Rescue(keyword, exception, statements, consequent); end",
"title": ""
},
{
"docid": "0aa0db9270c5a88c81da713a1ee0e8f8",
"score": "0.6463533",
"text": "def rescued_exception; end",
"title": ""
},
{
"docid": "00949c1d8b99c90b4eb14133c02de6a5",
"score": "0.6444939",
"text": "def after_error(job, file_system, script); end",
"title": ""
},
{
"docid": "4d7be79950e1b34c8dc3f37215c70808",
"score": "0.6436398",
"text": "def exception_executions=(_arg0); end",
"title": ""
},
{
"docid": "cb51451c94ebd91eeb482b6ad9ad3e5c",
"score": "0.6378925",
"text": "def executa_erro\n\traise \"um teste do backtrace\"\nend",
"title": ""
},
{
"docid": "d1dce276804e494d5ee43ff4ef8f576b",
"score": "0.6351013",
"text": "def verifier_erreurs #:nodoc:\n begin\n yield\n rescue ErreurAucuneAdresseCourriel => e\n exit_now!( \"Aucune adresse de courriel n'est specifiee: #{e.message}.\", 1 )\n rescue ErreurDepotExisteDeja => e\n exit_now!( \"Le fichier '#{e.message}' existe. Si vous voulez le detruire, utilisez 'init --detruire'.\", 1 )\n rescue ErreurDepotInexistant => e\n exit_now!( \"Le fichier '#{e.message}' n'existe pas.\", 1 )\n rescue ErreurDejaEmprunte => e\n exit_now!( \"Un livre avec le meme titre est deja emprunte par '#{e.message}'.\", 1 )\n rescue ErreurFormatNonTraite => e\n exit_now!( \"Format de fichier non traite '#{e.message}'.\", 1 )\n rescue ErreurPasEmprunte => e\n exit_now!( \"Aucun livre emprunte avec le titre '#{e.message}'.\", 1 )\n rescue Exception => e\n exit_now!( \"#{e.inspect}: #{e.message}\", 1 )\n end\nend",
"title": ""
},
{
"docid": "f5cc358536014ae4f00727558d578b6f",
"score": "0.63240474",
"text": "def exception; end",
"title": ""
},
{
"docid": "f5cc358536014ae4f00727558d578b6f",
"score": "0.63240474",
"text": "def exception; end",
"title": ""
},
{
"docid": "f5cc358536014ae4f00727558d578b6f",
"score": "0.63240474",
"text": "def exception; end",
"title": ""
},
{
"docid": "f5cc358536014ae4f00727558d578b6f",
"score": "0.63240474",
"text": "def exception; end",
"title": ""
},
{
"docid": "f5cc358536014ae4f00727558d578b6f",
"score": "0.63240474",
"text": "def exception; end",
"title": ""
},
{
"docid": "f5cc358536014ae4f00727558d578b6f",
"score": "0.63240474",
"text": "def exception; end",
"title": ""
},
{
"docid": "f5cc358536014ae4f00727558d578b6f",
"score": "0.63240474",
"text": "def exception; end",
"title": ""
},
{
"docid": "f5cc358536014ae4f00727558d578b6f",
"score": "0.63240474",
"text": "def exception; end",
"title": ""
},
{
"docid": "f5cc358536014ae4f00727558d578b6f",
"score": "0.63240474",
"text": "def exception; end",
"title": ""
},
{
"docid": "f5cc358536014ae4f00727558d578b6f",
"score": "0.63240474",
"text": "def exception; end",
"title": ""
},
{
"docid": "f5cc358536014ae4f00727558d578b6f",
"score": "0.63240474",
"text": "def exception; end",
"title": ""
},
{
"docid": "f5cc358536014ae4f00727558d578b6f",
"score": "0.63240474",
"text": "def exception; end",
"title": ""
},
{
"docid": "6d967e0574a93ad1a7a438ecf62b646c",
"score": "0.63145864",
"text": "def ex; end",
"title": ""
},
{
"docid": "6d967e0574a93ad1a7a438ecf62b646c",
"score": "0.63145864",
"text": "def ex; end",
"title": ""
},
{
"docid": "e8010aa2fa64c527e13c0680e84ce6e5",
"score": "0.63042206",
"text": "def error_catch1 err_nice1\n begin\n raise err_nice1\n rescue SystemCallError, IOError, SignalException => e\n p \"I cought `raise err_nice1 # this is from arr and each` \" + e.inspect\n end\nend",
"title": ""
},
{
"docid": "31e27cadcdaf72d31aafa79a6bc38bf5",
"score": "0.63018143",
"text": "def catch(&block); end",
"title": ""
},
{
"docid": "31e27cadcdaf72d31aafa79a6bc38bf5",
"score": "0.63018143",
"text": "def catch(&block); end",
"title": ""
},
{
"docid": "8b79e8f7bbe83880e51794d26cd62a8f",
"score": "0.62902033",
"text": "def try; end",
"title": ""
},
{
"docid": "887fdf1bc2451f76fa767eea193c94e4",
"score": "0.6281843",
"text": "def rescue_action(e) raise end",
"title": ""
},
{
"docid": "dae4b7a2c99898300702fba290291fbb",
"score": "0.6281446",
"text": "def rescue_action(e); raise e; end",
"title": ""
},
{
"docid": "b3c1b8ba9ca0c2f07d50143d49a80d3d",
"score": "0.6279305",
"text": "def propagate_pre_exec_failure; end",
"title": ""
},
{
"docid": "3c6c88e23daafe11a13fe7775a8e9d0c",
"score": "0.6234755",
"text": "def failure_handling; end",
"title": ""
},
{
"docid": "e3348650e2d2261c204878dabc9f3db0",
"score": "0.6217331",
"text": "def exception_handler; end",
"title": ""
},
{
"docid": "69ba7969de648e97d6662217dd822315",
"score": "0.61918783",
"text": "def error_catch err_nice\n begin\n raise err_nice\n rescue SystemCallError, IOError, SignalException\n p \"I cought `raise err_nice # this is arg` #{$!}\"\n end\nend",
"title": ""
},
{
"docid": "65b47be744db855a555e4d8b4021d4be",
"score": "0.6174978",
"text": "def ignored_exceptions; end",
"title": ""
},
{
"docid": "0d71feec5757f1d1bc8eb4d57fe1d252",
"score": "0.6168624",
"text": "def exec\n fatal_error(code: :its_broken)\n end",
"title": ""
},
{
"docid": "7daa5f4162e1e534dd82c013a6f7a990",
"score": "0.6164698",
"text": "def cause; end",
"title": ""
},
{
"docid": "7daa5f4162e1e534dd82c013a6f7a990",
"score": "0.6164698",
"text": "def cause; end",
"title": ""
},
{
"docid": "7daa5f4162e1e534dd82c013a6f7a990",
"score": "0.6164698",
"text": "def cause; end",
"title": ""
},
{
"docid": "9c1ad670554f7052be35bc2a6053cd8f",
"score": "0.6161782",
"text": "def rescue_action(e) raise e end",
"title": ""
},
{
"docid": "9c1ad670554f7052be35bc2a6053cd8f",
"score": "0.6161782",
"text": "def rescue_action(e) raise e end",
"title": ""
},
{
"docid": "9c1ad670554f7052be35bc2a6053cd8f",
"score": "0.6161782",
"text": "def rescue_action(e) raise e end",
"title": ""
},
{
"docid": "9c1ad670554f7052be35bc2a6053cd8f",
"score": "0.6161782",
"text": "def rescue_action(e) raise e end",
"title": ""
},
{
"docid": "9c1ad670554f7052be35bc2a6053cd8f",
"score": "0.6161782",
"text": "def rescue_action(e) raise e end",
"title": ""
},
{
"docid": "9c1ad670554f7052be35bc2a6053cd8f",
"score": "0.6161782",
"text": "def rescue_action(e) raise e end",
"title": ""
},
{
"docid": "9c1ad670554f7052be35bc2a6053cd8f",
"score": "0.6161782",
"text": "def rescue_action(e) raise e end",
"title": ""
},
{
"docid": "9c1ad670554f7052be35bc2a6053cd8f",
"score": "0.6161782",
"text": "def rescue_action(e) raise e end",
"title": ""
},
{
"docid": "9c1ad670554f7052be35bc2a6053cd8f",
"score": "0.6161782",
"text": "def rescue_action(e) raise e end",
"title": ""
},
{
"docid": "8a3f99b211d1a60c7e7e2b5e64219500",
"score": "0.61426544",
"text": "def rails_report_rescued_exceptions=(_arg0); end",
"title": ""
},
{
"docid": "14968cf747e515f29e58b2748bb080b4",
"score": "0.6140474",
"text": "def exceptions_app=(_arg0); end",
"title": ""
},
{
"docid": "3b2a4fc518fe5dc58f5de51821f8b22a",
"score": "0.61220556",
"text": "def exitScript(msg = 'Something went wrong and the script died. Please check your code.')\n raise(RuntimeError, msg)\nend",
"title": ""
},
{
"docid": "4a016480c2996b102e2a61bb440cc837",
"score": "0.6112348",
"text": "def launch2\n batten_hatches\n light_seatbelt_sign\n true\nrescue StandardError => e\n puts e.message\n puts \"Exception intercepted\"\n false\nend",
"title": ""
},
{
"docid": "08df34bf21bc5a9d0f38c165b9c14000",
"score": "0.60865796",
"text": "def onerror(&blk); super; end",
"title": ""
},
{
"docid": "9fbec8627093e497107caedceff7f269",
"score": "0.6083318",
"text": "def fail\n\t\traise \"Hell!\"\n\tend",
"title": ""
},
{
"docid": "1b48965d040adf3368bc5dd471af9b5c",
"score": "0.6070478",
"text": "def display_exception; end",
"title": ""
},
{
"docid": "f7910a0132de0be422ca167e4480e8da",
"score": "0.6058358",
"text": "def on_rescue_mod(statement, value); end",
"title": ""
},
{
"docid": "af829dc1a654d92f12163ee4d33312d8",
"score": "0.60504365",
"text": "def display_exception=(ex); end",
"title": ""
},
{
"docid": "b1b8bd4a337d5bb90ee03ba30da93d62",
"score": "0.6046328",
"text": "def addSuperWord\r\n\t\t\t\tyield 'exception'\r\n\t\t\t\tyield 'fatal'\r\n\t\t\t\tyield 'crash'\r\n\t\t\tend",
"title": ""
},
{
"docid": "4c40be68f2979600b9fe99a32b310eb3",
"score": "0.6043739",
"text": "def handle_error()\n end",
"title": ""
},
{
"docid": "21c28929a769662ce81e7d65450531d1",
"score": "0.6033553",
"text": "def launch\n batten_hatches\n light_seatbelt_warning\n true\nrescue\n puts \"Exception!!!\"\n false\nend",
"title": ""
},
{
"docid": "95246cbcd815a36fc7238098cbf9f141",
"score": "0.60268545",
"text": "def standard_exception_handling; end",
"title": ""
},
{
"docid": "cfe7ad320656963106db9ac9636ccd6c",
"score": "0.6024846",
"text": "def setex(args)\n end",
"title": ""
},
{
"docid": "f400dddbd94e7dfb57a8a6a4f8ac6845",
"score": "0.60150766",
"text": "def ignore_errors\n risky_a\nrescue Exception => e\n puts \"Error running code: #{e}\"\nelse\n risky_b\nend",
"title": ""
},
{
"docid": "f63e987fb239a33793f84e8cea6eb2af",
"score": "0.6014949",
"text": "def error_watchdog\n # Run\n yield\n rescue StandardError, ScriptError => e\n handle_error e\n e\n else\n nil\n end",
"title": ""
},
{
"docid": "e3bf28d8b95ec8d385af0bba48b9d670",
"score": "0.6008489",
"text": "def enter_failed; end",
"title": ""
},
{
"docid": "4aa22dfe53d206616edcdeb4ad0d5a32",
"score": "0.60037357",
"text": "def handler_for_rescue(exception); end",
"title": ""
},
{
"docid": "db0637b52c24247abaf95cf29bfeafe2",
"score": "0.5985699",
"text": "def errback(&block); end",
"title": ""
},
{
"docid": "7f9ed4500d298197e163d98d56390301",
"score": "0.59795284",
"text": "def excluded_exceptions=(_arg0); end",
"title": ""
},
{
"docid": "f713e842e7ad66ca429522a0fdc0162a",
"score": "0.5966222",
"text": "def launch3\n batten_hatches\n light_seatbelt_sign\n true\nrescue LightError\n puts \"Lights not working, still launching\"\n true\nrescue StandardError => e\n puts $!.message #refers to the same exception object as e\n raise #raise the error again\n false\nend",
"title": ""
},
{
"docid": "19c7d53d1516eb07179a0ad758f7a9fc",
"score": "0.59633774",
"text": "def lookup_all_error; end",
"title": ""
},
{
"docid": "7495859905e4e5637f21a4af9a6a65a9",
"score": "0.5949075",
"text": "def on_error(_exception)\n :exit\n end",
"title": ""
},
{
"docid": "9b8da0b8cc04672de7e8156a51c9bfaf",
"score": "0.59472865",
"text": "def unhandled; end",
"title": ""
},
{
"docid": "418e6488912657e7d0d7b69989256856",
"score": "0.594425",
"text": "def err; end",
"title": ""
},
{
"docid": "dce362de6cb6b526391e14e7387c9a9d",
"score": "0.5926557",
"text": "def rails_report_rescued_exceptions; end",
"title": ""
},
{
"docid": "297aba88a72e455da17016798edbfc2f",
"score": "0.5923615",
"text": "def ric_rescue(msg=\"Unknown Rescue Problem\")\n rescue_html = <<-RESCUE_HTML\n <table border='3'>\n <tr>\n <td>\n <img src='/images/photos/palladius-unhappy.jpg' >\n <td >\n <h2 class='debug' ><font color='red'>RicRescue Exception</font>: #{msg}</h2>\n <tr>\n <td>\n Lasterr\n <td colspan=\"2\" >\n <b>#{$!}</b>\n <tr>\n <td>backtrace\n <td colspan=\"1\" >\n <code class='lilliput' >\n #{ $!.backtrace.first(20).join('<br/>')}\n <br/>\n <br/>\n (These were the first 20 out of #{$!.backtrace.size})\n </code>\n </table>\n RESCUE_HTML\n rescue_html.html_safe # palladius-unhappy.jpg\n end",
"title": ""
},
{
"docid": "91e18c9b5123bc043a3dbb4fe0f99164",
"score": "0.59212375",
"text": "def catch_table; end",
"title": ""
},
{
"docid": "a32e73a75ea25a61b709ac3eb4d9146f",
"score": "0.5911901",
"text": "def defuse\r\n begin # the following code may fail with an exception\r\n puts risky # Try to invoke print the return value\r\n rescue RuntimeError => e\r\n # if we get an exception\r\n p e.message # print the error message instead\r\n end\r\nend",
"title": ""
},
{
"docid": "de589bc43dc774fd8424dc5178b20244",
"score": "0.590989",
"text": "def update_phase1\n super\n rescue Exception\n puts $!.message\n battle_end(1)\n end",
"title": ""
},
{
"docid": "2cf0d21d091dc500e47132971754a41a",
"score": "0.5903136",
"text": "def broken?; end",
"title": ""
},
{
"docid": "2cf0d21d091dc500e47132971754a41a",
"score": "0.5903136",
"text": "def broken?; end",
"title": ""
},
{
"docid": "37013b22997a7d16cf75d139ba2a2aef",
"score": "0.59026754",
"text": "def failed?; end",
"title": ""
},
{
"docid": "37013b22997a7d16cf75d139ba2a2aef",
"score": "0.59026754",
"text": "def failed?; end",
"title": ""
},
{
"docid": "3ff5fb604ce97b4348c661e1f904ae4e",
"score": "0.59015197",
"text": "def auto_rescue_exceptions\n self.auto_rescued_exceptions\n end",
"title": ""
},
{
"docid": "d7fc78e5f7d18ecb842683ae08694b69",
"score": "0.5888176",
"text": "def run_failed(exception, run_status); end",
"title": ""
},
{
"docid": "78b6280a5d3e14c1f3cf6107f0218f3b",
"score": "0.5879725",
"text": "def defuse\n begin # The following code may fail with an exception.\n puts risky # Try to invoke print the return value.\n rescue RuntimeError => e # If we get an exception\n puts e.message # print the error message instead.\n end \nend",
"title": ""
},
{
"docid": "6632be4a1a1eaa84710f9303c331d248",
"score": "0.5872085",
"text": "def rescued_error\n ErrorSound.play\n id = data_battler.id\n seq_key = phase_sequence[battle_phase].call\n phase = (dead? ? :dead : battle_phase)\n klass = data_battler.class\n result = \"Theolized SBS : \\n\"+\n \"Error occured on #{klass} in ID #{id}\\n\" +\n \"Undefined sequence key \\\"#{seq_key}\\\" for #{phase} phase\\n\\n\" +\n \"This is your fault. Not this script error!\"\n msgbox result\n exit\n end",
"title": ""
},
{
"docid": "6632be4a1a1eaa84710f9303c331d248",
"score": "0.5872085",
"text": "def rescued_error\n ErrorSound.play\n id = data_battler.id\n seq_key = phase_sequence[battle_phase].call\n phase = (dead? ? :dead : battle_phase)\n klass = data_battler.class\n result = \"Theolized SBS : \\n\"+\n \"Error occured on #{klass} in ID #{id}\\n\" +\n \"Undefined sequence key \\\"#{seq_key}\\\" for #{phase} phase\\n\\n\" +\n \"This is your fault. Not this script error!\"\n msgbox result\n exit\n end",
"title": ""
},
{
"docid": "1c4519da49afffecc537288ec0c75d89",
"score": "0.58708483",
"text": "def errback &block\n super\n end",
"title": ""
}
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.